mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-22 09:37:59 +02:00
new socket for slsDetector
This commit is contained in:
@ -215,12 +215,21 @@ bool multiSlsDetector::isAcquireReady() {
|
||||
return OK;
|
||||
}
|
||||
|
||||
int multiSlsDetector::checkVersionCompatibility(portType t, int detPos) {
|
||||
int multiSlsDetector::checkDetectorVersionCompatibility(int detPos) {
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->checkVersionCompatibility(t);
|
||||
return detectors[detPos]->checkDetectorVersionCompatibility();
|
||||
}
|
||||
|
||||
auto r = parallelCall(&slsDetector::checkVersionCompatibility, t);
|
||||
auto r = parallelCall(&slsDetector::checkDetectorVersionCompatibility);
|
||||
return sls::minusOneIfDifferent(r);
|
||||
}
|
||||
|
||||
int multiSlsDetector::checkReceiverVersionCompatibility(int detPos) {
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->checkReceiverVersionCompatibility();
|
||||
}
|
||||
|
||||
auto r = parallelCall(&slsDetector::checkReceiverVersionCompatibility);
|
||||
return sls::minusOneIfDifferent(r);
|
||||
}
|
||||
|
||||
@ -482,14 +491,28 @@ void multiSlsDetector::addSlsDetector(const std::string &hostname) {
|
||||
}
|
||||
}
|
||||
|
||||
// get type by connecting
|
||||
detectorType type = slsDetector::getTypeFromDetector(hostname.c_str(), DEFAULT_PORTNO);
|
||||
if (type == GENERIC) {
|
||||
FILE_LOG(logERROR) << "Could not connect to Detector " << hostname
|
||||
<< " to determine the type!";
|
||||
setErrorMask(getErrorMask() | MULTI_DETECTORS_NOT_ADDED);
|
||||
appendNotAddedList(hostname.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
int pos = (int)detectors.size();
|
||||
detectors.push_back(sls::make_unique<slsDetector>(hostname, detId, pos, false));
|
||||
detectors.push_back(sls::make_unique<slsDetector>(type, detId, pos, false));
|
||||
thisMultiDetector->numberOfDetectors = detectors.size();
|
||||
thisMultiDetector->dataBytes += detectors[pos]->getDataBytes();
|
||||
thisMultiDetector->dataBytesInclGapPixels +=
|
||||
detectors[pos]->getDataBytesInclGapPixels();
|
||||
thisMultiDetector->numberOfChannels +=
|
||||
detectors[pos]->getTotalNumberOfChannels();
|
||||
|
||||
detectors[pos]->setHostname(hostname);
|
||||
detectors[pos]->setOnline(true);
|
||||
|
||||
}
|
||||
|
||||
slsDetectorDefs::detectorType multiSlsDetector::getDetectorTypeAsEnum(int detPos) {
|
||||
|
@ -216,14 +216,22 @@ class multiSlsDetector : public virtual slsDetectorDefs,
|
||||
bool isAcquireReady();
|
||||
|
||||
/**
|
||||
* Check version compatibility with detector/receiver software
|
||||
* Check version compatibility with detector software
|
||||
* (if hostname/rx_hostname has been set/ sockets created)
|
||||
* @param p port type control port or receiver port
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns FAIL for incompatibility, OK for compatibility
|
||||
*/
|
||||
int checkVersionCompatibility(portType t, int detPos = -1);
|
||||
|
||||
int checkDetectorVersionCompatibility(int detPos = -1);
|
||||
/**
|
||||
* Check version compatibility with receiver software
|
||||
* (if hostname/rx_hostname has been set/ sockets created)
|
||||
* @param p port type control port or receiver port
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns FAIL for incompatibility, OK for compatibility
|
||||
*/
|
||||
int checkReceiverVersionCompatibility(int detPos = -1);
|
||||
|
||||
/**
|
||||
* Get ID or version numbers
|
||||
* @param mode version type
|
||||
|
@ -88,8 +88,14 @@ class multiSlsDetectorClient {
|
||||
|
||||
// call multi detector command line
|
||||
slsDetectorCommand myCmd(detPtr);
|
||||
std::cout << "narg: " << parser.n_arguments()+1 << '\n';
|
||||
std::cout << "narg: " << parser.argv().data() << '\n';
|
||||
std::cout << "narg: " << parser.detector_id() << '\n';
|
||||
|
||||
std::cout << "HEY!!!!!!!!!!!!!!!!!!!!!!! 55555\n";
|
||||
|
||||
std::string answer = myCmd.executeLine(parser.n_arguments()+1, parser.argv().data(), action_, parser.detector_id());
|
||||
|
||||
std::cout << "HEY!!!!!!!!!!!!!!!!!!!!!!! 9999\n";
|
||||
if (parser.multi_id()!=0)
|
||||
std::cout << parser.multi_id() << '-';
|
||||
if (parser.detector_id() != -1)
|
||||
|
Reference in New Issue
Block a user