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