kstars
#include <simclock.h>

Public Slots | |
void | manualTick (bool force=false) |
Q_SCRIPTABLE Q_NOREPLY void | setClockScale (float s) |
Q_SCRIPTABLE Q_NOREPLY void | setUTC (const KStarsDateTime &newtime) |
Q_SCRIPTABLE Q_NOREPLY void | start () |
Q_SCRIPTABLE Q_NOREPLY void | stop () |
void | tick () |
Signals | |
void | clockToggled (bool) |
void | scaleChanged (float) |
void | timeAdvanced () |
void | timeChanged () |
Public Member Functions | |
SimClock (QObject *parent=0, const KStarsDateTime &when=KStarsDateTime::currentDateTime()) | |
bool | isActive () |
bool | isManualMode () const |
double | scale () const |
void | setManualMode (bool on=true) |
const KStarsDateTime & | utc () const |
Detailed Description
Constructor & Destructor Documentation
|
explicit |
Constructor.
- Parameters
-
parent parent object for the clock when the date/time to which the SimClock should be initialized in UTC
Definition at line 30 of file simclock.cpp.
Member Function Documentation
|
signal |
This is an signal that is called on either clock start or clock stop with an appropriate boolean argument.
Required so that we can bind it to KToggleAction::slotToggled(bool)
bool SimClock::isActive | ( | ) |
Whether the clock is active or not is a bit complicated by the introduction of "manual mode".
In manual mode, SimClock's internal timer is stopped, because the clock is ticked manually when the current update has finished. So, if ManualMode is true, then isActive() checks whether ManualActive is true. Otherwise, it checks whether the timer is running.
- Returns
- true if the Simulation clock is actively running.
Definition at line 97 of file simclock.cpp.
|
inline |
Manual Mode is a new (04/2002) addition to the SimClock.
It is intended to be activated for large timesteps, when we want each frame drawn to the screen to be precisely Scale seconds later than the previous frame. (i.e., if the timescale is 1 year, then each successive frame should be 1 year later than the previous frame). ManualMode accomplishes this by stopping the internal timer and allowing the clock to be advanced manually (the manualTick() slot is called at the end of each KStars::updateTime()).
- Returns
- whether Manual Mode is active.
Definition at line 72 of file simclock.h.
|
slot |
Equivalent of tick() for manual mode.
If ManualActive is true, add Scale seconds to the SimClock time. (we may want to modify this slightly...e.g., the number of seconds in a year is not constant (leap years), so it is better to increment the year, instead of adding 31 million seconds.
Definition at line 90 of file simclock.cpp.
|
inline |
- Returns
- the current timestep setting
Definition at line 60 of file simclock.h.
|
signal |
The timestep has changed.
|
slot |
DBUS function to set scale of simclock.
Definition at line 157 of file simclock.cpp.
void SimClock::setManualMode | ( | bool | on = true | ) |
Sets Manual Mode on/off according to the bool argument.
Definition at line 73 of file simclock.cpp.
|
slot |
DBUS function to set the time of the SimClock.
Definition at line 136 of file simclock.cpp.
|
slot |
DBUS function to start the SimClock.
Definition at line 117 of file simclock.cpp.
|
slot |
DBUS function to stop the SimClock.
Definition at line 104 of file simclock.cpp.
|
slot |
Respond to the QTimer::timeout signal.
Definition at line 49 of file simclock.cpp.
|
signal |
The clock has ticked (emitted by tick() )
|
signal |
The time has changed (emitted by setUTC() )
|
inline |
- Returns
- const reference to the current simulation Universal Time.
Definition at line 47 of file simclock.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.