mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 23:10:02 +02:00
stylistic cleanup
This commit is contained in:
parent
f806759af3
commit
795e147e7d
@ -940,7 +940,7 @@ int multiSlsDetector::readConfigurationFile(const std::string& fname) {
|
|||||||
freeSharedMemory();
|
freeSharedMemory();
|
||||||
setupMultiDetector();
|
setupMultiDetector();
|
||||||
|
|
||||||
std::string ans;
|
// std::string ans;
|
||||||
std::string str;
|
std::string str;
|
||||||
std::ifstream infile;
|
std::ifstream infile;
|
||||||
int iargval;
|
int iargval;
|
||||||
|
@ -1254,7 +1254,7 @@ int slsDetector::setPort(portType index, int num) {
|
|||||||
int fnum=F_SET_PORT, fnum2 = F_SET_RECEIVER_PORT;
|
int fnum=F_SET_PORT, fnum2 = F_SET_RECEIVER_PORT;
|
||||||
int retval;
|
int retval;
|
||||||
// uint64_t ut;
|
// uint64_t ut;
|
||||||
char mess[MAX_STR_LENGTH]="";
|
|
||||||
int ret=FAIL;
|
int ret=FAIL;
|
||||||
bool online=false;
|
bool online=false;
|
||||||
MySocketTCP *s = 0;
|
MySocketTCP *s = 0;
|
||||||
@ -1362,6 +1362,7 @@ int slsDetector::setPort(portType index, int num) {
|
|||||||
s->SendDataOnly(&num,sizeof(num));
|
s->SendDataOnly(&num,sizeof(num));
|
||||||
s->ReceiveDataOnly(&ret,sizeof(ret));
|
s->ReceiveDataOnly(&ret,sizeof(ret));
|
||||||
if (ret==FAIL) {
|
if (ret==FAIL) {
|
||||||
|
char mess[MAX_STR_LENGTH]="";
|
||||||
s->ReceiveDataOnly(mess,sizeof(mess));
|
s->ReceiveDataOnly(mess,sizeof(mess));
|
||||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||||
} else {
|
} else {
|
||||||
@ -2099,8 +2100,7 @@ int slsDetector::loadSettingsFile(std::string fname) {
|
|||||||
int iodelay = -1;
|
int iodelay = -1;
|
||||||
int tau = -1;
|
int tau = -1;
|
||||||
|
|
||||||
std::string fn=fname;
|
std::string fn = fname;
|
||||||
fn=fname;
|
|
||||||
|
|
||||||
std::ostringstream ostfn;
|
std::ostringstream ostfn;
|
||||||
ostfn << fname;
|
ostfn << fname;
|
||||||
@ -2233,8 +2233,7 @@ int slsDetector::startAcquisition() {
|
|||||||
|
|
||||||
int fnum=F_START_ACQUISITION;
|
int fnum=F_START_ACQUISITION;
|
||||||
int ret=FAIL;
|
int ret=FAIL;
|
||||||
char mess[MAX_STR_LENGTH]="";
|
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "Starting acquisition "<< std::endl;
|
std::cout<< "Starting acquisition "<< std::endl;
|
||||||
#endif
|
#endif
|
||||||
@ -2244,6 +2243,7 @@ int slsDetector::startAcquisition() {
|
|||||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||||
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||||
if (ret==FAIL) {
|
if (ret==FAIL) {
|
||||||
|
char mess[MAX_STR_LENGTH]="";
|
||||||
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||||
}
|
}
|
||||||
@ -2778,12 +2778,9 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t) {
|
|||||||
|
|
||||||
|
|
||||||
int64_t slsDetector::getTimeLeft(timerIndex index) {
|
int64_t slsDetector::getTimeLeft(timerIndex index) {
|
||||||
|
int fnum = F_GET_TIME_LEFT;
|
||||||
|
int64_t retval = -1;
|
||||||
int fnum=F_GET_TIME_LEFT;
|
int ret = OK;
|
||||||
int64_t retval;
|
|
||||||
char mess[MAX_STR_LENGTH]="";
|
|
||||||
int ret=OK;
|
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "Getting timer "<< index << std::endl;
|
std::cout<< "Getting timer "<< index << std::endl;
|
||||||
@ -2795,6 +2792,7 @@ int64_t slsDetector::getTimeLeft(timerIndex index) {
|
|||||||
stopSocket->SendDataOnly(&index,sizeof(index));
|
stopSocket->SendDataOnly(&index,sizeof(index));
|
||||||
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||||
if (ret==FAIL) {
|
if (ret==FAIL) {
|
||||||
|
char mess[MAX_STR_LENGTH]="";
|
||||||
stopSocket->ReceiveDataOnly(mess,sizeof(mess));
|
stopSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||||
} else {
|
} else {
|
||||||
@ -3023,16 +3021,10 @@ int slsDetector::setDAC(int val, dacIndex index, int mV) {
|
|||||||
|
|
||||||
|
|
||||||
int slsDetector::getADC(dacIndex index) {
|
int slsDetector::getADC(dacIndex index) {
|
||||||
|
int retval = -1;
|
||||||
int retval;
|
|
||||||
int fnum=F_GET_ADC;
|
int fnum=F_GET_ADC;
|
||||||
int ret=FAIL;
|
int ret=FAIL;
|
||||||
char mess[MAX_STR_LENGTH]="";
|
int arg = index;
|
||||||
|
|
||||||
int arg;
|
|
||||||
arg=index;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< std::endl;
|
std::cout<< std::endl;
|
||||||
@ -3049,6 +3041,7 @@ int slsDetector::getADC(dacIndex index) {
|
|||||||
*(adcs+index)=retval;
|
*(adcs+index)=retval;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
char mess[MAX_STR_LENGTH]="";
|
||||||
stopSocket->ReceiveDataOnly(mess,sizeof(mess));
|
stopSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||||
}
|
}
|
||||||
@ -3064,30 +3057,18 @@ int slsDetector::getADC(dacIndex index) {
|
|||||||
if (ret==FAIL) {
|
if (ret==FAIL) {
|
||||||
std::cout<< "Get ADC failed " << std::endl;
|
std::cout<< "Get ADC failed " << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
slsDetectorDefs::externalCommunicationMode slsDetector::setExternalCommunicationMode(
|
slsDetectorDefs::externalCommunicationMode slsDetector::setExternalCommunicationMode(
|
||||||
externalCommunicationMode pol) {
|
externalCommunicationMode pol) {
|
||||||
|
int arg = pol;
|
||||||
|
externalCommunicationMode retval = GET_EXTERNAL_COMMUNICATION_MODE;;
|
||||||
|
|
||||||
|
|
||||||
int arg[1];
|
|
||||||
externalCommunicationMode retval;
|
|
||||||
int fnum=F_SET_EXTERNAL_COMMUNICATION_MODE;
|
int fnum=F_SET_EXTERNAL_COMMUNICATION_MODE;
|
||||||
char mess[MAX_STR_LENGTH]="";
|
|
||||||
|
|
||||||
arg[0]=pol;
|
|
||||||
|
|
||||||
int ret=FAIL;
|
int ret=FAIL;
|
||||||
retval=GET_EXTERNAL_COMMUNICATION_MODE;
|
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< std::endl;
|
std::cout<< std::endl;
|
||||||
@ -3101,6 +3082,7 @@ slsDetectorDefs::externalCommunicationMode slsDetector::setExternalCommunication
|
|||||||
if (ret!=FAIL)
|
if (ret!=FAIL)
|
||||||
controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||||
else {
|
else {
|
||||||
|
char mess[MAX_STR_LENGTH]="";
|
||||||
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||||
}
|
}
|
||||||
@ -3119,7 +3101,6 @@ slsDetectorDefs::externalCommunicationMode slsDetector::setExternalCommunication
|
|||||||
std::cout<< "Setting communication mode failed" << std::endl;
|
std::cout<< "Setting communication mode failed" << std::endl;
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user