mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 06:50:02 +02:00
Merge branch 'developer' into gui
This commit is contained in:
commit
ffbc0a0fc3
@ -616,7 +616,7 @@ hframe=new TGHorizontalFrame(this, 800,50);
|
||||
// mgAdcs=new TMultiGraph();
|
||||
adcStack=new THStack();
|
||||
TH1F *h;
|
||||
int nSamples=nAnalogSamples;
|
||||
int nSamples=nAnalogSamples;
|
||||
|
||||
for (int i=0; i<NADCS; i++) {
|
||||
sprintf(tit,"adc%d",i);
|
||||
|
@ -248,6 +248,15 @@ void ctbAdc::setEnabled(Bool_t b){
|
||||
|
||||
|
||||
|
||||
void ctbAdc::setPlot(Bool_t b){
|
||||
// cout << id << "set enabled " << b << endl;
|
||||
if (b)
|
||||
sAdcPlot->SetOn(kTRUE,kTRUE);
|
||||
else
|
||||
sAdcPlot->SetOn(kFALSE,kTRUE);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -543,16 +552,20 @@ string ctbAdcs::getAdcParameters() {
|
||||
void ctbAdcs::CheckAll() {
|
||||
|
||||
|
||||
for (int is=0; is<NADCS; is++)
|
||||
sAdc[is]->setEnabled(kTRUE);
|
||||
for (int is=0; is<NADCS; is++){
|
||||
sAdc[is]->setPlot(kTRUE);
|
||||
// sAdc[is]->setEnabled(kTRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::RemoveAll() {
|
||||
|
||||
|
||||
for (int is=0; is<NADCS; is++)
|
||||
sAdc[is]->setEnabled(kFALSE);
|
||||
for (int is=0; is<NADCS; is++) {
|
||||
// sAdc[is]->setEnabled(kFALSE);
|
||||
sAdc[is]->setPlot(kFALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -560,31 +573,39 @@ void ctbAdcs::RemoveAll() {
|
||||
void ctbAdcs::CheckHalf0() {
|
||||
|
||||
|
||||
for (int is=0; is<NADCS/2; is++)
|
||||
sAdc[is]->setEnabled(kTRUE);
|
||||
for (int is=0; is<NADCS/2; is++) {
|
||||
sAdc[is]->setPlot(kTRUE);
|
||||
// sAdc[is]->setEnabled(kTRUE)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::RemoveHalf0() {
|
||||
|
||||
|
||||
for (int is=0; is<NADCS/2; is++)
|
||||
sAdc[is]->setEnabled(kFALSE);
|
||||
for (int is=0; is<NADCS/2; is++){
|
||||
// sAdc[is]->setEnabled(kFALSE);
|
||||
sAdc[is]->setPlot(kFALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void ctbAdcs::CheckHalf1() {
|
||||
|
||||
|
||||
for (int is=NADCS/2; is<NADCS; is++)
|
||||
sAdc[is]->setEnabled(kTRUE);
|
||||
for (int is=NADCS/2; is<NADCS; is++){
|
||||
sAdc[is]->setPlot(kTRUE);
|
||||
// sAdc[is]->setEnabled(kTRUE)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::RemoveHalf1() {
|
||||
|
||||
|
||||
for (int is=NADCS/2; is<NADCS; is++)
|
||||
sAdc[is]->setEnabled(kFALSE);
|
||||
for (int is=NADCS/2; is<NADCS; is++){
|
||||
// sAdc[is]->setEnabled(kFALSE);
|
||||
sAdc[is]->setPlot(kFALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -75,6 +75,7 @@ class ctbAdc : public TGHorizontalFrame {
|
||||
|
||||
Bool_t getEnable();
|
||||
void setEnable(Bool_t);
|
||||
void setPlot(Bool_t);
|
||||
Bool_t getInverted();
|
||||
Bool_t getPlot();
|
||||
void setInverted(Bool_t);
|
||||
|
Binary file not shown.
Binary file not shown.
BIN
slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer
Executable file
BIN
slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer
Executable file
Binary file not shown.
Binary file not shown.
@ -485,31 +485,26 @@ int get_detector_type(int file_des) {
|
||||
int set_external_signal_flag(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int args[2] = {-1,-1};
|
||||
int arg = -1;
|
||||
enum externalSignalFlag retval= GET_EXTERNAL_SIGNAL_FLAG;
|
||||
|
||||
if (receiveData(file_des, args, sizeof(args), INT32) < 0)
|
||||
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
||||
return printSocketReadError();
|
||||
|
||||
int signalindex = args[0];
|
||||
enum externalSignalFlag flag = args[1];
|
||||
FILE_LOG(logDEBUG1, ("Setting external signal %d to flag %d\n", signalindex, flag));
|
||||
enum externalSignalFlag flag = arg;
|
||||
FILE_LOG(logDEBUG1, ("Setting external signal flag to %d\n", flag));
|
||||
|
||||
#ifndef GOTTHARDD
|
||||
functionNotImplemented();
|
||||
#else
|
||||
if (signalindex > 0)
|
||||
modeNotImplemented("Signal index", signalindex);
|
||||
else {
|
||||
// set
|
||||
if ((flag != GET_EXTERNAL_SIGNAL_FLAG) && (Server_VerifyLock() == OK)) {
|
||||
setExtSignal(flag);
|
||||
}
|
||||
// get
|
||||
retval = getExtSignal();
|
||||
validate((int)flag, (int)retval, "set external signal flag", DEC);
|
||||
FILE_LOG(logDEBUG1, ("External Signal Flag: %d\n", retval));
|
||||
// set
|
||||
if ((flag != GET_EXTERNAL_SIGNAL_FLAG) && (Server_VerifyLock() == OK)) {
|
||||
setExtSignal(flag);
|
||||
}
|
||||
// get
|
||||
retval = getExtSignal();
|
||||
validate((int)flag, (int)retval, "set external signal flag", DEC);
|
||||
FILE_LOG(logDEBUG1, ("External Signal Flag: %d\n", retval));
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, UPDATE, &retval, sizeof(retval));
|
||||
}
|
||||
|
@ -828,13 +828,12 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
||||
* Set/get external signal flags (to specify triggerinrising edge etc)
|
||||
* (Gotthard, Mythen)
|
||||
* @param pol external signal flag (-1 gets)
|
||||
* @param signalindex singal index (0 - 3)
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns current timing mode
|
||||
*/
|
||||
externalSignalFlag
|
||||
setExternalSignalFlags(externalSignalFlag pol = GET_EXTERNAL_SIGNAL_FLAG,
|
||||
int signalindex = 0, int detPos = -1);
|
||||
int detPos = -1);
|
||||
|
||||
/**
|
||||
* Set/get readout flags (Eiger, Mythen)
|
||||
|
@ -814,10 +814,9 @@ class slsDetector : public virtual slsDetectorDefs{
|
||||
/**
|
||||
* Set/get external signal flags (to specify triggerinrising edge etc) (Gotthard, Mythen)
|
||||
* @param pol external signal flag (-1 gets)
|
||||
* @param signalindex singal index (0 - 3)
|
||||
* @returns current timing mode
|
||||
*/
|
||||
externalSignalFlag setExternalSignalFlags(externalSignalFlag pol = GET_EXTERNAL_SIGNAL_FLAG, int signalindex = 0);
|
||||
externalSignalFlag setExternalSignalFlags(externalSignalFlag pol = GET_EXTERNAL_SIGNAL_FLAG);
|
||||
|
||||
/**
|
||||
* Set/get readout flags (Eiger, Mythen)
|
||||
|
@ -1366,14 +1366,14 @@ multiSlsDetector::setExternalCommunicationMode(externalCommunicationMode pol, in
|
||||
}
|
||||
|
||||
slsDetectorDefs::externalSignalFlag
|
||||
multiSlsDetector::setExternalSignalFlags(externalSignalFlag pol, int signalindex, int detPos) {
|
||||
multiSlsDetector::setExternalSignalFlags(externalSignalFlag pol, int detPos) {
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->setExternalSignalFlags(pol, signalindex);
|
||||
return detectors[detPos]->setExternalSignalFlags(pol);
|
||||
}
|
||||
|
||||
// multi
|
||||
auto r = parallelCall(&slsDetector::setExternalSignalFlags, pol, signalindex);
|
||||
auto r = parallelCall(&slsDetector::setExternalSignalFlags, pol);
|
||||
return sls::minusOneIfDifferent(r);
|
||||
}
|
||||
|
||||
|
@ -1707,15 +1707,13 @@ slsDetector::setExternalCommunicationMode(externalCommunicationMode pol) {
|
||||
}
|
||||
|
||||
slsDetectorDefs::externalSignalFlag
|
||||
slsDetector::setExternalSignalFlags(externalSignalFlag pol, int signalindex) {
|
||||
slsDetector::setExternalSignalFlags(externalSignalFlag pol) {
|
||||
int fnum = F_SET_EXTERNAL_SIGNAL_FLAG;
|
||||
int args[]{signalindex, pol};
|
||||
auto retval = GET_EXTERNAL_SIGNAL_FLAG;
|
||||
FILE_LOG(logDEBUG1) << "Setting signal " << signalindex << " to flag "
|
||||
<< pol;
|
||||
FILE_LOG(logDEBUG1) << "Setting signal flag to " << pol;
|
||||
if (shm()->onlineFlag == ONLINE_FLAG) {
|
||||
sendToDetector(fnum, args, retval);
|
||||
FILE_LOG(logDEBUG1) << "Ext Signal (" << signalindex << "): " << retval;
|
||||
sendToDetector(fnum, pol, retval);
|
||||
FILE_LOG(logDEBUG1) << "Ext Signal: " << retval;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
|
||||
++i;
|
||||
|
||||
/*! \page config
|
||||
- <b>extsig:[i] [flag]</b> sets/gets the mode of the external signal i. Options: \c off, \c gate_in_active_high, \c gate_in_active_low, \c trigger_in_rising_edge, \c trigger_in_falling_edge,
|
||||
- <b>extsig [flag]</b> sets/gets the mode of the external signal. Options: \c off, \c gate_in_active_high, \c gate_in_active_low, \c trigger_in_rising_edge, \c trigger_in_falling_edge,
|
||||
\c ro_trigger_in_rising_edge, \c ro_trigger_in_falling_edge, \c gate_out_active_high, \c gate_out_active_low, \c trigger_out_rising_edge, \c trigger_out_falling_edge, \c ro_trigger_out_rising_edge,
|
||||
\c ro_trigger_out_falling_edge. \n Used in GOTTHARDonly. \c Returns \c (string)
|
||||
*/
|
||||
@ -3879,11 +3879,14 @@ std::string slsDetectorCommand::cmdDAC(int narg, const char * const args[], int
|
||||
char answer[1000];
|
||||
int mode = 0;
|
||||
|
||||
int idac = -1;
|
||||
if (sscanf(args[0], "dac:%d", &idac) == 1) {
|
||||
//printf("chiptestboard!\n");
|
||||
if (cmd == "dac") {
|
||||
int idac = -1;
|
||||
if (sscanf(args[1], "%d", &idac) != 1) {
|
||||
return std::string("Could not scan dac index") + std::string(args[1]);
|
||||
}
|
||||
dac = (dacIndex)idac;
|
||||
} else if (cmd == "adcvpp")
|
||||
}
|
||||
else if (cmd == "adcvpp")
|
||||
dac = ADC_VPP;
|
||||
else if (cmd == "vthreshold")
|
||||
dac = THRESHOLD;
|
||||
@ -4218,8 +4221,6 @@ std::string slsDetectorCommand::helpDAC(int action) {
|
||||
std::string slsDetectorCommand::cmdADC(int narg, const char * const args[], int action, int detPos) {
|
||||
|
||||
dacIndex adc;
|
||||
int idac;
|
||||
// double val=-1;
|
||||
char answer[1000];
|
||||
|
||||
if (action == HELP_ACTION)
|
||||
@ -4227,13 +4228,18 @@ std::string slsDetectorCommand::cmdADC(int narg, const char * const args[], int
|
||||
else if (action == PUT_ACTION)
|
||||
return std::string("cannot set ") + cmd;
|
||||
|
||||
if (sscanf(args[0],"adc:%d",&idac)==1) {
|
||||
// printf("chiptestboard!\n");
|
||||
adc=(dacIndex)(idac+SLOW_ADC0);
|
||||
if (idac < 0 || idac > SLOW_ADC_TEMP - SLOW_ADC0)
|
||||
if (cmd == "adc") {
|
||||
int idac = -1;
|
||||
if (sscanf(args[1], "%d", &idac) != 1) {
|
||||
return std::string("Could not scan adc index") + std::string(args[1]);
|
||||
}
|
||||
if (idac < 0 || idac > SLOW_ADC_TEMP - SLOW_ADC0) {
|
||||
return (std::string ("cannot set adc, must be between ") + std::to_string(0) +
|
||||
std::string (" and ") + std::to_string(SLOW_ADC_TEMP - SLOW_ADC0));
|
||||
} else if (cmd=="temp_adc")
|
||||
}
|
||||
adc = (dacIndex)(idac + SLOW_ADC0);
|
||||
}
|
||||
else if (cmd=="temp_adc")
|
||||
adc=TEMPERATURE_ADC;
|
||||
else if (cmd=="temp_fpga")
|
||||
adc=TEMPERATURE_FPGA;
|
||||
@ -4817,11 +4823,6 @@ std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[],
|
||||
|
||||
} else if (cmd == "extsig") {
|
||||
externalSignalFlag flag = GET_EXTERNAL_SIGNAL_FLAG;
|
||||
int is = -1;
|
||||
if (sscanf(args[0], "extsig:%d", &is))
|
||||
;
|
||||
else
|
||||
return std::string("could not scan signal number ") + std::string(args[0]);
|
||||
|
||||
if (action == PUT_ACTION) {
|
||||
flag = myDet->externalSignalType(args[1]);
|
||||
@ -4830,7 +4831,7 @@ std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[],
|
||||
}
|
||||
myDet->setOnline(ONLINE_FLAG, detPos);
|
||||
|
||||
return myDet->externalSignalType(myDet->setExternalSignalFlags(flag, is, detPos));
|
||||
return myDet->externalSignalType(myDet->setExternalSignalFlags(flag, detPos));
|
||||
|
||||
} else if (cmd == "programfpga") {
|
||||
if (action == GET_ACTION)
|
||||
@ -4955,7 +4956,7 @@ std::string slsDetectorCommand::helpAdvanced(int action) {
|
||||
std::ostringstream os;
|
||||
if (action == PUT_ACTION || action == HELP_ACTION) {
|
||||
|
||||
os << "extsig:i mode \t sets the mode of the external signal i. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
|
||||
os << "extsig mode \t sets the mode of the external signal. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
|
||||
os << "flags mode \t sets the readout flags to mode. can be none, storeinram, tot, continous, parallel, nonparallel, safe, digital, analog_digital, overlow, nooverflow, unknown." << std::endl;
|
||||
|
||||
os << "programfpga f \t programs the fpga with file f (with .pof extension)." << std::endl;
|
||||
@ -4970,7 +4971,7 @@ std::string slsDetectorCommand::helpAdvanced(int action) {
|
||||
}
|
||||
if (action == GET_ACTION || action == HELP_ACTION) {
|
||||
|
||||
os << "extsig:i \t gets the mode of the external signal i. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
|
||||
os << "extsig \t gets the mode of the external signal. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
|
||||
|
||||
os << "flags \t gets the readout flags. can be none, storeinram, tot, continous, parallel, nonparallel, safe, digital, analog_digital, overflow, nooverflow, unknown" << std::endl;
|
||||
os << "led \t returns led status (0 off, 1 on)" << std::endl;
|
||||
|
@ -1,10 +1,10 @@
|
||||
/** API versions */
|
||||
#define GITBRANCH "refgui"
|
||||
#define APIGOTTHARD 0x190108
|
||||
#define APIMOENCH 0x181108
|
||||
#define APILIB 0x190405
|
||||
#define APIRECEIVER 0x190405
|
||||
#define APIGUI 0x190405
|
||||
#define APIEIGER 0x190531
|
||||
#define APIJUNGFRAU 0x190531
|
||||
#define APICTB 0x190603
|
||||
#define APIGOTTHARD 0x190604
|
||||
#define APICTB 0x190604
|
||||
#define APIJUNGFRAU 0x190604
|
||||
#define APIEIGER 0x190604
|
||||
|
Loading…
x
Reference in New Issue
Block a user