rsmp 0.6.4 → 0.7.2
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/config/supervisor.yaml +0 -2
- data/config/tlc.yaml +0 -2
- data/lib/rsmp/component.rb +9 -8
- data/lib/rsmp/error.rb +3 -0
- data/lib/rsmp/logger.rb +19 -4
- data/lib/rsmp/message.rb +1 -1
- data/lib/rsmp/site_proxy.rb +1 -1
- data/lib/rsmp/tlc/traffic_controller_site.rb +6 -1
- data/lib/rsmp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a5a515a9a42c794ebc27efd12ab9d87a1b0281544e06050bfe63f433bdf4a80
|
4
|
+
data.tar.gz: 51e2cca7f3e44cf5c4fe6447151436474f1d5001715e8a4ce54c070ce867565e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac5c99fb01e74f49a7bab931fefe9314c1d4279e7c0be9d688de622c60892edb0138ac72b676261fc6e86681e01e30f7b59d28ee33e853389af509b9229f5982
|
7
|
+
data.tar.gz: 8050ccd64dc78c49704f403fea069ab62c6f68778a3b3f2fdabba359d74620027959f8ab2bc5ce0fc22193a403301d7454a186fe01f14fd54800534ac640e541
|
data/Gemfile.lock
CHANGED
data/config/supervisor.yaml
CHANGED
data/config/tlc.yaml
CHANGED
data/lib/rsmp/component.rb
CHANGED
@@ -79,16 +79,17 @@ module RSMP
|
|
79
79
|
|
80
80
|
def handle_alarm message
|
81
81
|
code = message.attribute('aCId')
|
82
|
-
|
83
|
-
if
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
82
|
+
previous = @alarms[code]
|
83
|
+
if previous
|
84
|
+
unless message.differ?(previous)
|
85
|
+
raise RepeatedAlarmError.new("no changes from previous alarm #{previous.m_id_short}")
|
86
|
+
end
|
87
|
+
if Time.parse(message.attribute('aTs')) < Time.parse(previous.attribute('aTs'))
|
88
|
+
raise TimestampError.new("timestamp is earlier than previous alarm #{previous.m_id_short}")
|
88
89
|
end
|
89
|
-
else
|
90
|
-
@alarms[code] = message
|
91
90
|
end
|
91
|
+
ensure
|
92
|
+
@alarms[code] = message
|
92
93
|
end
|
93
94
|
|
94
95
|
# Handle an incoming status respone, by storing the values
|
data/lib/rsmp/error.rb
CHANGED
data/lib/rsmp/logger.rb
CHANGED
@@ -14,6 +14,7 @@ module RSMP
|
|
14
14
|
'hide_ip_and_port' => false,
|
15
15
|
'acknowledgements' => false,
|
16
16
|
'watchdogs' => false,
|
17
|
+
'alarms' => true,
|
17
18
|
'json'=>false,
|
18
19
|
'tabs'=>'-',
|
19
20
|
|
@@ -44,6 +45,15 @@ module RSMP
|
|
44
45
|
'id'=>4,
|
45
46
|
}
|
46
47
|
|
48
|
+
@ignorable = {
|
49
|
+
'versions' => ['Version'],
|
50
|
+
'statuses' => ['StatusRequest','StatusSubscribe','StatusUnsubscribe','StatusResponse','StatusUpdate'],
|
51
|
+
'commands' => ['CommandRequest','CommandResponse'],
|
52
|
+
'watchdogs' => 'Watchdog',
|
53
|
+
'alarms' => ['AlarmIssue','AlarmRequest','AlarmAcknowledged','AlarmSuspend','AlarmResume'],
|
54
|
+
'aggregated_status' => ['AggregatedStatus','AggregatedStatusRequest']
|
55
|
+
}
|
56
|
+
|
47
57
|
if settings
|
48
58
|
@settings = defaults.merge settings
|
49
59
|
else
|
@@ -96,10 +106,15 @@ module RSMP
|
|
96
106
|
if item[:message]
|
97
107
|
type = item[:message].type
|
98
108
|
ack = type == "MessageAck" || type == "MessageNotAck"
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
109
|
+
@ignorable.each_pair do |key,types|
|
110
|
+
next unless types
|
111
|
+
ignore = [types].flatten
|
112
|
+
if @settings[key] == false
|
113
|
+
#p [type,ignore_type, [ignore_type].flatten.include?(type)]
|
114
|
+
return false if ignore.include?(type)
|
115
|
+
if ack
|
116
|
+
return false if item[:message].original && ignore.include?(item[:message].original.type)
|
117
|
+
end
|
103
118
|
end
|
104
119
|
end
|
105
120
|
return false if ack && @settings["acknowledgements"] == false &&
|
data/lib/rsmp/message.rb
CHANGED
@@ -126,7 +126,7 @@ module RSMP
|
|
126
126
|
end
|
127
127
|
|
128
128
|
def initialize attributes = {}
|
129
|
-
@timestamp = Time.now # this timestamp is for internal use, and does not the clock
|
129
|
+
@timestamp = Time.now # this timestamp is for internal use, and does not use the clock
|
130
130
|
# in the node, which can be set by an rsmp supervisor
|
131
131
|
|
132
132
|
@attributes = { "mType"=> "rSMsg" }.merge attributes
|
data/lib/rsmp/site_proxy.rb
CHANGED
@@ -68,7 +68,7 @@ module RSMP
|
|
68
68
|
else
|
69
69
|
super message
|
70
70
|
end
|
71
|
-
rescue RSMP::RepeatedAlarmError, RSMP::RepeatedStatusError => e
|
71
|
+
rescue RSMP::RepeatedAlarmError, RSMP::RepeatedStatusError, TimestampError => e
|
72
72
|
str = "Rejected #{message.type} message,"
|
73
73
|
dont_acknowledge message, str, "#{e}"
|
74
74
|
notify_error e.exception("#{str}#{e.message} #{message.json}")
|
@@ -19,7 +19,12 @@ module RSMP
|
|
19
19
|
@signal_plans = {}
|
20
20
|
return unless signal_plans
|
21
21
|
signal_plans.each_pair do |id,settings|
|
22
|
-
|
22
|
+
states = nil
|
23
|
+
bands = nil
|
24
|
+
states = settings['states'] if settings
|
25
|
+
dynamic_bands = settings['dynamic_bands'] if settings
|
26
|
+
|
27
|
+
@signal_plans[id.to_i] = SignalPlan.new(nr: id.to_i, states:states,dynamic_bands:dynamic_bands)
|
23
28
|
end
|
24
29
|
end
|
25
30
|
|
data/lib/rsmp/version.rb
CHANGED