Module: RSMP::TLC::Proxy::Detectors

Included in:
TrafficControllerProxy
Defined in:
lib/rsmp/tlc/proxy/detectors.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

#force_detector_logic(component_id, status:, mode:, within:) ⇒ Object

M0008 — Force detector logic to a given mode and status. component_id must refer to the detector logic component, not main.



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

def force_detector_logic(component_id, status:, mode:, within:)
  validate_ready 'force detector logic'

  security_code = security_code_for(2)

  command_list = [{
    'cCI' => 'M0008',
    'cO' => 'setForceDetectorLogic',
    'n' => 'status',
    'v' => status.to_s
  }, {
    'cCI' => 'M0008',
    'cO' => 'setForceDetectorLogic',
    'n' => 'securityCode',
    'v' => security_code.to_s
  }, {
    'cCI' => 'M0008',
    'cO' => 'setForceDetectorLogic',
    'n' => 'mode',
    'v' => mode.to_s
  }]
  send_command_and_collect(command_list, component: component_id, within: within).ok!
end

#set_trigger_level(status, within:) ⇒ Object

M0021 — Set the trigger level for traffic counting.



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/rsmp/tlc/proxy/detectors.rb', line 34

def set_trigger_level(status, within:)
  validate_ready 'set trigger level'
  raise 'TLC main component not found' unless main

  security_code = security_code_for(2)

  command_list = [{
    'cCI' => 'M0021',
    'cO' => 'setLevel',
    'n' => 'status',
    'v' => status.to_s
  }, {
    'cCI' => 'M0021',
    'cO' => 'setLevel',
    'n' => 'securityCode',
    'v' => security_code.to_s
  }]
  send_command_and_collect(command_list, within: within).ok!
end