mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-18 15:57:13 +02:00
separated parameters and versions
This commit is contained in:
@ -48,18 +48,15 @@ int64_t Detector::getClientVersion() const {
|
||||
}
|
||||
|
||||
Result<int64_t> Detector::getFirmwareVersion(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getId, pos,
|
||||
defs::DETECTOR_FIRMWARE_VERSION);
|
||||
return pimpl->Parallel(&slsDetector::getFirmwareVersion, pos);
|
||||
}
|
||||
|
||||
Result<int64_t> Detector::getDetectorServerVersion(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getId, pos,
|
||||
defs::DETECTOR_SOFTWARE_VERSION);
|
||||
return pimpl->Parallel(&slsDetector::getDetectorServerVersion, pos);
|
||||
}
|
||||
|
||||
Result<int64_t> Detector::getSerialNumber(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::getId, pos,
|
||||
defs::DETECTOR_SERIAL_NUMBER);
|
||||
return pimpl->Parallel(&slsDetector::getSerialNumber, pos);
|
||||
}
|
||||
|
||||
Result<int64_t> Detector::getReceiverVersion(Positions pos) const {
|
||||
@ -485,43 +482,35 @@ void Detector::setTenGiga(bool value, Positions pos) {
|
||||
}
|
||||
|
||||
Result<bool> Detector::getTenGigaFlowControl(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
|
||||
defs::FLOW_CONTROL_10G, -1);
|
||||
return pimpl->Parallel(&slsDetector::getTenGigaFlowControl, pos);
|
||||
}
|
||||
|
||||
void Detector::setTenGigaFlowControl(bool enable, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
|
||||
defs::FLOW_CONTROL_10G, static_cast<int>(enable));
|
||||
pimpl->Parallel(&slsDetector::setTenGigaFlowControl, pos, enable);
|
||||
}
|
||||
|
||||
Result<int> Detector::getTransmissionDelayFrame(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
|
||||
defs::DETECTOR_TXN_DELAY_FRAME, -1);
|
||||
return pimpl->Parallel(&slsDetector::getTransmissionDelayFrame, pos);
|
||||
}
|
||||
|
||||
void Detector::setTransmissionDelayFrame(int value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
|
||||
defs::DETECTOR_TXN_DELAY_FRAME, value);
|
||||
pimpl->Parallel(&slsDetector::setTransmissionDelayFrame, pos, value);
|
||||
}
|
||||
|
||||
Result<int> Detector::getTransmissionDelayLeft(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
|
||||
defs::DETECTOR_TXN_DELAY_LEFT, -1);
|
||||
return pimpl->Parallel(&slsDetector::getTransmissionDelayLeft, pos);
|
||||
}
|
||||
|
||||
void Detector::setTransmissionDelayLeft(int value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
|
||||
defs::DETECTOR_TXN_DELAY_LEFT, value);
|
||||
pimpl->Parallel(&slsDetector::setTransmissionDelayLeft, pos, value);
|
||||
}
|
||||
|
||||
Result<int> Detector::getTransmissionDelayRight(Positions pos) const {
|
||||
return pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
|
||||
defs::DETECTOR_TXN_DELAY_RIGHT, -1);
|
||||
return pimpl->Parallel(&slsDetector::getTransmissionDelayRight, pos);
|
||||
}
|
||||
|
||||
void Detector::setTransmissionDelayRight(int value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
|
||||
defs::DETECTOR_TXN_DELAY_RIGHT, value);
|
||||
pimpl->Parallel(&slsDetector::setTransmissionDelayRight, pos, value);
|
||||
}
|
||||
|
||||
// Receiver
|
||||
@ -1082,13 +1071,11 @@ void Detector::setExternalSignalFlags(defs::externalSignalFlag value,
|
||||
}
|
||||
|
||||
Result<int> Detector::getImageTestMode(Positions pos) {
|
||||
return pimpl->Parallel(&slsDetector::digitalTest, pos, defs::IMAGE_TEST,
|
||||
-1);
|
||||
return pimpl->Parallel(&slsDetector::getImageTestMode, pos);
|
||||
}
|
||||
|
||||
Result<int> Detector::setImageTestMode(int value, Positions pos) {
|
||||
return pimpl->Parallel(&slsDetector::digitalTest, pos, defs::IMAGE_TEST,
|
||||
value);
|
||||
void Detector::setImageTestMode(int value, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::setImageTestMode, pos, value);
|
||||
}
|
||||
|
||||
// CTB Specific
|
||||
@ -1527,14 +1514,12 @@ void Detector::clearBit(uint32_t addr, int bitnr, Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::clearBit, pos, addr, bitnr);
|
||||
}
|
||||
|
||||
Result<int> Detector::executeFirmwareTest(Positions pos) {
|
||||
return pimpl->Parallel(&slsDetector::digitalTest, pos,
|
||||
defs::DETECTOR_FIRMWARE_TEST, -1);
|
||||
void Detector::executeFirmwareTest(Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::executeFirmwareTest, pos);
|
||||
}
|
||||
|
||||
Result<int> Detector::executeBusTest(Positions pos) {
|
||||
return pimpl->Parallel(&slsDetector::digitalTest, pos,
|
||||
defs::DETECTOR_BUS_TEST, -1);
|
||||
void Detector::executeBusTest(Positions pos) {
|
||||
pimpl->Parallel(&slsDetector::executeBusTest, pos);
|
||||
}
|
||||
|
||||
void Detector::writeAdcRegister(uint32_t addr, uint32_t value, Positions pos) {
|
||||
|
@ -104,27 +104,33 @@ void slsDetector::checkReceiverVersionCompatibility() {
|
||||
sendToReceiver(F_RECEIVER_CHECK_VERSION, arg, nullptr);
|
||||
}
|
||||
|
||||
int64_t slsDetector::getId(idMode mode) {
|
||||
// These should not go to detector...
|
||||
assert(mode != THIS_SOFTWARE_VERSION);
|
||||
assert(mode != RECEIVER_VERSION);
|
||||
assert(mode != CLIENT_SOFTWARE_API_VERSION);
|
||||
assert(mode != CLIENT_RECEIVER_API_VERSION);
|
||||
|
||||
int arg = static_cast<int>(mode);
|
||||
int64_t slsDetector::getFirmwareVersion() {
|
||||
int64_t retval = -1;
|
||||
FILE_LOG(logDEBUG1) << "Getting id type " << mode;
|
||||
sendToDetector(F_GET_ID, arg, retval);
|
||||
FILE_LOG(logDEBUG1) << "Id (" << mode << "): 0x" << std::hex << retval
|
||||
<< std::dec;
|
||||
sendToDetector(F_GET_FIRMWARE_VERSION, nullptr, retval);
|
||||
FILE_LOG(logDEBUG1) << "firmware version: 0x" << std::hex << retval << std::dec;
|
||||
return retval;
|
||||
}
|
||||
|
||||
int64_t slsDetector::getDetectorServerVersion() {
|
||||
int64_t retval = -1;
|
||||
sendToDetector(F_GET_SERVER_VERSION, nullptr, retval);
|
||||
FILE_LOG(logDEBUG1) << "firmware version: 0x" << std::hex << retval << std::dec;
|
||||
return retval;
|
||||
}
|
||||
|
||||
int64_t slsDetector::getSerialNumber() {
|
||||
int64_t retval = -1;
|
||||
sendToDetector(F_GET_SERIAL_NUMBER, nullptr, retval);
|
||||
FILE_LOG(logDEBUG1) << "firmware version: 0x" << std::hex << retval << std::dec;
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
int64_t slsDetector::getReceiverSoftwareVersion() const {
|
||||
FILE_LOG(logDEBUG1) << "Getting receiver software version";
|
||||
int64_t retval = -1;
|
||||
if (shm()->useReceiverFlag) {
|
||||
sendToReceiver(F_GET_RECEIVER_ID, nullptr, retval);
|
||||
sendToReceiver(F_GET_RECEIVER_VERSION, nullptr, retval);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
@ -1049,7 +1055,7 @@ std::string slsDetector::getTrimbitFilename(detectorSettings s, int e_eV) {
|
||||
std::ostringstream ostfn;
|
||||
ostfn << shm()->settingsDir << ssettings << "/" << e_eV << "eV"
|
||||
<< "/noise.sn" << std::setfill('0') << std::setw(3) << std::dec
|
||||
<< getId(DETECTOR_SERIAL_NUMBER) << std::setbase(10);
|
||||
<< getSerialNumber() << std::setbase(10);
|
||||
return ostfn.str();
|
||||
}
|
||||
|
||||
@ -1073,7 +1079,7 @@ void slsDetector::loadSettingsFile(const std::string &fname) {
|
||||
fname.find(".trim") == std::string::npos &&
|
||||
fname.find(".settings") == std::string::npos) {
|
||||
ostfn << ".sn" << std::setfill('0') << std::setw(3) << std::dec
|
||||
<< getId(DETECTOR_SERIAL_NUMBER);
|
||||
<< getSerialNumber();
|
||||
}
|
||||
}
|
||||
fn = ostfn.str();
|
||||
@ -1089,7 +1095,7 @@ void slsDetector::saveSettingsFile(const std::string &fname) {
|
||||
// find specific file if it has detid in file name (.snxxx)
|
||||
if (shm()->myDetectorType == EIGER) {
|
||||
ostfn << ".sn" << std::setfill('0') << std::setw(3) << std::dec
|
||||
<< getId(DETECTOR_SERIAL_NUMBER);
|
||||
<< getSerialNumber();
|
||||
}
|
||||
fn = ostfn.str();
|
||||
sls_detector_module myMod = getModule();
|
||||
@ -2110,17 +2116,57 @@ void slsDetector::updateReceiverStreamingIP() {
|
||||
setReceiverStreamingIP(ip);
|
||||
}
|
||||
|
||||
int slsDetector::setDetectorNetworkParameter(networkParameter index,
|
||||
int delay) {
|
||||
int args[]{static_cast<int>(index), delay};
|
||||
|
||||
bool slsDetector::getTenGigaFlowControl() {
|
||||
int retval = -1;
|
||||
FILE_LOG(logDEBUG1) << "Setting network parameter index " << index << " to "
|
||||
<< delay;
|
||||
sendToDetector(F_SET_NETWORK_PARAMETER, args, retval);
|
||||
FILE_LOG(logDEBUG1) << "Network Parameter (" << index << "): " << retval;
|
||||
return retval;
|
||||
sendToDetector(F_GET_TEN_GIGA_FLOW_CONTROL, nullptr, retval);
|
||||
FILE_LOG(logDEBUG1) << "ten giga flow control :" << retval;
|
||||
return retval == 1 ? true : false;
|
||||
}
|
||||
|
||||
void slsDetector::setTenGigaFlowControl(bool enable) {
|
||||
int arg = static_cast<int>(enable);
|
||||
FILE_LOG(logDEBUG1) << "Setting ten giga flow control to " << arg;
|
||||
sendToDetector(F_SET_TEN_GIGA_FLOW_CONTROL, arg, nullptr);
|
||||
}
|
||||
|
||||
int slsDetector::getTransmissionDelayFrame() {
|
||||
int retval = -1;
|
||||
sendToDetector(F_GET_TRANSMISSION_DELAY_FRAME, nullptr, retval);
|
||||
FILE_LOG(logDEBUG1) << "transmission delay frame :" << retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
void slsDetector::setTransmissionDelayFrame(int value) {
|
||||
FILE_LOG(logDEBUG1) << "Setting transmission delay frame to " << value;
|
||||
sendToDetector(F_SET_TRANSMISSION_DELAY_FRAME, value, nullptr);
|
||||
}
|
||||
|
||||
int slsDetector::getTransmissionDelayLeft() {
|
||||
int retval = -1;
|
||||
sendToDetector(F_GET_TRANSMISSION_DELAY_LEFT, nullptr, retval);
|
||||
FILE_LOG(logDEBUG1) << "transmission delay left :" << retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
void slsDetector::setTransmissionDelayLeft(int value) {
|
||||
FILE_LOG(logDEBUG1) << "Setting transmission delay left to " << value;
|
||||
sendToDetector(F_SET_TRANSMISSION_DELAY_LEFT, value, nullptr);
|
||||
}
|
||||
|
||||
int slsDetector::getTransmissionDelayRight() {
|
||||
int retval = -1;
|
||||
sendToDetector(F_GET_TRANSMISSION_DELAY_RIGHT, nullptr, retval);
|
||||
FILE_LOG(logDEBUG1) << "transmission delay right :" << retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
void slsDetector::setTransmissionDelayRight(int value) {
|
||||
FILE_LOG(logDEBUG1) << "Setting transmission delay right to " << value;
|
||||
sendToDetector(F_SET_TRANSMISSION_DELAY_RIGHT, value, nullptr);
|
||||
}
|
||||
|
||||
|
||||
std::string
|
||||
slsDetector::setAdditionalJsonHeader(const std::string &jsonheader) {
|
||||
int fnum = F_ADDITIONAL_JSON_HEADER;
|
||||
@ -2262,16 +2308,28 @@ int64_t slsDetector::getReceiverRealUDPSocketBufferSize() const {
|
||||
return retval;
|
||||
}
|
||||
|
||||
int slsDetector::digitalTest(digitalTestMode mode, int ival) {
|
||||
int args[]{static_cast<int>(mode), ival};
|
||||
void slsDetector::executeFirmwareTest() {
|
||||
FILE_LOG(logDEBUG1) << "Executing firmware test";
|
||||
sendToDetector(F_SET_FIRMWARE_TEST);
|
||||
}
|
||||
|
||||
void slsDetector::executeBusTest() {
|
||||
FILE_LOG(logDEBUG1) << "Executing bus test";
|
||||
sendToDetector(F_SET_BUS_TEST);
|
||||
}
|
||||
|
||||
int slsDetector::getImageTestMode() {
|
||||
int retval = -1;
|
||||
FILE_LOG(logDEBUG1) << "Sending digital test of mode " << mode << ", ival "
|
||||
<< ival;
|
||||
sendToDetector(F_DIGITAL_TEST, args, retval);
|
||||
FILE_LOG(logDEBUG1) << "Digital Test returned: " << retval;
|
||||
sendToDetector(F_GET_IMAGE_TEST_MODE, nullptr, retval);
|
||||
FILE_LOG(logDEBUG1) << "image test mode: " << retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
void slsDetector::setImageTestMode(const int value) {
|
||||
FILE_LOG(logDEBUG1) << "Sending image test mode " << value;
|
||||
sendToDetector(F_SET_IMAGE_TEST_MODE, value, nullptr);
|
||||
}
|
||||
|
||||
int slsDetector::setCounterBit(int cb) {
|
||||
int retval = -1;
|
||||
FILE_LOG(logDEBUG1) << "Sending counter bit " << cb;
|
||||
|
Reference in New Issue
Block a user