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

#include <qxrddetectorperkinelmer.h>

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

Public Slots

void onExposureTimeChanged ()
 
void onBinningModeChanged ()
 
void onCameraGainChanged ()
 
void startDetector ()
 
void stopDetector ()
 
void onEndFrame (int counter, unsigned int n1, unsigned int n2)
 
void onEndFrameCallback ()
 
void dumpHeaderInfo ()
 
QString acquisitionErrorString (int n)
 
- Public Slots inherited from QxrdDetector
bool isEnabled ()
 
bool checkDetectorEnabled ()
 
virtual void startDetector ()
 
virtual void stopDetector ()
 
virtual void onExposureTimeChanged ()
 
void openControlWindow ()
 
QxrdDetectorProcessorPtr processor ()
 
void startOrStop (bool enabled)
 
virtual void beginFrame ()
 
virtual QcepImageDataBasePtr acquireFrameIfAvailable ()
 
virtual QcepImageDataBasePtr acquireFrame ()
 
int roiCount ()
 
QxrdROICoordinatesPtr roi (int i)
 
QcepDoubleVector scalerCounts ()
 
double scalerCounts (int chan)
 
- Public Slots inherited from QcepObject
virtual void printLine (QString line)
 
virtual QString settingsScript ()
 
QString scriptValueLiteral (QVariant v)
 

Public Member Functions

 QxrdDetectorPerkinElmer (QcepSettingsSaverWPtr saver, QxrdExperimentWPtr expt, QxrdAcquisitionWPtr acq, int detNum, QcepObject *parent)
 
virtual ~QxrdDetectorPerkinElmer ()
 
int detectorNumber () const
 
int detectorSubType () const
 
QString detectorAddress () const
 
void pushPropertiesToProxy (QxrdDetectorProxyPtr proxy)
 
void pullPropertiesfromProxy (QxrdDetectorProxyPtr proxy)
 
- Public Member Functions inherited from QxrdDetector
 QxrdDetector (QcepSettingsSaverWPtr saver, QxrdExperimentWPtr expt, QxrdAcquisitionWPtr acq, int detType, int detNum, QcepObject *parent)
 
void initialize ()
 
virtual ~QxrdDetector ()
 
QxrdExperimentWPtr experiment ()
 
QxrdAcquisitionWPtr acquisition ()
 
void printMessage (QString msg, QDateTime ts=QDateTime::currentDateTime()) const
 
void criticalMessage (QString msg, QDateTime ts=QDateTime::currentDateTime()) const
 
void statusMessage (QString msg, QDateTime ts=QDateTime::currentDateTime()) const
 
void readSettings (QSettings *settings, QString section)
 
void writeSettings (QSettings *settings, QString section)
 
void enqueueAcquiredFrame (QcepImageDataBasePtr img)
 
- Public Member Functions inherited from QcepObject
 QcepObject (QString name, QcepObject *parent)
 
virtual ~QcepObject ()
 
QString get_Name () const
 
void set_Name (QString name)
 

Static Public Member Functions

static void pushDefaultsToProxy (QxrdDetectorProxyPtr proxy)
 
- Static Public Member Functions inherited from QxrdDetector
static QScriptValue toScriptValue (QScriptEngine *engine, const QxrdDetectorPtr &det)
 
static void fromScriptValue (const QScriptValue &obj, QxrdDetectorPtr &det)
 
static void pushDefaultsToProxy (QxrdDetectorProxyPtr proxy, int detType)
 
- Static Public Member Functions inherited from QcepObject
static int allocatedObjects ()
 
static int deletedObjects ()
 
static QSet< QcepObject * > allocatedObjectsSet ()
 
static QString addSlashes (QString str)
 

Protected Member Functions

void beginAcquisition (double exposure)
 
void endAcquisition ()
 
void shutdownAcquisition ()
 

Properties

int detectorNumber
 
int detectorSubType
 
QString detectorAddress
 
int detectorGain
 
int detectorBinning
 
- Properties inherited from QxrdDetector
int detectorNumber
 
int detectorType
 
QString detectorTypeName
 
bool enabled
 
QString detectorName
 
int nCols
 
int nRows
 
int hBinning
 
int vBinning
 
QString extension
 
- Properties inherited from QcepObject
QString name
 

Private Member Functions

void acquisitionError (const char *fn, int ln, int n)
 
void startupAcquisition ()
 
bool checkPluginAvailable ()
 
void acquisitionInitError (const char *fn, int ln, int n)
 
void acquisitionNSensorsError (const char *fn, int ln, int n)
 

Private Attributes

QMutex m_Mutex
 
int m_BufferSize
 
int m_BufferIndex
 
QVector< quint16 > m_Buffer
 
QVector< double > m_ReadoutTimes
 
HACQDESC m_AcqDesc
 
int m_StartupDelayed
 
int m_PROMID
 
int m_HeaderID
 
int m_CameraType
 
QString m_CameraModel
 
int m_CurrentGain
 
int m_SyncMode
 
QAtomicInt m_Counter
 
CHwHeaderInfo m_HwHeaderInfo
 
CHwHeaderInfoEx m_HwHeaderInfoEx
 
QxrdPerkinElmerPluginInterfaceWPtr m_PerkinElmer
 

Additional Inherited Members

- Public Types inherited from QxrdDetector
enum  { FileIndexScaler, FilePhaseScaler, ExtraScalers }
 
- Protected Attributes inherited from QxrdDetector
QcepSettingsSaverWPtr m_Saver
 
QxrdExperimentWPtr m_Experiment
 
QxrdAcquisitionWPtr m_Acquisition
 
QxrdDetectorProcessorPtr m_Processor
 
QxrdDetectorControlWindowPtr m_DetectorControlWindow
 

Detailed Description

Definition at line 16 of file qxrddetectorperkinelmer.h.

Constructor & Destructor Documentation

QxrdDetectorPerkinElmer::QxrdDetectorPerkinElmer ( QcepSettingsSaverWPtr  saver,
QxrdExperimentWPtr  expt,
QxrdAcquisitionWPtr  acq,
int  detNum,
QcepObject parent 
)
explicit

Definition at line 14 of file qxrddetectorperkinelmer.cpp.

References DEBUG_CONSTRUCTORS, DEBUG_PERKINELMER, QxrdDetector::printMessage(), and qcepDebug().

18  :
19  QxrdDetector(saver, expt, acq, QxrdDetectorThread::PerkinElmerDetector, detNum, parent),
20  m_Mutex(QMutex::Recursive),
21  m_BufferSize(0),
22  m_AcqDesc(NULL),
24  m_PROMID(-1),
25  m_HeaderID(-1),
26  m_CameraType(-1),
27  m_CameraModel(""),
28  m_CurrentGain(-1),
29  m_SyncMode(HIS_SYNCMODE_INTERNAL_TIMER),
30  m_Counter(0),
31  m_PerkinElmer(),
32  m_DetectorNumber (saver, this, "detectorNumber", 0, "Perkin Elmer Detector Number"),
33  m_DetectorSubType(saver, this, "detectorSubType", 0, "Perkin Elmer Detector Subtype"),
34  m_DetectorAddress(saver, this, "detectorAddress", "", "Perkin Elmer Detector Address"),
35  m_DetectorGain (saver, this, "detectorGain", 0, "Detector Gain"),
36  m_DetectorBinning(saver, this, "detectorBinning", 0, "Detector Binning Mode")
37 {
39  printf("QxrdDetectorPerkinElmer::QxrdDetectorPerkinElmer(%p)\n", this);
40  }
41 
43  printMessage("QxrdDetectorPerkinElmer::QxrdDetectorPerkinElmer()");
44  }
45 
46 // ::g_Detector = this;
47 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QxrdDetector(QcepSettingsSaverWPtr saver, QxrdExperimentWPtr expt, QxrdAcquisitionWPtr acq, int detType, int detNum, QcepObject *parent)
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QxrdPerkinElmerPluginInterfaceWPtr m_PerkinElmer

Here is the call graph for this function:

QxrdDetectorPerkinElmer::~QxrdDetectorPerkinElmer ( )
virtual

