Beispiel #1
0
    def __init__(self, interval):
        if _debug:
            PrairieDog._debug("__init__ %r", interval)
        RecurringTask.__init__(self, interval)

        # install it
        self.install_task()
Beispiel #2
0
    def __init__(self, interval):
        if _debug:
            TestAnalogValueTask._debug("__init__ %r", interval)
        RecurringTask.__init__(self, interval * 1000)

        # make a list of test values
        self.test_values = list(float(i * 10) for i in range(10))
Beispiel #3
0
    def __init__(self, rebootQueue, time_to_check=1800000):
        if _debug: RebootWithNoTraffic._debug('init')
        RecurringTask.__init__(self, time_to_check)

        self.time_to_check_s = time_to_check / 1000.0
        self.reboot_queue = rebootQueue

        self.install_task()
Beispiel #4
0
    def __init__(self, interval):
        if _debug: TestBinaryValueTask._debug("__init__ %r", interval)
        RecurringTask.__init__(self, interval * 1000)

        # save the interval
        self.interval = interval

        # make a list of test values
        self.test_values = [True, False]
Beispiel #5
0
    def __init__(self, dog_number, interval):
        if _debug: PrairieDog._debug("__init__ %r %r", dog_number, interval)
        RecurringTask.__init__(self, interval)

        # save the identity
        self.dog_number = dog_number

        # install it
        self.install_task()
Beispiel #6
0
    def __init__(self, dog_number, interval):
        if _debug: PrairieDog._debug("__init__ %r %r", dog_number, interval)
        RecurringTask.__init__(self, interval)

        # save the identity
        self.dog_number = dog_number

        # install it
        self.install_task()
Beispiel #7
0
    def __init__(self, interval, *args):
        if _debug: PrairieDog._debug("__init__ %r %r", interval, args)
        BIPSimpleApplication.__init__(self, *args)
        RecurringTask.__init__(self, interval * 1000)

        # no longer busy
        self.is_busy = False

        # install the task
        self.install_task()
    def __init__(self, accumulator, increment, interval):
        if _debug: PulseTask._debug("__init__ %r %r %r", accumulator, increment, interval)

        # this is a recurring task
        RecurringTask.__init__(self, interval)

        # install it
        self.install_task()

        # save the parameters
        self.accumulator = accumulator
        self.increment = increment
Beispiel #9
0
    def __init__(self, *args):
        BIPSimpleApplication.__init__(self, *args)
        RecurringTask.__init__(self, 250)
        self.request_queue = Queue()

        # assigning invoke identifiers
        self.nextInvokeID = 1

        # keep track of requests to line up responses
        self.iocb = {}
        
        self.install_task()
Beispiel #10
0
    def __init__(self, accumulator, increment, interval):
        if _debug: PulseTask._debug("__init__ %r %r %r", accumulator, increment, interval)

        # this is a recurring task
        RecurringTask.__init__(self, interval)

        # install it
        self.install_task()

        # save the parameters
        self.accumulator = accumulator
        self.increment = increment
Beispiel #11
0
    def __init__(self, heartbeat_on_time=1000, pin_board_num=11):
        if _debug: LEDHeartbeat._debug('init')
        RecurringTask.__init__(self, heartbeat_on_time)

        # self.heartbeat_on_time = heartbeat_on_time / 1000  # set in ms to coincide with interval
        self.pin_board_num = pin_board_num
        self.pin_value = False

        GPIO.setup(self.pin_board_num, GPIO.OUT)
        GPIO.output(self.pin_board_num, GPIO.LOW)

        self.install_task()
Beispiel #12
0
    def __init__(self, *args):
        BIPSimpleApplication.__init__(self, *args)
        RecurringTask.__init__(self, 250)
        self.request_queue = Queue()

        # assigning invoke identifiers
        self.nextInvokeID = 1

        # keep track of requests to line up responses
        self.iocb = {}

        self.install_task()
    def __init__(self,
                 bank_to_bcnt_queue,
                 app_dict,
                 interval,
                 max_run_time=50):
        if _debug: UpdateObjectsFromModbus._debug('init')
        RecurringTask.__init__(self, interval)

        self.bank_to_bcnt_queue = bank_to_bcnt_queue
        self.app_dict = app_dict
        self.max_run_time = max_run_time / 1000  # set in ms to coincide with interval

        # install it
        self.install_task()
Beispiel #14
0
    def __init__(self, interval):
        if _debug:
            DoSomething._debug("__init__ %r", interval)
        RecurringTask.__init__(self, interval * 1000)

        # save the interval
        self.interval = interval

        # make a list of test values
        self.test_values = [
            ("active", 1.0),
            ("inactive", 2.0),
            ("active", 3.0),
            ("inactive", 4.0),
        ]
Beispiel #15
0
    def __init__(self, interval, *args):
        if _debug: PrairieDog._debug("__init__ %r, %r", interval, args)
        BIPSimpleApplication.__init__(self, *args)
        RecurringTask.__init__(self, interval * 1000)

        # keep track of requests to line up responses
        self._request = None

        # start out idle
        self.is_busy = False
        self.point_queue = deque()
        self.response_values = []

        # install it
        self.install_task()
    def __init__(self, interval, *args):
        BIPSimpleApplication.__init__(self, *args)
        RecurringTask.__init__(self, interval * 1000)

        # Configure IoT telemetry
        self.iot_broker = 'mqtt.googleapis.com'
        self.iot_broker_port = 8883

        # Task Runner Status
        self.is_busy = False

        # Install task to queue
        self.install_task()

        # Bacnet point list
        self.bacnet_points = {}
Beispiel #17
0
    def __init__(self, i_am_callback, forward_cov_callback,
                 request_check_interval, *args):
        BIPSimpleApplication.__init__(self, *args)
        RecurringTask.__init__(self, request_check_interval)

        self.i_am_callback = i_am_callback
        self.forward_cov_callback = forward_cov_callback

        self.request_queue = Queue()

        # assigning invoke identifiers
        self.nextInvokeID = 1

        # keep track of requests to line up responses
        self.iocb = {}

        # Tracking mechanism for matching COVNotifications to a COV subscriptionContext object
        self.sub_cov_contexts = {}
        self.cov_sub_process_ID = 1

        self.install_task()
Beispiel #18
0
    def __init__(self, i_am_callback, send_cov_subscription_callback,
                 forward_cov_callback, request_check_interval, *args):
        BIPSimpleApplication.__init__(self, *args)
        RecurringTask.__init__(self, request_check_interval)

        self.i_am_callback = i_am_callback
        self.send_cov_subscription_callback = send_cov_subscription_callback
        self.forward_cov_callback = forward_cov_callback

        self.request_queue = Queue()

        # assigning invoke identifiers
        self.nextInvokeID = 1

        # keep track of requests to line up responses
        self.iocb = {}

        # Tracking mechanism for matching COVNotifications to a COV
        # subscriptionContext object
        self.sub_cov_contexts = {}
        self.cov_sub_process_ID = 1

        self.install_task()
Beispiel #19
0
    def __init__(self):
        if _debug: SampleRecurringTask._debug("__init__")
        RecurringTask.__init__(self)

        self.process_task_called = []
    def __init__(self,
                 localDevice,
                 localAddress,
                 deviceInfoCache=None,
                 aseID=None):
        if _debug:
            ReadPointListApplication._debug(
                "__init__ %r %r deviceInfoCache=%r aseID=%r", localDevice,
                localAddress, deviceInfoCache, aseID)
        global args

        Application.__init__(self, localDevice, deviceInfoCache, aseID=aseID)
        RecurringTask.__init__(self, args.interval * 1000)

        # local address might be useful for subclasses
        if isinstance(localAddress, Address):
            self.localAddress = localAddress
        else:
            self.localAddress = Address(localAddress)

        # include a application decoder
        self.asap = ApplicationServiceAccessPoint()

        # pass the device object to the state machine access point so it
        # can know if it should support segmentation
        self.smap = StateMachineAccessPoint(localDevice)

        # the segmentation state machines need access to the same device
        # information cache as the application
        self.smap.deviceInfoCache = self.deviceInfoCache

        # a network service access point will be needed
        self.nsap = NetworkServiceAccessPoint()

        # give the NSAP a generic network layer service element
        self.nse = NetworkServiceElement()
        bind(self.nse, self.nsap)

        # bind the top layers
        bind(self, self.asap, self.smap, self.nsap)

        # create a generic BIP stack, bound to the Annex J server
        # on the UDP multiplexer
        self.bip = BIPSimple()
        self.annexj = AnnexJCodec()
        self.mux = UDPMultiplexer(self.localAddress)

        # bind the bottom layers
        bind(self.bip, self.annexj, self.mux.annexJ)

        # bind the BIP stack to the network, no network number
        self.nsap.bind(self.bip)

        # install the task
        self.install_task()

        # timer
        self.start_time = None

        # pending requests
        self.pending_requests = {}
    def __init__(self):
        if _debug:
            SampleRecurringTask._debug("__init__")
        RecurringTask.__init__(self)

        self.process_task_called = 0