DLMS-SPODES 0.87.17__py3-none-any.whl → 0.88.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- DLMS_SPODES/Values/EN/__init__.py +1 -1
- DLMS_SPODES/Values/EN/actors.py +8 -8
- DLMS_SPODES/Values/EN/relation_to_obis_names.py +387 -387
- DLMS_SPODES/Values/RU/__init__.py +1 -1
- DLMS_SPODES/Values/RU/actors.py +8 -8
- DLMS_SPODES/Values/RU/relation_to_obis_names.py +396 -396
- DLMS_SPODES/__init__.py +6 -6
- DLMS_SPODES/configEN.ini +126 -126
- DLMS_SPODES/config_parser.py +53 -53
- DLMS_SPODES/cosem_interface_classes/Overview/__init__.py +0 -0
- DLMS_SPODES/cosem_interface_classes/Overview/class_id.py +107 -0
- DLMS_SPODES/cosem_interface_classes/__class_init__.py +3 -3
- DLMS_SPODES/cosem_interface_classes/__init__.py +3 -2
- DLMS_SPODES/cosem_interface_classes/activity_calendar.py +210 -254
- DLMS_SPODES/cosem_interface_classes/arbitrator.py +78 -105
- DLMS_SPODES/cosem_interface_classes/association_ln/abstract.py +50 -34
- DLMS_SPODES/cosem_interface_classes/association_ln/authentication_mechanism_name.py +25 -25
- DLMS_SPODES/cosem_interface_classes/association_ln/mechanism_id.py +25 -25
- DLMS_SPODES/cosem_interface_classes/association_ln/method.py +5 -5
- DLMS_SPODES/cosem_interface_classes/association_ln/ver0.py +440 -485
- DLMS_SPODES/cosem_interface_classes/association_ln/ver1.py +126 -133
- DLMS_SPODES/cosem_interface_classes/association_ln/ver2.py +30 -36
- DLMS_SPODES/cosem_interface_classes/association_ln/ver3.py +3 -4
- DLMS_SPODES/cosem_interface_classes/association_sn/ver0.py +14 -12
- DLMS_SPODES/cosem_interface_classes/clock.py +81 -131
- DLMS_SPODES/cosem_interface_classes/collection.py +2106 -2122
- DLMS_SPODES/cosem_interface_classes/cosem_interface_class.py +525 -583
- DLMS_SPODES/cosem_interface_classes/data.py +12 -21
- DLMS_SPODES/cosem_interface_classes/demand_register/ver0.py +32 -59
- DLMS_SPODES/cosem_interface_classes/disconnect_control.py +56 -74
- DLMS_SPODES/cosem_interface_classes/extended_register.py +18 -27
- DLMS_SPODES/cosem_interface_classes/gprs_modem_setup.py +33 -43
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver0.py +78 -103
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver1.py +42 -40
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver2.py +6 -9
- DLMS_SPODES/cosem_interface_classes/iec_hdlc_setup/ver0.py +11 -11
- DLMS_SPODES/cosem_interface_classes/iec_hdlc_setup/ver1.py +27 -53
- DLMS_SPODES/cosem_interface_classes/iec_local_port_setup.py +9 -11
- DLMS_SPODES/cosem_interface_classes/image_transfer/image_transfer_status.py +15 -15
- DLMS_SPODES/cosem_interface_classes/image_transfer/ver0.py +54 -126
- DLMS_SPODES/cosem_interface_classes/implementations/__init__.py +3 -3
- DLMS_SPODES/cosem_interface_classes/implementations/arbitrator.py +19 -19
- DLMS_SPODES/cosem_interface_classes/implementations/data.py +491 -487
- DLMS_SPODES/cosem_interface_classes/implementations/profile_generic.py +85 -83
- DLMS_SPODES/cosem_interface_classes/ipv4_setup.py +42 -72
- DLMS_SPODES/cosem_interface_classes/limiter.py +77 -111
- DLMS_SPODES/cosem_interface_classes/ln_pattern.py +334 -333
- DLMS_SPODES/cosem_interface_classes/modem_configuration/ver0.py +51 -65
- DLMS_SPODES/cosem_interface_classes/modem_configuration/ver1.py +27 -39
- DLMS_SPODES/cosem_interface_classes/ntp_setup/ver0.py +48 -67
- DLMS_SPODES/cosem_interface_classes/obis.py +28 -23
- DLMS_SPODES/cosem_interface_classes/overview.py +198 -197
- DLMS_SPODES/cosem_interface_classes/parameter.py +548 -547
- DLMS_SPODES/cosem_interface_classes/parameters.py +172 -172
- DLMS_SPODES/cosem_interface_classes/profile_generic/ver0.py +90 -133
- DLMS_SPODES/cosem_interface_classes/profile_generic/ver1.py +268 -277
- DLMS_SPODES/cosem_interface_classes/push_setup/ver0.py +13 -12
- DLMS_SPODES/cosem_interface_classes/push_setup/ver1.py +9 -10
- DLMS_SPODES/cosem_interface_classes/push_setup/ver2.py +124 -166
- DLMS_SPODES/cosem_interface_classes/register.py +18 -45
- DLMS_SPODES/cosem_interface_classes/register_activation/ver0.py +45 -80
- DLMS_SPODES/cosem_interface_classes/register_monitor.py +33 -46
- DLMS_SPODES/cosem_interface_classes/reports.py +72 -70
- DLMS_SPODES/cosem_interface_classes/schedule.py +88 -176
- DLMS_SPODES/cosem_interface_classes/script_table.py +54 -87
- DLMS_SPODES/cosem_interface_classes/security_setup/ver0.py +45 -68
- DLMS_SPODES/cosem_interface_classes/security_setup/ver1.py +122 -158
- DLMS_SPODES/cosem_interface_classes/single_action_schedule.py +34 -50
- DLMS_SPODES/cosem_interface_classes/special_days_table.py +54 -84
- DLMS_SPODES/cosem_interface_classes/tcp_udp_setup.py +20 -42
- DLMS_SPODES/cosem_pdu.py +93 -93
- DLMS_SPODES/enums.py +625 -625
- DLMS_SPODES/exceptions.py +106 -106
- DLMS_SPODES/firmwares.py +99 -99
- DLMS_SPODES/hdlc/frame.py +875 -875
- DLMS_SPODES/hdlc/sub_layer.py +54 -54
- DLMS_SPODES/literals.py +17 -17
- DLMS_SPODES/obis/__init__.py +1 -1
- DLMS_SPODES/obis/media_id.py +931 -931
- DLMS_SPODES/pardata.py +22 -22
- DLMS_SPODES/pdu_enums.py +98 -98
- DLMS_SPODES/relation_to_OBIS.py +463 -465
- DLMS_SPODES/settings.py +551 -551
- DLMS_SPODES/types/choices.py +140 -142
- DLMS_SPODES/types/common_data_types.py +2379 -2401
- DLMS_SPODES/types/cosem_service_types.py +109 -109
- DLMS_SPODES/types/implementations/arrays.py +25 -25
- DLMS_SPODES/types/implementations/bitstrings.py +97 -97
- DLMS_SPODES/types/implementations/double_long_usingneds.py +35 -35
- DLMS_SPODES/types/implementations/enums.py +57 -57
- DLMS_SPODES/types/implementations/integers.py +12 -11
- DLMS_SPODES/types/implementations/long_unsigneds.py +127 -127
- DLMS_SPODES/types/implementations/octet_string.py +11 -11
- DLMS_SPODES/types/implementations/structs.py +64 -64
- DLMS_SPODES/types/type_alias.py +74 -0
- DLMS_SPODES/types/useful_types.py +627 -677
- {dlms_spodes-0.87.17.dist-info → dlms_spodes-0.88.1.dist-info}/METADATA +30 -30
- dlms_spodes-0.88.1.dist-info/RECORD +118 -0
- {dlms_spodes-0.87.17.dist-info → dlms_spodes-0.88.1.dist-info}/WHEEL +1 -1
- DLMS_SPODES/cosem_interface_classes/a_parameter.py +0 -20
- DLMS_SPODES/cosem_interface_classes/attr_indexes.py +0 -12
- dlms_spodes-0.87.17.dist-info/RECORD +0 -117
- {dlms_spodes-0.87.17.dist-info → dlms_spodes-0.88.1.dist-info}/top_level.txt +0 -0
|
@@ -1,172 +1,172 @@
|
|
|
1
|
-
from dataclasses import dataclass
|
|
2
|
-
from functools import cached_property
|
|
3
|
-
from typing import Self
|
|
4
|
-
from .parameter import Parameter
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@dataclass(frozen=True)
|
|
8
|
-
class Data(Parameter):
|
|
9
|
-
@property
|
|
10
|
-
def value(self) -> Parameter:
|
|
11
|
-
return self.get_attr(2)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class ActiveFirmwareIdentifier(Data):
|
|
15
|
-
|
|
16
|
-
@classmethod
|
|
17
|
-
def from_b(cls, b: int = 0) -> "ActiveFirmwareIdentifier":
|
|
18
|
-
return cls.parse(f"0.{b}.0.2.0.255")
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
LDN = Data.parse("0.0.42.0.0.255")
|
|
22
|
-
ACTIVE_FIRMWARE_IDENTIFIER_0 = ActiveFirmwareIdentifier.from_b()
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
@dataclass(frozen=True)
|
|
26
|
-
class Register(Data):
|
|
27
|
-
@property
|
|
28
|
-
def scaler_unit(self) -> Parameter:
|
|
29
|
-
return self.get_attr(3)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
@dataclass(frozen=True)
|
|
33
|
-
class Clock(Parameter):
|
|
34
|
-
@classmethod
|
|
35
|
-
def from_be(cls, b: int = 0, e: int = 0) -> "Clock":
|
|
36
|
-
return cls.parse(f"0.{b}.1.0.{e}.255")
|
|
37
|
-
|
|
38
|
-
@property
|
|
39
|
-
def time(self) -> "Clock":
|
|
40
|
-
return self.get_attr(2)
|
|
41
|
-
|
|
42
|
-
@property
|
|
43
|
-
def time_zone(self) -> "Clock":
|
|
44
|
-
return self.get_attr(3)
|
|
45
|
-
|
|
46
|
-
@property
|
|
47
|
-
def status(self) -> "Clock":
|
|
48
|
-
return self.get_attr(4)
|
|
49
|
-
|
|
50
|
-
@property
|
|
51
|
-
def daylight_savings_begin(self) -> "Clock":
|
|
52
|
-
return self.get_attr(5)
|
|
53
|
-
|
|
54
|
-
@property
|
|
55
|
-
def daylight_savings_end(self) -> "Clock":
|
|
56
|
-
return self.get_attr(6)
|
|
57
|
-
|
|
58
|
-
@property
|
|
59
|
-
def daylight_savings_deviation(self) -> "Clock":
|
|
60
|
-
return self.get_attr(7)
|
|
61
|
-
|
|
62
|
-
@property
|
|
63
|
-
def daylight_savings_enabled(self) -> "Clock":
|
|
64
|
-
return self.get_attr(8)
|
|
65
|
-
|
|
66
|
-
@property
|
|
67
|
-
def clock_base(self) -> "Clock":
|
|
68
|
-
return self.get_attr(9)
|
|
69
|
-
|
|
70
|
-
@property
|
|
71
|
-
def adjust_to_quarter(self) -> "Clock":
|
|
72
|
-
return self.get_meth(1)
|
|
73
|
-
|
|
74
|
-
@property
|
|
75
|
-
def adjust_to_measuring_period(self) -> "Clock":
|
|
76
|
-
return self.get_meth(2)
|
|
77
|
-
|
|
78
|
-
@property
|
|
79
|
-
def adjust_to_minute(self) -> "Clock":
|
|
80
|
-
return self.get_meth(3)
|
|
81
|
-
|
|
82
|
-
@property
|
|
83
|
-
def adjust_to_preset_time(self) -> "Clock":
|
|
84
|
-
return self.get_meth(4)
|
|
85
|
-
|
|
86
|
-
@property
|
|
87
|
-
def preset_adjusting_time(self) -> "Clock":
|
|
88
|
-
return self.get_meth(5)
|
|
89
|
-
|
|
90
|
-
@property
|
|
91
|
-
def shift_time(self) -> "Clock":
|
|
92
|
-
return self.get_meth(6)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
@dataclass(frozen=True)
|
|
96
|
-
class DisconnectControl(Parameter):
|
|
97
|
-
|
|
98
|
-
@classmethod
|
|
99
|
-
def from_b(cls, b: int) -> "DisconnectControl":
|
|
100
|
-
return cls.parse(f"0.{b}.96.3.10.255")
|
|
101
|
-
|
|
102
|
-
@property
|
|
103
|
-
def output_state(self) -> "DisconnectControl":
|
|
104
|
-
return self.get_attr(2)
|
|
105
|
-
|
|
106
|
-
@property
|
|
107
|
-
def control_state(self) -> "DisconnectControl":
|
|
108
|
-
return self.get_attr(3)
|
|
109
|
-
|
|
110
|
-
@property
|
|
111
|
-
def control_mode(self) -> "DisconnectControl":
|
|
112
|
-
return self.get_attr(4)
|
|
113
|
-
|
|
114
|
-
@property
|
|
115
|
-
def remote_disconnect(self) -> "DisconnectControl":
|
|
116
|
-
return self.get_meth(1)
|
|
117
|
-
|
|
118
|
-
@property
|
|
119
|
-
def remote_reconnect(self) -> "DisconnectControl":
|
|
120
|
-
return self.get_meth(2)
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
DISCONNECT_CONTROL_0 = DisconnectControl.from_b(0)
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
@dataclass(frozen=True)
|
|
127
|
-
class ImageTransfer(Parameter):
|
|
128
|
-
@classmethod
|
|
129
|
-
def from_e(cls, e: int = 0) -> "ImageTransfer":
|
|
130
|
-
return cls.parse(f"0.0.44.0.{e}.255")
|
|
131
|
-
|
|
132
|
-
@property
|
|
133
|
-
def image_block_size(self) -> "ImageTransfer":
|
|
134
|
-
return self.get_attr(2)
|
|
135
|
-
|
|
136
|
-
@property
|
|
137
|
-
def image_transferred_blocks_status(self) -> "ImageTransfer":
|
|
138
|
-
return self.get_attr(3)
|
|
139
|
-
|
|
140
|
-
@property
|
|
141
|
-
def image_first_not_transferred_block_number(self) -> "ImageTransfer":
|
|
142
|
-
return self.get_attr(4)
|
|
143
|
-
|
|
144
|
-
@property
|
|
145
|
-
def image_transfer_enabled(self) -> "ImageTransfer":
|
|
146
|
-
return self.get_attr(5)
|
|
147
|
-
|
|
148
|
-
@property
|
|
149
|
-
def image_transfer_status(self) -> "ImageTransfer":
|
|
150
|
-
return self.get_attr(6)
|
|
151
|
-
|
|
152
|
-
@property
|
|
153
|
-
def image_to_activate_info(self) -> "ImageTransfer":
|
|
154
|
-
return self.get_attr(7)
|
|
155
|
-
|
|
156
|
-
@property
|
|
157
|
-
def image_transfer_initiate(self) -> "ImageTransfer":
|
|
158
|
-
return self.get_meth(1)
|
|
159
|
-
|
|
160
|
-
@property
|
|
161
|
-
def image_block_transfer(self) -> "ImageTransfer":
|
|
162
|
-
return self.get_meth(2)
|
|
163
|
-
|
|
164
|
-
@property
|
|
165
|
-
def image_verify(self) -> "ImageTransfer":
|
|
166
|
-
return self.get_meth(3)
|
|
167
|
-
|
|
168
|
-
@property
|
|
169
|
-
def image_activate(self) -> "ImageTransfer":
|
|
170
|
-
return self.get_meth(4)
|
|
171
|
-
|
|
172
|
-
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from functools import cached_property
|
|
3
|
+
from typing import Self
|
|
4
|
+
from .parameter import Parameter
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass(frozen=True)
|
|
8
|
+
class Data(Parameter):
|
|
9
|
+
@property
|
|
10
|
+
def value(self) -> Parameter:
|
|
11
|
+
return self.get_attr(2)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ActiveFirmwareIdentifier(Data):
|
|
15
|
+
|
|
16
|
+
@classmethod
|
|
17
|
+
def from_b(cls, b: int = 0) -> "ActiveFirmwareIdentifier":
|
|
18
|
+
return cls.parse(f"0.{b}.0.2.0.255")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
LDN = Data.parse("0.0.42.0.0.255")
|
|
22
|
+
ACTIVE_FIRMWARE_IDENTIFIER_0 = ActiveFirmwareIdentifier.from_b()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass(frozen=True)
|
|
26
|
+
class Register(Data):
|
|
27
|
+
@property
|
|
28
|
+
def scaler_unit(self) -> Parameter:
|
|
29
|
+
return self.get_attr(3)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@dataclass(frozen=True)
|
|
33
|
+
class Clock(Parameter):
|
|
34
|
+
@classmethod
|
|
35
|
+
def from_be(cls, b: int = 0, e: int = 0) -> "Clock":
|
|
36
|
+
return cls.parse(f"0.{b}.1.0.{e}.255")
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def time(self) -> "Clock":
|
|
40
|
+
return self.get_attr(2)
|
|
41
|
+
|
|
42
|
+
@property
|
|
43
|
+
def time_zone(self) -> "Clock":
|
|
44
|
+
return self.get_attr(3)
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def status(self) -> "Clock":
|
|
48
|
+
return self.get_attr(4)
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def daylight_savings_begin(self) -> "Clock":
|
|
52
|
+
return self.get_attr(5)
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def daylight_savings_end(self) -> "Clock":
|
|
56
|
+
return self.get_attr(6)
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def daylight_savings_deviation(self) -> "Clock":
|
|
60
|
+
return self.get_attr(7)
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
def daylight_savings_enabled(self) -> "Clock":
|
|
64
|
+
return self.get_attr(8)
|
|
65
|
+
|
|
66
|
+
@property
|
|
67
|
+
def clock_base(self) -> "Clock":
|
|
68
|
+
return self.get_attr(9)
|
|
69
|
+
|
|
70
|
+
@property
|
|
71
|
+
def adjust_to_quarter(self) -> "Clock":
|
|
72
|
+
return self.get_meth(1)
|
|
73
|
+
|
|
74
|
+
@property
|
|
75
|
+
def adjust_to_measuring_period(self) -> "Clock":
|
|
76
|
+
return self.get_meth(2)
|
|
77
|
+
|
|
78
|
+
@property
|
|
79
|
+
def adjust_to_minute(self) -> "Clock":
|
|
80
|
+
return self.get_meth(3)
|
|
81
|
+
|
|
82
|
+
@property
|
|
83
|
+
def adjust_to_preset_time(self) -> "Clock":
|
|
84
|
+
return self.get_meth(4)
|
|
85
|
+
|
|
86
|
+
@property
|
|
87
|
+
def preset_adjusting_time(self) -> "Clock":
|
|
88
|
+
return self.get_meth(5)
|
|
89
|
+
|
|
90
|
+
@property
|
|
91
|
+
def shift_time(self) -> "Clock":
|
|
92
|
+
return self.get_meth(6)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
@dataclass(frozen=True)
|
|
96
|
+
class DisconnectControl(Parameter):
|
|
97
|
+
|
|
98
|
+
@classmethod
|
|
99
|
+
def from_b(cls, b: int) -> "DisconnectControl":
|
|
100
|
+
return cls.parse(f"0.{b}.96.3.10.255")
|
|
101
|
+
|
|
102
|
+
@property
|
|
103
|
+
def output_state(self) -> "DisconnectControl":
|
|
104
|
+
return self.get_attr(2)
|
|
105
|
+
|
|
106
|
+
@property
|
|
107
|
+
def control_state(self) -> "DisconnectControl":
|
|
108
|
+
return self.get_attr(3)
|
|
109
|
+
|
|
110
|
+
@property
|
|
111
|
+
def control_mode(self) -> "DisconnectControl":
|
|
112
|
+
return self.get_attr(4)
|
|
113
|
+
|
|
114
|
+
@property
|
|
115
|
+
def remote_disconnect(self) -> "DisconnectControl":
|
|
116
|
+
return self.get_meth(1)
|
|
117
|
+
|
|
118
|
+
@property
|
|
119
|
+
def remote_reconnect(self) -> "DisconnectControl":
|
|
120
|
+
return self.get_meth(2)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
DISCONNECT_CONTROL_0 = DisconnectControl.from_b(0)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
@dataclass(frozen=True)
|
|
127
|
+
class ImageTransfer(Parameter):
|
|
128
|
+
@classmethod
|
|
129
|
+
def from_e(cls, e: int = 0) -> "ImageTransfer":
|
|
130
|
+
return cls.parse(f"0.0.44.0.{e}.255")
|
|
131
|
+
|
|
132
|
+
@property
|
|
133
|
+
def image_block_size(self) -> "ImageTransfer":
|
|
134
|
+
return self.get_attr(2)
|
|
135
|
+
|
|
136
|
+
@property
|
|
137
|
+
def image_transferred_blocks_status(self) -> "ImageTransfer":
|
|
138
|
+
return self.get_attr(3)
|
|
139
|
+
|
|
140
|
+
@property
|
|
141
|
+
def image_first_not_transferred_block_number(self) -> "ImageTransfer":
|
|
142
|
+
return self.get_attr(4)
|
|
143
|
+
|
|
144
|
+
@property
|
|
145
|
+
def image_transfer_enabled(self) -> "ImageTransfer":
|
|
146
|
+
return self.get_attr(5)
|
|
147
|
+
|
|
148
|
+
@property
|
|
149
|
+
def image_transfer_status(self) -> "ImageTransfer":
|
|
150
|
+
return self.get_attr(6)
|
|
151
|
+
|
|
152
|
+
@property
|
|
153
|
+
def image_to_activate_info(self) -> "ImageTransfer":
|
|
154
|
+
return self.get_attr(7)
|
|
155
|
+
|
|
156
|
+
@property
|
|
157
|
+
def image_transfer_initiate(self) -> "ImageTransfer":
|
|
158
|
+
return self.get_meth(1)
|
|
159
|
+
|
|
160
|
+
@property
|
|
161
|
+
def image_block_transfer(self) -> "ImageTransfer":
|
|
162
|
+
return self.get_meth(2)
|
|
163
|
+
|
|
164
|
+
@property
|
|
165
|
+
def image_verify(self) -> "ImageTransfer":
|
|
166
|
+
return self.get_meth(3)
|
|
167
|
+
|
|
168
|
+
@property
|
|
169
|
+
def image_activate(self) -> "ImageTransfer":
|
|
170
|
+
return self.get_meth(4)
|
|
171
|
+
|
|
172
|
+
|
|
@@ -1,133 +1,90 @@
|
|
|
1
|
-
"""DLMS UA 1000-1 Ed 14"""
|
|
2
|
-
from typing import
|
|
3
|
-
from
|
|
4
|
-
from ...types
|
|
5
|
-
from ..
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
BUFFER = 2
|
|
9
|
-
CAPTURE_OBJECTS = 3
|
|
10
|
-
CAPTURE_PERIOD = 4
|
|
11
|
-
SORT_METHOD = 5
|
|
12
|
-
SORT_OBJECT = 6
|
|
13
|
-
ENTRIES_IN_USE = 7
|
|
14
|
-
PROFILE_ENTRIES = 8
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class ObjectDefinition(cdt.Structure):
|
|
18
|
-
"""ObjectDefinition"""
|
|
19
|
-
logical_name: cst.LogicalName
|
|
20
|
-
class_id: long_unsigneds.ClassId
|
|
21
|
-
attribute_index: cdt.Integer
|
|
22
|
-
|
|
23
|
-
def __hash__(self):
|
|
24
|
-
return hash((self.logical_name.contents, self.class_id.contents, self.attribute_index.contents))
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class CaptureObjects(cdt.Array):
|
|
28
|
-
""" Specifies the list of capture objects """
|
|
29
|
-
TYPE = ObjectDefinition
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
class SortMethod(cdt.Enum, elements=(1, 2, 3, 4, 5, 6)):
|
|
33
|
-
"""sort_method"""
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
class
|
|
37
|
-
"""
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
self.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
self.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
@property
|
|
93
|
-
def capture_period(self) -> cdt.DoubleLongUnsigned:
|
|
94
|
-
return self.get_attr(4)
|
|
95
|
-
|
|
96
|
-
@property
|
|
97
|
-
def sort_method(self) -> SortMethod:
|
|
98
|
-
return self.get_attr(5)
|
|
99
|
-
|
|
100
|
-
@property
|
|
101
|
-
def sort_object(self) -> ObjectDefinition:
|
|
102
|
-
return self.get_attr(6)
|
|
103
|
-
|
|
104
|
-
@property
|
|
105
|
-
def entries_in_use(self) -> cdt.DoubleLongUnsigned:
|
|
106
|
-
return self.get_attr(7)
|
|
107
|
-
|
|
108
|
-
@property
|
|
109
|
-
def profile_entries(self) -> cdt.DoubleLongUnsigned:
|
|
110
|
-
return self.get_attr(8)
|
|
111
|
-
|
|
112
|
-
@property
|
|
113
|
-
def reset(self) -> integers.Only0:
|
|
114
|
-
return self.get_meth(1)
|
|
115
|
-
|
|
116
|
-
@property
|
|
117
|
-
def capture(self) -> integers.Only0:
|
|
118
|
-
return self.get_meth(2)
|
|
119
|
-
|
|
120
|
-
def __create_buffer_struct_type(self):
|
|
121
|
-
""" TODO: more refactoring !!! """
|
|
122
|
-
# rename ObjectDefinition's and adding object if it absense in collection
|
|
123
|
-
el_value: ObjectDefinition
|
|
124
|
-
if self.capture_objects is None:
|
|
125
|
-
raise ValueError(F"{self}: create buffer Struct type, not set <capture_object> attribute. Need initiate <capture_objects> before")
|
|
126
|
-
for el_value in self.capture_objects:
|
|
127
|
-
self.collection.add_if_missing(
|
|
128
|
-
class_id=ut.CosemClassId(el_value.class_id.contents),
|
|
129
|
-
version=None,
|
|
130
|
-
logical_name=el_value.logical_name)
|
|
131
|
-
el_value.set_name(self.collection.get_name_and_type(el_value)[0][-1])
|
|
132
|
-
self.buffer_capture_objects = self.capture_objects
|
|
133
|
-
self.buffer.set_type(self.capture_objects.__class__)
|
|
1
|
+
"""DLMS UA 1000-1 Ed 14"""
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from ...types.implementations import long_unsigneds, integers
|
|
4
|
+
from ...types import cdt, cst, ut
|
|
5
|
+
from ..cosem_interface_class import ICAuto, ICAElement, ICMElement, Classifier, Cardinality
|
|
6
|
+
from ..Overview import class_id
|
|
7
|
+
|
|
8
|
+
BUFFER = 2
|
|
9
|
+
CAPTURE_OBJECTS = 3
|
|
10
|
+
CAPTURE_PERIOD = 4
|
|
11
|
+
SORT_METHOD = 5
|
|
12
|
+
SORT_OBJECT = 6
|
|
13
|
+
ENTRIES_IN_USE = 7
|
|
14
|
+
PROFILE_ENTRIES = 8
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ObjectDefinition(cdt.Structure):
|
|
18
|
+
"""ObjectDefinition"""
|
|
19
|
+
logical_name: cst.LogicalName
|
|
20
|
+
class_id: long_unsigneds.ClassId
|
|
21
|
+
attribute_index: cdt.Integer
|
|
22
|
+
|
|
23
|
+
def __hash__(self):
|
|
24
|
+
return hash((self.logical_name.contents, self.class_id.contents, self.attribute_index.contents))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class CaptureObjects(cdt.Array):
|
|
28
|
+
""" Specifies the list of capture objects """
|
|
29
|
+
TYPE = ObjectDefinition
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class SortMethod(cdt.Enum, elements=(1, 2, 3, 4, 5, 6)):
|
|
33
|
+
"""sort_method"""
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class ProfileGeneric(ICAuto):
|
|
37
|
+
"""5.3.1 Profile generic"""
|
|
38
|
+
CLASS_ID = class_id.PROFILE_GENERIC
|
|
39
|
+
VERSION = 0
|
|
40
|
+
# todo: remove down following
|
|
41
|
+
scaler_profile_key: bytes | None = None
|
|
42
|
+
""" obis of scaler profile for this profile if need """
|
|
43
|
+
buffer_capture_objects: CaptureObjects
|
|
44
|
+
range_descriptor: type[cdt.Structure] = None
|
|
45
|
+
attr_descriptor_with_selection: type[ut.CosemAttributeDescriptorWithSelection] = None
|
|
46
|
+
|
|
47
|
+
A_ELEMENTS = (
|
|
48
|
+
ICAElement(2, "buffer", cdt.Array, classifier=Classifier.DYNAMIC),
|
|
49
|
+
ICAElement(3, "capture_objects", CaptureObjects),
|
|
50
|
+
ICAElement(4, "capture_period", cdt.DoubleLongUnsigned),
|
|
51
|
+
ICAElement(5, "sort_method", SortMethod),
|
|
52
|
+
ICAElement(6, "sort_object", ObjectDefinition),
|
|
53
|
+
ICAElement(7, "entries_in_use", cdt.DoubleLongUnsigned, 0, default=0, classifier=Classifier.DYNAMIC),
|
|
54
|
+
ICAElement(8, "profile_entries", cdt.DoubleLongUnsigned, 1, default=1)
|
|
55
|
+
)
|
|
56
|
+
M_ELEMENTS = (
|
|
57
|
+
ICMElement(1, "reset", integers.Only0),
|
|
58
|
+
ICMElement(2, "capture", integers.Only0),
|
|
59
|
+
# more 2 elements
|
|
60
|
+
)
|
|
61
|
+
buffer: Optional[cdt.Array]
|
|
62
|
+
capture_objects: Optional[CaptureObjects]
|
|
63
|
+
capture_period: Optional[cdt.DoubleLongUnsigned]
|
|
64
|
+
sort_method: Optional[SortMethod]
|
|
65
|
+
sort_object: Optional[ObjectDefinition]
|
|
66
|
+
entries_in_use: Optional[cdt.DoubleLongUnsigned]
|
|
67
|
+
profile_entries: Optional[cdt.DoubleLongUnsigned]
|
|
68
|
+
|
|
69
|
+
def characteristics_init(self):
|
|
70
|
+
self.set_attr(BUFFER, None)
|
|
71
|
+
# todo remove it
|
|
72
|
+
self.buffer.register_cb_preset(lambda _: self.__create_buffer_struct_type()) # value not used for creating struct type
|
|
73
|
+
self._cbs_attr_post_init.update({CAPTURE_OBJECTS: self.__create_buffer_struct_type})
|
|
74
|
+
self.buffer_capture_objects = self.capture_objects
|
|
75
|
+
""" objects for buffer. Change with access_selection """
|
|
76
|
+
|
|
77
|
+
def __create_buffer_struct_type(self):
|
|
78
|
+
""" TODO: more refactoring !!! """
|
|
79
|
+
# rename ObjectDefinition's and adding object if it absense in collection
|
|
80
|
+
el_value: ObjectDefinition
|
|
81
|
+
if self.capture_objects is None:
|
|
82
|
+
raise ValueError(F"{self}: create buffer Struct type, not set <capture_object> attribute. Need initiate <capture_objects> before")
|
|
83
|
+
for el_value in self.capture_objects:
|
|
84
|
+
self.collection.add_if_missing(
|
|
85
|
+
class_id=ut.CosemClassId(el_value.class_id.contents),
|
|
86
|
+
version=None,
|
|
87
|
+
logical_name=el_value.logical_name)
|
|
88
|
+
el_value.set_name(self.collection.get_name_and_type(el_value)[0][-1])
|
|
89
|
+
self.buffer_capture_objects = self.capture_objects
|
|
90
|
+
self.buffer.set_type(self.capture_objects.__class__)
|