[Kstars-devel] branches/kstars/summer/kstars/kstars/comast

Prakash Mohan prak902000 at gmail.com
Wed Jul 15 02:48:02 CEST 2009


Oops, that was meant to be reading lenses.

2009/7/15 Prakash Mohan <prak902000 at gmail.com>:
> SVN commit 996847 by prakash:
>
> Adding support for reading Eyepieces from the OAL logs.
>
> CCMAIL: kstars-devel at kde.org
>
>
>  M  +1 -0      lens.h
>  M  +42 -0     log.cpp
>  M  +2 -0      log.h
>
>
> --- branches/kstars/summer/kstars/kstars/comast/lens.h #996846:996847
> @@ -24,6 +24,7 @@
>
>  class Comast::Lens {
>     public:
> +        Lens( QString id, QString model, QString vendor, double factor ) { setLens( id, model, vendor, factor ); }
>         QString id() { return m_Name; }
>         QString model() { return m_Model; }
>         QString vendor() { return m_Vendor; }
> --- branches/kstars/summer/kstars/kstars/comast/log.cpp #996846:996847
> @@ -401,6 +401,8 @@
>                 readScopes();
>            else if( reader->name() == "eyepieces" )
>                 readEyepieces();
> +           else if( reader->name() =="lenses" )
> +                readLenses();
>            else if( reader->name() == "geodate" )
>                 readGeoDate();
>             else
> @@ -505,6 +507,22 @@
>     }
>  }
>
> +void Comast::Log::readLenses() {
> +    while( ! reader->atEnd() ) {
> +        reader->readNext();
> +
> +        if( reader->isEndElement() )
> +            break;
> +
> +        if( reader->isStartElement() ) {
> +            if( reader->name() == "Lens" )
> +                readLens( reader->attributes().value( "id" ).toString() );
> +            else
> +                readUnknownElement();
> +        }
> +    }
> +}
> +
>  void Comast::Log::readTarget() {
>     SkyObject *o = NULL;
>     while( ! reader->atEnd() ) {
> @@ -674,6 +692,30 @@
>     m_eyepieceList.append( o );
>  }
>
> +void Comast::Log::readLens( QString id ) {
> +    QString model, factor, vendor;
> +    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() == "factor" ) {
> +                factor = reader->readElementText() ;
> +            } else
> +                readUnknownElement();
> +        }
> +    }
> +
> +    Comast::Lens *o= new Comast::Lens( id, model, vendor, factor.toDouble() );
> +    m_lensList.append( o );
> +}
> +
>  void Comast::Log::readPosition() {
>     while( ! reader->atEnd() ) {
>         reader->readNext();
> --- branches/kstars/summer/kstars/kstars/comast/log.h #996846:996847
> @@ -72,12 +72,14 @@
>         void readSessions();
>         void readScopes();
>         void readEyepieces();
> +        void readLenses();
>         void readTarget();
>         void readObserver();
>         void readSite();
>         void readSession( QString id, QString lang );
>         void readScope( QString id );
>         void readEyepiece( QString id );
> +        void readLens( QString id );
>         void readPosition();
>         void readGeoDate();
>     private:
> _______________________________________________
> Kstars-devel mailing list
> Kstars-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kstars-devel
>



-- 
Prakash
Undergraduate Student
Department of Aerospace Engineering
Indian Institute Of Technology Madras


More information about the Kstars-devel mailing list