ISCS火警系统ecs定义

This commit is contained in:
xzb 2023-12-14 16:17:54 +08:00
parent 2b6b1120a5
commit 0500e446f2
5 changed files with 248 additions and 7 deletions

View File

@ -122,6 +122,93 @@ const (
/////////////////////////////////////////
// FasAcs 火警ACS联动
type FasAcs struct {
Normal bool //true-正常
Release bool //true-紧急释放
Exception consts.DeviceExceptionEnum //具体异常-故障、异常、通信中断
}
// FasAfc 火警AFC联动
type FasAfc struct {
Normal bool //true-正常
Release bool //true-紧急释放
Exception consts.DeviceExceptionEnum //具体异常-故障、异常、通信中断
}
//////////////////////////////////////////
// NonFirePowerSource 非消防电源
type NonFirePowerSource struct {
Normal bool //true-正常
TurnOff bool //true-切除,关闭非消防电源,防止在救火时触电或漏电引起二次事故
Exception consts.DeviceExceptionEnum //具体异常-故障、异常、通信中断
}
///////////////////////////////////////////
// WaterFlowIndicator 水流指示器
//
// 水流指示器是用于自动喷水灭火系统中将水流信号转换成电信号的一种水流报警装置。水流指示器的作用是能够及时报告火灾发生的部位。
type WaterFlowIndicator struct {
Normal bool //true-正常
Flowing bool //true-发出有水流动信号,表示某处有火灾
Exception consts.DeviceExceptionEnum //具体异常-故障、异常、通信中断
}
///////////////////////////////////////////
// PumpStartButton 启泵按钮
type PumpStartButton struct {
Normal bool //true-正常
Pressed bool //true-动作,按钮按下
Exception consts.DeviceExceptionEnum //具体异常-故障、异常、通信中断
}
////////////////////////////////////////////
// TemperatureSensingCable 感温电缆
type TemperatureSensingCable struct {
Normal bool //true-正常
FireAlarm bool //true-火警
Exception consts.DeviceExceptionEnum //具体异常-故障、异常、通信中断
}
// ElevatorToOriginalPosModule 电梯归首功能模块
//
// 1、一般电梯应有的消防功能。归首的意思是指回归首层。2、该功能也就是说电梯在上行过程中如果一旦触发了消防开关电梯就立即返回基站也就是归首层
type ElevatorToOriginalPosModule struct {
Normal bool //true-正常
Exception consts.DeviceExceptionEnum //具体异常-火警故障、故障、异常、通信中断
}
////////////////////////////////////////////
// FireDamper 防火阀
//
// 当烟气温度达到280℃时人已基本疏散完毕排烟已无实际意义而烟气中此时已带火阀门自动关闭以避免火势蔓延
type FireDamper struct {
Normal bool //true-正常
Isolate bool //true-隔离
Exception consts.DeviceExceptionEnum //具体异常-火警故障、故障、异常、通信中断
}
// ElectricSmokeFireDamper 电动防烟防火阀
type ElectricSmokeFireDamper struct {
Normal bool //true-正常
Exception consts.DeviceExceptionEnum //具体异常-火警故障、故障、异常、通信中断
}
////////////////////////////////////////////
// FireInterconnectionSignal 火灾互联互通信号
type FireInterconnectionSignal struct {
Normal bool //true-正常
Exception consts.DeviceExceptionEnum //具体异常-火警故障、故障、异常、通信中断
}
/////////////////////////////////////////////
var (
PartitionTypeFireRollerShutterTag = ecs.NewTag() //隔断型防火卷帘
EvacuationTypeFireRollerShutterTag = ecs.NewTag() //疏散型防火卷帘
@ -129,6 +216,9 @@ var (
FirePumpTag = ecs.NewTag() //消防泵
SprayPumpTag = ecs.NewTag() //喷淋泵
StabilizedPressurePumpTag = ecs.NewTag() //稳压泵
SignalButterflyValveTag = ecs.NewTag() //信号蝶阀
PressureSwitchTag = ecs.NewTag() //压力开关是与电器开关相结合的装置,当到达预先设定的流体压力时,开关接点动作
)
var (
NetworkHostType = ecs.NewComponentType[NetworkHost]() //主机
@ -138,4 +228,14 @@ var (
GasFireExtinguisherType = ecs.NewComponentType[GasFireExtinguisher]() //气体灭火
AlarmBellType = ecs.NewComponentType[AlarmBell]() //警铃
FireRollerShutterType = ecs.NewComponentType[FireRollerShutter]() //防火卷帘
FasAcsType = ecs.NewComponentType[FasAcs]() //火警ACS联动
FasAfcType = ecs.NewComponentType[FasAfc]() //火警AFC联动
NonFirePowerSourceType = ecs.NewComponentType[NonFirePowerSource]() //非消防电源
WaterFlowIndicatorType = ecs.NewComponentType[WaterFlowIndicator]() //水流指示器
PumpStartButtonType = ecs.NewComponentType[PumpStartButton]() //启泵按钮
TemperatureSensingCableType = ecs.NewComponentType[TemperatureSensingCable]() //感温电缆
ElevatorToOriginalPosModuleType = ecs.NewComponentType[ElevatorToOriginalPosModule]() //电梯归首
FireDamperType = ecs.NewComponentType[FireDamper]() //防火阀
ElectricSmokeFireDamperType = ecs.NewComponentType[ElectricSmokeFireDamper]() //电动防烟防火阀
FireInterconnectionSignalType = ecs.NewComponentType[FireInterconnectionSignal]() //火灾互联互通信号
)

View File

@ -166,6 +166,7 @@ var (
DeviceAlarmTag = ecs.NewTag() //报警 有事故信号产生
DeviceStartTimeoutTag = ecs.NewTag() //启动超时
DeviceModuleFaultTag = ecs.NewTag() //模块故障
DeviceFireAlarmMalfunctionTag = ecs.NewTag() //火警故障
)
// 设备置牌标签定义

View File

@ -11,4 +11,5 @@ const (
DeviceAlarm //报警 有事故信号产生
DeviceStartTimeout //启动超时
DeviceModuleFault //模块故障
DeviceFireAlarmMalfunction //火警故障
)

View File

@ -123,3 +123,137 @@ func NewStabilizedPressurePumpEntity(w ecs.World, id string) *ecs.Entry {
entry.AddComponent(component.StabilizedPressurePumpTag)
return entry
}
// NewFasAcsEntity 创建火警ACS联动实体
func NewFasAcsEntity(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.FasAcsType))
component.UidType.SetValue(e, component.Uid{Id: id})
wd.EntityMap[id] = e
}
return e
}
// NewFasAfcEntity 创建火警AFC联动实体
func NewFasAfcEntity(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.FasAfcType))
component.UidType.SetValue(e, component.Uid{Id: id})
wd.EntityMap[id] = e
}
return e
}
// NewWaterFlowIndicatorEntity 创建水流指示器实体
func NewWaterFlowIndicatorEntity(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.WaterFlowIndicatorType))
component.UidType.SetValue(e, component.Uid{Id: id})
wd.EntityMap[id] = e
}
return e
}
// NewSignalButterflyValveEntity 创建信号蝶阀实体
func NewSignalButterflyValveEntity(w ecs.World, id string) *ecs.Entry {
entry := NewElectricControlValveEntity(w, id)
entry.AddComponent(component.SignalButterflyValveTag)
return entry
}
// NewPressureSwitchEntity 压力开关是与电器开关相结合的装置,当到达预先设定的流体压力时,开关接点动作
func NewPressureSwitchEntity(w ecs.World, id string) *ecs.Entry {
entry := NewElectricControlValveEntity(w, id)
entry.AddComponent(component.PressureSwitchTag)
return entry
}
// NewNonFirePowerSourceEntity 创建非消防电源实体
func NewNonFirePowerSourceEntity(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.NonFirePowerSourceType))
component.UidType.SetValue(e, component.Uid{Id: id})
wd.EntityMap[id] = e
}
return e
}
// NewPumpStartButtonEntity 创建启泵按钮实体
func NewPumpStartButtonEntity(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.PumpStartButtonType))
component.UidType.SetValue(e, component.Uid{Id: id})
wd.EntityMap[id] = e
}
return e
}
// NewTemperatureSensingCableEntity 创建感温电缆实体
func NewTemperatureSensingCableEntity(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.TemperatureSensingCableType))
component.UidType.SetValue(e, component.Uid{Id: id})
wd.EntityMap[id] = e
}
return e
}
// NewElevatorToOriginalPosModuleEntity 电梯归首功能模块实体
func NewElevatorToOriginalPosModuleEntity(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.ElevatorToOriginalPosModuleType))
component.UidType.SetValue(e, component.Uid{Id: id})
wd.EntityMap[id] = e
}
return e
}
// NewFireDamperEntity 创建防火阀实体
func NewFireDamperEntity(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.FireDamperType))
component.UidType.SetValue(e, component.Uid{Id: id})
wd.EntityMap[id] = e
}
return e
}
// NewElectricSmokeFireDamperEntity 创建电动防火防烟阀实体
func NewElectricSmokeFireDamperEntity(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.ElectricSmokeFireDamperType))
component.UidType.SetValue(e, component.Uid{Id: id})
wd.EntityMap[id] = e
}
return e
}
// NewFireInterconnectionSignalEntity 创建火灾互联互通信号设备实体
func NewFireInterconnectionSignalEntity(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.FireInterconnectionSignalType))
component.UidType.SetValue(e, component.Uid{Id: id})
wd.EntityMap[id] = e
}
return e
}

