Skip to content

Commit b475aef

Browse files
committed
feat: add model ID query
1 parent 21ef718 commit b475aef

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

absscpi/client.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,22 @@ def get_model_info(self) -> AbsModelInfo:
13331333
self.__check_err(res)
13341334
return info
13351335

1336+
def get_model_id(self) -> str:
1337+
"""Query the ID of the currently loaded model. This ID is user-defined
1338+
and is not used by the unit. It is intended for use by tools.
1339+
1340+
Returns:
1341+
Model ID.
1342+
1343+
Raises:
1344+
ScpiClientError: An error occurred while executing the query.
1345+
"""
1346+
buf = create_string_buffer(256)
1347+
res = self.__dll.AbsScpiClient_GetModelId(
1348+
self.__handle, byref(buf), c_uint(len(buf)))
1349+
self.__check_err(res)
1350+
return buf.value.decode()
1351+
13361352
def set_global_model_input(self, index: int, value: float):
13371353
"""Set a single global model input.
13381354

0 commit comments

Comments
 (0)