mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 03:40:04 +02:00
Version 1 with the action tab working
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@6 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
parent
20cc6d9a90
commit
7a218418d1
@ -10,7 +10,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>822</height>
|
||||
<height>800</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -39,12 +39,9 @@
|
||||
<property name="dockNestingEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="dockOptions">
|
||||
<set>QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks</set>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -52,13 +49,13 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
<height>395</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>524287</width>
|
||||
<height>450</height>
|
||||
<height>395</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
@ -71,6 +68,24 @@
|
||||
<height>25</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
@ -132,13 +147,13 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>38</width>
|
||||
<height>369</height>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>524287</width>
|
||||
<height>524287</height>
|
||||
<height>390</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="palette">
|
||||
@ -251,8 +266,11 @@
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QDockWidget" name="dockWidgetPlot">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
@ -6,12 +6,12 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>748</width>
|
||||
<width>734</width>
|
||||
<height>339</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -24,26 +24,13 @@
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>1000</width>
|
||||
<height>1000</height>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>224</x>
|
||||
<y>223</y>
|
||||
<width>75</width>
|
||||
<height>25</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
@ -47,8 +47,8 @@
|
||||
<widget class="QPushButton" name="btnTemp">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>52</x>
|
||||
<y>106</y>
|
||||
<x>10</x>
|
||||
<y>14</y>
|
||||
<width>91</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
@ -67,8 +67,8 @@ Temperature</string>
|
||||
<widget class="QLineEdit" name="dispTempFpga">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>222</x>
|
||||
<y>132</y>
|
||||
<x>180</x>
|
||||
<y>40</y>
|
||||
<width>151</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
@ -90,8 +90,8 @@ Temperature</string>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>162</x>
|
||||
<y>102</y>
|
||||
<x>120</x>
|
||||
<y>10</y>
|
||||
<width>41</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
@ -103,8 +103,8 @@ Temperature</string>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>162</x>
|
||||
<y>132</y>
|
||||
<x>120</x>
|
||||
<y>40</y>
|
||||
<width>41</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
@ -116,8 +116,8 @@ Temperature</string>
|
||||
<widget class="QLineEdit" name="dispTempAdc">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>222</x>
|
||||
<y>102</y>
|
||||
<x>180</x>
|
||||
<y>10</y>
|
||||
<width>151</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
|
@ -31,41 +31,182 @@
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<widget class="QGroupBox" name="boxCorrection">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>157</x>
|
||||
<y>256</y>
|
||||
<width>75</width>
|
||||
<height>25</height>
|
||||
<x>20</x>
|
||||
<y>75</y>
|
||||
<width>691</width>
|
||||
<height>206</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
<property name="title">
|
||||
<string>Correction</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="gridLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>671</width>
|
||||
<height>181</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_3">
|
||||
<property name="text">
|
||||
<string>Flat Field File</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_2">
|
||||
<property name="text">
|
||||
<string>Rate Correction</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_4">
|
||||
<property name="text">
|
||||
<string>Angular Conversion</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" colspan="4">
|
||||
<widget class="QLineEdit" name="lineEdit_2"/>
|
||||
</item>
|
||||
<item row="0" column="7">
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="text">
|
||||
<string>Acquire Flat Field Data</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QRadioButton" name="radioButton_3">
|
||||
<property name="text">
|
||||
<string>Auto</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="7">
|
||||
<widget class="QSpinBox" name="spinBox"/>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5" colspan="2">
|
||||
<widget class="QRadioButton" name="radioButton">
|
||||
<property name="text">
|
||||
<string>Custom dead time(ns):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_5">
|
||||
<property name="text">
|
||||
<string>Discard Bad Channels</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<widget class="QFrame" name="frameOutput">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>108</width>
|
||||
<height>16</height>
|
||||
<x>19</x>
|
||||
<y>20</y>
|
||||
<width>701</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Output Directory:</string>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>118</x>
|
||||
<y>10</y>
|
||||
<width>113</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>6</y>
|
||||
<width>691</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="layoutOutput">
|
||||
<property name="spacing">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Output Directory:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="dispOutputDir"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnOutputBrowse">
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -7,11 +7,11 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>734</width>
|
||||
<height>339</height>
|
||||
<height>345</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -37,12 +37,15 @@
|
||||
<x>10</x>
|
||||
<y>130</y>
|
||||
<width>711</width>
|
||||
<height>151</height>
|
||||
<height>146</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Plot Axis</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@ -288,12 +291,15 @@
|
||||
<x>11</x>
|
||||
<y>70</y>
|
||||
<width>571</width>
|
||||
<height>51</height>
|
||||
<height>46</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>2D Plot Options</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@ -350,7 +356,7 @@
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>571</width>
|
||||
<height>51</height>
|
||||
<height>46</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="palette">
|
||||
@ -474,6 +480,9 @@
|
||||
<property name="title">
|
||||
<string>1D Plot Options</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@ -482,20 +491,26 @@
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>551</width>
|
||||
<height>27</height>
|
||||
<width>641</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="chktest1D">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string>Superimpose</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="btnClear">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
@ -509,22 +524,27 @@
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
<width>400</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<zorder>gridLayoutWidget_3</zorder>
|
||||
<zorder>groupBox_2</zorder>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="boxSave">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>288</y>
|
||||
<y>290</y>
|
||||
<width>711</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
@ -532,11 +552,17 @@
|
||||
<property name="title">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>13</y>
|
||||
<y>15</y>
|
||||
<width>698</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
@ -645,24 +671,33 @@
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>599</x>
|
||||
<y>10</y>
|
||||
<width>121</width>
|
||||
<height>111</height>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Clone</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="gridLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<width>81</width>
|
||||
<height>81</height>
|
||||
<x>5</x>
|
||||
<y>10</y>
|
||||
<width>111</width>
|
||||
<height>76</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
@ -673,7 +708,7 @@
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>13</number>
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="btnClone">
|
||||
|
84
slsDetectorGui/include/qActionsWidget.h
Normal file
84
slsDetectorGui/include/qActionsWidget.h
Normal file
@ -0,0 +1,84 @@
|
||||
/*
|
||||
* qTabActions.h
|
||||
*
|
||||
* Created on: May 10, 2012
|
||||
* Author: l_maliakal_d
|
||||
*/
|
||||
|
||||
#ifndef QACTIONSWIDGET_H_
|
||||
#define QACTIONSWIDGET_H_
|
||||
#include <QFrame>
|
||||
class QGridLayout;
|
||||
class QComboBox;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QLabel;
|
||||
class QSpinBox;
|
||||
class QGroupBox;
|
||||
class QRadioButton;
|
||||
|
||||
|
||||
class ActionsWidget : public QFrame{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/** \short The constructor
|
||||
* @param parent is the parent tab widget
|
||||
* @param detector is the detector returned from the detector tab
|
||||
*/
|
||||
ActionsWidget(QWidget *parent, int scanType);
|
||||
|
||||
~ActionsWidget();
|
||||
|
||||
private:
|
||||
QGridLayout *layout;
|
||||
QComboBox *comboScript;
|
||||
QLineEdit *dispScript;
|
||||
QPushButton *btnBrowse;
|
||||
QLabel *lblParameter;
|
||||
QLineEdit *dispParameter;
|
||||
QLabel *lblSteps;
|
||||
QSpinBox *spinSteps;
|
||||
QLabel *lblPrecision;
|
||||
QSpinBox *spinPrecision;
|
||||
QGroupBox *group;
|
||||
QRadioButton *radioConstant;
|
||||
QRadioButton *radioSpecific;
|
||||
QRadioButton *radioValue;
|
||||
QLabel *lblFrom;
|
||||
QSpinBox *spinFrom;
|
||||
QLabel *lblTo;
|
||||
QSpinBox *spinTo;
|
||||
QLabel *lblSize;
|
||||
QSpinBox *spinSize;
|
||||
QComboBox *comboSpecific;
|
||||
QLineEdit *dispValues;
|
||||
QPushButton *btnValues;
|
||||
|
||||
/** Sets up the widget
|
||||
* @param scanType 1 if it includes Threshold Scan,Energy Scan and Trimbits Scan, else 0*/
|
||||
void SetupWidgetWindow(int scanType);
|
||||
|
||||
/** Sets up all the slots and signals */
|
||||
void Initialization();
|
||||
|
||||
|
||||
private slots:
|
||||
/** Sets the scan or script. Accordingly enables, disables other widgets
|
||||
* @param index value chosen*/
|
||||
void SetScript(int index);
|
||||
|
||||
/** Enables widgets depending on which size is clicked.
|
||||
* Options: constant size,specific values,values from file */
|
||||
void EnableSizeWidgets();
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* QACTIONSWIDGET_H_ */
|
||||
|
@ -25,6 +25,23 @@ class slsDetectorUtils;
|
||||
/** Qt Include Headers */
|
||||
#include <QScrollArea>
|
||||
#include <QGridLayout>
|
||||
#include <QResizeEvent>
|
||||
|
||||
class MyTabWidget:public QTabWidget
|
||||
{
|
||||
public:
|
||||
MyTabWidget(QWidget* parent = 0)
|
||||
{
|
||||
setParent(parent);
|
||||
}
|
||||
|
||||
//Overridden method from QTabWidget
|
||||
QTabBar* tabBar()
|
||||
{
|
||||
return QTabWidget::tabBar();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
*@short Main window of the GUI.
|
||||
@ -56,12 +73,13 @@ private:
|
||||
/** The Plot widget */
|
||||
qDrawPlot *myPlot;
|
||||
/**Tab Widget */
|
||||
QTabWidget *tabs;
|
||||
MyTabWidget *tabs;
|
||||
/**Layout of the central Widget */
|
||||
QGridLayout *layoutTabs;
|
||||
/** height of Plot Window when undocked */
|
||||
/** default height of Plot Window when docked */
|
||||
int heightPlotWindow;
|
||||
|
||||
/** default height of central widgetwhen plot Window when docked */
|
||||
int heightCentralWidget;
|
||||
/** enumeration of the tabs */
|
||||
enum {Measurement, DataOutput, Plot, Actions, Settings, Advanced, Debugging, Developer, NumberOfTabs };
|
||||
|
||||
@ -83,6 +101,8 @@ private:
|
||||
qTabDebugging *tab_debugging;
|
||||
/**Developer tab */
|
||||
qTabDeveloper *tab_developer;
|
||||
/**if the developer tab should be enabled,known from command line */
|
||||
int isDeveloper;
|
||||
|
||||
|
||||
/**Sets up the layout of the widget
|
||||
@ -163,6 +183,12 @@ void ResizeMainWindow(bool b);
|
||||
*/
|
||||
void SetTerminalWindowSize(bool b);
|
||||
|
||||
/** Enables/disables tabs depending on if acquisition is currently in progress
|
||||
*/
|
||||
void EnableTabs();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
|
||||
signals:
|
||||
|
||||
|
@ -8,15 +8,25 @@
|
||||
#ifndef QTABACTIONS_H_
|
||||
#define QTABACTIONS_H_
|
||||
|
||||
|
||||
/** Form Header */
|
||||
#include "ui_form_tab_actions.h"
|
||||
/** Project Class Headers */
|
||||
class slsDetectorUtils;
|
||||
class ActionsWidget;
|
||||
|
||||
|
||||
class QPushButton;
|
||||
class QLabel;
|
||||
class QScrollArea;
|
||||
class QGridLayout;
|
||||
class QPalette;
|
||||
|
||||
|
||||
/**
|
||||
*@short sets up the acions parameters
|
||||
*/
|
||||
class qTabActions:public QWidget, private Ui::TabActionsObject{
|
||||
class qTabActions:public QWidget,private Ui::TabActionsObject{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@ -35,18 +45,32 @@ private:
|
||||
/** The sls detector object */
|
||||
slsDetectorUtils *myDet;
|
||||
|
||||
/** Sets up the widget
|
||||
*/
|
||||
static const int NUM_ACTION_WIDGETS = 9;
|
||||
|
||||
QGridLayout *gridLayout;
|
||||
QButtonGroup *group;
|
||||
QPalette *palette;
|
||||
|
||||
/** action widget objects */
|
||||
ActionsWidget *actionWidget[NUM_ACTION_WIDGETS];
|
||||
QPushButton *btnExpand[NUM_ACTION_WIDGETS];
|
||||
QLabel *lblName[NUM_ACTION_WIDGETS];
|
||||
|
||||
/** Sets up the widget */
|
||||
void SetupWidgetWindow();
|
||||
|
||||
/** Sets up all the slots and signals
|
||||
*/
|
||||
/** Sets up all the slots and signals */
|
||||
void Initialization();
|
||||
|
||||
/** Enables/Disables all the widgets
|
||||
*/
|
||||
/** Enables/Disables all the widgets */
|
||||
void Enable(bool enable);
|
||||
|
||||
|
||||
private slots:
|
||||
/** To Expand the Action Widget */
|
||||
void Expand(QAbstractButton *button);
|
||||
|
||||
};
|
||||
|
||||
#endif /* QTABACTIONS_H_ */
|
||||
|
||||
|
@ -12,6 +12,9 @@
|
||||
#include "ui_form_tab_dataoutput.h"
|
||||
/** Project Class Headers */
|
||||
class slsDetectorUtils;
|
||||
/** Qt Include Headers */
|
||||
#include <QString>
|
||||
|
||||
|
||||
/**
|
||||
*@short sets up the DataOutput parameters
|
||||
@ -35,18 +38,28 @@ private:
|
||||
/** The sls detector object */
|
||||
slsDetectorUtils *myDet;
|
||||
|
||||
/** Sets up the widget
|
||||
*/
|
||||
/** Output Directory */
|
||||
QString outputDir;
|
||||
|
||||
/** methods */
|
||||
/** Sets up the widget */
|
||||
void SetupWidgetWindow();
|
||||
|
||||
/** Sets up all the slots and signals
|
||||
*/
|
||||
/** Sets up all the slots and signals */
|
||||
void Initialization();
|
||||
|
||||
/** Enables/Disables all the widgets
|
||||
*/
|
||||
/** Enables/Disables all the widgets */
|
||||
void Enable(bool enable);
|
||||
|
||||
|
||||
private slots:
|
||||
/** Sets the output directory
|
||||
* @param path output path to be set
|
||||
*/
|
||||
void setOutputDir(const QString& path);
|
||||
|
||||
/** Open dialog to choose the output directory */
|
||||
void browseOutputDir();
|
||||
};
|
||||
|
||||
|
||||
|
@ -70,6 +70,7 @@ private:
|
||||
|
||||
|
||||
public slots:
|
||||
|
||||
/** update plot is finished,
|
||||
* changes start/stop text and enables/disables all widgets
|
||||
*/
|
||||
@ -77,7 +78,6 @@ void UpdateFinished();
|
||||
|
||||
|
||||
|
||||
|
||||
private slots:
|
||||
/** Set file name
|
||||
* @param fName name of file
|
||||
@ -133,7 +133,8 @@ void setNumProbes(int val);
|
||||
|
||||
signals:
|
||||
|
||||
|
||||
void StartSignal();
|
||||
void StopSignal();
|
||||
};
|
||||
|
||||
|
||||
|
@ -50,6 +50,7 @@ SOURCES = \
|
||||
src/qTabDataOutput.cpp\
|
||||
src/qTabPlot.cpp\
|
||||
src/qTabActions.cpp\
|
||||
src/qActionsWidget.cpp\
|
||||
src/qTabAdvanced.cpp\
|
||||
src/qTabSettings.cpp\
|
||||
src/qTabDebugging.cpp\
|
||||
@ -72,6 +73,7 @@ HEADERS = \
|
||||
include/qTabDataOutput.h\
|
||||
include/qTabPlot.h\
|
||||
include/qTabActions.h\
|
||||
include/qActionsWidget.h\
|
||||
include/qTabAdvanced.h\
|
||||
include/qTabSettings.h\
|
||||
include/qTabDebugging.h\
|
||||
|
264
slsDetectorGui/src/qActionsWidget.cpp
Normal file
264
slsDetectorGui/src/qActionsWidget.cpp
Normal file
@ -0,0 +1,264 @@
|
||||
/*
|
||||
* qTabActions.cpp
|
||||
*
|
||||
* Created on: May 10, 2012
|
||||
* Author: l_maliakal_d
|
||||
*/
|
||||
|
||||
/** Qt Project Class Headers */
|
||||
#include "qActionsWidget.h"
|
||||
/** Qt Include Headers */
|
||||
#include <QGridLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QComboBox>
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
#include <QLabel>
|
||||
#include <QLayout>
|
||||
#include <QSpacerItem>
|
||||
#include <QSpinBox>
|
||||
#include <QGroupBox>
|
||||
#include <QRadioButton>
|
||||
/** C++ Include Headers */
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
|
||||
|
||||
#define Detector_Index 0
|
||||
|
||||
|
||||
ActionsWidget::ActionsWidget(QWidget *parent, int scanType): QFrame(parent){
|
||||
SetupWidgetWindow(scanType);
|
||||
Initialization();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ActionsWidget::~ActionsWidget(){
|
||||
delete layout;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ActionsWidget::SetupWidgetWindow(int scanType){
|
||||
/** Widget Settings */
|
||||
//setFrameStyle(QFrame::Box);
|
||||
//setFrameShadow(QFrame::Raised);
|
||||
setFixedHeight(25);
|
||||
if(scanType) setFixedHeight(125);
|
||||
|
||||
|
||||
/** Main Layout Settings */
|
||||
layout = new QGridLayout(this);
|
||||
setLayout(layout);
|
||||
layout->setContentsMargins(0,0,0,0);
|
||||
if(scanType) layout->setVerticalSpacing(5);
|
||||
|
||||
|
||||
/** Main Widgets*/
|
||||
comboScript = new QComboBox(this);
|
||||
if(!scanType){
|
||||
comboScript->addItem("None");
|
||||
comboScript->addItem("Custom Script");
|
||||
}else{
|
||||
comboScript->addItem("None");
|
||||
comboScript->addItem("Energy Scan");
|
||||
comboScript->addItem("Threshold Scan");
|
||||
comboScript->addItem("Trimbits Scan");
|
||||
comboScript->addItem("Custom Script");
|
||||
}
|
||||
layout->addWidget(comboScript,0,0);
|
||||
layout->addItem(new QSpacerItem(20,20,QSizePolicy::Fixed,QSizePolicy::Fixed),0,1);
|
||||
dispScript = new QLineEdit("None");
|
||||
dispScript->setEnabled(false);
|
||||
layout->addWidget(dispScript,0,2);
|
||||
btnBrowse = new QPushButton("Browse");
|
||||
btnBrowse->setEnabled(false);
|
||||
layout->addWidget(btnBrowse,0,3);
|
||||
layout->addItem(new QSpacerItem(20,20,QSizePolicy::Fixed,QSizePolicy::Fixed),0,4);
|
||||
lblParameter = new QLabel("Additional Parameter:");
|
||||
lblParameter->setEnabled(false);
|
||||
layout->addWidget(lblParameter,0,5);
|
||||
dispParameter = new QLineEdit("None");
|
||||
dispParameter->setEnabled(false);
|
||||
dispParameter->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||
layout->addWidget(dispParameter,0,6);
|
||||
|
||||
|
||||
|
||||
/** Scan Levels Widgets*/
|
||||
if(scanType){
|
||||
lblSteps = new QLabel("Number of Steps:");
|
||||
lblSteps->setEnabled(false);
|
||||
layout->addWidget(lblSteps,1,2);
|
||||
spinSteps = new QSpinBox(this);
|
||||
spinSteps->setEnabled(false);
|
||||
layout->addWidget(spinSteps,1,3);
|
||||
lblPrecision = new QLabel("Precision:");
|
||||
lblPrecision->setEnabled(false);
|
||||
layout->addWidget(lblPrecision,1,5);
|
||||
spinPrecision = new QSpinBox(this);
|
||||
spinPrecision->setEnabled(false);
|
||||
layout->addWidget(spinPrecision,1,6);
|
||||
group = new QGroupBox(this);
|
||||
group->setEnabled(false);
|
||||
/** Fix the size of the groupbox*/
|
||||
group->setFixedSize(513,66);
|
||||
layout->addWidget(group,2,2,1,5);
|
||||
|
||||
|
||||
/** Group Box for step size */
|
||||
/** Radio Buttons Layout */
|
||||
QWidget *h1Widget = new QWidget(group);
|
||||
h1Widget->setGeometry(QRect(10, 5, group->width()-20, 23));
|
||||
QHBoxLayout *h1 = new QHBoxLayout(h1Widget);
|
||||
h1->setContentsMargins(0, 0, 0, 0);
|
||||
radioConstant = new QRadioButton("Constant Step Size",h1Widget);
|
||||
radioConstant->setChecked(true);
|
||||
h1->addWidget(radioConstant);
|
||||
radioSpecific = new QRadioButton("Specific Values",h1Widget);
|
||||
h1->addWidget(radioSpecific);
|
||||
radioValue = new QRadioButton("Values from File",h1Widget);
|
||||
radioValue->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||
h1->addWidget(radioValue);
|
||||
|
||||
/** Constant Size Layout */
|
||||
QWidget *h2ConstantWidget = new QWidget(group);
|
||||
h2ConstantWidget->setGeometry(QRect(10, 30, group->width()-20, 31));
|
||||
QHBoxLayout *h2Constant = new QHBoxLayout(h2ConstantWidget);
|
||||
h2Constant->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
h2Constant->addItem(new QSpacerItem(50,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
|
||||
lblFrom = new QLabel("from",h2ConstantWidget);
|
||||
lblFrom->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||
h2Constant->addWidget(lblFrom);
|
||||
spinFrom = new QSpinBox(h2ConstantWidget);
|
||||
h2Constant->addWidget(spinFrom);
|
||||
lblTo = new QLabel("to",h2ConstantWidget);
|
||||
lblTo->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||
h2Constant->addWidget(lblTo);
|
||||
spinTo = new QSpinBox(h2ConstantWidget);
|
||||
h2Constant->addWidget(spinTo);
|
||||
h2Constant->addItem(new QSpacerItem(20,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
|
||||
lblSize = new QLabel("Size",h2ConstantWidget);
|
||||
lblSize->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||
h2Constant->addWidget(lblSize);
|
||||
spinSize = new QSpinBox(h2ConstantWidget);
|
||||
h2Constant->addWidget(spinSize);
|
||||
h2Constant->addItem(new QSpacerItem(50,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
|
||||
|
||||
/** Specific Values Layout */
|
||||
QWidget *h2SpecificWidget = new QWidget(group);
|
||||
h2SpecificWidget->setGeometry(QRect(10, 30, group->width()-20, 31));
|
||||
QHBoxLayout *h2Specific = new QHBoxLayout(h2SpecificWidget);
|
||||
h2Specific->setContentsMargins(0, 0, 0, 0);
|
||||
h2Specific->addItem(new QSpacerItem(200,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
|
||||
comboSpecific = new QComboBox(h2SpecificWidget);
|
||||
h2Specific->addWidget(comboSpecific);
|
||||
comboSpecific->hide();
|
||||
h2Specific->addItem(new QSpacerItem(200,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
|
||||
|
||||
/** Values From a File Layout */
|
||||
QWidget *h2ValuesWidget = new QWidget(group);
|
||||
h2ValuesWidget->setGeometry(QRect(10, 30, group->width()-20, 31));
|
||||
QHBoxLayout *h2Values = new QHBoxLayout(h2ValuesWidget);
|
||||
h2Values->setContentsMargins(0, 0, 0, 0);
|
||||
h2Values->addItem(new QSpacerItem(50,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
|
||||
dispValues = new QLineEdit("steps.txt",h2ValuesWidget);
|
||||
dispValues->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed);
|
||||
h2Values->addWidget(dispValues);
|
||||
dispValues->hide();
|
||||
btnValues = new QPushButton("Browse",h2ValuesWidget);
|
||||
btnValues->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||
h2Values->addWidget(btnValues);
|
||||
btnValues->hide();
|
||||
h2Values->addItem(new QSpacerItem(50,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ActionsWidget::Initialization(){
|
||||
connect(comboScript,SIGNAL(currentIndexChanged(int)),this,SLOT(SetScript(int)));
|
||||
connect(radioConstant,SIGNAL(toggled(bool)),this,SLOT(EnableSizeWidgets()));
|
||||
connect(radioSpecific,SIGNAL(toggled(bool)),this,SLOT(EnableSizeWidgets()));
|
||||
connect(radioValue,SIGNAL(toggled(bool)),this,SLOT(EnableSizeWidgets()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ActionsWidget::SetScript(int index){
|
||||
/** defaults */
|
||||
dispScript->setEnabled(false);
|
||||
btnBrowse->setEnabled(false);
|
||||
lblParameter->setEnabled(false);
|
||||
dispParameter->setEnabled(false);
|
||||
if(comboScript->count()>2){
|
||||
group->setEnabled(false);
|
||||
lblSteps->setEnabled(false);
|
||||
spinSteps->setEnabled(false);
|
||||
lblPrecision->setEnabled(false);
|
||||
spinPrecision->setEnabled(false);
|
||||
}
|
||||
/** If anything other than None is selected*/
|
||||
if(index){
|
||||
/** Custom Script only enables the first layout with addnl parameters etc */
|
||||
if(!comboScript->currentText().compare("Custom Script")){
|
||||
dispScript->setEnabled(true);
|
||||
btnBrowse->setEnabled(true);
|
||||
lblParameter->setEnabled(true);
|
||||
dispParameter->setEnabled(true);
|
||||
}
|
||||
/** If this group includes Energy scan , threhold scan etc */
|
||||
if(comboScript->count()>2){
|
||||
group->setEnabled(true);
|
||||
lblPrecision->setEnabled(true);
|
||||
spinPrecision->setEnabled(true);
|
||||
/** Steps are enabled only if constant step size is not checked*/
|
||||
lblSteps->setEnabled(!radioConstant->isChecked());
|
||||
spinSteps->setEnabled(!radioConstant->isChecked());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ActionsWidget::EnableSizeWidgets(){
|
||||
/** defaults */
|
||||
lblFrom->hide();
|
||||
spinFrom->hide();
|
||||
lblTo->hide();
|
||||
spinTo->hide();
|
||||
lblSize->hide();
|
||||
spinSize->hide();
|
||||
comboSpecific->hide();
|
||||
dispValues->hide();
|
||||
btnValues->hide();
|
||||
lblSteps->setEnabled(true);
|
||||
spinSteps->setEnabled(true);
|
||||
/** Constant Step Size */
|
||||
if(radioConstant->isChecked()){
|
||||
lblFrom->show();
|
||||
spinFrom->show();
|
||||
lblTo->show();
|
||||
spinTo->show();
|
||||
lblSize->show();
|
||||
spinSize->show();
|
||||
lblSteps->setEnabled(false);
|
||||
spinSteps->setEnabled(false);
|
||||
}/** Specific Values */
|
||||
else if(radioSpecific->isChecked())
|
||||
comboSpecific->show();
|
||||
/** Values from a File */
|
||||
else{
|
||||
dispValues->show();
|
||||
btnValues->show();
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,6 @@ void qCloneWidget::SetupWidgetWindow(QString title,int numDim,SlsQt1DPlot*& plot
|
||||
gridClone = new QGridLayout(cloneBox);
|
||||
cloneBox->setLayout(gridClone);
|
||||
cloneBox->setContentsMargins(0,0,0,0);
|
||||
//cloneBox->resize(400,200);
|
||||
cloneBox->setTitle(title);
|
||||
cloneBox->setAlignment(Qt::AlignHCenter);
|
||||
cloneBox->setFont(QFont("Sans Serif",11,QFont::Bold));
|
||||
@ -86,6 +85,7 @@ void qCloneWidget::SetupWidgetWindow(QString title,int numDim,SlsQt1DPlot*& plot
|
||||
hLayoutSave->setSpacing(0);
|
||||
/** file name */
|
||||
dispFName = new QLineEdit(this);
|
||||
dispFName->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||
hLayoutSave->addWidget(dispFName);
|
||||
/** file format */
|
||||
comboFormat = new QComboBox(this);
|
||||
@ -118,6 +118,8 @@ void qCloneWidget::SetupWidgetWindow(QString title,int numDim,SlsQt1DPlot*& plot
|
||||
/** Save */
|
||||
connect(btnSave, SIGNAL(clicked()), this, SLOT(SavePlot()));
|
||||
|
||||
setMinimumHeight(300);
|
||||
resize(500,350);
|
||||
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ int main (int argc, char **argv) {
|
||||
|
||||
|
||||
qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app, QWidget *parent) :
|
||||
QMainWindow(parent), theApp(app),myPlot(NULL),tabs(NULL){
|
||||
QMainWindow(parent), theApp(app),myPlot(NULL),tabs(NULL),isDeveloper(0){
|
||||
myDet = 0;
|
||||
setupUi(this);
|
||||
SetUpWidgetWindow();
|
||||
@ -44,7 +44,7 @@ qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app, QWidget *
|
||||
/**need to use argc and argv to determine which slsdet or multidet to use.*/
|
||||
|
||||
for(int iarg=1; iarg<argc; iarg++){
|
||||
if(!strcasecmp(argv[1],"-developer")) SetDeveloperMode(true);
|
||||
if(!strcasecmp(argv[1],"-developer")) {isDeveloper=1;SetDeveloperMode(true);}
|
||||
|
||||
if(!strcasecmp(argv[1],"-help")){
|
||||
cout<<"Possible Arguments are:"<<endl;
|
||||
@ -56,8 +56,6 @@ qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app, QWidget *
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//centralwidget->setFixedHeight(centralwidget->height());
|
||||
}
|
||||
|
||||
|
||||
@ -88,7 +86,7 @@ void qDetectorMain::SetUpWidgetWindow(){
|
||||
dockWidgetPlot->setWidget(myPlot);
|
||||
|
||||
/**tabs setup*/
|
||||
tabs = new QTabWidget(this);
|
||||
tabs = new MyTabWidget(this);
|
||||
layoutTabs->addWidget(tabs);
|
||||
/** creating all the tab widgets */
|
||||
tab_measurement = new qTabMeasurement (this, myDet,myPlot);
|
||||
@ -114,6 +112,7 @@ void qDetectorMain::SetUpWidgetWindow(){
|
||||
scroll[Debugging] ->setWidget(tab_debugging);
|
||||
scroll[Developer] ->setWidget(tab_developer);
|
||||
|
||||
|
||||
/** inserting all the tabs*/
|
||||
tabs->insertTab(Measurement, scroll[Measurement], "Measurement");
|
||||
tabs->insertTab(DataOutput, scroll[DataOutput], "Data Output");
|
||||
@ -130,6 +129,9 @@ void qDetectorMain::SetUpWidgetWindow(){
|
||||
SetExpertMode(false);
|
||||
SetDeveloperMode(false);
|
||||
|
||||
tabs->tabBar()->setTabTextColor(0,QColor(0,0,200,255));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -172,6 +174,9 @@ void qDetectorMain::Initialization(){
|
||||
|
||||
/** Plotting */
|
||||
/** When the acquisition is finished, must update the meas tab */
|
||||
connect(tab_measurement, SIGNAL(StartSignal()), this,SLOT(EnableTabs()));
|
||||
connect(tab_measurement, SIGNAL(StopSignal()), this,SLOT(EnableTabs()));
|
||||
connect(myPlot, SIGNAL(UpdatingPlotFinished()), this,SLOT(EnableTabs()));
|
||||
connect(myPlot, SIGNAL(UpdatingPlotFinished()), tab_measurement,SLOT(UpdateFinished()));
|
||||
|
||||
|
||||
@ -195,7 +200,7 @@ void qDetectorMain::Initialization(){
|
||||
connect(actionVersion,SIGNAL(triggered()),this,SLOT(Version()));
|
||||
|
||||
heightPlotWindow = dockWidgetPlot->size().height();
|
||||
|
||||
heightCentralWidget = centralwidget->size().height();
|
||||
}
|
||||
|
||||
|
||||
@ -224,9 +229,8 @@ void qDetectorMain::SetExpertMode(bool b){
|
||||
#ifdef VERBOSE
|
||||
cout<<"Setting Expert Mode to "<<b<<endl;
|
||||
#endif
|
||||
//threshold part in measu is enabled
|
||||
tabs->setTabEnabled(Advanced,b);
|
||||
tab_advanced->setEnabled(b);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -237,6 +241,13 @@ void qDetectorMain::refresh(int index){
|
||||
else{
|
||||
;
|
||||
}
|
||||
for(int i=0;i<NumberOfTabs;i++){
|
||||
if(tabs->isTabEnabled(i))
|
||||
tabs->tabBar()->setTabTextColor(i,Qt::black);
|
||||
else
|
||||
tabs->tabBar()->setTabTextColor(i,Qt::gray);
|
||||
}
|
||||
tabs->tabBar()->setTabTextColor(index,QColor(0,0,200,255));
|
||||
}
|
||||
|
||||
|
||||
@ -324,24 +335,45 @@ void qDetectorMain::ResizeMainWindow(bool b){
|
||||
cout<<"Resizing Main Window: height:"<<height()<<endl;
|
||||
#endif
|
||||
/** undocked from the main window */
|
||||
if(b){/** sets the main window height to a smaller maximum to get rid of space*/
|
||||
if(b){
|
||||
/** sets the main window height to a smaller maximum to get rid of space*/
|
||||
setMaximumHeight(height()-heightPlotWindow-9);
|
||||
dockWidgetPlot->setMinimumHeight(0);
|
||||
cout<<"undocking it from main window"<<endl;
|
||||
}
|
||||
else{
|
||||
setMaximumHeight(QWIDGETSIZE_MAX);
|
||||
dockWidgetPlot->setMinimumHeight(heightPlotWindow);
|
||||
|
||||
/** the minimum for plot will be set when the widget gets resized automatically*/
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void qDetectorMain::resizeEvent(QResizeEvent* event){
|
||||
if(!dockWidgetPlot->isFloating()){
|
||||
if(tabs->currentIndex()== Actions){
|
||||
dockWidgetPlot->setMinimumHeight(heightPlotWindow-100);
|
||||
centralwidget->setMaximumHeight(QWIDGETSIZE_MAX);
|
||||
|
||||
}
|
||||
else{
|
||||
dockWidgetPlot->setMinimumHeight(height()-centralwidget->height()-50);
|
||||
centralwidget->setMaximumHeight(heightCentralWidget);
|
||||
}
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
cout<<"height:"<<height()<<endl;
|
||||
cout<<"dockWidgetPlot height:"<<dockWidgetPlot->height()<<endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
//prolly not needed
|
||||
void qDetectorMain::SetTerminalWindowSize(bool b){
|
||||
#ifdef VERBOSE
|
||||
cout<<"Resizing Terminal Window"<<endl;
|
||||
#endif
|
||||
//depends on gridlayout in qdrawterminal widget class
|
||||
/*//depends on gridlayout in qdrawterminal widget class
|
||||
if(b){
|
||||
dockWidgetTerminal->setMinimumWidth(width()/2);
|
||||
}
|
||||
@ -350,5 +382,34 @@ void qDetectorMain::SetTerminalWindowSize(bool b){
|
||||
dockWidgetTerminal->setMinimumWidth(38);
|
||||
QSizePolicy sizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
dockWidgetTerminal->setSizePolicy(sizePolicy);
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
void qDetectorMain::EnableTabs(){
|
||||
bool enable;
|
||||
enable=(tabs->isTabEnabled(DataOutput)?false:true);
|
||||
|
||||
// or use the Enable/Disable button
|
||||
/** normal tabs*/
|
||||
tabs->setTabEnabled(DataOutput,enable);
|
||||
tabs->setTabEnabled(Actions,enable);
|
||||
tabs->setTabEnabled(Settings,enable);
|
||||
|
||||
/** special tabs */
|
||||
if(enable==false){
|
||||
tabs->setTabEnabled(Debugging,enable);
|
||||
tabs->setTabEnabled(Advanced,enable);
|
||||
tabs->setTabEnabled(Developer,enable);
|
||||
}
|
||||
else{
|
||||
/** enable these tabs only if they were enabled earlier */
|
||||
if(actionDebug->isChecked())
|
||||
tabs->setTabEnabled(Debugging,enable);
|
||||
if(actionExpert->isChecked())
|
||||
tabs->setTabEnabled(Advanced,enable);
|
||||
if(isDeveloper)
|
||||
tabs->setTabEnabled(Developer,enable);
|
||||
}
|
||||
}
|
||||
|
@ -286,14 +286,14 @@ void* qDrawPlot::AcquireImages(){
|
||||
|
||||
/* if(framePeriod<acquisitionTime) usleep((int)acquisitionTime*1e6);
|
||||
else usleep((int)framePeriod*1e6);*/
|
||||
cout<<"Reading in image: "<<i<<endl;
|
||||
//cout<<"Reading in image: "<<i<<endl;
|
||||
//usleep(1000000);
|
||||
if(stop_signal) break; //stop_signal should also go to readout function
|
||||
if(!pthread_mutex_trylock(&last_image_complete_mutex)){
|
||||
|
||||
//plot_in_scope = 1;//i%2 + 1;
|
||||
//plot_in_scope = 2;
|
||||
cout<<"value:"<<image_data[6]<<endl;
|
||||
//cout<<"value:"<<image_data[6]<<endl;
|
||||
|
||||
lastImageNumber = i+1;
|
||||
char temp_title[2000];
|
||||
@ -431,11 +431,14 @@ void qDrawPlot::ClonePlot(){
|
||||
found=true;
|
||||
break;
|
||||
}
|
||||
/** no space for more clone widget references*/
|
||||
if(!found){
|
||||
cout<<"Too many clones"<<endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/** save height to keep maintain same height of plot */
|
||||
int preheight = height();
|
||||
/** create clone */
|
||||
winClone[i] = new qCloneWidget(this,i,boxPlot->title(),(int)plot_in_scope,plot1D,plot2D,myDet->getFilePath());
|
||||
if(plot_in_scope==1){
|
||||
plot1D = new SlsQt1DPlot(boxPlot);
|
||||
@ -454,11 +457,16 @@ void qDrawPlot::ClonePlot(){
|
||||
plot2D->SetZTitle(imageZAxisTitle);
|
||||
plotLayout->addWidget(plot2D,1,1,1,1);
|
||||
}
|
||||
setMinimumHeight(preheight);
|
||||
resize(width(),preheight);
|
||||
/** update the actual plot */
|
||||
UpdatePlot();
|
||||
connect(this, SIGNAL(InterpolateSignal(bool)), plot2D, SIGNAL(InterpolateSignal(bool)));
|
||||
connect(this, SIGNAL(ContourSignal(bool)), plot2D, SIGNAL(ContourSignal(bool)));
|
||||
connect(this, SIGNAL(LogzSignal(bool)), plot2D, SLOT(SetZScaleToLog(bool)));
|
||||
winClone[i]->show();
|
||||
|
||||
/** to remember which all clone widgets were closed*/
|
||||
connect(winClone[i], SIGNAL(CloneClosedSignal(int)),this, SLOT(CloneCloseEvent(int)));
|
||||
|
||||
}
|
||||
|
@ -7,9 +7,18 @@
|
||||
/** Qt Project Class Headers */
|
||||
#include "qTabActions.h"
|
||||
#include "qDefs.h"
|
||||
#include "qActionsWidget.h"
|
||||
/** Project Class Headers */
|
||||
#include "slsDetector.h"
|
||||
#include "multiSlsDetector.h"
|
||||
/** Qt Include Headers */
|
||||
|
||||
#include <QGridLayout>
|
||||
#include <QPushButton>
|
||||
#include <QLabel>
|
||||
#include <QScrollArea>
|
||||
#include <QLayoutItem>
|
||||
#include <QPalette>
|
||||
/** C++ Include Headers */
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
@ -20,7 +29,7 @@ using namespace std;
|
||||
|
||||
|
||||
qTabActions::qTabActions(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector){
|
||||
setupUi(this);
|
||||
//setupUi(this);
|
||||
if(myDet)
|
||||
{
|
||||
SetupWidgetWindow();
|
||||
@ -39,20 +48,209 @@ qTabActions::~qTabActions(){
|
||||
|
||||
|
||||
void qTabActions::SetupWidgetWindow(){
|
||||
setupUi(this);
|
||||
/** Window Settings*/
|
||||
setFixedSize(705,350);
|
||||
setContentsMargins(0,0,0,0);
|
||||
|
||||
/** Scroll Area Settings*/
|
||||
QScrollArea *scroll = new QScrollArea;
|
||||
scroll->setWidget(this);
|
||||
scroll->setWidgetResizable(true);
|
||||
|
||||
/** Layout Settings*/
|
||||
gridLayout = new QGridLayout(scroll);
|
||||
setLayout(gridLayout);
|
||||
gridLayout->setContentsMargins(10,5,0,0);
|
||||
gridLayout->setVerticalSpacing(2);
|
||||
|
||||
/** Buttongroup to know which +/- button was clicked*/
|
||||
group = new QButtonGroup(this);
|
||||
palette = new QPalette();
|
||||
|
||||
/** For each level of Actions */
|
||||
for(int i=0;i<NUM_ACTION_WIDGETS;i++){
|
||||
/** Add the extra widgets only for the 1st 2 levels*/
|
||||
if((i==1)||(i==2))
|
||||
actionWidget[i] = new ActionsWidget(this,1);
|
||||
else
|
||||
actionWidget[i] = new ActionsWidget(this,0);
|
||||
|
||||
btnExpand[i] = new QPushButton("+");
|
||||
btnExpand[i]->setFixedSize(20,20);
|
||||
lblName[i] = new QLabel("");
|
||||
group->addButton(btnExpand[i],i);
|
||||
gridLayout->addWidget(btnExpand[i],(i*2),0);
|
||||
gridLayout->addWidget(lblName[i],(i*2),1);
|
||||
gridLayout->addWidget(actionWidget[i],(i*2)+1,1,1,2);
|
||||
|
||||
}
|
||||
|
||||
/** Label Values */
|
||||
lblName[0]->setText("Action at Start");
|
||||
lblName[1]->setText("Scan Level 0");
|
||||
lblName[2]->setText("Scan Level 1");
|
||||
lblName[3]->setText("Action before each Frame");
|
||||
lblName[4]->setText("Number of Positions");
|
||||
lblName[5]->setText("Header before Frame");
|
||||
lblName[6]->setText("Header after Frame");
|
||||
lblName[7]->setText("Action after each Frame");
|
||||
lblName[8]->setText("Action at Stop");
|
||||
|
||||
/** initially hide all the widgets*/
|
||||
for(int i=0;i<NUM_ACTION_WIDGETS;i++) actionWidget[i]->hide();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void qTabActions::Initialization(){
|
||||
connect(group,SIGNAL(buttonClicked(QAbstractButton*)),this,SLOT(Expand(QAbstractButton*)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void qTabActions::Enable(bool enable){
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void qTabActions::Expand(QAbstractButton *button ){
|
||||
int index = group->id(button);
|
||||
/** Collapse */
|
||||
if(!QString::compare(button->text(), "-")){
|
||||
palette->setColor(QPalette::WindowText,Qt::black);
|
||||
lblName[index]->setPalette(*palette);
|
||||
actionWidget[index]->hide();
|
||||
button->setText("+");
|
||||
if((index==1)||(index==2))
|
||||
setFixedHeight(height()-130);
|
||||
else
|
||||
setFixedHeight(height()-30);
|
||||
}else{
|
||||
/** Expand */
|
||||
palette->setColor(QPalette::WindowText,QColor(0,0,200,255));
|
||||
lblName[index]->setPalette(*palette);
|
||||
actionWidget[index]->show();
|
||||
button->setText("-");
|
||||
if((index==1)||(index==2))
|
||||
setFixedHeight(height()+130);
|
||||
else
|
||||
setFixedHeight(height()+30);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
void qTabActions::Initialization(){
|
||||
connect(radio0Constant, SIGNAL(toggled(bool)),this,SLOT(ChangeStepSize(bool)));
|
||||
connect(radio0Specific, SIGNAL(toggled(bool)),this,SLOT(ChangeStepSize(bool)));
|
||||
connect(radio0Value, SIGNAL(toggled(bool)),this,SLOT(ChangeStepSize(bool)));
|
||||
connect(radio1Constant, SIGNAL(toggled(bool)),this,SLOT(ChangeStepSize(bool)));
|
||||
connect(radio1Specific, SIGNAL(toggled(bool)),this,SLOT(ChangeStepSize(bool)));
|
||||
connect(radio1Value, SIGNAL(toggled(bool)),this,SLOT(ChangeStepSize(bool)));
|
||||
|
||||
connect(btntry, SIGNAL(clicked()),this,SLOT(Trial()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void qTabActions::Enable(bool enable){
|
||||
//this->setEnabled(enable);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void qTabActions::ChangeStepSize(bool b){
|
||||
* defaults
|
||||
lbl0From->hide();
|
||||
lbl0Size->hide();
|
||||
lbl0To->hide();
|
||||
spin0From->hide();
|
||||
spin0Size->hide();
|
||||
spin0To->hide();
|
||||
combo0Specific->hide();
|
||||
btn0Browse->hide();
|
||||
disp0File->hide();
|
||||
lbl1From->hide();
|
||||
lbl1Size->hide();
|
||||
lbl1To->hide();
|
||||
spin1From->hide();
|
||||
spin1Size->hide();
|
||||
spin1To->hide();
|
||||
combo1Specific->hide();
|
||||
btn1Browse->hide();
|
||||
disp1File->hide();
|
||||
*Scan 0
|
||||
* constant step size
|
||||
if(radio0Constant->isChecked()){
|
||||
lbl0From->show();
|
||||
lbl0Size->show();
|
||||
lbl0To->show();
|
||||
spin0From->show();
|
||||
spin0Size->show();
|
||||
spin0To->show();
|
||||
}
|
||||
* specific values
|
||||
else if(radio0Specific->isChecked())
|
||||
combo0Specific->show();
|
||||
* values from a file
|
||||
else{
|
||||
btn0Browse->show();
|
||||
disp0File->show();
|
||||
}
|
||||
*Scan 1
|
||||
* constant step size
|
||||
if(radio1Constant->isChecked()){
|
||||
lbl1From->show();
|
||||
lbl1Size->show();
|
||||
lbl1To->show();
|
||||
spin1From->show();
|
||||
spin1Size->show();
|
||||
spin1To->show();
|
||||
}
|
||||
* specific values
|
||||
else if(radio1Specific->isChecked())
|
||||
combo1Specific->show();
|
||||
* values from a file
|
||||
else{
|
||||
btn1Browse->show();
|
||||
disp1File->show();
|
||||
}
|
||||
|
||||
|
||||
//groupBox->hide();
|
||||
}
|
||||
|
||||
|
||||
//if(!QString::compare(btntry->text(),"+")){
|
||||
*/
|
||||
|
||||
|
@ -9,8 +9,11 @@
|
||||
/** Project Class Headers */
|
||||
#include "slsDetector.h"
|
||||
#include "multiSlsDetector.h"
|
||||
/** Qt Include Headers */
|
||||
#include <QFileDialog>
|
||||
/** C++ Include Headers */
|
||||
#include<iostream>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
|
||||
@ -18,7 +21,8 @@ using namespace std;
|
||||
|
||||
|
||||
|
||||
qTabDataOutput::qTabDataOutput(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector){
|
||||
qTabDataOutput::qTabDataOutput(QWidget *parent,slsDetectorUtils*& detector):
|
||||
QWidget(parent),myDet(detector){
|
||||
setupUi(this);
|
||||
if(myDet)
|
||||
{
|
||||
@ -38,18 +42,39 @@ qTabDataOutput::~qTabDataOutput(){
|
||||
|
||||
|
||||
void qTabDataOutput::SetupWidgetWindow(){
|
||||
outputDir= QString(myDet->getFilePath().c_str());
|
||||
dispOutputDir->setText(outputDir);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void qTabDataOutput::Initialization(){
|
||||
connect(dispOutputDir, SIGNAL(textChanged(const QString&)), this, SLOT(setOutputDir(const QString&)));
|
||||
connect(btnOutputBrowse, SIGNAL(clicked()), this, SLOT(browseOutputDir()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
void qTabDataOutput::Enable(bool enable){
|
||||
//this->setEnabled(enable);
|
||||
|
||||
layoutOutput->setEnabled(enable);
|
||||
boxCorrection->setEnabled(enable);
|
||||
}
|
||||
|
||||
|
||||
void qTabDataOutput::setOutputDir(const QString& path){
|
||||
outputDir = path;
|
||||
myDet->setFilePath(string(outputDir.toAscii().constData()));
|
||||
#ifdef VERBOSE
|
||||
cout<<"Output Directory changed to :"<<myDet->getFilePath()<<endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void qTabDataOutput::browseOutputDir()
|
||||
{
|
||||
QString directory = QFileDialog::getExistingDirectory(this,tr("Choose Output Directory "),dispOutputDir->text());
|
||||
if (!directory.isEmpty())
|
||||
dispOutputDir->setText(directory);
|
||||
}
|
||||
|
||||
|
||||
|
@ -170,9 +170,8 @@ void qTabMeasurement::DeInitialization(){
|
||||
|
||||
|
||||
void qTabMeasurement::Enable(bool enable){
|
||||
gridTimeResolved->setEnabled(enable);
|
||||
gridLayout->setEnabled(enable);
|
||||
boxProgress->setEnabled(enable);
|
||||
frameTimeResolved->setEnabled(enable);
|
||||
frameNotTimeResolved->setEnabled(enable);
|
||||
/** Enable this always **/
|
||||
if(!enable) btnStartStop->setEnabled(true);
|
||||
}
|
||||
@ -217,12 +216,14 @@ void qTabMeasurement::startStopAcquisition(){
|
||||
#endif
|
||||
btnStartStop->setText("Stop");
|
||||
Enable(0);
|
||||
emit StartSignal();
|
||||
}else{
|
||||
#ifdef VERBOSE
|
||||
cout<<"Stopping Acquisition"<<endl;
|
||||
#endif
|
||||
btnStartStop->setText("Start");
|
||||
Enable(1);
|
||||
emit StopSignal();
|
||||
}
|
||||
myPlot->StartStopDaqToggle();
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ qTabPlot::qTabPlot(QWidget *parent,slsDetectorUtils*& detector, qDrawPlot*& plot
|
||||
//This also selects the text if unchecked
|
||||
//includes setupwidgetwindow
|
||||
//SelectPlot(1);
|
||||
Select1DPlot(false);
|
||||
Select1DPlot(true);
|
||||
Initialization();
|
||||
}
|
||||
}
|
||||
@ -115,10 +115,10 @@ void qTabPlot::Initialization(){
|
||||
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()));
|
||||
connect(dispTitle, SIGNAL(textChanged(const QString&)), this, SLOT(SetTitles()));
|
||||
connect(dispXAxis, SIGNAL(textChanged(const QString&)), this, SLOT(SetTitles()));
|
||||
connect(dispYAxis, SIGNAL(textChanged(const QString&)), this, SLOT(SetTitles()));
|
||||
connect(dispZAxis, SIGNAL(textChanged(const QString&)), this, SLOT(SetTitles()));
|
||||
/** Common Buttons*/
|
||||
connect(btnClear, SIGNAL(clicked()), myPlot, SLOT(Clear1DPlot()));
|
||||
/** Save */
|
||||
|
Loading…
x
Reference in New Issue
Block a user