mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-17 21:48:41 +01:00
Gotthard class implemented
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@34 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@@ -6,10 +6,6 @@
|
||||
//using namespace std;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
string mythenDetector::executeLine(int narg, char *args[], int action) {
|
||||
|
||||
|
||||
@@ -99,8 +95,8 @@ string mythenDetector::executeLine(int narg, char *args[], int action) {
|
||||
std::cout<< helpLine(action);
|
||||
return string("more questions? Refere to software documentation!");
|
||||
}
|
||||
|
||||
if (var=="hostname") {
|
||||
|
||||
if (var=="hostname") {
|
||||
if (action==PUT_ACTION) {
|
||||
setTCPSocket(args[1]);
|
||||
}
|
||||
@@ -270,9 +266,9 @@ string mythenDetector::executeLine(int narg, char *args[], int action) {
|
||||
if (var=="trimdir") {
|
||||
if (action==PUT_ACTION) {
|
||||
sval=string(args[1]);
|
||||
setTrimDir(sval);
|
||||
setSettingsDir(sval);
|
||||
}
|
||||
return string(getTrimDir());
|
||||
return string(getSettingsDir());
|
||||
} else if (var=="caldir") {
|
||||
if (action==PUT_ACTION) {
|
||||
sval=string(args[1]);
|
||||
@@ -730,9 +726,11 @@ string mythenDetector::executeLine(int narg, char *args[], int action) {
|
||||
sett=FAST;
|
||||
else if (sval=="highgain")
|
||||
sett=HIGHGAIN;
|
||||
//setSettings(sett);
|
||||
else {
|
||||
sprintf(answer,"%s not defined for this detector",sval.c_str());
|
||||
return string(answer);
|
||||
}
|
||||
}
|
||||
//switch (setSettings( GET_SETTINGS)) {
|
||||
switch (setSettings(sett)) {
|
||||
case STANDARD:
|
||||
return string("standard");
|
||||
@@ -740,6 +738,14 @@ string mythenDetector::executeLine(int narg, char *args[], int action) {
|
||||
return string("fast");
|
||||
case HIGHGAIN:
|
||||
return string("highgain");
|
||||
case DYNAMICGAIN:
|
||||
return string("dynamicgain");
|
||||
case GAIN1:
|
||||
return string("gain1");
|
||||
case GAIN2:
|
||||
return string("gain2");
|
||||
case GAIN3:
|
||||
return string("gain3");
|
||||
default:
|
||||
return string("undefined");
|
||||
}
|
||||
@@ -981,14 +987,14 @@ string mythenDetector::executeLine(int narg, char *args[], int action) {
|
||||
if (action==GET_ACTION) {
|
||||
ostfn << sval << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im);
|
||||
if ((myMod=getModule(im))) {
|
||||
writeTrimFile(ostfn.str(),*myMod);
|
||||
writeSettingsFile(ostfn.str(),*myMod);
|
||||
deleteModule(myMod);
|
||||
}
|
||||
} else if (action==PUT_ACTION) {
|
||||
ostfn << sval ;
|
||||
if (sval.find('.',sval.length()-7)<string::npos)
|
||||
ostfn << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im);
|
||||
myMod=readTrimFile(ostfn.str());
|
||||
myMod=readSettingsFile(ostfn.str());
|
||||
if (myMod) {
|
||||
myMod->module=im;
|
||||
setModule(*myMod);
|
||||
@@ -998,7 +1004,7 @@ string mythenDetector::executeLine(int narg, char *args[], int action) {
|
||||
}
|
||||
}
|
||||
std::cout<< "Returning trimfile " << std::endl;
|
||||
return string(getTrimFile());
|
||||
return string(getSettingsFile());
|
||||
} else if (var.find("trim")==0) {
|
||||
if (action==GET_ACTION) {
|
||||
trimMode mode=NOISE_TRIMMING;
|
||||
@@ -1040,7 +1046,7 @@ string mythenDetector::executeLine(int narg, char *args[], int action) {
|
||||
//create file names
|
||||
ostfn << sval << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im);
|
||||
if ((myMod=getModule(im))) {
|
||||
writeTrimFile(ostfn.str(),*myMod);
|
||||
writeSettingsFile(ostfn.str(),*myMod);
|
||||
deleteModule(myMod);
|
||||
}
|
||||
}
|
||||
@@ -1549,29 +1555,6 @@ string mythenDetector::helpLine( int action) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* detector configuration (no communication to server) */
|
||||
|
||||
/*
|
||||
@@ -1921,11 +1904,10 @@ int mythenDetector::retrieveDetectorSetup(string fname1, int level){
|
||||
|
||||
|
||||
|
||||
|
||||
/* I/O */
|
||||
|
||||
|
||||
sls_detector_module* mythenDetector::readTrimFile(string fname, sls_detector_module *myMod){
|
||||
sls_detector_module* mythenDetector::readSettingsFile(string fname, sls_detector_module *myMod){
|
||||
|
||||
int nflag=0;
|
||||
|
||||
@@ -2056,7 +2038,7 @@ int mythenDetector::retrieveDetectorSetup(string fname1, int level){
|
||||
std::cout<< "read " << ichan*ichip << " channels" <<std::endl;
|
||||
#endif
|
||||
infile.close();
|
||||
strcpy(thisDetector->trimFile,fname.c_str());
|
||||
strcpy(thisDetector->settingsFile,fname.c_str());
|
||||
return myMod;
|
||||
} else {
|
||||
std::cout<< "could not open trim file " << myfname << std::endl;
|
||||
@@ -2068,7 +2050,7 @@ int mythenDetector::retrieveDetectorSetup(string fname1, int level){
|
||||
};
|
||||
|
||||
|
||||
int mythenDetector::writeTrimFile(string fname, sls_detector_module mod){
|
||||
int mythenDetector::writeSettingsFile(string fname, sls_detector_module mod){
|
||||
|
||||
ofstream outfile;
|
||||
string names[]={"Vtrim", "Vthresh", "Rgsh1", "Rgsh2", "Rgpr", "Vcal", "outBuffEnable"};
|
||||
@@ -2119,9 +2101,9 @@ int mythenDetector::writeTrimFile(string fname, sls_detector_module mod){
|
||||
|
||||
|
||||
|
||||
int mythenDetector::writeTrimFile(string fname, int imod){
|
||||
int mythenDetector::writeSettingsFile(string fname, int imod){
|
||||
|
||||
return writeTrimFile(fname,detectorModules[imod]);
|
||||
return writeSettingsFile(fname,detectorModules[imod]);
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user