Specifications:

    • Traffic Light Controller IO Input is read with S0003

      Verify that we can read input status with S0003

      1. Given the site is connected

      2. When we read input with S0029

      3. Then we should receive a valid response

      
      
      14
      15
      16
      17
      # File 'spec/site/tlc/io_spec.rb', line 14
      
      Validator::Site.connected do |task,supervisor,site|
                request_status_and_confirm site, "input status",
                  { S0003: [:inputstatus] }
              end
    • Traffic Light Controller IO Input is read with S0003

      Verify that we can read input status with S0003

      1. Given the site is connected

      2. When we read input with S0029

      3. Then we should receive a valid response

      
      
      14
      15
      16
      17
      # File 'spec/site/tlc/io_spec.rb', line 14
      
      Validator::Site.connected do |task,supervisor,site|
                request_status_and_confirm site, "input status",
                  { S0003: [:inputstatus] }
              end
    • Traffic Light Controller IO Input forcing is read with S0029

      Verify that we can read forced input status with S0029

      1. Given the site is connected

      2. When we read input with S0029

      3. Then we should receive a valid response

      
      
      37
      38
      39
      40
      # File 'spec/site/tlc/io_spec.rb', line 37
      
      Validator::Site.connected do |task,supervisor,site|
                request_status_and_confirm site, "forced input status",
                  { S0029: [:status] }
              end
    • Traffic Light Controller IO Input forcing is set with M0019

      Verify that we can force input with M0019

      1. Given the site is connected

      2. And the input is forced off

      3. When we force the input on

      4. Then S0003 should show the input on

      
      
      50
      51
      52
      53
      54
      55
      56
      57
      58
      59
      60
      # File 'spec/site/tlc/io_spec.rb', line 50
      
      Validator::Site.connected do |task,supervisor,site|
                prepare task, site
                inputs = Validator.get_config('items','inputs')
                skip("No inputs configured") if inputs.nil? || inputs.empty?
                inputs.each do |input|
                  force_input input: input, status: 'True', value: 'False'
                  force_input input: input, status: 'True', value: 'True'
                ensure
                  force_input input: input, status: 'False', validate: false
                end
              end
    • Traffic Light Controller IO Input is activated with M0006

      Verify that we can activate input with M0006

      1. Given the site is connected

      2. When we activate input with M0006

      3. Then S0003 should show the input is active

      4. When we deactivate input with M0006

      5. Then S0003 should show the input is inactive

      
      
      71
      72
      73
      74
      75
      76
      77
      # File 'spec/site/tlc/io_spec.rb', line 71
      
      Validator::Site.connected do |task,supervisor,site|
                prepare task, site
                inputs = Validator.get_config('items','inputs')
                skip("No inputs configured") if inputs.nil? || inputs.empty?
                prepare task, site
                inputs.each { |input| switch_input input }
              end
    • Traffic Light Controller IO Input series is activated with M0013

      Verify that we can acticate/deactivate a series of inputs with M0013

      1. Given the site is connected

      2. Send control command to set a serie of input

      3. Wait for status = true

      
      
      85
      86
      87
      88
      89
      90
      91
      # File 'spec/site/tlc/io_spec.rb', line 85
      
      Validator::Site.connected do |task,supervisor,site|
                prepare task, site
                inputs = Validator.get_config('items','inputs')
                skip("No inputs configured") if inputs.nil? || inputs.empty?
                status = "1,3,12;5,5,10"
                set_series_of_inputs status
              end
    • Traffic Light Controller IO Input sensitivity is set with M0021

      Verify that input sensitivity can be set with M0021

      1. Given the site is connected

      2. When we set sensitivity with M0021

      3. Then we receive a confirmation

      
      
      99
      100
      101
      102
      103
      # File 'spec/site/tlc/io_spec.rb', line 99
      
      Validator::Site.connected do |task,supervisor,site|
                prepare task, site
                status = '1-50'
                set_trigger_level status
              end
    • Traffic Light Controller IO Output is read with S0004

      Verify that output status can be read with S0004

      1. Given the site is connected

      2. When we subscribe to S0004

      3. We should receive a status updated

      4. And the outputstatus attribute should be a digit string

      
      
      114
      115
      116
      117
      118
      # File 'spec/site/tlc/io_spec.rb', line 114
      
      Validator::Site.connected do |task,supervisor,site|
                prepare task, site
                request_status_and_confirm site, "output status",
                  { S0004: [:outputstatus] }
              end
    • Traffic Light Controller IO Output is read with S0004

      Verify that output status can be read with S0004

      1. Given the site is connected

      2. When we subscribe to S0004

      3. We should receive a status updated

      4. And the outputstatus attribute should be a digit string

      
      
      114
      115
      116
      117
      118
      # File 'spec/site/tlc/io_spec.rb', line 114
      
      Validator::Site.connected do |task,supervisor,site|
                prepare task, site
                request_status_and_confirm site, "output status",
                  { S0004: [:outputstatus] }
              end
    • Traffic Light Controller IO Output forcing is read with S0030

      Verify that forced output status can be read with S0030

      1. Given the site is connected

      2. Request status

      3. Expect status response before timeout

      
      
      139
      140
      141
      142
      143
      # File 'spec/site/tlc/io_spec.rb', line 139
      
      Validator::Site.connected do |task,supervisor,site|
                prepare task, site
                request_status_and_confirm site, "forced output status",
                  { S0030: [:status] }
              end
    • Traffic Light Controller IO Output forcing is set with M0020

      Verify that output can be forced with M0020

      1. Given the site is connected

      2. When we force output with M0020

      3. Wait for status = true

      
      
      151
      152
      153
      154
      155
      156
      157
      158
      159
      160
      161
      # File 'spec/site/tlc/io_spec.rb', line 151
      
      Validator::Site.connected do |task,supervisor,site|
                prepare task, site
                outputs = Validator.get_config('items','outputs')
                skip("No outputs configured") if outputs.nil? || outputs.empty?
                outputs.each do |output|
                  force_output output: output, status:'True', value:'True'
                  force_output output: output, status:'True', value:'False'
                ensure
                  force_output output: output, status:'False', validate: false
                end
             end