QXRD  0.11.16
Public Slots | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
QxrdDetectorControlWindow Class Reference

#include <qxrddetectorcontrolwindow.h>

Inheritance diagram for QxrdDetectorControlWindow:
Inheritance graph
[legend]
Collaboration diagram for QxrdDetectorControlWindow:
Collaboration graph
[legend]

Public Slots

void printMessage (QString msg, QDateTime ts=QDateTime::currentDateTime())
 
- Public Slots inherited from QcepMainWindow
void shrinkPanels (int fontSize, int spacing)
 
void setFontSize (int fontSize)
 
void setSpacing (int spacing)
 
virtual void printMessage (QString msg, QDateTime ts=QDateTime::currentDateTime())=0
 

Public Member Functions

 QxrdDetectorControlWindow (QcepSettingsSaverWPtr saver, QxrdExperimentWPtr exp, QxrdAcquisitionWPtr acq, QxrdDetectorWPtr det, QxrdDetectorProcessorWPtr proc, QWidget *parent=0)
 
 ~QxrdDetectorControlWindow ()
 
void displayNewData (QcepImageDataBasePtr img, QcepMaskDataPtr overflow)
 
void displayNewMask (QcepMaskDataPtr mask)
 
- Public Member Functions inherited from QxrdMainWindow
 QxrdMainWindow (QWidget *parent=0)
 
- Public Member Functions inherited from QcepMainWindow
 QcepMainWindow (QWidget *parent=0)
 
void possiblyClose ()
 
bool wantToClose ()
 

Protected Member Functions

void changeEvent (QEvent *e)
 
- Protected Member Functions inherited from QcepMainWindow
void shrinkDockWidget (QDockWidget *dockWidget, int fontSize, int spacing)
 
void shrinkObject (QObject *obj, int fontSize, int spacing)
 
void setObjectSpacing (QObject *obj, int spacing)
 

Private Slots

void doAppendROI ()
 
void doDeleteROI ()
 
void doMoveROIDown ()
 
void doMoveROIUp ()
 
void updateImageDisplay ()
 
void onUpdateIntervalMsecChanged (int newVal)
 
void updateWindowTitle ()
 
void updateROIDisplay (bool show)
 
void doBrowseMask ()
 
void doClearMask ()
 
void doBrowseDark ()
 
void doClearDark ()
 
void doBrowseBadPixels ()
 
void doClearBadPixels ()
 
void doBrowseGainCorrection ()
 
void doClearGainCorrection ()
 
void doRecalculate ()
 
void doVisualizeBackground ()
 
void doVisualizePeak ()
 

Private Member Functions

QVector< int > selectedROIs ()
 

Private Attributes

QcepSettingsSaverWPtr m_Saver
 
QxrdExperimentWPtr m_Experiment
 
QxrdAcquisitionWPtr m_Acquisition
 
QxrdDetectorWPtr m_Detector
 
QxrdDetectorProcessorWPtr m_Processor
 
QxrdROICoordinatesListModelPtr m_ROIModel
 
QMutex m_UpdateMutex
 
QTimer m_UpdateTimer
 
QcepImageDataBasePtr m_DisplayedImage
 
QcepMaskDataPtr m_DisplayedMask
 
QcepMaskDataPtr m_DisplayedOverflow
 
QcepImageDataBasePtr m_NewImage
 
QcepMaskDataPtr m_NewMask
 
QcepMaskDataPtr m_NewOverflow
 
QAtomicInt m_NewDataAvailable
 
QAtomicInt m_NewMaskAvailable
 

Detailed Description

Definition at line 14 of file qxrddetectorcontrolwindow.h.

Constructor & Destructor Documentation

QxrdDetectorControlWindow::QxrdDetectorControlWindow ( QcepSettingsSaverWPtr  saver,
QxrdExperimentWPtr  exp,
QxrdAcquisitionWPtr  acq,
QxrdDetectorWPtr  det,
QxrdDetectorProcessorWPtr  proc,
QWidget *  parent = 0 
)
explicit

Definition at line 16 of file qxrddetectorcontrolwindow.cpp.

