diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index 106b5cbf9..4a5572a24 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -193,7 +193,7 @@ class Detector { * Get Detector type as an enum * @returns detector type */ - defs::detectorType getDetectorTypeAsEnum() const; + defs::detectorType getDetectorType() const; /** * Get Detector type as an enum @@ -411,7 +411,8 @@ class Detector { * @param tb 1 to include trimbits, 0 to exclude * @param pos detector position */ - void setThresholdEnergy(int value, defs::detectorSettings sett = defs::GET_SETTINGS, + void setThresholdEnergy(int value, + defs::detectorSettings sett = defs::GET_SETTINGS, int tb = 1, Positions pos = {}); /** @@ -444,6 +445,57 @@ class Detector { */ void saveSettingsFile(const std::string &value, Positions pos = {}); + /** + * Get Detector run status + * @param pos detector position + * @returns status + */ + Result getRunStatus(Positions pos = {}); + + /** + * Prepares detector for acquisition (Eiger) + */ + void prepareAcquisition(); + + /** + * Start detector acquisition (Non blocking) + */ + void startAcquisition(); + + /** + * Stop detector acquisition + */ + void stopAcquisition(); + + /** + * Give an internal software trigger to the detector (Eiger only) + * @param pos detector position + */ + void sendSoftwareTrigger(Positions pos = {}); + + /** + * Start detector acquisition and read all data (Blocking until end of + * acquisition) + */ + void startAndReadAll(); + + /** + * Start readout (without exposure or interrupting exposure) (Eiger store in + * ram) + */ + void startReadOut(); + + /** + * Requests and receives all data from the detector (Eiger store in ram) + */ + void readAll(); + + /** + * Configures in detector the destination for UDP packets + * @param pos detector position + */ + void configureMAC(Positions pos = {}); + // Erik Result getFramesCaughtByReceiver(Positions pos = {}) const; diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index d945692a0..e42cb1028 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -157,7 +157,7 @@ void Detector::setHostname(const std::vector &value) { pimpl->setHostname(value); } -defs::detectorType Detector::getDetectorTypeAsEnum() const { +defs::detectorType Detector::getDetectorType() const { return pimpl->getDetectorTypeAsEnum(); } @@ -290,7 +290,8 @@ Result Detector::getThresholdEnergy(Positions pos) const { return pimpl->Parallel(&slsDetector::getThresholdEnergy, pos); } -void Detector::setThresholdEnergy(int value, defs::detectorSettings sett, int tb, Positions pos) { +void Detector::setThresholdEnergy(int value, defs::detectorSettings sett, + int tb, Positions pos) { pimpl->Parallel(&slsDetector::setThresholdEnergy, pos, value, sett, tb); } @@ -310,6 +311,48 @@ void Detector::saveSettingsFile(const std::string &value, Positions pos) { pimpl->Parallel(&slsDetector::saveSettingsFile, pos, value); } +Result Detector::getRunStatus(Positions pos) { + return pimpl->Parallel(&slsDetector::getRunStatus, pos); +} + +void Detector::prepareAcquisition() { + pimpl->Parallel(&slsDetector::prepareAcquisition, {}); +} + +void Detector::startAcquisition() { + if (getDetectorType() == defs::EIGER) { + prepareAcquisition(); + } + pimpl->Parallel(&slsDetector::startAcquisition, {}); +} + +void Detector::stopAcquisition() { + pimpl->Parallel(&slsDetector::stopAcquisition, {}); +} + +void Detector::sendSoftwareTrigger(Positions pos) { + pimpl->Parallel(&slsDetector::sendSoftwareTrigger, pos); +} + +void Detector::startAndReadAll() { + if (getDetectorType() == defs::EIGER) { + prepareAcquisition(); + } + pimpl->Parallel(&slsDetector::startAndReadAll, {}); +} + +void Detector::startReadOut() { + pimpl->Parallel(&slsDetector::startReadOut, {}); +} + +void Detector::readAll() { + pimpl->Parallel(&slsDetector::readAll, {}); +} + +void Detector::configureMAC(Positions pos) { + pimpl->Parallel(&slsDetector::configureMAC, pos); +} + // Erik Result Detector::getFramesCaughtByReceiver(Positions pos) const { return pimpl->Parallel(&slsDetector::getFramesCaughtByReceiver, pos);