• 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
  • tools
altvstime.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  altvstime.cpp - description
3  -------------------
4  begin : wed nov 17 08:05:11 CET 2002
5  copyright : (C) 2002-2003 by Pablo de Vicente
6  email : vicente@oan.es
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 #include "altvstime.h"
19 
20 #include <QVBoxLayout>
21 #include <QFrame>
22 
23 #include <klocale.h>
24 #include <kdialog.h>
25 #include <kplotobject.h>
26 #include <kplotwidget.h>
27 #include <kplotaxis.h>
28 #include <QPainter>
29 #include <QPrinter>
30 #include <QPrintDialog>
31 #include <kdeprintdialog.h>
32 
33 #include "dms.h"
34 #include "ksalmanac.h"
35 #include "kstarsdata.h"
36 #include "kstarsdatetime.h"
37 #include "ksnumbers.h"
38 #include "simclock.h"
39 #include "kssun.h"
40 #include "dialogs/finddialog.h"
41 #include "dialogs/locationdialog.h"
42 #include "skyobjects/skypoint.h"
43 #include "skyobjects/skyobject.h"
44 
45 #include "avtplotwidget.h"
46 #include "ui_altvstime.h"
47 
48 AltVsTimeUI::AltVsTimeUI( QWidget *p ) :
49  QFrame( p )
50 {
51  setupUi( this );
52 }
53 
54 AltVsTime::AltVsTime( QWidget* parent) :
55  KDialog( parent )
56 {
57  QFrame *page = new QFrame( this );
58  setMainWidget(page);
59  setCaption( i18n( "Altitude vs. Time" ) );
60  setButtons( KDialog::Close | KDialog::User1 );
61  setButtonGuiItem( KDialog::User1, KGuiItem( i18n("&Print..."), "document-print", i18n("Print the Altitude vs. time plot") ) );
62  setModal( false );
63 
64  QVBoxLayout* topLayout = new QVBoxLayout( page );
65  topLayout->setMargin( 0 );
66  topLayout->setSpacing( spacingHint() );
67 
68  avtUI = new AltVsTimeUI( page );
69 
70  avtUI->View->setLimits( -12.0, 12.0, -90.0, 90.0 );
71  avtUI->View->setShowGrid( false );
72  avtUI->View->axis(KPlotWidget::BottomAxis)->setTickLabelFormat( 't' );
73  avtUI->View->axis(KPlotWidget::BottomAxis)->setLabel( i18n( "Local Time" ) );
74  avtUI->View->axis(KPlotWidget::TopAxis)->setTickLabelFormat( 't' );
75  avtUI->View->axis(KPlotWidget::TopAxis)->setTickLabelsShown( true );
76  avtUI->View->axis(KPlotWidget::TopAxis)->setLabel( i18n( "Local Sidereal Time" ) );
77  avtUI->View->axis(KPlotWidget::LeftAxis)->setLabel( i18nc( "the angle of an object above (or below) the horizon", "Altitude" ) );
78 
79  avtUI->raBox->setDegType( false );
80  avtUI->decBox->setDegType( true );
81 
82  //FIXME:
83  //Doesn't make sense to manually adjust long/lat unless we can modify TZ also
84  avtUI->longBox->setReadOnly( true );
85  avtUI->latBox->setReadOnly( true );
86 
87  topLayout->addWidget( avtUI );
88 
89  geo = KStarsData::Instance()->geo();
90 
91  DayOffset = 0;
92  showCurrentDate();
93  if ( getDate().time().hour() > 12 )
94  DayOffset = 1;
95 
96  avtUI->longBox->show( geo->lng() );
97  avtUI->latBox->show( geo->lat() );
98 
99  computeSunRiseSetTimes();
100  setLSTLimits();
101  setDawnDusk();
102 
103  connect( avtUI->browseButton, SIGNAL( clicked() ), this, SLOT( slotBrowseObject() ) );
104  connect( avtUI->cityButton, SIGNAL( clicked() ), this, SLOT( slotChooseCity() ) );
105  connect( avtUI->updateButton, SIGNAL( clicked() ), this, SLOT( slotUpdateDateLoc() ) );
106  connect( avtUI->clearButton , SIGNAL( clicked() ), this, SLOT( slotClear() ) );
107  connect( avtUI->addButton, SIGNAL( clicked() ), this, SLOT( slotAddSource() ) );
108  connect( avtUI->nameBox, SIGNAL( returnPressed() ), this, SLOT( slotAddSource() ) );
109  connect( avtUI->raBox, SIGNAL( returnPressed() ), this, SLOT( slotAddSource() ) );
110  connect( avtUI->decBox, SIGNAL( returnPressed() ), this, SLOT( slotAddSource() ) );
111  connect( avtUI->clearFieldsButton, SIGNAL( clicked() ), this, SLOT( slotClearBoxes() ) );
112  connect( avtUI->longBox, SIGNAL( returnPressed() ), this, SLOT( slotAdvanceFocus() ) );
113  connect( avtUI->latBox, SIGNAL( returnPressed() ), this, SLOT( slotAdvanceFocus() ) );
114  connect( avtUI->PlotList, SIGNAL( currentRowChanged(int) ), this, SLOT( slotHighlight(int) ) );
115  connect( button( KDialog::User1 ), SIGNAL( clicked() ), this, SLOT( slotPrint() ) );
116 
117  //the edit boxes should not pass on the return key!
118  avtUI->nameBox->setTrapReturnKey( true );
119  avtUI->raBox->setTrapReturnKey( true );
120  avtUI->decBox->setTrapReturnKey( true );
121 
122  setMouseTracking( true );
123 }
124 
125 AltVsTime::~AltVsTime()
126 {
127  //WARNING: need to delete deleteList items!
128 }
129 
130 void AltVsTime::slotAddSource() {
131  SkyObject *obj = KStarsData::Instance()->objectNamed( avtUI->nameBox->text() );
132 
133  if ( obj ) {
134  //An object with the current name exists. If the object is not already
135  //in the avt list, add it.
136  bool found = false;
137  foreach ( SkyObject *o, pList ) {
138  if ( o->name() == obj->name() ) {
139  found = true;
140  break;
141  }
142  }
143  if( !found )
144  processObject( obj );
145  } else {
146  //Object with the current name doesn't exist. It's possible that the
147  //user is trying to add a custom object. Assume this is the case if
148  //the RA and Dec fields are filled in.
149 
150  if( ! avtUI->nameBox->text().isEmpty() &&
151  ! avtUI->raBox->text().isEmpty() &&
152  ! avtUI->decBox->text().isEmpty() )
153  {
154  bool okRA, okDec;
155  dms newRA = avtUI->raBox->createDms( false, &okRA );
156  dms newDec = avtUI->decBox->createDms( true, &okDec );
157  if( !okRA || !okDec )
158  return;
159 
160  //If the epochName is blank (or any non-double), we assume J2000
161  //Otherwise, precess to J2000.
162  KStarsDateTime dt;
163  dt.setFromEpoch( getEpoch( avtUI->epochName->text() ) );
164  long double jd = dt.djd();
165  if ( jd != J2000 ) {
166  SkyPoint ptest( newRA, newDec );
167  ptest.precessFromAnyEpoch( jd, J2000 );
168  newRA.setH( ptest.ra().Hours() );
169  newDec.setD( ptest.dec().Degrees() );
170  }
171 
172  //make sure the coords do not already exist from another object
173  bool found = false;
174  foreach ( SkyObject *p, pList ) {
175  //within an arcsecond?
176  if ( fabs( newRA.Degrees() - p->ra().Degrees() ) < 0.0003 && fabs( newDec.Degrees() - p->dec().Degrees() ) < 0.0003 ) {
177  found = true;
178  break;
179  }
180  }
181  if( !found ) {
182  SkyObject *obj = new SkyObject( 8, newRA, newDec, 1.0, avtUI->nameBox->text() );
183  deleteList.append( obj ); //this object will be deleted when window is destroyed
184  processObject( obj );
185  }
186  }
187 
188  //If the Ra and Dec boxes are filled, but the name field is empty,
189  //move input focus to nameBox. If either coordinate box is empty,
190  //move focus there
191  if( avtUI->nameBox->text().isEmpty() ) {
192  avtUI->nameBox->QWidget::setFocus();
193  }
194  if( avtUI->raBox->text().isEmpty() ) {
195  avtUI->raBox->QWidget::setFocus();
196  } else {
197  if ( avtUI->decBox->text().isEmpty() )
198  avtUI->decBox->QWidget::setFocus();
199  }
200  }
201 
202  avtUI->View->update();
203 }
204 
205 //Use find dialog to choose an object
206 void AltVsTime::slotBrowseObject() {
207  QPointer<FindDialog> fd = new FindDialog(this);
208  if ( fd->exec() == QDialog::Accepted ) {
209  SkyObject *o = fd->selectedObject();
210  processObject( o );
211  }
212  delete fd;
213 
214  avtUI->View->update();
215 }
216 
217 void AltVsTime::processObject( SkyObject *o, bool forceAdd ) {
218  if( !o )
219  return;
220 
221  KSNumbers *num = new KSNumbers( getDate().djd() );
222  KSNumbers *oldNum = 0;
223 
224  //If the object is in the solar system, recompute its position for the given epochLabel
225  KStarsData* data = KStarsData::Instance();
226  if ( o->isSolarSystem() ) {
227  oldNum = new KSNumbers( data->ut().djd() );
228  o->updateCoords( num, true, geo->lat(), data->lst() );
229  }
230 
231  //precess coords to target epoch
232  o->updateCoords( num );
233 
234  //If this point is not in list already, add it to list
235  bool found(false);
236  foreach ( SkyObject *p, pList ) {
237  if ( o->ra().Degrees() == p->ra().Degrees() && o->dec().Degrees() == p->dec().Degrees() ) {
238  found = true;
239  break;
240  }
241  }
242  if ( found && !forceAdd ) {
243  kDebug() << "This point is already displayed; I will not duplicate it.";
244  } else {
245  pList.append( o );
246 
247  //make sure existing curves are thin and red
248  foreach(KPlotObject* obj, avtUI->View->plotObjects()) {
249  if ( obj->size() == 2 )
250  obj->setLinePen( QPen( Qt::red, 1 ) );
251  }
252 
253  //add new curve with width=2, and color=white
254  KPlotObject *po = new KPlotObject( Qt::white, KPlotObject::Lines, 2.0 );
255  for ( double h=-12.0; h<=12.0; h+=0.5 ) {
256  int label_pos = -11.0 + avtUI->View->plotObjects().count();
257  while ( label_pos > 11.0 )
258  label_pos -= 23.0;
259  if( h == label_pos )
260  po->addPoint( h, findAltitude( o, h ), o->translatedName() );
261  else
262  po->addPoint( h, findAltitude( o, h ) );
263  }
264  avtUI->View->addPlotObject( po );
265 
266  avtUI->PlotList->addItem( o->translatedName() );
267  avtUI->PlotList->setCurrentRow( avtUI->PlotList->count() - 1 );
268  avtUI->raBox->showInHours(o->ra() );
269  avtUI->decBox->showInDegrees(o->dec() );
270  avtUI->nameBox->setText(o->translatedName() );
271 
272  //Set epochName to epoch shown in date tab
273  avtUI->epochName->setText( QString().setNum( getDate().epoch() ) );
274  }
275  kDebug() << "Currently, there are " << avtUI->View->plotObjects().count() << " objects displayed.";
276 
277  //restore original position
278  if ( o->isSolarSystem() ) {
279  o->updateCoords( oldNum, true, data->geo()->lat(), data->lst() );
280  delete oldNum;
281  }
282  o->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
283  delete num;
284 }
285 
286 double AltVsTime::findAltitude( SkyPoint *p, double hour ) {
287  hour += 24.0 * DayOffset;
288 
289  //getDate converts the user-entered local time to UT
290  KStarsDateTime ut = getDate().addSecs( hour*3600.0 );
291 
292  dms LST = geo->GSTtoLST( ut.gst() );
293  p->EquatorialToHorizontal( &LST, geo->lat() );
294  return p->alt().Degrees();
295 }
296 
297 void AltVsTime::slotHighlight( int row ) {
298  //highlight the curve of the selected object
299  QList< KPlotObject* > objects = avtUI->View->plotObjects();
300  for ( int i=0; i<objects.count(); ++i ) {
301  KPlotObject *obj = objects.at( i );
302 
303  if ( i == row ) {
304  obj->setLinePen( QPen( Qt::white, 2 ) );
305  } else {
306  obj->setLinePen( QPen( Qt::red, 1 ) );
307  }
308  }
309 
310  avtUI->View->update();
311 
312  if( row >= 0 && row < pList.size() ) {
313  SkyObject *p = pList.at(row);
314  avtUI->raBox->showInHours( p->ra() );
315  avtUI->decBox->showInDegrees( p->dec() );
316  avtUI->nameBox->setText( avtUI->PlotList->currentItem()->text() );
317  }
318 }
319 
320 //move input focus to the next logical widget
321 void AltVsTime::slotAdvanceFocus() {
322  if ( sender()->objectName() == QString( "nameBox" ) ) avtUI->addButton->setFocus();
323  if ( sender()->objectName() == QString( "raBox" ) ) avtUI->decBox->setFocus();
324  if ( sender()->objectName() == QString( "decbox" ) ) avtUI->addButton->setFocus();
325  if ( sender()->objectName() == QString( "longBox" ) ) avtUI->latBox->setFocus();
326  if ( sender()->objectName() == QString( "latBox" ) ) avtUI->updateButton->setFocus();
327 }
328 
329 void AltVsTime::slotClear() {
330  pList.clear();
331  //Need to delete the pointers in deleteList
332  while( !deleteList.isEmpty() )
333  delete deleteList.takeFirst();
334 
335  avtUI->PlotList->clear();
336  avtUI->nameBox->clear();
337  avtUI->raBox->clear();
338  avtUI->decBox->clear();
339  avtUI->epochName->clear();
340  avtUI->View->removeAllPlotObjects();
341  avtUI->View->update();
342 }
343 
344 void AltVsTime::slotClearBoxes() {
345  avtUI->nameBox->clear();
346  avtUI->raBox->clear() ;
347  avtUI->decBox->clear();
348  avtUI->epochName->clear();
349 }
350 
351 void AltVsTime::computeSunRiseSetTimes() {
352  //Determine the time of sunset and sunrise for the desired date and location
353  //expressed as doubles, the fraction of a full day.
354  KStarsDateTime today = getDate();
355  KSAlmanac ksal;
356  ksal.setDate( &today);
357  ksal.setLocation(geo);
358  double sunRise = ksal.getSunRise();
359  double sunSet = ksal.getSunSet();
360  avtUI->View->setSunRiseSetTimes( sunRise, sunSet );
361 }
362 
363 void AltVsTime::slotUpdateDateLoc() {
364  KStarsData* data = KStarsData::Instance();
365  KStarsDateTime today = getDate();
366  KSNumbers *num = new KSNumbers( today.djd() );
367  KSNumbers *oldNum = 0;
368  dms LST = geo->GSTtoLST( today.gst() );
369 
370  //First determine time of sunset and sunrise
371  computeSunRiseSetTimes();
372  // Determine dawn/dusk time and min/max sun elevation
373  setDawnDusk();
374 
375  for ( int i = 0; i < avtUI->PlotList->count(); ++i ) {
376  QString oName = avtUI->PlotList->item( i )->text().toLower();
377 
378  SkyObject *o = data->objectNamed( oName );
379  if ( o ) {
380  //If the object is in the solar system, recompute its position for the given date
381  if ( o->isSolarSystem() ) {
382  oldNum = new KSNumbers( data->ut().djd() );
383  o->updateCoords( num, true, geo->lat(), &LST );
384  }
385 
386  //precess coords to target epoch
387  o->updateCoords( num );
388 
389  //update pList entry
390  pList.replace( i, o );
391 
392  KPlotObject *po = new KPlotObject( Qt::white, KPlotObject::Lines, 1 );
393  for ( double h=-12.0; h<=12.0; h+=0.5 ) {
394  po->addPoint( h, findAltitude( o, h ) );
395  }
396  avtUI->View->replacePlotObject( i, po );
397 
398  //restore original position
399  if ( o->isSolarSystem() ) {
400  o->updateCoords( oldNum, true, data->geo()->lat(), data->lst() );
401  delete oldNum;
402  oldNum = 0;
403  }
404  o->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
405  } else { //assume unfound object is a custom object
406  pList.at(i)->updateCoords( num ); //precess to desired epoch
407 
408  KPlotObject *po = new KPlotObject( Qt::white, KPlotObject::Lines, 1 );
409  for ( double h=-12.0; h<=12.0; h+=0.5 ) {
410  po->addPoint( h, findAltitude( pList.at(i), h ) );
411  }
412  avtUI->View->replacePlotObject( i, po );
413  }
414  }
415 
416  if ( getDate().time().hour() > 12 )
417  DayOffset = 1;
418  else
419  DayOffset = 0;
420 
421  setLSTLimits();
422  slotHighlight( avtUI->PlotList->currentRow() );
423  avtUI->View->update();
424 
425  delete num;
426 }
427 
428 void AltVsTime::slotChooseCity() {
429  QPointer<LocationDialog> ld = new LocationDialog(this);
430  if ( ld->exec() == QDialog::Accepted ) {
431  GeoLocation *newGeo = ld->selectedCity();
432  if ( newGeo ) {
433  geo = newGeo;
434  avtUI->latBox->showInDegrees( geo->lat() );
435  avtUI->longBox->showInDegrees( geo->lng() );
436  }
437  }
438  delete ld;
439 }
440 
441 void AltVsTime::setLSTLimits() {
442  //UT at noon on target date
443  KStarsDateTime ut = getDate().addSecs( ((double)DayOffset + 0.5)*86400. );
444 
445  dms lst = geo->GSTtoLST( ut.gst() );
446  double h1 = lst.Hours();
447  if( h1 > 12.0 )
448  h1 -= 24.0;
449  double h2 = h1 + 24.0;
450  avtUI->View->setSecondaryLimits( h1, h2, -90.0, 90.0 );
451 }
452 
453 void AltVsTime::showCurrentDate()
454 {
455  KStarsDateTime dt = KStarsDateTime::currentDateTime();
456  if( dt.time() > QTime( 12, 0, 0 ) )
457  dt = dt.addDays( 1 );
458  avtUI->DateWidget->setDate( dt.date() );
459 }
460 
461 KStarsDateTime AltVsTime::getDate()
462 {
463  //convert midnight local time to UT:
464  KStarsDateTime dt( avtUI->DateWidget->date(), QTime() );
465  return geo->LTtoUT( dt );
466 }
467 
468 double AltVsTime::getEpoch(const QString &eName)
469 {
470  //If Epoch field not a double, assume J2000
471  bool ok;
472  double epoch = eName.toDouble(&ok);
473  if ( !ok ) {
474  kDebug() << "Invalid Epoch. Assuming 2000.0.";
475  return 2000.0;
476  }
477  return epoch;
478 }
479 
480 void AltVsTime::setDawnDusk()
481 {
482  KStarsDateTime today = getDate();
483  KSNumbers num( today.djd() );
484  dms LST = geo->GSTtoLST( today.gst() );
485 
486  KSSun sun;
487  sun.updateCoords( &num, true, geo->lat(), &LST );
488  double dawn, da, dusk, du, max_alt, min_alt;
489  double last_h = -12.0;
490  double last_alt = findAltitude( &sun, last_h );
491  dawn = dusk = -13.0;
492  max_alt = -100.0;
493  min_alt = 100.0;
494  for ( double h=-11.95; h<=12.0; h+=0.05 ) {
495  double alt = findAltitude( &sun, h );
496  bool asc = alt - last_alt > 0;
497  if ( alt > max_alt )
498  max_alt = alt;
499  if ( alt < min_alt )
500  min_alt = alt;
501 
502  if ( asc && last_alt <= -18.0 && alt >= -18.0 )
503  dawn = h;
504  if ( !asc && last_alt >= -18.0 && alt <= -18.0 )
505  dusk = h;
506 
507  last_h = h;
508  last_alt = alt;
509  }
510 
511  if ( dawn < -12.0 || dusk < -12.0 ) {
512  da = -1.0;
513  du = -1.0;
514  } else {
515  da = dawn / 24.0;
516  du = ( dusk + 24.0 ) / 24.0;
517  }
518 
519  avtUI->View->setDawnDuskTimes( da, du );
520  avtUI->View->setMinMaxSunAlt( min_alt, max_alt );
521 }
522 
523 void AltVsTime::slotPrint()
524 {
525  QPainter p; // Our painter object
526  QPrinter printer; // Our printer object
527  QString str_legend; // Text legend
528  QString str_year; // Calendar's year
529  int text_height = 200; // Height of legend text zone in points
530  QSize plot_size; // Initial plot widget size
531  QFont plot_font; // Initial plot widget font
532  int plot_font_size; // Initial plot widget font size
533 
534  // Set printer resolution to 300 dpi
535  printer.setResolution( 300 );
536 
537  // Open print dialog
538  QPointer<QPrintDialog> dialog( KdePrint::createPrintDialog( &printer, this ) );
539  dialog->setWindowTitle( i18n( "Print elevation vs time plot" ) );
540  if ( dialog->exec() == QDialog::Accepted ) {
541  // Change mouse cursor
542  QApplication::setOverrideCursor( Qt::WaitCursor );
543 
544  // Save plot widget font
545  plot_font = avtUI->View->font();
546  // Save plot widget font size
547  plot_font_size = plot_font.pointSize();
548  // Save calendar widget size
549  plot_size = avtUI->View->size();
550 
551  // Set text legend
552  str_legend = i18n( "Elevation vs. Time Plot" );
553  str_legend += "\n";
554  str_legend += geo->fullName();
555  str_legend += " - ";
556  str_legend += avtUI->DateWidget->date().toString( "dd/MM/yyyy" );
557 
558  // Create a rectangle for legend text zone
559  QRect text_rect( 0, 0, printer.width(), text_height );
560 
561  // Increase plot widget font size so it looks good in 300 dpi
562  plot_font.setPointSize( plot_font_size * 2.5 );
563  avtUI->View->setFont( plot_font );
564  // Increase plot widget size to fit the entire page
565  avtUI->View->resize( printer.width(), printer.height() - text_height );
566 
567  // Create a pixmap and render plot widget into it
568  QPixmap pixmap( avtUI->View->size() );
569  avtUI->View->render( &pixmap );
570 
571  // Begin painting on printer
572  p.begin( &printer );
573  // Draw legend
574  p.drawText( text_rect, Qt::AlignLeft, str_legend );
575  // Draw plot widget
576  p.drawPixmap( 0, text_height, pixmap );
577  // Ending painting
578  p.end();
579 
580  // Restore plot widget font size
581  plot_font.setPointSize( plot_font_size );
582  avtUI->View->setFont( plot_font );
583  // Restore calendar widget size
584  avtUI->View->resize( plot_size );
585 
586  // Restore mouse cursor
587  QApplication::restoreOverrideCursor();
588  }
589  delete dialog;
590 }
591 
592 
593 #include "altvstime.moc"
LocationDialog
Dialog for changing the geographic location of the observer.
Definition: locationdialog.h:57
SkyPoint::ra
const dms & ra() const
Definition: skypoint.h:171
KStarsData::objectNamed
SkyObject * objectNamed(const QString &name)
Find object by name.
Definition: kstarsdata.cpp:345
KStarsData
KStarsData is the backbone of KStars.
Definition: kstarsdata.h:66
KSAlmanac::setDate
void setDate(KStarsDateTime *newdt)
Set the date for computations to the given date.
Definition: ksalmanac.cpp:130
AltVsTimeUI::AltVsTimeUI
AltVsTimeUI(QWidget *p=0)
Definition: altvstime.cpp:48
AltVsTime::~AltVsTime
~AltVsTime()
Destructor.
Definition: altvstime.cpp:125
AltVsTime::getDate
KStarsDateTime getDate()
Definition: altvstime.cpp:461
KSSun
Child class of KSPlanetBase; encapsulates information about the Sun.
Definition: kssun.h:31
SkyObject::translatedName
QString translatedName() const
Definition: skyobject.h:129
skyobject.h
AltVsTime::showCurrentDate
void showCurrentDate()
Set the AltVsTime Date according to the current Date in the KStars main window.
Definition: altvstime.cpp:453
AltVsTime::slotBrowseObject
void slotBrowseObject()
Launch the Find Object window to select a new object for the list of displayed objects.
Definition: altvstime.cpp:206
AltVsTime::slotClear
void slotClear()
Clear the list of displayed objects.
Definition: altvstime.cpp:329
KStarsDateTime::addDays
KStarsDateTime addDays(int nd) const
Modify the Date/Time by adding a number of days.
Definition: kstarsdatetime.h:117
QWidget
KStarsData::lst
dms * lst()
Definition: kstarsdata.h:161
KStarsData::Instance
static KStarsData * Instance()
Definition: kstarsdata.h:92
dms::Degrees
const double & Degrees() const
Definition: dms.h:98
GeoLocation::lng
const dms * lng() const
Definition: geolocation.h:76
AltVsTime::slotClearBoxes
void slotClearBoxes()
Clear the edit boxes for specifying a new object.
Definition: altvstime.cpp:344
AltVsTime::findAltitude
double findAltitude(SkyPoint *p, double hour)
Determine the altitude coordinate of a SkyPoint, given an hour of the day.
Definition: altvstime.cpp:286
KStarsDateTime::setDate
void setDate(const QDate &d)
Assign the Date according to a QDate object.
Definition: kstarsdatetime.cpp:119
SkyPoint::updateCoords
virtual void updateCoords(KSNumbers *num, bool includePlanets=true, const dms *lat=0, const dms *LST=0, bool forceRecompute=false)
Determine the current coordinates (RA, Dec) from the catalog coordinates (RA0, Dec0), accounting for both precession and nutation.
Definition: skypoint.cpp:317
KDialog
KSAlmanac
A class that implements methods to find sun rise, sun set, twilight begin / end times, moon rise and moon set times.
Definition: ksalmanac.h:42
KStarsData::geo
GeoLocation * geo()
Definition: kstarsdata.h:164
altvstime.h
AltVsTime::getEpoch
double getEpoch(const QString &eName)
Parse a string as an epoch number.
Definition: altvstime.cpp:468
KStarsDateTime::setFromEpoch
bool setFromEpoch(double e)
Set the Date/Time from an epoch value, represented as a double.
Definition: kstarsdatetime.cpp:195
dms.h
AltVsTime::processObject
void processObject(SkyObject *o, bool forceAdd=false)
Add a SkyObject to the display.
Definition: altvstime.cpp:217
SkyPoint
The sky coordinates of a point in the sky.
Definition: skypoint.h:50
KSAlmanac::getSunRise
double getSunRise()
All the functions returns the fraction of the day as their return value.
Definition: ksalmanac.h:63
locationdialog.h
GeoLocation
Contains all relevant information for specifying a location on Earth: City Name, State/Province name...
Definition: geolocation.h:39
AltVsTime::slotPrint
void slotPrint()
Print plot widget.
Definition: altvstime.cpp:523
KStarsDateTime::currentDateTime
static KStarsDateTime currentDateTime(KDateTime::Spec ts=KDateTime::Spec::ClockTime())
Definition: kstarsdatetime.cpp:67
KStarsDateTime::djd
long double djd() const
Definition: kstarsdatetime.h:145
KStarsDateTime::addSecs
KStarsDateTime addSecs(double s) const
Definition: kstarsdatetime.cpp:127
i18nc
i18nc("string from libindi, used in the config dialog","100x")
KStarsDateTime
Extension of KDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day...
Definition: kstarsdatetime.h:45
SkyObject::isSolarSystem
bool isSolarSystem() const
Definition: skyobject.h:197
ksnumbers.h
avtplotwidget.h
AltVsTimeUI
Definition: altvstime.h:30
dms
An angle, stored as degrees, but expressible in many ways.
Definition: dms.h:42
simclock.h
KSPlanetBase::updateCoords
virtual void updateCoords(KSNumbers *num, bool includePlanets=true, const dms *lat=0, const dms *LST=0, bool forceRecompute=false)
Update position of the planet (reimplemented from SkyPoint)
Definition: ksplanetbase.cpp:105
AltVsTime::computeSunRiseSetTimes
void computeSunRiseSetTimes()
Determine the time of sunset and sunrise for the current date and location settings.
Definition: altvstime.cpp:351
SkyPoint::dec
const dms & dec() const
Definition: skypoint.h:174
dms::Hours
double Hours() const
Definition: dms.h:125
skypoint.h
AltVsTime::AltVsTime
AltVsTime(QWidget *parent=0)
Constructor.
Definition: altvstime.cpp:54
SkyPoint::EquatorialToHorizontal
void EquatorialToHorizontal(const dms *LST, const dms *lat)
Determine the (Altitude, Azimuth) coordinates of the SkyPoint from its (RA, Dec) coordinates, given the local sidereal time and the observer's latitude.
Definition: skypoint.cpp:55
KSNumbers
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition: ksnumbers.h:43
ksalmanac.h
kssun.h
GeoLocation::lat
const dms * lat() const
Definition: geolocation.h:79
AltVsTime::slotAdvanceFocus
void slotAdvanceFocus()
Move input keyboard focus to the next logical widget.
Definition: altvstime.cpp:321
finddialog.h
KSAlmanac::getSunSet
double getSunSet()
Definition: ksalmanac.h:64
J2000
#define J2000
Definition: kstarsdatetime.h:21
NaN::ld
const long double ld
Definition: nan.h:37
AltVsTime::slotHighlight
void slotHighlight(int)
Update the plot to highlight the altitude curve of the objects which is highlighted in the listbox...
Definition: altvstime.cpp:297
SkyPoint::precessFromAnyEpoch
void precessFromAnyEpoch(long double jd0, long double jdf)
General case of precession.
Definition: skypoint.cpp:356
AltVsTime::slotUpdateDateLoc
void slotUpdateDateLoc()
Update the plot to reflec new Date and Location settings.
Definition: altvstime.cpp:363
kstarsdatetime.h
kstarsdata.h
KStarsData::ut
const KStarsDateTime & ut() const
Definition: kstarsdata.h:140
SkyPoint::alt
const dms & alt() const
Definition: skypoint.h:180
dms::setD
void setD(const double &x)
Sets floating-point value of angle, in degrees.
Definition: dms.h:130
SkyObject::name
virtual QString name(void) const
Definition: skyobject.h:124
KStarsDateTime::gst
dms gst() const
Definition: kstarsdatetime.cpp:138
AltVsTime::setLSTLimits
void setLSTLimits()
Determine the limits for the sideral time axis, using the sidereal time at midnight for the current d...
Definition: altvstime.cpp:441
SkyObject
Provides all necessary information about an object in the sky: its coordinates, name(s), type, magnitude, and QStringLists of URLs for images and webpages regarding the object.
Definition: skyobject.h:46
QFrame
AltVsTime::slotAddSource
void slotAddSource()
Add an object to the list of displayed objects, according to the data entered in the edit boxes...
Definition: altvstime.cpp:130
QList
KSAlmanac::setLocation
void setLocation(GeoLocation *m_geo)
Set the location for computations to the given location.
Definition: ksalmanac.cpp:135
AltVsTime::slotChooseCity
void slotChooseCity()
Launch the Location dialog to choose a new location.
Definition: altvstime.cpp:428
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:19 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