Skip to content

Commit 710aa32

Browse files
committed
modeling: replace 1-18:1-2 with 1-36
1 parent 75215c8 commit 710aa32

2 files changed

Lines changed: 14 additions & 27 deletions

File tree

absscpi/client.py

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
DIGITAL_INPUT_COUNT = 4
1919
GLOBAL_MODEL_INPUT_COUNT = 8
2020
LOCAL_MODEL_INPUT_COUNT = 8
21-
MODEL_OUTPUT_COUNT = 18
21+
MODEL_OUTPUT_COUNT = 36
2222

2323
class AbsCellFault(IntEnum):
2424
"""ABS cell faulting mode."""
@@ -91,16 +91,6 @@ def get_version(self) -> str:
9191
"""Get the model's version."""
9292
return self.version.decode()
9393

94-
class AbsModelOutputPair(Structure):
95-
"""ABS model output pair."""
96-
97-
_fields_ = [("value_0", c_float),
98-
("value_1", c_float)]
99-
100-
def to_tuple(self) -> tuple[float, float]:
101-
"""Get the values as a tuple."""
102-
return (self.value_0.value, self.value_1.value)
103-
10494
class AbsEthernetDiscoveryResult(Structure):
10595
"""ABS Ethernet discovery result."""
10696

@@ -1455,38 +1445,38 @@ def get_all_local_model_inputs(self) -> list[float]:
14551445
self.__check_err(res)
14561446
return vals[:]
14571447

1458-
def get_model_output(self, index: int) -> tuple[float, float]:
1459-
"""Query a single pair of model outputs.
1448+
def get_model_output(self, index: int) -> float:
1449+
"""Query a single model output.
14601450
14611451
Args:
1462-
index: Output index, 0-17.
1452+
index: Output index, 0-35.
14631453
14641454
Returns:
1465-
The model output pair.
1455+
The model output.
14661456
14671457
Raises:
14681458
ScpiClientError: An error occurred while executing the query.
14691459
"""
1470-
pair = AbsModelOutputPair()
1460+
val = c_float()
14711461
res = self.__dll.AbsScpiClient_GetModelOutput(
1472-
self.__handle, c_uint(index), byref(pair))
1462+
self.__handle, c_uint(index), byref(val))
14731463
self.__check_err(res)
1474-
return pair.to_tuple()
1464+
return val.value
14751465

1476-
def get_all_model_outputs(self) -> list[tuple[float, float]]:
1477-
"""Query all model output pairs.
1466+
def get_all_model_outputs(self) -> list[float]:
1467+
"""Query all model outputs.
14781468
14791469
Returns:
1480-
A list of all model output pairs.
1470+
A list of all model outputs.
14811471
14821472
Raises:
14831473
ScpiClientError: An error occurred while executing the query.
14841474
"""
1485-
pairs = (AbsModelOutputPair * MODEL_OUTPUT_COUNT)()
1475+
values = (c_float * MODEL_OUTPUT_COUNT)()
14861476
res = self.__dll.AbsScpiClient_GetAllModelOutputs(
1487-
self.__handle, byref(pairs), c_uint(MODEL_OUTPUT_COUNT))
1477+
self.__handle, byref(values), c_uint(MODEL_OUTPUT_COUNT))
14881478
self.__check_err(res)
1489-
return [p.to_tuple() for p in pairs]
1479+
return values[:]
14901480

14911481
def multicast_discovery(
14921482
self,

docs/util.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ Structures
3232
.. autoclass:: absscpi.AbsModelInfo
3333
:members:
3434

35-
.. autoclass:: absscpi.AbsModelOutputPair
36-
:members:
37-
3835
.. autoclass:: absscpi.AbsEthernetDiscoveryResult
3936
:members:
4037

0 commit comments

Comments
 (0)