iscs bas 大系统

This commit is contained in:
xzb 2023-12-25 13:40:00 +08:00
parent cb1c16aeae
commit 88260cb721
4 changed files with 719 additions and 635 deletions

View File

@ -1,7 +1,11 @@
package component package component
// SpaceAreaEnv 空间区域BAS环境(如站厅、设备室等的温度、湿度、烟雾浓度、CO2浓度等) // ExhaustPavilion 排风亭
type SpaceAreaEnv struct { type ExhaustPavilion struct {
T int16 //温度 Normal bool //true-正常
}
// AirSupplyPavilion 送风亭
type AirSupplyPavilion struct {
Normal bool //true-正常
} }

View File

@ -327,22 +327,18 @@ enum DeviceType {
DeviceType_PowerSource = 385; DeviceType_PowerSource = 385;
//ISCS //ISCS
DeviceType_EarthingDevice = 386; DeviceType_EarthingDevice = 386;
//ISCS //ISCS
DeviceType_ExhaustPavilion = 387; DeviceType_AirPavilion = 387;
//ISCS //ISCS
DeviceType_AirSupplyPavilion = 388; DeviceType_Valve = 388;
//ISCS 
DeviceType_ElectricControlValve = 389;
//ISCS
DeviceType_ElectricAirValve = 390;
//ISCS //ISCS
DeviceType_GasMixingChamber = 391; DeviceType_GasMixingChamber = 389;
//ISCS //ISCS
DeviceType_CombinationAirConditioner = 392; DeviceType_CombinationAirConditioner = 390;
//ISCS //ISCS
DeviceType_AirPurificationDevice = 393; DeviceType_AirPurificationDevice = 391;
//ISCS (+) //ISCS (+)
DeviceType_GasEnvironment = 394; DeviceType_GasEnvironment = 392;
} }
@ -649,32 +645,29 @@ message WireCabinet{
string code = 2; string code = 2;
} }
// //()
//A message AirPavilion{
message ExhaustPavilion{
string id = 1;
string code = 2;
}
//
//A
message AirSupplyPavilion{
string id = 1;
string code = 2;
}
//
//A和B
message ElectricControlValve{
string id = 1; string id = 1;
string code = 2; string code = 2;
enum Type{
ExhaustPavilion = 0;//
AirSupplyPavilion = 1;//
}
Type pavilionType = 3;//
} }
// //()
//A和B message Valve{
message ElectricAirValve{
string id = 1; string id = 1;
string code = 2; string code = 2;
enum Type{
ElectricControlValve = 0;//
ElectricAirValve = 1;//
}
Type valveType = 3;//
} }
//() //()
//ABC三个端口为输入口D端口为输出口 //ABC三个端口为输入口D端口为输出口
message GasMixingChamber{ message GasMixingChamber{

View File

@ -4,67 +4,88 @@ import "joylink.club/rtsssimulation/repository/model/proto"
//ISCS BAS 大系统相关 //ISCS BAS 大系统相关
// ExhaustPavilion 排风亭 // AirPavilion 风亭(排、送)
// 有一个输入端口A该端口连接排气管 type AirPavilion struct {
type ExhaustPavilion struct {
Identity Identity
Code string Code string
PavilionType proto.AirPavilion_Type //风亭子类型
PortA DevicePort //风亭A端口连接的设备
} }
func NewExhaustPavilion(id string, code string) *ExhaustPavilion { func NewAirPavilion(id string, code string, pavilionType proto.AirPavilion_Type) *AirPavilion {
return &ExhaustPavilion{ return &AirPavilion{
Identity: &identity{id: id, deviceType: proto.DeviceType_DeviceType_ExhaustPavilion}, Identity: &identity{id: id, deviceType: proto.DeviceType_DeviceType_AirPavilion},
Code: code, Code: code,
PavilionType: pavilionType,
} }
} }
func (p *AirPavilion) PortNum() int {
// AirSupplyPavilion 送风亭 return 1
// 有一个输出端口A该端口与送风管连接
type AirSupplyPavilion struct {
Identity
Code string
} }
func NewAirSupplyPavilion(id string, code string) *AirSupplyPavilion { // AirPavilionPort 风亭端口
return &AirSupplyPavilion{ //
Identity: &identity{id: id, deviceType: proto.DeviceType_DeviceType_AirSupplyPavilion}, // implement DevicePort
Code: code, type AirPavilionPort struct {
port proto.Port
device *CircuitBreaker
}
func (p *AirPavilionPort) Port() proto.Port {
return p.port
}
func (p *AirPavilionPort) Device() PortedDevice {
return p.device
}
///////////////////////////////////////////////////////////
// Valve 阀门(电动调节阀、电动风阀)
type Valve struct {
Identity
Code string
ValveType proto.Valve_Type //阀门子类型
PortA DevicePort //阀门A端口连接的设备
PortB DevicePort //阀门B端口连接的设备
}
func NewValve(id string, code string, valveType proto.Valve_Type) *Valve {
return &Valve{
Identity: &identity{id: id, deviceType: proto.DeviceType_DeviceType_Valve},
Code: code,
ValveType: valveType,
} }
} }
func (p *Valve) PortNum() int {
// ElectricControlValve 电动调节阀 return 2
// 有两个端口分别为A和B
type ElectricControlValve struct {
Identity
Code string
} }
func NewElectricControlValve(id string, code string) *ElectricControlValve { // ValvePort 风亭端口
return &ElectricControlValve{ //
Identity: &identity{id: id, deviceType: proto.DeviceType_DeviceType_ElectricControlValve}, // implement DevicePort
Code: code, type ValvePort struct {
} port proto.Port
device *Valve
} }
// ElectricAirValve 电动风阀 func (p *ValvePort) Port() proto.Port {
// 有两个端口分别为A和B return p.port
type ElectricAirValve struct { }
Identity func (p *ValvePort) Device() PortedDevice {
Code string return p.device
} }
func NewElectricAirValve(id string, code string) *ElectricAirValve { //////////////////////////////////////////////////
return &ElectricAirValve{
Identity: &identity{id: id, deviceType: proto.DeviceType_DeviceType_ElectricAirValve},
Code: code,
}
}
// GasMixingChamber 混合室静压箱(气体) // GasMixingChamber 混合室静压箱(气体)
// 有四个端口ABC三个端口为输入口D端口为输出口 // 有四个端口ABC三个端口为输入口D端口为输出口
type GasMixingChamber struct { type GasMixingChamber struct {
Identity Identity
Code string Code string
PortA DevicePort //A端口连接的设备
PortB DevicePort //B端口连接的设备
PortC DevicePort //C端口连接的设备
PortD DevicePort //D端口连接的设备
} }
func NewGasMixingChamber(id string, code string) *GasMixingChamber { func NewGasMixingChamber(id string, code string) *GasMixingChamber {
@ -73,13 +94,37 @@ func NewGasMixingChamber(id string, code string) *GasMixingChamber {
Code: code, Code: code,
} }
} }
func (p *GasMixingChamber) PortNum() int {
return 4
}
// GasMixingChamberPort 混合室静压箱端口
//
// implement DevicePort
type GasMixingChamberPort struct {
port proto.Port
device *GasMixingChamber
}
func (p *GasMixingChamberPort) Port() proto.Port {
return p.port
}
func (p *GasMixingChamberPort) Device() PortedDevice {
return p.device
}
////////////////////////////////////////////////
// CombinationAirConditioner 组合式空调 // CombinationAirConditioner 组合式空调
// 有四个端口新风输入端口A,工作风输出端口B // 有四个端口新风输入端口A,工作风输出端口B
// 端口C输出风再通过端口D输入通过C->D实现对风再处理。 // 端口C输出风再通过端口D输入通过C->D实现对风再处理。
type CombinationAirConditioner struct { type CombinationAirConditioner struct {
Identity Identity
Code string Code string
PortA DevicePort //新风输入A端口连接的设备
PortB DevicePort //工作风输出B端口连接的设备
PortC DevicePort //C端口连接的设备
PortD DevicePort //D端口连接的设备
} }
func NewCombinationAirConditioner(id string, code string) *CombinationAirConditioner { func NewCombinationAirConditioner(id string, code string) *CombinationAirConditioner {
@ -88,12 +133,34 @@ func NewCombinationAirConditioner(id string, code string) *CombinationAirConditi
Code: code, Code: code,
} }
} }
func (p *CombinationAirConditioner) PortNum() int {
return 4
}
// CombinationAirConditionerPort 组合式空调端口
//
// implement DevicePort
type CombinationAirConditionerPort struct {
port proto.Port
device *CombinationAirConditioner
}
func (p *CombinationAirConditionerPort) Port() proto.Port {
return p.port
}
func (p *CombinationAirConditionerPort) Device() PortedDevice {
return p.device
}
/////////////////////////////////////////////////////////////////
// AirPurificationDevice 净化装置(对组合式空调B端口输出的工作风进行净化) // AirPurificationDevice 净化装置(对组合式空调B端口输出的工作风进行净化)
// 有两个端口端口A输入端口B输出 // 有两个端口端口A输入端口B输出
type AirPurificationDevice struct { type AirPurificationDevice struct {
Identity Identity
Code string Code string
PortA DevicePort //A端口连接的设备
PortB DevicePort //B端口连接的设备
} }
func NewAirPurificationDevice(id string, code string) *AirPurificationDevice { func NewAirPurificationDevice(id string, code string) *AirPurificationDevice {
@ -102,6 +169,26 @@ func NewAirPurificationDevice(id string, code string) *AirPurificationDevice {
Code: code, Code: code,
} }
} }
func (p *AirPurificationDevice) PortNum() int {
return 2
}
// AirPurificationDevicePort 净化装置端口
//
// implement DevicePort
type AirPurificationDevicePort struct {
port proto.Port
device *AirPurificationDevice
}
func (p *AirPurificationDevicePort) Port() proto.Port {
return p.port
}
func (p *AirPurificationDevicePort) Device() PortedDevice {
return p.device
}
/////////////////////////////////////////////////////////
// AirCurtain 空气幕 // AirCurtain 空气幕
type AirCurtain struct { type AirCurtain struct {
@ -116,10 +203,14 @@ func NewAirCurtain(id string, code string) *AirCurtain {
} }
} }
//////////////////////////////////////////////////////////
// Fan 风机 // Fan 风机
type Fan struct { type Fan struct {
Identity Identity
Code string Code string
PortA DevicePort //A端口连接的设备
PortB DevicePort //B端口连接的设备
} }
func NewFan(id string, code string) *Fan { func NewFan(id string, code string) *Fan {
@ -128,6 +219,26 @@ func NewFan(id string, code string) *Fan {
Code: code, Code: code,
} }
} }
func (p *Fan) PortNum() int {
return 2
}
// FanPort 风机端口
//
// implement DevicePort
type FanPort struct {
port proto.Port
device *Fan
}
func (p *FanPort) Port() proto.Port {
return p.port
}
func (p *FanPort) Device() PortedDevice {
return p.device
}
////////////////////////////////////////////////
// GasEnvironment 气体环境(正常空气+有害烟雾) // GasEnvironment 气体环境(正常空气+有害烟雾)
// 有多个输入口统一为端口A用来为环境补充新鲜空气 // 有多个输入口统一为端口A用来为环境补充新鲜空气
@ -135,12 +246,26 @@ func NewFan(id string, code string) *Fan {
// 排出气体动力源为该环境。 // 排出气体动力源为该环境。
type GasEnvironment struct { type GasEnvironment struct {
Identity Identity
Code string Code string
PortsA []DevicePort // 有多个输入口统一为端口A用来为环境补充新鲜空气
PortsB []DevicePort // 有多个输出口统一为端口B用户将环境的混浊气体排除
} }
func NewGasEnvironment(id string, code string) *GasEnvironment { func (p *GasEnvironment) PortNum() int {
return &GasEnvironment{ return len(p.PortsA) + len(p.PortsB)
Identity: &identity{id: id, deviceType: proto.DeviceType_DeviceType_GasEnvironment}, }
Code: code,
} // GasEnvironmentPort 气体环境端口
//
// implement DevicePort
type GasEnvironmentPort struct {
port proto.Port
device *GasEnvironment
}
func (p *GasEnvironmentPort) Port() proto.Port {
return p.port
}
func (p *GasEnvironmentPort) Device() PortedDevice {
return p.device
} }

File diff suppressed because it is too large Load Diff