[docs]classTimeCls:"""Time commands group definition. 12 total commands, 3 Subgroups, 4 group commands"""def__init__(self,core:Core,parent):self._core=coreself._cmd_group=CommandsGroup("time",core,parent)@propertydefdaylightSavingTime(self):"""daylightSavingTime commands group. 1 Sub-classes, 1 commands."""ifnothasattr(self,'_daylightSavingTime'):from.DaylightSavingTimeimportDaylightSavingTimeClsself._daylightSavingTime=DaylightSavingTimeCls(self._core,self._cmd_group)returnself._daylightSavingTime@propertydefhrTimer(self):"""hrTimer commands group. 1 Sub-classes, 1 commands."""ifnothasattr(self,'_hrTimer'):from.HrTimerimportHrTimerClsself._hrTimer=HrTimerCls(self._core,self._cmd_group)returnself._hrTimer@propertydefzone(self):"""zone commands group. 0 Sub-classes, 2 commands."""ifnothasattr(self,'_zone'):from.ZoneimportZoneClsself._zone=ZoneCls(self._core,self._cmd_group)returnself._zone
[docs]defset(self,hour:int,minute:int,second:int)->None:"""SCPI: SYSTem:TIME \n Snippet: driver.system.time.set(hour = 1, minute = 1, second = 1) \n Queries or sets the time for the instrument-internal clock. This is a password-protected function. Unlock the protection level 1 to access it. See method RsSmbv.System.Protect.State.set. \n :param hour: integer Range: 0 to 23 :param minute: integer Range: 0 to 59 :param second: integer Range: 0 to 59 """param=ArgSingleList().compose_cmd_string(ArgSingle('hour',hour,DataType.Integer),ArgSingle('minute',minute,DataType.Integer),ArgSingle('second',second,DataType.Integer))self._core.io.write(f'SYSTem:TIME {param}'.rstrip())
# noinspection PyTypeChecker
[docs]classTimeStruct(StructBase):"""Response structure. Fields: \n - Hour: int: integer Range: 0 to 23 - Minute: int: integer Range: 0 to 59 - Second: int: integer Range: 0 to 59"""__meta_args_list=[ArgStruct.scalar_int('Hour'),ArgStruct.scalar_int('Minute'),ArgStruct.scalar_int('Second')]def__init__(self):StructBase.__init__(self,self)self.Hour:int=Noneself.Minute:int=Noneself.Second:int=None
[docs]defget(self)->TimeStruct:"""SCPI: SYSTem:TIME \n Snippet: value: TimeStruct = driver.system.time.get() \n Queries or sets the time for the instrument-internal clock. This is a password-protected function. Unlock the protection level 1 to access it. See method RsSmbv.System.Protect.State.set. \n :return: structure: for return value, see the help for TimeStruct structure arguments."""returnself._core.io.query_struct(f'SYSTem:TIME?',self.__class__.TimeStruct())
[docs]defget_local(self)->str:"""SCPI: SYSTem:TIME:LOCal \n Snippet: value: str = driver.system.time.get_local() \n No command help available \n :return: pseudo_string: No help available """response=self._core.io.query_str('SYSTem:TIME:LOCal?')returntrim_str_response(response)
[docs]defset_local(self,pseudo_string:str)->None:"""SCPI: SYSTem:TIME:LOCal \n Snippet: driver.system.time.set_local(pseudo_string = 'abc') \n No command help available \n :param pseudo_string: No help available """param=Conversions.value_to_quoted_str(pseudo_string)self._core.io.write(f'SYSTem:TIME:LOCal {param}')
# noinspection PyTypeChecker
[docs]defget_protocol(self)->enums.TimeProtocol:"""SCPI: SYSTem:TIME:PROTocol \n Snippet: value: enums.TimeProtocol = driver.system.time.get_protocol() \n Sets the date and time of the operating system. \n :return: time_protocol: OFF| NONE| 0| NTP| ON| 1 NONE Sets the date and time according to the selected timezone, see method RsSmbv.System.Time.Zone.catalog and method RsSmbv.System.Time.Zone.value. NTP Sets the date and time derived from the network time protocol. To select the NTP time server, use the commands method RsSmbv.System.Ntp.hostname and SYSTem:NTP:STATe. """response=self._core.io.query_str('SYSTem:TIME:PROTocol?')returnConversions.str_to_scalar_enum(response,enums.TimeProtocol)
[docs]defset_protocol(self,time_protocol:enums.TimeProtocol)->None:"""SCPI: SYSTem:TIME:PROTocol \n Snippet: driver.system.time.set_protocol(time_protocol = enums.TimeProtocol._0) \n Sets the date and time of the operating system. \n :param time_protocol: OFF| NONE| 0| NTP| ON| 1 NONE Sets the date and time according to the selected timezone, see method RsSmbv.System.Time.Zone.catalog and method RsSmbv.System.Time.Zone.value. NTP Sets the date and time derived from the network time protocol. To select the NTP time server, use the commands method RsSmbv.System.Ntp.hostname and SYSTem:NTP:STATe. """param=Conversions.enum_scalar_to_str(time_protocol,enums.TimeProtocol)self._core.io.write(f'SYSTem:TIME:PROTocol {param}')
[docs]defget_utc(self)->str:"""SCPI: SYSTem:TIME:UTC \n Snippet: value: str = driver.system.time.get_utc() \n No command help available \n :return: pseudo_string: No help available """response=self._core.io.query_str('SYSTem:TIME:UTC?')returntrim_str_response(response)
[docs]defset_utc(self,pseudo_string:str)->None:"""SCPI: SYSTem:TIME:UTC \n Snippet: driver.system.time.set_utc(pseudo_string = 'abc') \n No command help available \n :param pseudo_string: No help available """param=Conversions.value_to_quoted_str(pseudo_string)self._core.io.write(f'SYSTem:TIME:UTC {param}')
defclone(self)->'TimeCls':"""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=TimeCls(self._core,self._cmd_group.parent)self._cmd_group.synchronize_repcaps(new_group)returnnew_group