mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
made some changes to make clone and main window resize plot
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@3 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
@ -57,21 +57,10 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>1000</width>
|
<width>524287</width>
|
||||||
<height>1000</height>
|
<height>450</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="gridLayoutWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>754</width>
|
|
||||||
<height>368</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="layoutTabs"/>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenuBar" name="menubar">
|
<widget class="QMenuBar" name="menubar">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
@ -321,8 +310,8 @@
|
|||||||
<font>
|
<font>
|
||||||
<family>Sans Serif</family>
|
<family>Sans Serif</family>
|
||||||
<pointsize>11</pointsize>
|
<pointsize>11</pointsize>
|
||||||
<weight>50</weight>
|
<weight>75</weight>
|
||||||
<bold>false</bold>
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="features">
|
<property name="features">
|
||||||
@ -339,7 +328,7 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
<widget class="QWidget" name="dockWidgetContentsPlot">
|
<widget class="QWidget" name="dockWidgetContentsPlot">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>734</width>
|
<width>718</width>
|
||||||
<height>339</height>
|
<height>339</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -153,9 +153,9 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>20</x>
|
<x>20</x>
|
||||||
<y>20</y>
|
<y>10</y>
|
||||||
<width>321</width>
|
<width>321</width>
|
||||||
<height>117</height>
|
<height>130</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
@ -270,9 +270,9 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>390</x>
|
<x>390</x>
|
||||||
<y>20</y>
|
<y>11</y>
|
||||||
<width>322</width>
|
<width>322</width>
|
||||||
<height>312</height>
|
<height>321</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridTimeResolved">
|
<layout class="QGridLayout" name="gridTimeResolved">
|
||||||
@ -788,7 +788,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>20</x>
|
<x>20</x>
|
||||||
<y>150</y>
|
<y>170</y>
|
||||||
<width>319</width>
|
<width>319</width>
|
||||||
<height>90</height>
|
<height>90</height>
|
||||||
</rect>
|
</rect>
|
||||||
|
@ -6,10 +6,16 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>748</width>
|
<width>734</width>
|
||||||
<height>339</height>
|
<height>339</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
@ -29,8 +35,8 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>180</y>
|
<y>130</y>
|
||||||
<width>731</width>
|
<width>711</width>
|
||||||
<height>151</height>
|
<height>151</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -45,7 +51,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>20</y>
|
<y>20</y>
|
||||||
<width>712</width>
|
<width>691</width>
|
||||||
<height>121</height>
|
<height>121</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -97,6 +103,9 @@
|
|||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="inputMethodHints">
|
||||||
|
<set>Qt::ImhDigitsOnly</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="6">
|
<item row="1" column="6">
|
||||||
@ -220,6 +229,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="3" column="6">
|
<item row="3" column="6">
|
||||||
<widget class="QCheckBox" name="chkZMax">
|
<widget class="QCheckBox" name="chkZMax">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Z max:</string>
|
<string>Z max:</string>
|
||||||
</property>
|
</property>
|
||||||
@ -227,6 +239,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="3" column="7">
|
<item row="3" column="7">
|
||||||
<widget class="QLineEdit" name="dispZMax">
|
<widget class="QLineEdit" name="dispZMax">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -270,10 +285,10 @@
|
|||||||
<widget class="QGroupBox" name="box2D">
|
<widget class="QGroupBox" name="box2D">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>11</x>
|
||||||
<y>100</y>
|
<y>70</y>
|
||||||
<width>571</width>
|
<width>571</width>
|
||||||
<height>61</height>
|
<height>51</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@ -282,16 +297,16 @@
|
|||||||
<property name="flat">
|
<property name="flat">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="gridLayoutWidget_2">
|
<widget class="QWidget" name="gridLayoutWidget_5">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>8</x>
|
||||||
<y>20</y>
|
<y>20</y>
|
||||||
<width>585</width>
|
<width>551</width>
|
||||||
<height>31</height>
|
<height>22</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QCheckBox" name="chkInterpolate">
|
<widget class="QCheckBox" name="chkInterpolate">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -314,16 +329,13 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="3">
|
<item row="0" column="3">
|
||||||
<spacer name="horizontalSpacer_9">
|
<spacer name="horizontalSpacer_3">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>250</width>
|
<width>40</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@ -336,11 +348,129 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>20</y>
|
<y>10</y>
|
||||||
<width>571</width>
|
<width>571</width>
|
||||||
<height>61</height>
|
<height>51</height>
|
||||||
</rect>
|
</rect>
|
||||||
</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>
|
||||||
|
<colorrole role="Text">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="ButtonText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Shadow">
|
||||||
|
<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>
|
||||||
|
<colorrole role="Text">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="ButtonText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Shadow">
|
||||||
|
<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>183</red>
|
||||||
|
<green>183</green>
|
||||||
|
<blue>183</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Text">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>171</red>
|
||||||
|
<green>171</green>
|
||||||
|
<blue>171</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="ButtonText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>179</red>
|
||||||
|
<green>179</green>
|
||||||
|
<blue>179</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Shadow">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>154</red>
|
||||||
|
<green>154</green>
|
||||||
|
<blue>154</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>1D Plot Options</string>
|
<string>1D Plot Options</string>
|
||||||
</property>
|
</property>
|
||||||
@ -352,83 +482,231 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>20</y>
|
<y>20</y>
|
||||||
<width>658</width>
|
<width>551</width>
|
||||||
<height>30</height>
|
<height>16</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="chkLogz_2">
|
<widget class="QCheckBox" name="chktest1D">
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Log Scale (Z)</string>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
</layout>
|
||||||
<widget class="QCheckBox" name="chkLogz_3">
|
</widget>
|
||||||
<property name="enabled">
|
<zorder>gridLayoutWidget_3</zorder>
|
||||||
<bool>false</bool>
|
<zorder>btnClear</zorder>
|
||||||
</property>
|
<zorder>gridLayoutWidget_4</zorder>
|
||||||
|
</widget>
|
||||||
|
<widget class="QGroupBox" name="boxSave">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>288</y>
|
||||||
|
<width>711</width>
|
||||||
|
<height>51</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Save</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>13</y>
|
||||||
|
<width>698</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="layoutSave">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lblFName">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Superimpose</string>
|
<string>File Name:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item>
|
||||||
<spacer name="horizontalSpacer_8">
|
<layout class="QHBoxLayout" name="hLayoutSave">
|
||||||
<property name="orientation">
|
<property name="spacing">
|
||||||
<enum>Qt::Horizontal</enum>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeType">
|
<item>
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
<widget class="QLineEdit" name="dispFName"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboFormat">
|
||||||
|
<property name="frame">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>.gif</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>.pdf</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>.png</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>.gif+</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>.jpg</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>.ps</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>.eps</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>.xpm</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>.C</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnSave">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="focusPolicy">
|
||||||
<size>
|
<enum>Qt::NoFocus</enum>
|
||||||
<width>295</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
<property name="text">
|
||||||
|
<string>Save</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="chkAutoFName">
|
||||||
|
<property name="text">
|
||||||
|
<string>Automatic File Name</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="chkSaveAll">
|
||||||
|
<property name="text">
|
||||||
|
<string>Save All</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="gridLayoutWidget_4">
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>610</x>
|
<x>599</x>
|
||||||
<y>22</y>
|
<y>41</y>
|
||||||
<width>121</width>
|
<width>121</width>
|
||||||
<height>71</height>
|
<height>80</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_4">
|
<property name="title">
|
||||||
<item row="0" column="0">
|
<string>Clone</string>
|
||||||
<widget class="QPushButton" name="btnClone">
|
</property>
|
||||||
<property name="sizePolicy">
|
<widget class="QWidget" name="gridLayoutWidget_2">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
<property name="geometry">
|
||||||
<horstretch>0</horstretch>
|
<rect>
|
||||||
<verstretch>0</verstretch>
|
<x>10</x>
|
||||||
</sizepolicy>
|
<y>10</y>
|
||||||
|
<width>101</width>
|
||||||
|
<height>71</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing">
|
||||||
|
<number>-1</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QPushButton" name="btnClone">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Clone Plot</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QPushButton" name="btnCloseClones">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Close All</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="verticalLayoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>600</x>
|
||||||
|
<y>16</y>
|
||||||
|
<width>121</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnClear">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Clone</string>
|
<string>Clear</string>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QPushButton" name="btnCloseClones">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Close All Clones</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -14,6 +14,14 @@ class SlsQt2DPlotLayout;
|
|||||||
/** Qt Include Headers */
|
/** Qt Include Headers */
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
|
#include <QGroupBox>
|
||||||
|
#include <QWidget>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QComboBox>
|
||||||
|
#include <QCheckBox>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*@short Sets up the clone plot widget
|
*@short Sets up the clone plot widget
|
||||||
@ -24,13 +32,16 @@ class qCloneWidget:public QFrame{
|
|||||||
public:
|
public:
|
||||||
/** \short The constructor
|
/** \short The constructor
|
||||||
*/
|
*/
|
||||||
qCloneWidget(QWidget *parent,int id,QSize fSize,int numDim,SlsQt1DPlot*& plot1D,SlsQt2DPlotLayout*& plot2D);
|
qCloneWidget(QWidget *parent,int id,QSize fSize,QString title,int numDim,SlsQt1DPlot*& plot1D,SlsQt2DPlotLayout*& plot2D);
|
||||||
|
|
||||||
/** Destructor
|
/** Destructor
|
||||||
*/
|
*/
|
||||||
~qCloneWidget();
|
~qCloneWidget();
|
||||||
|
|
||||||
|
|
||||||
|
/** Get the 1D plot reference
|
||||||
|
*/
|
||||||
|
SlsQt1DPlot* Get1Dplot(){ return cloneplot1D;};
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
@ -44,6 +55,17 @@ private:
|
|||||||
/** clone 2D Plot */
|
/** clone 2D Plot */
|
||||||
SlsQt2DPlotLayout* cloneplot2D;
|
SlsQt2DPlotLayout* cloneplot2D;
|
||||||
|
|
||||||
|
QGridLayout *mainLayout;
|
||||||
|
QGroupBox *boxSave;
|
||||||
|
QWidget *horizontalLayoutWidget;
|
||||||
|
QHBoxLayout *layoutSave;
|
||||||
|
QLabel *lblFName;
|
||||||
|
QHBoxLayout *hLayoutSave;
|
||||||
|
QLineEdit *dispFName;
|
||||||
|
QComboBox *comboFormat;
|
||||||
|
QPushButton *btnSave;
|
||||||
|
QCheckBox *chkAutoFName;
|
||||||
|
QCheckBox *chkSaveAll;
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent* event);
|
void closeEvent(QCloseEvent* event);
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ class slsDetectorUtils;
|
|||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
/** Qt Include Headers */
|
/** Qt Include Headers */
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
|
#include <QGridLayout>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*@short Main window of the GUI.
|
*@short Main window of the GUI.
|
||||||
@ -50,16 +51,14 @@ public:
|
|||||||
private:
|
private:
|
||||||
/** The Qt Application */
|
/** The Qt Application */
|
||||||
QApplication *theApp;
|
QApplication *theApp;
|
||||||
|
|
||||||
/** The sls detector object */
|
/** The sls detector object */
|
||||||
slsDetectorUtils *myDet;
|
slsDetectorUtils *myDet;
|
||||||
|
|
||||||
/** The Plot widget */
|
/** The Plot widget */
|
||||||
qDrawPlot *myPlot;
|
qDrawPlot *myPlot;
|
||||||
|
|
||||||
/**Tab Widget */
|
/**Tab Widget */
|
||||||
QTabWidget *tabs;
|
QTabWidget *tabs;
|
||||||
|
/**Layout of the central Widget */
|
||||||
|
QGridLayout *layoutTabs;
|
||||||
/** height of Plot Window when undocked */
|
/** height of Plot Window when undocked */
|
||||||
int heightPlotWindow;
|
int heightPlotWindow;
|
||||||
|
|
||||||
@ -68,7 +67,6 @@ private:
|
|||||||
|
|
||||||
/* Scroll Area for the tabs**/
|
/* Scroll Area for the tabs**/
|
||||||
QScrollArea *scroll[NumberOfTabs];
|
QScrollArea *scroll[NumberOfTabs];
|
||||||
QScrollArea *scrollMain;
|
|
||||||
/**Measurement tab */
|
/**Measurement tab */
|
||||||
qTabMeasurement *tab_measurement;
|
qTabMeasurement *tab_measurement;
|
||||||
/**DataOutput tab */
|
/**DataOutput tab */
|
||||||
@ -99,9 +97,10 @@ private:
|
|||||||
*/
|
*/
|
||||||
void Initialization();
|
void Initialization();
|
||||||
|
|
||||||
/** Enables the developer tab
|
/** Sets/unsets the developer mode (developer tab)
|
||||||
|
* @param b bool TRUE sets, FALSE unsets\
|
||||||
*/
|
*/
|
||||||
void SetDeveloperMode();
|
void SetDeveloperMode(bool b);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/** Sets/unsets the debug mode i.e. enables/disables the debug tab
|
/** Sets/unsets the debug mode i.e. enables/disables the debug tab
|
||||||
|
@ -21,6 +21,7 @@ class qCloneWidget;
|
|||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,6 +45,20 @@ public:
|
|||||||
*/
|
*/
|
||||||
void StartStopDaqToggle(bool stop_if_running=0);
|
void StartStopDaqToggle(bool stop_if_running=0);
|
||||||
|
|
||||||
|
/** sets plot Title */
|
||||||
|
void SetPlotTitle(QString title) {boxPlot->setTitle(title);}
|
||||||
|
/** sets 1D X Axis Title */
|
||||||
|
void SetHistXAxisTitle(QString title) {histXAxisTitle = title;}
|
||||||
|
/** sets 1D Y Axis Title */
|
||||||
|
void SetHistYAxisTitle(QString title) {histYAxisTitle = title;}
|
||||||
|
/** sets 2D X Axis Title */
|
||||||
|
void SetImageXAxisTitle(QString title) {imageXAxisTitle = title;}
|
||||||
|
/** sets 2D Y Axis Title */
|
||||||
|
void SetImageYAxisTitle(QString title) {imageYAxisTitle = title;}
|
||||||
|
/** sets 2D Z Axis Title */
|
||||||
|
void SetImageZAxisTitle(QString title) {imageZAxisTitle = title;}
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** The sls detector object */
|
/** The sls detector object */
|
||||||
slsDetectorUtils *myDet;
|
slsDetectorUtils *myDet;
|
||||||
@ -61,7 +76,7 @@ private:
|
|||||||
/** Max Number of Clone Windows */
|
/** Max Number of Clone Windows */
|
||||||
static const int MAXCloneWindows = 50;
|
static const int MAXCloneWindows = 50;
|
||||||
/** Array of clone window widget pointers */
|
/** Array of clone window widget pointers */
|
||||||
qCloneWidget *winClone[MAXCloneWindows];
|
qCloneWidget *winClone[MAXCloneWindows];
|
||||||
|
|
||||||
/** Widgets needed to set up plot*/
|
/** Widgets needed to set up plot*/
|
||||||
QGroupBox *boxPlot;
|
QGroupBox *boxPlot;
|
||||||
@ -69,13 +84,16 @@ private:
|
|||||||
QGridLayout *plotLayout;
|
QGridLayout *plotLayout;
|
||||||
/** Timer to update plot */
|
/** Timer to update plot */
|
||||||
QTimer* plot_update_timer;
|
QTimer* plot_update_timer;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** 1D object */
|
/** 1D object */
|
||||||
SlsQt1DPlot* plot1D;
|
SlsQt1DPlot* plot1D;
|
||||||
/** 2D object */
|
/** 2D object */
|
||||||
SlsQt2DPlotLayout* plot2D;
|
SlsQt2DPlotLayout* plot2D;
|
||||||
/** 1D hist values */
|
/** vector of 1D hist values */
|
||||||
QVector<SlsQtH1D*> plot1D_hists;
|
QVector<SlsQtH1D*> plot1D_hists;
|
||||||
|
QVector<SlsQtH1D*> cloneplot1D_hists;
|
||||||
|
|
||||||
/**variables for threads */
|
/**variables for threads */
|
||||||
/** */
|
/** */
|
||||||
@ -91,11 +109,11 @@ private:
|
|||||||
/** Title in 2D */
|
/** Title in 2D */
|
||||||
std::string imageTitle;
|
std::string imageTitle;
|
||||||
/** X Axis Title in 2D */
|
/** X Axis Title in 2D */
|
||||||
std::string imageXAxisTitle;
|
QString imageXAxisTitle;
|
||||||
/** Y Axis Title in 2D */
|
/** Y Axis Title in 2D */
|
||||||
std::string imageYAxisTitle;
|
QString imageYAxisTitle;
|
||||||
/** Z Axis Title in 2D */
|
/** Z Axis Title in 2D */
|
||||||
std::string imageZAxisTitle;
|
QString imageZAxisTitle;
|
||||||
/** Number of Pixels in X Axis */
|
/** Number of Pixels in X Axis */
|
||||||
unsigned int nPixelsX;
|
unsigned int nPixelsX;
|
||||||
/** Number of Pixels in Y Axis */
|
/** Number of Pixels in Y Axis */
|
||||||
@ -107,9 +125,9 @@ private:
|
|||||||
/** Title for all the graphs in 1D */
|
/** Title for all the graphs in 1D */
|
||||||
std::string histTitle[10];
|
std::string histTitle[10];
|
||||||
/** X Axis Title in 1D */
|
/** X Axis Title in 1D */
|
||||||
std::string histXAxisTitle;
|
QString histXAxisTitle;
|
||||||
/** Y Axis Title in 1D */
|
/** Y Axis Title in 1D */
|
||||||
std::string histYAxisTitle;
|
QString histYAxisTitle;
|
||||||
/** Total Number of X axis values/channels in 1D */
|
/** Total Number of X axis values/channels in 1D */
|
||||||
int histNBins;
|
int histNBins;
|
||||||
/** X Axis value in 1D */
|
/** X Axis value in 1D */
|
||||||
@ -123,46 +141,19 @@ private:
|
|||||||
/** */
|
/** */
|
||||||
int UnlockLastImageArray() {return pthread_mutex_unlock(&last_image_complete_mutex);}
|
int UnlockLastImageArray() {return pthread_mutex_unlock(&last_image_complete_mutex);}
|
||||||
/** */
|
/** */
|
||||||
SlsQt1DPlot* Get1DPlotPtr() {return plot1D;}
|
|
||||||
/** */
|
|
||||||
SlsQt2DPlotLayout* Get2DPlotPtr() {return plot2D;}
|
|
||||||
/** */
|
|
||||||
int StartDaqForGui() {return StartOrStopThread(1) ? 1:0;}
|
int StartDaqForGui() {return StartOrStopThread(1) ? 1:0;}
|
||||||
/** */
|
/** */
|
||||||
int StopDaqForGui() {return StartOrStopThread(0) ? 0:1;}
|
int StopDaqForGui() {return StartOrStopThread(0) ? 0:1;}
|
||||||
/** */
|
|
||||||
unsigned int PlotInScope() {return plot_in_scope;}
|
|
||||||
/** */
|
|
||||||
unsigned int GetLastImageNumber() {return lastImageNumber;}
|
|
||||||
/** */
|
/** */
|
||||||
const char* GetImageTitle() {return imageTitle.c_str();}
|
const char* GetImageTitle() {return imageTitle.c_str();}
|
||||||
/** */
|
/** */
|
||||||
const char* GetImageXAxisTitle() {return imageXAxisTitle.c_str();}
|
|
||||||
/** */
|
|
||||||
const char* GetImageYAxisTitle() {return imageYAxisTitle.c_str();}
|
|
||||||
/** */
|
|
||||||
const char* GetImageZAxisTitle() {return imageZAxisTitle.c_str();}
|
|
||||||
/** */
|
|
||||||
unsigned int GetNPixelsX() {return nPixelsX;}
|
|
||||||
/** */
|
|
||||||
unsigned int GetNPixelsY() {return nPixelsY;}
|
|
||||||
/** */
|
|
||||||
double* GetLastImageArray() {return lastImageArray;}
|
|
||||||
/** */
|
|
||||||
unsigned int GetNHists() {return nHists;}
|
|
||||||
/** */
|
|
||||||
const char* GetHistTitle(int i) {return (i>=0&&i<10) ? histTitle[i].c_str():0;} //int for hist number
|
const char* GetHistTitle(int i) {return (i>=0&&i<10) ? histTitle[i].c_str():0;} //int for hist number
|
||||||
/** */
|
/** */
|
||||||
const char* GetHistXAxisTitle() {return histXAxisTitle.c_str();}
|
|
||||||
/** */
|
|
||||||
const char* GetHistYAxisTitle() {return histYAxisTitle.c_str();}
|
|
||||||
/** */
|
|
||||||
unsigned int GetHistNBins() {return histNBins;}
|
|
||||||
/** */
|
|
||||||
double* GetHistXAxis() {return histXAxis;}
|
|
||||||
/** */
|
|
||||||
double* GetHistYAxis(int i) {return (i>=0&&i<10) ? histYAxis[i]:0;} //int for hist number
|
double* GetHistYAxis(int i) {return (i>=0&&i<10) ? histYAxis[i]:0;} //int for hist number
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** Initializes all its members and the thread */
|
/** Initializes all its members and the thread */
|
||||||
void Initialization();
|
void Initialization();
|
||||||
|
|
||||||
@ -229,6 +220,9 @@ void StopUpdatePlot();
|
|||||||
*/
|
*/
|
||||||
void StartDaq(bool start);
|
void StartDaq(bool start);
|
||||||
|
|
||||||
|
/** To set the reference to zero after closing a clone
|
||||||
|
* @param id is the id of the clone
|
||||||
|
*/
|
||||||
void CloneCloseEvent(int id);
|
void CloneCloseEvent(int id);
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
@ -41,6 +41,15 @@ private:
|
|||||||
/** The Plot widget */
|
/** The Plot widget */
|
||||||
qDrawPlot *myPlot;
|
qDrawPlot *myPlot;
|
||||||
|
|
||||||
|
/** some Default Values */
|
||||||
|
static QString defaultPlotTitle;
|
||||||
|
static QString defaultHistXAxisTitle;
|
||||||
|
static QString defaultHistYAxisTitle;
|
||||||
|
static QString defaultImageXAxisTitle;
|
||||||
|
static QString defaultImageYAxisTitle;
|
||||||
|
static QString defaultImageZAxisTitle;
|
||||||
|
|
||||||
|
|
||||||
/** methods */
|
/** methods */
|
||||||
/** Sets up the widget
|
/** Sets up the widget
|
||||||
*/
|
*/
|
||||||
@ -63,6 +72,22 @@ public slots:
|
|||||||
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
/** Selects the plot to display, enables/disables widgets
|
||||||
|
* @param b true to select plot dimension 1, else false to select 2D
|
||||||
|
*/
|
||||||
|
void Select1DPlot(bool b);
|
||||||
|
|
||||||
|
/**Sets the titles in plot axis
|
||||||
|
*/
|
||||||
|
void SetTitles();
|
||||||
|
|
||||||
|
/** Enables/Sets Titles to default
|
||||||
|
*/
|
||||||
|
void EnableTitles();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,58 +1,3 @@
|
|||||||
|
|
||||||
/**
|
|
||||||
* @author Ian Johnson
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef SLSQT2DPLOTLAYOUT_H
|
|
||||||
#define SLSQT2DPLOTLAYOUT_H
|
|
||||||
|
|
||||||
#include <qwidget.h>
|
|
||||||
#include <qgroupbox.h>
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
#include "SlsQtNumberEntry.h"
|
|
||||||
#include "SlsQt2DPlot.h"
|
|
||||||
|
|
||||||
//class QGridLayout;
|
|
||||||
//class QToolbar;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SlsQt2DPlotLayout: public QGroupBox{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
SlsQt2DPlotLayout(QWidget * = NULL);
|
|
||||||
~SlsQt2DPlotLayout();
|
|
||||||
|
|
||||||
SlsQt2DPlot* GetPlot() {return the_plot;}
|
|
||||||
void SetXTitle(QString st);
|
|
||||||
void SetYTitle(QString st);
|
|
||||||
void SetZTitle(QString st);
|
|
||||||
|
|
||||||
void UpdateNKeepSetRangeIfSet();
|
|
||||||
|
|
||||||
private:
|
|
||||||
//QGridLayout* the_layout;
|
|
||||||
SlsQt2DPlot* the_plot;
|
|
||||||
//SlsQtNumberEntry* z_range_ne;
|
|
||||||
|
|
||||||
void ConnectSignalsAndSlots();
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void SetZScaleToLog(bool yes);
|
|
||||||
void ResetRange();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Ian Johnson
|
* @author Ian Johnson
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
@ -69,6 +14,7 @@ private:
|
|||||||
#include "SlsQt2DPlot.h"
|
#include "SlsQt2DPlot.h"
|
||||||
|
|
||||||
class QGridLayout;
|
class QGridLayout;
|
||||||
|
class QString;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -102,6 +48,7 @@ private:
|
|||||||
public slots:
|
public slots:
|
||||||
void SetZScaleToLog(bool yes);
|
void SetZScaleToLog(bool yes);
|
||||||
void ResetRange();
|
void ResetRange();
|
||||||
|
void SetTitle(QString st);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void InterpolateSignal(bool);
|
void InterpolateSignal(bool);
|
||||||
|
@ -1,105 +1,3 @@
|
|||||||
/**
|
|
||||||
* @author Ian Johnson
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include <qgroupbox.h>
|
|
||||||
//#include <qgridlayout.h>
|
|
||||||
//#include <qlabel.h>
|
|
||||||
|
|
||||||
|
|
||||||
#include "SlsQt2DPlotLayout.h"
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
SlsQt2DPlotLayout::SlsQt2DPlotLayout(QWidget *parent):QGroupBox(parent){
|
|
||||||
//the_layout=0;
|
|
||||||
the_plot = new SlsQt2DPlot(this);
|
|
||||||
|
|
||||||
// z_range_ne = new SlsQtNumberEntry(this,1,"Set the z axis range from",2,"to",2);
|
|
||||||
// z_range_ne->setFixedWidth(402);
|
|
||||||
|
|
||||||
ConnectSignalsAndSlots();
|
|
||||||
}
|
|
||||||
|
|
||||||
SlsQt2DPlotLayout::~SlsQt2DPlotLayout(){
|
|
||||||
|
|
||||||
//if(the_layout) delete the_layout;
|
|
||||||
delete the_plot;
|
|
||||||
// delete z_range_ne;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SlsQt2DPlotLayout::ConnectSignalsAndSlots(){
|
|
||||||
connect(btnInterpolate, SIGNAL(toggled(bool)),the_plot, SLOT(InterpolatedPlot(bool)));
|
|
||||||
connect(btnContour, SIGNAL(toggled(bool)),the_plot, SLOT(showContour(bool)));
|
|
||||||
connect(btnLogz, SIGNAL(toggled(bool)),this,SLOT(SetZScaleToLog(bool)));
|
|
||||||
|
|
||||||
connect(z_range_ne,SIGNAL(CheckBoxChanged(bool)),this,SLOT(ResetRange()));
|
|
||||||
connect(z_range_ne,SIGNAL(AValueChanged(SlsQtNumberEntry*)),this,SLOT(ResetRange()));
|
|
||||||
|
|
||||||
btnInterpolate->setChecked(false);
|
|
||||||
btnContour->setChecked(false);
|
|
||||||
btnLogz->setChecked(false);
|
|
||||||
|
|
||||||
}
|
|
||||||
void SlsQt2DPlotLayout::UpdateNKeepSetRangeIfSet(){
|
|
||||||
if(z_range_ne->CheckBoxState()){
|
|
||||||
//just reset histogram range before update
|
|
||||||
the_plot->SetZMinMax(z_range_ne->GetValue(0),z_range_ne->GetValue(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
the_plot->Update();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SlsQt2DPlotLayout::ResetRange(){
|
|
||||||
//refind z limits
|
|
||||||
the_plot->SetZMinMax();
|
|
||||||
if(btnLogz->isChecked()) the_plot->SetZMinimumToFirstGreaterThanZero();
|
|
||||||
|
|
||||||
if(z_range_ne->CheckBoxState()){
|
|
||||||
//first time check validity
|
|
||||||
bool same = (z_range_ne->GetValue(0)==z_range_ne->GetValue(1)) ? 1:0;
|
|
||||||
if(!z_range_ne->IsValueOk(0)||same) z_range_ne->SetValue(the_plot->GetZMinimum(),0);
|
|
||||||
if(!z_range_ne->IsValueOk(1)||same) z_range_ne->SetValue(the_plot->GetZMaximum(),1);
|
|
||||||
|
|
||||||
z_range_ne->SetRange(the_plot->GetZMinimum(),z_range_ne->GetValue(1),0);
|
|
||||||
z_range_ne->SetRange(z_range_ne->GetValue(0),the_plot->GetZMaximum(),1);
|
|
||||||
|
|
||||||
//set histogram range
|
|
||||||
the_plot->SetZMinMax(z_range_ne->GetValue(0),z_range_ne->GetValue(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
the_plot->Update();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SlsQt2DPlotLayout::SetZScaleToLog(bool yes){
|
|
||||||
the_plot->LogZ(yes);
|
|
||||||
ResetRange();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SlsQt2DPlotLayout::SetXTitle(QString st){
|
|
||||||
GetPlot()->axisWidget(QwtPlot::xBottom)->setTitle(st);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SlsQt2DPlotLayout::SetYTitle(QString st){
|
|
||||||
GetPlot()->axisWidget(QwtPlot::yLeft)->setTitle(st);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SlsQt2DPlotLayout::SetZTitle(QString st){
|
|
||||||
GetPlot()->axisWidget(QwtPlot::yRight)->setTitle(st);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Ian Johnson
|
* @author Ian Johnson
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
@ -112,6 +10,7 @@ void SlsQt2DPlotLayout::SetZTitle(QString st){
|
|||||||
#include <qgroupbox.h>
|
#include <qgroupbox.h>
|
||||||
#include <qgridlayout.h>
|
#include <qgridlayout.h>
|
||||||
#include <qlabel.h>
|
#include <qlabel.h>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
#include "SlsQt2DPlotLayout.h"
|
#include "SlsQt2DPlotLayout.h"
|
||||||
|
|
||||||
@ -147,8 +46,6 @@ void SlsQt2DPlotLayout::Layout(){
|
|||||||
the_layout = new QGridLayout(this);
|
the_layout = new QGridLayout(this);
|
||||||
the_layout->addWidget(the_plot,2,1,3,3);
|
the_layout->addWidget(the_plot,2,1,3,3);
|
||||||
the_layout->addWidget(z_range_ne,5,1,1,3);
|
the_layout->addWidget(z_range_ne,5,1,1,3);
|
||||||
|
|
||||||
the_layout->setMargin(12);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SlsQt2DPlotLayout::ConnectSignalsAndSlots(){
|
void SlsQt2DPlotLayout::ConnectSignalsAndSlots(){
|
||||||
@ -210,3 +107,6 @@ void SlsQt2DPlotLayout::SetZTitle(QString st){
|
|||||||
GetPlot()->axisWidget(QwtPlot::yRight)->setTitle(st);
|
GetPlot()->axisWidget(QwtPlot::yRight)->setTitle(st);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SlsQt2DPlotLayout::SetTitle(QString st){
|
||||||
|
setTitle(st);
|
||||||
|
}
|
||||||
|
@ -17,30 +17,97 @@
|
|||||||
/** C++ Include Headers */
|
/** C++ Include Headers */
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <QSizePolicy>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
qCloneWidget::qCloneWidget(QWidget *parent,int id,QSize fSize,int numDim,SlsQt1DPlot*& plot1D,SlsQt2DPlotLayout*& plot2D):QFrame(parent,Qt::Popup|Qt::SubWindow),id(id){
|
qCloneWidget::qCloneWidget(QWidget *parent,int id,QSize fSize,QString title,int numDim,SlsQt1DPlot*& plot1D,SlsQt2DPlotLayout*& plot2D):QFrame(parent,Qt::Popup|Qt::SubWindow),id(id){
|
||||||
|
|
||||||
|
|
||||||
|
mainLayout = new QGridLayout(this);
|
||||||
|
setLayout(mainLayout);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QGroupBox *cloneBox = new QGroupBox(this);
|
QGroupBox *cloneBox = new QGroupBox(this);
|
||||||
QGridLayout *gridClone = new QGridLayout(cloneBox);
|
QGridLayout *gridClone = new QGridLayout(cloneBox);
|
||||||
cloneBox->setLayout(gridClone);
|
cloneBox->setLayout(gridClone);
|
||||||
cloneBox->setFlat(1);
|
|
||||||
cloneBox->setTitle("Startup Image");
|
|
||||||
cloneBox->resize(fSize);
|
cloneBox->resize(fSize);
|
||||||
|
cloneBox->setTitle(title);
|
||||||
|
cloneBox->setAlignment(Qt::AlignHCenter);
|
||||||
|
cloneBox->setFont(QFont("Sans Serif",11,QFont::Bold));
|
||||||
if(numDim==1){
|
if(numDim==1){
|
||||||
cloneplot1D = plot1D;
|
cloneplot1D = plot1D;
|
||||||
gridClone->addWidget(cloneplot1D,0,0);
|
gridClone->addWidget(cloneplot1D,0,0);
|
||||||
|
cloneBox->setFlat(false);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
cloneplot2D = plot2D;
|
cloneplot2D = plot2D;
|
||||||
gridClone->addWidget(cloneplot2D,0,0);
|
gridClone->addWidget(cloneplot2D,0,0);
|
||||||
|
cloneBox->setFlat(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
boxSave = new QGroupBox(this);
|
||||||
|
layoutSave = new QHBoxLayout;
|
||||||
|
boxSave->setLayout(layoutSave);
|
||||||
|
|
||||||
|
lblFName = new QLabel(layoutSave);
|
||||||
|
lblFName->setText("File Name:");
|
||||||
|
layoutSave->addWidget(lblFName);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
hLayoutSave = new QHBoxLayout();
|
||||||
|
hLayoutSave->setSpacing(0);
|
||||||
|
|
||||||
|
dispFName = new QLineEdit(layoutSave);
|
||||||
|
hLayoutSave->addWidget(dispFName);
|
||||||
|
|
||||||
|
comboFormat = new QComboBox(layoutSave);
|
||||||
|
comboFormat->setFrame(true);
|
||||||
|
comboFormat->insertItem(".gif");
|
||||||
|
comboFormat->insertItem(".pdf");
|
||||||
|
comboFormat->insertItem(".png");
|
||||||
|
comboFormat->insertItem(".gif+");
|
||||||
|
comboFormat->insertItem(".jpg");
|
||||||
|
comboFormat->insertItem(".ps");
|
||||||
|
comboFormat->insertItem(".eps");
|
||||||
|
comboFormat->insertItem(".xpm");
|
||||||
|
comboFormat->insertItem(".C");
|
||||||
|
hLayoutSave->addWidget(comboFormat);
|
||||||
|
|
||||||
|
layoutSave->addLayout(hLayoutSave);
|
||||||
|
|
||||||
|
|
||||||
|
btnSave = new QPushButton(layoutSave);
|
||||||
|
bnSave->setText("Save");
|
||||||
|
QSizePolicy sizePolicy2(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||||
|
sizePolicy2.setHeightForWidth(btnSave->sizePolicy().hasHeightForWidth());
|
||||||
|
btnSave->setSizePolicy(sizePolicy2);
|
||||||
|
btnSave->setFocusPolicy(Qt::NoFocus);
|
||||||
|
layoutSave->addWidget(btnSave);
|
||||||
|
|
||||||
|
chkAutoFName = new QCheckBox(layoutSave);
|
||||||
|
chkAutoFName->setText("Automatic File Name");
|
||||||
|
layoutSave->addWidget(chkAutoFName);
|
||||||
|
|
||||||
|
chkSaveAll = new QCheckBox(layoutSave);
|
||||||
|
chkSaveAll->setText("Save All")
|
||||||
|
layoutSave->addWidget(chkSaveAll);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
gridClone->addWidget(boxSave,0,0);
|
||||||
|
mainLayout->addWidget(boxSave,1,1);*/
|
||||||
|
|
||||||
|
mainLayout->addWidget(cloneBox,0,0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,20 +41,26 @@ qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app, QWidget *
|
|||||||
setupUi(this);
|
setupUi(this);
|
||||||
SetUpWidgetWindow();
|
SetUpWidgetWindow();
|
||||||
Initialization();
|
Initialization();
|
||||||
SetDeveloperMode();
|
|
||||||
/**need to use argc and argv to determine which slsdet or multidet to use.*/
|
/**need to use argc and argv to determine which slsdet or multidet to use.*/
|
||||||
|
|
||||||
if(argc>1){
|
for(int iarg=1; iarg<argc; iarg++){
|
||||||
if(!strcasecmp(argv[1],"-developer"))
|
if(!strcasecmp(argv[1],"-developer")) SetDeveloperMode(true);
|
||||||
tabs->setTabEnabled(Developer,true);
|
|
||||||
else
|
if(!strcasecmp(argv[1],"-help")){
|
||||||
tabs->setTabEnabled(Developer,false);
|
cout<<"Possible Arguments are:"<<endl;
|
||||||
|
cout<<"-help \t\t : \t This help"<<endl;
|
||||||
|
cout<<"-developer \t : \t Enables the developer tab"<<endl;
|
||||||
|
//cout<<"-id i \t : \t Sets the detector to id i (the default is 0). ";
|
||||||
|
//cout<<"Required only when more than one detector is connected in parallel."<<endl;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//centralwidget->setFixedHeight(centralwidget->height());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Qt::ScrollBarAsNeeded
|
|
||||||
|
|
||||||
|
|
||||||
qDetectorMain::~qDetectorMain(){
|
qDetectorMain::~qDetectorMain(){
|
||||||
@ -70,13 +76,12 @@ qDetectorMain::~qDetectorMain(){
|
|||||||
void qDetectorMain::SetUpWidgetWindow(){
|
void qDetectorMain::SetUpWidgetWindow(){
|
||||||
|
|
||||||
|
|
||||||
/* scrollMain = new QScrollArea;
|
|
||||||
setCentralWidget(scrollMain);
|
|
||||||
scrollMain ->setWidget(centralwidget);
|
|
||||||
scrollMain->setWidgetResizable(true);*/
|
|
||||||
|
|
||||||
SetUpDetector();
|
SetUpDetector();
|
||||||
|
|
||||||
|
/** Layout */
|
||||||
|
layoutTabs= new QGridLayout;
|
||||||
|
centralwidget->setLayout(layoutTabs);
|
||||||
|
|
||||||
/** plot setup*/
|
/** plot setup*/
|
||||||
myPlot = new qDrawPlot(dockWidgetPlot,myDet);
|
myPlot = new qDrawPlot(dockWidgetPlot,myDet);
|
||||||
dockWidgetPlot->setWidget(myPlot);
|
dockWidgetPlot->setWidget(myPlot);
|
||||||
@ -107,6 +112,7 @@ 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");
|
||||||
@ -121,6 +127,8 @@ void qDetectorMain::SetUpWidgetWindow(){
|
|||||||
SetDebugMode(false);
|
SetDebugMode(false);
|
||||||
SetBeamlineMode(false);
|
SetBeamlineMode(false);
|
||||||
SetExpertMode(false);
|
SetExpertMode(false);
|
||||||
|
SetDeveloperMode(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -190,11 +198,11 @@ void qDetectorMain::Initialization(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void qDetectorMain::SetDeveloperMode(){
|
void qDetectorMain::SetDeveloperMode(bool b){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Enabling Developer Mode "<<endl;
|
cout<<"Setting Developer Mode to "<<b<<endl;
|
||||||
#endif
|
#endif
|
||||||
tabs->setTabEnabled(Developer,true);
|
tabs->setTabEnabled(Developer,b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -314,31 +322,32 @@ void qDetectorMain::ResizeMainWindow(bool b){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Resizing Main Window: height:"<<height()<<endl;
|
cout<<"Resizing Main Window: height:"<<height()<<endl;
|
||||||
#endif
|
#endif
|
||||||
if(b)/** sets the main window height to a smaller maximum to get rid of space*/
|
/** undocked from the main window */
|
||||||
|
if(b){/** sets the main window height to a smaller maximum to get rid of space*/
|
||||||
setMaximumHeight(height()-heightPlotWindow-9);
|
setMaximumHeight(height()-heightPlotWindow-9);
|
||||||
else
|
dockWidgetPlot->setMinimumHeight(0);
|
||||||
|
}
|
||||||
|
else{
|
||||||
setMaximumHeight(QWIDGETSIZE_MAX);
|
setMaximumHeight(QWIDGETSIZE_MAX);
|
||||||
|
dockWidgetPlot->setMinimumHeight(heightPlotWindow);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
cout<<"size hint ht:"<<sizeHint().height()<<endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void qDetectorMain::SetTerminalWindowSize(bool b){
|
void qDetectorMain::SetTerminalWindowSize(bool b){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Resizing Terminal Window"<<endl;
|
cout<<"Resizing Terminal Window"<<endl;
|
||||||
#endif
|
#endif
|
||||||
|
//depends on gridlayout in qdrawterminal widget class
|
||||||
cout<<"min width:"<<dockWidgetTerminal->minimumWidth()<<endl;
|
|
||||||
cout<<"min height:"<<dockWidgetTerminal->minimumHeight()<<endl;
|
|
||||||
if(b){
|
if(b){
|
||||||
dockWidgetTerminal->setMinimumWidth(width()/2);
|
dockWidgetTerminal->setMinimumWidth(width()/2);
|
||||||
}
|
}
|
||||||
//dockWidgetTerminal->setFixedSize(width()/2,dockWidgetTerminal->minimumHeight());
|
|
||||||
|
|
||||||
else{
|
else{
|
||||||
dockWidgetTerminal->setMinimumWidth(38);
|
dockWidgetTerminal->setMinimumWidth(38);
|
||||||
QSizePolicy sizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
QSizePolicy sizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||||
dockWidgetTerminal->setSizePolicy(sizePolicy);
|
dockWidgetTerminal->setSizePolicy(sizePolicy);
|
||||||
//dockWidgetTerminal->setSizePolicy(new QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding));
|
|
||||||
//dockWidgetTerminal->setFixedSize(dockWidgetTerminal->minimumWidth(),dockWidgetTerminal->minimumHeight());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,8 @@ using namespace std;
|
|||||||
|
|
||||||
qDrawPlot::qDrawPlot(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector),numberOfMeasurements(1){
|
qDrawPlot::qDrawPlot(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector),numberOfMeasurements(1){
|
||||||
if(myDet) {
|
if(myDet) {
|
||||||
Initialization();
|
|
||||||
SetupWidgetWindow();
|
SetupWidgetWindow();
|
||||||
|
Initialization();
|
||||||
StartStopDaqToggle(); //as default
|
StartStopDaqToggle(); //as default
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -35,47 +35,44 @@ qDrawPlot::qDrawPlot(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent
|
|||||||
qDrawPlot::~qDrawPlot(){
|
qDrawPlot::~qDrawPlot(){
|
||||||
/** Clear plot*/
|
/** Clear plot*/
|
||||||
Clear1DPlot();
|
Clear1DPlot();
|
||||||
for(QVector<SlsQtH1D*>::iterator h = plot1D_hists.begin();h!=plot1D_hists.end();h++)
|
for(QVector<SlsQtH1D*>::iterator h = plot1D_hists.begin();h!=plot1D_hists.end();h++) delete *h;
|
||||||
delete *h;
|
|
||||||
plot1D_hists.clear();
|
plot1D_hists.clear();
|
||||||
delete[] lastImageArray; lastImageArray=0;
|
delete[] lastImageArray; lastImageArray=0;
|
||||||
StartOrStopThread(0);
|
StartOrStopThread(0);
|
||||||
/** delete detector object pointer*/
|
|
||||||
delete myDet;
|
delete myDet;
|
||||||
|
for(int i=0;i<MAXCloneWindows;i++) delete winClone[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void qDrawPlot::Initialization(){
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout<<"Setting up plot variables"<<endl;
|
|
||||||
#endif
|
|
||||||
stop_signal = 0;
|
|
||||||
pthread_mutex_init(&last_image_complete_mutex,NULL);
|
|
||||||
|
|
||||||
plot_in_scope = 0;
|
|
||||||
lastImageNumber = 0;
|
|
||||||
nPixelsX = 0;
|
|
||||||
nPixelsY = 0;
|
|
||||||
lastImageArray = 0;
|
|
||||||
|
|
||||||
nHists = 0;
|
|
||||||
histNBins = 0;
|
|
||||||
histXAxis = 0;
|
|
||||||
for(int i=0;i<10;i++) histYAxis[i]=0;
|
|
||||||
|
|
||||||
for(int i=0;i<MAXCloneWindows;i++) winClone[i]=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void qDrawPlot::SetupWidgetWindow(){
|
void qDrawPlot::SetupWidgetWindow(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Setting up plot variables"<<endl;
|
||||||
|
#endif
|
||||||
|
stop_signal = 0;
|
||||||
|
pthread_mutex_init(&last_image_complete_mutex,NULL);
|
||||||
|
|
||||||
|
plot_in_scope = 0;
|
||||||
|
lastImageNumber = 0;
|
||||||
|
nPixelsX = 0;
|
||||||
|
nPixelsY = 0;
|
||||||
|
lastImageArray = 0;
|
||||||
|
|
||||||
|
nHists = 0;
|
||||||
|
histNBins = 0;
|
||||||
|
histXAxis = 0;
|
||||||
|
for(int i=0;i<10;i++) histYAxis[i]=0;
|
||||||
|
|
||||||
|
for(int i=0;i<MAXCloneWindows;i++) winClone[i]=0;
|
||||||
|
|
||||||
|
|
||||||
/** Setting up window*/
|
/** Setting up window*/
|
||||||
setFont(QFont("Sans Serif",9));
|
setFont(QFont("Sans Serif",9));
|
||||||
layout = new QGridLayout;
|
layout = new QGridLayout;
|
||||||
boxPlot = new QGroupBox("Start Image");
|
boxPlot = new QGroupBox("Measurement");
|
||||||
|
|
||||||
|
boxPlot->setAlignment(Qt::AlignHCenter);
|
||||||
|
boxPlot->setFont(QFont("Sans Serif",11,QFont::Bold));
|
||||||
|
|
||||||
layout->addWidget(boxPlot,1,1);
|
layout->addWidget(boxPlot,1,1);
|
||||||
this->setLayout(layout);
|
this->setLayout(layout);
|
||||||
|
|
||||||
@ -83,26 +80,28 @@ void qDrawPlot::SetupWidgetWindow(){
|
|||||||
connect(plot_update_timer, SIGNAL(timeout()), this, SLOT(UpdatePlot()));
|
connect(plot_update_timer, SIGNAL(timeout()), this, SLOT(UpdatePlot()));
|
||||||
|
|
||||||
plot1D = new SlsQt1DPlot(boxPlot);
|
plot1D = new SlsQt1DPlot(boxPlot);
|
||||||
plot1D->SetXTitle("x axis");
|
plot1D->setFont(QFont("Sans Serif",9,QFont::Normal));
|
||||||
plot1D->SetYTitle("y axis");
|
|
||||||
plot1D->hide();
|
plot1D->hide();
|
||||||
|
|
||||||
plot2D = new SlsQt2DPlotLayout(boxPlot);
|
plot2D = new SlsQt2DPlotLayout(boxPlot);
|
||||||
plot2D->SetXTitle("pixel");
|
plot2D->setFont(QFont("Sans Serif",9,QFont::Normal));
|
||||||
plot2D->SetYTitle("pixel");
|
plot2D->setTitle("Start Image");
|
||||||
plot2D->SetZTitle("Intensity");
|
plot2D->setAlignment(Qt::AlignLeft);
|
||||||
boxPlot->setFlat(1);
|
boxPlot->setFlat(true);
|
||||||
boxPlot->setTitle("Startup Image");
|
|
||||||
|
|
||||||
plotLayout = new QGridLayout(boxPlot);
|
plotLayout = new QGridLayout(boxPlot);
|
||||||
plotLayout->addWidget(plot1D,1,1,1,1);
|
plotLayout->addWidget(plot1D,1,1,1,1);
|
||||||
plotLayout->addWidget(plot2D,1,1,1,1);
|
plotLayout->addWidget(plot2D,1,1,1,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qDrawPlot::Initialization(){
|
||||||
connect(this, SIGNAL(InterpolateSignal(bool)), plot2D, SIGNAL(InterpolateSignal(bool)));
|
connect(this, SIGNAL(InterpolateSignal(bool)), plot2D, SIGNAL(InterpolateSignal(bool)));
|
||||||
connect(this, SIGNAL(ContourSignal(bool)), plot2D, SIGNAL(ContourSignal(bool)));
|
connect(this, SIGNAL(ContourSignal(bool)), plot2D, SIGNAL(ContourSignal(bool)));
|
||||||
connect(this, SIGNAL(LogzSignal(bool)), plot2D, SLOT(SetZScaleToLog(bool)));
|
connect(this, SIGNAL(LogzSignal(bool)), plot2D, SLOT(SetZScaleToLog(bool)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -269,7 +268,7 @@ void* qDrawPlot::AcquireImages(){
|
|||||||
if(!pthread_mutex_trylock(&last_image_complete_mutex)){
|
if(!pthread_mutex_trylock(&last_image_complete_mutex)){
|
||||||
|
|
||||||
//plot_in_scope = 1;//i%2 + 1;
|
//plot_in_scope = 1;//i%2 + 1;
|
||||||
plot_in_scope = 2;
|
//plot_in_scope = 2;
|
||||||
cout<<"value:"<<image_data[6]<<endl;
|
cout<<"value:"<<image_data[6]<<endl;
|
||||||
|
|
||||||
lastImageNumber = i+1;
|
lastImageNumber = i+1;
|
||||||
@ -278,8 +277,6 @@ void* qDrawPlot::AcquireImages(){
|
|||||||
nHists = 2;
|
nHists = 2;
|
||||||
sprintf(temp_title,"curve one %d",i); histTitle[0] = temp_title;
|
sprintf(temp_title,"curve one %d",i); histTitle[0] = temp_title;
|
||||||
sprintf(temp_title,"curve two %d",i); histTitle[1] = temp_title;
|
sprintf(temp_title,"curve two %d",i); histTitle[1] = temp_title;
|
||||||
sprintf(temp_title,"Channel Number"); histXAxisTitle=temp_title;
|
|
||||||
sprintf(temp_title,"Intensity"); histYAxisTitle=temp_title;
|
|
||||||
histNBins = nx;
|
histNBins = nx;
|
||||||
memcpy(histXAxis, xvalues,nx*sizeof(double));
|
memcpy(histXAxis, xvalues,nx*sizeof(double));
|
||||||
memcpy(histYAxis[0],yvalues0,nx*sizeof(double));
|
memcpy(histYAxis[0],yvalues0,nx*sizeof(double));
|
||||||
@ -287,9 +284,6 @@ void* qDrawPlot::AcquireImages(){
|
|||||||
|
|
||||||
//2d image stuff
|
//2d image stuff
|
||||||
sprintf(temp_title,"Image number %d",i); imageTitle=temp_title;
|
sprintf(temp_title,"Image number %d",i); imageTitle=temp_title;
|
||||||
sprintf(temp_title,"The x-axis title"); imageXAxisTitle=temp_title;
|
|
||||||
sprintf(temp_title,"The y-axis title"); imageYAxisTitle=temp_title;
|
|
||||||
sprintf(temp_title,"The z-axis title"); imageZAxisTitle=temp_title;
|
|
||||||
nPixelsX = nx;
|
nPixelsX = nx;
|
||||||
nPixelsY = ny;
|
nPixelsY = ny;
|
||||||
memcpy(lastImageArray,image_data,nx*ny*sizeof(double));
|
memcpy(lastImageArray,image_data,nx*ny*sizeof(double));
|
||||||
@ -315,9 +309,13 @@ void qDrawPlot::SelectPlot(int i){ //1 for 1D otherwise 2D
|
|||||||
if(i==1){
|
if(i==1){
|
||||||
plot1D->show();
|
plot1D->show();
|
||||||
plot2D->hide();
|
plot2D->hide();
|
||||||
|
boxPlot->setFlat(false);
|
||||||
|
plot_in_scope=1;
|
||||||
}else{
|
}else{
|
||||||
plot1D->hide();
|
plot1D->hide();
|
||||||
plot2D->show();
|
plot2D->show();
|
||||||
|
boxPlot->setFlat(true);
|
||||||
|
plot_in_scope=2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -339,17 +337,17 @@ void qDrawPlot::UpdatePlot(){
|
|||||||
|
|
||||||
LockLastImageArray();
|
LockLastImageArray();
|
||||||
//1-d plot stuff
|
//1-d plot stuff
|
||||||
if(GetHistNBins()){
|
if(histNBins){
|
||||||
plot1D->SetXTitle(GetHistXAxisTitle());
|
plot1D->SetXTitle(histXAxisTitle.toAscii().constData());
|
||||||
plot1D->SetYTitle(GetHistYAxisTitle());
|
plot1D->SetYTitle(histYAxisTitle.toAscii().constData());
|
||||||
for(int hist_num=0;hist_num<GetNHists();hist_num++){
|
for(int hist_num=0;hist_num<nHists;hist_num++){
|
||||||
SlsQtH1D* h;
|
SlsQtH1D* h;
|
||||||
if(hist_num+1>plot1D_hists.size()){
|
if(hist_num+1>plot1D_hists.size()){
|
||||||
plot1D_hists.append(h=new SlsQtH1D("1d plot",GetHistNBins(),GetHistXAxis(),GetHistYAxis(hist_num)));
|
plot1D_hists.append(h=new SlsQtH1D("1d plot",histNBins,histXAxis,GetHistYAxis(hist_num)));
|
||||||
h->SetLineColor(hist_num+1);
|
h->SetLineColor(hist_num+1);
|
||||||
}else{
|
}else{
|
||||||
h=plot1D_hists.at(hist_num);
|
h=plot1D_hists.at(hist_num);
|
||||||
h->SetData(GetHistNBins(),GetHistXAxis(),GetHistYAxis(hist_num));
|
h->SetData(histNBins,histXAxis,GetHistYAxis(hist_num));
|
||||||
}
|
}
|
||||||
h->setTitle(GetHistTitle(hist_num));
|
h->setTitle(GetHistTitle(hist_num));
|
||||||
h->Attach(plot1D);
|
h->Attach(plot1D);
|
||||||
@ -359,23 +357,23 @@ void qDrawPlot::UpdatePlot(){
|
|||||||
|
|
||||||
//2-d plot stuff
|
//2-d plot stuff
|
||||||
static int last_plot_number = 0;
|
static int last_plot_number = 0;
|
||||||
if(GetLastImageArray()){
|
if(lastImageArray){
|
||||||
if(GetLastImageNumber()&&last_plot_number!=GetLastImageNumber() && //there is a new plot
|
if(lastImageNumber&&last_plot_number!=lastImageNumber && //there is a new plot
|
||||||
GetNPixelsX()>0&&GetNPixelsY()>0){
|
nPixelsX>0&&nPixelsY>0){
|
||||||
plot2D->GetPlot()->SetData(GetNPixelsX(),-0.5,GetNPixelsX()-0.5,GetNPixelsY(),-0.5,GetNPixelsY()-0.5,GetLastImageArray());
|
plot2D->GetPlot()->SetData(nPixelsX,-0.5,nPixelsX-0.5,nPixelsY,-0.5,nPixelsY-0.5,lastImageArray);
|
||||||
//as it inherits a widget
|
//as it inherits a widget
|
||||||
boxPlot->setTitle(GetImageTitle());
|
plot2D->setTitle(GetImageTitle());
|
||||||
plot2D->SetXTitle(GetImageXAxisTitle());
|
plot2D->SetXTitle(imageXAxisTitle);
|
||||||
plot2D->SetYTitle(GetImageYAxisTitle());
|
plot2D->SetYTitle(imageYAxisTitle);
|
||||||
plot2D->SetZTitle(GetImageZAxisTitle());
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
last_plot_number=GetLastImageNumber();
|
last_plot_number=lastImageNumber;
|
||||||
UnlockLastImageArray();
|
UnlockLastImageArray();
|
||||||
|
|
||||||
if(PlotInScope()==1) SelectPlot(1);
|
/* if(plot_in_scope==1) SelectPlot(1);
|
||||||
else if(PlotInScope()==2) SelectPlot(2);
|
else if(plot_in_scope==2) SelectPlot(2);*/
|
||||||
|
|
||||||
if(number_of_exposures==last_plot_number){
|
if(number_of_exposures==last_plot_number){
|
||||||
StartStopDaqToggle(1);
|
StartStopDaqToggle(1);
|
||||||
@ -407,13 +405,32 @@ void qDrawPlot::ClonePlot(){
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
winClone[i] = new qCloneWidget(this,i,boxPlot->size(),(int)PlotInScope(),plot1D,plot2D);
|
winClone[i] = new qCloneWidget(this,i,boxPlot->size(),boxPlot->title(),(int)plot_in_scope,plot1D,plot2D);
|
||||||
if(PlotInScope()==1)
|
if(plot_in_scope==1){
|
||||||
plot1D = new SlsQt1DPlot(boxPlot);
|
plot1D = new SlsQt1DPlot(boxPlot);
|
||||||
else
|
plot1D->setFont(QFont("Sans Serif",9,QFont::Normal));
|
||||||
|
plotLayout->addWidget(plot1D,1,1,1,1);
|
||||||
|
/** Somehow the 1d plot hists are lost*/
|
||||||
|
SlsQtH1D* h;
|
||||||
|
for(int hist_num=0;hist_num<nHists;hist_num++){
|
||||||
|
SlsQtH1D* k;
|
||||||
|
if(hist_num+1>cloneplot1D_hists.size()){
|
||||||
|
cloneplot1D_hists.append(k=new SlsQtH1D("1d plot",histNBins,histXAxis,GetHistYAxis(hist_num)));
|
||||||
|
k->SetLineColor(hist_num+1);
|
||||||
|
}else{
|
||||||
|
k=cloneplot1D_hists.at(hist_num);
|
||||||
|
k->SetData(histNBins,histXAxis,GetHistYAxis(hist_num));
|
||||||
|
}
|
||||||
|
k->setTitle(GetHistTitle(hist_num));
|
||||||
|
k->Attach(winClone[i]->Get1Dplot());
|
||||||
|
}
|
||||||
|
winClone[i]->Get1Dplot()->UnZoom();
|
||||||
|
}
|
||||||
|
else{
|
||||||
plot2D = new SlsQt2DPlotLayout(boxPlot);
|
plot2D = new SlsQt2DPlotLayout(boxPlot);
|
||||||
plotLayout->addWidget(plot1D,1,1,1,1);
|
plot2D->setFont(QFont("Sans Serif",9,QFont::Normal));
|
||||||
plotLayout->addWidget(plot2D,1,1,1,1);
|
plotLayout->addWidget(plot2D,1,1,1,1);
|
||||||
|
}
|
||||||
UpdatePlot();
|
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)));
|
||||||
|
@ -319,30 +319,27 @@ void qTabMeasurement::setTimingMode(int mode){
|
|||||||
cout<<"Setting Timing mode to " << comboTimingMode->currentText().toAscii().data()<<endl;
|
cout<<"Setting Timing mode to " << comboTimingMode->currentText().toAscii().data()<<endl;
|
||||||
#endif
|
#endif
|
||||||
//need to send to client to set the timing mode
|
//need to send to client to set the timing mode
|
||||||
|
|
||||||
|
/** Default settings */
|
||||||
|
lblNumFrames->setEnabled(false); spinNumFrames->setEnabled(false);
|
||||||
|
lblExpTime->setEnabled(false); spinExpTime->setEnabled(false); comboExpUnit->setEnabled(false);
|
||||||
|
lblPeriod->setEnabled(false); spinPeriod->setEnabled(false); comboPeriodUnit->setEnabled(false);
|
||||||
|
lblNumTriggers->setEnabled(false); spinNumTriggers->setEnabled(false);
|
||||||
|
lblDelay->setEnabled(false); spinDelay->setEnabled(false); comboDelayUnit->setEnabled(false);
|
||||||
|
lblNumGates->setEnabled(false); spinNumGates->setEnabled(false);
|
||||||
|
lblNumProbes->setEnabled(false); spinNumProbes->setEnabled(false);
|
||||||
|
|
||||||
|
|
||||||
switch(mode){
|
switch(mode){
|
||||||
case None:
|
case None:
|
||||||
lblNumFrames->setEnabled(false); spinNumFrames->setEnabled(false);
|
|
||||||
lblExpTime->setEnabled(false); spinExpTime->setEnabled(false); comboExpUnit->setEnabled(false);
|
|
||||||
lblPeriod->setEnabled(false); spinPeriod->setEnabled(false); comboPeriodUnit->setEnabled(false);
|
|
||||||
lblNumTriggers->setEnabled(false); spinNumTriggers->setEnabled(false);
|
|
||||||
lblDelay->setEnabled(false); spinDelay->setEnabled(false); comboDelayUnit->setEnabled(false);
|
|
||||||
lblNumGates->setEnabled(false); spinNumGates->setEnabled(false);
|
|
||||||
lblNumProbes->setEnabled(false); spinNumProbes->setEnabled(false);
|
|
||||||
break;
|
break;
|
||||||
case Auto:
|
case Auto:
|
||||||
lblNumFrames->setEnabled(true); spinNumFrames->setEnabled(true);
|
lblNumFrames->setEnabled(true); spinNumFrames->setEnabled(true);
|
||||||
lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true);
|
lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true);
|
||||||
lblPeriod->setEnabled(true); spinPeriod->setEnabled(true); comboPeriodUnit->setEnabled(true);
|
lblPeriod->setEnabled(true); spinPeriod->setEnabled(true); comboPeriodUnit->setEnabled(true);
|
||||||
lblNumTriggers->setEnabled(false); spinNumTriggers->setEnabled(false);
|
|
||||||
lblDelay->setEnabled(false); spinDelay->setEnabled(false); comboDelayUnit->setEnabled(false);
|
|
||||||
lblNumGates->setEnabled(false); spinNumGates->setEnabled(false);
|
|
||||||
break;
|
break;
|
||||||
case Gated:
|
case Gated:
|
||||||
lblNumFrames->setEnabled(true); spinNumFrames->setEnabled(true);
|
lblNumFrames->setEnabled(true); spinNumFrames->setEnabled(true);
|
||||||
lblExpTime->setEnabled(false); spinExpTime->setEnabled(false); comboExpUnit->setEnabled(false);
|
|
||||||
lblPeriod->setEnabled(false); spinPeriod->setEnabled(false); comboPeriodUnit->setEnabled(false);
|
|
||||||
lblNumTriggers->setEnabled(false); spinNumTriggers->setEnabled(false);
|
|
||||||
lblDelay->setEnabled(false); spinDelay->setEnabled(false); comboDelayUnit->setEnabled(false);
|
|
||||||
lblNumGates->setEnabled(true); spinNumGates->setEnabled(true);
|
lblNumGates->setEnabled(true); spinNumGates->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
case Trigger_Exp_Series:
|
case Trigger_Exp_Series:
|
||||||
@ -351,39 +348,26 @@ void qTabMeasurement::setTimingMode(int mode){
|
|||||||
lblPeriod->setEnabled(true); spinPeriod->setEnabled(true); comboPeriodUnit->setEnabled(true);
|
lblPeriod->setEnabled(true); spinPeriod->setEnabled(true); comboPeriodUnit->setEnabled(true);
|
||||||
lblNumTriggers->setEnabled(true); spinNumTriggers->setEnabled(true);
|
lblNumTriggers->setEnabled(true); spinNumTriggers->setEnabled(true);
|
||||||
lblDelay->setEnabled(true); spinDelay->setEnabled(true); comboDelayUnit->setEnabled(true);
|
lblDelay->setEnabled(true); spinDelay->setEnabled(true); comboDelayUnit->setEnabled(true);
|
||||||
lblNumGates->setEnabled(false); spinNumGates->setEnabled(false);
|
|
||||||
break;
|
break;
|
||||||
case Trigger_Readout:
|
case Trigger_Readout:
|
||||||
lblNumFrames->setEnabled(true); spinNumFrames->setEnabled(true);
|
lblNumFrames->setEnabled(true); spinNumFrames->setEnabled(true);
|
||||||
lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true);
|
lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true);
|
||||||
lblPeriod->setEnabled(true); spinPeriod->setEnabled(true); comboPeriodUnit->setEnabled(true);
|
lblPeriod->setEnabled(true); spinPeriod->setEnabled(true); comboPeriodUnit->setEnabled(true);
|
||||||
lblNumTriggers->setEnabled(false); spinNumTriggers->setEnabled(false);
|
|
||||||
lblDelay->setEnabled(true); spinDelay->setEnabled(true); comboDelayUnit->setEnabled(true);
|
lblDelay->setEnabled(true); spinDelay->setEnabled(true); comboDelayUnit->setEnabled(true);
|
||||||
lblNumGates->setEnabled(false); spinNumGates->setEnabled(false);
|
|
||||||
break;
|
break;
|
||||||
case Gated_Start:
|
case Gated_Start:
|
||||||
lblNumFrames->setEnabled(true); spinNumFrames->setEnabled(true);
|
lblNumFrames->setEnabled(true); spinNumFrames->setEnabled(true);
|
||||||
lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true);
|
lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true);
|
||||||
lblPeriod->setEnabled(true); spinPeriod->setEnabled(true); comboPeriodUnit->setEnabled(true);
|
lblPeriod->setEnabled(true); spinPeriod->setEnabled(true); comboPeriodUnit->setEnabled(true);
|
||||||
lblNumTriggers->setEnabled(true); spinNumTriggers->setEnabled(true);
|
lblNumTriggers->setEnabled(true); spinNumTriggers->setEnabled(true);
|
||||||
lblDelay->setEnabled(false); spinDelay->setEnabled(false); comboDelayUnit->setEnabled(false);
|
|
||||||
lblNumGates->setEnabled(true); spinNumGates->setEnabled(true);
|
lblNumGates->setEnabled(true); spinNumGates->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
case Trigger_Frame:
|
case Trigger_Frame:
|
||||||
lblNumFrames->setEnabled(false); spinNumFrames->setEnabled(false);
|
|
||||||
lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true);
|
lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true);
|
||||||
lblPeriod->setEnabled(false); spinPeriod->setEnabled(false); comboPeriodUnit->setEnabled(false);
|
|
||||||
lblNumTriggers->setEnabled(true); spinNumTriggers->setEnabled(true);
|
lblNumTriggers->setEnabled(true); spinNumTriggers->setEnabled(true);
|
||||||
lblDelay->setEnabled(false); spinDelay->setEnabled(false); comboDelayUnit->setEnabled(false);
|
|
||||||
lblNumGates->setEnabled(false); spinNumGates->setEnabled(false);
|
|
||||||
break;
|
break;
|
||||||
case Trigger_Window:
|
case Trigger_Window:
|
||||||
lblNumFrames->setEnabled(false); spinNumFrames->setEnabled(false);
|
|
||||||
lblExpTime->setEnabled(false); spinExpTime->setEnabled(false); comboExpUnit->setEnabled(false);
|
|
||||||
lblPeriod->setEnabled(false); spinPeriod->setEnabled(false); comboPeriodUnit->setEnabled(false);
|
|
||||||
lblNumTriggers->setEnabled(true); spinNumTriggers->setEnabled(true);
|
lblNumTriggers->setEnabled(true); spinNumTriggers->setEnabled(true);
|
||||||
lblDelay->setEnabled(false); spinDelay->setEnabled(false); comboDelayUnit->setEnabled(false);
|
|
||||||
lblNumGates->setEnabled(false); spinNumGates->setEnabled(false);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cout<<"ERROR: Timing mode being set to other should never happen"<<endl;
|
cout<<"ERROR: Timing mode being set to other should never happen"<<endl;
|
||||||
@ -392,9 +376,7 @@ void qTabMeasurement::setTimingMode(int mode){
|
|||||||
|
|
||||||
if(mode!=None){
|
if(mode!=None){
|
||||||
if(myDet->getDetectorsType()==slsDetectorDefs::MYTHEN){
|
if(myDet->getDetectorsType()==slsDetectorDefs::MYTHEN){
|
||||||
lblNumProbes->setEnabled(true); spinNumProbes->setEnabled(true);
|
lblNumProbes->setEnabled(true); spinNumProbes->setEnabled(true);
|
||||||
}else{
|
|
||||||
lblNumProbes->setEnabled(false); spinNumProbes->setEnabled(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,19 +12,30 @@
|
|||||||
#include "slsDetector.h"
|
#include "slsDetector.h"
|
||||||
#include "multiSlsDetector.h"
|
#include "multiSlsDetector.h"
|
||||||
/** C++ Include Headers */
|
/** C++ Include Headers */
|
||||||
#include<iostream>
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
#define Detector_Index 0
|
#define Detector_Index 0
|
||||||
|
|
||||||
|
|
||||||
|
QString qTabPlot::defaultPlotTitle("Measurement");
|
||||||
|
QString qTabPlot::defaultHistXAxisTitle("Channel Number");
|
||||||
|
QString qTabPlot::defaultHistYAxisTitle("Counts");
|
||||||
|
QString qTabPlot::defaultImageXAxisTitle("Pixel");
|
||||||
|
QString qTabPlot::defaultImageYAxisTitle("Pixel");
|
||||||
|
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);
|
||||||
if(myDet)
|
if(myDet)
|
||||||
{
|
{
|
||||||
SetupWidgetWindow();
|
// wherever you choose plot do all these steps
|
||||||
|
//This also selects the text if unchecked
|
||||||
|
//includes setupwidgetwindow
|
||||||
|
//SelectPlot(1);
|
||||||
Initialization();
|
Initialization();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -41,10 +52,51 @@ qTabPlot::~qTabPlot(){
|
|||||||
|
|
||||||
|
|
||||||
void qTabPlot::SetupWidgetWindow(){
|
void qTabPlot::SetupWidgetWindow(){
|
||||||
box1D->setEnabled(false);
|
/** Plot Axis*/
|
||||||
|
myPlot->SetPlotTitle(defaultPlotTitle);
|
||||||
|
dispTitle->setText(defaultPlotTitle);
|
||||||
|
dispTitle->setEnabled(false);
|
||||||
|
dispXAxis->setEnabled(false);
|
||||||
|
dispYAxis->setEnabled(false);
|
||||||
|
dispZAxis->setEnabled(false);
|
||||||
|
dispXMin->setEnabled(false);
|
||||||
|
dispYMin->setEnabled(false);
|
||||||
|
dispZMin->setEnabled(false);
|
||||||
|
dispXMax->setEnabled(false);
|
||||||
|
dispYMax->setEnabled(false);
|
||||||
|
dispZMax->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qTabPlot::Select1DPlot(bool b){
|
||||||
|
SetupWidgetWindow();
|
||||||
|
if(b){
|
||||||
|
myPlot->Select1DPlot();
|
||||||
|
box1D->setEnabled(true);
|
||||||
|
box2D->setEnabled(false);
|
||||||
|
chkZAxis->setEnabled(false);
|
||||||
|
chkZMin->setEnabled(false);
|
||||||
|
chkZMax->setEnabled(false);
|
||||||
|
myPlot->SetHistXAxisTitle(defaultHistXAxisTitle);
|
||||||
|
dispXAxis->setText(defaultHistXAxisTitle);
|
||||||
|
myPlot->SetHistYAxisTitle(defaultHistYAxisTitle);
|
||||||
|
dispYAxis->setText(defaultHistYAxisTitle);
|
||||||
|
}else{
|
||||||
|
myPlot->Select2DPlot();
|
||||||
|
box1D->setEnabled(false);
|
||||||
|
box2D->setEnabled(true);
|
||||||
|
chkZAxis->setEnabled(true);
|
||||||
|
chkZMin->setEnabled(true);
|
||||||
|
chkZMax->setEnabled(true);
|
||||||
|
myPlot->SetImageXAxisTitle(defaultImageXAxisTitle);
|
||||||
|
dispXAxis->setText(defaultImageXAxisTitle);
|
||||||
|
myPlot->SetImageYAxisTitle(defaultImageYAxisTitle);
|
||||||
|
dispYAxis->setText(defaultImageYAxisTitle);
|
||||||
|
myPlot->SetImageZAxisTitle(defaultImageZAxisTitle);
|
||||||
|
dispZAxis->setText(defaultImageZAxisTitle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void qTabPlot::Initialization(){
|
void qTabPlot::Initialization(){
|
||||||
/** Plot box*/
|
/** Plot box*/
|
||||||
@ -54,6 +106,21 @@ void qTabPlot::Initialization(){
|
|||||||
connect(chkInterpolate, SIGNAL(toggled(bool)),myPlot, SIGNAL(InterpolateSignal(bool)));
|
connect(chkInterpolate, SIGNAL(toggled(bool)),myPlot, SIGNAL(InterpolateSignal(bool)));
|
||||||
connect(chkContour, SIGNAL(toggled(bool)),myPlot, SIGNAL(ContourSignal(bool)));
|
connect(chkContour, SIGNAL(toggled(bool)),myPlot, SIGNAL(ContourSignal(bool)));
|
||||||
connect(chkLogz, SIGNAL(toggled(bool)),myPlot, SIGNAL(LogzSignal(bool)));
|
connect(chkLogz, SIGNAL(toggled(bool)),myPlot, SIGNAL(LogzSignal(bool)));
|
||||||
|
/** Plot Axis **/
|
||||||
|
connect(chkTitle, SIGNAL(toggled(bool)), this, SLOT(EnableTitles()));
|
||||||
|
connect(chkXAxis, SIGNAL(toggled(bool)), this, SLOT(EnableTitles()));
|
||||||
|
connect(chkYAxis, SIGNAL(toggled(bool)), this, SLOT(EnableTitles()));
|
||||||
|
connect(chkZAxis, SIGNAL(toggled(bool)), this, SLOT(EnableTitles()));
|
||||||
|
connect(dispTitle, SIGNAL(returnPressed()), this, SLOT(SetTitles()));
|
||||||
|
connect(dispXAxis, SIGNAL(returnPressed()), this, SLOT(SetTitles()));
|
||||||
|
connect(dispYAxis, SIGNAL(returnPressed()), this, SLOT(SetTitles()));
|
||||||
|
connect(dispZAxis, SIGNAL(returnPressed()), this, SLOT(SetTitles()));
|
||||||
|
|
||||||
|
/** Common Buttons*/
|
||||||
|
connect(btnClear, SIGNAL(clicked()),myPlot, SLOT(Clear1DPlot()));
|
||||||
|
|
||||||
|
/** test for 1D*/
|
||||||
|
connect(chktest1D, SIGNAL(toggled(bool)), this, SLOT(Select1DPlot(bool)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -66,4 +133,65 @@ void qTabPlot::Enable(bool enable){
|
|||||||
boxPlotAxis->setEnabled(enable);
|
boxPlotAxis->setEnabled(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabPlot::SetTitles(){
|
||||||
|
int oneD = box1D->isEnabled();
|
||||||
|
/** Plot Title*/
|
||||||
|
if(dispTitle->isEnabled())
|
||||||
|
myPlot->SetPlotTitle(dispTitle->text());
|
||||||
|
/** X Axis */
|
||||||
|
if(dispXAxis->isEnabled()){
|
||||||
|
if(oneD) myPlot->SetHistXAxisTitle(dispXAxis->text());
|
||||||
|
else myPlot->SetImageXAxisTitle(dispXAxis->text());
|
||||||
|
}
|
||||||
|
/** Y Axis */
|
||||||
|
if(dispYAxis->isEnabled()){
|
||||||
|
if(oneD) myPlot->SetHistYAxisTitle(dispYAxis->text());
|
||||||
|
else myPlot->SetImageYAxisTitle(dispYAxis->text());
|
||||||
|
}
|
||||||
|
/** Z Axis */
|
||||||
|
if(dispZAxis->isEnabled())
|
||||||
|
myPlot->SetImageZAxisTitle(dispZAxis->text());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qTabPlot::EnableTitles(){
|
||||||
|
int oneD = box1D->isEnabled();
|
||||||
|
/** Plot Title*/
|
||||||
|
dispTitle->setEnabled(chkTitle->isChecked());
|
||||||
|
if(!chkTitle->isChecked()){
|
||||||
|
myPlot->SetPlotTitle(defaultPlotTitle);
|
||||||
|
dispTitle->setText(defaultPlotTitle);
|
||||||
|
}
|
||||||
|
/** X Axis */
|
||||||
|
dispXAxis->setEnabled(chkXAxis->isChecked());
|
||||||
|
if(!chkXAxis->isChecked()){
|
||||||
|
if(oneD){
|
||||||
|
myPlot->SetHistXAxisTitle(defaultHistXAxisTitle);
|
||||||
|
dispXAxis->setText(defaultHistXAxisTitle);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
myPlot->SetImageXAxisTitle(defaultImageXAxisTitle);
|
||||||
|
dispXAxis->setText(defaultImageXAxisTitle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** Y Axis */
|
||||||
|
dispYAxis->setEnabled(chkYAxis->isChecked());
|
||||||
|
if(!chkYAxis->isChecked()){
|
||||||
|
if(oneD){
|
||||||
|
myPlot->SetHistYAxisTitle(defaultHistYAxisTitle);
|
||||||
|
dispYAxis->setText(defaultHistYAxisTitle);
|
||||||
|
}else{
|
||||||
|
myPlot->SetImageYAxisTitle(defaultImageYAxisTitle);
|
||||||
|
dispYAxis->setText(defaultImageYAxisTitle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** Z Axis */
|
||||||
|
dispZAxis->setEnabled(chkZAxis->isChecked());
|
||||||
|
if(!chkZAxis->isChecked()){
|
||||||
|
myPlot->SetImageZAxisTitle(defaultImageZAxisTitle);
|
||||||
|
dispZAxis->setText(defaultImageZAxisTitle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user