From 0bba8f0934b210dce941f6afd35d3c068d2745df Mon Sep 17 00:00:00 2001 From: walker Date: Mon, 9 Oct 2023 11:17:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4donburi=E5=8C=85=E5=BC=95?= =?UTF-8?q?=E7=94=A8=20=E4=BF=AE=E6=94=B9filter=E5=AF=BC=E5=85=A5=E4=B8=BA?= =?UTF-8?q?=E4=BB=8Eecs=E9=A1=B9=E7=9B=AE=E5=AF=BC=E5=85=A5=20=E6=95=B4?= =?UTF-8?q?=E7=90=86=E5=8C=85=E7=BB=93=E6=9E=84=EF=BC=8C=E5=B0=86=E5=BC=83?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E5=8C=85=E6=94=BE=E5=85=A5deprecated?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/common.go | 13 +- component/component_proto/common.pb.go | 361 ++++++++++++++++++ .../entities}/button_entity.go | 2 +- .../entities}/common_entity.go | 2 +- .../entities}/dcb_entity.go | 2 +- .../entities}/emps_entity.go | 2 +- .../entities}/psd_entity.go | 2 +- .../entities}/relay_entity.go | 4 +- .../entities}/signal_entity.go | 2 +- .../entities}/spks_entity.go | 2 +- .../entities}/switch_entity.go | 4 +- .../simulation}/simulation.go | 0 .../simulation}/world/config.go | 3 +- .../simulation}/world/init.go | 8 +- .../system}/button_system.go | 2 +- {system => deprecated/system}/dcb_system.go | 2 +- {system => deprecated/system}/dubug_system.go | 0 {system => deprecated/system}/emp_system.go | 2 +- .../system}/event/button_event.go | 0 .../system}/event/relay_event.go | 0 .../system}/event/signal_3xh1_event.go | 0 {system => deprecated/system}/model_umi.go | 0 .../system}/percentage_system.go | 3 +- {system => deprecated/system}/psd_system.go | 4 +- {system => deprecated/system}/relay_system.go | 4 +- .../system}/signal_2xh1_system.go | 5 +- .../system}/signal_3xh1_system.go | 4 +- .../system}/signal_3xh2_system.go | 5 +- .../system}/signal_3xh3_system.go | 5 +- .../system}/signal_3xh4_system.go | 5 +- .../system}/signal_dcxh_system.go | 5 +- .../system}/signal_jckxh_system.go | 5 +- .../system}/signal_jdxh_system.go | 5 +- {system => deprecated/system}/spks_system.go | 2 +- .../system}/switch_2jzdj9_system.go | 5 +- {system => deprecated/system}/system.go | 10 +- {system => deprecated/system}/timer_system.go | 2 +- {system => deprecated/system}/train_system.go | 0 {system => deprecated/system}/type.go | 0 {examples => deprecated}/test1/main.go | 0 {examples => deprecated}/test1/sjzdj9/main.go | 15 +- .../test1/tinit/config.go | 3 +- {examples => deprecated}/test1/tinit/init.go | 4 +- .../test1/tmodel/device_model.go | 2 +- .../test1/tmodel/relay_model.go | 0 .../test1/tmodel/switch_model.go | 2 +- .../test1/tstorages/model_storage.go | 3 +- .../test1/tstorages/storage_manager.go | 3 +- entity/singleton.go | 2 +- go.mod | 1 - go.work.sum | 71 ++++ proto/src/component/common.proto | 28 ++ sys/circuit_sys/signal_2xh1.go | 2 +- sys/circuit_sys/turnout_zdj9_2.go | 2 +- sys/common_sys/counter.go | 2 +- sys/common_sys/counterdown.go | 2 +- sys/common_sys/two_position_movement.go | 2 +- sys/device_sys/dbq.go | 2 +- sys/device_sys/relay.go | 2 +- sys/device_sys/turnout.go | 2 +- sys/device_sys/zzj.go | 2 +- sys/world_time.go | 2 +- 62 files changed, 557 insertions(+), 79 deletions(-) create mode 100644 component/component_proto/common.pb.go rename {entities => deprecated/entities}/button_entity.go (94%) rename {entities => deprecated/entities}/common_entity.go (92%) rename {entities => deprecated/entities}/dcb_entity.go (89%) rename {entities => deprecated/entities}/emps_entity.go (88%) rename {entities => deprecated/entities}/psd_entity.go (98%) rename {entities => deprecated/entities}/relay_entity.go (89%) rename {entities => deprecated/entities}/signal_entity.go (98%) rename {entities => deprecated/entities}/spks_entity.go (89%) rename {entities => deprecated/entities}/switch_entity.go (96%) rename {simulation => deprecated/simulation}/simulation.go (100%) rename {simulation => deprecated/simulation}/world/config.go (86%) rename {simulation => deprecated/simulation}/world/init.go (97%) rename {system => deprecated/system}/button_system.go (97%) rename {system => deprecated/system}/dcb_system.go (99%) rename {system => deprecated/system}/dubug_system.go (100%) rename {system => deprecated/system}/emp_system.go (98%) rename {system => deprecated/system}/event/button_event.go (100%) rename {system => deprecated/system}/event/relay_event.go (100%) rename {system => deprecated/system}/event/signal_3xh1_event.go (100%) rename {system => deprecated/system}/model_umi.go (100%) rename {system => deprecated/system}/percentage_system.go (98%) rename {system => deprecated/system}/psd_system.go (99%) rename {system => deprecated/system}/relay_system.go (95%) rename {system => deprecated/system}/signal_2xh1_system.go (97%) rename {system => deprecated/system}/signal_3xh1_system.go (98%) rename {system => deprecated/system}/signal_3xh2_system.go (98%) rename {system => deprecated/system}/signal_3xh3_system.go (97%) rename {system => deprecated/system}/signal_3xh4_system.go (97%) rename {system => deprecated/system}/signal_dcxh_system.go (97%) rename {system => deprecated/system}/signal_jckxh_system.go (97%) rename {system => deprecated/system}/signal_jdxh_system.go (97%) rename {system => deprecated/system}/spks_system.go (98%) rename {system => deprecated/system}/switch_2jzdj9_system.go (99%) rename {system => deprecated/system}/system.go (93%) rename {system => deprecated/system}/timer_system.go (97%) rename {system => deprecated/system}/train_system.go (100%) rename {system => deprecated/system}/type.go (100%) rename {examples => deprecated}/test1/main.go (100%) rename {examples => deprecated}/test1/sjzdj9/main.go (96%) rename {examples => deprecated}/test1/tinit/config.go (86%) rename {examples => deprecated}/test1/tinit/init.go (84%) rename {examples => deprecated}/test1/tmodel/device_model.go (85%) rename {examples => deprecated}/test1/tmodel/relay_model.go (100%) rename {examples => deprecated}/test1/tmodel/switch_model.go (97%) rename {examples => deprecated}/test1/tstorages/model_storage.go (97%) rename {examples => deprecated}/test1/tstorages/storage_manager.go (97%) create mode 100644 proto/src/component/common.proto diff --git a/component/common.go b/component/common.go index 0f94a83..258c2e9 100644 --- a/component/common.go +++ b/component/common.go @@ -2,6 +2,7 @@ package component import ( "joylink.club/ecs" + "joylink.club/rtsssimulation/component/component_proto" "joylink.club/rtsssimulation/consts" ) @@ -13,9 +14,13 @@ type Uid struct { var UidType = ecs.NewComponentType[Uid]() // 两个稳态位置转换组件 +// type TwoPositionTransform struct { +// Pos int // 当前位置百分比,[0, 10000],两位小数 +// Speed int +// } + type TwoPositionTransform struct { - Pos int // 当前位置百分比,[0, 10000],两位小数 - Speed int + component_proto.TwoPositionTransform } // 当前位置百分比值 @@ -27,8 +32,8 @@ var TwoPositionTransformType = ecs.NewComponentType[TwoPositionTransform]() // 计算两位置动作的平均速度 // 总时间t和tick的单位都应该是ms -func CalculateTwoPositionAvgSpeed(t int, tick int) int { - return consts.TwoPosMax / (t / tick) +func CalculateTwoPositionAvgSpeed(t int, tick int) int32 { + return int32(consts.TwoPosMax / (t / tick)) } // 仅有两状态的组件 diff --git a/component/component_proto/common.pb.go b/component/component_proto/common.pb.go new file mode 100644 index 0000000..53c59b7 --- /dev/null +++ b/component/component_proto/common.pb.go @@ -0,0 +1,361 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.23.1 +// source: component/common.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 TwoPositionTransform struct { + state protoimpl.MessageState + 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"` +} + +func (x *TwoPositionTransform) Reset() { + *x = TwoPositionTransform{} + if protoimpl.UnsafeEnabled { + mi := &file_component_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TwoPositionTransform) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TwoPositionTransform) ProtoMessage() {} + +func (x *TwoPositionTransform) ProtoReflect() protoreflect.Message { + mi := &file_component_common_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 TwoPositionTransform.ProtoReflect.Descriptor instead. +func (*TwoPositionTransform) Descriptor() ([]byte, []int) { + return file_component_common_proto_rawDescGZIP(), []int{0} +} + +func (x *TwoPositionTransform) GetPos() int32 { + if x != nil { + return x.Pos + } + return 0 +} + +func (x *TwoPositionTransform) GetSpeed() int32 { + if x != nil { + return x.Speed + } + return 0 +} + +// 仅有两状态的组件 +type BitState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Val bool `protobuf:"varint,1,opt,name=Val,proto3" json:"Val,omitempty"` +} + +func (x *BitState) Reset() { + *x = BitState{} + if protoimpl.UnsafeEnabled { + mi := &file_component_common_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BitState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BitState) ProtoMessage() {} + +func (x *BitState) ProtoReflect() protoreflect.Message { + mi := &file_component_common_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 BitState.ProtoReflect.Descriptor instead. +func (*BitState) Descriptor() ([]byte, []int) { + return file_component_common_proto_rawDescGZIP(), []int{1} +} + +func (x *BitState) GetVal() bool { + if x != nil { + return x.Val + } + return false +} + +// 计数/计时组件 +type Counter struct { + state protoimpl.MessageState + 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"` +} + +func (x *Counter) Reset() { + *x = Counter{} + if protoimpl.UnsafeEnabled { + mi := &file_component_common_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Counter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Counter) ProtoMessage() {} + +func (x *Counter) ProtoReflect() protoreflect.Message { + mi := &file_component_common_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 Counter.ProtoReflect.Descriptor instead. +func (*Counter) Descriptor() ([]byte, []int) { + return file_component_common_proto_rawDescGZIP(), []int{2} +} + +func (x *Counter) GetVal() int32 { + if x != nil { + return x.Val + } + return 0 +} + +func (x *Counter) GetStep() int32 { + if x != nil { + return x.Step + } + return 0 +} + +// 倒数/倒计时组件 +type CounterDown struct { + state protoimpl.MessageState + 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"` +} + +func (x *CounterDown) Reset() { + *x = CounterDown{} + if protoimpl.UnsafeEnabled { + mi := &file_component_common_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CounterDown) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CounterDown) ProtoMessage() {} + +func (x *CounterDown) ProtoReflect() protoreflect.Message { + mi := &file_component_common_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 CounterDown.ProtoReflect.Descriptor instead. +func (*CounterDown) Descriptor() ([]byte, []int) { + return file_component_common_proto_rawDescGZIP(), []int{3} +} + +func (x *CounterDown) GetVal() int32 { + if x != nil { + return x.Val + } + return 0 +} + +func (x *CounterDown) GetStep() int32 { + if x != nil { + return x.Step + } + return 0 +} + +var File_component_common_proto protoreflect.FileDescriptor + +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, + 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, + 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, + 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, + 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_common_proto_rawDescOnce sync.Once + file_component_common_proto_rawDescData = file_component_common_proto_rawDesc +) + +func file_component_common_proto_rawDescGZIP() []byte { + file_component_common_proto_rawDescOnce.Do(func() { + file_component_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_component_common_proto_rawDescData) + }) + return file_component_common_proto_rawDescData +} + +var file_component_common_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_component_common_proto_goTypes = []interface{}{ + (*TwoPositionTransform)(nil), // 0: component.TwoPositionTransform + (*BitState)(nil), // 1: component.BitState + (*Counter)(nil), // 2: component.Counter + (*CounterDown)(nil), // 3: component.CounterDown +} +var file_component_common_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_component_common_proto_init() } +func file_component_common_proto_init() { + if File_component_common_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_component_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TwoPositionTransform); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_component_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BitState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_component_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Counter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_component_common_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CounterDown); 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_common_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_component_common_proto_goTypes, + DependencyIndexes: file_component_common_proto_depIdxs, + MessageInfos: file_component_common_proto_msgTypes, + }.Build() + File_component_common_proto = out.File + file_component_common_proto_rawDesc = nil + file_component_common_proto_goTypes = nil + file_component_common_proto_depIdxs = nil +} diff --git a/entities/button_entity.go b/deprecated/entities/button_entity.go similarity index 94% rename from entities/button_entity.go rename to deprecated/entities/button_entity.go index 4a20b16..9dfc5be 100644 --- a/entities/button_entity.go +++ b/deprecated/entities/button_entity.go @@ -2,7 +2,7 @@ package entities import ( "joylink.club/ecs" - "joylink.club/rtsssimulation/system" + "joylink.club/rtsssimulation/deprecated/system" ) // CreateSelfResetButtonEntity 创建自复位按钮实体 diff --git a/entities/common_entity.go b/deprecated/entities/common_entity.go similarity index 92% rename from entities/common_entity.go rename to deprecated/entities/common_entity.go index 5095124..48fe32e 100644 --- a/entities/common_entity.go +++ b/deprecated/entities/common_entity.go @@ -4,7 +4,7 @@ import ( "time" "joylink.club/ecs" - "joylink.club/rtsssimulation/system" + "joylink.club/rtsssimulation/deprecated/system" ) // CreateModelStorageEntity 创建模型仓库实体 diff --git a/entities/dcb_entity.go b/deprecated/entities/dcb_entity.go similarity index 89% rename from entities/dcb_entity.go rename to deprecated/entities/dcb_entity.go index 57d24a4..69430d5 100644 --- a/entities/dcb_entity.go +++ b/deprecated/entities/dcb_entity.go @@ -2,7 +2,7 @@ package entities import ( "joylink.club/ecs" - "joylink.club/rtsssimulation/system" + "joylink.club/rtsssimulation/deprecated/system" ) // CreateDcbCircuitEntity 创建门控箱电路实体 diff --git a/entities/emps_entity.go b/deprecated/entities/emps_entity.go similarity index 88% rename from entities/emps_entity.go rename to deprecated/entities/emps_entity.go index f522f79..fa9b618 100644 --- a/entities/emps_entity.go +++ b/deprecated/entities/emps_entity.go @@ -2,7 +2,7 @@ package entities import ( "joylink.club/ecs" - "joylink.club/rtsssimulation/system" + "joylink.club/rtsssimulation/deprecated/system" ) func CreateEmpsCircuitEntity(w ecs.World, empsCircuitId string) *ecs.Entry { diff --git a/entities/psd_entity.go b/deprecated/entities/psd_entity.go similarity index 98% rename from entities/psd_entity.go rename to deprecated/entities/psd_entity.go index ab77587..b3763a3 100644 --- a/entities/psd_entity.go +++ b/deprecated/entities/psd_entity.go @@ -2,7 +2,7 @@ package entities import ( "joylink.club/ecs" - "joylink.club/rtsssimulation/system" + "joylink.club/rtsssimulation/deprecated/system" ) // CreatePsdCircuitEntity 创建车站屏蔽门电路实体 diff --git a/entities/relay_entity.go b/deprecated/entities/relay_entity.go similarity index 89% rename from entities/relay_entity.go rename to deprecated/entities/relay_entity.go index 9791aa5..8e3db29 100644 --- a/entities/relay_entity.go +++ b/deprecated/entities/relay_entity.go @@ -2,9 +2,9 @@ package entities import ( "joylink.club/ecs" + "joylink.club/rtsssimulation/deprecated/simulation" + "joylink.club/rtsssimulation/deprecated/system" "joylink.club/rtsssimulation/repository" - "joylink.club/rtsssimulation/simulation" - "joylink.club/rtsssimulation/system" ) type RelayState struct { diff --git a/entities/signal_entity.go b/deprecated/entities/signal_entity.go similarity index 98% rename from entities/signal_entity.go rename to deprecated/entities/signal_entity.go index 4cf21c4..444bfa7 100644 --- a/entities/signal_entity.go +++ b/deprecated/entities/signal_entity.go @@ -2,7 +2,7 @@ package entities import ( "joylink.club/ecs" - "joylink.club/rtsssimulation/system" + "joylink.club/rtsssimulation/deprecated/system" ) func CreateSignal3XH1Entity(w ecs.World, signalId string) *ecs.Entry { diff --git a/entities/spks_entity.go b/deprecated/entities/spks_entity.go similarity index 89% rename from entities/spks_entity.go rename to deprecated/entities/spks_entity.go index 5cb9b6e..fcd64d9 100644 --- a/entities/spks_entity.go +++ b/deprecated/entities/spks_entity.go @@ -2,7 +2,7 @@ package entities import ( "joylink.club/ecs" - "joylink.club/rtsssimulation/system" + "joylink.club/rtsssimulation/deprecated/system" ) // CreateSpksCircuitEntity 创建人员防护按钮电路实体 diff --git a/entities/switch_entity.go b/deprecated/entities/switch_entity.go similarity index 96% rename from entities/switch_entity.go rename to deprecated/entities/switch_entity.go index ce95a6c..1163849 100644 --- a/entities/switch_entity.go +++ b/deprecated/entities/switch_entity.go @@ -4,9 +4,9 @@ import ( "time" "joylink.club/ecs" + "joylink.club/rtsssimulation/deprecated/simulation" + "joylink.club/rtsssimulation/deprecated/system" "joylink.club/rtsssimulation/repository" - "joylink.club/rtsssimulation/simulation" - "joylink.club/rtsssimulation/system" ) type Position int diff --git a/simulation/simulation.go b/deprecated/simulation/simulation.go similarity index 100% rename from simulation/simulation.go rename to deprecated/simulation/simulation.go diff --git a/simulation/world/config.go b/deprecated/simulation/world/config.go similarity index 86% rename from simulation/world/config.go rename to deprecated/simulation/world/config.go index b0e4e56..496b8d4 100644 --- a/simulation/world/config.go +++ b/deprecated/simulation/world/config.go @@ -1,9 +1,10 @@ package world import ( - "joylink.club/rtsssimulation/system" "time" + "joylink.club/rtsssimulation/deprecated/system" + "joylink.club/ecs" ) diff --git a/simulation/world/init.go b/deprecated/simulation/world/init.go similarity index 97% rename from simulation/world/init.go rename to deprecated/simulation/world/init.go index f50e447..8619149 100644 --- a/simulation/world/init.go +++ b/deprecated/simulation/world/init.go @@ -3,12 +3,12 @@ package world import ( "time" - "github.com/yohamta/donburi/filter" "joylink.club/ecs" - "joylink.club/rtsssimulation/entities" + "joylink.club/ecs/filter" + "joylink.club/rtsssimulation/deprecated/entities" + "joylink.club/rtsssimulation/deprecated/simulation" + "joylink.club/rtsssimulation/deprecated/system" "joylink.club/rtsssimulation/repository" - "joylink.club/rtsssimulation/simulation" - "joylink.club/rtsssimulation/system" ) func CreateSimulation(repo *repository.Repository) ecs.WorldId { diff --git a/system/button_system.go b/deprecated/system/button_system.go similarity index 97% rename from system/button_system.go rename to deprecated/system/button_system.go index 112714a..e39e0b9 100644 --- a/system/button_system.go +++ b/deprecated/system/button_system.go @@ -1,8 +1,8 @@ package system import ( - "github.com/yohamta/donburi/filter" "joylink.club/ecs" + "joylink.club/ecs/filter" ) // ButtonState 广义按钮开关状态,开关有三个接点,分别为公共接点、常开点和常闭点 diff --git a/system/dcb_system.go b/deprecated/system/dcb_system.go similarity index 99% rename from system/dcb_system.go rename to deprecated/system/dcb_system.go index 9974f64..206367b 100644 --- a/system/dcb_system.go +++ b/deprecated/system/dcb_system.go @@ -1,8 +1,8 @@ package system import ( - "github.com/yohamta/donburi/filter" "joylink.club/ecs" + "joylink.club/ecs/filter" ) // DcbCircuitState 门控箱电路 A---按钮 J---继电器 diff --git a/system/dubug_system.go b/deprecated/system/dubug_system.go similarity index 100% rename from system/dubug_system.go rename to deprecated/system/dubug_system.go diff --git a/system/emp_system.go b/deprecated/system/emp_system.go similarity index 98% rename from system/emp_system.go rename to deprecated/system/emp_system.go index 734f890..71dfa86 100644 --- a/system/emp_system.go +++ b/deprecated/system/emp_system.go @@ -1,8 +1,8 @@ package system import ( - "github.com/yohamta/donburi/filter" "joylink.club/ecs" + "joylink.club/ecs/filter" ) //站台紧急停车按钮 diff --git a/system/event/button_event.go b/deprecated/system/event/button_event.go similarity index 100% rename from system/event/button_event.go rename to deprecated/system/event/button_event.go diff --git a/system/event/relay_event.go b/deprecated/system/event/relay_event.go similarity index 100% rename from system/event/relay_event.go rename to deprecated/system/event/relay_event.go diff --git a/system/event/signal_3xh1_event.go b/deprecated/system/event/signal_3xh1_event.go similarity index 100% rename from system/event/signal_3xh1_event.go rename to deprecated/system/event/signal_3xh1_event.go diff --git a/system/model_umi.go b/deprecated/system/model_umi.go similarity index 100% rename from system/model_umi.go rename to deprecated/system/model_umi.go diff --git a/system/percentage_system.go b/deprecated/system/percentage_system.go similarity index 98% rename from system/percentage_system.go rename to deprecated/system/percentage_system.go index af7118f..c5e880c 100644 --- a/system/percentage_system.go +++ b/deprecated/system/percentage_system.go @@ -2,8 +2,9 @@ package system import ( "fmt" - "github.com/yohamta/donburi/filter" + "joylink.club/ecs" + "joylink.club/ecs/filter" ) // PercentageDeviceState 百分比设备 diff --git a/system/psd_system.go b/deprecated/system/psd_system.go similarity index 99% rename from system/psd_system.go rename to deprecated/system/psd_system.go index e7c9c05..984eebf 100644 --- a/system/psd_system.go +++ b/deprecated/system/psd_system.go @@ -1,9 +1,9 @@ package system import ( - "github.com/yohamta/donburi/filter" "joylink.club/ecs" - sysEvent "joylink.club/rtsssimulation/system/event" + "joylink.club/ecs/filter" + sysEvent "joylink.club/rtsssimulation/deprecated/system/event" ) // PsdDriveXGMJ 联锁驱动XGMJ diff --git a/system/relay_system.go b/deprecated/system/relay_system.go similarity index 95% rename from system/relay_system.go rename to deprecated/system/relay_system.go index aecd349..a260981 100644 --- a/system/relay_system.go +++ b/deprecated/system/relay_system.go @@ -1,9 +1,9 @@ package system import ( - "github.com/yohamta/donburi/filter" "joylink.club/ecs" - sysEvent "joylink.club/rtsssimulation/system/event" + "joylink.club/ecs/filter" + sysEvent "joylink.club/rtsssimulation/deprecated/system/event" ) // RelayState 继电器有两个线圈1-2,3-4 diff --git a/system/signal_2xh1_system.go b/deprecated/system/signal_2xh1_system.go similarity index 97% rename from system/signal_2xh1_system.go rename to deprecated/system/signal_2xh1_system.go index e3ea4ff..b172c80 100644 --- a/system/signal_2xh1_system.go +++ b/deprecated/system/signal_2xh1_system.go @@ -2,9 +2,10 @@ package system import ( "fmt" - "github.com/yohamta/donburi/filter" + "joylink.club/ecs" - sysEvent "joylink.club/rtsssimulation/system/event" + "joylink.club/ecs/filter" + sysEvent "joylink.club/rtsssimulation/deprecated/system/event" ) // Signal2XH1State 电路状态:**信号机2XH-1(红-绿) 出段(场)信号机 或 **出站区间阻挡信号机 diff --git a/system/signal_3xh1_system.go b/deprecated/system/signal_3xh1_system.go similarity index 98% rename from system/signal_3xh1_system.go rename to deprecated/system/signal_3xh1_system.go index 80f22b6..472de90 100644 --- a/system/signal_3xh1_system.go +++ b/deprecated/system/signal_3xh1_system.go @@ -3,9 +3,9 @@ package system import ( "fmt" - "github.com/yohamta/donburi/filter" "joylink.club/ecs" - sysEvent "joylink.club/rtsssimulation/system/event" + "joylink.club/ecs/filter" + sysEvent "joylink.club/rtsssimulation/deprecated/system/event" ) // 信号机电路继电器组合类型和功能名称常量 diff --git a/system/signal_3xh2_system.go b/deprecated/system/signal_3xh2_system.go similarity index 98% rename from system/signal_3xh2_system.go rename to deprecated/system/signal_3xh2_system.go index 86ae0e0..8addd57 100644 --- a/system/signal_3xh2_system.go +++ b/deprecated/system/signal_3xh2_system.go @@ -2,9 +2,10 @@ package system import ( "fmt" - "github.com/yohamta/donburi/filter" + "joylink.club/ecs" - sysEvent "joylink.club/rtsssimulation/system/event" + "joylink.club/ecs/filter" + sysEvent "joylink.club/rtsssimulation/deprecated/system/event" ) // Signal3XH2State 电路状态:信号机3XH-2(红-绿-黄) 道岔防护信号机(三显示不封灯、无单黄显示、带引导) diff --git a/system/signal_3xh3_system.go b/deprecated/system/signal_3xh3_system.go similarity index 97% rename from system/signal_3xh3_system.go rename to deprecated/system/signal_3xh3_system.go index e417f59..be5692c 100644 --- a/system/signal_3xh3_system.go +++ b/deprecated/system/signal_3xh3_system.go @@ -2,9 +2,10 @@ package system import ( "fmt" - "github.com/yohamta/donburi/filter" + "joylink.club/ecs" - sysEvent "joylink.club/rtsssimulation/system/event" + "joylink.club/ecs/filter" + sysEvent "joylink.club/rtsssimulation/deprecated/system/event" ) // Signal3XH3State 电路状态:信号机3XH-3(红-绿-黄) 道岔防护信号机(三显示封绿灯、有单黄显示、带引导) diff --git a/system/signal_3xh4_system.go b/deprecated/system/signal_3xh4_system.go similarity index 97% rename from system/signal_3xh4_system.go rename to deprecated/system/signal_3xh4_system.go index 7e00ea9..76b0b87 100644 --- a/system/signal_3xh4_system.go +++ b/deprecated/system/signal_3xh4_system.go @@ -2,9 +2,10 @@ package system import ( "fmt" - "github.com/yohamta/donburi/filter" + "joylink.club/ecs" - sysEvent "joylink.club/rtsssimulation/system/event" + "joylink.club/ecs/filter" + sysEvent "joylink.club/rtsssimulation/deprecated/system/event" ) // Signal3XH4State 电路状态:信号机3XH-4(红-绿-黄) 出站兼道岔防护信号机(三显示不封灯、有单黄显示、无引导) diff --git a/system/signal_dcxh_system.go b/deprecated/system/signal_dcxh_system.go similarity index 97% rename from system/signal_dcxh_system.go rename to deprecated/system/signal_dcxh_system.go index c906fb4..47ae420 100644 --- a/system/signal_dcxh_system.go +++ b/deprecated/system/signal_dcxh_system.go @@ -2,9 +2,10 @@ package system import ( "fmt" - "github.com/yohamta/donburi/filter" + "joylink.club/ecs" - sysEvent "joylink.club/rtsssimulation/system/event" + "joylink.club/ecs/filter" + sysEvent "joylink.club/rtsssimulation/deprecated/system/event" ) // SignalDCXHState 电路状态:信号机DCXH(蓝-白) 调车信号机 diff --git a/system/signal_jckxh_system.go b/deprecated/system/signal_jckxh_system.go similarity index 97% rename from system/signal_jckxh_system.go rename to deprecated/system/signal_jckxh_system.go index 1ff2c20..6546bec 100644 --- a/system/signal_jckxh_system.go +++ b/deprecated/system/signal_jckxh_system.go @@ -2,9 +2,10 @@ package system import ( "fmt" - "github.com/yohamta/donburi/filter" + "joylink.club/ecs" - sysEvent "joylink.club/rtsssimulation/system/event" + "joylink.club/ecs/filter" + sysEvent "joylink.club/rtsssimulation/deprecated/system/event" ) // SignalJCKXHState 电路状态:信号机JCKXH(红-白-黄) 进/出库列车兼调车信号机(三显示不封灯、有单黄显示、无引导) diff --git a/system/signal_jdxh_system.go b/deprecated/system/signal_jdxh_system.go similarity index 97% rename from system/signal_jdxh_system.go rename to deprecated/system/signal_jdxh_system.go index f7cfee1..df9a042 100644 --- a/system/signal_jdxh_system.go +++ b/deprecated/system/signal_jdxh_system.go @@ -2,9 +2,10 @@ package system import ( "fmt" - "github.com/yohamta/donburi/filter" + "joylink.club/ecs" - sysEvent "joylink.club/rtsssimulation/system/event" + "joylink.club/ecs/filter" + sysEvent "joylink.club/rtsssimulation/deprecated/system/event" ) // SignalJDXHState 电路状态:信号机JDXH(红-绿-黄) 进段信号机(三显示不封灯、无单黄显示、带引导) diff --git a/system/spks_system.go b/deprecated/system/spks_system.go similarity index 98% rename from system/spks_system.go rename to deprecated/system/spks_system.go index 007cc23..f0fc3c9 100644 --- a/system/spks_system.go +++ b/deprecated/system/spks_system.go @@ -1,8 +1,8 @@ package system import ( - "github.com/yohamta/donburi/filter" "joylink.club/ecs" + "joylink.club/ecs/filter" ) // SpksCircuitState 车站人员防护开关电路 diff --git a/system/switch_2jzdj9_system.go b/deprecated/system/switch_2jzdj9_system.go similarity index 99% rename from system/switch_2jzdj9_system.go rename to deprecated/system/switch_2jzdj9_system.go index d3c834f..6716106 100644 --- a/system/switch_2jzdj9_system.go +++ b/deprecated/system/switch_2jzdj9_system.go @@ -2,9 +2,10 @@ package system import ( "fmt" - "github.com/yohamta/donburi/filter" + "joylink.club/ecs" - sysEvent "joylink.club/rtsssimulation/system/event" + "joylink.club/ecs/filter" + sysEvent "joylink.club/rtsssimulation/deprecated/system/event" ) // --------联锁驱动----------------- diff --git a/system/system.go b/deprecated/system/system.go similarity index 93% rename from system/system.go rename to deprecated/system/system.go index 93995a9..47e5d0a 100644 --- a/system/system.go +++ b/deprecated/system/system.go @@ -2,12 +2,12 @@ package system import ( "fmt" - "joylink.club/rtsssimulation/simulation" - "github.com/yohamta/donburi/component" - "github.com/yohamta/donburi/filter" + "joylink.club/rtsssimulation/deprecated/simulation" + "joylink.club/ecs" - sysEvent "joylink.club/rtsssimulation/system/event" + "joylink.club/ecs/filter" + sysEvent "joylink.club/rtsssimulation/deprecated/system/event" ) // EntityIdentity 实体身份定义 @@ -60,7 +60,7 @@ func simpleRecover() { ///////////////////////////////////////////////////////// // EntityTag 实体标签 -type EntityTag = component.IComponentType +type EntityTag = ecs.IComponentType type EntityTagHandler struct { Tag EntityTag diff --git a/system/timer_system.go b/deprecated/system/timer_system.go similarity index 97% rename from system/timer_system.go rename to deprecated/system/timer_system.go index 83ed874..7b15256 100644 --- a/system/timer_system.go +++ b/deprecated/system/timer_system.go @@ -3,8 +3,8 @@ package system import ( "time" - "github.com/yohamta/donburi/filter" "joylink.club/ecs" + "joylink.club/ecs/filter" ) var SystemTimerComponent = ecs.NewComponentType[SystemTimer]() diff --git a/system/train_system.go b/deprecated/system/train_system.go similarity index 100% rename from system/train_system.go rename to deprecated/system/train_system.go diff --git a/system/type.go b/deprecated/system/type.go similarity index 100% rename from system/type.go rename to deprecated/system/type.go diff --git a/examples/test1/main.go b/deprecated/test1/main.go similarity index 100% rename from examples/test1/main.go rename to deprecated/test1/main.go diff --git a/examples/test1/sjzdj9/main.go b/deprecated/test1/sjzdj9/main.go similarity index 96% rename from examples/test1/sjzdj9/main.go rename to deprecated/test1/sjzdj9/main.go index 3bed4f8..da59c3c 100644 --- a/examples/test1/sjzdj9/main.go +++ b/deprecated/test1/sjzdj9/main.go @@ -2,16 +2,17 @@ package sjzdj9 import ( "fmt" - "joylink.club/rtsssimulation/examples/test1/tinit" - "joylink.club/rtsssimulation/repository/model/proto" "time" - "github.com/yohamta/donburi/filter" + "joylink.club/rtsssimulation/deprecated/test1/tinit" + "joylink.club/rtsssimulation/repository/model/proto" + "joylink.club/ecs" - "joylink.club/rtsssimulation/entities" - "joylink.club/rtsssimulation/examples/test1/tmodel" - "joylink.club/rtsssimulation/examples/test1/tstorages" - "joylink.club/rtsssimulation/system" + "joylink.club/ecs/filter" + "joylink.club/rtsssimulation/deprecated/entities" + "joylink.club/rtsssimulation/deprecated/system" + "joylink.club/rtsssimulation/deprecated/test1/tmodel" + "joylink.club/rtsssimulation/deprecated/test1/tstorages" ) // Test 测试双机ZDJ9道岔 diff --git a/examples/test1/tinit/config.go b/deprecated/test1/tinit/config.go similarity index 86% rename from examples/test1/tinit/config.go rename to deprecated/test1/tinit/config.go index 5b8635a..439aea1 100644 --- a/examples/test1/tinit/config.go +++ b/deprecated/test1/tinit/config.go @@ -1,9 +1,10 @@ package tinit import ( - "joylink.club/rtsssimulation/system" "time" + "joylink.club/rtsssimulation/deprecated/system" + "joylink.club/ecs" ) diff --git a/examples/test1/tinit/init.go b/deprecated/test1/tinit/init.go similarity index 84% rename from examples/test1/tinit/init.go rename to deprecated/test1/tinit/init.go index c1b69bb..e77260d 100644 --- a/examples/test1/tinit/init.go +++ b/deprecated/test1/tinit/init.go @@ -2,8 +2,8 @@ package tinit import ( "joylink.club/ecs" - "joylink.club/rtsssimulation/entities" - "joylink.club/rtsssimulation/system" + "joylink.club/rtsssimulation/deprecated/entities" + "joylink.club/rtsssimulation/deprecated/system" ) // InitializeWorld 初始化仿真world diff --git a/examples/test1/tmodel/device_model.go b/deprecated/test1/tmodel/device_model.go similarity index 85% rename from examples/test1/tmodel/device_model.go rename to deprecated/test1/tmodel/device_model.go index f6a26c8..7d5cf87 100644 --- a/examples/test1/tmodel/device_model.go +++ b/deprecated/test1/tmodel/device_model.go @@ -1,7 +1,7 @@ package tmodel import ( - "joylink.club/rtsssimulation/system" + "joylink.club/rtsssimulation/deprecated/system" ) // 设备模型基础信息 diff --git a/examples/test1/tmodel/relay_model.go b/deprecated/test1/tmodel/relay_model.go similarity index 100% rename from examples/test1/tmodel/relay_model.go rename to deprecated/test1/tmodel/relay_model.go diff --git a/examples/test1/tmodel/switch_model.go b/deprecated/test1/tmodel/switch_model.go similarity index 97% rename from examples/test1/tmodel/switch_model.go rename to deprecated/test1/tmodel/switch_model.go index 1c26d88..b8da1b6 100644 --- a/examples/test1/tmodel/switch_model.go +++ b/deprecated/test1/tmodel/switch_model.go @@ -1,8 +1,8 @@ package tmodel import ( + "joylink.club/rtsssimulation/deprecated/system" "joylink.club/rtsssimulation/repository/model/proto" - "joylink.club/rtsssimulation/system" ) // 道岔电路系统中的继电器 diff --git a/examples/test1/tstorages/model_storage.go b/deprecated/test1/tstorages/model_storage.go similarity index 97% rename from examples/test1/tstorages/model_storage.go rename to deprecated/test1/tstorages/model_storage.go index 71274e1..23d3075 100644 --- a/examples/test1/tstorages/model_storage.go +++ b/deprecated/test1/tstorages/model_storage.go @@ -2,7 +2,8 @@ package tstorages import ( "fmt" - "joylink.club/rtsssimulation/system" + + "joylink.club/rtsssimulation/deprecated/system" ) // 仿真模型数据定义 diff --git a/examples/test1/tstorages/storage_manager.go b/deprecated/test1/tstorages/storage_manager.go similarity index 97% rename from examples/test1/tstorages/storage_manager.go rename to deprecated/test1/tstorages/storage_manager.go index 69c36ca..5fa6512 100644 --- a/examples/test1/tstorages/storage_manager.go +++ b/deprecated/test1/tstorages/storage_manager.go @@ -2,8 +2,9 @@ package tstorages import ( "fmt" + + "joylink.club/rtsssimulation/deprecated/system" "joylink.club/rtsssimulation/repository/model/proto" - "joylink.club/rtsssimulation/system" ) // 共享仓库映射 diff --git a/entity/singleton.go b/entity/singleton.go index b58acdd..f88bf7b 100644 --- a/entity/singleton.go +++ b/entity/singleton.go @@ -3,8 +3,8 @@ package entity import ( "time" - "github.com/yohamta/donburi/filter" "joylink.club/ecs" + "joylink.club/ecs/filter" "joylink.club/rtsssimulation/component" "joylink.club/rtsssimulation/repository" ) diff --git a/go.mod b/go.mod index 4bc5c7f..fe1d836 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module joylink.club/rtsssimulation go 1.20 require ( - github.com/yohamta/donburi v1.3.8 google.golang.org/protobuf v1.31.0 ) diff --git a/go.work.sum b/go.work.sum index 0ae9788..8c0b2dc 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,15 +1,86 @@ +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/ebitengine/purego v0.0.0-20220905075623-aeed57cda744/go.mod h1:Eh8I3yvknDYZeCuXH9kRNaPuHEwvXDCk378o9xszmHg= github.com/ebitengine/purego v0.1.0/go.mod h1:Eh8I3yvknDYZeCuXH9kRNaPuHEwvXDCk378o9xszmHg= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20220806181222-55e207c401ad/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/hajimehoshi/bitmapfont/v2 v2.2.2/go.mod h1:Ua/x9Dkz7M9CU4zr1VHWOqGwjKdXbOTRsH7lWfb1Co0= github.com/hajimehoshi/ebiten/v2 v2.4.13/go.mod h1:BZcqCU4XHmScUi+lsKexocWcf4offMFwfp8dVGIB/G4= +github.com/hajimehoshi/file2byteslice v0.0.0-20210813153925-5340248a8f41/go.mod h1:CqqAHp7Dk/AqQiwuhV1yT2334qbA/tFWQW0MD2dGqUE= github.com/hajimehoshi/file2byteslice v1.0.0/go.mod h1:CqqAHp7Dk/AqQiwuhV1yT2334qbA/tFWQW0MD2dGqUE= +github.com/hajimehoshi/go-mp3 v0.3.3/go.mod h1:qMJj/CSDxx6CGHiZeCgbiq2DSUkbK0UbtXShQcnfyMM= +github.com/hajimehoshi/oto v0.6.1/go.mod h1:0QXGEkbuJRohbJaxr7ZQSxnju7hEhseiPx2hrh6raOI= +github.com/hajimehoshi/oto/v2 v2.3.1/go.mod h1:seWLbgHH7AyUMYKfKYT9pg7PhUu9/SisyJvNTT+ASQo= +github.com/jakecoffman/cp v1.2.1/go.mod h1:JjY/Fp6d8E1CHnu74gWNnU0+b9VzEdUVPoJxg2PsTQg= github.com/jezek/xgb v1.0.1/go.mod h1:nrhwO0FX/enq75I7Y7G8iN1ubpSGZEiA3v9e9GyRFlk= +github.com/jfreymuth/oggvorbis v1.0.4/go.mod h1:1U4pqWmghcoVsCJJ4fRBKv9peUJMBHixthRlBeD6uII= +github.com/jfreymuth/vorbis v1.0.2/go.mod h1:DoftRo4AznKnShRl1GxiTFCseHr4zR9BN3TWXyuzrqQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.1.0/go.mod h1:iyPr49SD/G/TBxYVB/9RRtGUT5eNbo2u4NamWeQcD5c= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190415191353-3e0bab5405d6/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mobile v0.0.0-20220722155234-aaac322e2105/go.mod h1:pe2sM7Uk+2Su1y7u/6Z8KJ24D7lepUjFZbhFOrmDfuQ= golang.org/x/mobile v0.0.0-20221012134814-c746ac228303/go.mod h1:M32cGdzp91A8Ex9qQtyZinr19EYxzkFqDjW2oyHzTDQ= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190429190828-d89cdac9e872/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220712014510-0a85c31ab51e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220818161305-2296e01440c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.8-0.20211022200916-316ba0b74098/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/proto/src/component/common.proto b/proto/src/component/common.proto new file mode 100644 index 0000000..d4aaed3 --- /dev/null +++ b/proto/src/component/common.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package component; + +option go_package = "./component/component_proto"; + +// 两个稳态位置转换组件 +message TwoPositionTransform { + int32 Pos = 1; // 当前位置百分比,[0, 10000],两位小数 + int32 Speed = 2; +} + +// 仅有两状态的组件 +message BitState { + bool Val = 1; +} + +// 计数/计时组件 +message Counter { + int32 Val = 1; + int32 Step = 2; +} + +// 倒数/倒计时组件 +message CounterDown { + int32 Val = 1; + int32 Step = 2; +} diff --git a/sys/circuit_sys/signal_2xh1.go b/sys/circuit_sys/signal_2xh1.go index 3366fae..746840e 100644 --- a/sys/circuit_sys/signal_2xh1.go +++ b/sys/circuit_sys/signal_2xh1.go @@ -1,8 +1,8 @@ package circuit_sys import ( - "github.com/yohamta/donburi/filter" "joylink.club/ecs" + "joylink.club/ecs/filter" "joylink.club/rtsssimulation/component" ) diff --git a/sys/circuit_sys/turnout_zdj9_2.go b/sys/circuit_sys/turnout_zdj9_2.go index bb4b872..617cae3 100644 --- a/sys/circuit_sys/turnout_zdj9_2.go +++ b/sys/circuit_sys/turnout_zdj9_2.go @@ -3,8 +3,8 @@ package circuit_sys import ( "fmt" - "github.com/yohamta/donburi/filter" "joylink.club/ecs" + "joylink.club/ecs/filter" "joylink.club/rtsssimulation/component" "joylink.club/rtsssimulation/consts" ) diff --git a/sys/common_sys/counter.go b/sys/common_sys/counter.go index 4d2eaf5..22b9fc7 100644 --- a/sys/common_sys/counter.go +++ b/sys/common_sys/counter.go @@ -1,8 +1,8 @@ package common_sys import ( - "github.com/yohamta/donburi/filter" "joylink.club/ecs" + "joylink.club/ecs/filter" "joylink.club/rtsssimulation/component" ) diff --git a/sys/common_sys/counterdown.go b/sys/common_sys/counterdown.go index 05fff92..7d3ba32 100644 --- a/sys/common_sys/counterdown.go +++ b/sys/common_sys/counterdown.go @@ -1,8 +1,8 @@ package common_sys import ( - "github.com/yohamta/donburi/filter" "joylink.club/ecs" + "joylink.club/ecs/filter" "joylink.club/rtsssimulation/component" ) diff --git a/sys/common_sys/two_position_movement.go b/sys/common_sys/two_position_movement.go index 25323bc..2e1d770 100644 --- a/sys/common_sys/two_position_movement.go +++ b/sys/common_sys/two_position_movement.go @@ -1,8 +1,8 @@ package common_sys import ( - "github.com/yohamta/donburi/filter" "joylink.club/ecs" + "joylink.club/ecs/filter" "joylink.club/rtsssimulation/component" "joylink.club/rtsssimulation/consts" ) diff --git a/sys/device_sys/dbq.go b/sys/device_sys/dbq.go index 88d022d..86f39aa 100644 --- a/sys/device_sys/dbq.go +++ b/sys/device_sys/dbq.go @@ -1,8 +1,8 @@ package device_sys import ( - "github.com/yohamta/donburi/filter" "joylink.club/ecs" + "joylink.club/ecs/filter" "joylink.club/rtsssimulation/component" "joylink.club/rtsssimulation/consts" ) diff --git a/sys/device_sys/relay.go b/sys/device_sys/relay.go index dea292d..ad3d136 100644 --- a/sys/device_sys/relay.go +++ b/sys/device_sys/relay.go @@ -3,8 +3,8 @@ package device_sys import ( "unsafe" - "github.com/yohamta/donburi/filter" "joylink.club/ecs" + "joylink.club/ecs/filter" "joylink.club/rtsssimulation/component" "joylink.club/rtsssimulation/consts" ) diff --git a/sys/device_sys/turnout.go b/sys/device_sys/turnout.go index e6fa62a..733de79 100644 --- a/sys/device_sys/turnout.go +++ b/sys/device_sys/turnout.go @@ -1,8 +1,8 @@ package device_sys import ( - "github.com/yohamta/donburi/filter" "joylink.club/ecs" + "joylink.club/ecs/filter" "joylink.club/rtsssimulation/component" ) diff --git a/sys/device_sys/zzj.go b/sys/device_sys/zzj.go index 04fb677..ce15e88 100644 --- a/sys/device_sys/zzj.go +++ b/sys/device_sys/zzj.go @@ -1,8 +1,8 @@ package device_sys import ( - "github.com/yohamta/donburi/filter" "joylink.club/ecs" + "joylink.club/ecs/filter" "joylink.club/rtsssimulation/component" "joylink.club/rtsssimulation/consts" ) diff --git a/sys/world_time.go b/sys/world_time.go index d2fcb0c..42c2c09 100644 --- a/sys/world_time.go +++ b/sys/world_time.go @@ -1,8 +1,8 @@ package sys import ( - "github.com/yohamta/donburi/filter" "joylink.club/ecs" + "joylink.club/ecs/filter" "joylink.club/rtsssimulation/component" )