from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ...Internal.Utilities import trim_str_response
from ...Internal.StructBase import StructBase
from ...Internal.ArgStruct import ArgStruct
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class SystemCls:
"""
| Commands in total: 21
| Subgroups: 6
| Direct child commands: 4
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("system", core, parent)
@property
def display(self):
"""
| Commands in total: 3
| Subgroups: 1
| Direct child commands: 1
"""
if not hasattr(self, '_display'):
from .Display import DisplayCls
self._display = DisplayCls(self._core, self._cmd_group)
return self._display
@property
def device(self):
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
if not hasattr(self, '_device'):
from .Device import DeviceCls
self._device = DeviceCls(self._core, self._cmd_group)
return self._device
@property
def date(self):
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
if not hasattr(self, '_date'):
from .Date import DateCls
self._date = DateCls(self._core, self._cmd_group)
return self._date
@property
def communicate(self):
"""
| Commands in total: 10
| Subgroups: 3
| Direct child commands: 0
"""
if not hasattr(self, '_communicate'):
from .Communicate import CommunicateCls
self._communicate = CommunicateCls(self._core, self._cmd_group)
return self._communicate
@property
def exit(self):
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
if not hasattr(self, '_exit'):
from .Exit import ExitCls
self._exit = ExitCls(self._core, self._cmd_group)
return self._exit
@property
def shutdown(self):
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
if not hasattr(self, '_shutdown'):
from .Shutdown import ShutdownCls
self._shutdown = ShutdownCls(self._core, self._cmd_group)
return self._shutdown
[docs]
def get_klock(self) -> bool:
"""
``SYSTem:KLOCk`` \n
Snippet: ``value: bool = driver.system.get_klock()`` \n
Locks or unlocks the local controls of the instrument. This includes the front panel keys, the keyboard, or other local
interfaces. except for the View button on the display.
"""
response = self._core.io.query_str_with_opc('SYSTem:KLOCk?')
return Conversions.str_to_bool(response)
[docs]
def set_klock(self, lock: bool) -> None:
"""
``SYSTem:KLOCk`` \n
Snippet: ``driver.system.set_klock(lock = False)`` \n
Locks or unlocks the local controls of the instrument. This includes the front panel keys, the keyboard, or other local
interfaces. except for the View button on the display.
:param lock: ON | 1: Locks the local keys OFF | 0: Keys are unlocked
"""
param = Conversions.bool_to_str(lock)
self._core.io.write_with_opc(f'SYSTem:KLOCk {param}')
# noinspection PyTypeChecker
[docs]
class TimeStruct(StructBase):
"""
Structure for reading output parameters. Fields: \n
- Hour: int: No parameter help available
- Minute: int: No parameter help available
- Day: int: No parameter help available
"""
__meta_args_list = [
ArgStruct.scalar_int('Hour'),
ArgStruct.scalar_int('Minute'),
ArgStruct.scalar_int('Day')]
def __init__(self):
StructBase.__init__(self, self)
self.Hour: int=None
self.Minute: int=None
self.Day: int=None
[docs]
def get_time(self) -> TimeStruct:
"""
``SYSTem:TIME`` \n
Snippet: ``value: TimeStruct = driver.system.get_time()`` \n
Returns the UTC (Universal Time Coordinated) of the internal clock. To define the current local time, use the time zone
setting of the operating system
:return: structure: for return value, see the help for TimeStruct structure arguments.
"""
return self._core.io.query_struct('SYSTem:TIME?', self.__class__.TimeStruct())
[docs]
def get_language(self) -> str:
"""
``SYSTem:LANGuage`` \n
Snippet: ``value: str = driver.system.get_language()`` \n
Defines the remote control behavior of the instrument and sets the remote control command set.
:return: language: String value. Available values: 'SCPI': R&S RTO6 remote command set is used. 'DPO7000' or 'TDS540': Compatible remote command set of Tektronix oscilloscopes DPO7000 or TDS540 is used. If one of these emulation modes is used, you can define alternative responses to the IDN*? and OPT*? commands on the Menu Settings System Remote SCPI Emulation tab.
"""
response = self._core.io.query_str_with_opc('SYSTem:LANGuage?')
return trim_str_response(response)
[docs]
def set_language(self, language: str) -> None:
"""
``SYSTem:LANGuage`` \n
Snippet: ``driver.system.set_language(language = 'abc')`` \n
Defines the remote control behavior of the instrument and sets the remote control command set.
:param language: String value. Available values: 'SCPI': R&S RTO6 remote command set is used. 'DPO7000' or 'TDS540': Compatible remote command set of Tektronix oscilloscopes DPO7000 or TDS540 is used. If one of these emulation modes is used, you can define alternative responses to the IDN*? and OPT*? commands on the Menu Settings System Remote SCPI Emulation tab.
"""
param = Conversions.value_to_quoted_str(language)
self._core.io.write_with_opc(f'SYSTem:LANGuage {param}')
def clone(self) -> 'SystemCls':
"""
Clones the group by creating new object from it and its whole existing subgroups.
Also copies all the existing default Repeated Capabilities setting,
which you can change independently without affecting the original group.
"""
new_group = SystemCls(self._core, self._cmd_group.parent)
self._cmd_group.synchronize_repcaps(new_group)
return new_group