rsmp 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rsmp/component.rb +1 -1
- data/lib/rsmp/components.rb +3 -3
- data/lib/rsmp/site_proxy.rb +0 -12
- data/lib/rsmp/tlc.rb +3 -1
- data/lib/rsmp/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63163e8e010e001deffd0bba691e343c028ae5edbf3a5c9022529d319c36035e
|
4
|
+
data.tar.gz: 07225c7538b514c3b74dbc307a432f32eb1fe839faaeef4483208206b29e103a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6eed25d057be1a6766b94d1127b41f498b4e3532bf5650d7c888321dfe48bafaf2af69ff2d871cc437fc44ae9286d898da2387bc2e267d451aca332d3695159f
|
7
|
+
data.tar.gz: 011f89ceb76bbfdc521ca0730c2d7f1c48663e4faf35576e4e72bee83831813745bc0ce0c45aab4201c1874f1ee21a5c1f6235dbab0c16feab1e3970acc56d3b
|
data/Gemfile.lock
CHANGED
data/lib/rsmp/component.rb
CHANGED
data/lib/rsmp/components.rb
CHANGED
@@ -39,7 +39,7 @@ module RSMP
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def infer_component_type component_id
|
42
|
-
|
42
|
+
Component
|
43
43
|
end
|
44
44
|
|
45
45
|
def find_component component_id, build: true
|
@@ -47,10 +47,10 @@ module RSMP
|
|
47
47
|
return component if component
|
48
48
|
if build
|
49
49
|
inferred = infer_component_type component_id
|
50
|
-
component = inferred
|
50
|
+
component = inferred.new node: self, id: component_id
|
51
51
|
@components[ component_id] = component
|
52
52
|
class_name = component.class.name.split('::').last
|
53
|
-
log "Inferred
|
53
|
+
log "Inferred #{class_name} component #{component_id}", level: :info
|
54
54
|
component
|
55
55
|
else
|
56
56
|
raise UnknownComponent.new("Component #{component_id} not found") unless component
|
data/lib/rsmp/site_proxy.rb
CHANGED
@@ -121,18 +121,6 @@ module RSMP
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
-
def infer_component_type component_id
|
125
|
-
if component_id =~ /TC/
|
126
|
-
{ klass: TrafficController, grouped: true }
|
127
|
-
elsif component_id =~ /DL/
|
128
|
-
{ klass: DetectorLogic, goruped: false }
|
129
|
-
elsif component_id =~ /SG/
|
130
|
-
{ klass: SignalGroup, grouped: false }
|
131
|
-
else
|
132
|
-
super
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
124
|
def process_aggregated_status message
|
137
125
|
se = message.attribute("se")
|
138
126
|
validate_aggregated_status(message,se) == false
|
data/lib/rsmp/tlc.rb
CHANGED
@@ -625,13 +625,15 @@ module RSMP
|
|
625
625
|
class SignalGroup < Component
|
626
626
|
attr_reader :plan, :state
|
627
627
|
|
628
|
-
|
628
|
+
# plan is a string, with each character representing a signal phase at a particular second in the cycle
|
629
|
+
def initialize node:, id:, plan: nil
|
629
630
|
super node: node, id: id, grouped: false
|
630
631
|
@plan = plan
|
631
632
|
move 0
|
632
633
|
end
|
633
634
|
|
634
635
|
def get_state pos
|
636
|
+
return 'a' unless @plan # if no plan, use phase a, which means disabled/dark
|
635
637
|
if pos > @plan.length
|
636
638
|
'.'
|
637
639
|
else
|
data/lib/rsmp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsmp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emil Tin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -254,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
254
254
|
- !ruby/object:Gem::Version
|
255
255
|
version: '0'
|
256
256
|
requirements: []
|
257
|
-
rubygems_version: 3.2.
|
257
|
+
rubygems_version: 3.2.26
|
258
258
|
signing_key:
|
259
259
|
specification_version: 4
|
260
260
|
summary: RoadSide Message Protocol (RSMP) library.
|