Definition at line 49 of file qxrddetectorperkinelmer.cpp.

References DEBUG_CONSTRUCTORS, DEBUG_PERKINELMER, m_AcqDesc, m_PerkinElmer, QxrdDetector::printMessage(), and qcepDebug().

50 {
52  printf("QxrdDetectorPerkinElmer::~QxrdDetectorPerkinElmer(%p)\n", this);
53  }
54 
56  printMessage("QxrdDetectorPerkinElmer::~QxrdDetectorPerkinElmer()");
57  }
58 
60 
61  if (plugin && m_AcqDesc) {
62  plugin->Acquisition_SetAcqData(m_AcqDesc, NULL);
63  plugin->Acquisition_SetCallbacksAndMessages(m_AcqDesc, NULL, 0, 0, NULL, NULL);
64  plugin->Acquisition_Abort(m_AcqDesc);
65  plugin->Acquisition_CloseAll();
66  }
67 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QSharedPointer< QxrdPerkinElmerPluginInterface > QxrdPerkinElmerPluginInterfacePtr
QxrdPerkinElmerPluginInterfaceWPtr m_PerkinElmer

Here is the call graph for this function:

Member Function Documentation

void QxrdDetectorPerkinElmer::acquisitionError ( const char *  fn,
int  ln,
int  n 
)
private

Definition at line 363 of file qxrddetectorperkinelmer.cpp.

References acquisitionErrorString(), QxrdDetector::criticalMessage(), QxrdDetector::m_Acquisition, and QxrdDetector::printMessage().

Referenced by acquisitionInitError(), acquisitionNSensorsError(), onBinningModeChanged(), onCameraGainChanged(), onExposureTimeChanged(), startDetector(), and startupAcquisition().

364 {
366 
367  if (acq) {
368  acq -> cancel();
369  }
370 
371  printMessage(tr("Acquisition Error %1 [%2] at line %3 in file %4")
372  .arg(n).arg(acquisitionErrorString(n)).arg(ln).arg(fn));
373 
374  criticalMessage(tr("Acquisition Error %1 [%2] at line %3 in file %4")
375  .arg(n).arg(acquisitionErrorString(n)).arg(ln).arg(fn));
376 }
void criticalMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QSharedPointer< QxrdAcquisition > QxrdAcquisitionPtr
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QxrdAcquisitionWPtr m_Acquisition
Definition: qxrddetector.h:94

Here is the call graph for this function:

Here is the caller graph for this function:

QString QxrdDetectorPerkinElmer::acquisitionErrorString ( int  n)
slot

Definition at line 118 of file qxrddetectorperkinelmer.cpp.

Referenced by acquisitionError().

119 {
120  QString res = "No Error";
121 
122  switch (n) {
123  case HIS_ALL_OK:
124  res = "HIS_ALL_OK";
125  break;
126 
127  case HIS_ERROR_MEMORY:
128  res = "HIS_ERROR_MEMORY";
129  break;
130 
131  case HIS_ERROR_BOARDINIT:
132  res = "HIS_ERROR_BOARDINIT";
133  break;
134 
135  case HIS_ERROR_NOCAMERA:
136  res = "HIS_ERROR_NOCAMERA";
137  break;
138 
139  case HIS_ERROR_CORRBUFFER_INCOMPATIBLE:
140  res = "HIS_ERROR_CORRBUFFER_INCOMPATIBLE";
141  break;
142 
143  case HIS_ERROR_ACQ_ALREADY_RUNNING:
144  res = "HIS_ERROR_ACQ_ALREADY_RUNNING";
145  break;
146 
147  case HIS_ERROR_TIMEOUT:
148  res = "HIS_ERROR_TIMEOUT";
149  break;
150 
151  case HIS_ERROR_INVALIDACQDESC:
152  res = "HIS_ERROR_INVALIDACQDESC";
153  break;
154 
155  case HIS_ERROR_VXDNOTFOUND:
156  res = "HIS_ERROR_VXDNOTFOUND";
157  break;
158 
159  case HIS_ERROR_VXDNOTOPEN:
160  res = "HIS_ERROR_VXDNOTOPEN";
161  break;
162 
163  case HIS_ERROR_VXDUNKNOWNERROR:
164  res = "HIS_ERROR_VXDUNKNOWNERROR";
165  break;
166 
167  case HIS_ERROR_VXDGETDMAADR:
168  res = "HIS_ERROR_VXDGETDMAADR";
169  break;
170 
171  case HIS_ERROR_ACQABORT:
172  res = "HIS_ERROR_ACQABORT";
173  break;
174 
175  case HIS_ERROR_ACQUISITION:
176  res = "HIS_ERROR_ACQUISITION";
177  break;
178 
179  case HIS_ERROR_VXD_REGISTER_IRQ:
180  res = "HIS_ERROR_VXD_REGISTER_IRQ";
181  break;
182 
183  case HIS_ERROR_VXD_REGISTER_STATADR:
184  res = "HIS_ERROR_MEMORY";
185  break;
186 
187  case HIS_ERROR_GETOSVERSION:
188  res = "HIS_ERROR_GETOSVERSION";
189  break;
190 
191  case HIS_ERROR_SETFRMSYNC:
192  res = "HIS_ERROR_SETFRMSYNC";
193  break;
194 
195  case HIS_ERROR_SETFRMSYNCMODE:
196  res = "HIS_ERROR_SETFRMSYNCMODE";
197  break;
198 
199  case HIS_ERROR_SETTIMERSYNC:
200  res = "HIS_ERROR_SETTIMERSYNC";
201  break;
202 
203  case HIS_ERROR_INVALID_FUNC_CALL:
204  res = "HIS_ERROR_INVALID_FUNC_CALL";
205  break;
206 
207  case HIS_ERROR_ABORTCURRFRAME:
208  res = "HIS_ERROR_ABORTCURRFRAME";
209  break;
210 
211  case HIS_ERROR_GETHWHEADERINFO:
212  res = "HIS_ERROR_GETHWHEADERINFO";
213  break;
214 
215  case HIS_ERROR_HWHEADER_INV:
216  res = "HIS_ERROR_HWHEADER_INV";
217  break;
218 
219  case HIS_ERROR_SETLINETRIG_MODE:
220  res = "HIS_ERROR_SETLINETRIG_MODE";
221  break;
222 
223  case HIS_ERROR_WRITE_DATA:
224  res = "HIS_ERROR_WRITE_DATA";
225  break;
226 
227  case HIS_ERROR_READ_DATA:
228  res = "HIS_ERROR_READ_DATA";
229  break;
230 
231  case HIS_ERROR_SETBAUDRATE:
232  res = "HIS_ERROR_SETBAUDRATE";
233  break;
234 
235  case HIS_ERROR_NODESC_AVAILABLE:
236  res = "HIS_ERROR_NODESC_AVAILABLE";
237  break;
238 
239  case HIS_ERROR_BUFFERSPACE_NOT_SUFF:
240  res = "HIS_ERROR_BUFFERSPACE_NOT_SUFF";
241  break;
242 
243  case HIS_ERROR_SETCAMERAMODE:
244  res = "HIS_ERROR_SETCAMERAMODE";
245  break;
246 
247  case HIS_ERROR_FRAME_INV:
248  res = "HIS_ERROR_FRAME_INV";
249  break;
250 
251  case HIS_ERROR_SLOW_SYSTEM:
252  res = "HIS_ERROR_SLOW_SYSTEM";
253  break;
254 
255  case HIS_ERROR_GET_NUM_BOARDS:
256  res = "HIS_ERROR_GET_NUM_BOARDS";
257  break;
258 
259  case HIS_ERROR_HW_ALREADY_OPEN_BY_ANOTHER_PROCESS:
260  res = "HIS_ERROR_HW_ALREADY_OPEN_BY_ANOTHER_PROCESS";
261  break;
262 
263  case HIS_ERROR_CREATE_MEMORYMAPPING:
264  res = "HIS_ERROR_CREATE_MEMORYMAPPING";
265  break;
266 
267  case HIS_ERROR_VXD_REGISTER_DMA_ADDRESS:
268  res = "HIS_ERROR_VXD_REGISTER_DMA_ADDRESS";
269  break;
270 
271  case HIS_ERROR_VXD_REGISTER_STAT_ADDR:
272  res = "HIS_ERROR_VXD_REGISTER_STAT_ADDR";
273  break;
274 
275  case HIS_ERROR_VXD_UNMASK_IRQ:
276  res = "HIS_ERROR_VXD_UNMASK_IRQ";
277  break;
278 
279  case HIS_ERROR_LOADDRIVER:
280  res = "HIS_ERROR_LOADDRIVER";
281  break;
282 
283  case HIS_ERROR_FUNC_NOTIMPL:
284  res = "HIS_ERROR_FUNC_NOTIMPL";
285  break;
286 
287  case HIS_ERROR_MEMORY_MAPPING:
288  res = "HIS_ERROR_MEMORY_MAPPING";
289  break;
290 
291  case HIS_ERROR_CREATE_MUTEX:
292  res = "HIS_ERROR_CREATE_MUTEX";
293  break;
294 
295  case HIS_ERROR_ACQ:
296  res = "HIS_ERROR_ACQ";
297  break;
298 
299  case HIS_ERROR_DESC_NOT_LOCAL:
300  res = "HIS_ERROR_DESC_NOT_LOCAL";
301  break;
302 
303  case HIS_ERROR_INVALID_PARAM:
304  res = "HIS_ERROR_INVALID_PARAM";
305  break;
306 
307  case HIS_ERROR_ABORT:
308  res = "HIS_ERROR_ABORT";
309  break;
310 
311  case HIS_ERROR_WRONGBOARDSELECT:
312  res = "HIS_ERROR_WRONGBOARDSELECT";
313  break;
314 
315  case HIS_ERROR_WRONG_CAMERA_MODE:
316  res = "HIS_ERROR_WRONG_CAMERA_MODE";
317  break;
318 
319  case HIS_ERROR_AVERAGED_LOST:
320  res = "HIS_ERROR_AVERAGED_LOST";
321  break;
322 
323  case HIS_ERROR_BAD_SORTING_PARAM:
324  res = "HIS_ERROR_BAD_SORTING_PARAM";
325  break;
326 
327  case HIS_ERROR_UNKNOWN_IP_MAC_NAME:
328  res = "HIS_ERROR_UNKNOWN_IP_MAC_NAME";
329  break;
330 
331  case HIS_ERROR_NO_BOARD_IN_SUBNET:
332  res = "HIS_ERROR_NO_BOARD_IN_SUBNET";
333  break;
334 
335  case HIS_ERROR_UNABLE_TO_OPEN_BOARD:
336  res = "HIS_ERROR_UNABLE_TO_OPEN_BOARD";
337  break;
338 
339  case HIS_ERROR_UNABLE_TO_CLOSE_BOARD:
340  res = "HIS_ERROR_UNABLE_TO_CLOSE_BOARD";
341  break;
342 
343  case HIS_ERROR_UNABLE_TO_ACCESS_DETECTOR_FLASH:
344  res = "HIS_ERROR_UNABLE_TO_ACCESS_DETECTOR_FLASH";
345  break;
346 
347  case HIS_ERROR_HEADER_TIMEOUT:
348  res = "HIS_ERROR_HEADER_TIMEOUT";
349  break;
350 
351  case HIS_ERROR_NO_PING_ACK:
352  res = "HIS_ERROR_NO_PING_ACK";
353  break;
354 
355  case HIS_ERROR_NR_OF_BOARDS_CHANGED:
356  res = "HIS_ERROR_NR_OF_BOARDS_CHANGED";
357  break;
358  }
359 
360  return res;
361 }

