[Kstars-devel] branches/kstars/summer/kstars/kstars
Prakash Mohan
prak902000 at gmail.com
Tue Jul 14 14:00:36 CEST 2009
SVN commit 996440 by prakash:
Adding full support for saving OAL 2.0 compliant XML logs. This is just a backend commit.
CCMAIL: kstars-devel at kde.org
M +8 -0 CMakeLists.txt
M +8 -6 comast/comast.h
A comast/eyepiece.cpp [License: GPL (v2+)]
A comast/eyepiece.h [License: GPL (v2+)]
A comast/filter.cpp [License: GPL (v2+)]
A comast/filter.h [License: GPL (v2+)]
A comast/lens.cpp [License: GPL (v2+)]
A comast/lens.h [License: GPL (v2+)]
M +159 -2 comast/log.cpp
M +23 -14 comast/log.h
A comast/observation.cpp [License: GPL (v2+)]
A comast/observation.h [License: GPL (v2+)]
A comast/observer.cpp [License: GPL (v2+)]
A comast/observer.h [License: GPL (v2+)]
A comast/scope.cpp [License: GPL (v2+)]
A comast/scope.h [License: GPL (v2+)]
A comast/session.cpp [License: GPL (v2+)]
A comast/session.h [License: GPL (v2+)]
A comast/site.cpp [License: GPL (v2+)]
A comast/site.h [License: GPL (v2+)]
--- branches/kstars/summer/kstars/kstars/CMakeLists.txt #996439:996440
@@ -312,6 +312,14 @@
set(comast_SRCS
comast/log.cpp
+ comast/observer.cpp
+ comast/site.cpp
+ comast/session.cpp
+ comast/scope.cpp
+ comast/eyepiece.cpp
+ comast/filter.cpp
+ comast/observation.cpp
+ comast/lens.cpp
)
set(kstars_SRCS ${indi_SRCS} ${fits_SRCS}
--- branches/kstars/summer/kstars/kstars/comast/comast.h #996439:996440
@@ -4,7 +4,7 @@
-------------------
begin : Friday June 19, 2009
copyright : (C) 2009 by Prakash Mohan
- email : prak902000 at gmail.com
+ email : prakash.mohan at kdemail.net
***************************************************************************/
/***************************************************************************
@@ -20,14 +20,16 @@
#define COMAST_H_
namespace Comast {
class Log;
-/* class Observer;
+ class Observer;
+ class Observation;
class Equipment;
class Eyepiece;
- class Telescope;
+ class Scope;
class Filter;
class Imager;
- class ObservingSite;
- class ObservingSession;
- class Target; */
+ class Site;
+ class Session;
+ class Target;
+ class Lens;
}
#endif
--- branches/kstars/summer/kstars/kstars/comast/log.cpp #996439:996440
@@ -4,7 +4,7 @@
-------------------
begin : Friday June 19, 2009
copyright : (C) 2009 by Prakash Mohan
- email : prak902000 at gmail.com
+ email : prakash.mohan at kdemail.net
***************************************************************************/
/***************************************************************************
@@ -59,7 +59,9 @@
}
void Comast::Log::writeObservers() {
- writer->writeStartElement("observers");
+ writer->writeStartElement( "observers" );
+ foreach( Comast::Observer *o, m_observerList )
+ writeObserver( o );
writer->writeEndElement();
}
@@ -160,6 +162,161 @@
writer->writeEndElement();
}
+void Comast::Log::writeObserver( Comast::Observer *o ) {
+ writer->writeStartElement( "observer" );
+ writer->writeAttribute( "id", o->name() );
+ writer->writeStartElement( "name" );
+ writer->writeCDATA( o->name() );
+ writer->writeEndElement();
+ writer->writeStartElement( "surname" );
+ writer->writeCDATA( o->surname() );
+ writer->writeEndElement();
+ writer->writeStartElement( "contact" );
+ writer->writeCDATA( o->contact() );
+ writer->writeEndElement();
+ writer->writeEndElement();
+}
+void Comast::Log::writeSite( Comast::Site *s ) {
+ writer->writeStartElement( "site" );
+ writer->writeAttribute( "id", s->name() );
+ writer->writeStartElement( "name" );
+ writer->writeCDATA( s->name() );
+ writer->writeEndElement();
+ writer->writeStartElement( "latitude" );
+ writer->writeAttribute( "unit", s->latUnit() );
+ writer->writeCharacters( QString::number( s->latitude() ) );
+ writer->writeStartElement( "longitude" );
+ writer->writeAttribute( "unit", s->lonUnit() );
+ writer->writeCharacters( QString::number( s->longitude() ) );
+ writer->writeEndElement();
+ writer->writeEndElement();
+}
+void Comast::Log::writeSession( Comast::Session *s ) {
+ writer->writeStartElement( "session" );
+ writer->writeAttribute( "id", s->id() );
+ writer->writeStartElement( "begin" );
+ writer->writeCharacters( s->begin().date().toString( "yyyy-MM-dd" ) + "T" + s->begin().time().toString( "hh:mm:ss" ) );
+ writer->writeEndElement();
+ writer->writeStartElement( "end" );
+ writer->writeCharacters( s->end().date().toString( "yyyy-MM-dd" ) + "T" + s->end().time().toString( "hh:mm:ss" ) );
+ writer->writeEndElement();
+ writer->writeStartElement( "site" );
+ writer->writeCDATA( s->site() );
+ writer->writeEndElement();
+ writer->writeStartElement( "weather" );
+ writer->writeCDATA( s->weather() );
+ writer->writeEndElement();
+ writer->writeStartElement( "equipment" );
+ writer->writeCDATA( s->equipment() );
+ writer->writeEndElement();
+ writer->writeStartElement( "comments" );
+ writer->writeCDATA( s->comments() );
+ writer->writeEndElement();
+ writer->writeEndElement();
+}
+void Comast::Log::writeScope( Comast::Scope *s ) {
+ writer->writeStartElement( "scope" );
+ writer->writeAttribute( "id", s->id() );
+ writer->writeStartElement( "model" );
+ writer->writeCDATA( s->model() );
+ writer->writeEndElement();
+ writer->writeStartElement( "type" );
+ writer->writeCDATA( s->type() );
+ writer->writeEndElement();
+ writer->writeStartElement( "vendor" );
+ writer->writeCDATA( s->vendor() );
+ writer->writeEndElement();
+ writer->writeStartElement( "focalLength" );
+ writer->writeCharacters( QString::number( s->focalLength() ) );
+ writer->writeEndElement();
+ writer->writeEndElement();
+}
+void Comast::Log::writeEyepiece( Comast::Eyepiece *ep ) {
+ writer->writeStartElement( "eyepiece" );
+ writer->writeAttribute( "id", ep->id() );
+ writer->writeStartElement( "model" );
+ writer->writeCDATA( ep->model() );
+ writer->writeEndElement();
+ writer->writeStartElement( "vendor" );
+ writer->writeCDATA( ep->vendor() );
+ writer->writeEndElement();
+ writer->writeStartElement( "focalLength" );
+ writer->writeCharacters( QString::number( ep->focalLength() ) );
+ writer->writeEndElement();
+ writer->writeStartElement( "apparantFOV" );
+ writer->writeAttribute( "unit", ep->fovUnit() );
+ writer->writeCharacters( QString::number( ep->appFov() ) );
+ writer->writeEndElement();
+ writer->writeEndElement();
+}
+void Comast::Log::writeLens( Comast::Lens *l ) {
+ writer->writeStartElement( "lens" );
+ writer->writeAttribute( "id", l->id() );
+ writer->writeStartElement( "model" );
+ writer->writeCDATA( l->model() );
+ writer->writeEndElement();
+ writer->writeStartElement( "vendor" );
+ writer->writeCDATA( l->vendor() );
+ writer->writeEndElement();
+ writer->writeStartElement( "factor" );
+ writer->writeCharacters( QString::number( l->factor() ) );
+ writer->writeEndElement();
+}
+
+void Comast::Log::writeFilter( Comast::Filter *f ) {
+ writer->writeStartElement( "filter" );
+ writer->writeAttribute( "id", f->id() );
+ writer->writeStartElement( "model" );
+ writer->writeCDATA( f->model() );
+ writer->writeEndElement();
+ writer->writeStartElement( "vendor" );
+ writer->writeCDATA( f->vendor() );
+ writer->writeEndElement();
+ writer->writeStartElement( "type" );
+ writer->writeCDATA( f->type() );
+ writer->writeEndElement();
+ writer->writeStartElement( "color" );
+ writer->writeCDATA( f->color() );
+ writer->writeEndElement();
+ writer->writeEndElement();
+}
+
+void Comast::Log::writeObservation( Comast::Observation *o ) {
+ writer->writeStartElement( "observation" );
+ writer->writeStartElement( "observer" );
+ writer->writeCharacters( o->observer() );
+ writer->writeEndElement();
+ writer->writeStartElement( "site" );
+ writer->writeCharacters( o->site() );
+ writer->writeEndElement();
+ writer->writeStartElement( "session" );
+ writer->writeCharacters( o->session() );
+ writer->writeEndElement();
+ writer->writeStartElement( "target" );
+ writer->writeCharacters( o->target() );
+ writer->writeEndElement();
+ writer->writeStartElement( "begin" );
+ writer->writeCharacters( o->begin().date().toString( "yyyy-MM-dd" ) + "T" + o->begin().time().toString( "hh:mm:ss" ) );
+ writer->writeEndElement();
+ writer->writeStartElement( "faintestStar" );
+ writer->writeCharacters( QString::number( o->faintestStar() ) );
+ writer->writeEndElement();
+ writer->writeStartElement( "seeing" );
+ writer->writeCharacters( QString::number( o->seeing() ) );
+ writer->writeEndElement();
+ writer->writeStartElement( "scope" );
+ writer->writeCharacters( o->scope() );
+ writer->writeEndElement();
+ writer->writeStartElement( "eyepiece" );
+ writer->writeCharacters( o->eyepiece() );
+ writer->writeEndElement();
+ writer->writeStartElement( "result" );
+ writer->writeAttribute( "xsi:type", "oal:findingsType" );
+ writer->writeAttribute( "lang", o->lang() );
+ writer->writeCDATA( o->result() );
+ writer->writeEndElement();
+ writer->writeEndElement();
+}
void Comast::Log::writeGeoDate() {
writer->writeStartElement( "geodate" );
writer->writeStartElement( "name" );
--- branches/kstars/summer/kstars/kstars/comast/log.h #996439:996440
@@ -4,7 +4,7 @@
-------------------
begin : Friday June 19, 2009
copyright : (C) 2009 by Prakash Mohan
- email : prak902000 at gmail.com
+ email : prakash.mohan at kdemail.net
***************************************************************************/
/***************************************************************************
@@ -27,6 +27,14 @@
#include "kstars.h"
#include "dms.h"
#include "skyobjects/skyobject.h"
+#include "comast/observer.h"
+#include "comast/site.h"
+#include "comast/session.h"
+#include "comast/scope.h"
+#include "comast/eyepiece.h"
+#include "comast/filter.h"
+#include "comast/lens.h"
+#include "comast/observation.h"
class Comast::Log {
public:
@@ -43,14 +51,15 @@
void writeFilters();
void writeImagers();
inline QList<SkyObject *> targetList() { return m_targetList; }
-// void writeObserver();
-// void writeSite();
-// void writeSession();
+ void writeObserver( Comast::Observer *o );
+ void writeSite( Comast::Site *s );
+ void writeSession( Comast::Session *s );
void writeTarget( SkyObject *o );
-// void writeScope();
-// void writeEyePiece();
-// void writeLense();
-// void writeFilter();
+ void writeScope( Comast::Scope *s );
+ void writeEyepiece( Comast::Eyepiece *ep );
+ void writeLens( Comast::Lens *l );
+ void writeFilter(Comast::Filter *f );
+ void writeObservation( Comast::Observation *o );
// void writeImager();
void writeEnd();
void readBegin( QString input );
@@ -62,14 +71,14 @@
void readGeoDate();
private:
QList<SkyObject *> m_targetList;
-// QList<Comast::Observer *> m_observerList;
-// QList<Comast::Eyepiece *> m_eyepieceList;
-// QList<Comast::Filter *> m_filterList;
+ QList<Comast::Observer *> m_observerList;
+ QList<Comast::Eyepiece *> m_eyepieceList;
+ QList<Comast::Filter *> m_filterList;
// QList<Comast::Equipment *> m_equipmentList;
// QList<Comast::Imager *> m_imagerList;
-// QList<Comast::ObservingSite *> m_siteList;
-// QList<Comast::ObservingSession *> m_sessionList;
-// QList<Comast::Telescope *> m_scopeList;
+ QList<Comast::Site *> m_siteList;
+ QList<Comast::Session *> m_sessionList;
+ QList<Comast::Scope *> m_scopeList;
QString output;
bool native;
dms ra, dec;
More information about the Kstars-devel
mailing list