qse  0.5.4
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
QseEXAFSOperator Class Reference

#include <qseexafsoperator.h>

Inheritance diagram for QseEXAFSOperator:
Inheritance graph

Public Types

enum  QseScanRole { UnspecifiedScanRole = -1, ScanNotUsedRole, ScanUsedRole }
 
enum  QseColumnRole {
  UnspecifiedRole = -1, NotUsedRole, DetectorRole, NormalizationRole,
  EnergyRole, SecondsRole, CopyRole, CopyNormalizedRole,
  CopyRateRole, CopyTotalCountsRole
}
 

Public Member Functions

 QseEXAFSOperator (QseDataSet *inData, QseDataSet *outData, const QString &name, QObject *parent=0)
 
QseDataSetinputData ()
 
QseDataSetoutputData ()
 
bool matchesEnergyPattern (const QseColumn *col, int colnum)
 
bool matchesEnergyColumn (const QseColumn *col, int colnum)
 
bool matchesDetectorPattern (const QseColumn *col, int colnum)
 
bool matchesDetectorColumn (const QseColumn *col, int colnum)
 
bool matchesNormalizationPattern (const QseColumn *col, int colnum)
 
bool matchesNormalizationColumn (const QseColumn *col, int colnum)
 
bool matchesSecondsPattern (const QseColumn *col, int colnum)
 
bool matchesSecondsColumn (const QseColumn *col, int colnum)
 
bool matchesCopyPattern (const QseColumn *col, int colnum)
 
bool matchesCopyColumn (const QseColumn *col, int colnum)
 
bool matchesCopyNormalizedPattern (const QseColumn *col, int colnum)
 
bool matchesCopyNormalizedColumn (const QseColumn *col, int colnum)
 
bool matchesCopyRatePattern (const QseColumn *col, int colnum)
 
bool matchesCopyRateColumn (const QseColumn *col, int colnum)
 
bool matchesCopyTotalCountsPattern (const QseColumn *col, int colnum)
 
bool matchesCopyTotalCountsColumn (const QseColumn *col, int colnum)
 
- Public Member Functions inherited from QseOperator
 QseOperator (const QString &name, QObject *parent=0)
 
QString name () const
 
void setName (const QString &name)
 
void addParameter (QseParameter *parameter)
 
virtual void exec ()=0
 

Static Public Member Functions

static QColor colorForRole (QseColumnRole r)
 
static QColor backgroundColorForRole (QseColumnRole r)
 

Protected Attributes

QseDataSetm_InputData
 
QseDataSetm_OutputData
 
QseRegExpParameter m_EnergyPattern
 
QseRegExpParameter m_DetectorPattern
 
QseRegExpParameter m_NormalizationPattern
 
QseRegExpParameter m_SecondsPattern
 
QseRegExpParameter m_CopyPattern
 
QseRegExpParameter m_CopyNormalizedPattern
 
QseRegExpParameter m_CopyRatePattern
 
QseRegExpParameter m_CopyTotalCountsPattern
 
QHash< const QseScan
*, QseScanRole
m_ScanExceptions
 
QHash< const QseColumn
*, QseColumnRole
m_Exceptions
 

Additional Inherited Members

- Signals inherited from QseOperator
void message (const QString &msg)
 

Detailed Description

Definition at line 13 of file qseexafsoperator.h.

Member Enumeration Documentation

Enumerator
UnspecifiedScanRole 
ScanNotUsedRole 
ScanUsedRole 

Definition at line 44 of file qseexafsoperator.h.

Constructor & Destructor Documentation

QseEXAFSOperator::QseEXAFSOperator ( QseDataSet inData,
QseDataSet outData,
const QString &  name,
QObject *  parent = 0 
)

Definition at line 6 of file qseexafsoperator.cpp.

7  : QseOperator(name, parent),
8  m_InputData(inData),
9  m_OutputData(outData),
10  m_EnergyPattern(this, "energypattern",NULL),
11  m_DetectorPattern(this, "detectorpattern",NULL),
12  m_NormalizationPattern(this, "normalizationpattern",NULL),
13  m_SecondsPattern(this, "secondspattern",NULL),
14  m_CopyPattern(this, "copypattern", NULL),
15  m_CopyNormalizedPattern(this, "copynormalizedpattern", NULL),
16  m_CopyRatePattern(this, "copyratepattern", NULL),
17  m_CopyTotalCountsPattern(this, "copytotalcountspattern", NULL)
18 {
19 }
QseRegExpParameter m_DetectorPattern
QseRegExpParameter m_SecondsPattern
QseRegExpParameter m_EnergyPattern
QseRegExpParameter m_CopyRatePattern
QseDataSet * m_InputData
QString name() const
Definition: qseoperator.cpp:11
QseRegExpParameter m_CopyTotalCountsPattern
QseRegExpParameter m_NormalizationPattern
QseRegExpParameter m_CopyNormalizedPattern
QseDataSet * m_OutputData
QseRegExpParameter m_CopyPattern

Member Function Documentation

QColor QseEXAFSOperator::backgroundColorForRole ( QseColumnRole  r)
static

Definition at line 357 of file qseexafsoperator.cpp.

References colorForRole().

Referenced by QseNormalizerModel::data().

358 {
359  QColor fg = colorForRole(r);
360 
361  fg.setAlpha(50);
362 
363  return fg;
364 }
static QColor colorForRole(QseColumnRole r)
QColor QseEXAFSOperator::colorForRole ( QseColumnRole  r)
static

Definition at line 309 of file qseexafsoperator.cpp.

References CopyNormalizedRole, CopyRateRole, CopyRole, CopyTotalCountsRole, DetectorRole, EnergyRole, NormalizationRole, NotUsedRole, SecondsRole, and UnspecifiedRole.

Referenced by backgroundColorForRole(), and QseNormalizerModel::data().

310 {
311  QColor res = Qt::black;
312 
313  switch (r) {
314  case UnspecifiedRole:
315  res = Qt::gray;
316  break;
317 
318  case NotUsedRole:
319  break;
320 
321  case DetectorRole:
322  res = Qt::blue;
323  break;
324 
325  case NormalizationRole:
326  res = Qt::green;
327  break;
328 
329  case EnergyRole:
330  res = Qt::red;
331  break;
332 
333  case SecondsRole:
334  res = Qt::magenta;
335  break;
336 
337  case CopyRole:
338  res = Qt::darkCyan;
339  break;
340 
341  case CopyNormalizedRole:
342  res = Qt::darkRed;
343  break;
344 
345  case CopyRateRole:
346  res = Qt::darkBlue;
347  break;
348 
349  case CopyTotalCountsRole:
350  res = Qt::darkGreen;
351  break;
352  }
353 
354  return res;
355 }
QseDataSet * QseEXAFSOperator::inputData ( )

Definition at line 366 of file qseexafsoperator.cpp.

References m_InputData.

367 {
368  return m_InputData;
369 }
QseDataSet * m_InputData
bool QseEXAFSOperator::matchesCopyColumn ( const QseColumn col,
int  colnum 
)

Definition at line 178 of file qseexafsoperator.cpp.

References CopyRole, m_CopyPattern, m_Exceptions, QseColumn::name(), UnspecifiedRole, and QseParameter::value().

Referenced by QseNormalizer::normalizeScan().

179 {
180  bool res = false;
181 
182  if (c) {
184 
185  if (m_Exceptions.contains(c)) {
186  r = m_Exceptions[c];
187  }
188 
189  if (r == UnspecifiedRole) {
190  QRegExp r = m_CopyPattern.value().toRegExp();
191 
192  res = r.exactMatch(c->name()) || r.exactMatch(QString::number(colnum));
193  } else {
194  res = (r == CopyRole);
195  }
196  }
197 
198  return res;
199 }
QVariant value() const
QHash< const QseColumn *, QseColumnRole > m_Exceptions
QseRegExpParameter m_CopyPattern
bool QseEXAFSOperator::matchesCopyNormalizedColumn ( const QseColumn col,
int  colnum 
)

Definition at line 214 of file qseexafsoperator.cpp.

References CopyNormalizedRole, m_CopyNormalizedPattern, m_Exceptions, QseColumn::name(), UnspecifiedRole, and QseParameter::value().

Referenced by QseNormalizer::normalizeScan().

215 {
216  bool res = false;
217 
218  if (c) {
220 
221  if (m_Exceptions.contains(c)) {
222  r = m_Exceptions[c];
223  }
224 
225  if (r == UnspecifiedRole) {
226  QRegExp r = m_CopyNormalizedPattern.value().toRegExp();
227 
228  res = r.exactMatch(c->name()) || r.exactMatch(QString::number(colnum));
229  } else {
230  res = (r == CopyNormalizedRole);
231  }
232  }
233 
234  return res;
235 }
QVariant value() const
QHash< const QseColumn *, QseColumnRole > m_Exceptions
QseRegExpParameter m_CopyNormalizedPattern
bool QseEXAFSOperator::matchesCopyNormalizedPattern ( const QseColumn col,
int  colnum 
)

Definition at line 201 of file qseexafsoperator.cpp.

References m_CopyNormalizedPattern, QseColumn::name(), and QseParameter::value().

Referenced by QseNormalizer::patternColumnRole().

202 {
203  bool res = false;
204 
205  if (c) {
206  QRegExp r = m_CopyNormalizedPattern.value().toRegExp();
207 
208  res = r.exactMatch(c->name()) || r.exactMatch(QString::number(colnum));
209  }
210 
211  return res;
212 }
QVariant value() const
QseRegExpParameter m_CopyNormalizedPattern
bool QseEXAFSOperator::matchesCopyPattern ( const QseColumn col,
int  colnum 
)

Definition at line 165 of file qseexafsoperator.cpp.

References m_CopyPattern, QseColumn::name(), and QseParameter::value().

Referenced by QseNormalizer::patternColumnRole().

166 {
167  bool res = false;
168 
169  if (c) {
170  QRegExp r = m_CopyPattern.value().toRegExp();
171 
172  res = r.exactMatch(c->name()) || r.exactMatch(QString::number(colnum));
173  }
174 
175  return res;
176 }
QVariant value() const
QseRegExpParameter m_CopyPattern
bool QseEXAFSOperator::matchesCopyRateColumn ( const QseColumn col,
int  colnum 
)

Definition at line 250 of file qseexafsoperator.cpp.

References CopyRateRole, m_CopyRatePattern, m_Exceptions, QseColumn::name(), UnspecifiedRole, and QseParameter::value().

Referenced by QseNormalizer::normalizeScan().

251 {
252  bool res = false;
253 
254  if (c) {
256 
257  if (m_Exceptions.contains(c)) {
258  r = m_Exceptions[c];
259  }
260 
261  if (r == UnspecifiedRole) {
262  QRegExp r = m_CopyRatePattern.value().toRegExp();
263 
264  res = r.exactMatch(c->name()) || r.exactMatch(QString::number(colnum));
265  } else {
266  res = (r == CopyRateRole);
267  }
268  }
269 
270  return res;
271 }
QVariant value() const
QseRegExpParameter m_CopyRatePattern
QHash< const QseColumn *, QseColumnRole > m_Exceptions
bool QseEXAFSOperator::matchesCopyRatePattern ( const QseColumn col,
int  colnum 
)

Definition at line 237 of file qseexafsoperator.cpp.

References m_CopyRatePattern, QseColumn::name(), and QseParameter::value().

Referenced by QseNormalizer::patternColumnRole().

238 {
239  bool res = false;
240 
241  if (c) {
242  QRegExp r = m_CopyRatePattern.value().toRegExp();
243 
244  res = r.exactMatch(c->name()) || r.exactMatch(QString::number(colnum));
245  }
246 
247  return res;
248 }
QVariant value() const
QseRegExpParameter m_CopyRatePattern
bool QseEXAFSOperator::matchesCopyTotalCountsColumn ( const QseColumn col,
int  colnum 
)

Definition at line 286 of file qseexafsoperator.cpp.

References CopyTotalCountsRole, m_CopyTotalCountsPattern, m_Exceptions, QseColumn::name(), UnspecifiedRole, and QseParameter::value().

Referenced by QseNormalizer::normalizeScan().

287 {
288  bool res = false;
289 
290  if (c) {
292 
293  if (m_Exceptions.contains(c)) {
294  r = m_Exceptions[c];
295  }
296 
297  if (r == UnspecifiedRole) {
298  QRegExp r = m_CopyTotalCountsPattern.value().toRegExp();
299 
300  res = r.exactMatch(c->name()) || r.exactMatch(QString::number(colnum));
301  } else {
302  res = (r == CopyTotalCountsRole);
303  }
304  }
305 
306  return res;
307 }
QVariant value() const
QHash< const QseColumn *, QseColumnRole > m_Exceptions
QseRegExpParameter m_CopyTotalCountsPattern
bool QseEXAFSOperator::matchesCopyTotalCountsPattern ( const QseColumn col,
int  colnum 
)

Definition at line 273 of file qseexafsoperator.cpp.

References m_CopyTotalCountsPattern, QseColumn::name(), and QseParameter::value().

Referenced by QseNormalizer::patternColumnRole().

274 {
275  bool res = false;
276 
277  if (c) {
278  QRegExp r = m_CopyTotalCountsPattern.value().toRegExp();
279 
280  res = r.exactMatch(c->name()) || r.exactMatch(QString::number(colnum));
281  }
282 
283  return res;
284 }
QVariant value() const
QseRegExpParameter m_CopyTotalCountsPattern
bool QseEXAFSOperator::matchesDetectorColumn ( const QseColumn col,
int  colnum 
)

Definition at line 70 of file qseexafsoperator.cpp.

References DetectorRole, m_DetectorPattern, m_Exceptions, QseColumn::name(), UnspecifiedRole, and QseParameter::value().

Referenced by QseNormalizer::normalizeScan().

71 {
72  bool res = false;
73 
74  if (c) {
76 
77  if (m_Exceptions.contains(c)) {
78  r = m_Exceptions[c];
79  }
80 
81  if (r == UnspecifiedRole) {
82  QRegExp r = m_DetectorPattern.value().toRegExp();
83 
84  res = r.exactMatch(c->name()) || r.exactMatch(QString::number(colnum));
85  } else {
86  res = (r == DetectorRole);
87  }
88  }
89 
90  return res;
91 }
QVariant value() const
QseRegExpParameter m_DetectorPattern
QHash< const QseColumn *, QseColumnRole > m_Exceptions
bool QseEXAFSOperator::matchesDetectorPattern ( const QseColumn col,
int  colnum 
)

Definition at line 57 of file qseexafsoperator.cpp.

References m_DetectorPattern, QseColumn::name(), and QseParameter::value().

Referenced by QseNormalizer::patternColumnRole().

58 {
59  bool res = false;
60 
61  if (c) {
62  QRegExp r = m_DetectorPattern.value().toRegExp();
63 
64  res = r.exactMatch(c->name()) || r.exactMatch(QString::number(colnum));
65  }
66 
67  return res;
68 }
QVariant value() const
QseRegExpParameter m_DetectorPattern
bool QseEXAFSOperator::matchesEnergyColumn ( const QseColumn col,
int  colnum 
)

Definition at line 34 of file qseexafsoperator.cpp.

References EnergyRole, m_EnergyPattern, m_Exceptions, QseColumn::name(), UnspecifiedRole, and QseParameter::value().

Referenced by QseNormalizer::normalizeScan().

35 {
36  bool res = false;
37 
38  if (c) {
40 
41  if (m_Exceptions.contains(c)) {
42  r = m_Exceptions[c];
43  }
44 
45  if (r == UnspecifiedRole) {
46  QRegExp r = m_EnergyPattern.value().toRegExp();
47 
48  res = r.exactMatch(c->name()) || r.exactMatch(QString::number(colnum));
49  } else {
50  res = (r == EnergyRole);
51  }
52  }
53 
54  return res;
55 }
QVariant value() const
QseRegExpParameter m_EnergyPattern
QHash< const QseColumn *, QseColumnRole > m_Exceptions
bool QseEXAFSOperator::matchesEnergyPattern ( const QseColumn col,
int  colnum 
)

Definition at line 21 of file qseexafsoperator.cpp.

References m_EnergyPattern, QseColumn::name(), and QseParameter::value().

Referenced by QseNormalizer::patternColumnRole().

22 {
23  bool res = false;
24 
25  if (c) {
26  QRegExp r = m_EnergyPattern.value().toRegExp();
27 
28  res = r.exactMatch(c->name()) || r.exactMatch(QString::number(colnum));
29  }
30 
31  return res;
32 }
QVariant value() const
QseRegExpParameter m_EnergyPattern
bool QseEXAFSOperator::matchesNormalizationColumn ( const QseColumn col,
int  colnum 
)

Definition at line 106 of file qseexafsoperator.cpp.

References m_Exceptions, m_NormalizationPattern, QseColumn::name(), NormalizationRole, UnspecifiedRole, and QseParameter::value().

Referenced by QseNormalizer::normalizeScan().

107 {
108  bool res = false;
109 
110  if (c) {
112 
113  if (m_Exceptions.contains(c)) {
114  r = m_Exceptions[c];
115  }
116 
117  if (r == UnspecifiedRole) {
118  QRegExp r = m_NormalizationPattern.value().toRegExp();
119 
120  res = r.exactMatch(c->name()) || r.exactMatch(QString::number(colnum));
121  } else {
122  res = (r == NormalizationRole);
123  }
124  }
125 
126  return res;
127 }
QVariant value() const
QHash< const QseColumn *, QseColumnRole > m_Exceptions
QseRegExpParameter m_NormalizationPattern
bool QseEXAFSOperator::matchesNormalizationPattern ( const QseColumn col,
int  colnum 
)

