rsmp 0.45.1 → 0.45.2
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/AGENTS.md +57 -0
- data/Gemfile.lock +2 -2
- data/documentation/configuration.md +11 -11
- data/lib/rsmp/tlc/proxy/control.rb +5 -5
- data/lib/rsmp/tlc/proxy/detectors.rb +2 -2
- data/lib/rsmp/tlc/proxy/io.rb +4 -4
- data/lib/rsmp/tlc/proxy/plans.rb +8 -8
- data/lib/rsmp/tlc/proxy/system.rb +2 -2
- data/lib/rsmp/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ceec0bb561c61873341a4af09334ed0c6e0eb7bb1909b6fb38f2a350aaae8ca9
|
|
4
|
+
data.tar.gz: 41f8df99b563e086770f502e69ff8bc8a8dc91b075aa9e50c2f0dd451b8bc0ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 46ee01791490e180283de79f9568b4d37ad8bef6bd228f2cee5c6eca7d95f568fad715f5f48314c1ebfec8610185bd027b7cc5e65701af248d2253d3569ff491
|
|
7
|
+
data.tar.gz: 26b27b919cc42a3fdf337720bfb31c3168e8a2a95a0361b642efe27973352eaffbcb4e4c07ea3d55a6f0d4e59d57650c226ed603edcf6a9c45747bb1b3439c98
|
data/AGENTS.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# RSMP Agent Guide
|
|
2
|
+
|
|
3
|
+
This repository contains the Ruby implementation of RSMP, the `rsmp` CLI, and vendored RSMP Core and TLC SXL JSON Schemas.
|
|
4
|
+
|
|
5
|
+
## Where Things Live
|
|
6
|
+
|
|
7
|
+
- `lib/rsmp/` contains the library, protocol logic, CLI implementation, schema handling, and converters.
|
|
8
|
+
- `exe/rsmp` is the executable entrypoint.
|
|
9
|
+
- `test/rsmp/` contains the internal `sus` test suite.
|
|
10
|
+
- `config/` contains example site and supervisor configuration files.
|
|
11
|
+
- `documentation/` contains project documentation.
|
|
12
|
+
- `schemas/` contains vendored Core and TLC schemas used at runtime. Do not edit these casually; update them from the source repos when possible.
|
|
13
|
+
|
|
14
|
+
## Commands
|
|
15
|
+
|
|
16
|
+
- `bundle exec sus` runs the test suite.
|
|
17
|
+
- `bundle exec rake test` also runs the test suite.
|
|
18
|
+
- `bundle exec rubocop` checks Ruby style.
|
|
19
|
+
- `bundle exec exe/rsmp schema generate --in path/to/sxl.yaml --out path/to/output` generates JSON Schema files from an SXL YAML file.
|
|
20
|
+
|
|
21
|
+
Always run project executables through `bundle exec` so the correct bundle is used.
|
|
22
|
+
|
|
23
|
+
## Schema Workflows
|
|
24
|
+
|
|
25
|
+
To generate JSON Schema files from an SXL YAML file:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
bundle exec exe/rsmp schema generate --in ../rsmp_sxl_traffic_lights/schema/sxl.yaml --out ../rsmp_sxl_traffic_lights/schema
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
To refresh the vendored schemas in this repo from the sibling source repositories:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
bundle exec rake schemas:update
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The `schemas:update` task assumes sibling repos at `../rsmp_core` and `../rsmp_sxl_traffic_lights` by default. Pass explicit paths when needed:
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
bundle exec rake schemas:update[/path/to/rsmp_core,/path/to/rsmp_sxl_traffic_lights]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The task archives `schema/` from configured version branches in those repos, so make sure the local branches exist and are up to date before running it.
|
|
44
|
+
|
|
45
|
+
## Editing Guidance
|
|
46
|
+
|
|
47
|
+
- Follow existing Ruby, `sus`, Thor CLI, and Async patterns.
|
|
48
|
+
- Tests may start local sites and supervisors; they use port `13111` to avoid the default RSMP port `12111`.
|
|
49
|
+
- CLI tests call the Thor class directly rather than spawning a separate process.
|
|
50
|
+
- Keep schema converter changes aligned with `RSMP::Schema` loading and validation behavior.
|
|
51
|
+
- If vendored schemas change, run the relevant schema and CLI tests.
|
|
52
|
+
|
|
53
|
+
## Validation
|
|
54
|
+
|
|
55
|
+
- Run the narrowest relevant `bundle exec sus ...` command after edits, or the full `bundle exec sus` when behavior is shared.
|
|
56
|
+
- Run `bundle exec rubocop` for Ruby changes when practical.
|
|
57
|
+
- If schema source repos, branches, or dependencies are unavailable, mention which validation or schema update step was skipped and why.
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rsmp (0.45.
|
|
4
|
+
rsmp (0.45.2)
|
|
5
5
|
async (~> 2.39)
|
|
6
6
|
colorize (~> 1.1)
|
|
7
7
|
io-endpoint (~> 0.17)
|
|
@@ -35,7 +35,7 @@ GEM
|
|
|
35
35
|
io-endpoint (0.17.2)
|
|
36
36
|
io-event (1.16.1)
|
|
37
37
|
io-stream (0.13.0)
|
|
38
|
-
json (2.19.
|
|
38
|
+
json (2.19.9)
|
|
39
39
|
json_schemer (2.5.0)
|
|
40
40
|
bigdecimal
|
|
41
41
|
hana (~> 1.3)
|
|
@@ -85,18 +85,18 @@ The following lists the top-level supervisor settings and the keys available for
|
|
|
85
85
|
|
|
86
86
|
Top-level supervisor settings
|
|
87
87
|
|
|
88
|
-
- `port`: integer|string
|
|
89
|
-
- `ip`: string
|
|
90
|
-
- `ips`: string or array
|
|
91
|
-
- `site_id`: string
|
|
92
|
-
- `max_sites`: integer
|
|
93
|
-
- `default`: object
|
|
94
|
-
- `sxls`: object
|
|
88
|
+
- `port`: integer|string - TCP port the supervisor listens on (default: `12111`).
|
|
89
|
+
- `ip`: string - address to bind to.
|
|
90
|
+
- `ips`: string or array - `'all'` or a list of allowed IP addresses.
|
|
91
|
+
- `site_id`: string - optional site identifier for the supervisor itself.
|
|
92
|
+
- `max_sites`: integer - limit concurrent connected sites.
|
|
93
|
+
- `default`: object - default settings applied to sites that don't have a specific `sites` entry. Contains keys:
|
|
94
|
+
- `sxls`: object - default SXL versions for default sites, for example `{ "tlc": "1.3.0" }`.
|
|
95
95
|
- `core_version`: string for the accepted RSMP Core version.
|
|
96
96
|
- `intervals`: object with `timer`, `watchdog` (numbers, seconds).
|
|
97
97
|
- `timeouts`: object with `watchdog`, `acknowledgement` (numbers, seconds).
|
|
98
|
-
- `log`: object
|
|
99
|
-
- `sites`: mapping
|
|
98
|
+
- `log`: object - log settings (see `log_settings` elsewhere in docs).
|
|
99
|
+
- `sites`: mapping - per-site settings (see below).
|
|
100
100
|
|
|
101
101
|
## Per-site settings (`sites` mapping)
|
|
102
102
|
|
|
@@ -113,8 +113,8 @@ Common per-site keys
|
|
|
113
113
|
- `site_id` (string): explicit site identifier (if different from the mapping key).
|
|
114
114
|
- `supervisors` (array): list of supervisor endpoints (objects with `ip` and `port`). Useful for reverse mappings or local-site configs.
|
|
115
115
|
- `components` (object): component definitions (same structure as site `components`), used by the supervisor-side proxies to set up component proxies.
|
|
116
|
-
- `intervals` (object): per-site timer settings
|
|
117
|
-
- `timeouts` (object): per-site timeouts
|
|
116
|
+
- `intervals` (object): per-site timer settings - `timer`, `watchdog`, `reconnect`, `after_connect` (numbers, seconds).
|
|
117
|
+
- `timeouts` (object): per-site timeouts - `connect`, `watchdog`, `acknowledgement` (numbers, seconds).
|
|
118
118
|
- `send_after_connect` (boolean): whether to send messages after connect without waiting for additional events.
|
|
119
119
|
- `skip_validation` (array[string]): list of message types to skip JSON schema validation for this site.
|
|
120
120
|
- `security_codes` (object): map of security code levels to secrets.
|
|
@@ -4,7 +4,7 @@ module RSMP
|
|
|
4
4
|
# Command methods for operational control of a remote TLC.
|
|
5
5
|
# Covers functional position, emergency routes, I/O modes, signal group orders, and system settings.
|
|
6
6
|
module Control
|
|
7
|
-
# M0001
|
|
7
|
+
# M0001 - Set functional position (NormalControl, YellowFlash, Dark).
|
|
8
8
|
def set_functional_position(status, within:, timeout_minutes: 0)
|
|
9
9
|
validate_ready 'set functional position'
|
|
10
10
|
raise 'TLC main component not found' unless main
|
|
@@ -17,7 +17,7 @@ module RSMP
|
|
|
17
17
|
{ collector: collector }
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
# M0005
|
|
20
|
+
# M0005 - Set or clear an emergency route.
|
|
21
21
|
def set_emergency_route(route:, active:, within:)
|
|
22
22
|
validate_ready 'set emergency route'
|
|
23
23
|
raise 'TLC main component not found' unless main
|
|
@@ -45,7 +45,7 @@ module RSMP
|
|
|
45
45
|
send_command_and_collect(command_list, within: within).ok!
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
# M0007
|
|
48
|
+
# M0007 - Enable or disable fixed-time control.
|
|
49
49
|
def set_fixed_time(status, within:)
|
|
50
50
|
validate_ready 'set fixed time'
|
|
51
51
|
raise 'TLC main component not found' unless main
|
|
@@ -70,7 +70,7 @@ module RSMP
|
|
|
70
70
|
wait_for_status "fixed time #{status}", confirm_status, timeout: within
|
|
71
71
|
end
|
|
72
72
|
|
|
73
|
-
# M0003
|
|
73
|
+
# M0003 - Set traffic situation (activate a specific situation number).
|
|
74
74
|
def set_traffic_situation(situation, within:)
|
|
75
75
|
validate_ready 'set traffic situation'
|
|
76
76
|
raise 'TLC main component not found' unless main
|
|
@@ -99,7 +99,7 @@ module RSMP
|
|
|
99
99
|
wait_for_status "traffic situation #{situation}", confirm_status, timeout: within
|
|
100
100
|
end
|
|
101
101
|
|
|
102
|
-
# M0003
|
|
102
|
+
# M0003 - Clear the active traffic situation.
|
|
103
103
|
def unset_traffic_situation(within:)
|
|
104
104
|
validate_ready 'unset traffic situation'
|
|
105
105
|
raise 'TLC main component not found' unless main
|
|
@@ -4,7 +4,7 @@ module RSMP
|
|
|
4
4
|
# Command methods for operational control of a remote TLC.
|
|
5
5
|
# Covers functional position, emergency routes, I/O modes, signal group orders, and system settings.
|
|
6
6
|
module Detectors
|
|
7
|
-
# M0008
|
|
7
|
+
# M0008 - Force detector logic to a given mode and status.
|
|
8
8
|
# component_id must refer to the detector logic component, not main.
|
|
9
9
|
def force_detector_logic(component_id, status:, mode:, within:)
|
|
10
10
|
validate_ready 'force detector logic'
|
|
@@ -30,7 +30,7 @@ module RSMP
|
|
|
30
30
|
send_command_and_collect(command_list, component: component_id, within: within).ok!
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
# M0021
|
|
33
|
+
# M0021 - Set the trigger level for traffic counting.
|
|
34
34
|
def set_trigger_level(status, within:)
|
|
35
35
|
validate_ready 'set trigger level'
|
|
36
36
|
raise 'TLC main component not found' unless main
|
data/lib/rsmp/tlc/proxy/io.rb
CHANGED
|
@@ -4,7 +4,7 @@ module RSMP
|
|
|
4
4
|
# Command methods for I/O control of a remote TLC.
|
|
5
5
|
# Covers detector logic, input/output forcing and setting.
|
|
6
6
|
module IO
|
|
7
|
-
# M0006
|
|
7
|
+
# M0006 - Set a single input to a given status.
|
|
8
8
|
def set_input(input:, status:, within:)
|
|
9
9
|
validate_ready 'set input'
|
|
10
10
|
raise 'TLC main component not found' unless main
|
|
@@ -30,7 +30,7 @@ module RSMP
|
|
|
30
30
|
send_command_and_collect(command_list, within: within).ok!
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
# M0013
|
|
33
|
+
# M0013 - Set all inputs via a bit-pattern string.
|
|
34
34
|
def set_inputs(status, within:)
|
|
35
35
|
validate_ready 'set inputs'
|
|
36
36
|
raise 'TLC main component not found' unless main
|
|
@@ -51,7 +51,7 @@ module RSMP
|
|
|
51
51
|
send_command_and_collect(command_list, within: within).ok!
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
# M0019
|
|
54
|
+
# M0019 - Force an input to a given value.
|
|
55
55
|
def force_input(input:, status:, value:, within:)
|
|
56
56
|
validate_ready 'force input'
|
|
57
57
|
raise 'TLC main component not found' unless main
|
|
@@ -62,7 +62,7 @@ module RSMP
|
|
|
62
62
|
wait_for_status "force input #{input}", confirm_status, timeout: within
|
|
63
63
|
end
|
|
64
64
|
|
|
65
|
-
# M0020
|
|
65
|
+
# M0020 - Force an output to a given value.
|
|
66
66
|
def force_output(output:, status:, value:, within:)
|
|
67
67
|
validate_ready 'force output'
|
|
68
68
|
raise 'TLC main component not found' unless main
|
data/lib/rsmp/tlc/proxy/plans.rb
CHANGED
|
@@ -4,7 +4,7 @@ module RSMP
|
|
|
4
4
|
# Command methods for signal plans.
|
|
5
5
|
# Covers time plans, week/day tables, bands, offsets, and cycle times.
|
|
6
6
|
module Plans
|
|
7
|
-
# M0014
|
|
7
|
+
# M0014 - Set dynamic bands for a signal plan.
|
|
8
8
|
def set_dynamic_bands(plan:, status:, within:)
|
|
9
9
|
validate_ready 'set dynamic bands'
|
|
10
10
|
raise 'TLC main component not found' unless main
|
|
@@ -30,7 +30,7 @@ module RSMP
|
|
|
30
30
|
send_command_and_collect(command_list, within: within).ok!
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
# M0023
|
|
33
|
+
# M0023 - Set timeout for dynamic bands.
|
|
34
34
|
def set_dynamic_bands_timeout(status, within:)
|
|
35
35
|
validate_ready 'set dynamic bands timeout'
|
|
36
36
|
raise 'TLC main component not found' unless main
|
|
@@ -51,7 +51,7 @@ module RSMP
|
|
|
51
51
|
send_command_and_collect(command_list, within: within).ok!
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
# M0015
|
|
54
|
+
# M0015 - Set offset for a signal plan.
|
|
55
55
|
def set_offset(plan:, offset:, within:)
|
|
56
56
|
validate_ready 'set offset'
|
|
57
57
|
raise 'TLC main component not found' unless main
|
|
@@ -105,7 +105,7 @@ module RSMP
|
|
|
105
105
|
wait_for_status("timeplan #{plan_nr}", confirm_status, timeout: within)
|
|
106
106
|
end
|
|
107
107
|
|
|
108
|
-
# M0016
|
|
108
|
+
# M0016 - Set week table (mapping week days to traffic situations).
|
|
109
109
|
def set_week_table(status, within:)
|
|
110
110
|
validate_ready 'set week table'
|
|
111
111
|
raise 'TLC main component not found' unless main
|
|
@@ -126,7 +126,7 @@ module RSMP
|
|
|
126
126
|
send_command_and_collect(command_list, within:).ok!
|
|
127
127
|
end
|
|
128
128
|
|
|
129
|
-
# M0017
|
|
129
|
+
# M0017 - Set day table (mapping time periods to signal plans).
|
|
130
130
|
def set_day_table(status, within:)
|
|
131
131
|
validate_ready 'set day table'
|
|
132
132
|
raise 'TLC main component not found' unless main
|
|
@@ -147,7 +147,7 @@ module RSMP
|
|
|
147
147
|
send_command_and_collect(command_list, within:).ok!
|
|
148
148
|
end
|
|
149
149
|
|
|
150
|
-
# M0018
|
|
150
|
+
# M0018 - Set cycle time for a signal plan.
|
|
151
151
|
def set_cycle_time(plan:, cycle_time:, within:)
|
|
152
152
|
validate_ready 'set cycle time'
|
|
153
153
|
raise 'TLC main component not found' unless main
|
|
@@ -173,7 +173,7 @@ module RSMP
|
|
|
173
173
|
send_command_and_collect(command_list, within:).ok!
|
|
174
174
|
end
|
|
175
175
|
|
|
176
|
-
# M0010
|
|
176
|
+
# M0010 - Order signal start for a signal group component.
|
|
177
177
|
def order_signal_start(component_id, within:)
|
|
178
178
|
validate_ready 'order signal start'
|
|
179
179
|
|
|
@@ -193,7 +193,7 @@ module RSMP
|
|
|
193
193
|
send_command_and_collect(command_list, component: component_id, within:).ok!
|
|
194
194
|
end
|
|
195
195
|
|
|
196
|
-
# M0011
|
|
196
|
+
# M0011 - Order signal stop for a signal group component.
|
|
197
197
|
def order_signal_stop(component_id, within:)
|
|
198
198
|
validate_ready 'order signal stop'
|
|
199
199
|
|
|
@@ -4,7 +4,7 @@ module RSMP
|
|
|
4
4
|
# Command methods for operational control of a remote TLC.
|
|
5
5
|
# Covers functional position, emergency routes, I/O modes, signal group orders, and system settings.
|
|
6
6
|
module System
|
|
7
|
-
# M0103
|
|
7
|
+
# M0103 - Change security code for a given level.
|
|
8
8
|
# Does not use security_code_for since the codes are passed explicitly.
|
|
9
9
|
def set_security_code(level:, old_code:, new_code:, within:)
|
|
10
10
|
validate_ready 'set security code'
|
|
@@ -29,7 +29,7 @@ module RSMP
|
|
|
29
29
|
send_command_and_collect(command_list, within: within).ok!
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
# M0104
|
|
32
|
+
# M0104 - Set the clock on the remote TLC. clock must respond to year/month/day/hour/min/sec.
|
|
33
33
|
def set_clock(clock, within:)
|
|
34
34
|
validate_ready 'set clock'
|
|
35
35
|
raise 'TLC main component not found' unless main
|
data/lib/rsmp/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rsmp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.45.
|
|
4
|
+
version: 0.45.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Emil Tin
|
|
@@ -137,6 +137,7 @@ files:
|
|
|
137
137
|
- ".gitmodules"
|
|
138
138
|
- ".rubocop.yml"
|
|
139
139
|
- ".tool-versions"
|
|
140
|
+
- AGENTS.md
|
|
140
141
|
- CHANGELOG.md
|
|
141
142
|
- Gemfile
|
|
142
143
|
- Gemfile.lock
|