conson-xp 1.34.0__py3-none-any.whl → 1.35.0__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.
- {conson_xp-1.34.0.dist-info → conson_xp-1.35.0.dist-info}/METADATA +1 -1
- {conson_xp-1.34.0.dist-info → conson_xp-1.35.0.dist-info}/RECORD +29 -29
- xp/__init__.py +1 -1
- xp/cli/commands/conbus/conbus_actiontable_commands.py +34 -35
- xp/cli/commands/conbus/conbus_autoreport_commands.py +11 -10
- xp/cli/commands/conbus/conbus_custom_commands.py +6 -4
- xp/cli/commands/conbus/conbus_datapoint_commands.py +8 -6
- xp/cli/commands/conbus/conbus_lightlevel_commands.py +19 -16
- xp/cli/commands/conbus/conbus_linknumber_commands.py +7 -6
- xp/cli/commands/conbus/conbus_modulenumber_commands.py +7 -6
- xp/cli/commands/conbus/conbus_msactiontable_commands.py +7 -9
- xp/cli/commands/conbus/conbus_output_commands.py +9 -7
- xp/cli/commands/conbus/conbus_raw_commands.py +7 -2
- xp/cli/commands/conbus/conbus_scan_commands.py +4 -2
- xp/services/conbus/actiontable/actiontable_download_service.py +79 -37
- xp/services/conbus/actiontable/actiontable_list_service.py +17 -17
- xp/services/conbus/actiontable/actiontable_upload_service.py +78 -36
- xp/services/conbus/actiontable/msactiontable_service.py +88 -48
- xp/services/conbus/conbus_custom_service.py +81 -26
- xp/services/conbus/conbus_datapoint_queryall_service.py +90 -43
- xp/services/conbus/conbus_datapoint_service.py +76 -28
- xp/services/conbus/conbus_output_service.py +82 -22
- xp/services/conbus/conbus_raw_service.py +78 -37
- xp/services/conbus/conbus_scan_service.py +86 -42
- xp/services/conbus/write_config_service.py +76 -26
- xp/utils/dependencies.py +10 -20
- {conson_xp-1.34.0.dist-info → conson_xp-1.35.0.dist-info}/WHEEL +0 -0
- {conson_xp-1.34.0.dist-info → conson_xp-1.35.0.dist-info}/entry_points.txt +0 -0
- {conson_xp-1.34.0.dist-info → conson_xp-1.35.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -6,43 +6,50 @@ telegrams to scan modules for all datapoints by function code.
|
|
|
6
6
|
|
|
7
7
|
import logging
|
|
8
8
|
from datetime import datetime
|
|
9
|
-
from typing import
|
|
9
|
+
from typing import Any, Optional
|
|
10
10
|
|
|
11
|
-
from
|
|
11
|
+
from psygnal import Signal
|
|
12
12
|
|
|
13
|
-
from xp.models import
|
|
14
|
-
ConbusClientConfig,
|
|
15
|
-
ConbusResponse,
|
|
16
|
-
)
|
|
13
|
+
from xp.models import ConbusResponse
|
|
17
14
|
from xp.models.protocol.conbus_protocol import TelegramReceivedEvent
|
|
18
|
-
from xp.services.protocol import
|
|
15
|
+
from xp.services.protocol.conbus_event_protocol import ConbusEventProtocol
|
|
19
16
|
|
|
20
17
|
|
|
21
|
-
class ConbusScanService
|
|
18
|
+
class ConbusScanService:
|
|
22
19
|
"""
|
|
23
20
|
Service for scanning modules for all datapoints by function code.
|
|
24
21
|
|
|
25
|
-
Uses
|
|
22
|
+
Uses ConbusEventProtocol to provide scan functionality for discovering
|
|
26
23
|
all available datapoints on a module.
|
|
24
|
+
|
|
25
|
+
Attributes:
|
|
26
|
+
conbus_protocol: Protocol instance for Conbus communication.
|
|
27
|
+
on_progress: Signal emitted when scan progress is made (with telegram frame).
|
|
28
|
+
on_finish: Signal emitted when scan finishes (with result).
|
|
27
29
|
"""
|
|
28
30
|
|
|
31
|
+
on_progress: Signal = Signal(str)
|
|
32
|
+
on_finish: Signal = Signal(ConbusResponse)
|
|
33
|
+
|
|
29
34
|
def __init__(
|
|
30
35
|
self,
|
|
31
|
-
|
|
32
|
-
reactor: PosixReactorBase,
|
|
36
|
+
conbus_protocol: ConbusEventProtocol,
|
|
33
37
|
) -> None:
|
|
34
38
|
"""Initialize the Conbus scan service.
|
|
35
39
|
|
|
36
40
|
Args:
|
|
37
|
-
|
|
38
|
-
reactor: Twisted reactor instance.
|
|
41
|
+
conbus_protocol: ConbusEventProtocol instance.
|
|
39
42
|
"""
|
|
40
|
-
|
|
43
|
+
self.conbus_protocol = conbus_protocol
|
|
44
|
+
self.conbus_protocol.on_connection_made.connect(self.connection_made)
|
|
45
|
+
self.conbus_protocol.on_telegram_sent.connect(self.telegram_sent)
|
|
46
|
+
self.conbus_protocol.on_telegram_received.connect(self.telegram_received)
|
|
47
|
+
self.conbus_protocol.on_timeout.connect(self.timeout)
|
|
48
|
+
self.conbus_protocol.on_failed.connect(self.failed)
|
|
49
|
+
|
|
41
50
|
self.serial_number: str = ""
|
|
42
51
|
self.function_code: str = ""
|
|
43
52
|
self.datapoint_value: int = -1
|
|
44
|
-
self.progress_callback: Optional[Callable[[str], None]] = None
|
|
45
|
-
self.finish_callback: Optional[Callable[[ConbusResponse], None]] = None
|
|
46
53
|
self.service_response: ConbusResponse = ConbusResponse(
|
|
47
54
|
success=False,
|
|
48
55
|
serial_number=self.serial_number,
|
|
@@ -53,8 +60,8 @@ class ConbusScanService(ConbusProtocol):
|
|
|
53
60
|
# Set up logging
|
|
54
61
|
self.logger = logging.getLogger(__name__)
|
|
55
62
|
|
|
56
|
-
def
|
|
57
|
-
"""Handle connection
|
|
63
|
+
def connection_made(self) -> None:
|
|
64
|
+
"""Handle connection made event."""
|
|
58
65
|
self.logger.debug("Connection established, starting scan")
|
|
59
66
|
self.scan_next_datacode()
|
|
60
67
|
|
|
@@ -66,14 +73,13 @@ class ConbusScanService(ConbusProtocol):
|
|
|
66
73
|
"""
|
|
67
74
|
self.datapoint_value += 1
|
|
68
75
|
if self.datapoint_value >= 100:
|
|
69
|
-
|
|
70
|
-
self.finish_callback(self.service_response)
|
|
76
|
+
self.on_finish.emit(self.service_response)
|
|
71
77
|
return False
|
|
72
78
|
|
|
73
79
|
self.logger.debug(f"Scanning next datacode: {self.datapoint_value:02d}")
|
|
74
80
|
data = f"{self.datapoint_value:02d}"
|
|
75
81
|
telegram_body = f"S{self.serial_number}F{self.function_code}D{data}"
|
|
76
|
-
self.sendFrame(telegram_body.encode())
|
|
82
|
+
self.conbus_protocol.sendFrame(telegram_body.encode())
|
|
77
83
|
return True
|
|
78
84
|
|
|
79
85
|
def telegram_sent(self, telegram_sent: str) -> None:
|
|
@@ -96,18 +102,13 @@ class ConbusScanService(ConbusProtocol):
|
|
|
96
102
|
self.service_response.received_telegrams = []
|
|
97
103
|
self.service_response.received_telegrams.append(telegram_received.frame)
|
|
98
104
|
|
|
99
|
-
|
|
100
|
-
self.progress_callback(telegram_received.frame)
|
|
101
|
-
|
|
102
|
-
def timeout(self) -> bool:
|
|
103
|
-
"""Handle timeout event by scanning next data code.
|
|
105
|
+
self.on_progress.emit(telegram_received.frame)
|
|
104
106
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
self.logger.debug(f"Timeout: {
|
|
109
|
-
|
|
110
|
-
return continue_scan
|
|
107
|
+
def timeout(self) -> None:
|
|
108
|
+
"""Handle timeout event by scanning next data code."""
|
|
109
|
+
timeout_seconds = self.conbus_protocol.timeout_seconds
|
|
110
|
+
self.logger.debug(f"Timeout: {timeout_seconds}s")
|
|
111
|
+
self.scan_next_datacode()
|
|
111
112
|
|
|
112
113
|
def failed(self, message: str) -> None:
|
|
113
114
|
"""Handle failed connection event.
|
|
@@ -119,15 +120,12 @@ class ConbusScanService(ConbusProtocol):
|
|
|
119
120
|
self.service_response.success = False
|
|
120
121
|
self.service_response.timestamp = datetime.now()
|
|
121
122
|
self.service_response.error = message
|
|
122
|
-
|
|
123
|
-
self.finish_callback(self.service_response)
|
|
123
|
+
self.on_finish.emit(self.service_response)
|
|
124
124
|
|
|
125
125
|
def scan_module(
|
|
126
126
|
self,
|
|
127
127
|
serial_number: str,
|
|
128
128
|
function_code: str,
|
|
129
|
-
progress_callback: Callable[[str], None],
|
|
130
|
-
finish_callback: Callable[[ConbusResponse], None],
|
|
131
129
|
timeout_seconds: float = 0.25,
|
|
132
130
|
) -> None:
|
|
133
131
|
"""Scan a module for all datapoints by function code.
|
|
@@ -135,16 +133,62 @@ class ConbusScanService(ConbusProtocol):
|
|
|
135
133
|
Args:
|
|
136
134
|
serial_number: 10-digit module serial number.
|
|
137
135
|
function_code: The function code to scan.
|
|
138
|
-
progress_callback: Callback to handle progress.
|
|
139
|
-
finish_callback: Callback function to call when the scan is complete.
|
|
140
136
|
timeout_seconds: Timeout in seconds.
|
|
141
137
|
"""
|
|
142
138
|
self.logger.info("Starting scan_module")
|
|
143
139
|
if timeout_seconds:
|
|
144
|
-
self.timeout_seconds = timeout_seconds
|
|
140
|
+
self.conbus_protocol.timeout_seconds = timeout_seconds
|
|
145
141
|
|
|
146
142
|
self.serial_number = serial_number
|
|
147
143
|
self.function_code = function_code
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
144
|
+
|
|
145
|
+
def set_timeout(self, timeout_seconds: float) -> None:
|
|
146
|
+
"""Set operation timeout.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
timeout_seconds: Timeout in seconds.
|
|
150
|
+
"""
|
|
151
|
+
self.conbus_protocol.timeout_seconds = timeout_seconds
|
|
152
|
+
|
|
153
|
+
def start_reactor(self) -> None:
|
|
154
|
+
"""Start the reactor."""
|
|
155
|
+
self.conbus_protocol.start_reactor()
|
|
156
|
+
|
|
157
|
+
def stop_reactor(self) -> None:
|
|
158
|
+
"""Stop the reactor."""
|
|
159
|
+
self.conbus_protocol.stop_reactor()
|
|
160
|
+
|
|
161
|
+
def __enter__(self) -> "ConbusScanService":
|
|
162
|
+
"""Enter context manager - reset state for singleton reuse.
|
|
163
|
+
|
|
164
|
+
Returns:
|
|
165
|
+
Self for context manager protocol.
|
|
166
|
+
"""
|
|
167
|
+
# Reset state for singleton reuse
|
|
168
|
+
self.serial_number = ""
|
|
169
|
+
self.function_code = ""
|
|
170
|
+
self.datapoint_value = -1
|
|
171
|
+
self.service_response = ConbusResponse(
|
|
172
|
+
success=False,
|
|
173
|
+
serial_number="",
|
|
174
|
+
sent_telegrams=[],
|
|
175
|
+
received_telegrams=[],
|
|
176
|
+
timestamp=datetime.now(),
|
|
177
|
+
)
|
|
178
|
+
return self
|
|
179
|
+
|
|
180
|
+
def __exit__(
|
|
181
|
+
self, _exc_type: Optional[type], _exc_val: Optional[Exception], _exc_tb: Any
|
|
182
|
+
) -> None:
|
|
183
|
+
"""Exit context manager and disconnect signals."""
|
|
184
|
+
# Disconnect protocol signals
|
|
185
|
+
self.conbus_protocol.on_connection_made.disconnect(self.connection_made)
|
|
186
|
+
self.conbus_protocol.on_telegram_sent.disconnect(self.telegram_sent)
|
|
187
|
+
self.conbus_protocol.on_telegram_received.disconnect(self.telegram_received)
|
|
188
|
+
self.conbus_protocol.on_timeout.disconnect(self.timeout)
|
|
189
|
+
self.conbus_protocol.on_failed.disconnect(self.failed)
|
|
190
|
+
# Disconnect service signals
|
|
191
|
+
self.on_progress.disconnect()
|
|
192
|
+
self.on_finish.disconnect()
|
|
193
|
+
# Stop reactor
|
|
194
|
+
self.stop_reactor()
|
|
@@ -5,49 +5,49 @@ This service handles setting link numbers for modules through Conbus telegrams.
|
|
|
5
5
|
|
|
6
6
|
import logging
|
|
7
7
|
from datetime import datetime
|
|
8
|
-
from typing import
|
|
8
|
+
from typing import Any, Optional
|
|
9
9
|
|
|
10
|
-
from
|
|
10
|
+
from psygnal import Signal
|
|
11
11
|
|
|
12
|
-
from xp.models import ConbusClientConfig
|
|
13
12
|
from xp.models.conbus.conbus_writeconfig import ConbusWriteConfigResponse
|
|
14
13
|
from xp.models.protocol.conbus_protocol import TelegramReceivedEvent
|
|
15
14
|
from xp.models.telegram.datapoint_type import DataPointType
|
|
16
15
|
from xp.models.telegram.system_function import SystemFunction
|
|
17
16
|
from xp.models.telegram.telegram_type import TelegramType
|
|
18
|
-
from xp.services.protocol import
|
|
17
|
+
from xp.services.protocol.conbus_event_protocol import ConbusEventProtocol
|
|
19
18
|
from xp.services.telegram.telegram_service import TelegramService
|
|
20
19
|
|
|
21
20
|
|
|
22
|
-
class WriteConfigService
|
|
23
|
-
"""
|
|
24
|
-
Service for writing module settings via Conbus telegrams.
|
|
21
|
+
class WriteConfigService:
|
|
22
|
+
"""Service for writing module settings via Conbus telegrams.
|
|
25
23
|
|
|
26
24
|
Handles setting assignment by sending F04DXX telegrams and processing
|
|
27
25
|
ACK/NAK responses from modules.
|
|
26
|
+
|
|
27
|
+
Attributes:
|
|
28
|
+
conbus_protocol: Protocol for Conbus communication.
|
|
29
|
+
telegram_service: Service for parsing telegrams.
|
|
30
|
+
on_finish: Signal emitted when write operation completes (with response).
|
|
28
31
|
"""
|
|
29
32
|
|
|
33
|
+
on_finish: Signal = Signal(ConbusWriteConfigResponse)
|
|
34
|
+
|
|
30
35
|
def __init__(
|
|
31
36
|
self,
|
|
37
|
+
conbus_protocol: ConbusEventProtocol,
|
|
32
38
|
telegram_service: TelegramService,
|
|
33
|
-
cli_config: ConbusClientConfig,
|
|
34
|
-
reactor: PosixReactorBase,
|
|
35
39
|
) -> None:
|
|
36
40
|
"""Initialize the Conbus link number set service.
|
|
37
41
|
|
|
38
42
|
Args:
|
|
43
|
+
conbus_protocol: Protocol for Conbus communication.
|
|
39
44
|
telegram_service: Service for parsing telegrams.
|
|
40
|
-
cli_config: Configuration for Conbus client connection.
|
|
41
|
-
reactor: Twisted reactor for event loop.
|
|
42
45
|
"""
|
|
43
|
-
|
|
46
|
+
self.conbus_protocol = conbus_protocol
|
|
44
47
|
self.telegram_service = telegram_service
|
|
45
48
|
self.datapoint_type: Optional[DataPointType] = None
|
|
46
49
|
self.serial_number: str = ""
|
|
47
50
|
self.data_value: str = ""
|
|
48
|
-
self.write_config_finished_callback: Optional[
|
|
49
|
-
Callable[[ConbusWriteConfigResponse], None]
|
|
50
|
-
] = None
|
|
51
51
|
self.write_config_response: ConbusWriteConfigResponse = (
|
|
52
52
|
ConbusWriteConfigResponse(
|
|
53
53
|
success=False,
|
|
@@ -58,8 +58,15 @@ class WriteConfigService(ConbusProtocol):
|
|
|
58
58
|
# Set up logging
|
|
59
59
|
self.logger = logging.getLogger(__name__)
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
# Connect protocol signals
|
|
62
|
+
self.conbus_protocol.on_connection_made.connect(self.connection_made)
|
|
63
|
+
self.conbus_protocol.on_telegram_sent.connect(self.telegram_sent)
|
|
64
|
+
self.conbus_protocol.on_telegram_received.connect(self.telegram_received)
|
|
65
|
+
self.conbus_protocol.on_timeout.connect(self.timeout)
|
|
66
|
+
self.conbus_protocol.on_failed.connect(self.failed)
|
|
67
|
+
|
|
68
|
+
def connection_made(self) -> None:
|
|
69
|
+
"""Handle connection made event."""
|
|
63
70
|
self.logger.debug(f"Connection established, writing config {self.data_value}.")
|
|
64
71
|
|
|
65
72
|
# Validate parameters before sending
|
|
@@ -79,7 +86,7 @@ class WriteConfigService(ConbusProtocol):
|
|
|
79
86
|
# Function F04 = WRITE_CONFIG,
|
|
80
87
|
# Datapoint = D datapoint_type
|
|
81
88
|
# Data = XX
|
|
82
|
-
self.send_telegram(
|
|
89
|
+
self.conbus_protocol.send_telegram(
|
|
83
90
|
telegram_type=TelegramType.SYSTEM,
|
|
84
91
|
serial_number=self.serial_number,
|
|
85
92
|
system_function=SystemFunction.WRITE_CONFIG,
|
|
@@ -133,6 +140,11 @@ class WriteConfigService(ConbusProtocol):
|
|
|
133
140
|
succeed_or_failed=succeed, system_function=reply_telegram.system_function
|
|
134
141
|
)
|
|
135
142
|
|
|
143
|
+
def timeout(self) -> None:
|
|
144
|
+
"""Handle timeout event."""
|
|
145
|
+
self.logger.debug("Timeout occurred")
|
|
146
|
+
self.finished(succeed_or_failed=False, message="Timeout")
|
|
147
|
+
|
|
136
148
|
def failed(self, message: str) -> None:
|
|
137
149
|
"""Handle telegram failed event.
|
|
138
150
|
|
|
@@ -163,16 +175,15 @@ class WriteConfigService(ConbusProtocol):
|
|
|
163
175
|
self.write_config_response.system_function = system_function
|
|
164
176
|
self.write_config_response.datapoint_type = self.datapoint_type
|
|
165
177
|
self.write_config_response.data_value = self.data_value
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
self.
|
|
178
|
+
|
|
179
|
+
# Emit finish signal
|
|
180
|
+
self.on_finish.emit(self.write_config_response)
|
|
169
181
|
|
|
170
182
|
def write_config(
|
|
171
183
|
self,
|
|
172
184
|
serial_number: str,
|
|
173
185
|
datapoint_type: DataPointType,
|
|
174
186
|
data_value: str,
|
|
175
|
-
finish_callback: Callable[[ConbusWriteConfigResponse], None],
|
|
176
187
|
timeout_seconds: Optional[float] = None,
|
|
177
188
|
) -> None:
|
|
178
189
|
"""Write config to a specific module.
|
|
@@ -181,14 +192,53 @@ class WriteConfigService(ConbusProtocol):
|
|
|
181
192
|
serial_number: 10-digit module serial number.
|
|
182
193
|
datapoint_type: the datapoint type to write to.
|
|
183
194
|
data_value: the data to write.
|
|
184
|
-
finish_callback: Callback function to call when operation completes.
|
|
185
195
|
timeout_seconds: Optional timeout in seconds.
|
|
186
196
|
"""
|
|
187
197
|
self.logger.info("Starting write_config")
|
|
188
198
|
if timeout_seconds:
|
|
189
|
-
self.timeout_seconds = timeout_seconds
|
|
199
|
+
self.conbus_protocol.timeout_seconds = timeout_seconds
|
|
190
200
|
self.serial_number = serial_number
|
|
191
201
|
self.datapoint_type = datapoint_type
|
|
192
202
|
self.data_value = data_value
|
|
193
|
-
|
|
194
|
-
|
|
203
|
+
|
|
204
|
+
def set_timeout(self, timeout_seconds: float) -> None:
|
|
205
|
+
"""Set operation timeout.
|
|
206
|
+
|
|
207
|
+
Args:
|
|
208
|
+
timeout_seconds: Timeout in seconds.
|
|
209
|
+
"""
|
|
210
|
+
self.conbus_protocol.timeout_seconds = timeout_seconds
|
|
211
|
+
|
|
212
|
+
def start_reactor(self) -> None:
|
|
213
|
+
"""Start the reactor."""
|
|
214
|
+
self.conbus_protocol.start_reactor()
|
|
215
|
+
|
|
216
|
+
def stop_reactor(self) -> None:
|
|
217
|
+
"""Stop the reactor."""
|
|
218
|
+
self.conbus_protocol.stop_reactor()
|
|
219
|
+
|
|
220
|
+
def __enter__(self) -> "WriteConfigService":
|
|
221
|
+
"""Enter context manager - reset state for singleton reuse.
|
|
222
|
+
|
|
223
|
+
Returns:
|
|
224
|
+
Self for context manager protocol.
|
|
225
|
+
"""
|
|
226
|
+
self.write_config_response = ConbusWriteConfigResponse(
|
|
227
|
+
success=False, serial_number=""
|
|
228
|
+
)
|
|
229
|
+
self.datapoint_type = None
|
|
230
|
+
self.serial_number = ""
|
|
231
|
+
self.data_value = ""
|
|
232
|
+
return self
|
|
233
|
+
|
|
234
|
+
def __exit__(
|
|
235
|
+
self, _exc_type: Optional[type], _exc_val: Optional[Exception], _exc_tb: Any
|
|
236
|
+
) -> None:
|
|
237
|
+
"""Exit context manager and disconnect signals."""
|
|
238
|
+
self.conbus_protocol.on_connection_made.disconnect(self.connection_made)
|
|
239
|
+
self.conbus_protocol.on_telegram_sent.disconnect(self.telegram_sent)
|
|
240
|
+
self.conbus_protocol.on_telegram_received.disconnect(self.telegram_received)
|
|
241
|
+
self.conbus_protocol.on_timeout.disconnect(self.timeout)
|
|
242
|
+
self.conbus_protocol.on_failed.disconnect(self.failed)
|
|
243
|
+
self.on_finish.disconnect()
|
|
244
|
+
self.stop_reactor()
|
xp/utils/dependencies.py
CHANGED
|
@@ -159,9 +159,8 @@ class ServiceContainer:
|
|
|
159
159
|
self.container.register(
|
|
160
160
|
ConbusDatapointService,
|
|
161
161
|
factory=lambda: ConbusDatapointService(
|
|
162
|
+
conbus_protocol=self.container.resolve(ConbusEventProtocol),
|
|
162
163
|
telegram_service=self.container.resolve(TelegramService),
|
|
163
|
-
cli_config=self.container.resolve(ConbusClientConfig),
|
|
164
|
-
reactor=self.container.resolve(PosixReactorBase),
|
|
165
164
|
),
|
|
166
165
|
scope=punq.Scope.singleton,
|
|
167
166
|
)
|
|
@@ -169,9 +168,8 @@ class ServiceContainer:
|
|
|
169
168
|
self.container.register(
|
|
170
169
|
ConbusDatapointQueryAllService,
|
|
171
170
|
factory=lambda: ConbusDatapointQueryAllService(
|
|
171
|
+
conbus_protocol=self.container.resolve(ConbusEventProtocol),
|
|
172
172
|
telegram_service=self.container.resolve(TelegramService),
|
|
173
|
-
cli_config=self.container.resolve(ConbusClientConfig),
|
|
174
|
-
reactor=self.container.resolve(PosixReactorBase),
|
|
175
173
|
),
|
|
176
174
|
scope=punq.Scope.singleton,
|
|
177
175
|
)
|
|
@@ -179,8 +177,7 @@ class ServiceContainer:
|
|
|
179
177
|
self.container.register(
|
|
180
178
|
ConbusScanService,
|
|
181
179
|
factory=lambda: ConbusScanService(
|
|
182
|
-
|
|
183
|
-
reactor=self.container.resolve(PosixReactorBase),
|
|
180
|
+
conbus_protocol=self.container.resolve(ConbusEventProtocol),
|
|
184
181
|
),
|
|
185
182
|
scope=punq.Scope.singleton,
|
|
186
183
|
)
|
|
@@ -283,9 +280,8 @@ class ServiceContainer:
|
|
|
283
280
|
self.container.register(
|
|
284
281
|
ConbusOutputService,
|
|
285
282
|
factory=lambda: ConbusOutputService(
|
|
283
|
+
conbus_protocol=self.container.resolve(ConbusEventProtocol),
|
|
286
284
|
telegram_output_service=self.container.resolve(TelegramOutputService),
|
|
287
|
-
cli_config=self.container.resolve(ConbusClientConfig),
|
|
288
|
-
reactor=self.container.resolve(PosixReactorBase),
|
|
289
285
|
),
|
|
290
286
|
scope=punq.Scope.singleton,
|
|
291
287
|
)
|
|
@@ -293,9 +289,8 @@ class ServiceContainer:
|
|
|
293
289
|
self.container.register(
|
|
294
290
|
WriteConfigService,
|
|
295
291
|
factory=lambda: WriteConfigService(
|
|
292
|
+
conbus_protocol=self.container.resolve(ConbusEventProtocol),
|
|
296
293
|
telegram_service=self.container.resolve(TelegramService),
|
|
297
|
-
cli_config=self.container.resolve(ConbusClientConfig),
|
|
298
|
-
reactor=self.container.resolve(PosixReactorBase),
|
|
299
294
|
),
|
|
300
295
|
scope=punq.Scope.singleton,
|
|
301
296
|
)
|
|
@@ -309,8 +304,7 @@ class ServiceContainer:
|
|
|
309
304
|
self.container.register(
|
|
310
305
|
ActionTableService,
|
|
311
306
|
factory=lambda: ActionTableService(
|
|
312
|
-
|
|
313
|
-
reactor=self.container.resolve(PosixReactorBase),
|
|
307
|
+
conbus_protocol=self.container.resolve(ConbusEventProtocol),
|
|
314
308
|
actiontable_serializer=self.container.resolve(ActionTableSerializer),
|
|
315
309
|
telegram_service=self.container.resolve(TelegramService),
|
|
316
310
|
),
|
|
@@ -320,8 +314,7 @@ class ServiceContainer:
|
|
|
320
314
|
self.container.register(
|
|
321
315
|
ActionTableUploadService,
|
|
322
316
|
factory=lambda: ActionTableUploadService(
|
|
323
|
-
|
|
324
|
-
reactor=self.container.resolve(PosixReactorBase),
|
|
317
|
+
conbus_protocol=self.container.resolve(ConbusEventProtocol),
|
|
325
318
|
actiontable_serializer=self.container.resolve(ActionTableSerializer),
|
|
326
319
|
telegram_service=self.container.resolve(TelegramService),
|
|
327
320
|
conson_config=self.container.resolve(ConsonModuleListConfig),
|
|
@@ -362,8 +355,7 @@ class ServiceContainer:
|
|
|
362
355
|
self.container.register(
|
|
363
356
|
MsActionTableService,
|
|
364
357
|
factory=lambda: MsActionTableService(
|
|
365
|
-
|
|
366
|
-
reactor=self.container.resolve(PosixReactorBase),
|
|
358
|
+
conbus_protocol=self.container.resolve(ConbusEventProtocol),
|
|
367
359
|
xp20ms_serializer=self.container.resolve(Xp20MsActionTableSerializer),
|
|
368
360
|
xp24ms_serializer=self.container.resolve(Xp24MsActionTableSerializer),
|
|
369
361
|
xp33ms_serializer=self.container.resolve(Xp33MsActionTableSerializer),
|
|
@@ -375,9 +367,8 @@ class ServiceContainer:
|
|
|
375
367
|
self.container.register(
|
|
376
368
|
ConbusCustomService,
|
|
377
369
|
factory=lambda: ConbusCustomService(
|
|
370
|
+
conbus_protocol=self.container.resolve(ConbusEventProtocol),
|
|
378
371
|
telegram_service=self.container.resolve(TelegramService),
|
|
379
|
-
cli_config=self.container.resolve(ConbusClientConfig),
|
|
380
|
-
reactor=self.container.resolve(PosixReactorBase),
|
|
381
372
|
),
|
|
382
373
|
scope=punq.Scope.singleton,
|
|
383
374
|
)
|
|
@@ -385,8 +376,7 @@ class ServiceContainer:
|
|
|
385
376
|
self.container.register(
|
|
386
377
|
ConbusRawService,
|
|
387
378
|
factory=lambda: ConbusRawService(
|
|
388
|
-
|
|
389
|
-
reactor=self.container.resolve(PosixReactorBase),
|
|
379
|
+
conbus_protocol=self.container.resolve(ConbusEventProtocol),
|
|
390
380
|
),
|
|
391
381
|
scope=punq.Scope.singleton,
|
|
392
382
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|