mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-31 22:34:57 +01:00
added black background for reciever to see gray font better
This commit is contained in:
@@ -135,7 +135,7 @@ void DataStreamer::RecordFirstIndices(uint64_t fnum) {
|
||||
}
|
||||
|
||||
#ifdef VERBOSE
|
||||
cprintf(BLUE,"%d First Acquisition Index:%lld\tFirst Measurement Index:%lld\n",
|
||||
bprintf(BLUE,"%d First Acquisition Index:%lld\tFirst Measurement Index:%lld\n",
|
||||
index, (long long int)firstAcquisitionIndex, (long long int)firstMeasurementIndex);
|
||||
#endif
|
||||
}
|
||||
@@ -166,10 +166,10 @@ int DataStreamer::CreateZmqSockets(int* dindex, int* nunits) {
|
||||
|
||||
zmqSocket = new ZmqSocket(portnum);
|
||||
if (zmqSocket->IsError()) {
|
||||
cprintf(RED, "Error: Could not create Zmq socket on port %d for Streamer %d\n", portnum, index);
|
||||
bprintf(RED, "Error: Could not create Zmq socket on port %d for Streamer %d\n", portnum, index);
|
||||
return FAIL;
|
||||
}
|
||||
printf("%d Streamer: Zmq Server started at %s\n",index, zmqSocket->GetZmqServerAddress());
|
||||
FILE_LOG(logINFO) << index << " Streamer: Zmq Server started at " << zmqSocket->GetZmqServerAddress();
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -186,13 +186,13 @@ void DataStreamer::ThreadExecution() {
|
||||
char* buffer=0;
|
||||
fifo->PopAddressToStream(buffer);
|
||||
#ifdef FIFODEBUG
|
||||
if (!index) cprintf(BLUE,"DataStreamer %d, pop 0x%p buffer:%s\n", index,(void*)(buffer),buffer);
|
||||
if (!index) bprintf(BLUE,"DataStreamer %d, pop 0x%p buffer:%s\n", index,(void*)(buffer),buffer);
|
||||
#endif
|
||||
|
||||
//check dummy
|
||||
uint32_t numBytes = (uint32_t)(*((uint32_t*)buffer));
|
||||
#ifdef VERBOSE
|
||||
cprintf(GREEN,"DataStreamer %d, Numbytes:%u\n", index,numBytes);
|
||||
bprintf(GREEN,"DataStreamer %d, Numbytes:%u\n", index,numBytes);
|
||||
#endif
|
||||
if (numBytes == DUMMY_PACKET_VALUE) {
|
||||
StopProcessing(buffer);
|
||||
@@ -211,17 +211,17 @@ void DataStreamer::ThreadExecution() {
|
||||
void DataStreamer::StopProcessing(char* buf) {
|
||||
#ifdef VERBOSE
|
||||
if (!index)
|
||||
cprintf(RED,"DataStreamer %d: Dummy\n", index);
|
||||
bprintf(RED,"DataStreamer %d: Dummy\n", index);
|
||||
#endif
|
||||
sls_detector_header* header = (sls_detector_header*) (buf);
|
||||
//send dummy header and data
|
||||
if (!SendHeader(header, true))
|
||||
cprintf(RED,"Error: Could not send zmq dummy header for streamer %d\n", index);
|
||||
bprintf(RED,"Error: Could not send zmq dummy header for streamer %d\n", index);
|
||||
|
||||
fifo->FreeAddress(buf);
|
||||
StopRunning();
|
||||
#ifdef VERBOSE
|
||||
printf("%d: Streaming Completed\n", index);
|
||||
FILE_LOG(logINFO) << index << ": Streaming Completed";
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -231,12 +231,12 @@ void DataStreamer::ProcessAnImage(char* buf) {
|
||||
sls_detector_header* header = (sls_detector_header*) (buf);
|
||||
uint64_t fnum = header->frameNumber;
|
||||
#ifdef VERBOSE
|
||||
cprintf(MAGENTA,"DataStreamer %d: fnum:%lu\n", index,fnum);
|
||||
bprintf(MAGENTA,"DataStreamer %d: fnum:%lu\n", index,fnum);
|
||||
#endif
|
||||
|
||||
if (!measurementStartedFlag) {
|
||||
#ifdef VERBOSE
|
||||
if (!index) cprintf(MAGENTA,"DataStreamer %d: fnum:%lu\n", index, fnum);
|
||||
if (!index) bprintf(MAGENTA,"DataStreamer %d: fnum:%lu\n", index, fnum);
|
||||
#endif
|
||||
RecordFirstIndices(fnum);
|
||||
//restart timer
|
||||
@@ -255,20 +255,20 @@ void DataStreamer::ProcessAnImage(char* buf) {
|
||||
}
|
||||
|
||||
if (!SendHeader(header))
|
||||
cprintf(RED,"Error: Could not send zmq header for fnum %lld and streamer %d\n",
|
||||
bprintf(RED,"Error: Could not send zmq header for fnum %lld and streamer %d\n",
|
||||
(long long int) fnum, index);
|
||||
|
||||
//shortframe gotthard - data sending
|
||||
if (completeBuffer) {
|
||||
memcpy(completeBuffer + ((generalData->imageSize)**shortFrameEnable), buf + sizeof(sls_detector_header), generalData->imageSize);
|
||||
if (!zmqSocket->SendData(completeBuffer, generalData->imageSize_Streamer))
|
||||
cprintf(RED,"Error: Could not send zmq data for fnum %lld and streamer %d\n",
|
||||
bprintf(RED,"Error: Could not send zmq data for fnum %lld and streamer %d\n",
|
||||
(long long int) fnum, index);
|
||||
}
|
||||
//normal - data sending
|
||||
else {
|
||||
if (!zmqSocket->SendData(buf + sizeof(sls_detector_header), generalData->imageSize))
|
||||
cprintf(RED,"Error: Could not send zmq data for fnum %lld and streamer %d\n",
|
||||
bprintf(RED,"Error: Could not send zmq data for fnum %lld and streamer %d\n",
|
||||
(long long int) fnum, index);
|
||||
}
|
||||
}
|
||||
@@ -279,7 +279,7 @@ bool DataStreamer::CheckTimer() {
|
||||
struct timespec end;
|
||||
clock_gettime(CLOCK_REALTIME, &end);
|
||||
#ifdef VERBOSE
|
||||
cprintf(BLUE,"%d Timer elapsed time:%f seconds\n", index, ( end.tv_sec - timerBegin.tv_sec ) + ( end.tv_nsec - timerBegin.tv_nsec ) / 1000000000.0);
|
||||
bprintf(BLUE,"%d Timer elapsed time:%f seconds\n", index, ( end.tv_sec - timerBegin.tv_sec ) + ( end.tv_nsec - timerBegin.tv_nsec ) / 1000000000.0);
|
||||
#endif
|
||||
//still less than streaming timer, keep waiting
|
||||
if((( end.tv_sec - timerBegin.tv_sec ) + ( end.tv_nsec - timerBegin.tv_nsec ) / 1000000000.0) < (*streamingTimerInMs/1000))
|
||||
|
||||
Reference in New Issue
Block a user