Skip to content

Commit

Permalink
Delete S53
Browse files Browse the repository at this point in the history
  • Loading branch information
markusrc11 committed Sep 17, 2024
1 parent b82385d commit 7c47cbe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 187 deletions.
119 changes: 4 additions & 115 deletions primestg/report/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
from primestg.message import MessageS
from primestg.utils import octet2name, octet2number

CNC_REPORTS = ['S02', 'S04', 'S05', 'S06', 'S09', 'S12', 'S13', 'S14', 'S15',
'S17', 'S18', 'S23', 'S24', 'S27', 'S42']
RTU_REPORTS = ['S52', 'S53']
SUPPORTED_REPORTS = CNC_REPORTS + RTU_REPORTS
SUPPORTED_REPORTS = ['S02', 'S04', 'S05', 'S06', 'S09', 'S12', 'S13', 'S14', 'S15',
'S17', 'S18', 'S23', 'S24', 'S27', 'S42', 'S52']


def is_supported(report_code):
Expand Down Expand Up @@ -349,35 +347,6 @@ def values(self):
return [values]


class MeasureS53(MeasureActiveReactiveFloat):
"""
Class for a set of measures of report S53.
"""

@property
def values(self):
"""
Set of measures of report S53.
:return: a dict with a set of measures of report S53
"""
try:
values = {}
for phase in range(1, 4): # Phase 1..3
values.update(self.active_reactive_with_phase(self.objectified, phase))
values.update(
{
'timestamp': self._get_timestamp('Fh'),
'bc': self.objectified.get('Bc')
}
)
except Exception as e:
self._warnings.append('ERROR: Thrown exception: {}'.format(e))
return []

return [values]


class MeasureEvents(Measure):
"""
Class for a set of measures of report S09.
Expand Down Expand Up @@ -1053,42 +1022,6 @@ def values(self):
return values


class LineSupervisorS53(LineSupervisorDetails):
"""
Class for a line supervisor of report S53.
"""

@property
def report_type(self):
"""
The type of report for report S53.
:return: a string with 'S53'
"""
return 'S53'

@property
def measure_class(self):
"""
The class used to instance measure sets for report S53.
:return: a class to instance measure sets of report S53
"""
return MeasureS53

@property
def values(self):
"""
Values of measure sets of this line supervisor of report that need the name of the remote terminal unit
and the line supervisor
:return: a list with the values of the measure sets
"""
values = super(LineSupervisorS53, self).values
for value in values:
value['magn'] = self.magnitude
return values


class MeterS01(MeterWithMagnitude):
"""
Expand Down Expand Up @@ -2175,42 +2108,6 @@ def report_type(self):
return 'S52'


class RemoteTerminalUnitS53(RemoteTerminalUnitDetails):
"""
Class for a remote terminal unit of report S53.
"""

def __init__(self, objectified_rt_unit, report_version, request_id):
"""
Create a RemoteTerminalUnit object for the report S53.
:param objectified_rt_unit: an lxml.objectify.StringElement \
representing a line supervisor
:param report_version: a string with the version of report
:return: a LineSupervisor object
"""
super(RemoteTerminalUnitS53, self).__init__(objectified_rt_unit)
self.report_version = report_version
self.request_id = request_id

@property
def line_supervisor_class(self):
"""
The class used to instance line supervisors for report S53.
:return: a class to instance line supervisors of report S53
"""
return LineSupervisorS53

@property
def report_type(self):
"""
The type of report for report S53.
:return: a string with 'S53'
"""
return 'S53'


class Report(object):
"""
Report class to process MessageS
Expand Down Expand Up @@ -2399,15 +2296,7 @@ def get_rt_unit(self, objectified_rt_unit):
self.report_version,
self.request_id
],
},
'S53': {
'class': RemoteTerminalUnitS53,
'args': [
objectified_rt_unit,
self.report_version,
self.request_id
],
},
}
}

if self.report_type not in report_type_class:
Expand Down Expand Up @@ -2449,7 +2338,7 @@ def values(self):
:return: a list with the values of the whole report
"""
values = []
if self.report_type == RTU_REPORTS:
if self.report_type == 'S52':
for rt_unit in self.rt_units:
values.extend(rt_unit.values)
else:
Expand Down
53 changes: 0 additions & 53 deletions spec/Report_S53_spec.py

This file was deleted.

19 changes: 0 additions & 19 deletions spec/data/ORMR208231717738_0_S53_1_20240624050827

This file was deleted.

0 comments on commit 7c47cbe

Please sign in to comment.