mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 22:40:02 +02:00
receiver-read frame in right order, cleaned fileio, config file-include extsig and vhighvoltage
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@339 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
bf7da5f493
commit
dc94fc3c97
@ -4941,8 +4941,6 @@ int slsDetector::writeConfigurationFile(string const fname){
|
|||||||
int slsDetector::writeConfigurationFile(ofstream &outfile, int id){
|
int slsDetector::writeConfigurationFile(ofstream &outfile, int id){
|
||||||
|
|
||||||
slsDetectorCommand *cmd=new slsDetectorCommand(this);
|
slsDetectorCommand *cmd=new slsDetectorCommand(this);
|
||||||
int nvar;
|
|
||||||
int nsig=-1;
|
|
||||||
|
|
||||||
string names[]={ \
|
string names[]={ \
|
||||||
"hostname", \
|
"hostname", \
|
||||||
@ -4965,8 +4963,7 @@ int slsDetector::writeConfigurationFile(ofstream &outfile, int id){
|
|||||||
// "trimen",
|
// "trimen",
|
||||||
// "dataport",
|
// "dataport",
|
||||||
|
|
||||||
switch (thisDetector->myDetectorType) {
|
if (thisDetector->myDetectorType==GOTTHARD) {
|
||||||
case GOTTHARD:
|
|
||||||
names[4]= "angdir";
|
names[4]= "angdir";
|
||||||
names[5]= "moveflag";
|
names[5]= "moveflag";
|
||||||
names[6]= "lock";
|
names[6]= "lock";
|
||||||
@ -4977,15 +4974,12 @@ int slsDetector::writeConfigurationFile(ofstream &outfile, int id){
|
|||||||
names[11]="servermac";
|
names[11]="servermac";
|
||||||
names[12]="receiverip";
|
names[12]="receiverip";
|
||||||
names[13]="outdir";
|
names[13]="outdir";
|
||||||
nvar=14;
|
names[14]="vhighvoltage";
|
||||||
break;
|
|
||||||
case MYTHEN:
|
|
||||||
nsig=4;
|
|
||||||
default:
|
|
||||||
nvar=15;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int nvar=15;
|
||||||
|
int nsig=4;//-1;
|
||||||
int iv=0;
|
int iv=0;
|
||||||
char *args[100];
|
char *args[100];
|
||||||
char myargs[100][1000];
|
char myargs[100][1000];
|
||||||
@ -5685,6 +5679,7 @@ int slsDetector::resetFramesCaught(int index){
|
|||||||
|
|
||||||
|
|
||||||
int* slsDetector::readFrameFromReceiver(){
|
int* slsDetector::readFrameFromReceiver(){
|
||||||
|
//cout<<"databytes:"<<thisDetector->dataBytes<<" headerlength:"<<HEADERLENGTH<<endl;
|
||||||
int fnum=F_READ_FRAME;
|
int fnum=F_READ_FRAME;
|
||||||
int nel=(thisDetector->dataBytes+HEADERLENGTH)/sizeof(int);//2572/
|
int nel=(thisDetector->dataBytes+HEADERLENGTH)/sizeof(int);//2572/
|
||||||
int* retval=new int[nel];
|
int* retval=new int[nel];
|
||||||
|
@ -126,8 +126,6 @@ void slsDetectorUtils::acquire(int delflag){
|
|||||||
|
|
||||||
if(setReceiverOnline()==OFFLINE_FLAG)
|
if(setReceiverOnline()==OFFLINE_FLAG)
|
||||||
*stoppedFlag=1;
|
*stoppedFlag=1;
|
||||||
else
|
|
||||||
setReceiverAcquiring(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -414,7 +412,6 @@ void slsDetectorUtils::acquire(int delflag){
|
|||||||
// loop measurements
|
// loop measurements
|
||||||
}
|
}
|
||||||
|
|
||||||
setReceiverAcquiring(0);
|
|
||||||
|
|
||||||
// waiting for the data processing thread to finish!
|
// waiting for the data processing thread to finish!
|
||||||
if (*threadedProcessing) {
|
if (*threadedProcessing) {
|
||||||
|
@ -80,49 +80,37 @@ int fileIO::writeDataFile(ofstream &outfile, int *data, int offset){
|
|||||||
|
|
||||||
|
|
||||||
int fileIO::writeDataFile(void *data, int iframe) {
|
int fileIO::writeDataFile(void *data, int iframe) {
|
||||||
cout <<"iframe " << iframe << endl;
|
|
||||||
|
|
||||||
if (iframe<0)
|
if (iframe<0)
|
||||||
iframe=frameIndex;
|
iframe=frameIndex;
|
||||||
//if (iframe>=0)
|
|
||||||
// frameIndex=iframe;
|
|
||||||
|
|
||||||
if ((*framesPerFile)<2)
|
if ((*framesPerFile)<2)
|
||||||
iframe=-1;
|
iframe=-1;
|
||||||
//frameIndex=-1;
|
|
||||||
if ((iframe%(*framesPerFile))==0 || (iframe<0)) {
|
if ((iframe%(*framesPerFile))==0 || (iframe<0)) {
|
||||||
//if ((frameIndex%(*framesPerFile))==0 || (frameIndex<0)) {
|
|
||||||
createFileName();
|
createFileName();
|
||||||
filefd = fopen((currentFileName+string(".raw")).c_str(), "w");
|
filefd = fopen((currentFileName+string(".raw")).c_str(), "w");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filefd){
|
if (filefd){
|
||||||
//if (iframe%(*framesPerFile)) {
|
fileIOStatic::writeBinaryDataFile(filefd,getDataBytes(), data);
|
||||||
/*if(setDynamicRange(-1)==16){
|
|
||||||
fileIOStatic::writeBinaryDataFile(filefd,getDataBytes()*2, data);
|
|
||||||
frameIndex+=2;
|
|
||||||
}
|
|
||||||
else{*/
|
|
||||||
fileIOStatic::writeBinaryDataFile(filefd,getDataBytes(), data);cout<<"write frameIndex:"<<iframe<<endl;
|
|
||||||
//}
|
|
||||||
iframe++;
|
iframe++;
|
||||||
//frameIndex++;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((iframe%(*framesPerFile)==0) || (iframe<0)) {
|
if ((iframe%(*framesPerFile)==0) || (iframe<0)) {
|
||||||
//if ((frameIndex%(*framesPerFile)==0) || (frameIndex<0)) {
|
|
||||||
if (filefd)
|
if (filefd)
|
||||||
fclose(filefd);
|
fclose(filefd);
|
||||||
filefd=NULL;
|
filefd=NULL;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int fileIO::closeDataFile() {cout<<"closing datafile: filfd:"<<filefd<<endl;
|
int fileIO::closeDataFile() {
|
||||||
if (filefd)
|
if (filefd)
|
||||||
fclose(filefd);
|
fclose(filefd);
|
||||||
filefd=NULL; cout<<"closed data file"<<endl;
|
filefd=NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ s
|
|||||||
|
|
||||||
int arraySize;
|
int arraySize;
|
||||||
|
|
||||||
void setReceiverAcquiring(int acq){receiverAcquiring=acq;};
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double *fdata;
|
double *fdata;
|
||||||
@ -349,11 +349,6 @@ s
|
|||||||
int numberOfChannels;
|
int numberOfChannels;
|
||||||
|
|
||||||
|
|
||||||
int receiverAcquiring;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -389,19 +389,13 @@ int stopReceiver(){
|
|||||||
|
|
||||||
|
|
||||||
char* readFrame(){
|
char* readFrame(){
|
||||||
// volatile char* now_ptr=NULL;
|
int i;
|
||||||
//u_int32_t* ram_values=NULL;
|
for(i=0;i<10;i++){
|
||||||
|
if ((((int)*((int*)buffer))%2)!=0)
|
||||||
// now_ptr=(char*)ram_values;
|
break;
|
||||||
|
else
|
||||||
//memcpy(now_ptr,buffer ,sizeof(buffer));
|
usleep(20000);
|
||||||
|
}
|
||||||
// memcpy(sendbuffer,buffer ,sizeof(buffer));
|
|
||||||
|
|
||||||
while (((int)*((int*)buffer))%2==0) {printf("checking\n");fflush(stdout);}//usleep(20000);
|
|
||||||
|
|
||||||
// memcpy(sendbuffer,buffer ,sizeof(buffer));
|
|
||||||
|
|
||||||
//printf("freamenum%d\n",*((int*) sendbuffer));
|
//printf("freamenum%d\n",*((int*) sendbuffer));
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user