def create_thing(self):
        # Create and Populate the TagGroup registry with JSON resource files.
        tgr = JSonTagGroupRegistry()
        tgr.register_tag_groups_from_uri(
            get_abs_file_uri(
                'definitions/TagGroup/com.adlinktech.example/LocationTagGroup.json'
            ))
        tgr.register_tag_groups_from_uri(
            get_abs_file_uri(
                'definitions/TagGroup/com.adlinktech.example/DistanceTagGroup.json'
            ))
        self._datariver.add_tag_group_registry(tgr)

        # Create and Populate the ThingClass registry with JSON resource files.
        tcr = JSonThingClassRegistry()
        tcr.register_thing_classes_from_uri(
            get_abs_file_uri(
                'definitions/ThingClass/com.adlinktech.example/DistanceServiceThingClass.json'
            ))
        self._datariver.add_thing_class_registry(tcr)

        # Create a Thing based on properties specified in a JSON resource file.
        tp = JSonThingProperties()
        tp.read_properties_from_uri(self._thing_properties_uri)
        return self._datariver.create_thing(tp)
Ejemplo n.º 2
0
def create_thing(dr: DataRiver, properties_str: str):
    '''
    Given a string for a Thing, instantiate it in the provided DataRiver and return it.
    '''
    tp = JSonThingProperties()
    tp.read_properties_from_string(properties_str)

    return dr.create_thing(tp)
   def create_thing(self):
       # Create and Populate the TagGroup registry with JSON resource files.
       tag_groups.Temperature_register_with_datariver(self._dr)
 
       # Create and Populate the ThingClass registry with JSON resource files.
       tcr = JSonThingClassRegistry()
       tcr.register_thing_classes_from_uri(get_abs_file_uri('definitions/ThingClass/com.adlinktech.example.protobuf/TemperatureDashboardThingClass.json'))
       self._dr.add_thing_class_registry(tcr)
 
       # Create a Thing based on properties specified in a JSON resource file.
       tp = JSonThingProperties()
       tp.read_properties_from_uri(self._thing_properties_uri)
       return ThingEx(self._dr.create_thing(tp))
Ejemplo n.º 4
0
   def create_thing(self):
       # Add listener for discovery of Things
       self._datariver.add_listener(self._new_thing_discovered_listener, self._dispatcher)
       
       # Create and Populate the ThingClass registry with JSON resource files.
       tcr = JSonThingClassRegistry()
       tcr.register_thing_classes_from_uri('file://definitions/ThingClass/com.adlinktech.example/ThingBrowserThingClass.json')
       self._datariver.add_thing_class_registry(tcr)
 
       # Create a Thing based on properties specified in a JSON resource file.
       tp = JSonThingProperties()
       tp.read_properties_from_uri(self._thing_properties_uri)
       
       return self._datariver.create_thing(tp)
   def create_thing(self):
       # Create and Populate the TagGroup registry with JSON resource files.
       RotationalSpeed_register_with_datariver(self._datariver)
 
       # Create and Populate the ThingClass registry with JSON resource files.
       tcr = JSonThingClassRegistry()
       tcr.register_thing_classes_from_uri('file://definitions/ThingClass/com.adlinktech.example.protobuf/RotationalSpeedSensorThingClass.json')
       self._datariver.add_thing_class_registry(tcr)
 
       # Create a Thing based on properties specified in a JSON resource file.
       tp = JSonThingProperties()
       tp.read_properties_from_uri(self._thing_properties_uri)
       
       return ThingEx(self._datariver.create_thing(tp))
Ejemplo n.º 6
0
    def create_thing(self):
        #  Register the protobuf TagGroups
        Location_register_with_datariver(self._datariver)
        Distance_register_with_datariver(self._datariver)

        # Create and Populate the ThingClass registry with JSON resource files.
        tcr = JSonThingClassRegistry()
        tcr.register_thing_classes_from_uri(
            get_abs_file_uri(
                'definitions/ThingClass/com.adlinktech.example.protobuf/GpsSensorThingClass.json'
            ))
        self._datariver.add_thing_class_registry(tcr)

        # Create a Thing based on properties specified in a JSON resource file.
        tp = JSonThingProperties()
        tp.read_properties_from_uri(self._thing_properties_uri)
        return ThingEx(self._datariver.create_thing(tp))
Ejemplo n.º 7
0
    def create_thing(self):
        # Create and Populate the TagGroup registry with JSON resource files.
        tgr = JSonTagGroupRegistry()
        tgr.register_tag_groups_from_uri(
            'file://definitions/TagGroup/com.adlinktech.example/SensorStateTagGroup.json'
        )
        tgr.register_tag_groups_from_uri(
            'file://definitions/TagGroup/com.adlinktech.example/FuelLevelTagGroup.json'
        )
        self._datariver.add_tag_group_registry(tgr)

        # Create and Populate the ThingClass registry with JSON resource files.
        tcr = JSonThingClassRegistry()
        tcr.register_thing_classes_from_uri(
            'file://definitions/ThingClass/com.adlinktech.example/FuelLevelSensorThingClass.json'
        )
        self._datariver.add_thing_class_registry(tcr)

        # Create a Thing based on properties specified in a JSON resource file.
        tp = JSonThingProperties()
        tp.read_properties_from_uri(self._thing_properties_uri)

        return self._datariver.create_thing(tp)