Beispiel #1
0
    def __init__(self, name, core_services):
        """
        Standard device init function.
        """
        from core.tracing import get_tracer
        self.__tracer = get_tracer("CSVDevice")
        self.__tracer.info("Initializing CSVDevice")
        self.name = name
        self.core = core_services
        self.tracer = get_tracer(name)

        self.tdict = {}
        self.prop_names = []
        self.dm = self.core.get_service("device_driver_manager")
        self.channel_manager = self.core.get_service('channel_manager')
        self.channel_database = self.channel_manager.channel_database_get()
        settings_list = [
            Setting(name='channel_pattern', type=str, required=True),
            Setting(name='delimiter',
                    type=str,
                    required=False,
                    default_value=','),
            Setting(name='column_names',
                    type=list,
                    default_value=[],
                    required=False),
        ]

        ##No properties defined at first
        property_list = []

        ## Initialize the DeviceBase interface:
        DeviceBase.__init__(self, self.name, self.core, settings_list,
                            property_list)
Beispiel #2
0
    def __init__(self, name, core_services):

        self.__name = name
        self.__core = core_services

        self.__digiweb_cb_handle = None
        self.__digiweb_xmlrpc = None

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        settings_list = [
            Setting(name='port', type=int, required=False, default_value=80),
            Setting(name='use_default_httpserver',
                    type=bool,
                    required=False,
                    default_value=True),
        ]

        ## Initialize settings:
        PresentationBase.__init__(self, name=name, settings_list=settings_list)

        ## Thread initialization:
        self.__stopevent = threading.Event()
        threading.Thread.__init__(self, name=name)
        threading.Thread.setDaemon(self, True)
    def __init__(self, name, core_services):
        """
        Create an instance of the RCIHandler.

        If the target_name is not specified, it will default to 'idigi_dia'.
        """

        self.__name = name
        self.__core = core_services
        self.__thread = None
        
        
        self.websocketCom = False
        self.retrying = False
        self.pingy = 0
        self.reconnecting = 0
        self.started = False
        self.ping_loop = False

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        settings_list = [
                         Setting(
                                 name='target_name', type=str,
                                 required=False, default_value='idigi_dia'),
                        ]

        ## Initialize settings:
        PresentationBase.__init__(self, name=name,
                                  settings_list=settings_list)
    def __init__(self, name, core_services):
        self.__name = name
        self.__core = core_services

        self.wd = None
        self.restart_counter = 0

        self.__tracer = get_tracer(name)
		
        # Settings

        # watchdog_interval: defines how often to stroke the watchdog in seconds
        # low_memory_threshold: reboot if below memory threshold (bytes)
        # auto_restart_interval: how long the device should run
        #     before auto-restart in seconds.
        
        ## Settings Table Definition:
        settings_list = [
            Setting(
                name='watchdog_interval', type=int, required=True, 
                default_value=120,
                verify_function=lambda x: x >= 60 and x <= 3600),
            Setting(
                name='low_memory_threshold', type=long, required=False,
                verify_function=lambda x: x >= 40960),
            Setting(
                name='auto_restart_interval', type=long, required=False, 
                verify_function=lambda x: x >= 600), 
        ]

        ## Initialize the ServiceBase interface:
        ServiceBase.__init__(self, self.__name, settings_list)
    def __init__(self, name, core, transport_managers, settings):
        """\
            The typical init function.
        """
        self.__name = name
        self.__core = core
        self.__transport_managers = transport_managers

        # Store a few of the settings that we use outside of init.
        self.__transport = settings['transport']
		
        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        # Get our device ID
        try:
            self.__deviceid = get_device_id()
        except:
            raise

        # Allocate the transport method we should use for this client.
        try:
            if settings['transport'] == "sms":
                self.__transport_obj = iDigiSMSTransportClient(self,
                                 self.__transport_managers['SMS'])
            else:
                raise Exception, "Unknown Transport Type"
        except:
            raise
Beispiel #6
0
 def __init__(self):
     ## Thread initialization:
     self.__stopevent = threading.Event()
     self.__queue = Queue.Queue(1)
     name = "XBeeDeviceManagerConfiguratorWorker"
     self.__tracer = get_tracer(name)
     threading.Thread.__init__(self, name=name)
Beispiel #7
0
    def __init__(self, name, core_services):

        self.__name = name
        self.__core = core_services
		
        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        # Settings:
        #
        # page: The path location to access this presentation.
        # exclude: List of strings. Channels matching the strings will not be
        #    displayed.  
        
        settings_list = [
            Setting(
                name='page', type=str, required=False,
                default_value='/idigi_dia'),
            Setting(
                name='exclude', type=list, required=False, default_value=[]),
        ]

        ## Initialize settings:
        PresentationBase.__init__(self, name=name,
                                    settings_list=settings_list)
def parse_dd(dd):
    """\
        Parse a Digi Device type value.

        Parses a given Digi Device type value gotten from a DDO DD command,
        into a tuple of (module_id, product_id).
        The top 2 bytes specify the wireless module type.
        The lower 2 bytes specify the end product type.

    """

    if isinstance(dd, str):
        try:
            # pad to four
            ln = len(dd)
            if ln > 4:
                raise ValueError("Value too long!")
            dd = '\x00' * (4 - ln) + dd
            dd = struct.unpack(">I", dd)[0]
        except:
            from core.tracing import get_tracer
            _tracer = get_tracer('prodid')
            _tracer.warning("Unable to determine device type, dd = \'" + \
                        dd + "\'. Check Xbee firmware.")
            dd = 0x00 # unspecified device/product

    if not isinstance(dd, (int, long)):
        raise TypeError("dd must be given as a string or int (given %s)" %
                        (str(type(dd))))

    module_id = dd >> 16
    product_id = dd & 0xffff

    return (module_id, product_id)
    def __init__(self, name, core_services):
        self.__name = name
        self.__core = core_services
        
        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        settings_list = [
            Setting(
                name='extended_address', type=str, required=False,
                default_value=''),
            Setting(
                name='sample_rate_ms', type=int, required=False),
            Setting(
                name='channel_settings', type=str, required=False,
                default_value="name,unit"),
            Setting(
                name='encryption', type=bool, required=False,
                default_value=False)
        ]
        ## Channel Properties Definition:
        property_list = []
        
        ## Initialize the DeviceBase interface:
        DeviceBase.__init__(self, self.__name, self.__core, settings_list, property_list)

        ## Thread initialization:
        self.__stopevent = threading.Event()
        threading.Thread.__init__(self, name=name)
        threading.Thread.setDaemon(self, True)
    def __init__(self, name, core_services):
        # Create protected dictionaries and lists
        self.name_to_signal = lockDict()
        self.name_to_type = lockDict()
        self.signal_to_name = lockDict()
        self.signal_to_units_range = lockDict()
        self.reads_reqd = lockList()
        self.signals_reqd = lockList()
        self.units_reqd = lockList()
        self.names_reqd = lockList()

        self.info_timeout_scale = 1

        self.__name = name
        self.__core = core_services

        ## Local State Variables:
        self.__xbee_manager = None

        from core.tracing import get_tracer
        self.__tracer = get_tracer("XBeeGPIOClient")

        ## Settings Table Definition:
        settings_list = [
            Setting( name='xbee_device_manager', type=str, required=True),
            Setting( name='extended_address', type=str, required=True),
            Setting( name='poll_rate', type=float, required=False),
        ]

        ## Channel Properties Definition is in start() below:
        property_list = []
                                            
        ## Initialize the DeviceBase interface:
        DeviceBase.__init__(self, self.__name, self.__core,
                                settings_list, property_list)
    def __init__(self, name, core_services, extra_settings=[],
            create_remote=True, create_local=True):
        self.__name = name
        self.__core = core_services
        self.__create_remote = create_remote
        self.__create_local = create_local

        ## Local State Variables:
        self.__xbee_manager = None

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        ## Settings Table Definition:
        settings_list = [
            Setting( name='xbee_device_manager', type=str, required=True),
            Setting( name='extended_address', type=str, required=True),
            Setting( name='endpoint', type=int, required=True),
            Setting( name='profile', type=int, required=True),
            Setting( name='cluster', type=int, required=True),
            Setting( name='local', type=str, required=False),
            Setting( name='remote', type=str, required=False),
        ]
        for s in extra_settings:
            settings_list.append(Setting(name=s['name'], type=s['type'],
                required=s['required']))
            

        ## Channel Properties Definition is in start() below:
        property_list = []
                                            
        ## Initialize the DeviceBase interface:
        DeviceBase.__init__(self, self.__name, self.__core,
                                settings_list, property_list)
    def __init__(self, name, core_services):

        self.__name = name
        self.__core = core_services
     
        self.__stopevent = threading.Event()
		
        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)
        
        # Configuration Settings:

        # server: The IP address or hostname to connect to.
        # port: The TCP port number to connect to.
        # interval: How often (in seconds) to emit CSV data 
        #    (default: 60 seconds).
        # channels: A list of channels to include in the data set. If this 
        #    setting is not given, all channels will be included.
        settings_list = [
                Setting(name="server", type=str, required=True),
                Setting(name="port", type=int, required=True),
                Setting(name='interval', type=int, required=False, default_value=60),
                Setting(name="channels", type=list, required=False, default_value=[]),
        ]
                                                 
        PresentationBase.__init__(self, name=name, settings_list=settings_list)

        threading.Thread.__init__(self, name=name)
        threading.Thread.setDaemon(self, True)
    def __init__(self, name, core_services):

        self.__name = name
        self.__core = core_services

        self.__digiweb_cb_handle = None
        self.__digiweb_xmlrpc = None

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        settings_list = [
            Setting(
              name='port', type=int, required=False, default_value=80),
            Setting(
              name='use_default_httpserver', type=bool, required=False,
              default_value=True),
        ]


        ## Initialize settings:
        PresentationBase.__init__(self, name=name,
                                  settings_list=settings_list)

        ## Thread initialization:
        self.__stopevent = threading.Event()
        threading.Thread.__init__(self, name=name)
        threading.Thread.setDaemon(self, True)
    def __init__(self, name, core_services):
        self.__name = name
        self.__core = core_services

        self.wd = None
        self.restart_counter = 0

        self.__tracer = get_tracer(name)

        # Settings

        # watchdog_interval: defines how often to stroke the watchdog in seconds
        # low_memory_threshold: reboot if below memory threshold (bytes)
        # auto_restart_interval: how long the device should run
        #     before auto-restart in seconds.

        ## Settings Table Definition:
        settings_list = [
            Setting(name='watchdog_interval',
                    type=int,
                    required=True,
                    default_value=120,
                    verify_function=lambda x: x >= 60 and x <= 3600),
            Setting(name='low_memory_threshold',
                    type=long,
                    required=False,
                    verify_function=lambda x: x >= 40960),
            Setting(name='auto_restart_interval',
                    type=long,
                    required=False,
                    verify_function=lambda x: x >= 600),
        ]

        ## Initialize the ServiceBase interface:
        ServiceBase.__init__(self, self.__name, settings_list)
Beispiel #15
0
    def __init__(self, name, core, source_channel, filter_channel):
        self._name = name
        self._core = core
        self.source_channel = source_channel
        self.filter_channel = filter_channel
        self._target_channel_name = filter_channel.name
        self._tracer = get_tracer(name)

        dm = self._core.get_service("device_driver_manager")
        target_device_name = source_channel.name().split('.')[0]
        target_device = dm.instance_get(target_device_name)
        self._target_device = target_device

        cm = self._core.get_service("channel_manager")
        cp = cm.channel_publisher_get()
        cp.subscribe(source_channel.name(), self._receive)

        # Attempt to force a copy of the source's current value into our value.
        try:
            self._receive(source_channel)
        except:
            pass

        # Override the default refresh callback with our more specific one.
        filter_channel.device_refresh_cb = self.property_refresh
    def __init__(self, name, core, transport_managers, settings):

        self.__name = name
        self.__core = core
        self.__transport_managers = transport_managers

        # Store a few of the settings that we use outside of init.
        self.__update_message = settings['update_message']
        self.__alarm_message = settings['alarm_message']
        self.__command_access = settings['command_access']
        self.__transport = settings['transport']

        # Get our device ID
        self.__deviceid = get_device_id()
		
        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        # Allocate the transport method we should use for this client.
        try:
            if settings['transport'] == "sms":
                self.__transport_obj = SMSTransportClient(self,
                                 self.__transport_managers['SMS'],
                                 settings['number'])
            else:
                raise Exception, "Unknown Transport Type"
        except:
            raise
