mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 11:20:04 +02:00
rx noRoi should not create files for port (#499)
This commit is contained in:
parent
3d3e70c718
commit
5be50785fb
@ -57,6 +57,7 @@ void DataProcessor::SetActivate(bool enable) { activated_ = enable; }
|
|||||||
void DataProcessor::SetReceiverROI(ROI roi) {
|
void DataProcessor::SetReceiverROI(ROI roi) {
|
||||||
receiverRoi_ = roi;
|
receiverRoi_ = roi;
|
||||||
receiverRoiEnabled_ = receiverRoi_.completeRoi() ? false : true;
|
receiverRoiEnabled_ = receiverRoi_.completeRoi() ? false : true;
|
||||||
|
receiverNoRoi_ = receiverRoi_.noRoi();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataProcessor::ResetParametersforNewAcquisition() {
|
void DataProcessor::ResetParametersforNewAcquisition() {
|
||||||
@ -125,8 +126,8 @@ void DataProcessor::CreateFirstFiles(
|
|||||||
}
|
}
|
||||||
CloseFiles();
|
CloseFiles();
|
||||||
|
|
||||||
// deactivated (half module/ single port), dont write file
|
// deactivated (half module/ single port or no roi), dont write file
|
||||||
if (!activated_ || !detectorDataStream) {
|
if (!activated_ || !detectorDataStream || receiverNoRoi_) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,6 +156,7 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
|||||||
bool activated_{false};
|
bool activated_{false};
|
||||||
ROI receiverRoi_{};
|
ROI receiverRoi_{};
|
||||||
bool receiverRoiEnabled_{false};
|
bool receiverRoiEnabled_{false};
|
||||||
|
bool receiverNoRoi_{false};
|
||||||
std::unique_ptr<char[]> completeImageToStreamBeforeCropping;
|
std::unique_ptr<char[]> completeImageToStreamBeforeCropping;
|
||||||
/** if 0, sending random images with a timer */
|
/** if 0, sending random images with a timer */
|
||||||
uint32_t *streamingFrequency_;
|
uint32_t *streamingFrequency_;
|
||||||
|
@ -440,6 +440,8 @@ void Implementation::setReceiverROI(const slsDetectorDefs::ROI arg) {
|
|||||||
portRois[iPort] = portRoi;
|
portRois[iPort] = portRoi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (size_t i = 0; i != listener.size(); ++i)
|
||||||
|
listener[i]->SetNoRoi(portRois[i].noRoi());
|
||||||
for (size_t i = 0; i != dataProcessor.size(); ++i)
|
for (size_t i = 0; i != dataProcessor.size(); ++i)
|
||||||
dataProcessor[i]->SetReceiverROI(portRois[i]);
|
dataProcessor[i]->SetReceiverROI(portRois[i]);
|
||||||
LOG(logINFO) << "receiver roi: " << ToString(receiverRoi);
|
LOG(logINFO) << "receiver roi: " << ToString(receiverRoi);
|
||||||
@ -721,6 +723,9 @@ void Implementation::stopReceiver() {
|
|||||||
} else if (!detectorDataStream[i]) {
|
} else if (!detectorDataStream[i]) {
|
||||||
summary = (i == 0 ? "\n\tDeactivated Left Port"
|
summary = (i == 0 ? "\n\tDeactivated Left Port"
|
||||||
: "\n\tDeactivated Right Port");
|
: "\n\tDeactivated Right Port");
|
||||||
|
} else if (portRois[i].noRoi()) {
|
||||||
|
summary = (i == 0 ? "\n\tNo Roi on Left Port"
|
||||||
|
: "\n\tNo Roi on Right Port");
|
||||||
} else {
|
} else {
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << "\n\tMissing Packets\t\t: " << mpMessage
|
os << "\n\tMissing Packets\t\t: " << mpMessage
|
||||||
@ -1002,6 +1007,7 @@ void Implementation::setNumberofUDPInterfaces(const int n) {
|
|||||||
&silentMode));
|
&silentMode));
|
||||||
listener[i]->SetGeneralData(generalData);
|
listener[i]->SetGeneralData(generalData);
|
||||||
listener[i]->SetActivate(activated);
|
listener[i]->SetActivate(activated);
|
||||||
|
listener[i]->SetNoRoi(portRois[i].noRoi());
|
||||||
|
|
||||||
int ctbAnalogDataBytes = 0;
|
int ctbAnalogDataBytes = 0;
|
||||||
if (detType == CHIPTESTBOARD) {
|
if (detType == CHIPTESTBOARD) {
|
||||||
|
@ -48,10 +48,7 @@ uint64_t Listener::GetLastFrameIndexCaught() const {
|
|||||||
|
|
||||||
int64_t Listener::GetNumMissingPacket(bool stoppedFlag,
|
int64_t Listener::GetNumMissingPacket(bool stoppedFlag,
|
||||||
uint64_t numPackets) const {
|
uint64_t numPackets) const {
|
||||||
if (!activated) {
|
if (!activated || !(*detectorDataStream) || noRoi) {
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (!(*detectorDataStream)) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!stoppedFlag) {
|
if (!stoppedFlag) {
|
||||||
@ -119,8 +116,10 @@ void Listener::SetGeneralData(GeneralData *g) { generalData = g; }
|
|||||||
|
|
||||||
void Listener::SetActivate(bool enable) { activated = enable; }
|
void Listener::SetActivate(bool enable) { activated = enable; }
|
||||||
|
|
||||||
|
void Listener::SetNoRoi(bool enable) {noRoi = enable; }
|
||||||
|
|
||||||
void Listener::CreateUDPSockets() {
|
void Listener::CreateUDPSockets() {
|
||||||
if (!activated || !(*detectorDataStream)) {
|
if (!activated || !(*detectorDataStream) || noRoi) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,7 +169,7 @@ void Listener::CreateDummySocketForUDPSocketBufferSize(int s) {
|
|||||||
LOG(logINFO) << "Testing UDP Socket Buffer size " << s << " with test port "
|
LOG(logINFO) << "Testing UDP Socket Buffer size " << s << " with test port "
|
||||||
<< *udpPortNumber;
|
<< *udpPortNumber;
|
||||||
|
|
||||||
if (!activated || !(*detectorDataStream)) {
|
if (!activated || !(*detectorDataStream) || noRoi) {
|
||||||
*actualUDPSocketBufferSize = (s * 2);
|
*actualUDPSocketBufferSize = (s * 2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -229,7 +228,7 @@ void Listener::ThreadExecution() {
|
|||||||
<< std::hex << (void *)(buffer) << std::dec << ":" << buffer;
|
<< std::hex << (void *)(buffer) << std::dec << ":" << buffer;
|
||||||
|
|
||||||
// udpsocket doesnt exist
|
// udpsocket doesnt exist
|
||||||
if (activated && *detectorDataStream && !udpSocketAlive && !carryOverFlag) {
|
if (activated && *detectorDataStream && !noRoi &&!udpSocketAlive && !carryOverFlag) {
|
||||||
// LOG(logERROR) << "Listening_Thread " << index << ": UDP Socket not
|
// LOG(logERROR) << "Listening_Thread " << index << ": UDP Socket not
|
||||||
// created or shut down earlier";
|
// created or shut down earlier";
|
||||||
(*((uint32_t *)buffer)) = 0;
|
(*((uint32_t *)buffer)) = 0;
|
||||||
@ -239,7 +238,7 @@ void Listener::ThreadExecution() {
|
|||||||
|
|
||||||
// get data
|
// get data
|
||||||
if ((*status != TRANSMITTING &&
|
if ((*status != TRANSMITTING &&
|
||||||
(!activated || !(*detectorDataStream) || udpSocketAlive)) ||
|
(!activated || !(*detectorDataStream) || noRoi || udpSocketAlive)) ||
|
||||||
carryOverFlag) {
|
carryOverFlag) {
|
||||||
rc = ListenToAnImage(buffer);
|
rc = ListenToAnImage(buffer);
|
||||||
}
|
}
|
||||||
@ -317,12 +316,8 @@ uint32_t Listener::ListenToAnImage(char *buf) {
|
|||||||
memset(buf, 0, fifohsize);
|
memset(buf, 0, fifohsize);
|
||||||
new_header = (sls_receiver_header *)(buf + FIFO_HEADER_NUMBYTES);
|
new_header = (sls_receiver_header *)(buf + FIFO_HEADER_NUMBYTES);
|
||||||
|
|
||||||
// deactivated port (eiger)
|
// deactivated port (eiger) or deactivated (eiger)
|
||||||
if (!(*detectorDataStream)) {
|
if (!(*detectorDataStream) || !activated || noRoi) {
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
// deactivated (eiger)
|
|
||||||
if (!activated) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject {
|
|||||||
void ResetParametersforNewAcquisition();
|
void ResetParametersforNewAcquisition();
|
||||||
void SetGeneralData(GeneralData *g);
|
void SetGeneralData(GeneralData *g);
|
||||||
void SetActivate(bool enable);
|
void SetActivate(bool enable);
|
||||||
|
void SetNoRoi(bool enable);
|
||||||
void CreateUDPSockets();
|
void CreateUDPSockets();
|
||||||
void ShutDownUDPSocket();
|
void ShutDownUDPSocket();
|
||||||
|
|
||||||
@ -129,6 +130,7 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject {
|
|||||||
frameDiscardPolicy *frameDiscardMode;
|
frameDiscardPolicy *frameDiscardMode;
|
||||||
bool activated{false};
|
bool activated{false};
|
||||||
bool *detectorDataStream;
|
bool *detectorDataStream;
|
||||||
|
bool noRoi{false};
|
||||||
bool *silentMode;
|
bool *silentMode;
|
||||||
|
|
||||||
/** row hardcoded as 1D or 2d,
|
/** row hardcoded as 1D or 2d,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user