References doAppendROI(), doBrowseBadPixels(), doBrowseDark(), doBrowseGainCorrection(), doBrowseMask(), doClearBadPixels(), doClearDark(), doClearGainCorrection(), doClearMask(), doDeleteROI(), doMoveROIDown(), doMoveROIUp(), doRecalculate(), doVisualizeBackground(), doVisualizePeak(), g_Application, m_Detector, m_Experiment, m_Processor, m_ROIModel, m_UpdateTimer, onUpdateIntervalMsecChanged(), QcepMainWindow::setFontSize(), QcepMainWindow::setSpacing(), QxrdROICoordinatesListModel::TypeCol, updateImageDisplay(), updateROIDisplay(), updateWindowTitle(), QcepIntProperty::valueChanged(), QcepBoolProperty::valueChanged(), and QcepStringProperty::valueChanged().

21  :
22  QxrdMainWindow(parent),
23  m_Saver(saver),
24  m_Experiment(exp),
25  m_Acquisition(acq),
26  m_Detector(det),
27  m_Processor(proc)
28 {
29  setupUi(this);
30 
31  setAttribute(Qt::WA_DeleteOnClose, false);
32 
34  QxrdApplication *app = qobject_cast<QxrdApplication*>(g_Application);
37 
38  if (dp) {
39  dp->prop_DetectorDisplayMode() -> linkTo(m_DetectorDisplayMode);
40  dp->prop_PerformDarkSubtraction() -> linkTo(m_PerformDarkSubtraction);
41  dp->prop_SaveRawImages() -> linkTo(m_SaveRawData);
42  dp->prop_SaveDarkImages() -> linkTo(m_SaveDarkData);
43  dp->prop_PerformBadPixels() -> linkTo(m_BadPixelCorrection);
44  dp->prop_PerformGainCorrection() -> linkTo(m_GainCorrection);
45  dp->prop_SaveSubtracted() -> linkTo(m_SaveSubtractedData);
46 
47  dp->prop_DarkImagePath() -> linkTo(m_DarkImagePath);
48  dp->prop_RawDataSubdir() -> linkTo(m_RawDataSubdir);
49  dp->prop_DarkDataSubdir() -> linkTo(m_DarkDataSubdir);
50  dp->prop_BadPixelsPath() -> linkTo(m_BadPixelPath);
51  dp->prop_GainMapPath() -> linkTo(m_GainCorrectionPath);
52  dp->prop_SubtractedSubdir() -> linkTo(m_SubtractedDataSubdir);
53 
54  dp->prop_MaskPath() -> linkTo(m_MaskImagePath);
55 
56  dp->prop_PerformIntegration() -> linkTo(m_PerformIntegration);
57  dp->prop_DisplayIntegratedData() -> linkTo(m_DisplayIntegratedData);
58  dp->prop_SaveIntegratedData() -> linkTo(m_SaveIntegratedData);
59  dp->prop_IntegratedDataFile() -> linkTo(m_IntegratedDataFile);
60  dp->prop_SaveIntegratedDataSeparate() -> linkTo(m_SaveIntegratedDataSeparate);
61  dp->prop_IntegratedDataSubdir() -> linkTo(m_IntegratedDataSubdir);
62 
63  dp->prop_AccumulateIntegrated2D() -> linkTo(m_AccumulateIntegratedData);
64  dp->prop_AccumulateIntegratedName()-> linkTo(m_AccumulateIntegratedName);
65 
66  dp->prop_CalculateROICounts() -> linkTo(m_CalculateROICounts);
67  dp->prop_DisplayROIBorders() -> linkTo(m_DisplayROIBorders);
68 
69  connect(dp->prop_DisplayROIBorders(), &QcepBoolProperty::valueChanged, this, &QxrdDetectorControlWindow::updateROIDisplay);
70 
71  connect(m_BrowseMask, &QAbstractButton::clicked, this, &QxrdDetectorControlWindow::doBrowseMask);
72  connect(m_ClearMask, &QAbstractButton::clicked, this, &QxrdDetectorControlWindow::doClearMask);
73  connect(m_BrowseDarkImage, &QAbstractButton::clicked, this, &QxrdDetectorControlWindow::doBrowseDark);
74  connect(m_ClearDarkImage, &QAbstractButton::clicked, this, &QxrdDetectorControlWindow::doClearDark);
75  connect(m_BrowseBadPixels, &QAbstractButton::clicked, this, &QxrdDetectorControlWindow::doBrowseBadPixels);
76  connect(m_ClearBadPixels, &QAbstractButton::clicked, this, &QxrdDetectorControlWindow::doClearBadPixels);
77  connect(m_BrowseGainImage, &QAbstractButton::clicked, this, &QxrdDetectorControlWindow::doBrowseGainCorrection);
78  connect(m_ClearGainImage, &QAbstractButton::clicked, this, &QxrdDetectorControlWindow::doClearGainCorrection);
79  connect(m_ActionLoadDarkImage, &QAction::triggered, this, &QxrdDetectorControlWindow::doBrowseDark);
80  connect(m_ActionLoadMask, &QAction::triggered, this, &QxrdDetectorControlWindow::doBrowseMask);
81 
82  updateROIDisplay(dp->get_DisplayROIBorders());
83 
84  QxrdROICalculatorPtr calc(dp->roiCalculator());
85 
86  if (calc) {
87  m_ROIModel = calc->roiModel();
88 
89  m_ROIWidget->setItemDelegateForColumn(QxrdROICoordinatesListModel::TypeCol, new QxrdROITypeDelegate());
90  m_ROIWidget->setModel(m_ROIModel.data());
91 
92  connect(m_NewROI, &QAbstractButton::clicked, this, &QxrdDetectorControlWindow::doAppendROI);
93  connect(m_DeleteROI, &QAbstractButton::clicked, this, &QxrdDetectorControlWindow::doDeleteROI);
94  connect(m_MoveROIDown, &QAbstractButton::clicked, this, &QxrdDetectorControlWindow::doMoveROIDown);
95  connect(m_MoveROIUp, &QAbstractButton::clicked, this, &QxrdDetectorControlWindow::doMoveROIUp);
96 
97  connect(m_RecalculateButton, &QAbstractButton::clicked, this, &QxrdDetectorControlWindow::doRecalculate);
98  connect(m_VisualizeROIBackground, &QAbstractButton::clicked, this, &QxrdDetectorControlWindow::doVisualizeBackground);
99  connect(m_VisualizeROIPeak, &QAbstractButton::clicked, this, &QxrdDetectorControlWindow::doVisualizePeak);
100 
101  m_ROIWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
102  }
103 
104  m_DetectorImage->init(dp->imagePlotSettings());
105 
106  m_DetectorImage->setROIModel(m_ROIModel);
107  m_DetectorImage->setROISelection(m_ROIWidget->selectionModel());
108  }
109 
110  if (app) {
111  connect(app->prop_UpdateIntervalMsec(), &QcepIntProperty::valueChanged,
113 
114  connect(&m_UpdateTimer, &QTimer::timeout,
116 
117  m_UpdateTimer.start(app->get_UpdateIntervalMsec());
118  }
119 
120  if (expt) {
121  int fs = expt->get_FontSize();
122  int sp = expt->get_Spacing();
123 
124  if (fs > 0) {
125  setFontSize(fs);
126  }
127 
128  if (sp >= 0) {
129  setSpacing(sp);
130  }
131 
132  connect(expt->prop_FontSize(), &QcepIntProperty::valueChanged, this, &QxrdDetectorControlWindow::setFontSize);
133  connect(expt->prop_Spacing(), &QcepIntProperty::valueChanged, this, &QxrdDetectorControlWindow::setSpacing);
134  }
135 
136  if (dt) {
137  connect(dt->prop_DetectorNumber(), &QcepIntProperty::valueChanged, this, &QxrdDetectorControlWindow::updateWindowTitle);
138  connect(dt->prop_DetectorTypeName(), &QcepStringProperty::valueChanged, this, &QxrdDetectorControlWindow::updateWindowTitle);
139  connect(dt->prop_DetectorName(), &QcepStringProperty::valueChanged, this, &QxrdDetectorControlWindow::updateWindowTitle);
140 
142  }
143 }
QSharedPointer< QxrdExperiment > QxrdExperimentPtr
void valueChanged(QString val, int index)
QSharedPointer< QxrdROICalculator > QxrdROICalculatorPtr
QxrdDetectorProcessorWPtr m_Processor
QxrdROICoordinatesListModelPtr m_ROIModel
QSharedPointer< QxrdDetectorProcessor > QxrdDetectorProcessorPtr
QxrdMainWindow(QWidget *parent=0)
void setSpacing(int spacing)
QcepApplication * g_Application
void setFontSize(int fontSize)
QSharedPointer< QxrdDetector > QxrdDetectorPtr
void valueChanged(int val, int index)
void valueChanged(bool val, int index)

Here is the call graph for this function:

QxrdDetectorControlWindow::~QxrdDetectorControlWindow ( )

Definition at line 145 of file qxrddetectorcontrolwindow.cpp.

146 {
147 #ifndef QT_NO_DEBUG
148  printf("Deleting detector control window\n");
149 #endif
150 }

Member Function Documentation

void QxrdDetectorControlWindow::changeEvent ( QEvent *  e)
protected

Definition at line 164 of file qxrddetectorcontrolwindow.cpp.

165 {
166  QMainWindow::changeEvent(e);
167  switch (e->type()) {
168  case QEvent::LanguageChange:
169  retranslateUi(this);
170  break;
171  default:
172  break;
173  }
174 }
void QxrdDetectorControlWindow::displayNewData ( QcepImageDataBasePtr  img,
QcepMaskDataPtr  overflow 
)

Definition at line 329 of file qxrddetectorcontrolwindow.cpp.

References m_NewDataAvailable, m_NewImage, m_NewOverflow, and m_UpdateMutex.

Referenced by doVisualizeBackground(), and doVisualizePeak().

330 {
331  QcepMutexLocker lock(__FILE__, __LINE__, &m_UpdateMutex);
332 
333  m_NewImage = img;
334  m_NewOverflow = overflow;
335 
336  m_NewDataAvailable.fetchAndStoreOrdered(1);
337 }

Here is the caller graph for this function:

void QxrdDetectorControlWindow::displayNewMask ( QcepMaskDataPtr  mask)

Definition at line 339 of file qxrddetectorcontrolwindow.cpp.

References m_NewMask, m_NewMaskAvailable, and m_UpdateMutex.

340 {
341  QcepMutexLocker lock(__FILE__, __LINE__, &m_UpdateMutex);
342 
343  m_NewMask = mask;
344 
345  m_NewMaskAvailable.fetchAndStoreOrdered(1);
346 }
void QxrdDetectorControlWindow::doAppendROI ( )
privateslot

Definition at line 204 of file qxrddetectorcontrolwindow.cpp.

References m_Experiment, m_ROIModel, m_Saver, QxrdROICoordinates::roiTypeCount(), QxrdROICoordinates::roiTypeName, and selectedROIs().

Referenced by QxrdDetectorControlWindow().

205 {
206  QVector<int> rois = selectedROIs();
207 
208  if (m_ROIModel) {
209  QMenu menu;
210 
211  for (int i=0; i<QxrdROICoordinates::roiTypeCount(); i++) {
212  QAction *a = new QAction(QxrdROICoordinates::roiTypeName(i), &menu);
213  a->setData(i);
214 
215  menu.addAction(a);
216  }
217 
218  QAction *choice = menu.exec(QCursor::pos());
219 
220  if (choice) {
221  int roiType = choice->data().toInt();
222 
225 
226  m_ROIModel->append(roi);
227  }
228  }
229 }
QSharedPointer< QxrdROICoordinates > QxrdROICoordinatesPtr
QxrdROICoordinatesListModelPtr m_ROIModel

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDetectorControlWindow::doBrowseBadPixels ( )
privateslot

Definition at line 407 of file qxrddetectorcontrolwindow.cpp.

References m_Processor.

Referenced by QxrdDetectorControlWindow().

408 {
410 
411  if (dp) {
412  QString newPath = QFileDialog::getOpenFileName(this, "Select Bad Pixels Image",
413  dp->get_BadPixelsPath());
414 
415  if (newPath.length() > 0) {
416  dp->set_BadPixelsPath(newPath);
417  }
418  }
419 }
QxrdDetectorProcessorWPtr m_Processor
QSharedPointer< QxrdDetectorProcessor > QxrdDetectorProcessorPtr

Here is the caller graph for this function:

void QxrdDetectorControlWindow::doBrowseDark ( )
privateslot

Definition at line 380 of file qxrddetectorcontrolwindow.cpp.

References m_Processor.

Referenced by QxrdDetectorControlWindow().

381 {
383 
384  if (dp) {
385  QString newPath = QFileDialog::getOpenFileName(this, "Select Dark Image",
386  dp->get_DarkImagePath());
387 
388  if (newPath.length() > 0) {
389  dp->set_DarkImagePath(newPath);
390  }
391  }
392 }
QxrdDetectorProcessorWPtr m_Processor
QSharedPointer< QxrdDetectorProcessor > QxrdDetectorProcessorPtr

Here is the caller graph for this function:

void QxrdDetectorControlWindow::doBrowseGainCorrection ( )
privateslot

Definition at line 434 of file qxrddetectorcontrolwindow.cpp.

References m_Processor.

Referenced by QxrdDetectorControlWindow().

435 {
437 
438  if (dp) {
439  QString newPath = QFileDialog::getOpenFileName(this, "Select Gain Correction Image",
440  dp->get_GainMapPath());
441 
442  if (newPath.length() > 0) {
443  dp->set_GainMapPath(newPath);
444  }
445  }
446 }
QxrdDetectorProcessorWPtr m_Processor
QSharedPointer< QxrdDetectorProcessor > QxrdDetectorProcessorPtr

Here is the caller graph for this function:

void QxrdDetectorControlWindow::doBrowseMask ( )
privateslot

Definition at line 353 of file qxrddetectorcontrolwindow.cpp.

References m_Processor.

Referenced by QxrdDetectorControlWindow().

354 {
356 
357  if (dp) {
358  QString newPath = QFileDialog::getOpenFileName(this, "Select Mask Image",
359  dp->get_MaskPath());
360 
361  if (newPath.length() > 0) {
362  dp->set_MaskPath(newPath);
363  }
364  }
365 }
QxrdDetectorProcessorWPtr m_Processor
QSharedPointer< QxrdDetectorProcessor > QxrdDetectorProcessorPtr

Here is the caller graph for this function:

void QxrdDetectorControlWindow::doClearBadPixels ( )
privateslot

Definition at line 421 of file qxrddetectorcontrolwindow.cpp.

References m_Processor.

Referenced by QxrdDetectorControlWindow().

422 {
424 
425  if (dp) {
426  int res = QMessageBox::information(this, "Clear Bad Pixels?", "Do you really want to clear the bad pixels image?", QMessageBox::Ok, QMessageBox::Cancel);
427 
428  if (res == QMessageBox::Ok) {
429  dp->set_BadPixelsPath("");
430  }
431  }
432 }
QxrdDetectorProcessorWPtr m_Processor
QSharedPointer< QxrdDetectorProcessor > QxrdDetectorProcessorPtr

Here is the caller graph for this function:

void QxrdDetectorControlWindow::doClearDark ( )
privateslot

Definition at line 394 of file qxrddetectorcontrolwindow.cpp.

References m_Processor.

Referenced by QxrdDetectorControlWindow().

395 {
397 
398  if (dp) {
399  int res = QMessageBox::information(this, "Clear Dark?", "Do you really want to clear the dark image?", QMessageBox::Ok, QMessageBox::Cancel);
400 
401  if (res == QMessageBox::Ok) {
402  dp->set_DarkImagePath("");
403  }
404  }
405 }
QxrdDetectorProcessorWPtr m_Processor
QSharedPointer< QxrdDetectorProcessor > QxrdDetectorProcessorPtr

Here is the caller graph for this function:

void QxrdDetectorControlWindow::doClearGainCorrection ( )
privateslot

Definition at line 448 of file qxrddetectorcontrolwindow.cpp.

References m_Processor.

Referenced by QxrdDetectorControlWindow().

449 {
451 
452  if (dp) {
453  int res = QMessageBox::information(this, "Clear Gain Correction?", "Do you really want to clear the gain correction image?", QMessageBox::Ok, QMessageBox::Cancel);
454 
455  if (res == QMessageBox::Ok) {
456  dp->set_GainMapPath("");
457  }
458  }
459 }
QxrdDetectorProcessorWPtr m_Processor
QSharedPointer< QxrdDetectorProcessor > QxrdDetectorProcessorPtr

Here is the caller graph for this function:

void QxrdDetectorControlWindow::doClearMask ( )
privateslot

Definition at line 367 of file qxrddetectorcontrolwindow.cpp.

References m_Processor.

Referenced by QxrdDetectorControlWindow().

368 {
370 
371  if (dp) {
372  int res = QMessageBox::information(this, "Clear Mask?", "Do you really want to clear the mask?", QMessageBox::Ok, QMessageBox::Cancel);
373 
374  if (res == QMessageBox::Ok) {
375  dp->set_MaskPath("");
376  }
377  }
378 }
QxrdDetectorProcessorWPtr m_Processor
QSharedPointer< QxrdDetectorProcessor > QxrdDetectorProcessorPtr

Here is the caller graph for this function:

void QxrdDetectorControlWindow::doDeleteROI ( )
privateslot

Definition at line 231 of file qxrddetectorcontrolwindow.cpp.

References m_ROIModel, and selectedROIs().

Referenced by QxrdDetectorControlWindow().

232 {
233  QVector<int> rois = selectedROIs();
234 
235  int res = QMessageBox::Cancel;
236 
237  if (rois.count() == 0) {
238  QMessageBox::information(this, "No ROIs Selected", "Select ROIs to delete", QMessageBox::Ok);
239  } else if (rois.count() == 1) {
240  res = QMessageBox::information(this, "Delete ROI?",
241  tr("Do you really want to delete ROI %1").arg(rois.value(0)),
242  QMessageBox::Ok, QMessageBox::Cancel);
243  } else {
244  QString roimsg;
245  foreach (int i, rois) {
246  if (roimsg=="") {
247  roimsg = tr("%1").arg(i);
248  } else {
249  roimsg += tr(", %1").arg(i);
250  }
251  }
252 
253  res = QMessageBox::information(this, "Delete ROIs?",
254  tr("Do you really want to delete ROIs %1").arg(roimsg));
255  }
256 
257  if (res == QMessageBox::Ok && m_ROIModel) {
258  for (int i=rois.count()-1; i>=0; i--) {
259  m_ROIModel->removeROI(rois.value(i));
260  }
261  }
262 }
QxrdROICoordinatesListModelPtr m_ROIModel

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDetectorControlWindow::doMoveROIDown ( )
privateslot

Definition at line 264 of file qxrddetectorcontrolwindow.cpp.

References m_ROIModel, and selectedROIs().

Referenced by QxrdDetectorControlWindow().

265 {
266  QVector<int> rois = selectedROIs();
267 
268  if (rois.count() != 1) {
269  QMessageBox::information(this, "Only Move One", "Must have a single ROI selected before moving it", QMessageBox::Ok);
270  } else {
271  if (m_ROIModel) {
272  m_ROIModel->moveROIDown(rois.first());
273  }
274  }
275 }
QxrdROICoordinatesListModelPtr m_ROIModel

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDetectorControlWindow::doMoveROIUp ( )
privateslot

Definition at line 277 of file qxrddetectorcontrolwindow.cpp.

References m_ROIModel, and selectedROIs().

Referenced by QxrdDetectorControlWindow().

278 {
279  QVector<int> rois = selectedROIs();
280 
281  if (rois.count() != 1) {
282  QMessageBox::information(this, "Only Move One", "Must have a single ROI selected before moving it", QMessageBox::Ok);
283  } else {
284  if (m_ROIModel) {
285  m_ROIModel->moveROIUp(rois.first());
286  }
287  }
288 }
QxrdROICoordinatesListModelPtr m_ROIModel

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDetectorControlWindow::doRecalculate ( )
privateslot

Definition at line 461 of file qxrddetectorcontrolwindow.cpp.

References m_Processor, and m_ROIModel.

Referenced by QxrdDetectorControlWindow().

462 {
464 
465  if (dp) {
466  if (m_ROIModel) {
467  m_ROIModel->recalculate(dp->data(), dp->mask());
468  }
469  }
470 }
QxrdDetectorProcessorWPtr m_Processor
QxrdROICoordinatesListModelPtr m_ROIModel
QSharedPointer< QxrdDetectorProcessor > QxrdDetectorProcessorPtr

Here is the caller graph for this function:

void QxrdDetectorControlWindow::doVisualizeBackground ( )
privateslot

Definition at line 472 of file qxrddetectorcontrolwindow.cpp.

References displayNewData(), m_Processor, m_ROIModel, and selectedROIs().

Referenced by QxrdDetectorControlWindow().

473 {
475 
476  if (dp) {
477  QVector<int> rois = selectedROIs();
478 
479  if (rois.count() != 1) {
480  QMessageBox::information(this, "Visualize ROI", "Select one ROI to visualize", QMessageBox::Ok);
481  } else if (m_ROIModel) {
482  m_ROIModel->visualizeBackground(rois.first(), dp->data(), dp->mask());
483 
484  displayNewData(dp->data(), QcepMaskDataPtr());
485  }
486  }
487 }
void displayNewData(QcepImageDataBasePtr img, QcepMaskDataPtr overflow)
QxrdDetectorProcessorWPtr m_Processor
QxrdROICoordinatesListModelPtr m_ROIModel
QSharedPointer< QxrdDetectorProcessor > QxrdDetectorProcessorPtr
QSharedPointer< QcepMaskData > QcepMaskDataPtr

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDetectorControlWindow::doVisualizePeak ( )
privateslot

Definition at line 489 of file qxrddetectorcontrolwindow.cpp.

References displayNewData(), m_Processor, m_ROIModel, and selectedROIs().

Referenced by QxrdDetectorControlWindow().

490 {
492 
493  if (dp) {
494  QVector<int> rois = selectedROIs();
495 
496  if (rois.count() != 1) {
497  QMessageBox::information(this, "Visualize ROI", "Select one ROI to visualize", QMessageBox::Ok);
498  } else if (m_ROIModel) {
499  m_ROIModel->visualizePeak(rois.first(), dp->data(), dp->mask());
500 
501  displayNewData(dp->data(), QcepMaskDataPtr());
502  }
503  }
504 }
void displayNewData(QcepImageDataBasePtr img, QcepMaskDataPtr overflow)
QxrdDetectorProcessorWPtr m_Processor
QxrdROICoordinatesListModelPtr m_ROIModel
QSharedPointer< QxrdDetectorProcessor > QxrdDetectorProcessorPtr
QSharedPointer< QcepMaskData > QcepMaskDataPtr

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDetectorControlWindow::onUpdateIntervalMsecChanged ( int  newVal)
privateslot

Definition at line 324 of file qxrddetectorcontrolwindow.cpp.

References m_UpdateTimer.

Referenced by QxrdDetectorControlWindow().

325 {
326  m_UpdateTimer.setInterval(newVal);
327 }

Here is the caller graph for this function:

void QxrdDetectorControlWindow::printMessage ( QString  msg,
QDateTime  ts = QDateTime::currentDateTime() 
)
slot

Definition at line 176 of file qxrddetectorcontrolwindow.cpp.

References m_Acquisition.

177 {
179 
180  if (acq) {
181  acq->printMessage(msg, ts);
182  }
183 }
QSharedPointer< QxrdAcquisition > QxrdAcquisitionPtr
QVector< int > QxrdDetectorControlWindow::selectedROIs ( )
private

Definition at line 185 of file qxrddetectorcontrolwindow.cpp.

References m_ROIModel.

Referenced by doAppendROI(), doDeleteROI(), doMoveROIDown(), doMoveROIUp(), doVisualizeBackground(), and doVisualizePeak().

186 {
187  QVector<int> res;
188 
189  if (m_ROIModel) {
190  int roiCount = m_ROIModel->rowCount(QModelIndex());
191 
192  QItemSelectionModel *selected = m_ROIWidget->selectionModel();
193 
194  for (int i=0; i<roiCount; i++) {
195  if (selected->rowIntersectsSelection(i, QModelIndex())) {
196  res.append(i);
197  }
198  }
199  }
200 
201  return res;
202 }
QxrdROICoordinatesListModelPtr m_ROIModel

Here is the caller graph for this function:

void QxrdDetectorControlWindow::updateImageDisplay ( )
privateslot

Definition at line 290 of file qxrddetectorcontrolwindow.cpp.

References QxrdDetectorProcessor::ImageDisplayMode, m_DisplayedImage, m_DisplayedMask, m_DisplayedOverflow, m_NewDataAvailable, m_NewImage, m_NewMask, m_NewMaskAvailable, m_NewOverflow, m_Processor, and m_UpdateMutex.

Referenced by QxrdDetectorControlWindow().

291 {
292  if (m_NewDataAvailable.fetchAndStoreOrdered(0)) {
293  QcepMutexLocker lock(__FILE__, __LINE__, &m_UpdateMutex);
294 
297 
300 
302 
303  if (proc) {
304  if (proc->get_DetectorDisplayMode() == QxrdDetectorProcessor::ImageDisplayMode) {
305  m_DetectorImage->onProcessedImageAvailable(m_DisplayedImage, m_DisplayedOverflow);
306  }
307  }
308  } else if (m_NewMaskAvailable.fetchAndStoreOrdered(0)) {
309  QcepMutexLocker lock(__FILE__, __LINE__, &m_UpdateMutex);
310 
313 
315 
316  if (proc) {
317  if (proc->get_DetectorDisplayMode() == QxrdDetectorProcessor::ImageDisplayMode) {
318  m_DetectorImage->onMaskedImageAvailable(m_DisplayedImage, m_DisplayedMask);
319  }
320  }
321  }
322 }
QxrdDetectorProcessorWPtr m_Processor
QSharedPointer< QxrdDetectorProcessor > QxrdDetectorProcessorPtr
QcepImageDataBasePtr m_DisplayedImage
QSharedPointer< QcepImageDataBase > QcepImageDataBasePtr
QSharedPointer< QcepMaskData > QcepMaskDataPtr

Here is the caller graph for this function:

void QxrdDetectorControlWindow::updateROIDisplay ( bool  show)
privateslot

Definition at line 348 of file qxrddetectorcontrolwindow.cpp.

Referenced by QxrdDetectorControlWindow().

349 {
350  m_DetectorImage -> enableROIDisplay(show);
351 }

Here is the caller graph for this function:

void QxrdDetectorControlWindow::updateWindowTitle ( )
privateslot

Definition at line 152 of file qxrddetectorcontrolwindow.cpp.

References m_Detector.

Referenced by QxrdDetectorControlWindow().

153 {
155 
156  if (dt) {
157  setWindowTitle(tr("%1: Control %2 detector \"%3\"")
158  .arg(dt->get_DetectorNumber())
159  .arg(dt->get_DetectorTypeName())
160  .arg(dt->get_DetectorName()));
161  }
162 }
QSharedPointer< QxrdDetector > QxrdDetectorPtr

Here is the caller graph for this function:

Member Data Documentation

QxrdAcquisitionWPtr QxrdDetectorControlWindow::m_Acquisition
private

Definition at line 71 of file qxrddetectorcontrolwindow.h.

Referenced by printMessage().

QxrdDetectorWPtr QxrdDetectorControlWindow::m_Detector
private

Definition at line 72 of file qxrddetectorcontrolwindow.h.

Referenced by QxrdDetectorControlWindow(), and updateWindowTitle().

QcepImageDataBasePtr QxrdDetectorControlWindow::m_DisplayedImage
private

Definition at line 79 of file qxrddetectorcontrolwindow.h.

Referenced by updateImageDisplay().

QcepMaskDataPtr QxrdDetectorControlWindow::m_DisplayedMask
private

Definition at line 80 of file qxrddetectorcontrolwindow.h.

Referenced by updateImageDisplay().

QcepMaskDataPtr QxrdDetectorControlWindow::m_DisplayedOverflow
private

Definition at line 81 of file qxrddetectorcontrolwindow.h.

Referenced by updateImageDisplay().

QxrdExperimentWPtr QxrdDetectorControlWindow::m_Experiment
private

Definition at line 70 of file qxrddetectorcontrolwindow.h.

Referenced by doAppendROI(), and QxrdDetectorControlWindow().

QAtomicInt QxrdDetectorControlWindow::m_NewDataAvailable
private

Definition at line 87 of file qxrddetectorcontrolwindow.h.

Referenced by displayNewData(), and updateImageDisplay().

QcepImageDataBasePtr QxrdDetectorControlWindow::m_NewImage
private

Definition at line 83 of file qxrddetectorcontrolwindow.h.

Referenced by displayNewData(), and updateImageDisplay().

QcepMaskDataPtr QxrdDetectorControlWindow::m_NewMask
private

Definition at line 84 of file qxrddetectorcontrolwindow.h.

Referenced by displayNewMask(), and updateImageDisplay().

QAtomicInt QxrdDetectorControlWindow::m_NewMaskAvailable
private

Definition at line 88 of file qxrddetectorcontrolwindow.h.

Referenced by displayNewMask(), and updateImageDisplay().

QcepMaskDataPtr QxrdDetectorControlWindow::m_NewOverflow
private

Definition at line 85 of file qxrddetectorcontrolwindow.h.

Referenced by displayNewData(), and updateImageDisplay().

QxrdDetectorProcessorWPtr QxrdDetectorControlWindow::m_Processor
private
QxrdROICoordinatesListModelPtr QxrdDetectorControlWindow::m_ROIModel
private
QcepSettingsSaverWPtr QxrdDetectorControlWindow::m_Saver
private

Definition at line 69 of file qxrddetectorcontrolwindow.h.

Referenced by doAppendROI().

QMutex QxrdDetectorControlWindow::m_UpdateMutex
private

Definition at line 76 of file qxrddetectorcontrolwindow.h.

Referenced by displayNewData(), displayNewMask(), and updateImageDisplay().

QTimer QxrdDetectorControlWindow::m_UpdateTimer
private

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