Merge branch '3.0.1' into developer

This commit is contained in:
Dhanya Maliakal 2017-11-13 15:32:47 +01:00
commit 8872f86e31
7 changed files with 35 additions and 92 deletions

View File

@ -57,7 +57,7 @@
<number>6</number>
</property>
<item row="3" column="0">
<widget class="QCheckBox" name="chkTenGiga">
<widget class="QCheckBox" name="chkUnused">
<property name="enabled">
<bool>false</bool>
</property>
@ -69,21 +69,7 @@ Compression using Root. Available only for Gotthard in Expert Mode.
&lt;/nobr&gt;</string>
</property>
<property name="text">
<string>10GbE</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="chkCompression">
<property name="toolTip">
<string>&lt;nobr&gt;
Compression using Root. Available only for Gotthard in Expert Mode.
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
#r_compression#
&lt;/nobr&gt;</string>
</property>
<property name="text">
<string>Compression</string>
<string>Unused</string>
</property>
</widget>
</item>
@ -104,6 +90,23 @@ Compression using Root. Available only for Gotthard in Expert Mode.
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="chkTenGiga">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Compression using Root. Available only for Gotthard in Expert Mode.
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
#r_compression#
&lt;/nobr&gt;</string>
</property>
<property name="text">
<string>10GbE</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="gridLayoutWidget_2">

View File

@ -45,12 +45,6 @@ public:
*/
int VerifyOutputDirectory();
/** To enable expert mode
* @param enable to enable if true
*/
void SetExpertMode(bool enable);
private:
/** The sls detector object */
multiSlsDetector *myDet;
@ -86,9 +80,6 @@ private:
*/
void PopulateDetectors();
/** Get Compression */
void GetCompression();
/** update speed */
void UpdateSpeedFromServer();
@ -140,9 +131,6 @@ void SetOutputDir();
/** set output directory*/
void GetOutputDir();
/** set compression */
void SetCompression(bool enable);
/** enable 10GbE */
void EnableTenGigabitEthernet(bool enable, int get=0);

View File

@ -68,7 +68,7 @@ public:
SlsQt2DPlot(QWidget * = NULL);
// SlsQt2DHist *GetHistogram(){ return hist; }
void UnZoom();
void UnZoom(bool replot=true);
void SetZoom(double xmin,double ymin,double x_width,double y_width);

View File

@ -164,13 +164,13 @@ void SlsQt2DPlot::SetupZoom(){
//replot();
}*/
void SlsQt2DPlot::UnZoom(){
void SlsQt2DPlot::UnZoom(bool replot){
#if QWT_VERSION<0x060000
zoomer->setZoomBase(QwtDoubleRect(hist->GetXMin(),hist->GetYMin(),hist->GetXMax()-hist->GetXMin(),hist->GetYMax()-hist->GetYMin()));
#else
zoomer->setZoomBase(QRectF(hist->GetXMin(),hist->GetYMin(),hist->GetXMax()-hist->GetXMin(),hist->GetYMax()-hist->GetYMin()));
#endif
zoomer->setZoomBase();//Call replot for the attached plot before initializing the zoomer with its scales.
zoomer->setZoomBase(replot);//Call replot for the attached plot before initializing the zoomer with its scales.
// zoomer->zoom(0);
}

View File

@ -417,7 +417,6 @@ void qDetectorMain::EnableModes(QAction *action){
actionSaveCalibration->setVisible(enable);
tab_measurement->SetExpertMode(enable);
tab_settings->SetExpertMode(enable);
tab_dataoutput->SetExpertMode(enable);
#ifdef VERBOSE
cout << "Setting Expert Mode to " << enable << endl;
#endif

View File

@ -513,7 +513,10 @@ bool qDrawPlot::StartOrStopThread(bool start){
plot2D->GetPlot()->SetXMinMax(-0.5,nPixelsX+0.5);
plot2D->GetPlot()->SetYMinMax(startPixel,endPixel);
plot2D->GetPlot()->SetZoom(-0.5,startPixel,nPixelsX,endPixel-startPixel);
plot2D->GetPlot()->UnZoom();
if (boxPlot->title() == "Sample Plot")
plot2D->GetPlot()->UnZoom();
else
plot2D->GetPlot()->UnZoom(false);
/*XYRangeChanged = true;*/
boxPlot->setTitle("Old_Plot.raw");
@ -901,13 +904,13 @@ int qDrawPlot::GetData(detectorData *data,int fIndex, int subIndex){
memcpy(histYAngleAxis,data->values,nAnglePixelsX*sizeof(double));
SetHistXAxisTitle("Angles");
}
plotRequired = true;
UnlockLastImageArray();
currentFrame++;
#ifdef VERYVERBOSE
cout << "Exiting GetData Function " << endl;
#endif
emit UpdatePlotSignal();
plotRequired = true;
return 0;
}
@ -961,11 +964,11 @@ int qDrawPlot::GetData(detectorData *data,int fIndex, int subIndex){
imageTitle = temp_title;
//copy data
memcpy(lastImageArray+(currentScanDivLevel*nPixelsX),data->values,nPixelsX*sizeof(double));
plotRequired = true;
UnlockLastImageArray();
currentFrame++;
currentScanDivLevel++;
emit UpdatePlotSignal();
plotRequired = true;
return 0;
}
//file index
@ -980,11 +983,11 @@ int qDrawPlot::GetData(detectorData *data,int fIndex, int subIndex){
imageTitle = temp_title;
//copy data
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
plotRequired = true;
UnlockLastImageArray();
currentFrame++;
currentScanDivLevel++;
emit UpdatePlotSignal();
plotRequired = true;
return 0;
}
//level0
@ -1006,10 +1009,10 @@ int qDrawPlot::GetData(detectorData *data,int fIndex, int subIndex){
imageTitle = temp_title;
//copy data
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
plotRequired = true;
UnlockLastImageArray();
currentFrame++;
emit UpdatePlotSignal();
plotRequired = true;
return 0;
}
//level1
@ -1031,10 +1034,10 @@ int qDrawPlot::GetData(detectorData *data,int fIndex, int subIndex){
imageTitle = temp_title;
//copy data
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
plotRequired = true;
UnlockLastImageArray();
currentFrame++;
emit UpdatePlotSignal();
plotRequired = true;
return 0;
}
@ -1233,14 +1236,14 @@ int qDrawPlot::GetData(detectorData *data,int fIndex, int subIndex){
}
/* pthread_mutex_unlock(&(last_image_complete_mutex));
}*/
plotRequired = true;
UnlockLastImageArray();
#ifdef VERYVERBOSE
cprintf(BLUE,"currentframe:%d \tcurrentframeindex:%d\n",currentFrame,currentFrameIndex);
#endif
emit UpdatePlotSignal();
plotRequired = true;
currentFrame++;
emit UpdatePlotSignal();
}

View File

@ -80,8 +80,8 @@ void qTabDataOutput::SetupWidgetWindow(){
outDirTip = lblOutputDir->toolTip();
//expert mode is not enabled initially
chkCompression->setEnabled(false);
//not used at all, later used for gappixels
chkUnused->setEnabled(false);
//enabling file format depending on detector type
SetupFileFormat();
@ -167,8 +167,6 @@ void qTabDataOutput::Initialization(){
connect(chkAngular, SIGNAL(toggled(bool)), this, SLOT(SetAngularCorrection()));
//discard bad channels
connect(chkDiscardBad, SIGNAL(toggled(bool)), this, SLOT(DiscardBadChannels()));
//compression
connect(chkCompression, SIGNAL(toggled(bool)), this, SLOT(SetCompression(bool)));
//10GbE
connect(chkTenGiga, SIGNAL(toggled(bool)), this, SLOT(EnableTenGigabitEthernet(bool)));
@ -186,18 +184,6 @@ void qTabDataOutput::Initialization(){
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabDataOutput::SetExpertMode(bool enable){
if((detType == slsDetectorDefs::GOTTHARD) || (detType == slsDetectorDefs::MOENCH)){
chkCompression->setEnabled(enable);
GetCompression();
}
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabDataOutput::BrowseOutputDir()
{
QString directory = QFileDialog::getExistingDirectory(this,tr("Choose Output Directory "),dispOutputDir->text());
@ -737,34 +723,6 @@ void qTabDataOutput::SetOutputDir(){
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabDataOutput::GetCompression(){
disconnect(chkCompression, SIGNAL(toggled(bool)), this, SLOT(SetCompression(bool)));
int ret = myDet->enableReceiverCompression();
if(ret > 0) chkCompression->setChecked(true);
else chkCompression->setChecked(false);
connect(chkCompression, SIGNAL(toggled(bool)), this, SLOT(SetCompression(bool)));
qDefs::checkErrorMessage(myDet,"qTabDataOutput::GetCompression");
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabDataOutput::SetCompression(bool enable){
disconnect(chkCompression, SIGNAL(toggled(bool)), this, SLOT(SetCompression(bool)));
int ret = myDet->enableReceiverCompression(enable);
if(ret > 0) chkCompression->setChecked(true);
else chkCompression->setChecked(false);
connect(chkCompression, SIGNAL(toggled(bool)), this, SLOT(SetCompression(bool)));
qDefs::checkErrorMessage(myDet,"qTabDataOutput::SetCompression");
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabDataOutput::EnableTenGigabitEthernet(bool enable,int get){
#ifdef VERBOSE
cout << endl << "Enabling/Disabling 10GbE" << endl;
@ -1102,14 +1060,6 @@ void qTabDataOutput::Refresh(){
btnOutputBrowse->setToolTip(dispOutputDir->toolTip());
}
//getting compression
if(chkCompression->isEnabled()){
#ifdef VERBOSE
cout << "Getting compression" << endl;
#endif
GetCompression();
}
//getting 10GbE
if(chkTenGiga->isEnabled()){
#ifdef VERBOSE