Beispiel #17
0
    def __init__(self, name, core, settings, properties):
        self._name = name
        self._core = core
        self._scheduler = self._core.get_service("scheduler")

        self._tracer = get_tracer(name)
        self._filter_channel_object = None
        self._filter_objects = []

        ## Settings Table Definition:
        settings_list = [
            Setting(name='target_channel_filter',
                    type=str,
                    required=False,
                    default_value='*.*'),
            Setting(name='channel_name_override',
                    type=str,
                    required=False,
                    default_value=""),
        ]
        settings.extend(settings_list)

        property_list = []
        properties.extend(property_list)

        ## Initialize the ServiceBase interface:
        DeviceBase.__init__(self, self._name, self._core, settings, properties)
    def __init__(self, binding=(), setting_defs=[]):
        # Add the binding:
        if binding in self._settings_global_bindings:
            if not self in self._settings_global_bindings:
                self._settings_global_bindings[binding].append(self)
        else:
            self._settings_global_bindings[binding] = [self]

        # Local (non-shared state) variables:
        self._settings_binding = binding
        self._settings_definitions = {}
        self._settings_running_registry = \
            self._settings_global_running_registry
        self._settings_pending_registry = \
            self.__get_local_registry_ref(
                self._settings_global_pending_registry, binding)
        self._settings_running_registry = \
            self.__get_local_registry_ref(
                self._settings_global_running_registry, binding)

        from core.tracing import get_tracer
        self.__tracer = get_tracer("SettingsBase")

        # Load settings into self._settings_definitions:
        for setting in setting_defs:
            self._settings_definitions[setting.name] = setting

        # Attempt to apply current pending settings:
        accepted, rejected, not_found = self.apply_settings()

        if rejected:
            raise ValueError, "ERROR: Invalid settings: %s" % rejected

        if not_found:
            raise SettingNotFound, "ERROR: Missing settings: %s" % not_found
    def __init__(self, binding=(), setting_defs = []):
        # Add the binding:
        if binding in self._settings_global_bindings:
            if not self in self._settings_global_bindings:
                self._settings_global_bindings[binding].append(self)
        else:
            self._settings_global_bindings[binding] = [self]

        # Local (non-shared state) variables:
        self._settings_binding = binding
        self._settings_definitions = { }
        self._settings_running_registry = \
            self._settings_global_running_registry
        self._settings_pending_registry = \
            self.__get_local_registry_ref(
                self._settings_global_pending_registry, binding)
        self._settings_running_registry = \
            self.__get_local_registry_ref(
                self._settings_global_running_registry, binding)

        from core.tracing import get_tracer
        self.__tracer = get_tracer("SettingsBase")

        # Load settings into self._settings_definitions:
        for setting in setting_defs:
            self._settings_definitions[setting.name] = setting

        # Attempt to apply current pending settings:
        accepted, rejected, not_found = self.apply_settings()

        if rejected:
            raise ValueError, "ERROR: Invalid settings: %s" % rejected

        if not_found:
            raise SettingNotFound, "ERROR: Missing settings: %s" % not_found
 def __init__(self):
     ## Thread initialization:
     self.__stopevent = threading.Event()
     self.__queue = Queue.Queue(1)
     name = "XBeeDeviceManagerConfiguratorWorker"
     self.__tracer = get_tracer(name)
     threading.Thread.__init__(self, name=name)
Beispiel #21
0
    def __init__(self, name, core_services):

        self.__name = name
        self.__core = core_services

        self.__stopevent = threading.Event()

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        # Configuration Settings:

        # server: The IP address or hostname to connect to.
        # port: The TCP port number to connect to.
        # interval: How often (in seconds) to emit CSV data
        #    (default: 60 seconds).
        # channels: A list of channels to include in the data set. If this
        #    setting is not given, all channels will be included.
        settings_list = [
            Setting(name="server", type=str, required=True),
            Setting(name="port", type=int, required=True),
            Setting(name='interval',
                    type=int,
                    required=False,
                    default_value=60),
            Setting(name="channels",
                    type=list,
                    required=False,
                    default_value=[]),
        ]

        PresentationBase.__init__(self, name=name, settings_list=settings_list)

        threading.Thread.__init__(self, name=name)
        threading.Thread.setDaemon(self, True)
Beispiel #22
0
def parse_dd(dd):
    """\
        Parse a Digi Device type value.

        Parses a given Digi Device type value gotten from a DDO DD command,
        into a tuple of (module_id, product_id).
        The top 2 bytes specify the wireless module type.
        The lower 2 bytes specify the end product type.

    """

    if isinstance(dd, str):
        try:
            # pad to four
            ln = len(dd)
            if ln > 4:
                raise ValueError("Value too long!")
            dd = '\x00' * (4 - ln) + dd
            dd = struct.unpack(">I", dd)[0]
        except:
            from core.tracing import get_tracer
            _tracer = get_tracer('prodid')
            _tracer.warning("Unable to determine device type, dd = \'" + \
                        dd + "\'. Check Xbee firmware.")
            dd = 0x00  # unspecified device/product

    if not isinstance(dd, (int, long)):
        raise TypeError("dd must be given as a string or int (given %s)" %
                        (str(type(dd))))

    module_id = dd >> 16
    product_id = dd & 0xffff

    return (module_id, product_id)
    def __init__(self, name, core_services, settings, properties):
        self._name = name
        self._core = core_services
        self._tracer = get_tracer(name)

        # Initialize settings:
        ## Settings Table Definition:
        settings_list = [
            Setting(
                name='trace', type=str, required=False,
                default_value=self.DEF_TRACE),
        ]
        # Add our settings_list entries into the settings passed to us.
        settings = self.merge_settings(settings, settings_list)

        self.__settings = settings
        SettingsBase.__init__(self, binding=("devices", (name,), "settings"),
                                    setting_defs=settings)

        # Initialize properties:
        self.__properties = { }
        for property in properties:
            self.add_property(property)

        # pre_start - check if special trace level requested
        trace = SettingsBase.get_setting(self, "trace")
        try:
            self._tracer.set_level(trace)
        except:
            self._tracer.warning("Ignoring bad trace level \'%s\' for this device", trace)

        self._tracer.calls("DeviceBase.__init__()")
