Sha256: c160e7cd47ada14482660468d9292e0ef7ce46c9aa47f4f1d221c6656388b29e

Contents?: true

Size: 1.05 KB

Versions: 64

Compression:

Stored size: 1.05 KB

Contents

# encoding: ascii-8bit

# Copyright 2014 Ball Aerospace & Technologies Corp.
# All Rights Reserved.
#
# This program is free software; you can modify and/or redistribute it
# under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 3 with
# attribution addendums as found in the LICENSE.txt

# This file implements an example background task

require 'cosmos/tools/cmd_tlm_server/background_task'

module Cosmos

  # ExampleBackgroundTask class
  #
  # This class is an example background task
  #
  class ExampleBackgroundTask < BackgroundTask

    def call
      sleep(5) # allow interfaces time to start
      loop do
        #Make sure we start up with 3 collects
        if (tlm('INST', 'HEALTH_STATUS', 'COLLECTS') < 3)
          begin
            cmd('INST', 'COLLECT', 'TYPE' => 'NORMAL', 'DURATION' => 1)
          rescue
            # Oh well - probably disconnected
          end
        else
          break
        end
        sleep(1)
      end
    end

  end # class ExampleBackgroundTask

end # module Cosmos

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
cosmos-4.5.2-java autohotkey/lib/example_background_task.rb
cosmos-4.5.2 autohotkey/lib/example_background_task.rb
cosmos-4.5.1-java autohotkey/lib/example_background_task.rb
cosmos-4.5.1 autohotkey/lib/example_background_task.rb
cosmos-4.5.0-java autohotkey/lib/example_background_task.rb
cosmos-4.5.0 autohotkey/lib/example_background_task.rb
cosmos-4.4.2-java autohotkey/lib/example_background_task.rb
cosmos-4.4.2 autohotkey/lib/example_background_task.rb
cosmos-4.4.1-java autohotkey/lib/example_background_task.rb
cosmos-4.4.1 autohotkey/lib/example_background_task.rb
cosmos-4.4.0-java autohotkey/lib/example_background_task.rb
cosmos-4.4.0 autohotkey/lib/example_background_task.rb
cosmos-4.3.0-java autohotkey/lib/example_background_task.rb
cosmos-4.3.0 autohotkey/lib/example_background_task.rb
cosmos-4.2.4-java autohotkey/lib/example_background_task.rb
cosmos-4.2.4 autohotkey/lib/example_background_task.rb
cosmos-4.2.3-java autohotkey/lib/example_background_task.rb
cosmos-4.2.3 autohotkey/lib/example_background_task.rb
cosmos-4.2.2-java autohotkey/lib/example_background_task.rb
cosmos-4.2.2 autohotkey/lib/example_background_task.rb