commit e2f9d69677c384564cb367881b8804fa22779e3b Author: bergamaschi Date: Fri Oct 9 14:10:09 2009 +0000 SlsDetector client library and servers. First import. git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@1 951219d9-93cf-4727-9268-0efd64621fa3 diff --git a/slsDetectorSoftware/.__afsCE79 b/slsDetectorSoftware/.__afsCE79 new file mode 100755 index 000000000..9ba87c69c Binary files /dev/null and b/slsDetectorSoftware/.__afsCE79 differ diff --git a/slsDetectorSoftware/Makefile b/slsDetectorSoftware/Makefile new file mode 100644 index 000000000..5be377fce --- /dev/null +++ b/slsDetectorSoftware/Makefile @@ -0,0 +1,37 @@ +CFLAGS= -DC_ONLY +#FLAGS=-DVERBOSE +INCLUDES= -I commonFiles -I slsDetector -I MySocketTCP -I eigerDetector -ImythenDetector -I usersFunctions + + +#SRC_H= slsDetector/slsDetector.h mythenDetector/mythenDetector.h eigerDetector/eigerDetector.h MySocketTCP/MySocketTCP.h usersFunctions/usersFunctions.h commonFiles/sls_detector_defs.h + +#mythenDetectorServer/communication_funcs.h mythenDetectorServer/firmware_funcs.h mythenDetectorServer/mcb_funcs.h mythenDetectorServer/registers.h mythenDetectorServer/server_defs.h mythenDetectorServer/server_funcs.h mythenDetectorServer/trimming_funcs.h + + +SRC_CLNT= slsDetector/slsDetector.cpp MySocketTCP/MySocketTCP.cxx usersFunctions/usersFunctions.c mythenDetector/mythenDetector.cpp eigerDetector/eigerDetector.cpp + +SRC_MYTHEN_SVC = mythenDetectorServer/server.c mythenDetectorServer/server_funcs.c commonFiles/communication_funcs.c mythenDetectorServer/firmware_funcs.c mythenDetectorServer/mcb_funcs.c mythenDetectorServer/trimming_funcs.c mythenDetectorServer/sharedmemory.c + +all: package mythenServer doc + +doc: $(SRC_H) $(SRC_CLNT) + doxygen doxy.config + + + + +mythenServer: $(SRC_MYTHEN_SVC) + gcc $(SRC_MYTHEN_SVC) $(CFLAGS) $(FLAGS) $(INCLUDES) -ImythenDetectorServer -D VIRTUAL -lm -D MCB_FUNCS + mv a.out bin/mythenDetectorServer + + + +package: $(SRC_CLNT) + gcc -fPIC -g -o objs/slsDetector.o -c -Wall slsDetector/slsDetector.cpp $(INCLUDES) + gcc -fPIC -g -o objs/eigerDetector.o -c -Wall eigerDetector/eigerDetector.cpp $(INCLUDES) + gcc -fPIC -g -o objs/usersFunctions.o -c -Wall usersFunctions/usersFunctions.c $(INCLUDES) + gcc -fPIC -g -o objs/MySocketTCP.o -c -Wall MySocketTCP/MySocketTCP.cxx $(INCLUDES) + gcc -shared -Wl,-soname,libSlsDetector.so.1 -o bin/libSlsDetector.so.1.0.1 objs/slsDetector.o objs/eigerDetector.o objs/usersFunctions.o objs/MySocketTCP.o -lc $(INCLUDES) + +clean: + rm bin/* core objs/* diff --git a/slsDetectorSoftware/MySocketTCP/._.DS_Store b/slsDetectorSoftware/MySocketTCP/._.DS_Store new file mode 100644 index 000000000..c9474ea62 Binary files /dev/null and b/slsDetectorSoftware/MySocketTCP/._.DS_Store differ diff --git a/slsDetectorSoftware/MySocketTCP/Makefile b/slsDetectorSoftware/MySocketTCP/Makefile new file mode 100644 index 000000000..69634f361 --- /dev/null +++ b/slsDetectorSoftware/MySocketTCP/Makefile @@ -0,0 +1,23 @@ + +TOBECLEANED = MySocketTCP.o + +PROGRAMS = rec send + +all: $(PROGRAMS) + +clean: + @rm -f $(TOBECLEANED) $(PROGRAMS) + +rec: MySocketTCP.o rec.cxx + g++ -o $@ $^ + @echo "$@ done" + +send: MySocketTCP.o send.cxx + g++ -o $@ $^ + @echo "$@ done" + +MySocketTCP.o: MySocketTCP.cxx MySocketTCP.h + g++ -c $< + @echo "$@ done" + + diff --git a/slsDetectorSoftware/MySocketTCP/MySocketTCP.c b/slsDetectorSoftware/MySocketTCP/MySocketTCP.c new file mode 120000 index 000000000..a995312db --- /dev/null +++ b/slsDetectorSoftware/MySocketTCP/MySocketTCP.c @@ -0,0 +1 @@ +MySocketTCP.cxx \ No newline at end of file diff --git a/slsDetectorSoftware/MySocketTCP/MySocketTCP.cxx b/slsDetectorSoftware/MySocketTCP/MySocketTCP.cxx new file mode 100644 index 000000000..e7317281a --- /dev/null +++ b/slsDetectorSoftware/MySocketTCP/MySocketTCP.cxx @@ -0,0 +1,231 @@ + +//version 1.0, ba +#include "MySocketTCP.h" + + + + + +using namespace std; +//se development ij 19/01/09 + +#include +#include +#include +MySocketTCP::~MySocketTCP(){ + Disconnect(); + if (socketDescriptor >= 0){ + close(socketDescriptor); + } + file_des=-1; +} + + +MySocketTCP::MySocketTCP(unsigned short int const port_number): last_keep_connection_open_action_was_a_send(0), file_des(-1), send_rec_max_size(SEND_REC_MAX_SIZE), is_a_server(1), portno(DEFAULT_PORTNO), socketDescriptor(-1) +{ // receiver (server) local no need for ip + //is_a_server = 1; + + portno=port_number; + strcpy(hostname,"localhost"); + // SetupParameters(); + + socketDescriptor = socket(AF_INET, SOCK_STREAM,0); //tcp + + if (socketDescriptor < 0) { + cerr << "Can not create socket "<h_addrtype; + memcpy((char *) &serverAddress.sin_addr.s_addr, + hostInfo->h_addr_list[0], hostInfo->h_length); + serverAddress.sin_port = htons(port_number); + socketDescriptor=0; //You can use send and recv, //would it work????? + } +} + + +int MySocketTCP::getHostname(char *name) { + if (is_a_server==0) { + strcpy(name,hostname); + } + return is_a_server; +}; + + + + + +int MySocketTCP::Connect(){ + + if(file_des>0) return file_des; + + + if(is_a_server){ //server; the server will wait for the clients connection + + + if (socketDescriptor>0) { + if ((file_des = accept(socketDescriptor,(struct sockaddr *) &clientAddress, &clientAddress_length)) < 0) { + + cerr << "Error: with server accept, connection refused"<=0){ //then was open + if(is_a_server){ + close(file_des); + } + else { + close(socketDescriptor); + socketDescriptor=-1; + } + file_des=-1; + } + +} + +int MySocketTCP::SendDataOnly(void* buf,int length){//length in characters + + +#ifdef VERY_VERBOSE + + cout << "want to send "<< length << " Bytes" << endl; +#endif + + if (file_des<0) return -1; + int total_sent=0; + while(length>0){ + int nsending = (length>send_rec_max_size) ? send_rec_max_size:length; + int nsent = write(file_des,(char*)buf+total_sent,nsending); + if(!nsent) break; + length-=nsent; + total_sent+=nsent; + // cout<<"nsent: "<0){ + int nreceiving = (length>send_rec_max_size) ? send_rec_max_size:length; + int nreceived = read(file_des,(char*)buf+total_received,nreceiving); + if(!nreceived) break; + length-=nreceived; + total_received+=nreceived; + // cout<<"nrec: "< +#include +#include +#include + + +#include + +class MySocketTCP{ + + public: + MySocketTCP(const char* const host_ip_or_name, unsigned short int const port_number); // sender (client): where to? ip + MySocketTCP(unsigned short int const port_number); // receiver (server) local no need for ip + ~MySocketTCP(); + + int getHostname(char *name); + int getPortNumber(){return portno;}; + int getErrorStatus(){if (socketDescriptor<0) return 1; else return 0;}; + + + + int Connect(); //establish connection a Disconnect should always follow + void Disconnect(); //free connection + + //The following two functions will connectioned->send/receive->disconnect + int SendData(void* buf,int length);//length in characters + int ReceiveData(void* buf,int length); + + + //The following two functions stay connected, blocking other connections, and must be manually disconnected, + // when the last call is a SendData() or ReceiveData() the disconnection will be done automatically + //These function will also automatically disconnect->reconnect if + // two reads (or two writes) are called in a row to preserve the data send/receive structure + int SendDataAndKeepConnection(void* buf,int length); + int ReceiveDataAndKeepConnection(void* buf,int length); + + + // Danger! These functions do not connect nor disconnect nor flush the data! be sure that send-receive match perfectly on both server and client side! + int SendDataOnly(void* buf,int length); + int ReceiveDataOnly(void* buf,int length); + + private: + + char hostname[1000]; + int portno; + + int is_a_server; + int socketDescriptor; + struct sockaddr_in clientAddress, serverAddress; + socklen_t clientAddress_length; + + int file_des; + + int send_rec_max_size; + bool last_keep_connection_open_action_was_a_send; + + + // void SetupParameters(); + +}; +#endif diff --git a/slsDetectorSoftware/MySocketTCP/rec b/slsDetectorSoftware/MySocketTCP/rec new file mode 100755 index 000000000..1bb8670a3 Binary files /dev/null and b/slsDetectorSoftware/MySocketTCP/rec differ diff --git a/slsDetectorSoftware/MySocketTCP/rec.cxx b/slsDetectorSoftware/MySocketTCP/rec.cxx new file mode 100644 index 000000000..fe937cb14 --- /dev/null +++ b/slsDetectorSoftware/MySocketTCP/rec.cxx @@ -0,0 +1,31 @@ + +//version 1.0, base development ij 19/01/09 + +#include +#include "MySocketTCP.h" + +using namespace std; + +int main(){ + + char data[50000]; + int length=50000; + + unsigned short int portnum = 1952; + MySocketTCP* sock = new MySocketTCP(portnum); + + cout<<"\tReceived :"<ReceiveDataAndKeepConnection(data,23000)<ReceiveData(data,32200)<ReceiveData(data,33300)<ReceiveData(data,30000)<ReceiveData(data,3222)< +#include "MySocketTCP.h" + +using namespace std; + +int main(int argc, char *argv[]){ + + if(argc!=2){ + cout<<"Usage: send ip_addess/hostName"<SendDataAndKeepConnection(data,2000)<SendData(data,2200)<SendData(data,1200)<SendData(data,25000)<SendData(data,222)< +#include /* for TCP_NODELAY */ +#include +#include +#include +#include + + + +//int socketDescriptor, file_des; +int socketDescriptor, file_des; +const int send_rec_max_size=SEND_REC_MAX_SIZE; +extern int errno; + +//struct sockaddr_in address; +//#define VERY_VERBOSE + + +int bindSocket(unsigned short int port_number) { + int i; + + struct sockaddr_in addressS; + + + file_des= -1; + socketDescriptor = socket(AF_INET, SOCK_STREAM,0); //tcp + + //socketDescriptor = socket(PF_INET, SOCK_STREAM, 0); + + + + if (socketDescriptor < 0) { + printf("Can not create socket\n"); + } else { + + i = 1; + setsockopt(socketDescriptor, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i)); + // setsockopt(socketDescriptor, IPPROTO_TCP, TCP_NODELAY, (char *) &i, sizeof(i)); + // TCP_CORK + + // Set some fields in the serverAddress structure. + addressS.sin_family = AF_INET; + addressS.sin_addr.s_addr = htonl(INADDR_ANY); + addressS.sin_port = htons(port_number); + + // memset(&address.sin_addr, 0, sizeof(address.sin_addr)); + + + if(bind(socketDescriptor,(struct sockaddr *) &addressS,sizeof(addressS))<0){ + + printf("Can not create socket\n"); + + socketDescriptor=-1; + } else { + listen(socketDescriptor, 5); + } + } + + + + + + + //int getrlimit(int resource, struct rlimit *rlim); + + + + + + + return socketDescriptor; + +} + + +/* +only client funcs +*/ +/* +#ifndef C_ONLY + +MySocketTCP::MySocketTCP(const char* const host_ip_or_name, unsigned short int const port_number): + last_keep_connection_open_action_was_a_send(0), file_des(-1), send_rec_max_size(SEND_REC_MAX_SIZE), is_a_server(0), portno(DEFAULT_PORTNO), socketDescriptor(-1) +{ // sender (client): where to? ip + //is_a_server = 0; + // SetupParameters(); + strcpy(hostname,host_ip_or_name); + portno=port_number; + struct hostent *hostInfo = gethostbyname(host_ip_or_name); + if (hostInfo == NULL){ + cerr << "Exiting: Problem interpreting host: " << host_ip_or_name << "\n"; + } else { + // Set some fields in the serverAddress structure. + serverAddress.sin_family = hostInfo->h_addrtype; + memcpy((char *) &serverAddress.sin_addr.s_addr, + hostInfo->h_addr_list[0], hostInfo->h_length); + serverAddress.sin_port = htons(port_number); + socketDescriptor=0; //You can use send and recv, //would it work????? + } +} + + +int MySocketTCP::getHostname(char *name) { + if (is_a_server==0) { + strcpy(name,hostname); + } + return is_a_server; +}; +#endif +*/ + + + + +int getServerError() +{ + if (socketDescriptor<0) return 1; + else return 0; +}; + + +int acceptConnection() { + struct sockaddr_in addressC; + //socklen_t address_length; + size_t address_length=sizeof(struct sockaddr_in); + + if(file_des>0) return file_des; + + +#ifndef C_ONLY + if(is_a_server){ //server; the server will wait for the clients connection +#endif + + + if (socketDescriptor>0) { + //if ((file_des = accept(socketDescriptor,(struct sockaddr *) &address, &address_length)) < 0) { + if ((file_des = accept(socketDescriptor,(struct sockaddr *) &addressC, &address_length)) < 0) { + + + printf("Error: with server accept, connection refused %d\n", errno); + + + switch(errno) { + case EWOULDBLOCK: + printf("ewouldblock eagain\n"); + break; + case EBADF: + printf("ebadf\n"); + break; + case ECONNABORTED: + printf("econnaborted\n"); + break; + case EFAULT: + printf("efault\n"); + break; + case EINTR: + printf("eintr\n"); + break; + case EINVAL: + printf("einval\n"); + break; + case EMFILE: + printf("emfile\n"); + break; + case ENFILE: + printf("enfile\n"); + break; + case ENOTSOCK: + printf("enotsock\n"); + break; + case EOPNOTSUPP: + printf("eOPNOTSUPP\n"); + break; + case ENOBUFS: + printf("ENOBUFS\n"); + break; + case ENOMEM: + printf("ENOMEM\n"); + break; + case ENOSR: + printf("ENOSR\n"); + break; + case EPROTO: + printf("EPROTO\n"); + break; + default: + printf("unknown error\n"); + } + + + socketDescriptor=-1; + } +#ifdef VERY_VERBOSE + printf("client connected %d\n", file_des); +#endif + } + + + return file_des; +} + + + + + + + +void closeConnection() { + //fflush(stdout); + //printf("Closing file_des %d\n", file_des); + //sleep(1); +#ifdef VERY_VERBOSE +#endif + if(file_des>=0) + close(file_des); + file_des=-1; +} + +void exitServer() { + if (socketDescriptor>=0) + close(socketDescriptor); +#ifdef VERY_VERBOSE + printf("Closing server\n"); +#endif + socketDescriptor=-1; +} + + + + +/* client close conenction */ +/* +#ifndef C_ONLY +void MySocketTCP::Disconnect(){ + + if(file_des>=0){ //then was open + if(is_a_server){ + close(file_des); + } + else { + close(socketDescriptor); + socketDescriptor=-1; + } + file_des=-1; + } + +} +#endif +*/ + + +int sendDataOnly(void* buf,int length) { + /* + int total_sent=0; + int nsending; + int nsent; + + +#ifdef VERY_VERBOSE + printf("want to send %d Bytes\n", length); +#endif + if (file_des<0) return -1; + + while(length>0){ + nsending = (length>send_rec_max_size) ? send_rec_max_size:length; + nsent = write(file_des,(char*)buf+total_sent,nsending); + if(!nsent) break; + length-=nsent; + total_sent+=nsent; + // cout<<"nsent: "<0){ + nreceiving = (length>send_rec_max_size) ? send_rec_max_size:length; + nreceived = read(file_des,(char*)buf+total_received,nreceiving); + if(!nreceived) break; + length-=nreceived; + total_received+=nreceived; + // cout<<"nrec: "<nchan; + ts+=sendDataOnly(myChip,sizeof(sls_detector_chip)); + ts+=sendDataOnly(myChip->chanregs,nChans*sizeof(int)); + return ts; +} + +int sendModule(sls_detector_module *myMod) { + int ts=0; + int nChips=myMod->nchip; + int nChans=myMod->nchan; + int nAdcs=myMod->nadc; + int nDacs=myMod->ndac; + ts+= sendDataOnly(myMod,sizeof(sls_detector_module)); + ts+= sendDataOnly(myMod->dacs,sizeof(float)*nDacs); + ts+= sendDataOnly(myMod->adcs,sizeof(float)*nAdcs); + ts+=sendDataOnly(myMod->chipregs,sizeof(int)*nChips); + ts+=sendDataOnly(myMod->chanregs,sizeof(int)*nChans); +#ifdef VERBOSE + printf("module %d of size %d sent register %x\n",myMod->module, ts, myMod->reg); +#endif + return ts; +} + +int receiveChannel(sls_detector_channel *myChan) { + return receiveDataOnly(myChan,sizeof(sls_detector_channel)); +} + +int receiveChip(sls_detector_chip* myChip) { + + int *ptr=myChip->chanregs; + int ts=0; + int nChans, nchanold=myChip->nchan, chdiff; + + ts+= receiveDataOnly(myChip,sizeof(sls_detector_chip)); + + + myChip->chanregs=ptr; + nChans=myChip->nchan; + chdiff=nChans-nchanold; + if (nchanold!=nChans) { + printf("wrong number of channels received!\n"); + } + + +#ifdef VERBOSE + printf("chip structure received\n"); + printf("now receiving %d channels\n", nChans); +#endif + + if (chdiff<=0) + ts+=receiveDataOnly(myChip->chanregs, sizeof(int)*nChans); + else { + ptr=malloc(chdiff*sizeof(int)); + myChip->nchan=nchanold; + ts+=receiveDataOnly(myChip->chanregs, sizeof(int)*nchanold); + ts+=receiveDataOnly(ptr, sizeof(int)*chdiff); + free(ptr); + return FAIL; + } + +#ifdef VERBOSE + printf("chip's channels received\n"); +#endif + return ts; +} + +int receiveModule(sls_detector_module* myMod) { + + + float *dacptr=myMod->dacs; + float *adcptr=myMod->adcs; + int *chipptr=myMod->chipregs, *chanptr=myMod->chanregs; + int ts=0; + int nChips, nchipold=myMod->nchip, nchipdiff; + int nChans, nchanold=myMod->nchan, nchandiff; + int nDacs, ndold=myMod->ndac, ndacdiff; + int nAdcs, naold=myMod->nadc, nadcdiff; + + + ts+= receiveDataOnly(myMod,sizeof(sls_detector_module)); + + myMod->dacs=dacptr; + myMod->adcs=adcptr; + myMod->chipregs=chipptr; + myMod->chanregs=chanptr; + + nChips=myMod->nchip; + nchipdiff=nChips-nchipold; + if (nchipold!=nChips) { + printf("received wrong number of chips\n"); + } +#ifdef VERBOSE + else + printf("received %d chips\n",nChips); +#endif + + nChans=myMod->nchan; + nchandiff=nChans-nchanold; + if (nchanold!=nChans) { + printf("received wrong number of channels\n"); + } +#ifdef VERBOSE + else + printf("received %d chans\n",nChans); +#endif + + + nDacs=myMod->ndac; + ndacdiff=nDacs-ndold; + if (ndold!=nDacs) { + printf("received wrong number of dacs\n"); + } +#ifdef VERBOSE + else + printf("received %d dacs\n",nDacs); +#endif + + nAdcs=myMod->nadc; + nadcdiff=nAdcs-naold; + if (naold!=nAdcs) { + printf("received wrong number of adcs\n"); + } +#ifdef VERBOSE + else + printf("received %d adcs\n",nAdcs); +#endif + if (ndacdiff<=0) { + ts+=receiveDataOnly(myMod->dacs, sizeof(float)*nDacs); +#ifdef VERBOSE + printf("dacs received\n"); +#endif + } else { + dacptr=malloc(ndacdiff*sizeof(float)); + myMod->ndac=ndold; + ts+=receiveDataOnly(myMod->dacs, sizeof(float)*ndold); + ts+=receiveDataOnly(dacptr, sizeof(float)*ndacdiff); + free(dacptr); + return FAIL; + } + + if (nadcdiff<=0) { + ts+=receiveDataOnly(myMod->adcs, sizeof(float)*nAdcs); +#ifdef VERBOSE + printf("adcs received\n"); +#endif + } else { + adcptr=malloc(nadcdiff*sizeof(float)); + myMod->nadc=naold; + ts+=receiveDataOnly(myMod->adcs, sizeof(float)*naold); + ts+=receiveDataOnly(adcptr, sizeof(float)*nadcdiff); + free(adcptr); + return FAIL; + } + + if (nchipdiff<=0) { + ts+=receiveDataOnly(myMod->chipregs, sizeof(int)*nChips); +#ifdef VERBOSE + printf("chips received\n"); +#endif + } else { + chipptr=malloc(nchipdiff*sizeof(int)); + myMod->nchip=nchipold; + ts+=receiveDataOnly(myMod->chipregs, sizeof(int)*nchipold); + ts+=receiveDataOnly(chipptr, sizeof(int)*nchipdiff); + free(chipptr); + return FAIL; + } + + if (nchandiff<=0) { + ts+=receiveDataOnly(myMod->chanregs, sizeof(int)*nChans); +#ifdef VERBOSE + printf("chans received\n"); +#endif + } else { + chanptr=malloc(nchandiff*sizeof(int)); + myMod->nchan=nchanold; + ts+=receiveDataOnly(myMod->chanregs, sizeof(int)*nchanold); + ts+=receiveDataOnly(chanptr, sizeof(int)*nchandiff); + free(chanptr); + return FAIL; + } +#ifdef VERBOSE + printf("received module %d of size %d register %x\n",myMod->module,ts,myMod->reg); +#endif + return ts; +} diff --git a/slsDetectorSoftware/commonFiles/communication_funcs.h b/slsDetectorSoftware/commonFiles/communication_funcs.h new file mode 100755 index 000000000..9f4faaadf --- /dev/null +++ b/slsDetectorSoftware/commonFiles/communication_funcs.h @@ -0,0 +1,32 @@ +#ifndef COMMUNICATION_FUNCS_H +#define COMMUNICATION_FUNCS_H + +#define SEND_REC_MAX_SIZE 4096 +#define DEFAULT_PORTNO 1952 +#include +#include + + +#include +#include +#include +#include + +#include "sls_detector_defs.h" + +int bindSocket(unsigned short int port_number); +int acceptConnection(); +void closeConnection(); +void exitServer(); +int sendDataOnly(void* buf,int length); +int receiveDataOnly(void* buf,int length); + +int getServerError(); +int sendChannel(sls_detector_channel *myChan); +int sendChip(sls_detector_chip *myChip); +int sendModule(sls_detector_module *myMod); +int receiveChannel(sls_detector_channel *myChan); +int receiveChip(sls_detector_chip* myChip); +int receiveModule(sls_detector_module* myMod); + +#endif diff --git a/slsDetectorSoftware/commonFiles/sls_detector_defs.h b/slsDetectorSoftware/commonFiles/sls_detector_defs.h new file mode 100755 index 000000000..db20a7f76 --- /dev/null +++ b/slsDetectorSoftware/commonFiles/sls_detector_defs.h @@ -0,0 +1,434 @@ +#ifndef SLS_DETECTOR_DEFS_H +#define SLS_DETECTOR_DEFS_H + +#include +/** + \file sls_detector_defs.h +This file contains all the basic definitions common to the slsDetector class +and to the server programs running on the detector + + + * @author Anna Bergamaschi + * @version 0.1alpha (any string) + * @see slsDetector +*/ + +/** default maximum string length */ +#define MAX_STR_LENGTH 1000 + +/** get flag form most functions */ +#define GET_FLAG -1 +/** + structure for a detector channel + should not be used by unexperienced users + + \see ::channelRegisterBit +*/ +typedef struct { + int chan; /**< is the channel number */ + int chip; /**< is the chip number */ + int module; /**< is the module number */ + int64_t reg; /**< is the is the channel register (e.g. trimbits, calibration enable, comparator enable...) */ +} sls_detector_channel; + +/** + structure for a detector chip + should not be used by unexperienced users + \see ::chipRegisterBit ::channelRegisterBit +*/ +typedef struct { + int chip; /**< is the chip number */ + int module; /**< is the module number */ + int nchan; /**< is the number of channels in the chip */ + int reg; /** + +MySocketTCP/MySocketTCP.cxx File Reference + + + + + + +

MySocketTCP/MySocketTCP.cxx File Reference

#include "MySocketTCP.h"
+#include <string.h>
+#include <iostream>
+#include <math.h>
+ + +
+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/MySocketTCP_8h-source.html b/slsDetectorSoftware/docs/html/MySocketTCP_8h-source.html new file mode 100644 index 000000000..3a99da11f --- /dev/null +++ b/slsDetectorSoftware/docs/html/MySocketTCP_8h-source.html @@ -0,0 +1,115 @@ + + +MySocketTCP/MySocketTCP.h Source File + + + + + + +

MySocketTCP/MySocketTCP.h

Go to the documentation of this file.
00001 //version 1.0, base development ij 19/01/09
+00002 
+00003 /* Modified by anna on 19.01.2008 */
+00004 /*
+00005   canceled SetupParameters() and varaibles intialized in the constructors' headers;
+00006   defined SEND_REC_MAX_SIZE (for compatibilty with mythen (and possibly other)  pure C servers (i would move it to the common header file)
+00007 
+00008   added #ifndef C_ONLY... to cutout class definition when including in pure C servers (can be removed if SEND_REC_MAX_SIZE is moved to the common header file)
+00009 
+00010   defined private variables char hostname[1000] and int portno to store connection informations;
+00011 
+00012   defined public functions  int getHostname(char *name) and  int getPortNumber() to retrieve connection informations
+00013   
+00014   added public function int getErrorStatus() returning 1 if socketDescriptor<0
+00015 
+00016   remove exits in the constructors and replace them with socketDescriptor=-1
+00017 
+00018   replaced the argument of send/receive data with void (to avoid too much casting or compiler errors/warnings)
+00019 
+00020   added a function which really does not close the socket between send/receive (senddataonly, receivedataonly)
+00021 
+00022 */
+00023 #ifndef MY_SOCKET_TCP_H
+00024 #define MY_SOCKET_TCP_H 
+00025 
+00026 #define SEND_REC_MAX_SIZE 4096
+00027 #define DEFAULT_PORTNO    1952
+00028 
+00029 
+00030 #include <arpa/inet.h>
+00031 #include <netdb.h>
+00032 #include <netinet/in.h>
+00033 #include <unistd.h>
+00034 
+00035 
+00036 #include <math.h>
+00037 
+00038 class MySocketTCP{
+00039 
+00040  public:
+00041   MySocketTCP(const char* const host_ip_or_name, unsigned short int const port_number); // sender (client): where to? ip 
+00042   MySocketTCP(unsigned short int const port_number); // receiver (server) local no need for ip 
+00043   ~MySocketTCP();
+00044 
+00045   int getHostname(char *name);
+00046   int getPortNumber(){return portno;};
+00047   int getErrorStatus(){if (socketDescriptor<0) return 1; else return 0;};
+00048 
+00049 
+00050 
+00051   int  Connect(); //establish connection a Disconnect should always follow
+00052   void Disconnect(); //free connection
+00053 
+00054   //The following two functions will connectioned->send/receive->disconnect
+00055   int  SendData(void* buf,int length);//length in characters
+00056   int  ReceiveData(void* buf,int length);
+00057  
+00058 
+00059   //The following two functions stay connected, blocking other connections, and must be manually disconnected,
+00060   //          when the last call is a SendData() or ReceiveData() the disconnection will be done automatically
+00061   //These function will also automatically disconnect->reconnect if
+00062   //          two reads (or two writes) are called in a row to preserve the data send/receive structure 
+00063   int  SendDataAndKeepConnection(void* buf,int length);
+00064   int  ReceiveDataAndKeepConnection(void* buf,int length);
+00065 
+00066 
+00067   // Danger! These functions do not connect nor disconnect nor flush the data! be sure that send-receive match perfectly on both server and client side!
+00068   int  SendDataOnly(void* buf,int length);
+00069   int  ReceiveDataOnly(void* buf,int length);
+00070 
+00071  private:
+00072 
+00073   char hostname[1000];
+00074   int portno;
+00075 
+00076   int is_a_server;
+00077   int socketDescriptor;
+00078   struct sockaddr_in clientAddress, serverAddress;
+00079   socklen_t clientAddress_length;
+00080 
+00081   int file_des;
+00082 
+00083   int send_rec_max_size;
+00084   bool last_keep_connection_open_action_was_a_send;
+00085 
+00086 
+00087   //  void SetupParameters();
+00088 
+00089 };
+00090 #endif
+

Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/MySocketTCP_8h.html b/slsDetectorSoftware/docs/html/MySocketTCP_8h.html new file mode 100644 index 000000000..86e560077 --- /dev/null +++ b/slsDetectorSoftware/docs/html/MySocketTCP_8h.html @@ -0,0 +1,74 @@ + + +MySocketTCP/MySocketTCP.h File Reference + + + + + + +

MySocketTCP/MySocketTCP.h File Reference

#include <arpa/inet.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <unistd.h>
+#include <math.h>
+ +

+Go to the source code of this file. + + + + + + + + + +

Classes

class  MySocketTCP

Defines

#define SEND_REC_MAX_SIZE   4096
#define DEFAULT_PORTNO   1952
+


Define Documentation

+ +
+
+ + + + +
#define DEFAULT_PORTNO   1952
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define SEND_REC_MAX_SIZE   4096
+
+
+ +

+ +

+

+


Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/annotated.html b/slsDetectorSoftware/docs/html/annotated.html new file mode 100644 index 000000000..70855c713 --- /dev/null +++ b/slsDetectorSoftware/docs/html/annotated.html @@ -0,0 +1,39 @@ + + +Class List + + + + + + +

Class List

Here are the classes, structs, unions and interfaces with brief descriptions: + + + + + + + + + + + +
angleConversionConstant
eigerDetectorThis is class contains all eiger specific functionalities
iarray
MySocketTCP
mythenDetectorThis calss contains all mythen specific functions
ROI
sls_detector_channel
sls_detector_chip
sls_detector_module
slsDetectorThis is the base class for all SLS detector functionalities
slsDetector::sharedSlsDetectorStructure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!)
+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/bug.html b/slsDetectorSoftware/docs/html/bug.html new file mode 100644 index 000000000..4e4a6acee --- /dev/null +++ b/slsDetectorSoftware/docs/html/bug.html @@ -0,0 +1,24 @@ + + +Bug List + + + + + +

Bug List

+
Member slsDetector::getChip (int ichip, int imod)
+
probably does not return corretly!
+
+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/classMySocketTCP-members.html b/slsDetectorSoftware/docs/html/classMySocketTCP-members.html new file mode 100644 index 000000000..0e2acde0e --- /dev/null +++ b/slsDetectorSoftware/docs/html/classMySocketTCP-members.html @@ -0,0 +1,50 @@ + + +Member List + + + + + + +

MySocketTCP Member List

This is the complete list of members for MySocketTCP, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + +
clientAddress_lengthMySocketTCP [private]
Connect()MySocketTCP
Disconnect()MySocketTCP
file_desMySocketTCP [private]
getErrorStatus()MySocketTCP [inline]
getHostname(char *name)MySocketTCP
getPortNumber()MySocketTCP [inline]
hostnameMySocketTCP [private]
is_a_serverMySocketTCP [private]
last_keep_connection_open_action_was_a_sendMySocketTCP [private]
MySocketTCP(const char *const host_ip_or_name, unsigned short int const port_number)MySocketTCP
MySocketTCP(unsigned short int const port_number)MySocketTCP
portnoMySocketTCP [private]
ReceiveData(void *buf, int length)MySocketTCP
ReceiveDataAndKeepConnection(void *buf, int length)MySocketTCP
ReceiveDataOnly(void *buf, int length)MySocketTCP
send_rec_max_sizeMySocketTCP [private]
SendData(void *buf, int length)MySocketTCP
SendDataAndKeepConnection(void *buf, int length)MySocketTCP
SendDataOnly(void *buf, int length)MySocketTCP
serverAddressMySocketTCP [private]
socketDescriptorMySocketTCP [private]
~MySocketTCP()MySocketTCP


Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/classMySocketTCP.html b/slsDetectorSoftware/docs/html/classMySocketTCP.html new file mode 100644 index 000000000..95cdeae8b --- /dev/null +++ b/slsDetectorSoftware/docs/html/classMySocketTCP.html @@ -0,0 +1,557 @@ + + +MySocketTCP Class Reference + + + + + + +

MySocketTCP Class Reference

#include <MySocketTCP.h> +

+List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 MySocketTCP (const char *const host_ip_or_name, unsigned short int const port_number)
 MySocketTCP (unsigned short int const port_number)
 ~MySocketTCP ()
int getHostname (char *name)
int getPortNumber ()
int getErrorStatus ()
int Connect ()
void Disconnect ()
int SendData (void *buf, int length)
int ReceiveData (void *buf, int length)
int SendDataAndKeepConnection (void *buf, int length)
int ReceiveDataAndKeepConnection (void *buf, int length)
int SendDataOnly (void *buf, int length)
int ReceiveDataOnly (void *buf, int length)

Private Attributes

char hostname [1000]
int portno
int is_a_server
int socketDescriptor
sockaddr_in clientAddress serverAddress
socklen_t clientAddress_length
int file_des
int send_rec_max_size
bool last_keep_connection_open_action_was_a_send
+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
MySocketTCP::MySocketTCP (const char *const   host_ip_or_name,
unsigned short int const   port_number 
)
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + + +
MySocketTCP::MySocketTCP (unsigned short int const   port_number  ) 
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + +
MySocketTCP::~MySocketTCP (  ) 
+
+
+ +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
int MySocketTCP::Connect (  ) 
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + +
void MySocketTCP::Disconnect (  ) 
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + +
int MySocketTCP::getErrorStatus (  )  [inline]
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + + +
int MySocketTCP::getHostname (char *  name  ) 
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + +
int MySocketTCP::getPortNumber (  )  [inline]
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int MySocketTCP::ReceiveData (void *  buf,
int  length 
)
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int MySocketTCP::ReceiveDataAndKeepConnection (void *  buf,
int  length 
)
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int MySocketTCP::ReceiveDataOnly (void *  buf,
int  length 
)
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int MySocketTCP::SendData (void *  buf,
int  length 
)
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int MySocketTCP::SendDataAndKeepConnection (void *  buf,
int  length 
)
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int MySocketTCP::SendDataOnly (void *  buf,
int  length 
)
+
+
+ +

+ +

+

+


Member Data Documentation

+ +
+
+ + + + +
socklen_t MySocketTCP::clientAddress_length [private]
+
+
+ +

+ +

+

+ +

+
+ + + + +
int MySocketTCP::file_des [private]
+
+
+ +

+ +

+

+ +

+
+ + + + +
char MySocketTCP::hostname[1000] [private]
+
+
+ +

+ +

+

+ +

+
+ + + + +
int MySocketTCP::is_a_server [private]
+
+
+ +

+ +

+

+ +

+ +
+ +

+ +

+

+ +

+
+ + + + +
int MySocketTCP::portno [private]
+
+
+ +

+ +

+

+ +

+
+ + + + +
int MySocketTCP::send_rec_max_size [private]
+
+
+ +

+ +

+

+ +

+
+ + + + +
struct sockaddr_in clientAddress MySocketTCP::serverAddress [private]
+
+
+ +

+ +

+

+ +

+
+ + + + +
int MySocketTCP::socketDescriptor [private]
+
+
+ +

+ +

+

+


The documentation for this class was generated from the following files: +
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/classeigerDetector-members.html b/slsDetectorSoftware/docs/html/classeigerDetector-members.html new file mode 100644 index 000000000..b2daf2be8 --- /dev/null +++ b/slsDetectorSoftware/docs/html/classeigerDetector-members.html @@ -0,0 +1,150 @@ + + +Member List + + + + + + +

eigerDetector Member List

This is the complete list of members for eigerDetector, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
acquire()slsDetector
addToMerging(float *p1, float *v1, float *e1, float *mp, float *mv, float *me, int *mm)slsDetector
analogTest(analogTestMode mode)slsDetector
createFileName()slsDetector
createModule()slsDetector
decodeData(int *datain)eigerDetector
deleteModule(sls_detector_module *myMod)slsDetector
digitalTest(digitalTestMode mode, int imod=0)slsDetector
dumpDetectorSetup(string const fname)slsDetector
eigerDetector(int id=0)eigerDetector
enableAnalogOutput(int ichan)slsDetector
enableAnalogOutput(int imod, int ichip, int ichan)slsDetector
execCommand(string cmd, string answer)slsDetector
executeTrimming(trimMode mode, int par1, int par2, int imod=-1)slsDetector
exists()slsDetector [inline]
exitServer()slsDetector
finalizeMerging(float *mp, float *mv, float *me, int *mm)slsDetector
flatFieldCorrect(float datain, float errin, float &dataout, float &errout, float ffcoefficient, float fferr)slsDetector
flatFieldCorrect(float *datain, float *errin, float *dataout, float *errout)slsDetector
GET_ONLINE_FLAG enum valueslsDetector
getADC(dacIndex index, int imod=0)slsDetector
getAngularConversion(int &direction, angleConversionConstant *angconv=NULL)slsDetector
getBadChannelCorrections(int *bad=NULL)slsDetector
getBinSize()slsDetector [inline]
getCalDir()slsDetector [inline]
getChannel(int ichan, int ichip, int imod)slsDetector
getChip(int ichip, int imod)slsDetector
getClockDivider()slsDetector [inline]
getControlPort()slsDetector [inline]
getDataFromDetectorNoWait()slsDetector
getDataPort()slsDetector [inline]
getDetectorType(char *type)slsDetector
getFileIndex()slsDetector [inline]
getFileName()slsDetector [inline]
getFilePath()slsDetector [inline]
getFineOffset()slsDetector [inline]
getFlatFieldCorrections(float *corr=NULL, float *ecorr=NULL)slsDetector
getGlobalOffset()slsDetector [inline]
getHostname()slsDetector [inline]
getId(idMode mode, int imod=0)slsDetector
getMaxNumberOfModules(dimension d=X)slsDetector
getModule(int imod)slsDetector
getPositions(float *pos=NULL)slsDetector [inline]
getRateCorrections(float &t)slsDetector
getRateCorrections()slsDetector
getRunStatus()slsDetector
getSetLength()slsDetector [inline]
getSettings(int imod=-1)slsDetector
getStopPort()slsDetector [inline]
getThresholdEnergy(int imod=-1)slsDetector
getTimeLeft(timerIndex index)slsDetector
getTrimDir()slsDetector [inline]
getTrimEn(int *en)slsDetector [inline]
giveCalibrationPulse(float vcal, int npulses)slsDetector
OFFLINE_FLAG enum valueslsDetector
ONLINE_FLAG enum valueslsDetector
popDataQueue()slsDetector
processData()slsDetector
rateCorrect(float datain, float errin, float &dataout, float &errout, float tau, float t)slsDetector
rateCorrect(float *datain, float *errin, float *dataout, float *errout)slsDetector
readAll()slsDetector
readAngularConversion(string fname="")slsDetector
readCalibrationFile(string fname, float &gain, float &offset)eigerDetector
readConfigurationFile(string const fname)slsDetector
readDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=0)eigerDetector
readDataFile(string fname, int *data)eigerDetector
readFrame()slsDetector
readRegister(int addr)slsDetector
readTrimFile(string fname, sls_detector_module *myMod=NULL)eigerDetector
resetMerging(float *mp, float *mv, float *me, int *mm)slsDetector
retrieveDetectorSetup(string const fname)slsDetector
setAngularConversion(string fname="")slsDetector
setBadChannelCorrection(string fname="")slsDetector
setBinSize(float bs)slsDetector [inline]
setCalDir(string s)slsDetector [inline]
setChannel(int64_t reg, int ichan=-1, int ichip=-1, int imod=-1)slsDetector
setChannel(sls_detector_channel chan)slsDetector
setChip(int reg, int ichip=-1, int imod=-1)slsDetector
setChip(sls_detector_chip chip)slsDetector
setClockDivider(int i)slsDetector [inline]
setDAC(float val, dacIndex index, int imod=-1)slsDetector
setDetectorType(detectorType type=GET_DETECTOR_TYPE)slsDetector
setDetectorType(string type)slsDetector
setDynamicRange(int n=-1)slsDetector
setExternalCommunicationMode(externalCommunicationMode pol=GET_EXTERNAL_COMMUNICATION_MODE)slsDetector
setExternalSignalFlags(externalSignalFlag pol=GET_EXTERNAL_SIGNAL_FLAG, int signalindex=0)slsDetector
setFileIndex(int i)slsDetector [inline]
setFileName(string s)slsDetector [inline]
setFilePath(string s)slsDetector [inline]
setFineOffset(float f)slsDetector [inline]
setFlatFieldCorrection(string fname="")slsDetector
setGlobalOffset(float f)slsDetector [inline]
setModule(int reg, int imod=-1)slsDetector
setModule(sls_detector_module module)slsDetector
setNumberOfModules(int n, dimension d=X)slsDetector
setOnline(int const online)slsDetector
setPositions(int nPos, float *pos)slsDetector [inline]
setRateCorrection(float t=0)slsDetector
setReadOutFlags(readOutFlags flag)slsDetector
setROI(int nroi=-1, int *xmin=NULL, int *xmax=NULL, int *ymin=NULL, int *ymax=NULL)slsDetector
setSetLength(int i)slsDetector [inline]
setSettings(detectorSettings isettings, int imod=-1)slsDetector
setTCPSocket(string const name="", int const control_port=-1, int const stop_port=-1, int const data_port=-1)slsDetector
setThresholdEnergy(int e_eV, int imod=-1, detectorSettings isettings=GET_SETTINGS)slsDetector
setTimer(timerIndex index, int64_t t=-1)slsDetector
setTrimDir(string s)slsDetector [inline]
sharedSlsDetector typedefslsDetector
slsDetector(detectorType type=GENERIC, int id=0)slsDetector
startAcquisition()slsDetector
startAndReadAll()slsDetector
startAndReadAllNoWait()slsDetector
startReadOut()slsDetector
stopAcquisition()slsDetector
writeAngularConversion(string fname="")slsDetector
writeCalibrationFile(string fname, float gain, float offset)eigerDetector
writeConfigurationFile(string const fname)slsDetector
writeDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1)eigerDetector
writeDataFile(string fname, int *data)eigerDetector
writeRegister(int addr, int val)slsDetector
writeTrimFile(string fname, sls_detector_module mod)eigerDetector
writeTrimFile(string fname, int imod)eigerDetector
~eigerDetector()eigerDetector [inline]
~slsDetector()slsDetector [inline]


Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/classeigerDetector.html b/slsDetectorSoftware/docs/html/classeigerDetector.html new file mode 100644 index 000000000..20f56c637 --- /dev/null +++ b/slsDetectorSoftware/docs/html/classeigerDetector.html @@ -0,0 +1,564 @@ + + +eigerDetector Class Reference + + + + + + +

eigerDetector Class Reference

This is class contains all eiger specific functionalities. +More... +

+#include <eigerDetector.h> +

+

Inheritance diagram for eigerDetector: +

+ +slsDetector + +List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 eigerDetector (int id=0)
 ~eigerDetector ()
sls_detector_modulereadTrimFile (string fname, sls_detector_module *myMod=NULL)
int writeTrimFile (string fname, sls_detector_module mod)
int writeTrimFile (string fname, int imod)
int writeDataFile (string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1)
int writeDataFile (string fname, int *data)
int readDataFile (string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=0)
int readDataFile (string fname, int *data)
int readCalibrationFile (string fname, float &gain, float &offset)
int writeCalibrationFile (string fname, float gain, float offset)
float * decodeData (int *datain)
+

Detailed Description

+This is class contains all eiger specific functionalities. +

+The mythenDetector class contains the functions specific to the eiger detector

+

Author:
Anna Bergamaschi
+
Version:
0.1alpha (any string)
+ +

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + +
eigerDetector::eigerDetector (int  id = 0  ) 
+
+
+ +

+(default) constructor

+

Parameters:
+ + +
id is the detector index which is needed to define the shared memory id. Different physical detectors should have different IDs in order to work independently
+
+ +
+

+ +

+
+ + + + + + + + +
eigerDetector::~eigerDetector (  )  [inline]
+
+
+ +

+destructor +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + + +
float* eigerDetector::decodeData (int *  datain  ) 
+
+
+ +

+decode data from the detector converting them to an array of floats, one for each channle

Parameters:
+ + +
datain data from the detector
+
+
Returns:
pointer to a float array with a data per channel
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int eigerDetector::readCalibrationFile (string  fname,
float &  gain,
float &  offset 
)
+
+
+ +

+int readCalibrationFile(string fname, float &gain, float &offset);

+

Parameters:
+ + + +
fname file to be read
gain reference to the gain variable reference to the offset variable
+
+
See also:
sharedSlsDetector
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int eigerDetector::readDataFile (string  fname,
int *  data 
)
+
+
+ +

+reads a data file

Parameters:
+ + + +
name of the file to be read
data array of data values
+
+
Returns:
OK or FAIL if it could not read the file or data=NULL
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int eigerDetector::readDataFile (string  fname,
float *  data,
float *  err = NULL,
float *  ang = NULL,
char  dataformat = 'f',
int  nch = 0 
)
+
+
+ +

+reads a data file

Parameters:
+ + + + + + + +
name of the file to be read
data array of data values to be filled
err array of arrors on the data. If NULL no errors are expected on the file
ang array of angular values. If NULL data are expected in the form chan-val(-err) otherwise ang-val(-err)
dataformat format of the data: can be 'i' integer or 'f' float (default)
nch number of channels to be written to file. if <=0 defaults to the number of installed channels of the detector
+
+
Returns:
OK or FAIL if it could not read the file or data=NULL
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
sls_detector_module* eigerDetector::readTrimFile (string  fname,
sls_detector_module myMod = NULL 
)
+
+
+ +

+reads a trim file

Parameters:
+ + + +
fname name of the file to be read
myMod pointer to the module structure which has to be set.
+ If it is NULL a new module structure will be created
+
+
Returns:
the pointer to myMod or NULL if reading the file failed
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int eigerDetector::writeCalibrationFile (string  fname,
float  gain,
float  offset 
)
+
+
+ +

+writes a clibration file

Parameters:
+ + + + +
fname file to be written
gain 
offset 
+
+
See also:
sharedSlsDetector
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int eigerDetector::writeDataFile (string  fname,
int *  data 
)
+
+
+ +

+writes a data file

Parameters:
+ + + +
name of the file to be written
data array of data values
+
+
Returns:
OK or FAIL if it could not write the file or data=NULL
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int eigerDetector::writeDataFile (string  fname,
float *  data,
float *  err = NULL,
float *  ang = NULL,
char  dataformat = 'f',
int  nch = -1 
)
+
+
+ +

+writes a data file

Parameters:
+ + + + + + + +
name of the file to be written
data array of data values
err array of arrors on the data. If NULL no errors will be written
ang array of angular values. If NULL data will be in the form chan-val(-err) otherwise ang-val(-err)
dataformat format of the data: can be 'i' integer or 'f' float (default)
nch number of channels to be written to file. if -1 defaults to the number of installed channels of the detector
+
+
Returns:
OK or FAIL if it could not write the file or data=NULL
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int eigerDetector::writeTrimFile (string  fname,
int  imod 
)
+
+
+ +

+writes a trim file for module number imod - the values will be read from the current detector structure

Parameters:
+ + + +
fname name of the file to be written
imod module number
+
+
Returns:
OK or FAIL if the file could not be written
+
See also:
sls_detector_module sharedSlsDetector
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int eigerDetector::writeTrimFile (string  fname,
sls_detector_module  mod 
)
+
+
+ +

+writes a trim file

Parameters:
+ + + +
fname name of the file to be written
mod module structure which has to be written to file
+
+
Returns:
OK or FAIL if the file could not be written
+
See also:
sls_detector_module
+ +

+Reimplemented from slsDetector. +

+

+


The documentation for this class was generated from the following file: +
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/classeigerDetector.png b/slsDetectorSoftware/docs/html/classeigerDetector.png new file mode 100644 index 000000000..d117872db Binary files /dev/null and b/slsDetectorSoftware/docs/html/classeigerDetector.png differ diff --git a/slsDetectorSoftware/docs/html/classmythenDetector-members.html b/slsDetectorSoftware/docs/html/classmythenDetector-members.html new file mode 100644 index 000000000..283b52963 --- /dev/null +++ b/slsDetectorSoftware/docs/html/classmythenDetector-members.html @@ -0,0 +1,150 @@ + + +Member List + + + + + + +

mythenDetector Member List

This is the complete list of members for mythenDetector, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
acquire()slsDetector
addToMerging(float *p1, float *v1, float *e1, float *mp, float *mv, float *me, int *mm)mythenDetector
analogTest(analogTestMode mode)slsDetector
createFileName()slsDetector
createModule()slsDetector
decodeData(int *datain)mythenDetector
deleteModule(sls_detector_module *myMod)slsDetector
digitalTest(digitalTestMode mode, int imod=0)slsDetector
dumpDetectorSetup(string const fname)slsDetector
enableAnalogOutput(int ichan)slsDetector
enableAnalogOutput(int imod, int ichip, int ichan)slsDetector
execCommand(string cmd, string answer)slsDetector
executeTrimming(trimMode mode, int par1, int par2, int imod=-1)slsDetector
exists()slsDetector [inline]
exitServer()slsDetector
finalizeMerging(float *mp, float *mv, float *me, int *mm)mythenDetector
flatFieldCorrect(float datain, float errin, float &dataout, float &errout, float ffcoefficient, float fferr)slsDetector
flatFieldCorrect(float *datain, float *errin, float *dataout, float *errout)slsDetector
GET_ONLINE_FLAG enum valueslsDetector
getADC(dacIndex index, int imod=0)slsDetector
getAngularConversion(int &direction, angleConversionConstant *angconv=NULL)mythenDetector
getBadChannelCorrections(int *bad=NULL)slsDetector
getBinSize()mythenDetector [inline]
getCalDir()slsDetector [inline]
getChannel(int ichan, int ichip, int imod)slsDetector
getChip(int ichip, int imod)slsDetector
getClockDivider()slsDetector [inline]
getControlPort()slsDetector [inline]
getDataFromDetectorNoWait()slsDetector
getDataPort()slsDetector [inline]
getDetectorType(char *type)slsDetector
getFileIndex()slsDetector [inline]
getFileName()slsDetector [inline]
getFilePath()slsDetector [inline]
getFineOffset()mythenDetector [inline]
getFlatFieldCorrections(float *corr=NULL, float *ecorr=NULL)slsDetector
getGlobalOffset()mythenDetector [inline]
getHostname()slsDetector [inline]
getId(idMode mode, int imod=0)slsDetector
getMaxNumberOfModules(dimension d=X)slsDetector
getModule(int imod)slsDetector
getPositions(float *pos=NULL)mythenDetector [inline]
getRateCorrections(float &t)slsDetector
getRateCorrections()slsDetector
getRunStatus()slsDetector
getSetLength()slsDetector [inline]
getSettings(int imod=-1)slsDetector
getStopPort()slsDetector [inline]
getThresholdEnergy(int imod=-1)slsDetector
getTimeLeft(timerIndex index)slsDetector
getTrimDir()slsDetector [inline]
getTrimEn(int *en)slsDetector [inline]
giveCalibrationPulse(float vcal, int npulses)slsDetector
mythenDetector(int id=0)mythenDetector
OFFLINE_FLAG enum valueslsDetector
ONLINE_FLAG enum valueslsDetector
popDataQueue()slsDetector
processData()slsDetector
rateCorrect(float datain, float errin, float &dataout, float &errout, float tau, float t)slsDetector
rateCorrect(float *datain, float *errin, float *dataout, float *errout)slsDetector
readAll()slsDetector
readAngularConversion(string fname="")mythenDetector
readCalibrationFile(string fname, float &gain, float &offset)mythenDetector
readConfigurationFile(string const fname)slsDetector
readDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=0)mythenDetector
readDataFile(string fname, int *data)mythenDetector
readFrame()slsDetector
readRegister(int addr)slsDetector
readTrimFile(string fname, sls_detector_module *myMod=NULL)mythenDetector
resetMerging(float *mp, float *mv, float *me, int *mm)mythenDetector
retrieveDetectorSetup(string const fname)slsDetector
setAngularConversion(string fname="")mythenDetector
setBadChannelCorrection(string fname="")slsDetector
setBinSize(float bs)mythenDetector [inline]
setCalDir(string s)slsDetector [inline]
setChannel(int64_t reg, int ichan=-1, int ichip=-1, int imod=-1)slsDetector
setChannel(sls_detector_channel chan)slsDetector
setChip(int reg, int ichip=-1, int imod=-1)slsDetector
setChip(sls_detector_chip chip)slsDetector
setClockDivider(int i)slsDetector [inline]
setDAC(float val, dacIndex index, int imod=-1)slsDetector
setDetectorType(detectorType type=GET_DETECTOR_TYPE)slsDetector
setDetectorType(string type)slsDetector
setDynamicRange(int n=-1)slsDetector
setExternalCommunicationMode(externalCommunicationMode pol=GET_EXTERNAL_COMMUNICATION_MODE)slsDetector
setExternalSignalFlags(externalSignalFlag pol=GET_EXTERNAL_SIGNAL_FLAG, int signalindex=0)slsDetector
setFileIndex(int i)slsDetector [inline]
setFileName(string s)slsDetector [inline]
setFilePath(string s)slsDetector [inline]
setFineOffset(float f)mythenDetector [inline]
setFlatFieldCorrection(string fname="")slsDetector
setGlobalOffset(float f)mythenDetector [inline]
setModule(int reg, int imod=-1)slsDetector
setModule(sls_detector_module module)slsDetector
setNumberOfModules(int n, dimension d=X)slsDetector
setOnline(int const online)slsDetector
setPositions(int nPos, float *pos)mythenDetector [inline]
setRateCorrection(float t=0)slsDetector
setReadOutFlags(readOutFlags flag)slsDetector
setROI(int nroi=-1, int *xmin=NULL, int *xmax=NULL, int *ymin=NULL, int *ymax=NULL)slsDetector
setSetLength(int i)slsDetector [inline]
setSettings(detectorSettings isettings, int imod=-1)slsDetector
setTCPSocket(string const name="", int const control_port=-1, int const stop_port=-1, int const data_port=-1)slsDetector
setThresholdEnergy(int e_eV, int imod=-1, detectorSettings isettings=GET_SETTINGS)slsDetector
setTimer(timerIndex index, int64_t t=-1)slsDetector
setTrimDir(string s)slsDetector [inline]
sharedSlsDetector typedefslsDetector
slsDetector(detectorType type=GENERIC, int id=0)slsDetector
startAcquisition()slsDetector
startAndReadAll()slsDetector
startAndReadAllNoWait()slsDetector
startReadOut()slsDetector
stopAcquisition()slsDetector
writeAngularConversion(string fname="")mythenDetector
writeCalibrationFile(string fname, float gain, float offset)mythenDetector
writeConfigurationFile(string const fname)slsDetector
writeDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1)mythenDetector
writeDataFile(string fname, int *data)mythenDetector
writeRegister(int addr, int val)slsDetector
writeTrimFile(string fname, sls_detector_module mod)mythenDetector
writeTrimFile(string fname, int imod)mythenDetector
~mythenDetector()mythenDetector [inline]
~slsDetector()slsDetector [inline]


Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/classmythenDetector.html b/slsDetectorSoftware/docs/html/classmythenDetector.html new file mode 100644 index 000000000..605918732 --- /dev/null +++ b/slsDetectorSoftware/docs/html/classmythenDetector.html @@ -0,0 +1,1086 @@ + + +mythenDetector Class Reference + + + + + + +

mythenDetector Class Reference

This calss contains all mythen specific functions. +More... +

+#include <mythenDetector.h> +

+

Inheritance diagram for mythenDetector: +

+ +slsDetector + +List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 mythenDetector (int id=0)
 ~mythenDetector ()
sls_detector_modulereadTrimFile (string fname, sls_detector_module *myMod=NULL)
int writeTrimFile (string fname, sls_detector_module mod)
int writeTrimFile (string fname, int imod)
int writeDataFile (string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1)
int writeDataFile (string fname, int *data)
int readDataFile (string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=0)
int readDataFile (string fname, int *data)
int readCalibrationFile (string fname, float &gain, float &offset)
int writeCalibrationFile (string fname, float gain, float offset)
int readAngularConversion (string fname="")
int writeAngularConversion (string fname="")
int setAngularConversion (string fname="")
int getAngularConversion (int &direction, angleConversionConstant *angconv=NULL)
float setGlobalOffset (float f)
float setFineOffset (float f)
float getFineOffset ()
float getGlobalOffset ()
int setPositions (int nPos, float *pos)
int getPositions (float *pos=NULL)
float setBinSize (float bs)
float getBinSize ()
float * decodeData (int *datain)
int resetMerging (float *mp, float *mv, float *me, int *mm)
int addToMerging (float *p1, float *v1, float *e1, float *mp, float *mv, float *me, int *mm)
int finalizeMerging (float *mp, float *mv, float *me, int *mm)
+

Detailed Description

+This calss contains all mythen specific functions. +

+The mythenDetector class contains the functions specific to the mythen detector

+

Author:
Anna Bergamaschi
+
Version:
0.1alpha (any string)
+ +

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + +
mythenDetector::mythenDetector (int  id = 0  ) 
+
+
+ +

+(default) constructor

+

Parameters:
+ + +
id is the detector index which is needed to define the shared memory id. Different physical detectors should have different IDs in order to work independently
+
+ +
+

+ +

+
+ + + + + + + + +
mythenDetector::~mythenDetector (  )  [inline]
+
+
+ +

+destructor +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int mythenDetector::addToMerging (float *  p1,
float *  v1,
float *  e1,
float *  mp,
float *  mv,
float *  me,
int *  mm 
)
+
+
+ +

+not yet implemented merge dataset

Parameters:
+ + + + + + + + +
p1 angular positions of dataset
v1 data
e1 errors
mp already merged postions
mv already merged data
me already merged errors (squared sum)
mm multiplicity of merged arrays
+
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + +
float* mythenDetector::decodeData (int *  datain  ) 
+
+
+ +

+decode data from the detector converting them to an array of floats, one for each channle

Parameters:
+ + +
datain data from the detector
+
+
Returns:
pointer to a float array with a data per channel
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int mythenDetector::finalizeMerging (float *  mp,
float *  mv,
float *  me,
int *  mm 
)
+
+
+ +

+calculates the "final" positions, data value and errors for the emrged data

Parameters:
+ + + + + +
mp already merged postions
mv already merged data
me already merged errors (squared sum)
mm multiplicity of merged arrays
+
+
Returns:
FAIL or the
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int mythenDetector::getAngularConversion (int &  direction,
angleConversionConstant angconv = NULL 
)
+
+
+ +

+get angular conversion

Parameters:
+ + + +
reference to diffractometer direction
angconv array that will be filled with the angular conversion constants
+
+
Returns:
0 if angular conversion disabled, >0 otherwise
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + +
float mythenDetector::getBinSize (  )  [inline]
+
+
+ +

+return detector bin size used for merging (approx angular resolution) +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + +
float mythenDetector::getFineOffset (  )  [inline]
+
+
+ +

+get detector fine offset +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + +
float mythenDetector::getGlobalOffset (  )  [inline]
+
+
+ +

+get detector global offset +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + +
int mythenDetector::getPositions (float *  pos = NULL  )  [inline]
+
+
+ +

+get positions for the acquisition

Parameters:
+ + +
pos array which will contain the encoder positions
+
+
Returns:
number of positions
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + +
int mythenDetector::readAngularConversion (string  fname = ""  ) 
+
+
+ +

+reads an angular conversion file

Parameters:
+ + +
fname file to be read
+
+
See also:
angleConversionConstant
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int mythenDetector::readCalibrationFile (string  fname,
float &  gain,
float &  offset 
)
+
+
+ +

+int readCalibrationFile(string fname, float &gain, float &offset);

Parameters:
+ + + +
fname file to be read
gain reference to the gain variable reference to the offset variable
+
+
See also:
sharedSlsDetector
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int mythenDetector::readDataFile (string  fname,
int *  data 
)
+
+
+ +

+reads a data file

Parameters:
+ + + +
name of the file to be read
data array of data values
+
+
Returns:
OK or FAIL if it could not read the file or data=NULL
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int mythenDetector::readDataFile (string  fname,
float *  data,
float *  err = NULL,
float *  ang = NULL,
char  dataformat = 'f',
int  nch = 0 
)
+
+
+ +

+reads a data file

Parameters:
+ + + + + + + +
name of the file to be read
data array of data values to be filled
err array of arrors on the data. If NULL no errors are expected on the file
ang array of angular values. If NULL data are expected in the form chan-val(-err) otherwise ang-val(-err)
dataformat format of the data: can be 'i' integer or 'f' float (default)
nch number of channels to be written to file. if <=0 defaults to the number of installed channels of the detector
+
+
Returns:
OK or FAIL if it could not read the file or data=NULL
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
sls_detector_module* mythenDetector::readTrimFile (string  fname,
sls_detector_module myMod = NULL 
)
+
+
+ +

+reads a trim file

Parameters:
+ + + +
fname name of the file to be read
myMod pointer to the module structure which has to be set.
+ If it is NULL a new module structure will be created
+
+
Returns:
the pointer to myMod or NULL if reading the file failed
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int mythenDetector::resetMerging (float *  mp,
float *  mv,
float *  me,
int *  mm 
)
+
+
+ +

+sets the arrays of the merged data to 0. NB The array should be created with size >= 360./getBinSize();

Parameters:
+ + + + + +
mp already merged postions
mv already merged data
me already merged errors (squared sum)
mm multiplicity of merged arrays
+
+
Returns:
OK or FAIL
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + +
int mythenDetector::setAngularConversion (string  fname = ""  ) 
+
+
+ +

+set angular conversion

Parameters:
+ + +
fname file with angular conversion constants ("" disable)
+
+
Returns:
0 if angular conversion disabled, >0 otherwise
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + +
float mythenDetector::setBinSize (float  bs  )  [inline]
+
+
+ +

+set detector bin size used for merging (approx angular resolution) +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + +
float mythenDetector::setFineOffset (float  f  )  [inline]
+
+
+ +

+set detector fine offset +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + +
float mythenDetector::setGlobalOffset (float  f  )  [inline]
+
+
+ +

+set detector global offset +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int mythenDetector::setPositions (int  nPos,
float *  pos 
) [inline]
+
+
+ +

+set positions for the acquisition

Parameters:
+ + + +
nPos number of positions
pos array with the encoder positions
+
+
Returns:
number of positions
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + +
int mythenDetector::writeAngularConversion (string  fname = ""  ) 
+
+
+ +

+writes an angular conversion file

Parameters:
+ + +
fname file to be written
+
+
See also:
angleConversionConstant
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int mythenDetector::writeCalibrationFile (string  fname,
float  gain,
float  offset 
)
+
+
+ +

+writes a clibration file

Parameters:
+ + + + +
fname file to be written
gain 
offset 
+
+
See also:
sharedSlsDetector
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int mythenDetector::writeDataFile (string  fname,
int *  data 
)
+
+
+ +

+writes a data file

Parameters:
+ + + +
name of the file to be written
data array of data values
+
+
Returns:
OK or FAIL if it could not write the file or data=NULL
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int mythenDetector::writeDataFile (string  fname,
float *  data,
float *  err = NULL,
float *  ang = NULL,
char  dataformat = 'f',
int  nch = -1 
)
+
+
+ +

+writes a data file

Parameters:
+ + + + + + + +
name of the file to be written
data array of data values
err array of arrors on the data. If NULL no errors will be written
ang array of angular values. If NULL data will be in the form chan-val(-err) otherwise ang-val(-err)
dataformat format of the data: can be 'i' integer or 'f' float (default)
nch number of channels to be written to file. if -1 defaults to the number of installed channels of the detector
+
+
Returns:
OK or FAIL if it could not write the file or data=NULL
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int mythenDetector::writeTrimFile (string  fname,
int  imod 
)
+
+
+ +

+writes a trim file for module number imod - the values will be read from the current detector structure

Parameters:
+ + + +
fname name of the file to be written
imod module number
+
+
Returns:
OK or FAIL if the file could not be written
+
See also:
sls_detector_module sharedSlsDetector
+ +

+Reimplemented from slsDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int mythenDetector::writeTrimFile (string  fname,
sls_detector_module  mod 
)
+
+
+ +

+writes a trim file

Parameters:
+ + + +
fname name of the file to be written
mod module structure which has to be written to file
+
+
Returns:
OK or FAIL if the file could not be written
+
See also:
sls_detector_module
+ +

+Reimplemented from slsDetector. +

+

+


The documentation for this class was generated from the following file: +
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/classmythenDetector.png b/slsDetectorSoftware/docs/html/classmythenDetector.png new file mode 100644 index 000000000..9940b1bcf Binary files /dev/null and b/slsDetectorSoftware/docs/html/classmythenDetector.png differ diff --git a/slsDetectorSoftware/docs/html/classslsDetector-members.html b/slsDetectorSoftware/docs/html/classslsDetector-members.html new file mode 100644 index 000000000..b8a41a503 --- /dev/null +++ b/slsDetectorSoftware/docs/html/classslsDetector-members.html @@ -0,0 +1,185 @@ + + +Member List + + + + + + +

slsDetector Member List

This is the complete list of members for slsDetector, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
acquire()slsDetector
adcsslsDetector [private]
addToMerging(float *p1, float *v1, float *e1, float *mp, float *mv, float *me, int *mm)slsDetector
analogTest(analogTestMode mode)slsDetector
badChannelMaskslsDetector [private]
chanregsslsDetector [private]
chipregsslsDetector [private]
controlSocketslsDetector [private]
createFileName()slsDetector
createModule()slsDetector
currentI0slsDetector [private]
currentPositionslsDetector [private]
currentPositionIndexslsDetector [private]
dacsslsDetector [private]
dataProcessingThreadslsDetector [private]
dataQueueslsDetector [private]
dataSocketslsDetector [private]
decodeData(int *datain)slsDetector
deleteModule(sls_detector_module *myMod)slsDetector
detectorModulesslsDetector [private]
detIdslsDetector [private]
digitalTest(digitalTestMode mode, int imod=0)slsDetector
dumpDetectorSetup(string const fname)slsDetector
enableAnalogOutput(int ichan)slsDetector
enableAnalogOutput(int imod, int ichip, int ichan)slsDetector
execCommand(string cmd, string answer)slsDetector
executeTrimming(trimMode mode, int par1, int par2, int imod=-1)slsDetector
exists()slsDetector [inline]
exitServer()slsDetector
ffcoefficientsslsDetector [private]
fferrorsslsDetector [private]
fillBadChannelMask()slsDetector [private]
finalizeMerging(float *mp, float *mv, float *me, int *mm)slsDetector
flatFieldCorrect(float datain, float errin, float &dataout, float &errout, float ffcoefficient, float fferr)slsDetector
flatFieldCorrect(float *datain, float *errin, float *dataout, float *errout)slsDetector
freeSharedMemory()slsDetector [private]
GET_ONLINE_FLAG enum valueslsDetector
getADC(dacIndex index, int imod=0)slsDetector
getAngularConversion(int &direction, angleConversionConstant *angconv=NULL)slsDetector
getBadChannelCorrections(int *bad=NULL)slsDetector
getBinSize()slsDetector [inline]
getCalDir()slsDetector [inline]
getChannel(int ichan, int ichip, int imod)slsDetector
getChip(int ichip, int imod)slsDetector
getClockDivider()slsDetector [inline]
getControlPort()slsDetector [inline]
getDataFromDetector()slsDetector [private]
getDataFromDetectorNoWait()slsDetector
getDataPort()slsDetector [inline]
getDetectorType(char *type)slsDetector
getFileIndex()slsDetector [inline]
getFileName()slsDetector [inline]
getFilePath()slsDetector [inline]
getFineOffset()slsDetector [inline]
getFlatFieldCorrections(float *corr=NULL, float *ecorr=NULL)slsDetector
getGlobalOffset()slsDetector [inline]
getHostname()slsDetector [inline]
getId(idMode mode, int imod=0)slsDetector
getMaxNumberOfModules(dimension d=X)slsDetector
getModule(int imod)slsDetector
getPositions(float *pos=NULL)slsDetector [inline]
getRateCorrections(float &t)slsDetector
getRateCorrections()slsDetector
getRunStatus()slsDetector
getSetLength()slsDetector [inline]
getSettings(int imod=-1)slsDetector
getStopPort()slsDetector [inline]
getThresholdEnergy(int imod=-1)slsDetector
getTimeLeft(timerIndex index)slsDetector
getTrimDir()slsDetector [inline]
getTrimEn(int *en)slsDetector [inline]
giveCalibrationPulse(float vcal, int npulses)slsDetector
initializeDetectorSize(detectorType type)slsDetector [private]
initializeDetectorStructure()slsDetector [private]
initSharedMemory(detectorType type=GENERIC, int id=0)slsDetector [private]
mergingBinsslsDetector [private]
mergingCountsslsDetector [private]
mergingErrorsslsDetector [private]
mergingMultiplicityslsDetector [private]
OFFLINE_FLAG enum valueslsDetector
ONLINE_FLAG enum valueslsDetector
onlineFlagslsDetector [private]
popDataQueue()slsDetector
processData()slsDetector
rateCorrect(float datain, float errin, float &dataout, float &errout, float tau, float t)slsDetector
rateCorrect(float *datain, float *errin, float *dataout, float *errout)slsDetector
readAll()slsDetector
readAngularConversion(string fname="")slsDetector
readCalibrationFile(string fname, float &gain, float &offset)slsDetector
readConfigurationFile(string const fname)slsDetector
readDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=0)slsDetector
readDataFile(string fname, int *data)slsDetector
readFrame()slsDetector
readRegister(int addr)slsDetector
readTrimFile(string fname, sls_detector_module *myMod=NULL)slsDetector
receiveChannel(sls_detector_channel *)slsDetector [private]
receiveChip(sls_detector_chip *)slsDetector [private]
receiveModule(sls_detector_module *)slsDetector [private]
resetMerging(float *mp, float *mv, float *me, int *mm)slsDetector
retrieveDetectorSetup(string const fname)slsDetector
sendChannel(sls_detector_channel *)slsDetector [private]
sendChip(sls_detector_chip *)slsDetector [private]
sendModule(sls_detector_module *)slsDetector [private]
setAngularConversion(string fname="")slsDetector
setBadChannelCorrection(string fname="")slsDetector
setBinSize(float bs)slsDetector [inline]
setCalDir(string s)slsDetector [inline]
setChannel(int64_t reg, int ichan=-1, int ichip=-1, int imod=-1)slsDetector
setChannel(sls_detector_channel chan)slsDetector
setChip(int reg, int ichip=-1, int imod=-1)slsDetector
setChip(sls_detector_chip chip)slsDetector
setClockDivider(int i)slsDetector [inline]
setDAC(float val, dacIndex index, int imod=-1)slsDetector
setDetectorType(detectorType type=GET_DETECTOR_TYPE)slsDetector
setDetectorType(string type)slsDetector
setDynamicRange(int n=-1)slsDetector
setExternalCommunicationMode(externalCommunicationMode pol=GET_EXTERNAL_COMMUNICATION_MODE)slsDetector
setExternalSignalFlags(externalSignalFlag pol=GET_EXTERNAL_SIGNAL_FLAG, int signalindex=0)slsDetector
setFileIndex(int i)slsDetector [inline]
setFileName(string s)slsDetector [inline]
setFilePath(string s)slsDetector [inline]
setFineOffset(float f)slsDetector [inline]
setFlatFieldCorrection(string fname="")slsDetector
setGlobalOffset(float f)slsDetector [inline]
setModule(int reg, int imod=-1)slsDetector
setModule(sls_detector_module module)slsDetector
setNumberOfModules(int n, dimension d=X)slsDetector
setOnline(int const online)slsDetector
setPositions(int nPos, float *pos)slsDetector [inline]
setRateCorrection(float t=0)slsDetector
setReadOutFlags(readOutFlags flag)slsDetector
setROI(int nroi=-1, int *xmin=NULL, int *xmax=NULL, int *ymin=NULL, int *ymax=NULL)slsDetector
setSetLength(int i)slsDetector [inline]
setSettings(detectorSettings isettings, int imod=-1)slsDetector
setTCPSocket(string const name="", int const control_port=-1, int const stop_port=-1, int const data_port=-1)slsDetector
setThresholdEnergy(int e_eV, int imod=-1, detectorSettings isettings=GET_SETTINGS)slsDetector
setTimer(timerIndex index, int64_t t=-1)slsDetector
setTrimDir(string s)slsDetector [inline]
sharedSlsDetector typedefslsDetector
shmIdslsDetector [private]
slsDetector(detectorType type=GENERIC, int id=0)slsDetector
startAcquisition()slsDetector
startAndReadAll()slsDetector
startAndReadAllNoWait()slsDetector
startReadOut()slsDetector
startThread()slsDetector [private]
stopAcquisition()slsDetector
stopSocketslsDetector [private]
thisDetectorslsDetector [private]
writeAngularConversion(string fname="")slsDetector
writeCalibrationFile(string fname, float gain, float offset)slsDetector
writeConfigurationFile(string const fname)slsDetector
writeDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1)slsDetector
writeDataFile(string fname, int *data)slsDetector
writeRegister(int addr, int val)slsDetector
writeTrimFile(string fname, sls_detector_module mod)slsDetector
writeTrimFile(string fname, int imod)slsDetector
~slsDetector()slsDetector [inline]


Generated on Fri Oct 9 16:01:05 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/classslsDetector.html b/slsDetectorSoftware/docs/html/classslsDetector.html new file mode 100644 index 000000000..3779fdbb8 --- /dev/null +++ b/slsDetectorSoftware/docs/html/classslsDetector.html @@ -0,0 +1,4674 @@ + + +slsDetector Class Reference + + + + + + +

slsDetector Class Reference

This is the base class for all SLS detector functionalities. +More... +

+#include <slsDetector.h> +

+

Inheritance diagram for slsDetector: +

+ +eigerDetector +mythenDetector + +List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Types

typedef slsDetector::sharedSlsDetector sharedSlsDetector
 Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!).
 GET_ONLINE_FLAG
 OFFLINE_FLAG
 ONLINE_FLAG
enum  { GET_ONLINE_FLAG, +OFFLINE_FLAG, +ONLINE_FLAG + }

Public Member Functions

 slsDetector (detectorType type=GENERIC, int id=0)
 ~slsDetector ()
int setOnline (int const online)
int exists ()
int readConfigurationFile (string const fname)
int writeConfigurationFile (string const fname)
int dumpDetectorSetup (string const fname)
int retrieveDetectorSetup (string const fname)
int setTCPSocket (string const name="", int const control_port=-1, int const stop_port=-1, int const data_port=-1)
char * getHostname ()
int getControlPort ()
int getStopPort ()
int getDataPort ()
char * getTrimDir ()
char * setTrimDir (string s)
int getTrimEn (int *en)
sls_detector_modulereadTrimFile (string fname, sls_detector_module *myMod=NULL)
int writeTrimFile (string fname, sls_detector_module mod)
int writeTrimFile (string fname, int imod)
char * setFilePath (string s)
char * setFileName (string s)
int setFileIndex (int i)
char * getFilePath ()
char * getFileName ()
int getFileIndex ()
string createFileName ()
int writeDataFile (string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1)
int writeDataFile (string fname, int *data)
int readDataFile (string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=0)
int readDataFile (string fname, int *data)
char * getCalDir ()
char * setCalDir (string s)
int readCalibrationFile (string fname, float &gain, float &offset)
int writeCalibrationFile (string fname, float gain, float offset)
int readAngularConversion (string fname="")
int writeAngularConversion (string fname="")
int execCommand (string cmd, string answer)
int setDetectorType (detectorType type=GET_DETECTOR_TYPE)
int setDetectorType (string type)
void getDetectorType (char *type)
int setNumberOfModules (int n, dimension d=X)
int getMaxNumberOfModules (dimension d=X)
externalSignalFlag setExternalSignalFlags (externalSignalFlag pol=GET_EXTERNAL_SIGNAL_FLAG, int signalindex=0)
externalCommunicationMode setExternalCommunicationMode (externalCommunicationMode pol=GET_EXTERNAL_COMMUNICATION_MODE)
int64_t getId (idMode mode, int imod=0)
int digitalTest (digitalTestMode mode, int imod=0)
int * analogTest (analogTestMode mode)
int enableAnalogOutput (int ichan)
int enableAnalogOutput (int imod, int ichip, int ichan)
int giveCalibrationPulse (float vcal, int npulses)
int writeRegister (int addr, int val)
int readRegister (int addr)
float setDAC (float val, dacIndex index, int imod=-1)
float getADC (dacIndex index, int imod=0)
int setChannel (int64_t reg, int ichan=-1, int ichip=-1, int imod=-1)
int setChannel (sls_detector_channel chan)
sls_detector_channel getChannel (int ichan, int ichip, int imod)
int setChip (int reg, int ichip=-1, int imod=-1)
int setChip (sls_detector_chip chip)
sls_detector_chip getChip (int ichip, int imod)
int setModule (int reg, int imod=-1)
int setModule (sls_detector_module module)
sls_detector_modulegetModule (int imod)
int getThresholdEnergy (int imod=-1)
int setThresholdEnergy (int e_eV, int imod=-1, detectorSettings isettings=GET_SETTINGS)
detectorSettings getSettings (int imod=-1)
detectorSettings setSettings (detectorSettings isettings, int imod=-1)
int startAcquisition ()
int stopAcquisition ()
int startReadOut ()
int getRunStatus ()
int * startAndReadAll ()
int startAndReadAllNoWait ()
int * getDataFromDetectorNoWait ()
int * readFrame ()
int * readAll ()
int * popDataQueue ()
int64_t setTimer (timerIndex index, int64_t t=-1)
int64_t getTimeLeft (timerIndex index)
int setClockDivider (int i)
int getClockDivider ()
int setSetLength (int i)
int getSetLength ()
int setDynamicRange (int n=-1)
int setROI (int nroi=-1, int *xmin=NULL, int *xmax=NULL, int *ymin=NULL, int *ymax=NULL)
int setReadOutFlags (readOutFlags flag)
int executeTrimming (trimMode mode, int par1, int par2, int imod=-1)
int setFlatFieldCorrection (string fname="")
int getFlatFieldCorrections (float *corr=NULL, float *ecorr=NULL)
int setRateCorrection (float t=0)
int getRateCorrections (float &t)
int getRateCorrections ()
int setBadChannelCorrection (string fname="")
int getBadChannelCorrections (int *bad=NULL)
int setAngularConversion (string fname="")
int getAngularConversion (int &direction, angleConversionConstant *angconv=NULL)
float setGlobalOffset (float f)
float setFineOffset (float f)
float getFineOffset ()
float getGlobalOffset ()
int setPositions (int nPos, float *pos)
int getPositions (float *pos=NULL)
float setBinSize (float bs)
float getBinSize ()
float * decodeData (int *datain)
int flatFieldCorrect (float datain, float errin, float &dataout, float &errout, float ffcoefficient, float fferr)
int flatFieldCorrect (float *datain, float *errin, float *dataout, float *errout)
int rateCorrect (float datain, float errin, float &dataout, float &errout, float tau, float t)
int rateCorrect (float *datain, float *errin, float *dataout, float *errout)
int resetMerging (float *mp, float *mv, float *me, int *mm)
int addToMerging (float *p1, float *v1, float *e1, float *mp, float *mv, float *me, int *mm)
int finalizeMerging (float *mp, float *mv, float *me, int *mm)
int exitServer ()
void * processData ()
sls_detector_modulecreateModule ()
void deleteModule (sls_detector_module *myMod)
void acquire ()

Private Member Functions

int * getDataFromDetector ()
int initSharedMemory (detectorType type=GENERIC, int id=0)
int freeSharedMemory ()
int initializeDetectorSize (detectorType type)
int initializeDetectorStructure ()
int sendChannel (sls_detector_channel *)
int sendChip (sls_detector_chip *)
int sendModule (sls_detector_module *)
int receiveChannel (sls_detector_channel *)
int receiveChip (sls_detector_chip *)
int receiveModule (sls_detector_module *)
void startThread ()
int fillBadChannelMask ()

Private Attributes

sharedSlsDetectorthisDetector
int onlineFlag
int detId
int shmId
MySocketTCPcontrolSocket
MySocketTCPstopSocket
MySocketTCPdataSocket
queue< int * > dataQueue
pthread_t dataProcessingThread
float currentPosition
float currentPositionIndex
float currentI0
float * mergingBins
float * mergingCounts
float * mergingErrors
int * mergingMultiplicity
float * ffcoefficients
float * fferrors
sls_detector_moduledetectorModules
float * dacs
float * adcs
int * chipregs
int * chanregs
int * badChannelMask

Classes

struct  sharedSlsDetector
 Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!). More...
+

Detailed Description

+This is the base class for all SLS detector functionalities. +

+The slsDetector class is expected to become the interface class for all SLS Detectors acquisition (and analysis) software.

+

Author:
Anna Bergamaschi
+
Version:
0.1alpha (any string)
+ +

+


Member Typedef Documentation

+ +
+ +
+ +

+Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!). +

+ +

+

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+online flags enum

See also:
setOnline
+
Enumerator:
+ + + + +
GET_ONLINE_FLAG  +returns wether the detector is in online or offline state
OFFLINE_FLAG  +detector in offline state (i.e. no communication to the detector - using only local structure - no data acquisition possible!)
ONLINE_FLAG  +detector in online state (i.e. communication to the detector updating the local structure)
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
slsDetector::slsDetector (detectorType  type = GENERIC,
int  id = 0 
)
+
+
+ +

+(default) constructor

Parameters:
+ + + +
type is needed to define the size of the detector shared memory 9defaults to GENERIC i.e. the largest shared memory needed by any slsDetector is allocated
id is the detector index which is needed to define the shared memory id. Different physical detectors should have different IDs in order to work independently
+
+ +

+sets onlineFlag to OFFLINE_FLAG

+Initlializes shared memory

See also:
initSharedMemory
+if it fails the detector id is incremented until it succeeds

+Initializes the detector stucture

See also:
initializeDetectorSize
+ +
+

+ +

+
+ + + + + + + + +
slsDetector::~slsDetector (  )  [inline]
+
+
+ +

+destructor +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
void slsDetector::acquire (  ) 
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::addToMerging (float *  p1,
float *  v1,
float *  e1,
float *  mp,
float *  mv,
float *  me,
int *  mm 
)
+
+
+ +

+not yet implemented merge dataset

Parameters:
+ + + + + + + + +
p1 angular positions of dataset
v1 data
e1 errors
mp already merged postions
mv already merged data
me already merged errors (squared sum)
mm multiplicity of merged arrays
+
+ +

+Reimplemented in mythenDetector. +

+

+ +

+
+ + + + + + + + + +
int* slsDetector::analogTest (analogTestMode  mode  ) 
+
+
+ +

+analog test

Parameters:
+ + +
modte test mode
+
+
Returns:
pointer to acquired data
+not yet implemented +
+

+ +

+
+ + + + + + + + +
string slsDetector::createFileName (  ) 
+
+
+ +

+generates file name without extension

+always appends to file path and file name the run index.

+in case also appends the position index

+Filenames will be of the form: filepath/filename(_px)_i where x is the position index and i is the run index +

+

+ +

+
+ + + + + + + + +
slsDetector::sls_detector_module * slsDetector::createModule (  ) 
+
+
+ +

+Allocates the memory for a sls_detector_module structure and initializes it

Returns:
myMod the pointer to the allocate dmemory location
+ +
+

+ +

+
+ + + + + + + + + +
float * slsDetector::decodeData (int *  datain  ) 
+
+
+ +

+decode data from the detector converting them to an array of floats, one for each channle

Parameters:
+ + +
datain data from the detector
+
+
Returns:
pointer to a float array with a data per channel
+ +

+Reimplemented in mythenDetector, and eigerDetector. +

+

+ +

+
+ + + + + + + + + +
void slsDetector::deleteModule (sls_detector_module myMod  ) 
+
+
+ +

+frees the memory for a sls_detector_module structure

Parameters:
+ + +
myMod the pointer to the memory to be freed
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int slsDetector::digitalTest (digitalTestMode  mode,
int  imod = 0 
)
+
+
+ +

+Digital test of the modules

Parameters:
+ + + +
mode test mode
imod module number for chip test or module firmware test
+
+
Returns:
OK or error mask
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::dumpDetectorSetup (string const   fname  ) 
+
+
+ +

+not yet implemented

+should dump to a file all the current detector parameters +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::enableAnalogOutput (int  imod,
int  ichip,
int  ichan 
)
+
+
+ +

+enable analog output of channel ichan, chip ichip, module imod

+not yet implemented +

+

+ +

+
+ + + + + + + + + +
int slsDetector::enableAnalogOutput (int  ichan  ) 
+
+
+ +

+enable analog output of channel ichan

+not yet implemented +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int slsDetector::execCommand (string  cmd,
string  answer 
)
+
+
+ +

+executes a system command on the server e.g. mount an nfs disk, reboot and returns answer etc.

Parameters:
+ + + +
cmd is the command to be executed
answer is the answer from the detector
+
+
Returns:
OK or FAIL depending on the command outcome
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::executeTrimming (trimMode  mode,
int  par1,
int  par2,
int  imod = -1 
)
+
+
+ +

+execute trimming

Parameters:
+ + + + + +
mode trim mode
par1 if noise, beam or fixed setting trimming it is count limit, if improve maximum number of iterations
par2 if noise or beam nsigma, if improve par2!=means vthreshold will be optimized, if fixed settings par2<0 trimwith median, par2>=0 trim with level
imod module number (-1 all)
+
+
Returns:
OK or FAIl (FAIL also if some channel are 0 or 63
+ +
+

+ +

+
+ + + + + + + + +
int slsDetector::exists (  )  [inline]
+
+
+ +

+sets the onlineFlag

Returns:
1 if the detector structure has already be initlialized, 0 otherwise
+ +
+

+ +

+
+ + + + + + + + +
int slsDetector::exitServer (  ) 
+
+
+ +

+turns of server +

+

+ +

+
+ + + + + + + + +
int slsDetector::fillBadChannelMask (  )  [private]
+
+
+ +

+fill bad channel mask (0 if channel is good, 1 if bad) +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::finalizeMerging (float *  mp,
float *  mv,
float *  me,
int *  mm 
)
+
+
+ +

+calculates the "final" positions, data value and errors for the emrged data

Parameters:
+ + + + + +
mp already merged postions
mv already merged data
me already merged errors (squared sum)
mm multiplicity of merged arrays
+
+
Returns:
FAIL or the
+ +

+Reimplemented in mythenDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::flatFieldCorrect (float *  datain,
float *  errin,
float *  dataout,
float *  errout 
)
+
+
+ +

+flat field correct data

Parameters:
+ + + + + +
datain data array
errin error array on data (if NULL will default to sqrt(datain)
dataout array of corrected data
errout error on corrected data (if not NULL)
+
+
Returns:
0
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::flatFieldCorrect (float  datain,
float  errin,
float &  dataout,
float &  errout,
float  ffcoefficient,
float  fferr 
)
+
+
+ +

+flat field correct data

Parameters:
+ + + + + + + +
datain data
errin error on data (if<=0 will default to sqrt(datain)
dataout corrected data
errout error on corrected data
ffcoefficient flat field correction coefficient
fferr erro on ffcoefficient
+
+
Returns:
0
+ +
+

+ +

+
+ + + + + + + + +
int slsDetector::freeSharedMemory (  )  [private]
+
+
+ +

+Frees the shared memory - should not be used +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
float slsDetector::getADC (dacIndex  index,
int  imod = 0 
)
+
+
+ +

+set dacs value

Parameters:
+ + + +
index ADC index
imod module number
+
+
Returns:
current ADC value
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int slsDetector::getAngularConversion (int &  direction,
angleConversionConstant angconv = NULL 
)
+
+
+ +

+get angular conversion

Parameters:
+ + + +
reference to diffractometer direction
angconv array that will be filled with the angular conversion constants
+
+
Returns:
0 if angular conversion disabled, >0 otherwise
+ +

+Reimplemented in mythenDetector. +

+

+ +

+
+ + + + + + + + + +
int slsDetector::getBadChannelCorrections (int *  bad = NULL  ) 
+
+
+ +

+get bad channels correction

Parameters:
+ + +
bad pointer to array that if bad!=NULL will be filled with the bad channel list
+
+
Returns:
0 if bad channel disabled or no bad channels, >0 otherwise
+ +
+

+ +

+
+ + + + + + + + +
float slsDetector::getBinSize (  )  [inline]
+
+
+ +

+return detector bin size used for merging (approx angular resolution) +

+Reimplemented in mythenDetector. +

+

+ +

+
+ + + + + + + + +
char* slsDetector::getCalDir (  )  [inline]
+
+
+ +

+returns the location of the calibration files

See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
slsDetector::sls_detector_channel slsDetector::getChannel (int  ichan,
int  ichip,
int  imod 
)
+
+
+ +

+get channel

Parameters:
+ + + + +
ichan channel number
ichip chip number
imod module number
+
+
Returns:
current channel structure for channel
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
slsDetector::sls_detector_chip slsDetector::getChip (int  ichip,
int  imod 
)
+
+
+ +

+get chip

Parameters:
+ + + +
ichip chip number
imod module number
+
+
Returns:
current chip structure for channel
+
Bug:
probably does not return corretly!
+ +
+

+ +

+
+ + + + + + + + +
int slsDetector::getClockDivider (  )  [inline]
+
+
+ +

+get clock divider

+not implemented (should be something more general like "set speed including also waitstates, set cycles etc.) +

+

+ +

+
+ + + + + + + + +
int slsDetector::getControlPort (  )  [inline]
+
+
+ +

+returns the detector control port

See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + +
int * slsDetector::getDataFromDetector (  )  [private]
+
+
+ +

+Receives a data frame from the detector socket

Returns:
pointer to the data (or NULL if failed)
+ +
+

+ +

+
+ + + + + + + + +
int * slsDetector::getDataFromDetectorNoWait (  ) 
+
+
+ +

+receives a data frame from the detector socket

Returns:
pointer to the data or NULL. If NULL disconnects the socket
+
See also:
getDataFromDetector
+ +
+

+ +

+
+ + + + + + + + +
int slsDetector::getDataPort (  )  [inline]
+
+
+ +

+returns the detector data port

See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + + +
void slsDetector::getDetectorType (char *  type  ) 
+
+
+ +

+gets detector type normally the detector knows what type of detector it is

Parameters:
+ + +
type is the string where the detector type will be written ("Mythen", "Pilatus", "XFS", "Gotthard", Agipd")
+
+ +
+

+ +

+
+ + + + + + + + +
int slsDetector::getFileIndex (  )  [inline]
+
+
+ +

+returns the default output file index

See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + +
char* slsDetector::getFileName (  )  [inline]
+
+
+ +

+returns the default output files root name

See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + +
char* slsDetector::getFilePath (  )  [inline]
+
+
+ +

+returns the default output files path

See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + +
float slsDetector::getFineOffset (  )  [inline]
+
+
+ +

+get detector fine offset +

+Reimplemented in mythenDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int slsDetector::getFlatFieldCorrections (float *  corr = NULL,
float *  ecorr = NULL 
)
+
+
+ +

+get flat field corrections

Parameters:
+ + + +
corr if !=NULL will be filled with the correction coefficients
ecorr if !=NULL will be filled with the correction coefficients errors
+
+
Returns:
0 if ff correction disabled, >0 otherwise
+ +
+

+ +

+
+ + + + + + + + +
float slsDetector::getGlobalOffset (  )  [inline]
+
+
+ +

+get detector global offset +

+Reimplemented in mythenDetector. +

+

+ +

+
+ + + + + + + + +
char* slsDetector::getHostname (  )  [inline]
+
+
+ +

+returns the detector hostname

See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int64_t slsDetector::getId (idMode  mode,
int  imod = 0 
)
+
+
+ +

+get detector ids/versions for module

Parameters:
+ + + +
mode which id/version has to be read
imod module number for module serial number
+
+
Returns:
id
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::getMaxNumberOfModules (dimension  d = X  ) 
+
+
+ +

+get the maximum size of the detector

Parameters:
+ + +
d dimension
+
+
Returns:
maximum number of modules that can be installed in direction d
+ +
+

+ +

+
+ + + + + + + + + +
slsDetector::sls_detector_module * slsDetector::getModule (int  imod  ) 
+
+
+ +

+get module

Parameters:
+ + +
imod module number
+
+
Returns:
pointer to module structure (which has bee created and must then be deleted)
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::getPositions (float *  pos = NULL  )  [inline]
+
+
+ +

+get positions for the acquisition

Parameters:
+ + +
pos array which will contain the encoder positions
+
+
Returns:
number of positions
+ +

+Reimplemented in mythenDetector. +

+

+ +

+
+ + + + + + + + +
int slsDetector::getRateCorrections (  ) 
+
+
+ +

+get rate correction

Returns:
0 if rate correction disabled, >0 otherwise
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::getRateCorrections (float &  t  ) 
+
+
+ +

+get rate correction

Parameters:
+ + +
t reference for dead time
+
+
Returns:
0 if rate correction disabled, >0 otherwise
+ +
+

+ +

+
+ + + + + + + + +
int slsDetector::getRunStatus (  ) 
+
+
+ +

+get run status

Returns:
status mask
+ +
+

+ +

+
+ + + + + + + + +
int slsDetector::getSetLength (  )  [inline]
+
+
+ +

+get length cycles

+not implemented (should be something more general like "set speed including also waitstates, set cycles etc.) +

+

+ +

+
+ + + + + + + + + +
slsDetector::detectorSettings slsDetector::getSettings (int  imod = -1  ) 
+
+
+ +

+get detector settings

Parameters:
+ + +
imod module number (-1 all)
+
+
Returns:
current settings
+ +
+

+ +

+
+ + + + + + + + +
int slsDetector::getStopPort (  )  [inline]
+
+
+ +

+returns the detector stop port

See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::getThresholdEnergy (int  imod = -1  ) 
+
+
+ +

+get threshold energy

Parameters:
+ + +
imod module number (-1 all)
+
+
Returns:
current threshold value for imod in ev (-1 failed)
+ +
+

+ +

+
+ + + + + + + + + +
int64_t slsDetector::getTimeLeft (timerIndex  index  ) 
+
+
+ +

+get current timer value

Parameters:
+ + +
index timer index
+
+
Returns:
elapsed time value in ns or number of...(e.g. frames, gates, probes)
+ +
+

+ +

+
+ + + + + + + + +
char* slsDetector::getTrimDir (  )  [inline]
+
+
+ +

+returns the detector trimbit directory

See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::getTrimEn (int *  en  )  [inline]
+
+
+ +

+returns the number of trim energies and their value

See also:
sharedSlsDetector
+
Parameters:
+ + +
point to the array that will contain the trim energies (in ev)
+
+
Returns:
number of trim energies
+
See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int slsDetector::giveCalibrationPulse (float  vcal,
int  npulses 
)
+
+
+ +

+give a train of calibration pulses

Parameters:
+ + + +
vcal pulse amplitude
npulses number of pulses
+
+not yet implemented +
+

+ +

+
+ + + + + + + + + +
int slsDetector::initializeDetectorSize (detectorType  type  )  [private]
+
+
+ +

+Initializes the thisDetector structure

Parameters:
+ + +
type is needed to define the number of channels, chips, modules etc.
+
+
See also:
sharedSlsDetector
+ +

+if the shared memory has newly be created, initialize the detector variables

+set hostname to default

+set ports to defaults

+set thisDetector->myDetectorType to type and according to this set nChans, nChips, nDacs, nAdcs, nModMax, dynamicRange, nMod

+number of modules is initally the maximum number of modules

+calculates the expected data size

+set trimDsdir, calDir and filePath to default to home directory

+set fileName to default to run

+set fileIndex to default to 0

+set number of trim energies to 0

+set correction mask to 0

+set deat time

+set number of bad chans to 0

+set number of bad flat field chans to 0

+set angular direction to 1

+set fine offset to 0

+set global offset to 0

+set number of rois to 0

+set readoutflags to none

+set current settings to uninitialized

+set threshold to -1

+set clockdivider to 1

+set number of positions to 0

+set binsize

+calculates the memory offsets for flat field coefficients and errors, module structures, dacs, adcs, chips and channels

+also in case thisDetector alread existed initialize the pointer for flat field coefficients and errors, module structures, dacs, adcs, chips and channels

+if thisDetector is new, initialize its structures

See also:
initializeDetectorStructure();
+set thisDetector->alreadyExisting=1

+fill the BadChannelMask

See also:
fillBadChannelMask
+ +
+

+ +

+
+ + + + + + + + +
int slsDetector::initializeDetectorStructure (  )  [private]
+
+
+ +

+Initializes the module structures in thisDetector if the detector did not exists before +

+for each of the detector modules up to the maximum number which can be installed initlialize the sls_detector_module structure

See also:
sls_detector_module
+sets the size of the module to nChans, nChips etc.

+initializes the serial number and register to 0

+initializes the dacs values to 0

+initializes the adc values to 0

+initializes the chip registers to 0

+initializes the channel registers to 0

+initialize gain and offset to -1 +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int slsDetector::initSharedMemory (detectorType  type = GENERIC,
int  id = 0 
) [private]
+
+
+ +

+Initializes the shared memory

Parameters:
+ + + +
type is needed to define the size of the shared memory
id is the detector id needed to define the shared memory id
+
+
Returns:
shm_id shared memory id
+ +

+the shared memory key is set to DEFAULT_SHM_KEY+id

+The size of the shared memory is: size of shared structure + ffcoefficents +fferrors + modules+ dacs+adcs+chips+chans

+thisDetector pointer is set to the memory address of the shared memory

+shm_id returns -1 is shared memory initialization fails +

+

+ +

+
+ + + + + + + + +
int * slsDetector::popDataQueue (  ) 
+
+
+ +

+pops the data from the data queue

Returns:
pointer to the popped data or NULL if the queue is empty.
+
See also:
dataQueue
+ +
+

+ +

+
+ + + + + + + + +
void * slsDetector::processData (  ) 
+
+
+ +

+function for processing data +

+Pop data queue

+decode data

+write raw data file

+rate correction

+flat field correction

+angular conversion

+data merging

+file writing +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::rateCorrect (float *  datain,
float *  errin,
float *  dataout,
float *  errout 
)
+
+
+ +

+rate correct data

Parameters:
+ + + + + +
datain data array
errin error array on data (if NULL will default to sqrt(datain)
dataout array of corrected data
errout error on corrected data (if not NULL)
+
+
Returns:
0
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::rateCorrect (float  datain,
float  errin,
float &  dataout,
float &  errout,
float  tau,
float  t 
)
+
+
+ +

+rate correct data

Parameters:
+ + + + + + + +
datain data
errin error on data (if<=0 will default to sqrt(datain)
dataout corrected data
errout error on corrected data
tau dead time 9in ns)
t acquisition time (in ns)
+
+
Returns:
0
+ +
+

+ +

+
+ + + + + + + + +
int * slsDetector::readAll (  ) 
+
+
+ +

+asks and receives all data from the detector and puts them in a data queue

Returns:
pointer to the front of the queue or NULL.
+
See also:
getDataFromDetector dataQueue
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::readAngularConversion (string  fname = ""  ) 
+
+
+ +

+reads an angular conversion file

Parameters:
+ + +
fname file to be read
+
+
See also:
angleConversionConstant
+ +

+Reimplemented in mythenDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::readCalibrationFile (string  fname,
float &  gain,
float &  offset 
)
+
+
+ +

+reads a calibration file

Parameters:
+ + + +
fname file to be read
gain reference to the gain variable reference to the offset variable
+
+
See also:
sharedSlsDetector
+ +

+Reimplemented in mythenDetector, and eigerDetector. +

+

+ +

+
+ + + + + + + + + +
int slsDetector::readConfigurationFile (string const   fname  ) 
+
+
+ +

+Every detector should have a basic configuration file containing: type (mythen, pilatus etc.) hostname portnumber communication type (default TCP/IP) eventually secondary portnumber (e.g. mythen stop function) number of modules installed if different from the detector size (x,y)

+to be changed +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int slsDetector::readDataFile (string  fname,
int *  data 
)
+
+
+ +

+reads a data file

Parameters:
+ + + +
name of the file to be read
data array of data values
+
+
Returns:
OK or FAIL if it could not read the file or data=NULL
+ +

+Reimplemented in mythenDetector, and eigerDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::readDataFile (string  fname,
float *  data,
float *  err = NULL,
float *  ang = NULL,
char  dataformat = 'f',
int  nch = 0 
)
+
+
+ +

+reads a data file

Parameters:
+ + + + + + + +
name of the file to be read
data array of data values to be filled
err array of arrors on the data. If NULL no errors are expected on the file
ang array of angular values. If NULL data are expected in the form chan-val(-err) otherwise ang-val(-err)
dataformat format of the data: can be 'i' integer or 'f' float (default)
nch number of channels to be written to file. if <=0 defaults to the number of installed channels of the detector
+
+
Returns:
OK or FAIL if it could not read the file or data=NULL
+ +

+Reimplemented in mythenDetector, and eigerDetector. +

+

+ +

+
+ + + + + + + + +
int * slsDetector::readFrame (  ) 
+
+
+ +

+asks and receives a data frame from the detector

Returns:
pointer to the data or NULL. If NULL disconnects the socket
+
See also:
getDataFromDetector
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::readRegister (int  addr  ) 
+
+
+ +

+read register

Parameters:
+ + +
addr address
+
+
Returns:
current register value
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
sls_detector_module* slsDetector::readTrimFile (string  fname,
sls_detector_module myMod = NULL 
)
+
+
+ +

+reads a trim file

Parameters:
+ + + +
fname name of the file to be read
myMod pointer to the module structure which has to be set.
+ If it is NULL a new module structure will be created
+
+
Returns:
the pointer to myMod or NULL if reading the file failed
+ +

+Reimplemented in mythenDetector, and eigerDetector. +

+

+ +

+
+ + + + + + + + + +
int slsDetector::receiveChannel (sls_detector_channel  )  [private]
+
+
+ +

+receive a sls_detector_channel structure over socket +

+

+ +

+
+ + + + + + + + + +
int slsDetector::receiveChip (sls_detector_chip  )  [private]
+
+
+ +

+receive a sls_detector_chip structure over socket +

+

+ +

+
+ + + + + + + + + +
int slsDetector::receiveModule (sls_detector_module  )  [private]
+
+
+ +

+receive a sls_detector_module structure over socket +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::resetMerging (float *  mp,
float *  mv,
float *  me,
int *  mm 
)
+
+
+ +

+sets the arrays of the merged data to 0. NB The array should be created with size >= 360./getBinSize();

Parameters:
+ + + + + +
mp already merged postions
mv already merged data
me already merged errors (squared sum)
mm multiplicity of merged arrays
+
+
Returns:
OK or FAIL
+ +

+Reimplemented in mythenDetector. +

+

+ +

+
+ + + + + + + + + +
int slsDetector::retrieveDetectorSetup (string const   fname  ) 
+
+
+ +

+not yet implemented

+should retrieve from a file all the current detector parameters +

+

+ +

+
+ + + + + + + + + +
int slsDetector::sendChannel (sls_detector_channel  )  [private]
+
+
+ +

+send a sls_detector_channel structure over socket +

+

+ +

+
+ + + + + + + + + +
int slsDetector::sendChip (sls_detector_chip  )  [private]
+
+
+ +

+send a sls_detector_chip structure over socket +

+

+ +

+
+ + + + + + + + + +
int slsDetector::sendModule (sls_detector_module  )  [private]
+
+
+ +

+send a sls_detector_module structure over socket +

+

+ +

+
+ + + + + + + + + +
int slsDetector::setAngularConversion (string  fname = ""  ) 
+
+
+ +

+set angular conversion

Parameters:
+ + +
fname file with angular conversion constants ("" disable)
+
+
Returns:
0 if angular conversion disabled, >0 otherwise
+ +

+Reimplemented in mythenDetector. +

+

+ +

+
+ + + + + + + + + +
int slsDetector::setBadChannelCorrection (string  fname = ""  ) 
+
+
+ +

+set bad channels correction

Parameters:
+ + +
fname file with bad channel list ("" disable)
+
+
Returns:
0 if bad channel disabled, >0 otherwise
+ +
+

+ +

+
+ + + + + + + + + +
float slsDetector::setBinSize (float  bs  )  [inline]
+
+
+ +

+set detector bin size used for merging (approx angular resolution) +

+Reimplemented in mythenDetector. +

+

+ +

+
+ + + + + + + + + +
char* slsDetector::setCalDir (string  s  )  [inline]
+
+
+ +

+sets the location of the calibration files

See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::setChannel (sls_detector_channel  chan  ) 
+
+
+ +

+configure channel

Parameters:
+ + +
chan channel to be set - must contain correct channel, module and chip number
+
+
Returns:
current register value
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::setChannel (int64_t  reg,
int  ichan = -1,
int  ichip = -1,
int  imod = -1 
)
+
+
+ +

+configure channel

Parameters:
+ + + + + +
reg channel register
ichan channel number (-1 all)
ichip chip number (-1 all)
imod module number (-1 all)
+
+
Returns:
current register value
+
See also:
sls_detector_channel
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::setChip (sls_detector_chip  chip  ) 
+
+
+ +

+configure chip

Parameters:
+ + +
chip chip to be set - must contain correct module and chip number and also channel registers
+
+
Returns:
current register value
+
See also:
sls_detector_chip
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::setChip (int  reg,
int  ichip = -1,
int  imod = -1 
)
+
+
+ +

+configure chip

Parameters:
+ + + + +
reg chip register
ichip chip number (-1 all)
imod module number (-1 all)
+
+
Returns:
current register value
+
See also:
sls_detector_chip
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::setClockDivider (int  i  )  [inline]
+
+
+ +

+set clock divider

+not implemented (should be something more general like "set speed including also waitstates, set cycles etc.) +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
float slsDetector::setDAC (float  val,
dacIndex  index,
int  imod = -1 
)
+
+
+ +

+set dacs value

Parameters:
+ + + + +
val value (in V)
index DAC index
imod module number (if -1 alla modules)
+
+
Returns:
current DAC value
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::setDetectorType (string  type  ) 
+
+
+ +

+sets/gets detector type normally the detector knows what type of detector it is

Parameters:
+ + +
type is the detector type ("Mythen", "Pilatus", "XFS", "Gotthard", Agipd")
+
+
Returns:
returns detector type index (1 GENERIC, 2 MYTHEN, 3 PILATUS, 4 XFS, 5 GOTTHARD, 6 AGIPD, -1 command failed)
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::setDetectorType (detectorType  type = GET_DETECTOR_TYPE  ) 
+
+
+ +

+sets/gets detector type normally the detector knows what type of detector it is

Parameters:
+ + +
type is the detector type (defaults to GET_DETECTOR_TYPE)
+
+
Returns:
returns detector type index (1 GENERIC, 2 MYTHEN, 3 PILATUS, 4 XFS, 5 GOTTHARD, 6 AGIPD, -1 command failed)
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::setDynamicRange (int  n = -1  ) 
+
+
+ +

+set/get dynamic range

Parameters:
+ + +
n dynamic range (-1 get)
+
+
Returns:
current dynamic range updates the size of the data expected from the detector
+
See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + + +
externalCommunicationMode slsDetector::setExternalCommunicationMode (externalCommunicationMode  pol = GET_EXTERNAL_COMMUNICATION_MODE  ) 
+
+
+ +

+set/get the external communication mode

+obsolete

See also:
setExternalSignalFlags
+
Parameters:
+ + +
pol value to be set
+
+
See also:
externalCommunicationMode
+
Returns:
current external communication mode
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
externalSignalFlag slsDetector::setExternalSignalFlags (externalSignalFlag  pol = GET_EXTERNAL_SIGNAL_FLAG,
int  signalindex = 0 
)
+
+
+ +

+set/get the use of an external signal

Parameters:
+ + +
pol meaning of the signal
+
+
See also:
externalSignalFlag
+
Parameters:
+ + +
signalIndex index of the signal
+
+
Returns:
current meaning of signal signalIndex
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::setFileIndex (int  i  )  [inline]
+
+
+ +

+sets the default output file index

See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + + +
char* slsDetector::setFileName (string  s  )  [inline]
+
+
+ +

+sets the default output files root name

See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + + +
char* slsDetector::setFilePath (string  s  )  [inline]
+
+
+ +

+sets the default output files path

See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + + +
float slsDetector::setFineOffset (float  f  )  [inline]
+
+
+ +

+set detector fine offset +

+Reimplemented in mythenDetector. +

+

+ +

+
+ + + + + + + + + +
int slsDetector::setFlatFieldCorrection (string  fname = ""  ) 
+
+
+ +

+set flat field corrections

Parameters:
+ + +
fname name of the flat field file (or "" if disable)
+
+
Returns:
0 if disable (or file could not be read), >0 otherwise
+ +
+

+ +

+
+ + + + + + + + + +
float slsDetector::setGlobalOffset (float  f  )  [inline]
+
+
+ +

+set detector global offset +

+Reimplemented in mythenDetector. +

+

+ +

+
+ + + + + + + + + +
int slsDetector::setModule (sls_detector_module  module  ) 
+
+
+ +

+configure chip

Parameters:
+ + +
module module to be set - must contain correct module number and also channel and chip registers
+
+
Returns:
current register value
+
See also:
sls_detector_module
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int slsDetector::setModule (int  reg,
int  imod = -1 
)
+
+
+ +

+configure module

Parameters:
+ + +
imod module number (-1 all)
+
+
Returns:
current register value
+
See also:
sls_detector_module
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int slsDetector::setNumberOfModules (int  n,
dimension  d = X 
)
+
+
+ +

+set/get the size of the detector

Parameters:
+ + + +
n number of modules
d dimension
+
+
Returns:
current number of modules in direction d
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::setOnline (int const   online  ) 
+
+
+ +

+sets the onlineFlag

Parameters:
+ + +
off can be:
+ GET_ONLINE_FLAG, returns wether the detector is in online or offline state;
+ OFFLINE_FLAG, detector in offline state (i.e. no communication to the detector - using only local structure - no data acquisition possible!);
+ ONLINE_FLAG detector in online state (i.e. communication to the detector updating the local structure)
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int slsDetector::setPositions (int  nPos,
float *  pos 
) [inline]
+
+
+ +

+set positions for the acquisition

Parameters:
+ + + +
nPos number of positions
pos array with the encoder positions
+
+
Returns:
number of positions
+ +

+Reimplemented in mythenDetector. +

+

+ +

+
+ + + + + + + + + +
int slsDetector::setRateCorrection (float  t = 0  ) 
+
+
+ +

+set rate correction

Parameters:
+ + +
t dead time in ns - if 0 disable correction, if >0 set dead time to t, if <0 set deadtime to default dead time for current settings
+
+
Returns:
0 if rate correction disabled, >0 otherwise
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::setReadOutFlags (readOutFlags  flag  ) 
+
+
+ +

+set/get readout flags

Parameters:
+ + +
flag readout flag to be set
+
+
Returns:
current flag
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::setROI (int  nroi = -1,
int *  xmin = NULL,
int *  xmax = NULL,
int *  ymin = NULL,
int *  ymax = NULL 
)
+
+
+ +

+set roi

+not yet implemented +

+

+ +

+
+ + + + + + + + + +
int slsDetector::setSetLength (int  i  )  [inline]
+
+
+ +

+set length cycles

+not implemented (should be something more general like "set speed including also waitstates, set cycles etc.) +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
detectorSettings slsDetector::setSettings (detectorSettings  isettings,
int  imod = -1 
)
+
+
+ +

+set detector settings

Parameters:
+ + + +
isettings settings
imod module number (-1 all)
+
+
Returns:
current settings
+in this function trimbits and calibration files are searched in the trimDir and calDir directories and the detector is initialized +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::setTCPSocket (string const   name = "",
int const   control_port = -1,
int const   stop_port = -1,
int const   data_port = -1 
)
+
+
+ +

+configure the socket communication and initializes the socket instances

+

Parameters:
+ + + + + +
name hostname - if "" the current hostname is used
control_port port for control commands - if -1 the current is used
stop_port port for stop command - if -1 the current is used
data_port port for receiving data - if -1 the current is used
+
+
Returns:
OK is connection succeded, FAIL otherwise
+
See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::setThresholdEnergy (int  e_eV,
int  imod = -1,
detectorSettings  isettings = GET_SETTINGS 
)
+
+
+ +

+set threshold energy

Parameters:
+ + + + +
e_eV threshold in eV
imod module number (-1 all)
isettings ev. change settings
+
+
Returns:
current threshold value for imod in ev (-1 failed)
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int64_t slsDetector::setTimer (timerIndex  index,
int64_t  t = -1 
)
+
+
+ +

+set/get timer value

Parameters:
+ + + +
index timer index
t time in ns or number of...(e.g. frames, gates, probes)
+
+
Returns:
timer set value in ns or number of...(e.g. frames, gates, probes)
+ +
+

+ +

+
+ + + + + + + + + +
char* slsDetector::setTrimDir (string  s  )  [inline]
+
+
+ +

+sets the detector trimbit directory

See also:
sharedSlsDetector
+ +
+

+ +

+
+ + + + + + + + +
int slsDetector::startAcquisition (  ) 
+
+
+ +

+start detector acquisition

Returns:
OK/FAIL
+ +
+

+ +

+
+ + + + + + + + +
int * slsDetector::startAndReadAll (  ) 
+
+
+ +

+start detector acquisition and read all data putting them a data queue

Returns:
pointer to the fron tof the data queue
+
See also:
startAndReadAllNoWait getDataFromDetector dataQueue
+ +
+

+ +

+
+ + + + + + + + +
int slsDetector::startAndReadAllNoWait (  ) 
+
+
+ +

+start detector acquisition and read out, but does not read data from socket +

+

+ +

+
+ + + + + + + + +
int slsDetector::startReadOut (  ) 
+
+
+ +

+start readout (without exposure or interrupting exposure)

Returns:
OK/FAIL
+ +
+

+ +

+
+ + + + + + + + +
void slsDetector::startThread (  )  [private]
+
+
+ +

+start data processing threas +

+

+ +

+
+ + + + + + + + +
int slsDetector::stopAcquisition (  ) 
+
+
+ +

+stop detector acquisition

Returns:
OK/FAIL
+ +
+

+ +

+
+ + + + + + + + + +
int slsDetector::writeAngularConversion (string  fname = ""  ) 
+
+
+ +

+writes an angular conversion file

Parameters:
+ + +
fname file to be written
+
+
See also:
angleConversionConstant
+ +

+Reimplemented in mythenDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::writeCalibrationFile (string  fname,
float  gain,
float  offset 
)
+
+
+ +

+writes a clibration file

Parameters:
+ + + + +
fname file to be written
gain 
offset 
+
+
See also:
sharedSlsDetector
+ +

+Reimplemented in mythenDetector, and eigerDetector. +

+

+ +

+
+ + + + + + + + + +
int slsDetector::writeConfigurationFile (string const   fname  ) 
+
+
+ +

+Every detector should have a basic configuration file containing: type (mythen, pilatus etc.) hostname portnumber communication type (default TCP/IP) eventually secondary portnumber (e.g. mythen stop function) number of modules installed if different from the detector size (x,y)

+to be changed +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int slsDetector::writeDataFile (string  fname,
int *  data 
)
+
+
+ +

+writes a data file

Parameters:
+ + + +
name of the file to be written
data array of data values
+
+
Returns:
OK or FAIL if it could not write the file or data=NULL
+ +

+Reimplemented in mythenDetector, and eigerDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int slsDetector::writeDataFile (string  fname,
float *  data,
float *  err = NULL,
float *  ang = NULL,
char  dataformat = 'f',
int  nch = -1 
)
+
+
+ +

+writes a data file

Parameters:
+ + + + + + + +
name of the file to be written
data array of data values
err array of arrors on the data. If NULL no errors will be written
ang array of angular values. If NULL data will be in the form chan-val(-err) otherwise ang-val(-err)
dataformat format of the data: can be 'i' integer or 'f' float (default)
nch number of channels to be written to file. if -1 defaults to the number of installed channels of the detector
+
+
Returns:
OK or FAIL if it could not write the file or data=NULL
+ +

+Reimplemented in mythenDetector, and eigerDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int slsDetector::writeRegister (int  addr,
int  val 
)
+
+
+ +

+write register

Parameters:
+ + +
addr address value
+
+
Returns:
current register value
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int slsDetector::writeTrimFile (string  fname,
int  imod 
)
+
+
+ +

+writes a trim file for module number imod - the values will be read from the current detector structure

Parameters:
+ + + +
fname name of the file to be written
imod module number
+
+
Returns:
OK or FAIL if the file could not be written
+
See also:
sls_detector_module sharedSlsDetector
+ +

+Reimplemented in mythenDetector, and eigerDetector. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int slsDetector::writeTrimFile (string  fname,
sls_detector_module  mod 
)
+
+
+ +

+writes a trim file

Parameters:
+ + + +
fname name of the file to be written
mod module structure which has to be written to file
+
+
Returns:
OK or FAIL if the file could not be written
+
See also:
sls_detector_module
+ +

+Reimplemented in mythenDetector, and eigerDetector. +

+

+


Member Data Documentation

+ +
+
+ + + + +
float* slsDetector::adcs [private]
+
+
+ +

+pointer to adc valuse +

+

+ +

+
+ + + + +
int* slsDetector::badChannelMask [private]
+
+
+ +

+pointer to bad channel mask 0 is channel is good 1 if it is bad

See also:
fillBadChannelMask()
+ +
+

+ +

+
+ + + + +
int* slsDetector::chanregs [private]
+
+
+ +

+pointer to channal registers +

+

+ +

+
+ + + + +
int* slsDetector::chipregs [private]
+
+
+ +

+pointer to chip registers +

+

+ +

+
+ + + + +
MySocketTCP* slsDetector::controlSocket [private]
+
+
+ +

+socket for control commands +

+

+ +

+
+ + + + +
float slsDetector::currentI0 [private]
+
+
+ +

+I0 measured +

+

+ +

+
+ + + + +
float slsDetector::currentPosition [private]
+
+
+ +

+current position of the detector +

+

+ +

+
+ + + + +
float slsDetector::currentPositionIndex [private]
+
+
+ +

+current position index of the detector +

+

+ +

+
+ + + + +
float* slsDetector::dacs [private]
+
+
+ +

+pointer to dac valuse +

+

+ +

+
+ + + + +
pthread_t slsDetector::dataProcessingThread [private]
+
+
+ +

+data processing thread??? +

+

+ +

+
+ + + + +
queue<int*> slsDetector::dataQueue [private]
+
+
+ +

+data queue +

+

+ +

+
+ + + + +
MySocketTCP* slsDetector::dataSocket [private]
+
+
+ +

+socket for data acquisition +

+

+ +

+ +
+ +

+pointer to detector module structures +

+

+ +

+
+ + + + +
int slsDetector::detId [private]
+
+
+ +

+detector ID +

+

+ +

+
+ + + + +
float* slsDetector::ffcoefficients [private]
+
+
+ +

+pointer to flat field coefficients +

+

+ +

+
+ + + + +
float* slsDetector::fferrors [private]
+
+
+ +

+pointer to flat field coefficient errors +

+

+ +

+
+ + + + +
float* slsDetector::mergingBins [private]
+
+
+ +

+merging bins +

+

+ +

+
+ + + + +
float* slsDetector::mergingCounts [private]
+
+
+ +

+merging counts +

+

+ +

+
+ + + + +
float* slsDetector::mergingErrors [private]
+
+
+ +

+merging errors +

+

+ +

+
+ + + + +
int* slsDetector::mergingMultiplicity [private]
+
+
+ +

+merging multiplicity +

+

+ +

+
+ + + + +
int slsDetector::onlineFlag [private]
+
+
+ +

+

See also:
setOnline
+ +
+

+ +

+
+ + + + +
int slsDetector::shmId [private]
+
+
+ +

+shared memeory ID +

+

+ +

+
+ + + + +
MySocketTCP* slsDetector::stopSocket [private]
+
+
+ +

+socket for emergency stop +

+

+ +

+ +
+ +

+address of the detector structure in shared memory +

+

+


The documentation for this class was generated from the following files: +
Generated on Fri Oct 9 16:01:05 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/classslsDetector.png b/slsDetectorSoftware/docs/html/classslsDetector.png new file mode 100644 index 000000000..1117ffac2 Binary files /dev/null and b/slsDetectorSoftware/docs/html/classslsDetector.png differ diff --git a/slsDetectorSoftware/docs/html/doxygen.css b/slsDetectorSoftware/docs/html/doxygen.css new file mode 100644 index 000000000..5d583694e --- /dev/null +++ b/slsDetectorSoftware/docs/html/doxygen.css @@ -0,0 +1,358 @@ +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Geneva, Arial, Helvetica, sans-serif; +} +BODY,TD { + font-size: 90%; +} +H1 { + text-align: center; + font-size: 160%; +} +H2 { + font-size: 120%; +} +H3 { + font-size: 100%; +} +CAPTION { font-weight: bold } +DIV.qindex { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.nav { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navtab { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +TD.navtab { + font-size: 70%; +} +A.qindex { + text-decoration: none; + font-weight: bold; + color: #1A419D; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; + color: #1A419D +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} +A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} +A.codeRef:link { font-weight: normal; color: #0000FF} +A.codeRef:visited { font-weight: normal; color: #0000FF} +A:hover { text-decoration: none; background-color: #f2f2ff } +DL.el { margin-left: -1cm } +.fragment { + font-family: monospace, fixed; + font-size: 95%; +} +PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } + +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } +BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} +TD.indexkey { + background-color: #e8eef2; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #e8eef2; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { text-align: center; } +IMG.formulaDsp { } +IMG.formulaInl { vertical-align: middle; } +SPAN.keyword { color: #008000 } +SPAN.keywordtype { color: #604020 } +SPAN.keywordflow { color: #e08000 } +SPAN.comment { color: #800000 } +SPAN.preprocessor { color: #806020 } +SPAN.stringliteral { color: #002080 } +SPAN.charliteral { color: #008080 } +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 80%; +} +.search { color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +TD.tiny { font-size: 75%; +} +a { + color: #1A41A8; +} +a:visited { + color: #2A3798; +} +.dirtab { padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} +TH.dirtab { background: #e8eef2; + font-weight: bold; +} +HR { height: 1px; + border: none; + border-top: 1px solid black; +} + +/* Style for detailed member documentation */ +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; +} +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +.memitem { + padding: 4px; + background-color: #eef3f5; + border-width: 1px; + border-style: solid; + border-color: #dedeee; + -moz-border-radius: 8px 8px 8px 8px; +} +.memname { + white-space: nowrap; + font-weight: bold; +} +.memdoc{ + padding-left: 10px; +} +.memproto { + background-color: #d5e1e8; + width: 100%; + border-width: 1px; + border-style: solid; + border-color: #84b0c7; + font-weight: bold; + -moz-border-radius: 8px 8px 8px 8px; +} +.paramkey { + text-align: right; +} +.paramtype { + white-space: nowrap; +} +.paramname { + color: #602020; + font-style: italic; +} +/* End Styling for detailed member documentation */ + +/* for the tree view */ +.ftvtree { + font-family: sans-serif; + margin:0.5em; +} +.directory { font-size: 9pt; font-weight: bold; } +.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } +.directory > h3 { margin-top: 0; } +.directory p { margin: 0px; white-space: nowrap; } +.directory div { display: none; margin: 0px; } +.directory img { vertical-align: -30%; } + diff --git a/slsDetectorSoftware/docs/html/doxygen.png b/slsDetectorSoftware/docs/html/doxygen.png new file mode 100644 index 000000000..f0a274bba Binary files /dev/null and b/slsDetectorSoftware/docs/html/doxygen.png differ diff --git a/slsDetectorSoftware/docs/html/eigerDetector_8h-source.html b/slsDetectorSoftware/docs/html/eigerDetector_8h-source.html new file mode 100644 index 000000000..d4bf9ab5b --- /dev/null +++ b/slsDetectorSoftware/docs/html/eigerDetector_8h-source.html @@ -0,0 +1,91 @@ + + +eigerDetector/eigerDetector.h Source File + + + + + + +

eigerDetector/eigerDetector.h

Go to the documentation of this file.
00001 
+00002 
+00003 
+00004 #ifndef EIGER_DETECTOR_H
+00005 #define EIGER_DETECTOR_H
+00006 
+00007 using namespace std;
+00008 
+00009 
+00010 
+00022 #include "slsDetector.h"
+00023 
+00024 class eigerDetector : public slsDetector{
+00025 
+00026 
+00027 
+00028  public:
+00029   
+00030 
+00031 
+00038   eigerDetector(int id=0);
+00039   //slsDetector(string  const fname);
+00041   ~eigerDetector(){};
+00042 
+00043 
+00044 
+00052   sls_detector_module* readTrimFile(string fname,  sls_detector_module* myMod=NULL);
+00053 
+00062   int writeTrimFile(string fname, sls_detector_module mod); 
+00063   
+00071   int writeTrimFile(string fname, int imod);
+00072 
+00073  
+00087   int writeDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1); 
+00088   
+00095   int writeDataFile(string fname, int *data);
+00096   
+00110   int readDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=0);  
+00111 
+00118   int readDataFile(string fname, int *data);
+00119 
+00134   int readCalibrationFile(string fname, float &gain, float &offset);
+00135 
+00136   
+00144   int writeCalibrationFile(string fname, float gain, float offset);
+00145 
+00146 
+00147 
+00148 
+00149 
+00150 
+00151 
+00152 
+00158   float* decodeData(int *datain);
+00159 
+00160   
+00161   
+00162  
+00163 
+00164  private:
+00165  
+00166 
+00167 };
+00168 
+00169 
+00170 #endif
+

Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/eigerDetector_8h.html b/slsDetectorSoftware/docs/html/eigerDetector_8h.html new file mode 100644 index 000000000..41f37d903 --- /dev/null +++ b/slsDetectorSoftware/docs/html/eigerDetector_8h.html @@ -0,0 +1,35 @@ + + +eigerDetector/eigerDetector.h File Reference + + + + + + +

eigerDetector/eigerDetector.h File Reference

#include "slsDetector.h"
+ +

+Go to the source code of this file. + + + + + +

Classes

class  eigerDetector
 This is class contains all eiger specific functionalities. More...
+


Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/files.html b/slsDetectorSoftware/docs/html/files.html new file mode 100644 index 000000000..efe84a44c --- /dev/null +++ b/slsDetectorSoftware/docs/html/files.html @@ -0,0 +1,36 @@ + + +File Index + + + + + + +

File List

Here is a list of all files with brief descriptions: + + + + + + + + + +
commonFiles/sls_detector_defs.h [code]
eigerDetector/eigerDetector.h [code]
MySocketTCP/MySocketTCP.cxx
MySocketTCP/MySocketTCP.h [code]
mythenDetector/mythenDetector.h [code]
slsDetector/slsDetector.cpp
slsDetector/slsDetector.h [code]
usersFunctions/usersFunctions.c
usersFunctions/usersFunctions.h [code]
+
Generated on Fri Oct 9 16:01:05 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions.html b/slsDetectorSoftware/docs/html/functions.html new file mode 100644 index 000000000..557dea4d2 --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions.html @@ -0,0 +1,74 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- a -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x62.html b/slsDetectorSoftware/docs/html/functions_0x62.html new file mode 100644 index 000000000..d3986ffaf --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x62.html @@ -0,0 +1,70 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- b -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x63.html b/slsDetectorSoftware/docs/html/functions_0x63.html new file mode 100644 index 000000000..ee6280404 --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x63.html @@ -0,0 +1,87 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- c -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x64.html b/slsDetectorSoftware/docs/html/functions_0x64.html new file mode 100644 index 000000000..a1e1a4989 --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x64.html @@ -0,0 +1,82 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- d -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x65.html b/slsDetectorSoftware/docs/html/functions_0x65.html new file mode 100644 index 000000000..9fef7e438 --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x65.html @@ -0,0 +1,76 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- e -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x66.html b/slsDetectorSoftware/docs/html/functions_0x66.html new file mode 100644 index 000000000..b09c2159a --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x66.html @@ -0,0 +1,79 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- f -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x67.html b/slsDetectorSoftware/docs/html/functions_0x67.html new file mode 100644 index 000000000..2988c617d --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x67.html @@ -0,0 +1,105 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- g -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x68.html b/slsDetectorSoftware/docs/html/functions_0x68.html new file mode 100644 index 000000000..f0d9fe5e1 --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x68.html @@ -0,0 +1,67 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- h -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x69.html b/slsDetectorSoftware/docs/html/functions_0x69.html new file mode 100644 index 000000000..1a521e886 --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x69.html @@ -0,0 +1,71 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- i -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x6c.html b/slsDetectorSoftware/docs/html/functions_0x6c.html new file mode 100644 index 000000000..2a8b8a393 --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x6c.html @@ -0,0 +1,68 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- l -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x6d.html b/slsDetectorSoftware/docs/html/functions_0x6d.html new file mode 100644 index 000000000..0c4578ff5 --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x6d.html @@ -0,0 +1,75 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- m -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x6e.html b/slsDetectorSoftware/docs/html/functions_0x6e.html new file mode 100644 index 000000000..705d164af --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x6e.html @@ -0,0 +1,83 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- n -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x6f.html b/slsDetectorSoftware/docs/html/functions_0x6f.html new file mode 100644 index 000000000..bb21d8dbf --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x6f.html @@ -0,0 +1,70 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- o -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x70.html b/slsDetectorSoftware/docs/html/functions_0x70.html new file mode 100644 index 000000000..da53d0402 --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x70.html @@ -0,0 +1,69 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- p -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x72.html b/slsDetectorSoftware/docs/html/functions_0x72.html new file mode 100644 index 000000000..58c81e089 --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x72.html @@ -0,0 +1,87 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- r -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x73.html b/slsDetectorSoftware/docs/html/functions_0x73.html new file mode 100644 index 000000000..dc80765fe --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x73.html @@ -0,0 +1,118 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- s -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x74.html b/slsDetectorSoftware/docs/html/functions_0x74.html new file mode 100644 index 000000000..579786a88 --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x74.html @@ -0,0 +1,72 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- t -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x77.html b/slsDetectorSoftware/docs/html/functions_0x77.html new file mode 100644 index 000000000..72ab3ee7d --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x77.html @@ -0,0 +1,72 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- w -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x78.html b/slsDetectorSoftware/docs/html/functions_0x78.html new file mode 100644 index 000000000..0555e6f36 --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x78.html @@ -0,0 +1,68 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- x -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x79.html b/slsDetectorSoftware/docs/html/functions_0x79.html new file mode 100644 index 000000000..0a1480d8d --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x79.html @@ -0,0 +1,68 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- y -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_0x7e.html b/slsDetectorSoftware/docs/html/functions_0x7e.html new file mode 100644 index 000000000..a78c2bc77 --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_0x7e.html @@ -0,0 +1,70 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all class members with links to the classes they belong to: +

+

- ~ -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_eval.html b/slsDetectorSoftware/docs/html/functions_eval.html new file mode 100644 index 000000000..eb5b8b72f --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_eval.html @@ -0,0 +1,42 @@ + + +Class Members - Enumerator + + + + + + + +  +

+

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_func.html b/slsDetectorSoftware/docs/html/functions_func.html new file mode 100644 index 000000000..a1b1d72e4 --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_func.html @@ -0,0 +1,217 @@ + + +Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- a -

+

- c -

+

- d -

+

- e -

+

- f -

+

- g -

+

- i -

+

- m -

+

- p -

+

- r -

+

- s -

+

- w -

+

- ~ -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_type.html b/slsDetectorSoftware/docs/html/functions_type.html new file mode 100644 index 000000000..c90b0b88f --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_type.html @@ -0,0 +1,40 @@ + + +Class Members - Typedefs + + + + + + + +  +

+

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/functions_vars.html b/slsDetectorSoftware/docs/html/functions_vars.html new file mode 100644 index 000000000..632771c47 --- /dev/null +++ b/slsDetectorSoftware/docs/html/functions_vars.html @@ -0,0 +1,206 @@ + + +Class Members - Variables + + + + + + + +
+ +
+ +

+  +

+

- a -

+

- b -

+

- c -

+

- d -

+

- e -

+

- f -

+

- g -

+

- h -

+

- i -

+

- l -

+

- m -

+

- n -

+

- o -

+

- p -

+

- r -

+

- s -

+

- t -

+

- x -

+

- y -

+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/globals.html b/slsDetectorSoftware/docs/html/globals.html new file mode 100644 index 000000000..53598671c --- /dev/null +++ b/slsDetectorSoftware/docs/html/globals.html @@ -0,0 +1,298 @@ + + +Class Members + + + + + + + +
+ +
+ +

+Here is a list of all file members with links to the files they belong to: +

+

- a -

+

- b -

+

- c -

+

- d -

+

- e -

+

- f -

+

- g -

+

- h -

+

- i -

+

- m -

+

- n -

+

- o -

+

- p -

+

- r -

+

- s -

+

- t -

+

- u -

+

- x -

+

- y -

+

- z -

+
Generated on Fri Oct 9 16:01:05 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/globals_defs.html b/slsDetectorSoftware/docs/html/globals_defs.html new file mode 100644 index 000000000..eb3c1528c --- /dev/null +++ b/slsDetectorSoftware/docs/html/globals_defs.html @@ -0,0 +1,57 @@ + + +Class Members + + + + + + + +  +

+

+
Generated on Fri Oct 9 16:01:05 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/globals_enum.html b/slsDetectorSoftware/docs/html/globals_enum.html new file mode 100644 index 000000000..17843b1f5 --- /dev/null +++ b/slsDetectorSoftware/docs/html/globals_enum.html @@ -0,0 +1,57 @@ + + +Class Members + + + + + + + +  +

+

+
Generated on Fri Oct 9 16:01:05 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/globals_eval.html b/slsDetectorSoftware/docs/html/globals_eval.html new file mode 100644 index 000000000..32fad025e --- /dev/null +++ b/slsDetectorSoftware/docs/html/globals_eval.html @@ -0,0 +1,256 @@ + + +Class Members + + + + + + + +
+ +
+ +

+  +

+

- a -

+

- b -

+

- c -

+

- d -

+

- e -

+

- f -

+

- g -

+

- h -

+

- i -

+

- m -

+

- n -

+

- o -

+

- p -

+

- r -

+

- s -

+

- t -

+

- u -

+

- x -

+

- y -

+

- z -

+
Generated on Fri Oct 9 16:01:05 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/globals_func.html b/slsDetectorSoftware/docs/html/globals_func.html new file mode 100644 index 000000000..2a6cb3ff5 --- /dev/null +++ b/slsDetectorSoftware/docs/html/globals_func.html @@ -0,0 +1,44 @@ + + +Class Members + + + + + + + +  +

+

+
Generated on Fri Oct 9 16:01:05 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/globals_vars.html b/slsDetectorSoftware/docs/html/globals_vars.html new file mode 100644 index 000000000..2d3e74cda --- /dev/null +++ b/slsDetectorSoftware/docs/html/globals_vars.html @@ -0,0 +1,40 @@ + + +Class Members + + + + + + + +  +

+

+
Generated on Fri Oct 9 16:01:05 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/hierarchy.html b/slsDetectorSoftware/docs/html/hierarchy.html new file mode 100644 index 000000000..e7fb78bf1 --- /dev/null +++ b/slsDetectorSoftware/docs/html/hierarchy.html @@ -0,0 +1,41 @@ + + +Hierarchical Index + + + + + + +

Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically: +
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/index.html b/slsDetectorSoftware/docs/html/index.html new file mode 100644 index 000000000..f0217bd9f --- /dev/null +++ b/slsDetectorSoftware/docs/html/index.html @@ -0,0 +1,37 @@ + + +Common C++ library for SLS detectors data acquisition + + + + + +

Common C++ library for SLS detectors data acquisition

+

+

+Introduction

+

+Motivation

+Although the SLS detectors group delvelops several types of detectors (1/2D, counting/integrating etc.) it is common interest of the group to use a common platfor for data acquisition

+System Architecture

+The architecture of the acquisitions system is intended as follows:
    +
  • A socket server running on the detector (or more than one in some special cases)
  • +
  • C++ classes common to all detectors for client-server communication. These can be supplied to users as libraries and embedded also in acquisition systems which are not developed by the SLS
    See also:
    MySocketTCP slsDetector
    +
  • +
  • the possibility of using a Qt-based graphical user interface (with eventually root analisys capabilities)
  • +
  • the possibility of runnin alla commands from command line. In order to ensure a fast operation of this so called "text client" the detector parameters should not be re-initialized everytime. For this reason a shared memory block is allocated where the main detector flags and parameters are stored
    See also:
    slsDetector::sharedSlsDetector
    +
    Author:
    Anna Bergamaschi
    +
  • +
+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/mythenDetector_8h-source.html b/slsDetectorSoftware/docs/html/mythenDetector_8h-source.html new file mode 100644 index 000000000..59db5d845 --- /dev/null +++ b/slsDetectorSoftware/docs/html/mythenDetector_8h-source.html @@ -0,0 +1,121 @@ + + +mythenDetector/mythenDetector.h Source File + + + + + + +

mythenDetector/mythenDetector.h

Go to the documentation of this file.
00001 
+00002 
+00003 
+00004 #ifndef MYTHEN_DETECTOR_H
+00005 #define MYTHEN_DETECTOR_H
+00006 
+00007 using namespace std;
+00008 
+00009 
+00010 
+00022 #include "slsDetector.h"
+00023 
+00024 class mythenDetector : public slsDetector{
+00025 
+00026 
+00027 
+00028  public:
+00029   
+00030 
+00031 
+00038   mythenDetector(int id=0);
+00039   //slsDetector(string  const fname);
+00041   ~mythenDetector(){};
+00042 
+00043 
+00044 
+00052   sls_detector_module* readTrimFile(string fname,  sls_detector_module* myMod=NULL);
+00053 
+00062   int writeTrimFile(string fname, sls_detector_module mod); 
+00063   
+00071   int writeTrimFile(string fname, int imod);
+00072 
+00073  
+00087   int writeDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1); 
+00088   
+00095   int writeDataFile(string fname, int *data);
+00096   
+00110   int readDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=0);  
+00111 
+00118   int readDataFile(string fname, int *data);
+00119 
+00132   int readCalibrationFile(string fname, float &gain, float &offset);
+00133 
+00141   int writeCalibrationFile(string fname, float gain, float offset);
+00142 
+00143 
+00149   int readAngularConversion(string fname="");
+00155   int writeAngularConversion(string fname="");
+00156  
+00157 
+00158 
+00159   /* Communication to server */
+00160 
+00161   // Tests and identification
+00162 
+00168   int setAngularConversion(string fname="");
+00169 
+00176   int getAngularConversion(int &direction,  angleConversionConstant *angconv=NULL);
+00177   
+00181   float setGlobalOffset(float f){thisDetector->globalOffset=f; return thisDetector->globalOffset;}; 
+00182 
+00186   float setFineOffset(float f){thisDetector->fineOffset=f; return thisDetector->fineOffset;};
+00190   float getFineOffset(){return thisDetector->fineOffset;};
+00191   
+00195   float getGlobalOffset(){return thisDetector->globalOffset;};
+00196 
+00203   int setPositions(int nPos, float *pos){thisDetector->numberOfPositions=nPos; for (int ip=0; ip<nPos; ip++) thisDetector->detPositions[ip]=pos[ip]; return thisDetector->numberOfPositions;};
+00209   int getPositions(float *pos=NULL){ if (pos ) {for (int ip=0; ip<thisDetector->numberOfPositions; ip++) pos[ip]=thisDetector->detPositions[ip];} return thisDetector->numberOfPositions;};
+00210   
+00211   
+00213   float setBinSize(float bs) {thisDetector->binSize=bs; return thisDetector->binSize;}
+00215   float getBinSize() {return thisDetector->binSize;}
+00216 
+00217 
+00218 
+00219 
+00220 
+00221 
+00227   float* decodeData(int *datain);
+00228 
+00229   
+00230   
+00231   int resetMerging(float *mp, float *mv,float *me, int *mm);
+00242   int addToMerging(float *p1, float *v1, float *e1, float *mp, float *mv,float *me, int *mm);
+00243 
+00252   int finalizeMerging(float *mp, float *mv,float *me, int *mm);
+00253 
+00254  
+00255 
+00256  private:
+00257  
+00258 
+00259 };
+00260 
+00261 
+00262 #endif
+

Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/mythenDetector_8h.html b/slsDetectorSoftware/docs/html/mythenDetector_8h.html new file mode 100644 index 000000000..55ab7a8c1 --- /dev/null +++ b/slsDetectorSoftware/docs/html/mythenDetector_8h.html @@ -0,0 +1,35 @@ + + +mythenDetector/mythenDetector.h File Reference + + + + + + +

mythenDetector/mythenDetector.h File Reference

#include "slsDetector.h"
+ +

+Go to the source code of this file. + + + + + +

Classes

class  mythenDetector
 This calss contains all mythen specific functions. More...
+


Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/namespaces.html b/slsDetectorSoftware/docs/html/namespaces.html new file mode 100644 index 000000000..8c83d98ad --- /dev/null +++ b/slsDetectorSoftware/docs/html/namespaces.html @@ -0,0 +1,23 @@ + + +Namespace Index + + + + + +

Namespace List

Here is a list of all namespaces with brief descriptions: + +
std
+
Generated on Fri Oct 9 16:01:05 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/namespacestd.html b/slsDetectorSoftware/docs/html/namespacestd.html new file mode 100644 index 000000000..65e50282a --- /dev/null +++ b/slsDetectorSoftware/docs/html/namespacestd.html @@ -0,0 +1,25 @@ + + +std Namespace Reference + + + + + +

std Namespace Reference

+

+ + +
+


Generated on Fri Oct 9 16:01:05 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/pages.html b/slsDetectorSoftware/docs/html/pages.html new file mode 100644 index 000000000..84c34fc2d --- /dev/null +++ b/slsDetectorSoftware/docs/html/pages.html @@ -0,0 +1,24 @@ + + +Page Index + + + + + +

Related Pages

Here is a list of all related documentation pages: +
Generated on Fri Oct 9 16:01:05 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/slsDetector_8cpp.html b/slsDetectorSoftware/docs/html/slsDetector_8cpp.html new file mode 100644 index 000000000..dad5a408a --- /dev/null +++ b/slsDetectorSoftware/docs/html/slsDetector_8cpp.html @@ -0,0 +1,33 @@ + + +slsDetector/slsDetector.cpp File Reference + + + + + + +

slsDetector/slsDetector.cpp File Reference

#include "slsDetector.h"
+#include "usersFunctions.h"
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+ + +
+
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/slsDetector_8h-source.html b/slsDetectorSoftware/docs/html/slsDetector_8h-source.html new file mode 100644 index 000000000..0febaa00a --- /dev/null +++ b/slsDetectorSoftware/docs/html/slsDetector_8h-source.html @@ -0,0 +1,517 @@ + + +slsDetector/slsDetector.h Source File + + + + + + +

slsDetector/slsDetector.h

Go to the documentation of this file.
00001 
+00002 
+00003 
+00004 #ifndef SLS_DETECTOR_H
+00005 #define SLS_DETECTOR_H
+00006 
+00007 #include "MySocketTCP.h"
+00008 #include <iostream>
+00009 #include <fstream>
+00010 #include <iomanip>
+00011 #include <cstring>
+00012 #include <string>
+00013 #include <sstream>
+00014  #include <queue>
+00015 extern "C" {
+00016  #include <pthread.h>
+00017 }
+00018  #include <fcntl.h>
+00019  #include <unistd.h>
+00020  #include <sys/stat.h>
+00021  #include <sys/types.h>
+00022  #include <sys/uio.h>
+00023 
+00024 
+00025 #define MAX_TIMERS 10
+00026 #define MAX_ROIS 100
+00027 #define MAX_BADCHANS 2000
+00028 #define MAXPOS 50
+00029 
+00030 #define NMODMAXX 24
+00031 #define NMODMAXY 24
+00032 #define MAXMODS 36
+00033 #define NCHIPSMAX 10
+00034 #define NCHANSMAX 65536
+00035 #define NDACSMAX 16
+00036 
+00037 #define DEFAULT_HOSTNAME  "localhost"
+00038 #define DEFAULT_SHM_KEY  5678
+00039 
+00040 #define defaultTDead {170,90,750}
+00041 
+00042 using namespace std;
+00078 class slsDetector {
+00079 
+00080 
+00081 
+00082  public:
+00083   
+00084 
+00086   enum {GET_ONLINE_FLAG, 
+00087         OFFLINE_FLAG, 
+00088         ONLINE_FLAG 
+00089   };
+00090 
+00091 
+00092 #include "sls_detector_defs.h"
+00093 
+00094 
+00099 typedef  struct sharedSlsDetector {
+00101     int alreadyExisting;
+00102     
+00104     char hostname[MAX_STR_LENGTH];
+00106     int controlPort;
+00108     int stopPort;
+00110     int dataPort;
+00111 
+00113     detectorType myDetectorType;
+00114 
+00115 
+00117     char trimDir[MAX_STR_LENGTH];
+00119     char calDir[MAX_STR_LENGTH];
+00121     int nTrimEn;
+00123     int trimEnergies[100];
+00124 
+00125            
+00127     int fileIndex;
+00129     char filePath[MAX_STR_LENGTH];
+00131     char fileName[MAX_STR_LENGTH];
+00132 
+00133   /* size of the detector */
+00134     
+00136     int nMod[2];
+00138     int nMods;
+00140     int nModMax[2];
+00142     int nModsMax;
+00144     int nChans;
+00146     int nChips;
+00148     int nDacs;
+00150     int nAdcs;
+00152     int dynamicRange;
+00154     int dataBytes;
+00155     
+00157     int correctionMask;
+00159     float tDead;
+00161     int nBadChans;
+00163     int badChansList[MAX_BADCHANS];
+00165     int nBadFF;
+00167     int badFFList[MAX_BADCHANS];
+00168     
+00170     angleConversionConstant angOff[MAXMODS];
+00172     int angDirection;
+00174     float fineOffset;
+00176     float globalOffset;
+00178     int numberOfPositions;
+00180     float detPositions[MAXPOS];
+00182   float binSize;
+00183 
+00184   /* infos necessary for the readout to determine the size of the data */
+00186     int nROI;
+00188     ROI roiLimits[MAX_ROIS];
+00190     readOutFlags roFlags;
+00191 
+00192  /* detector setup - not needed */
+00194     detectorSettings currentSettings;
+00196     int currentThresholdEV;
+00198     int64_t timerValue[MAX_TIMERS];
+00200     int clkDiv;
+00201     
+00202   /*offsets*/
+00204     int ffoff;
+00206     int fferroff;
+00208     int modoff;
+00210     int dacoff;
+00212     int adcoff;
+00214     int chipoff;
+00216     int chanoff;
+00217 
+00218 } sharedSlsDetector;
+00219 
+00220 
+00221 
+00228   slsDetector(detectorType type=GENERIC, int id=0);
+00229   //slsDetector(string  const fname);
+00230   //  ~slsDetector(){while(dataQueue.size()>0){}};
+00232   ~slsDetector(){};
+00233 
+00234 
+00237   int setOnline(int const online);  
+00240   int exists() {return thisDetector->alreadyExisting;};
+00241 
+00254   int readConfigurationFile(string const fname);  
+00266   int writeConfigurationFile(string const fname);
+00267 
+00268 
+00269   /* 
+00270      It should be possible to dump all the settings of the detector (including trimbits, threshold energy, gating/triggering, acquisition time etc.
+00271      in a file and retrieve it for repeating the measurement with identicals ettings, if necessary
+00272   */
+00278   int dumpDetectorSetup(string const fname);  
+00284   int retrieveDetectorSetup(string const fname);
+00285 
+00297   int setTCPSocket(string const name="", int const control_port=-1, int const stop_port=-1, int const data_port=-1);
+00299   char* getHostname() {return thisDetector->hostname;};
+00301   int getControlPort() {return  thisDetector->controlPort;};
+00303   int getStopPort() {return thisDetector->stopPort;};
+00305   int getDataPort() {return thisDetector->dataPort;};
+00306  
+00307 
+00308   /* I/O */
+00310   char* getTrimDir() {return thisDetector->trimDir;};
+00312   char* setTrimDir(string s) {sprintf(thisDetector->trimDir, s.c_str()); return thisDetector->trimDir;};
+00319   int getTrimEn(int *en) {for (int ien=0; ien<thisDetector->nTrimEn; ien++) en[ien]=thisDetector->trimEnergies[ien]; return (thisDetector->nTrimEn);};
+00320 
+00328   sls_detector_module* readTrimFile(string fname,  sls_detector_module* myMod=NULL);
+00329 
+00338   int writeTrimFile(string fname, sls_detector_module mod); 
+00339   
+00347   int writeTrimFile(string fname, int imod);
+00348 
+00353   char* setFilePath(string s) {sprintf(thisDetector->filePath, s.c_str()); return thisDetector->filePath;};
+00354 
+00359   char* setFileName(string s) {sprintf(thisDetector->fileName, s.c_str()); return thisDetector->fileName;}; 
+00360 
+00365   int setFileIndex(int i) {thisDetector->fileIndex=i; return thisDetector->fileIndex;}; 
+00366   
+00371   char* getFilePath() {return thisDetector->filePath;};
+00372   
+00377   char* getFileName() {return thisDetector->fileName;};
+00378 
+00383   int getFileIndex() {return thisDetector->fileIndex;};
+00384   
+00396   string createFileName();
+00397   
+00411   int writeDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1); 
+00412   
+00419   int writeDataFile(string fname, int *data);
+00420   
+00434   int readDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=0);  
+00435 
+00442   int readDataFile(string fname, int *data);
+00443 
+00448   char* getCalDir() {return thisDetector->calDir;};
+00453   char* setCalDir(string s) {sprintf(thisDetector->calDir, s.c_str()); return thisDetector->calDir;}; 
+00461   int readCalibrationFile(string fname, float &gain, float &offset);
+00469   int writeCalibrationFile(string fname, float gain, float offset);
+00470 
+00471 
+00477   int readAngularConversion(string fname="");
+00483   int writeAngularConversion(string fname="");
+00484  
+00485 
+00486 
+00487   /* Communication to server */
+00488 
+00489   // General purpose functions
+00490 
+00498   int execCommand(string cmd, string answer);
+00499   
+00506   int setDetectorType(detectorType type=GET_DETECTOR_TYPE);  
+00507 
+00514   int setDetectorType(string type);  
+00515 
+00521   void getDetectorType(char *type);
+00522 
+00523 
+00524   // Detector configuration functions
+00531   int setNumberOfModules(int n, dimension d=X); // if n=GET_FLAG returns the number of installed modules
+00532 
+00533   /*
+00534     returns the instrinsic size of the detector (maxmodx, maxmody, nchans, nchips, ndacs
+00535     enum numberOf {
+00536     MAXMODX,
+00537     MAXMODY,
+00538     CHANNELS,
+00539     CHIPS,
+00540     DACS
+00541     }
+00542   */
+00543 
+00544 
+00550   int getMaxNumberOfModules(dimension d=X); //
+00551  
+00552  
+00559   externalSignalFlag setExternalSignalFlags(externalSignalFlag pol=GET_EXTERNAL_SIGNAL_FLAG , int signalindex=0);
+00560 
+00561  
+00569   externalCommunicationMode setExternalCommunicationMode(externalCommunicationMode pol=GET_EXTERNAL_COMMUNICATION_MODE);
+00570 
+00571 
+00572   // Tests and identification
+00573  
+00580   int64_t getId(idMode mode, int imod=0);
+00587   int digitalTest(digitalTestMode mode, int imod=0);
+00596   int* analogTest(analogTestMode mode);
+00597   
+00603   int enableAnalogOutput(int ichan);
+00604   
+00610   int enableAnalogOutput(int imod, int ichip, int ichan);
+00611 
+00620   int giveCalibrationPulse(float vcal, int npulses);
+00621 
+00622   // Expert Initialization functions
+00623  
+00624 
+00632   int writeRegister(int addr, int val);
+00633   
+00640   int readRegister(int addr);
+00641 
+00649   float setDAC(float val, dacIndex index, int imod=-1);
+00650   
+00657   float getADC(dacIndex index, int imod=0); 
+00658  
+00668   int setChannel(int64_t reg, int ichan=-1, int ichip=-1, int imod=-1);  
+00669 
+00675   int setChannel(sls_detector_channel chan);
+00676 
+00684   sls_detector_channel getChannel(int ichan, int ichip, int imod);
+00685   
+00686 
+00687 
+00696   int setChip(int reg, int ichip=-1, int imod=-1);
+00697   
+00704   int setChip(sls_detector_chip chip); 
+00705 
+00714   sls_detector_chip getChip(int ichip, int imod);
+00715 
+00716 
+00723   int setModule(int reg, int imod=-1); 
+00724 
+00731   int setModule(sls_detector_module module);
+00732 
+00738   sls_detector_module *getModule(int imod);
+00739  
+00740   // calibration functions
+00741   //  int setCalibration(int imod, detectorSettings isettings, float gain, float offset);
+00742   //int getCalibration(int imod, detectorSettings isettings, float &gain, float &offset);
+00743   
+00744 
+00745   /*
+00746     calibrated setup of the threshold
+00747   */  
+00753   int getThresholdEnergy(int imod=-1);  
+00754 
+00762   int setThresholdEnergy(int e_eV, int imod=-1, detectorSettings isettings=GET_SETTINGS); 
+00763  
+00769   detectorSettings getSettings(int imod=-1);  
+00770 
+00779   detectorSettings setSettings(detectorSettings isettings, int imod=-1);
+00780 
+00781 
+00782 // Acquisition functions
+00783 
+00784 
+00789   int startAcquisition();
+00790 
+00795   int stopAcquisition();
+00796   
+00801   int startReadOut();
+00802 
+00807   int getRunStatus();
+00808 
+00814   int* startAndReadAll();
+00815   
+00820   int startAndReadAllNoWait(); 
+00821 
+00827   int* getDataFromDetectorNoWait(); 
+00828 
+00834   int* readFrame(); 
+00835 
+00841   int* readAll();
+00842 
+00843   
+00849   int* popDataQueue();
+00850 
+00857   int64_t setTimer(timerIndex index, int64_t t=-1);
+00858 
+00864   int64_t getTimeLeft(timerIndex index);
+00865 
+00872   int setClockDivider(int i) {cout << "not implemented any longer!"<< endl; thisDetector->clkDiv=i;return thisDetector->clkDiv;};  
+00873 
+00880   int getClockDivider() {return thisDetector->clkDiv;};  
+00881 
+00888   int setSetLength(int i) {cout << "not implemented any longer!"<< endl; thisDetector->clkDiv=i;return 3;}; 
+00889 
+00895   int getSetLength() {return 3;};
+00896   
+00897 
+00898   // Flags
+00906   int setDynamicRange(int n=-1);
+00907  
+00913   int setROI(int nroi=-1, int *xmin=NULL, int *xmax=NULL, int *ymin=NULL, int *ymax=NULL);
+00914   
+00915 
+00921   int setReadOutFlags(readOutFlags flag);
+00922 
+00931   int executeTrimming(trimMode mode, int par1, int par2, int imod=-1);
+00932 
+00933  
+00934   //Corrections
+00935 
+00941   int setFlatFieldCorrection(string fname=""); 
+00942 
+00949   int getFlatFieldCorrections(float *corr=NULL, float *ecorr=NULL);
+00950 
+00956   int setRateCorrection(float t=0);
+00957 
+00958   
+00964   int getRateCorrections(float &t);  
+00965 
+00970   int getRateCorrections();
+00971   
+00977   int setBadChannelCorrection(string fname="");
+00978   
+00984   int getBadChannelCorrections(int *bad=NULL);
+00985 
+00986   
+00992   int setAngularConversion(string fname="");
+00993 
+01000   int getAngularConversion(int &direction,  angleConversionConstant *angconv=NULL);
+01001   
+01005   float setGlobalOffset(float f){thisDetector->globalOffset=f; return thisDetector->globalOffset;}; 
+01006 
+01010   float setFineOffset(float f){thisDetector->fineOffset=f; return thisDetector->fineOffset;};
+01014   float getFineOffset(){return thisDetector->fineOffset;};
+01015   
+01019   float getGlobalOffset(){return thisDetector->globalOffset;};
+01020 
+01027   int setPositions(int nPos, float *pos){thisDetector->numberOfPositions=nPos; for (int ip=0; ip<nPos; ip++) thisDetector->detPositions[ip]=pos[ip]; return thisDetector->numberOfPositions;};
+01033   int getPositions(float *pos=NULL){ if (pos ) {for (int ip=0; ip<thisDetector->numberOfPositions; ip++) pos[ip]=thisDetector->detPositions[ip];} return thisDetector->numberOfPositions;};
+01034   
+01035   
+01037   float setBinSize(float bs) {thisDetector->binSize=bs; return thisDetector->binSize;}
+01039   float getBinSize() {return thisDetector->binSize;}
+01040 
+01041 
+01042 
+01043 
+01044 
+01045 
+01051   float* decodeData(int *datain);
+01052 
+01053   
+01054   
+01055   
+01066   int flatFieldCorrect(float datain, float errin, float &dataout, float &errout, float ffcoefficient, float fferr);
+01067   
+01076   int flatFieldCorrect(float* datain, float *errin, float* dataout, float *errout);
+01077  
+01078 
+01079   
+01090   int rateCorrect(float datain, float errin, float &dataout, float &errout, float tau, float t);
+01091   
+01100   int rateCorrect(float* datain, float *errin, float* dataout, float *errout);
+01101 
+01102   
+01110   int resetMerging(float *mp, float *mv,float *me, int *mm);
+01121   int addToMerging(float *p1, float *v1, float *e1, float *mp, float *mv,float *me, int *mm);
+01122 
+01131   int finalizeMerging(float *mp, float *mv,float *me, int *mm);
+01132 
+01136   int exitServer();
+01137 
+01141   void* processData(); // thread function
+01146   sls_detector_module*  createModule();
+01152   void deleteModule(sls_detector_module *myMod);
+01153 
+01154 
+01155   void acquire();
+01156 
+01157  private:
+01158  
+01162   sharedSlsDetector *thisDetector;
+01163 
+01167   int onlineFlag;
+01168   
+01172   int detId;
+01173   
+01177   int shmId;
+01178 
+01182   MySocketTCP *controlSocket;
+01183 
+01187   MySocketTCP *stopSocket;
+01188   
+01192   MySocketTCP *dataSocket; 
+01193   
+01197   queue<int*> dataQueue;
+01198   
+01202   pthread_t dataProcessingThread;
+01203   
+01207   float currentPosition;
+01208   
+01212   float currentPositionIndex;
+01213   
+01217   float currentI0;
+01218   
+01219 
+01220 
+01222   float *mergingBins;
+01223 
+01225   float *mergingCounts;
+01226 
+01228   float *mergingErrors;
+01229 
+01231   int *mergingMultiplicity;
+01232   
+01233 
+01234 
+01235 
+01236 
+01237 
+01238  
+01240   float *ffcoefficients;
+01242   float *fferrors;
+01244   sls_detector_module *detectorModules;
+01246   float *dacs;
+01248   float *adcs;
+01250   int *chipregs;
+01252   int *chanregs;
+01254   int *badChannelMask;
+01255 
+01261   int* getDataFromDetector();
+01262 
+01268   int initSharedMemory(detectorType type=GENERIC, int id=0);
+01269 
+01271   int freeSharedMemory();
+01277   int initializeDetectorSize(detectorType type);
+01281   int initializeDetectorStructure(); 
+01285   int sendChannel(sls_detector_channel*); 
+01289   int sendChip(sls_detector_chip*);
+01293   int sendModule(sls_detector_module*);
+01297   int receiveChannel(sls_detector_channel*);
+01301   int receiveChip(sls_detector_chip*);
+01305   int receiveModule(sls_detector_module*);
+01306   
+01310   void startThread();
+01311   
+01315   int fillBadChannelMask();
+01316 };
+01317 
+01318 
+01319 //static void* startProcessData(void *n);
+01320 #endif
+

Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/slsDetector_8h.html b/slsDetectorSoftware/docs/html/slsDetector_8h.html new file mode 100644 index 000000000..cea35af33 --- /dev/null +++ b/slsDetectorSoftware/docs/html/slsDetector_8h.html @@ -0,0 +1,278 @@ + + +slsDetector/slsDetector.h File Reference + + + + + + +

slsDetector/slsDetector.h File Reference

#include "MySocketTCP.h"
+#include <iostream>
+#include <fstream>
+#include <iomanip>
+#include <cstring>
+#include <string>
+#include <sstream>
+#include <queue>
+#include <pthread.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/uio.h>
+#include "sls_detector_defs.h"
+ +

+Go to the source code of this file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Namespaces

namespace  std

Classes

class  slsDetector
 This is the base class for all SLS detector functionalities. More...
struct  slsDetector::sharedSlsDetector
 Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!). More...

Defines

#define MAX_TIMERS   10
#define MAX_ROIS   100
#define MAX_BADCHANS   2000
#define MAXPOS   50
#define NMODMAXX   24
#define NMODMAXY   24
#define MAXMODS   36
#define NCHIPSMAX   10
#define NCHANSMAX   65536
#define NDACSMAX   16
#define DEFAULT_HOSTNAME   "localhost"
#define DEFAULT_SHM_KEY   5678
#define defaultTDead   {170,90,750}
+


Define Documentation

+ +
+
+ + + + +
#define DEFAULT_HOSTNAME   "localhost"
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define DEFAULT_SHM_KEY   5678
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define defaultTDead   {170,90,750}
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define MAX_BADCHANS   2000
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define MAX_ROIS   100
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define MAX_TIMERS   10
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define MAXMODS   36
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define MAXPOS   50
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define NCHANSMAX   65536
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define NCHIPSMAX   10
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define NDACSMAX   16
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define NMODMAXX   24
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define NMODMAXY   24
+
+
+ +

+ +

+

+


Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/sls__detector__defs_8h-source.html b/slsDetectorSoftware/docs/html/sls__detector__defs_8h-source.html new file mode 100644 index 000000000..c57b7f8ac --- /dev/null +++ b/slsDetectorSoftware/docs/html/sls__detector__defs_8h-source.html @@ -0,0 +1,310 @@ + + +commonFiles/sls_detector_defs.h Source File + + + + + + +

commonFiles/sls_detector_defs.h

Go to the documentation of this file.
00001 #ifndef SLS_DETECTOR_DEFS_H
+00002 #define SLS_DETECTOR_DEFS_H
+00003 
+00004 #include <stdint.h> 
+00017 #define MAX_STR_LENGTH 1000
+00018 
+00020 #define GET_FLAG -1
+00021 
+00027 typedef struct {
+00028   int chan; 
+00029   int chip; 
+00030   int module; 
+00031   int64_t reg;   
+00032 } sls_detector_channel;
+00033 
+00039 typedef struct  {
+00040   int chip;   
+00041   int module;  
+00042   int nchan; 
+00043   int reg; 
+00045   int *chanregs; 
+00047 } sls_detector_chip;
+00048 
+00063 typedef struct {
+00064   int module; 
+00065   int serialnumber;  
+00066   int nchan; 
+00067   int nchip; 
+00068   int ndac; 
+00069   int nadc; 
+00070   int reg; 
+00072   float *dacs; 
+00073   float *adcs;  
+00074   int *chipregs; 
+00076   int *chanregs; 
+00078   float gain;  
+00079   float offset;  
+00080 } sls_detector_module;
+00081 
+00087 typedef struct {
+00088   int xmin;  
+00089   int xmax;  
+00090   int ymin;  
+00091   int ymax;   
+00092 } ROI ;
+00093 
+00098 typedef struct {
+00099 
+00100   int len;  
+00101   int *iptr; 
+00102 } iarray ;
+00103 
+00104 
+00108 enum detectorType {
+00109   GET_DETECTOR_TYPE,   
+00110   GENERIC,  
+00111   MYTHEN, 
+00112   PILATUS, 
+00113   EIGER, 
+00114   GOTTHARD, 
+00115   AGIPD 
+00116 };
+00117 
+00121 enum communicationProtocol{
+00122   TCP,  
+00123   UDP 
+00124 };
+00125 
+00126 
+00130 enum numberOf {
+00131   MAXMODX, 
+00132   MAXMODY, 
+00133   NMODX, 
+00134   NMODY, 
+00135   NCHANSX, 
+00136   NCHANSY, 
+00137   NCHIPSX, 
+00138   NCHIPSY 
+00139 };
+00140 
+00144 enum dimension {
+00145   X=0, 
+00146   Y=1, 
+00147   Z=2 
+00148 };
+00149 
+00153 enum  {
+00154   OK, 
+00155   FAIL 
+00156 };
+00157 
+00161 enum {
+00162   DISABLED, 
+00163   ENABLED 
+00164 };
+00165 
+00169 enum externalSignalFlag {
+00170   GET_EXTERNAL_SIGNAL_FLAG,  
+00171   SIGNAL_OFF, 
+00172   GATE_IN_ACTIVE_HIGH,  
+00173   GATE_IN_ACTIVE_LOW,  
+00174   TRIGGER_IN_RISING_EDGE,  
+00175   TRIGGER_IN_FALLING_EDGE, 
+00176   RO_TRIGGER_IN_RISING_EDGE,  
+00177   RO_TRIGGER_IN_FALLING_EDGE, 
+00178   GATE_OUT_ACTIVE_HIGH, 
+00179   GATE_OUT_ACTIVE_LOW,  
+00180   TRIGGER_OUT_RISING_EDGE,  
+00181   TRIGGER_OUT_FALLING_EDGE, 
+00182   RO_TRIGGER_OUT_RISING_EDGE,   
+00183   RO_TRIGGER_OUT_FALLING_EDGE  
+00184 };
+00185 
+00191 enum externalCommunicationMode{
+00192   GET_EXTERNAL_COMMUNICATION_MODE,
+00193   AUTO,
+00194   TRIGGER_EXPOSURE,
+00195   TRIGGER_READOUT,
+00196   TRIGGER_COINCIDENCE_WITH_INTERNAL_ENABLE,
+00197   GATE_FIX_NUMBER,
+00198   GATE_FIX_DURATION,
+00199   GATE_WITH_START_TRIGGER,
+00200   GATE_COINCIDENCE_WITH_INTERNAL_ENABLE
+00201 };
+00205 enum idMode{
+00206   MODULE_SERIAL_NUMBER, 
+00207   MODULE_FIRMWARE_VERSION,  
+00208   DETECTOR_SERIAL_NUMBER,  
+00209   DETECTOR_FIRMWARE_VERSION,  
+00210   DETECTOR_SOFTWARE_VERSION,   
+00211   THIS_SOFTWARE_VERSION  
+00212 };
+00216 enum digitalTestMode {
+00217   CHIP_TEST, 
+00218   MODULE_FIRMWARE_TEST,  
+00219   DETECTOR_FIRMWARE_TEST,  
+00220   DETECTOR_MEMORY_TEST,  
+00221   DETECTOR_BUS_TEST,  
+00222   DETECTOR_SOFTWARE_TEST  
+00223 };
+00227 enum analogTestMode {
+00228   CALIBRATION_PULSES,  
+00229   MY_ANALOG_TEST_MODE  
+00230 };
+00231 
+00235 enum dacIndex {
+00236   THRESHOLD,  
+00237   CALIBRATION_PULSE,  
+00238   TRIMBIT_SIZE,   
+00239   PREAMP,   
+00240   SHAPER1,    
+00241   SHAPER2,  
+00242   TEMPERATURE,  
+00243   HUMIDITY,  
+00244   DETECTOR_BIAS   
+00245 };
+00246 
+00250 enum detectorSettings{  
+00251   GET_SETTINGS=-1,  
+00252   STANDARD,   
+00253   FAST,   
+00254   HIGHGAIN,  
+00255   UNDEFINED,  
+00256   UNINITIALIZED  
+00257 };
+00262 enum channelRegisterBit {
+00263   TRIMBIT_OFF,  
+00264   COMPARATOR_ENABLE=0x100,  
+00265   ANALOG_SIGNAL_ENABLE=0x200, 
+00266   CALIBRATION_ENABLE=0x300, 
+00267 };
+00272 enum chipRegisterBit {
+00273   ENABLE_ANALOG_OUTPUT=0x1, 
+00274   CHIP_OUTPUT_WIDTH=0x2 
+00275 };
+00279 enum moduleRegisterBit {
+00280   MY_MODULE_REGISTER_BIT,  
+00281   MODULE_OUTPUT_WIDTH   
+00282 };
+00283 
+00287 enum timerIndex {
+00288   FRAME_NUMBER, 
+00289   ACQUISITION_TIME, 
+00290   FRAME_PERIOD, 
+00291   DELAY_AFTER_TRIGGER, 
+00292   GATES_NUMBER, 
+00293   PROBES_NUMBER, 
+00294   CYCLES_NUMBER 
+00295 };
+00296 
+00300 enum readOutFlags {
+00301   GET_READOUT_FLAGS=-1, 
+00302   NORMAL_READOUT=0, 
+00303   STORE_IN_RAM=0x1, 
+00304   READ_HITS=0x2, 
+00305   ZERO_COMPRESSION=0x4,
+00306   PUMP_PROBE_MODE=0x8,
+00307   BACKGROUND_CORRECTIONS=0x1000 
+00308 };
+00312 enum trimMode {
+00313   NOISE_TRIMMING, 
+00314   BEAM_TRIMMING, 
+00315   IMPROVE_TRIMMING, 
+00316   FIXEDSETTINGS_TRIMMING,
+00317   OFFLINE_TRIMMING 
+00318 };
+00322 enum correctionFlags {
+00323   DISCARD_BAD_CHANNELS, 
+00324   AVERAGE_NEIGHBOURS_FOR_BAD_CHANNELS,  
+00325   FLAT_FIELD_CORRECTION,  
+00326   RATE_CORRECTION,  
+00327   ANGULAR_CONVERSION,
+00328   I0_NORMALIZATION
+00329 };
+00330 
+00339 enum {
+00340 
+00341   // General purpose functions
+00342   F_EXEC_COMMAND, 
+00343   F_GET_ERROR,  
+00345   // configuration  functions
+00346   F_GET_DETECTOR_TYPE, 
+00347   F_SET_NUMBER_OF_MODULES, 
+00348   F_GET_MAX_NUMBER_OF_MODULES, 
+00349   F_SET_EXTERNAL_SIGNAL_FLAG,  
+00350   F_SET_EXTERNAL_COMMUNICATION_MODE, 
+00354   // Tests and identification
+00355 
+00356   F_GET_ID, 
+00357   F_DIGITAL_TEST,  
+00358   F_ANALOG_TEST,  
+00359   F_ENABLE_ANALOG_OUT,  
+00360   F_CALIBRATION_PULSE,  
+00362   // Initialization functions
+00363   F_SET_DAC,   
+00364   F_GET_ADC,  
+00365   F_WRITE_REGISTER,  
+00366   F_READ_REGISTER, 
+00367   F_WRITE_MEMORY,  
+00368   F_READ_MEMORY, 
+00371   F_SET_CHANNEL,  
+00372   F_GET_CHANNEL,  
+00373   F_SET_ALL_CHANNELS,  
+00375   F_SET_CHIP,  
+00376   F_GET_CHIP,  
+00377   F_SET_ALL_CHIPS,  
+00379   F_SET_MODULE, 
+00380   F_GET_MODULE,  
+00381   F_SET_ALL_MODULES,  
+00384   F_SET_SETTINGS,  
+00385   F_GET_THRESHOLD_ENERGY,  
+00386   F_SET_THRESHOLD_ENERGY,  
+00389   // Acquisition functions
+00390   F_START_ACQUISITION, 
+00391   F_STOP_ACQUISITION, 
+00392   F_START_READOUT, 
+00393   F_GET_RUN_STATUS,  
+00394   F_START_AND_READ_ALL,  
+00395   F_READ_FRAME,  
+00396   F_READ_ALL,  
+00398   //Acquisition setup functions
+00399   F_SET_TIMER,  
+00400   F_GET_TIME_LEFT,  
+00404   F_SET_DYNAMIC_RANGE,  
+00405   F_SET_READOUT_FLAGS,  
+00406   F_SET_ROI,  
+00408   //Trimming
+00409   F_EXECUTE_TRIMMING,   
+00414   F_EXIT_SERVER  
+00416 };
+00417 
+00418 
+00422 typedef struct  {
+00423   float center;  
+00424   float ecenter; 
+00425   float r_conversion;  
+00426   float er_conversion;  
+00427   float offset; 
+00428   float eoffset; 
+00429   float tilt; 
+00430   float etilt; 
+00431 } angleConversionConstant;
+00432 
+00433 
+00434 #endif
+

Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/sls__detector__defs_8h.html b/slsDetectorSoftware/docs/html/sls__detector__defs_8h.html new file mode 100644 index 000000000..0643a45ab --- /dev/null +++ b/slsDetectorSoftware/docs/html/sls__detector__defs_8h.html @@ -0,0 +1,1044 @@ + + +commonFiles/sls_detector_defs.h File Reference + + + + + + +

commonFiles/sls_detector_defs.h File Reference

#include <stdint.h>
+ +

+Go to the source code of this file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Classes

struct  sls_detector_channel
struct  sls_detector_chip
struct  sls_detector_module
struct  ROI
struct  iarray
struct  angleConversionConstant

Defines

#define MAX_STR_LENGTH   1000
#define GET_FLAG   -1

Enumerations

enum  detectorType {
+  GET_DETECTOR_TYPE, +GENERIC, +MYTHEN, +PILATUS, +
+  EIGER, +GOTTHARD, +AGIPD +
+ }
enum  communicationProtocol { TCP, +UDP + }
enum  numberOf {
+  MAXMODX, +MAXMODY, +NMODX, +NMODY, +
+  NCHANSX, +NCHANSY, +NCHIPSX, +NCHIPSY +
+ }
enum  dimension { X = 0, +Y = 1, +Z = 2 + }
enum  { OK, +FAIL + }
enum  { DISABLED, +ENABLED + }
enum  externalSignalFlag {
+  GET_EXTERNAL_SIGNAL_FLAG, +SIGNAL_OFF, +GATE_IN_ACTIVE_HIGH, +GATE_IN_ACTIVE_LOW, +
+  TRIGGER_IN_RISING_EDGE, +TRIGGER_IN_FALLING_EDGE, +RO_TRIGGER_IN_RISING_EDGE, +RO_TRIGGER_IN_FALLING_EDGE, +
+  GATE_OUT_ACTIVE_HIGH, +GATE_OUT_ACTIVE_LOW, +TRIGGER_OUT_RISING_EDGE, +TRIGGER_OUT_FALLING_EDGE, +
+  RO_TRIGGER_OUT_RISING_EDGE, +RO_TRIGGER_OUT_FALLING_EDGE +
+ }
enum  externalCommunicationMode {
+  GET_EXTERNAL_COMMUNICATION_MODE, +AUTO, +TRIGGER_EXPOSURE, +TRIGGER_READOUT, +
+  TRIGGER_COINCIDENCE_WITH_INTERNAL_ENABLE, +GATE_FIX_NUMBER, +GATE_FIX_DURATION, +GATE_WITH_START_TRIGGER, +
+  GATE_COINCIDENCE_WITH_INTERNAL_ENABLE +
+ }
enum  idMode {
+  MODULE_SERIAL_NUMBER, +MODULE_FIRMWARE_VERSION, +DETECTOR_SERIAL_NUMBER, +DETECTOR_FIRMWARE_VERSION, +
+  DETECTOR_SOFTWARE_VERSION, +THIS_SOFTWARE_VERSION +
+ }
enum  digitalTestMode {
+  CHIP_TEST, +MODULE_FIRMWARE_TEST, +DETECTOR_FIRMWARE_TEST, +DETECTOR_MEMORY_TEST, +
+  DETECTOR_BUS_TEST, +DETECTOR_SOFTWARE_TEST +
+ }
enum  analogTestMode { CALIBRATION_PULSES, +MY_ANALOG_TEST_MODE + }
enum  dacIndex {
+  THRESHOLD, +CALIBRATION_PULSE, +TRIMBIT_SIZE, +PREAMP, +
+  SHAPER1, +SHAPER2, +TEMPERATURE, +HUMIDITY, +
+  DETECTOR_BIAS +
+ }
enum  detectorSettings {
+  GET_SETTINGS = -1, +STANDARD, +FAST, +HIGHGAIN, +
+  UNDEFINED, +UNINITIALIZED +
+ }
enum  channelRegisterBit { TRIMBIT_OFF, +COMPARATOR_ENABLE = 0x100, +ANALOG_SIGNAL_ENABLE = 0x200, +CALIBRATION_ENABLE = 0x300 + }
enum  chipRegisterBit { ENABLE_ANALOG_OUTPUT = 0x1, +CHIP_OUTPUT_WIDTH = 0x2 + }
enum  moduleRegisterBit { MY_MODULE_REGISTER_BIT, +MODULE_OUTPUT_WIDTH + }
enum  timerIndex {
+  FRAME_NUMBER, +ACQUISITION_TIME, +FRAME_PERIOD, +DELAY_AFTER_TRIGGER, +
+  GATES_NUMBER, +PROBES_NUMBER, +CYCLES_NUMBER +
+ }
enum  readOutFlags {
+  GET_READOUT_FLAGS = -1, +NORMAL_READOUT = 0, +STORE_IN_RAM = 0x1, +READ_HITS = 0x2, +
+  ZERO_COMPRESSION = 0x4, +PUMP_PROBE_MODE = 0x8, +BACKGROUND_CORRECTIONS = 0x1000 +
+ }
enum  trimMode {
+  NOISE_TRIMMING, +BEAM_TRIMMING, +IMPROVE_TRIMMING, +FIXEDSETTINGS_TRIMMING, +
+  OFFLINE_TRIMMING +
+ }
enum  correctionFlags {
+  DISCARD_BAD_CHANNELS, +AVERAGE_NEIGHBOURS_FOR_BAD_CHANNELS, +FLAT_FIELD_CORRECTION, +RATE_CORRECTION, +
+  ANGULAR_CONVERSION, +I0_NORMALIZATION +
+ }
enum  {
+  F_EXEC_COMMAND, +F_GET_ERROR, +F_GET_DETECTOR_TYPE, +F_SET_NUMBER_OF_MODULES, +
+  F_GET_MAX_NUMBER_OF_MODULES, +F_SET_EXTERNAL_SIGNAL_FLAG, +F_SET_EXTERNAL_COMMUNICATION_MODE, +F_GET_ID, +
+  F_DIGITAL_TEST, +F_ANALOG_TEST, +F_ENABLE_ANALOG_OUT, +F_CALIBRATION_PULSE, +
+  F_SET_DAC, +F_GET_ADC, +F_WRITE_REGISTER, +F_READ_REGISTER, +
+  F_WRITE_MEMORY, +F_READ_MEMORY, +F_SET_CHANNEL, +F_GET_CHANNEL, +
+  F_SET_ALL_CHANNELS, +F_SET_CHIP, +F_GET_CHIP, +F_SET_ALL_CHIPS, +
+  F_SET_MODULE, +F_GET_MODULE, +F_SET_ALL_MODULES, +F_SET_SETTINGS, +
+  F_GET_THRESHOLD_ENERGY, +F_SET_THRESHOLD_ENERGY, +F_START_ACQUISITION, +F_STOP_ACQUISITION, +
+  F_START_READOUT, +F_GET_RUN_STATUS, +F_START_AND_READ_ALL, +F_READ_FRAME, +
+  F_READ_ALL, +F_SET_TIMER, +F_GET_TIME_LEFT, +F_SET_DYNAMIC_RANGE, +
+  F_SET_READOUT_FLAGS, +F_SET_ROI, +F_EXECUTE_TRIMMING, +F_EXIT_SERVER +
+ }
+


Detailed Description

+This file contains all the basic definitions common to the slsDetector class and to the server programs running on the detector

+

Author:
Anna Bergamaschi
+
Version:
0.1alpha (any string)
+
See also:
slsDetector
+

Define Documentation

+ +
+
+ + + + +
#define GET_FLAG   -1
+
+
+ +

+get flag form most functions +

+

+ +

+
+ + + + +
#define MAX_STR_LENGTH   1000
+
+
+ +

+default maximum string length +

+

+


Enumeration Type Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+return values

Enumerator:
+ + + +
OK  +function succeeded
FAIL  +function failed
+
+ +
+

+ +

+
+ + + + +
anonymous enum
+
+
+ +

+enable/disable flags

Enumerator:
+ + + +
DISABLED  +flag disabled
ENABLED  +flag enabled
+
+ +
+

+ +

+
+ + + + +
anonymous enum
+
+
+ +

+function indexes to call on the server

+All set functions with argument -1 work as get, when possible

Enumerator:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
F_EXEC_COMMAND  +command is executed
F_GET_ERROR  +return detector error status
F_GET_DETECTOR_TYPE  +return detector type
F_SET_NUMBER_OF_MODULES  +set/get number of installed modules
F_GET_MAX_NUMBER_OF_MODULES  +get maximum number of installed modules
F_SET_EXTERNAL_SIGNAL_FLAG  +set/get flag for external signal
F_SET_EXTERNAL_COMMUNICATION_MODE  +set/get external communication mode (obsolete)
F_GET_ID  +get detector id of version
F_DIGITAL_TEST  +digital test of the detector
F_ANALOG_TEST  +analog test of the detector
F_ENABLE_ANALOG_OUT  +enable the analog output
F_CALIBRATION_PULSE  +pulse the calibration input
F_SET_DAC  +set DAC value
F_GET_ADC  +get ADC value
F_WRITE_REGISTER  +write to register
F_READ_REGISTER  +read register
F_WRITE_MEMORY  +write to memory
F_READ_MEMORY  +read memory
F_SET_CHANNEL  +initialize channel
F_GET_CHANNEL  +get channel register
F_SET_ALL_CHANNELS  +initialize all channels
F_SET_CHIP  +initialize chip
F_GET_CHIP  +get chip status
F_SET_ALL_CHIPS  +initialize all chips
F_SET_MODULE  +initialize module
F_GET_MODULE  +get module status
F_SET_ALL_MODULES  +initialize all modules
F_SET_SETTINGS  +set detector settings
F_GET_THRESHOLD_ENERGY  +get detector threshold (in eV)
F_SET_THRESHOLD_ENERGY  +set detector threshold (in eV)
F_START_ACQUISITION  +start acquisition
F_STOP_ACQUISITION  +stop acquisition
F_START_READOUT  +start readout
F_GET_RUN_STATUS  +get acquisition status
F_START_AND_READ_ALL  +start acquisition and read all frames
F_READ_FRAME  +read one frame
F_READ_ALL  +read alla frames
F_SET_TIMER  +set/get timer value
F_GET_TIME_LEFT  +get current value of the timer (time left)
F_SET_DYNAMIC_RANGE  +set/get detector dynamic range
F_SET_READOUT_FLAGS  +set/get readout flags
F_SET_ROI  +set/get region of interest
F_EXECUTE_TRIMMING  +execute trimming
F_EXIT_SERVER  +turnoff detector server
+
+ +
+

+ +

+
+ + + + +
enum analogTestMode
+
+
+ +

+detector analogue test modes

Enumerator:
+ + + +
CALIBRATION_PULSES  +test using calibration pulses
MY_ANALOG_TEST_MODE  +other possible test modes
+
+ +
+

+ +

+
+ + + + +
enum channelRegisterBit
+
+
+ +

+meaning of the channel register bits

See also:
sls_detector_channel
+
Enumerator:
+ + + + + +
TRIMBIT_OFF  +offset of trimbit value in the channel register
COMPARATOR_ENABLE  +mask of the comparator enable bit
ANALOG_SIGNAL_ENABLE  +mask of the analogue output enable bit
CALIBRATION_ENABLE  +mask of the calibration input enable bit
+
+ +
+

+ +

+
+ + + + +
enum chipRegisterBit
+
+
+ +

+meaning of the chip register bits

See also:
sls_detector_chip
+
Enumerator:
+ + + +
ENABLE_ANALOG_OUTPUT  +mask of the analogue output enable bit
CHIP_OUTPUT_WIDTH  +mask of the chip output width
+
+ +
+

+ +

+
+ + + + +
enum communicationProtocol
+
+
+ +

+Communication protocol (normally TCP)

Enumerator:
+ + + +
TCP  +TCP/IP
UDP  +UDP
+
+ +
+

+ +

+
+ + + + +
enum correctionFlags
+
+
+ +

+data correction flags

Enumerator:
+ + + + + + + +
DISCARD_BAD_CHANNELS  +bad channels are discarded
AVERAGE_NEIGHBOURS_FOR_BAD_CHANNELS  +bad channels are replaced with the avergae of the neighbours
FLAT_FIELD_CORRECTION  +data are flat field corrected
RATE_CORRECTION  +data are rate corrected
ANGULAR_CONVERSION  +angular conversion is calculated
I0_NORMALIZATION  +
+
+ +
+

+ +

+
+ + + + +
enum dacIndex
+
+
+ +

+detector dacs indexes

Enumerator:
+ + + + + + + + + + +
THRESHOLD  +comparator threshold level
CALIBRATION_PULSE  +calibration input pulse height
TRIMBIT_SIZE  +voltage to determine the trimbits LSB
PREAMP  +preamp feedback
SHAPER1  +shaper1 feedback
SHAPER2  +shaper2 feedback
TEMPERATURE  +temperature sensor (adc)
HUMIDITY  +humidity sensor (adc)
DETECTOR_BIAS  +detector bias
+
+ +
+

+ +

+
+ + + + +
enum detectorSettings
+
+
+ +

+detector settings indexes

Enumerator:
+ + + + + + + +
GET_SETTINGS  +return current detector settings
STANDARD  +standard settings
FAST  +fast settings
HIGHGAIN  +highgain settings
UNDEFINED  +undefined or custom settings
UNINITIALIZED  +uninitialiazed (status at startup)
+
+ +
+

+ +

+
+ + + + +
enum detectorType
+
+
+ +

+Type of the detector

Enumerator:
+ + + + + + + + +
GET_DETECTOR_TYPE  +the detector will return its type
GENERIC  +generic sls detector
MYTHEN  +mythen
PILATUS  +pilatus
EIGER  +eiger
GOTTHARD  +gotthard
AGIPD  +agipd
+
+ +
+

+ +

+
+ + + + +
enum digitalTestMode
+
+
+ +

+detector digital test modes

Enumerator:
+ + + + + + + +
CHIP_TEST  +test chips
MODULE_FIRMWARE_TEST  +test module firmware
DETECTOR_FIRMWARE_TEST  +test detector system firmware
DETECTOR_MEMORY_TEST  +test detector system memory
DETECTOR_BUS_TEST  +test detector system CPU-FPGA bus
DETECTOR_SOFTWARE_TEST  +test detector system software
+
+ +
+

+ +

+
+ + + + +
enum dimension
+
+
+ +

+dimension indexes

Enumerator:
+ + + + +
X  +X dimension
Y  +Y dimension
Z  +Z dimension
+
+ +
+

+ +

+
+ + + + +
enum externalCommunicationMode
+
+
+ +

+communication mode using external signals (obsolete: it will be authomatically determined by the external signal flags)

+

See also:
externalSignalFlag
+
Enumerator:
+ + + + + + + + + + +
GET_EXTERNAL_COMMUNICATION_MODE  +
AUTO  +
TRIGGER_EXPOSURE  +
TRIGGER_READOUT  +
TRIGGER_COINCIDENCE_WITH_INTERNAL_ENABLE  +
GATE_FIX_NUMBER  +
GATE_FIX_DURATION  +
GATE_WITH_START_TRIGGER  +
GATE_COINCIDENCE_WITH_INTERNAL_ENABLE  +
+
+ +
+

+ +

+
+ + + + +
enum externalSignalFlag
+
+
+ +

+use of the external signals

Enumerator:
+ + + + + + + + + + + + + + + +
GET_EXTERNAL_SIGNAL_FLAG  +return flag for signal
SIGNAL_OFF  +signal unused
GATE_IN_ACTIVE_HIGH  +input gate active high
GATE_IN_ACTIVE_LOW  +input gate active low
TRIGGER_IN_RISING_EDGE  +input exposure trigger on rising edge
TRIGGER_IN_FALLING_EDGE  +input exposure trigger on falling edge
RO_TRIGGER_IN_RISING_EDGE  +input raedout trigger on rising edge
RO_TRIGGER_IN_FALLING_EDGE  +input readout trigger on falling edge
GATE_OUT_ACTIVE_HIGH  +output active high when detector is exposing
GATE_OUT_ACTIVE_LOW  +output active low when detector is exposing
TRIGGER_OUT_RISING_EDGE  +output trigger rising edge at start of exposure
TRIGGER_OUT_FALLING_EDGE  +output trigger falling edge at start of exposure
RO_TRIGGER_OUT_RISING_EDGE  +output trigger rising edge at start of readout
RO_TRIGGER_OUT_FALLING_EDGE  +output trigger falling edge at start of readout
+
+ +
+

+ +

+
+ + + + +
enum idMode
+
+
+ +

+detector IDs/versions

Enumerator:
+ + + + + + + +
MODULE_SERIAL_NUMBER  +return module serial number
MODULE_FIRMWARE_VERSION  +return module firmware
DETECTOR_SERIAL_NUMBER  +return detector system serial number
DETECTOR_FIRMWARE_VERSION  +return detector system firmware version
DETECTOR_SOFTWARE_VERSION  +return detector system software version
THIS_SOFTWARE_VERSION  +return this software version
+
+ +
+

+ +

+
+ + + + +
enum moduleRegisterBit
+
+
+ +

+meaning of the module register bits

Enumerator:
+ + + +
MY_MODULE_REGISTER_BIT  +possible module register bit meaning
MODULE_OUTPUT_WIDTH  +possibly module dynamic range
+
+ +
+

+ +

+
+ + + + +
enum numberOf
+
+
+ +

+flags to get (or set) the size of the detector

Enumerator:
+ + + + + + + + + +
MAXMODX  +maximum number of module in X direction
MAXMODY  +maximum number of module in Y direction
NMODX  +installed number of module in X direction
NMODY  +installed number of module in Y direction
NCHANSX  +number of channels in X direction
NCHANSY  +number of channels in Y direction
NCHIPSX  +number of chips in X direction
NCHIPSY  +number of chips in Y direction
+
+ +
+

+ +

+
+ + + + +
enum readOutFlags
+
+
+ +

+readout flags

Enumerator:
+ + + + + + + + +
GET_READOUT_FLAGS  +return readout flags
NORMAL_READOUT  +no flag
STORE_IN_RAM  +data are stored in ram and sent only after end of acquisition for faster frame rate
READ_HITS  +return only the number of the channel which counted ate least one
ZERO_COMPRESSION  +returned data are 0-compressed
PUMP_PROBE_MODE  +pump-probe mode
BACKGROUND_CORRECTIONS  +background corrections
+
+ +
+

+ +

+
+ + + + +
enum timerIndex
+
+
+ +

+indexes for the acquisition timers

Enumerator:
+ + + + + + + + +
FRAME_NUMBER  +number of real time frames: total number of acquisitions is number or frames*number of cycles
ACQUISITION_TIME  +exposure time
FRAME_PERIOD  +period between exposures
DELAY_AFTER_TRIGGER  +delay between trigger and start of exposure or readout (in triggered mode)
GATES_NUMBER  +number of gates per frame (in gated mode)
PROBES_NUMBER  +number of probe types in pump-probe mode
CYCLES_NUMBER  +number of cycles: total number of acquisitions is number or frames*number of cycles
+
+ +
+

+ +

+
+ + + + +
enum trimMode
+
+
+ +

+trimming modes

Enumerator:
+ + + + + + +
NOISE_TRIMMING  +trim with noise
BEAM_TRIMMING  +trim with x-rays (on all 63 bits)
IMPROVE_TRIMMING  +trim with x-rays (on a limited range of bits - should start from an already trimmed mode)
FIXEDSETTINGS_TRIMMING  +trim without optimizing the threshold and the trimbit size
OFFLINE_TRIMMING  +trimming is performed offline
+
+ +
+

+


Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/structROI-members.html b/slsDetectorSoftware/docs/html/structROI-members.html new file mode 100644 index 000000000..a86a4c7c0 --- /dev/null +++ b/slsDetectorSoftware/docs/html/structROI-members.html @@ -0,0 +1,31 @@ + + +Member List + + + + + + +

ROI Member List

This is the complete list of members for ROI, including all inherited members.

+ + + + +
xmaxROI
xminROI
ymaxROI
yminROI


Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/structROI.html b/slsDetectorSoftware/docs/html/structROI.html new file mode 100644 index 000000000..398eae7bb --- /dev/null +++ b/slsDetectorSoftware/docs/html/structROI.html @@ -0,0 +1,107 @@ + + +ROI Struct Reference + + + + + + +

ROI Struct Reference

#include <sls_detector_defs.h> +

+List of all members. + + + + + + + + + + +

Public Attributes

int xmin
int xmax
int ymin
int ymax
+


Detailed Description

+structure for a region of interest

+xmin,xmax,ymin,ymax define the limits of the region +

+


Member Data Documentation

+ +
+
+ + + + +
int ROI::xmax
+
+
+ +

+is the roi xmax (in channel number) +

+

+ +

+
+ + + + +
int ROI::xmin
+
+
+ +

+is the roi xmin (in channel number) +

+

+ +

+
+ + + + +
int ROI::ymax
+
+
+ +

+is the roi ymax (in channel number) +

+

+ +

+
+ + + + +
int ROI::ymin
+
+
+ +

+is the roi ymin (in channel number) +

+

+


The documentation for this struct was generated from the following file: +
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/structangleConversionConstant-members.html b/slsDetectorSoftware/docs/html/structangleConversionConstant-members.html new file mode 100644 index 000000000..20438c0c6 --- /dev/null +++ b/slsDetectorSoftware/docs/html/structangleConversionConstant-members.html @@ -0,0 +1,35 @@ + + +Member List + + + + + + +

angleConversionConstant Member List

This is the complete list of members for angleConversionConstant, including all inherited members.

+ + + + + + + + +
centerangleConversionConstant
ecenterangleConversionConstant
eoffsetangleConversionConstant
er_conversionangleConversionConstant
etiltangleConversionConstant
offsetangleConversionConstant
r_conversionangleConversionConstant
tiltangleConversionConstant


Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/structangleConversionConstant.html b/slsDetectorSoftware/docs/html/structangleConversionConstant.html new file mode 100644 index 000000000..6d900f96c --- /dev/null +++ b/slsDetectorSoftware/docs/html/structangleConversionConstant.html @@ -0,0 +1,174 @@ + + +angleConversionConstant Struct Reference + + + + + + +

angleConversionConstant Struct Reference

#include <sls_detector_defs.h> +

+List of all members. + + + + + + + + + + + + + + + + + + +

Public Attributes

float center
float ecenter
float r_conversion
float er_conversion
float offset
float eoffset
float tilt
float etilt
+


Detailed Description

+angular conversion constant for a module +

+


Member Data Documentation

+ +
+ +
+ +

+center of the module (channel at which the radius is perpendicular to the module surface) +

+

+ +

+ +
+ +

+error in the center determination +

+

+ +

+ +
+ +

+error in the offset determination +

+

+ +

+ +
+ +

+error in the r_conversion determination +

+

+ +

+ +
+ +

+error in the tilt determination +

+

+ +

+ +
+ +

+the module offset i.e. the position of channel 0 with respect to the diffractometer 0 +

+

+ +

+ +
+ +

+detector pixel size (or strip pitch) divided by the diffractometer radius +

+

+ +

+ +
+ +

+ossible tilt in the orthogonal direction (unused) +

+

+


The documentation for this struct was generated from the following file: +
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/structiarray-members.html b/slsDetectorSoftware/docs/html/structiarray-members.html new file mode 100644 index 000000000..e99fa9ad7 --- /dev/null +++ b/slsDetectorSoftware/docs/html/structiarray-members.html @@ -0,0 +1,29 @@ + + +Member List + + + + + + +

iarray Member List

This is the complete list of members for iarray, including all inherited members.

+ + +
iptriarray
leniarray


Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/structiarray.html b/slsDetectorSoftware/docs/html/structiarray.html new file mode 100644 index 000000000..1d4e187e3 --- /dev/null +++ b/slsDetectorSoftware/docs/html/structiarray.html @@ -0,0 +1,72 @@ + + +iarray Struct Reference + + + + + + +

iarray Struct Reference

#include <sls_detector_defs.h> +

+List of all members. + + + + + + +

Public Attributes

int len
int * iptr
+


Detailed Description

+structure for a generic integer array +

+


Member Data Documentation

+ +
+
+ + + + +
int* iarray::iptr
+
+
+ +

+is the pointer to the array +

+

+ +

+
+ + + + +
int iarray::len
+
+
+ +

+is the number of elements of the array +

+

+


The documentation for this struct was generated from the following file: +
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/structslsDetector_1_1sharedSlsDetector-members.html b/slsDetectorSoftware/docs/html/structslsDetector_1_1sharedSlsDetector-members.html new file mode 100644 index 000000000..a0c00972d --- /dev/null +++ b/slsDetectorSoftware/docs/html/structslsDetector_1_1sharedSlsDetector-members.html @@ -0,0 +1,77 @@ + + +Member List + + + + + + +

slsDetector::sharedSlsDetector Member List

This is the complete list of members for slsDetector::sharedSlsDetector, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
adcoffslsDetector::sharedSlsDetector
alreadyExistingslsDetector::sharedSlsDetector
angDirectionslsDetector::sharedSlsDetector
angOffslsDetector::sharedSlsDetector
badChansListslsDetector::sharedSlsDetector
badFFListslsDetector::sharedSlsDetector
binSizeslsDetector::sharedSlsDetector
calDirslsDetector::sharedSlsDetector
chanoffslsDetector::sharedSlsDetector
chipoffslsDetector::sharedSlsDetector
clkDivslsDetector::sharedSlsDetector
controlPortslsDetector::sharedSlsDetector
correctionMaskslsDetector::sharedSlsDetector
currentSettingsslsDetector::sharedSlsDetector
currentThresholdEVslsDetector::sharedSlsDetector
dacoffslsDetector::sharedSlsDetector
dataBytesslsDetector::sharedSlsDetector
dataPortslsDetector::sharedSlsDetector
detPositionsslsDetector::sharedSlsDetector
dynamicRangeslsDetector::sharedSlsDetector
fferroffslsDetector::sharedSlsDetector
ffoffslsDetector::sharedSlsDetector
fileIndexslsDetector::sharedSlsDetector
fileNameslsDetector::sharedSlsDetector
filePathslsDetector::sharedSlsDetector
fineOffsetslsDetector::sharedSlsDetector
globalOffsetslsDetector::sharedSlsDetector
hostnameslsDetector::sharedSlsDetector
modoffslsDetector::sharedSlsDetector
myDetectorTypeslsDetector::sharedSlsDetector
nAdcsslsDetector::sharedSlsDetector
nBadChansslsDetector::sharedSlsDetector
nBadFFslsDetector::sharedSlsDetector
nChansslsDetector::sharedSlsDetector
nChipsslsDetector::sharedSlsDetector
nDacsslsDetector::sharedSlsDetector
nModslsDetector::sharedSlsDetector
nModMaxslsDetector::sharedSlsDetector
nModsslsDetector::sharedSlsDetector
nModsMaxslsDetector::sharedSlsDetector
nROIslsDetector::sharedSlsDetector
nTrimEnslsDetector::sharedSlsDetector
numberOfPositionsslsDetector::sharedSlsDetector
roFlagsslsDetector::sharedSlsDetector
roiLimitsslsDetector::sharedSlsDetector
stopPortslsDetector::sharedSlsDetector
tDeadslsDetector::sharedSlsDetector
timerValueslsDetector::sharedSlsDetector
trimDirslsDetector::sharedSlsDetector
trimEnergiesslsDetector::sharedSlsDetector


Generated on Fri Oct 9 16:01:05 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/structslsDetector_1_1sharedSlsDetector.html b/slsDetectorSoftware/docs/html/structslsDetector_1_1sharedSlsDetector.html new file mode 100644 index 000000000..ba35a1c05 --- /dev/null +++ b/slsDetectorSoftware/docs/html/structslsDetector_1_1sharedSlsDetector.html @@ -0,0 +1,897 @@ + + +slsDetector::sharedSlsDetector Struct Reference + + + + + + + +

slsDetector::sharedSlsDetector Struct Reference

Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!). +More... +

+#include <slsDetector.h> +

+List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Attributes

int alreadyExisting
char hostname [MAX_STR_LENGTH]
int controlPort
int stopPort
int dataPort
detectorType myDetectorType
char trimDir [MAX_STR_LENGTH]
char calDir [MAX_STR_LENGTH]
int nTrimEn
int trimEnergies [100]
int fileIndex
char filePath [MAX_STR_LENGTH]
char fileName [MAX_STR_LENGTH]
int nMod [2]
int nMods
int nModMax [2]
int nModsMax
int nChans
int nChips
int nDacs
int nAdcs
int dynamicRange
int dataBytes
int correctionMask
float tDead
int nBadChans
int badChansList [MAX_BADCHANS]
int nBadFF
int badFFList [MAX_BADCHANS]
angleConversionConstant angOff [MAXMODS]
int angDirection
float fineOffset
float globalOffset
int numberOfPositions
float detPositions [MAXPOS]
float binSize
int nROI
ROI roiLimits [MAX_ROIS]
readOutFlags roFlags
detectorSettings currentSettings
int currentThresholdEV
int64_t timerValue [MAX_TIMERS]
int clkDiv
int ffoff
int fferroff
int modoff
int dacoff
int adcoff
int chipoff
int chanoff
+


Detailed Description

+Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!). +

+


Member Data Documentation

+ +
+ +
+ +

+memory offsets for the adc arrays +

+

+ +

+ +
+ +

+already existing flag. If the detector does not yet exist (alreadyExisting=0) the sharedMemory will be created, otherwise it will simly be linked +

+

+ +

+ +
+ +

+angular direction (1 if it corresponds to the encoder direction i.e. channel 0 is 0, maxchan is positive high angle, 0 otherwise +

+

+ +

+ +
+ +

+array of angular conversion constants for each module

See also:
angleConversionConstant
+ +
+

+ +

+
+ + + + +
int slsDetector::sharedSlsDetector::badChansList[MAX_BADCHANS]
+
+
+ +

+list of bad channels +

+

+ +

+
+ + + + +
int slsDetector::sharedSlsDetector::badFFList[MAX_BADCHANS]
+
+
+ +

+list of bad channels from flat field i.e. channels which read 0 in the flat field file +

+

+ +

+ +
+ +

+bin size for data merging +

+

+ +

+
+ + + + +
char slsDetector::sharedSlsDetector::calDir[MAX_STR_LENGTH]
+
+
+ +

+path of the calibration files +

+

+ +

+ +
+ +

+memory offsets for the channel register arrays +

+

+ +

+ +
+ +

+memory offsets for the chip register arrays +

+

+ +

+ +
+ +

+clock divider +

+

+ +

+ +
+ +

+is the port used for control functions normally it should not be changed +

+

+ +

+ +
+ +

+corrections to be applied to the data

See also:
correctionFlags
+ +
+

+ +

+ +
+ +

+detector settings (standard, fast, etc.) +

+

+ +

+ +
+ +

+detector threshold (eV) +

+

+ +

+ +
+ +

+memory offsets for the dac arrays +

+

+ +

+ +
+ +

+size of the data that are transfered from the detector +

+

+ +

+ +
+ +

+is the port used to acquire the data normally it should not be changed +

+

+ +

+ +
+ +

+list of encoder positions at which the detector should acquire +

+

+ +

+ +
+ +

+dynamic range of the detector data +

+

+ +

+ +
+ +

+memory offsets for the flat filed coefficient errors +

+

+ +

+ +
+ +

+memory offsets for the flat filed coefficients +

+

+ +

+ +
+ +

+current index of the output file +

+

+ +

+
+ + + + +
char slsDetector::sharedSlsDetector::fileName[MAX_STR_LENGTH]
+
+
+ +

+name root of the output files +

+

+ +

+
+ + + + +
char slsDetector::sharedSlsDetector::filePath[MAX_STR_LENGTH]
+
+
+ +

+path of the output files +

+

+ +

+ +
+ +

+beamline fine offset (of the order of mdeg, might be adjusted for each measurements) +

+

+ +

+ +
+ +

+beamline offset (might be a few degrees beacuse of encoder offset - normally it is kept fixed for a long period of time) +

+

+ +

+
+ + + + +
char slsDetector::sharedSlsDetector::hostname[MAX_STR_LENGTH]
+
+
+ +

+is the hostname (or IP address) of the detector. needs to be set before startin the communication +

+

+ +

+ +
+ +

+memory offsets for the module structures +

+

+ +

+ +
+ +

+detector type \ see :: detectorType +

+

+ +

+ +
+ +

+number of adcs per module +

+

+ +

+ +
+ +

+number of bad channels from bad channel list +

+

+ +

+ +
+ +

+number of bad channels from flat field i.e. channels which read 0 in the flat field file +

+

+ +

+ +
+ +

+number of channels per chip +

+

+ +

+ +
+ +

+number of chips per module +

+

+ +

+ +
+ +

+number of dacs per module +

+

+ +

+ +
+ +

+number of installed modules of the detector (x and y directions) +

+

+ +

+ +
+ +

+maximum number of modules of the detector (x and y directions) +

+

+ +

+ +
+ +

+number of modules ( nMod[X]*nMod[Y])

See also:
nMod
+ +
+

+ +

+ +
+ +

+maximum number of modules (nModMax[X]*nModMax[Y])

See also:
nModMax
+ +
+

+ +

+ +
+ +

+number of rois defined +

+

+ +

+ +
+ +

+number of energies at which the detector has been trimmed (unused) +

+

+ +

+ +
+ +

+number of positions at which the detector should acquire +

+

+ +

+ +
+ +

+readout flags +

+

+ +

+ +
+ +

+list of rois +

+

+ +

+ +
+ +

+is the port used to stop the acquisition normally it should not be changed +

+

+ +

+ +
+ +

+dead time (in ns) for rate corrections +

+

+ +

+
+ + + + +
int64_t slsDetector::sharedSlsDetector::timerValue[MAX_TIMERS]
+
+
+ +

+timer values +

+

+ +

+
+ + + + +
char slsDetector::sharedSlsDetector::trimDir[MAX_STR_LENGTH]
+
+
+ +

+path of the trimbits files +

+

+ +

+ +
+ +

+list of the energies at which the detector has been trimmed (unused) +

+

+


The documentation for this struct was generated from the following file: +
Generated on Fri Oct 9 16:01:05 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/structsls__detector__channel-members.html b/slsDetectorSoftware/docs/html/structsls__detector__channel-members.html new file mode 100644 index 000000000..bb3c515d6 --- /dev/null +++ b/slsDetectorSoftware/docs/html/structsls__detector__channel-members.html @@ -0,0 +1,31 @@ + + +Member List + + + + + + +

sls_detector_channel Member List

This is the complete list of members for sls_detector_channel, including all inherited members.

+ + + + +
chansls_detector_channel
chipsls_detector_channel
modulesls_detector_channel
regsls_detector_channel


Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/structsls__detector__channel.html b/slsDetectorSoftware/docs/html/structsls__detector__channel.html new file mode 100644 index 000000000..68c0ac27a --- /dev/null +++ b/slsDetectorSoftware/docs/html/structsls__detector__channel.html @@ -0,0 +1,108 @@ + + +sls_detector_channel Struct Reference + + + + + + +

sls_detector_channel Struct Reference

#include <sls_detector_defs.h> +

+List of all members. + + + + + + + + + + +

Public Attributes

int chan
int chip
int module
int64_t reg
+


Detailed Description

+structure for a detector channel should not be used by unexperienced users

+

See also:
channelRegisterBit
+ +

+


Member Data Documentation

+ +
+ +
+ +

+is the channel number +

+

+ +

+ +
+ +

+is the chip number +

+

+ +

+ +
+ +

+is the module number +

+

+ +

+
+ + + + +
int64_t sls_detector_channel::reg
+
+
+ +

+is the is the channel register (e.g. trimbits, calibration enable, comparator enable...) +

+

+


The documentation for this struct was generated from the following file: +
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/structsls__detector__chip-members.html b/slsDetectorSoftware/docs/html/structsls__detector__chip-members.html new file mode 100644 index 000000000..e2e0771a9 --- /dev/null +++ b/slsDetectorSoftware/docs/html/structsls__detector__chip-members.html @@ -0,0 +1,32 @@ + + +Member List + + + + + + +

sls_detector_chip Member List

This is the complete list of members for sls_detector_chip, including all inherited members.

+ + + + + +
chanregssls_detector_chip
chipsls_detector_chip
modulesls_detector_chip
nchansls_detector_chip
regsls_detector_chip


Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/structsls__detector__chip.html b/slsDetectorSoftware/docs/html/structsls__detector__chip.html new file mode 100644 index 000000000..6726b024c --- /dev/null +++ b/slsDetectorSoftware/docs/html/structsls__detector__chip.html @@ -0,0 +1,126 @@ + + +sls_detector_chip Struct Reference + + + + + + +

sls_detector_chip Struct Reference

#include <sls_detector_defs.h> +

+List of all members. + + + + + + + + + + + + +

Public Attributes

int chip
int module
int nchan
int reg
int * chanregs
+


Detailed Description

+structure for a detector chip should not be used by unexperienced users
See also:
chipRegisterBit channelRegisterBit
+ +

+


Member Data Documentation

+ +
+
+ + + + +
int* sls_detector_chip::chanregs
+
+
+ +

+is the pointer to the array of the channel registers

See also:
channelRegisterBit
+ +
+

+ +

+
+ + + + +
int sls_detector_chip::chip
+
+
+ +

+is the chip number +

+

+ +

+
+ + + + +
int sls_detector_chip::module
+
+
+ +

+is the module number +

+

+ +

+
+ + + + +
int sls_detector_chip::nchan
+
+
+ +

+is the number of channels in the chip +

+

+ +

+
+ + + + +
int sls_detector_chip::reg
+
+
+ +

+is the chip register (e.g. output analogue buffer enable)

See also:
chipRegisterBit
+ +
+

+


The documentation for this struct was generated from the following file: +
Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/structsls__detector__module-members.html b/slsDetectorSoftware/docs/html/structsls__detector__module-members.html new file mode 100644 index 000000000..46e2695a2 --- /dev/null +++ b/slsDetectorSoftware/docs/html/structsls__detector__module-members.html @@ -0,0 +1,40 @@ + + +Member List + + + + + + +

sls_detector_module Member List

This is the complete list of members for sls_detector_module, including all inherited members.

+ + + + + + + + + + + + + +
adcssls_detector_module
chanregssls_detector_module
chipregssls_detector_module
dacssls_detector_module
gainsls_detector_module
modulesls_detector_module
nadcsls_detector_module
nchansls_detector_module
nchipsls_detector_module
ndacsls_detector_module
offsetsls_detector_module
regsls_detector_module
serialnumbersls_detector_module


Generated on Fri Oct 9 16:01:05 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/structsls__detector__module.html b/slsDetectorSoftware/docs/html/structsls__detector__module.html new file mode 100644 index 000000000..aa62d8f83 --- /dev/null +++ b/slsDetectorSoftware/docs/html/structsls__detector__module.html @@ -0,0 +1,273 @@ + + +sls_detector_module Struct Reference + + + + + + +

sls_detector_module Struct Reference

#include <sls_detector_defs.h> +

+List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Attributes

int module
int serialnumber
int nchan
int nchip
int ndac
int nadc
int reg
float * dacs
float * adcs
int * chipregs
int * chanregs
float gain
float offset
+


Detailed Description

+structure for a detector module should not be used by unexperienced users

+

See also:
:: moduleRegisterBit chipRegisterBit :channelRegisterBit
+
    +
  • reg is the module register (e.g. dynamic range? see moduleRegisterBit)
  • +
  • dacs is the pointer to the array of dac values (in V)
  • +
  • adcs is the pointer to the array of adc values (in V)
  • +
  • chipregs is the pointer to the array of chip registers
  • +
  • chanregs is the pointer to the array of channel registers
  • +
  • gain is the module gain
  • +
  • offset is the module offset
  • +
+ +

+


Member Data Documentation

+ +
+
+ + + + +
float* sls_detector_module::adcs
+
+
+ +

+is the pointer to the array of the adc values (in V) +

+

+ +

+ +
+ +

+is the pointer to the array of the channel registers

See also:
channelRegisterBit
+ +
+

+ +

+ +
+ +

+is the pointer to the array of the chip registers

See also:
chipRegisterBit
+ +
+

+ +

+
+ + + + +
float* sls_detector_module::dacs
+
+
+ +

+is the pointer to the array of the dac values (in V) +

+

+ +

+
+ + + + +
float sls_detector_module::gain
+
+
+ +

+is the module gain (V/keV) +

+

+ +

+ +
+ +

+is the module number +

+

+ +

+
+ + + + +
int sls_detector_module::nadc
+
+
+ +

+is the number of adcs on the module +

+

+ +

+ +
+ +

+is the number of channels per chip +

+

+ +

+ +
+ +

+is the number of chips on the module +

+

+ +

+
+ + + + +
int sls_detector_module::ndac
+
+
+ +

+is the number of dacs on the module +

+

+ +

+
+ + + + +
float sls_detector_module::offset
+
+
+ +

+is the module offset (V) +

+

+ +

+
+ + + + +
int sls_detector_module::reg
+
+
+ +

+is the module register (e.g. dynamic range?)

See also:
moduleRegisterBit
+ +
+

+ +

+ +
+ +

+is the module serial number +

+

+


The documentation for this struct was generated from the following file: +
Generated on Fri Oct 9 16:01:05 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/tab_b.gif b/slsDetectorSoftware/docs/html/tab_b.gif new file mode 100644 index 000000000..0d623483f Binary files /dev/null and b/slsDetectorSoftware/docs/html/tab_b.gif differ diff --git a/slsDetectorSoftware/docs/html/tab_l.gif b/slsDetectorSoftware/docs/html/tab_l.gif new file mode 100644 index 000000000..9b1e6337c Binary files /dev/null and b/slsDetectorSoftware/docs/html/tab_l.gif differ diff --git a/slsDetectorSoftware/docs/html/tab_r.gif b/slsDetectorSoftware/docs/html/tab_r.gif new file mode 100644 index 000000000..ce9dd9f53 Binary files /dev/null and b/slsDetectorSoftware/docs/html/tab_r.gif differ diff --git a/slsDetectorSoftware/docs/html/tabs.css b/slsDetectorSoftware/docs/html/tabs.css new file mode 100644 index 000000000..a61552a67 --- /dev/null +++ b/slsDetectorSoftware/docs/html/tabs.css @@ -0,0 +1,102 @@ +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs INPUT +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI#current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI#current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.nav +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; +} diff --git a/slsDetectorSoftware/docs/html/usersFunctions_8c.html b/slsDetectorSoftware/docs/html/usersFunctions_8c.html new file mode 100644 index 000000000..b1cab6701 --- /dev/null +++ b/slsDetectorSoftware/docs/html/usersFunctions_8c.html @@ -0,0 +1,204 @@ + + +usersFunctions/usersFunctions.c File Reference + + + + + + +

usersFunctions/usersFunctions.c File Reference

#include "usersFunctions.h"
+#include <math.h>
+ + + + + + + + + + + + + + + + +

Functions

float angle (int ichan, float encoder, float totalOffset, float conv_r, float center, float offset, float tilt, int direction)
float get_position ()
int go_to_position (float p)
int go_to_position_no_wait (float p)
float get_i0 ()

Variables

float pos
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
float angle (int  ichan,
float  encoder,
float  totalOffset,
float  conv_r,
float  center,
float  offset,
float  tilt,
int  direction 
)
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + +
float get_i0 (  ) 
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + +
float get_position (  ) 
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + + +
int go_to_position (float  p  ) 
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + + +
int go_to_position_no_wait (float  p  ) 
+
+
+ +

+ +

+

+


Variable Documentation

+ +
+
+ + + + +
float pos
+
+
+ +

+ +

+

+


Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/usersFunctions_8h-source.html b/slsDetectorSoftware/docs/html/usersFunctions_8h-source.html new file mode 100644 index 000000000..b94aa5169 --- /dev/null +++ b/slsDetectorSoftware/docs/html/usersFunctions_8h-source.html @@ -0,0 +1,59 @@ + + +usersFunctions/usersFunctions.h Source File + + + + + + +

usersFunctions/usersFunctions.h

Go to the documentation of this file.
00001 #ifndef USERS_FUNCTIONS_H
+00002 #define USERS_FUNCTIONS_H
+00003 /******************************************************************
+00004 
+00005 Functions depending on the experimental setup should be defined here
+00006 
+00007 ******************************************************************/
+00008 
+00009 #define PI 3.14159265358979323846
+00010 
+00011 
+00012 
+00013 #ifdef __cplusplus
+00014 extern "C" {
+00015 #endif
+00016 
+00017   float angle(int ichan, float encoder, float totalOffset, float conv_r, float center, float offset, float tilt, int direction);
+00018   float get_position();
+00019   int go_to_position(float p);
+00020   int go_to_position_no_wait(float p);
+00021 
+00022 
+00023   float get_i0();
+00024   
+00025 
+00026 
+00027 
+00028 
+00029 #ifdef __cplusplus
+00030 };
+00031 #endif
+00032 
+00033 
+00034 #endif
+

Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/html/usersFunctions_8h.html b/slsDetectorSoftware/docs/html/usersFunctions_8h.html new file mode 100644 index 000000000..50409056b --- /dev/null +++ b/slsDetectorSoftware/docs/html/usersFunctions_8h.html @@ -0,0 +1,204 @@ + + +usersFunctions/usersFunctions.h File Reference + + + + + + +

usersFunctions/usersFunctions.h File Reference

+

+Go to the source code of this file. + + + + + + + + + + + + + + + +

Defines

#define PI   3.14159265358979323846

Functions

float angle (int ichan, float encoder, float totalOffset, float conv_r, float center, float offset, float tilt, int direction)
float get_position ()
int go_to_position (float p)
int go_to_position_no_wait (float p)
float get_i0 ()
+


Define Documentation

+ +
+
+ + + + +
#define PI   3.14159265358979323846
+
+
+ +

+ +

+

+


Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
float angle (int  ichan,
float  encoder,
float  totalOffset,
float  conv_r,
float  center,
float  offset,
float  tilt,
int  direction 
)
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + +
float get_i0 (  ) 
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + +
float get_position (  ) 
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + + +
int go_to_position (float  p  ) 
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + + +
int go_to_position_no_wait (float  p  ) 
+
+
+ +

+ +

+

+


Generated on Fri Oct 9 16:01:04 2009 by  + +doxygen 1.4.7
+ + diff --git a/slsDetectorSoftware/docs/latex/FreeSans.ttf b/slsDetectorSoftware/docs/latex/FreeSans.ttf new file mode 100644 index 000000000..b550b90ba Binary files /dev/null and b/slsDetectorSoftware/docs/latex/FreeSans.ttf differ diff --git a/slsDetectorSoftware/docs/latex/Makefile b/slsDetectorSoftware/docs/latex/Makefile new file mode 100644 index 000000000..776fcf968 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/Makefile @@ -0,0 +1,39 @@ +all: clean refman.dvi + +ps: refman.ps + +pdf: refman.pdf + +ps_2on1: refman_2on1.ps + +pdf_2on1: refman_2on1.pdf + +refman.ps: refman.dvi + dvips -o refman.ps refman.dvi + +refman.pdf: refman.ps + ps2pdf refman.ps refman.pdf + +refman.dvi: refman.tex doxygen.sty + echo "Running latex..." + latex refman.tex + echo "Running makeindex..." + makeindex refman.idx + echo "Rerunning latex...." + latex refman.tex + latex_count=5 ; \ + while egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\ + do \ + echo "Rerunning latex...." ;\ + latex refman.tex ;\ + latex_count=`expr $$latex_count - 1` ;\ + done + +refman_2on1.ps: refman.ps + psnup -2 refman.ps >refman_2on1.ps + +refman_2on1.pdf: refman_2on1.ps + ps2pdf refman_2on1.ps refman_2on1.pdf + +clean: + rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out refman.pdf diff --git a/slsDetectorSoftware/docs/latex/MySocketTCP_8cxx.tex b/slsDetectorSoftware/docs/latex/MySocketTCP_8cxx.tex new file mode 100644 index 000000000..e12ec6b64 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/MySocketTCP_8cxx.tex @@ -0,0 +1,6 @@ +\section{My\-Socket\-TCP/My\-Socket\-TCP.cxx File Reference} +\label{MySocketTCP_8cxx}\index{MySocketTCP/MySocketTCP.cxx@{MySocketTCP/MySocketTCP.cxx}} +{\tt \#include \char`\"{}My\-Socket\-TCP.h\char`\"{}}\par +{\tt \#include $<$string.h$>$}\par +{\tt \#include $<$iostream$>$}\par +{\tt \#include $<$math.h$>$}\par diff --git a/slsDetectorSoftware/docs/latex/MySocketTCP_8h.tex b/slsDetectorSoftware/docs/latex/MySocketTCP_8h.tex new file mode 100644 index 000000000..9b08138ca --- /dev/null +++ b/slsDetectorSoftware/docs/latex/MySocketTCP_8h.tex @@ -0,0 +1,32 @@ +\section{My\-Socket\-TCP/My\-Socket\-TCP.h File Reference} +\label{MySocketTCP_8h}\index{MySocketTCP/MySocketTCP.h@{MySocketTCP/MySocketTCP.h}} +{\tt \#include $<$arpa/inet.h$>$}\par +{\tt \#include $<$netdb.h$>$}\par +{\tt \#include $<$netinet/in.h$>$}\par +{\tt \#include $<$unistd.h$>$}\par +{\tt \#include $<$math.h$>$}\par +\subsection*{Classes} +\begin{CompactItemize} +\item +class \bf{My\-Socket\-TCP} +\end{CompactItemize} +\subsection*{Defines} +\begin{CompactItemize} +\item +\#define \bf{SEND\_\-REC\_\-MAX\_\-SIZE}~4096 +\item +\#define \bf{DEFAULT\_\-PORTNO}~1952 +\end{CompactItemize} + + +\subsection{Define Documentation} +\index{MySocketTCP.h@{My\-Socket\-TCP.h}!DEFAULT_PORTNO@{DEFAULT\_\-PORTNO}} +\index{DEFAULT_PORTNO@{DEFAULT\_\-PORTNO}!MySocketTCP.h@{My\-Socket\-TCP.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define DEFAULT\_\-PORTNO~1952}\label{MySocketTCP_8h_50b86f9de42a975581ff978f42ff426d} + + +\index{MySocketTCP.h@{My\-Socket\-TCP.h}!SEND_REC_MAX_SIZE@{SEND\_\-REC\_\-MAX\_\-SIZE}} +\index{SEND_REC_MAX_SIZE@{SEND\_\-REC\_\-MAX\_\-SIZE}!MySocketTCP.h@{My\-Socket\-TCP.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define SEND\_\-REC\_\-MAX\_\-SIZE~4096}\label{MySocketTCP_8h_bb1295578cf74e08a721feb53b401551} + + diff --git a/slsDetectorSoftware/docs/latex/annotated.tex b/slsDetectorSoftware/docs/latex/annotated.tex new file mode 100644 index 000000000..1b7f38c77 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/annotated.tex @@ -0,0 +1,14 @@ +\section{Class List} +Here are the classes, structs, unions and interfaces with brief descriptions:\begin{CompactList} +\item\contentsline{section}{\bf{angle\-Conversion\-Constant} }{\pageref{structangleConversionConstant}}{} +\item\contentsline{section}{\bf{eiger\-Detector} (This is class contains all eiger specific functionalities )}{\pageref{classeigerDetector}}{} +\item\contentsline{section}{\bf{iarray} }{\pageref{structiarray}}{} +\item\contentsline{section}{\bf{My\-Socket\-TCP} }{\pageref{classMySocketTCP}}{} +\item\contentsline{section}{\bf{mythen\-Detector} (This calss contains all mythen specific functions )}{\pageref{classmythenDetector}}{} +\item\contentsline{section}{\bf{ROI} }{\pageref{structROI}}{} +\item\contentsline{section}{\bf{sls\_\-detector\_\-channel} }{\pageref{structsls__detector__channel}}{} +\item\contentsline{section}{\bf{sls\_\-detector\_\-chip} }{\pageref{structsls__detector__chip}}{} +\item\contentsline{section}{\bf{sls\_\-detector\_\-module} }{\pageref{structsls__detector__module}}{} +\item\contentsline{section}{\bf{sls\-Detector} (This is the base class for all SLS detector functionalities )}{\pageref{classslsDetector}}{} +\item\contentsline{section}{\bf{sls\-Detector::shared\-Sls\-Detector} (Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!) )}{\pageref{structslsDetector_1_1sharedSlsDetector}}{} +\end{CompactList} diff --git a/slsDetectorSoftware/docs/latex/bug.tex b/slsDetectorSoftware/docs/latex/bug.tex new file mode 100644 index 000000000..33102c1d0 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/bug.tex @@ -0,0 +1,4 @@ +\section{Bug List}\label{bug} +\label{bug__bug000001} + \begin{description} +\item[Member \doxyref{sls\-Detector::get\-Chip}{p.}{classslsDetector_6dd6b42b668610dbd03a7700de84b845}(int ichip, int imod) ]probably does not return corretly! \end{description} diff --git a/slsDetectorSoftware/docs/latex/classMySocketTCP.tex b/slsDetectorSoftware/docs/latex/classMySocketTCP.tex new file mode 100644 index 000000000..e1c02ab4d --- /dev/null +++ b/slsDetectorSoftware/docs/latex/classMySocketTCP.tex @@ -0,0 +1,186 @@ +\section{My\-Socket\-TCP Class Reference} +\label{classMySocketTCP}\index{MySocketTCP@{MySocketTCP}} +{\tt \#include $<$My\-Socket\-TCP.h$>$} + +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\bf{My\-Socket\-TCP} (const char $\ast$const host\_\-ip\_\-or\_\-name, unsigned short int const port\_\-number) +\item +\bf{My\-Socket\-TCP} (unsigned short int const port\_\-number) +\item +\bf{$\sim$My\-Socket\-TCP} () +\item +int \bf{get\-Hostname} (char $\ast$name) +\item +int \bf{get\-Port\-Number} () +\item +int \bf{get\-Error\-Status} () +\item +int \bf{Connect} () +\item +void \bf{Disconnect} () +\item +int \bf{Send\-Data} (void $\ast$buf, int length) +\item +int \bf{Receive\-Data} (void $\ast$buf, int length) +\item +int \bf{Send\-Data\-And\-Keep\-Connection} (void $\ast$buf, int length) +\item +int \bf{Receive\-Data\-And\-Keep\-Connection} (void $\ast$buf, int length) +\item +int \bf{Send\-Data\-Only} (void $\ast$buf, int length) +\item +int \bf{Receive\-Data\-Only} (void $\ast$buf, int length) +\end{CompactItemize} +\subsection*{Private Attributes} +\begin{CompactItemize} +\item +char \bf{hostname} [1000] +\item +int \bf{portno} +\item +int \bf{is\_\-a\_\-server} +\item +int \bf{socket\-Descriptor} +\item +sockaddr\_\-in client\-Address \bf{server\-Address} +\item +socklen\_\-t \bf{client\-Address\_\-length} +\item +int \bf{file\_\-des} +\item +int \bf{send\_\-rec\_\-max\_\-size} +\item +bool \bf{last\_\-keep\_\-connection\_\-open\_\-action\_\-was\_\-a\_\-send} +\end{CompactItemize} + + +\subsection{Constructor \& Destructor Documentation} +\index{MySocketTCP@{My\-Socket\-TCP}!MySocketTCP@{MySocketTCP}} +\index{MySocketTCP@{MySocketTCP}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}My\-Socket\-TCP::My\-Socket\-TCP (const char $\ast$const {\em host\_\-ip\_\-or\_\-name}, unsigned short int const {\em port\_\-number})}\label{classMySocketTCP_4d44c3d3d93c2990bcdff6a58016a170} + + +\index{MySocketTCP@{My\-Socket\-TCP}!MySocketTCP@{MySocketTCP}} +\index{MySocketTCP@{MySocketTCP}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}My\-Socket\-TCP::My\-Socket\-TCP (unsigned short int const {\em port\_\-number})}\label{classMySocketTCP_1033d3d7438fe9da3cff3da3c4344c51} + + +\index{MySocketTCP@{My\-Socket\-TCP}!~MySocketTCP@{$\sim$MySocketTCP}} +\index{~MySocketTCP@{$\sim$MySocketTCP}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}My\-Socket\-TCP::$\sim$My\-Socket\-TCP ()}\label{classMySocketTCP_20407e0c509b8e32e164f1780b98b51c} + + + + +\subsection{Member Function Documentation} +\index{MySocketTCP@{My\-Socket\-TCP}!Connect@{Connect}} +\index{Connect@{Connect}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int My\-Socket\-TCP::Connect ()}\label{classMySocketTCP_1debe73787357c6dcec52ca981298609} + + +\index{MySocketTCP@{My\-Socket\-TCP}!Disconnect@{Disconnect}} +\index{Disconnect@{Disconnect}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void My\-Socket\-TCP::Disconnect ()}\label{classMySocketTCP_69f0b72663378245f14e2872b92696a4} + + +\index{MySocketTCP@{My\-Socket\-TCP}!getErrorStatus@{getErrorStatus}} +\index{getErrorStatus@{getErrorStatus}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int My\-Socket\-TCP::get\-Error\-Status ()\hspace{0.3cm}{\tt [inline]}}\label{classMySocketTCP_8cd662e945f4a51e9f616fd5c196bdeb} + + +\index{MySocketTCP@{My\-Socket\-TCP}!getHostname@{getHostname}} +\index{getHostname@{getHostname}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int My\-Socket\-TCP::get\-Hostname (char $\ast$ {\em name})}\label{classMySocketTCP_6c3f62f34cf58c78d58bcc788776afa5} + + +\index{MySocketTCP@{My\-Socket\-TCP}!getPortNumber@{getPortNumber}} +\index{getPortNumber@{getPortNumber}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int My\-Socket\-TCP::get\-Port\-Number ()\hspace{0.3cm}{\tt [inline]}}\label{classMySocketTCP_8d15a71679ab2f83822db875be1ad5cd} + + +\index{MySocketTCP@{My\-Socket\-TCP}!ReceiveData@{ReceiveData}} +\index{ReceiveData@{ReceiveData}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int My\-Socket\-TCP::Receive\-Data (void $\ast$ {\em buf}, int {\em length})}\label{classMySocketTCP_ed8a6a9435932659ed8793ff57b356c8} + + +\index{MySocketTCP@{My\-Socket\-TCP}!ReceiveDataAndKeepConnection@{ReceiveDataAndKeepConnection}} +\index{ReceiveDataAndKeepConnection@{ReceiveDataAndKeepConnection}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int My\-Socket\-TCP::Receive\-Data\-And\-Keep\-Connection (void $\ast$ {\em buf}, int {\em length})}\label{classMySocketTCP_375171791400d7d60804b56852ff3611} + + +\index{MySocketTCP@{My\-Socket\-TCP}!ReceiveDataOnly@{ReceiveDataOnly}} +\index{ReceiveDataOnly@{ReceiveDataOnly}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int My\-Socket\-TCP::Receive\-Data\-Only (void $\ast$ {\em buf}, int {\em length})}\label{classMySocketTCP_a8b6322845e72ffc6da44db774b19d73} + + +\index{MySocketTCP@{My\-Socket\-TCP}!SendData@{SendData}} +\index{SendData@{SendData}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int My\-Socket\-TCP::Send\-Data (void $\ast$ {\em buf}, int {\em length})}\label{classMySocketTCP_7777e909e20c47d38e32a174b0eae425} + + +\index{MySocketTCP@{My\-Socket\-TCP}!SendDataAndKeepConnection@{SendDataAndKeepConnection}} +\index{SendDataAndKeepConnection@{SendDataAndKeepConnection}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int My\-Socket\-TCP::Send\-Data\-And\-Keep\-Connection (void $\ast$ {\em buf}, int {\em length})}\label{classMySocketTCP_1641bc23538af6849efeb195a1b33626} + + +\index{MySocketTCP@{My\-Socket\-TCP}!SendDataOnly@{SendDataOnly}} +\index{SendDataOnly@{SendDataOnly}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int My\-Socket\-TCP::Send\-Data\-Only (void $\ast$ {\em buf}, int {\em length})}\label{classMySocketTCP_2f9ce7233ee4903127039d43b4a34886} + + + + +\subsection{Member Data Documentation} +\index{MySocketTCP@{My\-Socket\-TCP}!clientAddress_length@{clientAddress\_\-length}} +\index{clientAddress_length@{clientAddress\_\-length}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}socklen\_\-t \bf{My\-Socket\-TCP::client\-Address\_\-length}\hspace{0.3cm}{\tt [private]}}\label{classMySocketTCP_446008276e7be89c50bd78f9a3015a69} + + +\index{MySocketTCP@{My\-Socket\-TCP}!file_des@{file\_\-des}} +\index{file_des@{file\_\-des}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{My\-Socket\-TCP::file\_\-des}\hspace{0.3cm}{\tt [private]}}\label{classMySocketTCP_8a6787a3cdb6b4539184b92303958f30} + + +\index{MySocketTCP@{My\-Socket\-TCP}!hostname@{hostname}} +\index{hostname@{hostname}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char \bf{My\-Socket\-TCP::hostname}[1000]\hspace{0.3cm}{\tt [private]}}\label{classMySocketTCP_bfd6f681b235f233d3203336a89d58f2} + + +\index{MySocketTCP@{My\-Socket\-TCP}!is_a_server@{is\_\-a\_\-server}} +\index{is_a_server@{is\_\-a\_\-server}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{My\-Socket\-TCP::is\_\-a\_\-server}\hspace{0.3cm}{\tt [private]}}\label{classMySocketTCP_e95406b86fb4f0e1978c49f0ac9d3821} + + +\index{MySocketTCP@{My\-Socket\-TCP}!last_keep_connection_open_action_was_a_send@{last\_\-keep\_\-connection\_\-open\_\-action\_\-was\_\-a\_\-send}} +\index{last_keep_connection_open_action_was_a_send@{last\_\-keep\_\-connection\_\-open\_\-action\_\-was\_\-a\_\-send}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool \bf{My\-Socket\-TCP::last\_\-keep\_\-connection\_\-open\_\-action\_\-was\_\-a\_\-send}\hspace{0.3cm}{\tt [private]}}\label{classMySocketTCP_e0cdfa6a0f0498c01d057ff5db10dca5} + + +\index{MySocketTCP@{My\-Socket\-TCP}!portno@{portno}} +\index{portno@{portno}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{My\-Socket\-TCP::portno}\hspace{0.3cm}{\tt [private]}}\label{classMySocketTCP_cc9182c599b55d4f081c31cb162d56f6} + + +\index{MySocketTCP@{My\-Socket\-TCP}!send_rec_max_size@{send\_\-rec\_\-max\_\-size}} +\index{send_rec_max_size@{send\_\-rec\_\-max\_\-size}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{My\-Socket\-TCP::send\_\-rec\_\-max\_\-size}\hspace{0.3cm}{\tt [private]}}\label{classMySocketTCP_702056a78e403d4931181d54e7263290} + + +\index{MySocketTCP@{My\-Socket\-TCP}!serverAddress@{serverAddress}} +\index{serverAddress@{serverAddress}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}struct sockaddr\_\-in client\-Address \bf{My\-Socket\-TCP::server\-Address}\hspace{0.3cm}{\tt [private]}}\label{classMySocketTCP_02c455c28f7aff0075c954c43715dad2} + + +\index{MySocketTCP@{My\-Socket\-TCP}!socketDescriptor@{socketDescriptor}} +\index{socketDescriptor@{socketDescriptor}!MySocketTCP@{My\-Socket\-TCP}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{My\-Socket\-TCP::socket\-Descriptor}\hspace{0.3cm}{\tt [private]}}\label{classMySocketTCP_7246bd46ad899956f39109e528da0567} + + + + +The documentation for this class was generated from the following files:\begin{CompactItemize} +\item +My\-Socket\-TCP/\bf{My\-Socket\-TCP.h}\item +My\-Socket\-TCP/\bf{My\-Socket\-TCP.cxx}\end{CompactItemize} diff --git a/slsDetectorSoftware/docs/latex/classeigerDetector.eps b/slsDetectorSoftware/docs/latex/classeigerDetector.eps new file mode 100644 index 000000000..57a6a5313 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/classeigerDetector.eps @@ -0,0 +1,197 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 412.371 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 1.2125 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 2 def +/cols 1 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(eigerDetector) cw +(slsDetector) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (eigerDetector) 0 0 box + (slsDetector) 0 1 box + +% ----- relations ----- + +solid +0 0 0 out +solid +1 0 1 in diff --git a/slsDetectorSoftware/docs/latex/classeigerDetector.tex b/slsDetectorSoftware/docs/latex/classeigerDetector.tex new file mode 100644 index 000000000..6afa8fc5b --- /dev/null +++ b/slsDetectorSoftware/docs/latex/classeigerDetector.tex @@ -0,0 +1,228 @@ +\section{eiger\-Detector Class Reference} +\label{classeigerDetector}\index{eigerDetector@{eigerDetector}} +This is class contains all eiger specific functionalities. + + +{\tt \#include $<$eiger\-Detector.h$>$} + +Inheritance diagram for eiger\-Detector::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=2cm]{classeigerDetector} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\bf{eiger\-Detector} (int id=0) +\item +\bf{$\sim$eiger\-Detector} () +\item +\bf{sls\_\-detector\_\-module} $\ast$ \bf{read\-Trim\-File} (string fname, \bf{sls\_\-detector\_\-module} $\ast$my\-Mod=NULL) +\item +int \bf{write\-Trim\-File} (string fname, \bf{sls\_\-detector\_\-module} mod) +\item +int \bf{write\-Trim\-File} (string fname, int imod) +\item +int \bf{write\-Data\-File} (string fname, float $\ast$data, float $\ast$err=NULL, float $\ast$ang=NULL, char dataformat='f', int nch=-1) +\item +int \bf{write\-Data\-File} (string fname, int $\ast$data) +\item +int \bf{read\-Data\-File} (string fname, float $\ast$data, float $\ast$err=NULL, float $\ast$ang=NULL, char dataformat='f', int nch=0) +\item +int \bf{read\-Data\-File} (string fname, int $\ast$data) +\item +int \bf{read\-Calibration\-File} (string fname, float \&gain, float \&offset) +\item +int \bf{write\-Calibration\-File} (string fname, float gain, float offset) +\item +float $\ast$ \bf{decode\-Data} (int $\ast$datain) +\end{CompactItemize} + + +\subsection{Detailed Description} +This is class contains all eiger specific functionalities. + +The \doxyref{mythen\-Detector}{p.}{classmythenDetector} class contains the functions specific to the eiger detector + +\begin{Desc} +\item[Author:]Anna Bergamaschi \end{Desc} +\begin{Desc} +\item[Version:]0.1alpha (any string) \end{Desc} + + + + +\subsection{Constructor \& Destructor Documentation} +\index{eigerDetector@{eiger\-Detector}!eigerDetector@{eigerDetector}} +\index{eigerDetector@{eigerDetector}!eigerDetector@{eiger\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}eiger\-Detector::eiger\-Detector (int {\em id} = {\tt 0})}\label{classeigerDetector_591261cd5af00795657b44ee2681ced3} + + +(default) constructor + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em id}]is the detector index which is needed to define the shared memory id. Different physical detectors should have different IDs in order to work independently \end{description} +\end{Desc} +\index{eigerDetector@{eiger\-Detector}!~eigerDetector@{$\sim$eigerDetector}} +\index{~eigerDetector@{$\sim$eigerDetector}!eigerDetector@{eiger\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}eiger\-Detector::$\sim$eiger\-Detector ()\hspace{0.3cm}{\tt [inline]}}\label{classeigerDetector_aa968c7588fb7200a8764a08196ac549} + + +destructor + +\subsection{Member Function Documentation} +\index{eigerDetector@{eiger\-Detector}!decodeData@{decodeData}} +\index{decodeData@{decodeData}!eigerDetector@{eiger\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float$\ast$ eiger\-Detector::decode\-Data (int $\ast$ {\em datain})}\label{classeigerDetector_3e0573baf38c37818c7769fb351010b3} + + +decode data from the detector converting them to an array of floats, one for each channle \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em datain}]data from the detector \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]pointer to a float array with a data per channel \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_937d257464bade6dc6d3ab42c86843ba}.\index{eigerDetector@{eiger\-Detector}!readCalibrationFile@{readCalibrationFile}} +\index{readCalibrationFile@{readCalibrationFile}!eigerDetector@{eiger\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int eiger\-Detector::read\-Calibration\-File (string {\em fname}, float \& {\em gain}, float \& {\em offset})}\label{classeigerDetector_6b1b4b5328a5d8c423e9a7a8a950028f} + + +int \doxyref{read\-Calibration\-File(string fname, float \&gain, float \&offset)}{p.}{classeigerDetector_6b1b4b5328a5d8c423e9a7a8a950028f}; + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]file to be read \item[{\em gain}]reference to the gain variable reference to the offset variable \end{description} +\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{classslsDetector_2dd6bff7d94ab8005c2797152b19264e} \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_9305060e7499cfcabac23b99c884b92b}.\index{eigerDetector@{eiger\-Detector}!readDataFile@{readDataFile}} +\index{readDataFile@{readDataFile}!eigerDetector@{eiger\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int eiger\-Detector::read\-Data\-File (string {\em fname}, int $\ast$ {\em data})}\label{classeigerDetector_a6afa206101506d7f95d1ec835fbf843} + + +reads a data file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em name}]of the file to be read \item[{\em data}]array of data values \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if it could not read the file or data=NULL \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_0d27017bc1140cc9da3e797f03848f2e}.\index{eigerDetector@{eiger\-Detector}!readDataFile@{readDataFile}} +\index{readDataFile@{readDataFile}!eigerDetector@{eiger\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int eiger\-Detector::read\-Data\-File (string {\em fname}, float $\ast$ {\em data}, float $\ast$ {\em err} = {\tt NULL}, float $\ast$ {\em ang} = {\tt NULL}, char {\em dataformat} = {\tt 'f'}, int {\em nch} = {\tt 0})}\label{classeigerDetector_4d0b7da609b9a0457656bfc8cf0a7997} + + +reads a data file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em name}]of the file to be read \item[{\em data}]array of data values to be filled \item[{\em err}]array of arrors on the data. If NULL no errors are expected on the file\item[{\em ang}]array of angular values. If NULL data are expected in the form chan-val(-err) otherwise ang-val(-err) \item[{\em dataformat}]format of the data: can be 'i' integer or 'f' float (default) \item[{\em nch}]number of channels to be written to file. if $<$=0 defaults to the number of installed channels of the detector \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if it could not read the file or data=NULL \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_ffd62fa6a3487693316209ea71502b4b}.\index{eigerDetector@{eiger\-Detector}!readTrimFile@{readTrimFile}} +\index{readTrimFile@{readTrimFile}!eigerDetector@{eiger\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{sls\_\-detector\_\-module}$\ast$ eiger\-Detector::read\-Trim\-File (string {\em fname}, \bf{sls\_\-detector\_\-module} $\ast$ {\em my\-Mod} = {\tt NULL})}\label{classeigerDetector_f24af0459e8eb45c1bc9c68a870e5094} + + +reads a trim file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]name of the file to be read \item[{\em my\-Mod}]pointer to the module structure which has to be set. \par + If it is NULL a new module structure will be created \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]the pointer to my\-Mod or NULL if reading the file failed \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_e84b8a7a2b27db3f89a98f9f8a81efca}.\index{eigerDetector@{eiger\-Detector}!writeCalibrationFile@{writeCalibrationFile}} +\index{writeCalibrationFile@{writeCalibrationFile}!eigerDetector@{eiger\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int eiger\-Detector::write\-Calibration\-File (string {\em fname}, float {\em gain}, float {\em offset})}\label{classeigerDetector_d5fbecfcc46cb151160c6011aa8e33b2} + + +writes a clibration file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]file to be written \item[{\em gain}]\item[{\em offset}]\end{description} +\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{classslsDetector_2dd6bff7d94ab8005c2797152b19264e} \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_8eb676a1ab6ef35601ba5cae942ba380}.\index{eigerDetector@{eiger\-Detector}!writeDataFile@{writeDataFile}} +\index{writeDataFile@{writeDataFile}!eigerDetector@{eiger\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int eiger\-Detector::write\-Data\-File (string {\em fname}, int $\ast$ {\em data})}\label{classeigerDetector_68a740d5e43fcdb00c57f401666c0856} + + +writes a data file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em name}]of the file to be written \item[{\em data}]array of data values \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if it could not write the file or data=NULL \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_3e1a8e49fbfb34a54381452abc8b5258}.\index{eigerDetector@{eiger\-Detector}!writeDataFile@{writeDataFile}} +\index{writeDataFile@{writeDataFile}!eigerDetector@{eiger\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int eiger\-Detector::write\-Data\-File (string {\em fname}, float $\ast$ {\em data}, float $\ast$ {\em err} = {\tt NULL}, float $\ast$ {\em ang} = {\tt NULL}, char {\em dataformat} = {\tt 'f'}, int {\em nch} = {\tt -1})}\label{classeigerDetector_5ad2bf5b10d17e8c4ad7ae6e81e647e0} + + +writes a data file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em name}]of the file to be written \item[{\em data}]array of data values \item[{\em err}]array of arrors on the data. If NULL no errors will be written\item[{\em ang}]array of angular values. If NULL data will be in the form chan-val(-err) otherwise ang-val(-err) \item[{\em dataformat}]format of the data: can be 'i' integer or 'f' float (default) \item[{\em nch}]number of channels to be written to file. if -1 defaults to the number of installed channels of the detector \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if it could not write the file or data=NULL \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_889c060afb5693830ca2be4fc6a5442c}.\index{eigerDetector@{eiger\-Detector}!writeTrimFile@{writeTrimFile}} +\index{writeTrimFile@{writeTrimFile}!eigerDetector@{eiger\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int eiger\-Detector::write\-Trim\-File (string {\em fname}, int {\em imod})}\label{classeigerDetector_df3a0dff0fc3111e10af0363bdd15a6a} + + +writes a trim file for module number imod - the values will be read from the current detector structure \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]name of the file to be written \item[{\em imod}]module number \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if the file could not be written \end{Desc} +\begin{Desc} +\item[See also:]\doxyref{sls\_\-detector\_\-module}{p.}{structsls__detector__module} \doxyref{shared\-Sls\-Detector}{p.}{classslsDetector_2dd6bff7d94ab8005c2797152b19264e} \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_afe675432bf8e5dcb47774da3cc81106}.\index{eigerDetector@{eiger\-Detector}!writeTrimFile@{writeTrimFile}} +\index{writeTrimFile@{writeTrimFile}!eigerDetector@{eiger\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int eiger\-Detector::write\-Trim\-File (string {\em fname}, \bf{sls\_\-detector\_\-module} {\em mod})}\label{classeigerDetector_8380366bf7112021c49be8e6f29f18d8} + + +writes a trim file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]name of the file to be written \item[{\em mod}]module structure which has to be written to file \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if the file could not be written\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{sls\_\-detector\_\-module}{p.}{structsls__detector__module} \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_9cbb1f97b8e48bd4b108a2dfa992c6af}. + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +eiger\-Detector/\bf{eiger\-Detector.h}\end{CompactItemize} diff --git a/slsDetectorSoftware/docs/latex/classmythenDetector.eps b/slsDetectorSoftware/docs/latex/classmythenDetector.eps new file mode 100644 index 000000000..0d1b7524e --- /dev/null +++ b/slsDetectorSoftware/docs/latex/classmythenDetector.eps @@ -0,0 +1,197 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 370.37 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 1.35 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 2 def +/cols 1 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(mythenDetector) cw +(slsDetector) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (mythenDetector) 0 0 box + (slsDetector) 0 1 box + +% ----- relations ----- + +solid +0 0 0 out +solid +1 0 1 in diff --git a/slsDetectorSoftware/docs/latex/classmythenDetector.tex b/slsDetectorSoftware/docs/latex/classmythenDetector.tex new file mode 100644 index 000000000..48f8d080e --- /dev/null +++ b/slsDetectorSoftware/docs/latex/classmythenDetector.tex @@ -0,0 +1,422 @@ +\section{mythen\-Detector Class Reference} +\label{classmythenDetector}\index{mythenDetector@{mythenDetector}} +This calss contains all mythen specific functions. + + +{\tt \#include $<$mythen\-Detector.h$>$} + +Inheritance diagram for mythen\-Detector::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=2cm]{classmythenDetector} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\bf{mythen\-Detector} (int id=0) +\item +\bf{$\sim$mythen\-Detector} () +\item +\bf{sls\_\-detector\_\-module} $\ast$ \bf{read\-Trim\-File} (string fname, \bf{sls\_\-detector\_\-module} $\ast$my\-Mod=NULL) +\item +int \bf{write\-Trim\-File} (string fname, \bf{sls\_\-detector\_\-module} mod) +\item +int \bf{write\-Trim\-File} (string fname, int imod) +\item +int \bf{write\-Data\-File} (string fname, float $\ast$data, float $\ast$err=NULL, float $\ast$ang=NULL, char dataformat='f', int nch=-1) +\item +int \bf{write\-Data\-File} (string fname, int $\ast$data) +\item +int \bf{read\-Data\-File} (string fname, float $\ast$data, float $\ast$err=NULL, float $\ast$ang=NULL, char dataformat='f', int nch=0) +\item +int \bf{read\-Data\-File} (string fname, int $\ast$data) +\item +int \bf{read\-Calibration\-File} (string fname, float \&gain, float \&offset) +\item +int \bf{write\-Calibration\-File} (string fname, float gain, float offset) +\item +int \bf{read\-Angular\-Conversion} (string fname=\char`\"{}\char`\"{}) +\item +int \bf{write\-Angular\-Conversion} (string fname=\char`\"{}\char`\"{}) +\item +int \bf{set\-Angular\-Conversion} (string fname=\char`\"{}\char`\"{}) +\item +int \bf{get\-Angular\-Conversion} (int \&direction, \bf{angle\-Conversion\-Constant} $\ast$angconv=NULL) +\item +float \bf{set\-Global\-Offset} (float f) +\item +float \bf{set\-Fine\-Offset} (float f) +\item +float \bf{get\-Fine\-Offset} () +\item +float \bf{get\-Global\-Offset} () +\item +int \bf{set\-Positions} (int n\-Pos, float $\ast$\bf{pos}) +\item +int \bf{get\-Positions} (float $\ast$\bf{pos}=NULL) +\item +float \bf{set\-Bin\-Size} (float bs) +\item +float \bf{get\-Bin\-Size} () +\item +float $\ast$ \bf{decode\-Data} (int $\ast$datain) +\item +int \bf{reset\-Merging} (float $\ast$mp, float $\ast$mv, float $\ast$me, int $\ast$mm) +\item +int \bf{add\-To\-Merging} (float $\ast$p1, float $\ast$v1, float $\ast$e1, float $\ast$mp, float $\ast$mv, float $\ast$me, int $\ast$mm) +\item +int \bf{finalize\-Merging} (float $\ast$mp, float $\ast$mv, float $\ast$me, int $\ast$mm) +\end{CompactItemize} + + +\subsection{Detailed Description} +This calss contains all mythen specific functions. + +The \doxyref{mythen\-Detector}{p.}{classmythenDetector} class contains the functions specific to the mythen detector + +\begin{Desc} +\item[Author:]Anna Bergamaschi \end{Desc} +\begin{Desc} +\item[Version:]0.1alpha (any string) \end{Desc} + + + + +\subsection{Constructor \& Destructor Documentation} +\index{mythenDetector@{mythen\-Detector}!mythenDetector@{mythenDetector}} +\index{mythenDetector@{mythenDetector}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}mythen\-Detector::mythen\-Detector (int {\em id} = {\tt 0})}\label{classmythenDetector_5efa6a91622e5e173d7491801f60bda0} + + +(default) constructor + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em id}]is the detector index which is needed to define the shared memory id. Different physical detectors should have different IDs in order to work independently \end{description} +\end{Desc} +\index{mythenDetector@{mythen\-Detector}!~mythenDetector@{$\sim$mythenDetector}} +\index{~mythenDetector@{$\sim$mythenDetector}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}mythen\-Detector::$\sim$mythen\-Detector ()\hspace{0.3cm}{\tt [inline]}}\label{classmythenDetector_8118166c2e7c3d3968b9ae5016614693} + + +destructor + +\subsection{Member Function Documentation} +\index{mythenDetector@{mythen\-Detector}!addToMerging@{addToMerging}} +\index{addToMerging@{addToMerging}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::add\-To\-Merging (float $\ast$ {\em p1}, float $\ast$ {\em v1}, float $\ast$ {\em e1}, float $\ast$ {\em mp}, float $\ast$ {\em mv}, float $\ast$ {\em me}, int $\ast$ {\em mm})}\label{classmythenDetector_eaaf7d7e3150f473e3bbcf59d91692c2} + + +not yet implemented merge dataset \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em p1}]angular positions of dataset \item[{\em v1}]data \item[{\em e1}]errors \item[{\em mp}]already merged postions \item[{\em mv}]already merged data \item[{\em me}]already merged errors (squared sum) \item[{\em mm}]multiplicity of merged arrays \end{description} +\end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_ed3ddadb246080ef644b6d1455fa2e32}.\index{mythenDetector@{mythen\-Detector}!decodeData@{decodeData}} +\index{decodeData@{decodeData}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float$\ast$ mythen\-Detector::decode\-Data (int $\ast$ {\em datain})}\label{classmythenDetector_77e8c92003fab14da768af660509241d} + + +decode data from the detector converting them to an array of floats, one for each channle \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em datain}]data from the detector \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]pointer to a float array with a data per channel \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_937d257464bade6dc6d3ab42c86843ba}.\index{mythenDetector@{mythen\-Detector}!finalizeMerging@{finalizeMerging}} +\index{finalizeMerging@{finalizeMerging}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::finalize\-Merging (float $\ast$ {\em mp}, float $\ast$ {\em mv}, float $\ast$ {\em me}, int $\ast$ {\em mm})}\label{classmythenDetector_a919a42bd89fe21c4086bae5f1fb2f32} + + +calculates the \char`\"{}final\char`\"{} positions, data value and errors for the emrged data \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em mp}]already merged postions \item[{\em mv}]already merged data \item[{\em me}]already merged errors (squared sum) \item[{\em mm}]multiplicity of merged arrays \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]FAIL or the \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_8f73479f68ca2171fd2108c2f157299e}.\index{mythenDetector@{mythen\-Detector}!getAngularConversion@{getAngularConversion}} +\index{getAngularConversion@{getAngularConversion}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::get\-Angular\-Conversion (int \& {\em direction}, \bf{angle\-Conversion\-Constant} $\ast$ {\em angconv} = {\tt NULL})}\label{classmythenDetector_b2b2f17c36883323ad0abf762c63494f} + + +get angular conversion \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em reference}]to diffractometer direction \item[{\em angconv}]array that will be filled with the angular conversion constants \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]0 if angular conversion disabled, $>$0 otherwise \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_a146baee5af54b53db0997de02f4779c}.\index{mythenDetector@{mythen\-Detector}!getBinSize@{getBinSize}} +\index{getBinSize@{getBinSize}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float mythen\-Detector::get\-Bin\-Size ()\hspace{0.3cm}{\tt [inline]}}\label{classmythenDetector_9fd4e479d7eb3f9c53d5d56a43bbccaf} + + +return detector bin size used for merging (approx angular resolution) + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_8a78eda56f5a0c487bbc4e2f962d04db}.\index{mythenDetector@{mythen\-Detector}!getFineOffset@{getFineOffset}} +\index{getFineOffset@{getFineOffset}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float mythen\-Detector::get\-Fine\-Offset ()\hspace{0.3cm}{\tt [inline]}}\label{classmythenDetector_00720f1445f3f301fa3316828d978de6} + + +get detector fine offset + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_1a402a849d04190024e9dc87d4dae6dc}.\index{mythenDetector@{mythen\-Detector}!getGlobalOffset@{getGlobalOffset}} +\index{getGlobalOffset@{getGlobalOffset}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float mythen\-Detector::get\-Global\-Offset ()\hspace{0.3cm}{\tt [inline]}}\label{classmythenDetector_b2086f336d7198381453556b520dd556} + + +get detector global offset + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_42f854256e2900f18b2a17201813b48c}.\index{mythenDetector@{mythen\-Detector}!getPositions@{getPositions}} +\index{getPositions@{getPositions}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::get\-Positions (float $\ast$ {\em pos} = {\tt NULL})\hspace{0.3cm}{\tt [inline]}}\label{classmythenDetector_0d306720dced0d3576474978b06b4be4} + + +get positions for the acquisition \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em pos}]array which will contain the encoder positions \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]number of positions \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_732f6d36456d6e87d70324a4bdc1bbb8}.\index{mythenDetector@{mythen\-Detector}!readAngularConversion@{readAngularConversion}} +\index{readAngularConversion@{readAngularConversion}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::read\-Angular\-Conversion (string {\em fname} = {\tt \char`\"{}\char`\"{}})}\label{classmythenDetector_33bf1b939eb877bbd4aa42f400d7ca36} + + +reads an angular conversion file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]file to be read \end{description} +\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{angle\-Conversion\-Constant}{p.}{structangleConversionConstant} \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_23398787e01e519bf8ac5f313ca5af01}.\index{mythenDetector@{mythen\-Detector}!readCalibrationFile@{readCalibrationFile}} +\index{readCalibrationFile@{readCalibrationFile}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::read\-Calibration\-File (string {\em fname}, float \& {\em gain}, float \& {\em offset})}\label{classmythenDetector_f8f1b7b42012420fc557aacd714140f8} + + +int \doxyref{read\-Calibration\-File(string fname, float \&gain, float \&offset)}{p.}{classmythenDetector_f8f1b7b42012420fc557aacd714140f8}; \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]file to be read \item[{\em gain}]reference to the gain variable reference to the offset variable \end{description} +\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{classslsDetector_2dd6bff7d94ab8005c2797152b19264e} \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_9305060e7499cfcabac23b99c884b92b}.\index{mythenDetector@{mythen\-Detector}!readDataFile@{readDataFile}} +\index{readDataFile@{readDataFile}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::read\-Data\-File (string {\em fname}, int $\ast$ {\em data})}\label{classmythenDetector_d83819d61ea01148cf18cd3c46f2a9f7} + + +reads a data file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em name}]of the file to be read \item[{\em data}]array of data values \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if it could not read the file or data=NULL \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_0d27017bc1140cc9da3e797f03848f2e}.\index{mythenDetector@{mythen\-Detector}!readDataFile@{readDataFile}} +\index{readDataFile@{readDataFile}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::read\-Data\-File (string {\em fname}, float $\ast$ {\em data}, float $\ast$ {\em err} = {\tt NULL}, float $\ast$ {\em ang} = {\tt NULL}, char {\em dataformat} = {\tt 'f'}, int {\em nch} = {\tt 0})}\label{classmythenDetector_1937a5355eed0dc553cb05d2098f7c47} + + +reads a data file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em name}]of the file to be read \item[{\em data}]array of data values to be filled \item[{\em err}]array of arrors on the data. If NULL no errors are expected on the file\item[{\em ang}]array of angular values. If NULL data are expected in the form chan-val(-err) otherwise ang-val(-err) \item[{\em dataformat}]format of the data: can be 'i' integer or 'f' float (default) \item[{\em nch}]number of channels to be written to file. if $<$=0 defaults to the number of installed channels of the detector \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if it could not read the file or data=NULL \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_ffd62fa6a3487693316209ea71502b4b}.\index{mythenDetector@{mythen\-Detector}!readTrimFile@{readTrimFile}} +\index{readTrimFile@{readTrimFile}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{sls\_\-detector\_\-module}$\ast$ mythen\-Detector::read\-Trim\-File (string {\em fname}, \bf{sls\_\-detector\_\-module} $\ast$ {\em my\-Mod} = {\tt NULL})}\label{classmythenDetector_2120f9105997fd8f8bf9165dbffc55e7} + + +reads a trim file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]name of the file to be read \item[{\em my\-Mod}]pointer to the module structure which has to be set. \par + If it is NULL a new module structure will be created \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]the pointer to my\-Mod or NULL if reading the file failed \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_e84b8a7a2b27db3f89a98f9f8a81efca}.\index{mythenDetector@{mythen\-Detector}!resetMerging@{resetMerging}} +\index{resetMerging@{resetMerging}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::reset\-Merging (float $\ast$ {\em mp}, float $\ast$ {\em mv}, float $\ast$ {\em me}, int $\ast$ {\em mm})}\label{classmythenDetector_7d38c9af0d94bc15571c3c15b38f39a8} + + +sets the arrays of the merged data to 0. NB The array should be created with size $>$= 360./get\-Bin\-Size(); \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em mp}]already merged postions \item[{\em mv}]already merged data \item[{\em me}]already merged errors (squared sum) \item[{\em mm}]multiplicity of merged arrays \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_208c3a5a80ba931056f1f2ff3cb5d0e5}.\index{mythenDetector@{mythen\-Detector}!setAngularConversion@{setAngularConversion}} +\index{setAngularConversion@{setAngularConversion}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::set\-Angular\-Conversion (string {\em fname} = {\tt \char`\"{}\char`\"{}})}\label{classmythenDetector_78efe554a277de7fb8759307992fc61b} + + +set angular conversion \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]file with angular conversion constants (\char`\"{}\char`\"{} disable) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]0 if angular conversion disabled, $>$0 otherwise \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_30fe39ddd78fa880b6b7815d1d5462ec}.\index{mythenDetector@{mythen\-Detector}!setBinSize@{setBinSize}} +\index{setBinSize@{setBinSize}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float mythen\-Detector::set\-Bin\-Size (float {\em bs})\hspace{0.3cm}{\tt [inline]}}\label{classmythenDetector_8f466447f886379204a59eb6785f1ed0} + + +set detector bin size used for merging (approx angular resolution) + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_96e2fb6fb0aa34bdbe59facf367c4ae1}.\index{mythenDetector@{mythen\-Detector}!setFineOffset@{setFineOffset}} +\index{setFineOffset@{setFineOffset}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float mythen\-Detector::set\-Fine\-Offset (float {\em f})\hspace{0.3cm}{\tt [inline]}}\label{classmythenDetector_fe142e36f1a5fa8b2ab5fc45e9f8c781} + + +set detector fine offset + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_fd3b79c59688a7a0f4f72ba5676a2f9b}.\index{mythenDetector@{mythen\-Detector}!setGlobalOffset@{setGlobalOffset}} +\index{setGlobalOffset@{setGlobalOffset}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float mythen\-Detector::set\-Global\-Offset (float {\em f})\hspace{0.3cm}{\tt [inline]}}\label{classmythenDetector_e24dd88c4eb965687bd656a12bae8ad7} + + +set detector global offset + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_84c8dc8017e692d93246cd546e6366c1}.\index{mythenDetector@{mythen\-Detector}!setPositions@{setPositions}} +\index{setPositions@{setPositions}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::set\-Positions (int {\em n\-Pos}, float $\ast$ {\em pos})\hspace{0.3cm}{\tt [inline]}}\label{classmythenDetector_1ffb0963f724e6d6d497685e6de62fd6} + + +set positions for the acquisition \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em n\-Pos}]number of positions \item[{\em pos}]array with the encoder positions \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]number of positions \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_ed6493ad015660281b14814f9a7f6cb5}.\index{mythenDetector@{mythen\-Detector}!writeAngularConversion@{writeAngularConversion}} +\index{writeAngularConversion@{writeAngularConversion}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::write\-Angular\-Conversion (string {\em fname} = {\tt \char`\"{}\char`\"{}})}\label{classmythenDetector_3c5f27709351c49dd715212adc5ba7d2} + + +writes an angular conversion file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]file to be written \end{description} +\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{angle\-Conversion\-Constant}{p.}{structangleConversionConstant} \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_921f212286be085d7e1b8d0d11110d9c}.\index{mythenDetector@{mythen\-Detector}!writeCalibrationFile@{writeCalibrationFile}} +\index{writeCalibrationFile@{writeCalibrationFile}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::write\-Calibration\-File (string {\em fname}, float {\em gain}, float {\em offset})}\label{classmythenDetector_10e7213bb0e7138c07231687e9a6899a} + + +writes a clibration file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]file to be written \item[{\em gain}]\item[{\em offset}]\end{description} +\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{classslsDetector_2dd6bff7d94ab8005c2797152b19264e} \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_8eb676a1ab6ef35601ba5cae942ba380}.\index{mythenDetector@{mythen\-Detector}!writeDataFile@{writeDataFile}} +\index{writeDataFile@{writeDataFile}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::write\-Data\-File (string {\em fname}, int $\ast$ {\em data})}\label{classmythenDetector_9a49c84d7ad664f7891b00fba0ce829a} + + +writes a data file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em name}]of the file to be written \item[{\em data}]array of data values \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if it could not write the file or data=NULL \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_3e1a8e49fbfb34a54381452abc8b5258}.\index{mythenDetector@{mythen\-Detector}!writeDataFile@{writeDataFile}} +\index{writeDataFile@{writeDataFile}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::write\-Data\-File (string {\em fname}, float $\ast$ {\em data}, float $\ast$ {\em err} = {\tt NULL}, float $\ast$ {\em ang} = {\tt NULL}, char {\em dataformat} = {\tt 'f'}, int {\em nch} = {\tt -1})}\label{classmythenDetector_42c1d320f594ebd87e2465cc986ee848} + + +writes a data file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em name}]of the file to be written \item[{\em data}]array of data values \item[{\em err}]array of arrors on the data. If NULL no errors will be written\item[{\em ang}]array of angular values. If NULL data will be in the form chan-val(-err) otherwise ang-val(-err) \item[{\em dataformat}]format of the data: can be 'i' integer or 'f' float (default) \item[{\em nch}]number of channels to be written to file. if -1 defaults to the number of installed channels of the detector \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if it could not write the file or data=NULL \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_889c060afb5693830ca2be4fc6a5442c}.\index{mythenDetector@{mythen\-Detector}!writeTrimFile@{writeTrimFile}} +\index{writeTrimFile@{writeTrimFile}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::write\-Trim\-File (string {\em fname}, int {\em imod})}\label{classmythenDetector_94179431a737bbceb20f27ca1fd30349} + + +writes a trim file for module number imod - the values will be read from the current detector structure \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]name of the file to be written \item[{\em imod}]module number \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if the file could not be written \end{Desc} +\begin{Desc} +\item[See also:]\doxyref{sls\_\-detector\_\-module}{p.}{structsls__detector__module} \doxyref{shared\-Sls\-Detector}{p.}{classslsDetector_2dd6bff7d94ab8005c2797152b19264e} \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_afe675432bf8e5dcb47774da3cc81106}.\index{mythenDetector@{mythen\-Detector}!writeTrimFile@{writeTrimFile}} +\index{writeTrimFile@{writeTrimFile}!mythenDetector@{mythen\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int mythen\-Detector::write\-Trim\-File (string {\em fname}, \bf{sls\_\-detector\_\-module} {\em mod})}\label{classmythenDetector_0b137abd78bd3d03653cd21436eb6c4d} + + +writes a trim file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]name of the file to be written \item[{\em mod}]module structure which has to be written to file \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if the file could not be written\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{sls\_\-detector\_\-module}{p.}{structsls__detector__module} \end{Desc} + + +Reimplemented from \bf{sls\-Detector} \doxyref{p.}{classslsDetector_9cbb1f97b8e48bd4b108a2dfa992c6af}. + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +mythen\-Detector/\bf{mythen\-Detector.h}\end{CompactItemize} diff --git a/slsDetectorSoftware/docs/latex/classslsDetector.eps b/slsDetectorSoftware/docs/latex/classslsDetector.eps new file mode 100644 index 000000000..aaf2f53a9 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/classslsDetector.eps @@ -0,0 +1,203 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: ClassName +%%Creator: Doxygen +%%CreationDate: Time +%%For: +%Magnification: 1.00 +%%Orientation: Portrait +%%BoundingBox: 0 0 500 185.185 +%%Pages: 0 +%%BeginSetup +%%EndSetup +%%EndComments + +% ----- variables ----- + +/boxwidth 0 def +/boxheight 40 def +/fontheight 24 def +/marginwidth 10 def +/distx 20 def +/disty 40 def +/boundaspect 2.7 def % aspect ratio of the BoundingBox (width/height) +/boundx 500 def +/boundy boundx boundaspect div def +/xspacing 0 def +/yspacing 0 def +/rows 2 def +/cols 2 def +/scalefactor 0 def +/boxfont /Times-Roman findfont fontheight scalefont def + +% ----- procedures ----- + +/dotted { [1 4] 0 setdash } def +/dashed { [5] 0 setdash } def +/solid { [] 0 setdash } def + +/max % result = MAX(arg1,arg2) +{ + /a exch def + /b exch def + a b gt {a} {b} ifelse +} def + +/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2) +{ + 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max +} def + +/cw % boxwidth = MAX(boxwidth, stringwidth(arg1)) +{ + /str exch def + /boxwidth boxwidth str stringwidth pop max def +} def + +/box % draws a box with text `arg1' at grid pos (arg2,arg3) +{ gsave + 2 setlinewidth + newpath + exch xspacing mul xoffset add + exch yspacing mul + moveto + boxwidth 0 rlineto + 0 boxheight rlineto + boxwidth neg 0 rlineto + 0 boxheight neg rlineto + closepath + dup stringwidth pop neg boxwidth add 2 div + boxheight fontheight 2 div sub 2 div + rmoveto show stroke + grestore +} def + +/mark +{ newpath + exch xspacing mul xoffset add boxwidth add + exch yspacing mul + moveto + 0 boxheight 4 div rlineto + boxheight neg 4 div boxheight neg 4 div rlineto + closepath + eofill + stroke +} def + +/arrow +{ newpath + moveto + 3 -8 rlineto + -6 0 rlineto + 3 8 rlineto + closepath + eofill + stroke +} def + +/out % draws an output connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight add + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/in % draws an input connector for the block at (arg1,arg2) +{ + newpath + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul disty 2 div sub + /y exch def + /x exch def + x y moveto + 0 disty 2 div rlineto + stroke + 1 eq { x y disty 2 div add arrow } if +} def + +/hedge +{ + exch xspacing mul xoffset add boxwidth 2 div add + exch yspacing mul boxheight 2 div sub + /y exch def + /x exch def + newpath + x y moveto + boxwidth 2 div distx add 0 rlineto + stroke + 1 eq + { newpath x boxwidth 2 div distx add add y moveto + -8 3 rlineto + 0 -6 rlineto + 8 3 rlineto + closepath + eofill + stroke + } if +} def + +/vedge +{ + /ye exch def + /ys exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add dup + ys yspacing mul boxheight 2 div sub + moveto + ye yspacing mul boxheight 2 div sub + lineto + stroke +} def + +/conn % connections the blocks from col `arg1' to `arg2' of row `arg3' +{ + /ys exch def + /xe exch def + /xs exch def + newpath + xs xspacing mul xoffset add boxwidth 2 div add + ys yspacing mul disty 2 div sub + moveto + xspacing xe xs sub mul 0 + rlineto + stroke +} def + +% ----- main ------ + +boxfont setfont +1 boundaspect scale +(slsDetector) cw +(eigerDetector) cw +(mythenDetector) cw +/boxwidth boxwidth marginwidth 2 mul add def +/xspacing boxwidth distx add def +/yspacing boxheight disty add def +/scalefactor + boxwidth cols mul distx cols 1 sub mul add + boxheight rows mul disty rows 1 sub mul add boundaspect mul + max def +boundx scalefactor div boundy scalefactor div scale + +% ----- classes ----- + + (slsDetector) 0.5 1 box + (eigerDetector) 0 0 box + (mythenDetector) 1 0 box + +% ----- relations ----- + +solid +1 0.5 0.25 out +solid +0 1 1 conn +solid +0 0 0.75 in +solid +0 1 0.75 in diff --git a/slsDetectorSoftware/docs/latex/classslsDetector.tex b/slsDetectorSoftware/docs/latex/classslsDetector.tex new file mode 100644 index 000000000..ccd17b208 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/classslsDetector.tex @@ -0,0 +1,1956 @@ +\section{sls\-Detector Class Reference} +\label{classslsDetector}\index{slsDetector@{slsDetector}} +This is the base class for all SLS detector functionalities. + + +{\tt \#include $<$sls\-Detector.h$>$} + +Inheritance diagram for sls\-Detector::\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[height=2cm]{classslsDetector} +\end{center} +\end{figure} +\subsection*{Public Types} +\begin{CompactItemize} +\item +typedef \bf{sls\-Detector::shared\-Sls\-Detector} \bf{shared\-Sls\-Detector} +\begin{CompactList}\small\item\em Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!). \item\end{CompactList}\item +\bf{GET\_\-ONLINE\_\-FLAG} +\item +\bf{OFFLINE\_\-FLAG} +\item +\bf{ONLINE\_\-FLAG} +\item +enum \{ \bf{GET\_\-ONLINE\_\-FLAG}, +\bf{OFFLINE\_\-FLAG}, +\bf{ONLINE\_\-FLAG} + \} +\end{CompactItemize} +\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\bf{sls\-Detector} (\bf{detector\-Type} type=GENERIC, int id=0) +\item +\bf{$\sim$sls\-Detector} () +\item +int \bf{set\-Online} (int const online) +\item +int \bf{exists} () +\item +int \bf{read\-Configuration\-File} (string const fname) +\item +int \bf{write\-Configuration\-File} (string const fname) +\item +int \bf{dump\-Detector\-Setup} (string const fname) +\item +int \bf{retrieve\-Detector\-Setup} (string const fname) +\item +int \bf{set\-TCPSocket} (string const name=\char`\"{}\char`\"{}, int const control\_\-port=-1, int const stop\_\-port=-1, int const data\_\-port=-1) +\item +char $\ast$ \bf{get\-Hostname} () +\item +int \bf{get\-Control\-Port} () +\item +int \bf{get\-Stop\-Port} () +\item +int \bf{get\-Data\-Port} () +\item +char $\ast$ \bf{get\-Trim\-Dir} () +\item +char $\ast$ \bf{set\-Trim\-Dir} (string s) +\item +int \bf{get\-Trim\-En} (int $\ast$en) +\item +\bf{sls\_\-detector\_\-module} $\ast$ \bf{read\-Trim\-File} (string fname, \bf{sls\_\-detector\_\-module} $\ast$my\-Mod=NULL) +\item +int \bf{write\-Trim\-File} (string fname, \bf{sls\_\-detector\_\-module} mod) +\item +int \bf{write\-Trim\-File} (string fname, int imod) +\item +char $\ast$ \bf{set\-File\-Path} (string s) +\item +char $\ast$ \bf{set\-File\-Name} (string s) +\item +int \bf{set\-File\-Index} (int i) +\item +char $\ast$ \bf{get\-File\-Path} () +\item +char $\ast$ \bf{get\-File\-Name} () +\item +int \bf{get\-File\-Index} () +\item +string \bf{create\-File\-Name} () +\item +int \bf{write\-Data\-File} (string fname, float $\ast$data, float $\ast$err=NULL, float $\ast$ang=NULL, char dataformat='f', int nch=-1) +\item +int \bf{write\-Data\-File} (string fname, int $\ast$data) +\item +int \bf{read\-Data\-File} (string fname, float $\ast$data, float $\ast$err=NULL, float $\ast$ang=NULL, char dataformat='f', int nch=0) +\item +int \bf{read\-Data\-File} (string fname, int $\ast$data) +\item +char $\ast$ \bf{get\-Cal\-Dir} () +\item +char $\ast$ \bf{set\-Cal\-Dir} (string s) +\item +int \bf{read\-Calibration\-File} (string fname, float \&gain, float \&offset) +\item +int \bf{write\-Calibration\-File} (string fname, float gain, float offset) +\item +int \bf{read\-Angular\-Conversion} (string fname=\char`\"{}\char`\"{}) +\item +int \bf{write\-Angular\-Conversion} (string fname=\char`\"{}\char`\"{}) +\item +int \bf{exec\-Command} (string cmd, string answer) +\item +int \bf{set\-Detector\-Type} (\bf{detector\-Type} type=GET\_\-DETECTOR\_\-TYPE) +\item +int \bf{set\-Detector\-Type} (string type) +\item +void \bf{get\-Detector\-Type} (char $\ast$type) +\item +int \bf{set\-Number\-Of\-Modules} (int n, \bf{dimension} d=X) +\item +int \bf{get\-Max\-Number\-Of\-Modules} (\bf{dimension} d=X) +\item +\bf{external\-Signal\-Flag} \bf{set\-External\-Signal\-Flags} (\bf{external\-Signal\-Flag} pol=GET\_\-EXTERNAL\_\-SIGNAL\_\-FLAG, int signalindex=0) +\item +\bf{external\-Communication\-Mode} \bf{set\-External\-Communication\-Mode} (\bf{external\-Communication\-Mode} pol=GET\_\-EXTERNAL\_\-COMMUNICATION\_\-MODE) +\item +int64\_\-t \bf{get\-Id} (\bf{id\-Mode} mode, int imod=0) +\item +int \bf{digital\-Test} (\bf{digital\-Test\-Mode} mode, int imod=0) +\item +int $\ast$ \bf{analog\-Test} (\bf{analog\-Test\-Mode} mode) +\item +int \bf{enable\-Analog\-Output} (int ichan) +\item +int \bf{enable\-Analog\-Output} (int imod, int ichip, int ichan) +\item +int \bf{give\-Calibration\-Pulse} (float vcal, int npulses) +\item +int \bf{write\-Register} (int addr, int val) +\item +int \bf{read\-Register} (int addr) +\item +float \bf{set\-DAC} (float val, \bf{dac\-Index} index, int imod=-1) +\item +float \bf{get\-ADC} (\bf{dac\-Index} index, int imod=0) +\item +int \bf{set\-Channel} (int64\_\-t reg, int ichan=-1, int ichip=-1, int imod=-1) +\item +int \bf{set\-Channel} (\bf{sls\_\-detector\_\-channel} chan) +\item +\bf{sls\_\-detector\_\-channel} \bf{get\-Channel} (int ichan, int ichip, int imod) +\item +int \bf{set\-Chip} (int reg, int ichip=-1, int imod=-1) +\item +int \bf{set\-Chip} (\bf{sls\_\-detector\_\-chip} chip) +\item +\bf{sls\_\-detector\_\-chip} \bf{get\-Chip} (int ichip, int imod) +\item +int \bf{set\-Module} (int reg, int imod=-1) +\item +int \bf{set\-Module} (\bf{sls\_\-detector\_\-module} module) +\item +\bf{sls\_\-detector\_\-module} $\ast$ \bf{get\-Module} (int imod) +\item +int \bf{get\-Threshold\-Energy} (int imod=-1) +\item +int \bf{set\-Threshold\-Energy} (int e\_\-e\-V, int imod=-1, \bf{detector\-Settings} isettings=GET\_\-SETTINGS) +\item +\bf{detector\-Settings} \bf{get\-Settings} (int imod=-1) +\item +\bf{detector\-Settings} \bf{set\-Settings} (\bf{detector\-Settings} isettings, int imod=-1) +\item +int \bf{start\-Acquisition} () +\item +int \bf{stop\-Acquisition} () +\item +int \bf{start\-Read\-Out} () +\item +int \bf{get\-Run\-Status} () +\item +int $\ast$ \bf{start\-And\-Read\-All} () +\item +int \bf{start\-And\-Read\-All\-No\-Wait} () +\item +int $\ast$ \bf{get\-Data\-From\-Detector\-No\-Wait} () +\item +int $\ast$ \bf{read\-Frame} () +\item +int $\ast$ \bf{read\-All} () +\item +int $\ast$ \bf{pop\-Data\-Queue} () +\item +int64\_\-t \bf{set\-Timer} (\bf{timer\-Index} index, int64\_\-t t=-1) +\item +int64\_\-t \bf{get\-Time\-Left} (\bf{timer\-Index} index) +\item +int \bf{set\-Clock\-Divider} (int i) +\item +int \bf{get\-Clock\-Divider} () +\item +int \bf{set\-Set\-Length} (int i) +\item +int \bf{get\-Set\-Length} () +\item +int \bf{set\-Dynamic\-Range} (int n=-1) +\item +int \bf{set\-ROI} (int nroi=-1, int $\ast$xmin=NULL, int $\ast$xmax=NULL, int $\ast$ymin=NULL, int $\ast$ymax=NULL) +\item +int \bf{set\-Read\-Out\-Flags} (\bf{read\-Out\-Flags} flag) +\item +int \bf{execute\-Trimming} (\bf{trim\-Mode} mode, int par1, int par2, int imod=-1) +\item +int \bf{set\-Flat\-Field\-Correction} (string fname=\char`\"{}\char`\"{}) +\item +int \bf{get\-Flat\-Field\-Corrections} (float $\ast$corr=NULL, float $\ast$ecorr=NULL) +\item +int \bf{set\-Rate\-Correction} (float t=0) +\item +int \bf{get\-Rate\-Corrections} (float \&t) +\item +int \bf{get\-Rate\-Corrections} () +\item +int \bf{set\-Bad\-Channel\-Correction} (string fname=\char`\"{}\char`\"{}) +\item +int \bf{get\-Bad\-Channel\-Corrections} (int $\ast$bad=NULL) +\item +int \bf{set\-Angular\-Conversion} (string fname=\char`\"{}\char`\"{}) +\item +int \bf{get\-Angular\-Conversion} (int \&direction, \bf{angle\-Conversion\-Constant} $\ast$angconv=NULL) +\item +float \bf{set\-Global\-Offset} (float f) +\item +float \bf{set\-Fine\-Offset} (float f) +\item +float \bf{get\-Fine\-Offset} () +\item +float \bf{get\-Global\-Offset} () +\item +int \bf{set\-Positions} (int n\-Pos, float $\ast$\bf{pos}) +\item +int \bf{get\-Positions} (float $\ast$\bf{pos}=NULL) +\item +float \bf{set\-Bin\-Size} (float bs) +\item +float \bf{get\-Bin\-Size} () +\item +float $\ast$ \bf{decode\-Data} (int $\ast$datain) +\item +int \bf{flat\-Field\-Correct} (float datain, float errin, float \&dataout, float \&errout, float ffcoefficient, float fferr) +\item +int \bf{flat\-Field\-Correct} (float $\ast$datain, float $\ast$errin, float $\ast$dataout, float $\ast$errout) +\item +int \bf{rate\-Correct} (float datain, float errin, float \&dataout, float \&errout, float tau, float t) +\item +int \bf{rate\-Correct} (float $\ast$datain, float $\ast$errin, float $\ast$dataout, float $\ast$errout) +\item +int \bf{reset\-Merging} (float $\ast$mp, float $\ast$mv, float $\ast$me, int $\ast$mm) +\item +int \bf{add\-To\-Merging} (float $\ast$p1, float $\ast$v1, float $\ast$e1, float $\ast$mp, float $\ast$mv, float $\ast$me, int $\ast$mm) +\item +int \bf{finalize\-Merging} (float $\ast$mp, float $\ast$mv, float $\ast$me, int $\ast$mm) +\item +int \bf{exit\-Server} () +\item +void $\ast$ \bf{process\-Data} () +\item +\bf{sls\_\-detector\_\-module} $\ast$ \bf{create\-Module} () +\item +void \bf{delete\-Module} (\bf{sls\_\-detector\_\-module} $\ast$my\-Mod) +\item +void \bf{acquire} () +\end{CompactItemize} +\subsection*{Private Member Functions} +\begin{CompactItemize} +\item +int $\ast$ \bf{get\-Data\-From\-Detector} () +\item +int \bf{init\-Shared\-Memory} (\bf{detector\-Type} type=GENERIC, int id=0) +\item +int \bf{free\-Shared\-Memory} () +\item +int \bf{initialize\-Detector\-Size} (\bf{detector\-Type} type) +\item +int \bf{initialize\-Detector\-Structure} () +\item +int \bf{send\-Channel} (\bf{sls\_\-detector\_\-channel} $\ast$) +\item +int \bf{send\-Chip} (\bf{sls\_\-detector\_\-chip} $\ast$) +\item +int \bf{send\-Module} (\bf{sls\_\-detector\_\-module} $\ast$) +\item +int \bf{receive\-Channel} (\bf{sls\_\-detector\_\-channel} $\ast$) +\item +int \bf{receive\-Chip} (\bf{sls\_\-detector\_\-chip} $\ast$) +\item +int \bf{receive\-Module} (\bf{sls\_\-detector\_\-module} $\ast$) +\item +void \bf{start\-Thread} () +\item +int \bf{fill\-Bad\-Channel\-Mask} () +\end{CompactItemize} +\subsection*{Private Attributes} +\begin{CompactItemize} +\item +\bf{shared\-Sls\-Detector} $\ast$ \bf{this\-Detector} +\item +int \bf{online\-Flag} +\item +int \bf{det\-Id} +\item +int \bf{shm\-Id} +\item +\bf{My\-Socket\-TCP} $\ast$ \bf{control\-Socket} +\item +\bf{My\-Socket\-TCP} $\ast$ \bf{stop\-Socket} +\item +\bf{My\-Socket\-TCP} $\ast$ \bf{data\-Socket} +\item +queue$<$ int $\ast$ $>$ \bf{data\-Queue} +\item +pthread\_\-t \bf{data\-Processing\-Thread} +\item +float \bf{current\-Position} +\item +float \bf{current\-Position\-Index} +\item +float \bf{current\-I0} +\item +float $\ast$ \bf{merging\-Bins} +\item +float $\ast$ \bf{merging\-Counts} +\item +float $\ast$ \bf{merging\-Errors} +\item +int $\ast$ \bf{merging\-Multiplicity} +\item +float $\ast$ \bf{ffcoefficients} +\item +float $\ast$ \bf{fferrors} +\item +\bf{sls\_\-detector\_\-module} $\ast$ \bf{detector\-Modules} +\item +float $\ast$ \bf{dacs} +\item +float $\ast$ \bf{adcs} +\item +int $\ast$ \bf{chipregs} +\item +int $\ast$ \bf{chanregs} +\item +int $\ast$ \bf{bad\-Channel\-Mask} +\end{CompactItemize} +\subsection*{Classes} +\begin{CompactItemize} +\item +struct \bf{shared\-Sls\-Detector} +\begin{CompactList}\small\item\em Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!). \item\end{CompactList}\end{CompactItemize} + + +\subsection{Detailed Description} +This is the base class for all SLS detector functionalities. + +The \doxyref{sls\-Detector}{p.}{classslsDetector} class is expected to become the interface class for all SLS Detectors acquisition (and analysis) software. + +\begin{Desc} +\item[Author:]Anna Bergamaschi \end{Desc} +\begin{Desc} +\item[Version:]0.1alpha (any string) \end{Desc} + + + + +\subsection{Member Typedef Documentation} +\index{slsDetector@{sls\-Detector}!sharedSlsDetector@{sharedSlsDetector}} +\index{sharedSlsDetector@{sharedSlsDetector}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef struct \bf{sls\-Detector::shared\-Sls\-Detector} \bf{sls\-Detector::shared\-Sls\-Detector}}\label{classslsDetector_2dd6bff7d94ab8005c2797152b19264e} + + +Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!). + + + +\subsection{Member Enumeration Documentation} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}anonymous enum}\label{classslsDetector_ac085f1939dcfed328dc6ff4b11fdb44} + + +online flags enum\begin{Desc} +\item[See also:]\doxyref{set\-Online}{p.}{classslsDetector_f041f723f702c17de292061d6d609698} \end{Desc} +\begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{GET_ONLINE_FLAG@{GET\_\-ONLINE\_\-FLAG}!slsDetector@{slsDetector}}\index{slsDetector@{slsDetector}!GET_ONLINE_FLAG@{GET\_\-ONLINE\_\-FLAG}}\item[{\em +GET\_\-ONLINE\_\-FLAG\label{classslsDetector_ac085f1939dcfed328dc6ff4b11fdb44617c55ac8cf00235b76c1c1481238abb} +}]returns wether the detector is in online or offline state \index{OFFLINE_FLAG@{OFFLINE\_\-FLAG}!slsDetector@{slsDetector}}\index{slsDetector@{slsDetector}!OFFLINE_FLAG@{OFFLINE\_\-FLAG}}\item[{\em +OFFLINE\_\-FLAG\label{classslsDetector_ac085f1939dcfed328dc6ff4b11fdb44da0a4f5b33e634292bc99256a9552f2f} +}]detector in offline state (i.e. no communication to the detector - using only local structure - no data acquisition possible!) \index{ONLINE_FLAG@{ONLINE\_\-FLAG}!slsDetector@{slsDetector}}\index{slsDetector@{slsDetector}!ONLINE_FLAG@{ONLINE\_\-FLAG}}\item[{\em +ONLINE\_\-FLAG\label{classslsDetector_ac085f1939dcfed328dc6ff4b11fdb44d3b612a2eb0d1029bd260b502afcf632} +}]detector in online state (i.e. communication to the detector updating the local structure) \end{description} +\end{Desc} + + + +\subsection{Constructor \& Destructor Documentation} +\index{slsDetector@{sls\-Detector}!slsDetector@{slsDetector}} +\index{slsDetector@{slsDetector}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}sls\-Detector::sls\-Detector (\bf{detector\-Type} {\em type} = {\tt GENERIC}, int {\em id} = {\tt 0})}\label{classslsDetector_eea9fc044ff9d496e4338efaaf176498} + + +(default) constructor \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em type}]is needed to define the size of the detector shared memory 9defaults to GENERIC i.e. the largest shared memory needed by any \doxyref{sls\-Detector}{p.}{classslsDetector} is allocated \item[{\em id}]is the detector index which is needed to define the shared memory id. Different physical detectors should have different IDs in order to work independently \end{description} +\end{Desc} + + +sets online\-Flag to OFFLINE\_\-FLAG + +Initlializes shared memory \begin{Desc} +\item[See also:]\doxyref{init\-Shared\-Memory}{p.}{classslsDetector_cb94b9bfa7bbea2d9e1b0289a272bca8}\end{Desc} +if it fails the detector id is incremented until it succeeds + +Initializes the detector stucture \begin{Desc} +\item[See also:]\doxyref{initialize\-Detector\-Size}{p.}{classslsDetector_19f1c6d120293c98a0d2dc992e5616f8} \end{Desc} +\index{slsDetector@{sls\-Detector}!~slsDetector@{$\sim$slsDetector}} +\index{~slsDetector@{$\sim$slsDetector}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}sls\-Detector::$\sim$sls\-Detector ()\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_7653e532ff88dbf403e270769bccc509} + + +destructor + +\subsection{Member Function Documentation} +\index{slsDetector@{sls\-Detector}!acquire@{acquire}} +\index{acquire@{acquire}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void sls\-Detector::acquire ()}\label{classslsDetector_b09a80264ca69e51b2c8379124398410} + + +\index{slsDetector@{sls\-Detector}!addToMerging@{addToMerging}} +\index{addToMerging@{addToMerging}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::add\-To\-Merging (float $\ast$ {\em p1}, float $\ast$ {\em v1}, float $\ast$ {\em e1}, float $\ast$ {\em mp}, float $\ast$ {\em mv}, float $\ast$ {\em me}, int $\ast$ {\em mm})}\label{classslsDetector_ed3ddadb246080ef644b6d1455fa2e32} + + +not yet implemented merge dataset \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em p1}]angular positions of dataset \item[{\em v1}]data \item[{\em e1}]errors \item[{\em mp}]already merged postions \item[{\em mv}]already merged data \item[{\em me}]already merged errors (squared sum) \item[{\em mm}]multiplicity of merged arrays \end{description} +\end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_eaaf7d7e3150f473e3bbcf59d91692c2}.\index{slsDetector@{sls\-Detector}!analogTest@{analogTest}} +\index{analogTest@{analogTest}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int$\ast$ sls\-Detector::analog\-Test (\bf{analog\-Test\-Mode} {\em mode})}\label{classslsDetector_18f91f8cf70d2d4eef9b3488b90bac51} + + +analog test \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em modte}]test mode \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]pointer to acquired data\end{Desc} +not yet implemented \index{slsDetector@{sls\-Detector}!createFileName@{createFileName}} +\index{createFileName@{createFileName}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}string sls\-Detector::create\-File\-Name ()}\label{classslsDetector_d055c470ae6faa973980f4dbf021132d} + + +generates file name without extension + +always appends to file path and file name the run index. + +in case also appends the position index + +Filenames will be of the form: filepath/filename(\_\-px)\_\-i where x is the position index and i is the run index \index{slsDetector@{sls\-Detector}!createModule@{createModule}} +\index{createModule@{createModule}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}sls\-Detector::sls\_\-detector\_\-module $\ast$ sls\-Detector::create\-Module ()}\label{classslsDetector_15e6fa87a3c57ff1c8e1943ec72ec6ad} + + +Allocates the memory for a \doxyref{sls\_\-detector\_\-module}{p.}{structsls__detector__module} structure and initializes it \begin{Desc} +\item[Returns:]my\-Mod the pointer to the allocate dmemory location \end{Desc} +\index{slsDetector@{sls\-Detector}!decodeData@{decodeData}} +\index{decodeData@{decodeData}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float $\ast$ sls\-Detector::decode\-Data (int $\ast$ {\em datain})}\label{classslsDetector_937d257464bade6dc6d3ab42c86843ba} + + +decode data from the detector converting them to an array of floats, one for each channle \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em datain}]data from the detector \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]pointer to a float array with a data per channel \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_77e8c92003fab14da768af660509241d}, and \bf{eiger\-Detector} \doxyref{p.}{classeigerDetector_3e0573baf38c37818c7769fb351010b3}.\index{slsDetector@{sls\-Detector}!deleteModule@{deleteModule}} +\index{deleteModule@{deleteModule}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void sls\-Detector::delete\-Module (\bf{sls\_\-detector\_\-module} $\ast$ {\em my\-Mod})}\label{classslsDetector_48984c8d058355c5249233165bf0c410} + + +frees the memory for a \doxyref{sls\_\-detector\_\-module}{p.}{structsls__detector__module} structure \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em my\-Mod}]the pointer to the memory to be freed \end{description} +\end{Desc} +\index{slsDetector@{sls\-Detector}!digitalTest@{digitalTest}} +\index{digitalTest@{digitalTest}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::digital\-Test (\bf{digital\-Test\-Mode} {\em mode}, int {\em imod} = {\tt 0})}\label{classslsDetector_40906e79010db5b8082d4855a3824aa7} + + +Digital test of the modules \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em mode}]test mode \item[{\em imod}]module number for chip test or module firmware test \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or error mask \end{Desc} +\index{slsDetector@{sls\-Detector}!dumpDetectorSetup@{dumpDetectorSetup}} +\index{dumpDetectorSetup@{dumpDetectorSetup}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::dump\-Detector\-Setup (string const {\em fname})}\label{classslsDetector_dc4f62e536b4ef6d0d2d178e3bfbec5e} + + +not yet implemented + +should dump to a file all the current detector parameters \index{slsDetector@{sls\-Detector}!enableAnalogOutput@{enableAnalogOutput}} +\index{enableAnalogOutput@{enableAnalogOutput}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::enable\-Analog\-Output (int {\em imod}, int {\em ichip}, int {\em ichan})}\label{classslsDetector_b20fef344ee47114fccb4d1bc8c6e5bd} + + +enable analog output of channel ichan, chip ichip, module imod + +not yet implemented \index{slsDetector@{sls\-Detector}!enableAnalogOutput@{enableAnalogOutput}} +\index{enableAnalogOutput@{enableAnalogOutput}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::enable\-Analog\-Output (int {\em ichan})}\label{classslsDetector_a83074759c48f194af2e45d1281cc818} + + +enable analog output of channel ichan + +not yet implemented \index{slsDetector@{sls\-Detector}!execCommand@{execCommand}} +\index{execCommand@{execCommand}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::exec\-Command (string {\em cmd}, string {\em answer})}\label{classslsDetector_9fc0c9161e967094a535cc40bc33cc6b} + + +executes a system command on the server e.g. mount an nfs disk, reboot and returns answer etc. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em cmd}]is the command to be executed \item[{\em answer}]is the answer from the detector \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL depending on the command outcome \end{Desc} +\index{slsDetector@{sls\-Detector}!executeTrimming@{executeTrimming}} +\index{executeTrimming@{executeTrimming}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::execute\-Trimming (\bf{trim\-Mode} {\em mode}, int {\em par1}, int {\em par2}, int {\em imod} = {\tt -1})}\label{classslsDetector_a257317d18965a353679c66b15b0987d} + + +execute trimming \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em mode}]trim mode \item[{\em par1}]if noise, beam or fixed setting trimming it is count limit, if improve maximum number of iterations \item[{\em par2}]if noise or beam nsigma, if improve par2!=means vthreshold will be optimized, if fixed settings par2$<$0 trimwith median, par2$>$=0 trim with level \item[{\em imod}]module number (-1 all) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIl (FAIL also if some channel are 0 or 63 \end{Desc} +\index{slsDetector@{sls\-Detector}!exists@{exists}} +\index{exists@{exists}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::exists ()\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_bf592960cebe5b3f1e2fdc77f770f17a} + + +sets the online\-Flag \begin{Desc} +\item[Returns:]1 if the detector structure has already be initlialized, 0 otherwise \end{Desc} +\index{slsDetector@{sls\-Detector}!exitServer@{exitServer}} +\index{exitServer@{exitServer}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::exit\-Server ()}\label{classslsDetector_466e9a65aa0b404c771d70c9f01af8b9} + + +turns of server \index{slsDetector@{sls\-Detector}!fillBadChannelMask@{fillBadChannelMask}} +\index{fillBadChannelMask@{fillBadChannelMask}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::fill\-Bad\-Channel\-Mask ()\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_6a0ebe013e27c065b2f67158a27f64ac} + + +fill bad channel mask (0 if channel is good, 1 if bad) \index{slsDetector@{sls\-Detector}!finalizeMerging@{finalizeMerging}} +\index{finalizeMerging@{finalizeMerging}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::finalize\-Merging (float $\ast$ {\em mp}, float $\ast$ {\em mv}, float $\ast$ {\em me}, int $\ast$ {\em mm})}\label{classslsDetector_8f73479f68ca2171fd2108c2f157299e} + + +calculates the \char`\"{}final\char`\"{} positions, data value and errors for the emrged data \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em mp}]already merged postions \item[{\em mv}]already merged data \item[{\em me}]already merged errors (squared sum) \item[{\em mm}]multiplicity of merged arrays \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]FAIL or the \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_a919a42bd89fe21c4086bae5f1fb2f32}.\index{slsDetector@{sls\-Detector}!flatFieldCorrect@{flatFieldCorrect}} +\index{flatFieldCorrect@{flatFieldCorrect}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::flat\-Field\-Correct (float $\ast$ {\em datain}, float $\ast$ {\em errin}, float $\ast$ {\em dataout}, float $\ast$ {\em errout})}\label{classslsDetector_1e6633db752222079b39a187e4d0e658} + + +flat field correct data \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em datain}]data array \item[{\em errin}]error array on data (if NULL will default to sqrt(datain) \item[{\em dataout}]array of corrected data \item[{\em errout}]error on corrected data (if not NULL) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]0 \end{Desc} +\index{slsDetector@{sls\-Detector}!flatFieldCorrect@{flatFieldCorrect}} +\index{flatFieldCorrect@{flatFieldCorrect}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::flat\-Field\-Correct (float {\em datain}, float {\em errin}, float \& {\em dataout}, float \& {\em errout}, float {\em ffcoefficient}, float {\em fferr})}\label{classslsDetector_24c7dd58e00df0bf62221b7572430740} + + +flat field correct data \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em datain}]data \item[{\em errin}]error on data (if$<$=0 will default to sqrt(datain) \item[{\em dataout}]corrected data \item[{\em errout}]error on corrected data \item[{\em ffcoefficient}]flat field correction coefficient \item[{\em fferr}]erro on ffcoefficient \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]0 \end{Desc} +\index{slsDetector@{sls\-Detector}!freeSharedMemory@{freeSharedMemory}} +\index{freeSharedMemory@{freeSharedMemory}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::free\-Shared\-Memory ()\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_5de7fb0d82ae2bcc406385373e665c6f} + + +Frees the shared memory - should not be used \index{slsDetector@{sls\-Detector}!getADC@{getADC}} +\index{getADC@{getADC}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float sls\-Detector::get\-ADC (\bf{dac\-Index} {\em index}, int {\em imod} = {\tt 0})}\label{classslsDetector_fa99bd04043c23b7ab583159dabebf93} + + +set dacs value \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em index}]ADC index \item[{\em imod}]module number \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current ADC value \end{Desc} +\index{slsDetector@{sls\-Detector}!getAngularConversion@{getAngularConversion}} +\index{getAngularConversion@{getAngularConversion}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::get\-Angular\-Conversion (int \& {\em direction}, \bf{angle\-Conversion\-Constant} $\ast$ {\em angconv} = {\tt NULL})}\label{classslsDetector_a146baee5af54b53db0997de02f4779c} + + +get angular conversion \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em reference}]to diffractometer direction \item[{\em angconv}]array that will be filled with the angular conversion constants \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]0 if angular conversion disabled, $>$0 otherwise \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_b2b2f17c36883323ad0abf762c63494f}.\index{slsDetector@{sls\-Detector}!getBadChannelCorrections@{getBadChannelCorrections}} +\index{getBadChannelCorrections@{getBadChannelCorrections}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::get\-Bad\-Channel\-Corrections (int $\ast$ {\em bad} = {\tt NULL})}\label{classslsDetector_f80db913b55026bb69d35585b08729cc} + + +get bad channels correction \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em bad}]pointer to array that if bad!=NULL will be filled with the bad channel list \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]0 if bad channel disabled or no bad channels, $>$0 otherwise \end{Desc} +\index{slsDetector@{sls\-Detector}!getBinSize@{getBinSize}} +\index{getBinSize@{getBinSize}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float sls\-Detector::get\-Bin\-Size ()\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_8a78eda56f5a0c487bbc4e2f962d04db} + + +return detector bin size used for merging (approx angular resolution) + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_9fd4e479d7eb3f9c53d5d56a43bbccaf}.\index{slsDetector@{sls\-Detector}!getCalDir@{getCalDir}} +\index{getCalDir@{getCalDir}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ sls\-Detector::get\-Cal\-Dir ()\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_102679594e60ed261daff24b4aeac21a} + + +returns the location of the calibration files \begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!getChannel@{getChannel}} +\index{getChannel@{getChannel}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}sls\-Detector::sls\_\-detector\_\-channel sls\-Detector::get\-Channel (int {\em ichan}, int {\em ichip}, int {\em imod})}\label{classslsDetector_bbf8573e249da1f0a436f581d0dc62e4} + + +get channel \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em ichan}]channel number \item[{\em ichip}]chip number \item[{\em imod}]module number \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current channel structure for channel \end{Desc} +\index{slsDetector@{sls\-Detector}!getChip@{getChip}} +\index{getChip@{getChip}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}sls\-Detector::sls\_\-detector\_\-chip sls\-Detector::get\-Chip (int {\em ichip}, int {\em imod})}\label{classslsDetector_6dd6b42b668610dbd03a7700de84b845} + + +get chip \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em ichip}]chip number \item[{\em imod}]module number \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current chip structure for channel\end{Desc} +\begin{Desc} +\item[\bf{Bug}]probably does not return corretly! \end{Desc} +\index{slsDetector@{sls\-Detector}!getClockDivider@{getClockDivider}} +\index{getClockDivider@{getClockDivider}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::get\-Clock\-Divider ()\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_12b884821edc41fe9821f2ab084a0baf} + + +get clock divider + +not implemented (should be something more general like \char`\"{}set speed including also waitstates, set cycles etc.) \index{slsDetector@{sls\-Detector}!getControlPort@{getControlPort}} +\index{getControlPort@{getControlPort}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::get\-Control\-Port ()\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_40ffd69f1c40b26575954e826cdf606a} + + +returns the detector control port\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!getDataFromDetector@{getDataFromDetector}} +\index{getDataFromDetector@{getDataFromDetector}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int $\ast$ sls\-Detector::get\-Data\-From\-Detector ()\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_b1982e89f8e8de63c807a707ccba594c} + + +Receives a data frame from the detector socket \begin{Desc} +\item[Returns:]pointer to the data (or NULL if failed) \end{Desc} +\index{slsDetector@{sls\-Detector}!getDataFromDetectorNoWait@{getDataFromDetectorNoWait}} +\index{getDataFromDetectorNoWait@{getDataFromDetectorNoWait}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int $\ast$ sls\-Detector::get\-Data\-From\-Detector\-No\-Wait ()}\label{classslsDetector_5b678231f1a0fafc518a95b6e58f00a8} + + +receives a data frame from the detector socket \begin{Desc} +\item[Returns:]pointer to the data or NULL. If NULL disconnects the socket \end{Desc} +\begin{Desc} +\item[See also:]\doxyref{get\-Data\-From\-Detector}{p.}{classslsDetector_b1982e89f8e8de63c807a707ccba594c} \end{Desc} +\index{slsDetector@{sls\-Detector}!getDataPort@{getDataPort}} +\index{getDataPort@{getDataPort}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::get\-Data\-Port ()\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_35043766eecb3d760fd95d891bed8b16} + + +returns the detector data port\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!getDetectorType@{getDetectorType}} +\index{getDetectorType@{getDetectorType}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void sls\-Detector::get\-Detector\-Type (char $\ast$ {\em type})}\label{classslsDetector_d63d6420e411ff4b962930d9c4fd615d} + + +gets detector type normally the detector knows what type of detector it is \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em type}]is the string where the detector type will be written (\char`\"{}Mythen\char`\"{}, \char`\"{}Pilatus\char`\"{}, \char`\"{}XFS\char`\"{}, \char`\"{}Gotthard\char`\"{}, Agipd\char`\"{}) \end{description} +\end{Desc} +\index{slsDetector@{sls\-Detector}!getFileIndex@{getFileIndex}} +\index{getFileIndex@{getFileIndex}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::get\-File\-Index ()\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_68b41fa20ddd8c6c67ac00dfea3c9796} + + +returns the default output file index \begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!getFileName@{getFileName}} +\index{getFileName@{getFileName}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ sls\-Detector::get\-File\-Name ()\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_717a3c59681f81ceaf5245a073eeacdb} + + +returns the default output files root name \begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!getFilePath@{getFilePath}} +\index{getFilePath@{getFilePath}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ sls\-Detector::get\-File\-Path ()\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_b4158bdacd10fccedeab9eacbd1f4304} + + +returns the default output files path \begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!getFineOffset@{getFineOffset}} +\index{getFineOffset@{getFineOffset}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float sls\-Detector::get\-Fine\-Offset ()\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_1a402a849d04190024e9dc87d4dae6dc} + + +get detector fine offset + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_00720f1445f3f301fa3316828d978de6}.\index{slsDetector@{sls\-Detector}!getFlatFieldCorrections@{getFlatFieldCorrections}} +\index{getFlatFieldCorrections@{getFlatFieldCorrections}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::get\-Flat\-Field\-Corrections (float $\ast$ {\em corr} = {\tt NULL}, float $\ast$ {\em ecorr} = {\tt NULL})}\label{classslsDetector_af22c79193907e364c6db97f5e55b9fd} + + +get flat field corrections \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em corr}]if !=NULL will be filled with the correction coefficients \item[{\em ecorr}]if !=NULL will be filled with the correction coefficients errors \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]0 if ff correction disabled, $>$0 otherwise \end{Desc} +\index{slsDetector@{sls\-Detector}!getGlobalOffset@{getGlobalOffset}} +\index{getGlobalOffset@{getGlobalOffset}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float sls\-Detector::get\-Global\-Offset ()\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_42f854256e2900f18b2a17201813b48c} + + +get detector global offset + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_b2086f336d7198381453556b520dd556}.\index{slsDetector@{sls\-Detector}!getHostname@{getHostname}} +\index{getHostname@{getHostname}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ sls\-Detector::get\-Hostname ()\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_fad06908ad59bfd8a8577899d6aa1843} + + +returns the detector hostname\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!getId@{getId}} +\index{getId@{getId}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int64\_\-t sls\-Detector::get\-Id (\bf{id\-Mode} {\em mode}, int {\em imod} = {\tt 0})}\label{classslsDetector_92f9261c62652e3643eebfdfa9942099} + + +get detector ids/versions for module \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em mode}]which id/version has to be read \item[{\em imod}]module number for module serial number \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]id \end{Desc} +\index{slsDetector@{sls\-Detector}!getMaxNumberOfModules@{getMaxNumberOfModules}} +\index{getMaxNumberOfModules@{getMaxNumberOfModules}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::get\-Max\-Number\-Of\-Modules (\bf{dimension} {\em d} = {\tt X})}\label{classslsDetector_d608a77a1c64989ad82175991be0a9b5} + + +get the maximum size of the detector \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em d}]dimension \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]maximum number of modules that can be installed in direction d \end{Desc} +\index{slsDetector@{sls\-Detector}!getModule@{getModule}} +\index{getModule@{getModule}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}sls\-Detector::sls\_\-detector\_\-module $\ast$ sls\-Detector::get\-Module (int {\em imod})}\label{classslsDetector_d1b14626e602ceaebfcf4321f6f40997} + + +get module \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em imod}]module number \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]pointer to module structure (which has bee created and must then be deleted) \end{Desc} +\index{slsDetector@{sls\-Detector}!getPositions@{getPositions}} +\index{getPositions@{getPositions}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::get\-Positions (float $\ast$ {\em pos} = {\tt NULL})\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_732f6d36456d6e87d70324a4bdc1bbb8} + + +get positions for the acquisition \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em pos}]array which will contain the encoder positions \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]number of positions \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_0d306720dced0d3576474978b06b4be4}.\index{slsDetector@{sls\-Detector}!getRateCorrections@{getRateCorrections}} +\index{getRateCorrections@{getRateCorrections}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::get\-Rate\-Corrections ()}\label{classslsDetector_7606366a3cbe280c90dc659036814697} + + +get rate correction \begin{Desc} +\item[Returns:]0 if rate correction disabled, $>$0 otherwise \end{Desc} +\index{slsDetector@{sls\-Detector}!getRateCorrections@{getRateCorrections}} +\index{getRateCorrections@{getRateCorrections}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::get\-Rate\-Corrections (float \& {\em t})}\label{classslsDetector_6e6212f4bbe0c5df253ec9c535c3f9b1} + + +get rate correction \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em t}]reference for dead time \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]0 if rate correction disabled, $>$0 otherwise \end{Desc} +\index{slsDetector@{sls\-Detector}!getRunStatus@{getRunStatus}} +\index{getRunStatus@{getRunStatus}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::get\-Run\-Status ()}\label{classslsDetector_567629b942b153a03cfc66d4d26c5daa} + + +get run status \begin{Desc} +\item[Returns:]status mask \end{Desc} +\index{slsDetector@{sls\-Detector}!getSetLength@{getSetLength}} +\index{getSetLength@{getSetLength}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::get\-Set\-Length ()\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_51a88168bf9e4cd2ef7730b973963055} + + +get length cycles + +not implemented (should be something more general like \char`\"{}set speed including also waitstates, set cycles etc.) \index{slsDetector@{sls\-Detector}!getSettings@{getSettings}} +\index{getSettings@{getSettings}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{sls\-Detector::detector\-Settings} sls\-Detector::get\-Settings (int {\em imod} = {\tt -1})}\label{classslsDetector_d112702360f31a967bfad9fe2aabf6f6} + + +get detector settings \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em imod}]module number (-1 all) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current settings \end{Desc} +\index{slsDetector@{sls\-Detector}!getStopPort@{getStopPort}} +\index{getStopPort@{getStopPort}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::get\-Stop\-Port ()\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_80ab8f7f4cc6b2e92017a0c77f961b70} + + +returns the detector stop port\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!getThresholdEnergy@{getThresholdEnergy}} +\index{getThresholdEnergy@{getThresholdEnergy}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::get\-Threshold\-Energy (int {\em imod} = {\tt -1})}\label{classslsDetector_f2da634bb9551730c12e07e2b772bf06} + + +get threshold energy \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em imod}]module number (-1 all) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current threshold value for imod in ev (-1 failed) \end{Desc} +\index{slsDetector@{sls\-Detector}!getTimeLeft@{getTimeLeft}} +\index{getTimeLeft@{getTimeLeft}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int64\_\-t sls\-Detector::get\-Time\-Left (\bf{timer\-Index} {\em index})}\label{classslsDetector_61f072fcaf0a359148f52ea34769c846} + + +get current timer value \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em index}]timer index \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]elapsed time value in ns or number of...(e.g. frames, gates, probes) \end{Desc} +\index{slsDetector@{sls\-Detector}!getTrimDir@{getTrimDir}} +\index{getTrimDir@{getTrimDir}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ sls\-Detector::get\-Trim\-Dir ()\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_d4a858d9b3a1b31c5d5decdc9d757267} + + +returns the detector trimbit directory\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!getTrimEn@{getTrimEn}} +\index{getTrimEn@{getTrimEn}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::get\-Trim\-En (int $\ast$ {\em en})\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_fa24d8a0ec1393c7e27e4e558e72cf87} + + +returns the number of trim energies and their value\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em point}]to the array that will contain the trim energies (in ev) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]number of trim energies\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!giveCalibrationPulse@{giveCalibrationPulse}} +\index{giveCalibrationPulse@{giveCalibrationPulse}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::give\-Calibration\-Pulse (float {\em vcal}, int {\em npulses})}\label{classslsDetector_a8fafd5690120579f484e326dc6fd9be} + + +give a train of calibration pulses \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em vcal}]pulse amplitude \item[{\em npulses}]number of pulses\end{description} +\end{Desc} +not yet implemented \index{slsDetector@{sls\-Detector}!initializeDetectorSize@{initializeDetectorSize}} +\index{initializeDetectorSize@{initializeDetectorSize}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::initialize\-Detector\-Size (\bf{detector\-Type} {\em type})\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_19f1c6d120293c98a0d2dc992e5616f8} + + +Initializes the this\-Detector structure \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em type}]is needed to define the number of channels, chips, modules etc. \end{description} +\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} + + +if the shared memory has newly be created, initialize the detector variables + +set hostname to default + +set ports to defaults + +set this\-Detector-$>$my\-Detector\-Type to type and according to this set n\-Chans, n\-Chips, n\-Dacs, n\-Adcs, n\-Mod\-Max, dynamic\-Range, n\-Mod + +number of modules is initally the maximum number of modules + +calculates the expected data size + +set trim\-Dsdir, cal\-Dir and file\-Path to default to home directory + +set file\-Name to default to run + +set file\-Index to default to 0 + +set number of trim energies to 0 + +set correction mask to 0 + +set deat time + +set number of bad chans to 0 + +set number of bad flat field chans to 0 + +set angular direction to 1 + +set fine offset to 0 + +set global offset to 0 + +set number of rois to 0 + +set readoutflags to none + +set current settings to uninitialized + +set threshold to -1 + +set clockdivider to 1 + +set number of positions to 0 + +set binsize + +calculates the memory offsets for flat field coefficients and errors, module structures, dacs, adcs, chips and channels + +also in case this\-Detector alread existed initialize the pointer for flat field coefficients and errors, module structures, dacs, adcs, chips and channels + +if this\-Detector is new, initialize its structures \begin{Desc} +\item[See also:]\doxyref{initialize\-Detector\-Structure()}{p.}{classslsDetector_1c39e47efe5d8794b68cb32295cddf3c};\end{Desc} +set this\-Detector-$>$already\-Existing=1 + +fill the Bad\-Channel\-Mask \begin{Desc} +\item[See also:]\doxyref{fill\-Bad\-Channel\-Mask}{p.}{classslsDetector_6a0ebe013e27c065b2f67158a27f64ac} \end{Desc} +\index{slsDetector@{sls\-Detector}!initializeDetectorStructure@{initializeDetectorStructure}} +\index{initializeDetectorStructure@{initializeDetectorStructure}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::initialize\-Detector\-Structure ()\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_1c39e47efe5d8794b68cb32295cddf3c} + + +Initializes the module structures in this\-Detector if the detector did not exists before + +for each of the detector modules up to the maximum number which can be installed initlialize the \doxyref{sls\_\-detector\_\-module}{p.}{structsls__detector__module} structure \begin{Desc} +\item[See also:]\doxyref{sls\_\-detector\_\-module}{p.}{structsls__detector__module}\end{Desc} +sets the size of the module to n\-Chans, n\-Chips etc. + +initializes the serial number and register to 0 + +initializes the dacs values to 0 + +initializes the adc values to 0 + +initializes the chip registers to 0 + +initializes the channel registers to 0 + +initialize gain and offset to -1 \index{slsDetector@{sls\-Detector}!initSharedMemory@{initSharedMemory}} +\index{initSharedMemory@{initSharedMemory}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::init\-Shared\-Memory (\bf{detector\-Type} {\em type} = {\tt GENERIC}, int {\em id} = {\tt 0})\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_cb94b9bfa7bbea2d9e1b0289a272bca8} + + +Initializes the shared memory \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em type}]is needed to define the size of the shared memory \item[{\em id}]is the detector id needed to define the shared memory id \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]shm\_\-id shared memory id \end{Desc} + + +the shared memory key is set to DEFAULT\_\-SHM\_\-KEY+id + +The size of the shared memory is: size of shared structure + ffcoefficents +fferrors + modules+ dacs+adcs+chips+chans + +this\-Detector pointer is set to the memory address of the shared memory + +shm\_\-id returns -1 is shared memory initialization fails \index{slsDetector@{sls\-Detector}!popDataQueue@{popDataQueue}} +\index{popDataQueue@{popDataQueue}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int $\ast$ sls\-Detector::pop\-Data\-Queue ()}\label{classslsDetector_ee85bddb6aa7b37c99f1397112e6c8b6} + + +pops the data from the data queue \begin{Desc} +\item[Returns:]pointer to the popped data or NULL if the queue is empty. \end{Desc} +\begin{Desc} +\item[See also:]\doxyref{data\-Queue}{p.}{classslsDetector_52e9fe9baf37db001cdf58f982ab5dd6} \end{Desc} +\index{slsDetector@{sls\-Detector}!processData@{processData}} +\index{processData@{processData}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void $\ast$ sls\-Detector::process\-Data ()}\label{classslsDetector_717eb12630b1d1f5138f98e5f7ba021f} + + +function for processing data + +Pop data queue + +decode data + +write raw data file + +rate correction + +flat field correction + +angular conversion + +data merging + +file writing \index{slsDetector@{sls\-Detector}!rateCorrect@{rateCorrect}} +\index{rateCorrect@{rateCorrect}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::rate\-Correct (float $\ast$ {\em datain}, float $\ast$ {\em errin}, float $\ast$ {\em dataout}, float $\ast$ {\em errout})}\label{classslsDetector_518feacfa3a1d6156779f8eaacdf86d3} + + +rate correct data \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em datain}]data array \item[{\em errin}]error array on data (if NULL will default to sqrt(datain) \item[{\em dataout}]array of corrected data \item[{\em errout}]error on corrected data (if not NULL) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]0 \end{Desc} +\index{slsDetector@{sls\-Detector}!rateCorrect@{rateCorrect}} +\index{rateCorrect@{rateCorrect}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::rate\-Correct (float {\em datain}, float {\em errin}, float \& {\em dataout}, float \& {\em errout}, float {\em tau}, float {\em t})}\label{classslsDetector_e8c2d03ab2c870d2f1ff7a861cfeb6d1} + + +rate correct data \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em datain}]data \item[{\em errin}]error on data (if$<$=0 will default to sqrt(datain) \item[{\em dataout}]corrected data \item[{\em errout}]error on corrected data \item[{\em tau}]dead time 9in ns) \item[{\em t}]acquisition time (in ns) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]0 \end{Desc} +\index{slsDetector@{sls\-Detector}!readAll@{readAll}} +\index{readAll@{readAll}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int $\ast$ sls\-Detector::read\-All ()}\label{classslsDetector_87acdd8cd43d30dc3dd88763b6e23d08} + + +asks and receives all data from the detector and puts them in a data queue \begin{Desc} +\item[Returns:]pointer to the front of the queue or NULL. \end{Desc} +\begin{Desc} +\item[See also:]\doxyref{get\-Data\-From\-Detector}{p.}{classslsDetector_b1982e89f8e8de63c807a707ccba594c} \doxyref{data\-Queue}{p.}{classslsDetector_52e9fe9baf37db001cdf58f982ab5dd6} \end{Desc} +\index{slsDetector@{sls\-Detector}!readAngularConversion@{readAngularConversion}} +\index{readAngularConversion@{readAngularConversion}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::read\-Angular\-Conversion (string {\em fname} = {\tt \char`\"{}\char`\"{}})}\label{classslsDetector_23398787e01e519bf8ac5f313ca5af01} + + +reads an angular conversion file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]file to be read \end{description} +\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{angle\-Conversion\-Constant}{p.}{structangleConversionConstant} \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_33bf1b939eb877bbd4aa42f400d7ca36}.\index{slsDetector@{sls\-Detector}!readCalibrationFile@{readCalibrationFile}} +\index{readCalibrationFile@{readCalibrationFile}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::read\-Calibration\-File (string {\em fname}, float \& {\em gain}, float \& {\em offset})}\label{classslsDetector_9305060e7499cfcabac23b99c884b92b} + + +reads a calibration file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]file to be read \item[{\em gain}]reference to the gain variable reference to the offset variable \end{description} +\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_f8f1b7b42012420fc557aacd714140f8}, and \bf{eiger\-Detector} \doxyref{p.}{classeigerDetector_6b1b4b5328a5d8c423e9a7a8a950028f}.\index{slsDetector@{sls\-Detector}!readConfigurationFile@{readConfigurationFile}} +\index{readConfigurationFile@{readConfigurationFile}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::read\-Configuration\-File (string const {\em fname})}\label{classslsDetector_49c88825b21dc040269f6980e9725a3a} + + +Every detector should have a basic configuration file containing: type (mythen, pilatus etc.) hostname portnumber communication type (default TCP/IP) eventually secondary portnumber (e.g. mythen stop function) number of modules installed if different from the detector size (x,y) + +to be changed \index{slsDetector@{sls\-Detector}!readDataFile@{readDataFile}} +\index{readDataFile@{readDataFile}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::read\-Data\-File (string {\em fname}, int $\ast$ {\em data})}\label{classslsDetector_0d27017bc1140cc9da3e797f03848f2e} + + +reads a data file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em name}]of the file to be read \item[{\em data}]array of data values \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if it could not read the file or data=NULL \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_d83819d61ea01148cf18cd3c46f2a9f7}, and \bf{eiger\-Detector} \doxyref{p.}{classeigerDetector_a6afa206101506d7f95d1ec835fbf843}.\index{slsDetector@{sls\-Detector}!readDataFile@{readDataFile}} +\index{readDataFile@{readDataFile}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::read\-Data\-File (string {\em fname}, float $\ast$ {\em data}, float $\ast$ {\em err} = {\tt NULL}, float $\ast$ {\em ang} = {\tt NULL}, char {\em dataformat} = {\tt 'f'}, int {\em nch} = {\tt 0})}\label{classslsDetector_ffd62fa6a3487693316209ea71502b4b} + + +reads a data file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em name}]of the file to be read \item[{\em data}]array of data values to be filled \item[{\em err}]array of arrors on the data. If NULL no errors are expected on the file\item[{\em ang}]array of angular values. If NULL data are expected in the form chan-val(-err) otherwise ang-val(-err) \item[{\em dataformat}]format of the data: can be 'i' integer or 'f' float (default) \item[{\em nch}]number of channels to be written to file. if $<$=0 defaults to the number of installed channels of the detector \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if it could not read the file or data=NULL \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_1937a5355eed0dc553cb05d2098f7c47}, and \bf{eiger\-Detector} \doxyref{p.}{classeigerDetector_4d0b7da609b9a0457656bfc8cf0a7997}.\index{slsDetector@{sls\-Detector}!readFrame@{readFrame}} +\index{readFrame@{readFrame}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int $\ast$ sls\-Detector::read\-Frame ()}\label{classslsDetector_b352d85c5a4f415d1ec930d17bae87fa} + + +asks and receives a data frame from the detector \begin{Desc} +\item[Returns:]pointer to the data or NULL. If NULL disconnects the socket \end{Desc} +\begin{Desc} +\item[See also:]\doxyref{get\-Data\-From\-Detector}{p.}{classslsDetector_b1982e89f8e8de63c807a707ccba594c} \end{Desc} +\index{slsDetector@{sls\-Detector}!readRegister@{readRegister}} +\index{readRegister@{readRegister}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::read\-Register (int {\em addr})}\label{classslsDetector_89ba6d2d8e79a60270e7e1c217df2d79} + + +read register \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em addr}]address \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current register value \end{Desc} +\index{slsDetector@{sls\-Detector}!readTrimFile@{readTrimFile}} +\index{readTrimFile@{readTrimFile}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{sls\_\-detector\_\-module}$\ast$ sls\-Detector::read\-Trim\-File (string {\em fname}, \bf{sls\_\-detector\_\-module} $\ast$ {\em my\-Mod} = {\tt NULL})}\label{classslsDetector_e84b8a7a2b27db3f89a98f9f8a81efca} + + +reads a trim file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]name of the file to be read \item[{\em my\-Mod}]pointer to the module structure which has to be set. \par + If it is NULL a new module structure will be created \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]the pointer to my\-Mod or NULL if reading the file failed \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_2120f9105997fd8f8bf9165dbffc55e7}, and \bf{eiger\-Detector} \doxyref{p.}{classeigerDetector_f24af0459e8eb45c1bc9c68a870e5094}.\index{slsDetector@{sls\-Detector}!receiveChannel@{receiveChannel}} +\index{receiveChannel@{receiveChannel}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::receive\-Channel (\bf{sls\_\-detector\_\-channel} $\ast$)\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_39f8959a55e92c7b0817529270be7667} + + +receive a \doxyref{sls\_\-detector\_\-channel}{p.}{structsls__detector__channel} structure over socket \index{slsDetector@{sls\-Detector}!receiveChip@{receiveChip}} +\index{receiveChip@{receiveChip}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::receive\-Chip (\bf{sls\_\-detector\_\-chip} $\ast$)\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_21d070352bfbf4745543c572bd6ae8f7} + + +receive a \doxyref{sls\_\-detector\_\-chip}{p.}{structsls__detector__chip} structure over socket \index{slsDetector@{sls\-Detector}!receiveModule@{receiveModule}} +\index{receiveModule@{receiveModule}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::receive\-Module (\bf{sls\_\-detector\_\-module} $\ast$)\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_1356b4fabe6b1aaa9c67939ff9331f98} + + +receive a \doxyref{sls\_\-detector\_\-module}{p.}{structsls__detector__module} structure over socket \index{slsDetector@{sls\-Detector}!resetMerging@{resetMerging}} +\index{resetMerging@{resetMerging}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::reset\-Merging (float $\ast$ {\em mp}, float $\ast$ {\em mv}, float $\ast$ {\em me}, int $\ast$ {\em mm})}\label{classslsDetector_208c3a5a80ba931056f1f2ff3cb5d0e5} + + +sets the arrays of the merged data to 0. NB The array should be created with size $>$= 360./get\-Bin\-Size(); \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em mp}]already merged postions \item[{\em mv}]already merged data \item[{\em me}]already merged errors (squared sum) \item[{\em mm}]multiplicity of merged arrays \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_7d38c9af0d94bc15571c3c15b38f39a8}.\index{slsDetector@{sls\-Detector}!retrieveDetectorSetup@{retrieveDetectorSetup}} +\index{retrieveDetectorSetup@{retrieveDetectorSetup}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::retrieve\-Detector\-Setup (string const {\em fname})}\label{classslsDetector_233c3d27e9a946fb42b0aa49717d9251} + + +not yet implemented + +should retrieve from a file all the current detector parameters \index{slsDetector@{sls\-Detector}!sendChannel@{sendChannel}} +\index{sendChannel@{sendChannel}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::send\-Channel (\bf{sls\_\-detector\_\-channel} $\ast$)\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_5cd249f9a287b25af9a3a7e7e675c559} + + +send a \doxyref{sls\_\-detector\_\-channel}{p.}{structsls__detector__channel} structure over socket \index{slsDetector@{sls\-Detector}!sendChip@{sendChip}} +\index{sendChip@{sendChip}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::send\-Chip (\bf{sls\_\-detector\_\-chip} $\ast$)\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_1e92a814b83501cdef5771c1e5c477aa} + + +send a \doxyref{sls\_\-detector\_\-chip}{p.}{structsls__detector__chip} structure over socket \index{slsDetector@{sls\-Detector}!sendModule@{sendModule}} +\index{sendModule@{sendModule}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::send\-Module (\bf{sls\_\-detector\_\-module} $\ast$)\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_cc29561aa2b22ee49038c7bdf2be5ad7} + + +send a \doxyref{sls\_\-detector\_\-module}{p.}{structsls__detector__module} structure over socket \index{slsDetector@{sls\-Detector}!setAngularConversion@{setAngularConversion}} +\index{setAngularConversion@{setAngularConversion}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Angular\-Conversion (string {\em fname} = {\tt \char`\"{}\char`\"{}})}\label{classslsDetector_30fe39ddd78fa880b6b7815d1d5462ec} + + +set angular conversion \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]file with angular conversion constants (\char`\"{}\char`\"{} disable) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]0 if angular conversion disabled, $>$0 otherwise \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_78efe554a277de7fb8759307992fc61b}.\index{slsDetector@{sls\-Detector}!setBadChannelCorrection@{setBadChannelCorrection}} +\index{setBadChannelCorrection@{setBadChannelCorrection}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Bad\-Channel\-Correction (string {\em fname} = {\tt \char`\"{}\char`\"{}})}\label{classslsDetector_45833eb571b8cb20225f4046e2a17e5a} + + +set bad channels correction \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]file with bad channel list (\char`\"{}\char`\"{} disable) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]0 if bad channel disabled, $>$0 otherwise \end{Desc} +\index{slsDetector@{sls\-Detector}!setBinSize@{setBinSize}} +\index{setBinSize@{setBinSize}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float sls\-Detector::set\-Bin\-Size (float {\em bs})\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_96e2fb6fb0aa34bdbe59facf367c4ae1} + + +set detector bin size used for merging (approx angular resolution) + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_8f466447f886379204a59eb6785f1ed0}.\index{slsDetector@{sls\-Detector}!setCalDir@{setCalDir}} +\index{setCalDir@{setCalDir}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ sls\-Detector::set\-Cal\-Dir (string {\em s})\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_9c4d2c796c176852537ff3cff4f5974b} + + +sets the location of the calibration files \begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!setChannel@{setChannel}} +\index{setChannel@{setChannel}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Channel (\bf{sls\_\-detector\_\-channel} {\em chan})}\label{classslsDetector_71bf1ef7be9f51c44cf6bc4a0dfea1e2} + + +configure channel \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em chan}]channel to be set - must contain correct channel, module and chip number \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current register value \end{Desc} +\index{slsDetector@{sls\-Detector}!setChannel@{setChannel}} +\index{setChannel@{setChannel}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Channel (int64\_\-t {\em reg}, int {\em ichan} = {\tt -1}, int {\em ichip} = {\tt -1}, int {\em imod} = {\tt -1})}\label{classslsDetector_bed71bb89a69cbf24de31de9f5f478bc} + + +configure channel \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em reg}]channel register \item[{\em ichan}]channel number (-1 all) \item[{\em ichip}]chip number (-1 all) \item[{\em imod}]module number (-1 all) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current register value \end{Desc} +\begin{Desc} +\item[See also:]\doxyref{sls\_\-detector\_\-channel}{p.}{structsls__detector__channel} \end{Desc} +\index{slsDetector@{sls\-Detector}!setChip@{setChip}} +\index{setChip@{setChip}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Chip (\bf{sls\_\-detector\_\-chip} {\em chip})}\label{classslsDetector_3a327b952866525e1b5c8fe541834c68} + + +configure chip \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em chip}]chip to be set - must contain correct module and chip number and also channel registers \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current register value \end{Desc} +\begin{Desc} +\item[See also:]\doxyref{sls\_\-detector\_\-chip}{p.}{structsls__detector__chip} \end{Desc} +\index{slsDetector@{sls\-Detector}!setChip@{setChip}} +\index{setChip@{setChip}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Chip (int {\em reg}, int {\em ichip} = {\tt -1}, int {\em imod} = {\tt -1})}\label{classslsDetector_18cf730c59f5981fb5e22ebf460b9abc} + + +configure chip \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em reg}]chip register \item[{\em ichip}]chip number (-1 all) \item[{\em imod}]module number (-1 all) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current register value \end{Desc} +\begin{Desc} +\item[See also:]\doxyref{sls\_\-detector\_\-chip}{p.}{structsls__detector__chip} \end{Desc} +\index{slsDetector@{sls\-Detector}!setClockDivider@{setClockDivider}} +\index{setClockDivider@{setClockDivider}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Clock\-Divider (int {\em i})\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_49af64998d4a4d44e965eb0adb1facb2} + + +set clock divider + +not implemented (should be something more general like \char`\"{}set speed including also waitstates, set cycles etc.) \index{slsDetector@{sls\-Detector}!setDAC@{setDAC}} +\index{setDAC@{setDAC}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float sls\-Detector::set\-DAC (float {\em val}, \bf{dac\-Index} {\em index}, int {\em imod} = {\tt -1})}\label{classslsDetector_cfcce08c547e24dc09968a74e35daf40} + + +set dacs value \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em val}]value (in V) \item[{\em index}]DAC index \item[{\em imod}]module number (if -1 alla modules) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current DAC value \end{Desc} +\index{slsDetector@{sls\-Detector}!setDetectorType@{setDetectorType}} +\index{setDetectorType@{setDetectorType}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Detector\-Type (string {\em type})}\label{classslsDetector_4bebb4f131fe345fa561428e070a933d} + + +sets/gets detector type normally the detector knows what type of detector it is \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em type}]is the detector type (\char`\"{}Mythen\char`\"{}, \char`\"{}Pilatus\char`\"{}, \char`\"{}XFS\char`\"{}, \char`\"{}Gotthard\char`\"{}, Agipd\char`\"{}) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]returns detector type index (1 GENERIC, 2 MYTHEN, 3 PILATUS, 4 XFS, 5 GOTTHARD, 6 AGIPD, -1 command failed) \end{Desc} +\index{slsDetector@{sls\-Detector}!setDetectorType@{setDetectorType}} +\index{setDetectorType@{setDetectorType}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Detector\-Type (\bf{detector\-Type} {\em type} = {\tt GET\_\-DETECTOR\_\-TYPE})}\label{classslsDetector_e76a665a8d7a6b37d85aff129d3afdef} + + +sets/gets detector type normally the detector knows what type of detector it is \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em type}]is the detector type (defaults to GET\_\-DETECTOR\_\-TYPE) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]returns detector type index (1 GENERIC, 2 MYTHEN, 3 PILATUS, 4 XFS, 5 GOTTHARD, 6 AGIPD, -1 command failed) \end{Desc} +\index{slsDetector@{sls\-Detector}!setDynamicRange@{setDynamicRange}} +\index{setDynamicRange@{setDynamicRange}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Dynamic\-Range (int {\em n} = {\tt -1})}\label{classslsDetector_57d00f77b9c12d9a01407d5a74bacddb} + + +set/get dynamic range \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em n}]dynamic range (-1 get) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current dynamic range updates the size of the data expected from the detector \end{Desc} +\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!setExternalCommunicationMode@{setExternalCommunicationMode}} +\index{setExternalCommunicationMode@{setExternalCommunicationMode}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{external\-Communication\-Mode} sls\-Detector::set\-External\-Communication\-Mode (\bf{external\-Communication\-Mode} {\em pol} = {\tt GET\_\-EXTERNAL\_\-COMMUNICATION\_\-MODE})}\label{classslsDetector_2f7bac599bf5bb103debcd9342b65edd} + + +set/get the external communication mode + +obsolete\begin{Desc} +\item[See also:]\doxyref{set\-External\-Signal\-Flags}{p.}{classslsDetector_5878c33a1353f1d32c383be4169531e7} \end{Desc} +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em pol}]value to be set\end{description} +\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{external\-Communication\-Mode}{p.}{sls__detector__defs_8h_51d6eb28d9d010319da9ce5da86ed32f} \end{Desc} +\begin{Desc} +\item[Returns:]current external communication mode \end{Desc} +\index{slsDetector@{sls\-Detector}!setExternalSignalFlags@{setExternalSignalFlags}} +\index{setExternalSignalFlags@{setExternalSignalFlags}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{external\-Signal\-Flag} sls\-Detector::set\-External\-Signal\-Flags (\bf{external\-Signal\-Flag} {\em pol} = {\tt GET\_\-EXTERNAL\_\-SIGNAL\_\-FLAG}, int {\em signalindex} = {\tt 0})}\label{classslsDetector_5878c33a1353f1d32c383be4169531e7} + + +set/get the use of an external signal \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em pol}]meaning of the signal\end{description} +\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{external\-Signal\-Flag}{p.}{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6ed} \end{Desc} +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em signal\-Index}]index of the signal \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current meaning of signal signal\-Index \end{Desc} +\index{slsDetector@{sls\-Detector}!setFileIndex@{setFileIndex}} +\index{setFileIndex@{setFileIndex}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-File\-Index (int {\em i})\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_22326d5e85503bfd16e4bdb279babb43} + + +sets the default output file index \begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!setFileName@{setFileName}} +\index{setFileName@{setFileName}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ sls\-Detector::set\-File\-Name (string {\em s})\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_ec565bab03357d783cccae55232b03ba} + + +sets the default output files root name \begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!setFilePath@{setFilePath}} +\index{setFilePath@{setFilePath}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ sls\-Detector::set\-File\-Path (string {\em s})\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_57c4587267e50a21ba13ead83294bdb4} + + +sets the default output files path \begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!setFineOffset@{setFineOffset}} +\index{setFineOffset@{setFineOffset}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float sls\-Detector::set\-Fine\-Offset (float {\em f})\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_fd3b79c59688a7a0f4f72ba5676a2f9b} + + +set detector fine offset + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_fe142e36f1a5fa8b2ab5fc45e9f8c781}.\index{slsDetector@{sls\-Detector}!setFlatFieldCorrection@{setFlatFieldCorrection}} +\index{setFlatFieldCorrection@{setFlatFieldCorrection}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Flat\-Field\-Correction (string {\em fname} = {\tt \char`\"{}\char`\"{}})}\label{classslsDetector_b4e2c11303714d5e62b4fcc22f829d8f} + + +set flat field corrections \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]name of the flat field file (or \char`\"{}\char`\"{} if disable) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]0 if disable (or file could not be read), $>$0 otherwise \end{Desc} +\index{slsDetector@{sls\-Detector}!setGlobalOffset@{setGlobalOffset}} +\index{setGlobalOffset@{setGlobalOffset}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float sls\-Detector::set\-Global\-Offset (float {\em f})\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_84c8dc8017e692d93246cd546e6366c1} + + +set detector global offset + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_e24dd88c4eb965687bd656a12bae8ad7}.\index{slsDetector@{sls\-Detector}!setModule@{setModule}} +\index{setModule@{setModule}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Module (\bf{sls\_\-detector\_\-module} {\em module})}\label{classslsDetector_d659b9a8ae9a29cea616e6333e2e7be4} + + +configure chip \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em module}]module to be set - must contain correct module number and also channel and chip registers \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current register value \end{Desc} +\begin{Desc} +\item[See also:]\doxyref{sls\_\-detector\_\-module}{p.}{structsls__detector__module} \end{Desc} +\index{slsDetector@{sls\-Detector}!setModule@{setModule}} +\index{setModule@{setModule}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Module (int {\em reg}, int {\em imod} = {\tt -1})}\label{classslsDetector_1be9e16689befa0d654345bc30ccd68e} + + +configure module \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em imod}]module number (-1 all) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current register value \end{Desc} +\begin{Desc} +\item[See also:]\doxyref{sls\_\-detector\_\-module}{p.}{structsls__detector__module} \end{Desc} +\index{slsDetector@{sls\-Detector}!setNumberOfModules@{setNumberOfModules}} +\index{setNumberOfModules@{setNumberOfModules}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Number\-Of\-Modules (int {\em n}, \bf{dimension} {\em d} = {\tt X})}\label{classslsDetector_9e4117c0234d51b22922a2d638e118ab} + + +set/get the size of the detector \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em n}]number of modules \item[{\em d}]dimension \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current number of modules in direction d \end{Desc} +\index{slsDetector@{sls\-Detector}!setOnline@{setOnline}} +\index{setOnline@{setOnline}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Online (int const {\em online})}\label{classslsDetector_f041f723f702c17de292061d6d609698} + + +sets the online\-Flag \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em off}]can be: \par + GET\_\-ONLINE\_\-FLAG, returns wether the detector is in online or offline state;\par + OFFLINE\_\-FLAG, detector in offline state (i.e. no communication to the detector - using only local structure - no data acquisition possible!);\par + ONLINE\_\-FLAG detector in online state (i.e. communication to the detector updating the local structure) \end{description} +\end{Desc} +\index{slsDetector@{sls\-Detector}!setPositions@{setPositions}} +\index{setPositions@{setPositions}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Positions (int {\em n\-Pos}, float $\ast$ {\em pos})\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_ed6493ad015660281b14814f9a7f6cb5} + + +set positions for the acquisition \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em n\-Pos}]number of positions \item[{\em pos}]array with the encoder positions \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]number of positions \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_1ffb0963f724e6d6d497685e6de62fd6}.\index{slsDetector@{sls\-Detector}!setRateCorrection@{setRateCorrection}} +\index{setRateCorrection@{setRateCorrection}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Rate\-Correction (float {\em t} = {\tt 0})}\label{classslsDetector_c89f7fc9f9255e573e34f8d3dadf38af} + + +set rate correction \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em t}]dead time in ns - if 0 disable correction, if $>$0 set dead time to t, if $<$0 set deadtime to default dead time for current settings \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]0 if rate correction disabled, $>$0 otherwise \end{Desc} +\index{slsDetector@{sls\-Detector}!setReadOutFlags@{setReadOutFlags}} +\index{setReadOutFlags@{setReadOutFlags}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Read\-Out\-Flags (\bf{read\-Out\-Flags} {\em flag})}\label{classslsDetector_e86bd9ff0d87efe9327118b5349321c4} + + +set/get readout flags \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em flag}]readout flag to be set \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current flag \end{Desc} +\index{slsDetector@{sls\-Detector}!setROI@{setROI}} +\index{setROI@{setROI}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-ROI (int {\em nroi} = {\tt -1}, int $\ast$ {\em xmin} = {\tt NULL}, int $\ast$ {\em xmax} = {\tt NULL}, int $\ast$ {\em ymin} = {\tt NULL}, int $\ast$ {\em ymax} = {\tt NULL})}\label{classslsDetector_e2a0716ddc050b79a45c552236ff2284} + + +set roi + +not yet implemented \index{slsDetector@{sls\-Detector}!setSetLength@{setSetLength}} +\index{setSetLength@{setSetLength}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Set\-Length (int {\em i})\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_f936cf5840bded81acb3f93b6b5fdd1c} + + +set length cycles + +not implemented (should be something more general like \char`\"{}set speed including also waitstates, set cycles etc.) \index{slsDetector@{sls\-Detector}!setSettings@{setSettings}} +\index{setSettings@{setSettings}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{detector\-Settings} sls\-Detector::set\-Settings (\bf{detector\-Settings} {\em isettings}, int {\em imod} = {\tt -1})}\label{classslsDetector_765072d5c8aaff56ca79734072607188} + + +set detector settings \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em isettings}]settings \item[{\em imod}]module number (-1 all) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current settings\end{Desc} +in this function trimbits and calibration files are searched in the trim\-Dir and cal\-Dir directories and the detector is initialized \index{slsDetector@{sls\-Detector}!setTCPSocket@{setTCPSocket}} +\index{setTCPSocket@{setTCPSocket}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-TCPSocket (string const {\em name} = {\tt \char`\"{}\char`\"{}}, int const {\em control\_\-port} = {\tt -1}, int const {\em stop\_\-port} = {\tt -1}, int const {\em data\_\-port} = {\tt -1})}\label{classslsDetector_019a01c4465c5ee572293cb6c00d9904} + + +configure the socket communication and initializes the socket instances + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em name}]hostname - if \char`\"{}\char`\"{} the current hostname is used \item[{\em control\_\-port}]port for control commands - if -1 the current is used \item[{\em stop\_\-port}]port for stop command - if -1 the current is used \item[{\em data\_\-port}]port for receiving data - if -1 the current is used\end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK is connection succeded, FAIL otherwise \end{Desc} +\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!setThresholdEnergy@{setThresholdEnergy}} +\index{setThresholdEnergy@{setThresholdEnergy}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::set\-Threshold\-Energy (int {\em e\_\-e\-V}, int {\em imod} = {\tt -1}, \bf{detector\-Settings} {\em isettings} = {\tt GET\_\-SETTINGS})}\label{classslsDetector_ab00a8eeca28831751121054e35d4c6b} + + +set threshold energy \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em e\_\-e\-V}]threshold in e\-V \item[{\em imod}]module number (-1 all) \item[{\em isettings}]ev. change settings \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current threshold value for imod in ev (-1 failed) \end{Desc} +\index{slsDetector@{sls\-Detector}!setTimer@{setTimer}} +\index{setTimer@{setTimer}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int64\_\-t sls\-Detector::set\-Timer (\bf{timer\-Index} {\em index}, int64\_\-t {\em t} = {\tt -1})}\label{classslsDetector_b78e1d801e92a9f5a06008d9e9731549} + + +set/get timer value \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em index}]timer index \item[{\em t}]time in ns or number of...(e.g. frames, gates, probes) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]timer set value in ns or number of...(e.g. frames, gates, probes) \end{Desc} +\index{slsDetector@{sls\-Detector}!setTrimDir@{setTrimDir}} +\index{setTrimDir@{setTrimDir}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ sls\-Detector::set\-Trim\-Dir (string {\em s})\hspace{0.3cm}{\tt [inline]}}\label{classslsDetector_646f389e75c23c2c8627c62fb1df2890} + + +sets the detector trimbit directory\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} +\index{slsDetector@{sls\-Detector}!startAcquisition@{startAcquisition}} +\index{startAcquisition@{startAcquisition}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::start\-Acquisition ()}\label{classslsDetector_49f44b9f27ce82d384ddfa0d229a0dee} + + +start detector acquisition \begin{Desc} +\item[Returns:]OK/FAIL \end{Desc} +\index{slsDetector@{sls\-Detector}!startAndReadAll@{startAndReadAll}} +\index{startAndReadAll@{startAndReadAll}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int $\ast$ sls\-Detector::start\-And\-Read\-All ()}\label{classslsDetector_fb4bb3d4e734c98684b60d283f34f128} + + +start detector acquisition and read all data putting them a data queue \begin{Desc} +\item[Returns:]pointer to the fron tof the data queue \end{Desc} +\begin{Desc} +\item[See also:]\doxyref{start\-And\-Read\-All\-No\-Wait}{p.}{classslsDetector_2e0a975f982971744ada81d346d84489} \doxyref{get\-Data\-From\-Detector}{p.}{classslsDetector_b1982e89f8e8de63c807a707ccba594c} \doxyref{data\-Queue}{p.}{classslsDetector_52e9fe9baf37db001cdf58f982ab5dd6} \end{Desc} +\index{slsDetector@{sls\-Detector}!startAndReadAllNoWait@{startAndReadAllNoWait}} +\index{startAndReadAllNoWait@{startAndReadAllNoWait}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::start\-And\-Read\-All\-No\-Wait ()}\label{classslsDetector_2e0a975f982971744ada81d346d84489} + + +start detector acquisition and read out, but does not read data from socket \index{slsDetector@{sls\-Detector}!startReadOut@{startReadOut}} +\index{startReadOut@{startReadOut}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::start\-Read\-Out ()}\label{classslsDetector_8314acd65ffb54f355967a5c6827448e} + + +start readout (without exposure or interrupting exposure) \begin{Desc} +\item[Returns:]OK/FAIL \end{Desc} +\index{slsDetector@{sls\-Detector}!startThread@{startThread}} +\index{startThread@{startThread}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void sls\-Detector::start\-Thread ()\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_58199d3393aa7eaa606cbb7cbf83469d} + + +start data processing threas \index{slsDetector@{sls\-Detector}!stopAcquisition@{stopAcquisition}} +\index{stopAcquisition@{stopAcquisition}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::stop\-Acquisition ()}\label{classslsDetector_07a3d8c3c0e03ec8f286a87673911c28} + + +stop detector acquisition \begin{Desc} +\item[Returns:]OK/FAIL \end{Desc} +\index{slsDetector@{sls\-Detector}!writeAngularConversion@{writeAngularConversion}} +\index{writeAngularConversion@{writeAngularConversion}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::write\-Angular\-Conversion (string {\em fname} = {\tt \char`\"{}\char`\"{}})}\label{classslsDetector_921f212286be085d7e1b8d0d11110d9c} + + +writes an angular conversion file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]file to be written \end{description} +\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{angle\-Conversion\-Constant}{p.}{structangleConversionConstant} \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_3c5f27709351c49dd715212adc5ba7d2}.\index{slsDetector@{sls\-Detector}!writeCalibrationFile@{writeCalibrationFile}} +\index{writeCalibrationFile@{writeCalibrationFile}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::write\-Calibration\-File (string {\em fname}, float {\em gain}, float {\em offset})}\label{classslsDetector_8eb676a1ab6ef35601ba5cae942ba380} + + +writes a clibration file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]file to be written \item[{\em gain}]\item[{\em offset}]\end{description} +\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_10e7213bb0e7138c07231687e9a6899a}, and \bf{eiger\-Detector} \doxyref{p.}{classeigerDetector_d5fbecfcc46cb151160c6011aa8e33b2}.\index{slsDetector@{sls\-Detector}!writeConfigurationFile@{writeConfigurationFile}} +\index{writeConfigurationFile@{writeConfigurationFile}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::write\-Configuration\-File (string const {\em fname})}\label{classslsDetector_82628148e11f4890c9d935ec921c1121} + + +Every detector should have a basic configuration file containing: type (mythen, pilatus etc.) hostname portnumber communication type (default TCP/IP) eventually secondary portnumber (e.g. mythen stop function) number of modules installed if different from the detector size (x,y) + +to be changed \index{slsDetector@{sls\-Detector}!writeDataFile@{writeDataFile}} +\index{writeDataFile@{writeDataFile}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::write\-Data\-File (string {\em fname}, int $\ast$ {\em data})}\label{classslsDetector_3e1a8e49fbfb34a54381452abc8b5258} + + +writes a data file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em name}]of the file to be written \item[{\em data}]array of data values \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if it could not write the file or data=NULL \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_9a49c84d7ad664f7891b00fba0ce829a}, and \bf{eiger\-Detector} \doxyref{p.}{classeigerDetector_68a740d5e43fcdb00c57f401666c0856}.\index{slsDetector@{sls\-Detector}!writeDataFile@{writeDataFile}} +\index{writeDataFile@{writeDataFile}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::write\-Data\-File (string {\em fname}, float $\ast$ {\em data}, float $\ast$ {\em err} = {\tt NULL}, float $\ast$ {\em ang} = {\tt NULL}, char {\em dataformat} = {\tt 'f'}, int {\em nch} = {\tt -1})}\label{classslsDetector_889c060afb5693830ca2be4fc6a5442c} + + +writes a data file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em name}]of the file to be written \item[{\em data}]array of data values \item[{\em err}]array of arrors on the data. If NULL no errors will be written\item[{\em ang}]array of angular values. If NULL data will be in the form chan-val(-err) otherwise ang-val(-err) \item[{\em dataformat}]format of the data: can be 'i' integer or 'f' float (default) \item[{\em nch}]number of channels to be written to file. if -1 defaults to the number of installed channels of the detector \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if it could not write the file or data=NULL \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_42c1d320f594ebd87e2465cc986ee848}, and \bf{eiger\-Detector} \doxyref{p.}{classeigerDetector_5ad2bf5b10d17e8c4ad7ae6e81e647e0}.\index{slsDetector@{sls\-Detector}!writeRegister@{writeRegister}} +\index{writeRegister@{writeRegister}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::write\-Register (int {\em addr}, int {\em val})}\label{classslsDetector_742c8c6b4e7f3cad4f7e60c8c7c0c18b} + + +write register \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em addr}]address value \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]current register value \end{Desc} +\index{slsDetector@{sls\-Detector}!writeTrimFile@{writeTrimFile}} +\index{writeTrimFile@{writeTrimFile}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::write\-Trim\-File (string {\em fname}, int {\em imod})}\label{classslsDetector_afe675432bf8e5dcb47774da3cc81106} + + +writes a trim file for module number imod - the values will be read from the current detector structure \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]name of the file to be written \item[{\em imod}]module number \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if the file could not be written \end{Desc} +\begin{Desc} +\item[See also:]\doxyref{sls\_\-detector\_\-module}{p.}{structsls__detector__module} \doxyref{shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector} \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_94179431a737bbceb20f27ca1fd30349}, and \bf{eiger\-Detector} \doxyref{p.}{classeigerDetector_df3a0dff0fc3111e10af0363bdd15a6a}.\index{slsDetector@{sls\-Detector}!writeTrimFile@{writeTrimFile}} +\index{writeTrimFile@{writeTrimFile}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sls\-Detector::write\-Trim\-File (string {\em fname}, \bf{sls\_\-detector\_\-module} {\em mod})}\label{classslsDetector_9cbb1f97b8e48bd4b108a2dfa992c6af} + + +writes a trim file \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em fname}]name of the file to be written \item[{\em mod}]module structure which has to be written to file \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]OK or FAIL if the file could not be written\end{Desc} +\begin{Desc} +\item[See also:]\doxyref{sls\_\-detector\_\-module}{p.}{structsls__detector__module} \end{Desc} + + +Reimplemented in \bf{mythen\-Detector} \doxyref{p.}{classmythenDetector_0b137abd78bd3d03653cd21436eb6c4d}, and \bf{eiger\-Detector} \doxyref{p.}{classeigerDetector_8380366bf7112021c49be8e6f29f18d8}. + +\subsection{Member Data Documentation} +\index{slsDetector@{sls\-Detector}!adcs@{adcs}} +\index{adcs@{adcs}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float$\ast$ \bf{sls\-Detector::adcs}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_f370b8466441491d8496bb8130b8c5e7} + + +pointer to adc valuse \index{slsDetector@{sls\-Detector}!badChannelMask@{badChannelMask}} +\index{badChannelMask@{badChannelMask}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int$\ast$ \bf{sls\-Detector::bad\-Channel\-Mask}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_614c98f77a8a3ec6cff57aa59e671123} + + +pointer to bad channel mask 0 is channel is good 1 if it is bad\begin{Desc} +\item[See also:]\doxyref{fill\-Bad\-Channel\-Mask()}{p.}{classslsDetector_6a0ebe013e27c065b2f67158a27f64ac} \end{Desc} +\index{slsDetector@{sls\-Detector}!chanregs@{chanregs}} +\index{chanregs@{chanregs}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int$\ast$ \bf{sls\-Detector::chanregs}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_44335474559f7321f0309fbda304caf8} + + +pointer to channal registers \index{slsDetector@{sls\-Detector}!chipregs@{chipregs}} +\index{chipregs@{chipregs}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int$\ast$ \bf{sls\-Detector::chipregs}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_0eb24981d044632eccba507bd15871a6} + + +pointer to chip registers \index{slsDetector@{sls\-Detector}!controlSocket@{controlSocket}} +\index{controlSocket@{controlSocket}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{My\-Socket\-TCP}$\ast$ \bf{sls\-Detector::control\-Socket}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_07f3943ab8a65f061bbe1c1e1d22b700} + + +socket for control commands \index{slsDetector@{sls\-Detector}!currentI0@{currentI0}} +\index{currentI0@{currentI0}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{sls\-Detector::current\-I0}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_4bba77b0de9f911c87d48d12c15a632b} + + +I0 measured \index{slsDetector@{sls\-Detector}!currentPosition@{currentPosition}} +\index{currentPosition@{currentPosition}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{sls\-Detector::current\-Position}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_9f64e866250e916299048c9816c9ef28} + + +current position of the detector \index{slsDetector@{sls\-Detector}!currentPositionIndex@{currentPositionIndex}} +\index{currentPositionIndex@{currentPositionIndex}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{sls\-Detector::current\-Position\-Index}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_9a6cd8787f618c147faacc1f3602bcf5} + + +current position index of the detector \index{slsDetector@{sls\-Detector}!dacs@{dacs}} +\index{dacs@{dacs}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float$\ast$ \bf{sls\-Detector::dacs}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_dc1b3f867b97136fca83f86c83b7ae14} + + +pointer to dac valuse \index{slsDetector@{sls\-Detector}!dataProcessingThread@{dataProcessingThread}} +\index{dataProcessingThread@{dataProcessingThread}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}pthread\_\-t \bf{sls\-Detector::data\-Processing\-Thread}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_8257cca09e23b601764e57f5a8bdaacd} + + +data processing thread??? \index{slsDetector@{sls\-Detector}!dataQueue@{dataQueue}} +\index{dataQueue@{dataQueue}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}queue$<$int$\ast$$>$ \bf{sls\-Detector::data\-Queue}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_52e9fe9baf37db001cdf58f982ab5dd6} + + +data queue \index{slsDetector@{sls\-Detector}!dataSocket@{dataSocket}} +\index{dataSocket@{dataSocket}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{My\-Socket\-TCP}$\ast$ \bf{sls\-Detector::data\-Socket}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_1629e3c46678ae201f6797e4d827cb32} + + +socket for data acquisition \index{slsDetector@{sls\-Detector}!detectorModules@{detectorModules}} +\index{detectorModules@{detectorModules}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{sls\_\-detector\_\-module}$\ast$ \bf{sls\-Detector::detector\-Modules}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_b78d6f2abc185b2bde2c550b31e0ff72} + + +pointer to detector module structures \index{slsDetector@{sls\-Detector}!detId@{detId}} +\index{detId@{detId}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::det\-Id}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_37f4af284283e7a18a28cec3f4e4532f} + + +detector ID \index{slsDetector@{sls\-Detector}!ffcoefficients@{ffcoefficients}} +\index{ffcoefficients@{ffcoefficients}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float$\ast$ \bf{sls\-Detector::ffcoefficients}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_a3c6e93198a2f8b072b7b84ba9af7c4b} + + +pointer to flat field coefficients \index{slsDetector@{sls\-Detector}!fferrors@{fferrors}} +\index{fferrors@{fferrors}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float$\ast$ \bf{sls\-Detector::fferrors}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_636168b92509e96418c9134d6d82ad4c} + + +pointer to flat field coefficient errors \index{slsDetector@{sls\-Detector}!mergingBins@{mergingBins}} +\index{mergingBins@{mergingBins}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float$\ast$ \bf{sls\-Detector::merging\-Bins}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_81751fd6e87f9659a8b6afe13efec2cf} + + +merging bins \index{slsDetector@{sls\-Detector}!mergingCounts@{mergingCounts}} +\index{mergingCounts@{mergingCounts}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float$\ast$ \bf{sls\-Detector::merging\-Counts}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_fc173dcaeda2bbd7bbd6a874b5b5726c} + + +merging counts \index{slsDetector@{sls\-Detector}!mergingErrors@{mergingErrors}} +\index{mergingErrors@{mergingErrors}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float$\ast$ \bf{sls\-Detector::merging\-Errors}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_f357d3b5961ead7ec263a47aa51c4c11} + + +merging errors \index{slsDetector@{sls\-Detector}!mergingMultiplicity@{mergingMultiplicity}} +\index{mergingMultiplicity@{mergingMultiplicity}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int$\ast$ \bf{sls\-Detector::merging\-Multiplicity}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_91c5e22042997d86c2c4d16ef1be9150} + + +merging multiplicity \index{slsDetector@{sls\-Detector}!onlineFlag@{onlineFlag}} +\index{onlineFlag@{onlineFlag}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::online\-Flag}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_7572bba8e53f900d4126657827bec3cf} + + +\begin{Desc} +\item[See also:]\doxyref{set\-Online}{p.}{classslsDetector_f041f723f702c17de292061d6d609698} \end{Desc} +\index{slsDetector@{sls\-Detector}!shmId@{shmId}} +\index{shmId@{shmId}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shm\-Id}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_53a78c7fe99f93b9bba8d0c2cb32a181} + + +shared memeory ID \index{slsDetector@{sls\-Detector}!stopSocket@{stopSocket}} +\index{stopSocket@{stopSocket}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{My\-Socket\-TCP}$\ast$ \bf{sls\-Detector::stop\-Socket}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_efee578cdd732339788a38707e5ce531} + + +socket for emergency stop \index{slsDetector@{sls\-Detector}!thisDetector@{thisDetector}} +\index{thisDetector@{thisDetector}!slsDetector@{sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{shared\-Sls\-Detector}$\ast$ \bf{sls\-Detector::this\-Detector}\hspace{0.3cm}{\tt [private]}}\label{classslsDetector_fe0da5c1491ebf18f187f0a26c5ded11} + + +address of the detector structure in shared memory + +The documentation for this class was generated from the following files:\begin{CompactItemize} +\item +sls\-Detector/\bf{sls\-Detector.h}\item +sls\-Detector/\bf{sls\-Detector.cpp}\end{CompactItemize} diff --git a/slsDetectorSoftware/docs/latex/doxygen.sty b/slsDetectorSoftware/docs/latex/doxygen.sty new file mode 100644 index 000000000..aed2ed8e4 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/doxygen.sty @@ -0,0 +1,78 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{doxygen} +\RequirePackage{calc} +\RequirePackage{array} +\pagestyle{fancyplain} +\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}} +\renewcommand{\chaptermark}[1]{\markboth{#1}{}} +\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} +\lhead[\fancyplain{}{\bfseries\thepage}] + {\fancyplain{}{\bfseries\rightmark}} +\rhead[\fancyplain{}{\bfseries\leftmark}] + {\fancyplain{}{\bfseries\thepage}} +\rfoot[\fancyplain{}{\bfseries\scriptsize Generated on Fri Oct 9 16:01:04 2009 by Doxygen }]{} +\lfoot[]{\fancyplain{}{\bfseries\scriptsize Generated on Fri Oct 9 16:01:04 2009 by Doxygen }} +\cfoot{} +\newenvironment{Code} +{\footnotesize} +{\normalsize} +\newcommand{\doxyref}[3]{\textbf{#1} (\textnormal{#2}\,\pageref{#3})} +\newenvironment{DocInclude} +{\footnotesize} +{\normalsize} +\newenvironment{VerbInclude} +{\footnotesize} +{\normalsize} +\newenvironment{Image} +{\begin{figure}[H]} +{\end{figure}} +\newenvironment{ImageNoCaption}{}{} +\newenvironment{CompactList} +{\begin{list}{}{ + \setlength{\leftmargin}{0.5cm} + \setlength{\itemsep}{0pt} + \setlength{\parsep}{0pt} + \setlength{\topsep}{0pt} + \renewcommand{\makelabel}{\hfill}}} +{\end{list}} +\newenvironment{CompactItemize} +{ + \begin{itemize} + \setlength{\itemsep}{-3pt} + \setlength{\parsep}{0pt} + \setlength{\topsep}{0pt} + \setlength{\partopsep}{0pt} +} +{\end{itemize}} +\newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp} +\newlength{\tmplength} +\newenvironment{TabularC}[1] +{ +\setlength{\tmplength} + {\linewidth/(#1)-\tabcolsep*2-\arrayrulewidth*(#1+1)/(#1)} + \par\begin{tabular*}{\linewidth} + {*{#1}{|>{\PBS\raggedright\hspace{0pt}}p{\the\tmplength}}|} +} +{\end{tabular*}\par} +\newcommand{\entrylabel}[1]{ + {\parbox[b]{\labelwidth-4pt}{\makebox[0pt][l]{\textbf{#1}}\vspace{1.5\baselineskip}}}} +\newenvironment{Desc} +{\begin{list}{} + { + \settowidth{\labelwidth}{40pt} + \setlength{\leftmargin}{\labelwidth} + \setlength{\parsep}{0pt} + \setlength{\itemsep}{-4pt} + \renewcommand{\makelabel}{\entrylabel} + } +} +{\end{list}} +\newenvironment{Indent} + {\begin{list}{}{\setlength{\leftmargin}{0.5cm}} + \item[]\ignorespaces} + {\unskip\end{list}} +\setlength{\parindent}{0cm} +\setlength{\parskip}{0.2cm} +\addtocounter{secnumdepth}{1} +\sloppy +\usepackage[T1]{fontenc} diff --git a/slsDetectorSoftware/docs/latex/eigerDetector_8h.tex b/slsDetectorSoftware/docs/latex/eigerDetector_8h.tex new file mode 100644 index 000000000..10fabb537 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/eigerDetector_8h.tex @@ -0,0 +1,8 @@ +\section{eiger\-Detector/eiger\-Detector.h File Reference} +\label{eigerDetector_8h}\index{eigerDetector/eigerDetector.h@{eigerDetector/eigerDetector.h}} +{\tt \#include \char`\"{}sls\-Detector.h\char`\"{}}\par +\subsection*{Classes} +\begin{CompactItemize} +\item +class \bf{eiger\-Detector} +\begin{CompactList}\small\item\em This is class contains all eiger specific functionalities. \item\end{CompactList}\end{CompactItemize} diff --git a/slsDetectorSoftware/docs/latex/files.tex b/slsDetectorSoftware/docs/latex/files.tex new file mode 100644 index 000000000..5276624a4 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/files.tex @@ -0,0 +1,12 @@ +\section{File List} +Here is a list of all files with brief descriptions:\begin{CompactList} +\item\contentsline{section}{common\-Files/\bf{sls\_\-detector\_\-defs.h} }{\pageref{sls__detector__defs_8h}}{} +\item\contentsline{section}{eiger\-Detector/\bf{eiger\-Detector.h} }{\pageref{eigerDetector_8h}}{} +\item\contentsline{section}{My\-Socket\-TCP/\bf{My\-Socket\-TCP.cxx} }{\pageref{MySocketTCP_8cxx}}{} +\item\contentsline{section}{My\-Socket\-TCP/\bf{My\-Socket\-TCP.h} }{\pageref{MySocketTCP_8h}}{} +\item\contentsline{section}{mythen\-Detector/\bf{mythen\-Detector.h} }{\pageref{mythenDetector_8h}}{} +\item\contentsline{section}{sls\-Detector/\bf{sls\-Detector.cpp} }{\pageref{slsDetector_8cpp}}{} +\item\contentsline{section}{sls\-Detector/\bf{sls\-Detector.h} }{\pageref{slsDetector_8h}}{} +\item\contentsline{section}{users\-Functions/\bf{users\-Functions.c} }{\pageref{usersFunctions_8c}}{} +\item\contentsline{section}{users\-Functions/\bf{users\-Functions.h} }{\pageref{usersFunctions_8h}}{} +\end{CompactList} diff --git a/slsDetectorSoftware/docs/latex/hierarchy.tex b/slsDetectorSoftware/docs/latex/hierarchy.tex new file mode 100644 index 000000000..20def11ea --- /dev/null +++ b/slsDetectorSoftware/docs/latex/hierarchy.tex @@ -0,0 +1,16 @@ +\section{Class Hierarchy} +This inheritance list is sorted roughly, but not completely, alphabetically:\begin{CompactList} +\item \contentsline{section}{angle\-Conversion\-Constant}{\pageref{structangleConversionConstant}}{} +\item \contentsline{section}{iarray}{\pageref{structiarray}}{} +\item \contentsline{section}{My\-Socket\-TCP}{\pageref{classMySocketTCP}}{} +\item \contentsline{section}{ROI}{\pageref{structROI}}{} +\item \contentsline{section}{sls\_\-detector\_\-channel}{\pageref{structsls__detector__channel}}{} +\item \contentsline{section}{sls\_\-detector\_\-chip}{\pageref{structsls__detector__chip}}{} +\item \contentsline{section}{sls\_\-detector\_\-module}{\pageref{structsls__detector__module}}{} +\item \contentsline{section}{sls\-Detector}{\pageref{classslsDetector}}{} +\begin{CompactList} +\item \contentsline{section}{eiger\-Detector}{\pageref{classeigerDetector}}{} +\item \contentsline{section}{mythen\-Detector}{\pageref{classmythenDetector}}{} +\end{CompactList} +\item \contentsline{section}{sls\-Detector::shared\-Sls\-Detector}{\pageref{structslsDetector_1_1sharedSlsDetector}}{} +\end{CompactList} diff --git a/slsDetectorSoftware/docs/latex/index.tex b/slsDetectorSoftware/docs/latex/index.tex new file mode 100644 index 000000000..937b3c404 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/index.tex @@ -0,0 +1,11 @@ +\section{Introduction}\label{index_intro_sec} +\subsection{Motivation}\label{index_mot_sec} +Although the SLS detectors group delvelops several types of detectors (1/2D, counting/integrating etc.) it is common interest of the group to use a common platfor for data acquisition \subsection{System Architecture}\label{index_arch_sec} +The architecture of the acquisitions system is intended as follows: \begin{itemize} +\item A socket server running on the detector (or more than one in some special cases) \item C++ classes common to all detectors for client-server communication. These can be supplied to users as libraries and embedded also in acquisition systems which are not developed by the SLS\begin{Desc} +\item[See also:]\doxyref{My\-Socket\-TCP}{p.}{classMySocketTCP} \doxyref{sls\-Detector}{p.}{classslsDetector} \end{Desc} +\item the possibility of using a Qt-based graphical user interface (with eventually root analisys capabilities) \item the possibility of runnin alla commands from command line. In order to ensure a fast operation of this so called \char`\"{}text client\char`\"{} the detector parameters should not be re-initialized everytime. For this reason a shared memory block is allocated where the main detector flags and parameters are stored\begin{Desc} +\item[See also:]\doxyref{sls\-Detector::shared\-Sls\-Detector}{p.}{structslsDetector_1_1sharedSlsDetector}\end{Desc} +\begin{Desc} +\item[Author:]Anna Bergamaschi \end{Desc} +\end{itemize} diff --git a/slsDetectorSoftware/docs/latex/mythenDetector_8h.tex b/slsDetectorSoftware/docs/latex/mythenDetector_8h.tex new file mode 100644 index 000000000..cc3a0d908 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/mythenDetector_8h.tex @@ -0,0 +1,8 @@ +\section{mythen\-Detector/mythen\-Detector.h File Reference} +\label{mythenDetector_8h}\index{mythenDetector/mythenDetector.h@{mythenDetector/mythenDetector.h}} +{\tt \#include \char`\"{}sls\-Detector.h\char`\"{}}\par +\subsection*{Classes} +\begin{CompactItemize} +\item +class \bf{mythen\-Detector} +\begin{CompactList}\small\item\em This calss contains all mythen specific functions. \item\end{CompactList}\end{CompactItemize} diff --git a/slsDetectorSoftware/docs/latex/namespaces.tex b/slsDetectorSoftware/docs/latex/namespaces.tex new file mode 100644 index 000000000..c2ca33382 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/namespaces.tex @@ -0,0 +1,4 @@ +\section{Namespace List} +Here is a list of all namespaces with brief descriptions:\begin{CompactList} +\item\contentsline{section}{\bf{std} }{\pageref{namespacestd}}{} +\end{CompactList} diff --git a/slsDetectorSoftware/docs/latex/namespacestd.tex b/slsDetectorSoftware/docs/latex/namespacestd.tex new file mode 100644 index 000000000..a1732dd75 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/namespacestd.tex @@ -0,0 +1,4 @@ +\section{std Namespace Reference} +\label{namespacestd}\index{std@{std}} + + diff --git a/slsDetectorSoftware/docs/latex/pages.tex b/slsDetectorSoftware/docs/latex/pages.tex new file mode 100644 index 000000000..8e47737da --- /dev/null +++ b/slsDetectorSoftware/docs/latex/pages.tex @@ -0,0 +1,5 @@ +\section{Related Pages} +Here is a list of all related documentation pages:\begin{CompactList} +\item \contentsline{section}{Bug List}{\pageref{bug}}{} + +\end{CompactList} diff --git a/slsDetectorSoftware/docs/latex/refman.tex b/slsDetectorSoftware/docs/latex/refman.tex new file mode 100644 index 000000000..d8b5658a3 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/refman.tex @@ -0,0 +1,69 @@ +\documentclass[a4paper]{book} +\usepackage{a4wide} +\usepackage{makeidx} +\usepackage{fancyhdr} +\usepackage{graphicx} +\usepackage{multicol} +\usepackage{float} +\usepackage{textcomp} +\usepackage{alltt} +\usepackage{doxygen} +\makeindex +\setcounter{tocdepth}{1} +\renewcommand{\footrulewidth}{0.4pt} +\begin{document} +\begin{titlepage} +\vspace*{7cm} +\begin{center} +{\Large Reference Manual}\\ +\vspace*{1cm} +{\large Generated by Doxygen 1.4.7}\\ +\vspace*{0.5cm} +{\small Fri Oct 9 16:01:04 2009}\\ +\end{center} +\end{titlepage} +\clearemptydoublepage +\pagenumbering{roman} +\tableofcontents +\clearemptydoublepage +\pagenumbering{arabic} +\chapter{Common C++ library for SLS detectors data acquisition } +\label{index}\input{index} +\chapter{Namespace Index} +\input{namespaces} +\chapter{Hierarchical Index} +\input{hierarchy} +\chapter{Class Index} +\input{annotated} +\chapter{File Index} +\input{files} +\chapter{Page Index} +\input{pages} +\chapter{Namespace Documentation} +\input{namespacestd} +\chapter{Class Documentation} +\input{structangleConversionConstant} +\include{classeigerDetector} +\include{structiarray} +\include{classMySocketTCP} +\include{classmythenDetector} +\include{structROI} +\include{structsls__detector__channel} +\include{structsls__detector__chip} +\include{structsls__detector__module} +\include{classslsDetector} +\include{structslsDetector_1_1sharedSlsDetector} +\chapter{File Documentation} +\input{sls__detector__defs_8h} +\include{eigerDetector_8h} +\include{MySocketTCP_8cxx} +\include{MySocketTCP_8h} +\include{mythenDetector_8h} +\include{slsDetector_8cpp} +\include{slsDetector_8h} +\include{usersFunctions_8c} +\include{usersFunctions_8h} +\chapter{Page Documentation} +\input{bug} +\printindex +\end{document} diff --git a/slsDetectorSoftware/docs/latex/slsDetector_8cpp.tex b/slsDetectorSoftware/docs/latex/slsDetector_8cpp.tex new file mode 100644 index 000000000..3d5daf12f --- /dev/null +++ b/slsDetectorSoftware/docs/latex/slsDetector_8cpp.tex @@ -0,0 +1,7 @@ +\section{sls\-Detector/sls\-Detector.cpp File Reference} +\label{slsDetector_8cpp}\index{slsDetector/slsDetector.cpp@{slsDetector/slsDetector.cpp}} +{\tt \#include \char`\"{}sls\-Detector.h\char`\"{}}\par +{\tt \#include \char`\"{}users\-Functions.h\char`\"{}}\par +{\tt \#include $<$sys/types.h$>$}\par +{\tt \#include $<$sys/ipc.h$>$}\par +{\tt \#include $<$sys/shm.h$>$}\par diff --git a/slsDetectorSoftware/docs/latex/slsDetector_8h.tex b/slsDetectorSoftware/docs/latex/slsDetector_8h.tex new file mode 100644 index 000000000..3e9098bf3 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/slsDetector_8h.tex @@ -0,0 +1,126 @@ +\section{sls\-Detector/sls\-Detector.h File Reference} +\label{slsDetector_8h}\index{slsDetector/slsDetector.h@{slsDetector/slsDetector.h}} +{\tt \#include \char`\"{}My\-Socket\-TCP.h\char`\"{}}\par +{\tt \#include $<$iostream$>$}\par +{\tt \#include $<$fstream$>$}\par +{\tt \#include $<$iomanip$>$}\par +{\tt \#include $<$cstring$>$}\par +{\tt \#include $<$string$>$}\par +{\tt \#include $<$sstream$>$}\par +{\tt \#include $<$queue$>$}\par +{\tt \#include $<$pthread.h$>$}\par +{\tt \#include $<$fcntl.h$>$}\par +{\tt \#include $<$unistd.h$>$}\par +{\tt \#include $<$sys/stat.h$>$}\par +{\tt \#include $<$sys/types.h$>$}\par +{\tt \#include $<$sys/uio.h$>$}\par +{\tt \#include \char`\"{}sls\_\-detector\_\-defs.h\char`\"{}}\par +\subsection*{Namespaces} +\begin{CompactItemize} +\item +namespace \bf{std} +\end{CompactItemize} +\subsection*{Classes} +\begin{CompactItemize} +\item +class \bf{sls\-Detector} +\begin{CompactList}\small\item\em This is the base class for all SLS detector functionalities. \item\end{CompactList}\item +struct \bf{sls\-Detector::shared\-Sls\-Detector} +\begin{CompactList}\small\item\em Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!). \item\end{CompactList}\end{CompactItemize} +\subsection*{Defines} +\begin{CompactItemize} +\item +\#define \bf{MAX\_\-TIMERS}~10 +\item +\#define \bf{MAX\_\-ROIS}~100 +\item +\#define \bf{MAX\_\-BADCHANS}~2000 +\item +\#define \bf{MAXPOS}~50 +\item +\#define \bf{NMODMAXX}~24 +\item +\#define \bf{NMODMAXY}~24 +\item +\#define \bf{MAXMODS}~36 +\item +\#define \bf{NCHIPSMAX}~10 +\item +\#define \bf{NCHANSMAX}~65536 +\item +\#define \bf{NDACSMAX}~16 +\item +\#define \bf{DEFAULT\_\-HOSTNAME}~\char`\"{}localhost\char`\"{} +\item +\#define \bf{DEFAULT\_\-SHM\_\-KEY}~5678 +\item +\#define \bf{default\-TDead}~\{170,90,750\} +\end{CompactItemize} + + +\subsection{Define Documentation} +\index{slsDetector.h@{sls\-Detector.h}!DEFAULT_HOSTNAME@{DEFAULT\_\-HOSTNAME}} +\index{DEFAULT_HOSTNAME@{DEFAULT\_\-HOSTNAME}!slsDetector.h@{sls\-Detector.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define DEFAULT\_\-HOSTNAME~\char`\"{}localhost\char`\"{}}\label{slsDetector_8h_cbd0b3def6b58577376d5c5edbc1f8d1} + + +\index{slsDetector.h@{sls\-Detector.h}!DEFAULT_SHM_KEY@{DEFAULT\_\-SHM\_\-KEY}} +\index{DEFAULT_SHM_KEY@{DEFAULT\_\-SHM\_\-KEY}!slsDetector.h@{sls\-Detector.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define DEFAULT\_\-SHM\_\-KEY~5678}\label{slsDetector_8h_c5cee1b5d2ab5671b3ec6e9ca2bf9fad} + + +\index{slsDetector.h@{sls\-Detector.h}!defaultTDead@{defaultTDead}} +\index{defaultTDead@{defaultTDead}!slsDetector.h@{sls\-Detector.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define default\-TDead~\{170,90,750\}}\label{slsDetector_8h_082faba3de8ce8379e160e3067333d14} + + +\index{slsDetector.h@{sls\-Detector.h}!MAX_BADCHANS@{MAX\_\-BADCHANS}} +\index{MAX_BADCHANS@{MAX\_\-BADCHANS}!slsDetector.h@{sls\-Detector.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define MAX\_\-BADCHANS~2000}\label{slsDetector_8h_458ac030ac964822b06ae7659da870df} + + +\index{slsDetector.h@{sls\-Detector.h}!MAX_ROIS@{MAX\_\-ROIS}} +\index{MAX_ROIS@{MAX\_\-ROIS}!slsDetector.h@{sls\-Detector.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define MAX\_\-ROIS~100}\label{slsDetector_8h_4c84515c2af98fbe570b5201a1022103} + + +\index{slsDetector.h@{sls\-Detector.h}!MAX_TIMERS@{MAX\_\-TIMERS}} +\index{MAX_TIMERS@{MAX\_\-TIMERS}!slsDetector.h@{sls\-Detector.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define MAX\_\-TIMERS~10}\label{slsDetector_8h_79fd3eac646964332ed33ec7dd40f208} + + +\index{slsDetector.h@{sls\-Detector.h}!MAXMODS@{MAXMODS}} +\index{MAXMODS@{MAXMODS}!slsDetector.h@{sls\-Detector.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define MAXMODS~36}\label{slsDetector_8h_86d84e5a6918e1cb1e2ecb75752e604a} + + +\index{slsDetector.h@{sls\-Detector.h}!MAXPOS@{MAXPOS}} +\index{MAXPOS@{MAXPOS}!slsDetector.h@{sls\-Detector.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define MAXPOS~50}\label{slsDetector_8h_361088f7869d8e7c123b003e817915a5} + + +\index{slsDetector.h@{sls\-Detector.h}!NCHANSMAX@{NCHANSMAX}} +\index{NCHANSMAX@{NCHANSMAX}!slsDetector.h@{sls\-Detector.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define NCHANSMAX~65536}\label{slsDetector_8h_1796142de2f82d4c3e10632bddde99f7} + + +\index{slsDetector.h@{sls\-Detector.h}!NCHIPSMAX@{NCHIPSMAX}} +\index{NCHIPSMAX@{NCHIPSMAX}!slsDetector.h@{sls\-Detector.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define NCHIPSMAX~10}\label{slsDetector_8h_13d24767ba1933e7367908de888f831a} + + +\index{slsDetector.h@{sls\-Detector.h}!NDACSMAX@{NDACSMAX}} +\index{NDACSMAX@{NDACSMAX}!slsDetector.h@{sls\-Detector.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define NDACSMAX~16}\label{slsDetector_8h_4460877d434c3a8731bb4beb20a2e256} + + +\index{slsDetector.h@{sls\-Detector.h}!NMODMAXX@{NMODMAXX}} +\index{NMODMAXX@{NMODMAXX}!slsDetector.h@{sls\-Detector.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define NMODMAXX~24}\label{slsDetector_8h_21b1e82005e7fb5d8c0539e47ae25b01} + + +\index{slsDetector.h@{sls\-Detector.h}!NMODMAXY@{NMODMAXY}} +\index{NMODMAXY@{NMODMAXY}!slsDetector.h@{sls\-Detector.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define NMODMAXY~24}\label{slsDetector_8h_4454335271010cc7a932117cbf3f1be1} + + diff --git a/slsDetectorSoftware/docs/latex/sls__detector__defs_8h.tex b/slsDetectorSoftware/docs/latex/sls__detector__defs_8h.tex new file mode 100644 index 000000000..3fa906e5a --- /dev/null +++ b/slsDetectorSoftware/docs/latex/sls__detector__defs_8h.tex @@ -0,0 +1,830 @@ +\section{common\-Files/sls\_\-detector\_\-defs.h File Reference} +\label{sls__detector__defs_8h}\index{commonFiles/sls_detector_defs.h@{commonFiles/sls\_\-detector\_\-defs.h}} +{\tt \#include $<$stdint.h$>$}\par +\subsection*{Classes} +\begin{CompactItemize} +\item +struct \bf{sls\_\-detector\_\-channel} +\item +struct \bf{sls\_\-detector\_\-chip} +\item +struct \bf{sls\_\-detector\_\-module} +\item +struct \bf{ROI} +\item +struct \bf{iarray} +\item +struct \bf{angle\-Conversion\-Constant} +\end{CompactItemize} +\subsection*{Defines} +\begin{CompactItemize} +\item +\#define \bf{MAX\_\-STR\_\-LENGTH}~1000 +\item +\#define \bf{GET\_\-FLAG}~-1 +\end{CompactItemize} +\subsection*{Enumerations} +\begin{CompactItemize} +\item +enum \bf{detector\-Type} \{ \par +\bf{GET\_\-DETECTOR\_\-TYPE}, +\bf{GENERIC}, +\bf{MYTHEN}, +\bf{PILATUS}, +\par +\bf{EIGER}, +\bf{GOTTHARD}, +\bf{AGIPD} + \} +\item +enum \bf{communication\-Protocol} \{ \bf{TCP}, +\bf{UDP} + \} +\item +enum \bf{number\-Of} \{ \par +\bf{MAXMODX}, +\bf{MAXMODY}, +\bf{NMODX}, +\bf{NMODY}, +\par +\bf{NCHANSX}, +\bf{NCHANSY}, +\bf{NCHIPSX}, +\bf{NCHIPSY} + \} +\item +enum \bf{dimension} \{ \bf{X} = 0, +\bf{Y} = 1, +\bf{Z} = 2 + \} +\item +enum \{ \bf{OK}, +\bf{FAIL} + \} +\item +enum \{ \bf{DISABLED}, +\bf{ENABLED} + \} +\item +enum \bf{external\-Signal\-Flag} \{ \par +\bf{GET\_\-EXTERNAL\_\-SIGNAL\_\-FLAG}, +\bf{SIGNAL\_\-OFF}, +\bf{GATE\_\-IN\_\-ACTIVE\_\-HIGH}, +\bf{GATE\_\-IN\_\-ACTIVE\_\-LOW}, +\par +\bf{TRIGGER\_\-IN\_\-RISING\_\-EDGE}, +\bf{TRIGGER\_\-IN\_\-FALLING\_\-EDGE}, +\bf{RO\_\-TRIGGER\_\-IN\_\-RISING\_\-EDGE}, +\bf{RO\_\-TRIGGER\_\-IN\_\-FALLING\_\-EDGE}, +\par +\bf{GATE\_\-OUT\_\-ACTIVE\_\-HIGH}, +\bf{GATE\_\-OUT\_\-ACTIVE\_\-LOW}, +\bf{TRIGGER\_\-OUT\_\-RISING\_\-EDGE}, +\bf{TRIGGER\_\-OUT\_\-FALLING\_\-EDGE}, +\par +\bf{RO\_\-TRIGGER\_\-OUT\_\-RISING\_\-EDGE}, +\bf{RO\_\-TRIGGER\_\-OUT\_\-FALLING\_\-EDGE} + \} +\item +enum \bf{external\-Communication\-Mode} \{ \par +\bf{GET\_\-EXTERNAL\_\-COMMUNICATION\_\-MODE}, +\bf{AUTO}, +\bf{TRIGGER\_\-EXPOSURE}, +\bf{TRIGGER\_\-READOUT}, +\par +\bf{TRIGGER\_\-COINCIDENCE\_\-WITH\_\-INTERNAL\_\-ENABLE}, +\bf{GATE\_\-FIX\_\-NUMBER}, +\bf{GATE\_\-FIX\_\-DURATION}, +\bf{GATE\_\-WITH\_\-START\_\-TRIGGER}, +\par +\bf{GATE\_\-COINCIDENCE\_\-WITH\_\-INTERNAL\_\-ENABLE} + \} +\item +enum \bf{id\-Mode} \{ \par +\bf{MODULE\_\-SERIAL\_\-NUMBER}, +\bf{MODULE\_\-FIRMWARE\_\-VERSION}, +\bf{DETECTOR\_\-SERIAL\_\-NUMBER}, +\bf{DETECTOR\_\-FIRMWARE\_\-VERSION}, +\par +\bf{DETECTOR\_\-SOFTWARE\_\-VERSION}, +\bf{THIS\_\-SOFTWARE\_\-VERSION} + \} +\item +enum \bf{digital\-Test\-Mode} \{ \par +\bf{CHIP\_\-TEST}, +\bf{MODULE\_\-FIRMWARE\_\-TEST}, +\bf{DETECTOR\_\-FIRMWARE\_\-TEST}, +\bf{DETECTOR\_\-MEMORY\_\-TEST}, +\par +\bf{DETECTOR\_\-BUS\_\-TEST}, +\bf{DETECTOR\_\-SOFTWARE\_\-TEST} + \} +\item +enum \bf{analog\-Test\-Mode} \{ \bf{CALIBRATION\_\-PULSES}, +\bf{MY\_\-ANALOG\_\-TEST\_\-MODE} + \} +\item +enum \bf{dac\-Index} \{ \par +\bf{THRESHOLD}, +\bf{CALIBRATION\_\-PULSE}, +\bf{TRIMBIT\_\-SIZE}, +\bf{PREAMP}, +\par +\bf{SHAPER1}, +\bf{SHAPER2}, +\bf{TEMPERATURE}, +\bf{HUMIDITY}, +\par +\bf{DETECTOR\_\-BIAS} + \} +\item +enum \bf{detector\-Settings} \{ \par +\bf{GET\_\-SETTINGS} = -1, +\bf{STANDARD}, +\bf{FAST}, +\bf{HIGHGAIN}, +\par +\bf{UNDEFINED}, +\bf{UNINITIALIZED} + \} +\item +enum \bf{channel\-Register\-Bit} \{ \bf{TRIMBIT\_\-OFF}, +\bf{COMPARATOR\_\-ENABLE} = 0x100, +\bf{ANALOG\_\-SIGNAL\_\-ENABLE} = 0x200, +\bf{CALIBRATION\_\-ENABLE} = 0x300 + \} +\item +enum \bf{chip\-Register\-Bit} \{ \bf{ENABLE\_\-ANALOG\_\-OUTPUT} = 0x1, +\bf{CHIP\_\-OUTPUT\_\-WIDTH} = 0x2 + \} +\item +enum \bf{module\-Register\-Bit} \{ \bf{MY\_\-MODULE\_\-REGISTER\_\-BIT}, +\bf{MODULE\_\-OUTPUT\_\-WIDTH} + \} +\item +enum \bf{timer\-Index} \{ \par +\bf{FRAME\_\-NUMBER}, +\bf{ACQUISITION\_\-TIME}, +\bf{FRAME\_\-PERIOD}, +\bf{DELAY\_\-AFTER\_\-TRIGGER}, +\par +\bf{GATES\_\-NUMBER}, +\bf{PROBES\_\-NUMBER}, +\bf{CYCLES\_\-NUMBER} + \} +\item +enum \bf{read\-Out\-Flags} \{ \par +\bf{GET\_\-READOUT\_\-FLAGS} = -1, +\bf{NORMAL\_\-READOUT} = 0, +\bf{STORE\_\-IN\_\-RAM} = 0x1, +\bf{READ\_\-HITS} = 0x2, +\par +\bf{ZERO\_\-COMPRESSION} = 0x4, +\bf{PUMP\_\-PROBE\_\-MODE} = 0x8, +\bf{BACKGROUND\_\-CORRECTIONS} = 0x1000 + \} +\item +enum \bf{trim\-Mode} \{ \par +\bf{NOISE\_\-TRIMMING}, +\bf{BEAM\_\-TRIMMING}, +\bf{IMPROVE\_\-TRIMMING}, +\bf{FIXEDSETTINGS\_\-TRIMMING}, +\par +\bf{OFFLINE\_\-TRIMMING} + \} +\item +enum \bf{correction\-Flags} \{ \par +\bf{DISCARD\_\-BAD\_\-CHANNELS}, +\bf{AVERAGE\_\-NEIGHBOURS\_\-FOR\_\-BAD\_\-CHANNELS}, +\bf{FLAT\_\-FIELD\_\-CORRECTION}, +\bf{RATE\_\-CORRECTION}, +\par +\bf{ANGULAR\_\-CONVERSION}, +\bf{I0\_\-NORMALIZATION} + \} +\item +enum \{ \par +\bf{F\_\-EXEC\_\-COMMAND}, +\bf{F\_\-GET\_\-ERROR}, +\bf{F\_\-GET\_\-DETECTOR\_\-TYPE}, +\bf{F\_\-SET\_\-NUMBER\_\-OF\_\-MODULES}, +\par +\bf{F\_\-GET\_\-MAX\_\-NUMBER\_\-OF\_\-MODULES}, +\bf{F\_\-SET\_\-EXTERNAL\_\-SIGNAL\_\-FLAG}, +\bf{F\_\-SET\_\-EXTERNAL\_\-COMMUNICATION\_\-MODE}, +\bf{F\_\-GET\_\-ID}, +\par +\bf{F\_\-DIGITAL\_\-TEST}, +\bf{F\_\-ANALOG\_\-TEST}, +\bf{F\_\-ENABLE\_\-ANALOG\_\-OUT}, +\bf{F\_\-CALIBRATION\_\-PULSE}, +\par +\bf{F\_\-SET\_\-DAC}, +\bf{F\_\-GET\_\-ADC}, +\bf{F\_\-WRITE\_\-REGISTER}, +\bf{F\_\-READ\_\-REGISTER}, +\par +\bf{F\_\-WRITE\_\-MEMORY}, +\bf{F\_\-READ\_\-MEMORY}, +\bf{F\_\-SET\_\-CHANNEL}, +\bf{F\_\-GET\_\-CHANNEL}, +\par +\bf{F\_\-SET\_\-ALL\_\-CHANNELS}, +\bf{F\_\-SET\_\-CHIP}, +\bf{F\_\-GET\_\-CHIP}, +\bf{F\_\-SET\_\-ALL\_\-CHIPS}, +\par +\bf{F\_\-SET\_\-MODULE}, +\bf{F\_\-GET\_\-MODULE}, +\bf{F\_\-SET\_\-ALL\_\-MODULES}, +\bf{F\_\-SET\_\-SETTINGS}, +\par +\bf{F\_\-GET\_\-THRESHOLD\_\-ENERGY}, +\bf{F\_\-SET\_\-THRESHOLD\_\-ENERGY}, +\bf{F\_\-START\_\-ACQUISITION}, +\bf{F\_\-STOP\_\-ACQUISITION}, +\par +\bf{F\_\-START\_\-READOUT}, +\bf{F\_\-GET\_\-RUN\_\-STATUS}, +\bf{F\_\-START\_\-AND\_\-READ\_\-ALL}, +\bf{F\_\-READ\_\-FRAME}, +\par +\bf{F\_\-READ\_\-ALL}, +\bf{F\_\-SET\_\-TIMER}, +\bf{F\_\-GET\_\-TIME\_\-LEFT}, +\bf{F\_\-SET\_\-DYNAMIC\_\-RANGE}, +\par +\bf{F\_\-SET\_\-READOUT\_\-FLAGS}, +\bf{F\_\-SET\_\-ROI}, +\bf{F\_\-EXECUTE\_\-TRIMMING}, +\bf{F\_\-EXIT\_\-SERVER} + \} +\end{CompactItemize} + + +\subsection{Detailed Description} +This file contains all the basic definitions common to the \doxyref{sls\-Detector}{p.}{classslsDetector} class and to the server programs running on the detector + +\begin{Desc} +\item[Author:]Anna Bergamaschi \end{Desc} +\begin{Desc} +\item[Version:]0.1alpha (any string) \end{Desc} +\begin{Desc} +\item[See also:]\doxyref{sls\-Detector}{p.}{classslsDetector} \end{Desc} + + +\subsection{Define Documentation} +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GET_FLAG@{GET\_\-FLAG}} +\index{GET_FLAG@{GET\_\-FLAG}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define GET\_\-FLAG~-1}\label{sls__detector__defs_8h_60fde43090da359538468c00f02f7468} + + +get flag form most functions \index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!MAX_STR_LENGTH@{MAX\_\-STR\_\-LENGTH}} +\index{MAX_STR_LENGTH@{MAX\_\-STR\_\-LENGTH}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define MAX\_\-STR\_\-LENGTH~1000}\label{sls__detector__defs_8h_aa695591372841e2c5580e4ed0f3620f} + + +default maximum string length + +\subsection{Enumeration Type Documentation} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}anonymous enum}\label{sls__detector__defs_8h_df764cbdea00d65edcd07bb9953ad2b7} + + +return values \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{OK@{OK}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!OK@{OK}}\item[{\em +OK\label{sls__detector__defs_8h_df764cbdea00d65edcd07bb9953ad2b72bc49ec37d6a5715dd23e85f1ff5bb59} +}]function succeeded \index{FAIL@{FAIL}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!FAIL@{FAIL}}\item[{\em +FAIL\label{sls__detector__defs_8h_df764cbdea00d65edcd07bb9953ad2b7936c4a5547a9360243178f726f6b2715} +}]function failed \end{description} +\end{Desc} + +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}anonymous enum}\label{sls__detector__defs_8h_99fb83031ce9923c84392b4e92f956b5} + + +enable/disable flags \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{DISABLED@{DISABLED}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!DISABLED@{DISABLED}}\item[{\em +DISABLED\label{sls__detector__defs_8h_99fb83031ce9923c84392b4e92f956b540f39385238042f6ec0cbac821a19fc4} +}]flag disabled \index{ENABLED@{ENABLED}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!ENABLED@{ENABLED}}\item[{\em +ENABLED\label{sls__detector__defs_8h_99fb83031ce9923c84392b4e92f956b599788d1f27bac42d0c7bac63026c5959} +}]flag enabled \end{description} +\end{Desc} + +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}anonymous enum}\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04} + + +function indexes to call on the server + +All set functions with argument -1 work as get, when possible \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{F_EXEC_COMMAND@{F\_\-EXEC\_\-COMMAND}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_EXEC_COMMAND@{F\_\-EXEC\_\-COMMAND}}\item[{\em +F\_\-EXEC\_\-COMMAND\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04acf1bcd49d2b7eda1281016456867d9f} +}]command is executed \index{F_GET_ERROR@{F\_\-GET\_\-ERROR}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_GET_ERROR@{F\_\-GET\_\-ERROR}}\item[{\em +F\_\-GET\_\-ERROR\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b040a5592a0f9c22971094ade209bb261ed} +}]return detector error status \index{F_GET_DETECTOR_TYPE@{F\_\-GET\_\-DETECTOR\_\-TYPE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_GET_DETECTOR_TYPE@{F\_\-GET\_\-DETECTOR\_\-TYPE}}\item[{\em +F\_\-GET\_\-DETECTOR\_\-TYPE\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b0471fe1c1745b71dc1d2cd587499448aef} +}]return detector type \index{F_SET_NUMBER_OF_MODULES@{F\_\-SET\_\-NUMBER\_\-OF\_\-MODULES}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_SET_NUMBER_OF_MODULES@{F\_\-SET\_\-NUMBER\_\-OF\_\-MODULES}}\item[{\em +F\_\-SET\_\-NUMBER\_\-OF\_\-MODULES\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04ce397ed23bbf3676690ea908f56b19fc} +}]set/get number of installed modules \index{F_GET_MAX_NUMBER_OF_MODULES@{F\_\-GET\_\-MAX\_\-NUMBER\_\-OF\_\-MODULES}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_GET_MAX_NUMBER_OF_MODULES@{F\_\-GET\_\-MAX\_\-NUMBER\_\-OF\_\-MODULES}}\item[{\em +F\_\-GET\_\-MAX\_\-NUMBER\_\-OF\_\-MODULES\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b042907a2d768a27fa23c451b765b2a3d8c} +}]get maximum number of installed modules \index{F_SET_EXTERNAL_SIGNAL_FLAG@{F\_\-SET\_\-EXTERNAL\_\-SIGNAL\_\-FLAG}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_SET_EXTERNAL_SIGNAL_FLAG@{F\_\-SET\_\-EXTERNAL\_\-SIGNAL\_\-FLAG}}\item[{\em +F\_\-SET\_\-EXTERNAL\_\-SIGNAL\_\-FLAG\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04e63e8ef1b45e94cb3edcab1f25d0a054} +}]set/get flag for external signal \index{F_SET_EXTERNAL_COMMUNICATION_MODE@{F\_\-SET\_\-EXTERNAL\_\-COMMUNICATION\_\-MODE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_SET_EXTERNAL_COMMUNICATION_MODE@{F\_\-SET\_\-EXTERNAL\_\-COMMUNICATION\_\-MODE}}\item[{\em +F\_\-SET\_\-EXTERNAL\_\-COMMUNICATION\_\-MODE\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b0475d1afa4f092a4739ea07e070e1bdc2f} +}]set/get external communication mode (obsolete) \index{F_GET_ID@{F\_\-GET\_\-ID}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_GET_ID@{F\_\-GET\_\-ID}}\item[{\em +F\_\-GET\_\-ID\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b045680377f7bbe65d9b93cbe8a1d61a86e} +}]get detector id of version \index{F_DIGITAL_TEST@{F\_\-DIGITAL\_\-TEST}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_DIGITAL_TEST@{F\_\-DIGITAL\_\-TEST}}\item[{\em +F\_\-DIGITAL\_\-TEST\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04adfa4c2d73bebe2bc6b281682f95f2ab} +}]digital test of the detector \index{F_ANALOG_TEST@{F\_\-ANALOG\_\-TEST}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_ANALOG_TEST@{F\_\-ANALOG\_\-TEST}}\item[{\em +F\_\-ANALOG\_\-TEST\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b0474a791309be6a971e149de43d7b823cc} +}]analog test of the detector \index{F_ENABLE_ANALOG_OUT@{F\_\-ENABLE\_\-ANALOG\_\-OUT}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_ENABLE_ANALOG_OUT@{F\_\-ENABLE\_\-ANALOG\_\-OUT}}\item[{\em +F\_\-ENABLE\_\-ANALOG\_\-OUT\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b0406db86821502a3e4913c0415b6934900} +}]enable the analog output \index{F_CALIBRATION_PULSE@{F\_\-CALIBRATION\_\-PULSE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_CALIBRATION_PULSE@{F\_\-CALIBRATION\_\-PULSE}}\item[{\em +F\_\-CALIBRATION\_\-PULSE\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b047f2ffa2426f4300e2dd12bd48d9f78d5} +}]pulse the calibration input \index{F_SET_DAC@{F\_\-SET\_\-DAC}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_SET_DAC@{F\_\-SET\_\-DAC}}\item[{\em +F\_\-SET\_\-DAC\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b040643db32c526a491969139a7e0f5ae7e} +}]set DAC value \index{F_GET_ADC@{F\_\-GET\_\-ADC}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_GET_ADC@{F\_\-GET\_\-ADC}}\item[{\em +F\_\-GET\_\-ADC\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b047a4a21e3dfc12d28f2e0fbe758b8c197} +}]get ADC value \index{F_WRITE_REGISTER@{F\_\-WRITE\_\-REGISTER}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_WRITE_REGISTER@{F\_\-WRITE\_\-REGISTER}}\item[{\em +F\_\-WRITE\_\-REGISTER\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04044400bedd4ee1ed810047b0224e7bb3} +}]write to register \index{F_READ_REGISTER@{F\_\-READ\_\-REGISTER}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_READ_REGISTER@{F\_\-READ\_\-REGISTER}}\item[{\em +F\_\-READ\_\-REGISTER\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04906dee7968c4d532ab4edbee7b3498c3} +}]read register \index{F_WRITE_MEMORY@{F\_\-WRITE\_\-MEMORY}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_WRITE_MEMORY@{F\_\-WRITE\_\-MEMORY}}\item[{\em +F\_\-WRITE\_\-MEMORY\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04dc204e15e98fdde48155a662748b0928} +}]write to memory \index{F_READ_MEMORY@{F\_\-READ\_\-MEMORY}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_READ_MEMORY@{F\_\-READ\_\-MEMORY}}\item[{\em +F\_\-READ\_\-MEMORY\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b044d3871faeb398af86df38e04b756a3cd} +}]read memory \index{F_SET_CHANNEL@{F\_\-SET\_\-CHANNEL}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_SET_CHANNEL@{F\_\-SET\_\-CHANNEL}}\item[{\em +F\_\-SET\_\-CHANNEL\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04853cfee21b3f4f792c1f98538c2026c6} +}]initialize channel \index{F_GET_CHANNEL@{F\_\-GET\_\-CHANNEL}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_GET_CHANNEL@{F\_\-GET\_\-CHANNEL}}\item[{\em +F\_\-GET\_\-CHANNEL\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04ade5c4860f4d5a02b5c37d849c12e447} +}]get channel register \index{F_SET_ALL_CHANNELS@{F\_\-SET\_\-ALL\_\-CHANNELS}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_SET_ALL_CHANNELS@{F\_\-SET\_\-ALL\_\-CHANNELS}}\item[{\em +F\_\-SET\_\-ALL\_\-CHANNELS\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04cad18ffc92ef0d4b968f1c9db6d4de5a} +}]initialize all channels \index{F_SET_CHIP@{F\_\-SET\_\-CHIP}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_SET_CHIP@{F\_\-SET\_\-CHIP}}\item[{\em +F\_\-SET\_\-CHIP\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b0429285b14bc7075ea6c3c6cee2fd56b52} +}]initialize chip \index{F_GET_CHIP@{F\_\-GET\_\-CHIP}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_GET_CHIP@{F\_\-GET\_\-CHIP}}\item[{\em +F\_\-GET\_\-CHIP\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b041f50ac9ffcab0cbba655e61312d6edaf} +}]get chip status \index{F_SET_ALL_CHIPS@{F\_\-SET\_\-ALL\_\-CHIPS}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_SET_ALL_CHIPS@{F\_\-SET\_\-ALL\_\-CHIPS}}\item[{\em +F\_\-SET\_\-ALL\_\-CHIPS\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b047cfca529a0554a7b6f05522cca8a27e0} +}]initialize all chips \index{F_SET_MODULE@{F\_\-SET\_\-MODULE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_SET_MODULE@{F\_\-SET\_\-MODULE}}\item[{\em +F\_\-SET\_\-MODULE\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04d1d02f05ca4c405b09f483f9fef45873} +}]initialize module \index{F_GET_MODULE@{F\_\-GET\_\-MODULE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_GET_MODULE@{F\_\-GET\_\-MODULE}}\item[{\em +F\_\-GET\_\-MODULE\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b045d2a18e900b219f28fa032b9c292bbe5} +}]get module status \index{F_SET_ALL_MODULES@{F\_\-SET\_\-ALL\_\-MODULES}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_SET_ALL_MODULES@{F\_\-SET\_\-ALL\_\-MODULES}}\item[{\em +F\_\-SET\_\-ALL\_\-MODULES\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04ea90ca7e8125f792a23eb30077ba893c} +}]initialize all modules \index{F_SET_SETTINGS@{F\_\-SET\_\-SETTINGS}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_SET_SETTINGS@{F\_\-SET\_\-SETTINGS}}\item[{\em +F\_\-SET\_\-SETTINGS\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b0439a8b6036282448bc7c6fd0faf30a463} +}]set detector settings \index{F_GET_THRESHOLD_ENERGY@{F\_\-GET\_\-THRESHOLD\_\-ENERGY}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_GET_THRESHOLD_ENERGY@{F\_\-GET\_\-THRESHOLD\_\-ENERGY}}\item[{\em +F\_\-GET\_\-THRESHOLD\_\-ENERGY\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b045396bc12890e411a3be32878f416322f} +}]get detector threshold (in e\-V) \index{F_SET_THRESHOLD_ENERGY@{F\_\-SET\_\-THRESHOLD\_\-ENERGY}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_SET_THRESHOLD_ENERGY@{F\_\-SET\_\-THRESHOLD\_\-ENERGY}}\item[{\em +F\_\-SET\_\-THRESHOLD\_\-ENERGY\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b049e2292a7b1ab8f18319f7e3d470f05b9} +}]set detector threshold (in e\-V) \index{F_START_ACQUISITION@{F\_\-START\_\-ACQUISITION}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_START_ACQUISITION@{F\_\-START\_\-ACQUISITION}}\item[{\em +F\_\-START\_\-ACQUISITION\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b047d0a2ccaa1d35dc62086ec15db612a01} +}]start acquisition \index{F_STOP_ACQUISITION@{F\_\-STOP\_\-ACQUISITION}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_STOP_ACQUISITION@{F\_\-STOP\_\-ACQUISITION}}\item[{\em +F\_\-STOP\_\-ACQUISITION\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04ba1808f9e0157665f75481bfcf0dd2f4} +}]stop acquisition \index{F_START_READOUT@{F\_\-START\_\-READOUT}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_START_READOUT@{F\_\-START\_\-READOUT}}\item[{\em +F\_\-START\_\-READOUT\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b043439c86f9c711d2047e056ad65c47f19} +}]start readout \index{F_GET_RUN_STATUS@{F\_\-GET\_\-RUN\_\-STATUS}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_GET_RUN_STATUS@{F\_\-GET\_\-RUN\_\-STATUS}}\item[{\em +F\_\-GET\_\-RUN\_\-STATUS\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b049b087d96dcc3b71af1c7a5a7d6dcaca2} +}]get acquisition status \index{F_START_AND_READ_ALL@{F\_\-START\_\-AND\_\-READ\_\-ALL}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_START_AND_READ_ALL@{F\_\-START\_\-AND\_\-READ\_\-ALL}}\item[{\em +F\_\-START\_\-AND\_\-READ\_\-ALL\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04338f2b56171efe69e355f4d3f3b05705} +}]start acquisition and read all frames \index{F_READ_FRAME@{F\_\-READ\_\-FRAME}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_READ_FRAME@{F\_\-READ\_\-FRAME}}\item[{\em +F\_\-READ\_\-FRAME\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b0496e2bb3d9197e625107389e399a0c61e} +}]read one frame \index{F_READ_ALL@{F\_\-READ\_\-ALL}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_READ_ALL@{F\_\-READ\_\-ALL}}\item[{\em +F\_\-READ\_\-ALL\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b0494f2c609379952cd2185dfb79caf7b6c} +}]read alla frames \index{F_SET_TIMER@{F\_\-SET\_\-TIMER}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_SET_TIMER@{F\_\-SET\_\-TIMER}}\item[{\em +F\_\-SET\_\-TIMER\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04dc7c9efafcb1a98ae74823bc308dc6d7} +}]set/get timer value \index{F_GET_TIME_LEFT@{F\_\-GET\_\-TIME\_\-LEFT}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_GET_TIME_LEFT@{F\_\-GET\_\-TIME\_\-LEFT}}\item[{\em +F\_\-GET\_\-TIME\_\-LEFT\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04257f0576d6da0c5c4dab728a8f314ba1} +}]get current value of the timer (time left) \index{F_SET_DYNAMIC_RANGE@{F\_\-SET\_\-DYNAMIC\_\-RANGE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_SET_DYNAMIC_RANGE@{F\_\-SET\_\-DYNAMIC\_\-RANGE}}\item[{\em +F\_\-SET\_\-DYNAMIC\_\-RANGE\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b046a499edff53cb19d03ac27b4c80e05fe} +}]set/get detector dynamic range \index{F_SET_READOUT_FLAGS@{F\_\-SET\_\-READOUT\_\-FLAGS}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_SET_READOUT_FLAGS@{F\_\-SET\_\-READOUT\_\-FLAGS}}\item[{\em +F\_\-SET\_\-READOUT\_\-FLAGS\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b045cdaebc62f9748ce0f9822f381959307} +}]set/get readout flags \index{F_SET_ROI@{F\_\-SET\_\-ROI}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_SET_ROI@{F\_\-SET\_\-ROI}}\item[{\em +F\_\-SET\_\-ROI\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04132603d9b086fb1178fbbd143d6aa126} +}]set/get region of interest \index{F_EXECUTE_TRIMMING@{F\_\-EXECUTE\_\-TRIMMING}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_EXECUTE_TRIMMING@{F\_\-EXECUTE\_\-TRIMMING}}\item[{\em +F\_\-EXECUTE\_\-TRIMMING\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b045be80176327f8e6afd6954cc8fd0ceaa} +}]execute trimming \index{F_EXIT_SERVER@{F\_\-EXIT\_\-SERVER}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!F_EXIT_SERVER@{F\_\-EXIT\_\-SERVER}}\item[{\em +F\_\-EXIT\_\-SERVER\label{sls__detector__defs_8h_bc6126af1d45847bc59afa0aa3216b04acb4344788e1f1e3716216aeffc50beb} +}]turnoff detector server \end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!analogTestMode@{analogTestMode}} +\index{analogTestMode@{analogTestMode}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{analog\-Test\-Mode}}\label{sls__detector__defs_8h_44f69dfb7317afdfb166d178f4b1a6fe} + + +detector analogue test modes \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{CALIBRATION_PULSES@{CALIBRATION\_\-PULSES}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!CALIBRATION_PULSES@{CALIBRATION\_\-PULSES}}\item[{\em +CALIBRATION\_\-PULSES\label{sls__detector__defs_8h_44f69dfb7317afdfb166d178f4b1a6feb7166e45218dcb846a3bae04949664cc} +}]test using calibration pulses \index{MY_ANALOG_TEST_MODE@{MY\_\-ANALOG\_\-TEST\_\-MODE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!MY_ANALOG_TEST_MODE@{MY\_\-ANALOG\_\-TEST\_\-MODE}}\item[{\em +MY\_\-ANALOG\_\-TEST\_\-MODE\label{sls__detector__defs_8h_44f69dfb7317afdfb166d178f4b1a6feca252079af7f6b24588e086e6231ca8a} +}]other possible test modes \end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!channelRegisterBit@{channelRegisterBit}} +\index{channelRegisterBit@{channelRegisterBit}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{channel\-Register\-Bit}}\label{sls__detector__defs_8h_40dcd9999cf30431eee4b9b6bc9c1035} + + +meaning of the channel register bits \begin{Desc} +\item[See also:]\doxyref{sls\_\-detector\_\-channel}{p.}{structsls__detector__channel} \end{Desc} +\begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{TRIMBIT_OFF@{TRIMBIT\_\-OFF}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!TRIMBIT_OFF@{TRIMBIT\_\-OFF}}\item[{\em +TRIMBIT\_\-OFF\label{sls__detector__defs_8h_40dcd9999cf30431eee4b9b6bc9c103593167c3ea33f720e0b63a8083f226746} +}]offset of trimbit value in the channel register \index{COMPARATOR_ENABLE@{COMPARATOR\_\-ENABLE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!COMPARATOR_ENABLE@{COMPARATOR\_\-ENABLE}}\item[{\em +COMPARATOR\_\-ENABLE\label{sls__detector__defs_8h_40dcd9999cf30431eee4b9b6bc9c1035d0898f44b5cde12d97bc409ea8670b42} +}]mask of the comparator enable bit \index{ANALOG_SIGNAL_ENABLE@{ANALOG\_\-SIGNAL\_\-ENABLE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!ANALOG_SIGNAL_ENABLE@{ANALOG\_\-SIGNAL\_\-ENABLE}}\item[{\em +ANALOG\_\-SIGNAL\_\-ENABLE\label{sls__detector__defs_8h_40dcd9999cf30431eee4b9b6bc9c1035b8469af9d62148087e0c05af80446d06} +}]mask of the analogue output enable bit \index{CALIBRATION_ENABLE@{CALIBRATION\_\-ENABLE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!CALIBRATION_ENABLE@{CALIBRATION\_\-ENABLE}}\item[{\em +CALIBRATION\_\-ENABLE\label{sls__detector__defs_8h_40dcd9999cf30431eee4b9b6bc9c10355fd4f0793e4050ae41dc14c57bf6b0fd} +}]mask of the calibration input enable bit \end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!chipRegisterBit@{chipRegisterBit}} +\index{chipRegisterBit@{chipRegisterBit}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{chip\-Register\-Bit}}\label{sls__detector__defs_8h_4330afff337dd4db0fe7dcca1c75a642} + + +meaning of the chip register bits \begin{Desc} +\item[See also:]\doxyref{sls\_\-detector\_\-chip}{p.}{structsls__detector__chip} \end{Desc} +\begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{ENABLE_ANALOG_OUTPUT@{ENABLE\_\-ANALOG\_\-OUTPUT}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!ENABLE_ANALOG_OUTPUT@{ENABLE\_\-ANALOG\_\-OUTPUT}}\item[{\em +ENABLE\_\-ANALOG\_\-OUTPUT\label{sls__detector__defs_8h_4330afff337dd4db0fe7dcca1c75a642ff4c2a386240df8c5fd524fd111f2690} +}]mask of the analogue output enable bit \index{CHIP_OUTPUT_WIDTH@{CHIP\_\-OUTPUT\_\-WIDTH}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!CHIP_OUTPUT_WIDTH@{CHIP\_\-OUTPUT\_\-WIDTH}}\item[{\em +CHIP\_\-OUTPUT\_\-WIDTH\label{sls__detector__defs_8h_4330afff337dd4db0fe7dcca1c75a64239622440b29c2ebda0609b011bf0222a} +}]mask of the chip output width \end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!communicationProtocol@{communicationProtocol}} +\index{communicationProtocol@{communicationProtocol}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{communication\-Protocol}}\label{sls__detector__defs_8h_2347f410e21bee8cf0604c494727cc40} + + +Communication protocol (normally TCP) \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{TCP@{TCP}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!TCP@{TCP}}\item[{\em +TCP\label{sls__detector__defs_8h_2347f410e21bee8cf0604c494727cc40a040cd7feeb588104634cdadf35abf1c} +}]TCP/IP \index{UDP@{UDP}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!UDP@{UDP}}\item[{\em +UDP\label{sls__detector__defs_8h_2347f410e21bee8cf0604c494727cc40db542475cf9d0636e4225e216cee9ae6} +}]UDP \end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!correctionFlags@{correctionFlags}} +\index{correctionFlags@{correctionFlags}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{correction\-Flags}}\label{sls__detector__defs_8h_82ffddab533d21b3ef6733d38dfcd5c6} + + +data correction flags \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{DISCARD_BAD_CHANNELS@{DISCARD\_\-BAD\_\-CHANNELS}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!DISCARD_BAD_CHANNELS@{DISCARD\_\-BAD\_\-CHANNELS}}\item[{\em +DISCARD\_\-BAD\_\-CHANNELS\label{sls__detector__defs_8h_82ffddab533d21b3ef6733d38dfcd5c677bf327c7ae7b4ad48c23ed12f95bb59} +}]bad channels are discarded \index{AVERAGE_NEIGHBOURS_FOR_BAD_CHANNELS@{AVERAGE\_\-NEIGHBOURS\_\-FOR\_\-BAD\_\-CHANNELS}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!AVERAGE_NEIGHBOURS_FOR_BAD_CHANNELS@{AVERAGE\_\-NEIGHBOURS\_\-FOR\_\-BAD\_\-CHANNELS}}\item[{\em +AVERAGE\_\-NEIGHBOURS\_\-FOR\_\-BAD\_\-CHANNELS\label{sls__detector__defs_8h_82ffddab533d21b3ef6733d38dfcd5c6265434493f74b2d2c809e47f950f2d78} +}]bad channels are replaced with the avergae of the neighbours \index{FLAT_FIELD_CORRECTION@{FLAT\_\-FIELD\_\-CORRECTION}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!FLAT_FIELD_CORRECTION@{FLAT\_\-FIELD\_\-CORRECTION}}\item[{\em +FLAT\_\-FIELD\_\-CORRECTION\label{sls__detector__defs_8h_82ffddab533d21b3ef6733d38dfcd5c631b7127ca7eb9e444a53759571a4071c} +}]data are flat field corrected \index{RATE_CORRECTION@{RATE\_\-CORRECTION}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!RATE_CORRECTION@{RATE\_\-CORRECTION}}\item[{\em +RATE\_\-CORRECTION\label{sls__detector__defs_8h_82ffddab533d21b3ef6733d38dfcd5c6880654a033856e88167900204c3b594f} +}]data are rate corrected \index{ANGULAR_CONVERSION@{ANGULAR\_\-CONVERSION}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!ANGULAR_CONVERSION@{ANGULAR\_\-CONVERSION}}\item[{\em +ANGULAR\_\-CONVERSION\label{sls__detector__defs_8h_82ffddab533d21b3ef6733d38dfcd5c6508f65f1d2c1f86381bdabc994174f71} +}]angular conversion is calculated \index{I0_NORMALIZATION@{I0\_\-NORMALIZATION}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!I0_NORMALIZATION@{I0\_\-NORMALIZATION}}\item[{\em +I0\_\-NORMALIZATION\label{sls__detector__defs_8h_82ffddab533d21b3ef6733d38dfcd5c6a23c8c8970434df2e749fef0ad45089c} +}]\end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!dacIndex@{dacIndex}} +\index{dacIndex@{dacIndex}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{dac\-Index}}\label{sls__detector__defs_8h_049814e50aa3d3237f51a4d7185ad4fe} + + +detector dacs indexes \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{THRESHOLD@{THRESHOLD}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!THRESHOLD@{THRESHOLD}}\item[{\em +THRESHOLD\label{sls__detector__defs_8h_049814e50aa3d3237f51a4d7185ad4fe4b8d6cea1ac561b0b7bb443d586aae42} +}]comparator threshold level \index{CALIBRATION_PULSE@{CALIBRATION\_\-PULSE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!CALIBRATION_PULSE@{CALIBRATION\_\-PULSE}}\item[{\em +CALIBRATION\_\-PULSE\label{sls__detector__defs_8h_049814e50aa3d3237f51a4d7185ad4fe5b6080db80cc2d5d20846575c49be2dd} +}]calibration input pulse height \index{TRIMBIT_SIZE@{TRIMBIT\_\-SIZE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!TRIMBIT_SIZE@{TRIMBIT\_\-SIZE}}\item[{\em +TRIMBIT\_\-SIZE\label{sls__detector__defs_8h_049814e50aa3d3237f51a4d7185ad4fec47e6801124b48b808665e7e99fbd767} +}]voltage to determine the trimbits LSB \index{PREAMP@{PREAMP}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!PREAMP@{PREAMP}}\item[{\em +PREAMP\label{sls__detector__defs_8h_049814e50aa3d3237f51a4d7185ad4fe00b743a237d5bf65e71c4facc16da16d} +}]preamp feedback \index{SHAPER1@{SHAPER1}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!SHAPER1@{SHAPER1}}\item[{\em +SHAPER1\label{sls__detector__defs_8h_049814e50aa3d3237f51a4d7185ad4fee25b9acb794bf1fc71d225cf52a617e0} +}]shaper1 feedback \index{SHAPER2@{SHAPER2}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!SHAPER2@{SHAPER2}}\item[{\em +SHAPER2\label{sls__detector__defs_8h_049814e50aa3d3237f51a4d7185ad4feefd8ebb38bc91dd2d231e534b84ade4e} +}]shaper2 feedback \index{TEMPERATURE@{TEMPERATURE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!TEMPERATURE@{TEMPERATURE}}\item[{\em +TEMPERATURE\label{sls__detector__defs_8h_049814e50aa3d3237f51a4d7185ad4fec4ae6787ff1d8b2d1cf0ae9aa696e56c} +}]temperature sensor (adc) \index{HUMIDITY@{HUMIDITY}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!HUMIDITY@{HUMIDITY}}\item[{\em +HUMIDITY\label{sls__detector__defs_8h_049814e50aa3d3237f51a4d7185ad4fefe1d7174637f10c7cfd0ea9d785cf9f1} +}]humidity sensor (adc) \index{DETECTOR_BIAS@{DETECTOR\_\-BIAS}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!DETECTOR_BIAS@{DETECTOR\_\-BIAS}}\item[{\em +DETECTOR\_\-BIAS\label{sls__detector__defs_8h_049814e50aa3d3237f51a4d7185ad4fe173ae1ed29084e1d570d97796155d4a0} +}]detector bias \end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!detectorSettings@{detectorSettings}} +\index{detectorSettings@{detectorSettings}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{detector\-Settings}}\label{sls__detector__defs_8h_754e2e1fdf9e993405c39b6050528d56} + + +detector settings indexes \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{GET_SETTINGS@{GET\_\-SETTINGS}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GET_SETTINGS@{GET\_\-SETTINGS}}\item[{\em +GET\_\-SETTINGS\label{sls__detector__defs_8h_754e2e1fdf9e993405c39b6050528d56ebe806e2682b05129c75bfdc7a72932b} +}]return current detector settings \index{STANDARD@{STANDARD}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!STANDARD@{STANDARD}}\item[{\em +STANDARD\label{sls__detector__defs_8h_754e2e1fdf9e993405c39b6050528d569de934790934fe831fe946c851e8338e} +}]standard settings \index{FAST@{FAST}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!FAST@{FAST}}\item[{\em +FAST\label{sls__detector__defs_8h_754e2e1fdf9e993405c39b6050528d56f84c11ba888e499a8a282a3e6f5de7de} +}]fast settings \index{HIGHGAIN@{HIGHGAIN}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!HIGHGAIN@{HIGHGAIN}}\item[{\em +HIGHGAIN\label{sls__detector__defs_8h_754e2e1fdf9e993405c39b6050528d56e8fdbae775b9c89c864f7e62f3552167} +}]highgain settings \index{UNDEFINED@{UNDEFINED}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!UNDEFINED@{UNDEFINED}}\item[{\em +UNDEFINED\label{sls__detector__defs_8h_754e2e1fdf9e993405c39b6050528d56605159e8a4c32319fd69b5d151369d93} +}]undefined or custom settings \index{UNINITIALIZED@{UNINITIALIZED}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!UNINITIALIZED@{UNINITIALIZED}}\item[{\em +UNINITIALIZED\label{sls__detector__defs_8h_754e2e1fdf9e993405c39b6050528d56f096820742c38363e9d6c33e7c932780} +}]uninitialiazed (status at startup) \end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!detectorType@{detectorType}} +\index{detectorType@{detectorType}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{detector\-Type}}\label{sls__detector__defs_8h_ab9f984f7b6798e684c8f3e6b63c6301} + + +Type of the detector \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{GET_DETECTOR_TYPE@{GET\_\-DETECTOR\_\-TYPE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GET_DETECTOR_TYPE@{GET\_\-DETECTOR\_\-TYPE}}\item[{\em +GET\_\-DETECTOR\_\-TYPE\label{sls__detector__defs_8h_ab9f984f7b6798e684c8f3e6b63c63013f15e91cc11ac10e7751457ebb3a675a} +}]the detector will return its type \index{GENERIC@{GENERIC}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GENERIC@{GENERIC}}\item[{\em +GENERIC\label{sls__detector__defs_8h_ab9f984f7b6798e684c8f3e6b63c63019e022e6380da28dd73210ed34b137c36} +}]generic sls detector \index{MYTHEN@{MYTHEN}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!MYTHEN@{MYTHEN}}\item[{\em +MYTHEN\label{sls__detector__defs_8h_ab9f984f7b6798e684c8f3e6b63c630138343da48d2f6783d4a1da59a94d5907} +}]mythen \index{PILATUS@{PILATUS}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!PILATUS@{PILATUS}}\item[{\em +PILATUS\label{sls__detector__defs_8h_ab9f984f7b6798e684c8f3e6b63c630110e5112cb956db4be121134d4cc98cc4} +}]pilatus \index{EIGER@{EIGER}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!EIGER@{EIGER}}\item[{\em +EIGER\label{sls__detector__defs_8h_ab9f984f7b6798e684c8f3e6b63c6301f5a789b06839f8a0693b0a4b4bec554b} +}]eiger \index{GOTTHARD@{GOTTHARD}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GOTTHARD@{GOTTHARD}}\item[{\em +GOTTHARD\label{sls__detector__defs_8h_ab9f984f7b6798e684c8f3e6b63c63019887ec95f534702e44df0b38f4224fdc} +}]gotthard \index{AGIPD@{AGIPD}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!AGIPD@{AGIPD}}\item[{\em +AGIPD\label{sls__detector__defs_8h_ab9f984f7b6798e684c8f3e6b63c6301362ef3626a356331a60a4142543ff450} +}]agipd \end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!digitalTestMode@{digitalTestMode}} +\index{digitalTestMode@{digitalTestMode}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{digital\-Test\-Mode}}\label{sls__detector__defs_8h_e4663256797974408ea7fbe5b86635c8} + + +detector digital test modes \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{CHIP_TEST@{CHIP\_\-TEST}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!CHIP_TEST@{CHIP\_\-TEST}}\item[{\em +CHIP\_\-TEST\label{sls__detector__defs_8h_e4663256797974408ea7fbe5b86635c8ae2e0c504f9214ef61f0fad7cb3b1a23} +}]test chips \index{MODULE_FIRMWARE_TEST@{MODULE\_\-FIRMWARE\_\-TEST}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!MODULE_FIRMWARE_TEST@{MODULE\_\-FIRMWARE\_\-TEST}}\item[{\em +MODULE\_\-FIRMWARE\_\-TEST\label{sls__detector__defs_8h_e4663256797974408ea7fbe5b86635c86e96f3a8573f78c06dfaefae6bb50409} +}]test module firmware \index{DETECTOR_FIRMWARE_TEST@{DETECTOR\_\-FIRMWARE\_\-TEST}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!DETECTOR_FIRMWARE_TEST@{DETECTOR\_\-FIRMWARE\_\-TEST}}\item[{\em +DETECTOR\_\-FIRMWARE\_\-TEST\label{sls__detector__defs_8h_e4663256797974408ea7fbe5b86635c87e3eed63ef6a2d158b401ad48618c5e9} +}]test detector system firmware \index{DETECTOR_MEMORY_TEST@{DETECTOR\_\-MEMORY\_\-TEST}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!DETECTOR_MEMORY_TEST@{DETECTOR\_\-MEMORY\_\-TEST}}\item[{\em +DETECTOR\_\-MEMORY\_\-TEST\label{sls__detector__defs_8h_e4663256797974408ea7fbe5b86635c84e7c62bd22f34793e0d8ef578f0b0bb9} +}]test detector system memory \index{DETECTOR_BUS_TEST@{DETECTOR\_\-BUS\_\-TEST}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!DETECTOR_BUS_TEST@{DETECTOR\_\-BUS\_\-TEST}}\item[{\em +DETECTOR\_\-BUS\_\-TEST\label{sls__detector__defs_8h_e4663256797974408ea7fbe5b86635c8eed72a9571f906df935af01090cb00cb} +}]test detector system CPU-FPGA bus \index{DETECTOR_SOFTWARE_TEST@{DETECTOR\_\-SOFTWARE\_\-TEST}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!DETECTOR_SOFTWARE_TEST@{DETECTOR\_\-SOFTWARE\_\-TEST}}\item[{\em +DETECTOR\_\-SOFTWARE\_\-TEST\label{sls__detector__defs_8h_e4663256797974408ea7fbe5b86635c8ca10909df91f4480939046333845450f} +}]test detector system software \end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!dimension@{dimension}} +\index{dimension@{dimension}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{dimension}}\label{sls__detector__defs_8h_83314ec5aea2e25bc6255af2e5d36dc9} + + +dimension indexes \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{X@{X}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!X@{X}}\item[{\em +X\label{sls__detector__defs_8h_83314ec5aea2e25bc6255af2e5d36dc958833a3110c570fb05130d40c365d1e4} +}]X dimension \index{Y@{Y}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!Y@{Y}}\item[{\em +Y\label{sls__detector__defs_8h_83314ec5aea2e25bc6255af2e5d36dc95596231eabd6cf29050967d5ac83ad84} +}]Y dimension \index{Z@{Z}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!Z@{Z}}\item[{\em +Z\label{sls__detector__defs_8h_83314ec5aea2e25bc6255af2e5d36dc9a70478ce277ffc322f8e1e3418e07355} +}]Z dimension \end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!externalCommunicationMode@{externalCommunicationMode}} +\index{externalCommunicationMode@{externalCommunicationMode}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{external\-Communication\-Mode}}\label{sls__detector__defs_8h_51d6eb28d9d010319da9ce5da86ed32f} + + +communication mode using external signals (obsolete: it will be authomatically determined by the external signal flags) + +\begin{Desc} +\item[See also:]\doxyref{external\-Signal\-Flag}{p.}{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6ed} \end{Desc} +\begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{GET_EXTERNAL_COMMUNICATION_MODE@{GET\_\-EXTERNAL\_\-COMMUNICATION\_\-MODE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GET_EXTERNAL_COMMUNICATION_MODE@{GET\_\-EXTERNAL\_\-COMMUNICATION\_\-MODE}}\item[{\em +GET\_\-EXTERNAL\_\-COMMUNICATION\_\-MODE\label{sls__detector__defs_8h_51d6eb28d9d010319da9ce5da86ed32fecc1279a26625814e7d763b02bd8c953} +}]\index{AUTO@{AUTO}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!AUTO@{AUTO}}\item[{\em +AUTO\label{sls__detector__defs_8h_51d6eb28d9d010319da9ce5da86ed32feef9468d1b98bca652a04bf5063fd9d6} +}]\index{TRIGGER_EXPOSURE@{TRIGGER\_\-EXPOSURE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!TRIGGER_EXPOSURE@{TRIGGER\_\-EXPOSURE}}\item[{\em +TRIGGER\_\-EXPOSURE\label{sls__detector__defs_8h_51d6eb28d9d010319da9ce5da86ed32f8f3da88ad1c84db7cfc6b4c8ccaa4d00} +}]\index{TRIGGER_READOUT@{TRIGGER\_\-READOUT}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!TRIGGER_READOUT@{TRIGGER\_\-READOUT}}\item[{\em +TRIGGER\_\-READOUT\label{sls__detector__defs_8h_51d6eb28d9d010319da9ce5da86ed32febd00656581dd2164b488ac0b70bbd31} +}]\index{TRIGGER_COINCIDENCE_WITH_INTERNAL_ENABLE@{TRIGGER\_\-COINCIDENCE\_\-WITH\_\-INTERNAL\_\-ENABLE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!TRIGGER_COINCIDENCE_WITH_INTERNAL_ENABLE@{TRIGGER\_\-COINCIDENCE\_\-WITH\_\-INTERNAL\_\-ENABLE}}\item[{\em +TRIGGER\_\-COINCIDENCE\_\-WITH\_\-INTERNAL\_\-ENABLE\label{sls__detector__defs_8h_51d6eb28d9d010319da9ce5da86ed32fc4d12bda4065deeeaa61f3c231705aac} +}]\index{GATE_FIX_NUMBER@{GATE\_\-FIX\_\-NUMBER}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GATE_FIX_NUMBER@{GATE\_\-FIX\_\-NUMBER}}\item[{\em +GATE\_\-FIX\_\-NUMBER\label{sls__detector__defs_8h_51d6eb28d9d010319da9ce5da86ed32f2776d5fe61e799d0793dc470d1418b54} +}]\index{GATE_FIX_DURATION@{GATE\_\-FIX\_\-DURATION}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GATE_FIX_DURATION@{GATE\_\-FIX\_\-DURATION}}\item[{\em +GATE\_\-FIX\_\-DURATION\label{sls__detector__defs_8h_51d6eb28d9d010319da9ce5da86ed32fa4acd22b2ca1964c082bb608806ab8a0} +}]\index{GATE_WITH_START_TRIGGER@{GATE\_\-WITH\_\-START\_\-TRIGGER}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GATE_WITH_START_TRIGGER@{GATE\_\-WITH\_\-START\_\-TRIGGER}}\item[{\em +GATE\_\-WITH\_\-START\_\-TRIGGER\label{sls__detector__defs_8h_51d6eb28d9d010319da9ce5da86ed32fb39f5aa486cab306e5d615fb2766d394} +}]\index{GATE_COINCIDENCE_WITH_INTERNAL_ENABLE@{GATE\_\-COINCIDENCE\_\-WITH\_\-INTERNAL\_\-ENABLE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GATE_COINCIDENCE_WITH_INTERNAL_ENABLE@{GATE\_\-COINCIDENCE\_\-WITH\_\-INTERNAL\_\-ENABLE}}\item[{\em +GATE\_\-COINCIDENCE\_\-WITH\_\-INTERNAL\_\-ENABLE\label{sls__detector__defs_8h_51d6eb28d9d010319da9ce5da86ed32fbf98279ca184efd31f801fef9c88058d} +}]\end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!externalSignalFlag@{externalSignalFlag}} +\index{externalSignalFlag@{externalSignalFlag}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{external\-Signal\-Flag}}\label{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6ed} + + +use of the external signals \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{GET_EXTERNAL_SIGNAL_FLAG@{GET\_\-EXTERNAL\_\-SIGNAL\_\-FLAG}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GET_EXTERNAL_SIGNAL_FLAG@{GET\_\-EXTERNAL\_\-SIGNAL\_\-FLAG}}\item[{\em +GET\_\-EXTERNAL\_\-SIGNAL\_\-FLAG\label{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6ed1ac6595a82aacbd6611252fd86a2cf77} +}]return flag for signal \index{SIGNAL_OFF@{SIGNAL\_\-OFF}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!SIGNAL_OFF@{SIGNAL\_\-OFF}}\item[{\em +SIGNAL\_\-OFF\label{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6edcc63da3b256156f312867f56ba3b0f17} +}]signal unused \index{GATE_IN_ACTIVE_HIGH@{GATE\_\-IN\_\-ACTIVE\_\-HIGH}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GATE_IN_ACTIVE_HIGH@{GATE\_\-IN\_\-ACTIVE\_\-HIGH}}\item[{\em +GATE\_\-IN\_\-ACTIVE\_\-HIGH\label{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6ed0f0552a20f43de8e991bef21b5cf62c2} +}]input gate active high \index{GATE_IN_ACTIVE_LOW@{GATE\_\-IN\_\-ACTIVE\_\-LOW}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GATE_IN_ACTIVE_LOW@{GATE\_\-IN\_\-ACTIVE\_\-LOW}}\item[{\em +GATE\_\-IN\_\-ACTIVE\_\-LOW\label{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6ed4c082ca1f2df45c22b3dc0fc3ef95b7f} +}]input gate active low \index{TRIGGER_IN_RISING_EDGE@{TRIGGER\_\-IN\_\-RISING\_\-EDGE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!TRIGGER_IN_RISING_EDGE@{TRIGGER\_\-IN\_\-RISING\_\-EDGE}}\item[{\em +TRIGGER\_\-IN\_\-RISING\_\-EDGE\label{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6ed79e6e24133ce8175a94d4b6f9e027c6a} +}]input exposure trigger on rising edge \index{TRIGGER_IN_FALLING_EDGE@{TRIGGER\_\-IN\_\-FALLING\_\-EDGE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!TRIGGER_IN_FALLING_EDGE@{TRIGGER\_\-IN\_\-FALLING\_\-EDGE}}\item[{\em +TRIGGER\_\-IN\_\-FALLING\_\-EDGE\label{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6edf72d356006c07eb2308e940fa57faccd} +}]input exposure trigger on falling edge \index{RO_TRIGGER_IN_RISING_EDGE@{RO\_\-TRIGGER\_\-IN\_\-RISING\_\-EDGE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!RO_TRIGGER_IN_RISING_EDGE@{RO\_\-TRIGGER\_\-IN\_\-RISING\_\-EDGE}}\item[{\em +RO\_\-TRIGGER\_\-IN\_\-RISING\_\-EDGE\label{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6ed7dbccd40b81af523b16bbee928d73ea6} +}]input raedout trigger on rising edge \index{RO_TRIGGER_IN_FALLING_EDGE@{RO\_\-TRIGGER\_\-IN\_\-FALLING\_\-EDGE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!RO_TRIGGER_IN_FALLING_EDGE@{RO\_\-TRIGGER\_\-IN\_\-FALLING\_\-EDGE}}\item[{\em +RO\_\-TRIGGER\_\-IN\_\-FALLING\_\-EDGE\label{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6edac4e89a4cdb8e21a09bb329b9c216ca7} +}]input readout trigger on falling edge \index{GATE_OUT_ACTIVE_HIGH@{GATE\_\-OUT\_\-ACTIVE\_\-HIGH}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GATE_OUT_ACTIVE_HIGH@{GATE\_\-OUT\_\-ACTIVE\_\-HIGH}}\item[{\em +GATE\_\-OUT\_\-ACTIVE\_\-HIGH\label{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6ed6fef915c5ee5f21d67750eceab5c3f63} +}]output active high when detector is exposing \index{GATE_OUT_ACTIVE_LOW@{GATE\_\-OUT\_\-ACTIVE\_\-LOW}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GATE_OUT_ACTIVE_LOW@{GATE\_\-OUT\_\-ACTIVE\_\-LOW}}\item[{\em +GATE\_\-OUT\_\-ACTIVE\_\-LOW\label{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6eddd95b42d2ab01ed06eeef0e4a31cb5ec} +}]output active low when detector is exposing \index{TRIGGER_OUT_RISING_EDGE@{TRIGGER\_\-OUT\_\-RISING\_\-EDGE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!TRIGGER_OUT_RISING_EDGE@{TRIGGER\_\-OUT\_\-RISING\_\-EDGE}}\item[{\em +TRIGGER\_\-OUT\_\-RISING\_\-EDGE\label{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6edc5ef5400c644119ae9b7d439bd976554} +}]output trigger rising edge at start of exposure \index{TRIGGER_OUT_FALLING_EDGE@{TRIGGER\_\-OUT\_\-FALLING\_\-EDGE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!TRIGGER_OUT_FALLING_EDGE@{TRIGGER\_\-OUT\_\-FALLING\_\-EDGE}}\item[{\em +TRIGGER\_\-OUT\_\-FALLING\_\-EDGE\label{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6ed4bd81afb554b39320bb69ef55aa5ae62} +}]output trigger falling edge at start of exposure \index{RO_TRIGGER_OUT_RISING_EDGE@{RO\_\-TRIGGER\_\-OUT\_\-RISING\_\-EDGE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!RO_TRIGGER_OUT_RISING_EDGE@{RO\_\-TRIGGER\_\-OUT\_\-RISING\_\-EDGE}}\item[{\em +RO\_\-TRIGGER\_\-OUT\_\-RISING\_\-EDGE\label{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6ed58bab8cbcc2d0edd2fef10e49a6d15e9} +}]output trigger rising edge at start of readout \index{RO_TRIGGER_OUT_FALLING_EDGE@{RO\_\-TRIGGER\_\-OUT\_\-FALLING\_\-EDGE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!RO_TRIGGER_OUT_FALLING_EDGE@{RO\_\-TRIGGER\_\-OUT\_\-FALLING\_\-EDGE}}\item[{\em +RO\_\-TRIGGER\_\-OUT\_\-FALLING\_\-EDGE\label{sls__detector__defs_8h_a436b9d7264c77b77021fe6adc33f6ed298fba9dd442b436e72528c4967de59f} +}]output trigger falling edge at start of readout \end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!idMode@{idMode}} +\index{idMode@{idMode}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{id\-Mode}}\label{sls__detector__defs_8h_fc5d5f295e6405046702fc95e6d6d0ea} + + +detector IDs/versions \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{MODULE_SERIAL_NUMBER@{MODULE\_\-SERIAL\_\-NUMBER}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!MODULE_SERIAL_NUMBER@{MODULE\_\-SERIAL\_\-NUMBER}}\item[{\em +MODULE\_\-SERIAL\_\-NUMBER\label{sls__detector__defs_8h_fc5d5f295e6405046702fc95e6d6d0ea93d81eb5f6b590fd14e1c32b23a97b02} +}]return module serial number \index{MODULE_FIRMWARE_VERSION@{MODULE\_\-FIRMWARE\_\-VERSION}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!MODULE_FIRMWARE_VERSION@{MODULE\_\-FIRMWARE\_\-VERSION}}\item[{\em +MODULE\_\-FIRMWARE\_\-VERSION\label{sls__detector__defs_8h_fc5d5f295e6405046702fc95e6d6d0ea17f2410ea2a3ab05fa5bc852df7c3f76} +}]return module firmware \index{DETECTOR_SERIAL_NUMBER@{DETECTOR\_\-SERIAL\_\-NUMBER}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!DETECTOR_SERIAL_NUMBER@{DETECTOR\_\-SERIAL\_\-NUMBER}}\item[{\em +DETECTOR\_\-SERIAL\_\-NUMBER\label{sls__detector__defs_8h_fc5d5f295e6405046702fc95e6d6d0ea65cdb23c9d47b2d3fb8eb74ea58b3ee8} +}]return detector system serial number \index{DETECTOR_FIRMWARE_VERSION@{DETECTOR\_\-FIRMWARE\_\-VERSION}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!DETECTOR_FIRMWARE_VERSION@{DETECTOR\_\-FIRMWARE\_\-VERSION}}\item[{\em +DETECTOR\_\-FIRMWARE\_\-VERSION\label{sls__detector__defs_8h_fc5d5f295e6405046702fc95e6d6d0eaba5743cd3930b18bfa225ef75570afc3} +}]return detector system firmware version \index{DETECTOR_SOFTWARE_VERSION@{DETECTOR\_\-SOFTWARE\_\-VERSION}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!DETECTOR_SOFTWARE_VERSION@{DETECTOR\_\-SOFTWARE\_\-VERSION}}\item[{\em +DETECTOR\_\-SOFTWARE\_\-VERSION\label{sls__detector__defs_8h_fc5d5f295e6405046702fc95e6d6d0ead2f4bf41d038bce268ded8c4b684efba} +}]return detector system software version \index{THIS_SOFTWARE_VERSION@{THIS\_\-SOFTWARE\_\-VERSION}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!THIS_SOFTWARE_VERSION@{THIS\_\-SOFTWARE\_\-VERSION}}\item[{\em +THIS\_\-SOFTWARE\_\-VERSION\label{sls__detector__defs_8h_fc5d5f295e6405046702fc95e6d6d0ea1fe21e424f78721b948644add6ce9b27} +}]return this software version \end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!moduleRegisterBit@{moduleRegisterBit}} +\index{moduleRegisterBit@{moduleRegisterBit}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{module\-Register\-Bit}}\label{sls__detector__defs_8h_922e64c27751c0f09a7cb2cda699a23e} + + +meaning of the module register bits \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{MY_MODULE_REGISTER_BIT@{MY\_\-MODULE\_\-REGISTER\_\-BIT}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!MY_MODULE_REGISTER_BIT@{MY\_\-MODULE\_\-REGISTER\_\-BIT}}\item[{\em +MY\_\-MODULE\_\-REGISTER\_\-BIT\label{sls__detector__defs_8h_922e64c27751c0f09a7cb2cda699a23ef6f62cca225b89d5946f3a89cfe5bde5} +}]possible module register bit meaning \index{MODULE_OUTPUT_WIDTH@{MODULE\_\-OUTPUT\_\-WIDTH}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!MODULE_OUTPUT_WIDTH@{MODULE\_\-OUTPUT\_\-WIDTH}}\item[{\em +MODULE\_\-OUTPUT\_\-WIDTH\label{sls__detector__defs_8h_922e64c27751c0f09a7cb2cda699a23eb82611809c1e4636a025b1e89178da65} +}]possibly module dynamic range \end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!numberOf@{numberOf}} +\index{numberOf@{numberOf}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{number\-Of}}\label{sls__detector__defs_8h_5d90cbfeeeea2d376b37fa552105dab6} + + +flags to get (or set) the size of the detector \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{MAXMODX@{MAXMODX}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!MAXMODX@{MAXMODX}}\item[{\em +MAXMODX\label{sls__detector__defs_8h_5d90cbfeeeea2d376b37fa552105dab6c9a007a9ba0f9500757b7cb2b2d21969} +}]maximum number of module in X direction \index{MAXMODY@{MAXMODY}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!MAXMODY@{MAXMODY}}\item[{\em +MAXMODY\label{sls__detector__defs_8h_5d90cbfeeeea2d376b37fa552105dab6798261b1b7eb0c307a984f286f02ee2b} +}]maximum number of module in Y direction \index{NMODX@{NMODX}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!NMODX@{NMODX}}\item[{\em +NMODX\label{sls__detector__defs_8h_5d90cbfeeeea2d376b37fa552105dab68393fcd1858d6268eb424ed34932b8be} +}]installed number of module in X direction \index{NMODY@{NMODY}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!NMODY@{NMODY}}\item[{\em +NMODY\label{sls__detector__defs_8h_5d90cbfeeeea2d376b37fa552105dab63831ab50de4c0e1752cd7787e0c8125f} +}]installed number of module in Y direction \index{NCHANSX@{NCHANSX}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!NCHANSX@{NCHANSX}}\item[{\em +NCHANSX\label{sls__detector__defs_8h_5d90cbfeeeea2d376b37fa552105dab6a760ea75b6cc0a7b8fcf85fabec2ebcd} +}]number of channels in X direction \index{NCHANSY@{NCHANSY}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!NCHANSY@{NCHANSY}}\item[{\em +NCHANSY\label{sls__detector__defs_8h_5d90cbfeeeea2d376b37fa552105dab68177fc09d9d60953606e8899f6b6a179} +}]number of channels in Y direction \index{NCHIPSX@{NCHIPSX}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!NCHIPSX@{NCHIPSX}}\item[{\em +NCHIPSX\label{sls__detector__defs_8h_5d90cbfeeeea2d376b37fa552105dab65b5856e119e490d1f0a61540462685a0} +}]number of chips in X direction \index{NCHIPSY@{NCHIPSY}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!NCHIPSY@{NCHIPSY}}\item[{\em +NCHIPSY\label{sls__detector__defs_8h_5d90cbfeeeea2d376b37fa552105dab6a5b2866c5c27e11877b7336ffda89ad0} +}]number of chips in Y direction \end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!readOutFlags@{readOutFlags}} +\index{readOutFlags@{readOutFlags}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{read\-Out\-Flags}}\label{sls__detector__defs_8h_6165e3e90182cc47b0003f3288a2e579} + + +readout flags \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{GET_READOUT_FLAGS@{GET\_\-READOUT\_\-FLAGS}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GET_READOUT_FLAGS@{GET\_\-READOUT\_\-FLAGS}}\item[{\em +GET\_\-READOUT\_\-FLAGS\label{sls__detector__defs_8h_6165e3e90182cc47b0003f3288a2e57982dd383146f95dad5856c3077c26791e} +}]return readout flags \index{NORMAL_READOUT@{NORMAL\_\-READOUT}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!NORMAL_READOUT@{NORMAL\_\-READOUT}}\item[{\em +NORMAL\_\-READOUT\label{sls__detector__defs_8h_6165e3e90182cc47b0003f3288a2e57986a905d2c80d41ed0a1c22e1e925f3c1} +}]no flag \index{STORE_IN_RAM@{STORE\_\-IN\_\-RAM}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!STORE_IN_RAM@{STORE\_\-IN\_\-RAM}}\item[{\em +STORE\_\-IN\_\-RAM\label{sls__detector__defs_8h_6165e3e90182cc47b0003f3288a2e579608b6a6b1c416104b3810ccf990e63c2} +}]data are stored in ram and sent only after end of acquisition for faster frame rate \index{READ_HITS@{READ\_\-HITS}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!READ_HITS@{READ\_\-HITS}}\item[{\em +READ\_\-HITS\label{sls__detector__defs_8h_6165e3e90182cc47b0003f3288a2e5797cd5d0e3e9361826e08ac0c74ae701b5} +}]return only the number of the channel which counted ate least one \index{ZERO_COMPRESSION@{ZERO\_\-COMPRESSION}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!ZERO_COMPRESSION@{ZERO\_\-COMPRESSION}}\item[{\em +ZERO\_\-COMPRESSION\label{sls__detector__defs_8h_6165e3e90182cc47b0003f3288a2e579660a7323d976b57490562c9976fd5b79} +}]returned data are 0-compressed \index{PUMP_PROBE_MODE@{PUMP\_\-PROBE\_\-MODE}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!PUMP_PROBE_MODE@{PUMP\_\-PROBE\_\-MODE}}\item[{\em +PUMP\_\-PROBE\_\-MODE\label{sls__detector__defs_8h_6165e3e90182cc47b0003f3288a2e579074069ba9d24eb8e2f3bd8f2e924a6ab} +}]pump-probe mode \index{BACKGROUND_CORRECTIONS@{BACKGROUND\_\-CORRECTIONS}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!BACKGROUND_CORRECTIONS@{BACKGROUND\_\-CORRECTIONS}}\item[{\em +BACKGROUND\_\-CORRECTIONS\label{sls__detector__defs_8h_6165e3e90182cc47b0003f3288a2e5793d1f7aae38dd931d1fcd35137ee92f80} +}]background corrections \end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!timerIndex@{timerIndex}} +\index{timerIndex@{timerIndex}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{timer\-Index}}\label{sls__detector__defs_8h_07c87ebf35dffccd06fe39859a3ca603} + + +indexes for the acquisition timers \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{FRAME_NUMBER@{FRAME\_\-NUMBER}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!FRAME_NUMBER@{FRAME\_\-NUMBER}}\item[{\em +FRAME\_\-NUMBER\label{sls__detector__defs_8h_07c87ebf35dffccd06fe39859a3ca603794854c0bd41940d227e1da3f4c6fae1} +}]number of real time frames: total number of acquisitions is number or frames$\ast$number of cycles \index{ACQUISITION_TIME@{ACQUISITION\_\-TIME}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!ACQUISITION_TIME@{ACQUISITION\_\-TIME}}\item[{\em +ACQUISITION\_\-TIME\label{sls__detector__defs_8h_07c87ebf35dffccd06fe39859a3ca603a93be5f3ba891e49b42c0e0b408ffa82} +}]exposure time \index{FRAME_PERIOD@{FRAME\_\-PERIOD}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!FRAME_PERIOD@{FRAME\_\-PERIOD}}\item[{\em +FRAME\_\-PERIOD\label{sls__detector__defs_8h_07c87ebf35dffccd06fe39859a3ca603390460de9b31250afdb483aface30ff5} +}]period between exposures \index{DELAY_AFTER_TRIGGER@{DELAY\_\-AFTER\_\-TRIGGER}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!DELAY_AFTER_TRIGGER@{DELAY\_\-AFTER\_\-TRIGGER}}\item[{\em +DELAY\_\-AFTER\_\-TRIGGER\label{sls__detector__defs_8h_07c87ebf35dffccd06fe39859a3ca60339e17506aafaf7e3884defca4847cb69} +}]delay between trigger and start of exposure or readout (in triggered mode) \index{GATES_NUMBER@{GATES\_\-NUMBER}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!GATES_NUMBER@{GATES\_\-NUMBER}}\item[{\em +GATES\_\-NUMBER\label{sls__detector__defs_8h_07c87ebf35dffccd06fe39859a3ca603691302b29ccf828080edf1d477ace695} +}]number of gates per frame (in gated mode) \index{PROBES_NUMBER@{PROBES\_\-NUMBER}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!PROBES_NUMBER@{PROBES\_\-NUMBER}}\item[{\em +PROBES\_\-NUMBER\label{sls__detector__defs_8h_07c87ebf35dffccd06fe39859a3ca603a818015d4a4f14332f9edf8d2e14c207} +}]number of probe types in pump-probe mode \index{CYCLES_NUMBER@{CYCLES\_\-NUMBER}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!CYCLES_NUMBER@{CYCLES\_\-NUMBER}}\item[{\em +CYCLES\_\-NUMBER\label{sls__detector__defs_8h_07c87ebf35dffccd06fe39859a3ca6039d9c7c2d79fbdb03000ddf08edbae649} +}]number of cycles: total number of acquisitions is number or frames$\ast$number of cycles \end{description} +\end{Desc} + +\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!trimMode@{trimMode}} +\index{trimMode@{trimMode}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{trim\-Mode}}\label{sls__detector__defs_8h_032d987fb5fbd375236b7f58f0168f33} + + +trimming modes \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{NOISE_TRIMMING@{NOISE\_\-TRIMMING}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!NOISE_TRIMMING@{NOISE\_\-TRIMMING}}\item[{\em +NOISE\_\-TRIMMING\label{sls__detector__defs_8h_032d987fb5fbd375236b7f58f0168f3367718675296bd6843744121a8a21dfcd} +}]trim with noise \index{BEAM_TRIMMING@{BEAM\_\-TRIMMING}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!BEAM_TRIMMING@{BEAM\_\-TRIMMING}}\item[{\em +BEAM\_\-TRIMMING\label{sls__detector__defs_8h_032d987fb5fbd375236b7f58f0168f3356a5f47848e51b90c4fabf90f7760038} +}]trim with x-rays (on all 63 bits) \index{IMPROVE_TRIMMING@{IMPROVE\_\-TRIMMING}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!IMPROVE_TRIMMING@{IMPROVE\_\-TRIMMING}}\item[{\em +IMPROVE\_\-TRIMMING\label{sls__detector__defs_8h_032d987fb5fbd375236b7f58f0168f338d817a34859c7c6ea331a79b27d045f5} +}]trim with x-rays (on a limited range of bits - should start from an already trimmed mode) \index{FIXEDSETTINGS_TRIMMING@{FIXEDSETTINGS\_\-TRIMMING}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!FIXEDSETTINGS_TRIMMING@{FIXEDSETTINGS\_\-TRIMMING}}\item[{\em +FIXEDSETTINGS\_\-TRIMMING\label{sls__detector__defs_8h_032d987fb5fbd375236b7f58f0168f3348d2488a117338a3dbdc173467f087bc} +}]trim without optimizing the threshold and the trimbit size \index{OFFLINE_TRIMMING@{OFFLINE\_\-TRIMMING}!sls_detector_defs.h@{sls\_\-detector\_\-defs.h}}\index{sls_detector_defs.h@{sls\_\-detector\_\-defs.h}!OFFLINE_TRIMMING@{OFFLINE\_\-TRIMMING}}\item[{\em +OFFLINE\_\-TRIMMING\label{sls__detector__defs_8h_032d987fb5fbd375236b7f58f0168f3331391480276ec7aff34c5fcb610c8eaa} +}]trimming is performed offline \end{description} +\end{Desc} + diff --git a/slsDetectorSoftware/docs/latex/structROI.tex b/slsDetectorSoftware/docs/latex/structROI.tex new file mode 100644 index 000000000..e3fa7435e --- /dev/null +++ b/slsDetectorSoftware/docs/latex/structROI.tex @@ -0,0 +1,50 @@ +\section{ROI Struct Reference} +\label{structROI}\index{ROI@{ROI}} +{\tt \#include $<$sls\_\-detector\_\-defs.h$>$} + +\subsection*{Public Attributes} +\begin{CompactItemize} +\item +int \bf{xmin} +\item +int \bf{xmax} +\item +int \bf{ymin} +\item +int \bf{ymax} +\end{CompactItemize} + + +\subsection{Detailed Description} +structure for a region of interest + +xmin,xmax,ymin,ymax define the limits of the region + + + +\subsection{Member Data Documentation} +\index{ROI@{ROI}!xmax@{xmax}} +\index{xmax@{xmax}!ROI@{ROI}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{ROI::xmax}}\label{structROI_e88034f1c060a9a66b6c824a0e89ace7} + + +is the roi xmax (in channel number) \index{ROI@{ROI}!xmin@{xmin}} +\index{xmin@{xmin}!ROI@{ROI}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{ROI::xmin}}\label{structROI_2718ba8d6b04f53f86467f4a142bc58a} + + +is the roi xmin (in channel number) \index{ROI@{ROI}!ymax@{ymax}} +\index{ymax@{ymax}!ROI@{ROI}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{ROI::ymax}}\label{structROI_84995369fd28f469f20f06482f6f9b68} + + +is the roi ymax (in channel number) \index{ROI@{ROI}!ymin@{ymin}} +\index{ymin@{ymin}!ROI@{ROI}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{ROI::ymin}}\label{structROI_8ff93da542938e19e5116c52e9c4bb7e} + + +is the roi ymin (in channel number) + +The documentation for this struct was generated from the following file:\begin{CompactItemize} +\item +common\-Files/\bf{sls\_\-detector\_\-defs.h}\end{CompactItemize} diff --git a/slsDetectorSoftware/docs/latex/structangleConversionConstant.tex b/slsDetectorSoftware/docs/latex/structangleConversionConstant.tex new file mode 100644 index 000000000..d3747a928 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/structangleConversionConstant.tex @@ -0,0 +1,76 @@ +\section{angle\-Conversion\-Constant Struct Reference} +\label{structangleConversionConstant}\index{angleConversionConstant@{angleConversionConstant}} +{\tt \#include $<$sls\_\-detector\_\-defs.h$>$} + +\subsection*{Public Attributes} +\begin{CompactItemize} +\item +float \bf{center} +\item +float \bf{ecenter} +\item +float \bf{r\_\-conversion} +\item +float \bf{er\_\-conversion} +\item +float \bf{offset} +\item +float \bf{eoffset} +\item +float \bf{tilt} +\item +float \bf{etilt} +\end{CompactItemize} + + +\subsection{Detailed Description} +angular conversion constant for a module + + + +\subsection{Member Data Documentation} +\index{angleConversionConstant@{angle\-Conversion\-Constant}!center@{center}} +\index{center@{center}!angleConversionConstant@{angle\-Conversion\-Constant}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{angle\-Conversion\-Constant::center}}\label{structangleConversionConstant_3e4a757b4b527bdc68872d62e071dffc} + + +center of the module (channel at which the radius is perpendicular to the module surface) \index{angleConversionConstant@{angle\-Conversion\-Constant}!ecenter@{ecenter}} +\index{ecenter@{ecenter}!angleConversionConstant@{angle\-Conversion\-Constant}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{angle\-Conversion\-Constant::ecenter}}\label{structangleConversionConstant_9927754f8e0f20a6315b423e265a7431} + + +error in the center determination \index{angleConversionConstant@{angle\-Conversion\-Constant}!eoffset@{eoffset}} +\index{eoffset@{eoffset}!angleConversionConstant@{angle\-Conversion\-Constant}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{angle\-Conversion\-Constant::eoffset}}\label{structangleConversionConstant_f49909ae584f5c00fd7417a0a7cfb28c} + + +error in the offset determination \index{angleConversionConstant@{angle\-Conversion\-Constant}!er_conversion@{er\_\-conversion}} +\index{er_conversion@{er\_\-conversion}!angleConversionConstant@{angle\-Conversion\-Constant}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{angle\-Conversion\-Constant::er\_\-conversion}}\label{structangleConversionConstant_123c4b9d22c2bc6c8a00eac0a31faeb3} + + +error in the r\_\-conversion determination \index{angleConversionConstant@{angle\-Conversion\-Constant}!etilt@{etilt}} +\index{etilt@{etilt}!angleConversionConstant@{angle\-Conversion\-Constant}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{angle\-Conversion\-Constant::etilt}}\label{structangleConversionConstant_6b7c4f3e7ac444fefd3b3957b25fa27f} + + +error in the tilt determination \index{angleConversionConstant@{angle\-Conversion\-Constant}!offset@{offset}} +\index{offset@{offset}!angleConversionConstant@{angle\-Conversion\-Constant}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{angle\-Conversion\-Constant::offset}}\label{structangleConversionConstant_2d71e0c6f0eb37f96743961f1d051e5f} + + +the module offset i.e. the position of channel 0 with respect to the diffractometer 0 \index{angleConversionConstant@{angle\-Conversion\-Constant}!r_conversion@{r\_\-conversion}} +\index{r_conversion@{r\_\-conversion}!angleConversionConstant@{angle\-Conversion\-Constant}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{angle\-Conversion\-Constant::r\_\-conversion}}\label{structangleConversionConstant_30dec69c8f1e62c582ad18f67f293bf3} + + +detector pixel size (or strip pitch) divided by the diffractometer radius \index{angleConversionConstant@{angle\-Conversion\-Constant}!tilt@{tilt}} +\index{tilt@{tilt}!angleConversionConstant@{angle\-Conversion\-Constant}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{angle\-Conversion\-Constant::tilt}}\label{structangleConversionConstant_23af3f7c89696b83abb6a713061cc4b9} + + +ossible tilt in the orthogonal direction (unused) + +The documentation for this struct was generated from the following file:\begin{CompactItemize} +\item +common\-Files/\bf{sls\_\-detector\_\-defs.h}\end{CompactItemize} diff --git a/slsDetectorSoftware/docs/latex/structiarray.tex b/slsDetectorSoftware/docs/latex/structiarray.tex new file mode 100644 index 000000000..2b2f2d85f --- /dev/null +++ b/slsDetectorSoftware/docs/latex/structiarray.tex @@ -0,0 +1,34 @@ +\section{iarray Struct Reference} +\label{structiarray}\index{iarray@{iarray}} +{\tt \#include $<$sls\_\-detector\_\-defs.h$>$} + +\subsection*{Public Attributes} +\begin{CompactItemize} +\item +int \bf{len} +\item +int $\ast$ \bf{iptr} +\end{CompactItemize} + + +\subsection{Detailed Description} +structure for a generic integer array + + + +\subsection{Member Data Documentation} +\index{iarray@{iarray}!iptr@{iptr}} +\index{iptr@{iptr}!iarray@{iarray}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int$\ast$ \bf{iarray::iptr}}\label{structiarray_65e4e79e4c42d1d3b075d84bff7046c4} + + +is the pointer to the array \index{iarray@{iarray}!len@{len}} +\index{len@{len}!iarray@{iarray}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{iarray::len}}\label{structiarray_97fedf6b925f79b2883d07300b266869} + + +is the number of elements of the array + +The documentation for this struct was generated from the following file:\begin{CompactItemize} +\item +common\-Files/\bf{sls\_\-detector\_\-defs.h}\end{CompactItemize} diff --git a/slsDetectorSoftware/docs/latex/structslsDetector_1_1sharedSlsDetector.tex b/slsDetectorSoftware/docs/latex/structslsDetector_1_1sharedSlsDetector.tex new file mode 100644 index 000000000..05f29644c --- /dev/null +++ b/slsDetectorSoftware/docs/latex/structslsDetector_1_1sharedSlsDetector.tex @@ -0,0 +1,381 @@ +\section{sls\-Detector::shared\-Sls\-Detector Struct Reference} +\label{structslsDetector_1_1sharedSlsDetector}\index{slsDetector::sharedSlsDetector@{slsDetector::sharedSlsDetector}} +Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!). + + +{\tt \#include $<$sls\-Detector.h$>$} + +\subsection*{Public Attributes} +\begin{CompactItemize} +\item +int \bf{already\-Existing} +\item +char \bf{hostname} [MAX\_\-STR\_\-LENGTH] +\item +int \bf{control\-Port} +\item +int \bf{stop\-Port} +\item +int \bf{data\-Port} +\item +\bf{detector\-Type} \bf{my\-Detector\-Type} +\item +char \bf{trim\-Dir} [MAX\_\-STR\_\-LENGTH] +\item +char \bf{cal\-Dir} [MAX\_\-STR\_\-LENGTH] +\item +int \bf{n\-Trim\-En} +\item +int \bf{trim\-Energies} [100] +\item +int \bf{file\-Index} +\item +char \bf{file\-Path} [MAX\_\-STR\_\-LENGTH] +\item +char \bf{file\-Name} [MAX\_\-STR\_\-LENGTH] +\item +int \bf{n\-Mod} [2] +\item +int \bf{n\-Mods} +\item +int \bf{n\-Mod\-Max} [2] +\item +int \bf{n\-Mods\-Max} +\item +int \bf{n\-Chans} +\item +int \bf{n\-Chips} +\item +int \bf{n\-Dacs} +\item +int \bf{n\-Adcs} +\item +int \bf{dynamic\-Range} +\item +int \bf{data\-Bytes} +\item +int \bf{correction\-Mask} +\item +float \bf{t\-Dead} +\item +int \bf{n\-Bad\-Chans} +\item +int \bf{bad\-Chans\-List} [MAX\_\-BADCHANS] +\item +int \bf{n\-Bad\-FF} +\item +int \bf{bad\-FFList} [MAX\_\-BADCHANS] +\item +\bf{angle\-Conversion\-Constant} \bf{ang\-Off} [MAXMODS] +\item +int \bf{ang\-Direction} +\item +float \bf{fine\-Offset} +\item +float \bf{global\-Offset} +\item +int \bf{number\-Of\-Positions} +\item +float \bf{det\-Positions} [MAXPOS] +\item +float \bf{bin\-Size} +\item +int \bf{n\-ROI} +\item +\bf{ROI} \bf{roi\-Limits} [MAX\_\-ROIS] +\item +\bf{read\-Out\-Flags} \bf{ro\-Flags} +\item +\bf{detector\-Settings} \bf{current\-Settings} +\item +int \bf{current\-Threshold\-EV} +\item +int64\_\-t \bf{timer\-Value} [MAX\_\-TIMERS] +\item +int \bf{clk\-Div} +\item +int \bf{ffoff} +\item +int \bf{fferroff} +\item +int \bf{modoff} +\item +int \bf{dacoff} +\item +int \bf{adcoff} +\item +int \bf{chipoff} +\item +int \bf{chanoff} +\end{CompactItemize} + + +\subsection{Detailed Description} +Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!). + + + +\subsection{Member Data Documentation} +\index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!adcoff@{adcoff}} +\index{adcoff@{adcoff}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::adcoff}}\label{structslsDetector_1_1sharedSlsDetector_5fea82d598a0252852d3b5aa3dcba778} + + +memory offsets for the adc arrays \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!alreadyExisting@{alreadyExisting}} +\index{alreadyExisting@{alreadyExisting}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::already\-Existing}}\label{structslsDetector_1_1sharedSlsDetector_ee2e81699a79e6b9ddc698d120a13ef9} + + +already existing flag. If the detector does not yet exist (already\-Existing=0) the shared\-Memory will be created, otherwise it will simly be linked \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!angDirection@{angDirection}} +\index{angDirection@{angDirection}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::ang\-Direction}}\label{structslsDetector_1_1sharedSlsDetector_289a2fe819a4e02a93dfc54f9ba7ae16} + + +angular direction (1 if it corresponds to the encoder direction i.e. channel 0 is 0, maxchan is positive high angle, 0 otherwise \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!angOff@{angOff}} +\index{angOff@{angOff}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{angle\-Conversion\-Constant} \bf{sls\-Detector::shared\-Sls\-Detector::ang\-Off}[MAXMODS]}\label{structslsDetector_1_1sharedSlsDetector_31cebbb4add050ac00b3fbe9b4494d8b} + + +array of angular conversion constants for each module\begin{Desc} +\item[See also:]\doxyref{angle\-Conversion\-Constant}{p.}{structangleConversionConstant} \end{Desc} +\index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!badChansList@{badChansList}} +\index{badChansList@{badChansList}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::bad\-Chans\-List}[MAX\_\-BADCHANS]}\label{structslsDetector_1_1sharedSlsDetector_4e03ad7a759acf38d4543e0df9ab9710} + + +list of bad channels \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!badFFList@{badFFList}} +\index{badFFList@{badFFList}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::bad\-FFList}[MAX\_\-BADCHANS]}\label{structslsDetector_1_1sharedSlsDetector_ebf29d7d9b406d65f381c9446953bc14} + + +list of bad channels from flat field i.e. channels which read 0 in the flat field file \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!binSize@{binSize}} +\index{binSize@{binSize}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{sls\-Detector::shared\-Sls\-Detector::bin\-Size}}\label{structslsDetector_1_1sharedSlsDetector_8a64597cae31d83524ea4e554e3798ab} + + +bin size for data merging \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!calDir@{calDir}} +\index{calDir@{calDir}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char \bf{sls\-Detector::shared\-Sls\-Detector::cal\-Dir}[MAX\_\-STR\_\-LENGTH]}\label{structslsDetector_1_1sharedSlsDetector_8db7c92973c8af22116cf3bc38b6efb9} + + +path of the calibration files \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!chanoff@{chanoff}} +\index{chanoff@{chanoff}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::chanoff}}\label{structslsDetector_1_1sharedSlsDetector_02e198988d9b1d5ca6d0391e6a9d0817} + + +memory offsets for the channel register arrays \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!chipoff@{chipoff}} +\index{chipoff@{chipoff}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::chipoff}}\label{structslsDetector_1_1sharedSlsDetector_299382d528788680646246405934fb4c} + + +memory offsets for the chip register arrays \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!clkDiv@{clkDiv}} +\index{clkDiv@{clkDiv}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::clk\-Div}}\label{structslsDetector_1_1sharedSlsDetector_904618e46e191d740569ba998623cba8} + + +clock divider \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!controlPort@{controlPort}} +\index{controlPort@{controlPort}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::control\-Port}}\label{structslsDetector_1_1sharedSlsDetector_11da9fd02e0833533a8b2de6ad3307d8} + + +is the port used for control functions normally it should not be changed \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!correctionMask@{correctionMask}} +\index{correctionMask@{correctionMask}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::correction\-Mask}}\label{structslsDetector_1_1sharedSlsDetector_fa0612dcfba406d532a36f433363bdad} + + +corrections to be applied to the data\begin{Desc} +\item[See also:]\doxyref{correction\-Flags}{p.}{sls__detector__defs_8h_82ffddab533d21b3ef6733d38dfcd5c6} \end{Desc} +\index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!currentSettings@{currentSettings}} +\index{currentSettings@{currentSettings}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{detector\-Settings} \bf{sls\-Detector::shared\-Sls\-Detector::current\-Settings}}\label{structslsDetector_1_1sharedSlsDetector_87e1f522b14c62f2bf43327e3584bbf2} + + +detector settings (standard, fast, etc.) \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!currentThresholdEV@{currentThresholdEV}} +\index{currentThresholdEV@{currentThresholdEV}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::current\-Threshold\-EV}}\label{structslsDetector_1_1sharedSlsDetector_4b80cdf3517e1484ad9223f44d3979b6} + + +detector threshold (e\-V) \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!dacoff@{dacoff}} +\index{dacoff@{dacoff}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::dacoff}}\label{structslsDetector_1_1sharedSlsDetector_f79b4d2240f81814f668358c18272607} + + +memory offsets for the dac arrays \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!dataBytes@{dataBytes}} +\index{dataBytes@{dataBytes}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::data\-Bytes}}\label{structslsDetector_1_1sharedSlsDetector_fbade261d7b298b6b605b6feff742f8b} + + +size of the data that are transfered from the detector \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!dataPort@{dataPort}} +\index{dataPort@{dataPort}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::data\-Port}}\label{structslsDetector_1_1sharedSlsDetector_108090dc9c97fe4d9f91357c27d56953} + + +is the port used to acquire the data normally it should not be changed \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!detPositions@{detPositions}} +\index{detPositions@{detPositions}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{sls\-Detector::shared\-Sls\-Detector::det\-Positions}[MAXPOS]}\label{structslsDetector_1_1sharedSlsDetector_bf1d315c4544329f53beb7c88eb47124} + + +list of encoder positions at which the detector should acquire \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!dynamicRange@{dynamicRange}} +\index{dynamicRange@{dynamicRange}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::dynamic\-Range}}\label{structslsDetector_1_1sharedSlsDetector_e8db406083e91d5f7bcbad93cea1c380} + + +dynamic range of the detector data \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!fferroff@{fferroff}} +\index{fferroff@{fferroff}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::fferroff}}\label{structslsDetector_1_1sharedSlsDetector_ce126fabef8ea393b69d44eff536e4c6} + + +memory offsets for the flat filed coefficient errors \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!ffoff@{ffoff}} +\index{ffoff@{ffoff}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::ffoff}}\label{structslsDetector_1_1sharedSlsDetector_4de66737ee8be8242ba8ad0a1a69a125} + + +memory offsets for the flat filed coefficients \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!fileIndex@{fileIndex}} +\index{fileIndex@{fileIndex}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::file\-Index}}\label{structslsDetector_1_1sharedSlsDetector_48bc3bbfc4292f81c490e73bb52d62e9} + + +current index of the output file \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!fileName@{fileName}} +\index{fileName@{fileName}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char \bf{sls\-Detector::shared\-Sls\-Detector::file\-Name}[MAX\_\-STR\_\-LENGTH]}\label{structslsDetector_1_1sharedSlsDetector_5903fa90b0a18c4896082882a906aba0} + + +name root of the output files \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!filePath@{filePath}} +\index{filePath@{filePath}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char \bf{sls\-Detector::shared\-Sls\-Detector::file\-Path}[MAX\_\-STR\_\-LENGTH]}\label{structslsDetector_1_1sharedSlsDetector_91b926344339e977f57954dcf0aef2fb} + + +path of the output files \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!fineOffset@{fineOffset}} +\index{fineOffset@{fineOffset}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{sls\-Detector::shared\-Sls\-Detector::fine\-Offset}}\label{structslsDetector_1_1sharedSlsDetector_5ca5b4ba561ff03260d4734f17273287} + + +beamline fine offset (of the order of mdeg, might be adjusted for each measurements) \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!globalOffset@{globalOffset}} +\index{globalOffset@{globalOffset}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{sls\-Detector::shared\-Sls\-Detector::global\-Offset}}\label{structslsDetector_1_1sharedSlsDetector_f4f3616855e8d7fa5a9a49774365497a} + + +beamline offset (might be a few degrees beacuse of encoder offset - normally it is kept fixed for a long period of time) \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!hostname@{hostname}} +\index{hostname@{hostname}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char \bf{sls\-Detector::shared\-Sls\-Detector::hostname}[MAX\_\-STR\_\-LENGTH]}\label{structslsDetector_1_1sharedSlsDetector_bf7e3c0dca0810fbd1522e5885d9fe7a} + + +is the hostname (or IP address) of the detector. needs to be set before startin the communication \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!modoff@{modoff}} +\index{modoff@{modoff}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::modoff}}\label{structslsDetector_1_1sharedSlsDetector_6a69b2de8d6cde5155517ca71e47b693} + + +memory offsets for the module structures \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!myDetectorType@{myDetectorType}} +\index{myDetectorType@{myDetectorType}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{detector\-Type} \bf{sls\-Detector::shared\-Sls\-Detector::my\-Detector\-Type}}\label{structslsDetector_1_1sharedSlsDetector_5fcd4804cb224f455da374b25fe5f08a} + + +detector type $\backslash$ see :: detector\-Type \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!nAdcs@{nAdcs}} +\index{nAdcs@{nAdcs}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::n\-Adcs}}\label{structslsDetector_1_1sharedSlsDetector_f9e8b66bbe436f33191e876312ba0d2c} + + +number of adcs per module \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!nBadChans@{nBadChans}} +\index{nBadChans@{nBadChans}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::n\-Bad\-Chans}}\label{structslsDetector_1_1sharedSlsDetector_237f834b800df65a32fc4bc5cd714283} + + +number of bad channels from bad channel list \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!nBadFF@{nBadFF}} +\index{nBadFF@{nBadFF}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::n\-Bad\-FF}}\label{structslsDetector_1_1sharedSlsDetector_d117d6131cef782896adb054e6b00861} + + +number of bad channels from flat field i.e. channels which read 0 in the flat field file \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!nChans@{nChans}} +\index{nChans@{nChans}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::n\-Chans}}\label{structslsDetector_1_1sharedSlsDetector_7a47b57931d2ac0f31a9f334dd94d015} + + +number of channels per chip \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!nChips@{nChips}} +\index{nChips@{nChips}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::n\-Chips}}\label{structslsDetector_1_1sharedSlsDetector_e7a48224edcce55cb28ad9b1f1a4d4f7} + + +number of chips per module \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!nDacs@{nDacs}} +\index{nDacs@{nDacs}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::n\-Dacs}}\label{structslsDetector_1_1sharedSlsDetector_7ffc3b1b55e34c1705717e4c5aaac564} + + +number of dacs per module \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!nMod@{nMod}} +\index{nMod@{nMod}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::n\-Mod}[2]}\label{structslsDetector_1_1sharedSlsDetector_aadb7a55fa5aca830df32e41f7fff06d} + + +number of installed modules of the detector (x and y directions) \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!nModMax@{nModMax}} +\index{nModMax@{nModMax}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::n\-Mod\-Max}[2]}\label{structslsDetector_1_1sharedSlsDetector_001f1ce26646f9367038aca388ca8910} + + +maximum number of modules of the detector (x and y directions) \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!nMods@{nMods}} +\index{nMods@{nMods}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::n\-Mods}}\label{structslsDetector_1_1sharedSlsDetector_8380248ff063419cae1a4454a49f359f} + + +number of modules ( n\-Mod[X]$\ast$n\-Mod[Y])\begin{Desc} +\item[See also:]\doxyref{n\-Mod}{p.}{structslsDetector_1_1sharedSlsDetector_aadb7a55fa5aca830df32e41f7fff06d} \end{Desc} +\index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!nModsMax@{nModsMax}} +\index{nModsMax@{nModsMax}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::n\-Mods\-Max}}\label{structslsDetector_1_1sharedSlsDetector_af9036fae1edd1a18ba311a903bc4fc6} + + +maximum number of modules (n\-Mod\-Max[X]$\ast$n\-Mod\-Max[Y])\begin{Desc} +\item[See also:]\doxyref{n\-Mod\-Max}{p.}{structslsDetector_1_1sharedSlsDetector_001f1ce26646f9367038aca388ca8910} \end{Desc} +\index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!nROI@{nROI}} +\index{nROI@{nROI}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::n\-ROI}}\label{structslsDetector_1_1sharedSlsDetector_46728c000c681867e5b15f6eb6833e09} + + +number of rois defined \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!nTrimEn@{nTrimEn}} +\index{nTrimEn@{nTrimEn}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::n\-Trim\-En}}\label{structslsDetector_1_1sharedSlsDetector_5d7058d713cc890d7d469c44eab500e2} + + +number of energies at which the detector has been trimmed (unused) \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!numberOfPositions@{numberOfPositions}} +\index{numberOfPositions@{numberOfPositions}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::number\-Of\-Positions}}\label{structslsDetector_1_1sharedSlsDetector_0ffc59bdf1f5d82da8c35ba48fd5f36d} + + +number of positions at which the detector should acquire \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!roFlags@{roFlags}} +\index{roFlags@{roFlags}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{read\-Out\-Flags} \bf{sls\-Detector::shared\-Sls\-Detector::ro\-Flags}}\label{structslsDetector_1_1sharedSlsDetector_e1c715ce4ba56b71fc868078acd44243} + + +readout flags \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!roiLimits@{roiLimits}} +\index{roiLimits@{roiLimits}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{ROI} \bf{sls\-Detector::shared\-Sls\-Detector::roi\-Limits}[MAX\_\-ROIS]}\label{structslsDetector_1_1sharedSlsDetector_bfd660b175826b4bb6255baf356eb364} + + +list of rois \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!stopPort@{stopPort}} +\index{stopPort@{stopPort}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::stop\-Port}}\label{structslsDetector_1_1sharedSlsDetector_fc7fef330e7b7ce0cd7470572a5f27b0} + + +is the port used to stop the acquisition normally it should not be changed \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!tDead@{tDead}} +\index{tDead@{tDead}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{sls\-Detector::shared\-Sls\-Detector::t\-Dead}}\label{structslsDetector_1_1sharedSlsDetector_8cb9a14f3eb2f280d0e57ee70a5e2f60} + + +dead time (in ns) for rate corrections \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!timerValue@{timerValue}} +\index{timerValue@{timerValue}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int64\_\-t \bf{sls\-Detector::shared\-Sls\-Detector::timer\-Value}[MAX\_\-TIMERS]}\label{structslsDetector_1_1sharedSlsDetector_d731d48df5668aa86ce690e216e0c816} + + +timer values \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!trimDir@{trimDir}} +\index{trimDir@{trimDir}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char \bf{sls\-Detector::shared\-Sls\-Detector::trim\-Dir}[MAX\_\-STR\_\-LENGTH]}\label{structslsDetector_1_1sharedSlsDetector_4a4421330a2c207e5da36e3739305915} + + +path of the trimbits files \index{slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}!trimEnergies@{trimEnergies}} +\index{trimEnergies@{trimEnergies}!slsDetector::sharedSlsDetector@{sls\-Detector::shared\-Sls\-Detector}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\-Detector::shared\-Sls\-Detector::trim\-Energies}[100]}\label{structslsDetector_1_1sharedSlsDetector_fba642bc1dcd491913723a1a4f88e6f0} + + +list of the energies at which the detector has been trimmed (unused) + +The documentation for this struct was generated from the following file:\begin{CompactItemize} +\item +sls\-Detector/\bf{sls\-Detector.h}\end{CompactItemize} diff --git a/slsDetectorSoftware/docs/latex/structsls__detector__channel.tex b/slsDetectorSoftware/docs/latex/structsls__detector__channel.tex new file mode 100644 index 000000000..b75cd2655 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/structsls__detector__channel.tex @@ -0,0 +1,52 @@ +\section{sls\_\-detector\_\-channel Struct Reference} +\label{structsls__detector__channel}\index{sls_detector_channel@{sls\_\-detector\_\-channel}} +{\tt \#include $<$sls\_\-detector\_\-defs.h$>$} + +\subsection*{Public Attributes} +\begin{CompactItemize} +\item +int \bf{chan} +\item +int \bf{chip} +\item +int \bf{module} +\item +int64\_\-t \bf{reg} +\end{CompactItemize} + + +\subsection{Detailed Description} +structure for a detector channel should not be used by unexperienced users + +\begin{Desc} +\item[See also:]\doxyref{channel\-Register\-Bit}{p.}{sls__detector__defs_8h_40dcd9999cf30431eee4b9b6bc9c1035} \end{Desc} + + + + +\subsection{Member Data Documentation} +\index{sls_detector_channel@{sls\_\-detector\_\-channel}!chan@{chan}} +\index{chan@{chan}!sls_detector_channel@{sls\_\-detector\_\-channel}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\_\-detector\_\-channel::chan}}\label{structsls__detector__channel_208f5290ee144a025afad9ed9ac756d1} + + +is the channel number \index{sls_detector_channel@{sls\_\-detector\_\-channel}!chip@{chip}} +\index{chip@{chip}!sls_detector_channel@{sls\_\-detector\_\-channel}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\_\-detector\_\-channel::chip}}\label{structsls__detector__channel_96ebfc3f219ee7e50c6534fad6410ccf} + + +is the chip number \index{sls_detector_channel@{sls\_\-detector\_\-channel}!module@{module}} +\index{module@{module}!sls_detector_channel@{sls\_\-detector\_\-channel}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\_\-detector\_\-channel::module}}\label{structsls__detector__channel_b97e99a70b0e6af5644d2d635e54cb16} + + +is the module number \index{sls_detector_channel@{sls\_\-detector\_\-channel}!reg@{reg}} +\index{reg@{reg}!sls_detector_channel@{sls\_\-detector\_\-channel}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int64\_\-t \bf{sls\_\-detector\_\-channel::reg}}\label{structsls__detector__channel_9cc64f05bbfac2f6005091ce6bb56339} + + +is the is the channel register (e.g. trimbits, calibration enable, comparator enable...) + +The documentation for this struct was generated from the following file:\begin{CompactItemize} +\item +common\-Files/\bf{sls\_\-detector\_\-defs.h}\end{CompactItemize} diff --git a/slsDetectorSoftware/docs/latex/structsls__detector__chip.tex b/slsDetectorSoftware/docs/latex/structsls__detector__chip.tex new file mode 100644 index 000000000..538cf4dcf --- /dev/null +++ b/slsDetectorSoftware/docs/latex/structsls__detector__chip.tex @@ -0,0 +1,61 @@ +\section{sls\_\-detector\_\-chip Struct Reference} +\label{structsls__detector__chip}\index{sls_detector_chip@{sls\_\-detector\_\-chip}} +{\tt \#include $<$sls\_\-detector\_\-defs.h$>$} + +\subsection*{Public Attributes} +\begin{CompactItemize} +\item +int \bf{chip} +\item +int \bf{module} +\item +int \bf{nchan} +\item +int \bf{reg} +\item +int $\ast$ \bf{chanregs} +\end{CompactItemize} + + +\subsection{Detailed Description} +structure for a detector chip should not be used by unexperienced users \begin{Desc} +\item[See also:]\doxyref{chip\-Register\-Bit}{p.}{sls__detector__defs_8h_4330afff337dd4db0fe7dcca1c75a642} \doxyref{channel\-Register\-Bit}{p.}{sls__detector__defs_8h_40dcd9999cf30431eee4b9b6bc9c1035} \end{Desc} + + + + +\subsection{Member Data Documentation} +\index{sls_detector_chip@{sls\_\-detector\_\-chip}!chanregs@{chanregs}} +\index{chanregs@{chanregs}!sls_detector_chip@{sls\_\-detector\_\-chip}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int$\ast$ \bf{sls\_\-detector\_\-chip::chanregs}}\label{structsls__detector__chip_9ad4b87d6ccbce2c499ab96b41f5bae1} + + +is the pointer to the array of the channel registers \begin{Desc} +\item[See also:]\doxyref{channel\-Register\-Bit}{p.}{sls__detector__defs_8h_40dcd9999cf30431eee4b9b6bc9c1035} \end{Desc} +\index{sls_detector_chip@{sls\_\-detector\_\-chip}!chip@{chip}} +\index{chip@{chip}!sls_detector_chip@{sls\_\-detector\_\-chip}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\_\-detector\_\-chip::chip}}\label{structsls__detector__chip_e27fb747f4ee909aa82c6df0b714cec5} + + +is the chip number \index{sls_detector_chip@{sls\_\-detector\_\-chip}!module@{module}} +\index{module@{module}!sls_detector_chip@{sls\_\-detector\_\-chip}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\_\-detector\_\-chip::module}}\label{structsls__detector__chip_a058157e80d3800c58aef07d71b318c1} + + +is the module number \index{sls_detector_chip@{sls\_\-detector\_\-chip}!nchan@{nchan}} +\index{nchan@{nchan}!sls_detector_chip@{sls\_\-detector\_\-chip}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\_\-detector\_\-chip::nchan}}\label{structsls__detector__chip_059c3ba703537649f570b5ea78bcdaf2} + + +is the number of channels in the chip \index{sls_detector_chip@{sls\_\-detector\_\-chip}!reg@{reg}} +\index{reg@{reg}!sls_detector_chip@{sls\_\-detector\_\-chip}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\_\-detector\_\-chip::reg}}\label{structsls__detector__chip_21e6b8d6f05b79c56e5049790b0eef15} + + +is the chip register (e.g. output analogue buffer enable) \begin{Desc} +\item[See also:]\doxyref{chip\-Register\-Bit}{p.}{sls__detector__defs_8h_4330afff337dd4db0fe7dcca1c75a642} \end{Desc} + + +The documentation for this struct was generated from the following file:\begin{CompactItemize} +\item +common\-Files/\bf{sls\_\-detector\_\-defs.h}\end{CompactItemize} diff --git a/slsDetectorSoftware/docs/latex/structsls__detector__module.tex b/slsDetectorSoftware/docs/latex/structsls__detector__module.tex new file mode 100644 index 000000000..865282aaa --- /dev/null +++ b/slsDetectorSoftware/docs/latex/structsls__detector__module.tex @@ -0,0 +1,123 @@ +\section{sls\_\-detector\_\-module Struct Reference} +\label{structsls__detector__module}\index{sls_detector_module@{sls\_\-detector\_\-module}} +{\tt \#include $<$sls\_\-detector\_\-defs.h$>$} + +\subsection*{Public Attributes} +\begin{CompactItemize} +\item +int \bf{module} +\item +int \bf{serialnumber} +\item +int \bf{nchan} +\item +int \bf{nchip} +\item +int \bf{ndac} +\item +int \bf{nadc} +\item +int \bf{reg} +\item +float $\ast$ \bf{dacs} +\item +float $\ast$ \bf{adcs} +\item +int $\ast$ \bf{chipregs} +\item +int $\ast$ \bf{chanregs} +\item +float \bf{gain} +\item +float \bf{offset} +\end{CompactItemize} + + +\subsection{Detailed Description} +structure for a detector module should not be used by unexperienced users + +\begin{Desc} +\item[See also:]:: \doxyref{module\-Register\-Bit}{p.}{sls__detector__defs_8h_922e64c27751c0f09a7cb2cda699a23e} \doxyref{chip\-Register\-Bit}{p.}{sls__detector__defs_8h_4330afff337dd4db0fe7dcca1c75a642} :\doxyref{channel\-Register\-Bit}{p.}{sls__detector__defs_8h_40dcd9999cf30431eee4b9b6bc9c1035}\end{Desc} +\begin{itemize} +\item reg is the module register (e.g. dynamic range? see module\-Register\-Bit) \item dacs is the pointer to the array of dac values (in V) \item adcs is the pointer to the array of adc values (in V) \item chipregs is the pointer to the array of chip registers \item chanregs is the pointer to the array of channel registers \item gain is the module gain \item offset is the module offset \end{itemize} + + + + +\subsection{Member Data Documentation} +\index{sls_detector_module@{sls\_\-detector\_\-module}!adcs@{adcs}} +\index{adcs@{adcs}!sls_detector_module@{sls\_\-detector\_\-module}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float$\ast$ \bf{sls\_\-detector\_\-module::adcs}}\label{structsls__detector__module_23e78882688995ac5a0b3beae9fbc47e} + + +is the pointer to the array of the adc values (in V) \index{sls_detector_module@{sls\_\-detector\_\-module}!chanregs@{chanregs}} +\index{chanregs@{chanregs}!sls_detector_module@{sls\_\-detector\_\-module}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int$\ast$ \bf{sls\_\-detector\_\-module::chanregs}}\label{structsls__detector__module_2d7e1d62439dca06b09c07ad2f8317c7} + + +is the pointer to the array of the channel registers \begin{Desc} +\item[See also:]\doxyref{channel\-Register\-Bit}{p.}{sls__detector__defs_8h_40dcd9999cf30431eee4b9b6bc9c1035} \end{Desc} +\index{sls_detector_module@{sls\_\-detector\_\-module}!chipregs@{chipregs}} +\index{chipregs@{chipregs}!sls_detector_module@{sls\_\-detector\_\-module}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int$\ast$ \bf{sls\_\-detector\_\-module::chipregs}}\label{structsls__detector__module_f4ce649ef6fe43b092485a427ef2639b} + + +is the pointer to the array of the chip registers \begin{Desc} +\item[See also:]\doxyref{chip\-Register\-Bit}{p.}{sls__detector__defs_8h_4330afff337dd4db0fe7dcca1c75a642} \end{Desc} +\index{sls_detector_module@{sls\_\-detector\_\-module}!dacs@{dacs}} +\index{dacs@{dacs}!sls_detector_module@{sls\_\-detector\_\-module}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float$\ast$ \bf{sls\_\-detector\_\-module::dacs}}\label{structsls__detector__module_2cb9e387ddc4ac7d2e451eddb3076a05} + + +is the pointer to the array of the dac values (in V) \index{sls_detector_module@{sls\_\-detector\_\-module}!gain@{gain}} +\index{gain@{gain}!sls_detector_module@{sls\_\-detector\_\-module}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{sls\_\-detector\_\-module::gain}}\label{structsls__detector__module_b978ffc0a15bc1f4189cbc5205260470} + + +is the module gain (V/ke\-V) \index{sls_detector_module@{sls\_\-detector\_\-module}!module@{module}} +\index{module@{module}!sls_detector_module@{sls\_\-detector\_\-module}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\_\-detector\_\-module::module}}\label{structsls__detector__module_3727a5a7bde541242df86dc3c49687e5} + + +is the module number \index{sls_detector_module@{sls\_\-detector\_\-module}!nadc@{nadc}} +\index{nadc@{nadc}!sls_detector_module@{sls\_\-detector\_\-module}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\_\-detector\_\-module::nadc}}\label{structsls__detector__module_98aaddadb685496c872d8527d941a552} + + +is the number of adcs on the module \index{sls_detector_module@{sls\_\-detector\_\-module}!nchan@{nchan}} +\index{nchan@{nchan}!sls_detector_module@{sls\_\-detector\_\-module}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\_\-detector\_\-module::nchan}}\label{structsls__detector__module_accf68d0cbc3093880452bbaba38e85c} + + +is the number of channels per chip \index{sls_detector_module@{sls\_\-detector\_\-module}!nchip@{nchip}} +\index{nchip@{nchip}!sls_detector_module@{sls\_\-detector\_\-module}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\_\-detector\_\-module::nchip}}\label{structsls__detector__module_52c12c0687c7ce05809c51222ee09b08} + + +is the number of chips on the module \index{sls_detector_module@{sls\_\-detector\_\-module}!ndac@{ndac}} +\index{ndac@{ndac}!sls_detector_module@{sls\_\-detector\_\-module}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\_\-detector\_\-module::ndac}}\label{structsls__detector__module_745d4ba4209ee3eb28f829d3fb76fda4} + + +is the number of dacs on the module \index{sls_detector_module@{sls\_\-detector\_\-module}!offset@{offset}} +\index{offset@{offset}!sls_detector_module@{sls\_\-detector\_\-module}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{sls\_\-detector\_\-module::offset}}\label{structsls__detector__module_2e4ed1d60daf3d142971659feecefc63} + + +is the module offset (V) \index{sls_detector_module@{sls\_\-detector\_\-module}!reg@{reg}} +\index{reg@{reg}!sls_detector_module@{sls\_\-detector\_\-module}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\_\-detector\_\-module::reg}}\label{structsls__detector__module_5fc4f0b2d53f479810b69ce4ae998a84} + + +is the module register (e.g. dynamic range?) \begin{Desc} +\item[See also:]\doxyref{module\-Register\-Bit}{p.}{sls__detector__defs_8h_922e64c27751c0f09a7cb2cda699a23e} \end{Desc} +\index{sls_detector_module@{sls\_\-detector\_\-module}!serialnumber@{serialnumber}} +\index{serialnumber@{serialnumber}!sls_detector_module@{sls\_\-detector\_\-module}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \bf{sls\_\-detector\_\-module::serialnumber}}\label{structsls__detector__module_7dfda9e378903db858fd7727d0a88afd} + + +is the module serial number + +The documentation for this struct was generated from the following file:\begin{CompactItemize} +\item +common\-Files/\bf{sls\_\-detector\_\-defs.h}\end{CompactItemize} diff --git a/slsDetectorSoftware/docs/latex/usersFunctions_8c.tex b/slsDetectorSoftware/docs/latex/usersFunctions_8c.tex new file mode 100644 index 000000000..2002955b7 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/usersFunctions_8c.tex @@ -0,0 +1,58 @@ +\section{users\-Functions/users\-Functions.c File Reference} +\label{usersFunctions_8c}\index{usersFunctions/usersFunctions.c@{usersFunctions/usersFunctions.c}} +{\tt \#include \char`\"{}users\-Functions.h\char`\"{}}\par +{\tt \#include $<$math.h$>$}\par +\subsection*{Functions} +\begin{CompactItemize} +\item +float \bf{angle} (int ichan, float encoder, float total\-Offset, float conv\_\-r, float center, float offset, float tilt, int direction) +\item +float \bf{get\_\-position} () +\item +int \bf{go\_\-to\_\-position} (float p) +\item +int \bf{go\_\-to\_\-position\_\-no\_\-wait} (float p) +\item +float \bf{get\_\-i0} () +\end{CompactItemize} +\subsection*{Variables} +\begin{CompactItemize} +\item +float \bf{pos} +\end{CompactItemize} + + +\subsection{Function Documentation} +\index{usersFunctions.c@{users\-Functions.c}!angle@{angle}} +\index{angle@{angle}!usersFunctions.c@{users\-Functions.c}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float angle (int {\em ichan}, float {\em encoder}, float {\em total\-Offset}, float {\em conv\_\-r}, float {\em center}, float {\em offset}, float {\em tilt}, int {\em direction})}\label{usersFunctions_8c_bceeb897c561346124ee40760081c47b} + + +\index{usersFunctions.c@{users\-Functions.c}!get_i0@{get\_\-i0}} +\index{get_i0@{get\_\-i0}!usersFunctions.c@{users\-Functions.c}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float get\_\-i0 ()}\label{usersFunctions_8c_f3342fc2bcb4fc2e02730b9901cdf65c} + + +\index{usersFunctions.c@{users\-Functions.c}!get_position@{get\_\-position}} +\index{get_position@{get\_\-position}!usersFunctions.c@{users\-Functions.c}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float get\_\-position ()}\label{usersFunctions_8c_39cbcb91119ba8ca02b90ae72c0f3e76} + + +\index{usersFunctions.c@{users\-Functions.c}!go_to_position@{go\_\-to\_\-position}} +\index{go_to_position@{go\_\-to\_\-position}!usersFunctions.c@{users\-Functions.c}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int go\_\-to\_\-position (float {\em p})}\label{usersFunctions_8c_53d87c05f752d9c7355db25f90a11413} + + +\index{usersFunctions.c@{users\-Functions.c}!go_to_position_no_wait@{go\_\-to\_\-position\_\-no\_\-wait}} +\index{go_to_position_no_wait@{go\_\-to\_\-position\_\-no\_\-wait}!usersFunctions.c@{users\-Functions.c}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int go\_\-to\_\-position\_\-no\_\-wait (float {\em p})}\label{usersFunctions_8c_3d8c86b31b18006fe0773c02885a6bae} + + + + +\subsection{Variable Documentation} +\index{usersFunctions.c@{users\-Functions.c}!pos@{pos}} +\index{pos@{pos}!usersFunctions.c@{users\-Functions.c}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float \bf{pos}}\label{usersFunctions_8c_f14c6d623ff1aec896b4d087ab74caa0} + + diff --git a/slsDetectorSoftware/docs/latex/usersFunctions_8h.tex b/slsDetectorSoftware/docs/latex/usersFunctions_8h.tex new file mode 100644 index 000000000..9577e6855 --- /dev/null +++ b/slsDetectorSoftware/docs/latex/usersFunctions_8h.tex @@ -0,0 +1,56 @@ +\section{users\-Functions/users\-Functions.h File Reference} +\label{usersFunctions_8h}\index{usersFunctions/usersFunctions.h@{usersFunctions/usersFunctions.h}} +\subsection*{Defines} +\begin{CompactItemize} +\item +\#define \bf{PI}~3.14159265358979323846 +\end{CompactItemize} +\subsection*{Functions} +\begin{CompactItemize} +\item +float \bf{angle} (int ichan, float encoder, float total\-Offset, float conv\_\-r, float center, float offset, float tilt, int direction) +\item +float \bf{get\_\-position} () +\item +int \bf{go\_\-to\_\-position} (float p) +\item +int \bf{go\_\-to\_\-position\_\-no\_\-wait} (float p) +\item +float \bf{get\_\-i0} () +\end{CompactItemize} + + +\subsection{Define Documentation} +\index{usersFunctions.h@{users\-Functions.h}!PI@{PI}} +\index{PI@{PI}!usersFunctions.h@{users\-Functions.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define PI~3.14159265358979323846}\label{usersFunctions_8h_598a3330b3c21701223ee0ca14316eca} + + + + +\subsection{Function Documentation} +\index{usersFunctions.h@{users\-Functions.h}!angle@{angle}} +\index{angle@{angle}!usersFunctions.h@{users\-Functions.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float angle (int {\em ichan}, float {\em encoder}, float {\em total\-Offset}, float {\em conv\_\-r}, float {\em center}, float {\em offset}, float {\em tilt}, int {\em direction})}\label{usersFunctions_8h_bceeb897c561346124ee40760081c47b} + + +\index{usersFunctions.h@{users\-Functions.h}!get_i0@{get\_\-i0}} +\index{get_i0@{get\_\-i0}!usersFunctions.h@{users\-Functions.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float get\_\-i0 ()}\label{usersFunctions_8h_f3342fc2bcb4fc2e02730b9901cdf65c} + + +\index{usersFunctions.h@{users\-Functions.h}!get_position@{get\_\-position}} +\index{get_position@{get\_\-position}!usersFunctions.h@{users\-Functions.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}float get\_\-position ()}\label{usersFunctions_8h_39cbcb91119ba8ca02b90ae72c0f3e76} + + +\index{usersFunctions.h@{users\-Functions.h}!go_to_position@{go\_\-to\_\-position}} +\index{go_to_position@{go\_\-to\_\-position}!usersFunctions.h@{users\-Functions.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int go\_\-to\_\-position (float {\em p})}\label{usersFunctions_8h_53d87c05f752d9c7355db25f90a11413} + + +\index{usersFunctions.h@{users\-Functions.h}!go_to_position_no_wait@{go\_\-to\_\-position\_\-no\_\-wait}} +\index{go_to_position_no_wait@{go\_\-to\_\-position\_\-no\_\-wait}!usersFunctions.h@{users\-Functions.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int go\_\-to\_\-position\_\-no\_\-wait (float {\em p})}\label{usersFunctions_8h_3d8c86b31b18006fe0773c02885a6bae} + + diff --git a/slsDetectorSoftware/doxy.config b/slsDetectorSoftware/doxy.config new file mode 100644 index 000000000..884bdc547 --- /dev/null +++ b/slsDetectorSoftware/doxy.config @@ -0,0 +1,64 @@ +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = YES + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +INPUT = slsDetector/slsDetector.h mythenDetector/mythenDetector.h eigerDetector/eigerDetector.h MySocketTCP/MySocketTCP.h usersFunctions/usersFunctions.h commonFiles/sls_detector_defs.h slsDetector/slsDetector.cpp MySocketTCP/MySocketTCP.cxx usersFunctions/usersFunctions.c + +OUTPUT_DIRECTORY = docs + diff --git a/slsDetectorSoftware/eigerDetector/eigerDetector.cpp b/slsDetectorSoftware/eigerDetector/eigerDetector.cpp new file mode 100644 index 000000000..1ceb4583a --- /dev/null +++ b/slsDetectorSoftware/eigerDetector/eigerDetector.cpp @@ -0,0 +1,12 @@ +#include "eigerDetector.h" + + +using namespace std; + + + +eigerDetector::eigerDetector(int id): slsDetector(EIGER,id) + { + ; +} + diff --git a/slsDetectorSoftware/eigerDetector/eigerDetector.h b/slsDetectorSoftware/eigerDetector/eigerDetector.h new file mode 100644 index 000000000..1a751667f --- /dev/null +++ b/slsDetectorSoftware/eigerDetector/eigerDetector.h @@ -0,0 +1,170 @@ + + + +#ifndef EIGER_DETECTOR_H +#define EIGER_DETECTOR_H + +using namespace std; + + + +/** + * + * +@libdoc The mythenDetector class contains the functions specific to the eiger detector + * + * @short This is class contains all eiger specific functionalities + * @author Anna Bergamaschi + * @version 0.1alpha (any string) + + + */ +#include "slsDetector.h" + +class eigerDetector : public slsDetector{ + + + + public: + + + +/** (default) constructor + + \param id is the detector index which is needed to define the shared memory id. Different physical detectors should have different IDs in order to work independently + + +*/ + eigerDetector(int id=0); + //slsDetector(string const fname); + /** destructor */ + ~eigerDetector(){}; + + + + /** + reads a trim file + \param fname name of the file to be read + \param myMod pointer to the module structure which has to be set.
If it is NULL a new module structure will be created + \returns the pointer to myMod or NULL if reading the file failed + */ + + sls_detector_module* readTrimFile(string fname, sls_detector_module* myMod=NULL); + + /** + writes a trim file + \param fname name of the file to be written + \param mod module structure which has to be written to file + \returns OK or FAIL if the file could not be written + + \sa ::sls_detector_module + */ + int writeTrimFile(string fname, sls_detector_module mod); + + /** + writes a trim file for module number imod - the values will be read from the current detector structure + \param fname name of the file to be written + \param imod module number + \returns OK or FAIL if the file could not be written + \sa ::sls_detector_module sharedSlsDetector + */ + int writeTrimFile(string fname, int imod); + + + /** + writes a data file + \param name of the file to be written + \param data array of data values + \param err array of arrors on the data. If NULL no errors will be written + + \param ang array of angular values. If NULL data will be in the form chan-val(-err) otherwise ang-val(-err) + \param dataformat format of the data: can be 'i' integer or 'f' float (default) + \param nch number of channels to be written to file. if -1 defaults to the number of installed channels of the detector + \returns OK or FAIL if it could not write the file or data=NULL + + + */ + int writeDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1); + + /** + writes a data file + \param name of the file to be written + \param data array of data values + \returns OK or FAIL if it could not write the file or data=NULL + */ + int writeDataFile(string fname, int *data); + + /** + reads a data file + \param name of the file to be read + \param data array of data values to be filled + \param err array of arrors on the data. If NULL no errors are expected on the file + + \param ang array of angular values. If NULL data are expected in the form chan-val(-err) otherwise ang-val(-err) + \param dataformat format of the data: can be 'i' integer or 'f' float (default) + \param nch number of channels to be written to file. if <=0 defaults to the number of installed channels of the detector + \returns OK or FAIL if it could not read the file or data=NULL + + + */ + int readDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=0); + + /** + reads a data file + \param name of the file to be read + \param data array of data values + \returns OK or FAIL if it could not read the file or data=NULL + */ + int readDataFile(string fname, int *data); + + /** + returns the location of the calibration files + \sa sharedSlsDetector + */ + + /** + int readCalibrationFile(string fname, float &gain, float &offset); + + + \param fname file to be read + \param gain reference to the gain variable + \offset reference to the offset variable + \sa sharedSlsDetector + */ + int readCalibrationFile(string fname, float &gain, float &offset); + + + /** + writes a clibration file + \param fname file to be written + \param gain + \param offset + \sa sharedSlsDetector + */ + int writeCalibrationFile(string fname, float gain, float offset); + + + + + + + + + /** + decode data from the detector converting them to an array of floats, one for each channle + \param datain data from the detector + \returns pointer to a float array with a data per channel + */ + float* decodeData(int *datain); + + + + + + private: + + +}; + + +#endif diff --git a/slsDetectorSoftware/mythenDetector/mythenDetector.cpp b/slsDetectorSoftware/mythenDetector/mythenDetector.cpp new file mode 100644 index 000000000..644bb5f2d --- /dev/null +++ b/slsDetectorSoftware/mythenDetector/mythenDetector.cpp @@ -0,0 +1,17 @@ +#include "mythenDetector.h" +#include "usersFunctions.h" +#include +#include +#include + + + +using namespace std; + + + +mythenDetector::mythenDetector(int id): slsDetector(MYTHEN,id) + { + ; +} + diff --git a/slsDetectorSoftware/mythenDetector/mythenDetector.h b/slsDetectorSoftware/mythenDetector/mythenDetector.h new file mode 100644 index 000000000..a1c4281f4 --- /dev/null +++ b/slsDetectorSoftware/mythenDetector/mythenDetector.h @@ -0,0 +1,262 @@ + + + +#ifndef MYTHEN_DETECTOR_H +#define MYTHEN_DETECTOR_H + +using namespace std; + + + +/** + * + * +@libdoc The mythenDetector class contains the functions specific to the mythen detector + * + * @short This calss contains all mythen specific functions + * @author Anna Bergamaschi + * @version 0.1alpha (any string) + + + */ +#include "slsDetector.h" + +class mythenDetector : public slsDetector{ + + + + public: + + + +/** (default) constructor + + \param id is the detector index which is needed to define the shared memory id. Different physical detectors should have different IDs in order to work independently + + +*/ + mythenDetector(int id=0); + //slsDetector(string const fname); + /** destructor */ + ~mythenDetector(){}; + + + + /** + reads a trim file + \param fname name of the file to be read + \param myMod pointer to the module structure which has to be set.
If it is NULL a new module structure will be created + \returns the pointer to myMod or NULL if reading the file failed + */ + + sls_detector_module* readTrimFile(string fname, sls_detector_module* myMod=NULL); + + /** + writes a trim file + \param fname name of the file to be written + \param mod module structure which has to be written to file + \returns OK or FAIL if the file could not be written + + \sa ::sls_detector_module + */ + int writeTrimFile(string fname, sls_detector_module mod); + + /** + writes a trim file for module number imod - the values will be read from the current detector structure + \param fname name of the file to be written + \param imod module number + \returns OK or FAIL if the file could not be written + \sa ::sls_detector_module sharedSlsDetector + */ + int writeTrimFile(string fname, int imod); + + + /** + writes a data file + \param name of the file to be written + \param data array of data values + \param err array of arrors on the data. If NULL no errors will be written + + \param ang array of angular values. If NULL data will be in the form chan-val(-err) otherwise ang-val(-err) + \param dataformat format of the data: can be 'i' integer or 'f' float (default) + \param nch number of channels to be written to file. if -1 defaults to the number of installed channels of the detector + \returns OK or FAIL if it could not write the file or data=NULL + + + */ + int writeDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1); + + /** + writes a data file + \param name of the file to be written + \param data array of data values + \returns OK or FAIL if it could not write the file or data=NULL + */ + int writeDataFile(string fname, int *data); + + /** + reads a data file + \param name of the file to be read + \param data array of data values to be filled + \param err array of arrors on the data. If NULL no errors are expected on the file + + \param ang array of angular values. If NULL data are expected in the form chan-val(-err) otherwise ang-val(-err) + \param dataformat format of the data: can be 'i' integer or 'f' float (default) + \param nch number of channels to be written to file. if <=0 defaults to the number of installed channels of the detector + \returns OK or FAIL if it could not read the file or data=NULL + + + */ + int readDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=0); + + /** + reads a data file + \param name of the file to be read + \param data array of data values + \returns OK or FAIL if it could not read the file or data=NULL + */ + int readDataFile(string fname, int *data); + + /** + returns the location of the calibration files + \sa sharedSlsDetector + */ + + /** + int readCalibrationFile(string fname, float &gain, float &offset); + \param fname file to be read + \param gain reference to the gain variable + \offset reference to the offset variable + \sa sharedSlsDetector + */ + int readCalibrationFile(string fname, float &gain, float &offset); + + /** + writes a clibration file + \param fname file to be written + \param gain + \param offset + \sa sharedSlsDetector + */ + int writeCalibrationFile(string fname, float gain, float offset); + + + /** + reads an angular conversion file + \param fname file to be read + \sa angleConversionConstant + */ + int readAngularConversion(string fname=""); + /** + writes an angular conversion file + \param fname file to be written + \sa angleConversionConstant + */ + int writeAngularConversion(string fname=""); + + + + /* Communication to server */ + + // Tests and identification + + /** + set angular conversion + \param fname file with angular conversion constants ("" disable) + \returns 0 if angular conversion disabled, >0 otherwise + */ + int setAngularConversion(string fname=""); + + /** + get angular conversion + \param reference to diffractometer direction + \param angconv array that will be filled with the angular conversion constants + \returns 0 if angular conversion disabled, >0 otherwise + */ + int getAngularConversion(int &direction, angleConversionConstant *angconv=NULL); + + /** + set detector global offset + */ + float setGlobalOffset(float f){thisDetector->globalOffset=f; return thisDetector->globalOffset;}; + + /** + set detector fine offset + */ + float setFineOffset(float f){thisDetector->fineOffset=f; return thisDetector->fineOffset;}; + /** + get detector fine offset + */ + float getFineOffset(){return thisDetector->fineOffset;}; + + /** + get detector global offset + */ + float getGlobalOffset(){return thisDetector->globalOffset;}; + + /** + set positions for the acquisition + \param nPos number of positions + \param pos array with the encoder positions + \returns number of positions + */ + int setPositions(int nPos, float *pos){thisDetector->numberOfPositions=nPos; for (int ip=0; ipdetPositions[ip]=pos[ip]; return thisDetector->numberOfPositions;}; + /** + get positions for the acquisition + \param pos array which will contain the encoder positions + \returns number of positions + */ + int getPositions(float *pos=NULL){ if (pos ) {for (int ip=0; ipnumberOfPositions; ip++) pos[ip]=thisDetector->detPositions[ip];} return thisDetector->numberOfPositions;}; + + + /** set detector bin size used for merging (approx angular resolution)*/ + float setBinSize(float bs) {thisDetector->binSize=bs; return thisDetector->binSize;} + /** return detector bin size used for merging (approx angular resolution)*/ + float getBinSize() {return thisDetector->binSize;} + + + + + + + /** + decode data from the detector converting them to an array of floats, one for each channle + \param datain data from the detector + \returns pointer to a float array with a data per channel + */ + float* decodeData(int *datain); + + + + int resetMerging(float *mp, float *mv,float *me, int *mm); + /** not yet implemented + merge dataset + \param p1 angular positions of dataset + \param v1 data + \param e1 errors + \param mp already merged postions + \param mv already merged data + \param me already merged errors (squared sum) + \param mm multiplicity of merged arrays + */ + int addToMerging(float *p1, float *v1, float *e1, float *mp, float *mv,float *me, int *mm); + + /** + calculates the "final" positions, data value and errors for the emrged data + \param mp already merged postions + \param mv already merged data + \param me already merged errors (squared sum) + \param mm multiplicity of merged arrays + \returns FAIL or the + */ + int finalizeMerging(float *mp, float *mv,float *me, int *mm); + + + + private: + + +}; + + +#endif diff --git a/slsDetectorSoftware/mythenDetectorServer/.target-makefrag b/slsDetectorSoftware/mythenDetectorServer/.target-makefrag new file mode 100755 index 000000000..ce093ecac --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/.target-makefrag @@ -0,0 +1 @@ +AXIS_BUILDTYPE ?= cris-axis-linux-gnu diff --git a/slsDetectorSoftware/mythenDetectorServer/Makefile b/slsDetectorSoftware/mythenDetectorServer/Makefile new file mode 100755 index 000000000..63658adc5 --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/Makefile @@ -0,0 +1,38 @@ +# $Id: Makefile,v 1.1.1.1 2006/02/04 03:35:01 freza Exp $ +# first compile +# make cris-axis-linux-gnu + +AXIS_USABLE_LIBS = UCLIBC GLIBC +include $(AXIS_TOP_DIR)/tools/build/Rules.axis + +PROGS= mythenDetectorServer + +INSTDIR= $(prefix)/bin +INSTMODE= 0777 + +SRCS= server.c server_funcs.c communication_funcs.c firmware_funcs.c mcb_funcs.c trimming_funcs.c sharedmemory.c +OBJS= $(SRCS:%.c=%.o) + +CFLAGS+= -Wall -DC_ONLY -DMCB_FUNCS +# -DVERBOSE +#-Werror + +LDLIBS+= -lm + +all: $(PROGS) + +boot: $(OBJS) + +$(PROGS): $(OBJS) + echo $(OBJS) + $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ + +install: $(PROGS) + $(INSTALL) -d $(INSTDIR) + $(INSTALL) -m $(INSTMODE) $(PROGS) $(INSTDIR) + +clean: + rm -rf $(PROGS) *.o + +depend: + makedepend -Y -- $(CFLAGS) -- $(SRCS) 2>/dev/null diff --git a/slsDetectorSoftware/mythenDetectorServer/Makefile.dum b/slsDetectorSoftware/mythenDetectorServer/Makefile.dum new file mode 100644 index 000000000..59a15e28e --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/Makefile.dum @@ -0,0 +1,37 @@ +# $Id: Makefile,v 1.1.1.1 2006/02/04 03:35:01 freza Exp $ +# first compile +# make cris-axis-linux-gnu + +AXIS_USABLE_LIBS = UCLIBC GLIBC +include $(AXIS_TOP_DIR)/tools/build/Rules.axis + +PROGS= dummy + +INSTDIR= $(prefix)/bin +INSTMODE= 0777 + +SRCS= dummy_main.c server_funcs.c communication_funcs.c firmware_funcs.c mcb_funcs.c trimming_funcs.c sharedmemory.c +OBJS= $(SRCS:%.c=%.o) + +CFLAGS+= -Wall -DC_ONLY -DVERBOSE +#-Werror + +LDLIBS+= -lm + +all: $(PROGS) + +boot: $(OBJS) + +$(PROGS): $(OBJS) + echo $(OBJS) + $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ + +install: $(PROGS) + $(INSTALL) -d $(INSTDIR) + $(INSTALL) -m $(INSTMODE) $(PROGS) $(INSTDIR) + +clean: + rm -rf $(PROGS) *.o + +depend: + makedepend -Y -- $(CFLAGS) -- $(SRCS) 2>/dev/null diff --git a/slsDetectorSoftware/mythenDetectorServer/communication_funcs.c b/slsDetectorSoftware/mythenDetectorServer/communication_funcs.c new file mode 120000 index 000000000..87a4f95d1 --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/communication_funcs.c @@ -0,0 +1 @@ +../commonFiles/communication_funcs.c \ No newline at end of file diff --git a/slsDetectorSoftware/mythenDetectorServer/communication_funcs.h b/slsDetectorSoftware/mythenDetectorServer/communication_funcs.h new file mode 120000 index 000000000..f220903b2 --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/communication_funcs.h @@ -0,0 +1 @@ +../commonFiles/communication_funcs.h \ No newline at end of file diff --git a/slsDetectorSoftware/mythenDetectorServer/firmware_funcs.c b/slsDetectorSoftware/mythenDetectorServer/firmware_funcs.c new file mode 100755 index 000000000..40c8f706b --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/firmware_funcs.c @@ -0,0 +1,924 @@ + +#include "server_defs.h" +#include "firmware_funcs.h" +#include "mcb_funcs.h" +#include "registers.h" + +#ifdef SHAREDMEMORY +#include "sharedmemory.h" +#endif + +#include +#include +#include + + +//for memory mapping +u_int32_t CSP0BASE; + +FILE *debugfp, *datafp; + +int fr; +int wait_time; +int *fifocntrl; +int *values; +int *statusreg; +const int nModY=1; +int nModBoard; +int nModX=NMAXMOD; +int dynamicRange=32; +int dataBytes=NMAXMOD*NCHIP*NCHAN*4; +int storeInRAM=0; +int *ram_values=NULL; +char *now_ptr=NULL; +int ram_size=0; + + +int ififostart, ififostop, ififostep, ififo; + + +#ifdef MCB_FUNCS +extern const int nChans; +extern const int nChips; +extern const int nDacs; +extern const int nAdcs; +#endif +#ifndef MCB_FUNCS + +const int nChans=NCHAN; +const int nChips=NCHIP; +const int nDacs=NDAC; +const int nAdcs=NADC; +#endif + +//int mybyte; +//int mysize=dataBytes/8; + +int mapCSP0(void) { + printf("Mapping memory\n"); +#ifndef VIRTUAL + int fd; + fd = open("/dev/mem", O_RDWR | O_SYNC, 0); + if (fd == -1) { + printf("\nCan't find /dev/mem!\n"); + return FAIL; + } + printf("/dev/mem opened\n"); + CSP0BASE = (u_int32_t)mmap(0, MEM_SIZE, PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED, fd, CSP0); + if (CSP0BASE == (u_int32_t)MAP_FAILED) { + printf("\nCan't map memmory area!!\n"); + return FAIL; + } + printf("CSP0 mapped\n"); + +#endif +#ifdef VIRTUAL + CSP0BASE = (u_int32_t)malloc(MEM_SIZE); + printf("memory allocated\n"); +#endif +#ifdef SHAREDMEMORY + if ( (res=inism(SMSV))<0) { + printf("error attaching shared memory! %i",res); + return FAIL; + } +#endif + printf("CSPOBASE=from %08x to %x\n",CSP0BASE,CSP0BASE+MEM_SIZE); + + values=(u_int32_t*)(CSP0BASE+FIFO_DATA_REG_OFF); + printf("values=%08x\n",values); + fifocntrl=(u_int32_t*)(CSP0BASE+FIFO_CNTRL_REG_OFF); + printf("fifcntrl=%08x\n",fifocntrl); + statusreg=(u_int32_t*)(CSP0BASE+STATUS_REG); + printf("statusreg=%08x\n",statusreg); + + return OK; +} + + +u_int32_t bus_w(u_int32_t offset, u_int32_t data) { + u_int32_t *ptr1; + + + ptr1=(u_int32_t*)(CSP0BASE+offset); + *ptr1=data; + + return OK; +} + + +u_int32_t bus_r(u_int32_t offset) { + u_int32_t *ptr1; + + ptr1=(u_int32_t*)(CSP0BASE+offset); + return *ptr1; +} + +// direct pattern output +u_int32_t putout(char *s, int modnum) { + int i; + u_int32_t pat; + int addr; + + if (strlen(s)<16) { + fprintf(stdout," *** putout error: incorrect pattern length ***\n"); + fprintf(stdout," %s \n",s); + return FAIL; + } + + pat=0; + for (i=0;i<16;i++) { + if (s[i]=='1') pat=pat+(1<>CLK_DIVIDER_OFFSET); +} + +u_int32_t getClockDivider() { + u_int32_t clk_div; + clk_div=((bus_r(SPEED_REG)&CLK_DIVIDER_MASK)>>CLK_DIVIDER_OFFSET); + return clk_div; +} + +u_int32_t setSetLength(int d) { + u_int32_t c; + c=bus_r(SPEED_REG); + bus_w(SPEED_REG,(d<>SET_LENGTH_OFFSET); +} + +u_int32_t getSetLength() { + u_int32_t clk_div; + clk_div=((bus_r(SPEED_REG)& SET_LENGTH_MASK)>>SET_LENGTH_OFFSET); + return clk_div; +} + + +u_int32_t setWaitStates(int d1) { + u_int32_t c; + int d=d1-2; + char cmd[100]; + sprintf(cmd,"bus -a 0xb0000000 -w 0xd000%1x",d1); + c=bus_r(SPEED_REG); + bus_w(SPEED_REG,(d<>WAIT_STATES_OFFSET); +} + +u_int32_t getWaitStates() { + u_int32_t clk_div; + clk_div=((bus_r(SPEED_REG)& WAIT_STATES_MASK)>>WAIT_STATES_OFFSET); + return clk_div; +} + + +u_int32_t setTotClockDivider(int d) { + u_int32_t c; + c=bus_r(SPEED_REG); + bus_w(SPEED_REG,(d<>TOTCLK_DIVIDER_OFFSET); +} + +u_int32_t getTotClockDivider() { + u_int32_t clk_div; + clk_div=((bus_r(SPEED_REG)&TOTCLK_DIVIDER_MASK)>>TOTCLK_DIVIDER_OFFSET); + return clk_div; +} + + +u_int32_t setExtSignal(int d, enum externalSignalFlag mode) { + + int modes[]={-1,EXT_SIG_OFF, EXT_GATE_IN_ACTIVEHIGH, EXT_GATE_IN_ACTIVELOW,EXT_TRIG_IN_RISING,EXT_TRIG_IN_FALLING,EXT_RO_TRIG_IN_RISING, EXT_RO_TRIG_IN_FALLING,EXT_GATE_OUT_ACTIVEHIGH, EXT_GATE_OUT_ACTIVELOW, EXT_TRIG_OUT_RISING, EXT_TRIG_OUT_FALLING, EXT_RO_TRIG_OUT_RISING, EXT_RO_TRIG_OUT_FALLING}; + + u_int32_t c; + int off=d*SIGNAL_OFFSET; + c=bus_r(EXT_SIGNAL_REG); + if (mode<=RO_TRIGGER_OUT_FALLING_EDGE) + bus_w(EXT_SIGNAL_REG,((modes[mode])<>off); + + + + if (mode=(FPGA_VERSION_VAL&0x00ffffff)) { + printf("FPGA version ok!! %x\n",val); + } else { + printf("FPGA version too old! %x\n",val); + return FAIL; + } + //dummy register + val=0xF0F0F0F0; + bus_w(DUMMY_REG, val); + val=bus_r(DUMMY_REG); + if (val==0xF0F0F0F0) { + printf("FPGA dummy register ok!! %x\n",val); + } else { + printf("FPGA dummy register wrong!! %x\n",val); + result=FAIL; + // return FAIL; + } + //dummy register + val=0x0F0F0F0F; + bus_w(DUMMY_REG, val); + val=bus_r(DUMMY_REG); + if (val==0x0F0F0F0F) { + printf("FPGA dummy register ok!! %x\n",val); + } else { + printf("FPGA dummy register wrong!! %x\n",val); + result=FAIL; + // return FAIL; + } + return result; +} + +int getNModBoard() { + int nmodboard; + u_int32_t val; + val=bus_r(FPGA_VERSION_REG)&0xff000000; + nmodboard=val >> 24; +#ifdef VERY_VERBOSE + printf("The board hosts %d modules\n",nmodboard); +#endif + nModBoard=nmodboard; + //getNModBoard()=nmodboard; + return nmodboard; +} + +int setNMod(int n) { + + int fifo; + int ifsta, ifsto, ifste; + if (n>0 && n<=getNModBoard()) { + nModX=n; + dataBytes=nModX*nModY*NCHIP*NCHAN*dynamicRange/8; + allocateRAM(); + } + + + /* should enable all fifos*/ + bus_w(FIFO_CNTRL_REG_OFF+(ALLFIFO<> 32; + vMSB=v64&(0xffffffff); + bus_w(aMSB,vMSB); + } + return get64BitReg(aLSB, aMSB); + +} + +int64_t get64BitReg(int aLSB, int aMSB){ + int64_t v64; + u_int32_t vLSB,vMSB; + vLSB=bus_r(aLSB); + vMSB=bus_r(aMSB); + v64=vMSB; + v64=(v64<<32) | vLSB; + return v64; +} + +int64_t setFrames(int64_t value){ + return set64BitReg(value, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG); +} + +int64_t getFrames(){ + return get64BitReg(GET_FRAMES_LSB_REG, GET_FRAMES_MSB_REG); +} + +int64_t setExposureTime(int64_t value){ + /* time is in ns */ + if (value!=-1) { + value*=(1E-9*CLK_FREQ); + } + return set64BitReg(value,SET_EXPTIME_LSB_REG, SET_EXPTIME_MSB_REG)/(1E-9*CLK_FREQ); +} + +int64_t getExposureTime(){ + return get64BitReg(GET_EXPTIME_LSB_REG, GET_EXPTIME_MSB_REG)/(1E-9*CLK_FREQ); +} + +int64_t setGates(int64_t value){ + return set64BitReg(value, SET_GATES_LSB_REG, SET_GATES_MSB_REG); +} + +int64_t getGates(){ + return get64BitReg(GET_GATES_LSB_REG, GET_GATES_MSB_REG); +} + +int64_t setPeriod(int64_t value){ + /* time is in ns */ + if (value!=-1) { + value*=(1E-9*CLK_FREQ); + } + return set64BitReg(value,SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG)/(1E-9*CLK_FREQ); +} + +int64_t getPeriod(){ + return get64BitReg(GET_PERIOD_LSB_REG, GET_PERIOD_MSB_REG)/(1E-9*CLK_FREQ); +} + +int64_t setDelay(int64_t value){ + /* time is in ns */ + if (value!=-1) { + value*=(1E-9*CLK_FREQ); + } + return set64BitReg(value,SET_DELAY_LSB_REG, SET_DELAY_MSB_REG)/(1E-9*CLK_FREQ); +} + +int64_t getDelay(){ + return get64BitReg(GET_DELAY_LSB_REG, GET_DELAY_MSB_REG)/(1E-9*CLK_FREQ); +} + +int64_t setTrains(int64_t value){ + return set64BitReg(value, SET_TRAINS_LSB_REG, SET_TRAINS_MSB_REG); +} + +int64_t getTrains(){ + return get64BitReg(GET_TRAINS_LSB_REG, GET_TRAINS_MSB_REG); +} + + +int64_t setProbes(int64_t value){ + int ow; + switch (getDynamicRange()) { + case 32: + ow=1; + break; + case 16: + ow=2; + break; + case 8: + ow=4; + break; + case 4: + ow=8; + break; + case 1: + ow=5; + default: + ow=1; + } + + if (value>=0) { + setCSregister(ALLMOD); + initChipWithProbes(0, ow,value, ALLMOD); + putout("0000000000000000",ALLMOD); + } + return getProbes(); +} + +int64_t getProbes(){ + u_int32_t shiftin=bus_r(GET_SHIFT_IN_REG); + u_int32_t np=(shiftin >>PROBES_OFF) & PROBES_MASK; +#ifdef VERYVERBOSE + printf("%08x ",shiftin); + printf("probes==%01x\n",np); +#endif + + return np; + +} + + + + + + +u_int32_t runBusy(void) { + return bus_r(STATUS_REG)&RUN_BUSY_BIT; +} + +u_int32_t dataPresent(void) { + return bus_r(LOOK_AT_ME_REG); +} + +u_int32_t runState(void) { + int s=bus_r(STATUS_REG); +#ifdef SHAREDMEMORY + if (s&RUN_BUSY_BIT) + write_status_sm("Running"); + else + write_status_sm("Stopped"); +#endif + return s; +} + + +// State Machine + +u_int32_t startStateMachine(){ +#ifdef VERBOSE + printf("Starting State Machine\n"); +#endif + fifoReset(); + now_ptr=(char*)ram_values; +#ifdef SHAREDMEMORY + write_stop_sm(0); + write_status_sm("Started"); +#endif +#ifdef MCB_FUNCS + setCSregister(ALLMOD); + clearSSregister(ALLMOD); +#endif + putout("0000000000000000",ALLMOD); + bus_w(CONTROL_REG, START_ACQ_BIT | START_EXPOSURE_BIT); + return OK; +} + + + + +u_int32_t stopStateMachine(){ + +#ifdef VERBOSE + printf("Stopping State Machine\n"); +#endif +#ifdef SHAREDMEMORY + write_stop_sm(1); + write_status_sm("Stopped"); +#endif + bus_w(CONTROL_REG, STOP_ACQ_BIT); + usleep(500); + if (!runBusy()) + return OK; + else + return FAIL; +} + + +u_int32_t startReadOut(){ + u_int32_t status; +#ifdef VERBOSE + printf("Starting State Machine Readout\n"); +#endif + status=bus_r(STATUS_REG)&RUN_BUSY_BIT; +#ifdef DEBUG + printf("State machine status is %08x\n",bus_r(STATUS_REG)); +#endif + bus_w(CONTROL_REG, START_ACQ_BIT |START_READOUT_BIT); // start readout + return OK; +} + + +// fifo routines + +u_int32_t fifoReset(void) { +#ifdef DEBUG + printf("resetting fifo\n"); +#endif + bus_w(FIFO_CNTRL_REG_OFF+(ALLFIFO<0) { + now_ptr+=dataBytes; + } + return ram_values; + +} + + + +u_int32_t* decode_data(int *datain) +{ + int *dataout; + const char one=1; + const int bytesize=8; + char *ptr=(char*)datain; + //int nbits=dynamicRange; + int ipos=0, ichan=0;; + //int nch, boff=0; + int ibyte, ibit; + char iptr; + + dataout=malloc(nChans*nChips*nModX*4); + ichan=0; + switch (dynamicRange) { + case 1: + for (ibyte=0; ibyte>ichan)&0xf; + dataout[ichan]=(iptr>>(ipos))&0x1; + ichan++; + } + } + break; + case 4: + for (ibyte=0; ibyte>ichan)&0xf; + dataout[ichan]=(iptr>>(ipos*4))&0xf; + ichan++; + } + } + break; + case 8: + for (ichan=0; ichan0) { + if (dr<=1) { + dynamicRange=1; + ow=5; + } else if (dr<=4) { + dynamicRange=4; + ow=4; + } else if (dr<=8) { + dynamicRange=8; + ow=3; + } else if (dr<=16) { + dynamicRange=16; + ow=2; + } else { + dynamicRange=32; + ow=0; //or 1? + } + setCSregister(ALLMOD); + initChipWithProbes(0, ow,np, ALLMOD); + putout("0000000000000000",ALLMOD); + + } + + + return getDynamicRange(); +} + + + + + + +int getDynamicRange() { + int dr; + u_int32_t shiftin=bus_r(GET_SHIFT_IN_REG); + u_int32_t outmux=(shiftin >> OUTMUX_OFF) & OUTMUX_MASK; +#ifdef VERYVERBOSE + printf("%08x ",shiftin); + printf("outmux==%02x\n",outmux); +#endif + + switch (outmux) { + case 2: + dr=16; + break; + case 4: + dr=8; + break; + case 8: + dr=4; + break; + case 16: + dr=1; + break; + default: + dr=32; + } + dynamicRange=dr; + dataBytes=nModX*nModY*NCHIP*NCHAN*dynamicRange/8; + if (allocateRAM()==OK) { + ; + } else + printf("ram not allocated\n"); + + return dynamicRange; + +} + +int testBus() { + int j; + char cmd[100]; + u_int32_t val; + printf("%s\n",cmd); + system(cmd); + for (j=0; j<1000000; j++) { + val=bus_r(FIX_PATT_REG); + if (val!=0xacdc1980){ + printf("%d %x\n",j, val); + return FAIL; + } + } + return OK; +} + + +int setStoreInRAM(int b) { + if (b) + storeInRAM=1; + else + storeInRAM=0; + return allocateRAM(); +} + + +int allocateRAM() { + size_t size; + + // ret=clearRAM(); + if (storeInRAM) { + size=dataBytes*setFrames(-1); +#ifdef VERBOSE + // printf("nmodx=%d nmody=%d dynamicRange=%d dataBytes=%d nFrames=%d size=%d\n",nModX,nModY,dynamicRange,dataBytes,setFrameNumber(-1),size ); +#endif + if (size +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +int mapCSP0(void); +u_int32_t bus_w(u_int32_t offset, u_int32_t data); +u_int32_t bus_r(u_int32_t offset); + + +u_int32_t putout(char *s, int modnum); +u_int32_t readin(int modnum); +u_int32_t setClockDivider(int d); +u_int32_t getClockDivider(); +u_int32_t setSetLength(int d); +u_int32_t getSetLength(); +u_int32_t setWaitStates(int d); +u_int32_t getWaitStates(); +u_int32_t setTotClockDivider(int d); +u_int32_t getTotClockDivider(); + +u_int32_t setExtSignal(int d, enum externalSignalFlag mode); +int getExtSignal(int d); + + + + +u_int64_t getMcsNumber(); +u_int32_t getMcsVersion(); +u_int32_t testFifos(void); +u_int32_t testFpga(void); +int testBus(void); +int64_t set64BitReg(int64_t value, int aLSB, int aMSB); +int64_t get64BitReg(int aLSB, int aMSB); + +int64_t setFrames(int64_t value); +int64_t getFrames(); + +int64_t setExposureTime(int64_t value); +int64_t getExposureTime(); + +int64_t setGates(int64_t value); +int64_t getGates(); + +int64_t setDelay(int64_t value); +int64_t getDelaye(); + +int64_t setPeriod(int64_t value); +int64_t getPeriod(); + +int64_t setTrains(int64_t value); +int64_t getTrains(); + +int64_t setProbes(int64_t value); +int64_t getProbes(); + +u_int32_t runBusy(void); +u_int32_t runState(void); +u_int32_t dataPresent(void); + + +u_int32_t startStateMachine(); +u_int32_t stopStateMachine(); +u_int32_t startReadOut(); +u_int32_t fifoReset(void); +u_int32_t fifoReadCounter(int fifonum); +u_int32_t fifoReadStatus(); + + +u_int32_t fifo_full(void); + + + +u_int32_t* fifo_read_event(); +u_int32_t* decode_data(int* datain); +//u_int32_t move_data(u_int64_t* datain, u_int64_t* dataout); +int setDynamicRange(int dr); +int getDynamicRange(); +int getNModBoard(); +int setNMod(int n); +int setStoreInRAM(int b); +int allocateRAM(); +int clearRAM(); + +/* + +u_int32_t setNBits(u_int32_t); +u_int32_t getNBits(); +*/ + +/* +//move to mcb_funcs? + +int readOutChan(int *val); +u_int32_t getModuleNumber(int modnum); +int testShiftIn(int imod); +int testShiftOut(int imod); +int testShiftStSel(int imod); +int testDataInOut(int num, int imod); +int testExtPulse(int imod); +int testExtPulseMux(int imod, int ow); +int testDataInOutMux(int imod, int ow, int num); +int testOutMux(int imod); +int testFpgaMux(int imod); +int calibration_sensor(int num, int *values, int *dacs) ; +int calibration_chip(int num, int *values, int *dacs); +*/ + + +#endif diff --git a/slsDetectorSoftware/mythenDetectorServer/mcb_funcs.c b/slsDetectorSoftware/mythenDetectorServer/mcb_funcs.c new file mode 100755 index 000000000..313fc89ba --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/mcb_funcs.c @@ -0,0 +1,2433 @@ +#ifdef MCB_FUNCS + +#include +#include +#include +#include +#include + + +#include "server_defs.h" +#include "firmware_funcs.h" +#include "mcb_funcs.h" + +/* global variables */ +#undef DEBUG +#undef DEBUGOUT + +extern int nModX; +const int nChans=NCHAN; +const int nChips=NCHIP; +const int nDacs=NDAC; +const int nAdcs=NADC; +const enum detectorType myDetectorType=MYTHEN; +enum detectorSettings thisSettings; + +int sChan, sChip, sMod, sDac, sAdc; +const int allSelected=-2; +const int noneSelected=-1; + + +sls_detector_module *detectorModules=NULL; +int *detectorChips=NULL; +int *detectorChans=NULL; +float *detectorDacs=NULL; +float *detectorAdcs=NULL; +//int numberOfProbes; + + + + + + + + +int initDetector() { + int imod; + // sls_detector_module *myModule; + int n=getNModBoard(); + + detectorModules=malloc(n*sizeof(sls_detector_module)); + detectorChips=malloc(n*NCHIP*sizeof(int)); + + detectorChans=malloc(n*NCHIP*NCHAN*sizeof(int)); + detectorDacs=malloc(n*NDAC*sizeof(float)); + detectorAdcs=malloc(n*NADC*sizeof(float)); +#ifdef VERBOSE + printf("modules from 0x%x to 0x%x\n",detectorModules, detectorModules+n); + printf("chips from 0x%x to 0x%x\n",detectorChips, detectorChips+n*NCHIP); + printf("chans from 0x%x to 0x%x\n",detectorChans, detectorChans+n*NCHIP*NCHAN); + printf("dacs from 0x%x to 0x%x\n",detectorDacs, detectorDacs+n*NDAC); + printf("adcs from 0x%x to 0x%x\n",detectorAdcs, detectorAdcs+n*NADC); +#endif + for (imod=0; imoddacs=detectorDacs+imod*NDAC; + (detectorModules+imod)->adcs=detectorAdcs+imod*NADC; + (detectorModules+imod)->chipregs=detectorChips+imod*NCHIP; + (detectorModules+imod)->chanregs=detectorChans+imod*NCHIP*NCHAN; + (detectorModules+imod)->ndac=NDAC; + (detectorModules+imod)->nadc=NADC; + (detectorModules+imod)->nchip=NCHIP; + (detectorModules+imod)->nchan=NCHIP*NCHAN; + (detectorModules+imod)->module=imod; + (detectorModules+imod)->gain=0; + (detectorModules+imod)->offset=0; + /* initialize registers, dacs, retrieve sn, adc values etc */ + } + thisSettings=UNINITIALIZED; + sChan=noneSelected; + sChip=noneSelected; + sMod=noneSelected; + sDac=noneSelected; + sAdc=noneSelected; + setCSregister(ALLMOD); + setSSregister(ALLMOD); + counterClear(ALLMOD); + clearSSregister(ALLMOD); + putout("0000000000000000",ALLMOD); + + /* initialize dynamic range etc. */ + nModX=n; + initChip(0, 1,ALLMOD); + // allocateRAM(); + + + + + return OK; +} + + + + +int copyChannel(sls_detector_channel *destChan, sls_detector_channel *srcChan) { + destChan->chan=srcChan->chan; + destChan->chip=srcChan->chip; + destChan->module=srcChan->module; + destChan->reg=srcChan->reg; + return OK; +} + + +int copyChip(sls_detector_chip *destChip, sls_detector_chip *srcChip) { + + int ichan; + int ret=OK; + if ((srcChip->nchan)>(destChip->nchan)) { + printf("Number of channels of source is larger than number of channels of destination\n"); + return FAIL; + } + + destChip->nchan=srcChip->nchan; + destChip->reg=srcChip->reg; + destChip->chip=srcChip->chip; + destChip->module=srcChip->module; + for (ichan=0; ichan<(srcChip->nchan); ichan++) { + *((destChip->chanregs)+ichan)=*((srcChip->chanregs)+ichan); + } + return ret; +} + + +int copyModule(sls_detector_module *destMod, sls_detector_module *srcMod) { + + int ichip, idac, ichan, iadc; + + int ret=FAIL; + if (srcMod->module>=0) + destMod->module=srcMod->module; + + if (srcMod->serialnumber>=0) + destMod->serialnumber=srcMod->serialnumber; + + if ((srcMod->nchip)>(destMod->nchip)) { + printf("Number of chip of source is larger than number of chips of destination\n"); + return FAIL; + } + if ((srcMod->nchan)>(destMod->nchan)) { + printf("Number of channels of source is larger than number of channels of destination\n"); + return FAIL; + } + if ((srcMod->ndac)>(destMod->ndac)) { + printf("Number of dacs of source is larger than number of dacs of destination\n"); + return FAIL; + } + if ((srcMod->nadc)>(destMod->nadc)) { + printf("Number of dacs of source is larger than number of dacs of destination\n"); + return FAIL; + } + destMod->ndac=srcMod->ndac; + destMod->nadc=srcMod->nadc; + destMod->nchip=srcMod->nchip; + destMod->nchan=srcMod->nchan; + if (srcMod->reg>=0) + destMod->reg=srcMod->reg; + + if (srcMod->gain>=0) + destMod->gain=srcMod->gain; + if (srcMod->offset>=0) + destMod->offset=srcMod->offset; + + // printf("copying gain and offset %f %f to %f %f\n",srcMod->gain,srcMod->offset,destMod->gain,destMod->offset); + + for (ichip=0; ichip<(srcMod->nchip); ichip++) { + if (*((srcMod->chipregs)+ichip)>=0) + *((destMod->chipregs)+ichip)=*((srcMod->chipregs)+ichip); + } + for (ichan=0; ichan<(srcMod->nchan); ichan++) { + if (*((srcMod->chanregs)+ichan)>=0) + *((destMod->chanregs)+ichan)=*((srcMod->chanregs)+ichan); + } + for (idac=0; idac<(srcMod->ndac); idac++) { + if (*((srcMod->dacs)+idac)>=0) + *((destMod->dacs)+idac)=*((srcMod->dacs)+idac); + } + for (iadc=0; iadc<(srcMod->nadc); iadc++) { + if (*((srcMod->adcs)+iadc)>=0) + *((destMod->adcs)+iadc)=*((srcMod->adcs)+iadc); + } + + return ret; +} + + + +/* Register commands */ + + +int clearDACSregister(int imod) { + putout("0000000001000000",imod); + putout("0000000101000000",imod); + putout("0000000101000000",imod); + putout("0000000001000000",imod); +#ifdef DEBUG + fprintf(stdout, "Clearing DAC shiftregister\n"); +#endif + /* + sChan=noneSelected; + sChip=noneSelected; + sMod=noneSelected; + sDac=noneSelected; + sAdc=noneSelected; + */ + sDac=0; + sMod=imod; + if (imod==ALLMOD) + sMod=allSelected; + return OK; +} + +int nextDAC(int imod) { + putout("0000000001000000",imod); + putout("0000000001001000",imod); + putout("0000000001000000",imod); +#ifdef DEBUG + fprintf(stdout, "Next DAC\n"); +#endif + sDac++; + sMod=imod; + if (imod==ALLMOD) + sMod=allSelected; + return OK; +} + + +int clearCSregister(int imod) { + + putout("0000000001000000",imod); + putout("0000100001000000",imod); + putout("0000100001000000",imod); + putout("0000000001000000",imod); +#ifdef DEBUG + fprintf(stdout, "Clearing CS shiftregister\n"); +#endif + /* + sChan=noneSelected; + sMod=noneSelected; + sDac=noneSelected; + sAdc=noneSelected; + */ + sChip=noneSelected; + sMod=imod; + if (imod==ALLMOD) + sMod=allSelected; + //putout("0000000000000000",imod); + return 0; +} + +int setCSregister(int imod){ + + putout("0000000001000000",imod); + putout("0001000001000000",imod); + putout("0001000001000000",imod); + putout("0000000001000000",imod); +#ifdef DEBUG + fprintf(stdout, "Setting CS shiftregister\n"); +#endif + putout("0000000000000000",imod); + sChip=allSelected; + sMod=imod; + if (imod==ALLMOD) + sMod=allSelected; + return 0; +} + +int nextChip(int imod){ + + putout("0000000001000000",imod); + putout("0010000001000000",imod); + putout("0000000001000000",imod); +#ifdef DEBUG + fprintf(stdout, "Next Chip\n"); +#endif + sChip++; + sMod=imod; + if (imod==ALLMOD) + sMod=allSelected; + return 0; +} + +int firstChip(int imod){ + + putout("0100000001000000",imod); + putout("0110000001000000",imod); + putout("0100000001000000",imod); +#ifdef DEBUG + fprintf(stdout, "First Chip\n"); +#endif + sChip=0; + sMod=imod; + if (imod==ALLMOD) + sMod=allSelected; + return 0; +} + +int clearSSregister(int imod){ + int i; + putout("0000011000000000",imod); + for (i=0; i<10; i++) + putout("0000111000000000",imod); + putout("0000011000000000",imod); +#ifdef DEBUG + fprintf(stdout,"Clearing SS shiftregister\n"); +#endif + putout("0000000000000000",imod); + sChan=noneSelected; + sMod=imod; + if (imod==ALLMOD) + sMod=allSelected; + return 0; +} + +int setSSregister(int imod){ + int i; + putout("0000011000000000",imod); + for (i=0; i<10; i++) + putout("0001011000000000",imod); + putout("0000011000000000",imod); +#ifdef DEBUG + fprintf(stdout,"Setting SS shiftregister\n"); +#endif + putout("0000000000000000",imod); + sChan=allSelected; + sMod=imod; + if (imod==ALLMOD) + sMod=allSelected; + return 0; +} + +int nextStrip(int imod){ + putout("0000011000000000",imod); + putout("0010011000000000",imod); + putout("0000011000000000",imod); +#ifdef DEBUG + fprintf(stdout,"|-"); +#endif + sChan++; + sMod=imod; + if (imod==ALLMOD) + sMod=allSelected; + return 0; +} + +int selChannel(const int strip,int imod) { + int istrip; + clearSSregister(imod); + nextStrip(imod); + for (istrip=0; istrip=0 && imoddacs[idac]=v; +#ifdef VERBOSE + printf("module=%d index=%d, val=%d\n",imod, idac, v); +#endif + detectorDacs[idac+NDAC*imod]=v; + } else if (imod==ALLMOD) { + for (im=0; imdacs[idac]=v; + } + } + } + return OK; +} + +int set_one_dac(int imod) { + int control, ibit; + int bit, value; + control=13; + value=(DAC_REFOUT<<10) | (control<< 12); +#ifdef DEBUGOUT + fprintf(stdout,"value=%d\n",value); +#endif + for (ibit=0; ibit<6; ibit++) { + bit=value & (1<<(15-ibit)); + if (bit) { + putout("0000010001000000",imod); + putout("0000011001000000",imod); + putout("0000010001000000",imod); +#ifdef DEBUGOUT + fprintf(stdout,"1"); +#endif + } else { + putout("0000000001000000",imod); + putout("0000001001000000",imod); + putout("0000000001000000",imod); +#ifdef DEBUGOUT + fprintf(stdout,"0"); +#endif + } + } + for (ibit=0; ibit<10; ibit++) { + putout("0000000001000000",imod); + putout("0000001001000000",imod); + putout("0000000001000000",imod); +#ifdef DEBUGOUT + fprintf(stdout,"0"); +#endif + } + +#ifdef DEBUGOUT + fprintf(stdout,"\n"); +#endif + return OK; +} + +float initDACbyIndex(int ind,float val, int imod) { + int v; + const float partref[NDAC]=PARTREF; + const float partr1[NDAC]=PARTR1; + const float partr2[NDAC]=PARTR2; + + float ref=partref[ind]; + float r1=partr1[ind]; + float r2=partr2[ind]; + + + v=(val+(val-ref)*r1/r2)*DAC_DR/DAC_MAX; + initDACbyIndexDACU(ind,v,imod); + + return val; +} + +float initDACbyIndexDACU(int ind, int val, int imod) { + + const float daccs[NDAC]=DACCS; + const float dacaddr[NDAC]=DACADDR; + + int cs=daccs[ind]; + int addr=dacaddr[ind]; + int iv; + + + initDAC(cs, addr,val, imod); + /*#ifdef VERBOSE + iv=detectorDacs[ind+imod*NDAC]; + printf("module=%d index=%d, cs=%d, addr=%d, dacu=%d, set to %d",imod, ind,cs,addr,val,iv); +#endif + */ + return val; +} + +int getThresholdEnergy() { + float g[3]=DEFAULTGAIN; + float o[3]=DEFAULTOFFSET; + float myg=-1, myo=-1; + int dacu; + int imod; + int ethr=-1; + int ret=FAIL; + + if (detectorModules) { + // for (imod=0; imodgain,(detectorModules+imod)->offset); +#endif + if ((detectorModules+imod)->gain>0) + myg=(detectorModules+imod)->gain; + else { + if (thisSettings>=0 && thisSettings<3) + myg=g[thisSettings]; + // else + //myg=-1; + } + + if ((detectorModules+imod)->offset>0) + myo=(detectorModules+imod)->offset; + else { + if (thisSettings>=0 && thisSettings<3) + myo=o[thisSettings]; + // else + //myo=-1; + } + + if (myg>0 && myo>0) + ethr=(myo-detectorDacs[VTHRESH+imod*NDAC])*1000/myg; + // else + // ethr=-1; + +#ifdef VERBOSE + printf("module=%d gain=%f, offset=%f, dacu=%f\n",imod, myg, myo, detectorDacs[VTHRESH+imod*NDAC]); + printf("Threshold energy of module %d is %d eV\n", imod, ethr); +#endif + + if (imod==0) + ret=ethr; + else { + if (ethr>(ret+100) || ethr<(ret-100)) + return FAIL; + } + } + } + return ret; +} + +int setThresholdEnergy(int ethr) { + float g[3]=DEFAULTGAIN; + float o[3]=DEFAULTOFFSET; + float myg=-1, myo=-1; + int dacu; + int imod; + int ret=ethr; + + setSettings(GET_SETTINGS); + if (thisSettings>=0 || thisSettings<3){ + myg=g[thisSettings]; + myo=o[thisSettings]; + } + for (imod=0; imodgain>0) + myg=(detectorModules+imod)->gain; + else + if (thisSettings>=0 && thisSettings<3) + myg=g[thisSettings]; + else + myg=-1; + if ((detectorModules+imod)->offset>0) + myo=(detectorModules+imod)->offset; + else + if (thisSettings>=0 && thisSettings<3) + myo=o[thisSettings]; + else + myo=-1; + } else { + if (thisSettings>=0 && thisSettings<3) + myo=o[thisSettings]; + else + myo=-1; + if (thisSettings>=0 && thisSettings<3) + myg=g[thisSettings]; + else + myg=-1; + } + if (myg>0 && myo>0) { + dacu=myo-myg*((float)ethr)/1000.; +#ifdef VERBOSE + printf("module %d (%x): gain %f, off %f, energy %d eV, dac %d\n",imod,(detectorModules+imod),(detectorModules+imod)->gain,(detectorModules+imod)->offset, ethr,dacu); +#endif + initDACbyIndexDACU(VTHRESH, dacu, imod); + } else + printf("could not set threshold energy for module %d, settings %d (offset is %f; gain is %f)\n",imod,myo,myg); + } + return ret; +} + + + +float getDACbyIndexDACU(int ind, int imod) { + + if (detectorDacs) + return (detectorDacs[ind+imod*NDAC]); + else + return FAIL; +} + + + +int initDAC(int dac_cs, int dac_addr, int value, int imod) { + int i; +#ifdef DEBUGOUT + printf("Programming dac %d %d with value %d\n", dac_cs, dac_addr, value); +#endif + clearDACSregister(imod); + /*if (dac_cs>0) {*/ + for (i=0; i0) {*/ + for (i=0; i=0) { +#ifdef VERBOSE + fprintf(stdout, "voltage %d\n", *(v+i)); +#endif + program_one_dac(iaddr, *(v+i),imod); + } + nextDAC(imod); + } + } + clearDACSregister(imod); + for (ichip=0; ichip<3; ichip++) { + set_one_dac(imod); + nextDAC(imod); + } + + return 0; +} + + + + +int setSettings(int i) { + int imod, isett, is; + int rgpr[]=RGPRVALS; + int rgsh1[]=RGSH1VALS; + int rgsh2[]=RGSH2VALS; + int irgpr, irgsh1, irgsh2; + + int v[NDAC]; + int ind; + for (ind=0; ind>(NTRIMBITS+1))&1; + int ae=(reg>>(NTRIMBITS+2))&1; + int coe=(reg>>(NTRIMBITS+3))&1; + int ocoe=(reg>>(NTRIMBITS+4))&1; + int counts=(reg>>(NTRIMBITS+5)); + + + if (myChan.chip<0) + setCSregister(myChan.module); + else + selChip(myChan.chip,myChan.module); + + if (myChan.chan<0) + setSSregister(myChan.module); + else + selChannel(myChan.chan,myChan.module); + + initChannel(ft,cae,ae, coe, ocoe, counts,myChan.module); + return myChan.reg; + +} + +int getChannelbyNumber(sls_detector_channel* myChan) { + int imod, ichip, ichan; + imod=myChan->module; + ichip=myChan->chip; + ichan=myChan->chan; + + if (detectorChans) + myChan->reg=detectorChans[imod*NCHAN*NCHIP+ichip*NCHAN+ichan]; + else + return FAIL; + return OK; + +} +int getTrimbit(int imod, int ichip, int ichan) { + if (detectorChans) + return (detectorChans[imod*NCHAN*NCHIP+ichip*NCHAN+ichan] & TRIM_DR); + else + return -1; +} + +int initChannel(int ft,int cae, int ae, int coe, int ocoe, int counts, int imod){ + + int ibit, bit, i, im, ichip, ichan; + int chanmi, chanma, chipmi, chipma, modmi, modma; + + + + sMod=imod; + // printf("initializing module %d\n",sMod); + if (imod==ALLMOD) { + sMod=allSelected; + + // printf("initializing all modules\n"); + } + + if (sChan==allSelected) { + // printf("initializing all channels ft=%d coe=%d\n",ft,coe); + chanmi=0; + chanma=NCHAN; + } else if (sChan==noneSelected || sChan>NCHAN || sChan<0) { + // printf("initializing no channels ft=%d coe=%d\n",ft,coe); + chanmi=0; + chanma=-1; + } else { + // printf("initializing channel %d ft=%d coe=%d\n",sChan, ft,coe); + chanmi=sChan; + chanma=sChan+1; + } + + if (sChip==allSelected) { + // printf("initializing all chips\n"); + chipmi=0; + chipma=NCHIP; + } else if (sChip==noneSelected || sChip>NCHIP || sChip<0) { + // printf("initializing no chips\n"); + chipmi=0; + chipma=-1; + } else { + // printf("initializing chip %d\n",sChip); + chipmi=sChip; + chipma=sChip+1; + } + + + if (sMod==allSelected) { + modmi=0; + modma=getNModBoard(); + } else if (sMod==noneSelected || sMod>getNModBoard() || sMod<0) { + modmi=0; + modma=-1; + return 1; + } else { + modmi=sMod; + modma=sMod+1; + } + + if (detectorChans) { + for (im=modmi; im63 || ft<0) { + fprintf(stdout,"Fine Threshold is %d while should be between 0 and 63!",ft); + return 1; + } + /*cal_enable*/ + if (cae) { + putout("0100000000000000",imod); + putout("0110000000000000",imod); + } else { + putout("0000000000000000",imod); + putout("0010000000000000",imod); + } + /*n_an_enable*/ + if (ae) { + putout("0000000000000000",imod); + putout("0010000000000000",imod); + putout("0000000000000000",imod); + } else { + putout("0100000000000000",imod); + putout("0110000000000000",imod); + putout("0100000000000000",imod); + } + /*trb5*/ + ibit=5; + bit=ft & (1<>1; + int nchan, ichan; + int ft, cae, ae, coe, ocoe, counts, chanreg; + + + + nchan=myChip.nchan; + if (ichip<0) + setCSregister(imod); + else + selChip(ichip,imod); + + clearSSregister(imod); + for (ichan=0; ichan>(NTRIMBITS+1))&1; + ae=(chanreg>>(NTRIMBITS+2))&1; + coe=((chanreg)>>(NTRIMBITS+3))&1; + ocoe=((chanreg)>>(NTRIMBITS+4))&1; + counts=((chanreg)>>(NTRIMBITS+5)); + nextStrip(imod); + initChannel(ft,cae,ae, coe, ocoe, counts,imod); + } + initChip(obe,ow,imod); + return myChip.reg; + +} + +int getChipbyNumber(sls_detector_chip* myChip){ + int imod, ichip; + imod=myChip->module; + ichip=myChip->chip; + + if (detectorChips) { + myChip->reg=detectorChips[ichip+imod*NCHIP]; + myChip->nchan=NCHAN; + myChip->chanregs=detectorChans+imod*NCHAN*NCHIP+ichip*NCHIP; + } + return OK; + +} + + + +int initChip(int obe, int ow,int imod){ + int i; + int im, ichip; + int chipmi, chipma, modmi, modma; + /* switch (ow) { + case 0:; + case 1: + setDynamicRange(32); + break; + case 2: + setDynamicRange(16); + break; + case 3: + setDynamicRange(8); + break; + case 4: + setDynamicRange(4); + break; + case 5: + setDynamicRange(1); + break; + default: + setDynamicRange(32); + break; + } + */ + +#ifdef DEBUGOUT + printf("Initializing chip\n"); +#endif + putout("0000000000000000",imod); +#ifdef DEBUGOUT + printf("Output mode= %d\n", ow); +#endif + + /* clearing shift in register */ + for (i=0; i<10; i++) + putout("0000100000000000",imod); + putout("0000000000000000",imod); + + if (ow>0) { + putout("0100000000000000",imod); + putout("0110000000000000",imod); + putout("0100000000000000",imod); + for (i=0; i<(OUTMUX_OFFSET-1); i++) { + putout("0000000000000000",imod); + putout("0010000000000000",imod); + putout("0000000000000000",imod); + } + if (ow>1) { + putout("0000000000000000",imod); + putout("0010000000000000",imod); + putout("0000000000000000",imod); + } + if (ow>2) { + putout("0000000000000000",imod); + putout("0010000000000000",imod); + putout("0000000000000000",imod); + } + if (ow>3) { + putout("0000000000000000",imod); + putout("0010000000000000",imod); + putout("0000000000000000",imod); + } + if (ow>4) { + putout("0000000000000000",imod); + putout("0010000000000000",imod); + putout("0000000000000000",imod); + } + } +#ifdef DEBUGOUT + printf("Output buffer enable= %d\n", obe); +#endif + if (obe) { + putout("0100000000000000",imod); + putout("0110000000000000",imod); + putout("0100000000000000",imod); + } else { + putout("0000000000000000",imod); + putout("0010000000000000",imod); + putout("0000000000000000",imod); + } + /*}*/ + putout("0000000000000000",imod); + + + + + + sMod=imod; + if (imod==ALLMOD) + sMod=allSelected; + + + if (sChip==allSelected) { + chipmi=0; + chipma=NCHIP; + } else if (sChip==noneSelected || sChip>NCHIP || sChip<0) { + chipmi=0; + chipma=-1; + } else { + chipmi=sChip; + chipma=sChip+1; + } + + + if (sMod==allSelected) { + modmi=0; + modma=getNModBoard(); + } else if (sMod==noneSelected || sMod>getNModBoard() || sMod<0) { + modmi=0; + modma=-1; + } else { + modmi=sMod; + modma=sMod+1; + } + + if (detectorChips) { + for (im=modmi; imNCHIP || sChip<0) { + chipmi=0; + chipma=-1; + } else { + chipmi=sChip; + chipma=sChip+1; + } + + + if (sMod==allSelected) { + modmi=0; + modma=getNModBoard(); + } else if (sMod==noneSelected || sMod>getNModBoard() || sMod<0) { + modmi=0; + modma=-1; + } else { + modmi=sMod; + modma=sMod+1; + } + + if (detectorChips) { + for (im=modmi; imgetNModBoard() || sMod<0) { + modmi=0; + modma=-1; + } else { + modmi=sMod; + modma=sMod+1; + } + + if (detectorModules) { + for (im=modmi; imreg)=cm; +#ifdef VERBOSE + printf("imod=%d reg=%d (%x)\n",im,(detectorModules+im)->reg,(detectorModules+im)); +#endif + } + } + return 0; +} + +int initModulebyNumber(sls_detector_module myMod) { + + + int ichip, nchip, ichan, nchan; + int im, modmi,modma; + int ft, cae, ae, coe, ocoe, counts, chanreg; + int imod; + int obe; + int ow; + int v[NDAC]; + + + nchip=myMod.nchip; + nchan=(myMod.nchan)/nchip; + + imod=myMod.module; + sMod=imod; + + if (sMod==ALLMOD) + sMod=allSelected; + + if (sMod==allSelected) { + modmi=0; + modma=getNModBoard(); + } else if (sMod==noneSelected || sMod>getNModBoard() || sMod<0) { + modmi=0; + modma=-1; + } else { + modmi=sMod; + modma=sMod+1; + } + + + /* + for (idac=0; idac>(NTRIMBITS+1))&1; + ae=(chanreg>>(NTRIMBITS+2))&1; + coe=((chanreg)>>(NTRIMBITS+3))&1; + ocoe=((chanreg)>>(NTRIMBITS+4))&1; + counts=((chanreg)>>(NTRIMBITS+5)); + nextStrip(imod); + initChannel(ft,cae,ae, coe, ocoe, counts,imod); + } + obe=((myMod.chipregs)[ichip])&1; + ow=1;//((myMod.chipregs)[ichip])>>1; + initChip(obe,ow,imod); + nextChip(imod); + } + + + initMCBregisters(myMod.reg,imod); + + if (detectorModules) { + for (im=modmi; immodule; +#ifdef VERBOSE + printf("Getting module %d\n",imod); +#endif + if (detectorModules) { + copyModule(myMod,detectorModules+imod); + ; + } else + return FAIL; + + return OK; +} + +/* To chips */ +int clearCounter(int imod){ + int i; +#ifdef DEBUG + printf("Clearing counter with contclear\n"); +#endif + putout("0000000000000000",imod); + for (i=0; i<10; i++) + putout("0000000000010000",imod); + putout("0000000000000000",imod); + + return 0; +} + +int clearOutReg(int imod){ + int i; +#ifdef DEBUG + printf("Clearing output register\n"); +#endif + putout("0000010000000000",imod); + for (i=0; i<10; i++) + putout("0000110000000000",imod); + putout("0000010000000000",imod); + return 0; +} +int setOutReg(int imod){ + int i; +#ifdef DEBUG + printf("Setting output register\n"); +#endif + putout("0000010000000000",imod); + for (i=0; i<10; i++) + putout("0001010000000000",imod); + putout("0000010000000000",imod); + return 0; +} + + +int extPulse(int ncal, int imod) { + int ical; +#ifdef DEBUG + printf("Giving a clock pulse to the counter\n"); +#endif + for (ical=0; ical0 && i%2==0) { + printf("Shift in: module %d chip %i bit %d read %d instead of %d \n",k,j,i,val & 1<< j, i%2); + result++; + } + if (i%2>0 && (val & 1<0 && (dum & (1<0) { + printf("Shift out: module %d chip %i bit %d read %d instead of %d \n",k,j,i,val & 1<< j, (dum &1<0 && i%2==0) { + printf("Shift stsel: module %d chip %i bit %d read %d instead of %d \n",k,j,i,val & 1<< j, i%2); + result++; + } + if (i%2>0 && (val & 1<> 1; + + + putout("0000000000000000",ALLMOD); + putout("0010000000000000",ALLMOD); //change mux setting + putout("0000000000000000",ALLMOD); + } + + if (result) + return 1; + else + return 0; +} + + + + + + + + + +int calibration_sensor(int num, int *v, int *dacs) { + int ich, ichip, imod; + int val[10]; + + + printf("calibrating sensor..."); + for (imod=0; imod + + +int sockfd; + + +void error(char *msg) +{ + perror(msg); +} + +int main(int argc, char *argv[]) +{ + int portno, b; + char cmd[100]; + int retval=OK; + + if (argc==1) { + portno = DEFAULT_PORTNO; + sprintf(cmd,"%s %d &",argv[0],DEFAULT_PORTNO+1); + printf("opening control server on port %d\n",portno ); + system(cmd); + b=1; + } else { + portno = DEFAULT_PORTNO+1; + if ( sscanf(argv[1],"%d",&portno) ==0) { + printf("could not open stop server: unknown port\n"); + return 1; + } + b=0; + printf("opening stop server on port %d\n",portno); + } + + init_detector(b); + + + bindSocket(portno); + if (getServerError()) + return -1; + + /* assign function table */ + function_table(); + + + + /* waits for connection */ + while(retval!=GOODBYE) { +#ifdef VERBOSE + printf("\n"); +#endif +#ifdef VERY_VERBOSE + printf("Waiting for client call\n"); +#endif + acceptConnection(); + retval=decode_function(); + closeConnection(); + } + + exitServer(); + printf("Goodbye!\n"); + + return 0; +} + diff --git a/slsDetectorSoftware/mythenDetectorServer/server_defs.h b/slsDetectorSoftware/mythenDetectorServer/server_defs.h new file mode 100755 index 000000000..2710f6baf --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/server_defs.h @@ -0,0 +1,42 @@ +#ifndef SERVER_DEFS_H +#define SERVER_DEFS_H + +#include "sls_detector_defs.h" + +#include + + +// Hardware definitions + +#define NCHAN 128 +#define NCHIP 10 +#define NMAXMODX 24 +#define NMAXMODY 1 +#define NMAXMOD NMAXMODX*NMAXMODY +#define NDAC 6 +#define NADC 0 + +#define NCHANS NCHAN*NCHIP*NMAXMOD +#define NDACS NDAC*NMAXMOD + +#define NTRIMBITS 6 +#define NCOUNTBITS 24 + +//#define TRIM_DR ((2**NTRIMBITS)-1) +//#define COUNT_DR ((2**NCOUNTBITS)-1) +#define TRIM_DR (((int)pow(2,NTRIMBITS))-1) +#define COUNT_DR (((int)pow(2,NCOUNTBITS))-1) + + +#define ALLMOD 0xffff +#define ALLFIFO 0xffff + +#ifdef VIRTUAL +#define DEBUGOUT +#endif + +#define CLK_FREQ 100E+6 + + +#define THIS_SOFTWARE_VERSION 0x20090205 +#endif diff --git a/slsDetectorSoftware/mythenDetectorServer/server_funcs.c b/slsDetectorSoftware/mythenDetectorServer/server_funcs.c new file mode 100755 index 000000000..c73325009 --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/server_funcs.c @@ -0,0 +1,2128 @@ + +#include "sls_detector_defs.h" +#include "server_funcs.h" +#include "server_defs.h" +#include "firmware_funcs.h" +#include "mcb_funcs.h" +#include "trimming_funcs.h" + + +// Global variables + +int (*flist[256])(int); + + + +#ifdef MCB_FUNCS +extern const enum detectorType myDetectorType; +#endif +#ifndef MCB_FUNCS +const enum detectorType myDetectorType=MYTHEN; +#endif +extern int nModX; +extern int nModY; +extern int dataBytes; +extern int dynamicRange; +extern int storeInRAM; + + +/* global variables for optimized readout */ +extern int *ram_values; +char *dataretval=NULL; +int nframes, iframes, dataret; +char mess[1000]; + + + + + +int init_detector( int b) { + mapCSP0(); + system("bus -a 0xb0000000 -w 0xd0008"); + testFpga(); +#ifdef MCB_FUNCS + if (b) { + initDetector(); + setSettings(GET_SETTINGS); + } +#endif + strcpy(mess,"dummy message"); + return OK; +} + + +int decode_function() { + int fnum,n; + int retval; + n = receiveDataOnly(&fnum,sizeof(fnum)); + if (n < 0) { + printf("ERROR reading from socket %d", n); + return GOODBYE; + } +#ifdef VERY_VERBOSE + else + printf("size of data received %d\n",n); +#endif +#ifdef VERBOSE + printf( "calling function fnum = %d %x\n",fnum,flist[fnum]); +#endif + if (fnum<0 || fnum>255) + fnum=255; + retval=(*flist[fnum])(fnum); + if (retval==FAIL) + printf( "Error executing the function = %d \n",fnum); + return retval; +} + + +int function_table() { + int i; + for (i=0;i<256;i++){ + flist[i]=&M_nofunc; + } + flist[F_EXIT_SERVER]=&exit_server; + flist[F_EXEC_COMMAND]=&exec_command; + flist[F_GET_DETECTOR_TYPE]=&get_detector_type; + flist[F_SET_NUMBER_OF_MODULES]=&set_number_of_modules; + flist[F_GET_MAX_NUMBER_OF_MODULES]=&get_max_number_of_modules; + flist[F_SET_EXTERNAL_SIGNAL_FLAG]=&set_external_signal_flag; + flist[F_SET_EXTERNAL_COMMUNICATION_MODE]=&set_external_communication_mode; + flist[F_GET_ID]=&get_id; + flist[F_DIGITAL_TEST]=&digital_test; + flist[F_WRITE_REGISTER]=&write_register; + flist[F_READ_REGISTER]=&read_register; + flist[F_SET_DAC]=&set_dac; + flist[F_GET_ADC]=&get_adc; + flist[F_SET_CHANNEL]=&set_channel; + flist[F_SET_CHIP]=&set_chip; + flist[F_SET_MODULE]=&set_module; + flist[F_GET_CHANNEL]=&get_channel; + flist[F_GET_CHIP]=&get_chip; + flist[F_GET_MODULE]=&get_module; + flist[F_GET_THRESHOLD_ENERGY]=&get_threshold_energy; + flist[F_SET_THRESHOLD_ENERGY]=&set_threshold_energy; + flist[F_SET_SETTINGS]=&set_settings; + flist[F_START_ACQUISITION]=&start_acquisition; + flist[F_STOP_ACQUISITION]=&stop_acquisition; + flist[F_START_READOUT]=&start_readout; + flist[F_GET_RUN_STATUS]=&get_run_status; + flist[F_READ_FRAME]=&read_frame; + flist[F_READ_ALL]=&read_all; + flist[F_START_AND_READ_ALL]=&start_and_read_all; + flist[F_SET_TIMER]=&set_timer; + flist[F_GET_TIME_LEFT]=&get_time_left; + flist[F_SET_DYNAMIC_RANGE]=&set_dynamic_range; + flist[F_SET_ROI]=&set_roi; + flist[F_SET_READOUT_FLAGS]=&set_readout_flags; + flist[F_EXECUTE_TRIMMING]=&execute_trimming; +#ifdef VERBOSE + /* for (i=0;i<256;i++){ + printf("function %d located at %x\n",i,flist[i]); + }*/ +#endif + return OK; +} + + +int M_nofunc(int fnum){ + + int retval=FAIL; + sprintf(mess,"Unrecognized Function %d\n",fnum); + printf(mess); + sendDataOnly(&retval,sizeof(retval)); + sendDataOnly(mess,sizeof(mess)); + return -1; +} + + +int exit_server(int fnum) { + int retval=FAIL; + sendDataOnly(&retval,sizeof(retval)); + printf("closing server."); + sprintf(mess,"closing server"); + sendDataOnly(mess,sizeof(mess)); + return GOODBYE; +} + +int exec_command(int fnum) { + char cmd[MAX_STR_LENGTH]; + char answer[MAX_STR_LENGTH]; + int retval=OK; + int sysret=0; + int n=0; + + /* receive arguments */ + n = receiveDataOnly(cmd,MAX_STR_LENGTH); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + retval=FAIL; + } + + /* execute action if the arguments correctly arrived*/ + if (retval==OK) { +#ifdef VERBOSE + printf("executing command %s\n", cmd); +#endif + sysret=system(cmd); + //should be replaced by popen + if (sysret==0) + sprintf(answer,"Succeeded\n"); + else { + sprintf(answer,"Failed\n"); + retval=FAIL; + } + } else { + sprintf(answer,"Could not receive the command\n"); + } + + /* send answer */ + n = sendDataOnly(answer,MAX_STR_LENGTH); + if (n < 0) { + sprintf(mess,"Error writing to socket"); + retval=FAIL; + } + + + /*return ok/fail*/ + return retval; + +} + + + +int get_detector_type(int fnum) { + int n=0; + enum detectorType ret; + int retval=OK; + + sprintf(mess,"Can't return detector type\n"); + + + /* receive arguments */ + /* execute action */ + ret=myDetectorType; + +#ifdef VERBOSE + printf("Returning detector type %d\n",ret); +#endif + + /* send answer */ + /* send OK/failed */ + n += sendDataOnly(&retval,sizeof(retval)); + if (retval==OK) { + /* send return argument */ + n += sendDataOnly(&ret,sizeof(ret)); + } else { + n += sendDataOnly(mess,sizeof(mess)); + } + /*return ok/fail*/ + return retval; + + +} + + +int set_number_of_modules(int fnum) { + int n; + int arg[2], ret=0; + int retval=OK; + int dim, nm; + + sprintf(mess,"Can't set number of modules\n"); + + /* receive arguments */ + n = receiveDataOnly(&arg,sizeof(arg)); + if (n < 0) { + sprintf(mess,"Error reading from socket %d", n); + retval=GOODBYE; + } + if (retval==OK) { + dim=arg[0]; + nm=arg[1]; + + /* execute action */ +#ifdef VERBOSE + printf("Setting the number of modules in dimension %d to %d\n",dim,nm ); +#endif + if (nm!=GET_FLAG) { + if (dim!=X) { + retval=FAIL; + sprintf(mess,"Can't change module number in dimension %d\n",dim); + } else { + setNMod(nm); + if (nModX==nm) + retval=OK; + else + retval=FAIL; + } + } + } + if (dim==X) + ret=nModX; + else if (dim==Y) + ret=nModY; + + /* send answer */ + /* send OK/failed */ + n = sendDataOnly(&retval,sizeof(retval)); + if (retval==OK) { + /* send return argument */ + n += sendDataOnly(&ret,sizeof(ret)); + } else { + n += sendDataOnly(mess,sizeof(mess)); + } + /*return ok/fail*/ + return retval; + +} + + +int get_max_number_of_modules(int fnum) { + int n; + int ret; + int retval=OK; + enum dimension arg; + + sprintf(mess,"Can't get max number of modules\n"); + /* receive arguments */ + n = receiveDataOnly(&arg,sizeof(arg)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + retval=FAIL; + } + /* execute action */ +#ifdef VERBOSE + printf("Getting the max number of modules in dimension %d \n",arg); +#endif + + + switch (arg) { + case X: + ret=getNModBoard(); + break; + case Y: + ret=NMAXMODY; + break; + default: + ret=FAIL; + retval=FAIL; + } +#ifdef VERBOSE + printf("Max number of module in dimension %d is %d\n",arg,ret ); +#endif + + + + + /* send answer */ + /* send OK/failed */ + n = sendDataOnly(&retval,sizeof(retval)); + if (retval==OK) { + /* send return argument */ + n += sendDataOnly(&ret,sizeof(ret)); + } else { + n += sendDataOnly(mess,sizeof(mess)); + } + + + + /*return ok/fail*/ + return retval; +} + + +//index 0 is in gate +//index 1 is in trigger +//index 2 is out gate +//index 3 is out trigger + +int set_external_signal_flag(int fnum) { + int n; + int arg[2]; + int ret=OK; + int signalindex; + enum externalSignalFlag flag, retval; + + sprintf(mess,"Can't set external signal flag\n"); + + /* receive arguments */ + n = receiveDataOnly(&arg,sizeof(arg)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + ret=FAIL; + } + retval=SIGNAL_OFF; + if (ret==OK) { + signalindex=arg[0]; + flag=arg[1]; + /* execute action */ + switch (flag) { + case GET_EXTERNAL_SIGNAL_FLAG: + retval=getExtSignal(signalindex); + break; + + default: + retval=setExtSignal(signalindex,flag); + + } + +#ifdef VERBOSE + printf("Setting external signal %d to flag %d\n",signalindex,flag ); + printf("Set to flag %d\n",retval); +#endif + + } else { + ret=FAIL; + } + + + /* send answer */ + /* send OK/failed */ + n = sendDataOnly(&ret,sizeof(ret)); + if (ret==OK) { + /* send return argument */ + n += sendDataOnly(&retval,sizeof(retval)); + } else { + n += sendDataOnly(mess,sizeof(mess)); + } + + + /*return ok/fail*/ + return ret; + +} + + +int set_external_communication_mode(int fnum) { + int n; + enum externalCommunicationMode arg, ret; + int retval=OK; + + sprintf(mess,"Can't set external communication mode\n"); + + + /* receive arguments */ + n = receiveDataOnly(&arg,sizeof(arg)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + retval=FAIL; + } + /* +enum externalCommunicationMode{ + GET_EXTERNAL_COMMUNICATION_MODE, + AUTO, + TRIGGER_EXPOSURE_SERIES, + TRIGGER_EXPOSURE_BURST, + TRIGGER_READOUT, + TRIGGER_COINCIDENCE_WITH_INTERNAL_ENABLE, + GATE_FIX_NUMBER, + GATE_FIX_DURATION, + GATE_WITH_START_TRIGGER, + GATE_COINCIDENCE_WITH_INTERNAL_ENABLE +}; + */ + ret=AUTO; + if (retval==OK) { + /* execute action */ + switch(arg) { + default: + sprintf(mess,"The meaning of single signals should be set\n"); + retval=FAIL; + } + + +#ifdef VERBOSE + printf("Setting external communication mode to %d\n", arg); +#endif + } else + ret=FAIL; + + /* send answer */ + /* send OK/failed */ + n = sendDataOnly(&retval,sizeof(retval)); + if (retval==OK) { + /* send return argument */ + n += sendDataOnly(&ret,sizeof(ret)); + } else { + n += sendDataOnly(mess,sizeof(mess)); + } + + /*return ok/fail*/ + return retval; + + +} + + + +int get_id(int fnum) { + // sends back 64 bits! + int64_t retval; + int ret=OK; + int imod=-1; + int n=0; + enum idMode arg; + + sprintf(mess,"Can't return id\n"); + + /* receive arguments */ + n = receiveDataOnly(&arg,sizeof(arg)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + ret=FAIL; + } + +#ifdef VERBOSE + printf("Getting id %d\n", arg); +#endif + + switch (arg) { + case MODULE_SERIAL_NUMBER: + n = receiveDataOnly(&imod,sizeof(imod)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + retval=FAIL; + } else { +#ifdef VERBOSE + printf("of module %d\n", imod); +#endif + if (imod>=0 && imod<=getNModBoard()) { +#ifdef MCB_FUNCS + retval=getModuleNumber(imod); +#endif + ; + } + else { + sprintf(mess,"Module number %d out of range\n",imod); + ret=FAIL; + } + } + break; + case MODULE_FIRMWARE_VERSION: + retval=0x1; + break; + case DETECTOR_SERIAL_NUMBER: + retval=getMcsNumber(); + break; + case DETECTOR_FIRMWARE_VERSION: + retval=getMcsVersion(); + break; + case DETECTOR_SOFTWARE_VERSION: + retval=THIS_SOFTWARE_VERSION; + break; + default: + printf("Required unknown id %d \n", arg); + ret=FAIL; + retval=FAIL; + } + +#ifdef VERBOSE + printf("Id is %llx\n", retval); +#endif + + /* send answer */ + /* send OK/failed */ + n = sendDataOnly(&ret,sizeof(ret)); + if (ret==OK) { + /* send return argument */ + n += sendDataOnly(&retval,sizeof(retval)); + } else { + n += sendDataOnly(mess,sizeof(mess)); + } + + /*return ok/fail*/ + return ret; + +} + +int digital_test(int fnum) { + + int retval; + int ret=OK; + int imod=-1; + int n=0; + int ibit=0; + int ow; + enum digitalTestMode arg; + + sprintf(mess,"Can't send digital test\n"); + + n = receiveDataOnly(&arg,sizeof(arg)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + ret=FAIL; + } + +#ifdef VERBOSE + printf("Digital test mode %d\n",arg ); +#endif + + switch (arg) { + case CHIP_TEST: + n = receiveDataOnly(&imod,sizeof(imod)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + retval=FAIL; + } +#ifdef VERBOSE + printf("of module %d\n", imod); +#endif + retval=0; +#ifdef MCB_FUNCS + if (testShiftIn(imod)) retval|=(1<<(ibit++)); + if (testShiftOut(imod)) retval|=(1<<(ibit++)); + if (testShiftStSel(imod)) retval|=(1<<(ibit++)); + //if ( testDataInOut(0x123456, imod)) retval|=(1<<(ibit++)); + //if ( testExtPulse(imod)) retval|=(1<<(ibit++)); + // for (ow=0; ow<6; ow++) + for (ow=0; ow<5; ow++) + if (testDataInOutMux(imod, ow, 0x789abc)) retval|=(1<=getNModBoard()) + ret=FAIL; + if (imod<0) + imod=ALLMOD; + +#ifdef MCB_FUNCS + switch (ind) { + case TRIMBIT_SIZE: + idac=VTRIM; + break; + case THRESHOLD: + idac=VTHRESH; + break; + case SHAPER1: + idac=RGSH1; + break; + case SHAPER2: + idac=RGSH2; + break; + case CALIBRATION_PULSE: + idac=VCAL; + break; + case PREAMP: + idac=RGPR; + break; + default: + printf("Unknown DAC index %d\n",ind); + sprintf(mess,"Unknown DAC index %d\n",ind); + ret=FAIL; + } + + if (ret==OK) { + retval=initDACbyIndexDACU(idac,val,imod); + } +#endif + +#ifdef VERBOSE + printf("DAC set to %f V\n", retval); +#endif + if (retval==val) + ret=OK; + else { + ret=FAIL; + printf("Setting dac %d of module %d: wrote %f but read %f\n", ind, imod, val, retval); + } + + + /* send answer */ + /* send OK/failed */ + n = sendDataOnly(&ret,sizeof(ret)); + if (ret==OK) { + /* send return argument */ + n += sendDataOnly(&retval,sizeof(retval)); + } else { + n += sendDataOnly(mess,sizeof(mess)); + } + + /* Maybe this is done inside the initialization funcs */ + //detectorDacs[imod][ind]=val; + /*return ok/fail*/ + return ret; + +} + + + +int get_adc(int fnum) { + + float retval; + int ret=OK; + int arg[2]; + enum dacIndex ind; + int imod; + int n; + int idac=0; + + sprintf(mess,"Can't read ADC\n"); + + + n = receiveDataOnly(arg,sizeof(arg)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + ret=FAIL; + } + ind=arg[0]; + imod=arg[1]; + + + if (imod>=getNModBoard() || imod<0) + ret=FAIL; + +#ifdef MCB_FUNCS + switch (ind) { + case TRIMBIT_SIZE: + idac=VTRIM; + break; + case THRESHOLD: + idac=VTHRESH; + break; + case SHAPER1: + idac=RGSH1; + break; + case SHAPER2: + idac=RGSH2; + break; + case CALIBRATION_PULSE: + idac=VCAL; + break; + case PREAMP: + idac=RGPR; + break; + default: + printf("Unknown DAC index %d\n",ind); + ret=FAIL; + sprintf(mess,"Unknown DAC index %d\n",ind); + } + + if (ret==OK) { + retval=getDACbyIndexDACU(idac,imod); + } + #endif +#ifdef VERBOSE + printf("Getting ADC %d of module %d\n", ind, imod); +#endif + +#ifdef VERBOSE + printf("ADC is %f V\n", retval); +#endif + if (ret==FAIL) { + printf("Getting adc %d of module %d failed\n", ind, imod); + } + + + /* send answer */ + /* send OK/failed */ + n = sendDataOnly(&ret,sizeof(ret)); + if (ret==OK) { + /* send return argument */ + n += sendDataOnly(&retval,sizeof(retval)); + } else { + n += sendDataOnly(mess,sizeof(mess)); + } + + /*return ok/fail*/ + return ret; + +} + +int set_channel(int fnum) { + int ret=OK; + sls_detector_channel myChan; + int retval; + int n; + + + sprintf(mess,"Can't set channel\n"); + +#ifdef VERBOSE + printf("Setting channel\n"); +#endif + ret=receiveChannel(&myChan); + if (ret>=0) + ret=OK; + else + ret=FAIL; +#ifdef VERBOSE + printf("channel number is %d, chip number is %d, module number is %d, register is %lld\n", myChan.chan,myChan.chip, myChan.module, myChan.reg); +#endif + + if (ret==OK) { + if (myChan.module>=getNModBoard()) + ret=FAIL; + if (myChan.chip>=NCHIP) + ret=FAIL; + if (myChan.chan>=NCHAN) + ret=FAIL; + if (myChan.module<0) + myChan.module=ALLMOD; + } + + + if (ret==OK) { +#ifdef MCB_FUNCS + retval=initChannelbyNumber(myChan); +#endif + } + /* Maybe this is done inside the initialization funcs */ + //copyChannel(detectorChans[myChan.module][myChan.chip]+(myChan.chan), &myChan); + + + + /* send answer */ + /* send OK/failed */ + n = sendDataOnly(&ret,sizeof(ret)); + if (ret==OK) { + /* send return argument */ + n += sendDataOnly(&retval,sizeof(retval)); + } else { + n += sendDataOnly(mess,sizeof(mess)); + } + + + /*return ok/fail*/ + return ret; + +} + + + + +int get_channel(int fnum) { + + int ret=OK; + sls_detector_channel retval; + + int arg[3]; + int ichan, ichip, imod; + int n; + + sprintf(mess,"Can't get channel\n"); + + + + n = receiveDataOnly(arg,sizeof(arg)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + ret=FAIL; + } + ichan=arg[0]; + ichip=arg[1]; + imod=arg[2]; + + if (ret==OK) { + ret=FAIL; + if (imod>=0 && imod=0 && ichip=0 && ichan=0) + ret=OK; + else + ret=FAIL; +#ifdef VERBOSE + printf("chip number is %d, module number is %d, register is %d, nchan %d\n",myChip.chip, myChip.module, myChip.reg, myChip.nchan); +#endif + + if (ret==OK) { + if (myChip.module>=getNModBoard()) + ret=FAIL; + if (myChip.module<0) + myChip.module=ALLMOD; + if (myChip.chip>=NCHIP) + ret=FAIL; + } +#ifdef MCB_FUNCS + retval=initChipbyNumber(myChip); +#endif + /* Maybe this is done inside the initialization funcs */ + //copyChip(detectorChips[myChip.module]+(myChip.chip), &myChip); + + /* send answer */ + /* send OK/failed */ + n = sendDataOnly(&ret,sizeof(ret)); + if (ret==OK) { + /* send return argument */ + n += sendDataOnly(&retval,sizeof(retval)); + } else { + n += sendDataOnly(mess,sizeof(mess)); + } + + + return ret; +} + +int get_chip(int fnum) { + + + int ret=OK; + sls_detector_chip retval; + int arg[2]; + int ichip, imod; + int n; + + + + n = receiveDataOnly(arg,sizeof(arg)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + ret=FAIL; + } + ichip=arg[0]; + imod=arg[1]; + if (ret==OK) { + ret=FAIL; + if (imod>=0 && imod=0 && ichip=0) + ret=OK; + else + ret=FAIL; + + +#ifdef VERBOSE + printf("module number is %d,register is %d, nchan %d, nchip %d, ndac %d, nadc %d, gain %f, offset %f\n",myModule.module, myModule.reg, myModule.nchan, myModule.nchip, myModule.ndac, myModule.nadc, myModule.gain,myModule.offset); +#endif + + if (ret==OK) { + if (myModule.module>=getNModBoard()) { + ret=FAIL; + printf("Module number is too large %d\n",myModule.module); + } + if (myModule.module<0) + myModule.module=ALLMOD; + } + + if (ret==OK) { +#ifdef MCB_FUNCS + retval=initModulebyNumber(myModule); +#endif + } + + /* Maybe this is done inside the initialization funcs */ + //copyChip(detectorChips[myChip.module]+(myChip.chip), &myChip); + + /* send answer */ + /* send OK/failed */ + n = sendDataOnly(&ret,sizeof(ret)); + if (ret==OK) { + /* send return argument */ + n += sendDataOnly(&retval,sizeof(retval)); + } else { + n += sendDataOnly(mess,sizeof(mess)); + } + free(myChip); + free(myChan); + free(myDac); + free(myAdc); + + setDynamicRange(dr); + + + return ret; +} + + + + +int get_module(int fnum) { + + + int ret=OK; + + + int arg; + int imod; + int n; + + + + sls_detector_module myModule; + int *myChip=malloc(NCHIP*sizeof(int)); + int *myChan=malloc(NCHIP*NCHAN*sizeof(int)); + float *myDac=malloc(NDAC*sizeof(int)); + float *myAdc=malloc(NADC*sizeof(int)); + + + if (myDac) + myModule.dacs=myDac; + else { + sprintf(mess,"could not allocate dacs\n"); + ret=FAIL; + } + if (myAdc) + myModule.adcs=myAdc; + else { + sprintf(mess,"could not allocate adcs\n"); + ret=FAIL; + } + if (myChip) + myModule.chipregs=myChip; + else { + sprintf(mess,"could not allocate chips\n"); + ret=FAIL; + } + if (myChan) + myModule.chanregs=myChan; + else { + sprintf(mess,"could not allocate chans\n"); + ret=FAIL; + } + + myModule.ndac=NDAC; + myModule.nchip=NCHIP; + myModule.nchan=NCHAN*NCHIP; + myModule.nadc=NADC; + + + + + + n = receiveDataOnly(&arg,sizeof(arg)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + ret=FAIL; + } + imod=arg; + + if (ret==OK) { + ret=FAIL; + if (imod>=0 && imod-2) { + sprintf(mess,"no data and run stopped: %d frames left\n",getFrames()+2); + } else { + strcpy(mess,"acquisition successfully finished\n"); + } +#ifdef VERBOSE + printf(mess); +#endif + sendDataOnly(mess,sizeof(mess)); +#ifdef VERBOSE + printf("message sent\n",mess); +#endif + return dataret; + } + } else { + nframes=0; + while(fifo_read_event()) { + nframes++; + } + dataretval=(char*)ram_values; + dataret=OK; +#ifdef VERBOSE + printf("sending data of %d frames\n",nframes); +#endif + for (iframes=0; iframes-2) + sprintf(mess,"no data and run stopped: %d frames left\n",getFrames()+2); + else + sprintf(mess,"acquisition successfully finished\n"); + +#ifdef VERBOSE + printf("Frames left %d\n",getFrames()); +#endif + dataret=FAIL; + sendDataOnly(&dataret,sizeof(dataret)); + sendDataOnly(mess,sizeof(mess)); + return dataret; + } + + return dataret; +} + + + + + + + + +int read_all(int fnum) { + + + while(read_frame(0)==OK) { +#ifdef VERBOSE + printf("frame read\n"); +#endif + ; + } + +#ifdef VERBOSE + printf("Frames finished\n"); +#endif + return OK; + + +} + +int start_and_read_all(int fnum) { + // int ret=OK; +#ifdef VERBOSE + printf("Starting and reading all frames\n"); +#endif + + startStateMachine(); + /* ret=startStateMachine(); + if (ret!=OK) { + sprintf(mess,"could not start state machine\n"); + sendDataOnly(&ret,sizeof(ret)); + sendDataOnly(mess,sizeof(mess)); + + #ifdef VERBOSE + printf("could not start state machine\n"); +#endif +} else {*/ + read_all(1); +#ifdef VERBOSE + printf("Frames finished\n"); +#endif + //} + + + return OK; + + +} + +int set_timer(int fnum) { + enum timerIndex ind; + int64_t tns; + int n; + int64_t retval; + int ret=OK; + + + sprintf(mess,"can't set timer\n"); + + + n = receiveDataOnly(&ind,sizeof(ind)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + ret=FAIL; + } + + n = receiveDataOnly(&tns,sizeof(tns)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + ret=FAIL; + } + + +#ifdef VERBOSE + printf("setting timer %d to %lld ns\n",ind,tns); +#endif + if (ret==OK) { + switch(ind) { + case FRAME_NUMBER: + retval=setFrames(tns); + break; + case ACQUISITION_TIME: + retval=setExposureTime(tns); + break; + case FRAME_PERIOD: + retval=setPeriod(tns); + break; + case DELAY_AFTER_TRIGGER: + retval=setDelay(tns); + break; + case GATES_NUMBER: + retval=setGates(tns); + break; + case PROBES_NUMBER: + retval=setProbes(tns); + break; + case CYCLES_NUMBER: + retval=setTrains(tns); + break; + default: + ret=FAIL; + sprintf(mess,"timer index unknown %d\n",ind); + } + } + + if (tns>=0 && retval!=tns && (retval+1)!=tns) { + printf("wrote %lld, read %lld\n",tns,retval); + ret=FAIL; + } + if (ret!=OK) { + printf("set timer failed\n"); + sprintf(mess, "set timer %d failed\n", ind); + } else if (ind==FRAME_NUMBER){ + ret=allocateRAM(); + if (ret!=OK) + sprintf(mess, "could not allocate RAM for %lld frames\n", tns); + } + + n = sendDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { +#ifdef VERBOSE + printf("returning error\n"); +#endif + + n = sendDataOnly(mess,sizeof(mess)); + } else { +#ifdef VERBOSE + printf("returning ok %d\n",sizeof(retval)); +#endif + + n = sendDataOnly(&retval,sizeof(retval)); + } + + return ret; + +} + + + + + + + + +int get_time_left(int fnum) { + + enum timerIndex ind; + int n; + int64_t retval; + int ret=OK; + + sprintf(mess,"can't set timer\n"); + n = receiveDataOnly(&ind,sizeof(ind)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + ret=FAIL; + } + + +#ifdef VERBOSE + + printf("getting time left on timer %d \n",ind); +#endif + + if (ret==OK) { + switch(ind) { + case FRAME_NUMBER: + retval=getFrames(); + break; + case ACQUISITION_TIME: + retval=getExposureTime(); + break; + case FRAME_PERIOD: + retval=getPeriod(); + break; + case DELAY_AFTER_TRIGGER: + retval=getDelay(); + break; + case GATES_NUMBER: + retval=getGates(); + break; + case PROBES_NUMBER: + retval=getProbes(); + break; + case CYCLES_NUMBER: + retval=getTrains(); + break; + default: + ret=FAIL; + sprintf(mess,"timer index unknown %d\n",ind); + } + } + + + if (ret!=OK) { + printf("get time left failed\n"); + } + + n = sendDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + n += sendDataOnly(mess,sizeof(mess)); + } else { + n = sendDataOnly(&retval,sizeof(retval)); + } + + return ret; + + +} + +int set_dynamic_range(int fnum) { + + + + int dr, ow; + int n; + int retval; + int ret=OK; + + + sprintf(mess,"can't set dynamic range\n"); + + + n = receiveDataOnly(&dr,sizeof(dr)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + ret=FAIL; + } + + if (dr>0) { + /* +#ifdef MCB_FUNCS + setCSregister(ALLMOD); + switch(dr) { + case 1: + ow=5; + break; + case 4: + ow=4; + break; + case 8: + ow=3; + break; + case 16: + ow=2; + break; + default: + // ow=0; + ow=1; + break; + } + + + initChip(0, ow,ALLMOD); +#endif + */ +#ifdef VERBOSE + printf("setting dynamic range to %d\n",dr); +#endif + } + retval=setDynamicRange(dr); + + + if (dr>=0 && retval!=dr) + ret=FAIL; + if (ret!=OK) { + sprintf(mess,"set dynamic range failed\n"); + } else { + ret=allocateRAM(); + if (ret!=OK) + sprintf(mess,"Could not allocate RAM for the dynamic range selected\n"); + } + + n = sendDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + n = sendDataOnly(mess,sizeof(mess)); + } else { + n = sendDataOnly(&retval,sizeof(retval)); + } + return ret; +} + +int set_roi(int fnum) { + + return FAIL; + +} + +int get_roi(int fnum) { + + + return FAIL; +} + +int set_readout_flags(int fnum) { + + enum readOutFlags retval; + enum readOutFlags arg; + int n; + int ret=OK; + + + sprintf(mess,"can't set readout flags\n"); + + + n = receiveDataOnly(&arg,sizeof(arg)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + ret=FAIL; + } + + +#ifdef VERBOSE + printf("setting readout flags to %d\n",arg); +#endif + + ret=setStoreInRAM(0); + initChipWithProbes(0,0,0, ALLMOD); + switch(arg) { + case STORE_IN_RAM: + ret=setStoreInRAM(1); + break; + case PUMP_PROBE_MODE: + //set number of probes + initChipWithProbes(0,0,2, ALLMOD); + // setExtSignal(0,GATE_IN_ACTIVE_HIGH); + // setExtSignal(0,TRIGGER_IN_RISING_EDGE); + break; + default: + ret=OK; + } + if (storeInRAM) + retval=STORE_IN_RAM; + else if (getProbes()) + retval=PUMP_PROBE_MODE; + else + retval=NORMAL_READOUT; + + if (ret!=OK) { + printf("set readout flags failed\n"); + sprintf(mess,"Could not allocate RAM\n"); + } + n = sendDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + n = sendDataOnly(mess,sizeof(mess)); + } else { + n = sendDataOnly(&retval,sizeof(retval)); + } + return ret; +} + + + + + +int execute_trimming(int fnum) { + + int arg[3]; + int n; + int ret=OK; + int imod, par1,par2; + enum trimMode mode; + + sprintf(mess,"can't set execute trimming\n"); + + n = receiveDataOnly(&mode,sizeof(mode)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + printf("Error reading from socket (mode)\n"); + ret=FAIL; + } + + n = receiveDataOnly(arg,sizeof(arg)); + if (n < 0) { + sprintf(mess,"Error reading from socket\n"); + printf("Error reading from socket (args)\n"); + ret=FAIL; + } + + imod=arg[0]; + + if (imod>=getNModBoard()) + ret=FAIL; + + if (imod<0) + imod=ALLMOD; + + par1=arg[1]; + par2=arg[2]; + +#ifdef VERBOSE + printf("trimming module %d mode %d, parameters %d %d \n",imod,mode, par1, par2); +#endif + if (ret==OK) { + switch(mode) { + case NOISE_TRIMMING: + // par1 is countlim; par2 is nsigma + ret=trim_with_noise(par1, par2, imod); + break; + case BEAM_TRIMMING: + // par1 is countlim; par2 is nsigma + ret=trim_with_beam(par1,par2,imod); + break; + case IMPROVE_TRIMMING: + // par1 is maxit; if par2!=0 vthresh will be optimized + ret=trim_improve(par1, par2,imod); + break; + case FIXEDSETTINGS_TRIMMING: + // par1 is countlim; if par2<0 then trimwithlevel else trim with median + ret=trim_fixed_settings(par1,par2,imod); + break; + // case OFFLINE_TRIMMING: + + //break; + default: + printf("Unknown trimming mode\n"); + sprintf(mess,"Unknown trimming mode\n"); + ret=FAIL; + } + } + + + if (ret!=OK) { + printf("trimming failed\n"); + } + n = sendDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + n = sendDataOnly(mess,sizeof(mess)); + } + + return ret; +} + + + + + + diff --git a/slsDetectorSoftware/mythenDetectorServer/server_funcs.h b/slsDetectorSoftware/mythenDetectorServer/server_funcs.h new file mode 100755 index 000000000..b6f49ed32 --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/server_funcs.h @@ -0,0 +1,70 @@ +#ifndef SERVER_FUNCS_H +#define SERVER_FUNCS_H +#include +/* +#include +#include +#include +*/ +#include "communication_funcs.h" + + + + +#define GOODBYE -200 +int function_table(); + +int decode_function(); + +int init_detector(int); + +int M_nofunc(int); +int exit_server(int); + + + + + // General purpose functions +int get_detector_type(int); +int set_number_of_modules(int); +int get_max_number_of_modules(int); + + +int exec_command(int); +int set_external_signal_flag(int); +int set_external_communication_mode(int); +int get_id(int); +int digital_test(int); +int write_register(int); +int read_register(int); +int set_dac(int); +int get_adc(int); +int set_channel(int); +int set_chip(int); +int set_module(int); +int get_channel(int); +int get_chip(int); +int get_module(int); + +int get_threshold_energy(int); +int set_threshold_energy(int); +int set_settings(int); +int start_acquisition(int); +int stop_acquisition(int); +int start_readout(int); +int get_run_status(int); +int read_frame(int); +int read_all(int); +int start_and_read_all(int); +int set_timer(int); +int get_time_left(int); +int set_dynamic_range(int); +int set_roi(int); +int get_roi(int); +int set_readout_flags(int); +int execute_trimming(int); + + + + +#endif diff --git a/slsDetectorSoftware/mythenDetectorServer/sharedmemory.c b/slsDetectorSoftware/mythenDetectorServer/sharedmemory.c new file mode 100755 index 000000000..4504cfe05 --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/sharedmemory.c @@ -0,0 +1,39 @@ +#include "sharedmemory.h" + +struct statusdata *stdata; + +int inism(int clsv) { + +static int scansmid; + + if (clsv==SMSV) { + if ( (scansmid=shmget(SMKEY,1024,IPC_CREAT | 0666 ))==-1 ) { + return -1; + } + if ( (stdata=shmat(scansmid,NULL,0))==(void*)-1) { + return -2; + } + } + + if (clsv==SMCL) { + if ( (scansmid=shmget(SMKEY,0,0) )==-1 ) { + return -3; + } + if ( (stdata=shmat(scansmid,NULL,0))==(void*)-1) { + return -4; + } + } + return 1; +} + +void write_status_sm(char *status) { + strcpy(stdata->status,status); +} + +void write_stop_sm(int v) { + stdata->stop=v; +} + +void write_runnumber_sm(int v) { + stdata->runnumber=v; +} diff --git a/slsDetectorSoftware/mythenDetectorServer/sharedmemory.h b/slsDetectorSoftware/mythenDetectorServer/sharedmemory.h new file mode 100755 index 000000000..8a5d89083 --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/sharedmemory.h @@ -0,0 +1,47 @@ +#ifndef SM +#define SM + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include + +#include +#include + +/* key for shared memory */ +#define SMKEY 10001 + +#define SMSV 1 +#define SMCL 2 + + +struct statusdata { + int runnumber; + int stop; + char status[20]; +} ; + + +/* for shared memory */ + +int inism(int clsv); +void write_status_sm(char *status); +void write_stop_sm(int v); +void write_runnumber_sm(int v); + +#endif diff --git a/slsDetectorSoftware/mythenDetectorServer/sls_detector_defs.h b/slsDetectorSoftware/mythenDetectorServer/sls_detector_defs.h new file mode 120000 index 000000000..c5062e03f --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/sls_detector_defs.h @@ -0,0 +1 @@ +../commonFiles/sls_detector_defs.h \ No newline at end of file diff --git a/slsDetectorSoftware/mythenDetectorServer/stop_server.c b/slsDetectorSoftware/mythenDetectorServer/stop_server.c new file mode 100755 index 000000000..571c9a978 --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/stop_server.c @@ -0,0 +1,41 @@ +/* A simple server in the internet domain using TCP + The port number is passed as an argument */ +#include "communication_funcs.h" +#include "firmware_funcs.h" + + +int sockfd; + +int main(int argc, char *argv[]) +{ + int portno; + int retval=0; + + portno = DEFAULT_PORTNO; + + + bindSocket(portno); + if (getServerError()) + return -1; + + + + /* waits for connection */ + while(retval!=GOODBYE) { +#ifdef VERBOSE + printf("\n"); +#endif +#ifdef VERY_VERBOSE + printf("Stop server: waiting for client call\n"); +#endif + acceptConnection(); + retval=stopStateMachine(); + closeConnection(); + } + + exitServer(); + printf("Goodbye!\n"); + + return 0; +} + diff --git a/slsDetectorSoftware/mythenDetectorServer/trimming_funcs.c b/slsDetectorSoftware/mythenDetectorServer/trimming_funcs.c new file mode 100755 index 000000000..5af595352 --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/trimming_funcs.c @@ -0,0 +1,661 @@ + +#include "server_defs.h" +#include "trimming_funcs.h" +#include "mcb_funcs.h" +#include "firmware_funcs.h" +#include + + + +extern int nModX; +//extern int *values; + +extern const int nChans; +extern const int nChips; +extern const int nDacs; +extern const int nAdcs; + + +int trim_fixed_settings(int countlim, int par2, int im) +{ + + int retval=OK; +#ifdef VERBOSE + printf("Trimming with fixed settings\n"); +#endif +#ifdef VIRTUAL + return OK; +#endif + + if (par2<=0) + retval=trim_with_level(countlim, im); + else + retval=trim_with_median(countlim,im); + + + return retval; +} + + +int trim_with_noise(int countlim, int nsigma, int im) +{ + + + int retval=OK, retval1=OK, retval2=OK; +#ifdef VERBOSE + printf("Trimming using noise\n"); +#endif +#ifdef VIRTUAL + return OK; +#endif + + /* threshold scan */ + +#ifdef VERBOSE + printf("chosing vthresh and vtrim....."); +#endif + retval1=choose_vthresh_and_vtrim(countlim,nsigma, im); + +#ifdef VERBOSE + printf("trimming with noise.....\n"); +#endif + retval2=trim_with_level(countlim, im); + +#ifdef DEBUGOUT + printf("done\n"); +#endif + if (retval1==OK && retval2==OK) + retval=OK; + else + retval=FAIL; + + return retval; + +} + +int trim_with_beam(int countlim, int nsigma, int im) //rpc +{ + + + int retval=OK, retval1=OK, retval2=OK; + + printf("Trimming using beam\n"); + //return OK; +#ifdef VIRTUAL + printf("Trimming using beam\n"); + return OK; +#endif + /* threshold scan */ +#ifdef DEBUGOUT + printf("chosing vthresh and vtrim....."); +#endif + + retval1=choose_vthresh_and_vtrim(countlim,nsigma,im); + retval2=trim_with_median(TRIM_DR, im); + +#ifdef DEBUGOUT + printf("done\n"); +#endif + + if (retval1==OK && retval2==OK) + retval=OK; + else + retval=FAIL; + + return retval; + +} + + +int trim_improve(int maxit, int par2, int im) //rpc +{ + + int retval=OK, retval1=OK, retval2=OK; + + +#ifdef VERBOSE + printf("Improve the trimming\n"); +#endif +#ifdef VIRTUAL + return OK; +#endif + + + if (par2!=0 && im==ALLMOD) + retval1=choose_vthresh(); + + retval2=trim_with_median(2*maxit+1, im); +#ifdef DEBUGOUT + printf("done\n"); +#endif + if (retval1==OK && retval2==OK) + retval=OK; + else + retval=FAIL; + + return retval; + +} + +int calcthr_from_vcal(int vcal) { + int thrmin; + //thrmin=140+3*vcal/5; + thrmin=180+3*vcal/5; + return thrmin; +} + +int calccal_from_vthr(int vthr) { + int vcal; + vcal=5*(vthr-140)/3; + return vcal; +} + +int choose_vthresh_and_vtrim(int countlim, int nsigma, int im) { + int retval=OK; +#ifdef MCB_FUNCS + int modma, modmi, nm; + int thr, thrstep=5, nthr=31; + + float vthreshmean, vthreshSTDev; + int *thrmi, *thrma; + float c; + float b=BVTRIM; + float a=AVTRIM; + int *trim; + int ich, imod, ichan; + int nvalid=0; + int *scan; + int ithr; + + + setFrames(1); + // setNMod(getNModBoard()); + + if (im==ALLMOD){ + modmi=0; + modma=nModX; + } else { + modmi=im; + modma=im+1; + } + nm=modma-modmi; + + trim=malloc(sizeof(int)*nChans*nChips*nModX); + thrmi=malloc(sizeof(int)*nModX); + thrma=malloc(sizeof(int)*nModX); + + + for (ich=0; ichcountlim && trim[ich]==-1) { + trim[ich]=getDACbyIndexDACU(VTHRESH,imod); +#ifdef VERBOSE + // printf("yes: %d %d %d\n",ich,ithr,scan[ich]); +#endif + } +#ifdef VERBOSE + /* else { + printf("no: %d %d %d\n",ich,ithr,scan[ich]); + }*/ +#endif + } + } + free(scan); + } + + for (imod=modmi; imodthrmi[imod] && trim[ich]0) { + vthreshmean=vthreshmean/nvalid; + vthreshSTDev=sqrt((vthreshSTDev/nvalid)-vthreshmean*vthreshmean); + } else { + vthreshmean=thrmi[imod]; + vthreshSTDev=nthr*thrstep; + printf("No valid channel for module %d\n",imod); + retval=FAIL; + } + +#ifdef DEBUGOUT + printf("module= %d nvalid = %d mean=%f RMS=%f\n",imod, nvalid, vthreshmean,vthreshSTDev); +#endif + // *vthresh=round(vthreshmean-nsigma*vthreshSTDev); + thr=(int)(vthreshmean-nsigma*vthreshSTDev); + if (thr<0 || thr>(DAC_DR-1)) { + thr=thrmi[imod]/2; + printf("Can't find correct threshold for module %d\n",imod); + retval=FAIL; + } + initDACbyIndexDACU(VTHRESH,thr,imod); +#ifdef VERBOSE + printf("vthresh=%d \n",thr); +#endif + c=CVTRIM-2.*nsigma*vthreshSTDev/63.; + thr=(int)((-b-sqrt(b*b-4*a*c))/(2*a)); + if (thr<500 || thr>(DAC_DR-1)) { + thr=750; + printf("Can't find correct trimbit size for module %d\n",imod); + retval=FAIL; + } + + initDACbyIndexDACU(VTRIM,thr,imod); + +#ifdef VERBOSE + printf("vtrim=%d \n",thr); +#endif + + } + free(trim); + free(thrmi); + free(thrma); + +#endif + return retval; +} + + + + + +int trim_with_level(int countlim, int im) { + int ich, itrim, ichan, ichip, imod; + int *scan, *inttrim; + int modma, modmi, nm; + int retval=OK; + +#ifdef MCB_FUNCS + setFrames(1); + // setNMod(getNModBoard()); + + if (im==ALLMOD){ + modmi=0; + modma=nModX; + } else { + modmi=im; + modma=im+1; + } + nm=modma-modmi; + + inttrim=malloc(sizeof(int)*nChips*nChans*nModX); + printf("countlim=%d\n",countlim); + for (ich=0; ichcountlim){ + if (inttrim[ich]==-1) { + inttrim[ich]=itrim; +#ifdef VERBOSE + printf("Channel %d trimbit %d counted %d countlim %d\n",ich,itrim,scan[ich],countlim); +#endif + } + } +#ifdef VERBOSE + /* else + printf("Channel %d trimbit %d counted %d countlim %d\n",ich,itrim,scan[ich],countlim);*/ +#endif + } + } + free(scan); + } + + for (imod=modmi; imod0) + direction[ichan]=1; + else + direction[ichan]=-1; + } + vthresh=getDACbyIndexDACU(VTHRESH,imod); + if ( direction[ichan]!=-3) { + if (abs(diff)>abs(olddiff[ichan])) { + vthresh=vthresh-direction[ichan]; + if (vthresh>(DAC_DR-1)) { + vthresh=(DAC_DR-1); + printf("can't equalize threshold for module %d\n", ichan); + retval=FAIL; + } + if (vthresh<0) { + vthresh=0; + printf("can't equalize threshold for module %d\n", ichan); + retval=FAIL; + } + direction[ichan]=-3; + } else { + vthresh=vthresh+direction[ichan]; + olddiff[ichan]=diff; + change_flag=1; + } + initDACbyIndex(VTHRESH,vthresh, ichan); + } + } + iteration++; + free(scan); + } +#endif + return retval; +} + + + + + +int trim_with_median(int stop, int im) { + + + int retval=OK; + +#ifdef MCB_FUNCS + int ichan, imod, ichip, ich; + int *scan, *olddiff, *direction; + int med, diff; + int change_flag=1; + int iteration=0; + int me[nModX]; + int modma, modmi, nm; + int trim; + + setFrames(1); + // setNMod(getNModBoard()); + + if (im==ALLMOD){ + modmi=0; + modma=nModX; + } else { + modmi=im; + modma=im+1; + } + nm=modma-modmi; + + olddiff=malloc(4*nModX*nChips*nChans); + direction=malloc(4*nModX*nChips*nChans); + + fifoReset(); + setCSregister(ALLMOD); + setSSregister(ALLMOD); + counterClear(ALLMOD); + clearSSregister(ALLMOD); + usleep(500); + startStateMachine(); + while (runBusy()) { + } + usleep(500); + scan=decode_data(fifo_read_event()); + for (imod=modmi; imod0) + direction[ichan]=1; + else + direction[ichan]=-1; + } + if ( direction[ichan]!=-3) { + if (abs(diff)>abs(olddiff[ichan])) { + printf("%d old diff %d < new diff %d %d\n",ichan, olddiff[ichan], diff, direction[ichan]); + trim=getTrimbit(imod,ichip,ich)+direction[ichan]; + direction[ichan]=-3; + } else { + trim=getTrimbit(imod,ichip,ich)-direction[ichan]; + olddiff[ichan]=diff; + change_flag=1; + } + if (trim>TRIM_DR) { + trim=63; + printf("can't trim channel %d chip %d module %d\n",ich, ichip, imod); + retval=FAIL; + } + if (trim<0) { + trim=0; + printf("can't trim channel %d chip %d module %d\n",ich, ichip, imod); + retval=FAIL; + } + initChannel(trim,0,0,1,0,0,imod); + } + } + } + } + iteration++; + free(scan); + } + free(olddiff); + free(direction); +#endif + return retval; +} diff --git a/slsDetectorSoftware/mythenDetectorServer/trimming_funcs.h b/slsDetectorSoftware/mythenDetectorServer/trimming_funcs.h new file mode 100755 index 000000000..c41451008 --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/trimming_funcs.h @@ -0,0 +1,17 @@ +#ifndef TRIMMING_FUNCS_H +#define TRIMMING_FUNCS_H +int trim_fixed_settings(int countlim, int par2, int imod); +int trim_with_noise(int countlim, int nsigma, int imod); +int trim_with_beam(int countlim, int nsigma, int imod); +int trim_improve(int maxit, int par2, int imod); +int calcthr_from_vcal(int vcal); +int calccal_from_vthr(int vthr); +int choose_vthresh_and_vtrim(int countlim, int nsigma, int imod); + +int choose_vthresh(); +int trim_with_level(int countlim, int imod); +int trim_with_median(int stop, int imod); +int calcthr_from_vcal(int vcal); +int calccal_from_vthr(int vthr); + +#endif diff --git a/slsDetectorSoftware/slsDetector/remove_shm.sh b/slsDetectorSoftware/slsDetector/remove_shm.sh new file mode 100755 index 000000000..a4608ae47 --- /dev/null +++ b/slsDetectorSoftware/slsDetector/remove_shm.sh @@ -0,0 +1,10 @@ +#!/bin/csh -f +#set l = `ipcs -m | grep "$USER"| cut -c12-19` +set l = `ipcs -m | cut -c12-19` +foreach s ( $l ) + echo $s + ipcrm shm $s +end +#if ($#l != 0 ) +echo $#l shared memory\(s\) for $user removed + diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp new file mode 100644 index 000000000..9972f76e4 --- /dev/null +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -0,0 +1,4040 @@ +#include "slsDetector.h" +#include "usersFunctions.h" +#include +#include +#include + + + +using namespace std; + + +int slsDetector::initSharedMemory(detectorType type, int id) { + + + /** + the shared memory key is set to DEFAULT_SHM_KEY+id + */ + key_t mem_key=DEFAULT_SHM_KEY+id; + int shm_id; + int nch, nm, nc, nd; + int sz; + + + switch(type) { + case MYTHEN: + nch=128; // complete mythen system + nm=24; + nc=10; + nd=6; // dacs+adcs + break; + default: + nch=65535; // one EIGER module + nm=1; //modules/detector + nc=8; //chips + nd=16; //dacs+adcs + } + /** + The size of the shared memory is: + size of shared structure + ffcoefficents +fferrors + modules+ dacs+adcs+chips+chans + */ + + + sz=sizeof(sharedSlsDetector)+nm*(2*nch*nc*sizeof(float)+sizeof(sls_detector_module)+sizeof(int)*nc+sizeof(float)*nd+sizeof(int)*nch*nc); + shm_id = shmget(mem_key,sz,IPC_CREAT | 0666); // allocate shared memory + + if (shm_id < 0) { + cout <<"*** shmget error (server) ***"<< endl; + return shm_id; + } + + /** + thisDetector pointer is set to the memory address of the shared memory + */ + + thisDetector = (sharedSlsDetector*) shmat(shm_id, NULL, 0); /* attach */ + + if ((int) thisDetector == -1) { + cout <<"*** shmat error (server) ***" << endl; + return shm_id; + } + /** + shm_id returns -1 is shared memory initialization fails + */ + return shm_id; + +} + + +int slsDetector::freeSharedMemory() { + // Detach Memory address + if (shmdt(thisDetector) == -1) { + perror("shmdt failed\n"); + return FAIL; + } + printf("Shared memory %d detached\n", shmId); + // remove shared memory + if (shmctl(shmId, IPC_RMID, 0) == -1) { + perror("shmctl(IPC_RMID) failed\n"); + return FAIL; + } + printf("Shared memory %d deleted\n", shmId); + return OK; +} + + +slsDetector::slsDetector(detectorType type, int id): + controlSocket(NULL), + stopSocket(NULL), + dataSocket(NULL), + shmId(-1), + detId(0), + thisDetector(NULL), + badChannelMask(NULL), + detectorModules(NULL) + { + /** sets onlineFlag to OFFLINE_FLAG */ + onlineFlag=OFFLINE_FLAG; + while (shmId<0) { + /**Initlializes shared memory \sa initSharedMemory + + if it fails the detector id is incremented until it succeeds + */ + shmId=initSharedMemory(type,id); + id++; + } + id--; +#ifdef VERBOSE + cout << "Detector id is " << id << endl; +#endif + detId=id; + /**Initializes the detector stucture \sa initializeDetectorSize + */ + initializeDetectorSize(type); + +} + + + +int slsDetector::initializeDetectorSize(detectorType type) { + char *goff; + goff=(char*)thisDetector; + + /** if the shared memory has newly be created, initialize the detector variables */ + if (thisDetector->alreadyExisting==0) { + /** set hostname to default */ + strcpy(thisDetector->hostname,DEFAULT_HOSTNAME); + /** set ports to defaults */ + thisDetector->controlPort=DEFAULT_PORTNO; + thisDetector->stopPort=DEFAULT_PORTNO+1; + thisDetector->dataPort=DEFAULT_PORTNO+2; + + /** set thisDetector->myDetectorType to type and according to this set nChans, nChips, nDacs, nAdcs, nModMax, dynamicRange, nMod*/ + thisDetector->myDetectorType=type; + switch(thisDetector->myDetectorType) { + case MYTHEN: + thisDetector->nChans=128; + thisDetector->nChips=10; + thisDetector->nDacs=6; + thisDetector->nAdcs=0; + thisDetector->nModMax[X]=24; + thisDetector->nModMax[Y]=1; + thisDetector->dynamicRange=32; + break; + default: + thisDetector->nChans=65536; + thisDetector->nChips=8; + thisDetector->nDacs=16; + thisDetector->nAdcs=16; + thisDetector->nModMax[X]=6; + thisDetector->nModMax[Y]=6; + thisDetector->dynamicRange=32; + } + thisDetector->nModsMax=thisDetector->nModMax[0]*thisDetector->nModMax[1]; + /** number of modules is initally the maximum number of modules */ + thisDetector->nMod[X]=thisDetector->nModMax[X]; + thisDetector->nMod[Y]=thisDetector->nModMax[Y]; + thisDetector->nMods=thisDetector->nModsMax; + /** calculates the expected data size */ + thisDetector->dataBytes=thisDetector->nMod[X]*thisDetector->nMod[Y]*thisDetector->nChips*thisDetector->nChans*thisDetector->dynamicRange/8; + /** set trimDsdir, calDir and filePath to default to home directory*/ + strcpy(thisDetector->trimDir,getenv("HOME")); + strcpy(thisDetector->calDir,getenv("HOME")); + strcpy(thisDetector->filePath,getenv("HOME")); + /** set fileName to default to run*/ + strcpy(thisDetector->fileName,"run"); + /** set fileIndex to default to 0*/ + thisDetector->fileIndex=0; + + /** set number of trim energies to 0*/ + thisDetector->nTrimEn=0; + /** set correction mask to 0*/ + thisDetector->correctionMask=0; + /** set deat time*/ + thisDetector->tDead=0; + /** set number of bad chans to 0*/ + thisDetector->nBadChans=0; + /** set number of bad flat field chans to 0*/ + thisDetector->nBadFF=0; + /** set angular direction to 1*/ + thisDetector->angDirection=1; + /** set fine offset to 0*/ + thisDetector->fineOffset=0; + /** set global offset to 0*/ + thisDetector->globalOffset=0; + /** set number of rois to 0*/ + thisDetector->nROI=0; + /** set readoutflags to none*/ + thisDetector->roFlags=NORMAL_READOUT; + /** set current settings to uninitialized*/ + thisDetector->currentSettings=UNINITIALIZED; + /** set threshold to -1*/ + thisDetector->currentThresholdEV=-1; + /** set clockdivider to 1*/ + thisDetector->clkDiv=1; + /** set number of positions to 0*/ + thisDetector->numberOfPositions=0; + /** set binsize*/ + thisDetector->binSize=0; + + + + /** calculates the memory offsets for flat field coefficients and errors, module structures, dacs, adcs, chips and channels */ + thisDetector->ffoff=sizeof(sharedSlsDetector); + thisDetector->fferroff=thisDetector->ffoff+sizeof(float)*thisDetector->nChans*thisDetector->nChips*thisDetector->nModsMax; + thisDetector->modoff= thisDetector->fferroff+sizeof(float)*thisDetector->nChans*thisDetector->nChips*thisDetector->nModsMax; + thisDetector->dacoff=thisDetector->modoff+sizeof(sls_detector_module)*thisDetector->nModsMax; + thisDetector->adcoff=thisDetector->dacoff+sizeof(float)*thisDetector->nDacs*thisDetector->nModsMax; + thisDetector->chipoff=thisDetector->adcoff+sizeof(float)*thisDetector->nAdcs*thisDetector->nModsMax; + thisDetector->chanoff=thisDetector->chipoff+sizeof(int)*thisDetector->nChips*thisDetector->nModsMax; + + + } + + + /** also in case thisDetector alread existed initialize the pointer for flat field coefficients and errors, module structures, dacs, adcs, chips and channels */ + ffcoefficients=(float*)(goff+thisDetector->ffoff); + fferrors=(float*)(goff+thisDetector->fferroff); + detectorModules=(sls_detector_module*)(goff+ thisDetector->modoff); + dacs=(float*)(goff+thisDetector->dacoff); + adcs=(float*)(goff+thisDetector->adcoff); + chipregs=(int*)(goff+thisDetector->chipoff); + chanregs=(int*)(goff+thisDetector->chanoff); + if (thisDetector->alreadyExisting==0) { + /** if thisDetector is new, initialize its structures \sa initializeDetectorStructure(); */ + initializeDetectorStructure(); + /** set thisDetector->alreadyExisting=1 */ + thisDetector->alreadyExisting=1; + } + /** fill the BadChannelMask \sa fillBadChannelMask */ + fillBadChannelMask(); + return OK; +} + +int slsDetector::initializeDetectorStructure() { + sls_detector_module *thisMod; + char *ptr, *p1, *p2; + p2=(char*)thisDetector; + + /** for each of the detector modules up to the maximum number which can be installed initlialize the sls_detector_module structure \sa ::sls_detector_module*/ + for (int imod=0; imodnModsMax; imod++) { + + + + thisMod=detectorModules+imod; + thisMod->module=imod; + + /** sets the size of the module to nChans, nChips etc. */ + thisMod->nchan=thisDetector->nChans; + thisMod->nchip=thisDetector->nChips; + thisMod->ndac=thisDetector->nDacs; + thisMod->nadc=thisDetector->nAdcs; + + + /** initializes the serial number and register to 0 */ + thisMod->serialnumber=0; + thisMod->reg=0; + + /** initializes the dacs values to 0 */ + for (int idac=0; idacnDacs; idac++) { + *(dacs+idac+thisDetector->nDacs*imod)=0.; + } + + + /** initializes the adc values to 0 */ + for (int iadc=0; iadcnAdcs; iadc++) { + *(adcs+iadc+thisDetector->nAdcs*imod)=0.; + } + + + + /** initializes the chip registers to 0 */ + for (int ichip=0; ichipnChips; ichip++) { + *(chipregs+ichip+thisDetector->nChips*imod)=-1; + } + + + /** initializes the channel registers to 0 */ + for (int ichan=0; ichannChans*thisDetector->nChips; ichan++) { + *(chanregs+ichan+thisDetector->nChans*imod)=-1; + } + /** initialize gain and offset to -1 */ + thisMod->gain=-1.; + thisMod->offset=-1.; + } +} + +slsDetector::sls_detector_module* slsDetector::createModule() { + + sls_detector_module *myMod=(sls_detector_module*)malloc(sizeof(sls_detector_module)); + float *dacs=new float[thisDetector->nDacs]; + float *adcs=new float[thisDetector->nAdcs]; + int *chipregs=new int[thisDetector->nChips]; + int *chanregs=new int[thisDetector->nChips*thisDetector->nChans]; + myMod->ndac=thisDetector->nDacs; + myMod->nadc=thisDetector->nAdcs; + myMod->nchip=thisDetector->nChips; + myMod->nchan=thisDetector->nChips*thisDetector->nChans; + + myMod->dacs=dacs; + myMod->adcs=adcs; + myMod->chipregs=chipregs; + myMod->chanregs=chanregs; + return myMod; +} + + +void slsDetector::deleteModule(sls_detector_module *myMod) { + delete [] myMod->dacs; + delete [] myMod->adcs; + delete [] myMod->chipregs; + delete [] myMod->chanregs; + delete myMod; +} + + + +int slsDetector::sendChannel(sls_detector_channel *myChan) { + return controlSocket->SendDataOnly(myChan, sizeof(sls_detector_channel)); +} + +int slsDetector::sendChip(sls_detector_chip *myChip) { + int ts=0; + ts+=controlSocket->SendDataOnly(myChip,sizeof(sls_detector_chip)); +#ifdef VERY_VERBOSE + cout << "chip structure sent" << endl; + cout << "now sending " << myChip->nchan << " channles" << endl; +#endif + + ts=controlSocket->SendDataOnly(myChip->chanregs,sizeof(int)*myChip->nchan ); + +#ifdef VERBOSE + cout << "chip's channels sent " <SendDataOnly(myMod,sizeof(sls_detector_module)); + ts+=controlSocket->SendDataOnly(myMod->dacs,sizeof(float)*(myMod->ndac)); + ts+=controlSocket->SendDataOnly(myMod->adcs,sizeof(float)*(myMod->nadc)); + ts+=controlSocket->SendDataOnly(myMod->chipregs,sizeof(int)*(myMod->nchip)); + ts+=controlSocket->SendDataOnly(myMod->chanregs,sizeof(int)*(myMod->nchan)); +} + +int slsDetector::receiveChannel(sls_detector_channel *myChan) { + return controlSocket->ReceiveDataOnly(myChan,sizeof(sls_detector_channel)); +} + +int slsDetector::receiveChip(sls_detector_chip* myChip) { + int *ptr=myChip->chanregs; + int nchanold=myChip->nchan; + int ts=0; + int nch; + ts+=controlSocket->ReceiveDataOnly(myChip,sizeof(sls_detector_chip)); + myChip->chanregs=ptr; + if (nchanold<(myChip->nchan)) { + nch=nchanold; + printf("number of channels received is too large!\n"); + } else + nch=myChip->nchan; + + ts+=controlSocket->ReceiveDataOnly(myChip->chanregs,sizeof(int)*nch); + + return ts; +} + +int slsDetector::receiveModule(sls_detector_module* myMod) { + + float *dacptr=myMod->dacs; + float *adcptr=myMod->adcs; + int *chipptr=myMod->chipregs; + int *chanptr=myMod->chanregs; + int ts=0; + ts+=controlSocket->ReceiveDataOnly(myMod,sizeof(sls_detector_module)); + myMod->dacs=dacptr; + myMod->adcs=adcptr; + myMod->chipregs=chipptr; + myMod->chanregs=chanptr; + + ts+=controlSocket->ReceiveDataOnly(myMod->dacs,sizeof(float)*(myMod->ndac)); + ts+=controlSocket->ReceiveDataOnly(myMod->adcs,sizeof(float)*(myMod->nadc)); + ts+=controlSocket->ReceiveDataOnly(myMod->chipregs,sizeof(int)*(myMod->nchip)); + ts+=controlSocket->ReceiveDataOnly(myMod->chanregs,sizeof(int)*(myMod->nchan)); +#ifdef VERBOSE + cout << "received module " << myMod->module << " of size "<< ts << " register " << myMod->reg << endl; +#endif + + return ts; +} + + +int slsDetector::setOnline(int off) { + if (off!=GET_ONLINE_FLAG) + onlineFlag=off; + return onlineFlag; +}; + + + + + + + + + + + + + /* detector configuration (no communication to server) */ + + /* + Every detector should have a basic configuration file containing: + type (mythen, pilatus etc.) + hostname + portnumber + communication type (default TCP/IP) + eventually secondary portnumber (e.g. mythen stop function) + number of modules installed if different from the detector size (x,y) + */ + +int slsDetector::readConfigurationFile(string const fname){ + + char hostname[1000]=DEFAULT_HOSTNAME; + int cport=DEFAULT_PORTNO, sport=DEFAULT_PORTNO+1,dport=-1; + int nmx=-1, nmy=-1; + float angoff=0.; + + + int nnames=14; + string names[]={"Hostname", "NmodX", "NmodY", "Detector", "ControlPort", "StopPort", "DataPort", "TrimBitDir","TrimBitEnergies", "CalDir", "BadChanList", "AngCal", "AngDirection", "FineOffset","GlobalOffset", "ClkDiv"}; + char line[500]; + string str; + ifstream infile; + string::size_type pos; + int iargval; + int interrupt=0; + + string sargname, sargval, dtype; + int iarg; + float farg; + int iline=0; + cout << "config file name "<< fname << endl; + infile.open(fname.c_str(), ios_base::in); + if (infile.is_open()) { + while (infile.good() and interrupt==0) { + sargname="none"; + sargval="0"; + getline(infile,str); + iline++; +#ifdef VERBOSE + // cout << str << endl; +#endif + if (str.find('#')!=string::npos) { + cout << "Line is a comment " << endl; + cout << str << endl; + continue; + } else { + istringstream ssstr(str); + ssstr >> sargname; + if (!ssstr.good()) { +#ifdef VERBOSE + // cout << "bad stream out" << endl; +#endif + interrupt=1; + break; + } else { + for (int iname=0; iname> sargval; + strcpy(hostname,sargval.c_str()); + break; + case 1: + ssstr>> nmx; + break; + case 2: + ssstr >> nmy; + break; + case 3: + ssstr >> dtype; + break; + case 4: + ssstr >> iargval; + cport=iargval; + break; + case 5: + ssstr >> iargval; + sport=iargval; + break; + case 6: + ssstr >> iargval; + dport=iargval; + break; + case 7: + ssstr>> sargval; + strcpy(thisDetector->trimDir,sargval.c_str()); + break; + case 8: + thisDetector->nTrimEn=0; + while (ssstr.good()) { + ssstr >> farg; + thisDetector->trimEnergies[thisDetector->nTrimEn]=farg; +#ifdef VERBOSE + cout << "trimbits acquired at energy " << farg << endl; +#endif + thisDetector->nTrimEn++; + } +#ifdef VERBOSE + cout << "total " << thisDetector->nTrimEn << " trimbitfiles" << endl; +#endif + case 9: + ssstr>> sargval; + strcpy(thisDetector->calDir,sargval.c_str()); + break; + case 10: + ssstr>> sargval; + // strcpy(thisDetector->badChanFile,sargval.c_str()); + break; + case 11: + ssstr>> sargval; + //strcpy(thisDetector->angConvFile,sargval.c_str()); + break; + case 12: + ssstr>> iargval; + thisDetector->angDirection=iargval; + break; + case 13: + ssstr>> farg; + thisDetector->fineOffset=farg; + break; + case 14: + ssstr>> farg; + thisDetector->globalOffset=farg; + break; + case 15: + ssstr>> iargval; + thisDetector->clkDiv=iargval; + break; + default: + cout << "unknown!" << endl; + } + break; + } + } + } + } + } + infile.close(); + } + else + { + cout << "Error opening configuration file " << fname << " for reading" << endl; + return FAIL; + } + + setTCPSocket(hostname,cport,sport,dport); + setDetectorType(dtype); + setNumberOfModules(nmx,X); + setNumberOfModules(nmy,Y); + + return OK; +}; + + +int slsDetector::writeConfigurationFile(string const fname){ + + + string names[]={"Hostname", "NmodX", "NmodY", "Detector", "ControlPort", "StopPort", "DataPort", "TrimBitDir", "TrimBitEnergies","CalDir", "BadChanList", "AngCal", "AngDirection", "AngOffset", "ClkDiv"}; + ofstream outfile; + char hostname[1000]=""; + + + outfile.open (fname.c_str(),ios_base::out); + if (outfile.is_open()) + { + while (outfile.good()) { + if (controlSocket) { + controlSocket->getHostname(hostname); + } + outfile << "Hostname " << hostname << endl; + outfile << "NModX " << setNumberOfModules(GET_FLAG, X) << endl; + outfile << "NModY " << setNumberOfModules(GET_FLAG, Y) << endl; + switch (thisDetector->myDetectorType) { + case MYTHEN: + outfile << "Detector Mythen" << endl; + break; + case PILATUS: + outfile << "Detector Pilatus" << endl; + break; + case EIGER: + outfile << "Detector EIGER" << endl; + break; + case GOTTHARD: + outfile << "Detector Gotthard" << endl; + break; + case AGIPD: + outfile << "Detector Agipd" << endl; + break; + default: + outfile << "Detector Generic" << endl; + break; + + } + if (controlSocket) + outfile << "ControlPort " << controlSocket->getPortNumber() << endl; + if (stopSocket) + outfile << "StopPort " << stopSocket->getPortNumber() << endl; + if (dataSocket) + outfile << "DataPort" << dataSocket->getPortNumber() << endl; + outfile << "TrimBitDir " << thisDetector->trimDir << endl; + outfile << "TrimBitEnergies" ; + for (int ien=0; ien< thisDetector->nTrimEn; ien++) + outfile << " " << thisDetector->trimEnergies[ien]<< endl; + outfile << endl; + outfile << "CalDir " << thisDetector->calDir << endl; + // outfile << "BadChanList " << thisDetector->badChanFile << endl; + //outfile << "AngCal " << thisDetector->angConvFile << endl; + outfile << "AngDirection " << thisDetector->angDirection << endl; + outfile << "FineOffset " << thisDetector->fineOffset<< endl; + outfile << "GlobalOffset " << thisDetector->globalOffset<< endl; + outfile << "ClkDiv " << thisDetector->clkDiv << endl; + } + outfile.close(); + } + else + { + cout << "Error opening configuration file " << fname << " for writing" << endl; + return FAIL; + } + return OK; +}; + /* + It should be possible to dump all the settings of the detector (including trimbits, threshold energy, gating/triggering, acquisition time etc. + in a file and retrieve it for repeating the measurement with identicals ettings, if necessary + */ +/* int slsDetector::dumpDetectorSetup(string fname){}; + int slsDetector::retrieveDetectorSetup(string fname){}; +*/ + /* + configure the socket communication and check that the server exists + enum communicationProtocol{ + TCP, + UDP + }{}; + + */ + +int slsDetector::setTCPSocket(string const name, int const control_port, int const stop_port, int const data_port){ + + + char thisName[MAX_STR_LENGTH]; + int thisCP, thisSP, thisDP; + int retval=OK; + + if (strcmp(name.c_str(),"")!=0) { +#ifdef VERBOSE + cout << "setting hostname" << endl; +#endif + strcpy(thisName,name.c_str()); + strcpy(thisDetector->hostname,thisName); + if (controlSocket) { + delete controlSocket; + controlSocket=NULL; + } + if (stopSocket) { + delete stopSocket; + stopSocket=NULL; + } + if (dataSocket){ + delete dataSocket; + dataSocket=NULL; + } + } else + strcpy(thisName,thisDetector->hostname); + + if (control_port>0) { +#ifdef VERBOSE + cout << "setting control port" << endl; +#endif + thisCP=control_port; + thisDetector->controlPort=thisCP; + if (controlSocket) { + delete controlSocket; + controlSocket=NULL; + } + } else + thisCP=thisDetector->controlPort; + + if (stop_port>0) { +#ifdef VERBOSE + cout << "setting stop port" << endl; +#endif + thisSP=stop_port; + thisDetector->stopPort=thisSP; + if (stopSocket) { + delete stopSocket; + stopSocket=NULL; + } + } else + thisSP=thisDetector->stopPort; + + + if (data_port>0) { +#ifdef VERBOSE + cout << "setting data port" << endl; +#endif + thisDP=data_port; + thisDetector->dataPort=thisDP; + if (dataSocket){ + delete dataSocket; + dataSocket=NULL; + } + } else + thisDP=thisDetector->dataPort; + + + if (!controlSocket) { + controlSocket= new MySocketTCP(thisName, thisCP); + if (controlSocket->getErrorStatus()){ +#ifdef VERBOSE + cout << "Could not connect Control socket " << thisName << " " << thisCP << endl; +#endif + retval=FAIL; + } +#ifdef VERYVERBOSE + else + cout << "Control socket connected " <getErrorStatus()){ +#ifdef VERBOSE + cout << "Could not connect Stop socket "<getErrorStatus()){ +#ifdef VERBOSE + cout << "Could not connect Data socket "<Connect(); + cout << "socket connection " << i<< endl; + if (i>=0) { + cout << "Could connect to socket" << endl; + getMaxNumberOfModules(X); + getMaxNumberOfModules(Y); + controlSocket->Disconnect(); + } else { + retval=FAIL; +#ifdef VERBOSE + cout << "could not connect to detector" << endl; + cout << "setting offline" << endl; +#endif + } + + + + if (retval==FAIL) { + onlineFlag=OFFLINE_FLAG; + if (controlSocket) + delete controlSocket; + if (stopSocket) + delete stopSocket; + if (dataSocket) + delete dataSocket; + } + */ + return retval; +}; + + + + + + /* I/O */ + + + slsDetector::sls_detector_module* slsDetector::readTrimFile(string fname, slsDetector::sls_detector_module *myMod){ + + int nflag=0; + + if (myMod==NULL) { + myMod=createModule(); + nflag=1; + } + string myfname; + string str; + ifstream infile; + ostringstream oss; + int isgood=1; + int iline=0; + string names[]={"Vtrim", "Vthresh", "Rgsh1", "Rgsh2", "Rgpr", "Vcal", "outBuffEnable"}; + string sargname; + int ival; + int ichan=0, ichip=0, idac=0; + + + +#ifdef VERBOSE + cout << "reading trimfile for module number "<< myMod->module << endl; +#endif + //im=myMod->module; + //myMod->module=im; + // myMod->serialnumber=getId(MODULE_SERIAL_NUMBER, im); + // if (im<0) + myfname=fname; + /* else { + // oss << fname << ".sn" << setfill('0') <serialnumber + oss << fname << ".sn" << setfill('0') <module; + myfname=oss.str(); + + }*/ +#ifdef VERBOSE + cout << "trim file name is "<< myfname << endl; +#endif + infile.open(myfname.c_str(), ios_base::in); + if (infile.is_open()) { + // while (infile.good() && isgood==1) { + for (int iarg=0; iargnDacs; iarg++) { + getline(infile,str); + iline++; +#ifdef VERBOSE + // cout << str << endl; +#endif + istringstream ssstr(str); + ssstr >> sargname >> ival; +#ifdef VERBOSE + cout << sargname << " dac nr. " << idac << " is " << ival << endl; +#endif + myMod->dacs[idac]=ival; + idac++; + } + for (ichip=0; ichipnChips; ichip++) { + getline(infile,str); + iline++; +#ifdef VERBOSE + // cout << str << endl; +#endif + istringstream ssstr(str); + ssstr >> sargname >> ival; +#ifdef VERBOSE + // cout << "chip " << ichip << " " << sargname << " is " << ival << endl; +#endif + + myMod->chipregs[ichip]=ival; + for (ichan=0; ichannChans; ichan++) { + getline(infile,str); +#ifdef VERBOSE + // cout << str << endl; +#endif + istringstream ssstr(str); + +#ifdef VERBOSE + // cout << "channel " << ichan+ichip*thisDetector->nChans <<" iline " << iline<< endl; +#endif + iline++; + myMod->chanregs[ichip*thisDetector->nChans+ichan]=0; + for (int iarg=0; iarg<6 ; iarg++) { + ssstr >> ival; + //if (ssstr.good()) { + switch (iarg) { + case 0: +#ifdef VERBOSE + // cout << "trimbits " << ival ; +#endif + myMod->chanregs[ichip*thisDetector->nChans+ichan]|=ival&0x3f; + break; + case 1: +#ifdef VERBOSE + //cout << " compen " << ival ; +#endif + myMod->chanregs[ichip*thisDetector->nChans+ichan]|=ival<<9; + break; + case 2: +#ifdef VERBOSE + //cout << " anen " << ival ; +#endif + myMod->chanregs[ichip*thisDetector->nChans+ichan]|=ival<<8; + break; + case 3: +#ifdef VERBOSE + //cout << " calen " << ival ; +#endif + myMod->chanregs[ichip*thisDetector->nChans+ichan]|=ival<<7; + break; + case 4: +#ifdef VERBOSE + //cout << " outcomp " << ival ; +#endif + myMod->chanregs[ichip*thisDetector->nChans+ichan]|=ival<<10; + break; + case 5: +#ifdef VERBOSE + //cout << " counts " << ival << endl; +#endif + myMod->chanregs[ichip*thisDetector->nChans+ichan]|=ival<<11; + break; + default: + cout << " too many columns" << endl; + break; + } + } + } + // } + } +#ifdef VERBOSE + cout << "read " << ichan*ichip << " channels" <nChans; ichan++) { + iv=mod.chanregs[ichip*thisDetector->nChans+ichan]; + iv1= (iv&0x3f); + outfile <>nb); + outfile << iv1 << " "; + nb=8; + iv1=((iv&(1<>nb); + outfile << iv1 << " "; + nb=7; + iv1=((iv&(1<>nb); + outfile <>nb); + outfile << iv1 << " "; + nb=11; + iv1= ((iv&0xfffff800)>>nb); + outfile << iv1 << endl; + } + } + outfile.close(); + return OK; + } else { + cout << "could not open file " << fname << endl; + return FAIL; + } + +}; + + + + +int slsDetector::writeTrimFile(string fname, int imod){ + + return writeTrimFile(fname,detectorModules[imod]); + +}; + +/* generates file name without extension*/ + +string slsDetector::createFileName() { + + + ostringstream osfn; + /*directory name +root file name */ + osfn << thisDetector->filePath << "/" << thisDetector->fileName; + + if (currentPositionIndex>0 && currentPositionIndex<=thisDetector->numberOfPositions) + osfn << "_p" << currentPositionIndex; + + osfn << "_" << thisDetector->fileIndex; + + return osfn.str(); + +} + +int slsDetector::writeDataFile(string fname, float *data, float *err, float *ang, char dataformat, int nch){ + if (nch==-1) + nch=thisDetector->nChans*thisDetector->nChips*thisDetector->nMods; + + + ofstream outfile; + int idata; + if (data==NULL) + return FAIL; +#ifdef VERBOSE + cout << "writing data to file " << fname << endl; +#endif + // args|=0x10; // one line per channel! + + outfile.open (fname.c_str(),ios_base::out); + if (outfile.is_open()) + { +#ifdef VERBOSE + cout << "Writing to file " << fname << endl; +#endif + for (int ichan=0; ichannChans*thisDetector->nChips*thisDetector->nMods; ichan++) + outfile << ichan << " " << *(data+ichan) << endl; + outfile.close(); + return OK; + } else { + cout << "Could not open file " << fname << "for writing"<< endl; + return FAIL; + } +}; + + + + + +int slsDetector::readDataFile(string fname, float *data, float *err, float *ang, char dataformat, int nch){ + + + ifstream infile; + int ichan, iline=0; + int interrupt=0; + float fdata, ferr, fang; + int maxchans; + int ich; + string str; + + if (nch==0) + maxchans=thisDetector->nChans*thisDetector->nChips*thisDetector->nMods; + else if (nch<0) + maxchans=0xfffffff; + else + maxchans=nch; + +#ifdef VERBOSE + cout << "Opening file "<< fname << endl; +#endif + infile.open(fname.c_str(), ios_base::in); + if (infile.is_open()) { + while (infile.good() and interrupt==0) { + getline(infile,str); +#ifdef VERBOSE + cout << str << endl; +#endif + istringstream ssstr(str); + if (ang==NULL) { + ssstr >> ichan >> fdata; + ich=ichan; + if (ich!=iline) + cout << "Channel number " << ichan << " does not match with line number " << iline << endl; + } else { + ssstr >> fang >> fdata; + ich=iline; + } + if (!ssstr.good()) { + interrupt=1; + break; + } + if (err) + ssstr >> ferr; + if (!ssstr.good()) { + interrupt=1; + break; + } + if (ich> ichan >> idata; + if (!ssstr.good()) { + interrupt=1; + break; + } + if (ichan!=iline) { + cout << " Expected channel "<< iline <<" but read channel "<< ichan << endl; + interrupt=1; + break; + } else { + if (ilinenChans*thisDetector->nChips*thisDetector->nMods) { + data[iline]=idata; + iline++; + } else { + interrupt=1; + break; + } + } + } + } else { + cout << "Could not read file " << fname << endl; + return -1; + } + return iline; +}; + + + + +int slsDetector::readCalibrationFile(string fname, float &gain, float &offset){ + + char line[500]; + string str; + ifstream infile; +#ifdef VERBOSE + cout << "Opening file "<< fname << endl; +#endif + infile.open(fname.c_str(), ios_base::in); + if (infile.is_open()) { + getline(infile,str); +#ifdef VERBOSE + cout << str << endl; +#endif + istringstream ssstr(str); + ssstr >> offset >> gain; + } else { + cout << "Could not open calibration file "<< fname << endl; + gain=0.; + offset=0.; + return -1; + } + return 0; +}; +/* +int slsDetector::writeCalibrationFile(string fname, float gain, float offset){}; +*/ + /* Communication to server */ + + // General purpose functions + + /* + executes a system command on the server + e.g. mount an nfs disk, reboot and returns answer etc. + */ +int slsDetector::execCommand(string cmd, string answer){ + + char arg[MAX_STR_LENGTH], retval[MAX_STR_LENGTH]; + int fnum=F_EXEC_COMMAND; + + int ret=FAIL; + + strcpy(arg,cmd.c_str()); + +#ifdef VERBOSE + cout << endl; + cout << "Sending command " << arg << endl; +#endif + if (onlineFlag==ONLINE_FLAG) { + if (controlSocket) { + if (controlSocket->Connect()>=0) { + if (controlSocket->SendDataOnly(&fnum,sizeof(fnum))>=0) { + if (controlSocket->SendDataOnly(arg,MAX_STR_LENGTH)>=0) { + if (controlSocket->ReceiveDataOnly(retval,MAX_STR_LENGTH)>=0) { + ret=OK; + answer=retval; + } + } + } + controlSocket->Disconnect(); + } + } +#ifdef VERBOSE + cout << "Detector answer is " << answer << endl; +#endif + } + return ret; +}; + +// Detector configuration functions + + /* + the detector knows what type of detector it is + + enum detectorType{ + GET_DETECTOR_TYPE, + GENERIC, + MYTHEN, + PILATUS, + EIGER, + GOTTHARD, + AGIPD + }; + + */ +int slsDetector::setDetectorType(detectorType const type){ + + int arg, retval=FAIL; + int fnum=F_GET_DETECTOR_TYPE; + arg=int(type); + detectorType retType=type; + char mess[100]; + strcpy(mess,"dummy"); + + int ret=FAIL; + +#ifdef VERBOSE + cout << endl; + cout << "Setting detector type to " << arg << endl; +#endif + if (onlineFlag==ONLINE_FLAG) { + if (controlSocket) { + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + if (retval==OK) + controlSocket->ReceiveDataOnly(&retType,sizeof(retType)); + else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + } + } else { + if (type==GET_DETECTOR_TYPE) + retType=thisDetector->myDetectorType; + else { + retType=type; + thisDetector->myDetectorType=type; + } + retval=OK; + } +#ifdef VERBOSE + cout << "Detector type set to " << retType << endl; +#endif + if (retval==FAIL) { + cout << "Set detector type failed " << endl; + retType=GENERIC; + } + else + thisDetector->myDetectorType=retType; + + + return retType; +}; + +int slsDetector::setDetectorType(string const type){ + detectorType dtype=GENERIC; + if (type=="Mythen") + dtype=MYTHEN; + else if (type=="Pilatus") + dtype=PILATUS; + else if (type=="Eiger") + dtype=EIGER; + else if (type=="Gotthard") + dtype=GOTTHARD; + else if (type=="Agipd") + dtype=AGIPD; + return setDetectorType(dtype); +}; + +void slsDetector::getDetectorType(char *type){ + + switch (thisDetector->myDetectorType) { + case MYTHEN: + strcpy(type,"Mythen"); + break; + case PILATUS: + strcpy(type,"Pilatus"); + break; + case EIGER: + strcpy(type,"Eiger"); + break; + case GOTTHARD: + strcpy(type,"Gotthard"); + break; + case AGIPD: + strcpy(type,"Agipd"); + break; + default: + strcpy(type,"Unknown"); + break; + } +}; + + + + + /* needed to set/get the size of the detector */ +// if n=GET_FLAG returns the number of installed modules, +int slsDetector::setNumberOfModules(int n, dimension d){ + + int arg[2], retval; + int fnum=F_SET_NUMBER_OF_MODULES; + int ret=FAIL; + char mess[100]; + + + arg[0]=d; + arg[1]=n; + + + if (dY) { + cout << "Set number of modules in wrong dimension " << d << endl; + return ret; + } + + +#ifdef VERBOSE + cout << endl; + cout << "Setting number of modules of dimension "<< d << " to " << n << endl; +#endif + if (onlineFlag==ONLINE_FLAG) { + if (controlSocket) { + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(&arg,sizeof(arg)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret==OK) + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Deterctor returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + } + } else { + ret=OK; + if (n==GET_FLAG) + retval=thisDetector->nMod[d]; + else { + if (n<=0 || n>thisDetector->nModMax[d]) { + retval=thisDetector->nMod[d]; + ret=FAIL; + } else + retval=thisDetector->nMod[d]; + } + } +#ifdef VERBOSE + cout << "Number of modules in dimension "<< d <<" is " << retval << endl; +#endif + if (ret==FAIL) { + cout << "Set number of modules failed " << endl; + } else { + thisDetector->nMod[d]=retval; + thisDetector->nMods=thisDetector->nMod[X]*thisDetector->nMod[Y]; + thisDetector->dataBytes=thisDetector->nMod[X]*thisDetector->nMod[Y]*thisDetector->nChips*thisDetector->nChans*thisDetector->dynamicRange/8; + } + return thisDetector->nMod[d]; +}; + + + + +int slsDetector::getMaxNumberOfModules(dimension d){ + + int retval; + int fnum=F_GET_MAX_NUMBER_OF_MODULES; + int ret=FAIL; + char mess[100]; + + if (dY) { + cout << "Get max number of modules in wrong dimension " << d << endl; + return ret; + } +#ifdef VERBOSE + cout << endl; + cout << "Getting max number of modules in dimension "<< d <Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(&d,sizeof(d)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret==OK) + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Deterctor returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + } + } else { + ret=OK; + retval=thisDetector->nModMax[d]; + } +#ifdef VERBOSE + cout << "Max number of modules in dimension "<< d <<" is " << retval << endl; +#endif + if (ret==FAIL) { + cout << "Get max number of modules failed " << endl; + return retval; + } else { + thisDetector->nModMax[d]=retval; + thisDetector->nModsMax=thisDetector->nModMax[0]*thisDetector->nModMax[1]; + } + return thisDetector->nModMax[d]; +}; + + + + /* + This function is used to set the polarity and meaning of the digital I/O signals (signal index) + +enum externalSignalFlag { + GET_EXTERNAL_SIGNAL_FLAG, + SIGNAL_OFF, + GATE_ACTIVE_HIGH, + GATE_ACTIVE_LOW, + TRIGGER_RISING_EDGE, + TRIGGER_FALLING_EDGE +}{}; + */ + + slsDetector::externalSignalFlag slsDetector::setExternalSignalFlags( slsDetector::externalSignalFlag pol, int signalindex){ + + + + + int arg[2]; + externalSignalFlag retval; + int ret=FAIL; + int fnum=F_SET_EXTERNAL_SIGNAL_FLAG; + char mess[100]; + + arg[0]=signalindex; + arg[1]=pol; + + retval=GET_EXTERNAL_SIGNAL_FLAG; + +#ifdef VERBOSE + cout << endl; + cout << "Setting signal "<< signalindex << " to flag" << pol << endl; +#endif + if (onlineFlag==ONLINE_FLAG) { + if (controlSocket) { + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(&arg,sizeof(arg)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret==OK) + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + } + } else { + retval=GET_EXTERNAL_SIGNAL_FLAG; + ret=FAIL; + } +#ifdef VERBOSE + cout << "Signal "<< signalindex << " flag set to" << retval << endl; +#endif + if (ret==FAIL) { + cout << "Set signal flag failed " << endl; + } + return retval; +}; + + /* + this function is used to select wether the detector is triggered or gated and in which mode + enum externalCommunicationMode{ + GET_EXTERNAL_COMMUNICATION_MODE, + AUTO, + TRIGGER_EXPOSURE, + TRIGGER_READOUT, + TRIGGER_COINCIDENCE_WITH_INTERNAL_ENABLE, + GATE_FIX_NUMBER, + GATE_FIX_DURATION, + GATE_WITH_START_TRIGGER, + GATE_COINCIDENCE_WITH_INTERNAL_ENABLE +}; + + */ + + slsDetector::externalCommunicationMode slsDetector::setExternalCommunicationMode( slsDetector::externalCommunicationMode pol){ + + + + + int arg[1]; + externalCommunicationMode retval; + int fnum=F_SET_EXTERNAL_COMMUNICATION_MODE; + char mess[100]; + + arg[0]=pol; + + int ret=FAIL; + retval=GET_EXTERNAL_COMMUNICATION_MODE; + +#ifdef VERBOSE + cout << endl; + cout << "Setting communication to mode " << pol << endl; +#endif + if (onlineFlag==ONLINE_FLAG) { if (controlSocket) { + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(&arg,sizeof(arg)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret==OK) + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + } + } else { + retval=GET_EXTERNAL_COMMUNICATION_MODE; + ret=FAIL; + } +#ifdef VERBOSE + cout << "Communication mode "<< " set to" << retval << endl; +#endif + if (ret==FAIL) { + cout << "Setting communication mode failed" << endl; + } + return retval; + +}; + + + // Tests and identification + /* + Gets versions + + enum idMode{ + MODULE_SERIAL_NUMBER, + MODULE_FIRMWARE_VERSION, + DETECTOR_SERIAL_NUMBER, + DETECTOR_FIRMWARE_VERSION, + DETECTOR_SOFTWARE_VERSION + }{}; + + */ + + + + + +int64_t slsDetector::getId( slsDetector::idMode mode, int imod){ + + + int64_t retval; + int fnum=F_GET_ID; + int ret=FAIL; + + char mess[100]; + +#ifdef VERBOSE + cout << endl; + cout << "Getting id of "<< mode << endl; +#endif + if (onlineFlag==ONLINE_FLAG) { + if (controlSocket) { + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(&mode,sizeof(mode)); + if (mode==MODULE_SERIAL_NUMBER) + controlSocket->SendDataOnly(&imod,sizeof(imod)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret==OK) + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + } + } else { + ret=FAIL; + } + if (ret==FAIL) { + cout << "Get id failed " << endl; + return ret; + } else { +#ifdef VERBOSE + cout << "Id "<< mode <<" is " << hex <Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(&mode,sizeof(mode)); + if (mode==CHIP_TEST) + controlSocket->SendDataOnly(&imod,sizeof(imod)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret==OK) + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + } + } else { + ret=FAIL; + } +#ifdef VERBOSE + cout << "Id "<< mode <<" is " << retval << endl; +#endif + if (ret==FAIL) { + cout << "Get id failed " << endl; + return ret; + } else + return retval; +}; + + + + /* + analog test of the modules + enum analogTestMode { + COUNT_CALIBRATION_PULSES, + I_DON_T_KNOW + }{}; + + */ +/* +int* slsDetector::analogTest(analogTestMode mode){ + cout << "function not yet implemented " << endl; +}; +*/ + /* + enable analog output of channel + */ +/* +int slsDetector::enableAnalogOutput(int ichan){ + int imod=ichan/(nChans*nChips); + ichan-=imod*(nChans*nChips); + int ichip=ichan/nChans; + ichan-=ichip*(nChans); + enableAnalogOutput(imod,ichip,ichan); + +}; +int slsDetector::enableAnalogOutput(int imod, int ichip, int ichan){ + cout << "function not yet implemented " << endl; +}; +*/ + /* + give a train of calibration pulses + */ +/* +int slsDetector::giveCalibrationPulse(float vcal, int npulses){ + cout << "function not yet implemented " << endl; +}; +*/ + // Expert low level functions + + + + /* write or read register */ + +int slsDetector::writeRegister(int addr, int val){ + + + int retval; + int fnum=F_WRITE_REGISTER; + int ret=FAIL; + + char mess[100]; + + int arg[2]; + arg[0]=addr; + arg[1]=val; + + +#ifdef VERBOSE + cout << endl; + cout << "Writing to register "<< addr << " data " << val << endl; +#endif + if (onlineFlag==ONLINE_FLAG) { + if (controlSocket) { + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(arg,sizeof(arg)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret==OK) + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + } + } +#ifdef VERBOSE + cout << "Register returned "<< retval << endl; +#endif + if (ret==FAIL) { + cout << "Write to register failed " << endl; + } + return retval; + +}; + + + + +int slsDetector::readRegister(int addr){ + + + int retval; + int fnum=F_READ_REGISTER; + int ret=FAIL; + + char mess[100]; + + int arg; + arg=addr; + + +#ifdef VERBOSE + cout << endl; + cout << "Reding register "<< addr << endl; +#endif + if (onlineFlag==ONLINE_FLAG) { + if (controlSocket) { + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(&arg,sizeof(arg)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret==OK) + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + } + } +#ifdef VERBOSE + cout << "Register returned "<< retval << endl; +#endif + if (ret==FAIL) { + cout << "Read register failed " << endl; + } + return retval; + +}; + + + // Expert initialization functions + /* + set dacs or read ADC for the module + enum dacIndex { + TRIMBIT_SIZE, + THRESHOLD, + SHAPER1, + SHAPER2, + CALIBRATION_PULSE, + PREAMP, + TEMPERATURE, + HUMIDITY, + DETECTOR_BIAS +}{}; + */ + + +float slsDetector::setDAC(float val, dacIndex index, int imod){ + + + float retval; + int fnum=F_SET_DAC; + int ret=FAIL; + char mess[100]; + int arg[2]; + arg[0]=index; + arg[1]=imod; + +#ifdef VERBOSE + cout << endl; + cout << "Setting DAC "<< index << "of module " << imod << " to " << val << endl; +#endif + if (onlineFlag==ONLINE_FLAG) { + if (controlSocket) { + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(arg,sizeof(arg)); + controlSocket->SendDataOnly(&val,sizeof(val)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret==OK) { + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + if (dacs) { + if (imod>=0) { + *(dacs+index+imod*thisDetector->nDacs)=retval; + } + else { + for (imod=0; imodnModsMax; imod++) + *(dacs+index+imod*thisDetector->nDacs)=retval; + } + } + } else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + + } + } +#ifdef VERBOSE + cout << "Dac set to "<< retval << endl; +#endif + if (ret==FAIL) { + cout << "Set dac failed " << endl; + } + return retval; + + + +}; + + +float slsDetector::getADC(dacIndex index, int imod){ + + float retval; + int fnum=F_GET_ADC; + int ret=FAIL; + char mess[100]; + + int arg[2]; + arg[0]=index; + arg[1]=imod; + + + +#ifdef VERBOSE + cout << endl; + cout << "Getting ADC "<< index << "of module " << imod << endl; +#endif + if (onlineFlag==ONLINE_FLAG) { + if (controlSocket) { + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(arg,sizeof(arg)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret==OK) { + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + if (adcs) { + *(adcs+index+imod*thisDetector->nAdcs)=retval; + } + } else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + } + } +#ifdef VERBOSE + cout << "ADC returned "<< retval << endl; +#endif + if (ret==FAIL) { + cout << "Get ADC failed " << endl; + } + return retval; + + + +}; + + /* + configure single channel + enum channelRegisterBit { + COMPARATOR_ENABLE_OFF, + ANALOG_SIGNAL_ENABLE_OFF, + CALIBRATION_ENABLE_OFF, + TRIMBIT_OFF // should always be the last! + } + + */ + +int slsDetector::setChannel(int64_t reg, int ichan, int ichip, int imod){ + sls_detector_channel myChan; +#ifdef VERBOSE + cout << "Setting channel "<< ichan << " " << ichip << " " << imod << " to " << reg << endl; +#endif + int mmin=imod, mmax=imod+1, chimin=ichip, chimax=ichip+1, chamin=ichan, chamax=ichan+1; + + int ret; + + if (imod==-1) { + mmin=0; + mmax=thisDetector->nModsMax; + } + + if (ichip==-1) { + chimin=0; + chimax=thisDetector->nChips; + } + + if (ichan==-1) { + chamin=0; + chamax=thisDetector->nChans; + } + + for (int im=mmin; imConnect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + sendChannel(&chan); + + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret==OK) { + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + } else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + } + + + if (ret==OK) { + if (chanregs) { + *(chanregs+im*thisDetector->nChans*thisDetector->nChips+ichi*thisDetector->nChips+icha)=retval; + } + } +#ifdef VERBOSE + cout << "Channel register returned "<< retval << endl; +#endif + return retval; + +} + + slsDetector::sls_detector_channel slsDetector::getChannel(int ichan, int ichip, int imod){ + + + int fnum=F_GET_CHANNEL; + sls_detector_channel myChan; + int arg[3]; + int ret=FAIL; + char mess[100]; + arg[0]=ichan; + arg[1]=ichip; + arg[2]=imod; + if (onlineFlag==ONLINE_FLAG) { + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(arg,sizeof(arg)); + + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret==OK) { + receiveChannel(&myChan); + } else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + } + + + if (ret==OK) { + if (chanregs) { + *(chanregs+imod*thisDetector->nChans*thisDetector->nChips+ichip*thisDetector->nChips+ichan)=myChan.reg; + } + } + +#ifdef VERBOSE + cout << "Returned channel "<< ichan << " " << ichip << " " << imod << " " << myChan.reg << endl; +#endif + return myChan; +} + + /* + configure chip + enum chipRegisterBit { + ENABLE_ANALOG_OUTPUT, + OUTPUT_WIDTH // should always be the last + }{}; + */ +int slsDetector::setChip(int reg, int ichip, int imod){ + slsDetector::sls_detector_chip myChip; + +#ifdef VERBOSE + cout << "Setting chip "<< ichip << " " << imod << " to " << reg << endl; +#endif + + + int chregs[thisDetector->nChans]; + int mmin=imod, mmax=imod+1, chimin=ichip, chimax=ichip+1; + int ret; + if (imod==-1) { + mmin=0; + mmax=thisDetector->nModsMax; + } + + if (ichip==-1) { + chimin=0; + chimax=thisDetector->nChips; + } + + myChip.nchan=thisDetector->nChans; + myChip.reg=reg; + for (int im=mmin; imnChans+im*thisDetector->nChans*thisDetector->nChips); + else { + for (int i=0; inChans; i++) + chregs[i]=-1; + myChip.chanregs=chregs; + } + ret=setChip(myChip); + } + } + return ret; +} + +int slsDetector::setChip( slsDetector::sls_detector_chip chip){ + + int fnum=F_SET_CHIP; + int retval; + int ret=FAIL; + char mess[100]; + + int ichi=chip.chip; + int im=chip.module; + + + + + + if (onlineFlag==ONLINE_FLAG) { + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + sendChip(&chip); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret==OK) { + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + } else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + } + + + if (ret==OK) { + if (chipregs) + *(chipregs+ichi+im*thisDetector->nChips)=retval; + } + +#ifdef VERBOSE + cout << "Chip register returned "<< retval << endl; +#endif + return retval; +}; + + + slsDetector::sls_detector_chip slsDetector::getChip(int ichip, int imod){ + + int fnum=F_GET_CHIP; + sls_detector_chip myChip; + int chanreg[thisDetector->nChans]; + + int ret=FAIL; + char mess[100]; + + + myChip.chip=ichip; + myChip.module=imod; + myChip.nchan=thisDetector->nChans; + myChip.chanregs=chanreg; + + int arg[2]; + arg[0]=ichip; + arg[1]=imod; + + + + + if (onlineFlag==ONLINE_FLAG) { + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(arg,sizeof(arg)); + + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret==OK) { + receiveChip(&myChip); + } else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + } + + + if (ret==OK) { + if (chipregs) + *(chipregs+ichip+imod*thisDetector->nChips)=myChip.reg; + if (chanregs) { + for (int ichan=0; ichannChans; ichan++) + *(chanregs+imod*thisDetector->nChans*thisDetector->nChips+ichip*thisDetector->nChans+ichan)=*((myChip.chanregs)+ichan); + } + } +#ifdef VERBOSE + cout << "Returned chip "<< ichip << " " << imod << " " << myChip.reg << endl; +#endif + + return myChip; +}; + + /* + configure module + enum moduleRegisterBit { + I_DON_T_KNOW, + OUTPUT_WIDTH // should always be the last + }{}; + */ + +int slsDetector::setModule(int reg, int imod){ + sls_detector_module myModule, *mptr; + + int charegs[thisDetector->nChans*thisDetector->nChips]; + int chiregs[thisDetector->nChips]; + float das[thisDetector->nDacs], ads[thisDetector->nAdcs]; + int mmin=imod, mmax=imod+1; + int ret; + + if (imod==-1) { + mmin=0; + mmax=thisDetector->nModsMax; + } + + + + for (int im=mmin; imnChans; + myModule.nchip=thisDetector->nChips; + myModule.ndac=thisDetector->nDacs; + myModule.nadc=thisDetector->nAdcs; + + myModule.reg=reg; + if (detectorModules) { + myModule.gain=(detectorModules+im)->gain; + myModule.offset=(detectorModules+im)->offset; + myModule.serialnumber=(detectorModules+im)->serialnumber; + } else { + myModule.gain=-1; + myModule.offset=-1; + myModule.serialnumber=-1; + } + + + for (int i=0; inAdcs; i++) + ads[i]=-1; + + if (chanregs) + myModule.chanregs=chanregs+im*thisDetector->nChips*thisDetector->nChans; + else { + for (int i=0; inChans*thisDetector->nChips; i++) + charegs[i]=-1; + myModule.chanregs=charegs; + } + if (chipregs) + myModule.chipregs=chanregs+im*thisDetector->nChips; + else { + for (int ichip=0; ichipnChips; ichip++) + chiregs[ichip]=-1; + myModule.chipregs=chiregs; + } + if (dacs) + myModule.dacs=dacs+im*thisDetector->nDacs; + else { + for (int i=0; inDacs; i++) + das[i]=-1; + myModule.dacs=das; + } + if (adcs) + myModule.adcs=adcs+im*thisDetector->nAdcs; + else { + for (int i=0; inAdcs; i++) + ads[i]=-1; + myModule.adcs=ads; + } + ret=setModule(myModule); + } + return ret; + + +}; + + + +int slsDetector::setModule(sls_detector_module module){ + + + int fnum=F_SET_MODULE; + int retval; + int ret=FAIL; + char mess[100]; + + int im=module.module; + + + + + + if (onlineFlag==ONLINE_FLAG) { + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + sendModule(&module); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret==OK) { + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + } else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + } + + + if (ret==OK) { + if (detectorModules) + (detectorModules+im)->reg=retval; + } + +#ifdef VERBOSE + cout << "Module register returned "<< retval << endl; +#endif + + return retval; + + + +}; + +slsDetector::sls_detector_module *slsDetector::getModule(int imod){ + + + int fnum=F_GET_MODULE; + sls_detector_module *myMod=createModule(); + + + char *ptr, *goff=(char*)thisDetector; + + // int chanreg[thisDetector->nChans*thisDetector->nChips]; + //int chipreg[thisDetector->nChips]; + //float dac[thisDetector->nDacs], adc[thisDetector->nAdcs]; + + int ret=FAIL; + char mess[100]; + int n; + +#ifdef VERBOSE + cout << "getting module " << imod << endl; +#endif + + myMod->module=imod; + // myMod.nchan=thisDetector->nChans*thisDetector->nChips; + //myMod.chanregs=chanreg; + //myMod.nchip=thisDetector->nChips; + //myMod.chipregs=chipreg; + //myMod.ndac=thisDetector->nDacs; + //myMod.dacs=dac; + //myMod.ndac=thisDetector->nAdcs; + //myMod.dacs=adc; + + + + + + + if (onlineFlag==ONLINE_FLAG) { + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(&imod,sizeof(imod)); + + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret==OK) { + receiveModule(myMod); + } else { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + } + + + if (ret==OK) { + if (detectorModules) { + (detectorModules+imod)->nchan=myMod->nchan; + (detectorModules+imod)->nchip=myMod->nchip; + (detectorModules+imod)->ndac=myMod->ndac; + (detectorModules+imod)->nadc=myMod->nadc; + thisDetector->nChips=myMod->nchip; + thisDetector->nChans=myMod->nchan/myMod->nchip; + thisDetector->nDacs=myMod->ndac; + thisDetector->nAdcs=myMod->nadc; + + for (int ichip=0; ichipnChips; ichip++) { + if (chipregs) + chipregs[ichip+thisDetector->nChips*imod]=myMod->chipregs[ichip]; + if (chanregs) { + for (int i=0; inChans; i++) { + chanregs[i+ichip*thisDetector->nChans+thisDetector->nChips*thisDetector->nChans*imod]=myMod->chanregs[ichip*thisDetector->nChans+i]; + } + } + } + if (dacs) { + for (int i=0; inDacs; i++) + dacs[i+imod*thisDetector->nDacs]=myMod->dacs[i]; + } + if (adcs) { + for (int i=0; inAdcs; i++) + adcs[i+imod*thisDetector->nAdcs]=myMod->adcs[i]; + } + (detectorModules+imod)->gain=myMod->gain; + (detectorModules+imod)->offset=myMod->offset; + (detectorModules+imod)->serialnumber=myMod->serialnumber; + (detectorModules+imod)->reg=myMod->reg; + } + } else { + deleteModule(myMod); + myMod=NULL; + } + + + +#ifdef VERBOSE + cout << "Returned module "<< myMod->module << " " << myMod->reg << endl; +#endif + return myMod; +} + + + + + // calibration functions +/* + really needed? + +int slsDetector::setCalibration(int imod, detectorSettings isettings, float gain, float offset){ + cout << "function not yet implemented " << endl; + + + + return OK; + +} +int slsDetector::getCalibration(int imod, detectorSettings isettings, float &gain, float &offset){ + + cout << "function not yet implemented " << endl; + + + +} +*/ + + /* + calibrated setup of the threshold + */ + +int slsDetector::getThresholdEnergy(int imod){ + + int fnum= F_GET_THRESHOLD_ENERGY; + int retval; + int ret=FAIL; + char mess[100]; +#ifdef VERBOSE + cout << "Getting threshold energy "<< endl; +#endif + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(&imod,sizeof(imod)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + cout << "Detector returned error: "<< endl; + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << mess << endl; + } else { + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + } + controlSocket->Disconnect(); + } + return retval; +}; + +int slsDetector::setThresholdEnergy(int e_eV, int imod, detectorSettings isettings){ + + int fnum= F_SET_THRESHOLD_ENERGY; + int retval; + int ret=FAIL; + char mess[100]; +#ifdef VERBOSE + cout << "Getting threshold energy "<< endl; +#endif + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(&e_eV,sizeof(e_eV)); + controlSocket->SendDataOnly(&imod,sizeof(imod)); + controlSocket->SendDataOnly(&isettings,sizeof(isettings)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + cout << "Detector returned error: "<< endl; + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << mess << endl; + } else { +#ifdef VERBOSE + cout << "Detector returned OK "<< endl; +#endif + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + } + controlSocket->Disconnect(); + } + return retval; +}; + + /* + select detector settings + */ + slsDetector::detectorSettings slsDetector::getSettings(int imod){ + + + int fnum=F_SET_SETTINGS; + int ret=FAIL; + char mess[100]; + int retval; + int arg[2]; + arg[0]=GET_SETTINGS; + arg[1]=imod; +#ifdef VERBOSE + cout << "Getting settings "<< endl; +#endif + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(arg,sizeof(arg)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } else{ + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + +#ifdef VERBOSE + cout << "Settings are "<< retval << endl; +#endif + } + controlSocket->Disconnect(); + } + thisDetector->currentSettings=(detectorSettings)retval; + return thisDetector->currentSettings; + +}; + + slsDetector::detectorSettings slsDetector::setSettings( slsDetector::detectorSettings isettings, int imod){ + sls_detector_module *myMod=createModule(); + int modmi=imod, modma=imod+1, im=imod; + string trimfname, calfname; + string ssettings; + + if (isettings>=STANDARD && isettings<=HIGHGAIN) { + switch (isettings) { + case STANDARD: + ssettings="/standard"; + break; + case FAST: + ssettings="/fast"; + break; + case HIGHGAIN: + ssettings="/highgain"; + break; + default: + cout << "Unknown settings!" << endl; + } + + if (imod<0) { + modmi=0; + // modma=thisDetector->nModMax[X]*thisDetector->nModMax[Y]; + modma=thisDetector->nMod[X]*thisDetector->nMod[Y]; + } + + for (im=modmi; immodule=im; + //create file names + ostfn << thisDetector->trimDir << ssettings <<"/noise.sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im) << setbase(10); + oscfn << thisDetector->calDir << ssettings << "/calibration.sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im) << setbase(10); + // + trimfname=ostfn.str(); + if (readTrimFile(trimfname,myMod)) { + calfname=oscfn.str(); + readCalibrationFile(calfname,myMod->gain, myMod->offset); + setModule(*myMod); + } else { + ostringstream ostfn,oscfn; + ostfn << thisDetector->trimDir << ssettings <<"/noise.snxxx" ; + oscfn << thisDetector->calDir << ssettings << "/calibration.snxxx"; + trimfname=ostfn.str(); + if (readTrimFile(trimfname,myMod)) { + calfname=oscfn.str(); + readCalibrationFile(calfname,myMod->gain, myMod->offset); + setModule(*myMod); + } + } + } + } + deleteModule(myMod); + if (thisDetector->correctionMask&(1<-1 && isett<3) { + thisDetector->tDead=t[isett]; + } + } + + + return getSettings(imod); +}; + +// Acquisition functions +/* change these funcs accepting also ok/fail */ + +int slsDetector::startAcquisition(){ + + + int fnum=F_START_ACQUISITION; + int ret=FAIL; + char mess[100]; + +#ifdef VERBOSE + cout << "Starting acquisition "<< endl; +#endif + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + return ret; + + + +}; +int slsDetector::stopAcquisition(){ + + + int fnum=F_STOP_ACQUISITION; + int ret=FAIL; + char mess[100]; + +#ifdef VERBOSE + cout << "Stopping acquisition "<< endl; +#endif + if (stopSocket->Connect()>=0) { + stopSocket->SendDataOnly(&fnum,sizeof(fnum)); + stopSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + stopSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + stopSocket->Disconnect(); + } + return ret; + + +}; + +int slsDetector::startReadOut(){ + + int fnum=F_START_READOUT; + int ret=FAIL; + char mess[100]; + +#ifdef VERBOSE + cout << "Starting readout "<< endl; +#endif + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } + controlSocket->Disconnect(); + } + return ret; +}; + + + +int slsDetector::getRunStatus(){ + int fnum=F_GET_RUN_STATUS; + int retval; + int ret=FAIL; + char mess[100]; +#ifdef VERBOSE + cout << "Getting status "<< endl; +#endif + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } else + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + controlSocket->Disconnect(); + } + return retval; + + +}; + +int* slsDetector::readFrame(){ + + int fnum=F_READ_FRAME, n; + int nel=thisDetector->dataBytes/sizeof(int); + int* retval=new int[nel]; + int ret=FAIL; + char mess[100]; + int i; + +#ifdef VERBOSE + cout << "slsDetector: Reading frame "<< endl; +#endif + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + retval=getDataFromDetector(); + controlSocket->Disconnect(); + } + return retval; +}; + +int* slsDetector::getDataFromDetector(){ + + int nel=thisDetector->dataBytes/sizeof(int); + int n; + int* retval=new int[nel]; + int ret=FAIL; + char mess[100]; +#ifdef VERY_VERBOSE + int i; +#endif + +#ifdef VERBOSE + // cout << "getting data "<< endl; +#endif + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned: " << mess << endl; + delete [] retval; + retval=NULL; + } else { + n=controlSocket->ReceiveDataOnly(retval,thisDetector->dataBytes); + +#ifdef VERBOSE + // cout << "Received "<< n << " data bytes" << endl; +#endif + if (ndataBytes) { + cout << "wrong data size received: received " << n << " but expected " << thisDetector->dataBytes << endl; + ret=FAIL; + delete [] retval; + retval=NULL; + } + } + + return retval; +}; + + + +int* slsDetector::readAll(){ + + int fnum=F_READ_ALL, n; + int* retval; // check what we return! + int ret=OK; + char mess[100]; + + int i=0; +#ifdef VERBOSE + cout << "Reading all frames "<< endl; +#endif + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + while (retval=getDataFromDetector()){ + i++; +#ifdef VERBOSE + // cout << i << endl; +#endif + dataQueue.push(retval); + } + controlSocket->Disconnect(); + } + //#ifdef VERBOSE + cout << "recieved "<< i<< " frames" << endl; + //#endif + return dataQueue.front(); // check what we return! + +}; + +int* slsDetector::startAndReadAll(){ + + + int* retval; + int i=0; + startAndReadAllNoWait(); + while (retval=getDataFromDetector()){ + i++; +#ifdef VERBOSE + // cout << i << endl; +#endif + dataQueue.push(retval); + } + controlSocket->Disconnect(); + +#ifdef VERBOSE + cout << "recieved "<< i<< " frames" << endl; +#endif + return dataQueue.front(); // check what we return! +/* while ((retval=getDataFromDetectorNoWait())) + i++; + #ifdef VERBOSE + cout << "Received " << i << " frames"<< endl; +#endif + return dataQueue.front(); // check what we return! + */ + +}; + + + +int slsDetector::startAndReadAllNoWait(){ + + int fnum= F_START_AND_READ_ALL; + int* retval; + int ret=OK; + char mess[100]; + int i=0; + +#ifdef VERBOSE + cout << "Starting and reading all frames "<< endl; +#endif + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + return OK; + } + return FAIL; +}; + +int* slsDetector::getDataFromDetectorNoWait() { + int *retval=getDataFromDetector(); + if (retval==NULL){ + controlSocket->Disconnect(); +#ifdef VERBOSE + cout << "Run finished "<< endl; +#endif + } else { +#ifdef VERBOSE + cout << "Frame received "<< endl; +#endif + } + return retval; // check what we return! +}; + + + + + +int* slsDetector::popDataQueue() { + int *retval=NULL; + if( !dataQueue.empty() ) { + retval=dataQueue.front(); + dataQueue.pop(); + } + return retval; +} + /* + set or read the acquisition timers + enum timerIndex { + FRAME_NUMBER, + ACQUISITION_TIME, + FRAME_PERIOD, + DELAY_AFTER_TRIGGER, + GATES_NUMBER, + PROBES_NUMBER + CYCLES_NUMBER, + GATE_INTEGRATED_TIME + } + */ +int64_t slsDetector::setTimer(timerIndex index, int64_t t){ + + + int fnum=F_SET_TIMER; + int64_t retval; + uint64_t ut, uretval; + char mess[100]; + int ret=OK; + int n=0; +#ifdef VERBOSE + cout << "Setting timer "<< index << " to " << t << "ns" << endl; +#endif + ut=t; + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(&index,sizeof(index)); + n=controlSocket->SendDataOnly(&t,sizeof(t)); +#ifdef VERBOSE + cout << "Sent "<< n << " bytes " << endl; +#endif + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } else { + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + } + controlSocket->Disconnect(); + } +#ifdef VERBOSE + cout << "Timer set to "<< retval << "ns" << endl; +#endif + if (t>0) + thisDetector->timerValue[index]=retval; + return retval; + +}; + +int64_t slsDetector::getTimeLeft(timerIndex index){ + + + int fnum=F_GET_TIME_LEFT; + int64_t retval; + char mess[100]; + int ret=OK; + +#ifdef VERBOSE + cout << "Getting timer "<< index << endl; +#endif + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(&index,sizeof(index)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } else { + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + thisDetector->timerValue[index]=retval; + } + controlSocket->Disconnect(); + } + +#ifdef VERBOSE + cout << "Time left is "<< retval << endl; +#endif + return retval; + +}; + + + // Flags +int slsDetector::setDynamicRange(int n){ + + int fnum=F_SET_DYNAMIC_RANGE; + int retval=-1; + char mess[100]; + int ret=OK; + +#ifdef VERBOSE + cout << "Setting dynamic range to "<< n << endl; +#endif + if (n==24) + n=32; + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(&n,sizeof(n)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } else { + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + } + controlSocket->Disconnect(); + } + if (ret==OK) { + thisDetector->dataBytes=thisDetector->nMod[X]*thisDetector->nMod[Y]*thisDetector->nChips*thisDetector->nChans*retval/8; + if (retval==32) + thisDetector->dynamicRange=24; + else + thisDetector->dynamicRange=retval; + + +#ifdef VERBOSE + cout << "Dynamic range set to "<< thisDetector->dynamicRange << endl; + cout << "Data bytes "<< thisDetector->dataBytes << endl; +#endif + + } + return thisDetector->dynamicRange; +}; + +/* + +int slsDetector::setROI(int nroi, int *xmin, int *xmax, int *ymin, int *ymax){ + + +}; +*/ + + /* + +enum readOutFlags { + NORMAL_READOUT, + setReadOutFlags(STORE_IN_RAM, + READ_HITS, + ZERO_COMPRESSION, + BACKGROUND_CORRECTIONS +}{}; + + */ + +int slsDetector::setReadOutFlags(readOutFlags flag){ + + + int fnum=F_SET_READOUT_FLAGS; + readOutFlags retval; + char mess[100]; + int ret=OK; + +#ifdef VERBOSE + cout << "Setting readout flags to "<< flag << endl; +#endif + + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->SendDataOnly(&flag,sizeof(flag)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } else { + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + thisDetector->roFlags=retval; + } + controlSocket->Disconnect(); + } +#ifdef VERBOSE + cout << "Readout flag set to "<< retval << endl; +#endif + return retval; +}; + + //Trimming + /* +enum trimMode { + NOISE_TRIMMING, + BEAM_TRIMMING, + IMPROVE_TRIMMING, + FIXEDSETTINGS_TRIMMING, + OFFLINE_TRIMMING +}{}; + */ +int slsDetector::executeTrimming(trimMode mode, int par1, int par2, int imod){ + + int fnum= F_EXECUTE_TRIMMING; + int retval; + char mess[100]; + int ret=OK; + int arg[3]; + arg[0]=imod; + arg[1]=par1; + arg[2]=par2; + + +#ifdef VERBOSE + cout << "Trimming module " << imod << " with mode "<< mode << " parameters " << par1 << " " << par2 << endl; +#endif + + if (controlSocket->Connect()>=0) { + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + cout << "sending mode bytes= "<< controlSocket->SendDataOnly(&mode,sizeof(mode)) << endl; + controlSocket->SendDataOnly(arg,sizeof(arg)); + controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (ret!=OK) { + controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + cout << "Detector returned error: " << mess << endl; + } else { +#ifdef VERBOSE + cout << "Detector trimmed "<< ret << endl; +#endif + /* + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + thisDetector->roFlags=retval; + */ + retval=ret; + } + controlSocket->Disconnect(); + } + return retval; + +}; + +float* slsDetector::decodeData(int *datain) { + float *dataout=new float[thisDetector->nChans*thisDetector->nChips*thisDetector->nMods]; + const char one=1; + const int bytesize=8; + + int ival=0; + char *ptr=(char*)datain; + char iptr; + + int nbits=thisDetector->dynamicRange; + int ipos=0, ichan=0, ibyte; + int nch, boff=0; + + switch (nbits) { + case 4: + for (ibyte=0; ibytedataBytes; ibyte++) { + iptr=ptr[ibyte]&0xff; + for (ipos=0; ipos<2; ipos++) { + // dataout[ibyte*2+ichan]=((iptr&((0xf)<>ichan)&0xf; + ival=(iptr>>(ipos*4))&0xf; + dataout[ichan]=ival; + ichan++; + } + } + break; + case 8: + for (ichan=0; ichandataBytes; ichan++) { + ival=ptr[ichan]&0xff; + dataout[ichan]=ival; + } + break; + case 16: + for (ichan=0; ichannChans*thisDetector->nChips*thisDetector->nMods; ichan++) { + // dataout[ichan]=0; + ival=0; + for (ibyte=0; ibyte<2; ibyte++) { + iptr=ptr[ichan*2+ibyte]; + ival|=((iptr<<(ibyte*bytesize))&(0xff<<(ibyte*bytesize))); + } + dataout[ichan]=ival; + } + break; + default: + for (ichan=0; ichannChans*thisDetector->nChips*thisDetector->nMods; ichan++) { + ival=datain[ichan]&0xffffff; + dataout[ichan]=ival; + } + } + + + /* + + if (nbits==32) { + for (ichan=0; ichannChans*thisDetector->nChips*thisDetector->nMods; ichan++) + dataout[ichan]=(datain[ichan]&0xffffff); + } else { + for (int ibyte=0; ibytedataBytes; ibyte++) { + for (int ibit=0; ibit>ibit)<dynamicRange) { + ipos=0; + dataout[ichan]=ival; + ichan++; + ival=0; + if (ichan>thisDetector->nChans*thisDetector->nChips*thisDetector->nMods){ + cout << "error: decoding too many channels!" << ichan; + break; + } + } + } + } + } + */ +#ifdef VERBOSE + cout << "decoded "<< ichan << " channels" << endl; +#endif + + + return dataout; +} + +//Corrections + /* + enum correctionFlags { + DISCARD_BAD_CHANNELS, + AVERAGE_NEIGHBOURS_FOR_BAD_CHANNELS, + FLAT_FIELD_CORRECTION, + RATE_CORRECTION, + ANGULAR_CONVERSION + } + */ + +int slsDetector::setFlatFieldCorrection(string fname){ + int interrupt=0; + float data[thisDetector->nModMax[X]*thisDetector->nModMax[Y]*thisDetector->nChans*thisDetector->nChips]; + float err[thisDetector->nModMax[X]*thisDetector->nModMax[Y]*thisDetector->nChans*thisDetector->nChips]; + float xmed[thisDetector->nModMax[X]*thisDetector->nModMax[Y]*thisDetector->nChans*thisDetector->nChips]; + int nmed=0; + int im=0; + int nch; + thisDetector->nBadFF=0; + + if (fname=="") { + thisDetector->correctionMask&=~(1<0) { + for (int ichan=0; ichan0) { + /* add to median */ + im=0; + while ((imim; i--) + xmed[i]=xmed[i-1]; + xmed[im]=data[ichan]; + nmed++; + } else { + //add the channel to the ff bad channel list + thisDetector->badFFList[thisDetector->nBadFF]=ichan; + (thisDetector->nBadFF)++; +#ifdef VERBOSE + cout << "Channel " << ichan << " added to the bad channel list" << endl; +#endif + + } + } + + if (nmed>1 && xmed[nmed/2]>0) { +#ifdef VERBOSE + cout << "Flat field median is " << xmed[nmed/2] << " calculated using "<< nmed << " points" << endl; +#endif + + thisDetector->correctionMask|=(1<0) { + ffcoefficients[ichan]=xmed[nmed/2]/data[ichan]; + fferrors[ichan]=ffcoefficients[ichan]*sqrt(data[ichan])/data[ichan]; + } else { + ffcoefficients[ichan]=0.; + fferrors[ichan]=1.; + } + } + for (int ichan=nch; ichannMod[X]*thisDetector->nMod[Y]*thisDetector->nChans*thisDetector->nChips; ichan++) { + ffcoefficients[ichan]=1.; + fferrors[ichan]=0.; + } + + fillBadChannelMask(); + + } else { + cout << "Flat field data from file " << fname << " are not valid " << endl; + return -1; + } + } else { + cout << "Flat field from file " << fname << " is not valid " << endl; + return -1; + } + } + return thisDetector->correctionMask&(1<correctionMask&(1<nMod[X]*thisDetector->nMod[Y]*thisDetector->nChans*thisDetector->nChips; ichan++) { + corr[ichan]=ffcoefficients[ichan]; + if (ecorr) + ecorr[ichan]=fferrors[ichan]; + } + } + return 1; + } else { + if (corr) + for (int ichan=0; ichannMod[X]*thisDetector->nMod[Y]*thisDetector->nChans*thisDetector->nChips; ichan++) { + corr[ichan]=1; + if (ecorr) + ecorr[ichan]=0; + } + return 0; + } + +} +int slsDetector::flatFieldCorrect(float datain, float errin, float &dataout, float &errout, float ffcoefficient, float fferr){ + float e; + + dataout=datain*ffcoefficient; + + if (errin==0 && datain>=0) + e=sqrt(datain); + else + e=errin; + + if (dataout>0) + errout=sqrt(e*ffcoefficient*e*ffcoefficient+datain*fferr*datain*fferr); + else + errout=1.; + + return 0; +}; + +int slsDetector::flatFieldCorrect(float* datain, float *errin, float* dataout, float *errout){ + float e, eo; + if (thisDetector->correctionMask&(1<nMod[X]*thisDetector->nMod[Y]*thisDetector->nChans*thisDetector->nChips; ichan++) { + if (errin==NULL) + e=0; + else + e=errin[ichan]; + + flatFieldCorrect(datain[ichan],e,dataout[ichan],eo,ffcoefficients[ichan],fferrors[ichan]); + if (errout) + errout[ichan]=eo; + } + } + return 0; + +}; + +int slsDetector::setRateCorrection(float t){ + float tdead[]=defaultTDead; + + if (t==0) + thisDetector->correctionMask&=~(1<correctionMask|=(1<0) + thisDetector->tDead=t; + else { + if (thisDetector->currentSettings<3 && thisDetector->currentSettings>-1) + thisDetector->tDead=tdead[thisDetector->currentSettings]; + } + } + return thisDetector->correctionMask&(1<correctionMask&(1<tDead; + return 1; + } else + return 0; +}; + +int slsDetector::getRateCorrections(){ + + if (thisDetector->correctionMask&(1<=0) + e=sqrt(datain); + else + e=errin; + + if (dataout>0) + errout=e*dataout*sqrt((1/(datain*datain)+tau*tau/(t*t))); + else + errout=1.; + +}; + + +int slsDetector::rateCorrect(float* datain, float *errin, float* dataout, float *errout){ + float tau=thisDetector->tDead; + float t=thisDetector->timerValue[ACQUISITION_TIME]; + float data; + float e; + if (thisDetector->correctionMask&(1<nMod[X]*thisDetector->nMod[Y]*thisDetector->nChans*thisDetector->nChips; ichan++) { + + if (errin==NULL) { + e=sqrt(datain[ichan]); + } else + e=errin[ichan]; + + rateCorrect(datain[ichan], e, dataout[ichan], errout[ichan], tau, t); + } + } + + +}; + + +int slsDetector::setBadChannelCorrection(string fname){ + ifstream infile; + string str; + int interrupt=0; + int ich; + int chmin,chmax; + if (fname=="") { + thisDetector->correctionMask&=~(1<< DISCARD_BAD_CHANNELS); + thisDetector->nBadChans=0; + } else { + thisDetector->correctionMask|=(1<< DISCARD_BAD_CHANNELS); + infile.open(fname.c_str(), ios_base::in); + thisDetector->nBadChans=0; + while (infile.good() and interrupt==0) { + getline(infile,str); + istringstream ssstr; + if (str.find('-')) { + ssstr.str(str); + ssstr >> chmin ; + ssstr.str(str.substr(str.find('-')+1,str.size())); + ssstr >> chmax; + for (ich=chmin; ich<=chmax; ich++) { + thisDetector->badChansList[thisDetector->nBadChans]=ich; + thisDetector->nBadChans++; +#ifdef VERBOSE + cout << thisDetector->nBadChans << " Found bad channel "<< ich << endl; +#endif + } + } else { + ssstr.str(str); + ssstr >> ich; + thisDetector->badChansList[thisDetector->nBadChans]=ich; + thisDetector->nBadChans++; +#ifdef VERBOSE + cout << thisDetector->nBadChans << " Found bad channel "<< ich << endl; +#endif + } + + + if (!ssstr.good()) { + interrupt=1; + break; + } + + } + + } + fillBadChannelMask(); + return thisDetector->nBadChans; +} + +int slsDetector::getBadChannelCorrections(int *bad) { + int ichan; + if (thisDetector->correctionMask&(1<< DISCARD_BAD_CHANNELS)) { + if (bad) { + for (ichan=0; ichannBadChans; ichan++) + bad[ichan]=thisDetector->badChansList[ichan]; + for (int ich=0; ichnBadFF; ich++) + bad[ichan+ich]=thisDetector->badFFList[ich]; + } + return thisDetector->nBadChans+ thisDetector->nBadFF; + } else + return 0; +} + + +int slsDetector::fillBadChannelMask() { + + if (thisDetector->correctionMask&(1<< DISCARD_BAD_CHANNELS)) { + if (badChannelMask) + delete [] badChannelMask; + badChannelMask=new int[thisDetector->nChans*thisDetector->nChips*thisDetector->nMods]; + for (int ichan=0; ichannChans*thisDetector->nChips*thisDetector->nMods; ichan++) + badChannelMask[ichan]=0; + for (int ichan=0; ichannBadChans; ichan++) { + if (thisDetector->badChansList[ichan]nChans*thisDetector->nChips*thisDetector->nMods) + badChannelMask[ichan]=1; + } + for (int ichan=0; ichannBadFF; ichan++) { + if (thisDetector->badFFList[ichan]nChans*thisDetector->nChips*thisDetector->nMods) + badChannelMask[ichan]=1; + } + + } else { + if (badChannelMask) + delete [] badChannelMask; + } + + +} + + +int slsDetector::setAngularConversion(string fname) { + if (fname=="") { + thisDetector->correctionMask&=~(1<< ANGULAR_CONVERSION); + } else { + if (readAngularConversion(fname)>=0) + thisDetector->correctionMask|=(1<< ANGULAR_CONVERSION); + } + return thisDetector->correctionMask&(1<< ANGULAR_CONVERSION); +} + +int slsDetector::getAngularConversion(int &direction, angleConversionConstant *angconv) { + if (thisDetector->correctionMask&(1<< ANGULAR_CONVERSION)) { + direction=thisDetector->angDirection; + if (angconv) { + for (int imod=0; imodnMods; imod++) { + (angconv+imod)->center=thisDetector->angOff[imod].center; + (angconv+imod)->r_conversion=thisDetector->angOff[imod].r_conversion; + (angconv+imod)->offset=thisDetector->angOff[imod].offset; + (angconv+imod)->ecenter=thisDetector->angOff[imod].ecenter; + (angconv+imod)->er_conversion=thisDetector->angOff[imod].er_conversion; + (angconv+imod)->eoffset=thisDetector->angOff[imod].eoffset; + } + } + return 1; + } else + return 0; + + +} + + + +int slsDetector::readAngularConversion(string fname) { + char line[500]; + string str; + ifstream infile; + int mod; + float center, ecenter; + float r_conv, er_conv; + float off, eoff; + string ss; + int interrupt=0; + + //" module %i center %E +- %E conversion %E +- %E offset %f +- %f \n" +#ifdef VERBOSE + cout << "Opening file "<< fname << endl; +#endif + infile.open(fname.c_str(), ios_base::in); + if (infile.is_open()) { + while (infile.good() and interrupt==0) { + getline(infile,str); +#ifdef VERBOSE + cout << str << endl; +#endif + istringstream ssstr(str); + ssstr >> ss >> mod; + ssstr >> ss >> center; + ssstr >> ss >> ecenter; + ssstr >> ss >> r_conv; + ssstr >> ss >> er_conv; + ssstr >> ss >> off; + ssstr >> ss >> eoff; + if (modnModsMax && mod>=0) { + thisDetector->angOff[mod].center=center; + thisDetector->angOff[mod].r_conversion=r_conv; + thisDetector->angOff[mod].offset=off; + thisDetector->angOff[mod].ecenter=ecenter; + thisDetector->angOff[mod].er_conversion=er_conv; + thisDetector->angOff[mod].eoffset=eoff; + } + } + } else { + cout << "Could not open calibration file "<< fname << endl; + return -1; + } + return 0; +} + + +int slsDetector:: writeAngularConversion(string fname) { + ofstream outfile; + outfile.open (fname.c_str(),ios_base::out); + if (outfile.is_open()) + { + for (int imod=0; imodnMods; imod++) { + outfile << " module " << imod << " center "<< thisDetector->angOff[imod].center<<" +- "<< thisDetector->angOff[imod].ecenter<<" conversion "<< thisDetector->angOff[imod].r_conversion << " +- "<< thisDetector->angOff[imod].er_conversion << " offset "<< thisDetector->angOff[imod].offset << " +- "<< thisDetector->angOff[imod].eoffset << endl; + } + outfile.close(); + } else { + cout << "Could not open file " << fname << "for writing"<< endl; + return -1; + } + //" module %i center %E +- %E conversion %E +- %E offset %f +- %f \n" + return 0; +} + + + + + + + +int slsDetector::exitServer(){ + + int retval; + int fnum=F_EXIT_SERVER; + + + if (controlSocket) { + controlSocket->Connect(); + controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + controlSocket->Disconnect(); + } + if (retval==OK) { + cout << endl; + cout << "Shutting down the server" << endl; + cout << endl; + } + return retval; +}; + +int slsDetector::resetMerging(float *mp, float *mv, float *me, int *mm) { + + float binsize; + if (thisDetector->binSize>0) + binsize=thisDetector->binSize; + else + return FAIL; + + for (int ibin=0; ibin<(360./binsize); ibin++) { + mp[ibin]=0; + mv[ibin]=0; + me[ibin]=0; + mm[ibin]=0; + } + return OK; +} + + +int slsDetector::finalizeMerging(float *mp, float *mv, float *me, int *mm) { + float binsize; + int np=0; + + if (thisDetector->binSize>0) + binsize=thisDetector->binSize; + else + return FAIL; + + for (int ibin=0; ibin<(360./binsize); ibin++) { + if (mm[ibin]>0) { + mp[np]=mp[ibin]/mm[ibin]; + mv[np]=mv[ibin]/mm[ibin]; + me[np]=me[ibin]/mm[ibin]; + me[np]=sqrt(me[ibin]); + mm[np]=mm[ibin]; + np++; + } + } + return OK; +} + +int slsDetector::addToMerging(float *p1, float *v1, float *e1, float *mp, float *mv,float *me, int *mm) { + + float binsize; + float binmi=-180., binma; + int ibin=0; + int imod; + float ang; + + if (thisDetector->binSize>0) + binsize=thisDetector->binSize; + else + return FAIL; + binmi=-180.; + binma=binmi+binsize; + + + if (thisDetector->angDirection>0) { + for (int ip=0; ipnChans*thisDetector->nChips*thisDetector->nMods; ip++) { + if (thisDetector->correctionMask&DISCARD_BAD_CHANNELS) { + if (badChannelMask[ip]) + continue; + } + imod=ip/(thisDetector->nChans*thisDetector->nChips); + if (p1) + ang=p1[ip]; + else + ang=angle(ip,currentPosition,thisDetector->fineOffset+thisDetector->globalOffset,thisDetector->angOff[imod].r_conversion,thisDetector->angOff[imod].center, thisDetector->angOff[imod].offset,thisDetector->angOff[imod].tilt,thisDetector->angDirection); + + + + while (binmanChans*thisDetector->nChips*thisDetector->nMods-1; ip>=0; ip--) { + if (thisDetector->correctionMask&(1<< DISCARD_BAD_CHANNELS)) { + if (badChannelMask[ip]) + continue; + } + + while (binmanumberOfPositions>0) + np=thisDetector->numberOfPositions; + + currentPositionIndex=0; + + for (int ip=0; ipnumberOfPositions>0) { + go_to_position (thisDetector->detPositions[ip]); + currentPositionIndex=ip+1; + } + //write header before? + + + startAndReadAll(); + + if (thisDetector->correctionMask&(1<< I0_NORMALIZATION)) + currentI0=get_i0(); + + //write header after? + + + if (thisDetector->correctionMask&(1<< ANGULAR_CONVERSION)) + currentPosition=get_position(); + + processData(); + + + + } +} + + +void* slsDetector::processData() { + + + int *myData; + float *fdata; + // float *dataout=new float[thisDetector->nChans*thisDetector->nChips*thisDetector->nMods]; + float *rcdata=NULL, *rcerr=NULL; + float *ffcdata=NULL, *ffcerr=NULL; + float *ang=NULL; + float bs=0.004; + int i=0; + int imod; + int nb; + while(1) { + + + if( !dataQueue.empty() ) { + + /** Pop data queue */ + myData=dataQueue.front(); // get the data from the queue + dataQueue.pop(); //remove the data from the queue + if (myData) { + //process data + + /** decode data */ + fdata=decodeData(myData); + + delete [] myData; + myData=NULL; + /** write raw data file */ + writeDataFile (createFileName().append(".raw"), fdata, NULL, NULL, 'i'); + + /** rate correction */ + if (thisDetector->correctionMask&(1<nChans*thisDetector->nChips*thisDetector->nMods]; + rcerr=new float[thisDetector->nChans*thisDetector->nChips*thisDetector->nMods]; + rateCorrect(fdata,NULL,rcdata,rcerr); + delete [] fdata; + } else { + rcdata=fdata; + fdata=NULL; + } + + /** flat field correction */ + if (thisDetector->correctionMask&(1<nChans*thisDetector->nChips*thisDetector->nMods]; + ffcerr=new float[thisDetector->nChans*thisDetector->nChips*thisDetector->nMods]; + flatFieldCorrect(rcdata,rcerr,ffcdata,ffcerr); + delete [] rcdata; + delete [] rcerr; + } else { + ffcdata=rcdata; + ffcerr=rcerr; + rcdata=NULL; + rcerr=NULL; + } + + if (thisDetector->correctionMask&(1<< ANGULAR_CONVERSION)) { + + /** angular conversion */ + /** data merging */ + if (thisDetector->numberOfPositions) { + + if (currentPositionIndex==1) { + if (thisDetector->binSize>0) + bs=thisDetector->binSize; + else if (thisDetector->angOff[0].r_conversion>0) { + bs=180./PI*atan(thisDetector->angOff[0].r_conversion); + thisDetector->binSize=bs; + } else + thisDetector->binSize=bs; + + + nb=360./bs; + + mergingBins=new float[nb]; + mergingCounts=new float[nb]; + mergingErrors=new float[nb]; + mergingMultiplicity=new int[nb]; + + resetMerging(mergingBins, mergingCounts,mergingErrors, mergingMultiplicity); + } + addToMerging(ang, ffcdata, ffcerr, mergingBins, mergingCounts,mergingErrors, mergingMultiplicity); + if (currentPositionIndex==thisDetector->numberOfPositions) { + + + + + int np=finalizeMerging(mergingBins, mergingCounts,mergingErrors, mergingMultiplicity); + + + /** file writing */ + currentPositionIndex++; + writeDataFile (createFileName().append(".dat"),mergingCounts, mergingErrors, mergingBins,'f',np); + + delete [] mergingBins; + delete [] mergingCounts; + delete [] mergingErrors; + delete [] mergingMultiplicity; + + } + } else { + + ang=new float[thisDetector->nChans*thisDetector->nChips*thisDetector->nMods]; + for (int ip=0; ipnChans*thisDetector->nChips*thisDetector->nMods; ip++) { + imod==ip/(thisDetector->nChans*thisDetector->nChips); + ang[ip]=angle(ip,currentPosition,thisDetector->fineOffset+thisDetector->globalOffset,thisDetector->angOff[imod].r_conversion,thisDetector->angOff[imod].center, thisDetector->angOff[imod].offset,thisDetector->angOff[imod].tilt,thisDetector->angDirection); + } + writeDataFile (createFileName().append(".dat"), ffcdata, ffcerr,ang); + } + } else + writeDataFile (createFileName().append(".dat"), ffcdata, ffcerr); + + + + + + + + + + + + + if (ffcdata) + delete [] ffcdata; + if (ffcerr) + delete [] ffcerr; + if (ang) + delete [] ang; + + + + + + } + } + } +} + + +/* +void slsDetector::startThread() { + pthread_attr_t tattr, mattr; + int ret; + int newprio; + sched_param param, mparam; + void *arg; + int policy= SCHED_OTHER; + + ret = pthread_attr_init(&tattr); + + // set the priority; others are unchanged + //newprio = 30; + mparam.sched_priority = 30; + // scheduling parameters of main thread + ret = pthread_setschedparam(pthread_self(), policy, &mparam); + + + printf("current priority is %d\n",param.sched_priority); + ret = pthread_create(&dataProcessingThread, NULL,startProcessData, (void*)this); + + + param.sched_priority = 1; + // scheduling parameters of target thread + ret = pthread_setschedparam(dataProcessingThread, policy, ¶m); + + +} + +void* startProcessData(void *n) { + + //void* processData(void *n) { + void *w; + slsDetector *myDet=(slsDetector*)n; + myDet->processData(0); +} +*/ diff --git a/slsDetectorSoftware/slsDetector/slsDetector.h b/slsDetectorSoftware/slsDetector/slsDetector.h new file mode 100644 index 000000000..34cf75f1c --- /dev/null +++ b/slsDetectorSoftware/slsDetector/slsDetector.h @@ -0,0 +1,1320 @@ + + + +#ifndef SLS_DETECTOR_H +#define SLS_DETECTOR_H + +#include "MySocketTCP.h" +#include +#include +#include +#include +#include +#include + #include +extern "C" { + #include +} + #include + #include + #include + #include + #include + + +#define MAX_TIMERS 10 +#define MAX_ROIS 100 +#define MAX_BADCHANS 2000 +#define MAXPOS 50 + +#define NMODMAXX 24 +#define NMODMAXY 24 +#define MAXMODS 36 +#define NCHIPSMAX 10 +#define NCHANSMAX 65536 +#define NDACSMAX 16 + +#define DEFAULT_HOSTNAME "localhost" +#define DEFAULT_SHM_KEY 5678 + +#define defaultTDead {170,90,750} + +using namespace std; +/** + \mainpage Common C++ library for SLS detectors data acquisition + * + * \section intro_sec Introduction + + + + * \subsection mot_sec Motivation + Although the SLS detectors group delvelops several types of detectors (1/2D, counting/integrating etc.) it is common interest of the group to use a common platfor for data acquisition + \subsection arch_sec System Architecture + The architecture of the acquisitions system is intended as follows: + \li A socket server running on the detector (or more than one in some special cases) + \li C++ classes common to all detectors for client-server communication. These can be supplied to users as libraries and embedded also in acquisition systems which are not developed by the SLS \sa MySocketTCP slsDetector + \li the possibility of using a Qt-based graphical user interface (with eventually root analisys capabilities) + \li the possibility of runnin alla commands from command line. In order to ensure a fast operation of this so called "text client" the detector parameters should not be re-initialized everytime. For this reason a shared memory block is allocated where the main detector flags and parameters are stored \sa slsDetector::sharedSlsDetector + + + @author Anna Bergamaschi + +*/ + + + +/** + * + * +@libdoc The slsDetector class is expected to become the interface class for all SLS Detectors acquisition (and analysis) software. + * + * @short This is the base class for all SLS detector functionalities + * @author Anna Bergamaschi + * @version 0.1alpha (any string) + + + */ + +class slsDetector { + + + + public: + + + /** online flags enum \sa setOnline*/ + enum {GET_ONLINE_FLAG, /**< returns wether the detector is in online or offline state */ + OFFLINE_FLAG, /**< detector in offline state (i.e. no communication to the detector - using only local structure - no data acquisition possible!) */ + ONLINE_FLAG /**< detector in online state (i.e. communication to the detector updating the local structure) */ + }; + + +#include "sls_detector_defs.h" + + + /** + @short Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!) + + */ +typedef struct sharedSlsDetector { + /** already existing flag. If the detector does not yet exist (alreadyExisting=0) the sharedMemory will be created, otherwise it will simly be linked */ + int alreadyExisting; + + /** is the hostname (or IP address) of the detector. needs to be set before startin the communication */ + char hostname[MAX_STR_LENGTH]; + /** is the port used for control functions normally it should not be changed*/ + int controlPort; + /** is the port used to stop the acquisition normally it should not be changed*/ + int stopPort; + /** is the port used to acquire the data normally it should not be changed*/ + int dataPort; + + /** detector type \ see :: detectorType*/ + detectorType myDetectorType; + + + /** path of the trimbits files */ + char trimDir[MAX_STR_LENGTH]; + /** path of the calibration files */ + char calDir[MAX_STR_LENGTH]; + /** number of energies at which the detector has been trimmed (unused) */ + int nTrimEn; + /** list of the energies at which the detector has been trimmed (unused) */ + int trimEnergies[100]; + + + /** current index of the output file */ + int fileIndex; + /** path of the output files */ + char filePath[MAX_STR_LENGTH]; + /** name root of the output files */ + char fileName[MAX_STR_LENGTH]; + + /* size of the detector */ + + /** number of installed modules of the detector (x and y directions) */ + int nMod[2]; + /** number of modules ( nMod[X]*nMod[Y]) \see nMod */ + int nMods; + /** maximum number of modules of the detector (x and y directions) */ + int nModMax[2]; + /** maximum number of modules (nModMax[X]*nModMax[Y]) \see nModMax */ + int nModsMax; + /** number of channels per chip */ + int nChans; + /** number of chips per module*/ + int nChips; + /** number of dacs per module*/ + int nDacs; + /** number of adcs per module */ + int nAdcs; + /** dynamic range of the detector data */ + int dynamicRange; + /** size of the data that are transfered from the detector */ + int dataBytes; + + /** corrections to be applied to the data \see ::correctionFlags */ + int correctionMask; + /** dead time (in ns) for rate corrections */ + float tDead; + /** number of bad channels from bad channel list */ + int nBadChans; + /** list of bad channels */ + int badChansList[MAX_BADCHANS]; + /** number of bad channels from flat field i.e. channels which read 0 in the flat field file */ + int nBadFF; + /** list of bad channels from flat field i.e. channels which read 0 in the flat field file */ + int badFFList[MAX_BADCHANS]; + + /** array of angular conversion constants for each module \see ::angleConversionConstant */ + angleConversionConstant angOff[MAXMODS]; + /** angular direction (1 if it corresponds to the encoder direction i.e. channel 0 is 0, maxchan is positive high angle, 0 otherwise */ + int angDirection; + /** beamline fine offset (of the order of mdeg, might be adjusted for each measurements) */ + float fineOffset; + /** beamline offset (might be a few degrees beacuse of encoder offset - normally it is kept fixed for a long period of time) */ + float globalOffset; + /** number of positions at which the detector should acquire */ + int numberOfPositions; + /** list of encoder positions at which the detector should acquire */ + float detPositions[MAXPOS]; + /** bin size for data merging */ + float binSize; + + /* infos necessary for the readout to determine the size of the data */ + /** number of rois defined */ + int nROI; + /** list of rois */ + ROI roiLimits[MAX_ROIS]; + /** readout flags */ + readOutFlags roFlags; + + /* detector setup - not needed */ + /** detector settings (standard, fast, etc.) */ + detectorSettings currentSettings; + /** detector threshold (eV) */ + int currentThresholdEV; + /** timer values */ + int64_t timerValue[MAX_TIMERS]; + /** clock divider */ + int clkDiv; + + /*offsets*/ + /** memory offsets for the flat filed coefficients */ + int ffoff; + /** memory offsets for the flat filed coefficient errors */ + int fferroff; + /** memory offsets for the module structures */ + int modoff; + /** memory offsets for the dac arrays */ + int dacoff; + /** memory offsets for the adc arrays */ + int adcoff; + /** memory offsets for the chip register arrays */ + int chipoff; + /** memory offsets for the channel register arrays */ + int chanoff; + +} sharedSlsDetector; + + + +/** (default) constructor + \param type is needed to define the size of the detector shared memory 9defaults to GENERIC i.e. the largest shared memory needed by any slsDetector is allocated + \param id is the detector index which is needed to define the shared memory id. Different physical detectors should have different IDs in order to work independently + + +*/ + slsDetector(detectorType type=GENERIC, int id=0); + //slsDetector(string const fname); + // ~slsDetector(){while(dataQueue.size()>0){}}; + /** destructor */ + ~slsDetector(){}; + + + /** sets the onlineFlag + \param off can be:
GET_ONLINE_FLAG, returns wether the detector is in online or offline state;
OFFLINE_FLAG, detector in offline state (i.e. no communication to the detector - using only local structure - no data acquisition possible!);
ONLINE_FLAG detector in online state (i.e. communication to the detector updating the local structure) */ + int setOnline(int const online); + /** sets the onlineFlag + \returns 1 if the detector structure has already be initlialized, 0 otherwise */ + int exists() {return thisDetector->alreadyExisting;}; + + /** + Every detector should have a basic configuration file containing: + type (mythen, pilatus etc.) + hostname + portnumber + communication type (default TCP/IP) + eventually secondary portnumber (e.g. mythen stop function) + number of modules installed if different from the detector size (x,y) + + to be changed + */ + + int readConfigurationFile(string const fname); + /** + Every detector should have a basic configuration file containing: + type (mythen, pilatus etc.) + hostname + portnumber + communication type (default TCP/IP) + eventually secondary portnumber (e.g. mythen stop function) + number of modules installed if different from the detector size (x,y) + + to be changed + */ + int writeConfigurationFile(string const fname); + + + /* + It should be possible to dump all the settings of the detector (including trimbits, threshold energy, gating/triggering, acquisition time etc. + in a file and retrieve it for repeating the measurement with identicals ettings, if necessary + */ + /** + not yet implemented + + should dump to a file all the current detector parameters + */ + int dumpDetectorSetup(string const fname); + /** + not yet implemented + + should retrieve from a file all the current detector parameters + */ + int retrieveDetectorSetup(string const fname); + + /** + configure the socket communication and initializes the socket instances + + \param name hostname - if "" the current hostname is used + \param control_port port for control commands - if -1 the current is used + \param stop_port port for stop command - if -1 the current is used + \param data_port port for receiving data - if -1 the current is used + + \returns OK is connection succeded, FAIL otherwise + \sa sharedSlsDetector + */ + int setTCPSocket(string const name="", int const control_port=-1, int const stop_port=-1, int const data_port=-1); + /** returns the detector hostname \sa sharedSlsDetector */ + char* getHostname() {return thisDetector->hostname;}; + /** returns the detector control port \sa sharedSlsDetector */ + int getControlPort() {return thisDetector->controlPort;}; + /** returns the detector stop port \sa sharedSlsDetector */ + int getStopPort() {return thisDetector->stopPort;}; + /** returns the detector data port \sa sharedSlsDetector */ + int getDataPort() {return thisDetector->dataPort;}; + + + /* I/O */ + /** returns the detector trimbit directory \sa sharedSlsDetector */ + char* getTrimDir() {return thisDetector->trimDir;}; + /** sets the detector trimbit directory \sa sharedSlsDetector */ + char* setTrimDir(string s) {sprintf(thisDetector->trimDir, s.c_str()); return thisDetector->trimDir;}; + /** returns the number of trim energies and their value \sa sharedSlsDetector + \param point to the array that will contain the trim energies (in ev) + \returns number of trim energies + + \sa sharedSlsDetector + */ + int getTrimEn(int *en) {for (int ien=0; iennTrimEn; ien++) en[ien]=thisDetector->trimEnergies[ien]; return (thisDetector->nTrimEn);}; + + /** + reads a trim file + \param fname name of the file to be read + \param myMod pointer to the module structure which has to be set.
If it is NULL a new module structure will be created + \returns the pointer to myMod or NULL if reading the file failed + */ + + sls_detector_module* readTrimFile(string fname, sls_detector_module* myMod=NULL); + + /** + writes a trim file + \param fname name of the file to be written + \param mod module structure which has to be written to file + \returns OK or FAIL if the file could not be written + + \sa ::sls_detector_module + */ + int writeTrimFile(string fname, sls_detector_module mod); + + /** + writes a trim file for module number imod - the values will be read from the current detector structure + \param fname name of the file to be written + \param imod module number + \returns OK or FAIL if the file could not be written + \sa ::sls_detector_module sharedSlsDetector + */ + int writeTrimFile(string fname, int imod); + + /** + sets the default output files path + \sa sharedSlsDetector + */ + char* setFilePath(string s) {sprintf(thisDetector->filePath, s.c_str()); return thisDetector->filePath;}; + + /** + sets the default output files root name + \sa sharedSlsDetector + */ + char* setFileName(string s) {sprintf(thisDetector->fileName, s.c_str()); return thisDetector->fileName;}; + + /** + sets the default output file index + \sa sharedSlsDetector + */ + int setFileIndex(int i) {thisDetector->fileIndex=i; return thisDetector->fileIndex;}; + + /** + returns the default output files path + \sa sharedSlsDetector + */ + char* getFilePath() {return thisDetector->filePath;}; + + /** + returns the default output files root name + \sa sharedSlsDetector + */ + char* getFileName() {return thisDetector->fileName;}; + + /** + returns the default output file index + \sa sharedSlsDetector + */ + int getFileIndex() {return thisDetector->fileIndex;}; + + /** generates file name without extension + + always appends to file path and file name the run index. + + in case also appends the position index + + Filenames will be of the form: filepath/filename(_px)_i + where x is the position index and i is the run index + + */ + + string createFileName(); + + /** + writes a data file + \param name of the file to be written + \param data array of data values + \param err array of arrors on the data. If NULL no errors will be written + + \param ang array of angular values. If NULL data will be in the form chan-val(-err) otherwise ang-val(-err) + \param dataformat format of the data: can be 'i' integer or 'f' float (default) + \param nch number of channels to be written to file. if -1 defaults to the number of installed channels of the detector + \returns OK or FAIL if it could not write the file or data=NULL + + + */ + int writeDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1); + + /** + writes a data file + \param name of the file to be written + \param data array of data values + \returns OK or FAIL if it could not write the file or data=NULL + */ + int writeDataFile(string fname, int *data); + + /** + reads a data file + \param name of the file to be read + \param data array of data values to be filled + \param err array of arrors on the data. If NULL no errors are expected on the file + + \param ang array of angular values. If NULL data are expected in the form chan-val(-err) otherwise ang-val(-err) + \param dataformat format of the data: can be 'i' integer or 'f' float (default) + \param nch number of channels to be written to file. if <=0 defaults to the number of installed channels of the detector + \returns OK or FAIL if it could not read the file or data=NULL + + + */ + int readDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=0); + + /** + reads a data file + \param name of the file to be read + \param data array of data values + \returns OK or FAIL if it could not read the file or data=NULL + */ + int readDataFile(string fname, int *data); + + /** + returns the location of the calibration files + \sa sharedSlsDetector + */ + char* getCalDir() {return thisDetector->calDir;}; + /** + sets the location of the calibration files + \sa sharedSlsDetector + */ + char* setCalDir(string s) {sprintf(thisDetector->calDir, s.c_str()); return thisDetector->calDir;}; + /** + reads a calibration file + \param fname file to be read + \param gain reference to the gain variable + \offset reference to the offset variable + \sa sharedSlsDetector + */ + int readCalibrationFile(string fname, float &gain, float &offset); + /** + writes a clibration file + \param fname file to be written + \param gain + \param offset + \sa sharedSlsDetector + */ + int writeCalibrationFile(string fname, float gain, float offset); + + + /** + reads an angular conversion file + \param fname file to be read + \sa angleConversionConstant + */ + int readAngularConversion(string fname=""); + /** + writes an angular conversion file + \param fname file to be written + \sa angleConversionConstant + */ + int writeAngularConversion(string fname=""); + + + + /* Communication to server */ + + // General purpose functions + + /** + executes a system command on the server + e.g. mount an nfs disk, reboot and returns answer etc. + \param cmd is the command to be executed + \param answer is the answer from the detector + \returns OK or FAIL depending on the command outcome + */ + int execCommand(string cmd, string answer); + + /** + sets/gets detector type + normally the detector knows what type of detector it is + \param type is the detector type (defaults to GET_DETECTOR_TYPE) + \returns returns detector type index (1 GENERIC, 2 MYTHEN, 3 PILATUS, 4 XFS, 5 GOTTHARD, 6 AGIPD, -1 command failed) + */ + int setDetectorType(detectorType type=GET_DETECTOR_TYPE); + + /** + sets/gets detector type + normally the detector knows what type of detector it is + \param type is the detector type ("Mythen", "Pilatus", "XFS", "Gotthard", Agipd") + \returns returns detector type index (1 GENERIC, 2 MYTHEN, 3 PILATUS, 4 XFS, 5 GOTTHARD, 6 AGIPD, -1 command failed) + */ + int setDetectorType(string type); + + /** + gets detector type + normally the detector knows what type of detector it is + \param type is the string where the detector type will be written ("Mythen", "Pilatus", "XFS", "Gotthard", Agipd") + */ + void getDetectorType(char *type); + + + // Detector configuration functions + /** + set/get the size of the detector + \param n number of modules + \param d dimension + \returns current number of modules in direction d + */ + int setNumberOfModules(int n, dimension d=X); // if n=GET_FLAG returns the number of installed modules + + /* + returns the instrinsic size of the detector (maxmodx, maxmody, nchans, nchips, ndacs + enum numberOf { + MAXMODX, + MAXMODY, + CHANNELS, + CHIPS, + DACS + } + */ + + + /** + get the maximum size of the detector + \param d dimension + \returns maximum number of modules that can be installed in direction d + */ + int getMaxNumberOfModules(dimension d=X); // + + + /** + set/get the use of an external signal + \param pol meaning of the signal \sa externalSignalFlag + \param signalIndex index of the signal + \returns current meaning of signal signalIndex + */ + externalSignalFlag setExternalSignalFlags(externalSignalFlag pol=GET_EXTERNAL_SIGNAL_FLAG , int signalindex=0); + + + /** + set/get the external communication mode + + obsolete \sa setExternalSignalFlags + \param pol value to be set \sa externalCommunicationMode + \returns current external communication mode + */ + externalCommunicationMode setExternalCommunicationMode(externalCommunicationMode pol=GET_EXTERNAL_COMMUNICATION_MODE); + + + // Tests and identification + + /** + get detector ids/versions for module + \param mode which id/version has to be read + \param imod module number for module serial number + \returns id + */ + int64_t getId(idMode mode, int imod=0); + /** + Digital test of the modules + \param mode test mode + \param imod module number for chip test or module firmware test + \returns OK or error mask + */ + int digitalTest(digitalTestMode mode, int imod=0); + /** + analog test + \param modte test mode + \return pointer to acquired data + + not yet implemented + */ + + int* analogTest(analogTestMode mode); + + /** + enable analog output of channel ichan + + not yet implemented + */ + int enableAnalogOutput(int ichan); + + /** + enable analog output of channel ichan, chip ichip, module imod + + not yet implemented + */ + int enableAnalogOutput(int imod, int ichip, int ichan); + + /** + give a train of calibration pulses + \param vcal pulse amplitude + \param npulses number of pulses + + not yet implemented + + */ + int giveCalibrationPulse(float vcal, int npulses); + + // Expert Initialization functions + + + /** + write register + \param addr address + \val value + \returns current register value + + */ + int writeRegister(int addr, int val); + + /** + read register + \param addr address + \returns current register value + + */ + int readRegister(int addr); + + /** + set dacs value + \param val value (in V) + \param index DAC index + \param imod module number (if -1 alla modules) + \returns current DAC value + */ + float setDAC(float val, dacIndex index, int imod=-1); + + /** + set dacs value + \param index ADC index + \param imod module number + \returns current ADC value + */ + float getADC(dacIndex index, int imod=0); + + /** + configure channel + \param reg channel register + \param ichan channel number (-1 all) + \param ichip chip number (-1 all) + \param imod module number (-1 all) + \returns current register value + \sa ::sls_detector_channel + */ + int setChannel(int64_t reg, int ichan=-1, int ichip=-1, int imod=-1); + + /** + configure channel + \param chan channel to be set - must contain correct channel, module and chip number + \returns current register value + */ + int setChannel(sls_detector_channel chan); + + /** + get channel + \param ichan channel number + \param ichip chip number + \param imod module number + \returns current channel structure for channel + */ + sls_detector_channel getChannel(int ichan, int ichip, int imod); + + + + /** + configure chip + \param reg chip register + \param ichip chip number (-1 all) + \param imod module number (-1 all) + \returns current register value + \sa ::sls_detector_chip + */ + int setChip(int reg, int ichip=-1, int imod=-1); + + /** + configure chip + \param chip chip to be set - must contain correct module and chip number and also channel registers + \returns current register value + \sa ::sls_detector_chip + */ + int setChip(sls_detector_chip chip); + + /** + get chip + \param ichip chip number + \param imod module number + \returns current chip structure for channel + + \bug probably does not return corretly! + */ + sls_detector_chip getChip(int ichip, int imod); + + + /** + configure module + \param imod module number (-1 all) + \returns current register value + \sa ::sls_detector_module + */ + int setModule(int reg, int imod=-1); + + /** + configure chip + \param module module to be set - must contain correct module number and also channel and chip registers + \returns current register value + \sa ::sls_detector_module + */ + int setModule(sls_detector_module module); + + /** + get module + \param imod module number + \returns pointer to module structure (which has bee created and must then be deleted) + */ + sls_detector_module *getModule(int imod); + + // calibration functions + // int setCalibration(int imod, detectorSettings isettings, float gain, float offset); + //int getCalibration(int imod, detectorSettings isettings, float &gain, float &offset); + + + /* + calibrated setup of the threshold + */ + /** + get threshold energy + \param imod module number (-1 all) + \returns current threshold value for imod in ev (-1 failed) + */ + int getThresholdEnergy(int imod=-1); + + /** + set threshold energy + \param e_eV threshold in eV + \param imod module number (-1 all) + \param isettings ev. change settings + \returns current threshold value for imod in ev (-1 failed) + */ + int setThresholdEnergy(int e_eV, int imod=-1, detectorSettings isettings=GET_SETTINGS); + + /** + get detector settings + \param imod module number (-1 all) + \returns current settings + */ + detectorSettings getSettings(int imod=-1); + + /** + set detector settings + \param isettings settings + \param imod module number (-1 all) + \returns current settings + + in this function trimbits and calibration files are searched in the trimDir and calDir directories and the detector is initialized + */ + detectorSettings setSettings(detectorSettings isettings, int imod=-1); + + +// Acquisition functions + + + /** + start detector acquisition + \returns OK/FAIL + */ + int startAcquisition(); + + /** + stop detector acquisition + \returns OK/FAIL + */ + int stopAcquisition(); + + /** + start readout (without exposure or interrupting exposure) + \returns OK/FAIL + */ + int startReadOut(); + + /** + get run status + \returns status mask + */ + int getRunStatus(); + + /** + start detector acquisition and read all data putting them a data queue + \returns pointer to the fron tof the data queue + \sa startAndReadAllNoWait getDataFromDetector dataQueue + */ + int* startAndReadAll(); + + /** + start detector acquisition and read out, but does not read data from socket + + */ + int startAndReadAllNoWait(); + + /** + receives a data frame from the detector socket + \returns pointer to the data or NULL. If NULL disconnects the socket + \sa getDataFromDetector + */ + int* getDataFromDetectorNoWait(); + + /** + asks and receives a data frame from the detector + \returns pointer to the data or NULL. If NULL disconnects the socket + \sa getDataFromDetector + */ + int* readFrame(); + + /** + asks and receives all data from the detector and puts them in a data queue + \returns pointer to the front of the queue or NULL. + \sa getDataFromDetector dataQueue + */ + int* readAll(); + + + /** + pops the data from the data queue + \returns pointer to the popped data or NULL if the queue is empty. + \sa dataQueue + */ + int* popDataQueue(); + + /** + set/get timer value + \param index timer index + \param t time in ns or number of...(e.g. frames, gates, probes) + \returns timer set value in ns or number of...(e.g. frames, gates, probes) + */ + int64_t setTimer(timerIndex index, int64_t t=-1); + + /** + get current timer value + \param index timer index + \returns elapsed time value in ns or number of...(e.g. frames, gates, probes) + */ + int64_t getTimeLeft(timerIndex index); + + /** + set clock divider + + not implemented (should be something more general like "set speed including also waitstates, set cycles etc.) + + */ + int setClockDivider(int i) {cout << "not implemented any longer!"<< endl; thisDetector->clkDiv=i;return thisDetector->clkDiv;}; + + /** + get clock divider + + not implemented (should be something more general like "set speed including also waitstates, set cycles etc.) + + */ + int getClockDivider() {return thisDetector->clkDiv;}; + + /** + set length cycles + + not implemented (should be something more general like "set speed including also waitstates, set cycles etc.) + + */ + int setSetLength(int i) {cout << "not implemented any longer!"<< endl; thisDetector->clkDiv=i;return 3;}; + + /** + get length cycles + + not implemented (should be something more general like "set speed including also waitstates, set cycles etc.) + */ + int getSetLength() {return 3;}; + + + // Flags + /** + set/get dynamic range + \param n dynamic range (-1 get) + \returns current dynamic range + updates the size of the data expected from the detector + \sa sharedSlsDetector + */ + int setDynamicRange(int n=-1); + + /** + set roi + + not yet implemented + */ + int setROI(int nroi=-1, int *xmin=NULL, int *xmax=NULL, int *ymin=NULL, int *ymax=NULL); + + + /** + set/get readout flags + \param flag readout flag to be set + \returns current flag + */ + int setReadOutFlags(readOutFlags flag); + + /** + execute trimming + \param mode trim mode + \param par1 if noise, beam or fixed setting trimming it is count limit, if improve maximum number of iterations + \param par2 if noise or beam nsigma, if improve par2!=means vthreshold will be optimized, if fixed settings par2<0 trimwith median, par2>=0 trim with level + \param imod module number (-1 all) + \returns OK or FAIl (FAIL also if some channel are 0 or 63 + */ + int executeTrimming(trimMode mode, int par1, int par2, int imod=-1); + + + //Corrections + + /** + set flat field corrections + \param fname name of the flat field file (or "" if disable) + \returns 0 if disable (or file could not be read), >0 otherwise + */ + int setFlatFieldCorrection(string fname=""); + + /** + get flat field corrections + \param corr if !=NULL will be filled with the correction coefficients + \param ecorr if !=NULL will be filled with the correction coefficients errors + \returns 0 if ff correction disabled, >0 otherwise + */ + int getFlatFieldCorrections(float *corr=NULL, float *ecorr=NULL); + + /** + set rate correction + \param t dead time in ns - if 0 disable correction, if >0 set dead time to t, if <0 set deadtime to default dead time for current settings + \returns 0 if rate correction disabled, >0 otherwise + */ + int setRateCorrection(float t=0); + + + /** + get rate correction + \param t reference for dead time + \returns 0 if rate correction disabled, >0 otherwise + */ + int getRateCorrections(float &t); + + /** + get rate correction + \returns 0 if rate correction disabled, >0 otherwise + */ + int getRateCorrections(); + + /** + set bad channels correction + \param fname file with bad channel list ("" disable) + \returns 0 if bad channel disabled, >0 otherwise + */ + int setBadChannelCorrection(string fname=""); + + /** + get bad channels correction + \param bad pointer to array that if bad!=NULL will be filled with the bad channel list + \returns 0 if bad channel disabled or no bad channels, >0 otherwise + */ + int getBadChannelCorrections(int *bad=NULL); + + + /** + set angular conversion + \param fname file with angular conversion constants ("" disable) + \returns 0 if angular conversion disabled, >0 otherwise + */ + int setAngularConversion(string fname=""); + + /** + get angular conversion + \param reference to diffractometer direction + \param angconv array that will be filled with the angular conversion constants + \returns 0 if angular conversion disabled, >0 otherwise + */ + int getAngularConversion(int &direction, angleConversionConstant *angconv=NULL); + + /** + set detector global offset + */ + float setGlobalOffset(float f){thisDetector->globalOffset=f; return thisDetector->globalOffset;}; + + /** + set detector fine offset + */ + float setFineOffset(float f){thisDetector->fineOffset=f; return thisDetector->fineOffset;}; + /** + get detector fine offset + */ + float getFineOffset(){return thisDetector->fineOffset;}; + + /** + get detector global offset + */ + float getGlobalOffset(){return thisDetector->globalOffset;}; + + /** + set positions for the acquisition + \param nPos number of positions + \param pos array with the encoder positions + \returns number of positions + */ + int setPositions(int nPos, float *pos){thisDetector->numberOfPositions=nPos; for (int ip=0; ipdetPositions[ip]=pos[ip]; return thisDetector->numberOfPositions;}; + /** + get positions for the acquisition + \param pos array which will contain the encoder positions + \returns number of positions + */ + int getPositions(float *pos=NULL){ if (pos ) {for (int ip=0; ipnumberOfPositions; ip++) pos[ip]=thisDetector->detPositions[ip];} return thisDetector->numberOfPositions;}; + + + /** set detector bin size used for merging (approx angular resolution)*/ + float setBinSize(float bs) {thisDetector->binSize=bs; return thisDetector->binSize;} + /** return detector bin size used for merging (approx angular resolution)*/ + float getBinSize() {return thisDetector->binSize;} + + + + + + + /** + decode data from the detector converting them to an array of floats, one for each channle + \param datain data from the detector + \returns pointer to a float array with a data per channel + */ + float* decodeData(int *datain); + + + + + /** + flat field correct data + \param datain data + \param errin error on data (if<=0 will default to sqrt(datain) + \param dataout corrected data + \param errout error on corrected data + \param ffcoefficient flat field correction coefficient + \param fferr erro on ffcoefficient + \returns 0 + */ + int flatFieldCorrect(float datain, float errin, float &dataout, float &errout, float ffcoefficient, float fferr); + + /** + flat field correct data + \param datain data array + \param errin error array on data (if NULL will default to sqrt(datain) + \param dataout array of corrected data + \param errout error on corrected data (if not NULL) + \returns 0 + */ + int flatFieldCorrect(float* datain, float *errin, float* dataout, float *errout); + + + + /** + rate correct data + \param datain data + \param errin error on data (if<=0 will default to sqrt(datain) + \param dataout corrected data + \param errout error on corrected data + \param tau dead time 9in ns) + \param t acquisition time (in ns) + \returns 0 + */ + int rateCorrect(float datain, float errin, float &dataout, float &errout, float tau, float t); + + /** + rate correct data + \param datain data array + \param errin error array on data (if NULL will default to sqrt(datain) + \param dataout array of corrected data + \param errout error on corrected data (if not NULL) + \returns 0 + */ + int rateCorrect(float* datain, float *errin, float* dataout, float *errout); + + + /** sets the arrays of the merged data to 0. NB The array should be created with size >= 360./getBinSize(); + \param mp already merged postions + \param mv already merged data + \param me already merged errors (squared sum) + \param mm multiplicity of merged arrays + \returns OK or FAIL + */ + int resetMerging(float *mp, float *mv,float *me, int *mm); + /** not yet implemented + merge dataset + \param p1 angular positions of dataset + \param v1 data + \param e1 errors + \param mp already merged postions + \param mv already merged data + \param me already merged errors (squared sum) + \param mm multiplicity of merged arrays + */ + int addToMerging(float *p1, float *v1, float *e1, float *mp, float *mv,float *me, int *mm); + + /** + calculates the "final" positions, data value and errors for the emrged data + \param mp already merged postions + \param mv already merged data + \param me already merged errors (squared sum) + \param mm multiplicity of merged arrays + \returns FAIL or the + */ + int finalizeMerging(float *mp, float *mv,float *me, int *mm); + + /** + turns of server + */ + int exitServer(); + + /** + function for processing data + */ + void* processData(); // thread function + /** Allocates the memory for a sls_detector_module structure and initializes it + \returns myMod the pointer to the allocate dmemory location + + */ + sls_detector_module* createModule(); + /** frees the memory for a sls_detector_module structure + \param myMod the pointer to the memory to be freed + + */ + + void deleteModule(sls_detector_module *myMod); + + + void acquire(); + + private: + + /** + address of the detector structure in shared memory + */ + sharedSlsDetector *thisDetector; + + /** + \sa setOnline + */ + int onlineFlag; + + /** + detector ID + */ + int detId; + + /** + shared memeory ID + */ + int shmId; + + /** + socket for control commands + */ + MySocketTCP *controlSocket; + + /** + socket for emergency stop + */ + MySocketTCP *stopSocket; + + /** + socket for data acquisition + */ + MySocketTCP *dataSocket; + + /** + data queue + */ + queue dataQueue; + + /** + data processing thread??? + */ + pthread_t dataProcessingThread; + + /** + current position of the detector + */ + float currentPosition; + + /** + current position index of the detector + */ + float currentPositionIndex; + + /** + I0 measured + */ + float currentI0; + + + + /** merging bins */ + float *mergingBins; + + /** merging counts */ + float *mergingCounts; + + /** merging errors */ + float *mergingErrors; + + /** merging multiplicity */ + int *mergingMultiplicity; + + + + + + + + /** pointer to flat field coefficients */ + float *ffcoefficients; + /** pointer to flat field coefficient errors */ + float *fferrors; + /** pointer to detector module structures */ + sls_detector_module *detectorModules; + /** pointer to dac valuse */ + float *dacs; + /** pointer to adc valuse */ + float *adcs; + /** pointer to chip registers */ + int *chipregs; + /** pointer to channal registers */ + int *chanregs; + /** pointer to bad channel mask 0 is channel is good 1 if it is bad \sa fillBadChannelMask() */ + int *badChannelMask; + + /** + Receives a data frame from the detector socket + \return pointer to the data (or NULL if failed) + + */ + int* getDataFromDetector(); + + /** Initializes the shared memory + \param type is needed to define the size of the shared memory + \param id is the detector id needed to define the shared memory id + \return shm_id shared memory id + */ + int initSharedMemory(detectorType type=GENERIC, int id=0); + + /** Frees the shared memory - should not be used*/ + int freeSharedMemory(); + /** + Initializes the thisDetector structure + \param type is needed to define the number of channels, chips, modules etc. + \sa sharedSlsDetector + */ + int initializeDetectorSize(detectorType type); + /** + Initializes the module structures in thisDetector if the detector did not exists before + */ + int initializeDetectorStructure(); + /** + send a sls_detector_channel structure over socket + */ + int sendChannel(sls_detector_channel*); + /** + send a sls_detector_chip structure over socket + */ + int sendChip(sls_detector_chip*); + /** + send a sls_detector_module structure over socket + */ + int sendModule(sls_detector_module*); + /** + receive a sls_detector_channel structure over socket + */ + int receiveChannel(sls_detector_channel*); + /** + receive a sls_detector_chip structure over socket + */ + int receiveChip(sls_detector_chip*); + /** + receive a sls_detector_module structure over socket + */ + int receiveModule(sls_detector_module*); + + /** + start data processing threas + */ + void startThread(); + + /** + fill bad channel mask (0 if channel is good, 1 if bad) + */ + int fillBadChannelMask(); +}; + + +//static void* startProcessData(void *n); +#endif diff --git a/slsDetectorSoftware/usersFunctions/usersFunctions.c b/slsDetectorSoftware/usersFunctions/usersFunctions.c new file mode 100644 index 000000000..e59b0a64d --- /dev/null +++ b/slsDetectorSoftware/usersFunctions/usersFunctions.c @@ -0,0 +1,47 @@ +#include "usersFunctions.h" +#include + +float pos; + +/* + contains the conversion channel-angle for a module channel + conv_r=pitch/radius +*/ + + +float angle(int ichan, float encoder, float totalOffset, float conv_r, float center, float offset, float tilt, int direction) { + + + float ang; + + ang=180./PI*(center*conv_r+atan((float)(ichan-center)*conv_r))+encoder+totalOffset; + + return direction*ang; + +} + +/* reads the encoder and returns the position */ + +float get_position() { + return pos; +} + +/* moves the encoder to position p */ + +int go_to_position(float p) { + pos=p; +} + +/* moves the encoder to position p without waiting */ + +int go_to_position_no_wait(float p) { + pos=p; +} + + +/* reads I0 and returns the intensity */ + +float get_i0() { + return 100.; +} + diff --git a/slsDetectorSoftware/usersFunctions/usersFunctions.h b/slsDetectorSoftware/usersFunctions/usersFunctions.h new file mode 100644 index 000000000..ee0bcd98c --- /dev/null +++ b/slsDetectorSoftware/usersFunctions/usersFunctions.h @@ -0,0 +1,34 @@ +#ifndef USERS_FUNCTIONS_H +#define USERS_FUNCTIONS_H +/****************************************************************** + +Functions depending on the experimental setup should be defined here + +******************************************************************/ + +#define PI 3.14159265358979323846 + + + +#ifdef __cplusplus +extern "C" { +#endif + + float angle(int ichan, float encoder, float totalOffset, float conv_r, float center, float offset, float tilt, int direction); + float get_position(); + int go_to_position(float p); + int go_to_position_no_wait(float p); + + + float get_i0(); + + + + + +#ifdef __cplusplus +}; +#endif + + +#endif