iscs bas 大系统

This commit is contained in:
xzb 2023-12-25 14:09:29 +08:00
parent 88260cb721
commit aa6d80c73e
5 changed files with 955 additions and 725 deletions

View File

@ -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;
}
//

View File

@ -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

View File

@ -8,81 +8,97 @@ import (
)
type Repository struct {
id string
version string
coordinate *MapCoordinate // 基准坐标系类型,在列车画图时统一坐标系
physicalSectionMap map[string]*PhysicalSection
checkPointMap map[string]*CheckPoint
turnoutMap map[string]*Turnout
signalMap map[string]*Signal
responderMap map[string]*Transponder
slopeMap map[string]*Slope
sectionalCurvatureMap map[string]*SectionalCurvature
kilometerConvertMap map[string]*proto.KilometerConvert
relayMap map[string]*Relay
phaseFailureProtectorMap map[string]*PhaseFailureProtector
buttonMap map[string]*Button
psdMap map[string]*Psd
lightMap map[string]*Light
alarmMap map[string]*Alarm
stationMap map[string]*Station
mkxMap map[string]*Mkx
keyMap map[string]*Key
linkMap map[string]*Link
platformMap map[string]*Platform
centralizedMap map[string]*proto.CentralizedStationRef
PipeMap map[string]*Pipe //ISCS 管线
PipeFittingMap map[string]*PipeFitting //ISCS 管件
CircuitBreakerMap map[string]*CircuitBreaker //ISCS 断路器
ThreePositionSwitchMap map[string]*ThreePositionSwitch //ISCS 三工位开关
HandcartSwitchMap map[string]*HandcartSwitch //ISCS 手车
RectifierMap map[string]*Rectifier //ISCS 整流器
DisconnectorMap map[string]*Disconnector //ISCS 隔离开关
VoltageTransformerMap map[string]*VoltageTransformer //ISCS 变压器
PowerSourceMap map[string]*PowerSource //ISCS 电源
LightningArresterMap map[string]*LightningArrester //ISCS 避雷器
EarthingDeviceMap map[string]*EarthingDevice //ISCS 接地装置
NetworkSwitchMap map[string]*NetworkSwitch //ISCS 网络交换机
WireCabinetMap map[string]*WireCabinet //ISCS 线柜
id string
version string
coordinate *MapCoordinate // 基准坐标系类型,在列车画图时统一坐标系
physicalSectionMap map[string]*PhysicalSection
checkPointMap map[string]*CheckPoint
turnoutMap map[string]*Turnout
signalMap map[string]*Signal
responderMap map[string]*Transponder
slopeMap map[string]*Slope
sectionalCurvatureMap map[string]*SectionalCurvature
kilometerConvertMap map[string]*proto.KilometerConvert
relayMap map[string]*Relay
phaseFailureProtectorMap map[string]*PhaseFailureProtector
buttonMap map[string]*Button
psdMap map[string]*Psd
lightMap map[string]*Light
alarmMap map[string]*Alarm
stationMap map[string]*Station
mkxMap map[string]*Mkx
keyMap map[string]*Key
linkMap map[string]*Link
platformMap map[string]*Platform
centralizedMap map[string]*proto.CentralizedStationRef
PipeMap map[string]*Pipe //ISCS 管线
PipeFittingMap map[string]*PipeFitting //ISCS 管件
CircuitBreakerMap map[string]*CircuitBreaker //ISCS 断路器
ThreePositionSwitchMap map[string]*ThreePositionSwitch //ISCS 三工位开关
HandcartSwitchMap map[string]*HandcartSwitch //ISCS 手车
RectifierMap map[string]*Rectifier //ISCS 整流器
DisconnectorMap map[string]*Disconnector //ISCS 隔离开关
VoltageTransformerMap map[string]*VoltageTransformer //ISCS 变压器
PowerSourceMap map[string]*PowerSource //ISCS 电源
LightningArresterMap map[string]*LightningArrester //ISCS 避雷器
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 {
return &Repository{
id: id,
version: version,
physicalSectionMap: make(map[string]*PhysicalSection),
checkPointMap: make(map[string]*CheckPoint),
turnoutMap: make(map[string]*Turnout),
signalMap: make(map[string]*Signal),
responderMap: make(map[string]*Transponder),
slopeMap: make(map[string]*Slope),
sectionalCurvatureMap: make(map[string]*SectionalCurvature),
kilometerConvertMap: make(map[string]*proto.KilometerConvert),
relayMap: make(map[string]*Relay),
phaseFailureProtectorMap: make(map[string]*PhaseFailureProtector),
linkMap: make(map[string]*Link),
buttonMap: make(map[string]*Button),
psdMap: make(map[string]*Psd),
lightMap: make(map[string]*Light),
alarmMap: make(map[string]*Alarm),
stationMap: make(map[string]*Station),
mkxMap: make(map[string]*Mkx),
keyMap: make(map[string]*Key),
platformMap: make(map[string]*Platform),
centralizedMap: make(map[string]*proto.CentralizedStationRef),
PipeMap: make(map[string]*Pipe), //ISCS 管线
PipeFittingMap: make(map[string]*PipeFitting), //ISCS 管件
CircuitBreakerMap: make(map[string]*CircuitBreaker), //ISCS 断路器
ThreePositionSwitchMap: make(map[string]*ThreePositionSwitch), //ISCS 三工位开关
HandcartSwitchMap: make(map[string]*HandcartSwitch), //ISCS 手车
RectifierMap: make(map[string]*Rectifier), //ISCS 整流器
DisconnectorMap: make(map[string]*Disconnector), //ISCS 隔离开关
VoltageTransformerMap: make(map[string]*VoltageTransformer), //ISCS 变压器
PowerSourceMap: make(map[string]*PowerSource), //ISCS 电源
LightningArresterMap: make(map[string]*LightningArrester), //ISCS 避雷器
EarthingDeviceMap: make(map[string]*EarthingDevice), //ISCS 接地装置
NetworkSwitchMap: make(map[string]*NetworkSwitch), //ISCS网络交换机
WireCabinetMap: make(map[string]*WireCabinet), //ISCS线柜
id: id,
version: version,
physicalSectionMap: make(map[string]*PhysicalSection),
checkPointMap: make(map[string]*CheckPoint),
turnoutMap: make(map[string]*Turnout),
signalMap: make(map[string]*Signal),
responderMap: make(map[string]*Transponder),
slopeMap: make(map[string]*Slope),
sectionalCurvatureMap: make(map[string]*SectionalCurvature),
kilometerConvertMap: make(map[string]*proto.KilometerConvert),
relayMap: make(map[string]*Relay),
phaseFailureProtectorMap: make(map[string]*PhaseFailureProtector),
linkMap: make(map[string]*Link),
buttonMap: make(map[string]*Button),
psdMap: make(map[string]*Psd),
lightMap: make(map[string]*Light),
alarmMap: make(map[string]*Alarm),
stationMap: make(map[string]*Station),
mkxMap: make(map[string]*Mkx),
keyMap: make(map[string]*Key),
platformMap: make(map[string]*Platform),
centralizedMap: make(map[string]*proto.CentralizedStationRef),
PipeMap: make(map[string]*Pipe), //ISCS 管线
PipeFittingMap: make(map[string]*PipeFitting), //ISCS 管件
CircuitBreakerMap: make(map[string]*CircuitBreaker), //ISCS 断路器
ThreePositionSwitchMap: make(map[string]*ThreePositionSwitch), //ISCS 三工位开关
HandcartSwitchMap: make(map[string]*HandcartSwitch), //ISCS 手车
RectifierMap: make(map[string]*Rectifier), //ISCS 整流器
DisconnectorMap: make(map[string]*Disconnector), //ISCS 隔离开关
VoltageTransformerMap: make(map[string]*VoltageTransformer), //ISCS 变压器
PowerSourceMap: make(map[string]*PowerSource), //ISCS 电源
LightningArresterMap: make(map[string]*LightningArrester), //ISCS 避雷器
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)
}

View File

@ -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
}