Source code for rsrtx.Implementations.Mtest.Segment.Rescale.Xfactor

from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from .....Internal.Types import DataType
from .....Internal.ArgSingleList import ArgSingleList
from .....Internal.ArgSingle import ArgSingle


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

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

[docs] def set(self, mask_test: str, mask_segment: int, expans_fact_x: float) -> None: """ ``MTESt:SEGMent:RESCale:XFACtor`` \n Snippet: ``driver.mtest.segment.rescale.xfactor.set(mask_test = 'abc', mask_segment = 1, expans_fact_x = 1.0)`` \n Stretches or compresses the selected mask segment in horizontal (XFACtor) or vertical direction (YFACtor) . The x- or y-values of all points of the selected mask segment are multiplied with this factor. Factors >1 stretch the mask segment, while factors between 0 and 1 compress it. Negative values are possible and change the algebraic sign. Only takes effect after the method ``RsRtx.mtest.segment.rescale.recalculate.set()`` command. :param mask_test: -100 to 100 :param mask_segment: String with the name of the mask test :param expans_fact_x: Number of the segment. Counting starts from 0. """ param = ArgSingleList().compose_cmd_string(ArgSingle('mask_test', mask_test, DataType.String), ArgSingle('mask_segment', mask_segment, DataType.Integer), ArgSingle('expans_fact_x', expans_fact_x, DataType.Float)) self._core.io.write_with_opc(f'MTESt:SEGMent:RESCale:XFACtor {param}'.rstrip())
[docs] def get(self, mask_test: str, mask_segment: int) -> float: """ ``MTESt:SEGMent:RESCale:XFACtor`` \n Snippet: ``value: float = driver.mtest.segment.rescale.xfactor.get(mask_test = 'abc', mask_segment = 1)`` \n Stretches or compresses the selected mask segment in horizontal (XFACtor) or vertical direction (YFACtor) . The x- or y-values of all points of the selected mask segment are multiplied with this factor. Factors >1 stretch the mask segment, while factors between 0 and 1 compress it. Negative values are possible and change the algebraic sign. Only takes effect after the method ``RsRtx.mtest.segment.rescale.recalculate.set()`` command. :param mask_test: -100 to 100 :param mask_segment: String with the name of the mask test """ param = ArgSingleList().compose_cmd_string(ArgSingle('mask_test', mask_test, DataType.String), ArgSingle('mask_segment', mask_segment, DataType.Integer)) response = self._core.io.query_str_with_opc(f'MTESt:SEGMent:RESCale:XFACtor? {param}'.rstrip()) return Conversions.str_to_float(response)