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

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
simclock.h
Go to the documentation of this file.
1 /***************************************************************************
2  simclock.h - description
3  -------------------
4  begin : Mon Feb 18 2002
5  copyright : (C) 2002 by Mark Hollomon
6  email : mhh@mindspring.com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef KSTARS_SIMCLOCK_H__
19 #define KSTARS_SIMCLOCK_H__
20 
21 #include <time.h>
22 
23 #include <QtDBus/QtDBus>
24 #include <QTimer>
25 
26 #include "kstarsdatetime.h"
27 
34 class SimClock : public QObject
35 {
36  Q_OBJECT
37  Q_CLASSINFO("D-Bus Interface", "org.kde.kstars.SimClock")
38 public:
44  explicit SimClock(QObject *parent = 0, const KStarsDateTime &when = KStarsDateTime::currentDateTime() );
45 
47  const KStarsDateTime& utc() const { return UTC; }
48 
57  bool isActive();
58 
60  double scale() const { return Scale; }
61 
72  bool isManualMode() const { return ManualMode; }
73 
75  void setManualMode( bool on=true );
76 
77 public Q_SLOTS:
79  Q_SCRIPTABLE Q_NOREPLY void stop();
80 
82  Q_SCRIPTABLE Q_NOREPLY void start();
83 
85  Q_SCRIPTABLE Q_NOREPLY void setUTC(const KStarsDateTime &newtime);
86 
88  Q_SCRIPTABLE Q_NOREPLY void setClockScale(float s);
89 
91  void tick();
92 
98  void manualTick( bool force=false );
99 
100 signals:
102  void timeChanged();
103 
105  void timeAdvanced();
106 
108  void scaleChanged(float);
109 
113  void clockToggled(bool);
114 
115 private:
116  long double julianmark;
117  KStarsDateTime UTC;
118  QTimer tmr;
119  double Scale;
120  QTime sysmark;
121  int lastelapsed;
122  bool ManualMode, ManualActive;
123 
124  // used to generate names for dcop interfaces
125  //static int idgen;
126  // how often to update
127  static int TimerInterval;
128 
129  // Disallow copying
130  SimClock(const SimClock&);
131  SimClock& operator = (const SimClock&);
132 };
133 
134 #endif
SimClock::setManualMode
void setManualMode(bool on=true)
Sets Manual Mode on/off according to the bool argument.
Definition: simclock.cpp:73
SimClock::scaleChanged
void scaleChanged(float)
The timestep has changed.
SimClock
kstars simulation clock
Definition: simclock.h:34
SimClock::tick
void tick()
Respond to the QTimer::timeout signal.
Definition: simclock.cpp:49
SimClock::isManualMode
bool isManualMode() const
Manual Mode is a new (04/2002) addition to the SimClock.
Definition: simclock.h:72
QObject
SimClock::isActive
bool isActive()
Whether the clock is active or not is a bit complicated by the introduction of "manual mode"...
Definition: simclock.cpp:97
SimClock::SimClock
SimClock(QObject *parent=0, const KStarsDateTime &when=KStarsDateTime::currentDateTime())
Constructor.
Definition: simclock.cpp:30
KStarsDateTime::currentDateTime
static KStarsDateTime currentDateTime(KDateTime::Spec ts=KDateTime::Spec::ClockTime())
Definition: kstarsdatetime.cpp:67
SimClock::utc
const KStarsDateTime & utc() const
Definition: simclock.h:47
SimClock::scale
double scale() const
Definition: simclock.h:60
SimClock::stop
Q_SCRIPTABLE Q_NOREPLY void stop()
DBUS function to stop the SimClock.
Definition: simclock.cpp:104
KStarsDateTime
Extension of KDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day...
Definition: kstarsdatetime.h:45
SimClock::setClockScale
Q_SCRIPTABLE Q_NOREPLY void setClockScale(float s)
DBUS function to set scale of simclock.
Definition: simclock.cpp:157
SimClock::clockToggled
void clockToggled(bool)
This is an signal that is called on either clock start or clock stop with an appropriate boolean argu...
SimClock::timeChanged
void timeChanged()
The time has changed (emitted by setUTC() )
SimClock::manualTick
void manualTick(bool force=false)
Equivalent of tick() for manual mode.
Definition: simclock.cpp:90
SimClock::start
Q_SCRIPTABLE Q_NOREPLY void start()
DBUS function to start the SimClock.
Definition: simclock.cpp:117
kstarsdatetime.h
SimClock::timeAdvanced
void timeAdvanced()
The clock has ticked (emitted by tick() )
SimClock::setUTC
Q_SCRIPTABLE Q_NOREPLY void setUTC(const KStarsDateTime &newtime)
DBUS function to set the time of the SimClock.
Definition: simclock.cpp:136
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:20 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