13 m_Normalizer(normalizer),
15 m_NormalizerModel(NULL),
16 m_ScanPatternEditor(
this, &m_Normalizer->m_ScanPattern, NULL),
17 m_EnergyPatternEditor(
this, &m_Normalizer->m_EnergyPattern, NULL),
18 m_DetectorPatternEditor(
this, &m_Normalizer->m_DetectorPattern, NULL),
19 m_NormalizationPatternEditor(
this, &m_Normalizer->m_NormalizationPattern, NULL),
20 m_SecondsPatternEditor(
this, &m_Normalizer->m_SecondsPattern, NULL),
21 m_CopyPatternEditor(
this, &m_Normalizer->m_CopyPattern, NULL),
22 m_CopyNormalizedPatternEditor(
this, &m_Normalizer->m_CopyNormalizedPattern, NULL),
23 m_CopyRatePatternEditor(
this, &m_Normalizer->m_CopyRatePattern, NULL),
24 m_CopyTotalCountsPatternEditor(
this, &m_Normalizer->m_CopyTotalCountsPattern, NULL),
25 m_MinScanRowCountEditor(
this, &m_Normalizer->m_MinScanRowCount, NULL),
26 m_MaxScanRowCountEditor(
this, &m_Normalizer->m_MaxScanRowCount, NULL),
27 m_MinScanColumnCountEditor(
this, &m_Normalizer->m_MinScanColumnCount, NULL),
28 m_MaxScanColumnCountEditor(
this, &m_Normalizer->m_MaxScanColumnCount, NULL),
29 m_InputEnergyUnitsEditor(
this, &m_Normalizer->m_InputEnergyUnits, NULL),
30 m_OutputEnergyUnitsEditor(
this, &m_Normalizer->m_OutputEnergyUnits, NULL)
34 m_ScanPatternEditor.setEditors
35 (scanPatternEdit,scanRegexp,patternApply,patternCancel);
37 m_EnergyPatternEditor.setEditors
38 (energyPatternEdit,energyRegexp,patternApply,patternCancel,
41 m_DetectorPatternEditor.setEditors
42 (detectorPatternEdit,detectorRegexp,patternApply,patternCancel,
45 m_NormalizationPatternEditor.setEditors
46 (normalizationPatternEdit,normalizationRegexp,patternApply,patternCancel,
49 m_SecondsPatternEditor.setEditors
50 (secondsPatternEdit,secondsRegexp,patternApply,patternCancel,
53 m_CopyPatternEditor.setEditors
54 (copyPatternEdit,copyRegexp,patternApply,patternCancel,
57 m_CopyNormalizedPatternEditor.setEditors
58 (copyNormalizedPatternEdit,copyNormalizedRegexp,patternApply,patternCancel,
61 m_CopyRatePatternEditor.setEditors
62 (copyRatePatternEdit,copyRateRegexp,patternApply,patternCancel,
65 m_CopyTotalCountsPatternEditor.setEditors
66 (copyTotalCountsPatternEdit,copyTotalCountsRegexp,patternApply,patternCancel,
69 m_MinScanRowCountEditor.setEditors
70 (minScanRowCount,patternApply,patternCancel);
72 m_MaxScanRowCountEditor.setEditors
73 (maxScanRowCount,patternApply,patternCancel);
75 m_MinScanColumnCountEditor.setEditors
76 (minScanColumnCount,patternApply,patternCancel);
78 m_MaxScanColumnCountEditor.setEditors
79 (maxScanColumnCount,patternApply,patternCancel);
81 m_InputEnergyUnitsEditor.setEditors
82 (inputUnits,patternApply,patternCancel);
84 m_OutputEnergyUnitsEditor.setEditors
85 (outputUnits,patternApply,patternCancel);
87 connect(patternApply, SIGNAL(clicked()),
this, SLOT(dialogApply()));
88 connect(patternCancel, SIGNAL(clicked()),
this, SLOT(dialogCancel()));
89 connect(normalizeButton, SIGNAL(clicked()),
this, SLOT(normalize()));
92 m_NormalizerTable -> setModel(m_NormalizerModel);
94 m_NormalizerTable -> setContextMenuPolicy(Qt::CustomContextMenu);
95 connect(m_NormalizerTable, SIGNAL(customContextMenuRequested(
const QPoint&)),
96 this, SLOT(normalizerTableContextMenu(
const QPoint&)));
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()));
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()));
194 QMenu menu(NULL, NULL);
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"));
200 QAction* separator = menu.addSeparator();
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"));
221 menu.setMouseTracking(
true);
223 QAction*
id = menu.exec(QCursor::pos() + QPoint( -40, -10), separator);
225 if (
id == excludeScan) {
227 }
else if (
id == includeScan) {
229 }
else if (
id == defaultScan) {
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) {
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) {
256 QItemSelectionModel *s = m_NormalizerTable -> selectionModel();
265 QItemSelectionModel *s = m_NormalizerTable -> selectionModel();
277 patternApply -> setEnabled(
false);
278 patternCancel-> setEnabled(
false);
279 normalizeButton-> setEnabled(
true);
289 patternApply -> setEnabled(
false);
290 patternCancel-> setEnabled(
false);
291 normalizeButton-> setEnabled(
true);
void setNormalizationColumns()
void setDefaultsColumns()
void normalizerTableContextMenu(const QPoint &pos)
void setScanExceptions(QseNormalizer::QseScanRole r)
void setColumnExceptions(QseNormalizer::QseColumnRole r)
void setCopyTotalCountsColumns()
void setCopyRateColumns()
void setCopyNormalizedColumns()
QseNormalizerModel * m_NormalizerModel
void setDetectorColumns()
QseNormalizer * m_Normalizer
QseNormalizerUI(QseNormalizer *normalizer, QWidget *parent=0)