rsmp 0.35.2 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.devcontainer/devcontainer.json +22 -0
- data/.github/copilot-instructions.md +33 -0
- data/.github/workflows/copilot-setup-steps.yml +35 -0
- data/.github/workflows/rspec.yaml +2 -1
- data/.github/workflows/rubocop.yaml +17 -0
- data/.gitignore +7 -7
- data/.rubocop.yml +80 -0
- data/Gemfile +13 -1
- data/Gemfile.lock +73 -35
- data/Rakefile +3 -3
- data/bin/console +2 -4
- data/documentation/tasks.md +4 -4
- data/lib/rsmp/cli.rb +147 -124
- data/lib/rsmp/collect/ack_collector.rb +8 -7
- data/lib/rsmp/collect/aggregated_status_collector.rb +4 -4
- data/lib/rsmp/collect/alarm_collector.rb +31 -23
- data/lib/rsmp/collect/alarm_matcher.rb +3 -3
- data/lib/rsmp/collect/collector/logging.rb +17 -0
- data/lib/rsmp/collect/collector/reporting.rb +44 -0
- data/lib/rsmp/collect/collector/status.rb +34 -0
- data/lib/rsmp/collect/collector.rb +69 -150
- data/lib/rsmp/collect/command_matcher.rb +19 -6
- data/lib/rsmp/collect/command_response_collector.rb +7 -7
- data/lib/rsmp/collect/distributor.rb +14 -11
- data/lib/rsmp/collect/filter.rb +31 -15
- data/lib/rsmp/collect/matcher.rb +7 -11
- data/lib/rsmp/collect/queue.rb +4 -4
- data/lib/rsmp/collect/receiver.rb +10 -12
- data/lib/rsmp/collect/state_collector.rb +116 -77
- data/lib/rsmp/collect/status_collector.rb +6 -6
- data/lib/rsmp/collect/status_matcher.rb +17 -7
- data/lib/rsmp/{alarm_state.rb → component/alarm_state.rb} +76 -37
- data/lib/rsmp/{component.rb → component/component.rb} +15 -15
- data/lib/rsmp/component/component_base.rb +89 -0
- data/lib/rsmp/component/component_proxy.rb +75 -0
- data/lib/rsmp/component/components.rb +63 -0
- data/lib/rsmp/convert/export/json_schema.rb +116 -110
- data/lib/rsmp/convert/import/yaml.rb +21 -18
- data/lib/rsmp/{rsmp.rb → helpers/clock.rb} +5 -6
- data/lib/rsmp/{deep_merge.rb → helpers/deep_merge.rb} +2 -1
- data/lib/rsmp/helpers/error.rb +71 -0
- data/lib/rsmp/{inspect.rb → helpers/inspect.rb} +6 -10
- data/lib/rsmp/log/archive.rb +98 -0
- data/lib/rsmp/log/colorization.rb +41 -0
- data/lib/rsmp/log/filtering.rb +54 -0
- data/lib/rsmp/log/logger.rb +206 -0
- data/lib/rsmp/{logging.rb → log/logging.rb} +5 -7
- data/lib/rsmp/message.rb +159 -148
- data/lib/rsmp/{node.rb → node/node.rb} +19 -17
- data/lib/rsmp/node/protocol.rb +37 -0
- data/lib/rsmp/node/site/site.rb +195 -0
- data/lib/rsmp/node/supervisor/modules/configuration.rb +59 -0
- data/lib/rsmp/node/supervisor/modules/connection.rb +140 -0
- data/lib/rsmp/node/supervisor/modules/sites.rb +64 -0
- data/lib/rsmp/node/supervisor/supervisor.rb +72 -0
- data/lib/rsmp/{task.rb → node/task.rb} +29 -19
- data/lib/rsmp/proxy/modules/acknowledgements.rb +144 -0
- data/lib/rsmp/proxy/modules/receive.rb +119 -0
- data/lib/rsmp/proxy/modules/send.rb +76 -0
- data/lib/rsmp/proxy/modules/state.rb +25 -0
- data/lib/rsmp/proxy/modules/tasks.rb +105 -0
- data/lib/rsmp/proxy/modules/versions.rb +69 -0
- data/lib/rsmp/proxy/modules/watchdogs.rb +66 -0
- data/lib/rsmp/proxy/proxy.rb +199 -0
- data/lib/rsmp/proxy/site/modules/aggregated_status.rb +52 -0
- data/lib/rsmp/proxy/site/modules/alarms.rb +27 -0
- data/lib/rsmp/proxy/site/modules/commands.rb +31 -0
- data/lib/rsmp/proxy/site/modules/status.rb +110 -0
- data/lib/rsmp/proxy/site/site_proxy.rb +205 -0
- data/lib/rsmp/proxy/supervisor/modules/aggregated_status.rb +47 -0
- data/lib/rsmp/proxy/supervisor/modules/alarms.rb +73 -0
- data/lib/rsmp/proxy/supervisor/modules/commands.rb +53 -0
- data/lib/rsmp/proxy/supervisor/modules/status.rb +204 -0
- data/lib/rsmp/proxy/supervisor/supervisor_proxy.rb +178 -0
- data/lib/rsmp/tlc/detector_logic.rb +18 -34
- data/lib/rsmp/tlc/input_states.rb +126 -0
- data/lib/rsmp/tlc/modules/detector_logics.rb +50 -0
- data/lib/rsmp/tlc/modules/display.rb +78 -0
- data/lib/rsmp/tlc/modules/helpers.rb +41 -0
- data/lib/rsmp/tlc/modules/inputs.rb +173 -0
- data/lib/rsmp/tlc/modules/modes.rb +253 -0
- data/lib/rsmp/tlc/modules/outputs.rb +30 -0
- data/lib/rsmp/tlc/modules/plans.rb +218 -0
- data/lib/rsmp/tlc/modules/signal_groups.rb +109 -0
- data/lib/rsmp/tlc/modules/startup_sequence.rb +22 -0
- data/lib/rsmp/tlc/modules/system.rb +140 -0
- data/lib/rsmp/tlc/modules/traffic_data.rb +49 -0
- data/lib/rsmp/tlc/signal_group.rb +37 -41
- data/lib/rsmp/tlc/signal_plan.rb +14 -11
- data/lib/rsmp/tlc/signal_priority.rb +39 -35
- data/lib/rsmp/tlc/startup_sequence.rb +59 -0
- data/lib/rsmp/tlc/traffic_controller.rb +39 -1006
- data/lib/rsmp/tlc/traffic_controller_site.rb +58 -57
- data/lib/rsmp/version.rb +1 -1
- data/lib/rsmp.rb +86 -49
- data/rsmp.gemspec +24 -30
- metadata +87 -130
- data/lib/rsmp/archive.rb +0 -76
- data/lib/rsmp/collect/message_matchers.rb +0 -0
- data/lib/rsmp/component_base.rb +0 -87
- data/lib/rsmp/component_proxy.rb +0 -57
- data/lib/rsmp/components.rb +0 -65
- data/lib/rsmp/error.rb +0 -71
- data/lib/rsmp/logger.rb +0 -216
- data/lib/rsmp/proxy.rb +0 -695
- data/lib/rsmp/site.rb +0 -188
- data/lib/rsmp/site_proxy.rb +0 -389
- data/lib/rsmp/supervisor.rb +0 -287
- data/lib/rsmp/supervisor_proxy.rb +0 -516
- data/lib/rsmp/tlc/inputs.rb +0 -134
metadata
CHANGED
|
@@ -1,70 +1,28 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rsmp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.38.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Emil Tin
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
|
-
- !ruby/object:Gem::Dependency
|
|
13
|
-
name: logger
|
|
14
|
-
requirement: !ruby/object:Gem::Requirement
|
|
15
|
-
requirements:
|
|
16
|
-
- - "~>"
|
|
17
|
-
- !ruby/object:Gem::Version
|
|
18
|
-
version: '1.6'
|
|
19
|
-
type: :runtime
|
|
20
|
-
prerelease: false
|
|
21
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
-
requirements:
|
|
23
|
-
- - "~>"
|
|
24
|
-
- !ruby/object:Gem::Version
|
|
25
|
-
version: '1.6'
|
|
26
|
-
- !ruby/object:Gem::Dependency
|
|
27
|
-
name: ostruct
|
|
28
|
-
requirement: !ruby/object:Gem::Requirement
|
|
29
|
-
requirements:
|
|
30
|
-
- - "~>"
|
|
31
|
-
- !ruby/object:Gem::Version
|
|
32
|
-
version: '0.6'
|
|
33
|
-
type: :runtime
|
|
34
|
-
prerelease: false
|
|
35
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
-
requirements:
|
|
37
|
-
- - "~>"
|
|
38
|
-
- !ruby/object:Gem::Version
|
|
39
|
-
version: '0.6'
|
|
40
12
|
- !ruby/object:Gem::Dependency
|
|
41
13
|
name: async
|
|
42
14
|
requirement: !ruby/object:Gem::Requirement
|
|
43
15
|
requirements:
|
|
44
16
|
- - "~>"
|
|
45
17
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: '2.
|
|
18
|
+
version: '2.32'
|
|
47
19
|
type: :runtime
|
|
48
20
|
prerelease: false
|
|
49
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
22
|
requirements:
|
|
51
23
|
- - "~>"
|
|
52
24
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: '2.
|
|
54
|
-
- !ruby/object:Gem::Dependency
|
|
55
|
-
name: async-io
|
|
56
|
-
requirement: !ruby/object:Gem::Requirement
|
|
57
|
-
requirements:
|
|
58
|
-
- - "~>"
|
|
59
|
-
- !ruby/object:Gem::Version
|
|
60
|
-
version: '1.43'
|
|
61
|
-
type: :runtime
|
|
62
|
-
prerelease: false
|
|
63
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
-
requirements:
|
|
65
|
-
- - "~>"
|
|
66
|
-
- !ruby/object:Gem::Version
|
|
67
|
-
version: '1.43'
|
|
25
|
+
version: '2.32'
|
|
68
26
|
- !ruby/object:Gem::Dependency
|
|
69
27
|
name: colorize
|
|
70
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -80,117 +38,75 @@ dependencies:
|
|
|
80
38
|
- !ruby/object:Gem::Version
|
|
81
39
|
version: '1.1'
|
|
82
40
|
- !ruby/object:Gem::Dependency
|
|
83
|
-
name:
|
|
41
|
+
name: io-endpoint
|
|
84
42
|
requirement: !ruby/object:Gem::Requirement
|
|
85
43
|
requirements:
|
|
86
44
|
- - "~>"
|
|
87
45
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: '0.
|
|
46
|
+
version: '0.15'
|
|
89
47
|
type: :runtime
|
|
90
48
|
prerelease: false
|
|
91
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
92
50
|
requirements:
|
|
93
51
|
- - "~>"
|
|
94
52
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: '0.
|
|
53
|
+
version: '0.15'
|
|
96
54
|
- !ruby/object:Gem::Dependency
|
|
97
|
-
name:
|
|
55
|
+
name: io-stream
|
|
98
56
|
requirement: !ruby/object:Gem::Requirement
|
|
99
57
|
requirements:
|
|
100
58
|
- - "~>"
|
|
101
59
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: '
|
|
103
|
-
type: :
|
|
104
|
-
prerelease: false
|
|
105
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
106
|
-
requirements:
|
|
107
|
-
- - "~>"
|
|
108
|
-
- !ruby/object:Gem::Version
|
|
109
|
-
version: '2.6'
|
|
110
|
-
- !ruby/object:Gem::Dependency
|
|
111
|
-
name: rake
|
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
|
113
|
-
requirements:
|
|
114
|
-
- - "~>"
|
|
115
|
-
- !ruby/object:Gem::Version
|
|
116
|
-
version: '13.2'
|
|
117
|
-
type: :development
|
|
118
|
-
prerelease: false
|
|
119
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
120
|
-
requirements:
|
|
121
|
-
- - "~>"
|
|
122
|
-
- !ruby/object:Gem::Version
|
|
123
|
-
version: '13.2'
|
|
124
|
-
- !ruby/object:Gem::Dependency
|
|
125
|
-
name: rspec
|
|
126
|
-
requirement: !ruby/object:Gem::Requirement
|
|
127
|
-
requirements:
|
|
128
|
-
- - "~>"
|
|
129
|
-
- !ruby/object:Gem::Version
|
|
130
|
-
version: '3.13'
|
|
131
|
-
type: :development
|
|
132
|
-
prerelease: false
|
|
133
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
134
|
-
requirements:
|
|
135
|
-
- - "~>"
|
|
136
|
-
- !ruby/object:Gem::Version
|
|
137
|
-
version: '3.13'
|
|
138
|
-
- !ruby/object:Gem::Dependency
|
|
139
|
-
name: rspec-expectations
|
|
140
|
-
requirement: !ruby/object:Gem::Requirement
|
|
141
|
-
requirements:
|
|
142
|
-
- - "~>"
|
|
143
|
-
- !ruby/object:Gem::Version
|
|
144
|
-
version: '3.13'
|
|
145
|
-
type: :development
|
|
60
|
+
version: '0.10'
|
|
61
|
+
type: :runtime
|
|
146
62
|
prerelease: false
|
|
147
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
148
64
|
requirements:
|
|
149
65
|
- - "~>"
|
|
150
66
|
- !ruby/object:Gem::Version
|
|
151
|
-
version: '
|
|
67
|
+
version: '0.10'
|
|
152
68
|
- !ruby/object:Gem::Dependency
|
|
153
|
-
name:
|
|
69
|
+
name: logger
|
|
154
70
|
requirement: !ruby/object:Gem::Requirement
|
|
155
71
|
requirements:
|
|
156
72
|
- - "~>"
|
|
157
73
|
- !ruby/object:Gem::Version
|
|
158
|
-
version: '
|
|
159
|
-
type: :
|
|
74
|
+
version: '1.6'
|
|
75
|
+
type: :runtime
|
|
160
76
|
prerelease: false
|
|
161
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
162
78
|
requirements:
|
|
163
79
|
- - "~>"
|
|
164
80
|
- !ruby/object:Gem::Version
|
|
165
|
-
version: '
|
|
81
|
+
version: '1.6'
|
|
166
82
|
- !ruby/object:Gem::Dependency
|
|
167
|
-
name:
|
|
83
|
+
name: ostruct
|
|
168
84
|
requirement: !ruby/object:Gem::Requirement
|
|
169
85
|
requirements:
|
|
170
86
|
- - "~>"
|
|
171
87
|
- !ruby/object:Gem::Version
|
|
172
|
-
version: '
|
|
173
|
-
type: :
|
|
88
|
+
version: '0.6'
|
|
89
|
+
type: :runtime
|
|
174
90
|
prerelease: false
|
|
175
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
176
92
|
requirements:
|
|
177
93
|
- - "~>"
|
|
178
94
|
- !ruby/object:Gem::Version
|
|
179
|
-
version: '
|
|
95
|
+
version: '0.6'
|
|
180
96
|
- !ruby/object:Gem::Dependency
|
|
181
|
-
name:
|
|
97
|
+
name: rsmp_schema
|
|
182
98
|
requirement: !ruby/object:Gem::Requirement
|
|
183
99
|
requirements:
|
|
184
100
|
- - "~>"
|
|
185
101
|
- !ruby/object:Gem::Version
|
|
186
|
-
version: '
|
|
187
|
-
type: :
|
|
102
|
+
version: '0.8'
|
|
103
|
+
type: :runtime
|
|
188
104
|
prerelease: false
|
|
189
105
|
version_requirements: !ruby/object:Gem::Requirement
|
|
190
106
|
requirements:
|
|
191
107
|
- - "~>"
|
|
192
108
|
- !ruby/object:Gem::Version
|
|
193
|
-
version: '
|
|
109
|
+
version: '0.8'
|
|
194
110
|
description: Easy RSMP site and supervisor communication.
|
|
195
111
|
email:
|
|
196
112
|
- zf0f@kk.dk
|
|
@@ -199,10 +115,15 @@ executables:
|
|
|
199
115
|
extensions: []
|
|
200
116
|
extra_rdoc_files: []
|
|
201
117
|
files:
|
|
118
|
+
- ".devcontainer/devcontainer.json"
|
|
119
|
+
- ".github/copilot-instructions.md"
|
|
120
|
+
- ".github/workflows/copilot-setup-steps.yml"
|
|
202
121
|
- ".github/workflows/rspec.yaml"
|
|
122
|
+
- ".github/workflows/rubocop.yaml"
|
|
203
123
|
- ".gitignore"
|
|
204
124
|
- ".gitmodules"
|
|
205
125
|
- ".rspec"
|
|
126
|
+
- ".rubocop.yml"
|
|
206
127
|
- ".tool-versions"
|
|
207
128
|
- CHANGELOG.md
|
|
208
129
|
- Gemfile
|
|
@@ -221,50 +142,85 @@ files:
|
|
|
221
142
|
- documentation/tasks.md
|
|
222
143
|
- exe/rsmp
|
|
223
144
|
- lib/rsmp.rb
|
|
224
|
-
- lib/rsmp/alarm_state.rb
|
|
225
|
-
- lib/rsmp/archive.rb
|
|
226
145
|
- lib/rsmp/cli.rb
|
|
227
146
|
- lib/rsmp/collect/ack_collector.rb
|
|
228
147
|
- lib/rsmp/collect/aggregated_status_collector.rb
|
|
229
148
|
- lib/rsmp/collect/alarm_collector.rb
|
|
230
149
|
- lib/rsmp/collect/alarm_matcher.rb
|
|
231
150
|
- lib/rsmp/collect/collector.rb
|
|
151
|
+
- lib/rsmp/collect/collector/logging.rb
|
|
152
|
+
- lib/rsmp/collect/collector/reporting.rb
|
|
153
|
+
- lib/rsmp/collect/collector/status.rb
|
|
232
154
|
- lib/rsmp/collect/command_matcher.rb
|
|
233
155
|
- lib/rsmp/collect/command_response_collector.rb
|
|
234
156
|
- lib/rsmp/collect/distributor.rb
|
|
235
157
|
- lib/rsmp/collect/filter.rb
|
|
236
158
|
- lib/rsmp/collect/matcher.rb
|
|
237
|
-
- lib/rsmp/collect/message_matchers.rb
|
|
238
159
|
- lib/rsmp/collect/queue.rb
|
|
239
160
|
- lib/rsmp/collect/receiver.rb
|
|
240
161
|
- lib/rsmp/collect/state_collector.rb
|
|
241
162
|
- lib/rsmp/collect/status_collector.rb
|
|
242
163
|
- lib/rsmp/collect/status_matcher.rb
|
|
243
|
-
- lib/rsmp/component.rb
|
|
244
|
-
- lib/rsmp/
|
|
245
|
-
- lib/rsmp/
|
|
246
|
-
- lib/rsmp/
|
|
164
|
+
- lib/rsmp/component/alarm_state.rb
|
|
165
|
+
- lib/rsmp/component/component.rb
|
|
166
|
+
- lib/rsmp/component/component_base.rb
|
|
167
|
+
- lib/rsmp/component/component_proxy.rb
|
|
168
|
+
- lib/rsmp/component/components.rb
|
|
247
169
|
- lib/rsmp/convert/export/json_schema.rb
|
|
248
170
|
- lib/rsmp/convert/import/yaml.rb
|
|
249
|
-
- lib/rsmp/
|
|
250
|
-
- lib/rsmp/
|
|
251
|
-
- lib/rsmp/
|
|
252
|
-
- lib/rsmp/
|
|
253
|
-
- lib/rsmp/
|
|
171
|
+
- lib/rsmp/helpers/clock.rb
|
|
172
|
+
- lib/rsmp/helpers/deep_merge.rb
|
|
173
|
+
- lib/rsmp/helpers/error.rb
|
|
174
|
+
- lib/rsmp/helpers/inspect.rb
|
|
175
|
+
- lib/rsmp/log/archive.rb
|
|
176
|
+
- lib/rsmp/log/colorization.rb
|
|
177
|
+
- lib/rsmp/log/filtering.rb
|
|
178
|
+
- lib/rsmp/log/logger.rb
|
|
179
|
+
- lib/rsmp/log/logging.rb
|
|
254
180
|
- lib/rsmp/message.rb
|
|
255
|
-
- lib/rsmp/node.rb
|
|
256
|
-
- lib/rsmp/
|
|
257
|
-
- lib/rsmp/
|
|
258
|
-
- lib/rsmp/
|
|
259
|
-
- lib/rsmp/
|
|
260
|
-
- lib/rsmp/supervisor.rb
|
|
261
|
-
- lib/rsmp/
|
|
262
|
-
- lib/rsmp/task.rb
|
|
181
|
+
- lib/rsmp/node/node.rb
|
|
182
|
+
- lib/rsmp/node/protocol.rb
|
|
183
|
+
- lib/rsmp/node/site/site.rb
|
|
184
|
+
- lib/rsmp/node/supervisor/modules/configuration.rb
|
|
185
|
+
- lib/rsmp/node/supervisor/modules/connection.rb
|
|
186
|
+
- lib/rsmp/node/supervisor/modules/sites.rb
|
|
187
|
+
- lib/rsmp/node/supervisor/supervisor.rb
|
|
188
|
+
- lib/rsmp/node/task.rb
|
|
189
|
+
- lib/rsmp/proxy/modules/acknowledgements.rb
|
|
190
|
+
- lib/rsmp/proxy/modules/receive.rb
|
|
191
|
+
- lib/rsmp/proxy/modules/send.rb
|
|
192
|
+
- lib/rsmp/proxy/modules/state.rb
|
|
193
|
+
- lib/rsmp/proxy/modules/tasks.rb
|
|
194
|
+
- lib/rsmp/proxy/modules/versions.rb
|
|
195
|
+
- lib/rsmp/proxy/modules/watchdogs.rb
|
|
196
|
+
- lib/rsmp/proxy/proxy.rb
|
|
197
|
+
- lib/rsmp/proxy/site/modules/aggregated_status.rb
|
|
198
|
+
- lib/rsmp/proxy/site/modules/alarms.rb
|
|
199
|
+
- lib/rsmp/proxy/site/modules/commands.rb
|
|
200
|
+
- lib/rsmp/proxy/site/modules/status.rb
|
|
201
|
+
- lib/rsmp/proxy/site/site_proxy.rb
|
|
202
|
+
- lib/rsmp/proxy/supervisor/modules/aggregated_status.rb
|
|
203
|
+
- lib/rsmp/proxy/supervisor/modules/alarms.rb
|
|
204
|
+
- lib/rsmp/proxy/supervisor/modules/commands.rb
|
|
205
|
+
- lib/rsmp/proxy/supervisor/modules/status.rb
|
|
206
|
+
- lib/rsmp/proxy/supervisor/supervisor_proxy.rb
|
|
263
207
|
- lib/rsmp/tlc/detector_logic.rb
|
|
264
|
-
- lib/rsmp/tlc/
|
|
208
|
+
- lib/rsmp/tlc/input_states.rb
|
|
209
|
+
- lib/rsmp/tlc/modules/detector_logics.rb
|
|
210
|
+
- lib/rsmp/tlc/modules/display.rb
|
|
211
|
+
- lib/rsmp/tlc/modules/helpers.rb
|
|
212
|
+
- lib/rsmp/tlc/modules/inputs.rb
|
|
213
|
+
- lib/rsmp/tlc/modules/modes.rb
|
|
214
|
+
- lib/rsmp/tlc/modules/outputs.rb
|
|
215
|
+
- lib/rsmp/tlc/modules/plans.rb
|
|
216
|
+
- lib/rsmp/tlc/modules/signal_groups.rb
|
|
217
|
+
- lib/rsmp/tlc/modules/startup_sequence.rb
|
|
218
|
+
- lib/rsmp/tlc/modules/system.rb
|
|
219
|
+
- lib/rsmp/tlc/modules/traffic_data.rb
|
|
265
220
|
- lib/rsmp/tlc/signal_group.rb
|
|
266
221
|
- lib/rsmp/tlc/signal_plan.rb
|
|
267
222
|
- lib/rsmp/tlc/signal_priority.rb
|
|
223
|
+
- lib/rsmp/tlc/startup_sequence.rb
|
|
268
224
|
- lib/rsmp/tlc/traffic_controller.rb
|
|
269
225
|
- lib/rsmp/tlc/traffic_controller_site.rb
|
|
270
226
|
- lib/rsmp/version.rb
|
|
@@ -277,6 +233,7 @@ metadata:
|
|
|
277
233
|
source_code_uri: https://github.com/rsmp-nordic/rsmp
|
|
278
234
|
changelog_uri: https://github.com/rsmp-nordic/rsmp/blob/master/CHANGELOG.md
|
|
279
235
|
bug_tracker_uri: https://github.com/rsmp-nordic/rsmp/issues
|
|
236
|
+
rubygems_mfa_required: 'true'
|
|
280
237
|
rdoc_options: []
|
|
281
238
|
require_paths:
|
|
282
239
|
- lib
|
|
@@ -284,14 +241,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
284
241
|
requirements:
|
|
285
242
|
- - ">="
|
|
286
243
|
- !ruby/object:Gem::Version
|
|
287
|
-
version: 3.
|
|
244
|
+
version: 3.4.0
|
|
288
245
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
289
246
|
requirements:
|
|
290
247
|
- - ">="
|
|
291
248
|
- !ruby/object:Gem::Version
|
|
292
249
|
version: '0'
|
|
293
250
|
requirements: []
|
|
294
|
-
rubygems_version: 3.6.
|
|
251
|
+
rubygems_version: 3.6.9
|
|
295
252
|
specification_version: 4
|
|
296
253
|
summary: RoadSide Message Protocol (RSMP) library.
|
|
297
254
|
test_files: []
|
data/lib/rsmp/archive.rb
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# Archive of log items, which can be messages or info items.
|
|
2
|
-
# All items are timestamped, and stored chronologically.
|
|
3
|
-
|
|
4
|
-
module RSMP
|
|
5
|
-
class Archive
|
|
6
|
-
include Inspect
|
|
7
|
-
|
|
8
|
-
attr_reader :items
|
|
9
|
-
|
|
10
|
-
@@index = 0
|
|
11
|
-
|
|
12
|
-
def initialize max=100
|
|
13
|
-
@items = []
|
|
14
|
-
@max = max
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def inspect
|
|
18
|
-
"#<#{self.class.name}:#{self.object_id}, #{inspector(:@items)}>"
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def self.prepare_item item
|
|
22
|
-
raise ArgumentError unless item.is_a? Hash
|
|
23
|
-
|
|
24
|
-
cleaned = item.select { |k,v| [:author,:level,:ip,:port,:site_id,:component,:text,:message,:exception].include? k }
|
|
25
|
-
cleaned[:timestamp] = Clock.now
|
|
26
|
-
if item[:message]
|
|
27
|
-
cleaned[:direction] = item[:message].direction
|
|
28
|
-
cleaned[:component] = item[:message].attributes['cId']
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
cleaned
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def self.increase_index
|
|
35
|
-
@@index += 1
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def self.current_index
|
|
39
|
-
@@index
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def by_level levels
|
|
43
|
-
items.select { |item| levels.include? item[:level] }
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def strings
|
|
47
|
-
items.map { |item| item[:str] }
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def add item
|
|
51
|
-
item[:index] = RSMP::Archive.increase_index
|
|
52
|
-
@items << item
|
|
53
|
-
if @items.size > @max
|
|
54
|
-
@items.shift
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
private
|
|
59
|
-
|
|
60
|
-
def find options, &block
|
|
61
|
-
# search backwards from newest to older, stopping once messages
|
|
62
|
-
# are older that options[:earliest]
|
|
63
|
-
out = []
|
|
64
|
-
@items.reverse_each do |item|
|
|
65
|
-
break if options[:earliest] && item[:timestamp] < options[:earliest]
|
|
66
|
-
next if options[:level] && item[:level] != options[:level]
|
|
67
|
-
next if options[:type] && (item[:message] == nil || (item[:message].type != options[:type]))
|
|
68
|
-
next if options[:with_message] && !(item[:direction] && item[:message])
|
|
69
|
-
next if block_given? && block.call != true
|
|
70
|
-
out.unshift item
|
|
71
|
-
end
|
|
72
|
-
out
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
end
|
|
File without changes
|
data/lib/rsmp/component_base.rb
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
module RSMP
|
|
2
|
-
|
|
3
|
-
# RSMP component base class.
|
|
4
|
-
|
|
5
|
-
class ComponentBase
|
|
6
|
-
include Inspect
|
|
7
|
-
|
|
8
|
-
attr_reader :c_id, :ntsOId, :xNId, :node, :alarms, :statuses,
|
|
9
|
-
:aggregated_status, :aggregated_status_bools, :grouped
|
|
10
|
-
|
|
11
|
-
AGGREGATED_STATUS_KEYS = [ :local_control,
|
|
12
|
-
:communication_distruption,
|
|
13
|
-
:high_priority_alarm,
|
|
14
|
-
:medium_priority_alarm,
|
|
15
|
-
:low_priority_alarm,
|
|
16
|
-
:normal,
|
|
17
|
-
:rest,
|
|
18
|
-
:not_connected ]
|
|
19
|
-
|
|
20
|
-
def initialize node:, id:, ntsOId: nil, xNId: nil, grouped: false
|
|
21
|
-
if grouped==false && (ntsOId || xNId)
|
|
22
|
-
raise RSMP::ConfigurationError.new("ntsOId and xNId are only allowed for grouped objects")
|
|
23
|
-
end
|
|
24
|
-
@c_id = id
|
|
25
|
-
@ntsOId = ntsOId
|
|
26
|
-
@xNId = xNId
|
|
27
|
-
@node = node
|
|
28
|
-
@grouped = grouped
|
|
29
|
-
clear_aggregated_status
|
|
30
|
-
@alarms = {}
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def now
|
|
34
|
-
node.now
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def clear_alarm_timestamps
|
|
38
|
-
@alarms.values.each {|alarm| alarm.clear_timestamp }
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def get_alarm_state alarm_code
|
|
42
|
-
alarm = @alarms[alarm_code] ||= RSMP::AlarmState.new component: self, code: alarm_code
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def clear_aggregated_status
|
|
46
|
-
@aggregated_status = []
|
|
47
|
-
@aggregated_status_bools = Array.new(8,false)
|
|
48
|
-
@aggregated_status_bools[5] = true
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def log str, options
|
|
52
|
-
default = { component: c_id}
|
|
53
|
-
@node.log str, default.merge(options)
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def set_aggregated_status status, options={}
|
|
57
|
-
status = [status] if status.is_a? Symbol
|
|
58
|
-
raise InvalidArgument unless status.is_a? Array
|
|
59
|
-
input = status & AGGREGATED_STATUS_KEYS
|
|
60
|
-
if input != @aggregated_status
|
|
61
|
-
AGGREGATED_STATUS_KEYS.each_with_index do |key,index|
|
|
62
|
-
@aggregated_status_bools[index] = status.include?(key)
|
|
63
|
-
end
|
|
64
|
-
aggregated_status_changed options
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def set_aggregated_status_bools status
|
|
69
|
-
raise InvalidArgument unless status.is_a? Array
|
|
70
|
-
raise InvalidArgument unless status.size == 8
|
|
71
|
-
if status != @aggregated_status_bools
|
|
72
|
-
@aggregated_status = []
|
|
73
|
-
AGGREGATED_STATUS_KEYS.each_with_index do |key,index|
|
|
74
|
-
on = status[index] == true
|
|
75
|
-
@aggregated_status_bools[index] = on
|
|
76
|
-
@aggregated_status << key if on
|
|
77
|
-
end
|
|
78
|
-
aggregated_status_changed
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
def aggregated_status_changed options={}
|
|
83
|
-
@node.aggregated_status_changed self, options
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
end
|
|
87
|
-
end
|
data/lib/rsmp/component_proxy.rb
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
module RSMP
|
|
2
|
-
# A proxy to a remote RSMP component.
|
|
3
|
-
class ComponentProxy < ComponentBase
|
|
4
|
-
def initialize node:, id:, ntsOId: nil, xNId: nil, grouped: false
|
|
5
|
-
super
|
|
6
|
-
@alarms = {}
|
|
7
|
-
@statuses = {}
|
|
8
|
-
@allow_repeat_updates = {}
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
# allow the next status update to be a repeat value
|
|
12
|
-
def allow_repeat_updates subscribe_list
|
|
13
|
-
subscribe_list.each do |item|
|
|
14
|
-
sCI = item['sCI']
|
|
15
|
-
n = item['n']
|
|
16
|
-
@allow_repeat_updates[sCI] ||= Set.new # Set is like an array, but with no duplicates
|
|
17
|
-
@allow_repeat_updates[sCI] << n
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
# Check that were not receiving repeated update values.
|
|
22
|
-
# The check is not performed for item with an update interval.
|
|
23
|
-
def check_repeat_values message, subscription_list
|
|
24
|
-
message.attribute('sS').each do |item|
|
|
25
|
-
sCI, n, s, q = item['sCI'], item['n'], item['s'], item['q']
|
|
26
|
-
uRt = subscription_list.dig(c_id,sCI,n,'uRt')
|
|
27
|
-
next if uRt.to_i > 0
|
|
28
|
-
sOc = subscription_list.dig(c_id,sCI,n,'sOc')
|
|
29
|
-
next if sOc == false
|
|
30
|
-
next if @allow_repeat_updates[sCI] && @allow_repeat_updates[sCI].include?(n)
|
|
31
|
-
new_values = {'s'=>s,'q'=>q}
|
|
32
|
-
old_values = @statuses.dig(sCI,n)
|
|
33
|
-
if new_values == old_values
|
|
34
|
-
raise RSMP::RepeatedStatusError.new "no change for #{sCI} '#{n}'"
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
# Store the latest status update values
|
|
39
|
-
def store_status message
|
|
40
|
-
message.attribute('sS').each do |item|
|
|
41
|
-
sCI, n, s, q = item['sCI'], item['n'], item['s'], item['q']
|
|
42
|
-
@statuses[sCI] ||= {}
|
|
43
|
-
@statuses[sCI][n] = {'s'=>s,'q'=>q}
|
|
44
|
-
|
|
45
|
-
# once a value is received, don't allow the value to be a repeat
|
|
46
|
-
@allow_repeat_updates[sCI].delete(n) if @allow_repeat_updates[sCI]
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
# handle incoming alarm
|
|
51
|
-
def handle_alarm message
|
|
52
|
-
code = message.attribute('aCId')
|
|
53
|
-
alarm = get_alarm_state code
|
|
54
|
-
alarm.update_from_message message
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|
data/lib/rsmp/components.rb
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# Things shared between sites and site proxies
|
|
2
|
-
|
|
3
|
-
module RSMP
|
|
4
|
-
module Components
|
|
5
|
-
attr_reader :components, :main
|
|
6
|
-
|
|
7
|
-
def initialize_components
|
|
8
|
-
@components = {}
|
|
9
|
-
@main = nil
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def aggregated_status_changed component, options={}
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def setup_components settings
|
|
16
|
-
return unless settings
|
|
17
|
-
check_main_component settings
|
|
18
|
-
settings.each_pair do |type,components_by_type|
|
|
19
|
-
if components_by_type
|
|
20
|
-
components_by_type.each_pair do |id,component_settings|
|
|
21
|
-
component_settings ||= {}
|
|
22
|
-
@components[id] = build_component(id:id, type:type, settings:component_settings)
|
|
23
|
-
@main = @components[id] if type=='main'
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def check_main_component settings
|
|
30
|
-
unless settings['main'] && settings['main'].size >= 1
|
|
31
|
-
raise ConfigurationError.new("main component must be defined")
|
|
32
|
-
end
|
|
33
|
-
if settings['main'].size > 1
|
|
34
|
-
raise ConfigurationError.new("only one main component can be defined, found #{settings['main'].keys.join(', ')}")
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def add_component component
|
|
39
|
-
@components[component.c_id] = component
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def infer_component_type component_id
|
|
43
|
-
raise UnknownComponent.new("Component #{component_id} mising and cannot infer type")
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def find_component component_id, build: true
|
|
47
|
-
component = @components[component_id]
|
|
48
|
-
return component if component
|
|
49
|
-
if build
|
|
50
|
-
inferred_type = infer_component_type component_id
|
|
51
|
-
component = inferred_type.new node: self, id: component_id
|
|
52
|
-
@components[ component_id] = component
|
|
53
|
-
class_name = component.class.name.split('::').last
|
|
54
|
-
class_name << " component" unless (class_name == 'Component' || class_name == 'ComponentProxy')
|
|
55
|
-
log "Added component #{component_id} with the inferred type #{class_name}", level: :debug
|
|
56
|
-
component
|
|
57
|
-
else
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def clear_alarm_timestamps
|
|
62
|
-
@components.values.each {|component| component.clear_alarm_timestamps }
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
end
|