Definition at line 93 of file qseexafsoperator.cpp.

References m_NormalizationPattern, QseColumn::name(), and QseParameter::value().

Referenced by QseNormalizer::patternColumnRole().

94 {
95  bool res = false;
96 
97  if (c) {
98  QRegExp r = m_NormalizationPattern.value().toRegExp();
99 
100  res = r.exactMatch(c->name()) || r.exactMatch(QString::number(colnum));
101  }
102 
103  return res;
104 }
QVariant value() const
QseRegExpParameter m_NormalizationPattern
bool QseEXAFSOperator::matchesSecondsColumn ( const QseColumn col,
int  colnum 
)

Definition at line 142 of file qseexafsoperator.cpp.

References m_Exceptions, m_SecondsPattern, QseColumn::name(), SecondsRole, UnspecifiedRole, and QseParameter::value().

Referenced by QseNormalizer::normalizeScan().

143 {
144  bool res = false;
145 
146  if (c) {
148 
149  if (m_Exceptions.contains(c)) {
150  r = m_Exceptions[c];
151  }
152 
153  if (r == UnspecifiedRole) {
154  QRegExp r = m_SecondsPattern.value().toRegExp();
155 
156  res = r.exactMatch(c->name()) || r.exactMatch(QString::number(colnum));
157  } else {
158  res = (r == SecondsRole);
159  }
160  }
161 
162  return res;
163 }
QVariant value() const
QseRegExpParameter m_SecondsPattern
QHash< const QseColumn *, QseColumnRole > m_Exceptions
bool QseEXAFSOperator::matchesSecondsPattern ( const QseColumn col,
int  colnum 
)

Definition at line 129 of file qseexafsoperator.cpp.

References m_SecondsPattern, QseColumn::name(), and QseParameter::value().

Referenced by QseNormalizer::patternColumnRole().

130 {
131  bool res = false;
132 
133  if (c) {
134  QRegExp r = m_SecondsPattern.value().toRegExp();
135 
136  res = r.exactMatch(c->name()) || r.exactMatch(QString::number(colnum));
137  }
138 
139  return res;
140 }
QVariant value() const
QseRegExpParameter m_SecondsPattern
QseDataSet * QseEXAFSOperator::outputData ( )

Definition at line 371 of file qseexafsoperator.cpp.

References m_OutputData.

372 {
373  return m_OutputData;
374 }
QseDataSet * m_OutputData

Member Data Documentation

QseRegExpParameter QseEXAFSOperator::m_CopyNormalizedPattern
protected

Definition at line 75 of file qseexafsoperator.h.

Referenced by matchesCopyNormalizedColumn(), and matchesCopyNormalizedPattern().

QseRegExpParameter QseEXAFSOperator::m_CopyPattern
protected

Definition at line 74 of file qseexafsoperator.h.

Referenced by matchesCopyColumn(), and matchesCopyPattern().

QseRegExpParameter QseEXAFSOperator::m_CopyRatePattern
protected

Definition at line 76 of file qseexafsoperator.h.

Referenced by matchesCopyRateColumn(), and matchesCopyRatePattern().

QseRegExpParameter QseEXAFSOperator::m_CopyTotalCountsPattern
protected
QseRegExpParameter QseEXAFSOperator::m_DetectorPattern
protected

Definition at line 71 of file qseexafsoperator.h.

Referenced by matchesDetectorColumn(), and matchesDetectorPattern().

QseRegExpParameter QseEXAFSOperator::m_EnergyPattern
protected

Definition at line 70 of file qseexafsoperator.h.

Referenced by matchesEnergyColumn(), and matchesEnergyPattern().

QHash<const QseColumn*, QseColumnRole> QseEXAFSOperator::m_Exceptions
protected
QseDataSet* QseEXAFSOperator::m_InputData
protected
QseRegExpParameter QseEXAFSOperator::m_NormalizationPattern
protected

Definition at line 72 of file qseexafsoperator.h.

Referenced by matchesNormalizationColumn(), and matchesNormalizationPattern().

QseDataSet* QseEXAFSOperator::m_OutputData
protected
QHash<const QseScan*, QseScanRole> QseEXAFSOperator::m_ScanExceptions
protected
QseRegExpParameter QseEXAFSOperator::m_SecondsPattern
protected

Definition at line 73 of file qseexafsoperator.h.

Referenced by matchesSecondsColumn(), and matchesSecondsPattern().


The documentation for this class was generated from the following files: