editing configuremac to include adc number

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@298 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2012-10-16 15:31:46 +00:00
parent 6fb6f72bc3
commit 6cf4fc5e43
10 changed files with 79 additions and 19 deletions

View File

@ -4502,7 +4502,7 @@ char* slsDetector::setServerMAC(string serverMAC){
};
int slsDetector::configureMAC(){
int slsDetector::configureMAC(int adc){
int retval,i;
int ret=FAIL;
int fnum=F_CONFIGURE_MAC;
@ -4565,6 +4565,7 @@ int slsDetector::configureMAC(){
if (controlSocket->Connect()>=0) {
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
controlSocket->SendDataOnly(arg,sizeof(arg));
controlSocket->SendDataOnly(&adc,sizeof(adc));
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
if (ret!=FAIL)
controlSocket->ReceiveDataOnly(&retval,sizeof(retval));

View File

@ -306,8 +306,10 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
/**
configures mac for gotthard readout
\param adc adc number
\returns OK or FAIL
*/
int configureMAC();
int configureMAC(int adc=-1);
/**
Reads the configuration file fname

View File

@ -2487,13 +2487,10 @@ string slsDetectorCommand::cmdConfigureMac(int narg, char *args[], int action) {
char ans[1000];
if (action==PUT_ACTION){
if (sscanf(args[1],"%d",&ival))
if(ival==1){
if (sscanf(args[1],"%d",&ival)){
myDet->setOnline(ONLINE_FLAG);
ret=myDet->configureMAC();
}
else
return string("Not yet implemented with arguments other than 1");
ret=myDet->configureMAC(ival);
}
}
else
return string("Cannot get ")+cmd;
@ -2506,7 +2503,7 @@ string slsDetectorCommand::helpConfigureMac(int narg, char *args[], int action)
ostringstream os;
if (action==PUT_ACTION || action==HELP_ACTION)
os << "configuremac i \n configures the MAC of the detector. i=1 for configure; i=0 for unconfigure(not implemented yet)"<< std::endl;
os << "configuremac i \n configures the MAC of the detector. i is adc number. -1 for all adcs"<< std::endl;
if (action==GET_ACTION || action==HELP_ACTION)
os << "configuremac " << "Cannot get " << std::endl;

View File

@ -473,10 +473,11 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
/**
configures mac for gotthard readout
\param adc adc number
\returns OK or FAIL
*/
virtual int configureMAC()=0;
virtual int configureMAC(int adc=-1)=0;
/** loads the modules settings/trimbits reading from a file