Here is the caller graph for this function:

void QxrdDetectorPerkinElmer::acquisitionInitError ( const char *  fn,
int  ln,
int  n 
)
private

Definition at line 1065 of file qxrddetectorperkinelmer.cpp.

References acquisitionError(), and QxrdDetector::criticalMessage().

Referenced by startDetector().

1066 {
1067  acquisitionError(fn, ln, n);
1068 
1069  criticalMessage("Detector Initialization Failed");
1070 }
void criticalMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
void acquisitionError(const char *fn, int ln, int n)

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDetectorPerkinElmer::acquisitionNSensorsError ( const char *  fn,
int  ln,
int  n 
)
private

Definition at line 1072 of file qxrddetectorperkinelmer.cpp.

References acquisitionError(), and QxrdDetector::criticalMessage().

Referenced by startDetector().

1073 {
1074  acquisitionError(fn, ln, n);
1075 
1076  criticalMessage("Detector Initialization Failed");
1077 }
void criticalMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
void acquisitionError(const char *fn, int ln, int n)

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDetectorPerkinElmer::beginAcquisition ( double  exposure)
protectedvirtual

Reimplemented from QxrdDetector.

Definition at line 897 of file qxrddetectorperkinelmer.cpp.

References QxrdDetector::beginAcquisition(), DEBUG_PERKINELMER, m_AcqDesc, m_Counter, m_PerkinElmer, m_StartupDelayed, QxrdDetector::printMessage(), qcepDebug(), and startupAcquisition().

898 {
899  if (QThread::currentThread() != thread()) {
900  QMetaObject::invokeMethod(this, "beginAcquisition", Qt::BlockingQueuedConnection, Q_ARG(double, exposure));
901  } else {
903 
904  if (m_StartupDelayed) {
906  printMessage("Delayed Acquisition Startup");
907  }
908 
910  m_StartupDelayed = 0;
911  }
912 
913  m_Counter.fetchAndStoreOrdered(0);
914 
916 
917  if (plugin && m_AcqDesc) {
919  printMessage("Reset frame counter");
920  }
921 
922  plugin -> Acquisition_ResetFrameCnt(m_AcqDesc);
923  }
924  }
925 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QSharedPointer< QxrdPerkinElmerPluginInterface > QxrdPerkinElmerPluginInterfacePtr
QxrdPerkinElmerPluginInterfaceWPtr m_PerkinElmer
virtual void beginAcquisition(double exposure)

Here is the call graph for this function:

bool QxrdDetectorPerkinElmer::checkPluginAvailable ( )
private

Definition at line 378 of file qxrddetectorperkinelmer.cpp.

References QxrdDetector::criticalMessage(), g_Application, and m_PerkinElmer.

Referenced by onBinningModeChanged(), onCameraGainChanged(), onEndFrame(), onEndFrameCallback(), onExposureTimeChanged(), startDetector(), and startupAcquisition().

379 {
380  QxrdApplication *app = qobject_cast<QxrdApplication*>(g_Application);
381 
382  if (app && m_PerkinElmer == NULL) {
383  m_PerkinElmer = app->perkinElmerPlugin();
384  }
385 
386  if (m_PerkinElmer == NULL) {
387  criticalMessage("No perkin elmer plugin available");
388  }
389 
390  return m_PerkinElmer;
391 }
void criticalMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QxrdPerkinElmerPluginInterfaceWPtr m_PerkinElmer
QcepApplication * g_Application

Here is the call graph for this function:

Here is the caller graph for this function:

QString QxrdDetectorPerkinElmer::detectorAddress ( ) const
int QxrdDetectorPerkinElmer::detectorNumber ( ) const
int QxrdDetectorPerkinElmer::detectorSubType ( ) const
void QxrdDetectorPerkinElmer::dumpHeaderInfo ( )
slot

Definition at line 1219 of file qxrddetectorperkinelmer.cpp.

References m_HwHeaderInfo, m_HwHeaderInfoEx, and QxrdDetector::printMessage().

1220 {
1221  printMessage(tr("Detector Header Info"));
1222  printMessage(tr("HeaderID %1 PROMID %2 Frame %3 Msec %4 Usec %5 Status %6")
1223  .arg(m_HwHeaderInfo.dwHeaderID)
1224  .arg(m_HwHeaderInfo.dwPROMID)
1225  .arg(m_HwHeaderInfoEx.wFrameCnt)
1226  .arg(m_HwHeaderInfoEx.wRealInttime_milliSec)
1227  .arg(m_HwHeaderInfoEx.wRealInttime_microSec)
1228  .arg(m_HwHeaderInfoEx.wStatus));
1229 
1230  printMessage(tr("Cmd1 %1 Cmd2 %2 Cmd3 %3 Cmd4 %4")
1231  .arg(m_HwHeaderInfoEx.wCommand1)
1232  .arg(m_HwHeaderInfoEx.wCommand2)
1233  .arg(m_HwHeaderInfoEx.wCommand3)
1234  .arg(m_HwHeaderInfoEx.wCommand4));
1235 }
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const

