QXRD  0.11.16
qxrdacquisition.cpp
Go to the documentation of this file.
1 #include "qxrddebug.h"
2 #include "qxrdacquisition.h"
3 #include "qcepmutexlocker.h"
4 #include "qxrddataprocessor.h"
5 #include "qcepallocator.h"
9 #include "qxrdwindow.h"
10 #include "qxrdapplication.h"
11 #include "qxrdacquisition-ptr.h"
12 //#include <QThreadPool>
13 #include <QtConcurrentRun>
14 #include <QDir>
15 #include <QMetaProperty>
16 #include "qxrdprocessargs.h"
17 #include "qxrddetectorproxy.h"
18 #include "qxrddetector.h"
19 #include "qxrddetectorthread.h"
20 #include "qxrddetectorprocessor.h"
24 
29  : QxrdAcquisitionInterface(saver, doc, proc, allocator),
30  m_QxrdVersion(QcepSettingsSaverWPtr(), this,"qxrdVersion",STR(QXRD_VERSION), "QXRD Version Number"),
31  m_QtVersion(QcepSettingsSaverWPtr(), this,"qtVersion",qVersion(), "QT Version Number"),
32  m_DetectorCount(m_Saver, this, "detectorCount", 0, "Number of Detectors"),
33  m_LastAcquired(QcepSettingsSaverWPtr(), this, "lastAcquired", 0, "Internal Acquisition Flag"),
34  m_FileIndex(saver, this,"fileIndex",0, "File Index"),
35  m_FileIndexWidth(saver, this, "fileIndexWidth", 5, "Digits in File Index Field"),
36  m_FilePhaseWidth(saver, this, "filePhaseWidth", 3, "Digits in Phase Number Field"),
37  m_FileOverflowWidth(saver, this, "fileOverflowWidth", 5, "Digits in Overflow Index Field"),
38  m_DetectorNumberWidth(saver, this, "detectorNumberWidth", 2, "Digits in detector number field"),
39  m_FileBase(saver, this,"fileBase","", "File Base"),
40  m_OverflowLevel(saver, this, "overflowLevel", 65500, "Overflow level (per exposure)"),
41  m_Raw16SaveTime(saver, this,"raw16SaveTime", 0.1, "Time to save 16 bit images"),
42  m_Raw32SaveTime(saver, this,"raw32SaveTime", 0.2, "Time to save 32 bit images"),
43  m_RawSaveTime(saver, this,"rawSaveTime", 0.2, "Time to save raw images"),
44  m_DarkSaveTime(saver, this,"darkSaveTime", 0.2, "Time to save dark images"),
45  m_UserComment1(saver, this,"userComment1","", "User Comment 1"),
46  m_UserComment2(saver, this,"userComment2","", "User Comment 2"),
47  m_UserComment3(saver, this,"userComment3","", "User Comment 3"),
48  m_UserComment4(saver, this,"userComment4","", "User Comment 4"),
49  m_Normalization(saver, this, "normalization", QcepDoubleList(), "Normalization Values"),
50  m_DroppedFrames(QcepSettingsSaverWPtr(), this,"droppedFrames",0, "Number of Dropped Frames"),
51  m_LiveViewAtIdle(saver, this, "liveViewAtIdle", false, "Live View during Idle"),
52  m_AcquisitionCancelsLiveView(saver, this, "acquisitionCancelsLiveView", true, "Acquisition operations cancel live view"),
53  m_RetryDropped(saver, this, "retryDropped", false, "Automatically retry dropped frames during acquisition"),
54  m_ScalerValues(QcepSettingsSaverWPtr(), this, "scalerValues", QcepDoubleVector(), "Scaler Values"),
55  m_Mutex(QMutex::Recursive),
58  m_Experiment(doc),
59  m_Window(),
60  m_Allocator(allocator),
61  m_DataProcessor(proc),
62  m_ControlPanel(NULL),
63  m_Idling(1)
64 {
66  printf("QxrdAcquisition::QxrdAcquisition(%p)\n", this);
67  }
68 }
69 
71 {
72  QxrdAcquisitionPtr me = qSharedPointerCast<QxrdAcquisition>(sharedFromThis());
73 
74 // if (me == NULL) {
75 // printf("QxrdAcquisition::myself returns NULL\n");
76 // }
77 
78  return me;
79 }
80 
82 {
84 
85  connect(prop_Raw16SaveTime(), &QcepDoubleProperty::valueChanged, this, &QxrdAcquisition::updateSaveTimes);
86  connect(prop_Raw32SaveTime(), &QcepDoubleProperty::valueChanged, this, &QxrdAcquisition::updateSaveTimes);
87  connect(prop_SummedExposures(), &QcepIntProperty::valueChanged, this, &QxrdAcquisition::updateSaveTimes);
88  connect(prop_DarkSummedExposures(), &QcepIntProperty::valueChanged, this, &QxrdAcquisition::updateSaveTimes);
89 
90 // m_FileIndex.setDebug(1);
91 
93 
94  if (qcepDebug(DEBUG_APP)) {
95  printMessage("QxrdAcquisition::QxrdAcquisition");
96  }
97 
100 
104 
107 
108  connect(prop_ExposureTime(), &QcepDoubleProperty::valueChanged,
110 
111  if (alloc) {
112  if (sizeof(void*) == 4) {
113  connect(alloc->prop_TotalBufferSizeMB32(), &QcepIntProperty::valueChanged,
115  onBufferSizeChanged(alloc->get_TotalBufferSizeMB32());
116  } else {
117  connect(alloc->prop_TotalBufferSizeMB64(), &QcepIntProperty::valueChanged,
119  onBufferSizeChanged(alloc->get_TotalBufferSizeMB64());
120  }
121  }
122 
123 // connect(&m_Watcher, &QFutureWatcherBase::finished, this, &QxrdAcquisition::onAcquireComplete);
124  connect(&m_IdleTimer, &QTimer::timeout, this, &QxrdAcquisition::onIdleTimeout);
125 
126  m_IdleTimer.start(1000);
127 
128  QxrdAcquisitionPtr myself = qSharedPointerDynamicCast<QxrdAcquisition>(sharedFromThis());
129 
131  new QxrdAcquisitionScalerModel(myself));
132 }
133 
135 {
136 #ifndef QT_NO_DEBUG
137  printf("Deleting acquisition\n");
138 #endif
139 
141  printf("QxrdAcquisition::~QxrdAcquisition(%p)\n", this);
142  }
143 
144  if (qcepDebug(DEBUG_APP)) {
145  printMessage("QxrdAcquisition::~QxrdAcquisition");
146  }
147 }
148 
150 {
151  return m_Experiment;
152 }
153 
155 {
156  return m_DataProcessor;
157 }
158 
160 {
161  return m_ScalerModel;
162 }
163 
165 {
166  if (qcepDebug(DEBUG_APP)) {
167  printMessage("QxrdAcquisition::shutdown()");
168  }
169 
170  for (int i=0; i<get_DetectorCount(); i++) {
171  detector(i) -> shutdownAcquisition();
172  }
173 
174  thread()->exit();
175 }
176 
178 {
179  if (get_SummedExposures() <= 1) {
180  set_RawSaveTime(get_Raw16SaveTime());
181  } else {
182  set_RawSaveTime(get_Raw32SaveTime());
183  }
184 
185  if (get_DarkSummedExposures() <= 1) {
186  set_DarkSaveTime(get_Raw16SaveTime());
187  } else {
188  set_DarkSaveTime(get_Raw32SaveTime());
189  }
190 }
191 
193 {
194  QByteArray name;
195 
196  if (g_Application) {
197  foreach(name, dynamicPropertyNames()) {
198  g_Application->printMessage(tr("acquisition.%1\n").arg(name.data()));
199  }
200  }
201 }
202 
204 {
205  if (dest) {
206  QByteArray name;
207 
208  foreach(name, dynamicPropertyNames()) {
209  dest -> setProperty(name.data(), property(name.data()));
210  }
211  }
212 }
213 
214 void QxrdAcquisition::writeSettings(QSettings *settings, QString section)
215 {
216  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
217 
218  QcepObject::writeSettings(settings, section);
219 
221  m_SynchronizedAcquisition->writeSettings(settings, section+"/sync");
222  }
223 
225  m_AcquisitionExtraInputs->writeSettings(settings, section+"/extrainputs");
226  }
227 
228  settings->beginWriteArray(section+"/detectors");
229 
230  for (int i=0; i<m_Detectors.count(); i++) {
231  settings->setArrayIndex(i);
232 
233  QxrdDetectorPtr det = m_Detectors.value(i);
234 
235  if (det) {
236  det->writeSettings(settings, "");
237  }
238  }
239 
240  settings->endArray();
241 }
242 
243 void QxrdAcquisition::readSettings(QSettings *settings, QString section)
244 {
245  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
246 
247  QcepObject::readSettings(settings, section);
248 
250  m_SynchronizedAcquisition->readSettings(settings, section+"/sync");
251  }
252 
254  m_AcquisitionExtraInputs->readSettings(settings, section+"/extrainputs");
255  }
256 
257  int n = settings->beginReadArray(section+"/detectors");
258 
259  m_DetectorThreads.resize(n);
260  m_Detectors.resize(n);
261 
262  for (int i=0; i<n; i++) {
263  settings->setArrayIndex(i);
264 
265  int detType = settings->value("detectorType", 0).toInt();
266 
267  QxrdDetectorThreadPtr detThread =
269  experiment(),
270  myself(),
271  detType,
272  i,
273  this));
274 
275  if (detThread) {
276  detThread->start();
277 
278  QxrdDetectorPtr det = detThread->detector();
279 
280  if (det) {
281  // det->initialize();
282  det->readSettings(settings, "");
283 
284  m_DetectorThreads[i] = detThread;
285  m_Detectors[i] = det;
286 
287  QxrdApplication *app = qobject_cast<QxrdApplication*>(g_Application);
288 
289  if (app && app->get_StartDetectors() == 0) {
290  det->set_Enabled(false);
291  }
292 
293  det->startOrStop(det->isEnabled());
294  }
295  }
296  }
297 
298  set_DetectorCount(m_Detectors.count());
299 
300  settings->endArray();
301 }
302 
304 {
305  if (QThread::currentThread() != thread()) {
306  QMetaObject::invokeMethod(this, "appendDetector", Qt::BlockingQueuedConnection,
307  Q_ARG(int, detType));
308  } else {
309  int nDet = get_DetectorCount();
310 
311  QxrdDetectorThreadPtr detThread =
313  experiment(),
314  myself(),
315  detType,
316  nDet,
317  this));
318 
319  if (detThread) {
320  detThread->start();
321 
322  QxrdDetectorPtr det = detThread->detector();
323 
324  if (det) {
325  m_DetectorThreads.append(detThread);
326  m_Detectors.append(det);
327 
328  set_DetectorCount(m_Detectors.count());
329  }
330  }
331  }
332 }
333 
335 {
336  if (QThread::currentThread() != thread()) {
337  QMetaObject::invokeMethod(this, "appendDetectorProxy", Qt::BlockingQueuedConnection,
338  Q_ARG(QxrdDetectorProxyPtr, proxy));
339  } else {
340  if (proxy) {
341  QxrdDetectorThreadPtr detThread = proxy->detectorThread();
342  QxrdDetectorPtr detector = proxy->detector();
343 
344  int nDet = get_DetectorCount();
345 
346  if (detThread==NULL || detector==NULL) {
347  int detType = proxy->detectorType();
348 
349  detThread =
351  experiment(),
352  myself(),
353  detType,
354  nDet,
355  this));
356  detThread->start();
357 
358  detector = detThread->detector();
359  }
360 
361  m_DetectorThreads.append(detThread);
362  m_Detectors.append(detector);
363 
364  set_DetectorCount(m_Detectors.count());
365 
366  detector->pullPropertiesfromProxy(proxy);
367  }
368  }
369 }
370 
372 {
373  if (QThread::currentThread() != thread()) {
374  QMetaObject::invokeMethod(this, "clearDetectors", Qt::BlockingQueuedConnection);
375  } else {
376  m_Detectors.resize(0);
377 
378  set_DetectorCount(0);
379  }
380 }
381 
383 {
384  return m_DetectorThreads.value(n);
385 }
386 
388 {
389  return m_Detectors.value(n);
390 }
391 
393 {
394  m_Window = win;
395 }
396 
397 void QxrdAcquisition::printMessage(QString msg, QDateTime ts) const
398 {
400 
401  if (exp) {
402  exp->printMessage(msg, ts);
403  }
404 }
405 
406 void QxrdAcquisition::criticalMessage(QString msg, QDateTime ts) const
407 {
409 
410  if (exp) {
411  exp->criticalMessage(msg, ts);
412  }
413 }
414 
415 void QxrdAcquisition::statusMessage(QString msg, QDateTime ts) const
416 {
418 
419  if (exp) {
420  exp->statusMessage(msg, ts);
421  }
422 }
423 
425 {
427 
428  if (alloc) {
429  alloc -> changedSizeMB(newMB);
430  }
431 }
432 
434 {
435  return m_Allocator;
436 }
437 
439 {
440  if (get_DetectorCount() == 0) {
441  criticalMessage("No Detectors are configured");
442  return false;
443  }
444 
445  int ndet = 0;
446 
447  for (int i=0; i<get_DetectorCount(); i++) {
448  QxrdDetectorPtr det = detector(i);
449 
450  if (det && det->isEnabled()) {
451  ndet++;
452  }
453  }
454 
455  if (ndet == 0) {
456  criticalMessage("No detectors are enabled");
457  return false;
458  }
459 
460  if (get_FilePattern() == "") {
461  criticalMessage("No save file name has been provided");
462  return false;
463  }
464 
465  return true;
466 }
467 
469 {
470  bool res = false;
471 
472  if (sanityCheckCommon() == false) {
473  } else if (get_PreTriggerFiles() < 0) {
474  criticalMessage("pretrigger files cannot be < 0");
475  } else if (get_PostTriggerFiles() < 0) {
476  criticalMessage("posttrigger files cannot be < 0");
477  } else if (get_PreTriggerFiles() + get_PostTriggerFiles() <= 0) {
478  criticalMessage("pre+post trigger files must be >= 1");
479  } else if (get_SummedExposures() <= 0) {
480  criticalMessage("Summed exposures must be >= 1");
481  } else if (get_SkippedExposures() < 0) {
482  criticalMessage("Skipped exposures must be >= 0");
483  } else if (get_ExposureTime() <= 0) {
484  criticalMessage("Exposure time must be > 0");
485  } else {
486  res = true;
487  }
488 
489  return res;
490 }
491 
493 {
494  bool res = false;
495 
496  if (sanityCheckCommon() == false) {
497  } else if (get_DarkSummedExposures() <= 0) {
498  criticalMessage("Dark summed exposures must be >= 0");
499  } else if (get_ExposureTime() <= 0) {
500  criticalMessage("Exposure time must be > 0");
501  } else {
502  res = true;
503  }
504 
505  return res;
506 }
507 
509 {
510  foreach (QxrdDetectorPtr det, m_Detectors) {
511  det->onExposureTimeChanged();
512  }
513 }
514 
516 {
517  printMessage(tr("Configure Detector %1").arg(i));
518 
519  QxrdDetectorPtr det = detector(i);
520 
522 
523  if (proxy && proxy->configureDetector()) {
524  det->pullPropertiesfromProxy(proxy);
525  }
526 }
527 
529 {
530  QxrdDetectorPtr det = detector(i);
531 
532  if (det) {
533  det->openControlWindow();
534  }
535 }
536 
538 {
539  prop_DroppedFrames() -> setValue(0);
540 }
541 
543 {
545 
546  if (alloc) {
547  QString msg = tr("Frame %1 dropped [%2/%3 MB Used]")
548  .arg(n)
549  .arg(alloc->allocatedMemoryMB())
550  .arg(alloc->maximumMemoryMB());
551 
552  statusMessage(msg);
553  printMessage(msg);
554 
555  prop_DroppedFrames() -> incValue(1);
556  }
557 }
558 
560 {
561  QcepInt16ImageDataPtr img16 = qSharedPointerCast<QcepInt16ImageData>(image);
562 
563  if (img16) {
564  accumulateAcquiredImage(img16, accum, overflow);
565  } else {
566  QcepInt32ImageDataPtr img32 = qSharedPointerCast<QcepInt32ImageData>(image);
567 
568  if (img32) {
569  accumulateAcquiredImage(img32, accum, overflow);
570  } else {
571  printMessage("type conversion failed in QxrdAcquisition::accumulateAcquiredImage");
572  }
573  }
574 }
575 
577 {
578  if (image && accum && overflow) {
579  long nPixels = image->get_Height()*image->get_Width();
580  int ovflwlvl = get_OverflowLevel();
581  quint16* src = image->data();
582  quint32* dst = accum->data();
583  short int* ovf = overflow->data();
584  int nsummed = accum->get_SummedExposures();
585 
586  if (nsummed == 0) {
587  if (qcepDebug(DEBUG_ACQUIRE)) {
588  printMessage(tr("Frame %1 saved").arg(nsummed));
589  }
590 
591  for (long i=0; i<nPixels; i++) {
592  quint16 val = *src++;
593 
594  if (val>ovflwlvl) {
595  *ovf++ = 1;
596  } else {
597  *ovf++ = 0;
598  }
599 
600  *dst++ = val;
601  }
602 
603  accum->set_Normalization(image->get_Normalization());
604  accum->set_ExtraInputs(image->get_ExtraInputs());
605  accum->set_SummedExposures(1);
606  accum->set_ImageSequenceNumber(image->get_ImageSequenceNumber());
607  } else {
608  if (qcepDebug(DEBUG_ACQUIRE)) {
609  printMessage(tr("Frame %1 summed").arg(nsummed));
610  }
611 
612  for (long i=0; i<nPixels; i++) {
613  quint16 val = *src++;
614 
615  if (val>ovflwlvl) {
616  *ovf++ += 1;
617  } else {
618  ovf++;
619  }
620 
621  *dst++ += val;
622  }
623 
624  accum->prop_Normalization() -> incValue(image->get_Normalization());
625  accum->prop_ExtraInputs() -> incValue(image->get_ExtraInputs());
626  accum->prop_SummedExposures() -> incValue(1);
627  accum->prop_ImageSequenceNumber() -> incValue(image->get_ImageSequenceNumber());
628  }
629  }
630 }
631 
633 {
634  if (image && accum && overflow) {
635  long nPixels = image->get_Height()*image->get_Width();
636  int ovflwlvl = get_OverflowLevel();
637  quint32* src = image->data();
638  quint32* dst = accum->data();
639  short int* ovf = overflow->data();
640  int nsummed = accum->get_SummedExposures();
641 
642  if (nsummed == 0) {
643  if (qcepDebug(DEBUG_ACQUIRE)) {
644  printMessage(tr("Frame %1 saved").arg(nsummed));
645  }
646 
647  for (long i=0; i<nPixels; i++) {
648  quint32 val = *src++;
649 
650  if (val>ovflwlvl) {
651  *ovf++ = 1;
652  } else {
653  *ovf++ = 0;
654  }
655 
656  *dst++ = val;
657  }
658 
659  accum->set_Normalization(image->get_Normalization());
660  accum->set_ExtraInputs(image->get_ExtraInputs());
661  accum->set_SummedExposures(1);
662  accum->set_ImageSequenceNumber(image->get_ImageSequenceNumber());
663  } else {
664  if (qcepDebug(DEBUG_ACQUIRE)) {
665  printMessage(tr("Frame %1 summed").arg(nsummed));
666  }
667 
668  for (long i=0; i<nPixels; i++) {
669  quint32 val = *src++;
670 
671  if (val>ovflwlvl) {
672  *ovf++ += 1;
673  } else {
674  ovf++;
675  }
676 
677  *dst++ += val;
678  }
679 
680  accum->prop_Normalization() -> incValue(image->get_Normalization());
681  accum->prop_ExtraInputs() -> incValue(image->get_ExtraInputs());
682  accum->prop_SummedExposures() -> incValue(1);
683  accum->prop_ImageSequenceNumber() -> incValue(image->get_ImageSequenceNumber());
684  }
685  }
686 }
687 
688 QString QxrdAcquisition::currentFileBase(int detNum, QString extension)
689 {
690  QString fileBase, fileName;
691 
692  QxrdDetectorPtr det = detector(detNum);
693  QString extent;
694 
695  if (extension.length()) {
696  extent = extension;
697  } else if (det) {
698  extent = det->get_Extension();
699  } else {
700  extent = "tif";
701  }
702 
704  get_FilePattern(),
705  extent,
706  detNum,
707  get_CurrentFile(),
708  get_CurrentPhase(),
709  get_PhasesInGroup(),
710  fileBase, fileName);
711 
712  return fileBase;
713 }
714 
715 void QxrdAcquisition::getFileBaseAndName(QString filePattern, QString extent, int detNum, int fileIndex, int phase, int nphases, QString &fileBase, QString &fileName)
716 {
717  int width = get_FileIndexWidth();
718  int detWidth = get_DetectorNumberWidth();
719  QxrdDetectorPtr det(detector(detNum));
720 
721  if (det) {
722  QxrdDetectorProcessorPtr proc(det->processor());
723  int nDet = get_DetectorCount();
724 
725  if (proc) {
726  if (nphases == 0 || phase < 0) {
727  if (nDet <= 1) {
728  fileBase = tr("%1-%2.dark.%3")
729  .arg(filePattern).arg(fileIndex,width,10,QChar('0')).arg(extent);
730  } else {
731  fileBase = tr("%1-%2-%3.dark.%4")
732  .arg(filePattern).arg(detNum,detWidth,10,QChar('0')).arg(fileIndex,width,10,QChar('0')).arg(extent);
733  }
734 
735  fileName = proc -> filePathInDarkOutputDirectory(fileBase);
736  } else {
737  if (nphases > 1) {
738  int phswidth = get_FilePhaseWidth();
739  if (nDet <= 1) {
740  fileBase = tr("%1-%2-%3.%4")
741  .arg(filePattern).arg(fileIndex,width,10,QChar('0')).arg(phase,phswidth,10,QChar('0')).arg(extent);
742  } else {
743  fileBase = tr("%1-%2-%3-%4.%5")
744  .arg(filePattern).arg(detNum,detWidth,10,QChar('0')).arg(fileIndex,width,10,QChar('0'))
745  .arg(phase,phswidth,10,QChar('0')).arg(extent);
746  }
747  } else {
748  if (nDet <= 1) {
749  fileBase = tr("%1-%2.%3")
750  .arg(filePattern).arg(fileIndex,width,10,QChar('0')).arg(extent);
751  } else {
752  fileBase = tr("%1-%2-%3.%4")
753  .arg(filePattern).arg(detNum,detWidth,10,QChar('0')).arg(fileIndex,width,10,QChar('0')).arg(extent);
754  }
755  }
756  fileName = proc -> filePathInRawOutputDirectory(fileBase);
757  }
758  }
759  }
760 }
761 
762 void QxrdAcquisition::processImage(QString filePattern, QString extent, int fileIndex, int phase, int nPhases, bool trig, QcepInt32ImageDataPtr image, QcepMaskDataPtr overflow)
763 {
764  if (image) {
766  printMessage(tr("processAcquiredImage(%1,%2) %3 summed exposures")
767  .arg(fileIndex).arg(phase).arg(image->get_SummedExposures()));
768  }
769 
770  QString fileName;
771  QString fileBase;
772 
773  getFileBaseAndName(filePattern, extent, 0, fileIndex, phase, nPhases, fileBase, fileName);
774 
776  printMessage(tr("Fn: %1, Fi: %2, Phs: %3")
777  .arg(fileName).arg(fileIndex).arg(phase));
778  }
779 
780  set_FileBase(fileBase);
781  // m_DataProcessor -> set_FileName(fileName);
782 
783  QFileInfo finfo(fileName);
784 
785  QDateTime now = QDateTime::currentDateTime();
786  double msec = QcepImageDataBase::secondsSinceEpoch();
787 
788  image -> set_FileBase(fileBase);
789  image -> set_FileName(fileName);
790  image -> set_Title(finfo.fileName());
791  image -> set_ExposureTime(get_ExposureTime());
792  image -> set_DateTime(now);
793  image -> set_TimeStamp(msec);
794  image -> set_HBinning(1);
795  image -> set_VBinning(1);
796  image -> set_DataType(QcepInt32ImageData::Raw32Data);
797  image -> set_UserComment1(get_UserComment1());
798  image -> set_UserComment2(get_UserComment2());
799  image -> set_UserComment3(get_UserComment3());
800  image -> set_UserComment4(get_UserComment4());
801  image -> set_ObjectSaved(false);
802  image -> set_Triggered(trig);
803  image -> set_Normalization(get_Normalization());
804 
805  copyDynamicProperties(image.data());
806 
807  if (nPhases == 0) {
809  printMessage(tr("32 bit Dark Image acquired"));
810  }
811 
812  image -> set_ImageNumber(-1);
813  image -> set_PhaseNumber(-1);
814  image -> set_NPhases(0);
815  } else {
817  printMessage(tr("32 bit Image %1 acquired").arg(fileIndex));
818  }
819 
820  image -> set_ImageNumber(fileIndex);
821  image -> set_PhaseNumber(phase);
822  image -> set_NPhases(nPhases);
823  }
824 
826 
827  if (processor) {
828  processor -> acquiredInt32Image(image, overflow);
829  }
830  }
831 }
832 
834 {
835 // QThread::currentThread()->setObjectName("processImage");
836 
838  printMessage(tr("QxrdAcquisition::processImage %1 %2 start").arg(args.m_FilePattern).arg(args.m_FileIndex));
839  }
840 
841  processImage(args.m_FilePattern, args.m_Extension, args.m_FileIndex, args.m_Phase, args.m_NPhases, args.m_Trig, args.m_Image, args.m_Overflow);
842 
844  printMessage(tr("QxrdAcquisition::processImage %1 %2 end").arg(args.m_FilePattern).arg(args.m_FileIndex));
845  }
846 }
847 
848 void QxrdAcquisition::processAcquiredImage(QString filePattern, QString extent, int fileIndex, int phase, int nPhases, bool trig, QcepInt32ImageDataPtr image, QcepMaskDataPtr overflow)
849 {
850  // printf("processAcquiredImage(""%s"",%d,%d,img,ovf)\n", qPrintable(filePattern), fileIndex, phase);
851 
852  // processImage(filePattern, fileIndex, phase, nPhases, trig, image, overflow);
853 
855  printMessage(tr("QxrdAcquisition::processAcquiredImage %1 %2 %3 (%4)").arg(filePattern).arg(fileIndex).arg(phase).arg((image?image->get_ImageNumber():-1)));
856  }
857 
858  QtConcurrent::run(this, &QxrdAcquisition::processImage,
859  QxrdProcessArgs(filePattern, extent, fileIndex, phase, nPhases, trig, image, overflow));
860 }
861 
863 {
864  // printf("processDarkImage(""%s"",%d,img,ovf)\n", qPrintable(filePattern), fileIndex);
865 
866  processImage(filePattern, extent, fileIndex, -1, 0, true, image, overflow);
867 }
868 
870 {
871  if (win) {
872  m_Window = win;
873 
875  m_Window,
876  myself(),
878  m_Window.data());
879 
880  return m_ControlPanel;
881  } else {
882  return NULL;
883  }
884 }
885 
887 {
890  }
891 
894  }
895 }
896 
898 {
901  } else {
903  }
904 }
905 
907 {
909 }
910 
912 {
914 }
915 
917 {
918  int res = get_Cancelling();
919 
920  if (res) {
921  printMessage(tr("Cancelling acquisition"));
922  statusMessage(tr("Cancelling acquisition"));
923  }
924 
925  return res;
926 }
927 
929 {
931 
932  if (parmsp) {
933  QTime acqTimer;
934  acqTimer.start();
935 
936  stopIdling();
937 
938  QString fileBase = parmsp->fileBase();
939  int fileIndex = get_FileIndex();
940  double exposure = parmsp->exposure();
941  int nsummed = parmsp->nsummed();
942  int preTrigger = parmsp->preTrigger();
943  int postTrigger = parmsp->postTrigger();
944  int nphases = parmsp->nphases();
945  int skipBefore = parmsp->skipBefore();
946 
947  if (skipBefore <= 0) {
948  if (get_LastAcquired() != 1) {
949  skipBefore = 1;
950  }
951  }
952 
953  set_LastAcquired(1);
954 
955  int skipBetween = parmsp->skipBetween();
956  int nPreTriggered = 0;
957 
958  if (preTrigger <= 0) {
959  set_Triggered(true);
960  }
961 
962  int nDet = 0;
963  QVector<QxrdDetectorPtr> dets;
964  QVector<QxrdDetectorProcessorPtr> procs;
965  QVector<QVector<QVector<QcepInt32ImageDataPtr> > >res;
966  QVector<QVector<QVector<QcepMaskDataPtr> > > ovf;
967 
968  for (int i=0; i<get_DetectorCount(); i++) {
969  QxrdDetectorPtr det = detector(i);
970 
971  if (det && det->isEnabled()) {
972  nDet++;
973  dets.append(det);
974  procs.append(det->processor());
975 
976  res.resize(nDet);
977  ovf.resize(nDet);
978 
979  res[nDet-1].resize(nphases);
980  ovf[nDet-1].resize(nphases);
981 
982  for (int p=0; p<nphases; p++) {
983  res[nDet-1][p].resize(preTrigger+1);
984  ovf[nDet-1][p].resize(preTrigger+1);
985  }
986  }
987  }
988 
989 
990  if (synchronizedAcquisition()) {
991  synchronizedAcquisition()->prepareForAcquisition(parmsp);
992  }
993 
994  if (acquisitionExtraInputs()) {
995  acquisitionExtraInputs()->prepareForAcquisition(parmsp);
996  }
997 
998  for (int d=0; d<nDet; d++) {
999  dets[d] -> beginAcquisition(exposure);
1000  }
1001 
1002  printMessage(tr("acquire(\"%1\", %2, %3, %4, %5, %6) // fileIndex = %7")
1003  .arg(fileBase).arg(exposure).arg(nsummed).arg(postTrigger).arg(preTrigger).arg(nphases).arg(fileIndex));
1004 
1005 
1006  set_CurrentPhase(0);
1007  set_CurrentSummation(-1);
1008  set_CurrentFile(fileIndex);
1009 
1010  for (int i=0; i<skipBefore; i++) {
1011  if (cancelling()) goto cancel;
1013  printMessage(tr("Skipping %1 of %2").arg(i+1).arg(skipBefore));
1014  }
1015 
1016  for (int d=0; d<nDet; d++) {
1017  dets[d]->beginFrame();
1018  }
1019 
1020  for (int d=0; d<nDet; d++) {
1021  dets[d]->acquireFrame();
1022  }
1023  }
1024 
1025  for (int i=0; i<postTrigger; i += (get_Triggered() ? 1:0)) {
1026  if (cancelling()) goto cancel;
1027 
1028  set_CurrentFile(fileIndex);
1029 
1030  if (i != 0) {
1031  for (int k=0; k<skipBetween; k++) {
1032  if (cancelling()) goto cancel;
1034  printMessage(tr("Skipping %1 of %2").arg(k+1).arg(skipBetween));
1035  }
1036 
1037  for (int d=0; d<nDet; d++) {
1038  dets[d]->acquireFrame();
1039  }
1040 
1042  printMessage(tr("Frame after %1 msec").arg(acqTimer.restart()));
1043  }
1044  }
1045  }
1046 
1047  if (cancelling()) goto cancel;
1048 
1049  for (int s=0; s<nsummed;) {
1050  set_CurrentSummation(s);
1051 
1052  for (int p=0; p<nphases; p++) {
1053  set_CurrentPhase(p);
1054 
1055  for (int d=0; d<nDet; d++) {
1056  QxrdDetectorPtr det = dets[d];
1057 
1058  det->beginFrame();
1059  }
1060 
1061  for (int d=0; d<nDet; d++) {
1062  QxrdDetectorPtr det = dets[d];
1063  int nCols = det->get_NCols();
1064  int nRows = det->get_NRows();
1065 
1066  if (res[d][p][0] == NULL) {
1068  nCols, nRows, this);
1069 
1070  res[d][p][0] = nres;
1071 
1072  if (nres == NULL) {
1074  printMessage("Dropped frame allocation...");
1075  }
1077  } else {
1078  QString fb, fn;
1080  printMessage(tr("Newly allocated image number %1").arg(nres->get_ImageNumber()));
1081  }
1082 
1083  nres -> set_SummedExposures(0);
1084 
1085  getFileBaseAndName(fileBase, det->get_Extension(),
1086  det->get_DetectorNumber(),
1087  fileIndex, p, nphases, fb, fn);
1088 
1089  nres -> set_FileBase(fb);
1090  nres -> set_FileName(fn);
1091  }
1092  }
1093 
1094  if (ovf[d][p][0] == NULL) {
1096  nCols, nRows, 0, this);
1097  ovf[d][p][0] = novf;
1098 
1099  if (novf == NULL) {
1101  printMessage("Dropped mask frame allocation...");
1102  }
1104  } else {
1106  printMessage(tr("Newly allocated mask number %1").arg(novf->get_ImageNumber()));
1107  }
1108  }
1109 
1110  if (novf) ovf[d][p][0] -> set_SummedExposures(0);
1111  }
1112 
1113  if (res[d][p][0]) {
1114  emit acquiredFrame(res[d][p][0]->get_FileBase(),
1115  p, nphases,
1116  s, nsummed,
1117  i, postTrigger);
1118  }
1119 
1120  QcepImageDataBasePtr img = det -> acquireFrame();
1121 
1122  if (img && res[d][p][0] && ovf[d][p][0]) {
1123  accumulateAcquiredImage(img, res[d][p][0], ovf[d][p][0]);
1124  } else if (!cancelling()){
1126  }
1127 
1129  printMessage(tr("accumulateAcquiredImage %1 msec idx:%2 post:%3 sum: %4 ph:%5")
1130  .arg(acqTimer.restart())
1131  .arg(fileIndex)
1132  .arg(i)
1133  .arg(s)
1134  .arg(p)
1135  );
1136  }
1137 
1138  if (cancelling()) goto saveCancel;
1139  }
1140  }
1141 
1142  if (get_RetryDropped()) {
1143  int minSum = nsummed+10;
1144 
1145  for (int p=0; p<nphases; p++) {
1146  for (int d=0; d<nDet; d++) {
1147  if (res[d][p][0]) {
1148  int ns = res[d][p][0]->get_SummedExposures();
1149 
1150  if (ns < minSum) {
1151  minSum = ns;
1152  }
1153  } else {
1154  minSum = 0;
1155  }
1156  }
1157  }
1158 
1160  printMessage(tr("i = %1, Minsum = %2, s = %3, nsummed = %4").arg(i).arg(minSum).arg(s).arg(nsummed));
1161  }
1162 
1163  if (minSum == nsummed+10) {
1165  printMessage("No acquired images allocated");
1166  }
1167  // s = s+1;
1168  } else {
1169  s = minSum;
1170  }
1171  } else {
1172  s = s+1;
1173  }
1174  }
1175 
1176 saveCancel:
1177  if (get_Triggered()) {
1178  int nPre = qMin(preTrigger, nPreTriggered);
1179 
1180  for (int ii=nPre; ii >= 1; ii--) {
1181  for (int p=0; p<nphases; p++) {
1182  for (int d=0; d<nDet; d++) {
1183 
1184  procs[d] -> processAcquiredImage(res[d][p][ii], ovf[d][p][ii], fileIndex, p, nphases, false);
1185 
1187  printMessage(tr("processAcquiredImage(line %1) %2 msec idx:%3 pre:%4 ph:%5")
1188  .arg(__LINE__)
1189  .arg(acqTimer.restart())
1190  .arg(fileIndex)
1191  .arg(ii)
1192  .arg(p)
1193  );
1194  }
1195 
1196  res[d][p].pop_back();
1197  ovf[d][p].pop_back();
1198  }
1199  }
1200 
1201  fileIndex++;
1202  set_FileIndex(fileIndex);
1203  }
1204 
1205  nPreTriggered = 0;
1206 
1207  for (int p=0; p<nphases; p++) {
1208  for (int d=0; d<nDet; d++) {
1209  procs[d] -> processAcquiredImage(res[d][p][0], ovf[d][p][0], fileIndex, p, nphases, true);
1210 
1212  printMessage(tr("processAcquiredImage(line %1) %2 msec idx:%3 pre:%4 ph:%5")
1213  .arg(__LINE__)
1214  .arg(acqTimer.restart())
1215  .arg(fileIndex)
1216  .arg(i)
1217  .arg(p)
1218  );
1219  }
1220 
1221  res[d][p][0] = QcepInt32ImageDataPtr();
1222  ovf[d][p][0] = QcepMaskDataPtr();
1223  }
1224  }
1225  fileIndex++;
1226  set_FileIndex(fileIndex);
1227  } else {
1228  nPreTriggered++;
1229  for (int p=0; p<nphases; p++) {
1230  for (int d=0; d<nDet; d++) {
1231  res[d][p].push_front(QcepInt32ImageDataPtr());
1232  ovf[d][p].push_front(QcepMaskDataPtr());
1233  res[d][p].pop_back();
1234  ovf[d][p].pop_back();
1235  }
1236  }
1237  }
1238  }
1239 
1240  statusMessage(tr("Acquisition complete"));
1241  printMessage(tr("Acquisition complete"));
1242 
1243 cancel:
1244  if (synchronizedAcquisition()) {
1245  synchronizedAcquisition()->finishedAcquisition();
1246  }
1247 
1248  for (int d=0; d<nDet; d++) {
1249  dets[d]->endAcquisition();
1250  }
1251 
1252  QVector<double> scalers;
1253 
1254  scalers.append(get_FileIndex()-1);
1255 
1256  if (acquisitionExtraInputs()) {
1257  scalers += acquisitionExtraInputs()->evaluateChannels();
1258  }
1259 
1260  for (int d=0; d<nDet; d++) {
1261  scalers += dets[d]->scalerCounts();
1262  }
1263 
1264  set_ScalerValues(scalers);
1265 
1266  startIdling();
1267  }
1268 
1269  m_Acquiring.unlock();
1270 
1271  emit acquireComplete();
1272 }
1273 
1275 {
1277 
1278  if (parmsp) {
1279  stopIdling();
1280 
1281  QString fileBase = parmsp->fileBase();
1282  int fileIndex = get_FileIndex();
1283  double exposure = parmsp->exposure();
1284  int nsummed = parmsp->nsummed();
1285  int skipBefore = parmsp->skipBefore();
1286 
1287  if (skipBefore <= 0) {
1288  if (get_LastAcquired() != -1) {
1289  skipBefore = 1;
1290  }
1291  }
1292 
1293  set_LastAcquired(-1);
1294 
1295  printMessage(tr("acquireDark(\"%1\", %2, %3) // fileIndex = %4")
1296  .arg(fileBase).arg(exposure).arg(nsummed).arg(fileIndex));
1297 
1298  int nDet = 0;
1299  QVector<QxrdDetectorPtr> dets;
1300  QVector<QxrdDetectorProcessorPtr> procs;
1301  QVector<QcepInt32ImageDataPtr> res;
1302  QVector<QcepMaskDataPtr> overflow;
1303 
1304  set_CurrentPhase(-1);
1305  set_CurrentSummation(0);
1306  set_CurrentFile(fileIndex);
1307 
1308  for (int i=0; i<get_DetectorCount(); i++) {
1309  QxrdDetectorPtr det = detector(i);
1310 
1311  if (det && det->isEnabled()) {
1312  nDet++;
1313  dets.append(det);
1314  procs.append(det->processor());
1315 
1317  det->get_NCols(), det->get_NRows(), this);
1318 
1319  res.append(img);
1320 
1322  det->get_NCols(), det->get_NRows(),0, this);
1323 
1324  overflow.append(msk);
1325  }
1326  }
1327 
1328  if (synchronizedAcquisition()) {
1329  synchronizedAcquisition()->prepareForDarkAcquisition(parmsp);
1330  }
1331 
1332  QString fb, fn;
1333 
1334  for (int d=0; d<nDet; d++) {
1335  if (res[d] == NULL || overflow[d] == NULL) {
1336  criticalMessage("Insufficient memory for acquisition operation");
1337  goto cancel;
1338  }
1339  }
1340 
1341  for (int d=0; d<nDet; d++) {
1342  dets[d] -> beginAcquisition(exposure);
1343  }
1344 
1345  for (int d=0; d<nDet; d++) {
1346  QxrdDetectorPtr det = dets[d];
1347 
1348  getFileBaseAndName(fileBase, det->get_Extension(), det->get_DetectorNumber(), fileIndex, -1, 1, fb, fn);
1349 
1350  res[d] -> set_FileBase(fb);
1351  res[d] -> set_FileName(fn);
1352  }
1353 
1354  for (int i=0; i<skipBefore; i++) {
1355  if (cancelling()) goto cancel;
1356 
1357  set_CurrentSummation(-1);
1358 
1359  for (int d=0; d<nDet; d++) {
1360  dets[i] -> beginFrame();
1361  }
1362 
1364  printMessage(tr("Skipping %1 of %2").arg(i+1).arg(skipBefore));
1365  }
1366 
1367  for (int d=0; d<nDet; d++) {
1368  dets[i] -> acquireFrame();
1369  }
1370  }
1371 
1372  for (int i=0; i<nsummed;) {
1373  if (cancelling()) goto cancel;
1374 
1375  set_CurrentSummation(i);
1376 
1377  for (int d=0; d<nDet; d++) {
1378  dets[d] -> beginFrame();
1379  }
1380 
1381  for (int d=0; d<nDet; d++) {
1382  emit acquiredFrame(res[d]->get_FileBase(), 0, 1, i, nsummed, 0, 1);
1383 
1384  QcepImageDataBasePtr img =
1385  dets[d] -> acquireFrame();
1386 
1387  if (img) {
1388  accumulateAcquiredImage(img, res[d], overflow[d]);
1389  } else {
1390  if (!cancelling()){
1392  } else {
1393  goto cancel;
1394  }
1395  }
1396  }
1397 
1398  if (get_RetryDropped()) {
1399  int minSum = nsummed+10;
1400 
1401  for (int d=0; d<nDet; d++) {
1402  if (res[d]) {
1403  int ns = res[d]->get_SummedExposures();
1404 
1405  if (ns < minSum) {
1406  minSum = ns;
1407  }
1408  } else {
1409  minSum = 0;
1410  }
1411  }
1412 
1413  i = minSum;
1414  } else{
1415  i = i+1;
1416  }
1417  }
1418 
1419  //saveCancel:
1420 
1421  for (int d=0; d<nDet; d++) {
1422  procs[d]->processDarkImage(res[d], overflow[d], fileIndex);
1423  }
1424 
1425  statusMessage(tr("Acquisition complete"));
1426  printMessage(tr("Acquisition complete"));
1427 
1428 cancel:
1429  if (synchronizedAcquisition()) {
1430  synchronizedAcquisition()->finishedAcquisition();
1431  }
1432 
1433  startIdling();
1434  }
1435 
1436  m_Acquiring.unlock();
1437 
1438  emit acquireComplete();
1439 }
1440 
1442 {
1443  m_Idling.fetchAndStoreOrdered(0);
1444 // flushImageQueue();
1445 
1446  if (get_AcquisitionCancelsLiveView()) {
1447  set_LiveViewAtIdle(false);
1448  }
1449 }
1450 
1452 {
1453  m_Idling.fetchAndStoreOrdered(1);
1454 }
1455 
1457 {
1458  if (m_Idling.fetchAndAddOrdered(0)) {
1459  for (int i=0; i<get_DetectorCount(); i++) {
1460  QxrdDetectorPtr det = detector(i);
1461 
1462  if (det && det->isEnabled()) {
1463  QcepImageDataBasePtr res = det -> acquireFrameIfAvailable();
1464 
1465  QxrdDetectorProcessorPtr proc = det->processor();
1466 
1467  if (proc) {
1468  proc->processIdleImage(res);
1469  }
1470  }
1471  }
1472  }
1473 }
1474 
1475 void QxrdAcquisition::Message(QString msg)
1476 {
1478 
1479  if (expt) {
1480  expt->statusMessage(msg);
1481  }
1482 }
1483 
1485 {
1486  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
1487 
1488  const QMetaObject *meta = metaObject();
1489 
1490  int count = meta->propertyCount();
1491  int offset = 1; /*meta->propertyOffset();*/
1492 
1493  for (int i=offset; i<count; i++) {
1494  QMetaProperty metaproperty = meta->property(i);
1495 
1496  const char *name = metaproperty.name();
1497  QVariant value = property(name);
1498 
1499  if (g_Application) {
1500  g_Application->printMessage(tr("Property %1: %2 = %3").arg(i).arg(name).arg(value.toString()));
1501  }
1502  }
1503 
1504  QList<QByteArray> dynProps = dynamicPropertyNames();
1505 
1506  foreach(QByteArray name, dynProps) {
1507  g_Application->printMessage(tr("Dynamic Property %1 = %2").arg(QString(name)).arg(property(name).toString()));
1508  }
1509 }
1510 
1511 void QxrdAcquisition::setupExposureMenu(QDoubleSpinBox *cb)
1512 {
1513 }
1514 
1516 {
1517  return get_ScalerValues().value(i);
1518 }
QSharedPointer< QxrdExperiment > QxrdExperimentPtr
QxrdWindowWPtr m_Window
QSharedPointer< QxrdDetectorProxy > QxrdDetectorProxyPtr
void indicateDroppedFrame(int n)
QWeakPointer< QxrdDataProcessor > QxrdDataProcessorWPtr
QVector< QxrdDetectorPtr > m_Detectors
QxrdSynchronizedAcquisitionPtr m_SynchronizedAcquisition
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QxrdDataProcessorWPtr m_DataProcessor
QxrdExperimentWPtr experiment()
QcepInt32ImageDataPtr m_Image
QSharedPointer< QxrdAcquisition > QxrdAcquisitionPtr
virtual void readSettings(QSettings *set, QString section)
Definition: qcepobject.cpp:119
void getFileBaseAndName(QString filePattern, QString extent, int detNum, int fileIndex, int phase, int nphases, QString &fileBase, QString &fileName)
QString currentFileBase(int detNum, QString extension="")
void acquiredFrame(QString fileName, int iphase, int nphases, int isum, int nsum, int igroup, int ngroup)
void statusMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
#define STR(s)
Definition: qcepmacros.h:16
QxrdAcquisitionScalerModelPtr m_ScalerModel
void configureDetector(int i)
virtual void stopIdling()
void appendDetectorProxy(QxrdDetectorProxyPtr proxy)
QWeakPointer< QxrdExperiment > QxrdExperimentWPtr
void processImage(const QxrdProcessArgs &args)
QxrdDetectorPtr detector(int n)
QSharedPointer< QxrdAcquisitionScalerModel > QxrdAcquisitionScalerModelPtr
QVector< double > QcepDoubleVector
Definition: qcepmacros.h:19
QxrdDataProcessorWPtr dataProcessor()
void appendDetector(int detType)
virtual void startIdling()
QSharedPointer< QxrdSynchronizedAcquisition > QxrdSynchronizedAcquisitionPtr
void setWindow(QxrdWindowWPtr win)
void openDetectorControlWindow(int i)
double scalerValue(int i)
QSharedPointer< QxrdAcquisitionExtraInputs > QxrdAcquisitionExtraInputsPtr
QxrdSynchronizedAcquisitionPtr synchronizedAcquisition() const
QxrdAcquisitionParameterPackPtr acquisitionParameterPack()
void copyDynamicProperties(QObject *dest)
QWeakPointer< QxrdWindow > QxrdWindowWPtr
Definition: qxrdwindow-ptr.h:9
virtual void setupExposureMenu(QDoubleSpinBox *cb)
QxrdDetectorThreadPtr detectorThread(int n)
void setNIDAQPlugin(QxrdNIDAQPluginInterfacePtr nidaqPlugin)
void extraInputsChanged()
QxrdAcquisitionPtr myself()
QList< double > QcepDoubleList
Definition: qcepmacros.h:28
void accumulateAcquiredImage(QcepInt16ImageDataPtr image, QcepInt32ImageDataPtr accum, QcepMaskDataPtr overflow)
QSharedPointer< QxrdDetectorProcessor > QxrdDetectorProcessorPtr
QxrdDarkAcquisitionParameterPackPtr darkAcquisitionParameterPack()
QxrdExperimentWPtr m_Experiment
virtual void onExposureTimeChanged()
QWeakPointer< QcepAllocator > QcepAllocatorWPtr
QSharedPointer< QxrdDarkAcquisitionParameterPack > QxrdDarkAcquisitionParameterPackPtr
void onBufferSizeChanged(int newMB)
QSharedPointer< QxrdNIDAQPluginInterface > QxrdNIDAQPluginInterfacePtr
virtual QxrdAcquisitionDialogPtr controlPanel(QxrdWindowWPtr win)
QVector< QxrdDetectorThreadPtr > m_DetectorThreads
void processAcquiredImage(QString filePattern, QString extent, int fileIndex, int phase, int nPhases, bool trig, QcepInt32ImageDataPtr image, QcepMaskDataPtr overflow)
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
void readSettings(QSettings *settings, QString section)
QxrdAcquisitionExtraInputsPtr acquisitionExtraInputs() const
void writeSettings(QSettings *settings, QString section)
virtual void writeSettings(QSettings *set, QString section)
Definition: qcepobject.cpp:114
virtual void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())=0
QSharedPointer< QcepInt32ImageData > QcepInt32ImageDataPtr
void processDarkImage(QString filePattern, QString extent, int fileIndex, QcepInt32ImageDataPtr image, QcepMaskDataPtr overflow)
QxrdAcquisition(QcepSettingsSaverWPtr saver, QxrdExperimentWPtr doc, QxrdDataProcessorWPtr proc, QcepAllocatorWPtr allocator)
QcepApplication * g_Application
QcepAllocatorWPtr allocator() const
QSharedPointer< QcepAllocator > QcepAllocatorPtr
void criticalMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QString name
Definition: qcepobject.h:49
QAtomicInt m_Idling
void valueChanged(double val, int index)
QSharedPointer< QxrdAcquisitionParameterPack > QxrdAcquisitionParameterPackPtr
QSharedPointer< QxrdDetectorThread > QxrdDetectorThreadPtr
QSharedPointer< QxrdDetector > QxrdDetectorPtr
QcepAllocatorWPtr m_Allocator
QcepMaskDataPtr m_Overflow
static QcepMaskDataPtr newMask(AllocationStrategy strat, int width, int height, int def, QcepObject *parent)
void valueChanged(int val, int index)
QSharedPointer< QcepImageDataBase > QcepImageDataBasePtr
QSharedPointer< QcepInt16ImageData > QcepInt16ImageDataPtr
QSharedPointer< QcepMaskData > QcepMaskDataPtr
static QcepInt32ImageDataPtr newInt32Image(AllocationStrategy strat, int width, int height, QcepObject *parent)
static double secondsSinceEpoch()
QxrdAcquisitionDialogPtr m_ControlPanel
QxrdAcquisitionExtraInputsPtr m_AcquisitionExtraInputs
QWeakPointer< QcepSettingsSaver > QcepSettingsSaverWPtr
void Message(QString cmd)
QxrdNIDAQPluginInterfacePtr nidaqPlugin() const
QxrdAcquisitionScalerModelPtr acquisitionScalerModel() const