rsmp 0.13.6 → 0.13.7
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/Gemfile.lock +1 -1
- data/lib/rsmp/alarm_state.rb +13 -1
- data/lib/rsmp/components.rb +2 -2
- data/lib/rsmp/site.rb +2 -17
- data/lib/rsmp/site_proxy.rb +3 -0
- data/lib/rsmp/supervisor_proxy.rb +15 -4
- data/lib/rsmp/tlc/traffic_controller.rb +2 -2
- data/lib/rsmp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e7dfc4d62630bc941181c506e6fe777e817a91270ff2797ecbfc5d0069e7d68
|
4
|
+
data.tar.gz: bacbfe1c630fdbae4eebf0604339820b00352b3cf7c312683f9e48751bef77a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9ddb8ba148e22c1919f7ba04cb727138db1e4d56750eac87a0ab03e63431990a31950c0a1ee83d45ca09e105adb478709061e7e59cfebf5d0e794a841152341
|
7
|
+
data.tar.gz: 1bd48de932a481cec40499c0f82cf34daab58620bb3795ca3789098424baa32e47a014373c51e0e3631229d079e3facf7a703b7cbc02f0f14cab7e032ff6e75a
|
data/Gemfile.lock
CHANGED
data/lib/rsmp/alarm_state.rb
CHANGED
@@ -17,6 +17,19 @@ module RSMP
|
|
17
17
|
@rvs = []
|
18
18
|
end
|
19
19
|
|
20
|
+
def to_hash
|
21
|
+
{
|
22
|
+
'cId' => component_id,
|
23
|
+
'aCId' => code,
|
24
|
+
'aTs' => Clock.to_s(timestamp),
|
25
|
+
'ack' => (acknowledged ? 'Acknowledged' : 'notAcknowledged'),
|
26
|
+
'sS' => (suspended ? 'suspended' : 'notSuspended'),
|
27
|
+
'aS' => (active ? 'Active' : 'inActive'),
|
28
|
+
'cat' => category,
|
29
|
+
'pri' => priority.to_s,
|
30
|
+
'rvs' => rvs
|
31
|
+
}
|
32
|
+
end
|
20
33
|
def suspend
|
21
34
|
change, @suspended = !@suspended, true
|
22
35
|
update_timestamp if change
|
@@ -89,6 +102,5 @@ module RSMP
|
|
89
102
|
@priority = message.attribute('pri').to_i
|
90
103
|
@rvs = message.attribute('rvs')
|
91
104
|
end
|
92
|
-
|
93
105
|
end
|
94
106
|
end
|
data/lib/rsmp/components.rb
CHANGED
@@ -50,8 +50,8 @@ module RSMP
|
|
50
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
|
-
class_name << "
|
54
|
-
log "
|
53
|
+
class_name << " component" unless (class_name == 'Component' || class_name == 'ComponentProxy')
|
54
|
+
log "Adding component #{component_id} with the inferred type #{class_name}", level: :debug
|
55
55
|
component
|
56
56
|
else
|
57
57
|
raise UnknownComponent.new("Component #{component_id} not found") unless component
|
data/lib/rsmp/site.rb
CHANGED
@@ -15,7 +15,6 @@ module RSMP
|
|
15
15
|
@proxies = []
|
16
16
|
@sleep_condition = Async::Notification.new
|
17
17
|
@proxies_condition = Async::Notification.new
|
18
|
-
|
19
18
|
build_proxies
|
20
19
|
end
|
21
20
|
|
@@ -93,27 +92,13 @@ module RSMP
|
|
93
92
|
end
|
94
93
|
end
|
95
94
|
|
96
|
-
def alarm_state_to_hash alarm_state
|
97
|
-
{
|
98
|
-
'cId' => alarm_state.component_id,
|
99
|
-
'aCId' => alarm_state.code,
|
100
|
-
'aTs' => Clock.to_s(alarm_state.timestamp),
|
101
|
-
'ack' => (alarm_state.acknowledged ? 'Acknowledged' : 'notAcknowledged'),
|
102
|
-
'sS' => (alarm_state.suspended ? 'suspended' : 'notSuspended'),
|
103
|
-
'aS' => (alarm_state.active ? 'Active' : 'inActive'),
|
104
|
-
'cat' => alarm_state.category,
|
105
|
-
'pri' => alarm_state.priority.to_s,
|
106
|
-
'rvs' => alarm_state.rvs
|
107
|
-
}
|
108
|
-
end
|
109
|
-
|
110
95
|
def alarm_suspended_or_resumed alarm_state
|
111
|
-
alarm = AlarmIssue.new(
|
96
|
+
alarm = AlarmIssue.new( alarm_state.to_hash.merge('aSp' => 'Suspend') )
|
112
97
|
send_alarm alarm
|
113
98
|
end
|
114
99
|
|
115
100
|
def alarm_activated_or_deactivated alarm_state
|
116
|
-
alarm = AlarmIssue.new(
|
101
|
+
alarm = AlarmIssue.new( alarm_state.to_hash.merge('aSp' => 'Issue') )
|
117
102
|
send_alarm alarm
|
118
103
|
end
|
119
104
|
|
data/lib/rsmp/site_proxy.rb
CHANGED
@@ -85,7 +85,10 @@ module RSMP
|
|
85
85
|
sanitized_sxl_version = RSMP::Schemer.sanitize_version(sxl_version)
|
86
86
|
log "Connection to supervisor established, using core #{@rsmp_version}, #{sxl} #{sanitized_sxl_version}", level: :info
|
87
87
|
start_watchdog
|
88
|
-
|
88
|
+
if @site_settings['send_after_connect']
|
89
|
+
send_all_aggregated_status
|
90
|
+
send_active_alarms
|
91
|
+
end
|
89
92
|
super
|
90
93
|
end
|
91
94
|
|
@@ -116,9 +119,6 @@ module RSMP
|
|
116
119
|
end
|
117
120
|
|
118
121
|
def acknowledged_first_ingoing message
|
119
|
-
# TODO
|
120
|
-
# aggregateds status should only be send for later version of rsmp
|
121
|
-
# to handle verison differences, we probably need inherited classes
|
122
122
|
case message.type
|
123
123
|
when "Watchdog"
|
124
124
|
handshake_complete
|
@@ -133,6 +133,17 @@ module RSMP
|
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
|
+
def send_active_alarms
|
137
|
+
@site.components.each_pair do |c_id,component|
|
138
|
+
component.alarms.each_pair do |alarm_code, alarm_state|
|
139
|
+
if alarm_state.active
|
140
|
+
alarm = AlarmIssue.new( alarm_state.to_hash.merge('aSp' => 'Issue') )
|
141
|
+
send_message alarm
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
136
147
|
def reconnect_delay
|
137
148
|
return false if @site_settings['intervals']['reconnect'] == :no
|
138
149
|
interval = @site_settings['intervals']['reconnect']
|
@@ -263,10 +263,10 @@ module RSMP
|
|
263
263
|
if actions['raise']
|
264
264
|
alarm_code = actions['raise']
|
265
265
|
if change
|
266
|
-
log "Activating
|
266
|
+
log "Activating input #{input} is programmed to activate alarm #{alarm_code}", level: :info
|
267
267
|
activate_alarm alarm_code
|
268
268
|
else
|
269
|
-
log "Deactivating
|
269
|
+
log "Deactivating input #{input} is programmed to deactivate alarm #{alarm_code}", level: :info
|
270
270
|
deactivate_alarm alarm_code
|
271
271
|
end
|
272
272
|
end
|
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.13.
|
4
|
+
version: 0.13.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: 2022-08-
|
11
|
+
date: 2022-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|