Here is the call graph for this function:

void QxrdDetectorPerkinElmer::endAcquisition ( )
protectedvirtual

Reimplemented from QxrdDetector.

Definition at line 927 of file qxrddetectorperkinelmer.cpp.

References QxrdDetector::endAcquisition().

928 {
929  if (QThread::currentThread() != thread()) {
930  QMetaObject::invokeMethod(this, "endAcquisition", Qt::BlockingQueuedConnection);
931  } else {
933  }
934 }
virtual void endAcquisition()

Here is the call graph for this function:

void QxrdDetectorPerkinElmer::onBinningModeChanged ( )
slot

Definition at line 776 of file qxrddetectorperkinelmer.cpp.

References acquisitionError(), QxrdDetectorThread::Binning1x1, QxrdDetectorThread::Binning2x2Average, QxrdDetectorThread::Binning2x2Summed, checkPluginAvailable(), QxrdDetector::isEnabled(), m_AcqDesc, QxrdDetector::m_Acquisition, m_HeaderID, m_PerkinElmer, and QxrdDetector::printMessage().

Referenced by startDetector().

777 {
778 // return;
779 
780  if (isEnabled() && checkPluginAvailable()) {
783 
784  if (plugin && acq) {
785  if (m_HeaderID == 14) {
786  int newMode = 1;
787 
788  switch (get_DetectorBinning()) {
790  newMode = 1;
791  break;
792 
794  newMode = 2 + 256;
795  break;
796 
798  newMode = 2 + 512;
799  break;
800  }
801 
802  printMessage(tr("Change binning mode to %1").arg(newMode));
803 
804  int nRet;
805  WORD binningMode = newMode;
806  WORD originalMode;
807 
808  // if (newMode == 1) {
809  // if (m_CameraType == 1) {
810  // newMode = 2;
811  // } else {
812  // newMode = 258;
813  // }
814  // }
815  if ((nRet=plugin->Acquisition_GetCameraBinningMode(m_AcqDesc, &originalMode)) != HIS_ALL_OK) {
816  acquisitionError(__FILE__, __LINE__, nRet);
817  return;
818  }
819 
820  printMessage(tr("Initial binning mode = %1").arg(originalMode));
821 
822  printMessage(tr("Setting binning mode = %1").arg(newMode));
823 
824  if ((nRet=plugin->Acquisition_SetCameraBinningMode(m_AcqDesc, newMode)) != HIS_ALL_OK) {
825  acquisitionError(__FILE__, __LINE__, nRet);
826  return;
827  }
828 
829  if ((nRet=plugin->Acquisition_GetCameraBinningMode(m_AcqDesc, &binningMode)) != HIS_ALL_OK) {
830  acquisitionError(__FILE__, __LINE__, nRet);
831  return;
832  }
833 
834  printMessage(tr("Binning mode was set to %1").arg(binningMode));
835 
836  if (binningMode <= 1) {
837  set_HBinning(1);
838  set_VBinning(1);
839  } else {
840  set_HBinning(2);
841  set_VBinning(2);
842  }
843  }
844  }
845  }
846 }
QSharedPointer< QxrdAcquisition > QxrdAcquisitionPtr
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QSharedPointer< QxrdPerkinElmerPluginInterface > QxrdPerkinElmerPluginInterfacePtr
QxrdAcquisitionWPtr m_Acquisition
Definition: qxrddetector.h:94
void acquisitionError(const char *fn, int ln, int n)
QxrdPerkinElmerPluginInterfaceWPtr m_PerkinElmer

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDetectorPerkinElmer::onCameraGainChanged ( )
slot

Definition at line 848 of file qxrddetectorperkinelmer.cpp.

References acquisitionError(), checkPluginAvailable(), QxrdDetector::isEnabled(), m_AcqDesc, QxrdDetector::m_Acquisition, m_CurrentGain, m_HeaderID, m_PerkinElmer, and QxrdDetector::printMessage().

Referenced by startDetector().

849 {
850  if (isEnabled() && checkPluginAvailable()) {
853 
854  if (acq && plugin) {
855  if (m_HeaderID >= 11) {
856  int newGain = get_DetectorGain();
857 
858  printMessage(tr("Camera Gain Changed to %1").arg(newGain));
859 
860  printMessage("Setting camera gain");
861 
862  int nRet;
863 
864  if (m_CurrentGain != get_DetectorGain()) {
865  if ((nRet=plugin->Acquisition_SetCameraGain(m_AcqDesc, get_DetectorGain())) != HIS_ALL_OK) {
866  acquisitionError(__FILE__, __LINE__, nRet);
867  return;
868  }
869  m_CurrentGain = get_DetectorGain();
870  }
871 
872  printMessage("Set camera gain");
873  }
874  }
875  }
876 }
QSharedPointer< QxrdAcquisition > QxrdAcquisitionPtr
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QSharedPointer< QxrdPerkinElmerPluginInterface > QxrdPerkinElmerPluginInterfacePtr
QxrdAcquisitionWPtr m_Acquisition
Definition: qxrddetector.h:94
void acquisitionError(const char *fn, int ln, int n)
QxrdPerkinElmerPluginInterfaceWPtr m_PerkinElmer

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDetectorPerkinElmer::onEndFrame ( int  counter,
unsigned int  n1,
unsigned int  n2 
)
slot

Definition at line 951 of file qxrddetectorperkinelmer.cpp.

References QcepAllocator::AllocateFromReserve, QxrdDetector::checkDetectorEnabled(), checkPluginAvailable(), DEBUG_PERKINELMERIDLING, QxrdDetector::enqueueAcquiredFrame(), QxrdDetector::m_Acquisition, m_Buffer, m_BufferIndex, m_BufferSize, m_Counter, m_Mutex, m_PerkinElmer, QcepAllocator::newInt16Image(), QxrdDetector::printMessage(), and qcepDebug().

Referenced by onEndFrameCallback().

