merge conflict resolved from 3.0.1

This commit is contained in:
Dhanya Maliakal
2017-11-17 09:40:42 +01:00
13 changed files with 263 additions and 87 deletions

View File

@ -65,9 +65,6 @@ qClient::~qClient() {
int qClient::executeLine(int narg, char *args[]){ int qClient::executeLine(int narg, char *args[]){
char arg[MAX_STR_LENGTH] = "";
int iarg = -1;
char answer[100];
string retval = ""; string retval = "";
string cmd = args[0]; string cmd = args[0];
string argument; string argument;

View File

@ -51,7 +51,7 @@
<enum>QTabWidget::North</enum> <enum>QTabWidget::North</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>3</number>
</property> </property>
<property name="elideMode"> <property name="elideMode">
<enum>Qt::ElideLeft</enum> <enum>Qt::ElideLeft</enum>
@ -142,7 +142,7 @@
<rect> <rect>
<x>230</x> <x>230</x>
<y>15</y> <y>15</y>
<width>226</width> <width>242</width>
<height>44</height> <height>44</height>
</rect> </rect>
</property> </property>
@ -957,8 +957,8 @@ An extension given by the modules serial number will be attached.
<widget class="QPushButton" name="btnRxr"> <widget class="QPushButton" name="btnRxr">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>25</x> <x>420</x>
<y>135</y> <y>143</y>
<width>291</width> <width>291</width>
<height>25</height> <height>25</height>
</rect> </rect>
@ -977,7 +977,7 @@ An extension given by the modules serial number will be attached.
<x>25</x> <x>25</x>
<y>25</y> <y>25</y>
<width>686</width> <width>686</width>
<height>96</height> <height>116</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_8"> <layout class="QGridLayout" name="gridLayout_8">
@ -1255,6 +1255,63 @@ An extension given by the modules serial number will be attached.
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0">
<widget class="QLabel" name="label_12">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>ZMQ Port TX:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="spinZmqPort2">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>127</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Sets Receiver UDP Port
#rx_udpport#</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string/>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>2000000000</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
@ -1264,13 +1321,42 @@ An extension given by the modules serial number will be attached.
<x>35</x> <x>35</x>
<y>15</y> <y>15</y>
<width>686</width> <width>686</width>
<height>101</height> <height>116</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_6"> <layout class="QGridLayout" name="gridLayout_6">
<property name="verticalSpacing"> <property name="verticalSpacing">
<number>6</number> <number>6</number>
</property> </property>
<item row="0" column="1">
<widget class="QComboBox" name="comboDetector">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="4"> <item row="0" column="4">
<widget class="QComboBox" name="comboOnline"> <widget class="QComboBox" name="comboOnline">
<property name="sizePolicy"> <property name="sizePolicy">
@ -1436,35 +1522,6 @@ An extension given by the modules serial number will be attached.
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1">
<widget class="QComboBox" name="comboDetector">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QSpinBox" name="spinControlPort"> <widget class="QSpinBox" name="spinControlPort">
<property name="sizePolicy"> <property name="sizePolicy">
@ -1531,6 +1588,63 @@ An extension given by the modules serial number will be attached.
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Sets Stop Port <string>Sets Stop Port
#stopport#</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string/>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>2000000000</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_11">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>ZMQ Port RX:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="spinZmqPort">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Sets Stop Port
#stopport#</string> #stopport#</string>
</property> </property>
<property name="statusTip"> <property name="statusTip">

View File

@ -119,11 +119,10 @@ private:
int id; int id;
/** Default Save file path */ /** Default Save file path */
string filePath; string filePath;
/** clone 2D Plot */
SlsQt2DPlotLayout* cloneplot2D;
/** clone 1D Plot */ /** clone 1D Plot */
SlsQt1DPlot* cloneplot1D; SlsQt1DPlot* cloneplot1D;
/** clone 2D Plot */
SlsQt2DPlotLayout* cloneplot2D;
/** vector of 1D hist values */ /** vector of 1D hist values */
QVector<SlsQtH1D*> cloneplot1D_hists; QVector<SlsQtH1D*> cloneplot1D_hists;

View File

@ -59,7 +59,8 @@ public:
// output anything that is left // output anything that is left
if (!m_string.empty()) { if (!m_string.empty()) {
pthread_mutex_lock(&mutex); pthread_mutex_lock(&mutex);
QApplication::postEvent(log_window, new qStreamEvent(m_string.c_str())); const char* c_string = m_string.c_str();
QApplication::postEvent(log_window, new qStreamEvent(c_string));
pthread_mutex_unlock(&mutex); pthread_mutex_unlock(&mutex);
} }
m_stream.rdbuf(m_old_buf); m_stream.rdbuf(m_old_buf);
@ -71,7 +72,8 @@ protected:
virtual int_type overflow(int_type v){ virtual int_type overflow(int_type v){
if (v == '\n'){ if (v == '\n'){
pthread_mutex_lock(&mutex); pthread_mutex_lock(&mutex);
QApplication::postEvent(log_window, new qStreamEvent(m_string.c_str())); const char* c_string = m_string.c_str();
QApplication::postEvent(log_window, new qStreamEvent(c_string));
m_string.erase(m_string.begin(), m_string.end()); m_string.erase(m_string.begin(), m_string.end());
pthread_mutex_unlock(&mutex); pthread_mutex_unlock(&mutex);
} }
@ -87,13 +89,14 @@ protected:
m_string.append(p, p + n); m_string.append(p, p + n);
//changed from uint because of 64 bit //changed from uint because of 64 bit
int pos = 0; size_t pos = 0;
while (pos != string::npos){ while (pos != string::npos){
pos = m_string.find('\n'); pos = m_string.find('\n');
if (pos != string::npos){ if (pos != string::npos){
string tmp(m_string.begin(), m_string.begin() + pos); string tmp(m_string.begin(), m_string.begin() + pos);
QApplication::postEvent(log_window, new qStreamEvent(tmp.c_str())); const char* c_tmp = tmp.c_str();
QApplication::postEvent(log_window, new qStreamEvent(c_tmp));
m_string.erase(m_string.begin(), m_string.begin() + pos + 1); m_string.erase(m_string.begin(), m_string.begin() + pos + 1);
} }
} }

View File

@ -430,7 +430,7 @@ unsigned int nPixelsX;
/** Number of angle Pixels in X Axis */ /** Number of angle Pixels in X Axis */
int nAnglePixelsX; int nAnglePixelsX;
/** Number of pixel bins in Y Axis */ /** Number of pixel bins in Y Axis */
int nPixelsY; unsigned int nPixelsY;
/** Min Pixel number for Y Axis*/ /** Min Pixel number for Y Axis*/
double minPixelsY; double minPixelsY;
/** Max Pixel number for Y Axis*/ /** Max Pixel number for Y Axis*/

View File

@ -133,6 +133,16 @@ private slots:
*/ */
void SetRxrUDPPort(int port); void SetRxrUDPPort(int port);
/** Sets client zmq receiver port
* @param port client zmq receiver port
*/
void SetCltZmqPort(int port);
/** Sets receiver zmq transmitting port
* @param port receiver zmq transmitting port
*/
void SetRxrZmqPort(int port);
/** Sets receiver online /** Sets receiver online
* @param index 1 for online and 0 for offline * @param index 1 for online and 0 for offline
*/ */

View File

@ -20,7 +20,7 @@
qCloneWidget::qCloneWidget(QWidget *parent,int id,QString title,QString xTitle, QString yTitle, QString zTitle, qCloneWidget::qCloneWidget(QWidget *parent,int id,QString title,QString xTitle, QString yTitle, QString zTitle,
int numDim,string FilePath,bool displayStats, QString min, QString max, QString sum): int numDim,string FilePath,bool displayStats, QString min, QString max, QString sum):
QMainWindow(parent),id(id),cloneplot2D(0),cloneplot1D(0),filePath(FilePath) QMainWindow(parent),id(id),filePath(FilePath),cloneplot1D(0),cloneplot2D(0)
{ {
// Window title // Window title
char winTitle[300],currTime[50]; char winTitle[300],currTime[50];
@ -267,12 +267,13 @@ void qCloneWidget::SavePlot(){
cloneBox->render(&painter); cloneBox->render(&painter);
fName = QFileDialog::getSaveFileName(this,tr("Save Snapshot "),fName,tr("PNG Files (*.png);;XPM Files(*.xpm);;JPEG Files(*.jpg)"),0,QFileDialog::ShowDirsOnly); fName = QFileDialog::getSaveFileName(this,tr("Save Snapshot "),fName,tr("PNG Files (*.png);;XPM Files(*.xpm);;JPEG Files(*.jpg)"),0,QFileDialog::ShowDirsOnly);
if (!fName.isEmpty()) if (!fName.isEmpty()) {
if((img.save(fName))) if((img.save(fName)))
qDefs::Message(qDefs::INFORMATION,"The SnapShot has been successfully saved","qCloneWidget::SavePlot"); qDefs::Message(qDefs::INFORMATION,"The SnapShot has been successfully saved","qCloneWidget::SavePlot");
else else
qDefs::Message(qDefs::WARNING,"Attempt to save snapshot failed.\n" qDefs::Message(qDefs::WARNING,"Attempt to save snapshot failed.\n"
"Formats: .png, .jpg, .xpm.","qCloneWidget::SavePlot"); "Formats: .png, .jpg, .xpm.","qCloneWidget::SavePlot");
}
} }

View File

@ -657,12 +657,12 @@ void qDetectorMain::ExecuteHelp(QAction *action){
cout << "About: Common GUI for Mythen, Eiger, Gotthard, Jungfrau, Moench and Propix detectors" << endl; cout << "About: Common GUI for Mythen, Eiger, Gotthard, Jungfrau, Moench and Propix detectors" << endl;
#endif #endif
char version[200]; char version[200];
int64_t retval= SVNREV; long long unsigned int retval= SVNREV;
retval= (retval <<32) | SVNDATE; retval= (retval <<32) | SVNDATE;
sprintf(version,"%llx",retval); sprintf(version,"%llx",retval);
string thisGUIVersion = string(version); string thisGUIVersion = string(version);
sprintf(version,"%llx",myDet->getId(slsDetectorDefs::THIS_SOFTWARE_VERSION)); sprintf(version,"%llx",(long long unsigned int)myDet->getId(slsDetectorDefs::THIS_SOFTWARE_VERSION));
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteHelp"); qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteHelp");
string thisClientVersion = string(version); string thisClientVersion = string(version);

View File

@ -297,7 +297,7 @@ void qDrawPlot::SetupWidgetWindow(){
nHists = 1; nHists = 1;
if(histXAxis) delete [] histXAxis; histXAxis = new double [nPixelsX]; if(histXAxis) delete [] histXAxis; histXAxis = new double [nPixelsX];
if(histYAxis[0]) delete [] histYAxis[0];histYAxis[0] = new double [nPixelsX]; if(histYAxis[0]) delete [] histYAxis[0];histYAxis[0] = new double [nPixelsX];
for(unsigned int px=0;px<(int)nPixelsX;px++) {histXAxis[px] = px;histYAxis[0][px] = 0;} for(unsigned int px=0;px<nPixelsX;px++) {histXAxis[px] = px;histYAxis[0][px] = 0;}
Clear1DPlot(); Clear1DPlot();
plot1D->SetXTitle("X Axis"); plot1D->SetXTitle("X Axis");
plot1D->SetYTitle("Y Axis"); plot1D->SetYTitle("Y Axis");
@ -349,8 +349,7 @@ void qDrawPlot::SetupWidgetWindow(){
//callbacks // callbacks
// Setting the callback function to get data from detector class // Setting the callback function to get data from detector class
myDet->registerDataCallback(&(GetDataCallBack),this); myDet->registerDataCallback(&(GetDataCallBack),this);
//Setting the callback function to alert when acquisition finished from detector class //Setting the callback function to alert when acquisition finished from detector class
@ -360,6 +359,13 @@ void qDrawPlot::SetupWidgetWindow(){
//Setting the callback function to get progress from detector class(using receivers) //Setting the callback function to get progress from detector class(using receivers)
myDet->registerProgressCallback(&(GetProgressCallBack),this); myDet->registerProgressCallback(&(GetProgressCallBack),this);
// if receiver, enable data streaming from receiver and client
if(myDet->setReceiverOnline() == slsDetectorDefs::ONLINE_FLAG) {
myDet->enableDataStreamingFromReceiver(1);
myDet->enableDataStreamingToClient(1);
}
qDefs::checkErrorMessage(myDet,"qDrawPlot::SetupWidgetWindow"); qDefs::checkErrorMessage(myDet,"qDrawPlot::SetupWidgetWindow");
} }
@ -561,7 +567,7 @@ void qDrawPlot::SetScanArgument(int scanArg){
//get #scansets for level 0 and level 1 //get #scansets for level 0 and level 1
int numScan0 = myDet->getScanSteps(0); numScan0 = ((numScan0==0)?1:numScan0); int numScan0 = myDet->getScanSteps(0); numScan0 = ((numScan0==0)?1:numScan0);
int numScan1 = myDet->getScanSteps(1); numScan1 = ((numScan1==0)?1:numScan1); int numScan1 = myDet->getScanSteps(1); numScan1 = ((numScan1==0)?1:numScan1);
int numPos=myDet->getPositions(); //int numPos=myDet->getPositions();
number_of_exposures = number_of_frames * numScan0 * numScan1; number_of_exposures = number_of_frames * numScan0 * numScan1;
if(anglePlot) number_of_exposures = numScan0 * numScan1;// * numPos; if(anglePlot) number_of_exposures = numScan0 * numScan1;// * numPos;
@ -615,9 +621,10 @@ void qDrawPlot::SetScanArgument(int scanArg){
if(gainImageArray) delete [] gainImageArray; gainImageArray = new double[nPixelsY*nPixelsX]; if(gainImageArray) delete [] gainImageArray; gainImageArray = new double[nPixelsY*nPixelsX];
//initializing 1d x axis //initializing 1d x axis
for(unsigned int px=0;px<(int)nPixelsX;px++) histXAxis[px] = px;/*+10;*/ for(unsigned int px=0;px<nPixelsX;px++) histXAxis[px] = px;/*+10;*/
//initializing 2d array //initializing 2d array
memset(lastImageArray,0,nPixelsY *nPixelsX * sizeof(double)); memset(lastImageArray,0,nPixelsY *nPixelsX * sizeof(double));
memset(gainImageArray,0,nPixelsY *nPixelsX * sizeof(double)); memset(gainImageArray,0,nPixelsY *nPixelsX * sizeof(double));
/*for(int py=0;py<(int)nPixelsY;py++) /*for(int py=0;py<(int)nPixelsY;py++)
@ -767,17 +774,15 @@ void qDrawPlot::SetupMeasurement(){
void* qDrawPlot::DataStartAcquireThread(void *this_pointer){ void* qDrawPlot::DataStartAcquireThread(void *this_pointer){
//stream data from receiver to the gui // stream data from receiver to the gui
if(((qDrawPlot*)this_pointer)->myDet->setReceiverOnline(slsDetectorDefs::GET_ONLINE_FLAG) == slsDetectorDefs::ONLINE_FLAG) { if(((qDrawPlot*)this_pointer)->myDet->setReceiverOnline() == slsDetectorDefs::ONLINE_FLAG) {
//if it was not on
if ( (((qDrawPlot*)this_pointer)->myDet->getStreamingSocketsCreatedInClient() != 1) // if receiver data up streaming not on, switch it on
|| (((qDrawPlot*)this_pointer)->myDet->enableDataStreamingFromReceiver(-1)!= 1) ){ if (((qDrawPlot*)this_pointer)->myDet->enableDataStreamingFromReceiver() != 1)
//switch it on, if error
if (((qDrawPlot*)this_pointer)->myDet->enableDataStreamingFromReceiver(1) != 1) { if (((qDrawPlot*)this_pointer)->myDet->enableDataStreamingFromReceiver(1) != 1) {
qDefs::checkErrorMessage(((qDrawPlot*)this_pointer)->myDet,"qDrawPlot::DataStartAcquireThread"); qDefs::checkErrorMessage(((qDrawPlot*)this_pointer)->myDet,"qDrawPlot::DataStartAcquireThread");
return this_pointer; return this_pointer;
} }
}
} }
((qDrawPlot*)this_pointer)->myDet->acquire(1); ((qDrawPlot*)this_pointer)->myDet->acquire(1);
@ -834,7 +839,7 @@ int qDrawPlot::GetData(detectorData *data,int fIndex, int subIndex){
sprintf(temp_title,"#%d %d",fIndex,subIndex); sprintf(temp_title,"#%d %d",fIndex,subIndex);
}else{ }else{
if(fileSaveEnable) strcpy(temp_title,"#%d"); if(fileSaveEnable) strcpy(temp_title,"#%d");
else sprintf(temp_title,"",currentFrame); else sprintf(temp_title,"#%d",currentFrame);
} }
if(subIndex != -1) if(subIndex != -1)
sprintf(temp_title,"#%d %d",fIndex,subIndex); sprintf(temp_title,"#%d %d",fIndex,subIndex);
@ -1713,12 +1718,13 @@ void qDrawPlot::SavePlot(){
fName = QFileDialog::getSaveFileName(0,tr("Save Image"),fName,tr("PNG Files (*.png);;XPM Files(*.xpm);;JPEG Files(*.jpg)"),0,QFileDialog::ShowDirsOnly); fName = QFileDialog::getSaveFileName(0,tr("Save Image"),fName,tr("PNG Files (*.png);;XPM Files(*.xpm);;JPEG Files(*.jpg)"),0,QFileDialog::ShowDirsOnly);
if (!fName.isEmpty()) if (!fName.isEmpty()) {
if(savedImage.save(fName)) if(savedImage.save(fName))
qDefs::Message(qDefs::INFORMATION,"The Image has been successfully saved","qDrawPlot::SavePlot"); qDefs::Message(qDefs::INFORMATION,"The Image has been successfully saved","qDrawPlot::SavePlot");
else else
qDefs::Message(qDefs::WARNING,"Attempt to save image failed.\n" qDefs::Message(qDefs::WARNING,"Attempt to save image failed.\n"
"Formats: .png, .jpg, .xpm.","qDrawPlot::SavePlot"); "Formats: .png, .jpg, .xpm.","qDrawPlot::SavePlot");
}
} }
@ -1816,7 +1822,7 @@ void qDrawPlot::DisableZoom(bool disable){
int qDrawPlot::UpdateTrimbitPlot(bool fromDetector,bool Histogram){ int qDrawPlot::UpdateTrimbitPlot(bool fromDetector,bool Histogram){
int ret,i,actualPixelsX; int ret,actualPixelsX;
double min=0,max=0,sum=0; double min=0,max=0,sum=0;
#ifdef VERBOSE #ifdef VERBOSE
if(fromDetector) cout << "Geting Trimbits from Detector" << endl; if(fromDetector) cout << "Geting Trimbits from Detector" << endl;
@ -1864,8 +1870,8 @@ int qDrawPlot::UpdateTrimbitPlot(bool fromDetector,bool Histogram){
if(histXAxis) delete [] histXAxis; histXAxis = new double [nPixelsX]; if(histXAxis) delete [] histXAxis; histXAxis = new double [nPixelsX];
if(histYAxis[0]) delete [] histYAxis[0]; histYAxis[0]= new double [nPixelsX]; if(histYAxis[0]) delete [] histYAxis[0]; histYAxis[0]= new double [nPixelsX];
//initializing //initializing
for(unsigned int px=0;px<(int)nPixelsX;px++) histXAxis[px] = px; for(unsigned int px=0;px<nPixelsX;px++) histXAxis[px] = px;
for(i=0;i<nPixelsX;i++) histYAxis[0][i] = 0; for(unsigned int i=0;i<nPixelsX;i++) histYAxis[0][i] = 0;
//data //data
memcpy(histYAxis[0],histTrimbits,nPixelsX*sizeof(double)); memcpy(histYAxis[0],histTrimbits,nPixelsX*sizeof(double));
@ -1896,14 +1902,14 @@ int qDrawPlot::UpdateTrimbitPlot(bool fromDetector,bool Histogram){
//create intervals //create intervals
histogramSamples.resize(TRIM_HISTOGRAM_XMAX+1); histogramSamples.resize(TRIM_HISTOGRAM_XMAX+1);
for(i=0; i<TRIM_HISTOGRAM_XMAX+1; i++){ for(unsigned int i=0; i<TRIM_HISTOGRAM_XMAX+1; i++){
histogramSamples[i].interval.setInterval(i,i+1); histogramSamples[i].interval.setInterval(i,i+1);
histogramSamples[i].value = 0; histogramSamples[i].value = 0;
} }
//fill histogram values //fill histogram values
int value = 0; int value = 0;
for(i=0;i<actualPixelsX;i++){ for(int i=0;i<actualPixelsX;i++){
if( (histTrimbits[i] <= TRIM_HISTOGRAM_XMAX) && (histTrimbits[i] >= 0)){//if(histogramSamples[j].interval.contains(data->values[i])) if( (histTrimbits[i] <= TRIM_HISTOGRAM_XMAX) && (histTrimbits[i] >= 0)){//if(histogramSamples[j].interval.contains(data->values[i]))
value = (int) histTrimbits[i]; value = (int) histTrimbits[i];
histogramSamples[value].value += 1; histogramSamples[value].value += 1;

View File

@ -77,6 +77,8 @@ void qTabAdvanced::SetupWidgetWindow(){
case slsDetectorDefs::MYTHEN: case slsDetectorDefs::MYTHEN:
isEnergy = true; isEnergy = true;
isAngular = true; isAngular = true;
spinZmqPort->setEnabled(false);
spinZmqPort2->setEnabled(false);
break; break;
case slsDetectorDefs::EIGER: case slsDetectorDefs::EIGER:
isEnergy = true; isEnergy = true;
@ -154,6 +156,8 @@ void qTabAdvanced::SetupWidgetWindow(){
spinStopPort->setValue(det->getStopPort()); spinStopPort->setValue(det->getStopPort());
spinTCPPort->setValue(det->getReceiverPort()); spinTCPPort->setValue(det->getReceiverPort());
spinUDPPort->setValue(atoi(det->getReceiverUDPPort().c_str())); spinUDPPort->setValue(atoi(det->getReceiverUDPPort().c_str()));
spinZmqPort->setValue(atoi(det->getClientStreamingPort().c_str()));
spinZmqPort2->setValue(atoi(det->getReceiverStreamingPort().c_str()));
cout << "Getting network information" << endl; cout << "Getting network information" << endl;
dispIP->setText(det->getDetectorIP().c_str()); dispIP->setText(det->getDetectorIP().c_str());
@ -260,12 +264,14 @@ void qTabAdvanced::Initialization(){
if((detType==slsDetectorDefs::GOTTHARD) || if((detType==slsDetectorDefs::GOTTHARD) ||
(detType==slsDetectorDefs::MOENCH) || (detType==slsDetectorDefs::MOENCH) ||
(detType==slsDetectorDefs::PROPIX) || (detType==slsDetectorDefs::PROPIX) ||
(detType==slsDetectorDefs::PROPIX) || (detType==slsDetectorDefs::JUNGFRAU) ||
(detType==slsDetectorDefs::JUNGFRAU)){ (detType==slsDetectorDefs::EIGER)){
//network //network
connect(spinTCPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrTCPPort(int))); connect(spinTCPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrTCPPort(int)));
connect(spinUDPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrUDPPort(int))); connect(spinUDPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrUDPPort(int)));
connect(spinZmqPort, SIGNAL(valueChanged(int)), this, SLOT(SetCltZmqPort(int)));
connect(spinZmqPort2, SIGNAL(valueChanged(int)), this, SLOT(SetRxrZmqPort(int)));
connect(comboRxrOnline, SIGNAL(currentIndexChanged(int)), this, SLOT(SetReceiverOnline(int))); connect(comboRxrOnline, SIGNAL(currentIndexChanged(int)), this, SLOT(SetReceiverOnline(int)));
connect(dispIP, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters())); connect(dispIP, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters()));
@ -721,6 +727,38 @@ void qTabAdvanced::SetRxrUDPPort(int port){
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabAdvanced::SetCltZmqPort(int port){
#ifdef VERBOSE
cout << "Setting Receiver UDP Port:" << port << endl;
#endif
ostringstream ss; ss << port; string sport = ss.str();
disconnect(spinZmqPort, SIGNAL(valueChanged(int)), this, SLOT(SetCltZmqPort(int)));
spinZmqPort->setValue(atoi(det->setClientStreamingPort(sport).c_str()));
qDefs::checkErrorMessage(det,"qTabAdvanced::SetCltZmqPort");
connect(spinZmqPort, SIGNAL(valueChanged(int)), this, SLOT(SetCltZmqPort(int)));
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabAdvanced::SetRxrZmqPort(int port){
#ifdef VERBOSE
cout << "Setting Receiver UDP Port:" << port << endl;
#endif
ostringstream ss; ss << port; string sport = ss.str();
disconnect(spinZmqPort2, SIGNAL(valueChanged(int)), this, SLOT(SetRxrZmqPort(int)));
spinZmqPort2->setValue(atoi(det->setReceiverStreamingPort(sport).c_str()));
qDefs::checkErrorMessage(det,"qTabAdvanced::SetRxrZmqPort");
connect(spinZmqPort2, SIGNAL(valueChanged(int)), this, SLOT(SetRxrZmqPort(int)));
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabAdvanced::SetReceiverOnline(int index){ void qTabAdvanced::SetReceiverOnline(int index){
#ifdef VERBOSE #ifdef VERBOSE
cout << "Setting Reciever Online to :" << index << endl; cout << "Setting Reciever Online to :" << index << endl;
@ -1061,6 +1099,8 @@ void qTabAdvanced::SetDetector(int index){
spinStopPort->setValue(det->getStopPort()); spinStopPort->setValue(det->getStopPort());
spinTCPPort->setValue(det->getReceiverPort()); spinTCPPort->setValue(det->getReceiverPort());
spinUDPPort->setValue(atoi(det->getReceiverUDPPort().c_str())); spinUDPPort->setValue(atoi(det->getReceiverUDPPort().c_str()));
spinZmqPort->setValue(atoi(det->getClientStreamingPort().c_str()));
spinZmqPort2->setValue(atoi(det->getReceiverStreamingPort().c_str()));
dispIP->setText(det->getDetectorIP().c_str()); dispIP->setText(det->getDetectorIP().c_str());
dispMAC->setText(det->getDetectorMAC().c_str()); dispMAC->setText(det->getDetectorMAC().c_str());
@ -1248,6 +1288,8 @@ void qTabAdvanced::Refresh(){
//disconnect //disconnect
disconnect(spinTCPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrTCPPort(int))); disconnect(spinTCPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrTCPPort(int)));
disconnect(spinUDPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrUDPPort(int))); disconnect(spinUDPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrUDPPort(int)));
disconnect(spinZmqPort, SIGNAL(valueChanged(int)), this, SLOT(SetCltZmqPort(int)));
disconnect(spinZmqPort2, SIGNAL(valueChanged(int)), this, SLOT(SetRxrZmqPort(int)));
disconnect(comboRxrOnline, SIGNAL(currentIndexChanged(int)), this, SLOT(SetReceiverOnline(int))); disconnect(comboRxrOnline, SIGNAL(currentIndexChanged(int)), this, SLOT(SetReceiverOnline(int)));
disconnect(dispIP, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters())); disconnect(dispIP, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters()));
disconnect(dispMAC, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters())); disconnect(dispMAC, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters()));
@ -1266,6 +1308,8 @@ void qTabAdvanced::Refresh(){
dispRxrHostname->setText(det->getReceiver().c_str()); dispRxrHostname->setText(det->getReceiver().c_str());
spinTCPPort->setValue(det->getReceiverPort()); spinTCPPort->setValue(det->getReceiverPort());
spinUDPPort->setValue(atoi(det->getReceiverUDPPort().c_str())); spinUDPPort->setValue(atoi(det->getReceiverUDPPort().c_str()));
spinZmqPort->setValue(atoi(det->getClientStreamingPort().c_str()));
spinZmqPort2->setValue(atoi(det->getReceiverStreamingPort().c_str()));
dispUDPIP->setText(det->getReceiverUDPIP().c_str()); dispUDPIP->setText(det->getReceiverUDPIP().c_str());
dispUDPMAC->setText(det->getReceiverUDPMAC().c_str()); dispUDPMAC->setText(det->getReceiverUDPMAC().c_str());
@ -1273,6 +1317,8 @@ void qTabAdvanced::Refresh(){
//connect //connect
connect(spinTCPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrTCPPort(int))); connect(spinTCPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrTCPPort(int)));
connect(spinUDPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrUDPPort(int))); connect(spinUDPPort, SIGNAL(valueChanged(int)), this, SLOT(SetRxrUDPPort(int)));
connect(spinZmqPort, SIGNAL(valueChanged(int)), this, SLOT(SetCltZmqPort(int)));
connect(spinZmqPort2, SIGNAL(valueChanged(int)), this, SLOT(SetRxrZmqPort(int)));
connect(comboRxrOnline, SIGNAL(currentIndexChanged(int)), this, SLOT(SetReceiverOnline(int))); connect(comboRxrOnline, SIGNAL(currentIndexChanged(int)), this, SLOT(SetReceiverOnline(int)));
connect(dispIP, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters())); connect(dispIP, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters()));
connect(dispMAC, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters())); connect(dispMAC, SIGNAL(editingFinished()), this, SLOT(SetNetworkParameters()));

View File

@ -404,11 +404,11 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){
det = myDet->getSlsDetector(i); det = myDet->getSlsDetector(i);
qDefs::checkErrorMessage(myDet,"qTabDebugging::SetParameters"); qDefs::checkErrorMessage(myDet,"qTabDebugging::SetParameters");
lblDetectorId->setText(comboDetector->itemText(i)); lblDetectorId->setText(comboDetector->itemText(i));
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER)); sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER));
lblDetectorSerial->setText(QString(value)); lblDetectorSerial->setText(QString(value));
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION)); sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION));
lblDetectorFirmware ->setText(QString(value)); lblDetectorFirmware ->setText(QString(value));
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION)); sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION));
lblDetectorSoftware->setText(QString(value)); lblDetectorSoftware->setText(QString(value));
qDefs::checkErrorMessage(det,"qTabDebugging::SetParameters"); qDefs::checkErrorMessage(det,"qTabDebugging::SetParameters");
@ -425,17 +425,17 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){
det = myDet->getSlsDetector(i); det = myDet->getSlsDetector(i);
qDefs::checkErrorMessage(myDet,"qTabDebugging::SetParameters"); qDefs::checkErrorMessage(myDet,"qTabDebugging::SetParameters");
lblDetectorId->setText(comboDetector->itemText(i)); lblDetectorId->setText(comboDetector->itemText(i));
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER)); sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER));
lblDetectorSerial->setText(QString(value)); lblDetectorSerial->setText(QString(value));
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION)); sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION));
lblDetectorFirmware ->setText(QString(value)); lblDetectorFirmware ->setText(QString(value));
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION)); sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION));
lblDetectorSoftware->setText(QString(value)); lblDetectorSoftware->setText(QString(value));
lblModuleId->setText(QString("%1").arg(im)); lblModuleId->setText(QString("%1").arg(im));
sprintf(value,"%llx",det->getId(slsDetectorDefs::MODULE_SERIAL_NUMBER,im)); sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::MODULE_SERIAL_NUMBER,im));
lblModuleSerial->setText(QString(value)); lblModuleSerial->setText(QString(value));
sprintf(value,"%llx",det->getId(slsDetectorDefs::MODULE_FIRMWARE_VERSION,im)); sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::MODULE_FIRMWARE_VERSION,im));
lblModuleFirmware->setText(QString(value)); lblModuleFirmware->setText(QString(value));
qDefs::checkErrorMessage(det,"qTabDebugging::SetParameters"); qDefs::checkErrorMessage(det,"qTabDebugging::SetParameters");
@ -457,11 +457,11 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){
det = myDet->getSlsDetector(i); det = myDet->getSlsDetector(i);
qDefs::checkErrorMessage(myDet,"qTabDebugging::SetParameters"); qDefs::checkErrorMessage(myDet,"qTabDebugging::SetParameters");
lblDetectorId->setText(comboDetector->itemText(i)); lblDetectorId->setText(comboDetector->itemText(i));
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER)); sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER));
lblDetectorSerial->setText(QString(value)); lblDetectorSerial->setText(QString(value));
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION)); sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION));
lblDetectorFirmware ->setText(QString(value)); lblDetectorFirmware ->setText(QString(value));
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION)); sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION));
lblDetectorSoftware->setText(QString(value)); lblDetectorSoftware->setText(QString(value));
qDefs::checkErrorMessage(det,"qTabDebugging::SetParameters"); qDefs::checkErrorMessage(det,"qTabDebugging::SetParameters");
@ -481,11 +481,11 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){
det = myDet->getSlsDetector(i); det = myDet->getSlsDetector(i);
qDefs::checkErrorMessage(myDet,"qTabDebugging::SetParameters"); qDefs::checkErrorMessage(myDet,"qTabDebugging::SetParameters");
lblDetectorId->setText(comboDetector->itemText(i)); lblDetectorId->setText(comboDetector->itemText(i));
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER)); sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER));
lblDetectorSerial->setText(QString(value)); lblDetectorSerial->setText(QString(value));
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION)); sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION));
lblDetectorFirmware ->setText(QString(value)); lblDetectorFirmware ->setText(QString(value));
sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION)); sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION));
lblDetectorSoftware->setText(QString(value)); lblDetectorSoftware->setText(QString(value));
qDefs::checkErrorMessage(det,"qTabDebugging::SetParameters"); qDefs::checkErrorMessage(det,"qTabDebugging::SetParameters");

View File

@ -734,7 +734,6 @@ void qTabMeasurement::SetTimingMode(int mode){
//Frame Period between exposures //Frame Period between exposures
qDefs::timeUnit unit;
if(lblPeriod->isEnabled()) if(lblPeriod->isEnabled())
CheckAcqPeriodGreaterThanExp(); CheckAcqPeriodGreaterThanExp();
else{ else{

View File

@ -69,11 +69,12 @@ void qTabSettings::GetDynamicRange(int setvalue){
cout << "Getting dynamic range" << endl; cout << "Getting dynamic range" << endl;
#endif #endif
int ret = myDet->setDynamicRange(-1); int ret = myDet->setDynamicRange(-1);
if(detType == slsDetectorDefs::MYTHEN) if(detType == slsDetectorDefs::MYTHEN) {
if(ret==24) if(ret==24)
ret=32; ret=32;
else if(ret==24) else if(ret==24)
cout<<"ret:"<<ret<<endl; cout<<"ret:"<<ret<<endl;
}
//check if the set value is equal to return value //check if the set value is equal to return value
if((setvalue!=-1) && (setvalue!=ret)){ if((setvalue!=-1) && (setvalue!=ret)){
qDefs::Message(qDefs::WARNING,"Dynamic Range cannot be set to this value.","qTabSettings::SetDynamicRange"); qDefs::Message(qDefs::WARNING,"Dynamic Range cannot be set to this value.","qTabSettings::SetDynamicRange");