View File

@ -93,6 +93,7 @@ const (
DeviceExceptionAlarm //报警 有事故信号产生
DeviceExceptionStartTimeout //启动超时
DeviceExceptionModuleFault //模块故障
DeviceExceptionFireAlarmMalfunction //火警故障
)
// DeviceExceptionOperate 设备例外操作
@ -110,6 +111,7 @@ func DeviceExceptionOperate(w ecs.World, deviceId string, opt DeviceExceptionOpt
deviceEntry.RemoveComponent(component.DeviceAlarmTag)
deviceEntry.RemoveComponent(component.DeviceStartTimeoutTag)
deviceEntry.RemoveComponent(component.DeviceModuleFaultTag)
deviceEntry.RemoveComponent(component.DeviceFireAlarmMalfunctionTag)
}
//
switch opt {
@ -131,6 +133,9 @@ func DeviceExceptionOperate(w ecs.World, deviceId string, opt DeviceExceptionOpt
case DeviceExceptionModuleFault:
clearAllExceptions(deviceEntry)
deviceEntry.AddComponent(component.DeviceModuleFaultTag)
case DeviceExceptionFireAlarmMalfunction:
clearAllExceptions(deviceEntry)
deviceEntry.AddComponent(component.DeviceFireAlarmMalfunctionTag)
default:
clearAllExceptions(deviceEntry)
}