952 {
953  // QTime tic;
954  // tic.start();
955 
959 
960  if (plugin && acq) {
962  get_NCols(), get_NRows(), this);
963 
964  // printf("allocator took %d msec\n", tic.restart());
965 
967  printMessage(tr("QxrdDetectorPerkinElmer::onEndFrame(%1,%2,%3)")
968  .arg(counter).arg(n1).arg(n2));
969  }
970 
971  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
972 
973  // if (get_Cancelling()) {
974  // set_Cancelling(false);
975  // return /*true*/;
976  // }
977 
978  long npixels = get_NRows()*get_NCols();
979 
980  unsigned short* frame = m_Buffer.data() + m_BufferIndex*npixels;
981 
982  DWORD /*actualFrame = n1,*/ actSecFrame = n2;
983 
984  // this->Acquisition_GetActFrame(m_AcqDesc, &actualFrame, &actSecFrame);
985  //
986  // if (n1 != actualFrame || n2 != actSecFrame) {
987  // printf("Lost frame, %d[%d], %d[%d]\n", n1, (int) actualFrame, n2, (int) actSecFrame);
988  // return;
989  // }
990 
991 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
992  int counter1 = m_Counter.load();
993 #else
994  int counter1 = m_Counter;
995 #endif
996 
997  if ((counter1 - counter) > 5) {
998  printMessage(tr("%1 frames behind [%2,%3], skipping")
999  .arg(counter1-counter).arg(counter).arg(counter1));
1000  return;
1001  }
1002 
1003  if (((actSecFrame-1)%m_BufferSize) != m_BufferIndex) {
1005  printMessage(tr("actSecFrame %1, m_BufferIndex %2")
1006  .arg(actSecFrame).arg(m_BufferIndex));
1007  }
1008  }
1009 
1010  quint16* current = (image ? image->data() : NULL);
1011  quint32 cksum = 0;
1012  double avg = 0;
1013 
1014  unsigned short *fp = frame;
1015 
1016  for (long i=0; i<npixels; i++) {
1017  unsigned short val = *fp++;
1018  cksum += val;
1019  avg += val;
1020  }
1021 
1022  if (current && frame) {
1023  ::memcpy(current, frame, npixels*sizeof(quint16));
1024  }
1025 
1026  // printf("Image copy took %d msec\n", tic.restart());
1027 
1028  // set_Average(avg/npixels);
1029 
1031  printMessage(tr("Frame checksum 0x%1, avg %2\n")
1032  .arg(cksum,8,16,QChar('0')).arg(avg/npixels));
1033 
1034  for (int f=0; f<m_BufferSize; f++) {
1035  unsigned short* fp = m_Buffer.data() + f*npixels;
1036 
1037  quint32 cksum = 0;
1038  double avg = 0;
1039 
1040  for (long i=0; i<npixels; i++) {
1041  unsigned short val = *fp++;
1042  cksum += val;
1043  avg += val;
1044  }
1045 
1046  printMessage(tr("Frame %1 checksum 0x%2, avg %3\n")
1047  .arg(f).arg(cksum,8,16,QChar('0')).arg(avg/npixels));
1048  }
1049  }
1050 
1051  m_BufferIndex = (m_BufferIndex+1)%m_BufferSize;
1052 
1053  // acquiredFrameAvailable(image);
1054 
1055  if (image) {
1056  image->set_ImageSequenceNumber(counter1);
1057  image->set_ImageNumber(n1);
1058  }
1059 
1060  enqueueAcquiredFrame(image);
1061  }
1062  }
1063 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QSharedPointer< QxrdAcquisition > QxrdAcquisitionPtr
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QSharedPointer< QxrdPerkinElmerPluginInterface > QxrdPerkinElmerPluginInterfacePtr
QxrdAcquisitionWPtr m_Acquisition
Definition: qxrddetector.h:94
bool checkDetectorEnabled()
void enqueueAcquiredFrame(QcepImageDataBasePtr img)
QxrdPerkinElmerPluginInterfaceWPtr m_PerkinElmer
static QcepInt16ImageDataPtr newInt16Image(AllocationStrategy strat, int width, int height, QcepObject *parent)
QSharedPointer< QcepInt16ImageData > QcepInt16ImageDataPtr

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDetectorPerkinElmer::onEndFrameCallback ( )
slot

Definition at line 1157 of file qxrddetectorperkinelmer.cpp.

References QxrdDetector::checkDetectorEnabled(), checkPluginAvailable(), m_AcqDesc, QxrdDetector::m_Acquisition, m_Counter, m_HwHeaderInfo, m_HwHeaderInfoEx, m_PerkinElmer, and onEndFrame().

Referenced by OnEndFrameCallback().

1158 {
1159 // QTime tic;
1160  // tic.start();
1164 
1165  if (plugin && acq) {
1166  QxrdSynchronizedAcquisitionPtr sync(acq->synchronizedAcquisition());
1167 
1168  if (sync) {
1169 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
1170  sync->acquiredFrameAvailable(m_Counter.load());
1171 #else
1172  sync->acquiredFrameAvailable(m_Counter);
1173 #endif
1174  }
1175 
1176  // printf("syncAcq->acquiredFrameAvailable took %d msec\n", tic.restart());
1177 
1178  DWORD actualFrame, actSecFrame;
1179 
1180  plugin->Acquisition_GetActFrame(m_AcqDesc, &actualFrame, &actSecFrame);
1181  plugin->Acquisition_GetLatestFrameHeader(m_AcqDesc, &m_HwHeaderInfo, &m_HwHeaderInfoEx);
1182 
1183  // printf("m_PerkinElmer->Acquisition_GetActFrame took %d msec\n", tic.restart());
1184 
1185  int counter = m_Counter.fetchAndAddOrdered(1) + 1;
1186 
1187  // printf("m_Counter.fetchAndAddOrdered took %d msec\n", tic.restart());
1188 
1189  onEndFrame(counter, actualFrame, actSecFrame);
1190  }
1191  }
1192 }
void onEndFrame(int counter, unsigned int n1, unsigned int n2)
QSharedPointer< QxrdAcquisition > QxrdAcquisitionPtr
QSharedPointer< QxrdPerkinElmerPluginInterface > QxrdPerkinElmerPluginInterfacePtr
QxrdAcquisitionWPtr m_Acquisition
Definition: qxrddetector.h:94
bool checkDetectorEnabled()
QSharedPointer< QxrdSynchronizedAcquisition > QxrdSynchronizedAcquisitionPtr
QxrdPerkinElmerPluginInterfaceWPtr m_PerkinElmer

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDetectorPerkinElmer::onExposureTimeChanged ( )
slot

Definition at line 741 of file qxrddetectorperkinelmer.cpp.

References acquisitionError(), checkPluginAvailable(), QxrdDetector::isEnabled(), m_AcqDesc, QxrdDetector::m_Acquisition, m_PerkinElmer, and QxrdDetector::printMessage().

Referenced by startDetector().

742 {
743  if (isEnabled() && checkPluginAvailable()) {
746 
747  if (plugin && acq) {
748  double newTime = acq->get_ExposureTime();
749 // if (newTime*1e6 < m_ReadoutTimes.value(0)) {
750 // printMessage(tr("Attempt to set exposure time less than minimum supported (%1 < %2)")
751 // .arg(newTime).arg(m_ReadoutTimes.value(0)/1e6));
752 
753 // newTime = m_ReadoutTimes.value(0)/1e6;
754 // }
755 
756  printMessage(tr("Exposure time changed to %1").arg(newTime));
757 
758  DWORD tmp = (int)(newTime*1e6);
759 
760  printMessage(tr("SetTimerSync %1").arg(tmp));
761 
762  int nRet;
763 
764  if ((nRet=plugin->Acquisition_SetTimerSync(m_AcqDesc, &tmp)) != HIS_ALL_OK) {
765  acquisitionError(__FILE__, __LINE__, nRet);
766  return;
767  }
768 
769  printMessage(tr("TimerSync = %1").arg(tmp));
770 
771 // acq->set_ExposureTime(tmp/1.0e6);
772  }
773  }
774 }
QSharedPointer< QxrdAcquisition > QxrdAcquisitionPtr
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QSharedPointer< QxrdPerkinElmerPluginInterface > QxrdPerkinElmerPluginInterfacePtr
QxrdAcquisitionWPtr m_Acquisition
Definition: qxrddetector.h:94
void acquisitionError(const char *fn, int ln, int n)
QxrdPerkinElmerPluginInterfaceWPtr m_PerkinElmer

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDetectorPerkinElmer::pullPropertiesfromProxy ( QxrdDetectorProxyPtr  proxy)
virtual

Reimplemented from QxrdDetector.

Definition at line 95 of file qxrddetectorperkinelmer.cpp.

References QxrdDetector::pullPropertiesfromProxy().

96 {
98 
99  if (proxy) {
100  set_DetectorNumber (proxy->property("detectorNumber").toInt());
101  set_DetectorSubType (proxy->property("detectorSubType").toInt());
102  set_DetectorAddress (proxy->property("detectorAddress").toString());
103  set_DetectorGain (proxy->property("detectorGain").toInt());
104  set_DetectorBinning (proxy->property("detectorBinning").toInt());
105  }
106 }
virtual void pullPropertiesfromProxy(QxrdDetectorProxyPtr proxy)

Here is the call graph for this function:

void QxrdDetectorPerkinElmer::pushDefaultsToProxy ( QxrdDetectorProxyPtr  proxy)
static

Definition at line 69 of file qxrddetectorperkinelmer.cpp.

References QxrdDetectorProxy::PEBinningProperty, QxrdDetectorProxy::PEDetNumProperty, QxrdDetectorProxy::PEGainProperty, QxrdDetectorThread::PerkinElmerDetector, QxrdDetectorProxy::PESubTypeProperty, QxrdDetector::pushDefaultsToProxy(), and QxrdDetectorProxy::StringProperty.

