rsmp 0.38.0 → 0.40.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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -16
  3. data/.tool-versions +1 -1
  4. data/Gemfile +2 -1
  5. data/Gemfile.lock +40 -38
  6. data/README.md +4 -3
  7. data/documentation/configuration.md +76 -0
  8. data/lib/rsmp/cli.rb +15 -12
  9. data/lib/rsmp/collect/alarm_matcher.rb +4 -4
  10. data/lib/rsmp/collect/collector/logging.rb +1 -0
  11. data/lib/rsmp/collect/command_matcher.rb +3 -3
  12. data/lib/rsmp/collect/matcher.rb +3 -3
  13. data/lib/rsmp/collect/queue.rb +3 -3
  14. data/lib/rsmp/collect/receiver.rb +2 -4
  15. data/lib/rsmp/collect/status_matcher.rb +7 -6
  16. data/lib/rsmp/component/alarm_state.rb +3 -4
  17. data/lib/rsmp/component/component_base.rb +0 -1
  18. data/lib/rsmp/component/components.rb +1 -2
  19. data/lib/rsmp/convert/export/json_schema.rb +2 -0
  20. data/lib/rsmp/convert/import/yaml.rb +1 -0
  21. data/lib/rsmp/helpers/clock.rb +3 -5
  22. data/lib/rsmp/helpers/deep_merge.rb +1 -0
  23. data/lib/rsmp/helpers/error.rb +1 -0
  24. data/lib/rsmp/helpers/inspect.rb +11 -12
  25. data/lib/rsmp/log/archive.rb +2 -3
  26. data/lib/rsmp/log/logger.rb +1 -0
  27. data/lib/rsmp/log/logging.rb +1 -0
  28. data/lib/rsmp/message.rb +26 -0
  29. data/lib/rsmp/node/node.rb +1 -2
  30. data/lib/rsmp/node/protocol.rb +1 -0
  31. data/lib/rsmp/node/site/site.rb +9 -36
  32. data/lib/rsmp/node/supervisor/modules/configuration.rb +3 -19
  33. data/lib/rsmp/node/supervisor/supervisor.rb +1 -4
  34. data/lib/rsmp/node/task.rb +1 -0
  35. data/lib/rsmp/options/options.rb +185 -0
  36. data/lib/rsmp/options/schemas/site.json +49 -0
  37. data/lib/rsmp/options/schemas/supervisor.json +43 -0
  38. data/lib/rsmp/options/schemas/traffic_controller_site.json +18 -0
  39. data/lib/rsmp/options/site_options.rb +44 -0
  40. data/lib/rsmp/options/supervisor_options.rb +28 -0
  41. data/lib/rsmp/options/traffic_controller_site_options.rb +12 -0
  42. data/lib/rsmp/proxy/proxy.rb +2 -4
  43. data/lib/rsmp/proxy/site/site_proxy.rb +1 -2
  44. data/lib/rsmp/proxy/supervisor/supervisor_proxy.rb +1 -2
  45. data/lib/rsmp/tlc/detector_logic.rb +1 -0
  46. data/lib/rsmp/tlc/signal_group.rb +1 -0
  47. data/lib/rsmp/tlc/signal_priority.rb +1 -0
  48. data/lib/rsmp/tlc/traffic_controller_site.rb +4 -0
  49. data/lib/rsmp/version.rb +1 -1
  50. data/lib/rsmp.rb +4 -0
  51. metadata +10 -2
@@ -0,0 +1,28 @@
1
+ module RSMP
2
+ class Supervisor < Node
3
+ # Configuration options for supervisors.
4
+ class Options < RSMP::Options
5
+ def defaults
6
+ {
7
+ 'port' => 12_111,
8
+ 'ips' => 'all',
9
+ 'guest' => {
10
+ 'sxl' => 'tlc',
11
+ 'intervals' => {
12
+ 'timer' => 1,
13
+ 'watchdog' => 1
14
+ },
15
+ 'timeouts' => {
16
+ 'watchdog' => 2,
17
+ 'acknowledgement' => 2
18
+ }
19
+ }
20
+ }
21
+ end
22
+
23
+ def schema_file
24
+ 'supervisor.json'
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,12 @@
1
+ module RSMP
2
+ module TLC
3
+ class TrafficControllerSite < Site
4
+ # Configuration options for traffic controller sites.
5
+ class Options < RSMP::Site::Options
6
+ def schema_file
7
+ 'traffic_controller_site.json'
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,10 +1,8 @@
1
- # A connection to a remote site or supervisor.
2
- # Uses the Task module to handle asyncronous work, but adds
3
- # the concept of a connection that can be connected or disconnected.
4
-
5
1
  require 'rubygems'
6
2
 
