Module: RSMP::TLC::Proxy::System

Included in:
TrafficControllerProxy
Defined in:
lib/rsmp/tlc/proxy/system.rb

Overview

Command methods for operational control of a remote TLC. Covers functional position, emergency routes, I/O modes, signal group orders, and system settings.

Instance Method Summary collapse

Instance Method Details

#set_clock(clock, within:) ⇒ Object

M0104 — Set the clock on the remote TLC. clock must respond to year/month/day/hour/min/sec.



33
34
35
36
37
38
# File 'lib/rsmp/tlc/proxy/system.rb', line 33

def set_clock(clock, within:)
  validate_ready 'set clock'
  raise 'TLC main component not found' unless main

  send_command_and_collect(clock_command_list(clock), within: within).ok!
end

#set_security_code(level:, old_code:, new_code:, within:) ⇒ Object

M0103 — Change security code for a given level. Does not use security_code_for since the codes are passed explicitly.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/rsmp/tlc/proxy/system.rb', line 9

def set_security_code(level:, old_code:, new_code:, within:)
  validate_ready 'set security code'
  raise 'TLC main component not found' unless main

  command_list = [{
    'cCI' => 'M0103',
    'cO' => 'setSecurityCode',
    'n' => 'status',
    'v' => level.to_s
  }, {
    'cCI' => 'M0103',
    'cO' => 'setSecurityCode',
    'n' => 'oldSecurityCode',
    'v' => old_code.to_s
  }, {
    'cCI' => 'M0103',
    'cO' => 'setSecurityCode',
    'n' => 'newSecurityCode',
    'v' => new_code.to_s
  }]
  send_command_and_collect(command_list, within: within).ok!
end