mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-16 22:58:02 +01:00
gotthard fixed roi only xmin and xmax.remove updateoffsets
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
const std::string DataStreamer::TypeName = "DataStreamer";
|
||||
|
||||
|
||||
DataStreamer::DataStreamer(int ind, Fifo* f, uint32_t* dr, std::vector<ROI>* r,
|
||||
DataStreamer::DataStreamer(int ind, Fifo* f, uint32_t* dr, ROI* r,
|
||||
uint64_t* fi, int fd, char* ajh, int* nd, bool* gpEnable) :
|
||||
ThreadObject(ind),
|
||||
runningFlag(0),
|
||||
@@ -93,9 +93,9 @@ void DataStreamer::ResetParametersforNewMeasurement(const std::string& fname){
|
||||
delete[] completeBuffer;
|
||||
completeBuffer = nullptr;
|
||||
}
|
||||
if (roi->size()) {
|
||||
if (roi->xmin != -1) {
|
||||
if (generalData->myDetectorType == GOTTHARD) {
|
||||
adcConfigured = generalData->GetAdcConfigured(index, roi);
|
||||
adcConfigured = generalData->GetAdcConfigured(index, *roi);
|
||||
}
|
||||
completeBuffer = new char[generalData->imageSizeComplete];
|
||||
memset(completeBuffer, 0, generalData->imageSizeComplete);
|
||||
|
||||
@@ -104,7 +104,8 @@ void slsReceiverImplementation::InitializeMembers() {
|
||||
overwriteEnable = true;
|
||||
|
||||
//***acquisition parameters***
|
||||
roi.clear();
|
||||
roi.xmin = -1;
|
||||
roi.xmax = -1;
|
||||
adcEnableMask = BIT32_MASK;
|
||||
streamingFrequency = 0;
|
||||
streamingTimerInMs = DEFAULT_STREAMING_TIMER_IN_MS;
|
||||
@@ -305,7 +306,7 @@ int slsReceiverImplementation::getNumberofUDPInterfaces() const {
|
||||
}
|
||||
|
||||
/***acquisition parameters***/
|
||||
std::vector<slsDetectorDefs::ROI> slsReceiverImplementation::getROI() const {
|
||||
slsDetectorDefs::ROI slsReceiverImplementation::getROI() const {
|
||||
FILE_LOG(logDEBUG3) << __SHORT_AT__ << " called";
|
||||
return roi;
|
||||
}
|
||||
@@ -858,51 +859,21 @@ int slsReceiverImplementation::setUDPSocketBufferSize(const int64_t s) {
|
||||
}
|
||||
|
||||
/***acquisition parameters***/
|
||||
int slsReceiverImplementation::setROI(
|
||||
const std::vector<slsDetectorDefs::ROI> new_roi) {
|
||||
bool change = false;
|
||||
if (roi.size() != new_roi.size())
|
||||
change = true;
|
||||
else {
|
||||
for (size_t i = 0; i != new_roi.size(); ++i) {
|
||||
if ((roi[i].xmin != new_roi[i].xmin) ||
|
||||
(roi[i].xmax != new_roi[i].xmax) ||
|
||||
(roi[i].ymin != new_roi[i].ymin) ||
|
||||
(roi[i].xmax != new_roi[i].xmax)) {
|
||||
change = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
int slsReceiverImplementation::setROI(slsDetectorDefs::ROI arg) {
|
||||
if (roi.xmin != arg.xmin || roi.xmax != arg.xmax) {
|
||||
roi.xmin = arg.xmin;
|
||||
roi.xmax = arg.xmax;
|
||||
|
||||
if (change) {
|
||||
roi = new_roi;
|
||||
switch (myDetectorType) {
|
||||
case GOTTHARD:
|
||||
generalData->SetROI(new_roi);
|
||||
framesPerFile = generalData->maxFramesPerFile;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// only for gotthard
|
||||
generalData->SetROI(arg);
|
||||
framesPerFile = generalData->maxFramesPerFile;
|
||||
for (const auto &it : dataProcessor)
|
||||
it->SetPixelDimension();
|
||||
if (SetupFifoStructure() == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
std::stringstream sstm;
|
||||
sstm << "ROI: ";
|
||||
if (!roi.size())
|
||||
sstm << "0";
|
||||
else {
|
||||
for (size_t i = 0; i < roi.size(); ++i) {
|
||||
sstm << "( " << roi[i].xmin << ", " << roi[i].xmax << ", "
|
||||
<< roi[i].ymin << ", " << roi[i].ymax << " )";
|
||||
}
|
||||
}
|
||||
std::string message = sstm.str();
|
||||
FILE_LOG(logINFO) << message;
|
||||
FILE_LOG(logINFO) << "ROI: [" << roi.xmin << ", " << roi.xmax << "]";;
|
||||
FILE_LOG(logINFO) << "Packets per Frame: "
|
||||
<< (generalData->packetsPerFrame);
|
||||
return OK;
|
||||
|
||||
@@ -510,22 +510,12 @@ int slsReceiverTCPIPInterface::set_detector_hostname(Interface &socket) {
|
||||
}
|
||||
|
||||
int slsReceiverTCPIPInterface::set_roi(Interface &socket) {
|
||||
static_assert(sizeof(ROI) == 4 * sizeof(int), "ROI not packed");
|
||||
auto narg = socket.Receive<int>();
|
||||
std::vector<ROI> arg;
|
||||
for (int iloop = 0; iloop < narg; ++iloop) {
|
||||
ROI temp{};
|
||||
socket.Receive(temp);
|
||||
arg.push_back(temp);
|
||||
}
|
||||
FILE_LOG(logDEBUG1) << "Set ROI narg: " << narg;
|
||||
for (int iloop = 0; iloop < narg; ++iloop) {
|
||||
FILE_LOG(logDEBUG1)
|
||||
<< "(" << arg[iloop].xmin << ", " << arg[iloop].xmax << ", "
|
||||
<< arg[iloop].ymin << ", " << arg[iloop].ymax << ")";
|
||||
}
|
||||
static_assert(sizeof(ROI) == 2 * sizeof(int), "ROI not packed");
|
||||
ROI arg;
|
||||
socket.Receive(arg);
|
||||
FILE_LOG(logDEBUG1) << "Set ROI: [" << arg.xmin << ", " << arg.xmax << "]";
|
||||
|
||||
if (myDetectorType == EIGER || myDetectorType == JUNGFRAU)
|
||||
if (myDetectorType != GOTTHARD)
|
||||
functionNotImplemented();
|
||||
|
||||
VerifyIdle(socket);
|
||||
|
||||
Reference in New Issue
Block a user