updated acquisition procedure of myems-modbus-tcp
parent
da908b8f74
commit
973c93764d
|
@ -194,18 +194,15 @@ def process(logger, data_source_id, host, port):
|
||||||
value = result[0]
|
value = result[0]
|
||||||
|
|
||||||
if point['object_type'] == 'ANALOG_VALUE':
|
if point['object_type'] == 'ANALOG_VALUE':
|
||||||
analog_value_list.append({'data_source_id': data_source_id,
|
analog_value_list.append({'point_id': point['id'],
|
||||||
'point_id': point['id'],
|
|
||||||
'is_trend': point['is_trend'],
|
'is_trend': point['is_trend'],
|
||||||
'value': Decimal(value) * point['ratio']})
|
'value': Decimal(value) * point['ratio']})
|
||||||
elif point['object_type'] == 'ENERGY_VALUE':
|
elif point['object_type'] == 'ENERGY_VALUE':
|
||||||
energy_value_list.append({'data_source_id': data_source_id,
|
energy_value_list.append({'point_id': point['id'],
|
||||||
'point_id': point['id'],
|
|
||||||
'is_trend': point['is_trend'],
|
'is_trend': point['is_trend'],
|
||||||
'value': Decimal(value) * point['ratio']})
|
'value': Decimal(value) * point['ratio']})
|
||||||
elif point['object_type'] == 'DIGITAL_VALUE':
|
elif point['object_type'] == 'DIGITAL_VALUE':
|
||||||
digital_value_list.append({'data_source_id': data_source_id,
|
digital_value_list.append({'point_id': point['id'],
|
||||||
'point_id': point['id'],
|
|
||||||
'is_trend': point['is_trend'],
|
'is_trend': point['is_trend'],
|
||||||
'value': int(value) * int(point['ratio'])})
|
'value': int(value) * int(point['ratio'])})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue