Merge branch 'master' into eiger_receiver

Conflicts:
	include/slsReceiverTCPIPInterface.h
	slsReceiver/slsReceiver.cpp
	src/UDPStandardImplementation.cpp
	src/slsReceiverTCPIPInterface.cpp

it compiles
This commit is contained in:
2014-11-11 15:53:48 +01:00
committed by Manuel Guizar
17 changed files with 362 additions and 209 deletions

View File

@ -213,6 +213,7 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
* Set UDP Port Number
*/
void setUDPPortNo(int p);
void setUDPPortNo2(int p);
/*
* Returns number of frames to receive
@ -287,9 +288,9 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
* @param c pointer to current file name
* @param raw address of pointer, pointing to current frame to send to gui
* @param fnum frame number for eiger as it is not in the packet
* @param fstartind is the start index of the acquisition
*/
void readFrame(char* c,char** raw, uint32_t &fnum);
void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind);
/**
* Closes all files
* @param ithr thread index
@ -777,6 +778,8 @@ protected:
* 2 we open, close, write file, callback does not do anything */
int cbAction;
/** true if bottom half module for eiger */
bool bottom;
public:

View File

@ -281,6 +281,11 @@ class UDPInterface {
*/
virtual void setUDPPortNo(int p) = 0;
/**
* Set UDP Port Number
*/
virtual void setUDPPortNo2(int p) = 0;
/**
* Set Ethernet Interface or IP to listen to
*/
@ -322,8 +327,9 @@ class UDPInterface {
* @param c pointer to current file name
* @param raw address of pointer, pointing to current frame to send to gui
* @param fnum frame number for eiger as it is not in the packet
* @param fstartind is the start index of the acquisition
*/
virtual void readFrame(char* c,char** raw, uint32_t &fnum) = 0;
virtual void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind ) = 0;
/** set status to transmitting and
* when fifo is empty later, sets status to run_finished

View File

@ -223,6 +223,7 @@ class UDPRESTImplementation : protected virtual slsReceiverDefs, public UDPBaseI
* Set UDP Port Number
*/
void setUDPPortNo(int p);
void setUDPPortNo2(int p);
/*
* Returns number of frames to receive
@ -300,7 +301,7 @@ class UDPRESTImplementation : protected virtual slsReceiverDefs, public UDPBaseI
* @param raw address of pointer, pointing to current frame to send to gui
* @param fnum frame number for eiger as it is not in the packet
*/
void readFrame(char* c,char** raw, uint32_t &fnum);
void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind);
/**
* Closes all files

View File

@ -212,6 +212,10 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
* Set UDP Port Number
*/
void setUDPPortNo(int p);
/**
* Set UDP Port Number
*/
void setUDPPortNo2(int p);
/*
* Returns number of frames to receive
@ -287,8 +291,7 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
* @param raw address of pointer, pointing to current frame to send to gui
* @param fnum frame number for eiger as it is not in the packet
*/
void readFrame(char* c,char** raw, uint32_t &fnum);
void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind);
/**
* Closes all files
* @param ithr thread index

View File

@ -61,6 +61,8 @@ class sockaddr_in;
#endif
#include <stdlib.h> /******exit */
#include <unistd.h>
#include <string.h>
#include <iostream>
@ -558,6 +560,16 @@ enum communicationProtocol{
break;
case UDP:
if (socketDescriptor<0) return -1;
/*
cout <<"******listening inside genericsocket"<<endl;
for(int i=0;i<10000;i++){
nsent = recvfrom(socketDescriptor,(char*)buf+total_sent,5000, 0, (struct sockaddr *) &clientAddress, &clientAddress_length);
cout<<i<<":"<<nsent<<"\t\t";
}
exit(-1);
*/
//if length given, listens to length, else listens for packetsize till length is reached
if(length){
while(length>0){

View File

@ -1,11 +1,11 @@
//#define SVNPATH ""
#define SVNURL "git@gitorious.psi.ch:sls_det_software/sls_receiver_software.git"
//#define SVNREPPATH ""
#define SVNREPUUID "1c259aeba8b068b9f6e550d63a9a3a14bd7d3ab7"
//#define SVNREV 0x6
#define SVNREPUUID "e019a6ce7d96d4ac9cb5762b7137245aedb4d5b8"
//#define SVNREV 0x22
//#define SVNKIND ""
//#define SVNSCHED ""
#define SVNAUTH "Maliakal_Dhanya"
#define SVNREV 0x6
#define SVNDATE 0x20140603
#define SVNAUTH "Anna_Bergamaschi"
#define SVNREV 0x22
#define SVNDATE 0x20141015
//

View File

@ -26,9 +26,11 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs {
* @param succecc socket creation was successfull
* @param rbase pointer to the receiver base
* @param pn port number (defaults to default port number)
* @param bot mode is bottom if true, else its a top half module
*/
slsReceiverTCPIPInterface(int &success, UDPInterface* rbase, int pn=-1);
slsReceiverTCPIPInterface(int &success, UDPInterface* rbase, int pn=-1, bool bot=false);
/**
* Sets the port number to listen to.
Take care that the client must know to whcih port it has to listen to, so normally it is better to use a fixes port from the instatiation or change it from the client.
@ -272,6 +274,9 @@ private:
/** port number */
int portNumber;
/** true if bottom half module for eiger */
bool bottom;
protected:
/** Socket */

View File

@ -43,7 +43,7 @@ class slsReceiverUDPFunctions : private virtual slsReceiverDefs, public UDPInter
/**
* Constructor
*/
slsReceiverUDPFunctions();
slsReceiverUDPFunctions(bool bot);
/**
* Destructor
@ -216,6 +216,11 @@ class slsReceiverUDPFunctions : private virtual slsReceiverDefs, public UDPInter
*/
void setUDPPortNo(int p);
/**
* Set UDP Port Number2
*/
void setUDPPortNo2(int p);
/*
* Returns number of frames to receive
* This is the number of frames to expect to receiver from the detector.
@ -289,8 +294,9 @@ class slsReceiverUDPFunctions : private virtual slsReceiverDefs, public UDPInter
* @param c pointer to current file name
* @param raw address of pointer, pointing to current frame to send to gui
* @param fnum frame number for eiger as it is not in the packet
* @param fstartind is the start index of the acquisition
*/
void readFrame(char* c,char** raw, uint32_t &fnum);
void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind);
/**
* Closes all files
@ -471,7 +477,6 @@ private:
unsigned char header_after[24];
} eiger_image_header;
/** structure of an eiger image header*/
typedef struct
{
@ -766,6 +771,9 @@ private:
* 2 we open, close, write file, callback does not do anything */
int cbAction;
/** true if bottom half module for eiger */
bool bottom;
public:

View File

@ -55,7 +55,9 @@ public:
GOTTHARD, /**< gotthard */
PICASSO, /**< picasso */
AGIPD, /**< agipd */
MOENCH /**< moench */
MOENCH, /**< moench */
JUNGFRAU, /**< jungfrau */
JUNGFRAUCTB /**< jungfrauCTBversion */
};
@ -85,7 +87,9 @@ public:
MEASUREMENT_TIME, /**< Time of the measurement from the detector (fifo) */
PROGRESS, /**< fraction of measurement elapsed - only get! */
MEASUREMENTS_NUMBER
MEASUREMENTS_NUMBER,
FRAMES_FROM_START,
FRAMES_FROM_START_PG
};

View File

@ -8,7 +8,7 @@
enum {
//General functions
F_EXEC_RECEIVER_COMMAND=0, /**< command is executed */
F_EXEC_RECEIVER_COMMAND=128, /**< command is executed */
F_EXIT_RECEIVER, /**< turn off receiver server */
F_LOCK_RECEIVER, /**< Locks/Unlocks server communication to the given client */
F_GET_LAST_RECEIVER_CLIENT_IP, /**< returns the IP of the client last connected to the receiver */