}
QDomNodeList spectrumList = domElement.namedItem( "spectra" ).toElement().elementsByTagName( "spectrum" );
- QValueList<double> speclist;
+
+ Spektrum *spectrum = new Spektrum();
for( uint i = 0; i < spectrumList.length(); i++ )
{
+ Spektrum::band b;
QDomElement spec = spectrumList.item( i ).toElement();
- double wavelenght = spec.text().toDouble();
- speclist.append( wavelenght );
+
+ b.intensity = spec.attributeNode( "intensity" ).value().toInt();
+ b.wavelength = spec.attributeNode( "wavelength" ).value().toDouble();
+ b.aki = spec.attributeNode( "aki" ).value().toDouble();
+ b.energy1 = spec.attributeNode( "energy1" ).value().toDouble();
+ b.energy2 = spec.attributeNode( "energy2" ).value().toDouble();
+ b.electronconfig1 = spec.attributeNode( "electronconfig1" ).value();
+ b.electronconfig2 = spec.attributeNode( "electronconfig1" ).value();
+ b.term1 = spec.attributeNode( "term1" ).value();
+ b.term2 = spec.attributeNode( "term2" ).value();
+ b.J1 = spec.attributeNode( "J1" ).value();
+ b.J2 = spec.attributeNode( "J2" ).value();
+
+ spectrum->addBand( b );
}
Element *e = new Element();
- e->setSpectrumList( speclist );
+ e->setSpektrum( spectrum );
e->setDate(date);
e->setBiologicalMeaning(bio);
e->setNumber( number );
typedef QValueList<coordinate> CList;
typedef QValueList<double> doubleList;
+/**
+ * @author Carsten Niehaus
+ *
+ * This class represents an spectrum with all its properties
+ */
+class Spektrum
+{
+ public:
+ Spektrum(){};
+ ~Spektrum(){};
+
+ /**
+ * a band is one line in the spektrum of an element
+ */
+ struct band
+ {
+ double wavelength;
+ double aki;
+ double energy1;
+ double energy2;
+ int intensity;
+ QString electronconfig1;
+ QString electronconfig2;
+ QString term1;
+ QString term2;
+ QString J1;
+ QString J2;
+ };
+
+ void addBand( band b ){
+ m_bandlist.append( b );
+ }
+
+ QValueList<band> m_bandlist;
+};
+
/**
* @author Carsten Niehaus
* @author Jörg Buchwald
m_isotopeList = list;
}
- void setSpectrumList( QValueList<double> list ){
- m_spectrumList = list;
+ void setSpektrum( Spektrum *spec ){
+ m_spectrum = spec;
}
doubleList ionisationList() const{
*/
int m_ElementNumber;
+ Spektrum *m_spectrum;
+
QValueList<Isotope*> m_isotopeList;
QValueList<double> m_spectrumList;
#include <kpixmapeffect.h>
#include <kcombobox.h>
+#include "element.h"
+
/**
* @author Carsten Niehaus
*/
SpectrumWidget( QWidget *parent, const char* name = 0 );
~SpectrumWidget();
- void setSpectra( QValueList<double> l ){
- m_spectra = l;
- update();
+ void setSpektrum( Spektrum* spec ){
+ m_spektrum = spec;
}
/**
*/
int Adjust( double color, double factor );
+ Spektrum *m_spektrum;
+
/**
* @param the position on a 0 to 1-scale in the widget. 0.5 mean
* that you want the wavelength in the middle of the widget,
public:
SpectrumView( QWidget* parent, const char* name );
- void setSpectra( QValueList<double> l ){
- m_spectrum->setSpectra( l );
- update();
- }
+//X void setSpectra( QValueList<double> l ){
+//X m_spectrum->setSpektrum( l );
+//X update();
+//X }
private:
SpectrumWidget *m_spectrum;