[Kstars-devel] branches/kstars/summer/kstars/kstars/comast
Prakash Mohan
prak902000 at gmail.com
Thu Jul 30 22:08:36 CEST 2009
SVN commit 1004762 by prakash:
Adding an element to store the aperture value of the scope, adding read/write elements for it in the logs and providing a KDoubleNumInput for it in the UI
CCMAIL: kstars-devel at kde.org
M +2 -2 equipmentwriter.cpp
M +12 -2 equipmentwriter.ui
M +7 -2 log.cpp
M +2 -1 scope.cpp
M +4 -3 scope.h
--- branches/kstars/summer/kstars/kstars/comast/equipmentwriter.cpp #1004761:1004762
@@ -54,11 +54,11 @@
Comast::Scope *s = ks->data()->logObject()->findScopeByName( ui.Id->text() );
if( s ) {
if( Comast::warningOverwrite( i18n( "Another Scope already exists with the given Id, Overwrite?" ) ) == KMessageBox::Yes ) {
- s->setScope( ui.Id->text(), ui.Model->text(), ui.Vendor->text(), ui.Type->text(), ui.FocalLength->value() );
+ s->setScope( ui.Id->text(), ui.Model->text(), ui.Vendor->text(), ui.Type->text(), ui.FocalLength->value(), ui.Aperture->value() );
} else
return; //Do nothing
} else { // No such scope exists, so create a new scope
- s = new Comast::Scope( ui.Id->text(), ui.Model->text(), ui.Vendor->text(), ui.Type->text(), ui.FocalLength->value() );
+ s = new Comast::Scope( ui.Id->text(), ui.Model->text(), ui.Vendor->text(), ui.Type->text(), ui.FocalLength->value(), ui.Aperture->value() );
ks->data()->logObject()->scopeList()->append( s );
}
--- branches/kstars/summer/kstars/kstars/comast/equipmentwriter.ui #1004761:1004762
@@ -77,16 +77,26 @@
<item row="3" column="1">
<widget class="KLineEdit" name="Type"/>
</item>
- <item row="4" column="0">
+ <item row="5" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Focal Length</string>
</property>
</widget>
</item>
- <item row="4" column="1">
+ <item row="5" column="1">
<widget class="KDoubleNumInput" name="FocalLength"/>
</item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_13">
+ <property name="text">
+ <string>Aperture</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="KDoubleNumInput" name="Aperture"/>
+ </item>
</layout>
</item>
<item>
--- branches/kstars/summer/kstars/kstars/comast/log.cpp #1004761:1004762
@@ -248,6 +248,9 @@
writer->writeStartElement( "vendor" );
writer->writeCDATA( s->vendor() );
writer->writeEndElement();
+ writer->writeStartElement( "aperture" );
+ writer->writeCharacters( QString::number( s->aperture() ) );
+ writer->writeEndElement();
writer->writeStartElement( "focalLength" );
writer->writeCharacters( QString::number( s->focalLength() ) );
writer->writeEndElement();
@@ -669,7 +672,7 @@
}
void Comast::Log::readScope( QString id ) {
- QString model, focalLength, vendor, type;
+ QString model, focalLength, vendor, type, aperture;
while( ! reader->atEnd() ) {
reader->readNext();
@@ -685,12 +688,14 @@
type = reader->readElementText() ;
} else if( reader->name() == "focalLength" ) {
focalLength = reader->readElementText() ;
+ } else if( reader->name() == "aperture" ) {
+ aperture = reader->readElementText() ;
} else
readUnknownElement();
}
}
- Comast::Scope *o= new Comast::Scope( id, model, vendor, type, focalLength.toDouble() );
+ Comast::Scope *o= new Comast::Scope( id, model, vendor, type, focalLength.toDouble(), aperture.toDouble() );
m_scopeList.append( o );
}
--- branches/kstars/summer/kstars/kstars/comast/scope.cpp #1004761:1004762
@@ -18,10 +18,11 @@
#include "comast/scope.h"
-void Comast::Scope::setScope( QString _name, QString _model, QString _vendor, QString _type, double _focalLength ) {
+void Comast::Scope::setScope( QString _name, QString _model, QString _vendor, QString _type, double _focalLength, double _aperture ) {
m_Name = _name;
m_Model = _model;
m_Vendor = _vendor;
m_Type = _type;
m_FocalLength = _focalLength;
+ m_Aperture = _aperture;
}
--- branches/kstars/summer/kstars/kstars/comast/scope.h #1004761:1004762
@@ -24,15 +24,16 @@
class Comast::Scope {
public:
- Scope( QString name, QString model, QString vendor, QString type, double focalLength ) { setScope( name, model, vendor, type, focalLength ); }
+ Scope( QString name, QString model, QString vendor, QString type, double focalLength, double aperture ) { setScope( name, model, vendor, type, focalLength, aperture ); }
QString id() { return m_Name; }
QString model() { return m_Model; }
QString vendor() { return m_Vendor; }
QString type() { return m_Type; }
double focalLength() { return m_FocalLength; }
- void setScope( QString _name, QString _model, QString _vendor, QString _type, double _focalLength );
+ double aperture() { return m_Aperture; }
+ void setScope( QString _name, QString _model, QString _vendor, QString _type, double _focalLength, double _aperture );
private:
QString m_Name, m_Model, m_Vendor, m_Type;
- double m_FocalLength;
+ double m_FocalLength, m_Aperture;
};
#endif
More information about the Kstars-devel
mailing list