from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ...Internal.Types import DataType
from ...Internal.Utilities import trim_str_response
from ...Internal.StructBase import StructBase
from ...Internal.ArgStruct import ArgStruct
from ...Internal.ArgSingleList import ArgSingleList
from ...Internal.ArgSingle import ArgSingle
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class DateCls:
"""
| Commands in total: 3
| Subgroups: 0
| Direct child commands: 3
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("date", core, parent)
[docs]
def set(self, year: int, month: int, day: int) -> None:
"""
``SYSTem:DATE`` \n
Snippet: ``driver.system.date.set(year = 1, month = 1, day = 1)`` \n
Queries or sets the date for the instrument-internal calendar. This is a password-protected function.
Unlock the protection level 1 to access it. See method ``RsSmw.system.protect.state.set()`` .
:param year: integer
:param month: integer Range: 1 to 12
:param day: integer Range: 1 to 31
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('year', year, DataType.Integer), ArgSingle('month', month, DataType.Integer), ArgSingle('day', day, DataType.Integer))
self._core.io.write(f'SYSTem:DATE {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
class DateStruct(StructBase):
"""
Response structure. Fields: \n
- 1 Year: int: integer
- 2 Month: int: integer Range: 1 to 12
- 3 Day: int: integer Range: 1 to 31
"""
__meta_args_list = [
ArgStruct.scalar_int('Year'),
ArgStruct.scalar_int('Month'),
ArgStruct.scalar_int('Day')]
def __init__(self):
StructBase.__init__(self, self)
self.Year: int = None
self.Month: int = None
self.Day: int = None
[docs]
def get(self) -> DateStruct:
"""
``SYSTem:DATE`` \n
Snippet: ``value: DateStruct = driver.system.date.get()`` \n
Queries or sets the date for the instrument-internal calendar. This is a password-protected function.
Unlock the protection level 1 to access it. See method ``RsSmw.system.protect.state.set()`` .
:return: structure: for return value, see the help for DateStruct structure arguments.
"""
return self._core.io.query_struct(f'SYSTem:DATE?', self.__class__.DateStruct())
[docs]
def get_local(self) -> str:
"""
``SYSTem:DATE:LOCal`` \n
Snippet: ``value: str = driver.system.date.get_local()`` \n
No help available
"""
response = self._core.io.query_str('SYSTem:DATE:LOCal?')
return trim_str_response(response)
[docs]
def set_local(self, pseudo_string: str) -> None:
"""
``SYSTem:DATE:LOCal`` \n
Snippet: ``driver.system.date.set_local(pseudo_string = 'abc')`` \n
No help available
"""
param = Conversions.value_to_quoted_str(pseudo_string)
self._core.io.write(f'SYSTem:DATE:LOCal {param}')
[docs]
def get_utc(self) -> str:
"""
``SYSTem:DATE:UTC`` \n
Snippet: ``value: str = driver.system.date.get_utc()`` \n
No help available
"""
response = self._core.io.query_str('SYSTem:DATE:UTC?')
return trim_str_response(response)
[docs]
def set_utc(self, pseudo_string: str) -> None:
"""
``SYSTem:DATE:UTC`` \n
Snippet: ``driver.system.date.set_utc(pseudo_string = 'abc')`` \n
No help available
"""
param = Conversions.value_to_quoted_str(pseudo_string)
self._core.io.write(f'SYSTem:DATE:UTC {param}')