enhancement: logy with arrow buttons

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@94 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d 2012-10-12 14:12:20 +00:00
parent 353e9baa78
commit 863662a5eb
7 changed files with 274 additions and 140 deletions

View File

@ -92,9 +92,9 @@
<widget class="QWidget" name="gridLayoutWidget_5"> <widget class="QWidget" name="gridLayoutWidget_5">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>8</x>
<y>20</y> <y>20</y>
<width>361</width> <width>358</width>
<height>26</height> <height>26</height>
</rect> </rect>
</property> </property>
@ -191,149 +191,258 @@
<property name="flat"> <property name="flat">
<bool>false</bool> <bool>false</bool>
</property> </property>
<widget class="QWidget" name="gridLayoutWidget_3"> <widget class="QStackedWidget" name="stackedWidget">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>4</x>
<y>20</y> <y>15</y>
<width>361</width> <width>366</width>
<height>26</height> <height>31</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <property name="currentIndex">
<property name="horizontalSpacing"> <number>0</number>
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QCheckBox" name="chkSuperimpose">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Superimpose</string>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QCheckBox" name="chkPoints">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Points</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>140</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="4">
<widget class="QCheckBox" name="chkLines">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Lines</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget_2">
<property name="geometry">
<rect>
<x>120</x>
<y>21</y>
<width>121</width>
<height>23</height>
</rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <widget class="QWidget" name="page">
<property name="spacing"> <widget class="QWidget" name="gridLayoutWidget_2">
<number>1</number> <property name="geometry">
</property> <rect>
<item> <x>5</x>
<widget class="QLabel" name="lblPersistency"> <y>4</y>
<property name="enabled"> <width>107</width>
<bool>false</bool> <height>26</height>
</property> </rect>
<property name="sizePolicy"> </property>
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <layout class="QGridLayout" name="gridLayout_2">
<horstretch>0</horstretch> <item row="0" column="0">
<verstretch>0</verstretch> <widget class="QCheckBox" name="chkSuperimpose">
</sizepolicy> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<property name="text"> <horstretch>0</horstretch>
<string>Persistency:</string> <verstretch>0</verstretch>
</property> </sizepolicy>
</widget> </property>
</item> <property name="text">
<item> <string>Superimpose</string>
<widget class="QSpinBox" name="spinPersistency"> </property>
<property name="enabled"> <property name="tristate">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="sizePolicy"> </widget>
<sizepolicy hsizetype="Minimum" vsizetype="Maximum"> </item>
<horstretch>0</horstretch> </layout>
<verstretch>0</verstretch> </widget>
</sizepolicy> <widget class="QWidget" name="horizontalLayoutWidget_2">
</property> <property name="geometry">
<property name="maximumSize"> <rect>
<size> <x>210</x>
<width>40</width> <y>5</y>
<height>16777215</height> <width>128</width>
</size> <height>23</height>
</property> </rect>
<property name="alignment"> </property>
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <layout class="QHBoxLayout" name="horizontalLayout">
</property> <property name="spacing">
<property name="minimum">
<number>1</number> <number>1</number>
</property> </property>
<property name="maximum"> <item>
<number>10</number> <widget class="QLabel" name="lblPersistency">
</property> <property name="enabled">
<property name="value"> <bool>false</bool>
<number>1</number> </property>
</property> <property name="sizePolicy">
</widget> <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
</item> <horstretch>0</horstretch>
</layout> <verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Persistency:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinPersistency">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>10</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QPushButton" name="btnRight">
<property name="geometry">
<rect>
<x>345</x>
<y>0</y>
<width>16</width>
<height>16</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/rightArrow.png</normaloff>:/icons/images/rightArrow.png</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</widget>
<widget class="QWidget" name="page_2">
<widget class="QWidget" name="gridLayoutWidget_8">
<property name="geometry">
<rect>
<x>5</x>
<y>5</y>
<width>336</width>
<height>26</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_10">
<item row="0" column="0">
<widget class="QCheckBox" name="chk1DLog">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Log Scale (Y)</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_20">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>95</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="chkPoints">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Points</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QCheckBox" name="chkLines">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Lines</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QPushButton" name="btnLeft">
<property name="geometry">
<rect>
<x>345</x>
<y>0</y>
<width>16</width>
<height>16</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/leftArrow.png</normaloff>:/icons/images/leftArrow.png</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</widget>
</widget> </widget>
</widget> </widget>
<widget class="QGroupBox" name="boxSave"> <widget class="QGroupBox" name="boxSave">
@ -1001,7 +1110,7 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>20</y> <y>20</y>
<width>361</width> <width>358</width>
<height>26</height> <height>26</height>
</rect> </rect>
</property> </property>

View File

@ -13,5 +13,7 @@
<file>../images/erase.png</file> <file>../images/erase.png</file>
<file>../images/remove.png</file> <file>../images/remove.png</file>
<file>../images/stop.png</file> <file>../images/stop.png</file>
<file>../images/leftArrow.png</file>
<file>../images/rightArrow.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -459,6 +459,7 @@ void UpdatingPlotFinished();
void InterpolateSignal(bool); void InterpolateSignal(bool);
void ContourSignal(bool); void ContourSignal(bool);
void LogzSignal(bool); void LogzSignal(bool);
void LogySignal(bool);
void SetZRangeSignal(double,double); void SetZRangeSignal(double,double);
void EnableZRangeSignal(bool); void EnableZRangeSignal(bool);
void SetCurrentMeasurementSignal(int); void SetCurrentMeasurementSignal(int);

View File

@ -140,6 +140,8 @@ private slots:
/** Set Plot to none, data graph, histogram*/ /** Set Plot to none, data graph, histogram*/
void SetPlot(); void SetPlot();
/** Change pages in 1D box*/
void Set1DPage();
signals: signals:

View File

@ -158,7 +158,7 @@ class SlsQt1DPlot:public QwtPlot{
void Update(); void Update();
void SetLogX(bool yes=1); void SetLogX(bool yes=1);
void SetLogY(bool yes=1); void SetLogY(bool yes=1);
protected: protected:

View File

@ -205,6 +205,7 @@ void qDrawPlot::Initialization(){
connect(this, SIGNAL(InterpolateSignal(bool)),plot2D, SIGNAL(InterpolateSignal(bool))); connect(this, SIGNAL(InterpolateSignal(bool)),plot2D, SIGNAL(InterpolateSignal(bool)));
connect(this, SIGNAL(ContourSignal(bool)), plot2D, SIGNAL(ContourSignal(bool))); connect(this, SIGNAL(ContourSignal(bool)), plot2D, SIGNAL(ContourSignal(bool)));
connect(this, SIGNAL(LogzSignal(bool)), plot2D, SLOT(SetZScaleToLog(bool))); connect(this, SIGNAL(LogzSignal(bool)), plot2D, SLOT(SetZScaleToLog(bool)));
connect(this, SIGNAL(LogySignal(bool)), plot1D, SLOT(SetLogY(bool)));
connect(this, SIGNAL(EnableZRangeSignal(bool)),plot2D, SLOT(EnableZRange(bool))); connect(this, SIGNAL(EnableZRangeSignal(bool)),plot2D, SLOT(EnableZRange(bool)));
connect(this, SIGNAL(SetZRangeSignal(double,double)), plot2D, SLOT(SetZRange(double,double))); connect(this, SIGNAL(SetZRangeSignal(double,double)), plot2D, SLOT(SetZRange(double,double)));
@ -753,7 +754,9 @@ int qDrawPlot::GetData(detectorData *data){
} }
pthread_mutex_unlock(&(last_image_complete_mutex)); pthread_mutex_unlock(&(last_image_complete_mutex));
} }
#ifdef VERYVERBOSE
cout<<"currentframe:"<<currentFrame<<"\tcurrentfileIndex:"<<currentFileIndex<<endl; cout<<"currentframe:"<<currentFrame<<"\tcurrentfileIndex:"<<currentFileIndex<<endl;
#endif
currentFrame++; currentFrame++;
} }
#ifdef VERYVERBOSE #ifdef VERYVERBOSE
@ -1074,6 +1077,7 @@ void qDrawPlot::ClonePlot(){
connect(this, SIGNAL(InterpolateSignal(bool)), plot2D, SIGNAL(InterpolateSignal(bool))); connect(this, SIGNAL(InterpolateSignal(bool)), plot2D, SIGNAL(InterpolateSignal(bool)));
connect(this, SIGNAL(ContourSignal(bool)), plot2D, SIGNAL(ContourSignal(bool))); connect(this, SIGNAL(ContourSignal(bool)), plot2D, SIGNAL(ContourSignal(bool)));
connect(this, SIGNAL(LogzSignal(bool)), plot2D, SLOT(SetZScaleToLog(bool))); connect(this, SIGNAL(LogzSignal(bool)), plot2D, SLOT(SetZScaleToLog(bool)));
connect(this, SIGNAL(LogySignal(bool)), plot1D, SLOT(SetLogY(bool)));
winClone[i]->show(); winClone[i]->show();
// to remember which all clone widgets were closed // to remember which all clone widgets were closed

View File

@ -154,6 +154,18 @@ void qTabPlot::SetupWidgetWindow(){
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabPlot::Set1DPage(){
QPushButton *clickedButton = qobject_cast<QPushButton *>(sender());
if(clickedButton->icon().pixmap(QSize(16,16)).toImage()==btnLeft->icon().pixmap(QSize(16,16)).toImage())
stackedWidget->setCurrentIndex(0);
else
stackedWidget->setCurrentIndex(1);
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabPlot::Select1DPlot(bool b){ void qTabPlot::Select1DPlot(bool b){
isOneD = b; isOneD = b;
if(b){ if(b){
@ -192,6 +204,10 @@ void qTabPlot::Initialization(){
connect(spinPersistency,SIGNAL(valueChanged(int)), myPlot,SLOT(SetPersistency(int))); connect(spinPersistency,SIGNAL(valueChanged(int)), myPlot,SLOT(SetPersistency(int)));
connect(chkPoints, SIGNAL(toggled(bool)), myPlot, SLOT(SetMarkers(bool))); connect(chkPoints, SIGNAL(toggled(bool)), myPlot, SLOT(SetMarkers(bool)));
connect(chkLines, SIGNAL(toggled(bool)), myPlot, SLOT(SetLines(bool))); connect(chkLines, SIGNAL(toggled(bool)), myPlot, SLOT(SetLines(bool)));
connect(chk1DLog, SIGNAL(toggled(bool)), myPlot, SIGNAL(LogySignal(bool)));
//to change pages
connect(btnLeft, SIGNAL(clicked()), this, SLOT(Set1DPage()));
connect(btnRight, SIGNAL(clicked()), this, SLOT(Set1DPage()));
// 2D Plot box // 2D Plot box
connect(chkInterpolate, SIGNAL(toggled(bool)),myPlot, SIGNAL(InterpolateSignal(bool))); connect(chkInterpolate, SIGNAL(toggled(bool)),myPlot, SIGNAL(InterpolateSignal(bool)));
connect(chkContour, SIGNAL(toggled(bool)),myPlot, SIGNAL(ContourSignal(bool))); connect(chkContour, SIGNAL(toggled(bool)),myPlot, SIGNAL(ContourSignal(bool)));