Traffic Light Controller Detector Logic
Tests
- Detector logic forcing is read with S0021
- Detector logic forcing is set with M0008
- Detector logic list size is read with S0016
- Detector logic sensitivity is read with S0031
- Detector logic status is read with S0002
Detector logic forcing is read with S0021
Verify status S0021 manually set detector logic
- Given the site is connected
- Request status
- Expect status response before timeout
View Source
Validator::Site.connected do |task,supervisor,site|
request_status_and_confirm site, "detector logic forcing",
{ S0021: [:detectorlogics] }
end
Detector logic forcing is set with M0008
- Verify connection
- Send control command to switch detector_logic= true
- Wait for status = true
View Source
Validator::Site.connected do |task,supervisor,site|
prepare task, site
Validator.get_config('components','detector_logic').keys.each_with_index do |component, indx|
force_detector_logic component, mode:'True'
wait_for_status(@task,
"detector logic #{component} to be True",
[{'sCI'=>'S0002','n'=>'detectorlogicstatus','s'=>/^.{#{indx}}1/}]
)
force_detector_logic component, mode:'False'
wait_for_status(@task,
"detector logic #{component} to be False",
[{'sCI'=>'S0002','n'=>'detectorlogicstatus','s'=>/^.{#{indx}}0/}]
)
end
end
Detector logic list size is read with S0016
Verify status S0016 number of detector logics
- Given the site is connected
- Request status
- Expect status response before timeout
View Source
Validator::Site.connected do |task,supervisor,site|
request_status_and_confirm site, "number of detector logics",
{ S0016: [:number] }
end
Detector logic sensitivity is read with S0031
Verify status S0031 trigger level sensitivity for loop detector
- Given the site is connected
- Request status
- Expect status response before timeout
View Source
Validator::Site.connected do |task,supervisor,site|
request_status_and_confirm site, "loop detector sensitivity",
{ S0031: [:status] }
end
Detector logic status is read with S0002
Verify status S0002 detector logic status
- Given the site is connected
- Request status
- Expect status response before timeout
View Source
Validator::Site.connected do |task,supervisor,site|
request_status_and_confirm site, "detector logic status",
{ S0002: [:detectorlogicstatus] }
end