Example #1
0
    def get_write_dial_position_from_db(self):
        name = 'DialPosition'
        db = self.get_database()
        pos_props = db.get_device_attribute_property(self.get_name(), name)[name]
        w_pos = pos_props["__value"][0]

        _, _, attr_info = self.get_dynamic_attributes()[0][name]
        w_pos = str_to_value(w_pos, attr_info.dtype, attr_info.dformat)

        w_pos, w_ts = float(pos_props["__value"][0]), None
        if "__value_ts" in pos_props:
            w_ts = float(pos_props["__value_ts"][0])
        return w_pos, w_ts
Example #2
0
    def get_write_value_from_db(self):
        name = 'Value'
        db = self.get_database()
        val_props = db.get_device_attribute_property(self.get_name(), name)[name]
        w_val = val_props["__value"][0]

        _, _, attr_info = self.get_dynamic_attributes()[0][name]
        w_val = str_to_value(w_val, attr_info.dtype, attr_info.dformat)

        w_val, w_ts = int(val_props["__value"][0]), None
        if "__value_ts" in val_props:
            w_ts = float(val_props["__value_ts"][0])
        return w_val, w_ts
Example #3
0
    def get_write_dial_position_from_db(self):
        name = 'DialPosition'
        db = self.get_database()
        pos_props = db.get_device_attribute_property(self.get_name(),
                                                     name)[name]
        w_pos = pos_props["__value"][0]

        _, _, attr_info = self.get_dynamic_attributes()[0][name]
        w_pos = str_to_value(w_pos, attr_info.dtype, attr_info.dformat)

        w_pos, w_ts = float(pos_props["__value"][0]), None
        if "__value_ts" in pos_props:
            w_ts = float(pos_props["__value_ts"][0])
        return w_pos, w_ts