diff --git a/go.mod b/go.mod index 037fdd7..4b6424f 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,18 @@ module joylink.club/rtsssimulation go 1.21 require ( - go.uber.org/zap v1.26.0 + github.com/stretchr/testify v1.8.3 google.golang.org/protobuf v1.31.0 + joylink.club/ecs v0.0.1 ) +replace joylink.club/ecs => ./jl-ecs-go + require ( + github.com/davecgh/go-spew v1.1.1 // indirect github.com/google/go-cmp v0.5.9 // indirect - github.com/stretchr/testify v1.8.3 // indirect - go.uber.org/multierr v1.10.0 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/yohamta/donburi v1.3.9 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index dcc9a6f..b6b3876 100644 --- a/go.sum +++ b/go.sum @@ -1,17 +1,26 @@ +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= -go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= -go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/yohamta/donburi v1.3.9 h1:sYAPaelSnxmoTGjgH9ZlYt4pUKrnwvAv4YGXxLZCK6E= +github.com/yohamta/donburi v1.3.9/go.mod h1:5QkyraUjkzbMVTD2b8jaPFy1Uwjm/zdFN1c1lZGaezg= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/go.work.sum b/go.work.sum index 7b90082..3f16d46 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,26 +1,81 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +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/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +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/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/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/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +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= go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= +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= -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= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +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= diff --git a/jl-ecs-go b/jl-ecs-go index 5aa1f62..bd947ba 160000 --- a/jl-ecs-go +++ b/jl-ecs-go @@ -1 +1 @@ -Subproject commit 5aa1f62ee8ba0f720e4444a05b53cdbaffe4780a +Subproject commit bd947baa4edadb6b7bd059f6e324fb20f8171f8f diff --git a/proto/src/model.proto b/proto/src/model.proto index fb22a3b..6583094 100644 --- a/proto/src/model.proto +++ b/proto/src/model.proto @@ -42,11 +42,6 @@ message SignalLayout { repeated KilometerConvert kilometerConverts = 10; } -// 继电器组合数据 -message RelayCombination { - -} - //物理区段 message PhysicalSection { string id = 1; @@ -160,6 +155,12 @@ enum DeviceType { DeviceType_Mkx = 17; DeviceType_Key = 18; DeviceType_Platform = 19; + // 信号机故障报警仪 + DeviceType_SignalFaultAlarm = 20; + //断路器 + DeviceType_Breakers = 21; + //电源屏 + DeviceType_PowerScreen = 22; } enum Port { @@ -269,6 +270,15 @@ message Station { string id = 1; string code = 2; repeated ElectronicGroup electronicGroup = 3; // 关联电子元件组合 + // 设备电子元件组合 + repeated DeviceEcc deccs = 4; // 暂时方案,后需重构 +} + +// 设备电子元件组合 +message DeviceEcc { + string deviceId = 1; + DeviceType deviceType = 2; + repeated ElectronicComponentGroup egs = 3; } // 元器件组信息 diff --git a/proto/src/repo.proto b/proto/src/repo.proto new file mode 100644 index 0000000..7c1c28f --- /dev/null +++ b/proto/src/repo.proto @@ -0,0 +1,330 @@ +syntax = "proto3"; + +package message; + +option go_package = "./repository/message_proto"; + +message Simulation { + enum Type { + // 城市轨道交通 + CG = 0; + // 国铁 + GT = 1; + } +} + +message Repo { + // 仿真类型 + Simulation.Type simType = 1; + oneof data { + CG cg = 2; + GT gt = 3; + } +} + +// 国铁数据 +message GT { + +} + +// 城轨数据 +message CG { + repeated Line lines = 1; +} + +// 城轨线路数据 +message Line { + // 所在城市 + string city = 1; + // 线路编号 + int32 lineId = 2; +} +// 信号布置数据 +message XHBZ { + // 数据id + string gid = 1; + // 车站 + repeated Station stations = 2; + // 站台 + repeated Platform platforms = 3; + // 屏蔽门 + repeated Psd psds = 4; + // 物理区段 + repeated PhysicalSection physicalSections = 5; + // 道岔 + repeated Turnout turnouts = 6; + // 信号机 + repeated Signal signals = 7; + // 应答器 + repeated Balise balises = 8; + // 停车点 + repeated ParkingSpot parkingSpots = 9; + // 坡度 + repeated Pd pds = 10; + // 曲度 + repeated Qd qds = 11; + // 紧急关闭/停车按钮 + repeated EMP emps = 12; + // 发车计时器 + repeated TDT tdts = 13; + // 门控箱 + repeated Mkx mkxs = 14; + // 就地控制盘 + repeated PSL psls = 15; + // 人员防护开关 + repeated SPKS spks = 16; +} +// 人员防护开关 +message SPKS { + uint32 id = 1; +} +// 就地控制盘 +message PSL { + uint32 id = 1; +} +// 门控箱 +message Mkx { + uint32 id = 1; +} +// 发车计时器 +message TDT { + uint32 id = 1; +} +// 紧急关闭/停车按钮 +message EMP { + uint32 id = 1; +} +// 曲度 +message Qd { + uint32 id = 1; +} +// 坡度 +message Pd { + uint32 id = 1; +} +// 停车点 +message ParkingSpot { + uint32 id = 1; +} +// 应答器 +message Balise { + uint32 id = 1; +} +//区段检测点 +message CheckPoint{ + // 检测点类型 + enum Type { + Boundary = 0; //区段边界 + JZ = 1; //计轴器 + JYJ = 2; //绝缘节 + } + uint32 id = 1; + // 检测点类型 + Type type = 2; + // 公里标 + GLB glb = 3; + // 关联的物理区段/道岔端口 + repeated DevicePort devicePorts = 4; +} +// 设备 +message Device { + // 设备类型 + enum Type { + // 区段 + Section = 0; + // 道岔 + Turnout = 1; + // 信号机 + Signal = 2; + } + // 设备端点(区段、道岔) + enum Port { + A = 0; + B = 1; + C = 2; + } + // 设备id + uint32 id = 1; + // 设备类型 + Type type = 2; +} + +// 设备端点 +message DevicePort { + // 设备id + uint32 id = 1; + // 设备类型 + Device.Type type = 2; + // 设备端 + Device.Port port = 3; +} +// 信号机 +message Signal { + enum Model { + HLU = 0; + } + uint32 id = 1; + // 信号机编号 + string code = 2; +} +// 道岔 +message Turnout { + uint32 id = 1; +} +// 物理区段 +message PhysicalSection { + uint32 id = 1; +} +// 屏蔽门 +message Psd { + uint32 id = 1; +} +//站台 +message Platform { + uint32 id = 1; + // 编号 + string code = 2; + // 所属车站 + uint32 stationId = 3; + // 关联物理区段(站台轨) + uint32 physicalSectionId = 4; +} +// 车站 +message Station { + uint32 id = 1; + // 车站名 + string name = 2; + // 车站站名 + string zname = 3; + // 车站公里标(站台中心点) + GLB glb = 4; +} +//公里标 +message GLB { + //坐标系编号 + string zbx = 1; + //左右行 + bool right = 2; + //公里标值,单位mm + int64 value = 3; +} + + +// 联锁设备布置数据 +message CiSBBZ { + // 设备集中站uid + string ecsId = 1; + // 继电器 + repeated Relay relays = 2; + // 断相保护器 + repeated PFP pfps = 3; + // 设备电气组合组 + repeated DeviceEcc deviceEcgs = 4; + // 联锁采集码表 + repeated CiCjTable cjt = 5; + // 联锁驱动码表 + repeated CiQdTable qdt = 6; + // 联锁区段码位表 + repeated string sectionIds = 7; +} +// 联锁区段码位表 +message CiSectionTable { + // 区段id + repeated uint32 sectionIds = 1; +} +// 联锁驱动码表 +message CiQdTable { + // 继电器id + repeated uint32 relayIds = 1; +} +// 联锁采集码表 +message CiCjTable { + repeated CiCjItem items = 1; +} +// 联锁采集项 +message CiCjItem { + // 继电器id + uint32 relayId = 1; + // 采集继电器前后接点(前接点为吸起/定位),true-前接点,false-后接点 + bool q = 2; +} +// 断相保护器(Phase failure protector) +message PFP { + uint32 id = 1; + // 编号 + string code = 2; +} +// 继电器 +message Relay { + // 继电器型号 + enum Model { + JPXC_1000 = 0; + JPXC_1700 = 1; + JWJXC_480 = 2; + JWJXC_H125_80 = 3; + JWXC_1700 = 4; + JWXC_H340 = 5; + JYJXC_160_260 = 6; + JZXC_H18 = 7; + } + uint32 id = 1; + // 继电器型号 + Model model = 2; + // 编号 + string code = 3; +} +// 按钮、灯等监控盘(IBP/门控箱/PSL等) +message JKP { + enum Type { + IBP = 0; + PSL = 1; + MKX = 2; + } + // 数据id + uint32 gid = 1; + // 开关 + repeated KaiGuan kgs = 2; + // 灯 + repeated Lamp lamps = 3; + // 警铃 + repeated Alarm alarms = 4; + // 设备电子元件组合 + repeated DeviceEcc deviceEccs = 5; +} +// 警铃/蜂鸣器 +message Alarm { + uint32 id = 1; + // 编号 + string code = 2; +} +// 开关 +message KaiGuan { + uint32 id = 1; + // 编号 + string code = 2; + // 是否有背光灯 + bool lamp = 3; +} +// 灯 +message Lamp { + uint32 id = 1; + // 编号 + string code = 2; +} + +// 设备电子元件组合 +message DeviceEcc { + // 设备编号 + string deviceCode = 1; + // 设备类型 + Device.Type deviceType = 2; + // 电子元件组合 + repeated Ecc ecc = 3; +} +// 电子元件组合 +message Ecc { + // 组合名称 + string code = 1; + // 关联的电子元件id + repeated uint32 ids = 2; +} \ No newline at end of file diff --git a/sys/device_sys/fadc_axle_device.go b/sys/device_sys/fadc_axle_device.go index 3e1526f..6708a26 100644 --- a/sys/device_sys/fadc_axle_device.go +++ b/sys/device_sys/fadc_axle_device.go @@ -1,12 +1,12 @@ package device_sys import ( - "github.com/yohamta/donburi" + "log/slog" + "joylink.club/ecs" "joylink.club/ecs/filter" "joylink.club/rtsssimulation/component" "joylink.club/rtsssimulation/entity" - "log/slog" ) // FaDcAxleDeviceSystem FaDc计轴设备管理器系统 @@ -21,7 +21,7 @@ func NewFaDcAxleDeviceSystem() *FaDcAxleDeviceSystem { } func (s *FaDcAxleDeviceSystem) Update(w ecs.World) { data := entity.GetWorldData(w) - s.query.Each(w, func(entry *donburi.Entry) { + s.query.Each(w, func(entry *ecs.Entry) { faDcDevice := component.AxleManageDeviceType.Get(entry) for axleSectionId, axleRuntime := range faDcDevice.Adrs { axleSectionEntry := data.EntityMap[axleSectionId] diff --git a/sys/device_sys/section_detection.to.go b/sys/device_sys/section_detection.to.go index 9ba9729..da37c90 100644 --- a/sys/device_sys/section_detection.to.go +++ b/sys/device_sys/section_detection.to.go @@ -2,15 +2,15 @@ package device_sys import ( "fmt" - "github.com/yohamta/donburi" + "log/slog" + "strings" + "joylink.club/ecs" "joylink.club/ecs/filter" "joylink.club/rtsssimulation/component" "joylink.club/rtsssimulation/entity" "joylink.club/rtsssimulation/repository" "joylink.club/rtsssimulation/repository/model/proto" - "log/slog" - "strings" ) // SectionDetectSystem 区段检测系统 @@ -27,7 +27,7 @@ func (s *SectionDetectSystem) Update(w ecs.World) { //key-sectionId,统计区段上有车的情况 sectionTrainMap := make(map[string]*trainCount) //所有列车 - s.trainQuery.Each(w, func(entry *donburi.Entry) { + s.trainQuery.Each(w, func(entry *ecs.Entry) { tp := component.TrainPositionInfoType.Get(entry) //fmt.Println("============>>>>>>列车位置信息:", tp.ToString()) trainSectionIds := s.doSearchTrainOccupiedSections(w, tp) @@ -42,7 +42,7 @@ func (s *SectionDetectSystem) Update(w ecs.World) { } }) //计轴区段 - s.axleSectionQuery.Each(w, func(entry *donburi.Entry) { + s.axleSectionQuery.Each(w, func(entry *ecs.Entry) { axleSectionId := component.UidType.Get(entry).Id axleSection := component.AxlePhysicalSectionType.Get(entry) tc, find := sectionTrainMap[axleSectionId]