Skip to content

Commit

Permalink
get_serial_from_name for transducer and ds
Browse files Browse the repository at this point in the history
  • Loading branch information
MaCuinea committed Jan 24, 2025
1 parent 8017749 commit 5f229da
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
18 changes: 17 additions & 1 deletion fus_ds_package/fus_driving_systems/driving_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,20 @@ def get_ds_list():
sys.exit('No driving systems found in configuration file.')

return ds_list



def get_serial_from_name(name):
"""
Returns the serial number matching the given name.
Args:
name (str): The name of the device.
Returns:
str: The serial number, or None if no match is found.
"""

for ds in get_ds_list():
if ds.name == name:

return ds.serial
17 changes: 17 additions & 0 deletions fus_ds_package/fus_driving_systems/transducer.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,20 @@ def get_tran_list():
sys.exit('No transducers found in configuration file.')

return tran_list


def get_serial_from_name(name):
"""
Returns the serial number matching the given name.
Args:
name (str): The name of the device.
Returns:
str: The serial number, or None if no match is found.
"""

for tran in get_tran_list():
if tran.name == name:

return tran.serial

0 comments on commit 5f229da

Please sign in to comment.