mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
made updatereceiver to actually update client in parameters that it can
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
Path: slsDetectorsPackage/slsReceiverSoftware
|
||||
URL: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git
|
||||
Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git
|
||||
Repsitory UUID: 55bce97b990e627682fc8dc7b38ed883fe155fde
|
||||
Revision: 599
|
||||
Branch: developer
|
||||
Repsitory UUID: 93d7b6862d591a0615e8f6f710aca7c69040dd97
|
||||
Revision: 601
|
||||
Branch: updaterec
|
||||
Last Changed Author: Dhanya_Maliakal
|
||||
Last Changed Rev: 604
|
||||
Last Changed Date: 2017-06-30 18:17:33 +0200
|
||||
Last Changed Rev: 606
|
||||
Last Changed Date: 2017-07-03 13:45:45 +0200
|
||||
|
@ -166,7 +166,7 @@ class BinaryFileStatic {
|
||||
(long long int)acquisitionPeriod,
|
||||
ctime(&t));
|
||||
if (strlen(message) > MAX_STR_LENGTH) {
|
||||
bprintf(BG_RED,"Master File Size %d is greater than max str size %d\n",
|
||||
bprintf(RED,"Master File Size %d is greater than max str size %d\n",
|
||||
(int)strlen(message), MAX_STR_LENGTH);
|
||||
return 1;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
//on background black
|
||||
#define bprintf(code, format, ...) printf(code BG_BLACK format RESET, ##__VA_ARGS__)
|
||||
|
||||
//normal printout
|
||||
#define cprintf(code, format, ...) printf(code format RESET, ##__VA_ARGS__)
|
||||
/*
|
||||
|
@ -1,11 +1,11 @@
|
||||
//#define SVNPATH ""
|
||||
#define SVNURL "git@git.psi.ch:sls_detectors_software/sls_receiver_software.git"
|
||||
//#define SVNREPPATH ""
|
||||
#define SVNREPUUID "55bce97b990e627682fc8dc7b38ed883fe155fde"
|
||||
//#define SVNREV 0x604
|
||||
#define SVNREPUUID "93d7b6862d591a0615e8f6f710aca7c69040dd97"
|
||||
//#define SVNREV 0x606
|
||||
//#define SVNKIND ""
|
||||
//#define SVNSCHED ""
|
||||
#define SVNAUTH "Dhanya_Maliakal"
|
||||
#define SVNREV 0x604
|
||||
#define SVNDATE 0x20170630
|
||||
#define SVNREV 0x606
|
||||
#define SVNDATE 0x20170703
|
||||
//
|
||||
|
@ -297,7 +297,6 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs {
|
||||
/** port number */
|
||||
int portNumber;
|
||||
|
||||
|
||||
//***callback parameters***
|
||||
/**
|
||||
* Call back for start acquisition
|
||||
|
@ -59,7 +59,7 @@ void HDF5File::PrintMembers() {
|
||||
} else if (datatype == PredType::STD_U32LE) {
|
||||
FILE_LOG(logINFO) << "Data Type: 32";
|
||||
} else {
|
||||
FILE_LOG(logERROR) << BG_RED,"unknown data type";
|
||||
FILE_LOG(logERROR) << "unknown data type";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -275,7 +275,7 @@ void Listener::ThreadExecution() {
|
||||
|
||||
//error check, (should not be here) if not transmitting yet (previous if) rc should be > 0
|
||||
if (rc <= 0) {
|
||||
//bprintf(BG_RED,"Error:(Weird Early self shut down), UDP Sockets not shut down, but received nothing\n");
|
||||
//cprintf(RED,"Error:(Weird Early self shut down), UDP Sockets not shut down, but received nothing\n");
|
||||
StopListening(buffer);
|
||||
return;
|
||||
}
|
||||
@ -343,7 +343,7 @@ uint32_t Listener::ListenToAnImage(char* buf) {
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
if (fnum != currentFrameIndex) {
|
||||
if (fnum < currentFrameIndex) {
|
||||
bprintf(BG_RED,"Error:(Weird), With carry flag: Frame number %lu less than current frame number %lu\n", fnum, currentFrameIndex);
|
||||
bprintf(RED,"Error:(Weird), With carry flag: Frame number %lu less than current frame number %lu\n", fnum, currentFrameIndex);
|
||||
return 0;
|
||||
}
|
||||
new_header->packetNumber = numpackets;
|
||||
|
@ -203,9 +203,9 @@ int UDPStandardImplementation::setDataStreamEnable(const bool enable) {
|
||||
}
|
||||
if (DataStreamer::GetErrorMask() || error) {
|
||||
if (DataStreamer::GetErrorMask())
|
||||
bprintf(BG_RED,"Error: Could not create data callback threads\n");
|
||||
bprintf(RED,"Error: Could not create data callback threads\n");
|
||||
else
|
||||
bprintf(BG_RED,"Error: Could not create zmq sockets\n");
|
||||
bprintf(RED,"Error: Could not create zmq sockets\n");
|
||||
for (vector<DataStreamer*>::const_iterator it = dataStreamer.begin(); it != dataStreamer.end(); ++it)
|
||||
delete(*it);
|
||||
dataStreamer.clear();
|
||||
@ -731,7 +731,7 @@ int UDPStandardImplementation::SetupFifoStructure() {
|
||||
(generalData->imageSize) * numberofJobs + (generalData->fifoBufferHeaderSize),
|
||||
fifoDepth, success));
|
||||
if (!success) {
|
||||
bprintf(BG_RED,"Error: Could not allocate memory for fifo structure of index %d\n", i);
|
||||
bprintf(RED,"Error: Could not allocate memory for fifo structure of index %d\n", i);
|
||||
for (vector<Fifo*>::const_iterator it = fifo.begin(); it != fifo.end(); ++it)
|
||||
delete(*it);
|
||||
fifo.clear();
|
||||
|
@ -510,6 +510,7 @@ int slsReceiverTCPIPInterface::lock_receiver() {
|
||||
|
||||
int slsReceiverTCPIPInterface::get_last_client_ip() {
|
||||
ret = OK;
|
||||
|
||||
if (mySock->differentClients)
|
||||
ret = FORCE_UPDATE;
|
||||
|
||||
@ -602,7 +603,8 @@ int slsReceiverTCPIPInterface::update_client() {
|
||||
|
||||
// send answer
|
||||
mySock->SendDataOnly(&ret,sizeof(ret));
|
||||
if (ret == FAIL){
|
||||
//fail and force_update
|
||||
if (ret != OK){
|
||||
mySock->SendDataOnly(mess,sizeof(mess));
|
||||
// return ok/fail
|
||||
return ret;
|
||||
@ -622,7 +624,7 @@ int slsReceiverTCPIPInterface::send_update() {
|
||||
|
||||
mySock->SendDataOnly(mySock->lastClientIP,sizeof(mySock->lastClientIP));
|
||||
|
||||
//filepath
|
||||
// filepath
|
||||
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
|
||||
path = receiverBase->getFilePath();
|
||||
#endif
|
||||
@ -633,7 +635,7 @@ int slsReceiverTCPIPInterface::send_update() {
|
||||
delete[] path;
|
||||
}
|
||||
|
||||
//filename
|
||||
// filename
|
||||
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
|
||||
path = receiverBase->getFileName();
|
||||
#endif
|
||||
@ -644,27 +646,29 @@ int slsReceiverTCPIPInterface::send_update() {
|
||||
delete[] path;
|
||||
}
|
||||
|
||||
//index
|
||||
// index
|
||||
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
|
||||
ind=receiverBase->getFileIndex();
|
||||
#endif
|
||||
mySock->SendDataOnly(&ind,sizeof(ind));
|
||||
|
||||
//file format
|
||||
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
|
||||
ind=(int)receiverBase->getFileFormat();
|
||||
#endif
|
||||
mySock->SendDataOnly(&ind,sizeof(ind));
|
||||
|
||||
// file path
|
||||
// file name
|
||||
// file index
|
||||
// file format
|
||||
// file write enable
|
||||
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
|
||||
ind=(int)receiverBase->getFileWriteEnable();
|
||||
#endif
|
||||
mySock->SendDataOnly(&ind,sizeof(ind));
|
||||
|
||||
// file overwrite enable
|
||||
|
||||
// activate
|
||||
// fifo depth
|
||||
|
||||
// data stream enable
|
||||
// receiver read frequency
|
||||
// receiver read timer
|
||||
|
||||
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
|
||||
ind=(int)receiverBase->getOverwriteEnable();
|
||||
#endif
|
||||
mySock->SendDataOnly(&ind,sizeof(ind));
|
||||
|
||||
if (!lockStatus)
|
||||
strcpy(mySock->lastClientIP,mySock->thisClientIP);
|
||||
@ -747,6 +751,10 @@ int slsReceiverTCPIPInterface::set_detector_type(){
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// client has started updating receiver, update ip
|
||||
if (!lockStatus)
|
||||
strcpy(mySock->lastClientIP,mySock->thisClientIP);
|
||||
|
||||
|
||||
if (ret == OK && mySock->differentClients)
|
||||
ret = FORCE_UPDATE;
|
||||
|
Reference in New Issue
Block a user