Specifications:

  • Traffic Light Controller Operational control mode is read with S0020

    Verify status S0020 control mode

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    11
    12
    13
    14
    # File 'spec/site/tlc/modes_spec.rb', line 11
    
    Validator::Site.connected do |task,supervisor,site|
            request_status_and_confirm site, "control mode",
              { S0020: [:controlmode,:intersection] }
          end
  • Traffic Light Controller Operational startup status is read with S0005

    Verify status S0005 traffic controller starting by intersection statusByIntersection requires core >= 3.2, since it uses the array data type.

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    23
    24
    25
    26
    # File 'spec/site/tlc/modes_spec.rb', line 23
    
    Validator::Site.connected do |task,supervisor,site|
            request_status_and_confirm site, "traffic controller starting (true/false)",
              { S0005: [:statusByIntersection] }
          end
  • Traffic Light Controller Operational startup status is read with S0005

    Verify status S0005 traffic controller starting by intersection statusByIntersection requires core >= 3.2, since it uses the array data type.

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    23
    24
    25
    26
    # File 'spec/site/tlc/modes_spec.rb', line 23
    
    Validator::Site.connected do |task,supervisor,site|
            request_status_and_confirm site, "traffic controller starting (true/false)",
              { S0005: [:statusByIntersection] }
          end
  • Traffic Light Controller Operational switched on is read with S0007

    Verify status S0007 controller switched on, source attribute

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    48
    49
    50
    51
    # File 'spec/site/tlc/modes_spec.rb', line 48
    
    Validator::Site.connected do |task,supervisor,site|
            status_list = { S0007: [:status,:intersection,:source] }
            request_status_and_confirm site, "controller switch on (dark mode=off)", status_list
          end
  • Traffic Light Controller Operational switched on is read with S0007

    Verify status S0007 controller switched on, source attribute

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    48
    49
    50
    51
    # File 'spec/site/tlc/modes_spec.rb', line 48
    
    Validator::Site.connected do |task,supervisor,site|
            status_list = { S0007: [:status,:intersection,:source] }
            request_status_and_confirm site, "controller switch on (dark mode=off)", status_list
          end
  • Traffic Light Controller Operational manual control is read with S0008

    Verify status S0008 manual control

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    72
    73
    74
    75
    76
    77
    78
    79
    # File 'spec/site/tlc/modes_spec.rb', line 72
    
    Validator::Site.connected do |task,supervisor,site|
            if RSMP::Proxy.version_meets_requirement?( site.sxl_version, '>=1.1' )
              status_list = { S0008: [:status,:intersection,:source] }
            else
              status_list = { S0008: [:status,:intersection] }
            end
            request_status_and_confirm site, "manual control status", status_list
          end
  • Traffic Light Controller Operational fixed time control is read with S0009

    Verify status S0009 fixed time control

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    88
    89
    90
    91
    92
    93
    94
    95
    # File 'spec/site/tlc/modes_spec.rb', line 88
    
    Validator::Site.connected do |task,supervisor,site|
            if RSMP::Proxy.version_meets_requirement?( site.sxl_version, '>=1.1' )
              status_list = { S0009: [:status,:intersection,:source] }
            else
              status_list = { S0009: [:status,:intersection] }
            end
            request_status_and_confirm site, "fixed time control status", status_list
          end
  • Traffic Light Controller Operational fixed time control can be activated with M0007

    Verify command M0007 fixed time control

    1. Verify connection

    2. Send command to switch to fixed time = true

    3. Wait for status = true

    4. Send command to switch to fixed time = false

    5. Wait for status = false

    
    
    106
    107
    108
    109
    110
    # File 'spec/site/tlc/modes_spec.rb', line 106
    
    Validator::Site.connected do |task,supervisor,site|
            prepare task, site
            switch_fixed_time 'True'
            switch_fixed_time 'False'
          end
  • Traffic Light Controller Operational isolated control is read with S0010

    Verify status S0010 isolated control

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    119
    120
    121
    122
    123
    124
    125
    126
    # File 'spec/site/tlc/modes_spec.rb', line 119
    
    Validator::Site.connected do |task,supervisor,site|
            if RSMP::Proxy.version_meets_requirement?( site.sxl_version, '>=1.1' )
              status_list = { S0010: [:status,:intersection,:source] }
            else
              status_list = { S0010: [:status,:intersection] }
            end
            request_status_and_confirm site, "isolated control status", status_list
          end
  • Traffic Light Controller Operational coordinated control is read with S0032

    Verify status S0032 coordinated control

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    135
    136
    137
    138
    # File 'spec/site/tlc/modes_spec.rb', line 135
    
    Validator::Site.connected do |task,supervisor,site|
            status_list = { S0032: [:status,:intersection,:source] }
            request_status_and_confirm site, "coordinated control status", status_list
          end
  • Traffic Light Controller Operational yellow flash can be read with S0011

    Verify status S0011 yellow flash

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    147
    148
    149
    150
    151
    152
    153
    154
    # File 'spec/site/tlc/modes_spec.rb', line 147
    
    Validator::Site.connected do |task,supervisor,site|
            if RSMP::Proxy.version_meets_requirement?( site.sxl_version, '>=1.1' )
              status_list = { S0011: [:status,:intersection,:source] }
            else
              status_list = { S0011: [:status,:intersection] }
            end
            request_status_and_confirm site, "yellow flash status", status_list
          end
  • Traffic Light Controller Operational yellow flash can be activated with M0001

    Verify that we can activate yellow flash

    1. Given the site is connected

    2. Send the control command to switch to Yellow flash

    3. Wait for status Yellow flash

    4. Send command to switch to normal control

    5. Wait for status “Yellow flash” = false, “Controller starting”= false, “Controller on”= true“

    
    
    165
    166
    167
    168
    169
    # File 'spec/site/tlc/modes_spec.rb', line 165
    
    Validator::Site.connected do |task,supervisor,site|
            prepare task, site
            switch_yellow_flash
            switch_normal_control
          end
  • Traffic Light Controller Operational yellow flash affects all signal groups

    Verify that we can yellow flash causes all groups to go to state ‘c’

    1. Given the site is connected

    2. Send the control command to switch to Yellow flash

    3. Wait for all groups to go to group ‘c’

    4. Send command to switch to normal control

    5. Wait for all groups to switch do something else that ‘c’

    
    
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    # File 'spec/site/tlc/modes_spec.rb', line 180
    
    Validator::Site.connected do |task,supervisor,site|
            prepare task, site
            timeout =  Validator.get_config('timeouts','yellow_flash')
    
            switch_yellow_flash
            wait_for_groups 'c', timeout: timeout      # c mean s yellow flash
    
            switch_normal_control
            wait_for_groups '[^c]', timeout: timeout   # not c, ie. not yellow flash
          end
  • Traffic Light Controller Operational all red can be read with S0012

    Verify status S0012 all red

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    198
    199
    200
    201
    202
    203
    204
    205
    # File 'spec/site/tlc/modes_spec.rb', line 198
    
    Validator::Site.connected do |task,supervisor,site|
            if RSMP::Proxy.version_meets_requirement?( site.sxl_version, '>=1.1' )
              status_list = { S0012: [:status,:intersection,:source] }
            else
              status_list = { S0012: [:status,:intersection] }
            end
            request_status_and_confirm site, "all-red status", status_list
          end
  • Traffic Light Controller Operational police key can be read with S0013

    Verify status S0013 police key

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    214
    215
    216
    217
    # File 'spec/site/tlc/modes_spec.rb', line 214
    
    Validator::Site.connected do |task,supervisor,site|
            request_status_and_confirm site, "police key",
              { S0013: [:status] }
          end
  • Traffic Light Controller Operational dark mode can be activated with M0001

    Verify that we can activate dark mode

    1. Given the site is connected

    2. Send the control command to switch todarkmode

    3. Wait for status“Controller on” = false

    4. Send command to switch to normal control

    5. Wait for status “Yellow flash” = false, “Controller starting”= false, “Controller on”= true“

    
    
    228
    229
    230
    231
    232
    # File 'spec/site/tlc/modes_spec.rb', line 228
    
    Validator::Site.connected do |task,supervisor,site|
            prepare task, site
            switch_dark_mode
            switch_normal_control
          end
  • Traffic Light Controller Operational yellow flash be used with a timeout of one minute

    Verify that we can activate yellow flash and after 1 minute goes back to NormalControl

    1. Given the site is connected

    2. Send the control command to switch to Normal Control, and wait for this

    3. Send the control command to switch to Yellow flash

    4. Wait for status Yellow flash

    5. Wait for automatic revert to Normal Control

    
    
    243
    244
    245
    246
    247
    248
    249
    # File 'spec/site/tlc/modes_spec.rb', line 243
    
    Validator::Site.connected do |task,supervisor,site|
            prepare task, site
            switch_normal_control
            minutes = 1
            switch_yellow_flash timeout_minutes: minutes
            wait_normal_control timeout: minutes*60 + Validator.get_config('timeouts','functional_position')
          end