• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

Public Slots | Signals | Public Member Functions | List of all members
SimClock Class Reference

#include <simclock.h>

Inheritance diagram for SimClock:
Inheritance graph
[legend]

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

kstars simulation clock

Author
Mark Hollomon
Version
1.0

Definition at line 34 of file simclock.h.

Constructor & Destructor Documentation

SimClock::SimClock ( QObject *  parent = 0,
const KStarsDateTime &  when = KStarsDateTime::currentDateTime() 
)
explicit

Constructor.

Parameters
parentparent object for the clock
whenthe date/time to which the SimClock should be initialized in UTC

Definition at line 30 of file simclock.cpp.

Member Function Documentation

void SimClock::clockToggled ( bool  )
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.

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 72 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 90 of file simclock.cpp.

double SimClock::scale ( ) const
inline
Returns
the current timestep setting

Definition at line 60 of file simclock.h.

void SimClock::scaleChanged ( float  )
signal

The timestep has changed.

void SimClock::setClockScale ( float  s)
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.

void SimClock::setUTC ( const KStarsDateTime &  newtime)
slot

DBUS function to set the time of the SimClock.

Definition at line 136 of file simclock.cpp.

void SimClock::start ( void  )
slot

DBUS function to start the SimClock.

Definition at line 117 of file simclock.cpp.

void SimClock::stop ( void  )
slot

DBUS function to stop the SimClock.

Definition at line 104 of file simclock.cpp.

void SimClock::tick ( )
slot

Respond to the QTimer::timeout signal.

Definition at line 49 of file simclock.cpp.

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 47 of file simclock.h.


The documentation for this class was generated from the following files:
  • simclock.h
  • simclock.cpp
This file is part of the KDE documentation.
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.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal