qse  0.5.4
Public Member Functions | Private Slots | Private Attributes | List of all members
QseNormalizerUI Class Reference

#include <qsenormalizerui.h>

Inheritance diagram for QseNormalizerUI:
Inheritance graph

Public Member Functions

 QseNormalizerUI (QseNormalizer *normalizer, QWidget *parent=0)
 
void setScanExceptions (QseNormalizer::QseScanRole r)
 
void setColumnExceptions (QseNormalizer::QseColumnRole r)
 
- Public Member Functions inherited from QseEXAFSOperatorUI
 QseEXAFSOperatorUI (QseEXAFSOperator *oper, QWidget *parent=0)
 
- Public Member Functions inherited from QseOperatorEditor
 QseOperatorEditor (QseOperator *oper, QWidget *parent=0)
 
void addEditor (QseParameterEditor *editor)
 

Private Slots

void dialogApply ()
 
void dialogCancel ()
 
void normalize ()
 
void normalizerTableContextMenu (const QPoint &pos)
 
void setScansUsed ()
 
void setScansUnused ()
 
void setScansDefault ()
 
void setEnergyColumns ()
 
void setDetectorColumns ()
 
void setNormalizationColumns ()
 
void setSecondsColumns ()
 
void setCopyColumns ()
 
void setCopyNormalizedColumns ()
 
void setCopyRateColumns ()
 
void setCopyTotalCountsColumns ()
 
void setExcludeColumns ()
 
void setDefaultsColumns ()
 

Private Attributes

QseNormalizerm_Normalizer
 
QseNormalizerModelm_NormalizerModel
 
QseRegExpParameterEditor m_ScanPatternEditor
 
QseRegExpParameterEditor m_EnergyPatternEditor
 
QseRegExpParameterEditor m_DetectorPatternEditor
 
QseRegExpParameterEditor m_NormalizationPatternEditor
 
QseRegExpParameterEditor m_SecondsPatternEditor
 
QseRegExpParameterEditor m_CopyPatternEditor
 
QseRegExpParameterEditor m_CopyNormalizedPatternEditor
 
QseRegExpParameterEditor m_CopyRatePatternEditor
 
QseRegExpParameterEditor m_CopyTotalCountsPatternEditor
 
QseStringParameterEditor m_MinScanRowCountEditor
 
QseStringParameterEditor m_MaxScanRowCountEditor
 
QseStringParameterEditor m_MinScanColumnCountEditor
 
QseStringParameterEditor m_MaxScanColumnCountEditor
 
QseEnumParameterEditor m_InputEnergyUnitsEditor
 
QseEnumParameterEditor m_OutputEnergyUnitsEditor
 

Additional Inherited Members

- Public Slots inherited from QseOperatorEditor
bool editorValidate ()
 
void editorApply ()
 
void editorCancel ()
 
- Protected Attributes inherited from QseOperatorEditor
QseOperatorm_Operator
 
QList< QseParameterEditor * > m_Editors
 

Detailed Description

Definition at line 14 of file qsenormalizerui.h.

Constructor & Destructor Documentation

QseNormalizerUI::QseNormalizerUI ( QseNormalizer normalizer,
QWidget *  parent = 0 
)

Definition at line 11 of file qsenormalizerui.cpp.

References QseEXAFSOperator::CopyNormalizedRole, QseEXAFSOperator::CopyRateRole, QseEXAFSOperator::CopyRole, QseEXAFSOperator::CopyTotalCountsRole, QseEXAFSOperator::DetectorRole, QseEXAFSOperator::EnergyRole, QseEXAFSOperator::NormalizationRole, and QseEXAFSOperator::SecondsRole.

