rsmp 0.9.10 → 0.10.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/config/tlc.yaml +1 -0
- data/lib/rsmp/component.rb +22 -0
- data/lib/rsmp/site.rb +6 -0
- data/lib/rsmp/supervisor_proxy.rb +6 -0
- data/lib/rsmp/tlc/traffic_controller.rb +2 -0
- 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: 966835905e623249647c1c09a2571ffe81e42a4d28b7f61630f11dbd886f5e60
|
4
|
+
data.tar.gz: 134c264fdbeddd2a2dd72613ccb96d9476f732ecff086ae274bb0bc25a381e5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '04027059289848f757e10b46b5cc9ba15ade51460cdaaa80d442945dd79a3300f676a593a6cc3ec29c945f9340664855cca3304188cbef99f89531820731004f'
|
7
|
+
data.tar.gz: a04881e95b77482897ccd746047847e3036953515d02539fb2988b1a743135ebf0d6c66d1f15c39c46d7d3bfd8c5df67568bddf58ac26df3fee5fca5f00d3dd4
|
data/Gemfile.lock
CHANGED
data/config/tlc.yaml
CHANGED
data/lib/rsmp/component.rb
CHANGED
@@ -77,6 +77,7 @@ module RSMP
|
|
77
77
|
raise UnknownStatus.new "Status #{status_code}/#{status_name} not implemented by #{self.class}"
|
78
78
|
end
|
79
79
|
|
80
|
+
# handle incoming alarm
|
80
81
|
def handle_alarm message
|
81
82
|
code = message.attribute('aCId')
|
82
83
|
previous = @alarms[code]
|
@@ -92,6 +93,27 @@ module RSMP
|
|
92
93
|
@alarms[code] = message
|
93
94
|
end
|
94
95
|
|
96
|
+
# set alarm
|
97
|
+
def send_alarm code:, status:
|
98
|
+
# TODO
|
99
|
+
# we need to manage the state of alarms internally (an ALarm class probably),
|
100
|
+
# and handle request from the supervisor to suspend and resume alarms etc.
|
101
|
+
# when this state changes, we then send an alarm message
|
102
|
+
alarm = Alarm.new(
|
103
|
+
'cId' => c_id,
|
104
|
+
'aTs' => @node.clock.to_s,
|
105
|
+
'aCId' => code,
|
106
|
+
'aSp' => 'Issue',
|
107
|
+
'ack' => 'Acknowledged',
|
108
|
+
'sS' => 'notSuspended',
|
109
|
+
'aS' => status,
|
110
|
+
'cat' => 'D',
|
111
|
+
'pri' => '2',
|
112
|
+
'rvs' => []
|
113
|
+
)
|
114
|
+
@node.alarm_changed self, alarm
|
115
|
+
end
|
116
|
+
|
95
117
|
# Handle an incoming status respone, by storing the values
|
96
118
|
def handle_status_response message
|
97
119
|
store_status message, check_repeated: false
|
data/lib/rsmp/site.rb
CHANGED
@@ -93,6 +93,12 @@ module RSMP
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
+
def alarm_changed component, alarm
|
97
|
+
@proxies.each do |proxy|
|
98
|
+
proxy.send_alarm component, alarm if proxy.ready?
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
96
102
|
def connect_to_supervisor task, supervisor_settings
|
97
103
|
proxy = build_proxy({
|
98
104
|
site: self,
|
@@ -172,6 +172,12 @@ module RSMP
|
|
172
172
|
end
|
173
173
|
end
|
174
174
|
|
175
|
+
def send_alarm component, alarm, options={}
|
176
|
+
send_and_optionally_collect alarm, options do |collect_options|
|
177
|
+
Collector.new self, collect_options.merge(task:@task, type: 'MessageAck')
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
175
181
|
def process_aggregated_status message
|
176
182
|
se = message.attribute("se")
|
177
183
|
validate_aggregated_status(message,se) == false
|
@@ -264,8 +264,10 @@ module RSMP
|
|
264
264
|
alarm_code = actions['raise']
|
265
265
|
if change
|
266
266
|
log "Activating alarm #{alarm_code}, because input #{input} was activated", level: :info
|
267
|
+
send_alarm code:alarm_code, status:'Active'
|
267
268
|
else
|
268
269
|
log "Deactivating alarm #{alarm_code}, because input #{input} was deactivated", level: :info
|
270
|
+
send_alarm code:alarm_code, status:'inActive'
|
269
271
|
end
|
270
272
|
end
|
271
273
|
end
|
data/lib/rsmp/version.rb
CHANGED