Source code for RsSmw.Implementations.Unit

from ..Internal.Core import Core
from ..Internal.CommandsGroup import CommandsGroup
from ..Internal import Conversions
from .. import enums


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class UnitCls:
	"""
	| Commands in total: 3
	| Subgroups: 0
	| Direct child commands: 3
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("unit", core, parent)

	# noinspection PyTypeChecker
[docs] def get_angle(self) -> enums.UnitAngle: """ ``UNIT:ANGLe`` \n Snippet: ``value: enums.UnitAngle = driver.unit.get_angle()`` \n Sets the default unit for phase modulation angle. The command affects no other parameters, such as RF phase, or the manual control or display. :return: angle: DEGree | DEGRee | RADian """ response = self._core.io.query_str('UNIT:ANGLe?') return Conversions.str_to_scalar_enum(response, enums.UnitAngle)
[docs] def set_angle(self, angle: enums.UnitAngle) -> None: """ ``UNIT:ANGLe`` \n Snippet: ``driver.unit.set_angle(angle = enums.UnitAngle.DEGree)`` \n Sets the default unit for phase modulation angle. The command affects no other parameters, such as RF phase, or the manual control or display. :param angle: DEGree | DEGRee | RADian """ param = Conversions.enum_scalar_to_str(angle, enums.UnitAngle) self._core.io.write(f'UNIT:ANGLe {param}')
# noinspection PyTypeChecker
[docs] def get_power(self) -> enums.UnitPower: """ ``UNIT:POWer`` \n Snippet: ``value: enums.UnitPower = driver.unit.get_power()`` \n Sets the default unit for all power parameters. This setting affects the GUI, as well as all remote control commands that determine power values. :return: power: V | DBUV | DBM """ response = self._core.io.query_str('UNIT:POWer?') return Conversions.str_to_scalar_enum(response, enums.UnitPower)
[docs] def set_power(self, power: enums.UnitPower) -> None: """ ``UNIT:POWer`` \n Snippet: ``driver.unit.set_power(power = enums.UnitPower.DBM)`` \n Sets the default unit for all power parameters. This setting affects the GUI, as well as all remote control commands that determine power values. :param power: V | DBUV | DBM """ param = Conversions.enum_scalar_to_str(power, enums.UnitPower) self._core.io.write(f'UNIT:POWer {param}')
# noinspection PyTypeChecker
[docs] def get_velocity(self) -> enums.UnitSpeed: """ ``UNIT:VELocity`` \n Snippet: ``value: enums.UnitSpeed = driver.unit.get_velocity()`` \n Sets the default unit for the velocity of the wave. :return: velocity: MPS | KMH | MPH | NMPH """ response = self._core.io.query_str('UNIT:VELocity?') return Conversions.str_to_scalar_enum(response, enums.UnitSpeed)
[docs] def set_velocity(self, velocity: enums.UnitSpeed) -> None: """ ``UNIT:VELocity`` \n Snippet: ``driver.unit.set_velocity(velocity = enums.UnitSpeed.KMH)`` \n Sets the default unit for the velocity of the wave. :param velocity: MPS | KMH | MPH | NMPH """ param = Conversions.enum_scalar_to_str(velocity, enums.UnitSpeed) self._core.io.write(f'UNIT:VELocity {param}')