diff --git a/component/iscs_bas.go b/component/iscs_bas.go deleted file mode 100644 index 789c1d8..0000000 --- a/component/iscs_bas.go +++ /dev/null @@ -1,11 +0,0 @@ -package component - -// ExhaustPavilion 排风亭 -type ExhaustPavilion struct { - Normal bool //true-正常 -} - -// AirSupplyPavilion 送风亭 -type AirSupplyPavilion struct { - Normal bool //true-正常 -} diff --git a/component/iscs_bas_air_conditioner.go b/component/iscs_bas_air_conditioner.go new file mode 100644 index 0000000..542e644 --- /dev/null +++ b/component/iscs_bas_air_conditioner.go @@ -0,0 +1,17 @@ +package component + +import "joylink.club/ecs" + +// AirConditioning 空调 +type AirConditioning struct { + Running bool //true-运行正常;false-停止 + +} + +var ( + AirConditioningType = ecs.NewComponentType[AirConditioning]() //空调 + + CombinationAirConditionerTag = ecs.NewTag() //组合式空调 + AirConditioningGroupTag = ecs.NewTag() //空调群控系统 + AirConditionerTag = ecs.NewTag() //空调器 +) diff --git a/component/iscs_bas_air_pavilion.go b/component/iscs_bas_air_pavilion.go new file mode 100644 index 0000000..dbd89f7 --- /dev/null +++ b/component/iscs_bas_air_pavilion.go @@ -0,0 +1,14 @@ +package component + +import "joylink.club/ecs" + +// AirPavilion 风亭(排风亭、送风亭) +type AirPavilion struct { + Normal bool //true-正常 +} + +var ( + AirPavilionType = ecs.NewComponentType[AirPavilion]() //风亭 + ExhaustPavilionTag = ecs.NewTag() //排风亭 + AirSupplyPavilionTag = ecs.NewTag() //送风亭 +) diff --git a/component/iscs_bas_fan.go b/component/iscs_bas_fan.go index fad96c8..284abf1 100644 --- a/component/iscs_bas_fan.go +++ b/component/iscs_bas_fan.go @@ -1,48 +1,43 @@ package component -import ( - "joylink.club/ecs" -) +import "joylink.club/ecs" -//环境与设备监控系统BAS 相关组件定义 - -// Fan 风机设备 +// FanDevice 风机设备 // 正转即顺时针转-排风;反转即逆时针转-进风 -type Fan struct { - Fc bool //true-变频器开启 - Bypass bool //true-旁路开启 - SoftStart bool //true-软启开启 - Power int //风机电源,大于0接通正转相序电源,小于0接通反转相序电源,等于0关闭电源 +type FanDevice struct { + Speed uint16 //风机转速,r/min + Forward bool //true-正转;false-反转 } -// FanState 面向用户的风机状态 -// 具体异常-故障、报警、异常、通信中断 -type FanState struct { - Forward bool //true-正转;false-反转 - Running bool //true-运行;false-停止 - Fc bool //true-变频器开启 - Bypass bool //true-旁路开启 - SoftStart bool //true-软启开启 - HighSpeed bool //true-双速风机之扇叶高速运转 - SlowSpeed bool //true-双速风机之扇叶低速运转 +// FanFcUnit 风机变频器 +type FanFcUnit struct { + Fc bool //true-变频器已开启 } -// AirConditionerGroup 空调群控系统 -// 具体异常-故障、异常、通信中断 -type AirConditionerGroup struct { - Acs []*ecs.Entry //空调群 - GroupRunning bool //true-空调群中所有空调正常运行 +// FanBypassUnit 风机旁路装置 +type FanBypassUnit struct { + Bypass bool //true-风机旁路已开启 +} + +// FanSoftStartUnit 风机软启装置 +type FanSoftStartUnit struct { + SoftStart bool //true-风机软启已开启 +} + +// FanHighLowSpeedMode 风机双速模式控制 +type FanHighLowSpeedMode struct { + HighMode bool //true-风机高速模式;false-风机低速模式 } var ( - FanType = ecs.NewComponentType[Fan]() //风机 - FanStateType = ecs.NewComponentType[FanState]() - - TwoSpeedFanTag = ecs.NewTag() //双速风机标签 - LowSpeedModeFanTag = ecs.NewTag() //双速风机低速运行模式标签 - HighSpeedModeFanTag = ecs.NewTag() //双速风机高速运行模式标签 - - AirConditionerTag = ecs.NewTag() //空调、空调器 - CombinedAirConditionerTag = ecs.NewTag() //组合式空调 + FanDeviceType = ecs.NewComponentType[FanDevice]() //风机设备 + FanFcUnitType = ecs.NewComponentType[FanFcUnit]() //风机变频装置 + FanBypassUnitType = ecs.NewComponentType[FanBypassUnit]() //风机旁路装置 + FanSoftStartUnitType = ecs.NewComponentType[FanSoftStartUnit]() //风机软启装置 + FanHighLowSpeedModeType = ecs.NewComponentType[FanHighLowSpeedMode]() //风机双速模式控制 + CommonFanTag = ecs.NewTag() + FcBypassFanTag = ecs.NewTag() + SoftStartFanTag = ecs.NewTag() + HighLowSpeedFanTag = ecs.NewTag() ) diff --git a/component/iscs_bas_gas_environment.go b/component/iscs_bas_gas_environment.go new file mode 100644 index 0000000..a7d3e0f --- /dev/null +++ b/component/iscs_bas_gas_environment.go @@ -0,0 +1,11 @@ +package component + +import "joylink.club/ecs" + +// GasEnvironment 气体环境 +type GasEnvironment struct { +} + +var ( + GasEnvironmentType = ecs.NewComponentType[GasEnvironment]() //气体环境 +) diff --git a/component/iscs_bas_gas_mixing_chamber.go b/component/iscs_bas_gas_mixing_chamber.go new file mode 100644 index 0000000..1cf69b5 --- /dev/null +++ b/component/iscs_bas_gas_mixing_chamber.go @@ -0,0 +1,11 @@ +package component + +import "joylink.club/ecs" + +// GasMixingChamber 混合室静压箱 +type GasMixingChamber struct { +} + +var ( + GasMixingChamberType = ecs.NewComponentType[GasMixingChamber]() +) diff --git a/component/iscs_bas_purification.go b/component/iscs_bas_purification.go index 5525f4a..09dccd9 100644 --- a/component/iscs_bas_purification.go +++ b/component/iscs_bas_purification.go @@ -14,5 +14,5 @@ type PurificationDevice struct { const PurificationDeviceStartTime int = 3000 //净化装置启动耗时,ms var ( - PurificationDeviceType = ecs.NewComponentType[PurificationDevice]() + PurificationDeviceType = ecs.NewComponentType[PurificationDevice]() //净化装置 ) diff --git a/component/iscs_bas_valve.go b/component/iscs_bas_valve.go index 9ed91cf..432d31d 100644 --- a/component/iscs_bas_valve.go +++ b/component/iscs_bas_valve.go @@ -4,35 +4,18 @@ import ( "joylink.club/ecs" ) -// 阀门开关 - -// ElectricControlValve 电动调节阀 -// 具体异常 -// -// 电动风阀、电动调节阀、组合式风阀、电动两通调节阀、电动蝶阀 -type ElectricControlValve struct { - Opened bool //true-开到位 - Closed bool //true-关到位 +// Valve 阀门开关(电动调节阀、电动风阀、组合式风阀、电动蝶阀) +type Valve struct { + Opened bool //true-开到位(全开) + Closed bool //true-关到位(全关) Moving bool //true-正在动作 - OpenRate uint8 //开度 -} - -// ElectricControlValveOperationTime 电动调节阀动作耗时,ms -const ElectricControlValveOperationTime int = 4000 - -// ControlValve 调节阀(手动) -type ControlValve struct { OpenRate uint8 //开度,0-100% } var ( - ElectricControlValveType = ecs.NewComponentType[ElectricControlValve]() - - ElectricAirValveTag = ecs.NewTag() //电动风阀标签 - CombinationAirValveTag = ecs.NewTag() //组合式风阀 - ElectricTwoWayValveTag = ecs.NewTag() //电动两通调节阀 - ElectricButterflyValveTag = ecs.NewTag() //电动蝶阀 - - ControlValveType = ecs.NewComponentType[ControlValve]() - BypassValveSwitchTag = ecs.NewTag() //旁通阀开关(ControlValve) + ValveType = ecs.NewComponentType[Valve]() //阀门(开关) + ElectricControlValveTag = ecs.NewTag() //电动调节阀 + ElectricAirValveTag = ecs.NewTag() //电动风阀标签 + CombinationAirValveTag = ecs.NewTag() //组合式风阀 + ElectricButterflyValveTag = ecs.NewTag() //电动蝶阀 ) diff --git a/entity/iscs_bas.go b/entity/iscs_bas.go index b1e4e18..4d7cf48 100644 --- a/entity/iscs_bas.go +++ b/entity/iscs_bas.go @@ -3,338 +3,15 @@ package entity import ( "joylink.club/ecs" "joylink.club/rtsssimulation/component" + "joylink.club/rtsssimulation/repository/model/proto" ) -// NewIscsFanEntity 创建风机实体 -func NewIscsFanEntity(w ecs.World, id string) *ecs.Entry { +// NewWireCabinetEntity 创建线柜实体 +func NewWireCabinetEntity(w ecs.World, id string) *ecs.Entry { wd := GetWorldData(w) e, ok := wd.EntityMap[id] if !ok { - e := w.Entry(w.Create(component.UidType, component.FanType, component.FanStateType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewIscsTwoSpeedFanEntity 创建双速风机实体 -func NewIscsTwoSpeedFanEntity(w ecs.World, id string) *ecs.Entry { - entry := NewIscsFanEntity(w, id) - entry.AddComponent(component.TwoSpeedFanTag) - return entry -} - -// NewAirConditionerEntity 创建空调实体/空调器实体 -// -// fc-true变频空调; -func NewAirConditionerEntity(w ecs.World, id string, fc bool) *ecs.Entry { - entry := NewIscsFanEntity(w, id) - entry.HasComponent(component.AirConditionerTag) - component.FanType.Get(entry).Fc = fc - return entry -} - -// NewCombinedAirConditionerEntity 组合式空调(变频空调) -func NewCombinedAirConditionerEntity(w ecs.World, id string) *ecs.Entry { - entry := NewAirConditionerEntity(w, id, true) - entry.AddComponent(component.CombinedAirConditionerTag) - return entry -} - -// NewElectricControlValveEntity 创建电动调节阀实体 -func NewElectricControlValveEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.ElectricControlValveType, component.TwoPositionTransformType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewElectricAirValveEntity 创建电动风阀实体 -func NewElectricAirValveEntity(w ecs.World, id string) *ecs.Entry { - entry := NewElectricControlValveEntity(w, id) - entry.AddComponent(component.ElectricAirValveTag) - return entry -} - -// NewCombinationAirValveEntity 创建组合式风阀 -func NewCombinationAirValveEntity(w ecs.World, id string) *ecs.Entry { - entry := NewElectricControlValveEntity(w, id) - entry.AddComponent(component.CombinationAirValveTag) - return entry -} - -// NewElectricTwoWayValveEntity 创建电动两通调节阀实体 -func NewElectricTwoWayValveEntity(w ecs.World, id string) *ecs.Entry { - entry := NewElectricControlValveEntity(w, id) - entry.AddComponent(component.ElectricTwoWayValveTag) - return entry -} - -// NewElectricButterflyValveEntity 创建电动蝶阀实体 -func NewElectricButterflyValveEntity(w ecs.World, id string) *ecs.Entry { - entry := NewElectricControlValveEntity(w, id) - entry.AddComponent(component.ElectricButterflyValveTag) - return entry -} - -// NewPurificationDeviceEntity 创建净化装置实体 -func NewPurificationDeviceEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.PurificationDeviceType, component.CounterType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewElevatorDeviceEntity 创建垂直电梯实体 -func NewElevatorDeviceEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.ElevatorType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewEscalatorDeviceEntity 创建自动扶梯实体 -func NewEscalatorDeviceEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.EscalatorType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewChillerUnitEntity 创建冷水机组实体 -func NewChillerUnitEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.ChillerUnitType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewWaterPumpEntity 创建水泵实体 -func NewWaterPumpEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.WaterPumpType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewFloatBallWaterPumpEntity 创建浮球型水泵 -func NewFloatBallWaterPumpEntity(w ecs.World, id string) *ecs.Entry { - entry := NewWaterPumpEntity(w, id) - entry.AddComponent(component.FloatBallSwitchType) - return entry -} - -// NewWaterTankEntity 创建水池或水箱实体 -func NewWaterTankEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.WaterTankType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewWaterClosedContainerEntity 创建封闭式水容器,如冷却塔、水处理器 -func NewWaterClosedContainerEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.WaterClosedContainerType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewCoolingTowerEntity 创建冷却塔实体 -func NewCoolingTowerEntity(w ecs.World, id string) *ecs.Entry { - entry := NewWaterClosedContainerEntity(w, id) - entry.AddComponent(component.CoolingTowerTag) - return entry -} - -// NewWaterProcessorEntity 创建水处理器实体 -func NewWaterProcessorEntity(w ecs.World, id string) *ecs.Entry { - entry := NewWaterClosedContainerEntity(w, id) - entry.AddComponent(component.WaterProcessorTag) - return entry -} - -// NewBypassValveSwitchEntity 创建旁通阀开关实体 -func NewBypassValveSwitchEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.ControlValveType, component.BypassValveSwitchTag)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewSensorEntity 创建传感器实体 -func NewSensorEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.SensorType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewThSensorEntity 创建温湿度传感器实体 -func NewThSensorEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.ThSensorType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewCO2SensorEntity CO2 传感器 -func NewCO2SensorEntity(w ecs.World, id string) *ecs.Entry { - entry := NewSensorEntity(w, id) - entry.AddComponent(component.CO2SensorTag) - return entry -} - -// NewWaterTSensorEntity 水温传感器 -func NewWaterTSensorEntity(w ecs.World, id string) *ecs.Entry { - entry := NewSensorEntity(w, id) - entry.AddComponent(component.WaterTSensorTag) - return entry -} - -// NewPressureSensorEntity 压力传感器 -func NewPressureSensorEntity(w ecs.World, id string) *ecs.Entry { - entry := NewSensorEntity(w, id) - entry.AddComponent(component.PressureSensorTag) - return entry -} - -// NewFlowSensorEntity 流量传感器 -func NewFlowSensorEntity(w ecs.World, id string) *ecs.Entry { - entry := NewSensorEntity(w, id) - entry.AddComponent(component.FlowSensorTag) - return entry -} - -// NewTemperatureSensorEntity 温度传感器 -func NewTemperatureSensorEntity(w ecs.World, id string) *ecs.Entry { - entry := NewSensorEntity(w, id) - entry.AddComponent(component.TemperatureSensorTag) - return entry -} - -// NewLightingGuidanceEntity 创建照明导向实体 -func NewLightingGuidanceEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.LightingGuidanceType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewPowerSwitchGuidanceEntity 创建电源开关导向实体 -func NewPowerSwitchGuidanceEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.PowerSwitchGuidanceType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewEscalatorGuidanceEntity 创建扶梯导向实体 -func NewEscalatorGuidanceEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.EscalatorGuidanceType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewTicketGateGuidanceEntity 创建闸机导向实体 -func NewTicketGateGuidanceEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.TicketGateGuidanceType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewSectionEvacuationGuidanceEntity 创建区间疏散导向实体 -func NewSectionEvacuationGuidanceEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.SectionEvacuationGuidanceType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewCivilDefenseDoorEntity 创建人防门实体 -func NewCivilDefenseDoorEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.CivilDefenseDoorType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - -// NewPlcControllerEntity 创建PLC控制器实体 -func NewPlcControllerEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.PlcControllerType)) + e := w.Entry(w.Create(component.UidType, component.WireCabinetType, component.DeviceExceptionType)) component.UidType.SetValue(e, component.Uid{Id: id}) wd.EntityMap[id] = e } @@ -354,12 +31,85 @@ func NewNetworkSwitchEntity(w ecs.World, id string) *ecs.Entry { return e } -// NewEmergencyLightingEntity 创建应急照明实体 -func NewEmergencyLightingEntity(w ecs.World, id string) *ecs.Entry { +// NewAirPavilionEntity 创建风亭实体 +func NewAirPavilionEntity(w ecs.World, id string, apType proto.AirPavilion_Type) *ecs.Entry { wd := GetWorldData(w) e, ok := wd.EntityMap[id] if !ok { - e := w.Entry(w.Create(component.UidType, component.EmergencyLightingType)) + e := w.Entry(w.Create(component.UidType, component.AirPavilionType)) + // + switch apType { + case proto.AirPavilion_ExhaustPavilion: + e.AddComponent(component.ExhaustPavilionTag) + case proto.AirPavilion_AirSupplyPavilion: + e.AddComponent(component.AirSupplyPavilionTag) + } + // + component.UidType.SetValue(e, component.Uid{Id: id}) + component.AirPavilionType.Set(e, &component.AirPavilion{Normal: true}) + wd.EntityMap[id] = e + } + return e +} + +// NewValveEntity 创建阀门实体 +func NewValveEntity(w ecs.World, id string, valveType proto.Valve_Type) *ecs.Entry { + wd := GetWorldData(w) + e, ok := wd.EntityMap[id] + if !ok { + e := w.Entry(w.Create(component.UidType, component.ValveType, component.DeviceExceptionType)) + component.UidType.SetValue(e, component.Uid{Id: id}) + component.ValveType.Set(e, &component.Valve{OpenRate: 100, Closed: false, Opened: true, Moving: false}) + // + switch valveType { + case proto.Valve_ElectricControlValve: + e.AddComponent(component.ElectricControlValveTag) + case proto.Valve_ElectricAirValve: + e.AddComponent(component.ElectricAirValveTag) + case proto.Valve_CombinationAirValve: + e.AddComponent(component.CombinationAirValveTag) + case proto.Valve_ElectricButterflyValve: + e.AddComponent(component.ElectricButterflyValveTag) + } + // + wd.EntityMap[id] = e + } + return e +} + +// NewGasMixingChamberEntity 创建混合室静压箱实体 +func NewGasMixingChamberEntity(w ecs.World, id string) *ecs.Entry { + wd := GetWorldData(w) + e, ok := wd.EntityMap[id] + if !ok { + e := w.Entry(w.Create(component.UidType, component.GasMixingChamberType)) + component.UidType.SetValue(e, component.Uid{Id: id}) + wd.EntityMap[id] = e + } + return e +} + +// NewCombinationAirConditionerEntity 创建组合式空调实体 +func NewCombinationAirConditionerEntity(w ecs.World, id string) *ecs.Entry { + return newAirConditioningEntity(w, id, component.CombinationAirConditionerTag) +} +func newAirConditioningEntity(w ecs.World, id string, tag *ecs.ComponentType[struct{}]) *ecs.Entry { + wd := GetWorldData(w) + e, ok := wd.EntityMap[id] + if !ok { + e := w.Entry(w.Create(component.UidType, component.AirConditioningType, component.DeviceExceptionType, tag)) + component.UidType.SetValue(e, component.Uid{Id: id}) + wd.EntityMap[id] = e + } + return e +} + +// NewPurificationDeviceEntity 创建净化装置实体 +func NewPurificationDeviceEntity(w ecs.World, id string) *ecs.Entry { + wd := GetWorldData(w) + e, ok := wd.EntityMap[id] + if !ok { + e := w.Entry(w.Create(component.UidType, component.PurificationDeviceType, component.DeviceExceptionType)) component.UidType.SetValue(e, component.Uid{Id: id}) wd.EntityMap[id] = e } @@ -371,9 +121,57 @@ func NewAirCurtainEntity(w ecs.World, id string) *ecs.Entry { wd := GetWorldData(w) e, ok := wd.EntityMap[id] if !ok { - e := w.Entry(w.Create(component.UidType, component.AirCurtainType)) + e := w.Entry(w.Create(component.UidType, component.AirCurtainType, component.DeviceExceptionType)) component.UidType.SetValue(e, component.Uid{Id: id}) wd.EntityMap[id] = e } return e } + +// NewGasEnvironmentEntity 创建气体环境实体 +func NewGasEnvironmentEntity(w ecs.World, id string) *ecs.Entry { + wd := GetWorldData(w) + e, ok := wd.EntityMap[id] + if !ok { + e := w.Entry(w.Create(component.UidType, component.GasEnvironmentType)) + component.UidType.SetValue(e, component.Uid{Id: id}) + wd.EntityMap[id] = e + } + return e +} + +// NewFanEntity 创建风机实体 +func NewFanEntity(w ecs.World, id string, fanType proto.Fan_Type) *ecs.Entry { + wd := GetWorldData(w) + e, ok := wd.EntityMap[id] + if !ok { + e := w.Entry(w.Create(component.UidType, component.FanDeviceType, component.DeviceExceptionType)) + component.UidType.SetValue(e, component.Uid{Id: id}) + // + switch fanType { + case proto.Fan_CommonFan: + { + e.AddComponent(component.CommonFanTag) + } + case proto.Fan_FcBypassFan: + { + e.AddComponent(component.FanFcUnitType) + e.AddComponent(component.FanBypassUnitType) + e.AddComponent(component.FcBypassFanTag) + } + case proto.Fan_SoftStartFan: + { + e.AddComponent(component.FanSoftStartUnitType) + e.AddComponent(component.SoftStartFanTag) + } + case proto.Fan_HighLowSpeedFan: + { + e.AddComponent(component.FanHighLowSpeedModeType) + e.AddComponent(component.HighLowSpeedFanTag) + } + } + // + wd.EntityMap[id] = e + } + return e +} diff --git a/entity/iscs_load.go b/entity/iscs_load.go index 63b24e0..21f7982 100644 --- a/entity/iscs_load.go +++ b/entity/iscs_load.go @@ -59,6 +59,38 @@ func LoadIscs(w ecs.World) error { for _, wc := range data.Repo.WireCabinetMap { NewWireCabinetEntity(w, wc.Id()) } + //风亭(排风亭、送风亭) + for _, ap := range data.Repo.AirPavilionMap { + NewAirPavilionEntity(w, ap.Id(), ap.PavilionType) + } + //阀门 + for _, valve := range data.Repo.ValveMap { + NewValveEntity(w, valve.Id(), valve.ValveType) + } + //混合室静压箱 + for _, gmc := range data.Repo.GasMixingChamberMap { + NewGasMixingChamberEntity(w, gmc.Id()) + } + //组合式空调 + for _, cac := range data.Repo.CombinationAirConditionerMap { + NewCombinationAirConditionerEntity(w, cac.Id()) + } + //净化装置 + for _, apd := range data.Repo.AirPurificationDeviceMap { + NewPurificationDeviceEntity(w, apd.Id()) + } + //空气幕 + for _, ac := range data.Repo.AirCurtainMap { + NewAirCurtainEntity(w, ac.Id()) + } + //气体环境 + for _, gasEnv := range data.Repo.GasEnvironmentMap { + NewGasEnvironmentEntity(w, gasEnv.Id()) + } + //风机 + for _, fan := range data.Repo.FanMap { + NewFanEntity(w, fan.Id(), fan.FanType) + } // return nil } diff --git a/entity/iscs_pscada.go b/entity/iscs_pscada.go index 9f52253..3fa821b 100644 --- a/entity/iscs_pscada.go +++ b/entity/iscs_pscada.go @@ -69,18 +69,6 @@ func NewDisconnectorEntity(w ecs.World, id string) *ecs.Entry { return e } -// NewWireCabinetEntity 创建线柜实体 -func NewWireCabinetEntity(w ecs.World, id string) *ecs.Entry { - wd := GetWorldData(w) - e, ok := wd.EntityMap[id] - if !ok { - e := w.Entry(w.Create(component.UidType, component.WireCabinetType, component.DeviceExceptionType)) - component.UidType.SetValue(e, component.Uid{Id: id}) - wd.EntityMap[id] = e - } - return e -} - // NewLightningArresterEntity 创建避雷器实体 func NewLightningArresterEntity(w ecs.World, id string) *ecs.Entry { wd := GetWorldData(w) diff --git a/proto/src/model.proto b/proto/src/model.proto index 0b74b30..22608b2 100644 --- a/proto/src/model.proto +++ b/proto/src/model.proto @@ -665,6 +665,7 @@ message WireCabinet{ message AirPavilion{ string id = 1; string code = 2; + //风亭子类型 enum Type{ ExhaustPavilion = 0;//排风亭 AirSupplyPavilion = 1;//送风亭 @@ -676,9 +677,12 @@ message AirPavilion{ message Valve{ string id = 1; string code = 2; + //阀门子类型 enum Type{ ElectricControlValve = 0;//电动调节阀 ElectricAirValve = 1;//电动风阀 + CombinationAirValve = 2;//组合式风阀 + ElectricButterflyValve = 3;//电动蝶阀 } Type valveType = 3;//阀门子类型 } @@ -716,6 +720,14 @@ message AirCurtain{ message Fan{ string id = 1; string code = 2; + //风机子类型 + enum Type{ + CommonFan = 0;//一般风机(普通风机、硬线风机、射流风机、排烟风机、正压送风机) + FcBypassFan = 1;//变频旁路风机(回排风机) + SoftStartFan = 2;//软启风机(软启风机、隧道风机) + HighLowSpeedFan = 3;//双速风机 + } + Type fanType = 3;//风机子类型 } //气体环境(正常空气+有害烟雾) diff --git a/repository/iscs_bas_dxt.go b/repository/iscs_bas_dxt.go index 22406b9..a577661 100644 --- a/repository/iscs_bas_dxt.go +++ b/repository/iscs_bas_dxt.go @@ -208,15 +208,17 @@ func NewAirCurtain(id string, code string) *AirCurtain { // Fan 风机 type Fan struct { Identity - Code string - PortA DevicePort //A端口连接的设备 - PortB DevicePort //B端口连接的设备 + Code string + FanType proto.Fan_Type + PortA DevicePort //A端口连接的设备 + PortB DevicePort //B端口连接的设备 } -func NewFan(id string, code string) *Fan { +func NewFan(id string, code string, fanType proto.Fan_Type) *Fan { return &Fan{ Identity: &identity{id: id, deviceType: proto.DeviceType_DeviceType_Fan}, Code: code, + FanType: fanType, } } func (p *Fan) PortNum() int { diff --git a/repository/model/proto/model.pb.go b/repository/model/proto/model.pb.go index 659c838..d8b10f0 100644 --- a/repository/model/proto/model.pb.go +++ b/repository/model/proto/model.pb.go @@ -962,6 +962,7 @@ func (Pipe_Type) EnumDescriptor() ([]byte, []int) { return file_model_proto_rawDescGZIP(), []int{32, 0} } +// 风亭子类型 type AirPavilion_Type int32 const ( @@ -1008,11 +1009,14 @@ func (AirPavilion_Type) EnumDescriptor() ([]byte, []int) { return file_model_proto_rawDescGZIP(), []int{45, 0} } +// 阀门子类型 type Valve_Type int32 const ( - Valve_ElectricControlValve Valve_Type = 0 //电动调节阀 - Valve_ElectricAirValve Valve_Type = 1 //电动风阀 + Valve_ElectricControlValve Valve_Type = 0 //电动调节阀 + Valve_ElectricAirValve Valve_Type = 1 //电动风阀 + Valve_CombinationAirValve Valve_Type = 2 //组合式风阀 + Valve_ElectricButterflyValve Valve_Type = 3 //电动蝶阀 ) // Enum value maps for Valve_Type. @@ -1020,10 +1024,14 @@ var ( Valve_Type_name = map[int32]string{ 0: "ElectricControlValve", 1: "ElectricAirValve", + 2: "CombinationAirValve", + 3: "ElectricButterflyValve", } Valve_Type_value = map[string]int32{ - "ElectricControlValve": 0, - "ElectricAirValve": 1, + "ElectricControlValve": 0, + "ElectricAirValve": 1, + "CombinationAirValve": 2, + "ElectricButterflyValve": 3, } ) @@ -1054,6 +1062,59 @@ func (Valve_Type) EnumDescriptor() ([]byte, []int) { return file_model_proto_rawDescGZIP(), []int{46, 0} } +// 风机子类型 +type Fan_Type int32 + +const ( + Fan_CommonFan Fan_Type = 0 //一般风机(普通风机、硬线风机、射流风机、排烟风机、正压送风机) + Fan_FcBypassFan Fan_Type = 1 //变频旁路风机(回排风机) + Fan_SoftStartFan Fan_Type = 2 //软启风机(软启风机、隧道风机) + Fan_HighLowSpeedFan Fan_Type = 3 //双速风机 +) + +// Enum value maps for Fan_Type. +var ( + Fan_Type_name = map[int32]string{ + 0: "CommonFan", + 1: "FcBypassFan", + 2: "SoftStartFan", + 3: "HighLowSpeedFan", + } + Fan_Type_value = map[string]int32{ + "CommonFan": 0, + "FcBypassFan": 1, + "SoftStartFan": 2, + "HighLowSpeedFan": 3, + } +) + +func (x Fan_Type) Enum() *Fan_Type { + p := new(Fan_Type) + *p = x + return p +} + +func (x Fan_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Fan_Type) Descriptor() protoreflect.EnumDescriptor { + return file_model_proto_enumTypes[13].Descriptor() +} + +func (Fan_Type) Type() protoreflect.EnumType { + return &file_model_proto_enumTypes[13] +} + +func (x Fan_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Fan_Type.Descriptor instead. +func (Fan_Type) EnumDescriptor() ([]byte, []int) { + return file_model_proto_rawDescGZIP(), []int{51, 0} +} + type Repository struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4809,8 +4870,9 @@ type Fan struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` + FanType Fan_Type `protobuf:"varint,3,opt,name=fanType,proto3,enum=model.Fan_Type" json:"fanType,omitempty"` //风机子类型 } func (x *Fan) Reset() { @@ -4859,6 +4921,13 @@ func (x *Fan) GetCode() string { return "" } +func (x *Fan) GetFanType() Fan_Type { + if x != nil { + return x.FanType + } + return Fan_CommonFan +} + // 气体环境(正常空气+有害烟雾) // 有多个输入口,统一为端口A,用来为环境补充新鲜空气; // 有多个输出口,统一为端口B,用户将环境的混浊气体排除; @@ -5463,34 +5532,45 @@ var file_model_proto_rawDesc = []byte{ 0x69, 0x6c, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x32, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x78, 0x68, 0x61, 0x75, 0x73, 0x74, 0x50, 0x61, 0x76, 0x69, 0x6c, 0x69, 0x6f, 0x6e, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x41, 0x69, 0x72, 0x53, 0x75, 0x70, - 0x70, 0x6c, 0x79, 0x50, 0x61, 0x76, 0x69, 0x6c, 0x69, 0x6f, 0x6e, 0x10, 0x01, 0x22, 0x94, 0x01, + 0x70, 0x6c, 0x79, 0x50, 0x61, 0x76, 0x69, 0x6c, 0x69, 0x6f, 0x6e, 0x10, 0x01, 0x22, 0xc9, 0x01, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x76, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x76, 0x65, 0x2e, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x36, 0x0a, 0x04, + 0x65, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x6b, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x76, 0x65, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x69, 0x63, 0x41, 0x69, 0x72, 0x56, 0x61, 0x6c, - 0x76, 0x65, 0x10, 0x01, 0x22, 0x36, 0x0a, 0x10, 0x47, 0x61, 0x73, 0x4d, 0x69, 0x78, 0x69, 0x6e, - 0x67, 0x43, 0x68, 0x61, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3f, 0x0a, 0x19, - 0x43, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x69, 0x72, 0x43, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x76, 0x65, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x41, 0x69, 0x72, 0x56, 0x61, 0x6c, 0x76, 0x65, 0x10, 0x02, 0x12, 0x1a, 0x0a, + 0x16, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x69, 0x63, 0x42, 0x75, 0x74, 0x74, 0x65, 0x72, 0x66, + 0x6c, 0x79, 0x56, 0x61, 0x6c, 0x76, 0x65, 0x10, 0x03, 0x22, 0x36, 0x0a, 0x10, 0x47, 0x61, 0x73, + 0x4d, 0x69, 0x78, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x22, 0x3f, 0x0a, 0x19, 0x43, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x41, 0x69, 0x72, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x22, 0x3b, 0x0a, 0x15, 0x41, 0x69, 0x72, 0x50, 0x75, 0x72, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, + 0x30, 0x0a, 0x0a, 0x41, 0x69, 0x72, 0x43, 0x75, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x22, 0xa3, 0x01, 0x0a, 0x03, 0x46, 0x61, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3b, 0x0a, - 0x15, 0x41, 0x69, 0x72, 0x50, 0x75, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x30, 0x0a, 0x0a, 0x41, 0x69, - 0x72, 0x43, 0x75, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x29, 0x0a, 0x03, - 0x46, 0x61, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x34, 0x0a, 0x0e, 0x47, 0x61, 0x73, 0x45, 0x6e, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x29, 0x0a, + 0x07, 0x66, 0x61, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, + 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x46, 0x61, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x07, 0x66, 0x61, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x4d, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x46, 0x61, 0x6e, 0x10, 0x00, 0x12, + 0x0f, 0x0a, 0x0b, 0x46, 0x63, 0x42, 0x79, 0x70, 0x61, 0x73, 0x73, 0x46, 0x61, 0x6e, 0x10, 0x01, + 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x6f, 0x66, 0x74, 0x53, 0x74, 0x61, 0x72, 0x74, 0x46, 0x61, 0x6e, + 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x48, 0x69, 0x67, 0x68, 0x4c, 0x6f, 0x77, 0x53, 0x70, 0x65, + 0x65, 0x64, 0x46, 0x61, 0x6e, 0x10, 0x03, 0x22, 0x34, 0x0a, 0x0e, 0x47, 0x61, 0x73, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0xee, 0x15, @@ -5695,7 +5775,7 @@ func file_model_proto_rawDescGZIP() []byte { return file_model_proto_rawDescData } -var file_model_proto_enumTypes = make([]protoimpl.EnumInfo, 13) +var file_model_proto_enumTypes = make([]protoimpl.EnumInfo, 14) var file_model_proto_msgTypes = make([]protoimpl.MessageInfo, 53) var file_model_proto_goTypes = []interface{}{ (DeviceType)(0), // 0: model.DeviceType @@ -5711,159 +5791,161 @@ var file_model_proto_goTypes = []interface{}{ (Pipe_Type)(0), // 10: model.Pipe.Type (AirPavilion_Type)(0), // 11: model.AirPavilion.Type (Valve_Type)(0), // 12: model.Valve.Type - (*Repository)(nil), // 13: model.Repository - (*SignalLayout)(nil), // 14: model.SignalLayout - (*PhysicalSection)(nil), // 15: model.PhysicalSection - (*CheckPoint)(nil), // 16: model.CheckPoint - (*Turnout)(nil), // 17: model.Turnout - (*Signal)(nil), // 18: model.Signal - (*Psd)(nil), // 19: model.Psd - (*Transponder)(nil), // 20: model.Transponder - (*Slope)(nil), // 21: model.Slope - (*SectionalCurvature)(nil), // 22: model.SectionalCurvature - (*DevicePort)(nil), // 23: model.DevicePort - (*Kilometer)(nil), // 24: model.Kilometer - (*KilometerConvert)(nil), // 25: model.KilometerConvert - (*Relay)(nil), // 26: model.Relay - (*PhaseFailureProtector)(nil), // 27: model.PhaseFailureProtector - (*ElectronicComponentGroup)(nil), // 28: model.ElectronicComponentGroup - (*Button)(nil), // 29: model.Button - (*Light)(nil), // 30: model.Light - (*Alarm)(nil), // 31: model.Alarm - (*Station)(nil), // 32: model.Station - (*DeviceEcc)(nil), // 33: model.DeviceEcc - (*ElectronicGroup)(nil), // 34: model.ElectronicGroup - (*ElectronicComponent)(nil), // 35: model.ElectronicComponent - (*Mkx)(nil), // 36: model.Mkx - (*Platform)(nil), // 37: model.Platform - (*Key)(nil), // 38: model.Key - (*CentralizedStationRef)(nil), // 39: model.CentralizedStationRef - (*CjData)(nil), // 40: model.CjData - (*CjDataItem)(nil), // 41: model.CjDataItem - (*QdData)(nil), // 42: model.QdData - (*AsdGroup)(nil), // 43: model.AsdGroup - (*CiSectionCodePoint)(nil), // 44: model.CiSectionCodePoint - (*Pipe)(nil), // 45: model.Pipe - (*PipeFitting)(nil), // 46: model.PipeFitting - (*CircuitBreaker)(nil), // 47: model.CircuitBreaker - (*ThreePositionSwitch)(nil), // 48: model.ThreePositionSwitch - (*HandcartSwitch)(nil), // 49: model.HandcartSwitch - (*Rectifier)(nil), // 50: model.Rectifier - (*Disconnector)(nil), // 51: model.Disconnector - (*VoltageTransformer)(nil), // 52: model.VoltageTransformer - (*PowerSource)(nil), // 53: model.PowerSource - (*LightningArrester)(nil), // 54: model.LightningArrester - (*EarthingDevice)(nil), // 55: model.EarthingDevice - (*NetworkSwitch)(nil), // 56: model.NetworkSwitch - (*WireCabinet)(nil), // 57: model.WireCabinet - (*AirPavilion)(nil), // 58: model.AirPavilion - (*Valve)(nil), // 59: model.Valve - (*GasMixingChamber)(nil), // 60: model.GasMixingChamber - (*CombinationAirConditioner)(nil), // 61: model.CombinationAirConditioner - (*AirPurificationDevice)(nil), // 62: model.AirPurificationDevice - (*AirCurtain)(nil), // 63: model.AirCurtain - (*Fan)(nil), // 64: model.Fan - (*GasEnvironment)(nil), // 65: model.GasEnvironment + (Fan_Type)(0), // 13: model.Fan.Type + (*Repository)(nil), // 14: model.Repository + (*SignalLayout)(nil), // 15: model.SignalLayout + (*PhysicalSection)(nil), // 16: model.PhysicalSection + (*CheckPoint)(nil), // 17: model.CheckPoint + (*Turnout)(nil), // 18: model.Turnout + (*Signal)(nil), // 19: model.Signal + (*Psd)(nil), // 20: model.Psd + (*Transponder)(nil), // 21: model.Transponder + (*Slope)(nil), // 22: model.Slope + (*SectionalCurvature)(nil), // 23: model.SectionalCurvature + (*DevicePort)(nil), // 24: model.DevicePort + (*Kilometer)(nil), // 25: model.Kilometer + (*KilometerConvert)(nil), // 26: model.KilometerConvert + (*Relay)(nil), // 27: model.Relay + (*PhaseFailureProtector)(nil), // 28: model.PhaseFailureProtector + (*ElectronicComponentGroup)(nil), // 29: model.ElectronicComponentGroup + (*Button)(nil), // 30: model.Button + (*Light)(nil), // 31: model.Light + (*Alarm)(nil), // 32: model.Alarm + (*Station)(nil), // 33: model.Station + (*DeviceEcc)(nil), // 34: model.DeviceEcc + (*ElectronicGroup)(nil), // 35: model.ElectronicGroup + (*ElectronicComponent)(nil), // 36: model.ElectronicComponent + (*Mkx)(nil), // 37: model.Mkx + (*Platform)(nil), // 38: model.Platform + (*Key)(nil), // 39: model.Key + (*CentralizedStationRef)(nil), // 40: model.CentralizedStationRef + (*CjData)(nil), // 41: model.CjData + (*CjDataItem)(nil), // 42: model.CjDataItem + (*QdData)(nil), // 43: model.QdData + (*AsdGroup)(nil), // 44: model.AsdGroup + (*CiSectionCodePoint)(nil), // 45: model.CiSectionCodePoint + (*Pipe)(nil), // 46: model.Pipe + (*PipeFitting)(nil), // 47: model.PipeFitting + (*CircuitBreaker)(nil), // 48: model.CircuitBreaker + (*ThreePositionSwitch)(nil), // 49: model.ThreePositionSwitch + (*HandcartSwitch)(nil), // 50: model.HandcartSwitch + (*Rectifier)(nil), // 51: model.Rectifier + (*Disconnector)(nil), // 52: model.Disconnector + (*VoltageTransformer)(nil), // 53: model.VoltageTransformer + (*PowerSource)(nil), // 54: model.PowerSource + (*LightningArrester)(nil), // 55: model.LightningArrester + (*EarthingDevice)(nil), // 56: model.EarthingDevice + (*NetworkSwitch)(nil), // 57: model.NetworkSwitch + (*WireCabinet)(nil), // 58: model.WireCabinet + (*AirPavilion)(nil), // 59: model.AirPavilion + (*Valve)(nil), // 60: model.Valve + (*GasMixingChamber)(nil), // 61: model.GasMixingChamber + (*CombinationAirConditioner)(nil), // 62: model.CombinationAirConditioner + (*AirPurificationDevice)(nil), // 63: model.AirPurificationDevice + (*AirCurtain)(nil), // 64: model.AirCurtain + (*Fan)(nil), // 65: model.Fan + (*GasEnvironment)(nil), // 66: model.GasEnvironment } var file_model_proto_depIdxs = []int32{ - 15, // 0: model.Repository.physicalSections:type_name -> model.PhysicalSection - 16, // 1: model.Repository.checkPoints:type_name -> model.CheckPoint - 17, // 2: model.Repository.turnouts:type_name -> model.Turnout - 18, // 3: model.Repository.signals:type_name -> model.Signal - 20, // 4: model.Repository.transponders:type_name -> model.Transponder - 21, // 5: model.Repository.slopes:type_name -> model.Slope - 22, // 6: model.Repository.sectionalCurvatures:type_name -> model.SectionalCurvature - 25, // 7: model.Repository.kilometerConverts:type_name -> model.KilometerConvert - 26, // 8: model.Repository.relays:type_name -> model.Relay - 27, // 9: model.Repository.phaseFailureProtectors:type_name -> model.PhaseFailureProtector - 29, // 10: model.Repository.buttons:type_name -> model.Button - 19, // 11: model.Repository.psds:type_name -> model.Psd - 30, // 12: model.Repository.lights:type_name -> model.Light - 31, // 13: model.Repository.alarms:type_name -> model.Alarm - 32, // 14: model.Repository.stations:type_name -> model.Station - 36, // 15: model.Repository.mkxs:type_name -> model.Mkx - 37, // 16: model.Repository.platforms:type_name -> model.Platform - 38, // 17: model.Repository.Keys:type_name -> model.Key - 39, // 18: model.Repository.CentralizedStationRefs:type_name -> model.CentralizedStationRef - 45, // 19: model.Repository.pipes:type_name -> model.Pipe - 46, // 20: model.Repository.pipeFittings:type_name -> model.PipeFitting - 47, // 21: model.Repository.circuitBreakers:type_name -> model.CircuitBreaker - 48, // 22: model.Repository.threePositionSwitches:type_name -> model.ThreePositionSwitch - 49, // 23: model.Repository.handcartSwitches:type_name -> model.HandcartSwitch - 50, // 24: model.Repository.rectifiers:type_name -> model.Rectifier - 51, // 25: model.Repository.disconnectors:type_name -> model.Disconnector - 52, // 26: model.Repository.voltageTransformers:type_name -> model.VoltageTransformer - 53, // 27: model.Repository.powerSources:type_name -> model.PowerSource - 54, // 28: model.Repository.lightningArresters:type_name -> model.LightningArrester - 55, // 29: model.Repository.earthingDevices:type_name -> model.EarthingDevice - 56, // 30: model.Repository.networkSwitches:type_name -> model.NetworkSwitch - 57, // 31: model.Repository.wireCabinets:type_name -> model.WireCabinet - 58, // 32: model.Repository.airPavilions:type_name -> model.AirPavilion - 59, // 33: model.Repository.valves:type_name -> model.Valve - 60, // 34: model.Repository.gasMixingChambers:type_name -> model.GasMixingChamber - 61, // 35: model.Repository.combinationAirConditioners:type_name -> model.CombinationAirConditioner - 62, // 36: model.Repository.airPurificationDevices:type_name -> model.AirPurificationDevice - 63, // 37: model.Repository.airCurtains:type_name -> model.AirCurtain - 64, // 38: model.Repository.fans:type_name -> model.Fan - 65, // 39: model.Repository.gasEnvironments:type_name -> model.GasEnvironment - 15, // 40: model.SignalLayout.physicalSections:type_name -> model.PhysicalSection - 16, // 41: model.SignalLayout.checkPoints:type_name -> model.CheckPoint - 17, // 42: model.SignalLayout.turnouts:type_name -> model.Turnout - 18, // 43: model.SignalLayout.signals:type_name -> model.Signal - 20, // 44: model.SignalLayout.transponders:type_name -> model.Transponder - 21, // 45: model.SignalLayout.slopes:type_name -> model.Slope - 22, // 46: model.SignalLayout.sectionalCurvatures:type_name -> model.SectionalCurvature - 25, // 47: model.SignalLayout.kilometerConverts:type_name -> model.KilometerConvert - 23, // 48: model.PhysicalSection.aDevicePort:type_name -> model.DevicePort - 23, // 49: model.PhysicalSection.bDevicePort:type_name -> model.DevicePort - 24, // 50: model.CheckPoint.km:type_name -> model.Kilometer + 16, // 0: model.Repository.physicalSections:type_name -> model.PhysicalSection + 17, // 1: model.Repository.checkPoints:type_name -> model.CheckPoint + 18, // 2: model.Repository.turnouts:type_name -> model.Turnout + 19, // 3: model.Repository.signals:type_name -> model.Signal + 21, // 4: model.Repository.transponders:type_name -> model.Transponder + 22, // 5: model.Repository.slopes:type_name -> model.Slope + 23, // 6: model.Repository.sectionalCurvatures:type_name -> model.SectionalCurvature + 26, // 7: model.Repository.kilometerConverts:type_name -> model.KilometerConvert + 27, // 8: model.Repository.relays:type_name -> model.Relay + 28, // 9: model.Repository.phaseFailureProtectors:type_name -> model.PhaseFailureProtector + 30, // 10: model.Repository.buttons:type_name -> model.Button + 20, // 11: model.Repository.psds:type_name -> model.Psd + 31, // 12: model.Repository.lights:type_name -> model.Light + 32, // 13: model.Repository.alarms:type_name -> model.Alarm + 33, // 14: model.Repository.stations:type_name -> model.Station + 37, // 15: model.Repository.mkxs:type_name -> model.Mkx + 38, // 16: model.Repository.platforms:type_name -> model.Platform + 39, // 17: model.Repository.Keys:type_name -> model.Key + 40, // 18: model.Repository.CentralizedStationRefs:type_name -> model.CentralizedStationRef + 46, // 19: model.Repository.pipes:type_name -> model.Pipe + 47, // 20: model.Repository.pipeFittings:type_name -> model.PipeFitting + 48, // 21: model.Repository.circuitBreakers:type_name -> model.CircuitBreaker + 49, // 22: model.Repository.threePositionSwitches:type_name -> model.ThreePositionSwitch + 50, // 23: model.Repository.handcartSwitches:type_name -> model.HandcartSwitch + 51, // 24: model.Repository.rectifiers:type_name -> model.Rectifier + 52, // 25: model.Repository.disconnectors:type_name -> model.Disconnector + 53, // 26: model.Repository.voltageTransformers:type_name -> model.VoltageTransformer + 54, // 27: model.Repository.powerSources:type_name -> model.PowerSource + 55, // 28: model.Repository.lightningArresters:type_name -> model.LightningArrester + 56, // 29: model.Repository.earthingDevices:type_name -> model.EarthingDevice + 57, // 30: model.Repository.networkSwitches:type_name -> model.NetworkSwitch + 58, // 31: model.Repository.wireCabinets:type_name -> model.WireCabinet + 59, // 32: model.Repository.airPavilions:type_name -> model.AirPavilion + 60, // 33: model.Repository.valves:type_name -> model.Valve + 61, // 34: model.Repository.gasMixingChambers:type_name -> model.GasMixingChamber + 62, // 35: model.Repository.combinationAirConditioners:type_name -> model.CombinationAirConditioner + 63, // 36: model.Repository.airPurificationDevices:type_name -> model.AirPurificationDevice + 64, // 37: model.Repository.airCurtains:type_name -> model.AirCurtain + 65, // 38: model.Repository.fans:type_name -> model.Fan + 66, // 39: model.Repository.gasEnvironments:type_name -> model.GasEnvironment + 16, // 40: model.SignalLayout.physicalSections:type_name -> model.PhysicalSection + 17, // 41: model.SignalLayout.checkPoints:type_name -> model.CheckPoint + 18, // 42: model.SignalLayout.turnouts:type_name -> model.Turnout + 19, // 43: model.SignalLayout.signals:type_name -> model.Signal + 21, // 44: model.SignalLayout.transponders:type_name -> model.Transponder + 22, // 45: model.SignalLayout.slopes:type_name -> model.Slope + 23, // 46: model.SignalLayout.sectionalCurvatures:type_name -> model.SectionalCurvature + 26, // 47: model.SignalLayout.kilometerConverts:type_name -> model.KilometerConvert + 24, // 48: model.PhysicalSection.aDevicePort:type_name -> model.DevicePort + 24, // 49: model.PhysicalSection.bDevicePort:type_name -> model.DevicePort + 25, // 50: model.CheckPoint.km:type_name -> model.Kilometer 3, // 51: model.CheckPoint.type:type_name -> model.CheckPointType - 23, // 52: model.CheckPoint.devicePorts:type_name -> model.DevicePort - 24, // 53: model.Turnout.km:type_name -> model.Kilometer - 23, // 54: model.Turnout.aDevicePort:type_name -> model.DevicePort - 23, // 55: model.Turnout.bDevicePort:type_name -> model.DevicePort - 23, // 56: model.Turnout.cDevicePort:type_name -> model.DevicePort + 24, // 52: model.CheckPoint.devicePorts:type_name -> model.DevicePort + 25, // 53: model.Turnout.km:type_name -> model.Kilometer + 24, // 54: model.Turnout.aDevicePort:type_name -> model.DevicePort + 24, // 55: model.Turnout.bDevicePort:type_name -> model.DevicePort + 24, // 56: model.Turnout.cDevicePort:type_name -> model.DevicePort 4, // 57: model.Turnout.switchMachineType:type_name -> model.Turnout.SwitchMachineType - 28, // 58: model.Turnout.electronicComponentGroups:type_name -> model.ElectronicComponentGroup - 24, // 59: model.Signal.km:type_name -> model.Kilometer - 23, // 60: model.Signal.turnoutPort:type_name -> model.DevicePort - 28, // 61: model.Signal.electronicComponentGroups:type_name -> model.ElectronicComponentGroup + 29, // 58: model.Turnout.electronicComponentGroups:type_name -> model.ElectronicComponentGroup + 25, // 59: model.Signal.km:type_name -> model.Kilometer + 24, // 60: model.Signal.turnoutPort:type_name -> model.DevicePort + 29, // 61: model.Signal.electronicComponentGroups:type_name -> model.ElectronicComponentGroup 5, // 62: model.Signal.model:type_name -> model.Signal.Model - 43, // 63: model.Psd.asdGroups:type_name -> model.AsdGroup - 28, // 64: model.Psd.electronicComponentGroups:type_name -> model.ElectronicComponentGroup - 24, // 65: model.Transponder.km:type_name -> model.Kilometer - 23, // 66: model.Transponder.turnoutPort:type_name -> model.DevicePort + 44, // 63: model.Psd.asdGroups:type_name -> model.AsdGroup + 29, // 64: model.Psd.electronicComponentGroups:type_name -> model.ElectronicComponentGroup + 25, // 65: model.Transponder.km:type_name -> model.Kilometer + 24, // 66: model.Transponder.turnoutPort:type_name -> model.DevicePort 6, // 67: model.Transponder.type:type_name -> model.Transponder.Type - 24, // 68: model.Slope.kms:type_name -> model.Kilometer - 24, // 69: model.SectionalCurvature.kms:type_name -> model.Kilometer + 25, // 68: model.Slope.kms:type_name -> model.Kilometer + 25, // 69: model.SectionalCurvature.kms:type_name -> model.Kilometer 0, // 70: model.DevicePort.deviceType:type_name -> model.DeviceType 1, // 71: model.DevicePort.port:type_name -> model.Port 2, // 72: model.Kilometer.direction:type_name -> model.Direction - 24, // 73: model.KilometerConvert.kmA:type_name -> model.Kilometer - 24, // 74: model.KilometerConvert.kmB:type_name -> model.Kilometer + 25, // 73: model.KilometerConvert.kmA:type_name -> model.Kilometer + 25, // 74: model.KilometerConvert.kmB:type_name -> model.Kilometer 7, // 75: model.Relay.model:type_name -> model.Relay.Model 8, // 76: model.Button.buttonType:type_name -> model.Button.ButtonType 9, // 77: model.Light.aspect:type_name -> model.Light.LightAspect - 34, // 78: model.Station.electronicGroup:type_name -> model.ElectronicGroup - 33, // 79: model.Station.deccs:type_name -> model.DeviceEcc + 35, // 78: model.Station.electronicGroup:type_name -> model.ElectronicGroup + 34, // 79: model.Station.deccs:type_name -> model.DeviceEcc 0, // 80: model.DeviceEcc.deviceType:type_name -> model.DeviceType - 28, // 81: model.DeviceEcc.egs:type_name -> model.ElectronicComponentGroup - 35, // 82: model.ElectronicGroup.components:type_name -> model.ElectronicComponent + 29, // 81: model.DeviceEcc.egs:type_name -> model.ElectronicComponentGroup + 36, // 82: model.ElectronicGroup.components:type_name -> model.ElectronicComponent 0, // 83: model.ElectronicComponent.deviceType:type_name -> model.DeviceType - 40, // 84: model.CentralizedStationRef.cjList:type_name -> model.CjData - 42, // 85: model.CentralizedStationRef.qdList:type_name -> model.QdData - 44, // 86: model.CentralizedStationRef.sectionCodePoints:type_name -> model.CiSectionCodePoint - 41, // 87: model.CjData.refRelays:type_name -> model.CjDataItem - 23, // 88: model.Pipe.portA:type_name -> model.DevicePort - 23, // 89: model.Pipe.portB:type_name -> model.DevicePort + 41, // 84: model.CentralizedStationRef.cjList:type_name -> model.CjData + 43, // 85: model.CentralizedStationRef.qdList:type_name -> model.QdData + 45, // 86: model.CentralizedStationRef.sectionCodePoints:type_name -> model.CiSectionCodePoint + 42, // 87: model.CjData.refRelays:type_name -> model.CjDataItem + 24, // 88: model.Pipe.portA:type_name -> model.DevicePort + 24, // 89: model.Pipe.portB:type_name -> model.DevicePort 10, // 90: model.Pipe.pipeType:type_name -> model.Pipe.Type 11, // 91: model.AirPavilion.pavilionType:type_name -> model.AirPavilion.Type 12, // 92: model.Valve.valveType:type_name -> model.Valve.Type - 93, // [93:93] is the sub-list for method output_type - 93, // [93:93] is the sub-list for method input_type - 93, // [93:93] is the sub-list for extension type_name - 93, // [93:93] is the sub-list for extension extendee - 0, // [0:93] is the sub-list for field type_name + 13, // 93: model.Fan.fanType:type_name -> model.Fan.Type + 94, // [94:94] is the sub-list for method output_type + 94, // [94:94] is the sub-list for method input_type + 94, // [94:94] is the sub-list for extension type_name + 94, // [94:94] is the sub-list for extension extendee + 0, // [0:94] is the sub-list for field type_name } func init() { file_model_proto_init() } @@ -6514,7 +6596,7 @@ func file_model_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_model_proto_rawDesc, - NumEnums: 13, + NumEnums: 14, NumMessages: 53, NumExtensions: 0, NumServices: 0, diff --git a/repository/repository_iscs.go b/repository/repository_iscs.go index fd3abf0..a96b8cc 100644 --- a/repository/repository_iscs.go +++ b/repository/repository_iscs.go @@ -101,7 +101,7 @@ func buildIscsModels(source *proto.Repository, repository *Repository) error { } //ISCS风机 for _, protoData := range source.Fans { - m := NewFan(protoData.Id, protoData.Code) + m := NewFan(protoData.Id, protoData.Code, protoData.FanType) repository.FanMap[m.Id()] = m } //ISCS气体环境