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