Modes
Tests
- Modes all red can be read with S0012
- Modes can use yellow flash with a timeout of one minute
- Modes control mode is read with S0020
- Modes coordinated control is read with S0032
- Modes dark mode can be activated with M0001
- Modes fixed time control can be activated with M0007
- Modes fixed time control is read with S0009
- Modes isolated control is read with S0010
- Modes manual control is read with S0008
- Modes police key can be read with S0013
- Modes startup status is read with S0005
- Modes startup status is read with S0005 by intersection
- Modes switched on is read with S0007
- Modes switched on is read with S0007 with source
- Modes yellow flash affects all signal groups
- Modes yellow flash can be activated with M0001
- Modes yellow flash can be read with S0011
Modes all red can be read with S0012
Verify status S0012 all red
- Given the site_proxy is connected
- Request status
- Expect status response before timeout
View Source
it 'all red can be read with S0012' do
with_site(:connected, sxl: '>=1.0.7') do |site_proxy|
status_list = if RSMP::Proxy.version_meets_requirement?(site_proxy.sxl_version, '>=1.1')
{ S0012: %i[status intersection source] }
else
{ S0012: %i[status intersection] }
end
site_proxy.request_status_and_collect(status_list,
within: RSMP::Validator.get_config('timeouts', 'status_response')).ok!
end
end
Modes can use yellow flash with a timeout of one minute
Verify that we can activate yellow flash and after 1 minute goes back to NormalControl
- Given the site_proxy is connected
- Send the control command to switch to Normal Control, and wait for this
- Send the control command to switch to Yellow flash
- Wait for status Yellow flash
- Wait for automatic revert to Normal Control
View Source
it 'can use yellow flash with a timeout of one minute' do
with_site(:connected, sxl: '>=1.0.7') do |site_proxy|
startup_timeout = RSMP::Validator.get_config('timeouts', 'startup_sequence')
site_proxy.tlc.set_functional_position('NormalControl', within: startup_timeout)
minutes = 1
timeout = RSMP::Validator.get_config('timeouts', 'yellow_flash')
site_proxy.tlc.set_functional_position('YellowFlash', timeout_minutes: minutes, within: timeout)
fp_timeout = RSMP::Validator.get_config('timeouts', 'functional_position')
wait_normal_control(site_proxy, timeout: (minutes * 60) + fp_timeout)
end
end
Modes control mode is read with S0020
Verify status S0020 control mode
- Given the site_proxy is connected
- Request status
- Expect status response before timeout
View Source
it 'control mode is read with S0020' do
with_site(:connected, sxl: '>=1.0.7') do |site_proxy|
site_proxy.request_status_and_collect({ S0020: %i[controlmode intersection] },
within: RSMP::Validator.get_config('timeouts', 'status_response')).ok!
end
end
Modes coordinated control is read with S0032
Verify status S0032 coordinated control
- Given the site_proxy is connected
- Request status
- Expect status response before timeout
View Source
it 'coordinated control is read with S0032' do
with_site(:connected, sxl: '>=1.1') do |site_proxy|
site_proxy.request_status_and_collect({ S0032: %i[status intersection source] },
within: RSMP::Validator.get_config('timeouts', 'status_response')).ok!
end
end
Modes dark mode can be activated with M0001
Verify that we can activate dark mode
- Given the site_proxy is connected
- Send the control command to switch todarkmode
- Wait for status”Controller on” = false
- Send command to switch to normal control
- Wait for status “Yellow flash” = false, “Controller starting”= false, “Controller on”= true”
View Source
it 'dark mode can be activated with M0001' do
with_site(:connected, sxl: '>=1.0.7') do |site_proxy|
timeout = RSMP::Validator.get_config('timeouts', 'functional_position')
startup_timeout = RSMP::Validator.get_config('timeouts', 'startup_sequence')
site_proxy.tlc.set_functional_position('Dark', within: timeout)
site_proxy.tlc.set_functional_position('NormalControl', within: startup_timeout)
end
end
Modes fixed time control can be activated with M0007
Verify command M0007 fixed time control
- Verify connection
- Send command to switch to fixed time = true
- Wait for status = true
- Send command to switch to fixed time = false
- Wait for status = false
View Source
it 'fixed time control can be activated with M0007' do
with_site(:connected, sxl: '>=1.0.7') do |site_proxy|
timeout = RSMP::Validator.get_config('timeouts', 'command')
site_proxy.tlc.set_fixed_time('True', within: timeout)
site_proxy.tlc.set_fixed_time('False', within: timeout)
end
end
Modes fixed time control is read with S0009
Verify status S0009 fixed time control
- Given the site_proxy is connected
- Request status
- Expect status response before timeout
View Source
it 'fixed time control is read with S0009' do
with_site(:connected, sxl: '>=1.0.7') do |site_proxy|
status_list = if RSMP::Proxy.version_meets_requirement?(site_proxy.sxl_version, '>=1.1')
{ S0009: %i[status intersection source] }
else
{ S0009: %i[status intersection] }
end
site_proxy.request_status_and_collect(status_list,
within: RSMP::Validator.get_config('timeouts', 'status_response')).ok!
end
end
Modes isolated control is read with S0010
Verify status S0010 isolated control
- Given the site_proxy is connected
- Request status
- Expect status response before timeout
View Source
it 'isolated control is read with S0010' do
with_site(:connected, sxl: '>=1.0.7') do |site_proxy|
status_list = if RSMP::Proxy.version_meets_requirement?(site_proxy.sxl_version, '>=1.1')
{ S0010: %i[status intersection source] }
else
{ S0010: %i[status intersection] }
end
site_proxy.request_status_and_collect(status_list,
within: RSMP::Validator.get_config('timeouts', 'status_response')).ok!
end
end
Modes manual control is read with S0008
Verify status S0008 manual control
- Given the site_proxy is connected
- Request status
- Expect status response before timeout
View Source
it 'manual control is read with S0008' do
with_site(:connected, sxl: '>=1.0.7') do |site_proxy|
status_list = if RSMP::Proxy.version_meets_requirement?(site_proxy.sxl_version, '>=1.1')
{ S0008: %i[status intersection source] }
else
{ S0008: %i[status intersection] }
end
site_proxy.request_status_and_collect(status_list,
within: RSMP::Validator.get_config('timeouts', 'status_response')).ok!
end
end
Modes police key can be read with S0013
Verify status S0013 police key
- Given the site_proxy is connected
- Request status
- Expect status response before timeout
View Source
it 'police key can be read with S0013' do
with_site(:connected, sxl: '>=1.0.7') do |site_proxy|
site_proxy.request_status_and_collect({ S0013: [:status] },
within: RSMP::Validator.get_config('timeouts', 'status_response')).ok!
end
end
Modes startup status is read with S0005
Verify status S0005 traffic controller starting
- Given the site_proxy is connected
- Request status
- Expect status response before timeout
View Source
it 'startup status is read with S0005' do
with_site(:connected, sxl: '>=1.0.7') do |site_proxy|
site_proxy.request_status_and_collect({ S0005: [:status] },
within: RSMP::Validator.get_config('timeouts', 'status_response')).ok!
end
end
Modes startup status is read with S0005 by intersection
Verify status S0005 traffic controller starting by intersection statusByIntersection requires core >= 3.2, since it uses the array data type.
- Given the site_proxy is connected
- Request status
- Expect status response before timeout
View Source
it 'startup status is read with S0005 by intersection' do
skip 'requires core >= 3.2' unless RSMP::Validator.core_matches?('>=3.2')
with_site(:connected, sxl: '>=1.2') do |site_proxy|
site_proxy.request_status_and_collect({ S0005: [:statusByIntersection] },
within: RSMP::Validator.get_config('timeouts', 'status_response')).ok!
end
end
Modes switched on is read with S0007
Verify status S0007 controller switched on (dark mode=off)
- Given the site_proxy is connected
- Request status
- Expect status response before timeout
View Source
it 'switched on is read with S0007' do
with_site(:connected, sxl: '>=1.0.7') do |site_proxy|
site_proxy.request_status_and_collect({ S0007: %i[status intersection] },
within: RSMP::Validator.get_config('timeouts', 'status_response')).ok!
end
end
Modes switched on is read with S0007 with source
Verify status S0007 controller switched on, source attribute
- Given the site_proxy is connected
- Request status
- Expect status response before timeout
View Source
it 'switched on is read with S0007 with source' do
with_site(:connected, sxl: '>=1.1') do |site_proxy|
site_proxy.request_status_and_collect({ S0007: %i[status intersection source] },
within: RSMP::Validator.get_config('timeouts', 'status_response')).ok!
end
end
Modes yellow flash affects all signal groups
Verify that we can yellow flash causes all groups to go to state ‘c’
- Given the site_proxy is connected
- Send the control command to switch to Yellow flash
- Wait for all groups to go to group ‘c’
- Send command to switch to normal control
- Wait for all groups to switch do something else that ‘c’
View Source
it 'yellow flash affects all signal groups' do
with_site(:connected, sxl: '>=1.0.7') do |site_proxy|
timeout = RSMP::Validator.get_config('timeouts', 'yellow_flash')
site_proxy.tlc.set_functional_position('YellowFlash', within: timeout)
site_proxy.tlc.wait_for_groups 'c', timeout: timeout # c means yellow flash
startup_timeout = RSMP::Validator.get_config('timeouts', 'startup_sequence')
site_proxy.tlc.set_functional_position('NormalControl', within: startup_timeout)
site_proxy.tlc.wait_for_groups '[^c]', timeout: timeout # not c, ie. not yellow flash
end
end
Modes yellow flash can be activated with M0001
Verify that we can activate yellow flash
- Given the site_proxy is connected
- Send the control command to switch to Yellow flash
- Wait for status Yellow flash
- Send command to switch to normal control
- Wait for status “Yellow flash” = false, “Controller starting”= false, “Controller on”= true”
View Source
it 'yellow flash can be activated with M0001' do
with_site(:connected, sxl: '>=1.0.7') do |site_proxy|
yellow_flash_timeout = RSMP::Validator.get_config('timeouts', 'yellow_flash')
startup_timeout = RSMP::Validator.get_config('timeouts', 'startup_sequence')
site_proxy.tlc.set_functional_position('YellowFlash', within: yellow_flash_timeout)
site_proxy.tlc.set_functional_position('NormalControl', within: startup_timeout)
end
end
Modes yellow flash can be read with S0011
Verify status S0011 yellow flash
- Given the site_proxy is connected
- Request status
- Expect status response before timeout
View Source
it 'yellow flash can be read with S0011' do
with_site(:connected, sxl: '>=1.0.7') do |site_proxy|
status_list = if RSMP::Proxy.version_meets_requirement?(site_proxy.sxl_version, '>=1.1')
{ S0011: %i[status intersection source] }
else
{ S0011: %i[status intersection] }
end
site_proxy.request_status_and_collect(status_list,
within: RSMP::Validator.get_config('timeouts', 'status_response')).ok!
end
end