mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 19:30:03 +02:00
Merge branch 'apidhanya' of github.com:slsdetectorgroup/slsDetectorPackage into apidhanya
This commit is contained in:
commit
a084ea2d0f
@ -124,7 +124,7 @@ void qTabAdvanced::PopulateDetectors() {
|
|||||||
SLOT(SetDetector(int)));
|
SLOT(SetDetector(int)));
|
||||||
|
|
||||||
comboDetector->clear();
|
comboDetector->clear();
|
||||||
for (int i = 0; i < myDet->getNumberOfDetectors(); ++i)
|
for (int i = 0; i < myDet->size(); ++i)
|
||||||
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
||||||
comboDetector->setCurrentIndex(0);
|
comboDetector->setCurrentIndex(0);
|
||||||
|
|
||||||
|
@ -80,8 +80,8 @@ void qTabDataOutput::PopulateDetectors() {
|
|||||||
|
|
||||||
comboDetector->clear();
|
comboDetector->clear();
|
||||||
comboDetector->addItem("All");
|
comboDetector->addItem("All");
|
||||||
if (myDet->getNumberOfDetectors() > 1) {
|
if (myDet->size() > 1) {
|
||||||
for (int i = 0; i < myDet->getNumberOfDetectors(); ++i)
|
for (int i = 0; i < myDet->size(); ++i)
|
||||||
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ void qTabDebugging::PopulateDetectors() {
|
|||||||
FILE_LOG(logDEBUG) << "Populating detectors";
|
FILE_LOG(logDEBUG) << "Populating detectors";
|
||||||
|
|
||||||
comboDetector->clear();
|
comboDetector->clear();
|
||||||
for (int i = 0; i < myDet->getNumberOfDetectors(); ++i) {
|
for (int i = 0; i < myDet->size(); ++i) {
|
||||||
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,8 +124,8 @@ void qTabDeveloper::PopulateDetectors() {
|
|||||||
|
|
||||||
comboDetector->clear();
|
comboDetector->clear();
|
||||||
comboDetector->addItem("All");
|
comboDetector->addItem("All");
|
||||||
if (myDet->getNumberOfDetectors() > 1) {
|
if (myDet->size() > 1) {
|
||||||
for (int i = 0; i < myDet->getNumberOfDetectors(); ++i)
|
for (int i = 0; i < myDet->size(); ++i)
|
||||||
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
comboDetector->addItem(QString(myDet->getHostname(i).c_str()));
|
||||||
}
|
}
|
||||||
comboDetector->setCurrentIndex(0);
|
comboDetector->setCurrentIndex(0);
|
||||||
|
@ -115,14 +115,6 @@ class Detector {
|
|||||||
Result<bool> getFileOverWrite(Positions pos = {}) const;
|
Result<bool> getFileOverWrite(Positions pos = {}) const;
|
||||||
void setFileOverWrite(bool value, Positions pos = {});
|
void setFileOverWrite(bool value, Positions pos = {});
|
||||||
|
|
||||||
// Time
|
|
||||||
Result<ns> getExptime(Positions pos = {}) const;
|
|
||||||
void setExptime(ns t, Positions pos = {});
|
|
||||||
Result<ns> getSubExptime(Positions pos = {}) const;
|
|
||||||
void setSubExptime(ns t, Positions pos = {});
|
|
||||||
Result<ns> getPeriod(Positions pos = {}) const;
|
|
||||||
void setPeriod(ns t, Positions pos = {});
|
|
||||||
|
|
||||||
// dhanya
|
// dhanya
|
||||||
/**
|
/**
|
||||||
* Get multidetector Id
|
* Get multidetector Id
|
||||||
@ -213,7 +205,7 @@ class Detector {
|
|||||||
* Returns the total number of detectors in the multidetector structure
|
* Returns the total number of detectors in the multidetector structure
|
||||||
* @returns total number of detectors in the multidetector structure
|
* @returns total number of detectors in the multidetector structure
|
||||||
*/
|
*/
|
||||||
int getTotalNumberOfDetectors() const;
|
int size() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of detectors in the multidetector structure
|
* Returns the number of detectors in the multidetector structure
|
||||||
@ -560,6 +552,33 @@ class Detector {
|
|||||||
*/
|
*/
|
||||||
void setNumberOfDigitalSamples(int64_t value, Positions pos = {});
|
void setNumberOfDigitalSamples(int64_t value, Positions pos = {});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get exposure time in ns
|
||||||
|
* @param pos detector position
|
||||||
|
* @returns exposure time in ns
|
||||||
|
*/
|
||||||
|
Result<ns> getExptime(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set exposure time in ns
|
||||||
|
* @param value exposure time in ns
|
||||||
|
* @param pos detector position
|
||||||
|
*/
|
||||||
|
void setExptime(ns t, Positions pos = {});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get period in ns
|
||||||
|
* @param pos detector position
|
||||||
|
* @returns period in ns
|
||||||
|
*/
|
||||||
|
Result<ns> getPeriod(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set period in ns
|
||||||
|
* @param value period in ns
|
||||||
|
* @param pos detector position
|
||||||
|
*/
|
||||||
|
void setPeriod(ns t, Positions pos = {});
|
||||||
/**
|
/**
|
||||||
* Get delay after trigger in ns(Gotthard, Jungfrau)
|
* Get delay after trigger in ns(Gotthard, Jungfrau)
|
||||||
* @param pos detector position
|
* @param pos detector position
|
||||||
@ -574,19 +593,32 @@ class Detector {
|
|||||||
*/
|
*/
|
||||||
void setDelayAfterTrigger(ns value, Positions pos = {});
|
void setDelayAfterTrigger(ns value, Positions pos = {});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get sub frame exposure time in ns (Eiger in 32 bit mode)
|
||||||
|
* @param pos detector position
|
||||||
|
* @returns sub frame exposure time in ns
|
||||||
|
*/
|
||||||
|
Result<ns> getSubExptime(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set sub frame exposure time after trigger (Eiger in 32 bit mode)
|
||||||
|
* @param value sub frame exposure time in ns
|
||||||
|
* @param pos detector position
|
||||||
|
*/
|
||||||
|
void setSubExptime(ns t, Positions pos = {});
|
||||||
/**
|
/**
|
||||||
* Get sub frame dead time in ns (Eiger in 32 bit mode)
|
* Get sub frame dead time in ns (Eiger in 32 bit mode)
|
||||||
* @param pos detector position
|
* @param pos detector position
|
||||||
* @returns delay after trigger in ns
|
* @returns sub frame dead time in ns
|
||||||
*/
|
*/
|
||||||
Result<ns> getSubFrameDeadTime(Positions pos = {}) const;
|
Result<ns> getSubDeadTime(Positions pos = {}) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set sub frame dead time after trigger (Eiger in 32 bit mode)
|
* Set sub frame dead time after trigger (Eiger in 32 bit mode)
|
||||||
* @param value delay after trigger in ns
|
* @param value sub frame dead time in ns
|
||||||
* @param pos detector position
|
* @param pos detector position
|
||||||
*/
|
*/
|
||||||
void setSubFrameDeadTime(ns value, Positions pos = {});
|
void setSubDeadTime(ns value, Positions pos = {});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get storage cell delay (Jungfrau)
|
* Get storage cell delay (Jungfrau)
|
||||||
@ -604,6 +636,76 @@ class Detector {
|
|||||||
*/
|
*/
|
||||||
void setStorageCellDelay(ns value, Positions pos = {});
|
void setStorageCellDelay(ns value, Positions pos = {});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get number of Frames left (Gotthard, Jungfrau, CTB)
|
||||||
|
* @param pos detector position
|
||||||
|
* @returns number of Frames left
|
||||||
|
*/
|
||||||
|
Result<int64_t> getNumberOfFramesLeft(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get number of Cycles left (Gotthard, Jungfrau, CTB)
|
||||||
|
* @param pos detector position
|
||||||
|
* @returns number of Cycles left
|
||||||
|
*/
|
||||||
|
Result<int64_t> getNumberOfCyclesLeft(Positions pos = {}) const;
|
||||||
|
/**
|
||||||
|
* Get exposure time left in ns (Gotthard)
|
||||||
|
* @param pos detector position
|
||||||
|
* @returns exposure time left in ns
|
||||||
|
*/
|
||||||
|
Result<ns> getExptimeLeft(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get period left in ns (Gotthard, Jungfrau, CTB)
|
||||||
|
* @param pos detector position
|
||||||
|
* @returns period left in ns
|
||||||
|
*/
|
||||||
|
Result<ns> getPeriodLeft(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get delay after trigger left in ns(Gotthard, Jungfrau, CTB)
|
||||||
|
* @param pos detector position
|
||||||
|
* @returns delay after trigger left in ns
|
||||||
|
*/
|
||||||
|
Result<ns> getDelayAfterTriggerLeft(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get number of frames from start up of detector (Jungfrau, CTB)
|
||||||
|
* @param pos detector position
|
||||||
|
* @returns number of frames from start up of detector
|
||||||
|
*/
|
||||||
|
Result<int64_t> getNumberOfFramesFromStart(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get time from detector start in ns (Jungfrau, CTB)
|
||||||
|
* @param pos detector position
|
||||||
|
* @returns time from detector start in ns
|
||||||
|
*/
|
||||||
|
Result<ns> getActualTime(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get timestamp at a frame start in ns(Jungfrau, CTB)
|
||||||
|
* @param pos detector position
|
||||||
|
* @returns timestamp at a frame start in ns
|
||||||
|
*/
|
||||||
|
Result<ns> getMeasurementTime(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get measured period between previous two frames in ns (Eiger)
|
||||||
|
* @param pos detector position
|
||||||
|
* @returns measured period between previous two frames in ns
|
||||||
|
*/
|
||||||
|
Result<ns> getMeasuredPeriod(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get measured sub frame period between previous two frames in ns (Eiger in
|
||||||
|
* 32 bit mode)
|
||||||
|
* @param pos detector position
|
||||||
|
* @returns measured sub frame period between previous two frames in ns
|
||||||
|
*/
|
||||||
|
Result<ns> getMeasuredSubFramePeriod(Positions pos = {}) const;
|
||||||
|
|
||||||
// Erik
|
// Erik
|
||||||
|
|
||||||
Result<int> getFramesCaughtByReceiver(Positions pos = {}) const;
|
Result<int> getFramesCaughtByReceiver(Positions pos = {}) const;
|
||||||
|
@ -107,6 +107,10 @@ template <class T, class Allocator = std::allocator<T>> class Result {
|
|||||||
*/
|
*/
|
||||||
T squash() const { return Squash(vec); }
|
T squash() const { return Squash(vec); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If all elements are equal it returns the front value
|
||||||
|
* otherwise throws an exception with custom message provided
|
||||||
|
*/
|
||||||
T tsquash(const std::string &error_msg) {
|
T tsquash(const std::string &error_msg) {
|
||||||
if (equal())
|
if (equal())
|
||||||
return vec.front();
|
return vec.front();
|
||||||
|
@ -381,7 +381,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* Returns the number of detectors in the multidetector structure
|
* Returns the number of detectors in the multidetector structure
|
||||||
* @returns number of detectors
|
* @returns number of detectors
|
||||||
*/
|
*/
|
||||||
int getNumberOfDetectors() const;//
|
int size() const;//
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns number of detectors in dimension d
|
* Returns number of detectors in dimension d
|
||||||
@ -819,7 +819,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns sub frame dead time in ns, or s if specified
|
* @returns sub frame dead time in ns, or s if specified
|
||||||
*/
|
*/
|
||||||
double getMeasuredPeriod(bool inseconds = false, int detPos = -1);
|
double getMeasuredPeriod(bool inseconds = false, int detPos = -1);//
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get sub period between previous two sub frames in 32 bit mode (EIGER)
|
* Get sub period between previous two sub frames in 32 bit mode (EIGER)
|
||||||
@ -828,7 +828,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns sub frame dead time in ns, or s if specified
|
* @returns sub frame dead time in ns, or s if specified
|
||||||
*/
|
*/
|
||||||
double getMeasuredSubFramePeriod(bool inseconds = false, int detPos = -1);
|
double getMeasuredSubFramePeriod(bool inseconds = false, int detPos = -1);//
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/get timer value left in acquisition (not all implemented for all
|
* Set/get timer value left in acquisition (not all implemented for all
|
||||||
@ -839,7 +839,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
* @returns timer set value in ns or number of...(e.g. frames,
|
* @returns timer set value in ns or number of...(e.g. frames,
|
||||||
* probes)
|
* probes)
|
||||||
*/
|
*/
|
||||||
int64_t getTimeLeft(timerIndex index, int detPos = -1);
|
int64_t getTimeLeft(timerIndex index, int detPos = -1);//
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set speed
|
* Set speed
|
||||||
@ -872,10 +872,6 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
*/
|
*/
|
||||||
int getDataBytes(int detPos = -1);
|
int getDataBytes(int detPos = -1);
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the number of detectors in the multi structure*/
|
|
||||||
size_t size() const { return detectors.size(); }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/get dacs value
|
* Set/get dacs value
|
||||||
* @param val value (in V)
|
* @param val value (in V)
|
||||||
|
@ -101,7 +101,7 @@ class multiSlsDetectorClient {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (parser.detector_id() >= detPtr->getNumberOfDetectors()) {
|
if (parser.detector_id() >= detPtr->size()) {
|
||||||
os << "position is out of bounds.\n";
|
os << "position is out of bounds.\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ public:
|
|||||||
* Returns the number of detectors in the multidetector structure
|
* Returns the number of detectors in the multidetector structure
|
||||||
* @returns number of detectors
|
* @returns number of detectors
|
||||||
*/
|
*/
|
||||||
int getNumberOfDetectors() const;
|
int size() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the maximum number of channels of all detectors
|
* Returns the maximum number of channels of all detectors
|
||||||
|
@ -51,11 +51,6 @@ Result<uint32_t> Detector::getRegister(uint32_t addr, Positions pos) {
|
|||||||
return pimpl->Parallel(&slsDetector::readRegister, pos, addr);
|
return pimpl->Parallel(&slsDetector::readRegister, pos, addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<ns> Detector::getExptime(Positions pos) const {
|
|
||||||
return pimpl->Parallel(&slsDetector::setTimer, pos, defs::ACQUISITION_TIME,
|
|
||||||
-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<uint64_t> Detector::getStartingFrameNumber(Positions pos) const {
|
Result<uint64_t> Detector::getStartingFrameNumber(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::getStartingFrameNumber, pos);
|
return pimpl->Parallel(&slsDetector::getStartingFrameNumber, pos);
|
||||||
}
|
}
|
||||||
@ -63,29 +58,6 @@ void Detector::setStartingFrameNumber(uint64_t value, Positions pos) {
|
|||||||
pimpl->Parallel(&slsDetector::setStartingFrameNumber, pos, value);
|
pimpl->Parallel(&slsDetector::setStartingFrameNumber, pos, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setExptime(ns t, Positions pos) {
|
|
||||||
pimpl->Parallel(&slsDetector::setTimer, pos, defs::ACQUISITION_TIME,
|
|
||||||
t.count());
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<ns> Detector::getSubExptime(Positions pos) const {
|
|
||||||
return pimpl->Parallel(&slsDetector::setTimer, pos,
|
|
||||||
defs::SUBFRAME_ACQUISITION_TIME, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Detector::setSubExptime(ns t, Positions pos) {
|
|
||||||
pimpl->Parallel(&slsDetector::setTimer, pos,
|
|
||||||
defs::SUBFRAME_ACQUISITION_TIME, t.count());
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<ns> Detector::getPeriod(Positions pos) const {
|
|
||||||
return pimpl->Parallel(&slsDetector::setTimer, pos, defs::FRAME_PERIOD, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Detector::setPeriod(ns t, Positions pos) {
|
|
||||||
pimpl->Parallel(&slsDetector::setTimer, pos, defs::FRAME_PERIOD, t.count());
|
|
||||||
}
|
|
||||||
|
|
||||||
// File
|
// File
|
||||||
void Detector::setFileName(const std::string &fname, Positions pos) {
|
void Detector::setFileName(const std::string &fname, Positions pos) {
|
||||||
pimpl->Parallel(&slsDetector::setFileName, pos, fname);
|
pimpl->Parallel(&slsDetector::setFileName, pos, fname);
|
||||||
@ -170,8 +142,8 @@ Result<std::string> Detector::getDetectorTypeAsString(Positions pos) const {
|
|||||||
return pimpl->Parallel(&slsDetector::getDetectorTypeAsString, pos);
|
return pimpl->Parallel(&slsDetector::getDetectorTypeAsString, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Detector::getTotalNumberOfDetectors() const {
|
int Detector::size() const {
|
||||||
return pimpl->getNumberOfDetectors();
|
return pimpl->size();
|
||||||
}
|
}
|
||||||
|
|
||||||
defs::coordinates Detector::getNumberOfDetectors() const {
|
defs::coordinates Detector::getNumberOfDetectors() const {
|
||||||
@ -393,6 +365,24 @@ void Detector::setNumberOfDigitalSamples(int64_t value, Positions pos) {
|
|||||||
pimpl->Parallel(&slsDetector::setTimer, pos, defs::DIGITAL_SAMPLES, value);
|
pimpl->Parallel(&slsDetector::setTimer, pos, defs::DIGITAL_SAMPLES, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result<ns> Detector::getExptime(Positions pos) const {
|
||||||
|
return pimpl->Parallel(&slsDetector::setTimer, pos, defs::ACQUISITION_TIME,
|
||||||
|
-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Detector::setExptime(ns t, Positions pos) {
|
||||||
|
pimpl->Parallel(&slsDetector::setTimer, pos, defs::ACQUISITION_TIME,
|
||||||
|
t.count());
|
||||||
|
}
|
||||||
|
|
||||||
|
Result<ns> Detector::getPeriod(Positions pos) const {
|
||||||
|
return pimpl->Parallel(&slsDetector::setTimer, pos, defs::FRAME_PERIOD, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Detector::setPeriod(ns t, Positions pos) {
|
||||||
|
pimpl->Parallel(&slsDetector::setTimer, pos, defs::FRAME_PERIOD, t.count());
|
||||||
|
}
|
||||||
|
|
||||||
Result<ns> Detector::getDelayAfterTrigger(Positions pos) const {
|
Result<ns> Detector::getDelayAfterTrigger(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::setTimer, pos,
|
return pimpl->Parallel(&slsDetector::setTimer, pos,
|
||||||
defs::DELAY_AFTER_TRIGGER, -1);
|
defs::DELAY_AFTER_TRIGGER, -1);
|
||||||
@ -403,12 +393,22 @@ void Detector::setDelayAfterTrigger(ns value, Positions pos) {
|
|||||||
value.count());
|
value.count());
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<ns> Detector::getSubFrameDeadTime(Positions pos) const {
|
Result<ns> Detector::getSubExptime(Positions pos) const {
|
||||||
|
return pimpl->Parallel(&slsDetector::setTimer, pos,
|
||||||
|
defs::SUBFRAME_ACQUISITION_TIME, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Detector::setSubExptime(ns t, Positions pos) {
|
||||||
|
pimpl->Parallel(&slsDetector::setTimer, pos,
|
||||||
|
defs::SUBFRAME_ACQUISITION_TIME, t.count());
|
||||||
|
}
|
||||||
|
|
||||||
|
Result<ns> Detector::getSubDeadTime(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::setTimer, pos, defs::SUBFRAME_DEADTIME,
|
return pimpl->Parallel(&slsDetector::setTimer, pos, defs::SUBFRAME_DEADTIME,
|
||||||
-1);
|
-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setSubFrameDeadTime(ns value, Positions pos) {
|
void Detector::setSubDeadTime(ns value, Positions pos) {
|
||||||
pimpl->Parallel(&slsDetector::setTimer, pos, defs::SUBFRAME_DEADTIME,
|
pimpl->Parallel(&slsDetector::setTimer, pos, defs::SUBFRAME_DEADTIME,
|
||||||
value.count());
|
value.count());
|
||||||
}
|
}
|
||||||
@ -423,6 +423,46 @@ void Detector::setStorageCellDelay(ns value, Positions pos) {
|
|||||||
value.count());
|
value.count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result<int64_t> Detector::getNumberOfFramesLeft(Positions pos) const {
|
||||||
|
return pimpl->Parallel(&slsDetector::getTimeLeft, pos, defs::FRAME_NUMBER);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result<int64_t> Detector::getNumberOfCyclesLeft(Positions pos) const {
|
||||||
|
return pimpl->Parallel(&slsDetector::getTimeLeft, pos, defs::CYCLES_NUMBER);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result<ns> Detector::getExptimeLeft(Positions pos) const {
|
||||||
|
return pimpl->Parallel(&slsDetector::getTimeLeft, pos, defs::ACQUISITION_TIME);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result<ns> Detector::getPeriodLeft(Positions pos) const {
|
||||||
|
return pimpl->Parallel(&slsDetector::getTimeLeft, pos, defs::FRAME_PERIOD);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result<ns> Detector::getDelayAfterTriggerLeft(Positions pos) const {
|
||||||
|
return pimpl->Parallel(&slsDetector::getTimeLeft, pos, defs::DELAY_AFTER_TRIGGER);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result<int64_t> Detector::getNumberOfFramesFromStart(Positions pos) const {
|
||||||
|
return pimpl->Parallel(&slsDetector::getTimeLeft, pos, defs::FRAMES_FROM_START);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result<ns> Detector::getActualTime(Positions pos) const {
|
||||||
|
return pimpl->Parallel(&slsDetector::getTimeLeft, pos, defs::ACTUAL_TIME);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result<ns> Detector::getMeasurementTime(Positions pos) const {
|
||||||
|
return pimpl->Parallel(&slsDetector::getTimeLeft, pos, defs::MEASUREMENT_TIME);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result<ns> Detector::getMeasuredPeriod(Positions pos) const {
|
||||||
|
return pimpl->Parallel(&slsDetector::getTimeLeft, pos, defs::MEASURED_PERIOD);
|
||||||
|
};
|
||||||
|
|
||||||
|
Result<ns> Detector::getMeasuredSubFramePeriod(Positions pos) const {
|
||||||
|
return pimpl->Parallel(&slsDetector::getTimeLeft, pos, defs::MEASURED_SUBPERIOD);
|
||||||
|
};
|
||||||
|
|
||||||
// Erik
|
// Erik
|
||||||
Result<int> Detector::getFramesCaughtByReceiver(Positions pos) const {
|
Result<int> Detector::getFramesCaughtByReceiver(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::getFramesCaughtByReceiver, pos);
|
return pimpl->Parallel(&slsDetector::getFramesCaughtByReceiver, pos);
|
||||||
@ -635,8 +675,8 @@ Result<bool> Detector::getAutoCompDisable(Positions pos) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setPowerChip(bool on, Positions pos) {
|
void Detector::setPowerChip(bool on, Positions pos) {
|
||||||
if (on && pimpl->getNumberOfDetectors() > 3) {
|
if (on && pimpl->size() > 3) {
|
||||||
for (int i = 0; i != pimpl->getNumberOfDetectors(); ++i) {
|
for (int i = 0; i != pimpl->size(); ++i) {
|
||||||
pimpl->powerChip(static_cast<int>(on), i);
|
pimpl->powerChip(static_cast<int>(on), i);
|
||||||
usleep(1000 * 1000);
|
usleep(1000 * 1000);
|
||||||
}
|
}
|
||||||
|
@ -660,7 +660,7 @@ std::string multiSlsDetector::getDetectorTypeAsString(int detPos) {
|
|||||||
return sls::concatenateIfDifferent(r);
|
return sls::concatenateIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::getNumberOfDetectors() const { return detectors.size(); }
|
int multiSlsDetector::size() const { return detectors.size(); }
|
||||||
|
|
||||||
int multiSlsDetector::getNumberOfDetectors(dimension d) const {
|
int multiSlsDetector::getNumberOfDetectors(dimension d) const {
|
||||||
return multi_shm()->numberOfDetector[d];
|
return multi_shm()->numberOfDetector[d];
|
||||||
@ -747,7 +747,7 @@ void multiSlsDetector::setDetectorOffset(dimension d, int off, int detPos) {
|
|||||||
|
|
||||||
int multiSlsDetector::getQuad(int detPos) {
|
int multiSlsDetector::getQuad(int detPos) {
|
||||||
int retval = detectors[0]->getQuad();
|
int retval = detectors[0]->getQuad();
|
||||||
if (retval && getNumberOfDetectors() > 1) {
|
if (retval && size() > 1) {
|
||||||
throw RuntimeError("Quad type is available only for 1 Eiger Quad Half "
|
throw RuntimeError("Quad type is available only for 1 Eiger Quad Half "
|
||||||
"module, but it Quad is enabled for 1st readout");
|
"module, but it Quad is enabled for 1st readout");
|
||||||
}
|
}
|
||||||
@ -755,7 +755,7 @@ int multiSlsDetector::getQuad(int detPos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void multiSlsDetector::setQuad(const bool enable, int detPos) {
|
void multiSlsDetector::setQuad(const bool enable, int detPos) {
|
||||||
if (enable && getNumberOfDetectors() > 1) {
|
if (enable && size() > 1) {
|
||||||
throw RuntimeError("Cannot set Quad type as it is available only for 1 "
|
throw RuntimeError("Cannot set Quad type as it is available only for 1 "
|
||||||
"Eiger Quad Half module.");
|
"Eiger Quad Half module.");
|
||||||
}
|
}
|
||||||
@ -2238,7 +2238,7 @@ void multiSlsDetector::setROI(int n, ROI roiLimits[], int detPos) {
|
|||||||
ymin = roiLimits[i].ymin;
|
ymin = roiLimits[i].ymin;
|
||||||
ymax = roiLimits[i].ymax;
|
ymax = roiLimits[i].ymax;
|
||||||
|
|
||||||
if (getNumberOfDetectors() > 1) {
|
if (size() > 1) {
|
||||||
// check roi max values
|
// check roi max values
|
||||||
idet = decodeNChannel(xmax, ymax, channelX, channelY);
|
idet = decodeNChannel(xmax, ymax, channelX, channelY);
|
||||||
FILE_LOG(logDEBUG1) << "Decoded Channel max vals: " << std::endl
|
FILE_LOG(logDEBUG1) << "Decoded Channel max vals: " << std::endl
|
||||||
@ -2885,7 +2885,7 @@ int multiSlsDetector::powerChip(int ival, int detPos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// multi delayed call for safety
|
// multi delayed call for safety
|
||||||
if (ival >= 0 && getNumberOfDetectors() > 3) {
|
if (ival >= 0 && size() > 3) {
|
||||||
std::vector<int> r;
|
std::vector<int> r;
|
||||||
r.reserve(detectors.size());
|
r.reserve(detectors.size());
|
||||||
for (auto &d : detectors) {
|
for (auto &d : detectors) {
|
||||||
@ -4160,34 +4160,19 @@ void multiSlsDetector::registerDataCallback(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::setTotalProgress() {
|
int multiSlsDetector::setTotalProgress() {
|
||||||
int nf = 1, nc = 1, ns = 1;
|
int nf = Parallel(&slsDetector::setTimer, {}, FRAME_NUMBER, -1).tsquash("Inconsistent number of frames");
|
||||||
|
int nc = Parallel(&slsDetector::setTimer, {}, CYCLES_NUMBER, -1).tsquash("Inconsistent number of cycles");
|
||||||
Result<int64_t> temp = Parallel(&slsDetector::setTimer, {}, FRAME_NUMBER, -1);
|
|
||||||
if (!temp.equal()) {
|
|
||||||
throw RuntimeError("Inconsistent number of frames");
|
|
||||||
}
|
|
||||||
nf = temp.squash();
|
|
||||||
|
|
||||||
temp = Parallel(&slsDetector::setTimer, {}, CYCLES_NUMBER, -1);
|
|
||||||
if (!temp.equal()) {
|
|
||||||
throw RuntimeError("Inconsistent number of cycles");
|
|
||||||
}
|
|
||||||
nc = temp.squash();
|
|
||||||
|
|
||||||
if (getDetectorTypeAsEnum() == JUNGFRAU) {
|
|
||||||
temp = Parallel(&slsDetector::setTimer, {}, STORAGE_CELL_NUMBER, -1);
|
|
||||||
if (!temp.equal()) {
|
|
||||||
throw RuntimeError("Inconsistent number of additional storage cells");
|
|
||||||
}
|
|
||||||
ns = temp.squash() + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nf == 0 || nc == 0) {
|
if (nf == 0 || nc == 0) {
|
||||||
throw RuntimeError("Number of frames or cycles is 0");
|
throw RuntimeError("Number of frames or cycles is 0");
|
||||||
}
|
}
|
||||||
|
|
||||||
totalProgress = nf * nc * ns;
|
int ns = 1;
|
||||||
|
if (getDetectorTypeAsEnum() == JUNGFRAU) {
|
||||||
|
ns = Parallel(&slsDetector::setTimer, {}, STORAGE_CELL_NUMBER, -1).tsquash("Inconsistent number of additional storage cells");
|
||||||
|
++ns;
|
||||||
|
}
|
||||||
|
|
||||||
|
totalProgress = nf * nc * ns;
|
||||||
FILE_LOG(logDEBUG1) << "nf " << nf << " nc " << nc << " ns " << ns;
|
FILE_LOG(logDEBUG1) << "nf " << nf << " nc " << nc << " ns " << ns;
|
||||||
FILE_LOG(logDEBUG1) << "Set total progress " << totalProgress << std::endl;
|
FILE_LOG(logDEBUG1) << "Set total progress " << totalProgress << std::endl;
|
||||||
return totalProgress;
|
return totalProgress;
|
||||||
|
@ -2175,7 +2175,7 @@ std::string slsDetectorCommand::cmdAcquire(int narg, const char * const args[],
|
|||||||
if (action == HELP_ACTION) {
|
if (action == HELP_ACTION) {
|
||||||
return helpAcquire(HELP_ACTION);
|
return helpAcquire(HELP_ACTION);
|
||||||
}
|
}
|
||||||
if (!myDet->getNumberOfDetectors()) {
|
if (!myDet->size()) {
|
||||||
FILE_LOG(logERROR) << "This shared memory has no detectors added. Aborting.";
|
FILE_LOG(logERROR) << "This shared memory has no detectors added. Aborting.";
|
||||||
return std::string("acquire failed");
|
return std::string("acquire failed");
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetectorUsers::getNumberOfDetectors() const {
|
int slsDetectorUsers::size() const {
|
||||||
return detector.getNumberOfDetectors();
|
return detector.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::getMaximumDetectorSize(int &nx, int &ny){
|
int slsDetectorUsers::getMaximumDetectorSize(int &nx, int &ny){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user