mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 18:10:40 +02:00
no plot histogram, messages work
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@16 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
parent
ec0878d008
commit
81ac62dd49
@ -159,43 +159,6 @@
|
|||||||
<height>524287</height>
|
<height>524287</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="palette">
|
|
||||||
<palette>
|
|
||||||
<active>
|
|
||||||
<colorrole role="WindowText">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>0</red>
|
|
||||||
<green>0</green>
|
|
||||||
<blue>0</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
</active>
|
|
||||||
<inactive>
|
|
||||||
<colorrole role="WindowText">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>0</red>
|
|
||||||
<green>0</green>
|
|
||||||
<blue>0</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
</inactive>
|
|
||||||
<disabled>
|
|
||||||
<colorrole role="WindowText">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>119</red>
|
|
||||||
<green>119</green>
|
|
||||||
<blue>119</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
</disabled>
|
|
||||||
</palette>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<family>Sans Serif</family>
|
<family>Sans Serif</family>
|
||||||
@ -220,6 +183,9 @@ p, li { white-space: pre-wrap; }
|
|||||||
<property name="statusTip">
|
<property name="statusTip">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="layoutDirection">
|
||||||
|
<enum>Qt::LeftToRight</enum>
|
||||||
|
</property>
|
||||||
<property name="features">
|
<property name="features">
|
||||||
<set>QDockWidget::NoDockWidgetFeatures</set>
|
<set>QDockWidget::NoDockWidgetFeatures</set>
|
||||||
</property>
|
</property>
|
||||||
|
@ -411,9 +411,9 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>315</x>
|
<x>430</x>
|
||||||
<y>70</y>
|
<y>70</y>
|
||||||
<width>446</width>
|
<width>331</width>
|
||||||
<height>51</height>
|
<height>51</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -431,7 +431,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>20</y>
|
<y>20</y>
|
||||||
<width>496</width>
|
<width>321</width>
|
||||||
<height>22</height>
|
<height>22</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -449,7 +449,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="2">
|
||||||
<widget class="QCheckBox" name="chkContour">
|
<widget class="QCheckBox" name="chkContour">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
@ -462,7 +462,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item row="0" column="4">
|
||||||
<widget class="QCheckBox" name="chkLogz">
|
<widget class="QCheckBox" name="chkLogz">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
@ -475,8 +475,8 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="3">
|
<item row="0" column="1">
|
||||||
<spacer name="horizontalSpacer_3">
|
<spacer name="horizontalSpacer_15">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -485,7 +485,23 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>180</width>
|
<width>10</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3">
|
||||||
|
<spacer name="horizontalSpacer_16">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>10</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@ -497,9 +513,9 @@
|
|||||||
<widget class="QGroupBox" name="box1D">
|
<widget class="QGroupBox" name="box1D">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>315</x>
|
<x>10</x>
|
||||||
<y>10</y>
|
<y>70</y>
|
||||||
<width>446</width>
|
<width>391</width>
|
||||||
<height>51</height>
|
<height>51</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -517,13 +533,19 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>20</y>
|
<y>20</y>
|
||||||
<width>254</width>
|
<width>376</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QCheckBox" name="chkSuperimpose">
|
<widget class="QCheckBox" name="chkSuperimpose">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Superimpose</string>
|
<string>Superimpose</string>
|
||||||
</property>
|
</property>
|
||||||
@ -532,16 +554,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
|
||||||
<widget class="QLabel" name="lblPersistency">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Persistency:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<spacer name="horizontalSpacer_4">
|
<spacer name="horizontalSpacer_4">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -558,77 +570,111 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="3">
|
<item row="0" column="5">
|
||||||
<widget class="QSpinBox" name="spinPersistency">
|
<widget class="QCheckBox" name="checkBox">
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="text">
|
||||||
<size>
|
<string>Line</string>
|
||||||
<width>60</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="6">
|
||||||
|
<widget class="QCheckBox" name="checkBox_2">
|
||||||
|
<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="4">
|
||||||
|
<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>10</width>
|
||||||
|
<height>10</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lblPersistency">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<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>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPushButton" name="btnClear">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>395</x>
|
|
||||||
<y>15</y>
|
|
||||||
<width>40</width>
|
|
||||||
<height>28</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::NoFocus</enum>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Clear</string>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QGroupBox" name="boxSave">
|
<widget class="QGroupBox" name="boxSave">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>135</y>
|
<y>135</y>
|
||||||
<width>751</width>
|
<width>391</width>
|
||||||
<height>51</height>
|
<height>51</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -646,69 +692,11 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>15</y>
|
<y>15</y>
|
||||||
<width>741</width>
|
<width>382</width>
|
||||||
<height>31</height>
|
<height>31</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="layoutSave">
|
<layout class="QHBoxLayout" name="layoutSave">
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="lblFName">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>File Name:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="hLayoutSave">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="dispFName">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>250</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="comboFormat">
|
|
||||||
<property name="frame">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>.png</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>.jpg</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>.xpm</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btnSave">
|
<widget class="QPushButton" name="btnSave">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -748,6 +736,22 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_11">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="chkSaveAll">
|
<widget class="QCheckBox" name="chkSaveAll">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -758,15 +762,15 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<widget class="QGroupBox" name="boxSnapshot">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>430</x>
|
||||||
<y>70</y>
|
<y>135</y>
|
||||||
<width>261</width>
|
<width>331</width>
|
||||||
<height>51</height>
|
<height>51</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -782,10 +786,10 @@
|
|||||||
<widget class="QWidget" name="gridLayoutWidget_4">
|
<widget class="QWidget" name="gridLayoutWidget_4">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>5</x>
|
<x>10</x>
|
||||||
<y>21</y>
|
<y>15</y>
|
||||||
<width>251</width>
|
<width>311</width>
|
||||||
<height>21</height>
|
<height>31</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_4">
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
@ -804,11 +808,11 @@
|
|||||||
<string>Create</string>
|
<string>Create</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="flat">
|
<property name="flat">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="2">
|
||||||
<widget class="QPushButton" name="btnCloseClones">
|
<widget class="QPushButton" name="btnCloseClones">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
@ -823,11 +827,11 @@
|
|||||||
<string>Close All</string>
|
<string>Close All</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="flat">
|
<property name="flat">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item row="0" column="4">
|
||||||
<widget class="QPushButton" name="btnSaveClones">
|
<widget class="QPushButton" name="btnSaveClones">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
@ -842,10 +846,42 @@
|
|||||||
<string>Save All</string>
|
<string>Save All</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="flat">
|
<property name="flat">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<spacer name="horizontalSpacer_12">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>30</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3">
|
||||||
|
<spacer name="horizontalSpacer_13">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>30</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@ -857,7 +893,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>10</y>
|
<y>10</y>
|
||||||
<width>261</width>
|
<width>391</width>
|
||||||
<height>51</height>
|
<height>51</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -875,32 +911,222 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>20</y>
|
<y>20</y>
|
||||||
<width>246</width>
|
<width>381</width>
|
||||||
<height>21</height>
|
<height>23</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_6">
|
<layout class="QGridLayout" name="gridLayout_6">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QCheckBox" name="chkNoPlot">
|
<widget class="QRadioButton" name="radioNoPlot">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>None</string>
|
<string>No Plot</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="4">
|
||||||
<widget class="QCheckBox" name="chktest1D_3">
|
<widget class="QRadioButton" name="radioDataGraph">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Data Graph</string>
|
<string>Data Graph</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item row="0" column="2">
|
||||||
<widget class="QCheckBox" name="chktest1D_4">
|
<widget class="QRadioButton" name="radioHistogram">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Histogram</string>
|
<string>Histogram</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<spacer name="horizontalSpacer_17">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>10</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3">
|
||||||
|
<spacer name="horizontalSpacer_18">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>10</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<widget class="QGroupBox" name="boxScan">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>430</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>331</width>
|
||||||
|
<height>51</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Scan - Y Axis Values</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="horizontalLayoutWidget_3">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>11</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>316</width>
|
||||||
|
<height>23</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="radioLevel0">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Level 0</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_6">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>5</width>
|
||||||
|
<height>10</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="radioLevel1">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Level 1</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_7">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>5</width>
|
||||||
|
<height>10</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="radioFileIndex">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>File Index</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_8">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>5</width>
|
||||||
|
<height>10</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="radioAllFrames">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>All Frames</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -139,7 +139,18 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QComboBox" name="comboDynamicRange"/>
|
<widget class="QComboBox" name="comboDynamicRange">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>16</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>32</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QSpinBox" name="spinNumModules"/>
|
<widget class="QSpinBox" name="spinNumModules"/>
|
||||||
|
@ -72,9 +72,6 @@ void SetScript(int index);
|
|||||||
* Options: constant size,specific values,values from file */
|
* Options: constant size,specific values,values from file */
|
||||||
void EnableSizeWidgets();
|
void EnableSizeWidgets();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
113
slsDetectorGui/include/qDebugStream.h
Normal file
113
slsDetectorGui/include/qDebugStream.h
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
/*
|
||||||
|
* qDebugStream.h
|
||||||
|
*
|
||||||
|
* Created on: Jun 28, 2012
|
||||||
|
* Author: Anna Bergamaschi
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef QDEBUGSTREAM_H_
|
||||||
|
#define QDEBUGSTREAM_H_
|
||||||
|
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QWidget>
|
||||||
|
#include <QString>
|
||||||
|
#include <QEvent>
|
||||||
|
#include <QCustomEvent>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <streambuf>
|
||||||
|
#include <string>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
#define STREAMEVENT 60001
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class qStreamEvent:public QEvent{
|
||||||
|
public:
|
||||||
|
qStreamEvent(QString s):QEvent(static_cast<QEvent::Type>(STREAMEVENT)) {str=s;};
|
||||||
|
/** \returns the progress index */
|
||||||
|
QString getString() {return str;};
|
||||||
|
private:
|
||||||
|
QString str;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class qDebugStream : public basic_streambuf<char> {
|
||||||
|
|
||||||
|
public:
|
||||||
|
qDebugStream(ostream &stream, QWidget* w) : m_stream(stream), log_window(w) {
|
||||||
|
m_old_buf = stream.rdbuf();
|
||||||
|
stream.rdbuf(this);
|
||||||
|
};
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
~qDebugStream(){
|
||||||
|
// output anything that is left
|
||||||
|
if (!m_string.empty()) {
|
||||||
|
qStreamEvent *ce=new qStreamEvent(m_string.c_str());
|
||||||
|
QApplication::postEvent(log_window, ce);
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cerr << m_string << endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
m_stream.rdbuf(m_old_buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual int_type overflow(int_type v){
|
||||||
|
if (v == '\n'){
|
||||||
|
qStreamEvent *ce=new qStreamEvent(m_string.c_str());
|
||||||
|
QApplication::postEvent(log_window, ce);
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cerr << m_string << endl;
|
||||||
|
#endif
|
||||||
|
m_string.erase(m_string.begin(), m_string.end());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_string += v;
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
virtual streamsize xsputn(const char *p, streamsize n) {
|
||||||
|
m_string.append(p, p + n);
|
||||||
|
uint pos = 0;
|
||||||
|
|
||||||
|
while (pos != string::npos)
|
||||||
|
{
|
||||||
|
pos = m_string.find('\n');
|
||||||
|
if (pos != string::npos)
|
||||||
|
{
|
||||||
|
string tmp(m_string.begin(), m_string.begin() + pos);
|
||||||
|
qStreamEvent *ce=new qStreamEvent(tmp.c_str());
|
||||||
|
QApplication::postEvent(log_window, ce);
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cerr << tmp << endl;
|
||||||
|
#endif
|
||||||
|
m_string.erase(m_string.begin(), m_string.begin() + pos + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
private:
|
||||||
|
ostream &m_stream;
|
||||||
|
streambuf *m_old_buf;
|
||||||
|
string m_string;
|
||||||
|
QWidget* log_window;
|
||||||
|
};
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#endif /* QDEBUGSTREAM_H_ */
|
@ -35,7 +35,24 @@ public:
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
/** returns the value in ns to send to server.
|
/** returns the unit in words
|
||||||
|
* @param unit is the time unit
|
||||||
|
*/
|
||||||
|
static string getUnitString(timeUnit unit){
|
||||||
|
switch(unit){
|
||||||
|
case HOURS: return string("hrs");
|
||||||
|
case MINUTES: return string("min");
|
||||||
|
case SECONDS: return string("sec");
|
||||||
|
case MILLISECONDS: return string("msec");
|
||||||
|
case MICROSECONDS: return string("usec");
|
||||||
|
case NANOSECONDS: return string("nsec");
|
||||||
|
default: return string("error");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/** returns the value in ns to send to server as the
|
||||||
|
* server class slsdetector accepts in ns.
|
||||||
* @param unit unit of time
|
* @param unit unit of time
|
||||||
* @param value time
|
* @param value time
|
||||||
* returns time value in ns
|
* returns time value in ns
|
||||||
@ -95,9 +112,22 @@ public:
|
|||||||
* @param source is the tab or the source of the error
|
* @param source is the tab or the source of the error
|
||||||
* */
|
* */
|
||||||
static void ErrorMessage(string errorMessage,char source[])
|
static void ErrorMessage(string errorMessage,char source[])
|
||||||
|
{
|
||||||
|
static QMessageBox* errorBox;
|
||||||
|
errorBox= new QMessageBox(QMessageBox::Warning,source,tr(errorMessage.c_str()),QMessageBox::Ok, errorBox);
|
||||||
|
errorBox->exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**displays an information message
|
||||||
|
* @param infoMessage the message to be displayed
|
||||||
|
* @param source is the tab or the source of the information
|
||||||
|
* */
|
||||||
|
static void InfoMessage(string infoMessage,char source[])
|
||||||
{
|
{
|
||||||
static QMessageBox* msgBox;
|
static QMessageBox* msgBox;
|
||||||
msgBox= new QMessageBox(QMessageBox::Warning,source,tr(errorMessage.c_str()),QMessageBox::Ok, msgBox);
|
msgBox= new QMessageBox(QMessageBox::Information,source,tr(infoMessage.c_str()),QMessageBox::Ok, msgBox);
|
||||||
msgBox->exec();
|
msgBox->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,10 +52,11 @@ public:
|
|||||||
* @param argv server options
|
* @param argv server options
|
||||||
* @param app the qapplication
|
* @param app the qapplication
|
||||||
* @param parent makes the parent window 0 by default
|
* @param parent makes the parent window 0 by default
|
||||||
*/
|
* */
|
||||||
qDetectorMain(int argc, char **argv, QApplication *app, QWidget *parent = 0);
|
qDetectorMain(int argc, char **argv, QApplication *app, QWidget *parent = 0);
|
||||||
|
|
||||||
/**Destructor */
|
/**Destructor
|
||||||
|
* */
|
||||||
~qDetectorMain();
|
~qDetectorMain();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -103,88 +104,55 @@ private:
|
|||||||
/**Messages tab */
|
/**Messages tab */
|
||||||
qTabMessages *tab_messages;
|
qTabMessages *tab_messages;
|
||||||
/**if the developer tab should be enabled,known from command line */
|
/**if the developer tab should be enabled,known from command line */
|
||||||
|
|
||||||
int isDeveloper;
|
int isDeveloper;
|
||||||
|
|
||||||
|
|
||||||
/**Sets up the layout of the widget
|
/**Sets up the layout of the widget
|
||||||
*/
|
* */
|
||||||
void SetUpWidgetWindow();
|
void SetUpWidgetWindow();
|
||||||
|
|
||||||
/**Sets up detector
|
/**Sets up detector
|
||||||
*/
|
* */
|
||||||
void SetUpDetector();
|
void SetUpDetector();
|
||||||
|
|
||||||
/**Sets up the signals and the slots
|
/**Sets up the signals and the slots
|
||||||
*/
|
* */
|
||||||
void Initialization();
|
void Initialization();
|
||||||
|
|
||||||
/** Sets/unsets the developer mode (developer tab)
|
|
||||||
* @param b bool TRUE sets, FALSE unsets\
|
|
||||||
*/
|
|
||||||
void SetDeveloperMode(bool b);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/** Sets/unsets the debug mode i.e. enables/disables the debug tab
|
/** Enables modes as selected -Debug, Beamline, Expert, Dockable(calls setdockablemode())
|
||||||
* @param b bool TRUE sets, FALSE unsets
|
* */
|
||||||
*/
|
void EnableModes(QAction *action);
|
||||||
void SetDebugMode(bool b);
|
|
||||||
|
|
||||||
/** Sets/unsets the beamline mode (at the moment it doesn't do anything)
|
/** Executes actions in the utilities menu as selected
|
||||||
* @param b bool TRUE sets, FALSE unsets
|
* */
|
||||||
*/
|
void ExecuteUtilities(QAction *action);
|
||||||
void SetBeamlineMode(bool b);
|
|
||||||
|
|
||||||
/** Sets/unsets the expert mode i.e. enables/disables the advanced and Settings tabs
|
/** Executes actions in the utilities menu as selected
|
||||||
* @param b bool TRUE sets, FALSE unsets
|
* */
|
||||||
*/
|
void ExecuteHelp(QAction *action);
|
||||||
void SetExpertMode(bool b);
|
|
||||||
|
|
||||||
/** Sets/unsets the dockable plot mode
|
/** Refreshes the tab each time the tab is changed. Also displays the next enabled tab
|
||||||
* @param b bool TRUE sets, FALSE unsets
|
* */
|
||||||
*/
|
void Refresh(int index);
|
||||||
void SetDockableMode(bool b);
|
|
||||||
|
|
||||||
/** Refreshes the tab each time the tab is changed. Also displays the next enabled tab */
|
|
||||||
void refresh(int index);
|
|
||||||
|
|
||||||
/** Opens Setup */
|
|
||||||
void OpenSetup();
|
|
||||||
|
|
||||||
/** Saves Setup */
|
|
||||||
void SaveSetup();
|
|
||||||
|
|
||||||
/** Measurement Wizard */
|
|
||||||
void MeasurementWizard();
|
|
||||||
|
|
||||||
/** Open Configuration*/
|
|
||||||
void OpenConfiguration();
|
|
||||||
|
|
||||||
/** Save Configuration */
|
|
||||||
void SaveConfiguration();
|
|
||||||
|
|
||||||
/** Executing Energy Calibration */
|
|
||||||
void EnergyCalibration();
|
|
||||||
|
|
||||||
/** Executing Angular Calibration */
|
|
||||||
void AngularCalibration();
|
|
||||||
|
|
||||||
/** Executing Version */
|
|
||||||
void Version();
|
|
||||||
|
|
||||||
/** Executing About */
|
|
||||||
void About();
|
|
||||||
|
|
||||||
/** Resizes the main window if the plot is docked/undocked
|
/** Resizes the main window if the plot is docked/undocked
|
||||||
* @param b bool TRUE if undocked(outside main window), FALSE docked
|
* @param b bool TRUE if undocked(outside main window), FALSE docked
|
||||||
*/
|
* */
|
||||||
void ResizeMainWindow(bool b);
|
void ResizeMainWindow(bool b);
|
||||||
|
|
||||||
/** Enables/disables tabs depending on if acquisition is currently in progress */
|
/** Enables/disables tabs depending on if acquisition is currently in progress
|
||||||
|
* */
|
||||||
void EnableTabs();
|
void EnableTabs();
|
||||||
|
|
||||||
/** Set the tool tip of mouse controlled zooming depening on if its enabled/disabled*/
|
/** Set the tool tip of mouse controlled zooming depening on if its enabled/disabled
|
||||||
|
* */
|
||||||
void SetZoomToolTip(bool disable);
|
void SetZoomToolTip(bool disable);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
/** Adjust the resizing to resize plot, except for actions tab
|
||||||
|
* */
|
||||||
void resizeEvent(QResizeEvent* event);
|
void resizeEvent(QResizeEvent* event);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -40,6 +40,8 @@ public:
|
|||||||
/** Destructor */
|
/** Destructor */
|
||||||
~qDrawPlot();
|
~qDrawPlot();
|
||||||
|
|
||||||
|
bool isRunning(){return running;};
|
||||||
|
|
||||||
/** Number of x axis pixels */
|
/** Number of x axis pixels */
|
||||||
int GetPixelsX(){return nPixelsX;};
|
int GetPixelsX(){return nPixelsX;};
|
||||||
/** Number of y axis pixels */
|
/** Number of y axis pixels */
|
||||||
@ -72,7 +74,10 @@ public:
|
|||||||
void DisableZoom(bool disable);
|
void DisableZoom(bool disable);
|
||||||
/** gets the progress of acquisition to the measurement tab*/
|
/** gets the progress of acquisition to the measurement tab*/
|
||||||
int GetProgress(){return progress;};
|
int GetProgress(){return progress;};
|
||||||
|
/** Enables plot from the plot tab*/
|
||||||
|
void EnablePlot(bool enable);
|
||||||
|
/** To know whether 1d started*/
|
||||||
|
bool DoesPlotExist(){return plotExists;};
|
||||||
|
|
||||||
/** Starts or stop acquisition
|
/** Starts or stop acquisition
|
||||||
* Calls startDaq() function
|
* Calls startDaq() function
|
||||||
@ -171,6 +176,8 @@ private:
|
|||||||
int currentPersistency;
|
int currentPersistency;
|
||||||
int progress;
|
int progress;
|
||||||
bool plotEnable;
|
bool plotEnable;
|
||||||
|
bool plotExists;
|
||||||
|
bool running;
|
||||||
|
|
||||||
/** Initializes all its members and the thread */
|
/** Initializes all its members and the thread */
|
||||||
void Initialization();
|
void Initialization();
|
||||||
@ -223,13 +230,10 @@ void Clear1DPlot();
|
|||||||
void ClonePlot();
|
void ClonePlot();
|
||||||
/** Closes all the clone plots */
|
/** Closes all the clone plots */
|
||||||
void CloseClones();
|
void CloseClones();
|
||||||
/** To Save plot
|
/** To Save plot */
|
||||||
@param FName full name of file */
|
void SavePlot();
|
||||||
void SavePlot(QString FName);
|
|
||||||
/** Sets persistency from plot tab */
|
/** Sets persistency from plot tab */
|
||||||
void SetPersistency(int val);
|
void SetPersistency(int val);
|
||||||
/** Enables plot */
|
|
||||||
void EnablePlot(bool enable);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,6 +37,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
~qTabActions();
|
~qTabActions();
|
||||||
|
|
||||||
|
/** To refresh and update widgets
|
||||||
|
*/
|
||||||
|
void Refresh();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** The sls detector object */
|
/** The sls detector object */
|
||||||
|
@ -30,6 +30,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
~qTabAdvanced();
|
~qTabAdvanced();
|
||||||
|
|
||||||
|
/** To refresh and update widgets
|
||||||
|
*/
|
||||||
|
void Refresh();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** The sls detector object */
|
/** The sls detector object */
|
||||||
|
@ -33,14 +33,16 @@ public:
|
|||||||
*/
|
*/
|
||||||
~qTabDataOutput();
|
~qTabDataOutput();
|
||||||
|
|
||||||
|
/** To refresh and update widgets
|
||||||
|
*/
|
||||||
|
void Refresh();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** The sls detector object */
|
/** The sls detector object */
|
||||||
slsDetectorUtils *myDet;
|
slsDetectorUtils *myDet;
|
||||||
|
|
||||||
/** Output Directory */
|
|
||||||
QString outputDir;
|
|
||||||
|
|
||||||
/** methods */
|
/** methods */
|
||||||
/** Sets up the widget */
|
/** Sets up the widget */
|
||||||
void SetupWidgetWindow();
|
void SetupWidgetWindow();
|
||||||
@ -48,9 +50,6 @@ private:
|
|||||||
/** Sets up all the slots and signals */
|
/** Sets up all the slots and signals */
|
||||||
void Initialization();
|
void Initialization();
|
||||||
|
|
||||||
/** Enables/Disables all the widgets */
|
|
||||||
void Enable(bool enable);
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/** Sets the output directory
|
/** Sets the output directory
|
||||||
|
@ -30,6 +30,9 @@ public:
|
|||||||
*/
|
*/
|
||||||
~qTabDebugging();
|
~qTabDebugging();
|
||||||
|
|
||||||
|
/** To refresh and update widgets
|
||||||
|
*/
|
||||||
|
void Refresh();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** The sls detector object */
|
/** The sls detector object */
|
||||||
|
@ -30,6 +30,9 @@ public:
|
|||||||
*/
|
*/
|
||||||
~qTabDeveloper();
|
~qTabDeveloper();
|
||||||
|
|
||||||
|
/** To refresh and update widgets
|
||||||
|
*/
|
||||||
|
void Refresh();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** The sls detector object */
|
/** The sls detector object */
|
||||||
|
@ -36,6 +36,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
~qTabMeasurement();
|
~qTabMeasurement();
|
||||||
|
|
||||||
|
/** To refresh and update widgets
|
||||||
|
*/
|
||||||
|
void Refresh();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** The sls detector object */
|
/** The sls detector object */
|
||||||
|
@ -15,7 +15,9 @@ class slsDetectorUtils;
|
|||||||
/** Qt Include Headers */
|
/** Qt Include Headers */
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QLineEdit>
|
#include <QEvent>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include "qDebugStream.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*@short sets up the Messages parameters
|
*@short sets up the Messages parameters
|
||||||
@ -42,11 +44,14 @@ private:
|
|||||||
/** Log of executed commands */
|
/** Log of executed commands */
|
||||||
QTextEdit *dispLog;
|
QTextEdit *dispLog;
|
||||||
|
|
||||||
/** Command display */
|
/** To save the log to file */
|
||||||
QLineEdit *dispCommand;
|
QPushButton *btnSave;
|
||||||
|
|
||||||
/** Path display */
|
/** To clear the log to file */
|
||||||
QLineEdit *dispPath;
|
QPushButton *btnClear;
|
||||||
|
|
||||||
|
/** This class creates the log */
|
||||||
|
qDebugStream *qout;
|
||||||
|
|
||||||
/** methods */
|
/** methods */
|
||||||
/** Sets up the widget */
|
/** Sets up the widget */
|
||||||
@ -55,9 +60,15 @@ private:
|
|||||||
/** Sets up all the slots and signals */
|
/** Sets up all the slots and signals */
|
||||||
void Initialization();
|
void Initialization();
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void executeCommand();
|
/** Stream log to textedit in GUI */
|
||||||
|
void customEvent(QEvent *e);
|
||||||
|
|
||||||
|
/** Save Log to File*/
|
||||||
|
void SaveLog();
|
||||||
|
|
||||||
|
/** Clear Log to File*/
|
||||||
|
void ClearLog();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ public:
|
|||||||
~qTabPlot();
|
~qTabPlot();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** The sls detector object */
|
/** The sls detector object */
|
||||||
slsDetectorUtils *myDet;
|
slsDetectorUtils *myDet;
|
||||||
@ -41,6 +42,9 @@ private:
|
|||||||
/** The Plot widget */
|
/** The Plot widget */
|
||||||
qDrawPlot *myPlot;
|
qDrawPlot *myPlot;
|
||||||
|
|
||||||
|
/** 1d/2d plot */
|
||||||
|
bool isOneD;
|
||||||
|
|
||||||
/** some Default Values */
|
/** some Default Values */
|
||||||
static QString defaultPlotTitle;
|
static QString defaultPlotTitle;
|
||||||
static QString defaultHistXAxisTitle;
|
static QString defaultHistXAxisTitle;
|
||||||
@ -58,11 +62,6 @@ private:
|
|||||||
*/
|
*/
|
||||||
void Initialization();
|
void Initialization();
|
||||||
|
|
||||||
/** Enables/Disables all the widgets
|
|
||||||
*/
|
|
||||||
void Enable(bool enable);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -93,9 +92,10 @@ void SetAxesRange();
|
|||||||
void SetZRange();
|
void SetZRange();
|
||||||
/** Enables the range of the z axis */
|
/** Enables the range of the z axis */
|
||||||
void EnableZRange();
|
void EnableZRange();
|
||||||
/** Save Plot */
|
/** Set Plot to none, data graph, histogram*/
|
||||||
void SavePlot();
|
void SetPlot();
|
||||||
|
/** Enable Histogram */
|
||||||
|
void EnableHistogram(bool enable);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void DisableZoomSignal(bool);
|
void DisableZoomSignal(bool);
|
||||||
|
@ -34,6 +34,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
~qTabSettings();
|
~qTabSettings();
|
||||||
|
|
||||||
|
/** To refresh and update widgets
|
||||||
|
*/
|
||||||
|
void Refresh();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** The sls detector object */
|
/** The sls detector object */
|
||||||
|
@ -71,6 +71,7 @@ HEADERS = \
|
|||||||
slsDetectorPlotting/include/SlsQtValidators.h\
|
slsDetectorPlotting/include/SlsQtValidators.h\
|
||||||
slsDetectorPlotting/include/SlsQtNumberEntry.h\
|
slsDetectorPlotting/include/SlsQtNumberEntry.h\
|
||||||
include/qDefs.h\
|
include/qDefs.h\
|
||||||
|
include/qDebugStream.h\
|
||||||
include/qDetectorMain.h\
|
include/qDetectorMain.h\
|
||||||
include/qDrawPlot.h\
|
include/qDrawPlot.h\
|
||||||
include/qCloneWidget.h\
|
include/qCloneWidget.h\
|
||||||
|
@ -141,7 +141,7 @@ void qCloneWidget::SetupWidgetWindow(QString title,int numDim,SlsQt1DPlot*& plot
|
|||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qCloneWidget::SetCloneHists(int nHists,int histNBins,double* histXAxis,double* histYAxis[],string histTitle[]){
|
void qCloneWidget::SetCloneHists(int nHists,int histNBins,double* histXAxis,double* histYAxis[],string histTitle[]){
|
||||||
/** for each plot*/
|
/** for each plot*/cout<<"qclone nhists:"<<nHists<<endl;
|
||||||
for(int hist_num=0;hist_num<nHists;hist_num++){
|
for(int hist_num=0;hist_num<nHists;hist_num++){
|
||||||
/** create hists */
|
/** create hists */
|
||||||
SlsQtH1D* k;
|
SlsQtH1D* k;
|
||||||
@ -183,11 +183,12 @@ void qCloneWidget::SavePlot(){
|
|||||||
QPainter painter(&img);
|
QPainter painter(&img);
|
||||||
cloneBox->render(&painter);
|
cloneBox->render(&painter);
|
||||||
|
|
||||||
fName = QFileDialog::getSaveFileName(this,tr("Save Snapshot "),
|
fName = QFileDialog::getSaveFileName(this,tr("Save Snapshot "),fName,tr("Images (*.png *.xpm *.jpg)"),0,QFileDialog::ShowDirsOnly);
|
||||||
fName,tr("Images (*.png *.xpm *.jpg)"));
|
|
||||||
if (!fName.isEmpty())
|
if (!fName.isEmpty())
|
||||||
if(!(img.save(fName)))
|
if((img.save(fName)))
|
||||||
qDefs::ErrorMessage("ERROR: Attempt to save snapshot failed","Snapshot: WARNING");
|
qDefs::InfoMessage("The SnapShot has been successfully saved","Snapshot: Information");
|
||||||
|
else
|
||||||
|
qDefs::ErrorMessage("ERROR: Attempt to save snapshot failed. Wrong Format","Snapshot: WARNING");
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
/** Qt Include Headers */
|
/** Qt Include Headers */
|
||||||
#include <QSizePolicy>
|
#include <QSizePolicy>
|
||||||
|
#include <QFileDialog>
|
||||||
/** C++ Include Headers */
|
/** C++ Include Headers */
|
||||||
#include<iostream>
|
#include<iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -25,6 +26,7 @@ using namespace std;
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
int main (int argc, char **argv) {
|
int main (int argc, char **argv) {
|
||||||
|
|
||||||
QApplication *theApp = new QApplication(argc, argv);
|
QApplication *theApp = new QApplication(argc, argv);
|
||||||
@ -35,8 +37,10 @@ int main (int argc, char **argv) {
|
|||||||
return theApp->exec();
|
return theApp->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app, QWidget *parent) :
|
qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app, QWidget *parent) :
|
||||||
QMainWindow(parent), theApp(app),myDet(0),detID(0),myPlot(NULL),tabs(NULL),isDeveloper(0){
|
QMainWindow(parent), theApp(app),myDet(0),detID(0),myPlot(NULL),tabs(NULL),isDeveloper(0){
|
||||||
|
|
||||||
@ -61,23 +65,26 @@ qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app, QWidget *
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
qDetectorMain::~qDetectorMain(){
|
qDetectorMain::~qDetectorMain(){
|
||||||
delete myDet;
|
delete myDet;
|
||||||
if (menubar) delete menubar;
|
if (menubar) delete menubar;
|
||||||
if (centralwidget) delete centralwidget;
|
if (centralwidget) delete centralwidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qDetectorMain::SetUpWidgetWindow(){
|
void qDetectorMain::SetUpWidgetWindow(){
|
||||||
|
|
||||||
/** Layout */
|
/** Layout */
|
||||||
layoutTabs= new QGridLayout;
|
layoutTabs= new QGridLayout;
|
||||||
centralwidget->setLayout(layoutTabs);
|
centralwidget->setLayout(layoutTabs);
|
||||||
|
|
||||||
|
|
||||||
/** plot setup*/
|
/** plot setup*/
|
||||||
myPlot = new qDrawPlot(dockWidgetPlot,myDet);
|
myPlot = new qDrawPlot(dockWidgetPlot,myDet);
|
||||||
dockWidgetPlot->setWidget(myPlot);
|
dockWidgetPlot->setWidget(myPlot);
|
||||||
@ -86,6 +93,7 @@ void qDetectorMain::SetUpWidgetWindow(){
|
|||||||
tabs = new MyTabWidget(this);
|
tabs = new MyTabWidget(this);
|
||||||
layoutTabs->addWidget(tabs);
|
layoutTabs->addWidget(tabs);
|
||||||
/** creating all the tab widgets */
|
/** creating all the tab widgets */
|
||||||
|
tab_messages = new qTabMessages (this, myDet);
|
||||||
tab_measurement = new qTabMeasurement (this, myDet,myPlot);
|
tab_measurement = new qTabMeasurement (this, myDet,myPlot);
|
||||||
tab_dataoutput = new qTabDataOutput (this, myDet);
|
tab_dataoutput = new qTabDataOutput (this, myDet);
|
||||||
tab_plot = new qTabPlot (this, myDet,myPlot);
|
tab_plot = new qTabPlot (this, myDet,myPlot);
|
||||||
@ -94,7 +102,6 @@ void qDetectorMain::SetUpWidgetWindow(){
|
|||||||
tab_advanced = new qTabAdvanced (this, myDet);
|
tab_advanced = new qTabAdvanced (this, myDet);
|
||||||
tab_debugging = new qTabDebugging (this, myDet);
|
tab_debugging = new qTabDebugging (this, myDet);
|
||||||
tab_developer = new qTabDeveloper (this, myDet);
|
tab_developer = new qTabDeveloper (this, myDet);
|
||||||
tab_messages = new qTabMessages (this, myDet);
|
|
||||||
/** creating the scroll area widgets for the tabs */
|
/** creating the scroll area widgets for the tabs */
|
||||||
for(int i=0;i<NumberOfTabs;i++){
|
for(int i=0;i<NumberOfTabs;i++){
|
||||||
scroll[i] = new QScrollArea;
|
scroll[i] = new QScrollArea;
|
||||||
@ -109,8 +116,6 @@ void qDetectorMain::SetUpWidgetWindow(){
|
|||||||
scroll[Advanced] ->setWidget(tab_advanced);
|
scroll[Advanced] ->setWidget(tab_advanced);
|
||||||
scroll[Debugging] ->setWidget(tab_debugging);
|
scroll[Debugging] ->setWidget(tab_debugging);
|
||||||
scroll[Developer] ->setWidget(tab_developer);
|
scroll[Developer] ->setWidget(tab_developer);
|
||||||
|
|
||||||
|
|
||||||
/** inserting all the tabs*/
|
/** inserting all the tabs*/
|
||||||
tabs->insertTab(Measurement, scroll[Measurement], "Measurement");
|
tabs->insertTab(Measurement, scroll[Measurement], "Measurement");
|
||||||
tabs->insertTab(DataOutput, scroll[DataOutput], "Data Output");
|
tabs->insertTab(DataOutput, scroll[DataOutput], "Data Output");
|
||||||
@ -122,21 +127,38 @@ void qDetectorMain::SetUpWidgetWindow(){
|
|||||||
tabs->insertTab(Developer, scroll[Developer], "Developer");
|
tabs->insertTab(Developer, scroll[Developer], "Developer");
|
||||||
/** Prefer this to expand and not have scroll buttons*/
|
/** Prefer this to expand and not have scroll buttons*/
|
||||||
tabs->insertTab(Messages, tab_messages, "Messages");
|
tabs->insertTab(Messages, tab_messages, "Messages");
|
||||||
|
/** Default tab color*/
|
||||||
|
defaultTabColor = tabs->tabBar()->tabTextColor(DataOutput);
|
||||||
|
/**Set the current tab(measurement) to blue as it is the current one*/
|
||||||
|
tabs->tabBar()->setTabTextColor(0,QColor(0,0,200,255));
|
||||||
|
/** increase the width so it uses all the empty space for the tab titles*/
|
||||||
|
tabs->tabBar()->setFixedWidth(width()+61);
|
||||||
|
|
||||||
/** mode setup - to set up the tabs initially as disabled, not in form so done here */
|
/** mode setup - to set up the tabs initially as disabled, not in form so done here */
|
||||||
SetDebugMode(false);
|
#ifdef VERBOSE
|
||||||
SetBeamlineMode(false);
|
cout<<"Setting Debug Mode to 0\nSetting Beamline Mode to 0\n"
|
||||||
SetExpertMode(false);
|
"Setting Expert Mode to 0\nSetting Dockable Mode to false\n"
|
||||||
SetDeveloperMode(false);
|
"Setting Developer Mode to "<<isDeveloper<<endl;
|
||||||
SetDeveloperMode(isDeveloper);
|
#endif
|
||||||
|
tabs->setTabEnabled(Debugging,false);
|
||||||
tabs->tabBar()->setTabTextColor(0,QColor(0,0,200,255));
|
//beamline mode to false
|
||||||
|
tabs->setTabEnabled(Advanced,false);
|
||||||
|
dockWidgetPlot->setFloating(false);
|
||||||
|
dockWidgetPlot->setFeatures(QDockWidget::NoDockWidgetFeatures);
|
||||||
|
tabs->setTabEnabled(Developer,isDeveloper);
|
||||||
|
|
||||||
|
/** Other setup*/
|
||||||
|
/**Height of plot and central widget*/
|
||||||
|
heightPlotWindow = dockWidgetPlot->size().height();
|
||||||
|
heightCentralWidget = centralwidget->size().height();
|
||||||
|
/** Default zoom Tool Tip */
|
||||||
|
zoomToolTip = dockWidgetPlot->toolTip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qDetectorMain::SetUpDetector(){
|
void qDetectorMain::SetUpDetector(){
|
||||||
|
|
||||||
|
|
||||||
@ -178,14 +200,16 @@ void qDetectorMain::SetUpDetector(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qDetectorMain::Initialization(){
|
void qDetectorMain::Initialization(){
|
||||||
/** Dockable Plot*/
|
/** Dockable Plot*/
|
||||||
connect(dockWidgetPlot,SIGNAL(topLevelChanged(bool)),this,SLOT(ResizeMainWindow(bool)));
|
connect(dockWidgetPlot,SIGNAL(topLevelChanged(bool)),this,SLOT(ResizeMainWindow(bool)));
|
||||||
|
|
||||||
/** tabs */
|
/** tabs */
|
||||||
connect(tabs,SIGNAL(currentChanged(int)),this, SLOT(refresh(int)));//( QWidget*)));
|
connect(tabs,SIGNAL(currentChanged(int)),this, SLOT(Refresh(int)));//( QWidget*)));
|
||||||
/** Measurement tab*/
|
/** Measurement tab*/
|
||||||
/** Plot tab */
|
/** Plot tab */
|
||||||
connect(tab_plot,SIGNAL(DisableZoomSignal(bool)),this, SLOT(SetZoomToolTip(bool)));
|
connect(tab_plot,SIGNAL(DisableZoomSignal(bool)),this, SLOT(SetZoomToolTip(bool)));
|
||||||
@ -200,166 +224,187 @@ void qDetectorMain::Initialization(){
|
|||||||
|
|
||||||
/** menubar */
|
/** menubar */
|
||||||
/** Modes Menu */
|
/** Modes Menu */
|
||||||
connect(actionDebug, SIGNAL(toggled(bool)),this,SLOT(SetDebugMode(bool)));
|
connect(menuModes,SIGNAL(triggered(QAction*)),SLOT(EnableModes(QAction*)));
|
||||||
connect(actionBeamline, SIGNAL(toggled(bool)),this,SLOT(SetBeamlineMode(bool)));
|
|
||||||
connect(actionExpert, SIGNAL(toggled(bool)),this,SLOT(SetExpertMode(bool)));
|
|
||||||
connect(actionDockable, SIGNAL(toggled(bool)),this,SLOT(SetDockableMode(bool)));
|
|
||||||
|
|
||||||
|
|
||||||
/** Utilities Menu */
|
/** Utilities Menu */
|
||||||
connect(actionOpenSetup,SIGNAL(triggered()),this,SLOT(OpenSetup()));
|
connect(menuUtilities,SIGNAL(triggered(QAction*)),SLOT(ExecuteUtilities(QAction*)));
|
||||||
connect(actionSaveSetup,SIGNAL(triggered()),this,SLOT(SaveSetup()));
|
/** Help Menu */
|
||||||
connect(actionMeasurementWizard,SIGNAL(triggered()),this,SLOT(MeasurementWizard()));
|
connect(menuHelp,SIGNAL(triggered(QAction*)),SLOT(ExecuteHelp(QAction*)));
|
||||||
connect(actionOpenConfiguration,SIGNAL(triggered()),this,SLOT(OpenConfiguration()));
|
|
||||||
connect(actionSaveConfiguration,SIGNAL(triggered()),this,SLOT(SaveConfiguration()));
|
|
||||||
connect(actionEnergyCalibration,SIGNAL(triggered()),this,SLOT(EnergyCalibration()));
|
|
||||||
connect(actionAngularCalibration,SIGNAL(triggered()),this,SLOT(AngularCalibration()));
|
|
||||||
connect(actionAbout,SIGNAL(triggered()),this,SLOT(About()));
|
|
||||||
connect(actionVersion,SIGNAL(triggered()),this,SLOT(Version()));
|
|
||||||
|
|
||||||
heightPlotWindow = dockWidgetPlot->size().height();
|
|
||||||
heightCentralWidget = centralwidget->size().height();
|
|
||||||
|
|
||||||
defaultTabColor = tabs->tabBar()->tabTextColor(DataOutput);
|
|
||||||
zoomToolTip = dockWidgetPlot->toolTip();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qDetectorMain::SetDeveloperMode(bool b){
|
|
||||||
|
void qDetectorMain::EnableModes(QAction *action){
|
||||||
|
bool enable;
|
||||||
|
|
||||||
|
/**Set DebugMode */
|
||||||
|
if(action==actionDebug){
|
||||||
|
enable = actionDebug->isChecked();
|
||||||
|
tabs->setTabEnabled(Debugging,enable);
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Setting Developer Mode to "<<b<<endl;
|
cout<<"Setting Debug Mode to "<<enable<<endl;
|
||||||
#endif
|
#endif
|
||||||
tabs->setTabEnabled(Developer,b);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
/**Set BeamlineMode */
|
||||||
|
else if(action==actionBeamline){
|
||||||
void qDetectorMain::SetDebugMode(bool b){
|
enable = actionBeamline->isChecked();
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Setting Debug Mode to "<<b<<endl;
|
cout<<"Setting Beamline Mode to "<<enable<<endl;
|
||||||
#endif
|
#endif
|
||||||
tabs->setTabEnabled(Debugging,b);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
/**Set ExpertMode */
|
||||||
|
else if(action==actionExpert){
|
||||||
void qDetectorMain::SetBeamlineMode(bool b){
|
enable = actionExpert->isChecked();
|
||||||
|
tabs->setTabEnabled(Advanced,enable);
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Setting Beamline Mode to "<<b<<endl;
|
cout<<"Setting Expert Mode to "<<enable<<endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
/**Set DockableMode */
|
||||||
|
else{
|
||||||
void qDetectorMain::SetExpertMode(bool b){
|
enable = actionDockable->isChecked();
|
||||||
|
if(enable)
|
||||||
|
dockWidgetPlot->setFeatures(QDockWidget::DockWidgetFloatable);
|
||||||
|
else{
|
||||||
|
dockWidgetPlot->setFloating(false);
|
||||||
|
dockWidgetPlot->setFeatures(QDockWidget::NoDockWidgetFeatures);
|
||||||
|
}
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Setting Expert Mode to "<<b<<endl;
|
cout<<"Setting Dockable Mode to "<<enable<<endl;
|
||||||
#endif
|
#endif
|
||||||
tabs->setTabEnabled(Advanced,b);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qDetectorMain::refresh(int index){
|
|
||||||
|
void qDetectorMain::ExecuteUtilities(QAction *action){
|
||||||
|
|
||||||
|
if(action==actionOpenSetup){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Opening Setup"<<endl;
|
||||||
|
#endif
|
||||||
|
QString fName = QString(myDet->getFilePath().c_str());
|
||||||
|
fName = QFileDialog::getOpenFileName(this,
|
||||||
|
tr("Load Detector Setup"),fName,
|
||||||
|
tr("Detector Setup files (*.det)"));
|
||||||
|
/** Gets called when cancelled as well*/
|
||||||
|
if (!fName.isEmpty()){
|
||||||
|
myDet->retrieveDetectorSetup(string(fName.toAscii().constData()));
|
||||||
|
qDefs::InfoMessage("The parameters have been successfully setup.","Main: Information");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(action==actionSaveSetup){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Saving Setup"<<endl;
|
||||||
|
#endif
|
||||||
|
QString fName = QString(myDet->getFilePath().c_str());
|
||||||
|
fName = QFileDialog::getSaveFileName(this,
|
||||||
|
tr("Save Current Detector Setup"),fName,
|
||||||
|
tr("Detector Setup files (*.det) "));
|
||||||
|
/** Gets called when cancelled as well*/
|
||||||
|
if (!fName.isEmpty()){
|
||||||
|
myDet->dumpDetectorSetup(string(fName.toAscii().constData()));
|
||||||
|
qDefs::InfoMessage("The setup parameters have been successfully saved.","Main: Information");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(action==actionMeasurementWizard){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Measurement Wizard"<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else if(action==actionOpenConfiguration){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Opening Configuration"<<endl;
|
||||||
|
#endif
|
||||||
|
QString fName = QString(myDet->getFilePath().c_str());
|
||||||
|
fName = QFileDialog::getOpenFileName(this,
|
||||||
|
tr("Load Detector Configuration"),fName,
|
||||||
|
tr("Configuration files (*.config)"));
|
||||||
|
/** Gets called when cancelled as well*/
|
||||||
|
if (!fName.isEmpty()){
|
||||||
|
myDet->readConfigurationFile(string(fName.toAscii().constData()));
|
||||||
|
qDefs::InfoMessage("The parameters have been successfully configured.","Main: Information");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(action==actionSaveConfiguration){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Saving Configuration"<<endl;
|
||||||
|
#endif
|
||||||
|
QString fName = QString(myDet->getFilePath().c_str());
|
||||||
|
fName = QFileDialog::getSaveFileName(this,
|
||||||
|
tr("Save Current Detector Configuration"),fName,
|
||||||
|
tr("Configuration files (*.config) "));
|
||||||
|
/** Gets called when cancelled as well*/
|
||||||
|
if (!fName.isEmpty()){
|
||||||
|
myDet->writeConfigurationFile(string(fName.toAscii().constData()));
|
||||||
|
qDefs::InfoMessage("The configuration parameters have been successfully saved.","Main: Information");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(action==actionEnergyCalibration){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Executing Energy Calibration"<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Executing Angular Calibration"<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
Refresh(tabs->currentIndex());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::ExecuteHelp(QAction *action){
|
||||||
|
if(action==actionVersion){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Version"<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"About"<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::Refresh(int index){
|
||||||
if(!tabs->isTabEnabled(index))
|
if(!tabs->isTabEnabled(index))
|
||||||
tabs->setCurrentIndex((index++)<(tabs->count()-1)?index:Measurement);
|
tabs->setCurrentIndex((index++)<(tabs->count()-1)?index:Measurement);
|
||||||
else{
|
else{
|
||||||
;
|
switch(tabs->currentIndex()){
|
||||||
|
case Measurement: if(!myPlot->isRunning()) tab_measurement->Refresh(); break;
|
||||||
|
case Settings: tab_settings->Refresh(); break;
|
||||||
|
case DataOutput: tab_dataoutput->Refresh(); break;
|
||||||
|
case Plot: break;
|
||||||
|
case Actions: tab_actions->Refresh(); break;
|
||||||
|
case Advanced: tab_advanced->Refresh(); break;
|
||||||
|
case Debugging: tab_debugging->Refresh(); break;
|
||||||
|
case Developer: tab_developer->Refresh(); break;
|
||||||
|
case Messages: break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for(int i=0;i<NumberOfTabs;i++)
|
for(int i=0;i<NumberOfTabs;i++)
|
||||||
tabs->tabBar()->setTabTextColor(i,defaultTabColor);
|
tabs->tabBar()->setTabTextColor(i,defaultTabColor);
|
||||||
tabs->tabBar()->setTabTextColor(index,QColor(0,0,200,255));
|
tabs->tabBar()->setTabTextColor(index,QColor(0,0,200,255));
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void qDetectorMain::SetDockableMode(bool b){
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout<<"Setting Dockable Mode to "<<b<<endl;
|
|
||||||
#endif
|
|
||||||
if(b)
|
|
||||||
dockWidgetPlot->setFeatures(QDockWidget::DockWidgetFloatable);
|
|
||||||
else{
|
|
||||||
dockWidgetPlot->setFloating(false);
|
|
||||||
dockWidgetPlot->setFeatures(QDockWidget::NoDockWidgetFeatures);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qDetectorMain::OpenSetup(){
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout<<"Opening Setup"<<endl;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void qDetectorMain::SaveSetup(){
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout<<"Saving Setup"<<endl;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void qDetectorMain::MeasurementWizard(){
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout<<"Measurement Wizard"<<endl;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
void qDetectorMain::OpenConfiguration(){
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout<<"Opening Configuration"<<endl;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void qDetectorMain::SaveConfiguration(){
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout<<"Saving Configuration"<<endl;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void qDetectorMain::EnergyCalibration(){
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout<<"Executing Energy Calibration"<<endl;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void qDetectorMain::AngularCalibration(){
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout<<"Executing Angular Calibration"<<endl;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void qDetectorMain::Version(){
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout<<"Executing Version"<<endl;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void qDetectorMain::About(){
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout<<"Executing About"<<endl;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void qDetectorMain::ResizeMainWindow(bool b){
|
void qDetectorMain::ResizeMainWindow(bool b){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
@ -379,6 +424,9 @@ void qDetectorMain::ResizeMainWindow(bool b){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qDetectorMain::resizeEvent(QResizeEvent* event){
|
void qDetectorMain::resizeEvent(QResizeEvent* event){
|
||||||
if(!dockWidgetPlot->isFloating()){
|
if(!dockWidgetPlot->isFloating()){
|
||||||
if(tabs->currentIndex()== Actions){
|
if(tabs->currentIndex()== Actions){
|
||||||
@ -394,8 +442,10 @@ void qDetectorMain::resizeEvent(QResizeEvent* event){
|
|||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qDetectorMain::EnableTabs(){
|
void qDetectorMain::EnableTabs(){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Entering EnableTabs function"<<endl;
|
cout<<"Entering EnableTabs function"<<endl;
|
||||||
@ -427,6 +477,7 @@ void qDetectorMain::EnableTabs(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@ -437,4 +488,5 @@ void qDetectorMain::SetZoomToolTip(bool disable){
|
|||||||
dockWidgetPlot->setToolTip(zoomToolTip);
|
dockWidgetPlot->setToolTip(zoomToolTip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
/** Qt Project Class Headers */
|
/** Qt Project Class Headers */
|
||||||
#include "qDrawPlot.h"
|
#include "qDrawPlot.h"
|
||||||
#include "qCloneWidget.h"
|
#include "qCloneWidget.h"
|
||||||
|
#include "qDefs.h"
|
||||||
|
#include "slsDetector.h"
|
||||||
/** Project Class Headers */
|
/** Project Class Headers */
|
||||||
#include "slsDetector.h"
|
#include "slsDetector.h"
|
||||||
#include "multiSlsDetector.h"
|
#include "multiSlsDetector.h"
|
||||||
@ -15,6 +17,7 @@
|
|||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <QFileDialog>
|
||||||
/** C++ Include Headers */
|
/** C++ Include Headers */
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -22,7 +25,6 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
qDrawPlot::qDrawPlot(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector){
|
qDrawPlot::qDrawPlot(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector){
|
||||||
@ -73,6 +75,9 @@ void qDrawPlot::SetupWidgetWindow(){
|
|||||||
currentPersistency = 0;
|
currentPersistency = 0;
|
||||||
progress = 0;
|
progress = 0;
|
||||||
plotEnable=true;
|
plotEnable=true;
|
||||||
|
plotExists=false;
|
||||||
|
/** This is so that it initially stop and plots */
|
||||||
|
running = 1;
|
||||||
for(int i=0;i<MAX_1DPLOTS;i++) {histYAxis[i]=0;yvalues[i]=0; }
|
for(int i=0;i<MAX_1DPLOTS;i++) {histYAxis[i]=0;yvalues[i]=0; }
|
||||||
|
|
||||||
/*clone*/
|
/*clone*/
|
||||||
@ -144,9 +149,9 @@ void qDrawPlot::Initialization(){
|
|||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qDrawPlot::StartStopDaqToggle(bool stop_if_running){
|
void qDrawPlot::StartStopDaqToggle(bool stop_if_running){
|
||||||
static bool running = 1;
|
//static bool running = 1;
|
||||||
if(running){ //stopping
|
if(running){ //stopping
|
||||||
StartDaq(0);
|
StartDaq(false);
|
||||||
running=!running;
|
running=!running;
|
||||||
}else if(!stop_if_running){ //then start
|
}else if(!stop_if_running){ //then start
|
||||||
|
|
||||||
@ -199,6 +204,7 @@ int qDrawPlot::ResetDaqForGui(){
|
|||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
bool qDrawPlot::StartOrStopThread(bool start){
|
bool qDrawPlot::StartOrStopThread(bool start){
|
||||||
|
static bool firstTime = true;
|
||||||
static bool gui_acquisition_thread_running = 0;
|
static bool gui_acquisition_thread_running = 0;
|
||||||
static pthread_t gui_acquisition_thread;
|
static pthread_t gui_acquisition_thread;
|
||||||
static pthread_mutex_t gui_acquisition_start_stop_mutex = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t gui_acquisition_start_stop_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
@ -207,13 +213,13 @@ bool qDrawPlot::StartOrStopThread(bool start){
|
|||||||
//stop part, before start or restart
|
//stop part, before start or restart
|
||||||
if(gui_acquisition_thread_running){
|
if(gui_acquisition_thread_running){
|
||||||
cout<<"Stopping current acquisition thread ...."<<endl;
|
cout<<"Stopping current acquisition thread ...."<<endl;
|
||||||
stop_signal = 1;//sort of useless
|
stop_signal = 1;//sorta useless right now
|
||||||
pthread_join(gui_acquisition_thread,NULL); //wait until he's finished, ie. exits
|
|
||||||
gui_acquisition_thread_running = 0;
|
gui_acquisition_thread_running = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//start part
|
//start part
|
||||||
if(start){
|
if(start){
|
||||||
|
|
||||||
/** Defaults */
|
/** Defaults */
|
||||||
progress = 0;
|
progress = 0;
|
||||||
currentFrame = 0;
|
currentFrame = 0;
|
||||||
@ -232,12 +238,14 @@ bool qDrawPlot::StartOrStopThread(bool start){
|
|||||||
/** Setting the callback function to get data from software client*/
|
/** Setting the callback function to get data from software client*/
|
||||||
myDet->registerDataCallback(&(GetDataCallBack),this);
|
myDet->registerDataCallback(&(GetDataCallBack),this);
|
||||||
/** Start acquiring data from server */
|
/** Start acquiring data from server */
|
||||||
|
if(!firstTime) pthread_join(gui_acquisition_thread,NULL);//wait until he's finished, ie. exits
|
||||||
pthread_create(&gui_acquisition_thread, NULL,DataStartAcquireThread, (void*) this);
|
pthread_create(&gui_acquisition_thread, NULL,DataStartAcquireThread, (void*) this);
|
||||||
|
firstTime = false;
|
||||||
/** This is set here and later reset to zero when all the plotting is done
|
/** This is set here and later reset to zero when all the plotting is done
|
||||||
* This is manually done instead of keeping track of thread because
|
* This is manually done instead of keeping track of thread because
|
||||||
* this thread returns immediately after executing the acquire command*/
|
* this thread returns immediately after executing the acquire command*/
|
||||||
gui_acquisition_thread_running=1;
|
gui_acquisition_thread_running=1;
|
||||||
cout<<"Started acquiring threaddd"<<endl;
|
cout<<"Started acquiring threaddd:"<<endl;
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&gui_acquisition_start_stop_mutex);
|
pthread_mutex_unlock(&gui_acquisition_start_stop_mutex);
|
||||||
return gui_acquisition_thread_running;
|
return gui_acquisition_thread_running;
|
||||||
@ -262,9 +270,9 @@ int qDrawPlot::GetDataCallBack(detectorData *data, void *this_pointer){
|
|||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
int qDrawPlot::GetData(detectorData *data){
|
int qDrawPlot::GetData(detectorData *data){
|
||||||
//#ifdef VERYVERBOSE
|
#ifdef VERYVERBOSE
|
||||||
cout<<"Entering GetDatafunction"<<endl;
|
cout<<"Entering GetDatafunction"<<endl;
|
||||||
//#endif
|
#endif
|
||||||
|
|
||||||
progress=(int)data->progressIndex;
|
progress=(int)data->progressIndex;
|
||||||
|
|
||||||
@ -332,6 +340,9 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
|
|
||||||
void qDrawPlot::setNumMeasurements(int num){
|
void qDrawPlot::setNumMeasurements(int num){
|
||||||
number_of_measurements = num;
|
number_of_measurements = num;
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Setting Number of Measurements to " <<num<<endl;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -366,7 +377,6 @@ void qDrawPlot::Clear1DPlot(){
|
|||||||
|
|
||||||
void qDrawPlot::UpdatePlot(){
|
void qDrawPlot::UpdatePlot(){
|
||||||
//static int last_plot_number = 0;
|
//static int last_plot_number = 0;
|
||||||
|
|
||||||
plot_update_timer->stop();
|
plot_update_timer->stop();
|
||||||
if(plotEnable){
|
if(plotEnable){
|
||||||
LockLastImageArray();
|
LockLastImageArray();
|
||||||
@ -392,6 +402,8 @@ void qDrawPlot::UpdatePlot(){
|
|||||||
h->Attach(plot1D);
|
h->Attach(plot1D);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/**plot exists is false in the beginning, right after cloning and when no plot is checked*/
|
||||||
|
plotExists=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -407,14 +419,15 @@ void qDrawPlot::UpdatePlot(){
|
|||||||
plot2D->SetZTitle(imageZAxisTitle);
|
plot2D->SetZTitle(imageZAxisTitle);
|
||||||
plot2D->UpdateNKeepSetRangeIfSet(); //this will keep a "set" z range, and call Plot()->Update();
|
plot2D->UpdateNKeepSetRangeIfSet(); //this will keep a "set" z range, and call Plot()->Update();
|
||||||
}
|
}
|
||||||
|
/**plot exists is false in the beginning, right after cloning and when no plot is checked*/
|
||||||
|
plotExists=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
last_plot_number=lastImageNumber;
|
last_plot_number=lastImageNumber;
|
||||||
|
|
||||||
if(plotEnable) UnlockLastImageArray();
|
if(plotEnable) UnlockLastImageArray();
|
||||||
|
|
||||||
/** Measurement not over, continue*/
|
/** Measurement not over, continue*/
|
||||||
if(number_of_exposures!=last_plot_number){
|
if(number_of_exposures!=currentFrame){//las plot number?
|
||||||
plot_update_timer->start(500);
|
plot_update_timer->start(500);
|
||||||
}
|
}
|
||||||
/** if a measurement is over */
|
/** if a measurement is over */
|
||||||
@ -428,7 +441,6 @@ void qDrawPlot::UpdatePlot(){
|
|||||||
}/** To start the next measurement*/
|
}/** To start the next measurement*/
|
||||||
else{
|
else{
|
||||||
StopDaqForGui();
|
StopDaqForGui();
|
||||||
//StartDaq(false);
|
|
||||||
StartDaq(true);
|
StartDaq(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -457,7 +469,10 @@ void qDrawPlot::ClonePlot(){
|
|||||||
}
|
}
|
||||||
/** save height to keep maintain same height of plot */
|
/** save height to keep maintain same height of plot */
|
||||||
int preheight = height();
|
int preheight = height();
|
||||||
|
|
||||||
/** create clone */
|
/** create clone */
|
||||||
|
/** plotexists is true after calling updateplot*/
|
||||||
|
plotExists=false;
|
||||||
winClone[i] = new qCloneWidget(this,i,boxPlot->title(),(int)plot_in_scope,plot1D,plot2D,myDet->getFilePath());
|
winClone[i] = new qCloneWidget(this,i,boxPlot->title(),(int)plot_in_scope,plot1D,plot2D,myDet->getFilePath());
|
||||||
if(plot_in_scope==1){
|
if(plot_in_scope==1){
|
||||||
plot1D = new SlsQt1DPlot(boxPlot);
|
plot1D = new SlsQt1DPlot(boxPlot);
|
||||||
@ -465,7 +480,7 @@ void qDrawPlot::ClonePlot(){
|
|||||||
plot1D->SetXTitle(histXAxisTitle.toAscii().constData());
|
plot1D->SetXTitle(histXAxisTitle.toAscii().constData());
|
||||||
plot1D->SetYTitle(histYAxisTitle.toAscii().constData());
|
plot1D->SetYTitle(histYAxisTitle.toAscii().constData());
|
||||||
plotLayout->addWidget(plot1D,1,1,1,1);
|
plotLayout->addWidget(plot1D,1,1,1,1);
|
||||||
winClone[i]->SetCloneHists((int)nHists,histNBins,histXAxis,histYAxis,histTitle);
|
if(running) winClone[i]->SetCloneHists((int)nHists,histNBins,histXAxis,histYAxis,histTitle);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
plot2D = new SlsQt2DPlotLayout(boxPlot);
|
plot2D = new SlsQt2DPlotLayout(boxPlot);
|
||||||
@ -478,8 +493,9 @@ void qDrawPlot::ClonePlot(){
|
|||||||
}
|
}
|
||||||
setMinimumHeight(preheight);
|
setMinimumHeight(preheight);
|
||||||
resize(width(),preheight);
|
resize(width(),preheight);
|
||||||
/** update the actual plot */
|
|
||||||
UpdatePlot();
|
/** update the actual plot only if running, else it doesnt know when its over*/
|
||||||
|
if(running) UpdatePlot();
|
||||||
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)));
|
||||||
@ -509,11 +525,21 @@ void qDrawPlot::CloneCloseEvent(int id){
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qDrawPlot::SavePlot(QString FName){
|
void qDrawPlot::SavePlot(){
|
||||||
|
/** render image */
|
||||||
QImage img(size().width(),size().height(),QImage::Format_RGB32);
|
QImage img(size().width(),size().height(),QImage::Format_RGB32);
|
||||||
QPainter painter(&img);
|
QPainter painter(&img);
|
||||||
render(&painter);
|
render(&painter);
|
||||||
img.save(FName);
|
|
||||||
|
/** save image*/
|
||||||
|
QString fName = QString(myDet->getFilePath().c_str())+"/Image.png";
|
||||||
|
fName = QFileDialog::getSaveFileName(this,tr("Save Image"),fName,tr("Images (*.png *.xpm *.jpg)"));
|
||||||
|
if (!fName.isEmpty())
|
||||||
|
if(img.save(fName))
|
||||||
|
qDefs::InfoMessage("The Image has been successfully saved","Dock: Information");
|
||||||
|
else
|
||||||
|
qDefs::ErrorMessage("ERROR: Attempt to save image failed. Wrong Format","Dock: WARNING");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -532,7 +558,10 @@ void qDrawPlot::EnablePlot(bool enable){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Plotting set to:"<<enable<<endl;
|
cout<<"Plotting set to:"<<enable<<endl;
|
||||||
#endif
|
#endif
|
||||||
plotEnable = !enable;
|
plotEnable = enable;
|
||||||
|
/**if no plot, cant do setting range.
|
||||||
|
* not true vice versa where plot was false and now set it to true*/
|
||||||
|
if(!enable) plotExists=false;
|
||||||
Clear1DPlot();
|
Clear1DPlot();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -232,4 +232,11 @@ void qTabActions::ChangeStepSize(bool b){
|
|||||||
|
|
||||||
//if(!QString::compare(btntry->text(),"+")){
|
//if(!QString::compare(btntry->text(),"+")){
|
||||||
*/
|
*/
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void qTabActions::Refresh(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -76,4 +76,13 @@ void qTabAdvanced::getTemperature(){
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void qTabAdvanced::Refresh(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
qTabDataOutput::qTabDataOutput(QWidget *parent,slsDetectorUtils*& detector):
|
qTabDataOutput::qTabDataOutput(QWidget *parent,slsDetectorUtils*& detector):
|
||||||
@ -27,6 +28,7 @@ qTabDataOutput::qTabDataOutput(QWidget *parent,slsDetectorUtils*& detector):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
qTabDataOutput::~qTabDataOutput(){
|
qTabDataOutput::~qTabDataOutput(){
|
||||||
@ -34,14 +36,16 @@ qTabDataOutput::~qTabDataOutput(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::SetupWidgetWindow(){
|
void qTabDataOutput::SetupWidgetWindow(){
|
||||||
outputDir= QString(myDet->getFilePath().c_str());
|
dispOutputDir->setText(QString(myDet->getFilePath().c_str()));
|
||||||
dispOutputDir->setText(outputDir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::Initialization(){
|
void qTabDataOutput::Initialization(){
|
||||||
connect(dispOutputDir, SIGNAL(textChanged(const QString&)), this, SLOT(setOutputDir(const QString&)));
|
connect(dispOutputDir, SIGNAL(textChanged(const QString&)), this, SLOT(setOutputDir(const QString&)));
|
||||||
@ -49,22 +53,29 @@ void qTabDataOutput::Initialization(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
void qTabDataOutput::Enable(bool enable){
|
|
||||||
layoutOutput->setEnabled(enable);
|
|
||||||
boxCorrection->setEnabled(enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::setOutputDir(const QString& path){
|
void qTabDataOutput::setOutputDir(const QString& path){
|
||||||
outputDir = path;
|
myDet->setFilePath(string(path.toAscii().constData()));
|
||||||
myDet->setFilePath(string(outputDir.toAscii().constData()));
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Output Directory changed to :"<<myDet->getFilePath()<<endl;
|
cout<<"Output Directory changed to :"<<myDet->getFilePath()<<endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void qTabDataOutput::Refresh(){
|
||||||
|
/** output dir*/
|
||||||
|
dispOutputDir->setText(QString(myDet->getFilePath().c_str()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabDataOutput::browseOutputDir()
|
void qTabDataOutput::browseOutputDir()
|
||||||
{
|
{
|
||||||
QString directory = QFileDialog::getExistingDirectory(this,tr("Choose Output Directory "),dispOutputDir->text());
|
QString directory = QFileDialog::getExistingDirectory(this,tr("Choose Output Directory "),dispOutputDir->text());
|
||||||
@ -73,3 +84,4 @@ void qTabDataOutput::browseOutputDir()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -48,3 +48,13 @@ void qTabDebugging::Enable(bool enable){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void qTabDebugging::Refresh(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -41,5 +41,14 @@ void qTabDeveloper::SetupWidgetWindow(){
|
|||||||
void qTabDeveloper::Initialization(){
|
void qTabDeveloper::Initialization(){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void qTabDeveloper::Refresh(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ void qTabMeasurement::setExposureTime(){
|
|||||||
/** Get the value of timer in ns **/
|
/** Get the value of timer in ns **/
|
||||||
exptimeNS = (int64_t)qDefs::getNSTime((qDefs::timeUnit)comboExpUnit->currentIndex(),spinExpTime->value());
|
exptimeNS = (int64_t)qDefs::getNSTime((qDefs::timeUnit)comboExpUnit->currentIndex(),spinExpTime->value());
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Setting acquisition time to " << exptimeNS << " clocks" << endl;
|
cout<<"Setting acquisition time to " << exptimeNS << " clocks" << "/"<<spinExpTime->value()<<qDefs::getUnitString((qDefs::timeUnit)comboExpUnit->currentIndex())<<endl;
|
||||||
#endif
|
#endif
|
||||||
myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,exptimeNS);
|
myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,exptimeNS);
|
||||||
|
|
||||||
@ -312,12 +312,12 @@ void qTabMeasurement::setExposureTime(){
|
|||||||
if(exptimeNS>acqtimeNS) {
|
if(exptimeNS>acqtimeNS) {
|
||||||
lblNote->show();
|
lblNote->show();
|
||||||
lblPeriod->setPalette(lblNote->palette());
|
lblPeriod->setPalette(lblNote->palette());
|
||||||
lblPeriod->setText("* Acquisition Period");
|
lblPeriod->setText("Acquisition Period:*");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lblNote->hide();
|
lblNote->hide();
|
||||||
lblPeriod->setPalette(lblNumFrames->palette());
|
lblPeriod->setPalette(lblNumFrames->palette());
|
||||||
lblPeriod->setText("Acquisition Period");
|
lblPeriod->setText("Acquisition Period:");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -329,7 +329,7 @@ void qTabMeasurement::setAcquisitionPeriod(){
|
|||||||
/** Get the value of timer in ns **/
|
/** Get the value of timer in ns **/
|
||||||
acqtimeNS = (int64_t)qDefs::getNSTime((qDefs::timeUnit)comboPeriodUnit->currentIndex(),spinPeriod->value());
|
acqtimeNS = (int64_t)qDefs::getNSTime((qDefs::timeUnit)comboPeriodUnit->currentIndex(),spinPeriod->value());
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Setting frame period between exposures to " << acqtimeNS << " clocks" << endl;
|
cout<<"Setting frame period between exposures to " << acqtimeNS << " clocks"<< "/"<<spinPeriod->value()<<qDefs::getUnitString((qDefs::timeUnit)comboPeriodUnit->currentIndex())<<endl;
|
||||||
#endif
|
#endif
|
||||||
myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,acqtimeNS);
|
myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,acqtimeNS);
|
||||||
|
|
||||||
@ -338,12 +338,12 @@ void qTabMeasurement::setAcquisitionPeriod(){
|
|||||||
if(exptimeNS>acqtimeNS){
|
if(exptimeNS>acqtimeNS){
|
||||||
lblNote->show();
|
lblNote->show();
|
||||||
lblPeriod->setPalette(lblNote->palette());
|
lblPeriod->setPalette(lblNote->palette());
|
||||||
lblPeriod->setText("* Acquisition Period");
|
lblPeriod->setText("Acquisition Period:*");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lblNote->hide();
|
lblNote->hide();
|
||||||
lblPeriod->setPalette(lblNumFrames->palette());
|
lblPeriod->setPalette(lblNumFrames->palette());
|
||||||
lblPeriod->setText("Acquisition Period");
|
lblPeriod->setText("Acquisition Period:");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,7 +363,7 @@ void qTabMeasurement::setDelay(){
|
|||||||
/** Get the value of timer in ns **/
|
/** Get the value of timer in ns **/
|
||||||
exptimeNS = (int64_t)qDefs::getNSTime((qDefs::timeUnit)comboDelayUnit->currentIndex(),spinDelay->value());
|
exptimeNS = (int64_t)qDefs::getNSTime((qDefs::timeUnit)comboDelayUnit->currentIndex(),spinDelay->value());
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Setting delay after trigger to " << exptimeNS << " clocks" << endl;
|
cout<<"Setting delay after trigger to " << exptimeNS << " clocks"<< "/"<<spinDelay->value()<<qDefs::getUnitString((qDefs::timeUnit)comboDelayUnit->currentIndex())<<endl;
|
||||||
#endif
|
#endif
|
||||||
myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,exptimeNS);
|
myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,exptimeNS);
|
||||||
}
|
}
|
||||||
@ -496,7 +496,7 @@ void qTabMeasurement::setTimingMode(int mode){
|
|||||||
if(lblExpTime->isEnabled()){
|
if(lblExpTime->isEnabled()){
|
||||||
time = qDefs::getCorrectTime(unit,((float)(myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,-1)*(1E-9))));
|
time = qDefs::getCorrectTime(unit,((float)(myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,-1)*(1E-9))));
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Getting acquisition time : " << time << "s" << endl;
|
cout<<"Getting acquisition time : " << time << qDefs::getUnitString(unit) << endl;
|
||||||
#endif
|
#endif
|
||||||
spinExpTime->setValue(time);
|
spinExpTime->setValue(time);
|
||||||
comboExpUnit->setCurrentIndex((int)unit);
|
comboExpUnit->setCurrentIndex((int)unit);
|
||||||
@ -506,7 +506,7 @@ void qTabMeasurement::setTimingMode(int mode){
|
|||||||
if(lblPeriod->isEnabled()){
|
if(lblPeriod->isEnabled()){
|
||||||
time = qDefs::getCorrectTime(unit,((float)(myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,-1)*(1E-9))));
|
time = qDefs::getCorrectTime(unit,((float)(myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,-1)*(1E-9))));
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Getting frame period between exposures : " << time << "s" << endl;
|
cout<<"Getting frame period between exposures : " << time << qDefs::getUnitString(unit) << endl;
|
||||||
#endif
|
#endif
|
||||||
spinPeriod->setValue(time);
|
spinPeriod->setValue(time);
|
||||||
comboPeriodUnit->setCurrentIndex((int)unit);
|
comboPeriodUnit->setCurrentIndex((int)unit);
|
||||||
@ -517,17 +517,17 @@ void qTabMeasurement::setTimingMode(int mode){
|
|||||||
if(exptimeNS>acqtimeNS) {
|
if(exptimeNS>acqtimeNS) {
|
||||||
lblNote->show();
|
lblNote->show();
|
||||||
lblPeriod->setPalette(lblNote->palette());
|
lblPeriod->setPalette(lblNote->palette());
|
||||||
lblPeriod->setText("* Acquisition Period");
|
lblPeriod->setText("Acquisition Period:*");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lblNote->hide();
|
lblNote->hide();
|
||||||
lblPeriod->setPalette(lblNumFrames->palette());
|
lblPeriod->setPalette(lblNumFrames->palette());
|
||||||
lblPeriod->setText("Acquisition Period");
|
lblPeriod->setText("Acquisition Period:");
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
lblNote->hide();
|
lblNote->hide();
|
||||||
lblPeriod->setPalette(lblNumFrames->palette());
|
lblPeriod->setPalette(lblNumFrames->palette());
|
||||||
lblPeriod->setText("Acquisition Period");
|
lblPeriod->setText("Acquisition Period:");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**Number of Triggers */
|
/**Number of Triggers */
|
||||||
@ -543,7 +543,7 @@ void qTabMeasurement::setTimingMode(int mode){
|
|||||||
if(lblDelay->isEnabled()){
|
if(lblDelay->isEnabled()){
|
||||||
time = qDefs::getCorrectTime(unit,((float)(myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,-1)*(1E-9))));
|
time = qDefs::getCorrectTime(unit,((float)(myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,-1)*(1E-9))));
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Getting delay after trigger : " << time << "s" << endl;
|
cout<<"Getting delay after trigger : " << time << qDefs::getUnitString(unit) << endl;
|
||||||
#endif
|
#endif
|
||||||
spinDelay->setValue(time);
|
spinDelay->setValue(time);
|
||||||
comboDelayUnit->setCurrentIndex((int)unit);
|
comboDelayUnit->setCurrentIndex((int)unit);
|
||||||
@ -574,4 +574,22 @@ void qTabMeasurement::setTimingMode(int mode){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void qTabMeasurement::Refresh(){
|
||||||
|
/** File Name **/
|
||||||
|
dispFileName->setText(QString(myDet->getFileName().c_str()));
|
||||||
|
/** File Index **/
|
||||||
|
spinIndex->setValue(myDet->getFileIndex());
|
||||||
|
/** progress label index **/
|
||||||
|
lblProgressIndex->setText(QString::number(myDet->getFileIndex()));
|
||||||
|
/** Progress bar **/
|
||||||
|
progressBar->setValue(myDet->getCurrentProgress());
|
||||||
|
/** Timing mode**/
|
||||||
|
SetupTimingMode();//comboTimingMode->setCurrentIndex((int)myDet->setExternalCommunicationMode());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -5,25 +5,26 @@
|
|||||||
* Author: l_maliakal_d
|
* Author: l_maliakal_d
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** Qt Project Class Headers */
|
||||||
#include "qTabMessages.h"
|
#include "qTabMessages.h"
|
||||||
|
#include "qDefs.h"
|
||||||
/** Project Class Headers */
|
/** Project Class Headers */
|
||||||
#include "slsDetector.h"
|
#include "slsDetector.h"
|
||||||
#include "multiSlsDetector.h"
|
#include "multiSlsDetector.h"
|
||||||
/** Qt Include Headers */
|
/** Qt Include Headers */
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QLabel>
|
#include <QFile>
|
||||||
#include <QSpacerItem>
|
#include <QTextStream>
|
||||||
#include <QDir>
|
#include <QFileDialog>
|
||||||
#include <QProcess>
|
#include <QSizePolicy>
|
||||||
#include <QStringList>
|
|
||||||
/** C++ Include Headers */
|
/** C++ Include Headers */
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
qTabMessages::qTabMessages(QWidget *parent,slsDetectorUtils*& detector):
|
qTabMessages::qTabMessages(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector){
|
||||||
QWidget(parent),myDet(detector){
|
|
||||||
SetupWidgetWindow();
|
SetupWidgetWindow();
|
||||||
Initialization();
|
Initialization();
|
||||||
}
|
}
|
||||||
@ -33,8 +34,6 @@ qTabMessages::qTabMessages(QWidget *parent,slsDetectorUtils*& detector):
|
|||||||
qTabMessages::~qTabMessages(){
|
qTabMessages::~qTabMessages(){
|
||||||
delete myDet;
|
delete myDet;
|
||||||
delete dispLog;
|
delete dispLog;
|
||||||
delete dispCommand;
|
|
||||||
delete dispPath;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -42,88 +41,71 @@ qTabMessages::~qTabMessages(){
|
|||||||
void qTabMessages::SetupWidgetWindow(){
|
void qTabMessages::SetupWidgetWindow(){
|
||||||
/** Layout */
|
/** Layout */
|
||||||
QGridLayout *gridLayout = new QGridLayout(this);
|
QGridLayout *gridLayout = new QGridLayout(this);
|
||||||
QLabel *lblCommand = new QLabel("System Command:",this);
|
|
||||||
QLabel *lblPath = new QLabel("Working Directory:",this);
|
|
||||||
QSpacerItem *hSpacer= new QSpacerItem(20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum);
|
|
||||||
dispLog = new QTextEdit(this);
|
|
||||||
dispCommand = new QLineEdit(this);
|
|
||||||
dispPath = new QLineEdit(this);
|
|
||||||
dispLog->setReadOnly(true);
|
|
||||||
dispPath->setReadOnly(true);
|
|
||||||
dispLog->setFocusPolicy(Qt::NoFocus);
|
|
||||||
dispPath->setFocusPolicy(Qt::NoFocus);
|
|
||||||
gridLayout->addWidget(dispLog, 0, 0, 1, 3);
|
|
||||||
gridLayout->addWidget(lblCommand, 1, 0, 1, 1);
|
|
||||||
gridLayout->addItem(hSpacer, 1, 1, 1, 1);
|
|
||||||
gridLayout->addWidget(dispCommand, 1, 2, 1, 1);
|
|
||||||
gridLayout->addWidget(lblPath, 2, 0, 1, 1);
|
|
||||||
gridLayout->addWidget(dispPath, 2, 2, 1, 1);
|
|
||||||
|
|
||||||
/** Command & Path*/
|
dispLog = new QTextEdit(this);
|
||||||
dispCommand->setText("Insert your command here");
|
dispLog->setReadOnly(true);
|
||||||
dispPath->setText(QDir("./").absolutePath());
|
dispLog->setFocusPolicy(Qt::NoFocus);
|
||||||
|
|
||||||
|
QSizePolicy sizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||||
|
|
||||||
|
btnSave = new QPushButton("Save Log",this);
|
||||||
|
btnSave->setFocusPolicy(Qt::NoFocus);
|
||||||
|
btnSave->setSizePolicy(sizePolicy);
|
||||||
|
|
||||||
|
btnClear = new QPushButton("Clear",this);
|
||||||
|
btnClear->setFocusPolicy(Qt::NoFocus);
|
||||||
|
btnClear->setSizePolicy(sizePolicy);
|
||||||
|
|
||||||
|
gridLayout->addWidget(btnSave,0,0,1,1);
|
||||||
|
gridLayout->addWidget(btnClear,0,4,1,1);
|
||||||
|
gridLayout->addWidget(dispLog,1,0,1,5);
|
||||||
|
|
||||||
|
qout=new qDebugStream(std::cout,this);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qTabMessages::Initialization(){
|
void qTabMessages::Initialization(){
|
||||||
connect(dispCommand,SIGNAL(returnPressed()),this,SLOT(executeCommand()));
|
connect(btnSave,SIGNAL(clicked()),this,SLOT(SaveLog()));
|
||||||
|
connect(btnClear,SIGNAL(clicked()),this,SLOT(ClearLog()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qTabMessages::executeCommand(){
|
void qTabMessages::customEvent(QEvent *e) {
|
||||||
#ifdef VERBOSE
|
if (e->type() == STREAMEVENT)
|
||||||
cout<<"Calling: "<< dispCommand->text().toAscii().constData()<<endl;
|
dispLog->append(((qStreamEvent*)e)->getString());
|
||||||
#endif
|
|
||||||
QProcess proc(this);
|
|
||||||
#ifdef VERBOSE
|
|
||||||
//std::cout <<"working directory would be " << proc.workingDirectory().absPath() << std::endl;
|
|
||||||
cout<<"Original Working Directory: "<< proc.workingDirectory().toAscii().constData()<<endl;
|
|
||||||
#endif
|
|
||||||
proc.setWorkingDirectory(QDir(dispPath->text()).absolutePath());
|
|
||||||
#ifdef VERBOSE
|
|
||||||
//std::cout <<"working directory is " << proc.workingDirectory().absPath() << std::endl;
|
|
||||||
cout<<"Current Working Directory: "<<proc.workingDirectory().toAscii().constData()<<endl;
|
|
||||||
#endif
|
|
||||||
proc.setArguments(QStringList::split(' ',dispCommand->text()));
|
|
||||||
#ifdef VERBOSE
|
|
||||||
/* QStringList list = proc.arguments();
|
|
||||||
QStringList::Iterator it = list.begin();
|
|
||||||
while( it != list.end() ) {
|
|
||||||
cout<<*it<<endl;
|
|
||||||
++it;
|
|
||||||
}*/
|
|
||||||
#endif
|
|
||||||
//if (!proc.start()) {
|
|
||||||
if(!(proc.state()==QProcess::Running)){
|
|
||||||
// error handling
|
|
||||||
cout<<"Could not launch process"<<endl;
|
|
||||||
} else {
|
|
||||||
//while(proc.isRunning()) {
|
|
||||||
while(proc.state()==QProcess::Running){
|
|
||||||
;
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout<<"Process running "<< proc.exitStatus()<< endl;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
//if (proc.normalExit()) {
|
|
||||||
if(proc.exitStatus()==QProcess::NormalExit){
|
|
||||||
;
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout<<" process returned OK"<<endl;
|
|
||||||
#endif
|
|
||||||
} else
|
|
||||||
cout<<" process returned error"<<endl;
|
|
||||||
while (proc.canReadLineStdout()) {//readAllStandardOutput ()
|
|
||||||
cout<<proc.readLineStdout() <<endl;
|
|
||||||
}
|
|
||||||
while (proc.canReadLineStderr()) {
|
|
||||||
cout<<"Error: "<<proc.readLineStderr() <<endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void qTabMessages::SaveLog() {
|
||||||
|
QString fName = QString(myDet->getFilePath().c_str());
|
||||||
|
fName = fName+"/LogFile.txt";
|
||||||
|
fName = QFileDialog::getSaveFileName(this,tr("Save Snapshot "),
|
||||||
|
fName,tr("Text files (*.txt)"));
|
||||||
|
if (!fName.isEmpty()){
|
||||||
|
QFile outfile;
|
||||||
|
outfile.setFileName(fName);
|
||||||
|
if(outfile.open(QIODevice::WriteOnly | QIODevice::Text)){//Append
|
||||||
|
QTextStream out(&outfile);
|
||||||
|
out<<dispLog->toPlainText() << endl;
|
||||||
|
qDefs::InfoMessage(string("The Log has been successfully saved to "
|
||||||
|
"")+fName.toAscii().constData(),"Messages: Information");
|
||||||
|
}
|
||||||
|
else qDefs::ErrorMessage("ERROR: Attempt to save log file failed.","Messages: WARNING");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void qTabMessages::ClearLog() {
|
||||||
|
dispLog->clear();
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Log Cleared"<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -11,11 +11,13 @@
|
|||||||
/** Project Class Headers */
|
/** Project Class Headers */
|
||||||
#include "slsDetector.h"
|
#include "slsDetector.h"
|
||||||
#include "multiSlsDetector.h"
|
#include "multiSlsDetector.h"
|
||||||
|
/** Qt Include Headers */
|
||||||
/** C++ Include Headers */
|
/** C++ Include Headers */
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
QString qTabPlot::defaultPlotTitle("Measurement");
|
QString qTabPlot::defaultPlotTitle("Measurement");
|
||||||
@ -26,6 +28,9 @@ QString qTabPlot::defaultImageYAxisTitle("Pixel");
|
|||||||
QString qTabPlot::defaultImageZAxisTitle("Intensity");
|
QString qTabPlot::defaultImageZAxisTitle("Intensity");
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
qTabPlot::qTabPlot(QWidget *parent,slsDetectorUtils*& detector, qDrawPlot*& plot):QWidget(parent),myDet(detector),myPlot(plot){
|
qTabPlot::qTabPlot(QWidget *parent,slsDetectorUtils*& detector, qDrawPlot*& plot):QWidget(parent),myDet(detector),myPlot(plot){
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
SetupWidgetWindow();
|
SetupWidgetWindow();
|
||||||
@ -42,6 +47,7 @@ qTabPlot::qTabPlot(QWidget *parent,slsDetectorUtils*& detector, qDrawPlot*& plot
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
qTabPlot::~qTabPlot(){
|
qTabPlot::~qTabPlot(){
|
||||||
@ -50,6 +56,7 @@ qTabPlot::~qTabPlot(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabPlot::SetupWidgetWindow(){
|
void qTabPlot::SetupWidgetWindow(){
|
||||||
@ -75,8 +82,11 @@ void qTabPlot::SetupWidgetWindow(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabPlot::Select1DPlot(bool b){
|
void qTabPlot::Select1DPlot(bool b){
|
||||||
SetupWidgetWindow();
|
isOneD = b;
|
||||||
if(b){
|
if(b){
|
||||||
box1D->setEnabled(true);
|
box1D->setEnabled(true);
|
||||||
box2D->setEnabled(false);
|
box2D->setEnabled(false);
|
||||||
@ -105,9 +115,16 @@ void qTabPlot::Select1DPlot(bool b){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabPlot::Initialization(){
|
void qTabPlot::Initialization(){
|
||||||
/** Plot arguments box*/
|
/** Plot arguments box*/
|
||||||
connect(chkNoPlot, SIGNAL(toggled(bool)),myPlot, SLOT(EnablePlot(bool)));
|
connect(radioNoPlot, SIGNAL(clicked()),this, SLOT(SetPlot()));
|
||||||
|
connect(radioHistogram, SIGNAL(clicked()),this, SLOT(SetPlot()));
|
||||||
|
connect(radioDataGraph, SIGNAL(clicked()),this, SLOT(SetPlot()));
|
||||||
|
/** Scan box*/
|
||||||
|
//connect(radioNoPlot, SIGNAL(toggled(bool)),this, SLOT(EnablePlot(bool)));
|
||||||
/** Snapshot box*/
|
/** Snapshot box*/
|
||||||
connect(btnClone, SIGNAL(clicked()),myPlot, SLOT(ClonePlot()));
|
connect(btnClone, SIGNAL(clicked()),myPlot, SLOT(ClonePlot()));
|
||||||
connect(btnCloseClones, SIGNAL(clicked()),myPlot, SLOT(CloseClones()));
|
connect(btnCloseClones, SIGNAL(clicked()),myPlot, SLOT(CloseClones()));
|
||||||
@ -147,21 +164,13 @@ void qTabPlot::Initialization(){
|
|||||||
connect(this, SIGNAL(SetZRangeSignal(double,double)),myPlot, SIGNAL(SetZRangeSignal(double,double)));
|
connect(this, SIGNAL(SetZRangeSignal(double,double)),myPlot, SIGNAL(SetZRangeSignal(double,double)));
|
||||||
|
|
||||||
/** Common Buttons*/
|
/** Common Buttons*/
|
||||||
connect(btnClear, SIGNAL(clicked()), myPlot, SLOT(Clear1DPlot()));
|
|
||||||
/** Save */
|
/** Save */
|
||||||
connect(btnSave, SIGNAL(clicked()), this, SLOT(SavePlot()));
|
connect(btnSave, SIGNAL(clicked()), myPlot, SLOT(SavePlot()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qTabPlot::Enable(bool enable){
|
|
||||||
btnClone->setEnabled(enable);
|
|
||||||
btnCloseClones->setEnabled(enable);
|
|
||||||
box1D->setEnabled(enable);
|
|
||||||
box2D->setEnabled(enable);
|
|
||||||
boxPlotAxis->setEnabled(enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
void qTabPlot::EnablePersistency(bool enable){
|
void qTabPlot::EnablePersistency(bool enable){
|
||||||
lblPersistency->setEnabled(enable);
|
lblPersistency->setEnabled(enable);
|
||||||
@ -172,19 +181,21 @@ void qTabPlot::EnablePersistency(bool enable){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabPlot::SetTitles(){
|
void qTabPlot::SetTitles(){
|
||||||
int oneD = box1D->isEnabled();
|
|
||||||
/** Plot Title*/
|
/** Plot Title*/
|
||||||
if(dispTitle->isEnabled())
|
if(dispTitle->isEnabled())
|
||||||
myPlot->SetPlotTitle(dispTitle->text());
|
myPlot->SetPlotTitle(dispTitle->text());
|
||||||
/** X Axis */
|
/** X Axis */
|
||||||
if(dispXAxis->isEnabled()){
|
if(dispXAxis->isEnabled()){
|
||||||
if(oneD) myPlot->SetHistXAxisTitle(dispXAxis->text());
|
if(isOneD) myPlot->SetHistXAxisTitle(dispXAxis->text());
|
||||||
else myPlot->SetImageXAxisTitle(dispXAxis->text());
|
else myPlot->SetImageXAxisTitle(dispXAxis->text());
|
||||||
}
|
}
|
||||||
/** Y Axis */
|
/** Y Axis */
|
||||||
if(dispYAxis->isEnabled()){
|
if(dispYAxis->isEnabled()){
|
||||||
if(oneD) myPlot->SetHistYAxisTitle(dispYAxis->text());
|
if(isOneD) myPlot->SetHistYAxisTitle(dispYAxis->text());
|
||||||
else myPlot->SetImageYAxisTitle(dispYAxis->text());
|
else myPlot->SetImageYAxisTitle(dispYAxis->text());
|
||||||
}
|
}
|
||||||
/** Z Axis */
|
/** Z Axis */
|
||||||
@ -193,9 +204,10 @@ void qTabPlot::SetTitles(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabPlot::EnableTitles(){
|
void qTabPlot::EnableTitles(){
|
||||||
int oneD = box1D->isEnabled();
|
|
||||||
/** Plot Title*/
|
/** Plot Title*/
|
||||||
dispTitle->setEnabled(chkTitle->isChecked());
|
dispTitle->setEnabled(chkTitle->isChecked());
|
||||||
if(!chkTitle->isChecked()){
|
if(!chkTitle->isChecked()){
|
||||||
@ -205,7 +217,7 @@ void qTabPlot::EnableTitles(){
|
|||||||
/** X Axis */
|
/** X Axis */
|
||||||
dispXAxis->setEnabled(chkXAxis->isChecked());
|
dispXAxis->setEnabled(chkXAxis->isChecked());
|
||||||
if(!chkXAxis->isChecked()){
|
if(!chkXAxis->isChecked()){
|
||||||
if(oneD){
|
if(isOneD){
|
||||||
myPlot->SetHistXAxisTitle(defaultHistXAxisTitle);
|
myPlot->SetHistXAxisTitle(defaultHistXAxisTitle);
|
||||||
dispXAxis->setText(defaultHistXAxisTitle);
|
dispXAxis->setText(defaultHistXAxisTitle);
|
||||||
}
|
}
|
||||||
@ -217,7 +229,7 @@ void qTabPlot::EnableTitles(){
|
|||||||
/** Y Axis */
|
/** Y Axis */
|
||||||
dispYAxis->setEnabled(chkYAxis->isChecked());
|
dispYAxis->setEnabled(chkYAxis->isChecked());
|
||||||
if(!chkYAxis->isChecked()){
|
if(!chkYAxis->isChecked()){
|
||||||
if(oneD){
|
if(isOneD){
|
||||||
myPlot->SetHistYAxisTitle(defaultHistYAxisTitle);
|
myPlot->SetHistYAxisTitle(defaultHistYAxisTitle);
|
||||||
dispYAxis->setText(defaultHistYAxisTitle);
|
dispYAxis->setText(defaultHistYAxisTitle);
|
||||||
}else{
|
}else{
|
||||||
@ -234,6 +246,7 @@ void qTabPlot::EnableTitles(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabPlot::EnableRange(){
|
void qTabPlot::EnableRange(){
|
||||||
@ -253,6 +266,8 @@ void qTabPlot::EnableRange(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabPlot::SetAxesRange(){
|
void qTabPlot::SetAxesRange(){
|
||||||
double xmin=0,xmax=0,ymin=0,ymax=0;
|
double xmin=0,xmax=0,ymin=0,ymax=0;
|
||||||
@ -260,28 +275,40 @@ void qTabPlot::SetAxesRange(){
|
|||||||
/** If disabled, get the min or max range of the plot as default */
|
/** If disabled, get the min or max range of the plot as default */
|
||||||
if((dispXMin->isEnabled())&&(!dispXMin->text().isEmpty()))
|
if((dispXMin->isEnabled())&&(!dispXMin->text().isEmpty()))
|
||||||
xmin = dispXMin->text().toDouble();
|
xmin = dispXMin->text().toDouble();
|
||||||
else xmin = myPlot->GetXMinimum();
|
else if(myPlot->DoesPlotExist())
|
||||||
|
xmin = myPlot->GetXMinimum();
|
||||||
if((dispXMax->isEnabled())&&(!dispXMax->text().isEmpty()))
|
if((dispXMax->isEnabled())&&(!dispXMax->text().isEmpty()))
|
||||||
xmax = dispXMax->text().toDouble();
|
xmax = dispXMax->text().toDouble();
|
||||||
else xmax = myPlot->GetXMaximum();
|
else if(myPlot->DoesPlotExist())
|
||||||
|
xmax = myPlot->GetXMaximum();
|
||||||
if((dispYMin->isEnabled())&&(!dispYMin->text().isEmpty()))
|
if((dispYMin->isEnabled())&&(!dispYMin->text().isEmpty()))
|
||||||
ymin = dispYMin->text().toDouble();
|
ymin = dispYMin->text().toDouble();
|
||||||
else ymin = myPlot->GetYMinimum();
|
else if(myPlot->DoesPlotExist())
|
||||||
|
ymin = myPlot->GetYMinimum();
|
||||||
if((dispYMax->isEnabled())&&(!dispYMax->text().isEmpty()))
|
if((dispYMax->isEnabled())&&(!dispYMax->text().isEmpty()))
|
||||||
ymax = dispYMax->text().toDouble();
|
ymax = dispYMax->text().toDouble();
|
||||||
else ymax = myPlot->GetYMaximum();
|
else if(myPlot->DoesPlotExist())
|
||||||
|
ymax = myPlot->GetYMaximum();
|
||||||
|
|
||||||
/** Setting the range*/
|
/** Setting the range*/
|
||||||
myPlot->SetXMinMax(xmin,xmax);
|
if(myPlot->DoesPlotExist()){
|
||||||
myPlot->SetYMinMax(ymin,ymax);
|
myPlot->SetXMinMax(xmin,xmax);
|
||||||
|
myPlot->SetYMinMax(ymin,ymax);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabPlot::SetZRange(){
|
void qTabPlot::SetZRange(){
|
||||||
emit SetZRangeSignal(dispZMin->text().toDouble(),dispZMax->text().toDouble());
|
emit SetZRangeSignal(dispZMin->text().toDouble(),dispZMax->text().toDouble());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabPlot::EnableZRange(){
|
void qTabPlot::EnableZRange(){
|
||||||
dispZMin->setEnabled(chkZMin->isChecked());
|
dispZMin->setEnabled(chkZMin->isChecked());
|
||||||
dispZMax->setEnabled(chkZMax->isChecked());
|
dispZMax->setEnabled(chkZMax->isChecked());
|
||||||
@ -289,9 +316,48 @@ void qTabPlot::EnableZRange(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qTabPlot::SavePlot(){
|
|
||||||
QString fullFileName = QString(myDet->getFilePath().c_str())+'/'+dispFName->text()+comboFormat->currentText();
|
void qTabPlot::SetPlot(){
|
||||||
myPlot->SavePlot(fullFileName);
|
if(radioNoPlot->isChecked()){
|
||||||
|
myPlot->EnablePlot(false);
|
||||||
|
/**if enable is true, disable everything */
|
||||||
|
box1D->setEnabled(false);
|
||||||
|
box2D->setEnabled(false);
|
||||||
|
boxSnapshot->setEnabled(false);
|
||||||
|
boxSave->setEnabled(false);
|
||||||
|
boxPlotAxis->setEnabled(false);
|
||||||
|
boxScan->setEnabled(false);
|
||||||
|
}else if(radioHistogram->isChecked()){
|
||||||
|
myPlot->EnablePlot(true);
|
||||||
|
/**if enable is true, disable everything */
|
||||||
|
box1D->setEnabled(true);
|
||||||
|
box2D->setEnabled(true);
|
||||||
|
boxSnapshot->setEnabled(true);
|
||||||
|
boxSave->setEnabled(true);
|
||||||
|
boxPlotAxis->setEnabled(true);
|
||||||
|
boxScan->setEnabled(false);
|
||||||
|
}else{
|
||||||
|
myPlot->EnablePlot(true);
|
||||||
|
/**if enable is true, disable everything */
|
||||||
|
box1D->setEnabled(true);
|
||||||
|
box2D->setEnabled(true);
|
||||||
|
boxSnapshot->setEnabled(true);
|
||||||
|
boxSave->setEnabled(true);
|
||||||
|
boxPlotAxis->setEnabled(true);
|
||||||
|
boxScan->setEnabled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void qTabPlot::EnableHistogram(bool enable){
|
||||||
|
//boxScan->setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -148,3 +148,13 @@ void qTabSettings::setSettings(int index){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void qTabSettings::Refresh(){
|
||||||
|
/** Settings */
|
||||||
|
SetupDetectorSettings();
|
||||||
|
comboSettings->setCurrentIndex(myDet->getSettings(detID));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user