[Kstars-devel] branches/kstars/summer/kstars/kstars/comast
Prakash Mohan
prak902000 at gmail.com
Wed Jul 15 02:59:37 CEST 2009
SVN commit 996850 by prakash:
Adding support for reading filters from the OAL logs.
CCMAIL: kstars-devel at kde.org
M +1 -0 filter.h
M +42 -0 log.cpp
M +2 -0 log.h
--- branches/kstars/summer/kstars/kstars/comast/filter.h #996849:996850
@@ -24,6 +24,7 @@
class Comast::Filter {
public:
+ Filter( QString name, QString model, QString vendor, QString type, QString color ) { setFilter( name, model, vendor, type, color ); }
QString id() { return m_Name; }
QString model() { return m_Model; }
QString vendor() { return m_Vendor; }
--- branches/kstars/summer/kstars/kstars/comast/log.cpp #996849:996850
@@ -523,6 +523,22 @@
}
}
+void Comast::Log::readFilters() {
+ while( ! reader->atEnd() ) {
+ reader->readNext();
+
+ if( reader->isEndElement() )
+ break;
+
+ if( reader->isStartElement() ) {
+ if( reader->name() == "filter" )
+ readFilter( reader->attributes().value( "id" ).toString() );
+ else
+ readUnknownElement();
+ }
+ }
+}
+
void Comast::Log::readTarget() {
SkyObject *o = NULL;
while( ! reader->atEnd() ) {
@@ -716,6 +732,32 @@
m_lensList.append( o );
}
+void Comast::Log::readFilter( QString id ) {
+ QString model, vendor, type, color;
+ while( ! reader->atEnd() ) {
+ reader->readNext();
+
+ if( reader->isEndElement() )
+ break;
+
+ if( reader->isStartElement() ) {
+ if( reader->name() == "model" ) {
+ model = reader->readElementText();
+ } else if( reader->name() == "vendor" ) {
+ vendor = reader->readElementText() ;
+ } else if( reader->name() == "type" ) {
+ type = reader->readElementText() ;
+ } else if( reader->name() == "color" ) {
+ color = reader->readElementText() ;
+ } else
+ readUnknownElement();
+ }
+ }
+
+ Comast::Filter *o= new Comast::Filter( id, model, vendor, type, color );
+ m_filterList.append( o );
+}
+
void Comast::Log::readPosition() {
while( ! reader->atEnd() ) {
reader->readNext();
--- branches/kstars/summer/kstars/kstars/comast/log.h #996849:996850
@@ -73,6 +73,7 @@
void readScopes();
void readEyepieces();
void readLenses();
+ void readFilters();
void readTarget();
void readObserver();
void readSite();
@@ -80,6 +81,7 @@
void readScope( QString id );
void readEyepiece( QString id );
void readLens( QString id );
+ void readFilter( QString id );
void readPosition();
void readGeoDate();
private:
More information about the Kstars-devel
mailing list