Beispiel #24
0
    def __init__(self, name, core_services):
        # Create protected dictionaries and lists
        self.name_to_signal = lockDict()
        self.name_to_type = lockDict()
        self.signal_to_name = lockDict()
        self.signal_to_units_range = lockDict()
        self.reads_reqd = lockList()
        self.signals_reqd = lockList()
        self.units_reqd = lockList()
        self.names_reqd = lockList()

        self.info_timeout_scale = 1

        self.__name = name
        self.__core = core_services

        ## Local State Variables:
        self.__xbee_manager = None

        from core.tracing import get_tracer
        self.__tracer = get_tracer("XBeeGPIOClient")

        ## Settings Table Definition:
        settings_list = [
            Setting(name='xbee_device_manager', type=str, required=True),
            Setting(name='extended_address', type=str, required=True),
            Setting(name='poll_rate', type=float, required=False),
        ]

        ## Channel Properties Definition is in start() below:
        property_list = []

        ## Initialize the DeviceBase interface:
        DeviceBase.__init__(self, self.__name, self.__core, settings_list,
                            property_list)
    def __init__(self, name, core_services, settings_in=None, property_in=None):

        self._my_tracer = get_tracer('MBusH8036(%s)' % name)

        ## Local State Variables:
        self._H8036 = VerisH8036()

        # init the My-Gang logic - chain multiple 
        self.init_gang()

        ## Settings Table Definition:
        settings_list = [
            # Setting( name='sample_rate_sec' is in Robust_Device

            Setting(
                name='channels', type=list, required=False,
                default_value=self.ENB_CHN_DEFAULTS),

            Setting(
                name='unit_id', type=int, required=False,
                default_value=self.DEF_UNIT_ID),
        ]

        settings_out = self._safely_merge_lists(settings_in, settings_list)

        ## Channel Properties Definition: assume ecm1240
        # property_list = [ ]

        # Add our property_list entries to the properties passed to us.
        # properties = self._safely_merge_lists(properties, property_list)
        property_out = property_in

        ## Initialize the DeviceBase interface:
        RobustBase.__init__(self, name, core_services, settings_out, property_out)
        return
    def __init__(self, name, core_services, settings=None):
        """
        Create an instance of the RCIHandler.

        If the target_name is not specified, it will default to 'idigi_dia'.
        """

        self._name = name
        self._core = core_services
        self._handle = None
        self._tracer = get_tracer(name)

        settings_list = [
            Setting(name='target_name',
                    type=str,
                    required=False,
                    default_value='idigi_dia'),
        ]

        if settings is not None:
            settings.extend(settings_list)
        else:
            settings = settings_list

        ## Initialize settings:
        PresentationBase.__init__(self, name=name, settings_list=settings)
Beispiel #27
0
    def __init__(self, name, core_services):

        self.__name = name
        self.__core = core_services

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        # Settings:
        #
        # page: The path location to access this presentation.
        # exclude: List of strings. Channels matching the strings will not be
        #    displayed.

        settings_list = [
            Setting(name='page',
                    type=str,
                    required=False,
                    default_value='/idigi_dia'),
            Setting(name='exclude',
                    type=list,
                    required=False,
                    default_value=[]),
        ]

        ## Initialize settings:
        PresentationBase.__init__(self, name=name, settings_list=settings_list)
Beispiel #28
0
    def __init__(self, name, core_services):
        self.__name = name
        self.__core = core_services
        self.__tracer = get_tracer(name)
        self.__xbee_manager = None

        ## Initialize the XBeeBase interface:
        XBeeBase.__init__(self, self.__name, self.__core, [], [])
    def __init__(self, name, core_services):
        self.__name = name
        self.__core = core_services

        self.targets = {}

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        ## Settings Table Definition:
        settings_list = [

            Setting(name=PROP_PRINTF, type=str, required=False, default_value=PROP_MINUTE),

            Setting( # how often to check for work
                name=PROP_TICK_RATE, type=int, required=False,
                default_value=DEFAULT_TICK_RATE,
                verify_function=lambda x: x > 0.0),
        ]

        ## Channel Properties Definition:
        property_list = [
            # gettable properties

            ChannelSourceDeviceProperty(name=PROP_15SEC, type=tuple,
                initial=Sample(timestamp=0, value=(0,None)),
                perms_mask=DPROP_PERM_GET),

            ChannelSourceDeviceProperty(name=PROP_MINUTE, type=tuple,
                initial=Sample(timestamp=0, value=(0,None)),
                perms_mask=DPROP_PERM_GET),

            ChannelSourceDeviceProperty(name=PROP_15MIN, type=tuple,
                initial=Sample(timestamp=0, value=(0,None)),
                perms_mask=DPROP_PERM_GET),

            ChannelSourceDeviceProperty(name=PROP_HOUR, type=tuple,
                initial=Sample(timestamp=0, value=(0,None)),
                perms_mask=DPROP_PERM_GET),

            ChannelSourceDeviceProperty(name=PROP_SIXHR, type=tuple,
                initial=Sample(timestamp=0, value=(0,None)),
                perms_mask=DPROP_PERM_GET),

            ChannelSourceDeviceProperty(name=PROP_DAY, type=tuple,
                initial=Sample(timestamp=0, value=(0,None)),
                perms_mask=DPROP_PERM_GET),

        ]

        ## Initialize the DeviceBase interface:
        DeviceBase.__init__(self, self.__name, self.__core,
                                settings_list, property_list)

        ## Thread initialization:
        self.__stopevent = threading.Event()
        threading.Thread.__init__(self, name=name)
        threading.Thread.setDaemon(self, True)
    def __init__(self, name, core_services):
        self.__name = name
        self.__core = core_services

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)
        
        
        self.main_addr = "mainMistaway_" + gw_extended_address()

        ## Local State Variables:
        self.__xbee_manager = None
        self.__settings_ctx = \
                    core_services.get_service("settings_base").get_context()
        self.__purgatory = []
        self.__callbacks = []

        ## Settings Table Definition:

        settings_list = [
            Setting(
                name='xbee_device_manager', type=str, required=True),

            # Contains the device driver settings for every device
            # that is intended to be auto enumerated.
            # The 'name: tag' is used as part of the new device name
            Setting(name='devices', type=dict, required=True,
                    default_value=[]),

            Setting(
                name='discover_rate', type=int, required=False,
                default_value=600,
                verify_function=lambda x: x >= 1 and x <= 86400),

            # Shortens the discovered device names, when NI is not used,
            # to only include the last two octets of the XBee MAC Address.
            # User must confirm uniqueness of these 2 octets.
            # Example: 'aio_[00:13:a2:00:40:52:e0:fc]!'
            # becomes just 'aio_E0_FC'
            Setting(name='short_names', type=bool, required=False,
                    default_value=False),
        ]

        ## Channel Properties Definition:
        property_list = [

        ]

        self.__add_device_queue = Queue.Queue()

        ## Initialize the DeviceBase interface:
        DeviceBase.__init__(self, self.__name, self.__core,
                                settings_list, property_list)

        ## Thread initialization:
        self.__stopevent = threading.Event()
        threading.Thread.__init__(self, name=name)
        threading.Thread.setDaemon(self, True)
    def __init__(self, ext_addr):
        # format for below: { 'XX': (value, method, failure_callback), ... }
        self.__parameters = {}
        self.__pending_parameters = {}

        from core.tracing import get_tracer
        self.__tracer = get_tracer('XBeeConfigBlockDDO')

        AbstractXBeeConfigBlockDDO.__init__(self, ext_addr)
    def __init__(self, core_services):
        self.__core = core_services
        self.__core.set_service("logging_manager", self)

        from core.tracing import get_tracer
        self.__tracer = get_tracer('LoggingManager')

        # Initialize our base class:
        AbstractServiceManager.__init__(self, core_services, ('loggers',))
    def __init__(self, core_services):
        self.__core = core_services
        self.__new_channel_listeners = set()
        self.__channel_listeners = {}
        self.__rlock = threading.RLock()
        self.__logging_manager = None

        from core.tracing import get_tracer
        self.__tracer = get_tracer("ChannelPublisher")
