123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- package model
- import (
- "encoding/xml"
- "gorm.io/gorm"
- )
- type IntelligentBuildingControl struct {
- gorm.Model
- }
- func (m *IntelligentBuildingControl) TableName() string {
- return "intelligent_building_control"
- }
- // 点位表
- type Point struct {
- Id int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement;comment:点位ID"`
- FullPath string `json:"full_path" gorm:"column:full_path;type:varchar(255);comment:点位全路径"`
- DeviceType string `json:"device_type" gorm:"column:device_type;type:varchar(50);comment:设备类型"`
- Building string `json:"building" gorm:"column:building;type:varchar(50);comment:所属楼宇ID"`
- Floor string `json:"floor" gorm:"column:floor;type:varchar(50);comment:楼层"`
- Section string `json:"section" gorm:"column:section;type:varchar(50);comment:区域"`
- DeviceName string `json:"device_name" gorm:"column:device_name;type:varchar(100);comment:设备名称"`
- PointName string `json:"point_name" gorm:"column:point_name;type:varchar(100);comment:点位名称"`
- }
- // DeviceType 设备类型对应表
- var DeviceType = map[string]string{
- "JSK": "集水坑",
- "AHU": "空调机组",
- "PAU": "新风机组",
- "EAF": "送排风机",
- }
- type PointType struct {
- Type map[string]string `json:"type"`
- }
- // PointName 设备名称对应表
- var PointName = map[string]string{
- "TempS1": "送风温度", //
- "HumS1": "送风湿度", //
- "TempH1": "回风温度", //
- "TempX1": "新风温度", //
- "CO2": "回风二氧化碳", //
- "AHUSts1": "运行状态", //
- "AHUAlr1": "故障报警", //
- "AHUAorm1": "自动状态", //
- "FJDPS1": "风机压差", //
- "FDKG1": "防冻开关", //
- "Sorw1": "冬夏季模式", //
- "XFLev1": "新风阀反馈", //
- "HFLev1": "回风阀反馈", //
- "SFLev1": "水阀反馈",
- "GlwDPS1": "过滤网压差", //
- }
- // RealPoint TempS1 点位表
- type RealPoint struct {
- XMLName xml.Name `xml:"real"`
- Val string `xml:"val,attr"` // "28.355751037597656"
- Status string `xml:"status,attr"` // "down"
- Display string `xml:"display,attr"` // "28.36 °C {down}"
- Href string `xml:"href,attr"`
- Unit string `xml:"unit,attr"` // "obix:units/celsius"
- }
- // PointType 设备类型表
- type BooleanPoint struct {
- XMLName xml.Name `xml:"bool"`
- Val string `xml:"val,attr"`
- Status string `xml:"status,attr"`
- Display string `xml:"display,attr"`
- Href string `xml:"href,attr"`
- Is string `xml:"is,attr"`
- }
- // NumericPoint TempS1
- type NumericPoint struct {
- Val float64 `xml:"val,attr"`
- Href string `xml:"href,attr,omitempty"`
- Is string `xml:"is,attr,omitempty"`
- Display string `xml:"display,attr,omitempty"`
- Icon string `xml:"icon,attr,omitempty"`
- Unit string `xml:"unit,attr,omitempty"`
- Facets *Facets `xml:"str"`
- ProxyExt *ProxyExt `xml:"ref"`
- Out *OutputValue `xml:"real[name=out]"`
- Tag *TagReference `xml:"ref[name=tag]"`
- }
- type Facets struct {
- Name string `xml:"name,attr"`
- Val string `xml:"val,attr"`
- Href string `xml:"href,attr,omitempty"`
- Display string `xml:"display,attr,omitempty"`
- DisplayName string `xml:"displayName,attr,omitempty"`
- }
- type ProxyExt struct {
- Name string `xml:"name,attr"`
- Href string `xml:"href,attr,omitempty"`
- Is string `xml:"is,attr,omitempty"`
- Display string `xml:"display,attr,omitempty"`
- DisplayName string `xml:"displayName,attr,omitempty"`
- Icon string `xml:"icon,attr,omitempty"`
- }
- type OutputValue struct {
- Name string `xml:"name,attr"`
- Val float64 `xml:"val,attr"`
- Href string `xml:"href,attr,omitempty"`
- Is string `xml:"is,attr,omitempty"`
- Display string `xml:"display,attr,omitempty"`
- DisplayName string `xml:"displayName,attr,omitempty"`
- Icon string `xml:"icon,attr,omitempty"`
- Unit string `xml:"unit,attr,omitempty"`
- }
- type TagReference struct {
- Name string `xml:"name,attr"`
- Href string `xml:"href,attr,omitempty"`
- Is string `xml:"is,attr,omitempty"`
- Display string `xml:"display,attr,omitempty"`
- Icon string `xml:"icon,attr,omitempty"`
- }
- //TempS1 end
- func (p *Point) TableName() string {
- return "point"
- }
|