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

    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

    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

    
    
    47
    48
    49
    50
    # File 'spec/site/tlc/modes_spec.rb', line 47
    
    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

    
    
    47
    48
    49
    50
    # File 'spec/site/tlc/modes_spec.rb', line 47
    
    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

    
    
    71
    72
    73
    74
    75
    76
    77
    78
    # File 'spec/site/tlc/modes_spec.rb', line 71
    
    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

    
    
    87
    88
    89
    90
    91
    92
    93
    94
    # File 'spec/site/tlc/modes_spec.rb', line 87
    
    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

    
    
    105
    106
    107
    108
    109
    # File 'spec/site/tlc/modes_spec.rb', line 105
    
    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

    
    
    118
    119
    120
    121
    122
    123
    124
    125
    # File 'spec/site/tlc/modes_spec.rb', line 118
    
    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

    
    
    134
    135
    136
    137
    # File 'spec/site/tlc/modes_spec.rb', line 134
    
    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

    
    
    146
    147
    148
    149
    150
    151
    152
    153
    # File 'spec/site/tlc/modes_spec.rb', line 146
    
    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“

    
    
    164
    165
    166
    167
    168
    # File 'spec/site/tlc/modes_spec.rb', line 164
    
    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’

    
    
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    # File 'spec/site/tlc/modes_spec.rb', line 179
    
    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

    
    
    197
    198
    199
    200
    201
    202
    203
    204
    # File 'spec/site/tlc/modes_spec.rb', line 197
    
    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

    
    
    213
    214
    215
    216
    # File 'spec/site/tlc/modes_spec.rb', line 213
    
    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“

    
    
    227
    228
    229
    230
    231
    # File 'spec/site/tlc/modes_spec.rb', line 227
    
    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

    
    
    242
    243
    244
    245
    246
    247
    248
    # File 'spec/site/tlc/modes_spec.rb', line 242
    
    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