from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class SpeedCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("speed", core, parent)
# noinspection PyTypeChecker
[docs]
def get_unit(self) -> enums.UnitSpeed:
"""
``[SOURce<HW>]:FSIMulator:SPEed:UNIT`` \n
Snippet: ``value: enums.UnitSpeed = driver.source.fsimulator.speed.get_unit()`` \n
Sets the unit for the speed of a moving receiver. Note that this setting only changes the speed unit in local mode.
To set the speed units via remote control set the unit after the speed value.
:return: unit: MPS | KMH | MPH | NMPH
"""
response = self._core.io.query_str('SOURce<HwInstance>:FSIMulator:SPEed:UNIT?')
return Conversions.str_to_scalar_enum(response, enums.UnitSpeed)
[docs]
def set_unit(self, unit: enums.UnitSpeed) -> None:
"""
``[SOURce<HW>]:FSIMulator:SPEed:UNIT`` \n
Snippet: ``driver.source.fsimulator.speed.set_unit(unit = enums.UnitSpeed.KMH)`` \n
Sets the unit for the speed of a moving receiver. Note that this setting only changes the speed unit in local mode.
To set the speed units via remote control set the unit after the speed value.
:param unit: MPS | KMH | MPH | NMPH
"""
param = Conversions.enum_scalar_to_str(unit, enums.UnitSpeed)
self._core.io.write(f'SOURce<HwInstance>:FSIMulator:SPEed:UNIT {param}')