iscs bas 大系统
This commit is contained in:
parent
88260cb721
commit
aa6d80c73e
@ -54,6 +54,22 @@ message Repository {
|
||||
repeated NetworkSwitch networkSwitches = 311;
|
||||
//ISCS线柜
|
||||
repeated WireCabinet wireCabinets = 312;
|
||||
//ISCS风亭
|
||||
repeated AirPavilion airPavilions = 313;
|
||||
//ISCS阀门
|
||||
repeated Valve valves = 314;
|
||||
//ISCS混合室静压箱
|
||||
repeated GasMixingChamber gasMixingChambers = 315;
|
||||
//ISCS组合式空调
|
||||
repeated CombinationAirConditioner combinationAirConditioners = 316;
|
||||
//ISCS净化装置
|
||||
repeated AirPurificationDevice airPurificationDevices = 317;
|
||||
//ISCS空气幕
|
||||
repeated AirCurtain airCurtains = 318;
|
||||
//ISCS风机
|
||||
repeated Fan fans = 319;
|
||||
//ISCS气体环境
|
||||
repeated GasEnvironment gasEnvironments = 320;
|
||||
}
|
||||
|
||||
// 信号布置数据
|
||||
|
@ -60,7 +60,7 @@ func (p *Valve) PortNum() int {
|
||||
return 2
|
||||
}
|
||||
|
||||
// ValvePort 风亭端口
|
||||
// ValvePort 阀门端口
|
||||
//
|
||||
// implement DevicePort
|
||||
type ValvePort struct {
|
||||
@ -251,6 +251,12 @@ type GasEnvironment struct {
|
||||
PortsB []DevicePort // 有多个输出口,统一为端口B,用户将环境的混浊气体排除;
|
||||
}
|
||||
|
||||
func NewGasEnvironment(id string, code string) *GasEnvironment {
|
||||
return &GasEnvironment{
|
||||
Identity: &identity{id: id, deviceType: proto.DeviceType_DeviceType_GasEnvironment},
|
||||
Code: code,
|
||||
}
|
||||
}
|
||||
func (p *GasEnvironment) PortNum() int {
|
||||
return len(p.PortsA) + len(p.PortsB)
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -44,6 +44,14 @@ type Repository struct {
|
||||
EarthingDeviceMap map[string]*EarthingDevice //ISCS 接地装置
|
||||
NetworkSwitchMap map[string]*NetworkSwitch //ISCS 网络交换机
|
||||
WireCabinetMap map[string]*WireCabinet //ISCS 线柜
|
||||
AirPavilionMap map[string]*AirPavilion //ISCS 风亭
|
||||
ValveMap map[string]*Valve //ISCS 阀门
|
||||
GasMixingChamberMap map[string]*GasMixingChamber //ISCS 混合室静压箱
|
||||
CombinationAirConditionerMap map[string]*CombinationAirConditioner //ISCS组合式空调
|
||||
AirPurificationDeviceMap map[string]*AirPurificationDevice //ISCS净化装置
|
||||
AirCurtainMap map[string]*AirCurtain //ISCS空气幕
|
||||
FanMap map[string]*Fan //ISCS风机
|
||||
GasEnvironmentMap map[string]*GasEnvironment //ISCS气体环境
|
||||
}
|
||||
|
||||
func newRepository(id string, version string) *Repository {
|
||||
@ -83,6 +91,14 @@ func newRepository(id string, version string) *Repository {
|
||||
EarthingDeviceMap: make(map[string]*EarthingDevice), //ISCS 接地装置
|
||||
NetworkSwitchMap: make(map[string]*NetworkSwitch), //ISCS网络交换机
|
||||
WireCabinetMap: make(map[string]*WireCabinet), //ISCS线柜
|
||||
AirPavilionMap: make(map[string]*AirPavilion), //ISCS 风亭
|
||||
ValveMap: make(map[string]*Valve), //ISCS 阀门
|
||||
GasMixingChamberMap: make(map[string]*GasMixingChamber), //ISCS 混合室静压箱
|
||||
CombinationAirConditionerMap: make(map[string]*CombinationAirConditioner), //ISCS组合式空调
|
||||
AirPurificationDeviceMap: make(map[string]*AirPurificationDevice), //ISCS净化装置
|
||||
AirCurtainMap: make(map[string]*AirCurtain), //ISCS空气幕
|
||||
FanMap: make(map[string]*Fan), //ISCS风机
|
||||
GasEnvironmentMap: make(map[string]*GasEnvironment), //ISCS气体环境
|
||||
}
|
||||
}
|
||||
|
||||
@ -152,6 +168,30 @@ func (repo *Repository) FindById(id string) Identity {
|
||||
if md, ok := repo.WireCabinetMap[id]; ok {
|
||||
return md
|
||||
}
|
||||
if md, ok := repo.AirPavilionMap[id]; ok {
|
||||
return md
|
||||
}
|
||||
if md, ok := repo.ValveMap[id]; ok {
|
||||
return md
|
||||
}
|
||||
if md, ok := repo.GasMixingChamberMap[id]; ok {
|
||||
return md
|
||||
}
|
||||
if md, ok := repo.CombinationAirConditionerMap[id]; ok {
|
||||
return md
|
||||
}
|
||||
if md, ok := repo.AirPurificationDeviceMap[id]; ok {
|
||||
return md
|
||||
}
|
||||
if md, ok := repo.AirCurtainMap[id]; ok {
|
||||
return md
|
||||
}
|
||||
if md, ok := repo.FanMap[id]; ok {
|
||||
return md
|
||||
}
|
||||
if md, ok := repo.GasEnvironmentMap[id]; ok {
|
||||
return md
|
||||
}
|
||||
//ISCS-end
|
||||
|
||||
return nil
|
||||
@ -331,6 +371,22 @@ func (repo *Repository) FindModel(deviceId string, deviceType proto.DeviceType)
|
||||
return repo.NetworkSwitchMap[deviceId], nil
|
||||
case proto.DeviceType_DeviceType_WireCabinet:
|
||||
return repo.WireCabinetMap[deviceId], nil
|
||||
case proto.DeviceType_DeviceType_AirPavilion:
|
||||
return repo.AirPavilionMap[deviceId], nil
|
||||
case proto.DeviceType_DeviceType_Valve:
|
||||
return repo.ValveMap[deviceId], nil
|
||||
case proto.DeviceType_DeviceType_GasMixingChamber:
|
||||
return repo.GasMixingChamberMap[deviceId], nil
|
||||
case proto.DeviceType_DeviceType_CombinationAirConditioner:
|
||||
return repo.CombinationAirConditionerMap[deviceId], nil
|
||||
case proto.DeviceType_DeviceType_AirPurificationDevice:
|
||||
return repo.AirPurificationDeviceMap[deviceId], nil
|
||||
case proto.DeviceType_DeviceType_AirCurtain:
|
||||
return repo.AirCurtainMap[deviceId], nil
|
||||
case proto.DeviceType_DeviceType_Fan:
|
||||
return repo.FanMap[deviceId], nil
|
||||
case proto.DeviceType_DeviceType_GasEnvironment:
|
||||
return repo.GasEnvironmentMap[deviceId], nil
|
||||
default:
|
||||
return nil, fmt.Errorf("仓库中不存在[%s]类型的模型", deviceType)
|
||||
}
|
||||
|
@ -69,6 +69,46 @@ func buildIscsModels(source *proto.Repository, repository *Repository) error {
|
||||
m := NewWireCabinet(protoData.Id, protoData.Code)
|
||||
repository.WireCabinetMap[m.Id()] = m
|
||||
}
|
||||
//ISCS风亭
|
||||
for _, protoData := range source.AirPavilions {
|
||||
m := NewAirPavilion(protoData.Id, protoData.Code, protoData.PavilionType)
|
||||
repository.AirPavilionMap[m.Id()] = m
|
||||
}
|
||||
//ISCS阀门
|
||||
for _, protoData := range source.Valves {
|
||||
m := NewValve(protoData.Id, protoData.Code, protoData.ValveType)
|
||||
repository.ValveMap[m.Id()] = m
|
||||
}
|
||||
//ISCS 混合室静压箱
|
||||
for _, protoData := range source.GasMixingChambers {
|
||||
m := NewGasMixingChamber(protoData.Id, protoData.Code)
|
||||
repository.GasMixingChamberMap[m.Id()] = m
|
||||
}
|
||||
//ISCS组合式空调
|
||||
for _, protoData := range source.CombinationAirConditioners {
|
||||
m := NewCombinationAirConditioner(protoData.Id, protoData.Code)
|
||||
repository.CombinationAirConditionerMap[m.Id()] = m
|
||||
}
|
||||
//ISCS净化装置
|
||||
for _, protoData := range source.AirPurificationDevices {
|
||||
m := NewAirPurificationDevice(protoData.Id, protoData.Code)
|
||||
repository.AirPurificationDeviceMap[m.Id()] = m
|
||||
}
|
||||
//ISCS空气幕
|
||||
for _, protoData := range source.AirCurtains {
|
||||
m := NewAirCurtain(protoData.Id, protoData.Code)
|
||||
repository.AirCurtainMap[m.Id()] = m
|
||||
}
|
||||
//ISCS风机
|
||||
for _, protoData := range source.Fans {
|
||||
m := NewFan(protoData.Id, protoData.Code)
|
||||
repository.FanMap[m.Id()] = m
|
||||
}
|
||||
//ISCS气体环境
|
||||
for _, protoData := range source.GasEnvironments {
|
||||
m := NewGasEnvironment(protoData.Id, protoData.Code)
|
||||
repository.GasEnvironmentMap[m.Id()] = m
|
||||
}
|
||||
//
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user