mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
injectchannel WIP
This commit is contained in:
@ -775,7 +775,9 @@ class CmdProxy {
|
||||
{"extsig", &CmdProxy::extsig},
|
||||
{"imagetest", &CmdProxy::imagetest},
|
||||
|
||||
/* Gotthard2 Specific */
|
||||
/* Gotthard2 Specific */
|
||||
{"inj_ch", &CmdProxy::InjectChannel},
|
||||
|
||||
/* CTB Specific */
|
||||
{"samples", &CmdProxy::Samples},
|
||||
{"asamples", &CmdProxy::asamples},
|
||||
|
@ -873,6 +873,19 @@ class Detector {
|
||||
* Default is 0 */
|
||||
void setImageTestMode(const int value, Positions pos = {});
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
* Gotthard2 Specific *
|
||||
* *
|
||||
* ************************************************/
|
||||
|
||||
/** [Gotthard2] offset channel, increment channel */
|
||||
Result<std::array<int, 2>> getInjectChannel(Positions pos = {});
|
||||
/** [Gotthard2]
|
||||
* @param offsetChannel starting channel to be injected
|
||||
* @param incrementChannel determines succeeding channels to be injected */
|
||||
void setInjectChannel(int offsetChannel, int incrementChannel, Positions pos = {});
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
* CTB Specific *
|
||||
|
@ -1102,6 +1102,15 @@ class slsDetector : public virtual slsDetectorDefs {
|
||||
* Default is 0 */
|
||||
void setImageTestMode(const int value);
|
||||
|
||||
|
||||
/** [Gotthard2] */
|
||||
std::array<int, 2> getInjectChannel();
|
||||
|
||||
/** [Gotthard2]
|
||||
* @param offsetChannel starting channel to be injected
|
||||
* @param incrementChannel determines succeeding channels to be injected */
|
||||
void setInjectChannel(int offsetChannel, int incrementChannel);
|
||||
|
||||
/**
|
||||
* Set/get counter bit in detector (Gotthard)
|
||||
* @param i is -1 to get, 0 to reset and any other value to set the counter
|
||||
|
@ -1017,7 +1017,33 @@ std::string CmdProxy::ClearROI(int action) {
|
||||
return os.str();
|
||||
}
|
||||
|
||||
|
||||
/* Gotthard2 Specific */
|
||||
|
||||
std::string CmdProxy::InjectChannel(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[offset] [increment]\n\t[Gotthard2] Inject channels with current source for calibration. Offset is starting channel that is injected, increment determines succeeding channels to be injected." << '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
if (args.size() != 0) {
|
||||
WrongNumberOfParameters(0);
|
||||
}
|
||||
auto t = det->getInjectChannel({det_id});
|
||||
os << OutString(t) << '\n';
|
||||
} else if (action == defs::PUT_ACTION) {
|
||||
if (args.size() != 2) {
|
||||
WrongNumberOfParameters(2);
|
||||
}
|
||||
det->setInjectChannel(std::stoi(args[0]), std::stoi(args[1]),{det_id});
|
||||
os << sls::ToString(args) << '\n';
|
||||
} else {
|
||||
throw sls::RuntimeError("Unknown action");
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
|
||||
/* CTB Specific */
|
||||
|
||||
std::string CmdProxy::Samples(int action) {
|
||||
|
@ -1086,6 +1086,16 @@ void Detector::setImageTestMode(int value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setImageTestMode, pos, value);
|
||||
}
|
||||
|
||||
// Gotthard2 Specific
|
||||
|
||||
Result<std::array<int, 2>> Detector::getInjectChannel(Positions pos) {
|
||||
return pimpl->Parallel(&slsDetector::getInjectChannel, pos);
|
||||
}
|
||||
|
||||
void Detector::setInjectChannel(int offsetChannel, int incrementChannel, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setInjectChannel, pos, offsetChannel, incrementChannel);
|
||||
}
|
||||
|
||||
// CTB Specific
|
||||
|
||||
Result<int> Detector::getNumberOfAnalogSamples(Positions pos) const {
|
||||
|
@ -2345,6 +2345,19 @@ void slsDetector::setImageTestMode(const int value) {
|
||||
sendToDetector(F_SET_IMAGE_TEST_MODE, value, nullptr);
|
||||
}
|
||||
|
||||
std::array<int, 2> slsDetector::getInjectChannel() {
|
||||
std::array<int, 2> retvals{};
|
||||
sendToDetector(F_GET_INJECT_CHANNEL, nullptr, retvals);
|
||||
FILE_LOG(logDEBUG1) << "Inject Channel: [offset: " << retvals[0] << ", increment: " << retvals[1] << ']';
|
||||
return retvals;
|
||||
}
|
||||
|
||||
void slsDetector::setInjectChannel(int offsetChannel, int incrementChannel) {
|
||||
int args[]{offsetChannel, incrementChannel};
|
||||
FILE_LOG(logDEBUG1) << "Setting inject channels [offset: " << offsetChannel << ", increment: " << incrementChannel << ']';
|
||||
sendToDetector(F_SET_INJECT_CHANNEL, args, nullptr);
|
||||
}
|
||||
|
||||
int slsDetector::setCounterBit(int cb) {
|
||||
int retval = -1;
|
||||
FILE_LOG(logDEBUG1) << "Sending counter bit " << cb;
|
||||
|
Reference in New Issue
Block a user