Merge branch 'master' of https://git.code.tencent.com/jl-framework/rtss_simulation
This commit is contained in:
commit
bfec6804ce
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc v4.23.1
|
||||
// source: component/common.proto
|
||||
|
||||
@ -26,8 +26,8 @@ type TwoPositionTransform struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Pos int32 `protobuf:"varint,1,opt,name=Pos,proto3" json:"Pos,omitempty"` // 当前位置百分比,[0, 10000],两位小数
|
||||
Speed int32 `protobuf:"varint,2,opt,name=Speed,proto3" json:"Speed,omitempty"`
|
||||
Pos int32 `protobuf:"varint,1,opt,name=pos,proto3" json:"pos,omitempty"` // 当前位置百分比,[0, 10000],两位小数
|
||||
Speed int32 `protobuf:"varint,2,opt,name=speed,proto3" json:"speed,omitempty"`
|
||||
}
|
||||
|
||||
func (x *TwoPositionTransform) Reset() {
|
||||
@ -82,7 +82,7 @@ type BitState struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Val bool `protobuf:"varint,1,opt,name=Val,proto3" json:"Val,omitempty"`
|
||||
Val bool `protobuf:"varint,1,opt,name=val,proto3" json:"val,omitempty"`
|
||||
}
|
||||
|
||||
func (x *BitState) Reset() {
|
||||
@ -130,8 +130,8 @@ type Counter struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Val int32 `protobuf:"varint,1,opt,name=Val,proto3" json:"Val,omitempty"`
|
||||
Step int32 `protobuf:"varint,2,opt,name=Step,proto3" json:"Step,omitempty"`
|
||||
Val int32 `protobuf:"varint,1,opt,name=val,proto3" json:"val,omitempty"`
|
||||
Step int32 `protobuf:"varint,2,opt,name=step,proto3" json:"step,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Counter) Reset() {
|
||||
@ -186,8 +186,8 @@ type CounterDown struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Val int32 `protobuf:"varint,1,opt,name=Val,proto3" json:"Val,omitempty"`
|
||||
Step int32 `protobuf:"varint,2,opt,name=Step,proto3" json:"Step,omitempty"`
|
||||
Val int32 `protobuf:"varint,1,opt,name=val,proto3" json:"val,omitempty"`
|
||||
Step int32 `protobuf:"varint,2,opt,name=step,proto3" json:"step,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CounterDown) Reset() {
|
||||
@ -242,18 +242,18 @@ var file_component_common_proto_rawDesc = []byte{
|
||||
0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d,
|
||||
0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e,
|
||||
0x65, 0x6e, 0x74, 0x22, 0x3e, 0x0a, 0x14, 0x54, 0x77, 0x6f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x50,
|
||||
0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x6f, 0x73, 0x12, 0x14, 0x0a,
|
||||
0x05, 0x53, 0x70, 0x65, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x70,
|
||||
0x6f, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x70,
|
||||
0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x12, 0x14, 0x0a,
|
||||
0x05, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x70,
|
||||
0x65, 0x65, 0x64, 0x22, 0x1c, 0x0a, 0x08, 0x42, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12,
|
||||
0x10, 0x0a, 0x03, 0x56, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x56, 0x61,
|
||||
0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x76, 0x61,
|
||||
0x6c, 0x22, 0x2f, 0x0a, 0x07, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03,
|
||||
0x56, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x56, 0x61, 0x6c, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x53, 0x74, 0x65, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x74,
|
||||
0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x74,
|
||||
0x65, 0x70, 0x22, 0x33, 0x0a, 0x0b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x44, 0x6f, 0x77,
|
||||
0x6e, 0x12, 0x10, 0x0a, 0x03, 0x56, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
|
||||
0x56, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x74, 0x65, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x04, 0x53, 0x74, 0x65, 0x70, 0x42, 0x1d, 0x5a, 0x1b, 0x2e, 0x2f, 0x63, 0x6f, 0x6d,
|
||||
0x6e, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
|
||||
0x76, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x42, 0x1d, 0x5a, 0x1b, 0x2e, 0x2f, 0x63, 0x6f, 0x6d,
|
||||
0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74,
|
||||
0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
513
component/component_proto/turnout.pb.go
Normal file
513
component/component_proto/turnout.pb.go
Normal file
@ -0,0 +1,513 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc v4.23.1
|
||||
// source: component/turnout.proto
|
||||
|
||||
package component_proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Turnout_Fault int32
|
||||
|
||||
const (
|
||||
// 失表
|
||||
Turnout_SB Turnout_Fault = 0
|
||||
// 定位失表
|
||||
Turnout_DWSB Turnout_Fault = 1
|
||||
// 反位失表
|
||||
Turnout_FWSB Turnout_Fault = 2
|
||||
// 挤岔
|
||||
Turnout_JC Turnout_Fault = 3
|
||||
)
|
||||
|
||||
// Enum value maps for Turnout_Fault.
|
||||
var (
|
||||
Turnout_Fault_name = map[int32]string{
|
||||
0: "SB",
|
||||
1: "DWSB",
|
||||
2: "FWSB",
|
||||
}
|
||||
Turnout_Fault_value = map[string]int32{
|
||||
"SB": 0,
|
||||
"DWSB": 1,
|
||||
"FWSB": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Turnout_Fault) Enum() *Turnout_Fault {
|
||||
p := new(Turnout_Fault)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x Turnout_Fault) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (Turnout_Fault) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_component_turnout_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (Turnout_Fault) Type() protoreflect.EnumType {
|
||||
return &file_component_turnout_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x Turnout_Fault) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Turnout_Fault.Descriptor instead.
|
||||
func (Turnout_Fault) EnumDescriptor() ([]byte, []int) {
|
||||
return file_component_turnout_proto_rawDescGZIP(), []int{1, 0}
|
||||
}
|
||||
|
||||
// 道岔位置状态表示组件
|
||||
type TurnoutPosition struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// 是否在定位(实际位置)
|
||||
Dw bool `protobuf:"varint,1,opt,name=dw,proto3" json:"dw,omitempty"`
|
||||
// 是否在反位(实际位置)
|
||||
Fw bool `protobuf:"varint,2,opt,name=fw,proto3" json:"fw,omitempty"`
|
||||
// 定表
|
||||
Db bool `protobuf:"varint,3,opt,name=db,proto3" json:"db,omitempty"`
|
||||
// 反表
|
||||
Fb bool `protobuf:"varint,4,opt,name=fb,proto3" json:"fb,omitempty"`
|
||||
}
|
||||
|
||||
func (x *TurnoutPosition) Reset() {
|
||||
*x = TurnoutPosition{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_component_turnout_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TurnoutPosition) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TurnoutPosition) ProtoMessage() {}
|
||||
|
||||
func (x *TurnoutPosition) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_component_turnout_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TurnoutPosition.ProtoReflect.Descriptor instead.
|
||||
func (*TurnoutPosition) Descriptor() ([]byte, []int) {
|
||||
return file_component_turnout_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *TurnoutPosition) GetDw() bool {
|
||||
if x != nil {
|
||||
return x.Dw
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *TurnoutPosition) GetFw() bool {
|
||||
if x != nil {
|
||||
return x.Fw
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *TurnoutPosition) GetDb() bool {
|
||||
if x != nil {
|
||||
return x.Db
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *TurnoutPosition) GetFb() bool {
|
||||
if x != nil {
|
||||
return x.Fb
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 道岔故障
|
||||
type Turnout struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Fault []Turnout_Fault `protobuf:"varint,1,rep,packed,name=fault,proto3,enum=component.Turnout_Fault" json:"fault,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Turnout) Reset() {
|
||||
*x = Turnout{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_component_turnout_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Turnout) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Turnout) ProtoMessage() {}
|
||||
|
||||
func (x *Turnout) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_component_turnout_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Turnout.ProtoReflect.Descriptor instead.
|
||||
func (*Turnout) Descriptor() ([]byte, []int) {
|
||||
return file_component_turnout_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Turnout) GetFault() []Turnout_Fault {
|
||||
if x != nil {
|
||||
return x.Fault
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 道岔失表故障
|
||||
type TurnoutFaultSB struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *TurnoutFaultSB) Reset() {
|
||||
*x = TurnoutFaultSB{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_component_turnout_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TurnoutFaultSB) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TurnoutFaultSB) ProtoMessage() {}
|
||||
|
||||
func (x *TurnoutFaultSB) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_component_turnout_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TurnoutFaultSB.ProtoReflect.Descriptor instead.
|
||||
func (*TurnoutFaultSB) Descriptor() ([]byte, []int) {
|
||||
return file_component_turnout_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
// 道岔定位失表故障
|
||||
type TurnoutFaultDwsb struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *TurnoutFaultDwsb) Reset() {
|
||||
*x = TurnoutFaultDwsb{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_component_turnout_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TurnoutFaultDwsb) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TurnoutFaultDwsb) ProtoMessage() {}
|
||||
|
||||
func (x *TurnoutFaultDwsb) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_component_turnout_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TurnoutFaultDwsb.ProtoReflect.Descriptor instead.
|
||||
func (*TurnoutFaultDwsb) Descriptor() ([]byte, []int) {
|
||||
return file_component_turnout_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
// 道岔反位失表故障
|
||||
type TurnoutFaultFwsb struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *TurnoutFaultFwsb) Reset() {
|
||||
*x = TurnoutFaultFwsb{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_component_turnout_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TurnoutFaultFwsb) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TurnoutFaultFwsb) ProtoMessage() {}
|
||||
|
||||
func (x *TurnoutFaultFwsb) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_component_turnout_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TurnoutFaultFwsb.ProtoReflect.Descriptor instead.
|
||||
func (*TurnoutFaultFwsb) Descriptor() ([]byte, []int) {
|
||||
return file_component_turnout_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
// 道岔挤岔故障
|
||||
type TurnoutFaultJc struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *TurnoutFaultJc) Reset() {
|
||||
*x = TurnoutFaultJc{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_component_turnout_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TurnoutFaultJc) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TurnoutFaultJc) ProtoMessage() {}
|
||||
|
||||
func (x *TurnoutFaultJc) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_component_turnout_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TurnoutFaultJc.ProtoReflect.Descriptor instead.
|
||||
func (*TurnoutFaultJc) Descriptor() ([]byte, []int) {
|
||||
return file_component_turnout_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
var File_component_turnout_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_component_turnout_proto_rawDesc = []byte{
|
||||
0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2f, 0x74, 0x75, 0x72, 0x6e,
|
||||
0x6f, 0x75, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f,
|
||||
0x6e, 0x65, 0x6e, 0x74, 0x22, 0x51, 0x0a, 0x0f, 0x54, 0x75, 0x72, 0x6e, 0x6f, 0x75, 0x74, 0x50,
|
||||
0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x77, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x02, 0x64, 0x77, 0x12, 0x0e, 0x0a, 0x02, 0x66, 0x77, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x02, 0x66, 0x77, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x02, 0x64, 0x62, 0x12, 0x0e, 0x0a, 0x02, 0x66, 0x62, 0x18, 0x04, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x02, 0x66, 0x62, 0x22, 0x5e, 0x0a, 0x07, 0x54, 0x75, 0x72, 0x6e, 0x6f,
|
||||
0x75, 0x74, 0x12, 0x2e, 0x0a, 0x05, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28,
|
||||
0x0e, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x75,
|
||||
0x72, 0x6e, 0x6f, 0x75, 0x74, 0x2e, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x05, 0x66, 0x61, 0x75,
|
||||
0x6c, 0x74, 0x22, 0x23, 0x0a, 0x05, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x06, 0x0a, 0x02, 0x53,
|
||||
0x42, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x57, 0x53, 0x42, 0x10, 0x01, 0x12, 0x08, 0x0a,
|
||||
0x04, 0x46, 0x57, 0x53, 0x42, 0x10, 0x02, 0x22, 0x10, 0x0a, 0x0e, 0x54, 0x75, 0x72, 0x6e, 0x6f,
|
||||
0x75, 0x74, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x42, 0x22, 0x12, 0x0a, 0x10, 0x54, 0x75, 0x72,
|
||||
0x6e, 0x6f, 0x75, 0x74, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x44, 0x77, 0x73, 0x62, 0x22, 0x12, 0x0a,
|
||||
0x10, 0x54, 0x75, 0x72, 0x6e, 0x6f, 0x75, 0x74, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x77, 0x73,
|
||||
0x62, 0x22, 0x10, 0x0a, 0x0e, 0x54, 0x75, 0x72, 0x6e, 0x6f, 0x75, 0x74, 0x46, 0x61, 0x75, 0x6c,
|
||||
0x74, 0x4a, 0x63, 0x42, 0x1d, 0x5a, 0x1b, 0x2e, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65,
|
||||
0x6e, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_component_turnout_proto_rawDescOnce sync.Once
|
||||
file_component_turnout_proto_rawDescData = file_component_turnout_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_component_turnout_proto_rawDescGZIP() []byte {
|
||||
file_component_turnout_proto_rawDescOnce.Do(func() {
|
||||
file_component_turnout_proto_rawDescData = protoimpl.X.CompressGZIP(file_component_turnout_proto_rawDescData)
|
||||
})
|
||||
return file_component_turnout_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_component_turnout_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_component_turnout_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_component_turnout_proto_goTypes = []interface{}{
|
||||
(Turnout_Fault)(0), // 0: component.Turnout.Fault
|
||||
(*TurnoutPosition)(nil), // 1: component.TurnoutPosition
|
||||
(*Turnout)(nil), // 2: component.Turnout
|
||||
(*TurnoutFaultSB)(nil), // 3: component.TurnoutFaultSB
|
||||
(*TurnoutFaultDwsb)(nil), // 4: component.TurnoutFaultDwsb
|
||||
(*TurnoutFaultFwsb)(nil), // 5: component.TurnoutFaultFwsb
|
||||
(*TurnoutFaultJc)(nil), // 6: component.TurnoutFaultJc
|
||||
}
|
||||
var file_component_turnout_proto_depIdxs = []int32{
|
||||
0, // 0: component.Turnout.fault:type_name -> component.Turnout.Fault
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_component_turnout_proto_init() }
|
||||
func file_component_turnout_proto_init() {
|
||||
if File_component_turnout_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_component_turnout_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TurnoutPosition); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_component_turnout_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Turnout); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_component_turnout_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TurnoutFaultSB); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_component_turnout_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TurnoutFaultDwsb); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_component_turnout_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TurnoutFaultFwsb); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_component_turnout_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TurnoutFaultJc); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_component_turnout_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_component_turnout_proto_goTypes,
|
||||
DependencyIndexes: file_component_turnout_proto_depIdxs,
|
||||
EnumInfos: file_component_turnout_proto_enumTypes,
|
||||
MessageInfos: file_component_turnout_proto_msgTypes,
|
||||
}.Build()
|
||||
File_component_turnout_proto = out.File
|
||||
file_component_turnout_proto_rawDesc = nil
|
||||
file_component_turnout_proto_goTypes = nil
|
||||
file_component_turnout_proto_depIdxs = nil
|
||||
}
|
@ -7,16 +7,17 @@ type LightDrive struct {
|
||||
Td bool
|
||||
}
|
||||
|
||||
// DsTag 灯色标签定义
|
||||
// DsTag 灯显示标签定义
|
||||
type DsTag = ecs.IComponentType
|
||||
|
||||
// 灯色标签
|
||||
// 灯标签
|
||||
var (
|
||||
LdTag DsTag = ecs.NewTag() //绿
|
||||
HdTag = ecs.NewTag() //红
|
||||
UdTag = ecs.NewTag() //黄
|
||||
BdTag = ecs.NewTag() //白
|
||||
AdTag = ecs.NewTag() //蓝
|
||||
FdTag = ecs.NewTag() //封,封灯显示
|
||||
)
|
||||
|
||||
// 组件
|
||||
|
@ -170,12 +170,142 @@ type Signal3XH3Electronic struct {
|
||||
Z3XH3_LXJ *ecs.Entry
|
||||
//引导信号继电器,true-吸合
|
||||
Z3XH3_YXJ *ecs.Entry
|
||||
// 物理黄灯,true-亮
|
||||
Z3XH3_U *ecs.Entry
|
||||
// 物理红灯,true-亮
|
||||
Z3XH3_H *ecs.Entry
|
||||
}
|
||||
|
||||
// Signal3XH3Lsq 联锁驱
|
||||
type Signal3XH3Lsq struct {
|
||||
//true-联锁施加励磁电流驱动继电器DDJ
|
||||
Z3XH3_DDJ_Q bool
|
||||
////true-联锁施加励磁电流驱动继电器LXJ
|
||||
Z3XH3_LXJ_Q bool
|
||||
////true-联锁施加励磁电流驱动继电器LXJ
|
||||
Z3XH3_YXJ_Q bool
|
||||
}
|
||||
|
||||
// Signal3XH3Lsc 联锁采
|
||||
type Signal3XH3Lsc struct {
|
||||
//true-继电器DJ吸起
|
||||
Z3XH3_DJ_Xq bool
|
||||
//true-继电器2DJ吸起
|
||||
Z3XH3_2DJ_Xq bool
|
||||
//true-继电器DDJ落下
|
||||
Z3XH3_DDJ_Lx bool
|
||||
//true-继电器LXJ吸起
|
||||
Z3XH3_LXJ_Xq bool
|
||||
//true-继电器YXJ吸起
|
||||
Z3XH3_YXJ_Xq bool
|
||||
}
|
||||
|
||||
var (
|
||||
Signal3XH3ElectronicType = ecs.NewComponentType[Signal3XH3Electronic]()
|
||||
Signal3XH3LsqType = ecs.NewComponentType[Signal3XH3Lsq]()
|
||||
Signal3XH3LscType = ecs.NewComponentType[Signal3XH3Lsc]()
|
||||
)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Signal3XH4Electronic 电路状态:信号机3XH-4(红-绿-黄) 出站兼道岔防护信号机(三显示不封灯、有单黄显示、无引导)
|
||||
type Signal3XH4Electronic struct {
|
||||
// 点灯继电器,true-吸合,常态落下表示逻辑点灯
|
||||
Z3XH4_DDJ *ecs.Entry
|
||||
//灯丝继电器,true-吸合
|
||||
Z3XH4_DJ *ecs.Entry
|
||||
//列车信号继电器,true-吸合
|
||||
Z3XH4_LXJ *ecs.Entry
|
||||
//开通正线信号继电器,true-吸合
|
||||
Z3XH4_ZXJ *ecs.Entry
|
||||
}
|
||||
|
||||
// Signal3XH4Lsq 联锁驱
|
||||
type Signal3XH4Lsq struct {
|
||||
//true-联锁施加励磁电流驱动继电器DDJ
|
||||
Z3XH4_DDJ_Q bool
|
||||
////true-联锁施加励磁电流驱动继电器LXJ
|
||||
Z3XH4_LXJ_Q bool
|
||||
////true-联锁施加励磁电流驱动继电器ZXJ
|
||||
Z3XH4_ZXJ_Q bool
|
||||
}
|
||||
|
||||
// Signal3XH4Lsc 联锁采
|
||||
type Signal3XH4Lsc struct {
|
||||
//true-继电器DJ吸起
|
||||
Z3XH4_DJ_Xq bool
|
||||
//true-继电器DDJ落下
|
||||
Z3XH4_DDJ_Lx bool
|
||||
//true-继电器LXJ吸起
|
||||
Z3XH4_LXJ_Xq bool
|
||||
//true-继电器ZXJ吸起
|
||||
Z3XH4_ZXJ_Xq bool
|
||||
}
|
||||
|
||||
var (
|
||||
Signal3XH4ElectronicType = ecs.NewComponentType[Signal3XH4Electronic]()
|
||||
Signal3XH4LsqType = ecs.NewComponentType[Signal3XH4Lsq]()
|
||||
Signal3XH4LscType = ecs.NewComponentType[Signal3XH4Lsc]()
|
||||
)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// SignalDCXHElectronic 电路状态:信号机DCXH(蓝-白) 调车信号机
|
||||
type SignalDCXHElectronic struct {
|
||||
//灯丝继电器,true-吸合
|
||||
DCXH_DJ *ecs.Entry
|
||||
//调车信号继电器,true-吸合
|
||||
DCXH_DXJ *ecs.Entry
|
||||
}
|
||||
|
||||
// SignalDCXHLsq 联锁驱
|
||||
type SignalDCXHLsq struct {
|
||||
////true-联锁施加励磁电流驱动继电器DXJ
|
||||
DCXH_DXJ_Q bool
|
||||
}
|
||||
|
||||
// SignalDCXHLsc 联锁采
|
||||
type SignalDCXHLsc struct {
|
||||
//true-继电器DJ吸起
|
||||
DCXH_DJ_Xq bool
|
||||
//true-继电器DXJ吸起
|
||||
DCXH_DXJ_Xq bool
|
||||
}
|
||||
|
||||
var (
|
||||
SignalDCXHElectronicType = ecs.NewComponentType[SignalDCXHElectronic]()
|
||||
SignalDCXHLsqType = ecs.NewComponentType[SignalDCXHLsq]()
|
||||
SignalDCXHLscType = ecs.NewComponentType[SignalDCXHLsc]()
|
||||
)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// SignalJCKXHElectronic 电路状态:信号机JCKXH(红-白-黄) 进/出库列车兼调车信号机(三显示不封灯、有单黄显示、无引导)
|
||||
type SignalJCKXHElectronic struct {
|
||||
//灯丝继电器,true-吸合
|
||||
JCKXH_DJ *ecs.Entry
|
||||
//调车信号继电器,true-吸合
|
||||
JCKXH_DXJ *ecs.Entry
|
||||
//列车信号继电器,true-吸合
|
||||
JCKXH_LXJ *ecs.Entry
|
||||
}
|
||||
|
||||
// SignalJCKXHLsq 联锁驱
|
||||
type SignalJCKXHLsq struct {
|
||||
//true-联锁施加励磁电流驱动继电器DXJ
|
||||
JCKXH_DXJ_Q bool
|
||||
////true-联锁施加励磁电流驱动继电器LXJ
|
||||
JCKXH_LXJ_Q bool
|
||||
}
|
||||
|
||||
// SignalJCKXHLsc 联锁采
|
||||
type SignalJCKXHLsc struct {
|
||||
//true-继电器DJ吸起
|
||||
JCKXH_DJ_Xq bool
|
||||
//true-继电器DXJ吸起
|
||||
JCKXH_DXJ_Xq bool
|
||||
//true-继电器LXJ吸起
|
||||
JCKXH_LXJ_Xq bool
|
||||
}
|
||||
|
||||
var (
|
||||
SignalJCKXHElectronicType = ecs.NewComponentType[SignalJCKXHElectronic]()
|
||||
SignalJCKXHLsqType = ecs.NewComponentType[SignalJCKXHLsq]()
|
||||
SignalJCKXHLscType = ecs.NewComponentType[SignalJCKXHLsc]()
|
||||
)
|
||||
|
@ -1,36 +0,0 @@
|
||||
package component
|
||||
|
||||
import "joylink.club/ecs"
|
||||
|
||||
// Signal3XH4Electronic 电路状态:信号机3XH-4(红-绿-黄) 出站兼道岔防护信号机(三显示不封灯、有单黄显示、无引导)
|
||||
type Signal3XH4Electronic struct {
|
||||
// 点灯继电器,true-吸合,常态落下表示逻辑点灯
|
||||
Z3XH4_DDJ *ecs.Entry
|
||||
//灯丝继电器,true-吸合
|
||||
Z3XH4_DJ *ecs.Entry
|
||||
//列车信号继电器,true-吸合
|
||||
Z3XH4_LXJ *ecs.Entry
|
||||
//开通正线信号继电器,true-吸合
|
||||
Z3XH4_ZXJ *ecs.Entry
|
||||
}
|
||||
|
||||
// Signal3XH4Filament 信号机3XH-4 灯丝状态
|
||||
type Signal3XH4Filament struct {
|
||||
// 物理黄灯,true-灯丝正常
|
||||
Uf bool
|
||||
// 物理绿灯,true-灯丝正常
|
||||
Lf bool
|
||||
// 物理红灯,true-灯丝正常
|
||||
Hf bool
|
||||
// 物理黄灯,true-亮
|
||||
U bool
|
||||
// 物理绿灯,true-亮
|
||||
L bool
|
||||
// 物理红灯,true-亮
|
||||
H bool
|
||||
}
|
||||
|
||||
var (
|
||||
Signal3XH4ElectronicType = ecs.NewComponentType[Signal3XH4Electronic]()
|
||||
Signal3XH4FilamentType = ecs.NewComponentType[Signal3XH4Filament]()
|
||||
)
|
@ -1,28 +0,0 @@
|
||||
package component
|
||||
|
||||
import "joylink.club/ecs"
|
||||
|
||||
// SignalDCXHElectronic 电路状态:信号机DCXH(蓝-白) 调车信号机
|
||||
type SignalDCXHElectronic struct {
|
||||
//灯丝继电器,true-吸合
|
||||
DCXH_DJ *ecs.Entry
|
||||
//调车信号继电器,true-吸合
|
||||
DCXH_DXJ *ecs.Entry
|
||||
}
|
||||
|
||||
// SignalDCXHFilament 信号机DCXH 灯丝状态
|
||||
type SignalDCXHFilament struct {
|
||||
// 物理白灯,true-灯丝正常
|
||||
Bf bool
|
||||
// 物理蓝灯,true-灯丝正常
|
||||
Af bool
|
||||
// 物理白灯,true-亮
|
||||
B bool
|
||||
// 物理蓝灯,true-亮
|
||||
A bool
|
||||
}
|
||||
|
||||
var (
|
||||
SignalDCXHElectronicType = ecs.NewComponentType[SignalDCXHElectronic]()
|
||||
SignalDCXHFilamentType = ecs.NewComponentType[SignalDCXHFilament]()
|
||||
)
|
@ -1,34 +0,0 @@
|
||||
package component
|
||||
|
||||
import "joylink.club/ecs"
|
||||
|
||||
// SignalJCKXHElectronic 电路状态:信号机JCKXH(红-白-黄) 进/出库列车兼调车信号机(三显示不封灯、有单黄显示、无引导)
|
||||
type SignalJCKXHElectronic struct {
|
||||
//灯丝继电器,true-吸合
|
||||
JCKXH_DJ *ecs.Entry
|
||||
//调车信号继电器,true-吸合
|
||||
JCKXH_DXJ *ecs.Entry
|
||||
//列车信号继电器,true-吸合
|
||||
JCKXH_LXJ *ecs.Entry
|
||||
}
|
||||
|
||||
// SignalJCKXHFilament 信号机JCKXH 灯丝状态
|
||||
type SignalJCKXHFilament struct {
|
||||
// 物理黄灯,true-灯丝正常
|
||||
Uf bool
|
||||
// 物理白灯,true-灯丝正常
|
||||
Bf bool
|
||||
// 物理红灯,true-灯丝正常
|
||||
Hf bool
|
||||
// 物理黄灯,true-亮
|
||||
U bool
|
||||
// 物理白灯,true-亮
|
||||
B bool
|
||||
// 物理红灯,true-亮
|
||||
H bool
|
||||
}
|
||||
|
||||
var (
|
||||
SignalJCKXHElectronicType = ecs.NewComponentType[SignalJCKXHElectronic]()
|
||||
SignalJCKXHFilamentType = ecs.NewComponentType[SignalJCKXHFilament]()
|
||||
)
|
@ -2,22 +2,48 @@ package component
|
||||
|
||||
import (
|
||||
"joylink.club/ecs"
|
||||
"joylink.club/rtsssimulation/component/component_proto"
|
||||
)
|
||||
|
||||
// 道岔标签
|
||||
var TurnoutTag = ecs.NewTag()
|
||||
|
||||
// 道岔的实际位置
|
||||
type TurnoutPosition struct {
|
||||
Dw bool // 是否定位(实际位置)
|
||||
Fw bool // 是否反位(实际位置)
|
||||
// // 道岔的实际位置
|
||||
// type TurnoutPosition struct {
|
||||
// Dw bool // 是否定位(实际位置)
|
||||
// Fw bool // 是否反位(实际位置)
|
||||
|
||||
Db bool // 定位表示(表示位置)
|
||||
Fb bool // 反位表示(表示位置)
|
||||
}
|
||||
// Db bool // 定位表示(表示位置)
|
||||
// Fb bool // 反位表示(表示位置)
|
||||
// }
|
||||
|
||||
// 实际道岔的实际位置组件类型
|
||||
var TurnoutPositionType = ecs.NewComponentType[TurnoutPosition]()
|
||||
var TurnoutPositionType = ecs.NewComponentType[component_proto.TurnoutPosition]()
|
||||
|
||||
var (
|
||||
// 失表故障
|
||||
TurnoutFaultSbType = ecs.NewComponentType[component_proto.TurnoutFaultSB]()
|
||||
// 定位失表故障
|
||||
TurnoutFaultDwsbType = ecs.NewComponentType[component_proto.TurnoutFaultDwsb]()
|
||||
// 反位失表故障
|
||||
TurnoutFaultFwsbType = ecs.NewComponentType[component_proto.TurnoutFaultFwsb]()
|
||||
// 挤岔故障类型
|
||||
TurnoutFaultJcType = ecs.NewComponentType[component_proto.TurnoutFaultJc]()
|
||||
)
|
||||
|
||||
func GetTurnoutFaultType(fault component_proto.Turnout_Fault) ecs.IComponentType {
|
||||
switch fault {
|
||||
case component_proto.Turnout_SB:
|
||||
return TurnoutFaultSbType
|
||||
case component_proto.Turnout_DWSB:
|
||||
return TurnoutFaultDwsbType
|
||||
case component_proto.Turnout_FWSB:
|
||||
return TurnoutFaultFwsbType
|
||||
case component_proto.Turnout_JC:
|
||||
return TurnoutFaultJcType
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ZDJ9单机电路元器件
|
||||
type Zdj9OneElectronic struct {
|
||||
|
@ -55,3 +55,12 @@ func NewLights(w ecs.World, lightTags ...component.DsTag) []*ecs.Entry {
|
||||
}
|
||||
return ls
|
||||
}
|
||||
|
||||
// IsLightFd 灯是否被封(如Signal 3xh3 红绿黄三显示封绿灯)
|
||||
func IsLightFd(lightEntry *ecs.Entry) bool {
|
||||
if lightEntry.HasComponent(component.LightDriveType) && lightEntry.HasComponent(component.BitStateType) {
|
||||
return lightEntry.HasComponent(component.FdTag)
|
||||
} else {
|
||||
panic("IsLightFd 参数lightEntry的值非灯实体")
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,9 @@ func loadSignal3xh3(w ecs.World, signal *repository.Signal, signalEntry *ecs.Ent
|
||||
|
||||
if len(elecs) == 5 { //3xh3组合类型包含5个继电器
|
||||
signalEntry.AddComponent(component.Signal3XH3ElectronicType)
|
||||
signalEntry.AddComponent(component.Signal3XH3LsqType)
|
||||
signalEntry.AddComponent(component.Signal3XH3LscType)
|
||||
signalEntry.AddComponent(component.SignalLightsType)
|
||||
//
|
||||
elecState := &component.Signal3XH3Electronic{}
|
||||
for _, elec := range elecs {
|
||||
@ -32,6 +35,11 @@ func loadSignal3xh3(w ecs.World, signal *repository.Signal, signalEntry *ecs.Ent
|
||||
}
|
||||
//
|
||||
component.Signal3XH3ElectronicType.Set(signalEntry, elecState)
|
||||
component.Signal3XH3LsqType.Set(signalEntry, &component.Signal3XH3Lsq{})
|
||||
component.Signal3XH3LscType.Set(signalEntry, &component.Signal3XH3Lsc{})
|
||||
component.SignalLightsType.Set(signalEntry, newSignalLights(w, component.HdTag, component.LdTag, component.UdTag))
|
||||
//封绿灯,即有绿灯但绿被封
|
||||
component.SignalLightsType.Get(signalEntry).GetLightByTag(component.LdTag).AddComponent(component.FdTag)
|
||||
} else {
|
||||
return fmt.Errorf("id=[%s]的信号机3xh3,电子元器件数量须为5", signal.Id())
|
||||
}
|
||||
|
@ -12,7 +12,9 @@ func loadSignal3xh4(w ecs.World, signal *repository.Signal, signalEntry *ecs.Ent
|
||||
|
||||
if len(elecs) == 4 { //3xh4组合类型包含4个继电器
|
||||
signalEntry.AddComponent(component.Signal3XH4ElectronicType)
|
||||
signalEntry.AddComponent(component.Signal3XH4FilamentType)
|
||||
signalEntry.AddComponent(component.Signal3XH4LsqType)
|
||||
signalEntry.AddComponent(component.Signal3XH4LscType)
|
||||
signalEntry.AddComponent(component.SignalLightsType)
|
||||
//
|
||||
elecState := &component.Signal3XH4Electronic{}
|
||||
for _, elec := range elecs {
|
||||
@ -31,7 +33,9 @@ func loadSignal3xh4(w ecs.World, signal *repository.Signal, signalEntry *ecs.Ent
|
||||
}
|
||||
//
|
||||
component.Signal3XH4ElectronicType.Set(signalEntry, elecState)
|
||||
component.Signal3XH4FilamentType.Set(signalEntry, &component.Signal3XH4Filament{Uf: true, Lf: true, Hf: true, U: false, L: false, H: false})
|
||||
component.Signal3XH4LsqType.Set(signalEntry, &component.Signal3XH4Lsq{})
|
||||
component.Signal3XH4LscType.Set(signalEntry, &component.Signal3XH4Lsc{})
|
||||
component.SignalLightsType.Set(signalEntry, newSignalLights(w, component.HdTag, component.LdTag, component.UdTag))
|
||||
} else {
|
||||
return fmt.Errorf("id=[%s]的信号机3xh4,电子元器件数量须为4", signal.Id())
|
||||
}
|
||||
|
@ -12,7 +12,9 @@ func loadSignalDcxh(w ecs.World, signal *repository.Signal, signalEntry *ecs.Ent
|
||||
|
||||
if len(elecs) == 2 { //dcxh组合类型包含2个继电器
|
||||
signalEntry.AddComponent(component.SignalDCXHElectronicType)
|
||||
signalEntry.AddComponent(component.SignalDCXHFilamentType)
|
||||
signalEntry.AddComponent(component.SignalDCXHLsqType)
|
||||
signalEntry.AddComponent(component.SignalDCXHLscType)
|
||||
signalEntry.AddComponent(component.SignalLightsType)
|
||||
//
|
||||
elecState := &component.SignalDCXHElectronic{}
|
||||
for _, elec := range elecs {
|
||||
@ -27,7 +29,9 @@ func loadSignalDcxh(w ecs.World, signal *repository.Signal, signalEntry *ecs.Ent
|
||||
}
|
||||
//
|
||||
component.SignalDCXHElectronicType.Set(signalEntry, elecState)
|
||||
component.SignalDCXHFilamentType.Set(signalEntry, &component.SignalDCXHFilament{Bf: true, Af: true, B: false, A: false})
|
||||
component.SignalDCXHLsqType.Set(signalEntry, &component.SignalDCXHLsq{})
|
||||
component.SignalDCXHLscType.Set(signalEntry, &component.SignalDCXHLsc{})
|
||||
component.SignalLightsType.Set(signalEntry, newSignalLights(w, component.AdTag, component.BdTag))
|
||||
} else {
|
||||
return fmt.Errorf("id=[%s]的信号机dcxh,电子元器件数量须为2", signal.Id())
|
||||
}
|
||||
|
@ -12,7 +12,9 @@ func loadSignalJckxh(w ecs.World, signal *repository.Signal, signalEntry *ecs.En
|
||||
|
||||
if len(elecs) == 3 { //jckxh组合类型包含3个继电器
|
||||
signalEntry.AddComponent(component.SignalJCKXHElectronicType)
|
||||
signalEntry.AddComponent(component.SignalJCKXHFilamentType)
|
||||
signalEntry.AddComponent(component.SignalJCKXHLsqType)
|
||||
signalEntry.AddComponent(component.SignalJCKXHLscType)
|
||||
signalEntry.AddComponent(component.SignalLightsType)
|
||||
//
|
||||
elecState := &component.SignalJCKXHElectronic{}
|
||||
for _, elec := range elecs {
|
||||
@ -29,7 +31,9 @@ func loadSignalJckxh(w ecs.World, signal *repository.Signal, signalEntry *ecs.En
|
||||
}
|
||||
//
|
||||
component.SignalJCKXHElectronicType.Set(signalEntry, elecState)
|
||||
component.SignalJCKXHFilamentType.Set(signalEntry, &component.SignalJCKXHFilament{Uf: true, Bf: true, Hf: true, U: false, B: false, H: false})
|
||||
component.SignalJCKXHLsqType.Set(signalEntry, &component.SignalJCKXHLsq{})
|
||||
component.SignalJCKXHLscType.Set(signalEntry, &component.SignalJCKXHLsc{})
|
||||
component.SignalLightsType.Set(signalEntry, newSignalLights(w, component.HdTag, component.BdTag, component.UdTag))
|
||||
} else {
|
||||
return fmt.Errorf("id=[%s]的信号机jckxh,电子元器件数量须为3", signal.Id())
|
||||
}
|
||||
|
@ -15,11 +15,8 @@ func DriveSignal3XH3Dd(w ecs.World, signalId string, dd bool) {
|
||||
wd := entity.GetWorldData(w)
|
||||
signalEntry, ok := wd.EntityMap[signalId]
|
||||
if ok {
|
||||
state := component.Signal3XH3ElectronicType.Get(signalEntry)
|
||||
driveDd := component.RelayDriveType.Get(state.Z3XH3_DDJ)
|
||||
//点灯继电器落下时才点灯
|
||||
driveDd.Td = !dd
|
||||
driveDd.Xq = !dd
|
||||
lsq := component.Signal3XH3LsqType.Get(signalEntry)
|
||||
lsq.Z3XH3_DDJ_Q = !dd
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -30,13 +27,9 @@ func DriveSignal3XH3Lx(w ecs.World, signalId string) {
|
||||
wd := entity.GetWorldData(w)
|
||||
signalEntry, ok := wd.EntityMap[signalId]
|
||||
if ok {
|
||||
state := component.Signal3XH3ElectronicType.Get(signalEntry)
|
||||
driveLx := component.RelayDriveType.Get(state.Z3XH3_LXJ)
|
||||
driveLx.Td = true
|
||||
driveLx.Xq = true
|
||||
driveYx := component.RelayDriveType.Get(state.Z3XH3_YXJ)
|
||||
driveYx.Td = false
|
||||
driveYx.Xq = false
|
||||
lsq := component.Signal3XH3LsqType.Get(signalEntry)
|
||||
lsq.Z3XH3_LXJ_Q = true
|
||||
lsq.Z3XH3_YXJ_Q = false
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -47,13 +40,9 @@ func DriveSignal3XH3Yx(w ecs.World, signalId string) {
|
||||
wd := entity.GetWorldData(w)
|
||||
signalEntry, ok := wd.EntityMap[signalId]
|
||||
if ok {
|
||||
state := component.Signal3XH3ElectronicType.Get(signalEntry)
|
||||
driveLx := component.RelayDriveType.Get(state.Z3XH3_LXJ)
|
||||
driveLx.Td = false
|
||||
driveLx.Xq = false
|
||||
driveYx := component.RelayDriveType.Get(state.Z3XH3_YXJ)
|
||||
driveYx.Td = true
|
||||
driveYx.Xq = true
|
||||
lsq := component.Signal3XH3LsqType.Get(signalEntry)
|
||||
lsq.Z3XH3_LXJ_Q = false
|
||||
lsq.Z3XH3_YXJ_Q = true
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -64,13 +53,9 @@ func DriveSignal3XH3Non(w ecs.World, signalId string) {
|
||||
wd := entity.GetWorldData(w)
|
||||
signalEntry, ok := wd.EntityMap[signalId]
|
||||
if ok {
|
||||
state := component.Signal3XH3ElectronicType.Get(signalEntry)
|
||||
driveLx := component.RelayDriveType.Get(state.Z3XH3_LXJ)
|
||||
driveLx.Td = false
|
||||
driveLx.Xq = false
|
||||
driveYx := component.RelayDriveType.Get(state.Z3XH3_YXJ)
|
||||
driveYx.Td = false
|
||||
driveYx.Xq = false
|
||||
lsq := component.Signal3XH3LsqType.Get(signalEntry)
|
||||
lsq.Z3XH3_LXJ_Q = false
|
||||
lsq.Z3XH3_YXJ_Q = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -15,11 +15,8 @@ func DriveSignal3XH4Dd(w ecs.World, signalId string, dd bool) {
|
||||
wd := entity.GetWorldData(w)
|
||||
signalEntry, ok := wd.EntityMap[signalId]
|
||||
if ok {
|
||||
state := component.Signal3XH4ElectronicType.Get(signalEntry)
|
||||
driveDd := component.RelayDriveType.Get(state.Z3XH4_DDJ)
|
||||
//点灯继电器落下时才点灯
|
||||
driveDd.Td = !dd
|
||||
driveDd.Xq = !dd
|
||||
lsq := component.Signal3XH4LsqType.Get(signalEntry)
|
||||
lsq.Z3XH4_DDJ_Q = !dd
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -31,13 +28,9 @@ func DriveSignal3XH4Lx(w ecs.World, signalId string, zx bool) {
|
||||
wd := entity.GetWorldData(w)
|
||||
signalEntry, ok := wd.EntityMap[signalId]
|
||||
if ok {
|
||||
state := component.Signal3XH4ElectronicType.Get(signalEntry)
|
||||
driveLx := component.RelayDriveType.Get(state.Z3XH4_LXJ)
|
||||
driveLx.Td = true
|
||||
driveLx.Xq = true
|
||||
driveZx := component.RelayDriveType.Get(state.Z3XH4_ZXJ)
|
||||
driveZx.Td = zx
|
||||
driveZx.Xq = zx
|
||||
lsq := component.Signal3XH4LsqType.Get(signalEntry)
|
||||
lsq.Z3XH4_LXJ_Q = true
|
||||
lsq.Z3XH4_ZXJ_Q = zx
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -48,13 +41,9 @@ func DriveSignal3XH4Non(w ecs.World, signalId string) {
|
||||
wd := entity.GetWorldData(w)
|
||||
signalEntry, ok := wd.EntityMap[signalId]
|
||||
if ok {
|
||||
state := component.Signal3XH4ElectronicType.Get(signalEntry)
|
||||
driveLx := component.RelayDriveType.Get(state.Z3XH4_LXJ)
|
||||
driveLx.Td = false
|
||||
driveLx.Xq = false
|
||||
driveZx := component.RelayDriveType.Get(state.Z3XH4_ZXJ)
|
||||
driveZx.Td = false
|
||||
driveZx.Xq = false
|
||||
lsq := component.Signal3XH4LsqType.Get(signalEntry)
|
||||
lsq.Z3XH4_LXJ_Q = false
|
||||
lsq.Z3XH4_ZXJ_Q = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -14,10 +14,8 @@ func DriveSignalDCXHDx(w ecs.World, signalId string) {
|
||||
wd := entity.GetWorldData(w)
|
||||
signalEntry, ok := wd.EntityMap[signalId]
|
||||
if ok {
|
||||
state := component.SignalDCXHElectronicType.Get(signalEntry)
|
||||
driveDx := component.RelayDriveType.Get(state.DCXH_DXJ)
|
||||
driveDx.Td = true
|
||||
driveDx.Xq = true
|
||||
lsq := component.SignalDCXHLsqType.Get(signalEntry)
|
||||
lsq.DCXH_DXJ_Q = true
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -28,10 +26,8 @@ func DriveSignalDCXHNon(w ecs.World, signalId string) {
|
||||
wd := entity.GetWorldData(w)
|
||||
signalEntry, ok := wd.EntityMap[signalId]
|
||||
if ok {
|
||||
state := component.SignalDCXHElectronicType.Get(signalEntry)
|
||||
driveDx := component.RelayDriveType.Get(state.DCXH_DXJ)
|
||||
driveDx.Td = false
|
||||
driveDx.Xq = false
|
||||
lsq := component.SignalDCXHLsqType.Get(signalEntry)
|
||||
lsq.DCXH_DXJ_Q = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -14,13 +14,9 @@ func DriveSignalJCKXHLx(w ecs.World, signalId string) {
|
||||
wd := entity.GetWorldData(w)
|
||||
signalEntry, ok := wd.EntityMap[signalId]
|
||||
if ok {
|
||||
state := component.SignalJCKXHElectronicType.Get(signalEntry)
|
||||
driveLx := component.RelayDriveType.Get(state.JCKXH_LXJ)
|
||||
driveLx.Td = true
|
||||
driveLx.Xq = true
|
||||
driveDx := component.RelayDriveType.Get(state.JCKXH_DXJ)
|
||||
driveDx.Td = false
|
||||
driveDx.Xq = false
|
||||
lsq := component.SignalJCKXHLsqType.Get(signalEntry)
|
||||
lsq.JCKXH_LXJ_Q = true
|
||||
lsq.JCKXH_DXJ_Q = false
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -31,13 +27,9 @@ func DriveSignalJCKXHDx(w ecs.World, signalId string) {
|
||||
wd := entity.GetWorldData(w)
|
||||
signalEntry, ok := wd.EntityMap[signalId]
|
||||
if ok {
|
||||
state := component.SignalJCKXHElectronicType.Get(signalEntry)
|
||||
driveLx := component.RelayDriveType.Get(state.JCKXH_LXJ)
|
||||
driveLx.Td = false
|
||||
driveLx.Xq = false
|
||||
driveDx := component.RelayDriveType.Get(state.JCKXH_DXJ)
|
||||
driveDx.Td = true
|
||||
driveDx.Xq = true
|
||||
lsq := component.SignalJCKXHLsqType.Get(signalEntry)
|
||||
lsq.JCKXH_LXJ_Q = false
|
||||
lsq.JCKXH_DXJ_Q = true
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -48,13 +40,9 @@ func DriveSignalJCKXHNon(w ecs.World, signalId string) {
|
||||
wd := entity.GetWorldData(w)
|
||||
signalEntry, ok := wd.EntityMap[signalId]
|
||||
if ok {
|
||||
state := component.SignalJCKXHElectronicType.Get(signalEntry)
|
||||
driveLx := component.RelayDriveType.Get(state.JCKXH_LXJ)
|
||||
driveLx.Td = false
|
||||
driveLx.Xq = false
|
||||
driveDx := component.RelayDriveType.Get(state.JCKXH_DXJ)
|
||||
driveDx.Td = false
|
||||
driveDx.Xq = false
|
||||
lsq := component.SignalJCKXHLsqType.Get(signalEntry)
|
||||
lsq.JCKXH_LXJ_Q = false
|
||||
lsq.JCKXH_DXJ_Q = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -5,11 +5,48 @@ import (
|
||||
|
||||
"joylink.club/ecs"
|
||||
"joylink.club/rtsssimulation/component"
|
||||
"joylink.club/rtsssimulation/component/component_proto"
|
||||
"joylink.club/rtsssimulation/entity"
|
||||
)
|
||||
|
||||
// 道岔功能接口
|
||||
|
||||
// 设置道岔故障
|
||||
func SetTurnoutFault(w ecs.World, id string, fault component_proto.Turnout_Fault) error {
|
||||
result := <-ecs.Request[ecs.EmptyType](w, func() ecs.Result[ecs.EmptyType] {
|
||||
wd := entity.GetWorldData(w)
|
||||
entry, ok := wd.EntityMap[id]
|
||||
if ok {
|
||||
ct := component.GetTurnoutFaultType(fault)
|
||||
if !entry.HasComponent(ct) {
|
||||
entry.AddComponent(ct)
|
||||
}
|
||||
} else {
|
||||
return ecs.NewErrResult(fmt.Errorf("未找到id=%s的道岔", id))
|
||||
}
|
||||
return ecs.NewOkEmptyResult()
|
||||
})
|
||||
return result.Err
|
||||
}
|
||||
|
||||
// 取消道岔故障
|
||||
func CancleTurnoutFault(w ecs.World, id string, fault component_proto.Turnout_Fault) error {
|
||||
result := <-ecs.Request[ecs.EmptyType](w, func() ecs.Result[ecs.EmptyType] {
|
||||
wd := entity.GetWorldData(w)
|
||||
entry, ok := wd.EntityMap[id]
|
||||
if ok {
|
||||
ct := component.GetTurnoutFaultType(fault)
|
||||
if entry.HasComponent(ct) {
|
||||
entry.RemoveComponent(ct)
|
||||
}
|
||||
} else {
|
||||
return ecs.NewErrResult(fmt.Errorf("未找到id=%s的道岔", id))
|
||||
}
|
||||
return ecs.NewOkEmptyResult()
|
||||
})
|
||||
return result.Err
|
||||
}
|
||||
|
||||
// 驱动道岔转辙机
|
||||
// id - 道岔uid
|
||||
// dc - 定操/反操
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 37e06d2aaf64828da677131dfb790bd0de7cef56
|
||||
Subproject commit 1c6eed67ea95b41e7b3cae7375f0f740202fd22b
|
@ -6,23 +6,23 @@ option go_package = "./component/component_proto";
|
||||
|
||||
// 两个稳态位置转换组件
|
||||
message TwoPositionTransform {
|
||||
int32 Pos = 1; // 当前位置百分比,[0, 10000],两位小数
|
||||
int32 Speed = 2;
|
||||
int32 pos = 1; // 当前位置百分比,[0, 10000],两位小数
|
||||
int32 speed = 2;
|
||||
}
|
||||
|
||||
// 仅有两状态的组件
|
||||
message BitState {
|
||||
bool Val = 1;
|
||||
bool val = 1;
|
||||
}
|
||||
|
||||
// 计数/计时组件
|
||||
message Counter {
|
||||
int32 Val = 1;
|
||||
int32 Step = 2;
|
||||
int32 val = 1;
|
||||
int32 step = 2;
|
||||
}
|
||||
|
||||
// 倒数/倒计时组件
|
||||
message CounterDown {
|
||||
int32 Val = 1;
|
||||
int32 Step = 2;
|
||||
int32 val = 1;
|
||||
int32 step = 2;
|
||||
}
|
||||
|
48
proto/src/component/turnout.proto
Normal file
48
proto/src/component/turnout.proto
Normal file
@ -0,0 +1,48 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package component;
|
||||
|
||||
option go_package = "./component/component_proto";
|
||||
|
||||
// 道岔位置状态表示组件
|
||||
message TurnoutPosition {
|
||||
// 是否在定位(实际位置)
|
||||
bool dw = 1;
|
||||
// 是否在反位(实际位置)
|
||||
bool fw = 2;
|
||||
|
||||
// 定表
|
||||
bool db = 3;
|
||||
// 反表
|
||||
bool fb = 4;
|
||||
}
|
||||
|
||||
// 道岔故障
|
||||
message Turnout {
|
||||
enum Fault {
|
||||
// 失表
|
||||
SB = 0;
|
||||
// 定位失表
|
||||
DWSB = 1;
|
||||
// 反位失表
|
||||
FWSB = 2;
|
||||
}
|
||||
repeated Fault fault = 1;
|
||||
}
|
||||
// 道岔失表故障
|
||||
message TurnoutFaultSB {
|
||||
|
||||
}
|
||||
// 道岔定位失表故障
|
||||
message TurnoutFaultDwsb {
|
||||
|
||||
}
|
||||
// 道岔反位失表故障
|
||||
message TurnoutFaultFwsb {
|
||||
|
||||
}
|
||||
// 道岔挤岔故障
|
||||
message TurnoutFaultJc {
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc v4.23.1
|
||||
// source: model.proto
|
||||
|
||||
|
@ -11,7 +11,11 @@ type Signal3XH2System struct {
|
||||
}
|
||||
|
||||
func NewSignal3XH2System() *Signal3XH2System {
|
||||
return &Signal3XH2System{query: ecs.NewQuery(filter.Contains(component.Signal3XH2ElectronicType))}
|
||||
return &Signal3XH2System{query: ecs.NewQuery(filter.Contains(
|
||||
component.Signal3XH2ElectronicType,
|
||||
component.Signal3XH2LsqType,
|
||||
component.Signal3XH2LscType,
|
||||
component.SignalLightsType))}
|
||||
}
|
||||
|
||||
// Update world 执行
|
||||
|
@ -11,54 +11,98 @@ type Signal3XH3System struct {
|
||||
}
|
||||
|
||||
func NewSignal3XH3System() *Signal3XH3System {
|
||||
return &Signal3XH3System{query: ecs.NewQuery(filter.Contains(component.Signal3XH3ElectronicType))}
|
||||
return &Signal3XH3System{query: ecs.NewQuery(filter.Contains(
|
||||
component.Signal3XH3ElectronicType,
|
||||
component.Signal3XH3LsqType,
|
||||
component.Signal3XH3LscType,
|
||||
component.SignalLightsType))}
|
||||
}
|
||||
|
||||
// Update world 执行
|
||||
func (s *Signal3XH3System) Update(w ecs.World) {
|
||||
s.query.Each(w, func(e *ecs.Entry) {
|
||||
state := component.Signal3XH3ElectronicType.Get(e)
|
||||
s.query.Each(w, func(entry *ecs.Entry) {
|
||||
state := component.Signal3XH3ElectronicType.Get(entry)
|
||||
lsq := component.Signal3XH3LsqType.Get(entry)
|
||||
lsc := component.Signal3XH3LscType.Get(entry)
|
||||
lights := component.SignalLightsType.Get(entry)
|
||||
Z3XH3_H := lights.GetLightByTag(component.HdTag)
|
||||
Z3XH3_U := lights.GetLightByTag(component.UdTag)
|
||||
//
|
||||
s.calculateU(state)
|
||||
s.calculateH(state)
|
||||
s.calculateDJ(state)
|
||||
s.calculate2DJ(state)
|
||||
s.calculateLsq(state, lsq)
|
||||
s.calculateU(state, Z3XH3_U)
|
||||
s.calculateH(state, Z3XH3_H)
|
||||
s.calculateDJ(state, Z3XH3_U, Z3XH3_H)
|
||||
s.calculate2DJ(state, Z3XH3_U)
|
||||
s.calculateLsc(state, lsc)
|
||||
})
|
||||
}
|
||||
|
||||
func (s *Signal3XH3System) calculateU(state *component.Signal3XH3Electronic) {
|
||||
// 联锁驱
|
||||
func (s *Signal3XH3System) calculateLsq(state *component.Signal3XH3Electronic, lsq *component.Signal3XH3Lsq) {
|
||||
ddj := component.RelayDriveType.Get(state.Z3XH3_DDJ)
|
||||
lxj := component.RelayDriveType.Get(state.Z3XH3_LXJ)
|
||||
yxj := component.RelayDriveType.Get(state.Z3XH3_YXJ)
|
||||
//
|
||||
ddjQ := lsq.Z3XH3_DDJ_Q
|
||||
ddj.Td = ddjQ
|
||||
ddj.Xq = ddjQ
|
||||
//
|
||||
lxjQ := lsq.Z3XH3_LXJ_Q
|
||||
lxj.Td = lxjQ
|
||||
lxj.Xq = lxjQ
|
||||
//
|
||||
yxjQ := lsq.Z3XH3_YXJ_Q
|
||||
yxj.Td = yxjQ
|
||||
yxj.Xq = yxjQ
|
||||
}
|
||||
|
||||
// 联锁采
|
||||
func (s *Signal3XH3System) calculateLsc(state *component.Signal3XH3Electronic, lsc *component.Signal3XH3Lsc) {
|
||||
ddj := component.BitStateType.Get(state.Z3XH3_DDJ)
|
||||
lxj := component.BitStateType.Get(state.Z3XH3_LXJ)
|
||||
dj := component.BitStateType.Get(state.Z3XH3_DJ)
|
||||
edj := component.BitStateType.Get(state.Z3XH3_2DJ)
|
||||
yxj := component.BitStateType.Get(state.Z3XH3_YXJ)
|
||||
//
|
||||
lsc.Z3XH3_2DJ_Xq = edj.Val
|
||||
lsc.Z3XH3_DJ_Xq = dj.Val
|
||||
lsc.Z3XH3_DDJ_Lx = !ddj.Val
|
||||
lsc.Z3XH3_LXJ_Xq = lxj.Val
|
||||
lsc.Z3XH3_YXJ_Xq = yxj.Val
|
||||
}
|
||||
func (s *Signal3XH3System) calculateU(state *component.Signal3XH3Electronic, Z3XH3_U *ecs.Entry) {
|
||||
ddj := component.BitStateType.Get(state.Z3XH3_DDJ)
|
||||
lxj := component.BitStateType.Get(state.Z3XH3_LXJ)
|
||||
dj := component.BitStateType.Get(state.Z3XH3_DJ)
|
||||
yxj := component.BitStateType.Get(state.Z3XH3_YXJ)
|
||||
isU := !ddj.Val && !lxj.Val && dj.Val && yxj.Val || !ddj.Val && lxj.Val
|
||||
driveU := component.LightDriveType.Get(state.Z3XH3_U)
|
||||
driveU := component.LightDriveType.Get(Z3XH3_U)
|
||||
driveU.Td = isU
|
||||
|
||||
}
|
||||
func (s *Signal3XH3System) calculateH(state *component.Signal3XH3Electronic) {
|
||||
func (s *Signal3XH3System) calculateH(state *component.Signal3XH3Electronic, Z3XH3_H *ecs.Entry) {
|
||||
ddj := component.BitStateType.Get(state.Z3XH3_DDJ)
|
||||
lxj := component.BitStateType.Get(state.Z3XH3_LXJ)
|
||||
isH := !ddj.Val && !lxj.Val
|
||||
driveH := component.LightDriveType.Get(state.Z3XH3_H)
|
||||
driveH := component.LightDriveType.Get(Z3XH3_H)
|
||||
driveH.Td = isH
|
||||
}
|
||||
func (s *Signal3XH3System) calculateDJ(state *component.Signal3XH3Electronic) {
|
||||
func (s *Signal3XH3System) calculateDJ(state *component.Signal3XH3Electronic, Z3XH3_U *ecs.Entry, Z3XH3_H *ecs.Entry) {
|
||||
ddj := component.BitStateType.Get(state.Z3XH3_DDJ)
|
||||
lxj := component.BitStateType.Get(state.Z3XH3_LXJ)
|
||||
ud := component.BitStateType.Get(state.Z3XH3_U)
|
||||
hd := component.BitStateType.Get(state.Z3XH3_H)
|
||||
ud := component.BitStateType.Get(Z3XH3_U)
|
||||
hd := component.BitStateType.Get(Z3XH3_H)
|
||||
isDJ := ud.Val && !ddj.Val && lxj.Val || hd.Val && !ddj.Val && !lxj.Val
|
||||
drive := component.RelayDriveType.Get(state.Z3XH3_DJ)
|
||||
drive.Td = isDJ
|
||||
drive.Xq = isDJ
|
||||
}
|
||||
func (s *Signal3XH3System) calculate2DJ(state *component.Signal3XH3Electronic) {
|
||||
func (s *Signal3XH3System) calculate2DJ(state *component.Signal3XH3Electronic, Z3XH3_U *ecs.Entry) {
|
||||
ddj := component.BitStateType.Get(state.Z3XH3_DDJ)
|
||||
lxj := component.BitStateType.Get(state.Z3XH3_LXJ)
|
||||
dj := component.BitStateType.Get(state.Z3XH3_DJ)
|
||||
yxj := component.BitStateType.Get(state.Z3XH3_YXJ)
|
||||
ud := component.BitStateType.Get(state.Z3XH3_U)
|
||||
ud := component.BitStateType.Get(Z3XH3_U)
|
||||
is2DJ := ud.Val && !ddj.Val && !lxj.Val && dj.Val && yxj.Val
|
||||
drive := component.RelayDriveType.Get(state.Z3XH3_2DJ)
|
||||
drive.Td = is2DJ
|
||||
|
@ -11,56 +11,101 @@ type Signal3XH4System struct {
|
||||
}
|
||||
|
||||
func NewSignal3XH4System() *Signal3XH4System {
|
||||
return &Signal3XH4System{query: ecs.NewQuery(filter.Contains(component.Signal3XH4ElectronicType, component.Signal3XH4FilamentType))}
|
||||
return &Signal3XH4System{query: ecs.NewQuery(filter.Contains(
|
||||
component.Signal3XH4ElectronicType,
|
||||
component.Signal3XH4LsqType,
|
||||
component.Signal3XH4LscType,
|
||||
component.SignalLightsType))}
|
||||
}
|
||||
|
||||
// Update world 执行
|
||||
func (s *Signal3XH4System) Update(w ecs.World) {
|
||||
s.query.Each(w, func(e *ecs.Entry) {
|
||||
state := component.Signal3XH4ElectronicType.Get(e)
|
||||
filament := component.Signal3XH4FilamentType.Get(e)
|
||||
s.query.Each(w, func(entry *ecs.Entry) {
|
||||
state := component.Signal3XH4ElectronicType.Get(entry)
|
||||
lsq := component.Signal3XH4LsqType.Get(entry)
|
||||
lsc := component.Signal3XH4LscType.Get(entry)
|
||||
lights := component.SignalLightsType.Get(entry)
|
||||
Z3XH4_H := lights.GetLightByTag(component.HdTag)
|
||||
Z3XH4_L := lights.GetLightByTag(component.LdTag)
|
||||
Z3XH4_U := lights.GetLightByTag(component.UdTag)
|
||||
//
|
||||
s.calculateU(state, filament)
|
||||
s.calculateL(state, filament)
|
||||
s.calculateH(w, state, filament)
|
||||
s.calculateDJ(w, e, state, filament)
|
||||
s.calculateLsq(state, lsq)
|
||||
s.calculateU(state, Z3XH4_U)
|
||||
s.calculateL(state, Z3XH4_L)
|
||||
s.calculateH(state, Z3XH4_H)
|
||||
s.calculateDJ(state, Z3XH4_H, Z3XH4_L, Z3XH4_U)
|
||||
s.calculateLsc(state, lsc)
|
||||
})
|
||||
}
|
||||
|
||||
func (s *Signal3XH4System) calculateU(state *component.Signal3XH4Electronic, filament *component.Signal3XH4Filament) {
|
||||
ddj := component.BitStateType.Get(state.Z3XH4_DDJ)
|
||||
lxj := component.BitStateType.Get(state.Z3XH4_LXJ)
|
||||
zxj := component.BitStateType.Get(state.Z3XH4_ZXJ)
|
||||
isU := filament.Uf && !ddj.Val && lxj.Val && !zxj.Val
|
||||
filament.U = isU
|
||||
// 联锁驱
|
||||
func (s *Signal3XH4System) calculateLsq(state *component.Signal3XH4Electronic, lsq *component.Signal3XH4Lsq) {
|
||||
ddj := component.RelayDriveType.Get(state.Z3XH4_DDJ)
|
||||
lxj := component.RelayDriveType.Get(state.Z3XH4_LXJ)
|
||||
zxj := component.RelayDriveType.Get(state.Z3XH4_ZXJ)
|
||||
//
|
||||
ddjQ := lsq.Z3XH4_DDJ_Q
|
||||
ddj.Td = ddjQ
|
||||
ddj.Xq = ddjQ
|
||||
//
|
||||
lxjQ := lsq.Z3XH4_LXJ_Q
|
||||
lxj.Td = lxjQ
|
||||
lxj.Xq = lxjQ
|
||||
//
|
||||
zxjQ := lsq.Z3XH4_ZXJ_Q
|
||||
zxj.Td = zxjQ
|
||||
zxj.Xq = zxjQ
|
||||
}
|
||||
|
||||
func (s *Signal3XH4System) calculateL(state *component.Signal3XH4Electronic, filament *component.Signal3XH4Filament) {
|
||||
// 联锁采
|
||||
func (s *Signal3XH4System) calculateLsc(state *component.Signal3XH4Electronic, lsc *component.Signal3XH4Lsc) {
|
||||
ddj := component.BitStateType.Get(state.Z3XH4_DDJ)
|
||||
lxj := component.BitStateType.Get(state.Z3XH4_LXJ)
|
||||
zxj := component.BitStateType.Get(state.Z3XH4_ZXJ)
|
||||
isL := filament.Lf && !ddj.Val && lxj.Val && zxj.Val
|
||||
filament.L = isL
|
||||
}
|
||||
|
||||
func (s *Signal3XH4System) calculateH(w ecs.World, state *component.Signal3XH4Electronic, filament *component.Signal3XH4Filament) {
|
||||
ddj := component.BitStateType.Get(state.Z3XH4_DDJ)
|
||||
lxj := component.BitStateType.Get(state.Z3XH4_LXJ)
|
||||
isH := filament.Hf && !ddj.Val && !lxj.Val
|
||||
filament.H = isH
|
||||
}
|
||||
|
||||
func (s *Signal3XH4System) calculateDJ(w ecs.World, e *ecs.Entry, state *component.Signal3XH4Electronic, filament *component.Signal3XH4Filament) {
|
||||
ddj := component.BitStateType.Get(state.Z3XH4_DDJ)
|
||||
dj := component.BitStateType.Get(state.Z3XH4_DJ)
|
||||
zxj := component.BitStateType.Get(state.Z3XH4_ZXJ)
|
||||
//
|
||||
lsc.Z3XH4_DJ_Xq = dj.Val
|
||||
lsc.Z3XH4_DDJ_Lx = !ddj.Val
|
||||
lsc.Z3XH4_LXJ_Xq = lxj.Val
|
||||
lsc.Z3XH4_ZXJ_Xq = zxj.Val
|
||||
}
|
||||
func (s *Signal3XH4System) calculateU(state *component.Signal3XH4Electronic, Z3XH4_U *ecs.Entry) {
|
||||
ddj := component.BitStateType.Get(state.Z3XH4_DDJ)
|
||||
lxj := component.BitStateType.Get(state.Z3XH4_LXJ)
|
||||
zxj := component.BitStateType.Get(state.Z3XH4_ZXJ)
|
||||
isDJ := filament.Uf && !ddj.Val && lxj.Val && !zxj.Val ||
|
||||
filament.Lf && !ddj.Val && lxj.Val && zxj.Val ||
|
||||
filament.Hf && !ddj.Val && !lxj.Val
|
||||
if isDJ != dj.Val {
|
||||
drive := component.RelayDriveType.Get(state.Z3XH4_DJ)
|
||||
drive.Td = isDJ
|
||||
drive.Xq = isDJ
|
||||
}
|
||||
isU := !ddj.Val && lxj.Val && !zxj.Val
|
||||
driveU := component.LightDriveType.Get(Z3XH4_U)
|
||||
driveU.Td = isU
|
||||
}
|
||||
|
||||
func (s *Signal3XH4System) calculateL(state *component.Signal3XH4Electronic, Z3XH4_L *ecs.Entry) {
|
||||
ddj := component.BitStateType.Get(state.Z3XH4_DDJ)
|
||||
lxj := component.BitStateType.Get(state.Z3XH4_LXJ)
|
||||
zxj := component.BitStateType.Get(state.Z3XH4_ZXJ)
|
||||
isL := !ddj.Val && lxj.Val && zxj.Val
|
||||
driveL := component.LightDriveType.Get(Z3XH4_L)
|
||||
driveL.Td = isL
|
||||
}
|
||||
|
||||
func (s *Signal3XH4System) calculateH(state *component.Signal3XH4Electronic, Z3XH4_H *ecs.Entry) {
|
||||
ddj := component.BitStateType.Get(state.Z3XH4_DDJ)
|
||||
lxj := component.BitStateType.Get(state.Z3XH4_LXJ)
|
||||
isH := !ddj.Val && !lxj.Val
|
||||
driveH := component.LightDriveType.Get(Z3XH4_H)
|
||||
driveH.Td = isH
|
||||
}
|
||||
|
||||
func (s *Signal3XH4System) calculateDJ(state *component.Signal3XH4Electronic, Z3XH4_H *ecs.Entry, Z3XH4_L *ecs.Entry, Z3XH4_U *ecs.Entry) {
|
||||
ddj := component.BitStateType.Get(state.Z3XH4_DDJ)
|
||||
lxj := component.BitStateType.Get(state.Z3XH4_LXJ)
|
||||
zxj := component.BitStateType.Get(state.Z3XH4_ZXJ)
|
||||
hd := component.BitStateType.Get(Z3XH4_H)
|
||||
ld := component.BitStateType.Get(Z3XH4_L)
|
||||
ud := component.BitStateType.Get(Z3XH4_U)
|
||||
isDJ := ud.Val && !ddj.Val && lxj.Val && !zxj.Val ||
|
||||
ld.Val && !ddj.Val && lxj.Val && zxj.Val ||
|
||||
hd.Val && !ddj.Val && !lxj.Val
|
||||
drive := component.RelayDriveType.Get(state.Z3XH4_DJ)
|
||||
drive.Td = isDJ
|
||||
drive.Xq = isDJ
|
||||
}
|
||||
|
@ -11,41 +11,69 @@ type SignalDCXHSystem struct {
|
||||
}
|
||||
|
||||
func NewSignalDCXHSystem() *SignalDCXHSystem {
|
||||
return &SignalDCXHSystem{query: ecs.NewQuery(filter.Contains(component.SignalDCXHElectronicType, component.SignalDCXHFilamentType))}
|
||||
return &SignalDCXHSystem{query: ecs.NewQuery(filter.Contains(
|
||||
component.SignalDCXHElectronicType,
|
||||
component.SignalDCXHLsqType,
|
||||
component.SignalDCXHLscType,
|
||||
component.SignalLightsType))}
|
||||
}
|
||||
|
||||
// Update world 执行
|
||||
func (s *SignalDCXHSystem) Update(w ecs.World) {
|
||||
s.query.Each(w, func(e *ecs.Entry) {
|
||||
state := component.SignalDCXHElectronicType.Get(e)
|
||||
filament := component.SignalDCXHFilamentType.Get(e)
|
||||
s.query.Each(w, func(entry *ecs.Entry) {
|
||||
state := component.SignalDCXHElectronicType.Get(entry)
|
||||
lsq := component.SignalDCXHLsqType.Get(entry)
|
||||
lsc := component.SignalDCXHLscType.Get(entry)
|
||||
lights := component.SignalLightsType.Get(entry)
|
||||
DCXH_A := lights.GetLightByTag(component.AdTag)
|
||||
DCXH_B := lights.GetLightByTag(component.BdTag)
|
||||
//
|
||||
s.calculateA(state, filament)
|
||||
s.calculateB(state, filament)
|
||||
s.calculateDJ(state, filament)
|
||||
s.calculateLsq(state, lsq)
|
||||
s.calculateA(state, DCXH_A)
|
||||
s.calculateB(state, DCXH_B)
|
||||
s.calculateDJ(state, DCXH_B, DCXH_A)
|
||||
s.calculateLsc(state, lsc)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
func (s *SignalDCXHSystem) calculateB(state *component.SignalDCXHElectronic, filament *component.SignalDCXHFilament) {
|
||||
dxj := component.BitStateType.Get(state.DCXH_DXJ)
|
||||
isB := filament.Bf && dxj.Val
|
||||
filament.B = isB
|
||||
// 联锁驱
|
||||
func (s *SignalDCXHSystem) calculateLsq(state *component.SignalDCXHElectronic, lsq *component.SignalDCXHLsq) {
|
||||
dxj := component.RelayDriveType.Get(state.DCXH_DXJ)
|
||||
//
|
||||
dxjQ := lsq.DCXH_DXJ_Q
|
||||
dxj.Td = dxjQ
|
||||
dxj.Xq = dxjQ
|
||||
}
|
||||
|
||||
func (s *SignalDCXHSystem) calculateA(state *component.SignalDCXHElectronic, filament *component.SignalDCXHFilament) {
|
||||
dxj := component.BitStateType.Get(state.DCXH_DXJ)
|
||||
isA := filament.Af && !dxj.Val
|
||||
filament.A = isA
|
||||
}
|
||||
|
||||
func (s *SignalDCXHSystem) calculateDJ(state *component.SignalDCXHElectronic, filament *component.SignalDCXHFilament) {
|
||||
// 联锁采
|
||||
func (s *SignalDCXHSystem) calculateLsc(state *component.SignalDCXHElectronic, lsc *component.SignalDCXHLsc) {
|
||||
dxj := component.BitStateType.Get(state.DCXH_DXJ)
|
||||
dj := component.BitStateType.Get(state.DCXH_DJ)
|
||||
isDJ := filament.Bf && dxj.Val || filament.Af && !dxj.Val
|
||||
if isDJ != dj.Val {
|
||||
drive := component.RelayDriveType.Get(state.DCXH_DJ)
|
||||
drive.Td = isDJ
|
||||
drive.Xq = isDJ
|
||||
}
|
||||
//
|
||||
lsc.DCXH_DJ_Xq = dj.Val
|
||||
lsc.DCXH_DXJ_Xq = dxj.Val
|
||||
}
|
||||
func (s *SignalDCXHSystem) calculateB(state *component.SignalDCXHElectronic, DCXH_B *ecs.Entry) {
|
||||
dxj := component.BitStateType.Get(state.DCXH_DXJ)
|
||||
isB := dxj.Val
|
||||
driveB := component.LightDriveType.Get(DCXH_B)
|
||||
driveB.Td = isB
|
||||
}
|
||||
|
||||
func (s *SignalDCXHSystem) calculateA(state *component.SignalDCXHElectronic, DCXH_A *ecs.Entry) {
|
||||
dxj := component.BitStateType.Get(state.DCXH_DXJ)
|
||||
isA := !dxj.Val
|
||||
driveA := component.LightDriveType.Get(DCXH_A)
|
||||
driveA.Td = isA
|
||||
}
|
||||
|
||||
func (s *SignalDCXHSystem) calculateDJ(state *component.SignalDCXHElectronic, DCXH_B *ecs.Entry, DCXH_A *ecs.Entry) {
|
||||
dxj := component.BitStateType.Get(state.DCXH_DXJ)
|
||||
ad := component.BitStateType.Get(DCXH_A)
|
||||
bd := component.BitStateType.Get(DCXH_B)
|
||||
isDJ := bd.Val && dxj.Val || ad.Val && !dxj.Val
|
||||
drive := component.RelayDriveType.Get(state.DCXH_DJ)
|
||||
drive.Td = isDJ
|
||||
drive.Xq = isDJ
|
||||
}
|
||||
|
@ -11,50 +11,88 @@ type SignalJCKXHSystem struct {
|
||||
}
|
||||
|
||||
func NewSignalJCKXHSystem() *SignalJCKXHSystem {
|
||||
return &SignalJCKXHSystem{query: ecs.NewQuery(filter.Contains(component.SignalJCKXHElectronicType, component.SignalJCKXHFilamentType))}
|
||||
return &SignalJCKXHSystem{query: ecs.NewQuery(filter.Contains(
|
||||
component.SignalJCKXHElectronicType,
|
||||
component.SignalJCKXHLsqType,
|
||||
component.SignalJCKXHLscType,
|
||||
component.SignalLightsType))}
|
||||
}
|
||||
|
||||
// Update world 执行
|
||||
func (s *SignalJCKXHSystem) Update(w ecs.World) {
|
||||
s.query.Each(w, func(e *ecs.Entry) {
|
||||
state := component.SignalJCKXHElectronicType.Get(e)
|
||||
filament := component.SignalJCKXHFilamentType.Get(e)
|
||||
s.query.Each(w, func(entry *ecs.Entry) {
|
||||
state := component.SignalJCKXHElectronicType.Get(entry)
|
||||
lsq := component.SignalJCKXHLsqType.Get(entry)
|
||||
lsc := component.SignalJCKXHLscType.Get(entry)
|
||||
lights := component.SignalLightsType.Get(entry)
|
||||
JCKXH_H := lights.GetLightByTag(component.HdTag)
|
||||
JCKXH_B := lights.GetLightByTag(component.BdTag)
|
||||
JCKXH_U := lights.GetLightByTag(component.UdTag)
|
||||
//
|
||||
s.calculateU(state, filament)
|
||||
s.calculateB(state, filament)
|
||||
s.calculateH(state, filament)
|
||||
s.calculateDJ(state, filament)
|
||||
s.calculateLsq(state, lsq)
|
||||
s.calculateU(state, JCKXH_U)
|
||||
s.calculateB(state, JCKXH_B)
|
||||
s.calculateH(state, JCKXH_H)
|
||||
s.calculateDJ(state, JCKXH_H, JCKXH_B, JCKXH_U)
|
||||
s.calculateLsc(state, lsc)
|
||||
})
|
||||
}
|
||||
|
||||
func (s *SignalJCKXHSystem) calculateU(state *component.SignalJCKXHElectronic, filament *component.SignalJCKXHFilament) {
|
||||
lxj := component.BitStateType.Get(state.JCKXH_LXJ)
|
||||
isU := filament.Uf && lxj.Val
|
||||
filament.U = isU
|
||||
// 联锁驱
|
||||
func (s *SignalJCKXHSystem) calculateLsq(state *component.SignalJCKXHElectronic, lsq *component.SignalJCKXHLsq) {
|
||||
dxj := component.RelayDriveType.Get(state.JCKXH_DXJ)
|
||||
lxj := component.RelayDriveType.Get(state.JCKXH_LXJ)
|
||||
//
|
||||
dxjQ := lsq.JCKXH_DXJ_Q
|
||||
dxj.Td = dxjQ
|
||||
dxj.Xq = dxjQ
|
||||
//
|
||||
lxjQ := lsq.JCKXH_LXJ_Q
|
||||
lxj.Td = lxjQ
|
||||
lxj.Xq = lxjQ
|
||||
}
|
||||
|
||||
func (s *SignalJCKXHSystem) calculateB(state *component.SignalJCKXHElectronic, filament *component.SignalJCKXHFilament) {
|
||||
lxj := component.BitStateType.Get(state.JCKXH_LXJ)
|
||||
dxj := component.BitStateType.Get(state.JCKXH_DXJ)
|
||||
isB := filament.Bf && !lxj.Val && dxj.Val
|
||||
filament.B = isB
|
||||
}
|
||||
|
||||
func (s *SignalJCKXHSystem) calculateH(state *component.SignalJCKXHElectronic, filament *component.SignalJCKXHFilament) {
|
||||
lxj := component.BitStateType.Get(state.JCKXH_LXJ)
|
||||
dxj := component.BitStateType.Get(state.JCKXH_DXJ)
|
||||
isH := filament.Bf && !lxj.Val && dxj.Val
|
||||
filament.H = isH
|
||||
}
|
||||
|
||||
func (s *SignalJCKXHSystem) calculateDJ(state *component.SignalJCKXHElectronic, filament *component.SignalJCKXHFilament) {
|
||||
lxj := component.BitStateType.Get(state.JCKXH_LXJ)
|
||||
// 联锁采
|
||||
func (s *SignalJCKXHSystem) calculateLsc(state *component.SignalJCKXHElectronic, lsc *component.SignalJCKXHLsc) {
|
||||
dxj := component.BitStateType.Get(state.JCKXH_DXJ)
|
||||
dj := component.BitStateType.Get(state.JCKXH_DJ)
|
||||
isDJ := filament.Uf && lxj.Val || filament.Bf && !lxj.Val && dxj.Val || filament.Bf && !lxj.Val && dxj.Val
|
||||
if isDJ != dj.Val {
|
||||
drive := component.RelayDriveType.Get(state.JCKXH_DJ)
|
||||
drive.Td = isDJ
|
||||
drive.Xq = isDJ
|
||||
}
|
||||
lxj := component.BitStateType.Get(state.JCKXH_LXJ)
|
||||
//
|
||||
lsc.JCKXH_DJ_Xq = dj.Val
|
||||
lsc.JCKXH_LXJ_Xq = lxj.Val
|
||||
lsc.JCKXH_DXJ_Xq = dxj.Val
|
||||
}
|
||||
func (s *SignalJCKXHSystem) calculateU(state *component.SignalJCKXHElectronic, JCKXH_U *ecs.Entry) {
|
||||
lxj := component.BitStateType.Get(state.JCKXH_LXJ)
|
||||
isU := lxj.Val
|
||||
driveU := component.LightDriveType.Get(JCKXH_U)
|
||||
driveU.Td = isU
|
||||
}
|
||||
|
||||
func (s *SignalJCKXHSystem) calculateB(state *component.SignalJCKXHElectronic, JCKXH_B *ecs.Entry) {
|
||||
lxj := component.BitStateType.Get(state.JCKXH_LXJ)
|
||||
dxj := component.BitStateType.Get(state.JCKXH_DXJ)
|
||||
isB := !lxj.Val && dxj.Val
|
||||
driveB := component.LightDriveType.Get(JCKXH_B)
|
||||
driveB.Td = isB
|
||||
}
|
||||
|
||||
func (s *SignalJCKXHSystem) calculateH(state *component.SignalJCKXHElectronic, JCKXH_H *ecs.Entry) {
|
||||
lxj := component.BitStateType.Get(state.JCKXH_LXJ)
|
||||
dxj := component.BitStateType.Get(state.JCKXH_DXJ)
|
||||
isH := !lxj.Val && dxj.Val
|
||||
driveH := component.LightDriveType.Get(JCKXH_H)
|
||||
driveH.Td = isH
|
||||
}
|
||||
|
||||
func (s *SignalJCKXHSystem) calculateDJ(state *component.SignalJCKXHElectronic, JCKXH_H *ecs.Entry, JCKXH_B *ecs.Entry, JCKXH_U *ecs.Entry) {
|
||||
lxj := component.BitStateType.Get(state.JCKXH_LXJ)
|
||||
dxj := component.BitStateType.Get(state.JCKXH_DXJ)
|
||||
hd := component.BitStateType.Get(JCKXH_H)
|
||||
bd := component.BitStateType.Get(JCKXH_B)
|
||||
ud := component.BitStateType.Get(JCKXH_U)
|
||||
isDJ := ud.Val && lxj.Val || bd.Val && !lxj.Val && dxj.Val || hd.Val && !lxj.Val && dxj.Val
|
||||
drive := component.RelayDriveType.Get(state.JCKXH_DJ)
|
||||
drive.Td = isDJ
|
||||
drive.Xq = isDJ
|
||||
}
|
||||
|
@ -64,14 +64,14 @@ func (zdj9 *ZDJ9TwoDragSys) Update(w ecs.World) {
|
||||
zdj9.exciteM2_TDFJ1_DFBJ(entry, elec)
|
||||
|
||||
// 总定表/反表继电器
|
||||
zdj9.exciteZDFBJ(elec)
|
||||
zdj9.exciteZDFBJ(entry, elec)
|
||||
|
||||
zdj9.exciteCollectElectronic(elec, collect)
|
||||
zdj9.exciteCollectElectronic(entry, elec, collect)
|
||||
})
|
||||
}
|
||||
|
||||
// 处理采集电路状态
|
||||
func (zdj9 *ZDJ9TwoDragSys) exciteCollectElectronic(elec *component.Zdj9TwoElectronic, collect *component.Zdj9TwoCollect) {
|
||||
func (zdj9 *ZDJ9TwoDragSys) exciteCollectElectronic(entry *ecs.Entry, elec *component.Zdj9TwoElectronic, collect *component.Zdj9TwoCollect) {
|
||||
zdbj := component.BitStateType.Get(elec.TDC_ZDBJ)
|
||||
zfbj := component.BitStateType.Get(elec.TDC_ZFBJ)
|
||||
ycj := component.BitStateType.Get(elec.TDC_YCJ)
|
||||
@ -108,20 +108,23 @@ func (zdj9 *ZDJ9TwoDragSys) exciteDriveElectronic(elec *component.Zdj9TwoElectro
|
||||
}
|
||||
|
||||
// 总定表、反表继电器控制
|
||||
func (zdj9 *ZDJ9TwoDragSys) exciteZDFBJ(elec *component.Zdj9TwoElectronic) {
|
||||
func (zdj9 *ZDJ9TwoDragSys) exciteZDFBJ(entry *ecs.Entry, elec *component.Zdj9TwoElectronic) {
|
||||
tdfj1_dbj := component.BitStateType.Get(elec.TDFJ1_DBJ)
|
||||
tdfj2_dbj := component.BitStateType.Get(elec.TDFJ2_DBJ)
|
||||
tdfj1_fbj := component.BitStateType.Get(elec.TDFJ1_FBJ)
|
||||
tdfj2_fbj := component.BitStateType.Get(elec.TDFJ2_FBJ)
|
||||
zdbj_drive := component.RelayDriveType.Get(elec.TDC_ZDBJ)
|
||||
zfbj_drive := component.RelayDriveType.Get(elec.TDC_ZFBJ)
|
||||
|
||||
// 总定表
|
||||
if zdbj_drive.Td { // 总定表继电器通电,监测电路是否断开
|
||||
if !(tdfj1_dbj.Val && tdfj2_dbj.Val) {
|
||||
zdbj_drive.Td = false
|
||||
}
|
||||
} else {
|
||||
if tdfj1_dbj.Val && tdfj2_dbj.Val {
|
||||
if tdfj1_dbj.Val && tdfj2_dbj.Val &&
|
||||
!entry.HasComponent(component.TurnoutFaultSbType) &&
|
||||
!entry.HasComponent(component.TurnoutFaultDwsbType) {
|
||||
zdbj_drive.Td = true
|
||||
}
|
||||
}
|
||||
@ -131,7 +134,9 @@ func (zdj9 *ZDJ9TwoDragSys) exciteZDFBJ(elec *component.Zdj9TwoElectronic) {
|
||||
zfbj_drive.Td = false
|
||||
}
|
||||
} else {
|
||||
if tdfj1_fbj.Val && tdfj2_fbj.Val {
|
||||
if tdfj1_fbj.Val && tdfj2_fbj.Val &&
|
||||
!entry.HasComponent(component.TurnoutFaultSbType) &&
|
||||
!entry.HasComponent(component.TurnoutFaultFwsbType) {
|
||||
zfbj_drive.Td = true
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"joylink.club/ecs"
|
||||
"joylink.club/ecs/filter"
|
||||
"joylink.club/rtsssimulation/component"
|
||||
"joylink.club/rtsssimulation/component/component_proto"
|
||||
)
|
||||
|
||||
// 道岔位置更新系统
|
||||
@ -40,17 +41,20 @@ func (s *TurnoutSys) Update(w ecs.World) {
|
||||
zdj9 := component.Zdj9TwoElectronicType.Get(entry)
|
||||
zdbj := component.BitStateType.Get(zdj9.TDC_ZDBJ)
|
||||
zfbj := component.BitStateType.Get(zdj9.TDC_ZFBJ)
|
||||
tp.Db = zdbj.Val
|
||||
tp.Fb = zfbj.Val
|
||||
setTurnoutBs(entry, tp, zdbj.Val, zfbj.Val)
|
||||
} else if entry.HasComponent(component.Zdj9OneElectronicType) {
|
||||
zdj9 := component.Zdj9OneElectronicType.Get(entry)
|
||||
dbj := component.BitStateType.Get(zdj9.TDFJ_DBJ)
|
||||
fbj := component.BitStateType.Get(zdj9.TDFJ_FBJ)
|
||||
tp.Db = dbj.Val
|
||||
tp.Fb = fbj.Val
|
||||
setTurnoutBs(entry, tp, dbj.Val, fbj.Val)
|
||||
} else {
|
||||
tp.Db = dw
|
||||
tp.Fb = fw
|
||||
setTurnoutBs(entry, tp, dw, fw)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 设置道岔定表
|
||||
func setTurnoutBs(entry *ecs.Entry, tp *component_proto.TurnoutPosition, db bool, fb bool) {
|
||||
tp.Db = db && !entry.HasComponent(component.TurnoutFaultSbType) && !entry.HasComponent(component.TurnoutFaultDwsbType)
|
||||
tp.Fb = fb && !entry.HasComponent(component.TurnoutFaultSbType) && !entry.HasComponent(component.TurnoutFaultFwsbType)
|
||||
}
|
||||
|
@ -29,17 +29,24 @@ func (z *ZzjSys) Update(w ecs.World) {
|
||||
z.query.Each(w, func(entry *ecs.Entry) {
|
||||
zzj := component.ZzjStateType.Get(entry)
|
||||
tp := component.TwoPositionTransformType.Get(entry)
|
||||
if zzj.Td { // 通电
|
||||
if tp.Speed >= 0 && tp.Pos > consts.TwoPosMin && zzj.Dw { // 转到定位
|
||||
tp.Speed = -component.CalculateTwoPositionAvgSpeed(TurnTime, w.Tick())
|
||||
} else if tp.Speed <= 0 && tp.Pos < consts.TwoPosMax && !zzj.Dw { // 转到反位
|
||||
tp.Speed = component.CalculateTwoPositionAvgSpeed(TurnTime, w.Tick())
|
||||
}
|
||||
} else { // 未通电
|
||||
if tp.Speed != 0 { // 停止
|
||||
tp.Speed = 0
|
||||
if entry.HasComponent(component.TurnoutFaultJcType) {
|
||||
// 道岔挤岔,设置位置到中间,且不再能转动
|
||||
tp.Pos = consts.TwoPosMax / 2
|
||||
tp.Speed = 0
|
||||
} else { // 正常转辙机带动
|
||||
if zzj.Td { // 通电
|
||||
if tp.Speed >= 0 && tp.Pos > consts.TwoPosMin && zzj.Dw { // 转到定位
|
||||
tp.Speed = -component.CalculateTwoPositionAvgSpeed(TurnTime, w.Tick())
|
||||
} else if tp.Speed <= 0 && tp.Pos < consts.TwoPosMax && !zzj.Dw { // 转到反位
|
||||
tp.Speed = component.CalculateTwoPositionAvgSpeed(TurnTime, w.Tick())
|
||||
}
|
||||
} else { // 未通电
|
||||
if tp.Speed != 0 { // 停止
|
||||
tp.Speed = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if tp.Pos == consts.TwoPosMax { // 到反位
|
||||
if !zzj.JD12 {
|
||||
zzj.JD12 = true
|
||||
|
Loading…
Reference in New Issue
Block a user