7
3
  module RSMP
4
+ # Represents a connection to a remote site or supervisor.
5
+ # Provides common connection lifecycle and message handling.
8
6
  class Proxy
9
7
  WRAPPING_DELIMITER = "\f".freeze
10
8
 
@@ -1,6 +1,5 @@
1
- # Handles a supervisor connection to a remote client
2
-
3
1
  module RSMP
2
+ # Handles a supervisor-side proxy for a connected site.
4
3
  class SiteProxy < Proxy
5
4
  include Components
6
5
  include Modules::Status
@@ -1,8 +1,7 @@
1
- # Handles a site connection to a remote supervisor
2
-
3
1
  require 'digest'
4
2
 
5
3
  module RSMP
4
+ # Proxy used by sites to connect to a remote supervisor.
6
5
  class SupervisorProxy < Proxy
7
6
  include Modules::Status
8
7
  include Modules::Commands
@@ -1,5 +1,6 @@
1
1
  module RSMP
2
2
  module TLC
3
+ # Detector logic component for the TLC.
3
4
  class DetectorLogic < Component
4
5
  attr_reader :forced, :value
5
6
 
@@ -1,5 +1,6 @@
1
1
  module RSMP
2
2
  module TLC
3
+ # Signal group representation for the TLC.
3
4
  class SignalGroup < Component
4
5
  attr_reader :plan, :state
5
6
 
@@ -1,5 +1,6 @@
1
1
  module RSMP
2
2
  module TLC
3
+ # Representation of a priority request for a TLC signal.
3
4
  class SignalPriority
4
5
  attr_reader :state, :node, :id, :level, :eta, :vehicle_type, :age, :updated
5
6
 
@@ -4,6 +4,10 @@ module RSMP
4
4
  class TrafficControllerSite < Site
5
5
  attr_accessor :main, :signal_plans
6
6
 
7
+ def self.options_class
8
+ RSMP::TLC::TrafficControllerSite::Options
9
+ end
10
+
7
11
  def initialize(options = {})
8
12
  # setup options before calling super initializer,
9
13
  # since build of components depend on options
data/lib/rsmp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RSMP
2
- VERSION = '0.38.0'.freeze
2
+ VERSION = '0.40.0'.freeze
3
3
  end
data/lib/rsmp.rb CHANGED
@@ -53,6 +53,10 @@ require_relative 'rsmp/node/supervisor/modules/configuration'
53
53
  require_relative 'rsmp/node/supervisor/modules/connection'
54
54
  require_relative 'rsmp/node/supervisor/modules/sites'
55
55
  require_relative 'rsmp/node/supervisor/supervisor'
56
+ require_relative 'rsmp/options/options'
57
+ require_relative 'rsmp/options/site_options'
58
+ require_relative 'rsmp/options/supervisor_options'
59
+ require_relative 'rsmp/options/traffic_controller_site_options'
56
60
  require_relative 'rsmp/proxy/modules/state'
57
61
  require_relative 'rsmp/proxy/modules/watchdogs'
58
62
  require_relative 'rsmp/proxy/modules/acknowledgements'
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.38.0
4
+ version: 0.40.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Tin
@@ -138,6 +138,7 @@ files:
138
138
  - cucumber.yml
139
139
  - documentation/classes_and_modules.md
140
140
  - documentation/collecting_message.md
141
+ - documentation/configuration.md
141
142
  - documentation/message_distribution.md
142
143
  - documentation/tasks.md
143
144
  - exe/rsmp
@@ -186,6 +187,13 @@ files:
186
187
  - lib/rsmp/node/supervisor/modules/sites.rb
187
188
  - lib/rsmp/node/supervisor/supervisor.rb
188
189
  - lib/rsmp/node/task.rb
190
+ - lib/rsmp/options/options.rb
191
+ - lib/rsmp/options/schemas/site.json
192
+ - lib/rsmp/options/schemas/supervisor.json
193
+ - lib/rsmp/options/schemas/traffic_controller_site.json
194
+ - lib/rsmp/options/site_options.rb
195
+ - lib/rsmp/options/supervisor_options.rb
196
+ - lib/rsmp/options/traffic_controller_site_options.rb
189
197
  - lib/rsmp/proxy/modules/acknowledgements.rb
190
198
  - lib/rsmp/proxy/modules/receive.rb
191
199
  - lib/rsmp/proxy/modules/send.rb
@@ -248,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
256
  - !ruby/object:Gem::Version
249
257
  version: '0'
250
258
  requirements: []
251
- rubygems_version: 3.6.9
259
+ rubygems_version: 4.0.3
252
260
  specification_version: 4
253
261
  summary: RoadSide Message Protocol (RSMP) library.
254
262
  test_files: []