Class: RSMP::TLC::SupervisorInterface
- Inherits:
-
SXL::SupervisorInterface
- Object
- SXL::SupervisorInterface
- RSMP::TLC::SupervisorInterface
- Includes:
- Proxy::Control, Proxy::Detectors, Proxy::IO, Proxy::Plans, Proxy::PlansBang, Proxy::Status, Proxy::System
- Defined in:
- lib/rsmp/tlc/supervisor_interface.rb
Overview
Supervisor-side TLC SXL interface.
Instance Attribute Summary collapse
-
#functional_position ⇒ Object
readonly
Returns the value of attribute functional_position.
-
#timeouts ⇒ Object
readonly
Returns the value of attribute timeouts.
-
#timeplan ⇒ Object
readonly
Returns the value of attribute timeplan.
-
#timeplan_source ⇒ Object
readonly
Returns the value of attribute timeplan_source.
-
#traffic_situation ⇒ Object
readonly
Returns the value of attribute traffic_situation.
-
#yellow_flash ⇒ Object
readonly
Returns the value of attribute yellow_flash.
Instance Method Summary collapse
- #current_plan ⇒ Object
-
#initialize ⇒ SupervisorInterface
constructor
A new instance of SupervisorInterface.
- #plan_source ⇒ Object
- #process_message(message) ⇒ Object
- #process_status_update(message) ⇒ Object
- #subscribe_to_timeplan ⇒ Object
- #subscribe_to_timeplan! ⇒ Object
- #timeplan_attributes ⇒ Object
Methods included from Proxy::System
#set_clock, #set_clock!, #set_security_code, #set_security_code!
Methods included from Proxy::Detectors
#force_detector_logic, #force_detector_logic!, #set_trigger_level, #set_trigger_level!
Methods included from Proxy::Status
#fetch_signal_plan, #fetch_signal_plan!, #read_current_plan, #read_current_plan!, #read_cycle_times, #read_cycle_times!, #read_dynamic_band, #read_dynamic_band!, #wait_for_groups, #wait_for_groups!, #wait_for_normal_control, #wait_for_normal_control!, #wait_for_status, #wait_for_status!
Methods included from Proxy::PlansBang
#order_signal_start!, #order_signal_stop!, #set_cycle_time!, #set_day_table!, #set_dynamic_bands!, #set_dynamic_bands_timeout!, #set_offset!, #set_timeplan!, #set_week_table!
Methods included from Proxy::Plans
#order_signal_start, #order_signal_stop, #set_cycle_time, #set_day_table, #set_dynamic_bands, #set_dynamic_bands_timeout, #set_offset, #set_timeplan, #set_week_table
Methods included from Proxy::IO
#force_input, #force_input!, #force_output, #force_output!, #set_input, #set_input!, #set_inputs, #set_inputs!
Methods included from Proxy::Control
#set_emergency_route, #set_emergency_route!, #set_fixed_time, #set_fixed_time!, #set_functional_position, #set_functional_position!, #set_traffic_situation, #set_traffic_situation!, #unset_traffic_situation, #unset_traffic_situation!
Constructor Details
#initialize ⇒ SupervisorInterface
Returns a new instance of SupervisorInterface.
17 18 19 20 21 22 23 24 25 |
# File 'lib/rsmp/tlc/supervisor_interface.rb', line 17 def initialize(...) super @timeplan_source = nil @timeplan = nil @functional_position = nil @yellow_flash = nil @traffic_situation = nil @timeouts = node.supervisor_settings.dig('default', 'timeouts') || {} end |
Instance Attribute Details
#functional_position ⇒ Object (readonly)
Returns the value of attribute functional_position.
14 15 16 |
# File 'lib/rsmp/tlc/supervisor_interface.rb', line 14 def functional_position @functional_position end |
#timeouts ⇒ Object (readonly)
Returns the value of attribute timeouts.
14 15 16 |
# File 'lib/rsmp/tlc/supervisor_interface.rb', line 14 def timeouts @timeouts end |
#timeplan ⇒ Object (readonly)
Returns the value of attribute timeplan.
14 15 16 |
# File 'lib/rsmp/tlc/supervisor_interface.rb', line 14 def timeplan @timeplan end |
#timeplan_source ⇒ Object (readonly)
Returns the value of attribute timeplan_source.
14 15 16 |
# File 'lib/rsmp/tlc/supervisor_interface.rb', line 14 def timeplan_source @timeplan_source end |
#traffic_situation ⇒ Object (readonly)
Returns the value of attribute traffic_situation.
14 15 16 |
# File 'lib/rsmp/tlc/supervisor_interface.rb', line 14 def traffic_situation @traffic_situation end |
#yellow_flash ⇒ Object (readonly)
Returns the value of attribute yellow_flash.
14 15 16 |
# File 'lib/rsmp/tlc/supervisor_interface.rb', line 14 def yellow_flash @yellow_flash end |
Instance Method Details
#current_plan ⇒ Object
27 28 29 |
# File 'lib/rsmp/tlc/supervisor_interface.rb', line 27 def current_plan @timeplan end |
#plan_source ⇒ Object
31 32 33 |
# File 'lib/rsmp/tlc/supervisor_interface.rb', line 31 def plan_source @timeplan_source end |
#process_message(message) ⇒ Object
61 62 63 |
# File 'lib/rsmp/tlc/supervisor_interface.rb', line 61 def () process_status_update if .is_a?(RSMP::StatusUpdate) end |
#process_status_update(message) ⇒ Object
54 55 56 57 58 59 |
# File 'lib/rsmp/tlc/supervisor_interface.rb', line 54 def process_status_update() status_values = .attribute('sS') return unless status_values status_values.each { |item| cache_status_item(item) } end |
#subscribe_to_timeplan ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/rsmp/tlc/supervisor_interface.rb', line 35 def subscribe_to_timeplan readiness = validate_ready 'subscribe to timeplan' return readiness if readiness.failure? status_list = [ { 'sCI' => 'S0014', 'n' => 'status', 'uRt' => '0' }, { 'sCI' => 'S0014', 'n' => 'source', 'uRt' => '0' } ] status_list.each { |item| item['sOc'] = true } if use_soc? raise 'TLC main component not found' unless main subscribe_to_status status_list, component: main.c_id end |
#subscribe_to_timeplan! ⇒ Object
50 51 52 |
# File 'lib/rsmp/tlc/supervisor_interface.rb', line 50 def subscribe_to_timeplan!(...) subscribe_to_timeplan(...).value! end |
#timeplan_attributes ⇒ Object
65 66 67 |
# File 'lib/rsmp/tlc/supervisor_interface.rb', line 65 def timeplan_attributes main&.statuses&.dig('S0014') || {} end |