mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +02:00
WIP
This commit is contained in:
parent
5e24591295
commit
0f2641f9fa
@ -200,14 +200,15 @@ void qDrawPlot::SetupPlots() {
|
||||
// default display data
|
||||
for (unsigned int px = 0; px < nPixelsX; ++px) {
|
||||
datax1d[px] = px;
|
||||
datay1d[0][px] = 0;
|
||||
datay1d[0][px] = px;
|
||||
}
|
||||
// add a hist
|
||||
DetachHists();
|
||||
SlsQtH1D *h = new SlsQtH1D("", nPixelsX, datax1d, datay1d[0]);
|
||||
h->SetLineColor(0);
|
||||
SetStyleandSymbol(h);
|
||||
hists1d.append(h);
|
||||
h->Attach(plot1d);
|
||||
plot1d->DisableZoom(true);
|
||||
|
||||
// setup 2d plot
|
||||
plot2d = new SlsQt2DPlotLayout(boxPlot);
|
||||
@ -792,7 +793,7 @@ void qDrawPlot::Get1dData(double* rawData) {
|
||||
if (currentPersistency) {
|
||||
// allocate
|
||||
for(int i = datay1d.size(); i <= persistency; ++i) {
|
||||
datay1d[i] = new double [nPixelsX];
|
||||
datay1d.push_back(new double [nPixelsX]);
|
||||
SlsQtH1D* h = new SlsQtH1D("", nPixelsX, datax1d, datay1d[i]);
|
||||
h->SetLineColor(i);
|
||||
SetStyleandSymbol(h);
|
||||
|
@ -159,7 +159,7 @@ void qTabDeveloper::Initialization() {
|
||||
connect(comboHV, SIGNAL(currentIndexChanged(int)), this, SLOT(SetHighVoltage()));
|
||||
}
|
||||
if (spinHV != nullptr) {
|
||||
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
||||
connect(spinHV, SIGNAL(editingFinished()), this, SLOT(SetHighVoltage()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -271,8 +271,8 @@ void qTabDeveloper::CreateHVWidget() {
|
||||
// jungfrau, moench (range of values)
|
||||
else {
|
||||
spinHV = new QSpinBox(boxDacs);
|
||||
spinDacs[numDACWidgets]->setMinimum(-1);
|
||||
spinDacs[numDACWidgets]->setMaximum(HV_MAX);
|
||||
spinHV->setMinimum(-1);
|
||||
spinHV->setMaximum(HV_MAX);
|
||||
spinHV->setToolTip("<nobr>Set high voltage to 0 or 60 - 200V</nobr>");
|
||||
lblHV->setToolTip(spinHV->toolTip());
|
||||
dacLayout->addWidget(spinHV, (int)(numDACWidgets / 2), 2);
|
||||
@ -341,7 +341,7 @@ void qTabDeveloper::GetHighVoltage() {
|
||||
|
||||
FILE_LOG(logDEBUG) << "Getting High Voltage";
|
||||
if (spinHV != nullptr) {
|
||||
disconnect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
||||
disconnect(spinHV, SIGNAL(editingFinished()), this, SLOT(SetHighVoltage()));
|
||||
}
|
||||
if (comboHV != nullptr) {
|
||||
disconnect(comboHV, SIGNAL(currentIndexChanged(int)), this, SLOT(SetHighVoltage()));
|
||||
@ -391,7 +391,7 @@ void qTabDeveloper::GetHighVoltage() {
|
||||
} CATCH_DISPLAY ("Could not get high voltage.", "qTabDeveloper::GetHighVoltage")
|
||||
|
||||
if (spinHV != nullptr) {
|
||||
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
||||
connect(spinHV, SIGNAL(editingFinished()), this, SLOT(SetHighVoltage()));
|
||||
}
|
||||
if (comboHV != nullptr) {
|
||||
connect(comboHV, SIGNAL(currentIndexChanged(int)), this, SLOT(SetHighVoltage()));
|
||||
|
Binary file not shown.
Binary file not shown.
@ -1824,13 +1824,11 @@ void readFrame(int *ret, char *mess){
|
||||
}
|
||||
|
||||
// frames left to give status
|
||||
*ret = (int)OK;
|
||||
int64_t retval = getTimeLeft(FRAME_NUMBER) + 1;
|
||||
if ( retval > -1) {
|
||||
*ret = (int)FAIL;
|
||||
sprintf(mess,"No data and run stopped: %lld frames left\n",(long long int)retval);
|
||||
FILE_LOG(logERROR, (mess));
|
||||
FILE_LOG(logERROR, ("No data and run stopped: %lld frames left\n",(long long int)retval));
|
||||
} else {
|
||||
*ret = (int)OK;
|
||||
FILE_LOG(logINFOGREEN, ("Acquisition successfully finished\n"));
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
@ -1013,28 +1013,38 @@ void setNumberofUDPInterfaces(int val) {
|
||||
FILE_LOG(logINFOBLUE, ("Setting #Interfaces: 1\n"));
|
||||
bus_w(addr, bus_r(addr) &~ CONFIG_OPRTN_MDE_2_X_10GbE_MSK);
|
||||
}
|
||||
FILE_LOG(logINFO, ("config reg:0x%x\n", bus_r(addr)));
|
||||
}
|
||||
|
||||
int getNumberofUDPInterfaces() {
|
||||
FILE_LOG(logINFO, ("config reg:0x%x\n", bus_r(CONFIG_REG)));
|
||||
FILE_LOG(logINFO, ("config reg 2x10 :0x%x %d\n",
|
||||
CONFIG_OPRTN_MDE_2_X_10GbE_MSK,
|
||||
bus_r(CONFIG_REG)|CONFIG_OPRTN_MDE_2_X_10GbE_MSK));
|
||||
// return 2 if enabled, else 1
|
||||
return ((bus_r(CONFIG_REG) | CONFIG_OPRTN_MDE_2_X_10GbE_MSK) ? 2 : 1);
|
||||
|
||||
return ((bus_r(CONFIG_REG) & CONFIG_OPRTN_MDE_2_X_10GbE_MSK) ? 2 : 1);
|
||||
}
|
||||
|
||||
void selectPrimaryInterface(int val) {
|
||||
uint32_t addr = CONFIG_REG;
|
||||
|
||||
// inner (user input: 0)
|
||||
// outer (user input: 0)
|
||||
if (val == 0) {
|
||||
FILE_LOG(logINFOBLUE, ("Setting Primary Interface: 0 (Outer)\n"));
|
||||
bus_w(addr, bus_r(addr) &~ CONFIG_INNR_PRIMRY_INTRFCE_MSK);
|
||||
}
|
||||
// outer (user input: 1)
|
||||
// inner (user input: 1)
|
||||
else {
|
||||
FILE_LOG(logINFOBLUE, ("Setting Secondary Interface: 1 (Inner)\n"));
|
||||
bus_w(addr, bus_r(addr) | CONFIG_INNR_PRIMRY_INTRFCE_MSK);
|
||||
}
|
||||
}
|
||||
|
||||
int getPrimaryInterface() {
|
||||
return ((bus_r(CONFIG_REG) & CONFIG_INNR_PRIMRY_INTRFCE_MSK) ? 1 : 0);
|
||||
}
|
||||
|
||||
void setupHeader(int iRxEntry, enum interfaceType type, uint32_t destip, uint64_t destmac, uint32_t destport, uint64_t sourcemac, uint32_t sourceip, uint32_t sourceport) {
|
||||
|
||||
// start addr
|
||||
@ -1128,9 +1138,9 @@ int configureMAC(int numInterfaces, int selInterface,
|
||||
uint32_t sourceport = DEFAULT_TX_UDP_PORT;
|
||||
|
||||
FILE_LOG(logINFO, ("\t#Interfaces : %d\n", numInterfaces));
|
||||
FILE_LOG(logINFO, ("\tInterface : %d\n\n", selInterface));
|
||||
FILE_LOG(logINFO, ("\tInterface : %d %s\n\n", selInterface, (selInterface ? "Inner" : "Outer")));
|
||||
|
||||
FILE_LOG(logINFO, ("\tOuter %s\n", (numInterfaces == 2) ? "(Bottom)": ""));
|
||||
FILE_LOG(logINFO, ("\tOuter %s\n", (numInterfaces == 2) ? "(Bottom)": (selInterface ? "Not Used" : "Used")));
|
||||
FILE_LOG(logINFO, ("\tSource IP : %d.%d.%d.%d \t\t(0x%08x)\n",
|
||||
(sourceip>>24)&0xff,(sourceip>>16)&0xff,(sourceip>>8)&0xff,(sourceip)&0xff, sourceip));
|
||||
FILE_LOG(logINFO, ("\tSource MAC : %02x:%02x:%02x:%02x:%02x:%02x \t(0x%010llx)\n",
|
||||
@ -1156,7 +1166,7 @@ int configureMAC(int numInterfaces, int selInterface,
|
||||
FILE_LOG(logINFO, ("\tDest. Port : %d \t\t\t(0x%08x)\n\n",udpport, udpport));
|
||||
|
||||
uint32_t sourceport2 = DEFAULT_TX_UDP_PORT + 1;
|
||||
FILE_LOG(logINFO, ("\tInner %s\n", (numInterfaces == 2) ? "(Top)": "Not used"));
|
||||
FILE_LOG(logINFO, ("\tInner %s\n", (numInterfaces == 2) ? "(Top)": (selInterface ? "Used" : "Not Used")));
|
||||
FILE_LOG(logINFO, ("\tSource IP2 : %d.%d.%d.%d \t\t(0x%08x)\n",
|
||||
(sourceip2>>24)&0xff,(sourceip2>>16)&0xff,(sourceip2>>8)&0xff,(sourceip2)&0xff, sourceip2));
|
||||
FILE_LOG(logINFO, ("\tSource MAC2 : %02x:%02x:%02x:%02x:%02x:%02x \t(0x%010llx)\n",
|
||||
@ -1214,14 +1224,16 @@ int setDetectorPosition(int pos[]) {
|
||||
int ret = OK;
|
||||
int innerPos[2] = {pos[X], pos[Y]};
|
||||
int outerPos[2] = {pos[X], pos[Y]};
|
||||
int selInterface = getPrimaryInterface();
|
||||
int numInterfaces = getNumberofUDPInterfaces();
|
||||
|
||||
if (numInterfaces == 1) {
|
||||
FILE_LOG(logDEBUG1, ("Setting detector position: (%d, %d)\n", innerPos[X], innerPos[Y]));
|
||||
FILE_LOG(logDEBUG, ("Setting detector position: 1 Interface %s \n(%d, %d)\n",
|
||||
(selInterface ? "Inner" : "Outer"), innerPos[X], innerPos[Y]));
|
||||
}
|
||||
else {
|
||||
++outerPos[X];
|
||||
FILE_LOG(logDEBUG1, ("Setting detector position:\n"
|
||||
FILE_LOG(logDEBUG, ("Setting detector position: 2 Interfaces \n"
|
||||
" inner top(%d, %d), outer bottom(%d, %d)\n"
|
||||
, innerPos[X], innerPos[Y], outerPos[X], outerPos[Y]));
|
||||
}
|
||||
@ -1250,11 +1262,11 @@ int setDetectorPosition(int pos[]) {
|
||||
|
||||
if (ret == OK) {
|
||||
if (numInterfaces == 1) {
|
||||
FILE_LOG(logINFO, ("Position set to [%d, %d]\n", innerPos[X], innerPos[Y]));
|
||||
FILE_LOG(logINFOBLUE, ("Position set to [%d, %d]\n", innerPos[X], innerPos[Y]));
|
||||
}
|
||||
else {
|
||||
FILE_LOG(logINFO, (" Inner (top) position set to [%d, %d]\n", innerPos[X], innerPos[Y]));
|
||||
FILE_LOG(logINFO, (" Outer (bottom) position set to [%d, %d]\n", outerPos[X], outerPos[Y]));
|
||||
FILE_LOG(logINFOBLUE, (" Inner (top) position set to [%d, %d]\n", innerPos[X], innerPos[Y]));
|
||||
FILE_LOG(logINFOBLUE, (" Outer (bottom) position set to [%d, %d]\n", outerPos[X], outerPos[Y]));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@ -1784,14 +1796,13 @@ void readFrame(int *ret, char *mess){
|
||||
usleep(500);
|
||||
}
|
||||
|
||||
*ret = (int)OK;
|
||||
// frames left to give status
|
||||
int64_t retval = getTimeLeft(FRAME_NUMBER) + 1;
|
||||
|
||||
if ( retval > 0) {
|
||||
*ret = (int)FAIL;
|
||||
sprintf(mess,"No data and run stopped: %lld frames left\n",(long long int)retval);
|
||||
FILE_LOG(logERROR, (mess));
|
||||
FILE_LOG(logERROR, ("No data and run stopped: %lld frames left\n",(long long int)retval));
|
||||
} else {
|
||||
*ret = (int)OK;
|
||||
FILE_LOG(logINFOGREEN, ("Acquisition successfully finished\n"));
|
||||
}
|
||||
}
|
||||
|
@ -222,6 +222,7 @@ void calcChecksum(mac_conf* mac, int sourceip, int destip);
|
||||
void setNumberofUDPInterfaces(int val);
|
||||
int getNumberofUDPInterfaces();
|
||||
void selectPrimaryInterface(int val);
|
||||
int getPrimaryInterface();
|
||||
void setupHeader(int iRxEntry, enum interfaceType type, uint32_t destip, uint64_t destmac, uint32_t destport, uint64_t sourcemac, uint32_t sourceip, uint32_t sourceport);
|
||||
void calcChecksum(udp_header* udp);
|
||||
#endif
|
||||
|
@ -3464,9 +3464,12 @@ void multiSlsDetector::readFrameFromReceiver() {
|
||||
}
|
||||
|
||||
// free resources
|
||||
delete[] image;
|
||||
delete[] multiframe;
|
||||
delete[] multigappixels;
|
||||
if (image != nullptr)
|
||||
delete[] image;
|
||||
if (multiframe)
|
||||
delete[] multiframe;
|
||||
if (multigappixels)
|
||||
delete [] multigappixels;
|
||||
}
|
||||
|
||||
int multiSlsDetector::processImageWithGapPixels(char *image, char *&gpImage) {
|
||||
|
@ -1443,7 +1443,7 @@ int slsDetector::configureMAC() {
|
||||
// col for horiz. udp ports
|
||||
pos[1] = (detId / max) * ((shm()->myDetectorType == EIGER) ? 2 : 1);
|
||||
// pos[2] (z is reserved)
|
||||
FILE_LOG(logDEBUG1) << "Detector [" << detId << "] - (" << pos[0] << ","
|
||||
FILE_LOG(logDEBUG) << "Detector [" << detId << "] - (" << pos[0] << ","
|
||||
<< pos[1] << ")";
|
||||
snprintf(args[12], array_size, "%x", pos[0]);
|
||||
snprintf(args[13], array_size, "%x", pos[1]);
|
||||
|
@ -5,6 +5,6 @@
|
||||
#define APIRECEIVER 0x190604
|
||||
#define APIGUI 0x190405
|
||||
#define APICTB 0x190604
|
||||
#define APIJUNGFRAU 0x190604
|
||||
#define APIGOTTHARD 0x190604
|
||||
#define APIEIGER 0x190702
|
||||
#define APIEIGER 0x190712
|
||||
#define APIJUNGFRAU 0x190712
|
||||
#define APIGOTTHARD 0x190712
|
||||
|
Loading…
x
Reference in New Issue
Block a user