cut 3.3.0
Loading...
Searching...
No Matches
qeclock.QeClock Class Reference

Class that displays current time in one of 3 reference frames, formatted according to 4 different formats. More...

Public Member Functions

 set_time_format (self, TimeFormat time_format)
 Sets format in which time should be displayed.
 
 get_time_format (self)
 Returns current time format.
 
 set_reference_frame (self, ReferenceFrame reference_frame)
 Sets time reference frames.
 
 get_reference_frame (self)
 Returns current time format.
 
 set_time (self, int timestamp)
 Sets current time to be displayed in the widget.
 
 get_time_ns (self)
 Returns current time in ns.
 
 setText (self, text)
 Overwritten base class method to make sure only numerical values are set to the widget.
 
 set_longitude (self, float new_value)
 Sets longitude that's necessary to calculate LST.
 
 convert_time (self)
 Converts time value stored in self._current_ns according to selected time reference.
 
 getQtDesignerPluginInfo (cls)
 Provides Qt Designer with widget information.
 

Detailed Description

Class that displays current time in one of 3 reference frames, formatted according to 4 different formats.

By default UTC time is displayed with HHMMSS formatting. For demo purpose and to avoid warning about invalid IERS data, present-day (current for development of the widget) is set.

Attention
Important: Local time display is based on OS time so if the OS time is set as UTC (not local), LOCAL and UTC will display the same. For proper display of LST time it's important to set longitude for which the calculations are to be made. By default Garching longitude is set (11.650 deg).
When passing time (in ns) that's considered outside the range where leap-second and Earth-orientation data are reliable (~2500 year), following warning may appear:
"ErfaWarning: ERFA function "utcut1" yielded
'dubious year (Note 3)'"
When passing timestamp which date lies outside the validity range of the loaded IERS table, following warning may occur:
"Tried to get polar motions for times before IERS data is valid."

Member Function Documentation

◆ get_reference_frame()

qeclock.QeClock.get_reference_frame ( self)

Returns current time format.

Used mostly for testing purposes

◆ get_time_format()

qeclock.QeClock.get_time_format ( self)

Returns current time format.

Used mostly for testing purposes

◆ getQtDesignerPluginInfo()

qeclock.QeClock.getQtDesignerPluginInfo ( cls)

Provides Qt Designer with widget information.

Return: dict Dictionary with values for keys: icon, module, container, tool_tip and xml.

◆ set_longitude()

qeclock.QeClock.set_longitude ( self,
float new_value )

Sets longitude that's necessary to calculate LST.

By default, the longitude is set to Garching (11.650 deg)

Parameters
new_valuelongitude to be set

◆ set_reference_frame()

qeclock.QeClock.set_reference_frame ( self,
ReferenceFrame reference_frame )

Sets time reference frames.

Parameters
reference_frameTime reference frame to be set (LOCAL, UTC or LST)

◆ set_time()

qeclock.QeClock.set_time ( self,
int timestamp )

Sets current time to be displayed in the widget.

Parameters
timestampnumber of ns since epoch

◆ set_time_format()

qeclock.QeClock.set_time_format ( self,
TimeFormat time_format )

Sets format in which time should be displayed.

Parameters
time_formatTime format to be set (HHMMSS, HHMMSSc, YMDHMS or ASTRONOMICAL)

◆ setText()

qeclock.QeClock.setText ( self,
text )

Overwritten base class method to make sure only numerical values are set to the widget.

Parameters
textText to be set (automatically converted to int)
Exceptions
ValueErroris thrown when text conversion to int fails

The documentation for this class was generated from the following file: