rsmp 0.37.0 → 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/workflows/rubocop.yaml +17 -0
- data/.gitignore +5 -6
- data/.rubocop.yml +80 -0
- data/Gemfile +13 -1
- data/Gemfile.lock +34 -1
- data/Rakefile +3 -3
- 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/{protocol.rb → node/protocol.rb} +5 -3
- 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} +12 -14
- 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 +38 -1010
- data/lib/rsmp/tlc/traffic_controller_site.rb +58 -57
- data/lib/rsmp/version.rb +1 -1
- data/lib/rsmp.rb +82 -48
- data/rsmp.gemspec +24 -31
- metadata +79 -139
- 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 -693
- data/lib/rsmp/site.rb +0 -188
- data/lib/rsmp/site_proxy.rb +0 -389
- data/lib/rsmp/supervisor.rb +0 -302
- data/lib/rsmp/supervisor_proxy.rb +0 -510
- data/lib/rsmp/tlc/inputs.rb +0 -134
metadata
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
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
12
|
- !ruby/object:Gem::Dependency
|
|
13
|
-
name:
|
|
13
|
+
name: async
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '
|
|
18
|
+
version: '2.32'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '
|
|
25
|
+
version: '2.32'
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
|
-
name:
|
|
27
|
+
name: colorize
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '
|
|
32
|
+
version: '1.1'
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '
|
|
39
|
+
version: '1.1'
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
|
-
name:
|
|
41
|
+
name: io-endpoint
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
|
44
44
|
- - "~>"
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: '
|
|
46
|
+
version: '0.15'
|
|
47
47
|
type: :runtime
|
|
48
48
|
prerelease: false
|
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
|
51
51
|
- - "~>"
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: '
|
|
53
|
+
version: '0.15'
|
|
54
54
|
- !ruby/object:Gem::Dependency
|
|
55
55
|
name: io-stream
|
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -66,33 +66,33 @@ dependencies:
|
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
67
|
version: '0.10'
|
|
68
68
|
- !ruby/object:Gem::Dependency
|
|
69
|
-
name:
|
|
69
|
+
name: logger
|
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
|
71
71
|
requirements:
|
|
72
72
|
- - "~>"
|
|
73
73
|
- !ruby/object:Gem::Version
|
|
74
|
-
version: '
|
|
74
|
+
version: '1.6'
|
|
75
75
|
type: :runtime
|
|
76
76
|
prerelease: false
|
|
77
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
78
78
|
requirements:
|
|
79
79
|
- - "~>"
|
|
80
80
|
- !ruby/object:Gem::Version
|
|
81
|
-
version: '
|
|
81
|
+
version: '1.6'
|
|
82
82
|
- !ruby/object:Gem::Dependency
|
|
83
|
-
name:
|
|
83
|
+
name: ostruct
|
|
84
84
|
requirement: !ruby/object:Gem::Requirement
|
|
85
85
|
requirements:
|
|
86
86
|
- - "~>"
|
|
87
87
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: '
|
|
88
|
+
version: '0.6'
|
|
89
89
|
type: :runtime
|
|
90
90
|
prerelease: false
|
|
91
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
92
92
|
requirements:
|
|
93
93
|
- - "~>"
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: '
|
|
95
|
+
version: '0.6'
|
|
96
96
|
- !ruby/object:Gem::Dependency
|
|
97
97
|
name: rsmp_schema
|
|
98
98
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -107,104 +107,6 @@ dependencies:
|
|
|
107
107
|
- - "~>"
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
109
|
version: '0.8'
|
|
110
|
-
- !ruby/object:Gem::Dependency
|
|
111
|
-
name: bundler
|
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
|
113
|
-
requirements:
|
|
114
|
-
- - "~>"
|
|
115
|
-
- !ruby/object:Gem::Version
|
|
116
|
-
version: '2.6'
|
|
117
|
-
type: :development
|
|
118
|
-
prerelease: false
|
|
119
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
120
|
-
requirements:
|
|
121
|
-
- - "~>"
|
|
122
|
-
- !ruby/object:Gem::Version
|
|
123
|
-
version: '2.6'
|
|
124
|
-
- !ruby/object:Gem::Dependency
|
|
125
|
-
name: rake
|
|
126
|
-
requirement: !ruby/object:Gem::Requirement
|
|
127
|
-
requirements:
|
|
128
|
-
- - "~>"
|
|
129
|
-
- !ruby/object:Gem::Version
|
|
130
|
-
version: '13.2'
|
|
131
|
-
type: :development
|
|
132
|
-
prerelease: false
|
|
133
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
134
|
-
requirements:
|
|
135
|
-
- - "~>"
|
|
136
|
-
- !ruby/object:Gem::Version
|
|
137
|
-
version: '13.2'
|
|
138
|
-
- !ruby/object:Gem::Dependency
|
|
139
|
-
name: rspec
|
|
140
|
-
requirement: !ruby/object:Gem::Requirement
|
|
141
|
-
requirements:
|
|
142
|
-
- - "~>"
|
|
143
|
-
- !ruby/object:Gem::Version
|
|
144
|
-
version: '3.13'
|
|
145
|
-
type: :development
|
|
146
|
-
prerelease: false
|
|
147
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
148
|
-
requirements:
|
|
149
|
-
- - "~>"
|
|
150
|
-
- !ruby/object:Gem::Version
|
|
151
|
-
version: '3.13'
|
|
152
|
-
- !ruby/object:Gem::Dependency
|
|
153
|
-
name: rspec-expectations
|
|
154
|
-
requirement: !ruby/object:Gem::Requirement
|
|
155
|
-
requirements:
|
|
156
|
-
- - "~>"
|
|
157
|
-
- !ruby/object:Gem::Version
|
|
158
|
-
version: '3.13'
|
|
159
|
-
type: :development
|
|
160
|
-
prerelease: false
|
|
161
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
162
|
-
requirements:
|
|
163
|
-
- - "~>"
|
|
164
|
-
- !ruby/object:Gem::Version
|
|
165
|
-
version: '3.13'
|
|
166
|
-
- !ruby/object:Gem::Dependency
|
|
167
|
-
name: timecop
|
|
168
|
-
requirement: !ruby/object:Gem::Requirement
|
|
169
|
-
requirements:
|
|
170
|
-
- - "~>"
|
|
171
|
-
- !ruby/object:Gem::Version
|
|
172
|
-
version: '0.9'
|
|
173
|
-
type: :development
|
|
174
|
-
prerelease: false
|
|
175
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
176
|
-
requirements:
|
|
177
|
-
- - "~>"
|
|
178
|
-
- !ruby/object:Gem::Version
|
|
179
|
-
version: '0.9'
|
|
180
|
-
- !ruby/object:Gem::Dependency
|
|
181
|
-
name: cucumber
|
|
182
|
-
requirement: !ruby/object:Gem::Requirement
|
|
183
|
-
requirements:
|
|
184
|
-
- - "~>"
|
|
185
|
-
- !ruby/object:Gem::Version
|
|
186
|
-
version: '9.2'
|
|
187
|
-
type: :development
|
|
188
|
-
prerelease: false
|
|
189
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
190
|
-
requirements:
|
|
191
|
-
- - "~>"
|
|
192
|
-
- !ruby/object:Gem::Version
|
|
193
|
-
version: '9.2'
|
|
194
|
-
- !ruby/object:Gem::Dependency
|
|
195
|
-
name: aruba
|
|
196
|
-
requirement: !ruby/object:Gem::Requirement
|
|
197
|
-
requirements:
|
|
198
|
-
- - "~>"
|
|
199
|
-
- !ruby/object:Gem::Version
|
|
200
|
-
version: '2.3'
|
|
201
|
-
type: :development
|
|
202
|
-
prerelease: false
|
|
203
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
204
|
-
requirements:
|
|
205
|
-
- - "~>"
|
|
206
|
-
- !ruby/object:Gem::Version
|
|
207
|
-
version: '2.3'
|
|
208
110
|
description: Easy RSMP site and supervisor communication.
|
|
209
111
|
email:
|
|
210
112
|
- zf0f@kk.dk
|
|
@@ -213,12 +115,15 @@ executables:
|
|
|
213
115
|
extensions: []
|
|
214
116
|
extra_rdoc_files: []
|
|
215
117
|
files:
|
|
118
|
+
- ".devcontainer/devcontainer.json"
|
|
216
119
|
- ".github/copilot-instructions.md"
|
|
217
120
|
- ".github/workflows/copilot-setup-steps.yml"
|
|
218
121
|
- ".github/workflows/rspec.yaml"
|
|
122
|
+
- ".github/workflows/rubocop.yaml"
|
|
219
123
|
- ".gitignore"
|
|
220
124
|
- ".gitmodules"
|
|
221
125
|
- ".rspec"
|
|
126
|
+
- ".rubocop.yml"
|
|
222
127
|
- ".tool-versions"
|
|
223
128
|
- CHANGELOG.md
|
|
224
129
|
- Gemfile
|
|
@@ -237,51 +142,85 @@ files:
|
|
|
237
142
|
- documentation/tasks.md
|
|
238
143
|
- exe/rsmp
|
|
239
144
|
- lib/rsmp.rb
|
|
240
|
-
- lib/rsmp/alarm_state.rb
|
|
241
|
-
- lib/rsmp/archive.rb
|
|
242
145
|
- lib/rsmp/cli.rb
|
|
243
146
|
- lib/rsmp/collect/ack_collector.rb
|
|
244
147
|
- lib/rsmp/collect/aggregated_status_collector.rb
|
|
245
148
|
- lib/rsmp/collect/alarm_collector.rb
|
|
246
149
|
- lib/rsmp/collect/alarm_matcher.rb
|
|
247
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
|
|
248
154
|
- lib/rsmp/collect/command_matcher.rb
|
|
249
155
|
- lib/rsmp/collect/command_response_collector.rb
|
|
250
156
|
- lib/rsmp/collect/distributor.rb
|
|
251
157
|
- lib/rsmp/collect/filter.rb
|
|
252
158
|
- lib/rsmp/collect/matcher.rb
|
|
253
|
-
- lib/rsmp/collect/message_matchers.rb
|
|
254
159
|
- lib/rsmp/collect/queue.rb
|
|
255
160
|
- lib/rsmp/collect/receiver.rb
|
|
256
161
|
- lib/rsmp/collect/state_collector.rb
|
|
257
162
|
- lib/rsmp/collect/status_collector.rb
|
|
258
163
|
- lib/rsmp/collect/status_matcher.rb
|
|
259
|
-
- lib/rsmp/component.rb
|
|
260
|
-
- lib/rsmp/
|
|
261
|
-
- lib/rsmp/
|
|
262
|
-
- 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
|
|
263
169
|
- lib/rsmp/convert/export/json_schema.rb
|
|
264
170
|
- lib/rsmp/convert/import/yaml.rb
|
|
265
|
-
- lib/rsmp/
|
|
266
|
-
- lib/rsmp/
|
|
267
|
-
- lib/rsmp/
|
|
268
|
-
- lib/rsmp/
|
|
269
|
-
- 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
|
|
270
180
|
- lib/rsmp/message.rb
|
|
271
|
-
- lib/rsmp/node.rb
|
|
272
|
-
- lib/rsmp/protocol.rb
|
|
273
|
-
- lib/rsmp/
|
|
274
|
-
- lib/rsmp/
|
|
275
|
-
- lib/rsmp/
|
|
276
|
-
- lib/rsmp/
|
|
277
|
-
- lib/rsmp/supervisor.rb
|
|
278
|
-
- lib/rsmp/
|
|
279
|
-
- lib/rsmp/
|
|
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
|
|
280
207
|
- lib/rsmp/tlc/detector_logic.rb
|
|
281
|
-
- 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
|
|
282
220
|
- lib/rsmp/tlc/signal_group.rb
|
|
283
221
|
- lib/rsmp/tlc/signal_plan.rb
|
|
284
222
|
- lib/rsmp/tlc/signal_priority.rb
|
|
223
|
+
- lib/rsmp/tlc/startup_sequence.rb
|
|
285
224
|
- lib/rsmp/tlc/traffic_controller.rb
|
|
286
225
|
- lib/rsmp/tlc/traffic_controller_site.rb
|
|
287
226
|
- lib/rsmp/version.rb
|
|
@@ -294,6 +233,7 @@ metadata:
|
|
|
294
233
|
source_code_uri: https://github.com/rsmp-nordic/rsmp
|
|
295
234
|
changelog_uri: https://github.com/rsmp-nordic/rsmp/blob/master/CHANGELOG.md
|
|
296
235
|
bug_tracker_uri: https://github.com/rsmp-nordic/rsmp/issues
|
|
236
|
+
rubygems_mfa_required: 'true'
|
|
297
237
|
rdoc_options: []
|
|
298
238
|
require_paths:
|
|
299
239
|
- lib
|
|
@@ -301,14 +241,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
301
241
|
requirements:
|
|
302
242
|
- - ">="
|
|
303
243
|
- !ruby/object:Gem::Version
|
|
304
|
-
version: 3.
|
|
244
|
+
version: 3.4.0
|
|
305
245
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
306
246
|
requirements:
|
|
307
247
|
- - ">="
|
|
308
248
|
- !ruby/object:Gem::Version
|
|
309
249
|
version: '0'
|
|
310
250
|
requirements: []
|
|
311
|
-
rubygems_version: 3.6.
|
|
251
|
+
rubygems_version: 3.6.9
|
|
312
252
|
specification_version: 4
|
|
313
253
|
summary: RoadSide Message Protocol (RSMP) library.
|
|
314
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
|