12  : QseEXAFSOperatorUI(normalizer, parent),
13  m_Normalizer(normalizer),
14 // m_NormalizerTable(NULL),
15  m_NormalizerModel(NULL),
31 {
32  setupUi(this);
33 
35  (scanPatternEdit,scanRegexp,patternApply,patternCancel);
36 
38  (energyPatternEdit,energyRegexp,patternApply,patternCancel,
40 
42  (detectorPatternEdit,detectorRegexp,patternApply,patternCancel,
44 
46  (normalizationPatternEdit,normalizationRegexp,patternApply,patternCancel,
48 
50  (secondsPatternEdit,secondsRegexp,patternApply,patternCancel,
52 
54  (copyPatternEdit,copyRegexp,patternApply,patternCancel,
56 
58  (copyNormalizedPatternEdit,copyNormalizedRegexp,patternApply,patternCancel,
60 
62  (copyRatePatternEdit,copyRateRegexp,patternApply,patternCancel,
64 
66  (copyTotalCountsPatternEdit,copyTotalCountsRegexp,patternApply,patternCancel,
68 
70  (minScanRowCount,patternApply,patternCancel);
71 
73  (maxScanRowCount,patternApply,patternCancel);
74 
76  (minScanColumnCount,patternApply,patternCancel);
77 
79  (maxScanColumnCount,patternApply,patternCancel);
80 
82  (inputUnits,patternApply,patternCancel);
83 
85  (outputUnits,patternApply,patternCancel);
86 
87  connect(patternApply, SIGNAL(clicked()), this, SLOT(dialogApply()));
88  connect(patternCancel, SIGNAL(clicked()), this, SLOT(dialogCancel()));
89  connect(normalizeButton, SIGNAL(clicked()), this, SLOT(normalize()));
90 
91  m_NormalizerModel = new QseNormalizerModel(m_Normalizer, m_NormalizerTable, this);
92  m_NormalizerTable -> setModel(m_NormalizerModel);
93 
94  m_NormalizerTable -> setContextMenuPolicy(Qt::CustomContextMenu);
95  connect(m_NormalizerTable, SIGNAL(customContextMenuRequested(const QPoint&)),
96  this, SLOT(normalizerTableContextMenu(const QPoint&)));
97 
98  connect(m_UseScansButton, SIGNAL(clicked()),
99  this,SLOT(setScansUsed()));
100  connect(m_ExcludeScansButton, SIGNAL(clicked()),
101  this,SLOT(setScansUnused()));
102  connect(m_DefaultScansButton, SIGNAL(clicked()),
103  this,SLOT(setScansDefault()));
104 
105  connect(m_EnergyColumnsButton, SIGNAL(clicked()),
106  this,SLOT(setEnergyColumns()));
107  connect(m_DetectorColumnsButton, SIGNAL(clicked()),
108  this,SLOT(setDetectorColumns()));
109  connect(m_NormalizationColumnsButton, SIGNAL(clicked()),
110  this,SLOT(setNormalizationColumns()));
111  connect(m_SecondsColumnsButton, SIGNAL(clicked()),
112  this,SLOT(setSecondsColumns()));
113  connect(m_CopyColumnsButton, SIGNAL(clicked()),
114  this,SLOT(setCopyColumns()));
115  connect(m_CopyNormalizedColumnsButton, SIGNAL(clicked()),
116  this,SLOT(setCopyNormalizedColumns()));
117  connect(m_CopyRateColumnsButton, SIGNAL(clicked()),
118  this,SLOT(setCopyRateColumns()));
119  connect(m_CopyTotalCountsColumnsButton, SIGNAL(clicked()),
120  this,SLOT(setCopyTotalCountsColumns()));
121  connect(m_ExcludeColumnsButton, SIGNAL(clicked()),
122  this,SLOT(setExcludeColumns()));
123  connect(m_DefaultColumnsButton, SIGNAL(clicked()),
124  this,SLOT(setDefaultsColumns()));
125 }
QseRegExpParameter m_DetectorPattern
QseStringParameterEditor m_MaxScanColumnCountEditor
void setNormalizationColumns()
QseRegExpParameter m_ScanPattern
Definition: qsenormalizer.h:47
QseStringParameter m_MinScanColumnCount
Definition: qsenormalizer.h:51
QseRegExpParameterEditor m_CopyTotalCountsPatternEditor
QseRegExpParameterEditor m_ScanPatternEditor
QseRegExpParameterEditor m_CopyPatternEditor
QseRegExpParameterEditor m_CopyNormalizedPatternEditor
void setEditors(QComboBox *combo, QPushButton *apply, QPushButton *cancel)
QseRegExpParameter m_SecondsPattern
void setEditors(QLineEdit *value, QPushButton *apply, QPushButton *cancel)
QseRegExpParameterEditor m_DetectorPatternEditor
void setEditors(QLineEdit *pattern, QCheckBox *useRegExp, QPushButton *apply, QPushButton *cancel, QPushButton *excepts=NULL, QColor fg=Qt::black, QColor bg=Qt::white)
static QColor colorForRole(QseColumnRole r)
QseRegExpParameterEditor m_SecondsPatternEditor
QseEnumParameterEditor m_InputEnergyUnitsEditor
QseRegExpParameterEditor m_NormalizationPatternEditor
void normalizerTableContextMenu(const QPoint &pos)
QseRegExpParameter m_EnergyPattern
QseEnumParameterEditor m_OutputEnergyUnitsEditor
QseEnumParameter m_InputEnergyUnits
Definition: qsenormalizer.h:53
QseRegExpParameter m_CopyRatePattern
QseEXAFSOperatorUI(QseEXAFSOperator *oper, QWidget *parent=0)
QseStringParameterEditor m_MinScanRowCountEditor
QseRegExpParameter m_CopyTotalCountsPattern
QseRegExpParameter m_NormalizationPattern
QseStringParameter m_MaxScanRowCount
Definition: qsenormalizer.h:50
QseRegExpParameter m_CopyNormalizedPattern
QseRegExpParameterEditor m_CopyRatePatternEditor
void setCopyTotalCountsColumns()
QseStringParameterEditor m_MaxScanRowCountEditor
QseStringParameter m_MinScanRowCount
Definition: qsenormalizer.h:49
void setCopyNormalizedColumns()
QseNormalizerModel * m_NormalizerModel
QseStringParameter m_MaxScanColumnCount
Definition: qsenormalizer.h:52
QseRegExpParameterEditor m_EnergyPatternEditor
QseNormalizer * m_Normalizer
QseRegExpParameter m_CopyPattern
static QColor backgroundColorForRole(QseColumnRole r)
QseEnumParameter m_OutputEnergyUnits
Definition: qsenormalizer.h:54
QseStringParameterEditor m_MinScanColumnCountEditor

Member Function Documentation

void QseNormalizerUI::dialogApply ( )
privateslot

Definition at line 272 of file qsenormalizerui.cpp.

References QseOperatorEditor::editorApply(), QseOperatorEditor::editorValidate(), and m_NormalizerModel.

Referenced by normalize().

273 {
274  if (editorValidate()) {
275  editorApply();
276 
277  patternApply -> setEnabled(false);
278  patternCancel-> setEnabled(false);
279  normalizeButton-> setEnabled(true);
280 
281  m_NormalizerModel -> operationCompleted();
282  }
283 }
QseNormalizerModel * m_NormalizerModel
void QseNormalizerUI::dialogCancel ( )
privateslot

Definition at line 285 of file qsenormalizerui.cpp.

References QseOperatorEditor::editorCancel(), and m_NormalizerModel.

286 {
287  editorCancel();
288 
289  patternApply -> setEnabled(false);
290  patternCancel-> setEnabled(false);
291  normalizeButton-> setEnabled(true);
292 
293  m_NormalizerModel -> operationCompleted();
294 }
QseNormalizerModel * m_NormalizerModel
void QseNormalizerUI::normalize ( )
privateslot

Definition at line 296 of file qsenormalizerui.cpp.

References dialogApply(), and m_Normalizer.

297 {
298  dialogApply();
299 
300  m_Normalizer -> exec();
301 }
QseNormalizer * m_Normalizer
void QseNormalizerUI::normalizerTableContextMenu ( const QPoint &  pos)
privateslot

Definition at line 192 of file qsenormalizerui.cpp.

References setCopyColumns(), setCopyNormalizedColumns(), setCopyRateColumns(), setCopyTotalCountsColumns(), setDefaultsColumns(), setDetectorColumns(), setEnergyColumns(), setExcludeColumns(), setNormalizationColumns(), setScansDefault(), setScansUnused(), setScansUsed(), and setSecondsColumns().

193 {
194  QMenu menu(NULL, NULL);
195 
196  QAction* excludeScan = menu.addAction(QString("Exclude Scans"));
197  QAction* includeScan = menu.addAction(QString("Include Scans"));
198  QAction* defaultScan = menu.addAction(QString("Return Scans to default usage"));
199 
200  QAction* separator = menu.addSeparator();
201 
202  QAction* energyColumn = menu.addAction(QString("Use columns as Energy"));
203  QAction* detectorColumn = menu.addAction(QString("Use columns as Detector"));
204  QAction* normalizeColumn =
205  menu.addAction(QString("Use columns for normalization"));
206  QAction* secondsColumn =
207  menu.addAction(QString("Use columns for counting time"));
208  QAction* copyColumn =
209  menu.addAction(QString("Copy columns to output"));
210  QAction* copyNormalizedColumn =
211  menu.addAction(QString("Copy columns to output normalized by 'normalization'"));
212  QAction* copyRateColumn =
213  menu.addAction(QString("Copy columns to output divided by 'seconds'"));
214  QAction* copyTotalCountsColumn =
215  menu.addAction(QString("Copy columns to output multiplied by 'seconds'"));
216  QAction* excludeColumn =
217  menu.addAction(QString("Do not use columns"));
218  QAction* defaultColumn =
219  menu.addAction(QString("Return columns to default usage"));
220 
221  menu.setMouseTracking(true);
222 
223  QAction* id = menu.exec(QCursor::pos() + QPoint( -40, -10), separator);
224 
225  if (id == excludeScan) {
226  setScansUnused();
227  } else if (id == includeScan) {
228  setScansUsed();
229  } else if (id == defaultScan) {
230  setScansDefault();
231  } else if (id == energyColumn) {
233  } else if (id == detectorColumn) {
235  } else if (id == normalizeColumn) {
237  } else if (id == secondsColumn) {
239  } else if (id == copyColumn) {
240  setCopyColumns();
241  } else if (id == copyNormalizedColumn) {
243  } else if (id == copyRateColumn) {
245  } else if (id == copyTotalCountsColumn) {
247  } else if (id == excludeColumn) {
249  } else if (id == defaultColumn) {
251  }
252 }
void setNormalizationColumns()
void setCopyTotalCountsColumns()
void setCopyNormalizedColumns()
void QseNormalizerUI::setColumnExceptions ( QseNormalizer::QseColumnRole  r)

Definition at line 263 of file qsenormalizerui.cpp.

References m_NormalizerModel.

Referenced by setCopyColumns(), setCopyNormalizedColumns(), setCopyRateColumns(), setCopyTotalCountsColumns(), setDefaultsColumns(), setDetectorColumns(), setEnergyColumns(), setExcludeColumns(), setNormalizationColumns(), and setSecondsColumns().

264 {
265  QItemSelectionModel *s = m_NormalizerTable -> selectionModel();
266 
268 
269  m_NormalizerModel -> operationCompleted();
270 }
void setColumnExceptions(QseNormalizer::QseColumnRole r)
QseNormalizerModel * m_NormalizerModel
void QseNormalizerUI::setCopyColumns ( )
privateslot

Definition at line 162 of file qsenormalizerui.cpp.

References QseEXAFSOperator::CopyRole, and setColumnExceptions().

Referenced by normalizerTableContextMenu().

163 {
165 }
void setColumnExceptions(QseNormalizer::QseColumnRole r)
void QseNormalizerUI::setCopyNormalizedColumns ( )
privateslot
void QseNormalizerUI::setCopyRateColumns ( )
privateslot

Definition at line 172 of file qsenormalizerui.cpp.

References QseEXAFSOperator::CopyRateRole, and setColumnExceptions().

Referenced by normalizerTableContextMenu().

173 {
175 }
void setColumnExceptions(QseNormalizer::QseColumnRole r)
void QseNormalizerUI::setCopyTotalCountsColumns ( )
privateslot
void QseNormalizerUI::setDefaultsColumns ( )
privateslot
void QseNormalizerUI::setDetectorColumns ( )
privateslot

Definition at line 147 of file qsenormalizerui.cpp.

References QseEXAFSOperator::DetectorRole, and setColumnExceptions().

Referenced by normalizerTableContextMenu().

148 {
150 }
void setColumnExceptions(QseNormalizer::QseColumnRole r)
void QseNormalizerUI::setEnergyColumns ( )
privateslot

Definition at line 142 of file qsenormalizerui.cpp.

References QseEXAFSOperator::EnergyRole, and setColumnExceptions().

Referenced by normalizerTableContextMenu().

143 {
145 }
void setColumnExceptions(QseNormalizer::QseColumnRole r)
void QseNormalizerUI::setExcludeColumns ( )
privateslot

Definition at line 182 of file qsenormalizerui.cpp.

References QseEXAFSOperator::NotUsedRole, and setColumnExceptions().

Referenced by normalizerTableContextMenu().

183 {
185 }
void setColumnExceptions(QseNormalizer::QseColumnRole r)
void QseNormalizerUI::setNormalizationColumns ( )
privateslot
void QseNormalizerUI::setScanExceptions ( QseNormalizer::QseScanRole  r)

Definition at line 254 of file qsenormalizerui.cpp.

References m_NormalizerModel.

Referenced by setScansDefault(), setScansUnused(), and setScansUsed().

255 {
256  QItemSelectionModel *s = m_NormalizerTable -> selectionModel();
257 
259 
260  m_NormalizerModel -> operationCompleted();
261 }
void setScanExceptions(QseNormalizer::QseScanRole r)
QseNormalizerModel * m_NormalizerModel
void QseNormalizerUI::setScansDefault ( )
privateslot
void QseNormalizerUI::setScansUnused ( )
privateslot
void QseNormalizerUI::setScansUsed ( )
privateslot

Definition at line 127 of file qsenormalizerui.cpp.

References QseEXAFSOperator::ScanUsedRole, and setScanExceptions().

Referenced by normalizerTableContextMenu().

128 {
130 }
void setScanExceptions(QseNormalizer::QseScanRole r)
void QseNormalizerUI::setSecondsColumns ( )
privateslot

Definition at line 157 of file qsenormalizerui.cpp.

References QseEXAFSOperator::SecondsRole, and setColumnExceptions().

Referenced by normalizerTableContextMenu().

158 {
160 }
void setColumnExceptions(QseNormalizer::QseColumnRole r)

Member Data Documentation

QseRegExpParameterEditor QseNormalizerUI::m_CopyNormalizedPatternEditor
private

Definition at line 54 of file qsenormalizerui.h.

QseRegExpParameterEditor QseNormalizerUI::m_CopyPatternEditor
private

Definition at line 53 of file qsenormalizerui.h.

QseRegExpParameterEditor QseNormalizerUI::m_CopyRatePatternEditor
private

Definition at line 55 of file qsenormalizerui.h.

QseRegExpParameterEditor QseNormalizerUI::m_CopyTotalCountsPatternEditor
private

Definition at line 56 of file qsenormalizerui.h.

QseRegExpParameterEditor QseNormalizerUI::m_DetectorPatternEditor
private

Definition at line 50 of file qsenormalizerui.h.

QseRegExpParameterEditor QseNormalizerUI::m_EnergyPatternEditor
private

Definition at line 49 of file qsenormalizerui.h.

QseEnumParameterEditor QseNormalizerUI::m_InputEnergyUnitsEditor
private

Definition at line 62 of file qsenormalizerui.h.

QseStringParameterEditor QseNormalizerUI::m_MaxScanColumnCountEditor
private

Definition at line 61 of file qsenormalizerui.h.

QseStringParameterEditor QseNormalizerUI::m_MaxScanRowCountEditor
private

Definition at line 59 of file qsenormalizerui.h.

QseStringParameterEditor QseNormalizerUI::m_MinScanColumnCountEditor
private

Definition at line 60 of file qsenormalizerui.h.

QseStringParameterEditor QseNormalizerUI::m_MinScanRowCountEditor
private

Definition at line 58 of file qsenormalizerui.h.

QseRegExpParameterEditor QseNormalizerUI::m_NormalizationPatternEditor
private

Definition at line 51 of file qsenormalizerui.h.

QseNormalizer* QseNormalizerUI::m_Normalizer
private
QseNormalizerModel* QseNormalizerUI::m_NormalizerModel
private
QseEnumParameterEditor QseNormalizerUI::m_OutputEnergyUnitsEditor
private

Definition at line 63 of file qsenormalizerui.h.

QseRegExpParameterEditor QseNormalizerUI::m_ScanPatternEditor
private

Definition at line 48 of file qsenormalizerui.h.

QseRegExpParameterEditor QseNormalizerUI::m_SecondsPatternEditor
private

Definition at line 52 of file qsenormalizerui.h.


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