#include <qxrddetectorpilatus.h>
|
| QxrdDetectorPilatus (QcepSettingsSaverWPtr saver, QxrdExperimentWPtr expt, QxrdAcquisitionWPtr acq, int detNum, QcepObject *parent) |
|
virtual | ~QxrdDetectorPilatus () |
|
void | pushPropertiesToProxy (QxrdDetectorProxyPtr proxy) |
|
void | pullPropertiesfromProxy (QxrdDetectorProxyPtr proxy) |
|
| 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) |
|
| QcepObject (QString name, QcepObject *parent) |
|
virtual | ~QcepObject () |
|
QString | get_Name () const |
|
void | set_Name (QString name) |
|
Definition at line 9 of file qxrddetectorpilatus.h.
Definition at line 15 of file qxrddetectorpilatus.cpp.
References DEBUG_CONSTRUCTORS, and qcepDebug().
26 m_PilatusHost (saver,
this,
"pilatusHost",
"s11id-pilatus",
"Host Address of Computer running Camserver"),
27 m_PilatusPort (saver,
this,
"pilatusPort", 41234,
"Camserver Port Number"),
28 m_PilatusUser (saver,
this,
"pilatusUser",
"det",
"Camserver User Name"),
29 m_PilatusSSH (saver,
this,
"pilatusSSH",
"ssh",
"ssh command path"),
30 m_PilatusSCP (saver,
this,
"pilatusSCP",
"scp",
"scp command path"),
31 m_PilatusDataDirectory (saver,
this,
"pilatusDataDirectory",
"/home/det/shareddata/test/",
"Data directory on Camserver computer"),
32 m_ReadFilesLocally (saver,
this,
"readFilesLocally",
true,
"Attempt to read acquired files into QXRD for further processing"),
33 m_DeleteFilesAfterReading(saver,
this,
"deleteFilesAfterReading",
false,
"Delete files from Camserver computer after reading"),
34 m_ExposureMode (saver,
this,
"exposureMode", 0,
"Pilatus Exposure Mode = (0:No Trigger, 1:ExtTrigger, 2:ExtEnable"),
35 m_EnableFrequency (saver,
this,
"enableFrequency", 1000,
"Frequency of ext enable signal"),
36 m_PilatusExtension (saver,
this,
"pilatusExtension",
"cbf",
"File format to be used by camserver")
39 printf(
"QxrdDetectorPilatus::QxrdDetectorPilatus(%p)\n",
this);
qint64 qcepDebug(int cond)
QxrdDetector(QcepSettingsSaverWPtr saver, QxrdExperimentWPtr expt, QxrdAcquisitionWPtr acq, int detType, int detNum, QcepObject *parent)
QxrdDetectorPilatusRemotePtr m_Remote
QTcpSocket m_PilatusSocket
QxrdDetectorPilatus::~QxrdDetectorPilatus |
( |
| ) |
|
|
virtual |
void QxrdDetectorPilatus::beginAcquisition |
( |
double |
exposure | ) |
|
|
slot |
Definition at line 93 of file qxrddetectorpilatus.cpp.
References QxrdDetector::beginAcquisition(), beginExposure(), DEBUG_PILATUS, imagePath(), QxrdDetector::printMessage(), and qcepDebug().
95 if (QThread::currentThread() != thread()) {
96 QMetaObject::invokeMethod(
this,
"beginAcquisition", Qt::BlockingQueuedConnection, Q_ARG(
double, exposure));
101 printMessage(tr(
"QxrdDetectorPilatus::beginAcquisition(%1)").arg(exposure));
qint64 qcepDebug(int cond)
void imagePath(QString path)
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
void beginExposure(double exposure)
virtual void beginAcquisition(double exposure)
void QxrdDetectorPilatus::beginExposure |
( |
double |
exposure | ) |
|
|
private |
void QxrdDetectorPilatus::beginFrame |
( |
| ) |
|
|
slot |
void QxrdDetectorPilatus::endAcquisition |
( |
| ) |
|
|
slot |
void QxrdDetectorPilatus::executeCommand |
( |
QString |
cmd | ) |
|
|
slot |
Definition at line 128 of file qxrddetectorpilatus.cpp.
References sendCommand().
130 if (QThread::currentThread() != thread()) {
131 QMetaObject::invokeMethod(
this,
"executeCommand", Qt::BlockingQueuedConnection, Q_ARG(QString, cmd));
void sendCommand(QString cmd)
void QxrdDetectorPilatus::expose |
( |
| ) |
|
|
private |
void QxrdDetectorPilatus::imagePath |
( |
QString |
path | ) |
|
|
private |
void QxrdDetectorPilatus::interpretReply |
( |
QString |
reply | ) |
|
|
private |
Definition at line 257 of file qxrddetectorpilatus.cpp.
References QxrdDetector::criticalMessage(), DEBUG_PILATUS, QxrdDetector::enqueueAcquiredFrame(), loadAndPush(), m_CurrentFile, QxrdDetector::printMessage(), qcepDebug(), remoteCopy(), and remoteDelete().
Referenced by readyRead().
260 printMessage(tr(
"QxrdDetectorPilatus::interpretReply(\"%1\")").arg(reply));
263 if (reply.startsWith(
"1 ERR")) {
265 }
else if (reply.startsWith(
"7 OK")) {
266 if (get_ReadFilesLocally() ==
false) {
273 if (get_DeleteFilesAfterReading()) {
277 }
else if (reply.startsWith(
"Image format:")) {
278 QRegExp matcher(
"Image format\\: (\\d+)\\(w\\) x (\\d+)\\(h\\) pixels(.*)");
280 if (matcher.exactMatch(reply)) {
281 int width = matcher.cap(1).toInt();
282 int height = matcher.cap(2).toInt();
284 printMessage(tr(
"Detector dimensions %1 cols x %2 rows").arg(width).arg(height));
291 printMessage(tr(
"Unmatched: %1, %2").arg(reply).arg(matcher.pattern()));
292 printMessage(tr(
"Matched Length %1").arg(matcher.matchedLength()));
qint64 qcepDebug(int cond)
void criticalMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
void enqueueAcquiredFrame(QcepImageDataBasePtr img)
void loadAndPush(QString f)
void remoteCopy(QString file)
QSharedPointer< QcepInt16ImageData > QcepInt16ImageDataPtr
void remoteDelete(QString file)
void QxrdDetectorPilatus::loadAndPush |
( |
QString |
f | ) |
|
|
private |
Reimplemented from QxrdDetector.
Definition at line 335 of file qxrddetectorpilatus.cpp.
References QxrdDetector::pullPropertiesfromProxy().
340 set_PilatusHost (proxy->property(
"pilatusHost").toString());
341 set_PilatusUser (proxy->property(
"pilatusUser").toString());
342 set_PilatusSSH (proxy->property(
"pilatusSSH").toString());
343 set_PilatusSCP (proxy->property(
"pilatusSCP").toString());
344 set_PilatusDataDirectory (proxy->property(
"pilatusDataDirectory").toString());
345 set_ReadFilesLocally (proxy->property(
"readFilesLocally").toBool());
346 set_DeleteFilesAfterReading(proxy->property(
"deleteFilesAfterReading").toBool());
347 set_PilatusExtension (proxy->property(
"pilatusExtension").toString());
348 set_ExposureMode (proxy->property(
"exposureMode").toInt());
349 set_EnableFrequency (proxy->property(
"enableFrequency").toDouble());
virtual void pullPropertiesfromProxy(QxrdDetectorProxyPtr proxy)
Definition at line 297 of file qxrddetectorpilatus.cpp.
References QxrdDetectorProxy::BooleanProperty, QxrdDetectorProxy::DirectoryProperty, QxrdDetectorProxy::DoubleProperty, QxrdDetectorProxy::ExtensionProperty, QxrdDetectorProxy::FilenameProperty, QxrdDetectorProxy::FixedIntegerProperty, QxrdDetectorThread::PilatusDetector, QxrdDetectorProxy::PilatusModeProperty, QxrdDetector::pushDefaultsToProxy(), and QxrdDetectorProxy::StringProperty.
Referenced by QxrdDetectorThread::pushDefaultsToProxy().
static void pushDefaultsToProxy(QxrdDetectorProxyPtr proxy, int detType)
Reimplemented from QxrdDetector.
Definition at line 316 of file qxrddetectorpilatus.cpp.
References QxrdDetectorProxy::BooleanProperty, QxrdDetectorProxy::DirectoryProperty, QxrdDetectorProxy::DoubleProperty, QxrdDetectorProxy::ExtensionProperty, QxrdDetectorProxy::FilenameProperty, QxrdDetectorProxy::FixedIntegerProperty, QxrdDetectorProxy::PilatusModeProperty, QxrdDetector::pushPropertiesToProxy(), and QxrdDetectorProxy::StringProperty.
327 proxy->pushProperty(
QxrdDetectorProxy::BooleanProperty,
"readFilesLocally",
"Attempt to read acquired files into QXRD for further processing", get_ReadFilesLocally());
virtual void pushPropertiesToProxy(QxrdDetectorProxyPtr proxy)
void QxrdDetectorPilatus::readyRead |
( |
| ) |
|
|
private |
void QxrdDetectorPilatus::remoteCommand |
( |
QString |
cmd | ) |
|
|
slot |
Definition at line 364 of file qxrddetectorpilatus.cpp.
References m_Remote.
Referenced by remoteTransfer().
366 if (QThread::currentThread() != thread()) {
367 QMetaObject::invokeMethod(
this,
"remoteCommand", Q_ARG(QString, cmd));
QxrdDetectorPilatusRemotePtr m_Remote
void QxrdDetectorPilatus::remoteConnect |
( |
QString |
sshCmd | ) |
|
|
slot |
Definition at line 353 of file qxrddetectorpilatus.cpp.
References m_Remote.
355 if (QThread::currentThread() != thread()) {
356 QMetaObject::invokeMethod(
this,
"remoteConnect", Q_ARG(QString, sshCmd));
QxrdDetectorPilatusRemotePtr m_Remote
void QxrdDetectorPilatus::remoteCopy |
( |
QString |
file | ) |
|
|
slot |
Definition at line 394 of file qxrddetectorpilatus.cpp.
References DEBUG_PILATUS, QxrdDetector::m_Experiment, QxrdDetector::printMessage(), and qcepDebug().
Referenced by interpretReply().
402 QString dest = proc->filePathInRawOutputDirectory(file);
404 QString cmd = tr(
"%1 -o ForwardX11=No %2@%3:%4/%5 %6")
405 .arg(get_PilatusSCP())
406 .arg(get_PilatusUser())
407 .arg(get_PilatusHost())
408 .arg(get_PilatusDataDirectory()).arg(file)
415 int rc = QProcess::execute(cmd);
QSharedPointer< QxrdExperiment > QxrdExperimentPtr
QxrdExperimentWPtr m_Experiment
qint64 qcepDebug(int cond)
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
void QxrdDetectorPilatus::remoteDelete |
( |
QString |
file | ) |
|
|
slot |
Definition at line 375 of file qxrddetectorpilatus.cpp.
References DEBUG_PILATUS, QxrdDetector::printMessage(), and qcepDebug().
Referenced by interpretReply().
377 QString cmd = tr(
"%1 -o ForwardX11=No %2@%3 rm %4/%5")
378 .arg(get_PilatusSSH())
379 .arg(get_PilatusUser())
380 .arg(get_PilatusHost())
381 .arg(get_PilatusDataDirectory()).arg(file);
387 int rc = QProcess::execute(cmd);
qint64 qcepDebug(int cond)
void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()) const
void QxrdDetectorPilatus::remoteTransfer |
( |
QString |
file | ) |
|
|
slot |
Definition at line 424 of file qxrddetectorpilatus.cpp.
References QxrdDetector::m_Experiment, and remoteCommand().
434 QString dest = proc->filePathInRawOutputDirectory(file);
436 remoteCommand(tr(
"echo -n transfer: ; ls -la %1").arg(file));
QSharedPointer< QxrdExperiment > QxrdExperimentPtr
QxrdExperimentWPtr m_Experiment
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
void remoteCommand(QString cmd)
void QxrdDetectorPilatus::sendCommand |
( |
QString |
cmd | ) |
|
|
private |
void QxrdDetectorPilatus::shutdownAcquisition |
( |
| ) |
|
|
slot |
void QxrdDetectorPilatus::startDetector |
( |
| ) |
|
|
slot |
void QxrdDetectorPilatus::stopDetector |
( |
| ) |
|
|
slot |
QByteArray QxrdDetectorPilatus::m_Buffer |
|
private |
QString QxrdDetectorPilatus::m_CurrentFile |
|
private |
int QxrdDetectorPilatus::m_ExposureFrameCount |
|
private |
int QxrdDetectorPilatus::m_ExposuresPerFrame |
|
private |
double QxrdDetectorPilatus::m_ExposureTime |
|
private |
QString QxrdDetectorPilatus::m_PilatusReply |
|
private |
QTcpSocket QxrdDetectorPilatus::m_PilatusSocket |
|
private |
bool QxrdDetectorPilatus::deleteFilesAfterReading |
|
readwrite |
double QxrdDetectorPilatus::enableFrequency |
|
readwrite |
int QxrdDetectorPilatus::exposureMode |
|
readwrite |
QString QxrdDetectorPilatus::pilatusDataDirectory |
|
readwrite |
QString QxrdDetectorPilatus::pilatusExtension |
|
readwrite |
QString QxrdDetectorPilatus::pilatusHost |
|
readwrite |
int QxrdDetectorPilatus::pilatusPort |
|
readwrite |
QString QxrdDetectorPilatus::pilatusSCP |
|
readwrite |
QString QxrdDetectorPilatus::pilatusSSH |
|
readwrite |
QString QxrdDetectorPilatus::pilatusUser |
|
readwrite |
bool QxrdDetectorPilatus::readFilesLocally |
|
readwrite |
The documentation for this class was generated from the following files: