kstars
SimClock Class Reference
kstars simulation clock More...
#include <simclock.h>

Public Slots | |
void | manualTick (bool force=false) |
void | setScale (float s) |
void | tick () |
Signals | |
void | clockStarted () |
void | clockStopped () |
void | scaleChanged (float) |
void | timeAdvanced () |
void | timeChanged () |
Public Member Functions | |
bool | isActive () |
bool | isManualMode () const |
double | scale () const |
virtual ASYNC | setClockScale (float s) |
void | setManualMode (bool on=true) |
virtual ASYNC | setUTC (const KStarsDateTime &newtime) |
SimClock (const SimClock &old) | |
SimClock (QObject *parent=0, const KStarsDateTime &when=KStarsDateTime::currentDateTime()) | |
virtual ASYNC | start () |
virtual ASYNC | stop () |
const KStarsDateTime & | utc () const |
Detailed Description
kstars simulation clock
- Version:
- 1.0
Definition at line 33 of file simclock.h.
Constructor & Destructor Documentation
SimClock::SimClock | ( | QObject * | parent = 0 , |
|
const KStarsDateTime & | when = KStarsDateTime::currentDateTime() | |||
) |
Constructor.
- Parameters:
-
parent parent object for the clock when the date/time to which the SimClock should be initialized in UTC
Definition at line 28 of file simclock.cpp.
SimClock::SimClock | ( | const SimClock & | old | ) |
Constructor.
- Parameters:
-
old a SimClock to initialize from.
Definition at line 44 of file simclock.cpp.
Member Function Documentation
void SimClock::clockStarted | ( | ) | [signal] |
The clock has started.
void SimClock::clockStopped | ( | ) | [signal] |
The clock has stopped.
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 116 of file simclock.cpp.
bool SimClock::isManualMode | ( | ) | const [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 75 of file simclock.h.
void SimClock::manualTick | ( | bool | force = false |
) | [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 110 of file simclock.cpp.
double SimClock::scale | ( | ) | const [inline] |
void SimClock::scaleChanged | ( | float | ) | [signal] |
The timestep has changed.
void SimClock::setClockScale | ( | float | s | ) | [virtual] |
DCOP function to set scale of simclock.
Calls setScale().
Implements SimClockInterface.
Definition at line 187 of file simclock.cpp.
void SimClock::setManualMode | ( | bool | on = true |
) |
void SimClock::setScale | ( | float | s | ) | [slot] |
void SimClock::setUTC | ( | const KStarsDateTime & | newtime | ) | [virtual] |
DCOP function to set the time of the SimClock.
Implements SimClockInterface.
Definition at line 156 of file simclock.cpp.
void SimClock::start | ( | ) | [virtual] |
DCOP function to start the SimClock.
Implements SimClockInterface.
Definition at line 135 of file simclock.cpp.
void SimClock::stop | ( | ) | [virtual] |
DCOP function to stop the SimClock.
Implements SimClockInterface.
Definition at line 122 of file simclock.cpp.
void SimClock::tick | ( | ) | [slot] |
void SimClock::timeAdvanced | ( | ) | [signal] |
The clock has ticked (emitted by tick() ).
void SimClock::timeChanged | ( | ) | [signal] |
The time has changed (emitted by setUTC() ).
const KStarsDateTime& SimClock::utc | ( | ) | const [inline] |
- Returns:
- const reference to the current simulation Universal Time.
Definition at line 50 of file simclock.h.
The documentation for this class was generated from the following files: