2023-07-31 11:30:34 +08:00
|
|
|
package face
|
2023-07-28 18:12:50 +08:00
|
|
|
|
|
|
|
import "strings"
|
|
|
|
|
|
|
|
//设备模型基类
|
|
|
|
type DeviceModel struct {
|
|
|
|
//图形id,即由前端作图时生成,且全局唯一
|
|
|
|
GraphicId string
|
|
|
|
//索引编号,同类设备唯一,不同类设备不唯一
|
|
|
|
Index string
|
|
|
|
}
|
|
|
|
|
|
|
|
//判断是否同一个设备
|
|
|
|
func (dm *DeviceModel) IsSame(other *DeviceModel) bool {
|
|
|
|
return strings.EqualFold(dm.GraphicId, other.GraphicId)
|
|
|
|
}
|
|
|
|
|
2023-07-31 11:30:34 +08:00
|
|
|
//模型图形id
|
|
|
|
func (dm *DeviceModel) GetGraphicId() string {
|
|
|
|
return dm.GraphicId
|
|
|
|
}
|
|
|
|
|
|
|
|
//模型索引
|
|
|
|
func (dm *DeviceModel) GetIndex() string {
|
|
|
|
return dm.Index
|
|
|
|
}
|
|
|
|
|
2023-07-28 18:12:50 +08:00
|
|
|
//////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
//设备端口枚举定义
|
|
|
|
type PortEnum int8
|
|
|
|
|
|
|
|
//设备端口枚举值
|
|
|
|
const (
|
|
|
|
A PortEnum = iota
|
|
|
|
B
|
|
|
|
C
|
|
|
|
)
|