This commit is contained in:
Erik Frojdh
2019-08-09 11:00:12 +02:00
parent 5292075a0a
commit dfbf7ab39a
6 changed files with 69 additions and 20 deletions

View File

@ -105,11 +105,19 @@ template <class T, class Allocator = std::allocator<T>> class Result {
*/
T squash() const { return Squash(vec); }
T tsquash(const std::string &error_msg) {
if (equal())
return vec.front();
else
throw RuntimeError(error_msg);
}
/**
* If all elements are equal return the front value, otherwise
* return the supplied default value
*/
T squash(T default_value) const { return Squash(vec, default_value); }
T squash(const T &default_value) const {
return Squash(vec, default_value);
}
/** Test whether all elements of the result are equal */
bool equal() const noexcept { return allEqual(vec); }

View File

@ -1487,7 +1487,9 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @param detPos -1 for all detectors in list or specific detector position
* @returns external sampling source
*/
int getExternalSamplingSource(int detPos = -1);
int getExternalSamplingSource(int detPos = -1); //
/**
* Set external sampling enable (CTB only)
@ -1592,6 +1594,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
*/
int enableGapPixels(int val = -1, int detPos = -1); //
void setGapPixelsEnable(bool enable, sls::Positions pos = {});
/**
* Sets the number of trim energies and their value (Eiger)
*