mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-25 07:40:03 +02:00
file name with frame index and detector index
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@307 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
cf5214bb01
commit
0c122168f3
@ -1336,34 +1336,27 @@ string slsDetectorCommand::helpTrimEn(int narg, char *args[], int action) {
|
|||||||
|
|
||||||
|
|
||||||
string slsDetectorCommand::cmdOutDir(int narg, char *args[], int action){
|
string slsDetectorCommand::cmdOutDir(int narg, char *args[], int action){
|
||||||
bool receiver = false;
|
|
||||||
|
|
||||||
if (action==HELP_ACTION) {
|
if (action==HELP_ACTION) {
|
||||||
return helpOutDir(narg, args, action);
|
return helpOutDir(narg, args, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(myDet->setReceiverOnline()==ONLINE_FLAG)
|
if(myDet->setReceiverOnline()==ONLINE_FLAG){
|
||||||
if(myDet->setReceiverOnline(ONLINE_FLAG)==ONLINE_FLAG)
|
if(myDet->setReceiverOnline(ONLINE_FLAG)!=ONLINE_FLAG)
|
||||||
receiver = true;
|
return string("cannot connect to receiver");
|
||||||
|
if(action==PUT_ACTION)
|
||||||
if (action==PUT_ACTION) {
|
myDet->setReceiverFileDir(string(args[1]));
|
||||||
if(receiver){
|
return myDet->setReceiverFileDir();
|
||||||
if(myDet->setReceiverFileDir(string(args[1]))==string(args[1]))
|
|
||||||
myDet->setFilePath(string(args[1]));
|
|
||||||
}else{
|
|
||||||
//check if the outdir really exists in localhost
|
|
||||||
struct stat st;
|
|
||||||
if(stat(args[1],&st))
|
|
||||||
return string("path does not exist");
|
|
||||||
else
|
|
||||||
myDet->setFilePath(string(args[1]));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(receiver)
|
if (action==PUT_ACTION) {
|
||||||
return myDet->setReceiverFileDir();
|
struct stat st;
|
||||||
else
|
if(stat(args[1],&st))
|
||||||
return string(myDet->getFilePath());
|
return string("path does not exist");
|
||||||
|
else
|
||||||
|
myDet->setFilePath(string(args[1]));
|
||||||
|
}
|
||||||
|
|
||||||
|
return string(myDet->getFilePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1381,28 +1374,22 @@ string slsDetectorCommand::helpOutDir(int narg, char *args[], int action){
|
|||||||
|
|
||||||
|
|
||||||
string slsDetectorCommand::cmdFileName(int narg, char *args[], int action){
|
string slsDetectorCommand::cmdFileName(int narg, char *args[], int action){
|
||||||
bool receiver = false;
|
|
||||||
|
|
||||||
if (action==HELP_ACTION) {
|
if (action==HELP_ACTION) {
|
||||||
return helpFileName(narg, args, action);
|
return helpFileName(narg, args, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(myDet->setReceiverOnline()==ONLINE_FLAG)
|
if(myDet->setReceiverOnline()==ONLINE_FLAG){
|
||||||
if(myDet->setReceiverOnline(ONLINE_FLAG)==ONLINE_FLAG)
|
if(myDet->setReceiverOnline(ONLINE_FLAG)!=ONLINE_FLAG)
|
||||||
receiver = true;
|
return string("cannot connect to receiver");
|
||||||
|
if(action==PUT_ACTION)
|
||||||
if (action==PUT_ACTION) {
|
myDet->setReceiverFileName(string(args[1]));
|
||||||
if(receiver){
|
return myDet->setReceiverFileName();
|
||||||
if(myDet->setReceiverFileName(string(args[1]))==string(args[1]))
|
|
||||||
myDet->setFileName(string(args[1]));
|
|
||||||
}else
|
|
||||||
myDet->setFileName(string(args[1]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(receiver)
|
if (action==PUT_ACTION)
|
||||||
return myDet->setReceiverFileName();
|
myDet->setFileName(string(args[1]));
|
||||||
else
|
|
||||||
return string(myDet->getFileName());
|
return string(myDet->getFileName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1450,36 +1437,29 @@ string slsDetectorCommand::helpEnablefwrite(int narg, char *args[], int action){
|
|||||||
}
|
}
|
||||||
|
|
||||||
string slsDetectorCommand::cmdFileIndex(int narg, char *args[], int action){
|
string slsDetectorCommand::cmdFileIndex(int narg, char *args[], int action){
|
||||||
bool receiver = false;
|
|
||||||
int i;
|
|
||||||
char ans[100];
|
char ans[100];
|
||||||
|
int i;
|
||||||
|
|
||||||
if (action==HELP_ACTION) {
|
if (action==HELP_ACTION) {
|
||||||
return helpFileName(narg, args, action);
|
return helpFileName(narg, args, action);
|
||||||
}
|
}
|
||||||
|
else if (action==PUT_ACTION)
|
||||||
|
if(!sscanf(args[1],"%d",&i))
|
||||||
|
return string("cannot parse file index");
|
||||||
|
|
||||||
if(myDet->setReceiverOnline()==ONLINE_FLAG)
|
if(myDet->setReceiverOnline()==ONLINE_FLAG){
|
||||||
if(myDet->setReceiverOnline(ONLINE_FLAG)==ONLINE_FLAG)
|
if(myDet->setReceiverOnline(ONLINE_FLAG)!=ONLINE_FLAG)
|
||||||
receiver = true;
|
return string("cannot connect to receiver");
|
||||||
|
if(action==PUT_ACTION)
|
||||||
if (action==PUT_ACTION) {
|
myDet->setReceiverFileIndex(i);
|
||||||
if (sscanf(args[1],"%d",&i)){
|
|
||||||
if(receiver){
|
|
||||||
if(myDet->setReceiverFileIndex(i)==i)
|
|
||||||
myDet->setFileIndex(i);
|
|
||||||
}else
|
|
||||||
myDet->setFileIndex(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(receiver){
|
|
||||||
//int ret=myDet->setReceiverFileIndex();
|
|
||||||
//myDet->setFileIndex(ret);
|
|
||||||
sprintf(ans,"%d", myDet->setReceiverFileIndex());
|
sprintf(ans,"%d", myDet->setReceiverFileIndex());
|
||||||
|
return string(ans);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
sprintf(ans,"%d", myDet->getFileIndex());
|
|
||||||
|
|
||||||
|
if (action==PUT_ACTION)
|
||||||
|
myDet->setFileIndex(i);
|
||||||
|
|
||||||
|
sprintf(ans,"%d", myDet->getFileIndex());
|
||||||
return string(ans);
|
return string(ans);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2217,7 +2197,7 @@ string slsDetectorCommand::cmdNetworkParameter(int narg, char *args[], int actio
|
|||||||
if(!strcmp(myDet->setNetworkParameter(t, args[1]),args[1])){
|
if(!strcmp(myDet->setNetworkParameter(t, args[1]),args[1])){
|
||||||
if(t==RECEIVER_IP){
|
if(t==RECEIVER_IP){
|
||||||
if(myDet->setReceiverOnline(ONLINE_FLAG)!=ONLINE_FLAG)
|
if(myDet->setReceiverOnline(ONLINE_FLAG)!=ONLINE_FLAG)
|
||||||
return string("receiver not online");
|
return string("cannot connect to receiver");
|
||||||
//outdir
|
//outdir
|
||||||
if(myDet->setReceiverFileDir(myDet->getFilePath()).compare(myDet->getFilePath()))
|
if(myDet->setReceiverFileDir(myDet->getFilePath()).compare(myDet->getFilePath()))
|
||||||
return string("could not set up receiver file outdir");
|
return string("could not set up receiver file outdir");
|
||||||
@ -2488,8 +2468,8 @@ string slsDetectorCommand::cmdConfigureMac(int narg, char *args[], int action) {
|
|||||||
|
|
||||||
if (action==PUT_ACTION){
|
if (action==PUT_ACTION){
|
||||||
if (sscanf(args[1],"%d",&ival)){
|
if (sscanf(args[1],"%d",&ival)){
|
||||||
myDet->setOnline(ONLINE_FLAG);
|
myDet->setOnline(ONLINE_FLAG);
|
||||||
ret=myDet->configureMAC(ival);
|
ret=myDet->configureMAC(ival);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -3602,10 +3582,8 @@ string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action) {
|
|||||||
|
|
||||||
if(myDet->stopReceiver()!=FAIL){
|
if(myDet->stopReceiver()!=FAIL){
|
||||||
//update index
|
//update index
|
||||||
int index = myDet->setReceiverFileIndex();
|
myDet->setFileIndex(myDet->getFileIndex()+1);
|
||||||
if(index==-1)
|
myDet->setReceiverFileIndex(myDet->getFileIndex());
|
||||||
return string("could not get receiver file index");
|
|
||||||
myDet->setFileIndex(index);
|
|
||||||
}
|
}
|
||||||
else if(myDet->setReceiverOnline()!=ONLINE_FLAG)
|
else if(myDet->setReceiverOnline()!=ONLINE_FLAG)
|
||||||
return string("cannot connect to receiver");
|
return string("cannot connect to receiver");
|
||||||
|
@ -120,7 +120,7 @@ class slsDetectorUsers
|
|||||||
*/
|
*/
|
||||||
int setFileIndex(int i);
|
int setFileIndex(int i);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@short get flat field corrections file directory
|
@short get flat field corrections file directory
|
||||||
\returns flat field correction file directory
|
\returns flat field correction file directory
|
||||||
*/
|
*/
|
||||||
|
@ -77,7 +77,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
|
|||||||
int enableCountRateCorrection(int i=-1){if (i>0) setRateCorrection(-1); else if (i==0) setRateCorrection(0); return getRateCorrection();};
|
int enableCountRateCorrection(int i=-1){if (i>0) setRateCorrection(-1); else if (i==0) setRateCorrection(0); return getRateCorrection();};
|
||||||
// string getFilePath(){return fileIO::getFilePath();};;
|
// string getFilePath(){return fileIO::getFilePath();};;
|
||||||
// string setFilePath(string s){return fileIO::setFilePath(s);};
|
// string setFilePath(string s){return fileIO::setFilePath(s);};
|
||||||
|
|
||||||
// string getFileName(){return fileIO::getFileName();};
|
// string getFileName(){return fileIO::getFileName();};
|
||||||
// string setFileName(string s){return fileIO::setFileName(s);};
|
// string setFileName(string s){return fileIO::setFileName(s);};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user