diff --git a/repository/iscs_bas_dxt.go b/repository/iscs_bas_dxt.go index a5817f1..22406b9 100644 --- a/repository/iscs_bas_dxt.go +++ b/repository/iscs_bas_dxt.go @@ -28,7 +28,7 @@ func (p *AirPavilion) PortNum() int { // implement DevicePort type AirPavilionPort struct { port proto.Port - device *CircuitBreaker + device *AirPavilion } func (p *AirPavilionPort) Port() proto.Port { diff --git a/repository/repository_iscs.go b/repository/repository_iscs.go index 5e03828..fd3abf0 100644 --- a/repository/repository_iscs.go +++ b/repository/repository_iscs.go @@ -137,6 +137,86 @@ func buildIscsPipeModelRelationship(source *proto.Repository, repository *Reposi } var pipePortRelatedDevice DevicePort switch portRelatedDevice.DeviceType { + case proto.DeviceType_DeviceType_AirPavilion: //管线关联风亭 + { + airPavilion := relatedDevice.(*AirPavilion) + pipePortRelatedDevice = &AirPavilionPort{port: portRelatedDevice.Port, device: airPavilion} + airPavilion.PortA = &PipePort{port: pipePort, pipe: pipeModel} + } + case proto.DeviceType_DeviceType_Valve: //管线关联风阀 + { + valve := relatedDevice.(*Valve) + pipePortRelatedDevice = &ValvePort{port: portRelatedDevice.Port, device: valve} + switch portRelatedDevice.Port { + case proto.Port_A: + valve.PortA = &PipePort{port: pipePort, pipe: pipeModel} + case proto.Port_B: + valve.PortB = &PipePort{port: pipePort, pipe: pipeModel} + } + } + case proto.DeviceType_DeviceType_GasMixingChamber: + { + gasMixingChamber := relatedDevice.(*GasMixingChamber) + pipePortRelatedDevice = &GasMixingChamberPort{port: portRelatedDevice.Port, device: gasMixingChamber} + switch portRelatedDevice.Port { + case proto.Port_A: + gasMixingChamber.PortA = &PipePort{port: pipePort, pipe: pipeModel} + case proto.Port_B: + gasMixingChamber.PortB = &PipePort{port: pipePort, pipe: pipeModel} + case proto.Port_C: + gasMixingChamber.PortC = &PipePort{port: pipePort, pipe: pipeModel} + case proto.Port_D: + gasMixingChamber.PortD = &PipePort{port: pipePort, pipe: pipeModel} + } + } + case proto.DeviceType_DeviceType_CombinationAirConditioner: + { + combinationAirConditioner := relatedDevice.(*CombinationAirConditioner) + pipePortRelatedDevice = &CombinationAirConditionerPort{port: portRelatedDevice.Port, device: combinationAirConditioner} + switch portRelatedDevice.Port { + case proto.Port_A: + combinationAirConditioner.PortA = &PipePort{port: pipePort, pipe: pipeModel} + case proto.Port_B: + combinationAirConditioner.PortB = &PipePort{port: pipePort, pipe: pipeModel} + case proto.Port_C: + combinationAirConditioner.PortC = &PipePort{port: pipePort, pipe: pipeModel} + case proto.Port_D: + combinationAirConditioner.PortD = &PipePort{port: pipePort, pipe: pipeModel} + } + } + case proto.DeviceType_DeviceType_AirPurificationDevice: + { + airPurificationDevice := relatedDevice.(*AirPurificationDevice) + pipePortRelatedDevice = &AirPurificationDevicePort{port: portRelatedDevice.Port, device: airPurificationDevice} + switch portRelatedDevice.Port { + case proto.Port_A: + airPurificationDevice.PortA = &PipePort{port: pipePort, pipe: pipeModel} + case proto.Port_B: + airPurificationDevice.PortB = &PipePort{port: pipePort, pipe: pipeModel} + } + } + case proto.DeviceType_DeviceType_Fan: + { + fan := relatedDevice.(*Fan) + pipePortRelatedDevice = &FanPort{port: portRelatedDevice.Port, device: fan} + switch portRelatedDevice.Port { + case proto.Port_A: + fan.PortA = &PipePort{port: pipePort, pipe: pipeModel} + case proto.Port_B: + fan.PortB = &PipePort{port: pipePort, pipe: pipeModel} + } + } + case proto.DeviceType_DeviceType_GasEnvironment: + { + gasEnvironment := relatedDevice.(*GasEnvironment) + pipePortRelatedDevice = &GasEnvironmentPort{port: portRelatedDevice.Port, device: gasEnvironment} + switch portRelatedDevice.Port { + case proto.Port_A: + gasEnvironment.PortsA = append(gasEnvironment.PortsA, &PipePort{port: pipePort, pipe: pipeModel}) + case proto.Port_B: + gasEnvironment.PortsB = append(gasEnvironment.PortsB, &PipePort{port: pipePort, pipe: pipeModel}) + } + } case proto.DeviceType_DeviceType_PipeFitting: { pipeFitting := relatedDevice.(*PipeFitting)