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

Included in:
SupervisorInterface
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.



39
40
41
42
43
44
45
46
# File 'lib/rsmp/tlc/proxy/system.rb', line 39

def set_clock(clock, within:)
  readiness = validate_ready 'set clock'
  return readiness if readiness.failure?

  raise 'TLC main component not found' unless main

  send_command_and_collect(clock_command_list(clock), within: within)
end

#set_clock!Object



48
49
50
# File 'lib/rsmp/tlc/proxy/system.rb', line 48

def set_clock!(...)
  set_clock(...).value!
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
31
32
# File 'lib/rsmp/tlc/proxy/system.rb', line 9

def set_security_code(level:, old_code:, new_code:, within:)
  readiness = validate_ready 'set security code'
  return readiness if readiness.failure?

  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)
end

#set_security_code!Object



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

def set_security_code!(...)
  set_security_code(...).value!
end