Referenced by QxrdDetectorThread::pushDefaultsToProxy().

70 {
72 
73  if (proxy) {
74  proxy->pushProperty(QxrdDetectorProxy::PEDetNumProperty, "detectorNumber", "PE Detector Number", 0);
75  proxy->pushProperty(QxrdDetectorProxy::PESubTypeProperty, "detectorSubType", "PE Detector Type", 0);
76  proxy->pushProperty(QxrdDetectorProxy::StringProperty, "detectorAddress", "PE Detector Address", "");
77  proxy->pushProperty(QxrdDetectorProxy::PEGainProperty, "detectorGain", "PE Detector Gain", 0);
78  proxy->pushProperty(QxrdDetectorProxy::PEBinningProperty, "detectorBinning", "PE Detector Binning", 0);
79  }
80 }
static void pushDefaultsToProxy(QxrdDetectorProxyPtr proxy, int detType)

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDetectorPerkinElmer::pushPropertiesToProxy ( QxrdDetectorProxyPtr  proxy)
virtual

Reimplemented from QxrdDetector.

Definition at line 82 of file qxrddetectorperkinelmer.cpp.

References QxrdDetectorProxy::PEBinningProperty, QxrdDetectorProxy::PEDetNumProperty, QxrdDetectorProxy::PEGainProperty, QxrdDetectorProxy::PESubTypeProperty, QxrdDetector::pushPropertiesToProxy(), and QxrdDetectorProxy::StringProperty.

83 {
85 
86  if (proxy) {
87  proxy->pushProperty(QxrdDetectorProxy::PEDetNumProperty, "detectorNumber", "PE Detector Number", get_DetectorNumber());
88  proxy->pushProperty(QxrdDetectorProxy::PESubTypeProperty, "detectorSubType", "PE Detector Type", get_DetectorSubType());
89  proxy->pushProperty(QxrdDetectorProxy::StringProperty, "detectorAddress", "PE Detector Address", get_DetectorAddress());
90  proxy->pushProperty(QxrdDetectorProxy::PEGainProperty, "detectorGain", "PE Detector Gain", get_DetectorGain());
91  proxy->pushProperty(QxrdDetectorProxy::PEBinningProperty, "detectorBinning", "PE Detector Binning", get_DetectorBinning());
92  }
93 }
virtual void pushPropertiesToProxy(QxrdDetectorProxyPtr proxy)

Here is the call graph for this function:

void QxrdDetectorPerkinElmer::shutdownAcquisition ( )
protectedvirtual

Reimplemented from QxrdDetector.

Definition at line 936 of file qxrddetectorperkinelmer.cpp.

References m_AcqDesc, m_PerkinElmer, and QxrdDetector::shutdownAcquisition().

937 {
938  if (QThread::currentThread() != thread()) {
939  QMetaObject::invokeMethod(this, "shutdownAcquisition", Qt::BlockingQueuedConnection);
940  } else {
942 
944 
945  if (plugin && m_AcqDesc) {
946  plugin->Acquisition_Abort(m_AcqDesc);
947  }
948  }
949 }
QSharedPointer< QxrdPerkinElmerPluginInterface > QxrdPerkinElmerPluginInterfacePtr
QxrdPerkinElmerPluginInterfaceWPtr m_PerkinElmer
virtual void shutdownAcquisition()

Here is the call graph for this function:

void QxrdDetectorPerkinElmer::startDetector ( )
slot

Definition at line 419 of file qxrddetectorperkinelmer.cpp.

References ACQDATATYPE, acquisitionError(), acquisitionInitError(), acquisitionNSensorsError(), QxrdDetector::checkDetectorEnabled(), checkPluginAvailable(), QxrdDetector::criticalMessage(), DEBUG_DELAY_ACQ, DEBUG_PERKINELMER, FALSE, QxrdDetectorThread::GBIF_IP_SubType, QxrdDetectorThread::GBIF_MAC_SubType, QxrdDetectorThread::GBIF_Name_SubType, QxrdDetectorThread::GBIF_Scan_SubType, m_AcqDesc, QxrdDetector::m_Acquisition, m_Buffer, m_BufferIndex, m_BufferSize, m_CameraType, QxrdDetector::m_Experiment, m_HeaderID, m_PerkinElmer, m_PROMID, m_ReadoutTimes, m_StartupDelayed, m_SyncMode, onBinningModeChanged(), onCameraGainChanged(), OnEndAcqCallback(), OnEndFrameCallback(), onExposureTimeChanged(), QxrdDetectorThread::PCI_SubType, QxrdDetector::printMessage(), qcepDebug(), QxrdDetector::startDetector(), startupAcquisition(), and THREAD_CHECK.

420 {
421  if (QThread::currentThread() != thread()) {
422  QMetaObject::invokeMethod(this, "startDetector"/*, Qt::BlockingQueuedConnection*/);
423  } else {
425  printMessage(tr("QxrdAcquisitionPerkinElmer::start"));
426  }
427 
429 
431  THREAD_CHECK;
432 
433  int nRet = HIS_ALL_OK;
434  UINT nSensors;
435  BOOL bEnableIRQ = true;
436  BOOL bSelfInit = true;
437  BOOL bAlwaysOpen = true;
438  ACQDESCPOS Pos = 0;
439  UINT nChannelType;
440  int nChannelNr;
441  UINT dwSortFlags, dwDataType, dwRows, dwColumns, dwFrames;
442  DWORD dwAcqType, dwSystemID, dwSyncMode, dwHwAccess;
443  WORD binningMode;
444 
446 
447  // if (exp) {
448  // m_DetectorNumber = exp->get_DetectorNumber();
449  // m_SubType = exp->get_DetectorSubType();
450  // m_Address = exp->get_DetectorAddress();
451  // }
452 
454 
455  int subType = get_DetectorSubType();
456 
457  if (subType == QxrdDetectorThread::PCI_SubType) {
458  printMessage("Initialising PCI/PCIe Perkin Elmer Detector");
459 
460  if (plugin) {
461  nRet = plugin->Acquisition_EnumSensors(&nSensors, bEnableIRQ, FALSE);
462  }
463 
465  printMessage(tr("Acquisition_EnumSensors = %1").arg(nRet));
466  }
467 
468  if (nRet != HIS_ALL_OK) {
469  acquisitionInitError(__FILE__, __LINE__, nRet);
470  return;
471  }
472 
474  printMessage(tr("Number of sensors = %1").arg(nSensors));
475  }
476 
477  if (get_DetectorNumber() == 0 && nSensors != 1) {
478  acquisitionNSensorsError(__FILE__, __LINE__, nRet);
479  return;
480  } else if (get_DetectorNumber() < 0 || get_DetectorNumber() > nSensors) {
481  acquisitionNSensorsError(__FILE__, __LINE__, nRet);
482  return;
483  }
484 
485  for (int i=1; i<=(get_DetectorNumber() ? get_DetectorNumber() : 1); i++) {
486  if (plugin && (nRet = plugin->Acquisition_GetNextSensor(&Pos, &m_AcqDesc))!=HIS_ALL_OK) {
487  acquisitionNSensorsError(__FILE__, __LINE__, nRet);
488  return;
489  }
490  }
491  } else if (subType == QxrdDetectorThread::GBIF_IP_SubType) {
492  printMessage(tr("Attempting to connect to Perkin Elmer detector on the network at IP Address %1")
493  .arg(get_DetectorAddress()));
494 
495  if (plugin && (nRet = plugin->Acquisition_GbIF_Init(&m_AcqDesc, 0, bEnableIRQ,
496  1024, 1024, bSelfInit,
497  bAlwaysOpen, 1,
498  (GBIF_STRING_DATATYPE*) qPrintable(get_DetectorAddress()))) != HIS_ALL_OK) {
499  acquisitionInitError(__FILE__, __LINE__, nRet);
500  return;
501  }
502  } else if (subType == QxrdDetectorThread::GBIF_MAC_SubType) {
503  printMessage(tr("Attempting to connect to Perkin Elmer detector on the network at MAC address %1").arg(get_DetectorAddress()));
504 
505  if (plugin && (nRet = plugin->Acquisition_GbIF_Init(&m_AcqDesc, 0, bEnableIRQ,
506  1024, 1024, bSelfInit,
507  bAlwaysOpen, 2,
508  (GBIF_STRING_DATATYPE*) qPrintable(get_DetectorAddress()))) != HIS_ALL_OK) {
509  acquisitionInitError(__FILE__, __LINE__, nRet);
510  return;
511  }
512  } else if (subType == QxrdDetectorThread::GBIF_Name_SubType) {
513  printMessage(tr("Attempting to connect to Perkin Elmer detector on the network at device name %1").arg(get_DetectorAddress()));
514 
515  if (plugin && (nRet = plugin->Acquisition_GbIF_Init(&m_AcqDesc, 0, bEnableIRQ,
516  1024, 1024, bSelfInit,
517  bAlwaysOpen, 3,
518  (GBIF_STRING_DATATYPE*) qPrintable(get_DetectorAddress()))) != HIS_ALL_OK) {
519  acquisitionInitError(__FILE__, __LINE__, nRet);
520  return;
521  }
522  } else if (subType == QxrdDetectorThread::GBIF_Scan_SubType) {
523  printMessage("Searching for Perkin Elmer Detectors on the network");
524 
525  long nBoards=0;
526 
527  if (plugin && (nRet = plugin->Acquisition_GbIF_GetDeviceCnt(&nBoards)) != HIS_ALL_OK) {
528  acquisitionNSensorsError(__FILE__, __LINE__, nRet);
529  return;
530  }
531 
532  QVector<GBIF_DEVICE_PARAM> devs(nBoards);
533 
534  if (plugin && (nRet = plugin->Acquisition_GbIF_GetDeviceList(devs.data(), nBoards))) {
535  acquisitionNSensorsError(__FILE__, __LINE__, nRet);
536  return;
537  }
538 
539  printMessage(tr("Found %1 Detectors").arg(nBoards));
540 
541  if (nBoards == 0) {
542  criticalMessage("No detectors found");
543  return;
544  }
545 
546  for (int i=0; i<nBoards; i++) {
547  printMessage(tr("Device %1: %2 found at IP: %3, MAC: %4, Name: %5")
548  .arg(i+1)
549  .arg(devs[i].cModelName)
550  .arg((char*)(devs[i].ucIP))
551  .arg((char*)(devs[i].ucMacAddress))
552  .arg(devs[i].cDeviceName));
553  }
554 
555  if (get_DetectorNumber() >= 0 && get_DetectorNumber() <= nBoards) {
556  int n = (get_DetectorNumber() ? get_DetectorNumber() : 1);
557 
558  if (plugin && (nRet = plugin->Acquisition_GbIF_Init(&m_AcqDesc, 0, bEnableIRQ,
559  1024, 1024, bSelfInit,
560  bAlwaysOpen, 1,
561  devs[n-1].ucIP)) != HIS_ALL_OK) {
562  acquisitionInitError(__FILE__, __LINE__, nRet);
563  return;
564  }
565  }
566  } else {
567  criticalMessage(tr("Unrecognized detector type %1").arg(subType));
568  return;
569  }
570 
571  if (plugin && (nRet = plugin->Acquisition_GetCommChannel(m_AcqDesc, &nChannelType, &nChannelNr))!=HIS_ALL_OK) {
572  acquisitionError(__FILE__, __LINE__, nRet);
573  return;
574  }
575 
577  printMessage(tr("Acquisition_GetCommChannel channel type = %1, channel no = %2")
578  .arg(nChannelType).arg(nChannelNr));
579  }
580 
581  if (plugin && (nRet=plugin->Acquisition_GetConfiguration(m_AcqDesc, &dwFrames, &dwRows, &dwColumns, &dwDataType,
582  &dwSortFlags, &bEnableIRQ, &dwAcqType,
583  &dwSystemID, &dwSyncMode, &dwHwAccess))!=HIS_ALL_OK) {
584  acquisitionError(__FILE__, __LINE__, nRet);
585  return;
586  }
587 
589  printMessage(tr("Acquisition_GetConfiguration frames = %1, rows = %2, cols = %3")
590  .arg(dwFrames).arg(dwRows).arg(dwColumns));
591  printMessage(tr("Acquisition_GetConfiguration data type = %1, sort flags = %2, IRQ = %3")
592  .arg(dwDataType).arg(dwSortFlags).arg(bEnableIRQ));
593  printMessage(tr("Acquisition_GetConfiguration acq type = %1, systemID = %2, syncMode = %3, hwAccess = %4")
594  .arg(dwAcqType).arg(dwSystemID).arg(dwSyncMode).arg(dwHwAccess));
595  }
596 
598 
599  if (acq) {
600  set_NRows(dwRows);
601  set_NCols(dwColumns);
602  }
603 
604  if (plugin && (nRet=plugin->Acquisition_GetCameraBinningMode(m_AcqDesc, &binningMode)) != HIS_ALL_OK) {
605  acquisitionError(__FILE__, __LINE__, nRet);
606  return;
607  }
608 
610  printMessage(tr("Acquisition_GetCameraBinningMode mode = %1").arg(binningMode));
611  }
612 
613  CHwHeaderInfo hwHeaderInfo;
614 
615  if (plugin && (nRet=plugin->Acquisition_GetHwHeaderInfo(m_AcqDesc, &hwHeaderInfo)) != HIS_ALL_OK) {
616  acquisitionError(__FILE__, __LINE__, nRet);
617  return;
618  }
619 
621  printMessage(tr("Prom ID %1, Header ID %2").arg(hwHeaderInfo.dwPROMID).arg(hwHeaderInfo.dwHeaderID));
622  }
623 
624  m_PROMID = hwHeaderInfo.dwPROMID;
625  m_HeaderID = hwHeaderInfo.dwHeaderID;
626 
627  if (hwHeaderInfo.dwHeaderID >= 14) {
628  CHwHeaderInfoEx hdrx;
629 
630  if (plugin && (nRet = plugin->Acquisition_GetHwHeaderInfoEx(m_AcqDesc, &hwHeaderInfo, &hdrx)) != HIS_ALL_OK) {
631  acquisitionError(__FILE__, __LINE__, nRet);
632  return;
633  }
634 
636  printMessage(tr("Camera Type %1").arg(hdrx.wCameratype));
637  printMessage(tr("Binning Mode %1").arg(hdrx.wBinningMode));
638  }
639 
640  m_CameraType = hdrx.wCameratype;
641  }
642 
643  int nReadoutTimes = 8;
644  double readoutTimes[8];
645 
646  if (plugin && (nRet = plugin->Acquisition_GetIntTimes(m_AcqDesc, readoutTimes, &nReadoutTimes)) != HIS_ALL_OK) {
647  acquisitionError(__FILE__, __LINE__, nRet);
648  return;
649  }
650 
651  for (int i=0; i<nReadoutTimes; i++) {
652  m_ReadoutTimes.append(readoutTimes[i]);
653  }
654 
656  printMessage(tr("%1 predefined exposure times available").arg(m_ReadoutTimes.count()));
657 
658  for (int i=0; i<nReadoutTimes; i++) {
659  printMessage(tr("Exp %1 = %2").arg(i).arg(m_ReadoutTimes[i]));
660  }
661  }
662 
663  if (plugin && (nRet = plugin->Acquisition_SetAcqData(m_AcqDesc, (ACQDATATYPE) this)) != HIS_ALL_OK) {
664  acquisitionError(__FILE__, __LINE__, nRet);
665  return;
666  }
667 
668  if (plugin && (nRet = plugin->Acquisition_SetCallbacksAndMessages(m_AcqDesc, NULL, 0,
669  0, OnEndFrameCallback, OnEndAcqCallback))!=HIS_ALL_OK) {
670  acquisitionError(__FILE__, __LINE__, nRet);
671  return;
672  }
673 
674  m_BufferSize = 4;
675  m_BufferIndex = 0;
676 
677  if (acq) {
678  m_Buffer.resize(get_NRows()*get_NCols()*m_BufferSize);
679  m_Buffer.fill(0);
680 
682  printMessage(tr("Exposure Time = %1").arg(acq->get_ExposureTime()));
683  }
684  }
685 
687  printMessage(tr("SetFrameSyncMode HIS_SYNCMODE_INTERNAL_TIMER"));
688  }
689 
690  if (plugin && (nRet=plugin->Acquisition_SetFrameSyncMode(m_AcqDesc, HIS_SYNCMODE_INTERNAL_TIMER)) != HIS_ALL_OK) {
691  if (plugin && (nRet=plugin->Acquisition_SetFrameSyncMode(m_AcqDesc, HIS_SYNCMODE_FREE_RUNNING)) != HIS_ALL_OK) {
692  acquisitionError(__FILE__, __LINE__, nRet);
693  return;
694  } else {
695  m_SyncMode = HIS_SYNCMODE_FREE_RUNNING;
696  }
697  } else {
698  m_SyncMode = HIS_SYNCMODE_INTERNAL_TIMER;
699  }
700 
702  printMessage(tr("Sync Mode = %1").arg(m_SyncMode));
703  }
704 
705  if (acq) {
707 
709 
710  if (acq->get_ExposureTime() <= 0) {
711  acq->set_ExposureTime(0.135);
712  }
713 
715 
716  if (plugin && (nRet=plugin->Acquisition_DefineDestBuffers(m_AcqDesc, m_Buffer.data(), m_BufferSize,
717  get_NRows(), get_NCols())) != HIS_ALL_OK) {
718  acquisitionError(__FILE__, __LINE__, nRet);
719  return;
720  }
721  }
722 
724  printMessage(tr("Define Dest Buffers"));
725  }
726 
727  if (qcepDebug(DEBUG_DELAY_ACQ)) {
728  m_StartupDelayed = 1;
729  } else {
731  }
732  }
733  }
734 }
QSharedPointer< QxrdExperiment > QxrdExperimentPtr
QxrdExperimentWPtr m_Experiment
Definition: qxrddetector.h:93
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void criticalMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QSharedPointer< QxrdAcquisition > QxrdAcquisitionPtr
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QSharedPointer< QxrdPerkinElmerPluginInterface > QxrdPerkinElmerPluginInterfacePtr
static void CALLBACK OnEndAcqCallback(HACQDESC hAcqDesc)
void acquisitionNSensorsError(const char *fn, int ln, int n)
QxrdAcquisitionWPtr m_Acquisition
Definition: qxrddetector.h:94
#define FALSE
Definition: triangulate.c:3
bool checkDetectorEnabled()
static void CALLBACK OnEndFrameCallback(HACQDESC hAcqDesc)
virtual void startDetector()
void acquisitionInitError(const char *fn, int ln, int n)
void acquisitionError(const char *fn, int ln, int n)
#define THREAD_CHECK
Definition: qcepmacros.h:11
QxrdPerkinElmerPluginInterfaceWPtr m_PerkinElmer
#define ACQDATATYPE

Here is the call graph for this function:

void QxrdDetectorPerkinElmer::startupAcquisition ( )
private

Definition at line 878 of file qxrddetectorperkinelmer.cpp.

References acquisitionError(), QxrdDetector::checkDetectorEnabled(), checkPluginAvailable(), DEBUG_PERKINELMER, m_AcqDesc, m_BufferSize, m_PerkinElmer, QxrdDetector::printMessage(), and qcepDebug().

Referenced by beginAcquisition(), and startDetector().

879 {
882 
883  int nRet;
884 
885  if (plugin && (nRet=plugin->Acquisition_Acquire_Image(m_AcqDesc, m_BufferSize,
886  0, HIS_SEQ_CONTINUOUS, NULL, NULL, NULL)) != HIS_ALL_OK) {
887  acquisitionError(__FILE__, __LINE__, nRet);
888  return;
889  }
890 
892  printMessage("Acquire");
893  }
894  }
895 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QSharedPointer< QxrdPerkinElmerPluginInterface > QxrdPerkinElmerPluginInterfacePtr
bool checkDetectorEnabled()
void acquisitionError(const char *fn, int ln, int n)
QxrdPerkinElmerPluginInterfaceWPtr m_PerkinElmer

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDetectorPerkinElmer::stopDetector ( )
slot

Definition at line 736 of file qxrddetectorperkinelmer.cpp.

References QxrdDetector::printMessage().

737 {
738  printMessage(tr("Stopping Perkin Elmer Detector %1").arg(get_DetectorName()));
739 }
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const

Here is the call graph for this function:

Member Data Documentation

HACQDESC QxrdDetectorPerkinElmer::m_AcqDesc
private
QVector<quint16> QxrdDetectorPerkinElmer::m_Buffer
private

Definition at line 66 of file qxrddetectorperkinelmer.h.

Referenced by onEndFrame(), and startDetector().

int QxrdDetectorPerkinElmer::m_BufferIndex
private

Definition at line 65 of file qxrddetectorperkinelmer.h.

Referenced by onEndFrame(), and startDetector().

int QxrdDetectorPerkinElmer::m_BufferSize
private

Definition at line 64 of file qxrddetectorperkinelmer.h.

Referenced by onEndFrame(), startDetector(), and startupAcquisition().

QString QxrdDetectorPerkinElmer::m_CameraModel
private

Definition at line 75 of file qxrddetectorperkinelmer.h.

int QxrdDetectorPerkinElmer::m_CameraType
private

Definition at line 74 of file qxrddetectorperkinelmer.h.

Referenced by startDetector().

QAtomicInt QxrdDetectorPerkinElmer::m_Counter
private

Definition at line 79 of file qxrddetectorperkinelmer.h.

Referenced by beginAcquisition(), onEndFrame(), and onEndFrameCallback().

int QxrdDetectorPerkinElmer::m_CurrentGain
private

Definition at line 76 of file qxrddetectorperkinelmer.h.

Referenced by onCameraGainChanged().

int QxrdDetectorPerkinElmer::m_HeaderID
private
CHwHeaderInfo QxrdDetectorPerkinElmer::m_HwHeaderInfo
private

Definition at line 81 of file qxrddetectorperkinelmer.h.

Referenced by dumpHeaderInfo(), and onEndFrameCallback().

CHwHeaderInfoEx QxrdDetectorPerkinElmer::m_HwHeaderInfoEx
private

Definition at line 82 of file qxrddetectorperkinelmer.h.

Referenced by dumpHeaderInfo(), and onEndFrameCallback().

QMutex QxrdDetectorPerkinElmer::m_Mutex
mutableprivate

Definition at line 63 of file qxrddetectorperkinelmer.h.

Referenced by onEndFrame().

QxrdPerkinElmerPluginInterfaceWPtr QxrdDetectorPerkinElmer::m_PerkinElmer
private
int QxrdDetectorPerkinElmer::m_PROMID
private

Definition at line 72 of file qxrddetectorperkinelmer.h.

Referenced by startDetector().

QVector<double> QxrdDetectorPerkinElmer::m_ReadoutTimes
private

Definition at line 67 of file qxrddetectorperkinelmer.h.

Referenced by startDetector().

int QxrdDetectorPerkinElmer::m_StartupDelayed
private

Definition at line 70 of file qxrddetectorperkinelmer.h.

Referenced by beginAcquisition(), and startDetector().

int QxrdDetectorPerkinElmer::m_SyncMode
private

Definition at line 77 of file qxrddetectorperkinelmer.h.

Referenced by startDetector().

Property Documentation

QString QxrdDetectorPerkinElmer::detectorAddress
readwrite

Definition at line 93 of file qxrddetectorperkinelmer.h.

int QxrdDetectorPerkinElmer::detectorBinning
readwrite

Definition at line 99 of file qxrddetectorperkinelmer.h.

int QxrdDetectorPerkinElmer::detectorGain
readwrite

Definition at line 96 of file qxrddetectorperkinelmer.h.

int QxrdDetectorPerkinElmer::detectorNumber
readwrite

Definition at line 87 of file qxrddetectorperkinelmer.h.

int QxrdDetectorPerkinElmer::detectorSubType
readwrite

Definition at line 90 of file qxrddetectorperkinelmer.h.


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