Skip to content

Commit

Permalink
updated for regulator list issue
Browse files Browse the repository at this point in the history
  • Loading branch information
singha42 committed Aug 18, 2020
1 parent a4761db commit 394f52f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dnp3/service/dnp3/cim_to_dnp3.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,18 @@ def _create_dnp3_object_map(self):

for m in regulators:
reg_attribute = attribute_map['regulators']['attribute']
# bank_phase = list(m['bankPhases'])
#bank_phase = list(m['bankPhases'])
for n in range(0, 4):
measurement_id = m.get("mRID")
name = uuid.uuid4().hex
description = "Name:" + m['bankName'] + ",ConductingEquipment_type:RatioTapChanger_Reg" +",Phase:" + m['bankPhases'] + ",Attribute:" + reg_attribute[n]
self.assign_val_d("AO", 42, 3, self.c_ao, name, description, measurement_id[0], reg_attribute[n])
self.c_ao += 1
for i in range(5, 7):
for j in range(0, len(m['bankPhases'])):
for j in range(0, len(m['endPhase'])):
measurement_id = m.get("mRID")[j]
name = uuid.uuid4().hex
description = "Name:" + m['tankName'][j] + ",ConductingEquipment_type:RatioTapChanger_Reg"+ ",Phase:" + m['bankPhases'][j] + ",controlAttribute:" + reg_attribute[i]
description = "Name:" + m['tankName'][j] + ",ConductingEquipment_type:RatioTapChanger_Reg"+ ",Phase:" + m['endPhase'][j] + ",controlAttribute:" + reg_attribute[i]
self.assign_val_d("AO", 42, 3, self.c_ao, name, description, measurement_id,reg_attribute[i])
self.c_ao += 1

Expand Down
2 changes: 1 addition & 1 deletion dnp3/service/new_start_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def publish_outstation_status(status_string):
out_dict = dict({'points': dnp3_object.out_json})
json.dump(out_dict, fp, indent=2, sort_keys=True)

with open("/tmp/port.json", 'r') as f:
with open("./dnp3/port.json", 'r') as f:
port_config = json.load(f)
print(port_config)

Expand Down

0 comments on commit 394f52f

Please sign in to comment.