Beispiel #34
0
 def __init__(self, name, core, source_channel, filter_channel,
              upper_threshold, lower_threshold,
              disable_upper, disable_lower):
     self._tracer = get_tracer(name)
     self._lower_threshold = lower_threshold
     self._upper_threshold = upper_threshold
     self._disable_lower = disable_lower
     self._disable_upper = disable_upper
     FilterChannelBase.__init__(self, name, core, source_channel, filter_channel)
    def __init__(self, core_services):
        self.__core = core_services
        self.__core.set_service("logging_manager", self)

        from core.tracing import get_tracer
        self.__tracer = get_tracer('LoggingManager')

        # Initialize our base class:
        AbstractServiceManager.__init__(self, core_services, ('loggers', ))
 def __init__(self, name, core, source_channel, filter_channel,
              interval, trigger_value, scheduler):
     self._tracer = get_tracer(name)
     self._interval = interval
     self._trigger_condition = trigger_value
     self._scheduled_event_handle = None
     self._scheduler = scheduler
     self._scheduler_lock = Lock()
     FilterChannelBase.__init__(self, name, core, source_channel, filter_channel)
    def __init__(self, core_services):
        self.__core = core_services
        self.__new_channel_listeners = set()
        self.__channel_listeners = {}
        self.__rlock = threading.RLock()
        self.__logging_manager = None
		
        from core.tracing import get_tracer
        self.__tracer = get_tracer("ChannelPublisher")
    def __init__(self, ext_addr):
        # format for below: { 'XX': (value, method, failure_callback), ... }
        self.__parameters = { }
        self.__pending_parameters = { }

        from core.tracing import get_tracer
        self.__tracer = get_tracer('XBeeConfigBlockDDO')

        AbstractXBeeConfigBlockDDO.__init__(self, ext_addr)
 def __init__(self, name, core, source_channel, filter_channel,
              interval, trigger_value, scheduler):
     self._tracer = get_tracer(name)
     self._interval = interval
     self._trigger_condition = trigger_value
     self._scheduled_event_handle = None
     self._scheduler = scheduler
     self._scheduler_lock = Lock()
     FilterChannelBase.__init__(self, name, core, source_channel, filter_channel)
    def __init__(self, name, core_services):
        self.__name = name
        self.__core = core_services

        ## Local State Variables:
        self.__response_buffer = ""
        self.__request_events = []
        self.__request_retry_events = []

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        ## Settings Table Definition:
        settings_list = [
            Setting(
                name='poll_rate_sec', type=int, required=False,
                default_value=5,
                verify_function=lambda x: x >= 0),
            Setting(
                name='bus_id', type=int, required=False,
                default_value=0,
                verify_function=lambda x: x >= 0),
        ]

        ## Channel Properties Definition:
        property_list = [
            # gettable properties
            ChannelSourceDeviceProperty(name="strength", type=int,
                initial=Sample(timestamp=0, value=0, unit="%"),
                perms_mask=DPROP_PERM_GET, options=DPROP_OPT_AUTOTIMESTAMP),

            ChannelSourceDeviceProperty(name="target_detected", type=Boolean,
                initial=Sample(timestamp=0,
                    value=Boolean(False, style=STYLE_YESNO)),
                perms_mask=DPROP_PERM_GET, options=DPROP_OPT_AUTOTIMESTAMP),

            ChannelSourceDeviceProperty(name="error_flag", type=Boolean,
                initial=Sample(timestamp=0,
                    value=Boolean(False, style=STYLE_YESNO)),
                perms_mask=DPROP_PERM_GET, options=DPROP_OPT_AUTOTIMESTAMP),

            ChannelSourceDeviceProperty(name="range", type=int,
                initial=Sample(timestamp=0, value=0, unit="in"),
                perms_mask=DPROP_PERM_GET, options=DPROP_OPT_AUTOTIMESTAMP),

            ChannelSourceDeviceProperty(name="temperature", type=float,
                initial=Sample(timestamp=0, value=0.0, unit="C"),
                perms_mask=DPROP_PERM_GET, options=DPROP_OPT_AUTOTIMESTAMP),
        ]

        ## Initialize the DeviceBase interface:
        DeviceBase.__init__(self, self.__name, self.__core,
                                settings_list, property_list)

        ## Initialize the serial interface:
        Serial.__init__(self, 0, 19200, timeout = 0)
    def __init__(self, name, core_services):
        self.__name = name
        self.__core = core_services

        ## Local State Variables:
        self.__response_buffer = ""
        self.__request_events = []
        self.__request_retry_events = []

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        ## Settings Table Definition:
        settings_list = [
            Setting(
                name='poll_rate_sec', type=int, required=False,
                default_value=5,
                verify_function=lambda x: x >= 0),
            Setting(
                name='bus_id', type=int, required=False,
                default_value=0,
                verify_function=lambda x: x >= 0),
        ]

        ## Channel Properties Definition:
        property_list = [
            # gettable properties
            ChannelSourceDeviceProperty(name="strength", type=int,
                initial=Sample(timestamp=0, value=0, unit="%"),
                perms_mask=DPROP_PERM_GET, options=DPROP_OPT_AUTOTIMESTAMP),

            ChannelSourceDeviceProperty(name="target_detected", type=Boolean,
                initial=Sample(timestamp=0,
                    value=Boolean(False, style=STYLE_YESNO)),
                perms_mask=DPROP_PERM_GET, options=DPROP_OPT_AUTOTIMESTAMP),

            ChannelSourceDeviceProperty(name="error_flag", type=Boolean,
                initial=Sample(timestamp=0,
                    value=Boolean(False, style=STYLE_YESNO)),
                perms_mask=DPROP_PERM_GET, options=DPROP_OPT_AUTOTIMESTAMP),

            ChannelSourceDeviceProperty(name="range", type=int,
                initial=Sample(timestamp=0, value=0, unit="in"),
                perms_mask=DPROP_PERM_GET, options=DPROP_OPT_AUTOTIMESTAMP),

            ChannelSourceDeviceProperty(name="temperature", type=float,
                initial=Sample(timestamp=0, value=0.0, unit="C"),
                perms_mask=DPROP_PERM_GET, options=DPROP_OPT_AUTOTIMESTAMP),
        ]

        ## Initialize the DeviceBase interface:
        DeviceBase.__init__(self, self.__name, self.__core,
                                settings_list, property_list)

        ## Initialize the serial interface:
        Serial.__init__(self, 0, 19200, timeout = 0)
 def __init__(self, name, core, source_channel, filter_channel,
              threshold, readings, continuous):
     self._tracer = get_tracer(name)
     self._filter_channel = filter_channel
     self._threshold = threshold
     self._readings = readings
     self._continuous = continuous
     self.__above_count = 0
     self.__below_count = 0
     FilterChannelBase.__init__(self, name, core, source_channel, filter_channel)
    def __init__(self, name, core_services):
        self.__name = name
        self.__core_services = core_services

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        settings_list = []

        LoggerBase.__init__(self, name=name, settings_list=settings_list)
 def __init__(self, name, core_services):
     self.__name = name
     self.__core_services = core_services
     
     from core.tracing import get_tracer
     self.__tracer = get_tracer(name)
     
     settings_list = [ ]
     
     LoggerBase.__init__(self, name=name, settings_list=settings_list)
    def __init__(self, name, core_services, property_list):
        self.__name = name
        self.__core = core_services
        self.__property_list = property_list

        from core.tracing import get_tracer
        self._tracer = get_tracer(name)

        ## Local State Variables:
        self.__xbee_manager = None

        self.sensor = None

        # Settings
        #
        # xbee_device_manager: must be set to the name of an XBeeDeviceManager
        #                      instance.
        # extended_address: the extended address of the XBee Watchport Sensor
        #                   device you would like to monitor.
        # sleep: True/False setting which determines if we should put the
        #        device to sleep between samples.
        # sample_rate_ms: the sample rate of the XBee adapter.
        # enable_low_battery: Force an adapter to enable support for
        #                     battery-monitor pin.
        #                     It should be only enabled if adapter is using
        #                     internal batteries. Optional, Off by default.

        settings_list = [
            Setting(
                name='sleep', type=bool, required=False,
                default_value=False),
            Setting(
                name='sample_rate_ms', type=int, required=True,
                default_value=60000,
                verify_function=lambda x: x >= 0 and x <= CYCLIC_SLEEP_EXT_MAX_MS),

            # This setting is provided for advanced users, it is not required:
            Setting(
                name='awake_time_ms', type=int, required=False,
                default_value=5000,
                verify_function=lambda x: x >= 0 and x <= 0xffff),
            Setting(
                name='enable_low_battery', type=Boolean, required=False,
                default_value=Boolean("Off", STYLE_ONOFF)),
        ]

        ## Channel Properties Definition:
        __property_list_internal = [

        ]
        property_list.extend(__property_list_internal)

        ## Initialize the XBeeBase interface:
        XBeeBase.__init__(self, self.__name, self.__core,
                                settings_list, property_list)
    def __init__(self, name, core_services):
        self.__name = name
        self.__core = core_services

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        settings_list = [
            Setting(name="SMS",
                    type=dict,
                    required=False,
                    default_value={},
                    verify_function=self.__verify_SMS),
            Setting(name="Iridium",
                    type=dict,
                    required=False,
                    default_value={},
                    verify_function=self.__verify_iridium),
            Setting(name="clients",
                    type=dict,
                    required=False,
                    default_value={},
                    verify_function=self.__verify_clients),
            Setting(name="updates",
                    type=dict,
                    required=False,
                    default_value={},
                    verify_function=self.__verify_updates),
            Setting(name="alarms",
                    type=dict,
                    required=False,
                    default_value={},
                    verify_function=self.__verify_alarms),
        ]

        PresentationBase.__init__(self, name=name, settings_list=settings_list)

        # Our dictionary of Transport Managers.
        self.__transport_managers = {}

        # Our cached list of clients.
        self.client_list = []

        # The list of DIA channels that have matched our filters and so we have
        # subscribed to getting channel updates from DIA as they come in.
        self.__channels_being_watched = []

        # The following list will contain a list of messages that should
        # be sent out at the next interval time.

        self.__coalesce_list = []

        self.__stopevent = threading.Event()
        threading.Thread.__init__(self, name=name)
        threading.Thread.setDaemon(self, True)
    def __init__(self, name, core_services, property_list):
        self.__name = name
        self.__core = core_services
        self.__property_list = property_list

        from core.tracing import get_tracer
        self._tracer = get_tracer(name)

        ## Local State Variables:
        self.__xbee_manager = None

        self.sensor = None

        # Settings
        #
        # xbee_device_manager: must be set to the name of an XBeeDeviceManager
        #                      instance.
        # extended_address: the extended address of the XBee Watchport Sensor
        #                   device you would like to monitor.
        # sleep: True/False setting which determines if we should put the
        #        device to sleep between samples.
        # sample_rate_ms: the sample rate of the XBee adapter.
        # enable_low_battery: Force an adapter to enable support for
        #                     battery-monitor pin.
        #                     It should be only enabled if adapter is using
        #                     internal batteries. Optional, Off by default.

        settings_list = [
            Setting(
                name='sleep', type=bool, required=False,
                default_value=False),
            Setting(
                name='sample_rate_ms', type=int, required=True,
                default_value=60000,
                verify_function=lambda x: x >= 0 and x <= CYCLIC_SLEEP_EXT_MAX_MS),

            # This setting is provided for advanced users, it is not required:
            Setting(
                name='awake_time_ms', type=int, required=False,
                default_value=5000,
                verify_function=lambda x: x >= 0 and x <= 0xffff),
            Setting(
                name='enable_low_battery', type=Boolean, required=False,
                default_value=Boolean("Off", STYLE_ONOFF)),
        ]

        ## Channel Properties Definition:
        __property_list_internal = [

        ]
        property_list.extend(__property_list_internal)

        ## Initialize the XBeeBase interface:
        XBeeBase.__init__(self, self.__name, self.__core,
                                settings_list, property_list)
    def __init__(self, name, core_services):
        self.__name = name
        self.__core = core_services

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)
		
        settings_list = [ ]

        ## Initialize settings:
        ServiceBase.__init__(self, name=name, settings_list=settings_list)
    def __init__(self):
        self.__state = self.STATE_INITIALIZING
        self.__event_specs = []
        self.__config_blocks = []
        self.__config_sched_handle = None
        self.__ext_addr = None      # Set by xbee_device_event_spec_add()
        self.__config_attempts = 0
        self.__last_heard_from = None

        from core.tracing import get_tracer
        self.__tracer = get_tracer('XbeeDeviceState')
    def __init__(self, name, core_services):
        self.__name = name
        self.__core = core_services

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        settings_list = []

        ## Initialize settings:
        ServiceBase.__init__(self, name=name, settings_list=settings_list)
    def __init__(self, name, core_services):
        """\
            Initialize an XBee Wall Router instance.

            Parameters:
                * name - The name of the XBee Wall Router instance.
                * core_services - The Core services instance.

        """

        self.__name = name
        self.__core = core_services

        ## Local State Variables:
        self.__xbee_manager = None
        
        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        # Settings:
        #
        # xbee_device_manager: must be set to the name of an XBeeDeviceManager
        #                      instance.
        # extended_address: is the extended address of the XBee device you
        #                   would like to monitor.
        # sample_rate_ms:   is the sample rate of the XBee Wall Router.

        settings_list = [
            Setting(
                name = 'xbee_device_manager', type = str, required = False,
                default_value = ''),
            Setting(
                name = 'extended_address', type = str, required = False,
                default_value = ''),
            Setting(
                name = 'sample_rate_ms', type = int, required = False,
                default_value = 1000,
                verify_function = lambda x: x > 0 and x < 0xffff),
        ]

        ## Channel Properties Definition:
        property_list = [
            # gettable properties
            ChannelSourceDeviceProperty(name = "light", type = float,
                initial = Sample(timestamp = 0, unit = "brightness", value = 0.0),
                perms_mask = DPROP_PERM_GET, options = DPROP_OPT_AUTOTIMESTAMP),
            ChannelSourceDeviceProperty(name = "temperature", type = float,
                initial = Sample(timestamp = 0, unit = "C", value = 0.0),
                perms_mask = DPROP_PERM_GET, options = DPROP_OPT_AUTOTIMESTAMP),
        ]

        ## Initialize the XBeeBase interface:
        XBeeBase.__init__(self, self.__name, self.__core,
                                settings_list, property_list)
    def __init__(self, name, core_services):
        self.__name = name
        self.__core = core_services

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        ## Local State Variables:
        self.__xbee_manager = None
        self.__settings_ctx = \
                    core_services.get_service("settings_base").get_context()
        self.__purgatory = []
        self.__callbacks = []

        ## Settings Table Definition:

        settings_list = [
            Setting(name='xbee_device_manager', type=str, required=True),

            # Contains the device driver settings for every device
            # that is intended to be auto enumerated.
            # The 'name: tag' is used as part of the new device name
            Setting(name='devices', type=dict, required=True,
                    default_value=[]),
            Setting(name='discover_rate',
                    type=int,
                    required=False,
                    default_value=600,
                    verify_function=lambda x: x >= 60 and x <= 86400),

            # Shortens the discovered device names, when NI is not used,
            # to only include the last two octets of the XBee MAC Address.
            # User must confirm uniqueness of these 2 octets.
            # Example: 'aio_[00:13:a2:00:40:52:e0:fc]!'
            # becomes just 'aio_E0_FC'
            Setting(name='short_names',
                    type=bool,
                    required=False,
                    default_value=False),
        ]

        ## Channel Properties Definition:
        property_list = []

        self.__add_device_queue = Queue.Queue()

        ## Initialize the DeviceBase interface:
        DeviceBase.__init__(self, self.__name, self.__core, settings_list,
                            property_list)

        ## Thread initialization:
        self.__stopevent = threading.Event()
        threading.Thread.__init__(self, name=name)
        threading.Thread.setDaemon(self, True)
    def __init__(self):
        self.__state = self.STATE_INITIALIZING
        self.__event_specs = []
        self.__config_blocks = []
        self.__config_sched_handle = None
        self.__ext_addr = None  # Set by xbee_device_event_spec_add()
        self.__config_attempts = 0
        self.__last_heard_from = None

        from core.tracing import get_tracer
        self.__tracer = get_tracer('XbeeDeviceState')
 def __init__(self, name, core, source_channel, filter_channel, threshold,
              readings, continuous):
     self._tracer = get_tracer(name)
     self._filter_channel = filter_channel
     self._threshold = threshold
     self._readings = readings
     self._continuous = continuous
     self.__above_count = 0
     self.__below_count = 0
     FilterChannelBase.__init__(self, name, core, source_channel,
                                filter_channel)
    def __init__(self, name, core_services):
        self.__name = name
        self.__core = core_services

        ## Settings Table Definition:
        settings_list = [
            Setting(
                name='prefix_init', type=str, required=False, 
                default_value="Hello ",
                verify_function=lambda x: len(x) >= 1),
            Setting(
                name='suffix_init', type=str, required=False, 
                default_value="World!",
                verify_function=lambda x: len(x) >= 1),
            Setting(
                name='update_rate', type=float, required=False, 
                default_value=1.0,
                verify_function=lambda x: x > 0.0),
        ]

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)
        
        ## Channel Properties Definition:
        property_list = [
            # gettable properties

            ChannelSourceDeviceProperty(name="prefix_string", type=str,
                initial=Sample(timestamp=0, value="Hello "),
                perms_mask=DPROP_PERM_GET, options=DPROP_OPT_AUTOTIMESTAMP),
                
            ChannelSourceDeviceProperty(name="xtended_string", type=str,
                initial=Sample(timestamp=0, value="Hello World!"),
                perms_mask=DPROP_PERM_GET, options=DPROP_OPT_AUTOTIMESTAMP),
                

            # gettable & settable properties
            ChannelSourceDeviceProperty(name="suffix_string", type=str,
                initial=Sample(timestamp=0, value="World!"),
                perms_mask=(DPROP_PERM_GET|DPROP_PERM_SET),
                options=DPROP_OPT_AUTOTIMESTAMP,
                set_cb=self.prop_set_suffix),
                
        ]
                                            
        ## Initialize the DeviceBase interface:
        DeviceBase.__init__(self, self.__name, self.__core,
                                settings_list, property_list)

        ## Thread initialization:
        self.__stopevent = threading.Event()
        threading.Thread.__init__(self, name=name)
        threading.Thread.setDaemon(self, True)
Beispiel #56
0
    def __init__(self, ext_addr):
        self.__parameters = {}
        self.__pending_parameters = {}
        self.__sleep_mode = SM_DISABLED
        self.__sleep_period_ms = 0

        from core.tracing import get_tracer
        self.__tracer = get_tracer('XBeeConfigBlockSleep')

        AbstractXBeeConfigBlockDDO.__init__(self, ext_addr)
        AbstractXBeeConfigBlockDDO.apply_only_to_modules(
            self, SLEEPABLE_MODULES)
    def __init__(self, name, core_services, settings, properties):

        # save these for use of sub-classed device drivers
        self._name = name
        self._core = core_services
        self._tracer = get_tracer(name)

        ## local variables

        # These are to be used by 'health monitoring' functions - all drivers
        # should correctly manage these (or leave set to None to mark as N/A)
        #
        # use self.get_time_of_last_data() and
        #     self.set_time_of_last_data() to access!
        self.__last_data_timestamp = None
        # use self.get_data_update_rate_seconds() and
        #     self.set_data_update_rate_seconds() to access!
        self.__data_update_rate = None

        # cache the channel DB reference
        self._channel_db = None

        # Initialize settings:
        ## Settings Table Definition:
        settings_list = [
            Setting(name='trace',
                    type=str,
                    required=False,
                    default_value=self.DEF_TRACE),
        ]
        # Add our settings_list entries into the settings passed to us.
        settings = self.merge_settings(settings, settings_list)

        self.__settings = settings
        SettingsBase.__init__(self,
                              binding=("devices", (name, ), "settings"),
                              setting_defs=settings)

        # Initialize properties:
        self.__properties = {}
        if properties is not None:
            for property in properties:
                self.add_property(property)

        # pre_start - check if special trace level requested
        trace = SettingsBase.get_setting(self, "trace")
        try:
            self._tracer.set_level(trace)
        except:
            self._tracer.warning(
                "Ignoring bad trace level \'%s\' for this device", trace)

        self._tracer.calls("DeviceBase.__init__()")
Beispiel #58
0
    def __init__(self, name, core_services):

        self.__name = name
        self.__core = core_services

        self.__stopevent = threading.Event()

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        self.use_proxy = None
        self.proxy_host = None
        self.proxy_port = None

        # Configuration Settings:

        settings_list = [
            Setting(name="cosm_host",
                    type=str,
                    required=False,
                    default_value="api.cosm.com"),
            Setting(name="cosm_key", type=str, required=True),
            Setting(name="cosm_feed_id0", type=str, required=True),
            Setting(name="channel0", type=str, required=True),
            Setting(name="cosm_datastream0", type=str, required=True),
            Setting(name="use_proxy",
                    type=bool,
                    required=False,
                    default_value=False),
            Setting(name="proxy_host", type=str, required=False),
            Setting(name="proxy_port",
                    type=int,
                    required=False,
                    default_value=3128),
        ]

        PresentationBase.__init__(self, name=name, settings_list=settings_list)

        self.use_proxy = SettingsBase.get_setting(self, "use_proxy")
        if self.use_proxy:
            self.proxy_host = SettingsBase.get_setting(self, "proxy_host")
            self.proxy_port = SettingsBase.get_setting(self, "proxy_port")
            if not self.proxy_host:
                self.__tracer.warning(
                    "proxy_host configuration parameter not set. Will ignore use_proxy to false"
                )
                self.use_proxy = False

        threading.Thread.__init__(self, name=name)
        threading.Thread.setDaemon(self, True)

        return
Beispiel #59
0
    def __init__(self, name="scheduler", core=None):
        self.__name = name
        self.__core = core

        self.__tracer = get_tracer(name)

        self.__semaphore = threading.Semaphore(0)
        self.__stop_flag = False

        self.__sched = sched.scheduler()

        threading.Thread.__init__(self)
        threading.Thread.setDaemon(self, True)
Beispiel #60
0
    def __init__(self, name, parent, channel, mode, source):
        self.__name = name
        self.__parent = parent
        self.__channel = channel
        self.__mode = mode
        self.__source = source

        from core.tracing import get_tracer
        self.__tracer = get_tracer(name)

        ## Local State Variables:
        self.__dia_device_obj = self.__parent.get_parent()
        self.__xbee_manager = self.__parent.get_xbee_manager()