Specifications:

  • Traffic Light Controller Detector Logic list size is read with S0016

    Verify status S0016 number of detector logics

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    11
    12
    13
    14
    # File 'spec/site/tlc/detector_logics_spec.rb', line 11
    
    Validator::Site.connected do |task,supervisor,site|
            request_status_and_confirm site, "number of detector logics",
              { S0016: [:number] }
          end
  • Traffic Light Controller Detector Logic status is read with S0002

    Verify status S0002 detector logic status

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    23
    24
    25
    26
    # File 'spec/site/tlc/detector_logics_spec.rb', line 23
    
    Validator::Site.connected do |task,supervisor,site|
            request_status_and_confirm site, "detector logic status",
              { S0002: [:detectorlogicstatus] }
          end
  • Traffic Light Controller Detector Logic forcing is read with S0021

    Verify status S0021 manually set detector logic

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    35
    36
    37
    38
    # File 'spec/site/tlc/detector_logics_spec.rb', line 35
    
    Validator::Site.connected do |task,supervisor,site|
            request_status_and_confirm site, "detector logic forcing",
              { S0021: [:detectorlogics] }
          end
  • Traffic Light Controller Detector Logic forcing is set with M0008
    1. Verify connection

    2. Send control command to switch detector_logic= true

    3. Wait for status = true

    
    
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    # File 'spec/site/tlc/detector_logics_spec.rb', line 45
    
    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
  • Traffic Light Controller Detector Logic sensitivity is read with S0031

    Verify status S0031 trigger level sensitivity for loop detector

    1. Given the site is connected

    2. Request status

    3. Expect status response before timeout

    
    
    70
    71
    72
    73
    # File 'spec/site/tlc/detector_logics_spec.rb', line 70
    
    Validator::Site.connected do |task,supervisor,site|
            request_status_and_confirm site, "loop detector sensitivity",
              { S0031: [:status] }
          end