mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-17 18:00:42 +02:00
Creating Classes, Libraries and Functions for the Common SLS Detector GUI
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@1 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
commit
9f851d6156
102
slsDetectorGui/doxy.config
Normal file
102
slsDetectorGui/doxy.config
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
|
||||||
|
# documentation are documented, even if no documentation was available.
|
||||||
|
# Private class members and static file members will be hidden unless
|
||||||
|
# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
|
||||||
|
|
||||||
|
EXTRACT_ALL = YES
|
||||||
|
|
||||||
|
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
|
||||||
|
# will be included in the documentation.
|
||||||
|
|
||||||
|
EXTRACT_PRIVATE = YES
|
||||||
|
|
||||||
|
# If the EXTRACT_STATIC tag is set to YES all static members of a file
|
||||||
|
# will be included in the documentation.
|
||||||
|
|
||||||
|
EXTRACT_STATIC = YES
|
||||||
|
|
||||||
|
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
|
||||||
|
# defined locally in source files will be included in the documentation.
|
||||||
|
# If set to NO only classes defined in header files are included.
|
||||||
|
|
||||||
|
EXTRACT_LOCAL_CLASSES = YES
|
||||||
|
|
||||||
|
# This flag is only useful for Objective-C code. When set to YES local
|
||||||
|
# methods, which are defined in the implementation section but not in
|
||||||
|
# the interface are included in the documentation.
|
||||||
|
# If set to NO (the default) only methods in the interface are included.
|
||||||
|
|
||||||
|
EXTRACT_LOCAL_METHODS = YES
|
||||||
|
|
||||||
|
# If this flag is set to YES, the members of anonymous namespaces will be
|
||||||
|
# extracted and appear in the documentation as a namespace called
|
||||||
|
# 'anonymous_namespace{file}', where file will be replaced with the base
|
||||||
|
# name of the file that contains the anonymous namespace. By default
|
||||||
|
# anonymous namespace are hidden.
|
||||||
|
|
||||||
|
EXTRACT_ANON_NSPACES = NO
|
||||||
|
|
||||||
|
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
|
||||||
|
# undocumented members of documented classes, files or namespaces.
|
||||||
|
# If set to NO (the default) these members will be included in the
|
||||||
|
# various overviews, but no documentation section is generated.
|
||||||
|
# This option has no effect if EXTRACT_ALL is enabled.
|
||||||
|
|
||||||
|
HIDE_UNDOC_MEMBERS = NO
|
||||||
|
|
||||||
|
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
|
||||||
|
# undocumented classes that are normally visible in the class hierarchy.
|
||||||
|
# If set to NO (the default) these classes will be included in the various
|
||||||
|
# overviews. This option has no effect if EXTRACT_ALL is enabled.
|
||||||
|
|
||||||
|
HIDE_UNDOC_CLASSES = NO
|
||||||
|
|
||||||
|
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
|
||||||
|
# friend (class|struct|union) declarations.
|
||||||
|
# If set to NO (the default) these declarations will be included in the
|
||||||
|
# documentation.
|
||||||
|
|
||||||
|
HIDE_FRIEND_COMPOUNDS = NO
|
||||||
|
|
||||||
|
INPUT = \
|
||||||
|
slsDetectorPlotting/include/SlsQt1DPlot.h\
|
||||||
|
slsDetectorPlotting/src/SlsQt1DPlot.cxx
|
||||||
|
slsDetectorPlotting/include/SlsQt1DZoomer.h\
|
||||||
|
slsDetectorPlotting/src/SlsQt1DZoomer.cxx\
|
||||||
|
slsDetectorPlotting/include/SlsQt2DHist.h\
|
||||||
|
slsDetectorPlotting/src/SlsQt2DHist.cxx\
|
||||||
|
slsDetectorPlotting/include/SlsQt2DPlot.h\
|
||||||
|
slsDetectorPlotting/src/SlsQt2DPlot.cxx\
|
||||||
|
slsDetectorPlotting/include/SlsQt2DPlotLayout.h\
|
||||||
|
slsDetectorPlotting/src/SlsQt2DPlotLayout.cxx\
|
||||||
|
slsDetectorPlotting/include/SlsQtNumberEntry.h\
|
||||||
|
slsDetectorPlotting/src/SlsQtNumberEntry.cxx\
|
||||||
|
slsDetectorPlotting/include/SlsQt2DZoomer.h\
|
||||||
|
slsDetectorPlotting/include/SlsQtValidators.h\
|
||||||
|
include/qDetectorMain.h\
|
||||||
|
src/qDetectorMain.cpp\
|
||||||
|
include/qDrawPlot.h\
|
||||||
|
src/qDrawPlot.cpp\
|
||||||
|
include/qCloneWidget.h\
|
||||||
|
src/qCloneWidget.cpp\
|
||||||
|
include/qTabMeasurement.h\
|
||||||
|
src/qTabMeasurement.cpp\
|
||||||
|
include/qTabDataOutput.h\
|
||||||
|
src/qTabDataOutput.cpp\
|
||||||
|
include/qTabPlot.h\
|
||||||
|
src/qTabPlot.cpp\
|
||||||
|
include/qTabActions.h\
|
||||||
|
src/qTabActions.cpp\
|
||||||
|
include/qTabAdvanced.h\
|
||||||
|
src/qTabAdvanced.cpp\
|
||||||
|
include/qTabSettings.h\
|
||||||
|
src/qTabSettings.cpp\
|
||||||
|
include/qTabDebugging.h\
|
||||||
|
src/qTabDebugging.cpp\
|
||||||
|
include/qTabDeveloper.h\
|
||||||
|
src/qTabDeveloper.cpp\
|
||||||
|
include/qDefs.h
|
||||||
|
|
||||||
|
|
||||||
|
OUTPUT_DIRECTORY = docs
|
||||||
|
|
399
slsDetectorGui/forms/form_detectormain.ui
Normal file
399
slsDetectorGui/forms/form_detectormain.ui
Normal file
@ -0,0 +1,399 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>DetectorMainObject</class>
|
||||||
|
<widget class="QMainWindow" name="DetectorMainObject">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>1000</width>
|
||||||
|
<height>956</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>SLS Detector GUI</string>
|
||||||
|
</property>
|
||||||
|
<property name="inputMethodHints">
|
||||||
|
<set>Qt::ImhNone</set>
|
||||||
|
</property>
|
||||||
|
<property name="documentMode">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="tabShape">
|
||||||
|
<enum>QTabWidget::Rounded</enum>
|
||||||
|
</property>
|
||||||
|
<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="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>470</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>1000</width>
|
||||||
|
<height>470</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="gridLayoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>953</width>
|
||||||
|
<height>470</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="layoutTabs"/>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenuBar" name="menubar">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>1000</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="defaultUp">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="nativeMenuBar">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QMenu" name="menuUtilities">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>&Utilities</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="actionOpenSetup"/>
|
||||||
|
<addaction name="actionSaveSetup"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionMeasurementWizard"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionOpenConfiguration"/>
|
||||||
|
<addaction name="actionSaveConfiguration"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionEnergyCalibration"/>
|
||||||
|
<addaction name="actionAngularCalibration"/>
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenu" name="menuModes">
|
||||||
|
<property name="title">
|
||||||
|
<string>&Modes</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="actionDebug"/>
|
||||||
|
<addaction name="actionBeamline"/>
|
||||||
|
<addaction name="actionExpert"/>
|
||||||
|
<addaction name="actionDockable"/>
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenu" name="menuHelp">
|
||||||
|
<property name="title">
|
||||||
|
<string>&Help</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="actionVersion"/>
|
||||||
|
<addaction name="actionAbout"/>
|
||||||
|
</widget>
|
||||||
|
<addaction name="menuUtilities"/>
|
||||||
|
<addaction name="menuModes"/>
|
||||||
|
<addaction name="menuHelp"/>
|
||||||
|
</widget>
|
||||||
|
<widget class="QDockWidget" name="dockWidgetTerminal">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>54</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>524287</width>
|
||||||
|
<height>470</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>11</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Undock, move and enlarge the window to use it</string>
|
||||||
|
</property>
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="features">
|
||||||
|
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetVerticalTitleBar</set>
|
||||||
|
</property>
|
||||||
|
<property name="allowedAreas">
|
||||||
|
<set>Qt::BottomDockWidgetArea|Qt::RightDockWidgetArea</set>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>SLS Detector Terminal</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="dockWidgetArea">
|
||||||
|
<number>2</number>
|
||||||
|
</attribute>
|
||||||
|
<widget class="QWidget" name="dockWidgetContentsTerminal">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
<weight>50</weight>
|
||||||
|
<bold>false</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<widget class="QDockWidget" name="dockWidgetPlot">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>58</width>
|
||||||
|
<height>455</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>524287</width>
|
||||||
|
<height>524287</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Sans Serif</family>
|
||||||
|
<pointsize>11</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="features">
|
||||||
|
<set>QDockWidget::DockWidgetMovable</set>
|
||||||
|
</property>
|
||||||
|
<property name="allowedAreas">
|
||||||
|
<set>Qt::BottomDockWidgetArea</set>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>SLS Detector Plot</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="dockWidgetArea">
|
||||||
|
<number>8</number>
|
||||||
|
</attribute>
|
||||||
|
<widget class="QWidget" name="dockWidgetContentsPlot">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>429</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
<weight>50</weight>
|
||||||
|
<bold>false</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<widget class="QFrame" name="framePlot">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>1000</width>
|
||||||
|
<height>431</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<property name="lineWidth">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<action name="actionOpenSetup">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Open Setup</string>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font/>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionSaveSetup">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Save Setup</string>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font/>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionMeasurementWizard">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Measurement Wizard</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionOpenConfiguration">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Open Configuration</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionSaveConfiguration">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Save Configuration</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionEnergyCalibration">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Energy Calibration</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionAngularCalibration">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Angular Calibration</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionDebug">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Debug</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionBeamline">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Beamline</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionExpert">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Expert</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionConfiguration">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Configuration</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionVersion">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Version</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionAbout">
|
||||||
|
<property name="text">
|
||||||
|
<string>&About</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionDockable">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Dockable Plot</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
71
slsDetectorGui/forms/form_drawplot.ui
Normal file
71
slsDetectorGui/forms/form_drawplot.ui
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>DrawPlotObject</class>
|
||||||
|
<widget class="QWidget" name="DrawPlotObject">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>1000</width>
|
||||||
|
<height>435</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QGroupBox" name="boxPlot">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>3</x>
|
||||||
|
<y>-2</y>
|
||||||
|
<width>1000</width>
|
||||||
|
<height>435</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>50</weight>
|
||||||
|
<bold>false</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Startup Image</string>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="gridLayoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>-3</x>
|
||||||
|
<y>16</y>
|
||||||
|
<width>1001</width>
|
||||||
|
<height>421</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="plotLayout">
|
||||||
|
<property name="sizeConstraint">
|
||||||
|
<enum>QLayout::SetNoConstraint</enum>
|
||||||
|
</property>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
44
slsDetectorGui/forms/form_tab_actions.ui
Normal file
44
slsDetectorGui/forms/form_tab_actions.ui
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>TabActionsObject</class>
|
||||||
|
<widget class="QWidget" name="TabActionsObject">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</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/>
|
||||||
|
</ui>
|
139
slsDetectorGui/forms/form_tab_advanced.ui
Normal file
139
slsDetectorGui/forms/form_tab_advanced.ui
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>TabAdvancedObject</class>
|
||||||
|
<widget class="QWidget" name="TabAdvancedObject">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QPushButton" name="pushButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>3</x>
|
||||||
|
<y>412</y>
|
||||||
|
<width>75</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>PushButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="btnTemp">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>626</x>
|
||||||
|
<y>8</y>
|
||||||
|
<width>91</width>
|
||||||
|
<height>41</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Gets both the temperature of ADC and FPGA</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Get
|
||||||
|
Temperature</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLineEdit" name="dispTempFpga">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>796</x>
|
||||||
|
<y>34</y>
|
||||||
|
<width>151</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Reads temperature of FPGA.
|
||||||
|
#temp_fpga#</string>
|
||||||
|
</property>
|
||||||
|
<property name="frame">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_10">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>736</x>
|
||||||
|
<y>4</y>
|
||||||
|
<width>41</width>
|
||||||
|
<height>20</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>ADC:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_11">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>736</x>
|
||||||
|
<y>34</y>
|
||||||
|
<width>41</width>
|
||||||
|
<height>20</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>FPGA:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLineEdit" name="dispTempAdc">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>796</x>
|
||||||
|
<y>4</y>
|
||||||
|
<width>151</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Reads temperature of ADC.
|
||||||
|
#temp_adc#</string>
|
||||||
|
</property>
|
||||||
|
<property name="inputMask">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="frame">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
44
slsDetectorGui/forms/form_tab_dataoutput.ui
Normal file
44
slsDetectorGui/forms/form_tab_dataoutput.ui
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>TabDataOutputObject</class>
|
||||||
|
<widget class="QWidget" name="TabDataOutputObject">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>900</width>
|
||||||
|
<height>400</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>952</width>
|
||||||
|
<height>1000</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QPushButton" name="pushButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>157</x>
|
||||||
|
<y>256</y>
|
||||||
|
<width>75</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>PushButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
44
slsDetectorGui/forms/form_tab_debugging.ui
Normal file
44
slsDetectorGui/forms/form_tab_debugging.ui
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>TabDebuggingObject</class>
|
||||||
|
<widget class="QWidget" name="TabDebuggingObject">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QPushButton" name="pushButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>232</x>
|
||||||
|
<y>141</y>
|
||||||
|
<width>75</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>PushButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
44
slsDetectorGui/forms/form_tab_developer.ui
Normal file
44
slsDetectorGui/forms/form_tab_developer.ui
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>TabDeveloperObject</class>
|
||||||
|
<widget class="QWidget" name="TabDeveloperObject">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QPushButton" name="pushButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>232</x>
|
||||||
|
<y>141</y>
|
||||||
|
<width>75</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>PushButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
346
slsDetectorGui/forms/form_tab_measurement.ui
Normal file
346
slsDetectorGui/forms/form_tab_measurement.ui
Normal file
@ -0,0 +1,346 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>TabMeasurementObject</class>
|
||||||
|
<widget class="QWidget" name="TabMeasurementObject">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>900</width>
|
||||||
|
<height>400</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>952</width>
|
||||||
|
<height>500</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="gridLayoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>9</x>
|
||||||
|
<y>30</y>
|
||||||
|
<width>420</width>
|
||||||
|
<height>355</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="1" colspan="2">
|
||||||
|
<widget class="QComboBox" name="comboSettings">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Settings of the detector.
|
||||||
|
#settings#</string>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Standard</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Fast</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>High Gain</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Dynamic Gain</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Low Gain</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Medium Gain</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Very High Gain</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Undefined</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Uninitialized</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Settings:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string>Number of measurements:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="text">
|
||||||
|
<string>Acquisition Time:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QDoubleSpinBox" name="spinExpTime">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Exposure time of each frame.
|
||||||
|
#exptime#</string>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>2000000000.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="QComboBox" name="comboExpUnit">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>hr</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>min</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>s</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>ms</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>us</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>ns</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QDoubleSpinBox" name="spinPeriod">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Frame period between exposures.
|
||||||
|
#period#</string>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>2000000000.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>2.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="2">
|
||||||
|
<widget class="QComboBox" name="comboPeriodUnit">
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>hr</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>min</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>s</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>ms</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>us</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>ns</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="label_9">
|
||||||
|
<property name="text">
|
||||||
|
<string>Frame Period:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="label_7">
|
||||||
|
<property name="text">
|
||||||
|
<string>File Name:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1" colspan="2">
|
||||||
|
<widget class="QLineEdit" name="dispFileName">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Root of the file name - please check that the output directory is correctly set and select the file name format.
|
||||||
|
#fname#</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>run</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="label_8">
|
||||||
|
<property name="text">
|
||||||
|
<string>Run Index:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1" colspan="2">
|
||||||
|
<widget class="QSpinBox" name="spinIndex">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Run index (automatically incremented)
|
||||||
|
#index#</string>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>2000000000</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0" colspan="3">
|
||||||
|
<widget class="QPushButton" name="btnStartStop">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Starts Acquisition</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Start</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1" colspan="2">
|
||||||
|
<widget class="QSpinBox" name="spinNumMeasurements">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Number of measurements (not in real time) that will be acquired.
|
||||||
|
#frames#</string>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>2000000000</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>2000</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
372
slsDetectorGui/forms/form_tab_plot.ui
Normal file
372
slsDetectorGui/forms/form_tab_plot.ui
Normal file
@ -0,0 +1,372 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>TabPlotObject</class>
|
||||||
|
<widget class="QWidget" name="TabPlotObject">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QGroupBox" name="boxPlotAxis">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>250</y>
|
||||||
|
<width>571</width>
|
||||||
|
<height>151</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Plot Axis</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="gridLayoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>551</width>
|
||||||
|
<height>121</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QCheckBox" name="chkXAxis">
|
||||||
|
<property name="text">
|
||||||
|
<string>X Axis:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLineEdit" name="dispXAxis"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="3">
|
||||||
|
<widget class="QCheckBox" name="chkXMin">
|
||||||
|
<property name="text">
|
||||||
|
<string>X min:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="4">
|
||||||
|
<widget class="QLineEdit" name="dispXMin"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="6">
|
||||||
|
<widget class="QCheckBox" name="chkXMax">
|
||||||
|
<property name="text">
|
||||||
|
<string>X max:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="7">
|
||||||
|
<widget class="QLineEdit" name="dispXMax"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QCheckBox" name="chkYAxis">
|
||||||
|
<property name="text">
|
||||||
|
<string>Y Axis:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLineEdit" name="dispYAxis"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="3">
|
||||||
|
<widget class="QCheckBox" name="chkYMin">
|
||||||
|
<property name="text">
|
||||||
|
<string>Y min:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="4">
|
||||||
|
<widget class="QLineEdit" name="dispYMin"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="6">
|
||||||
|
<widget class="QCheckBox" name="chkYMax">
|
||||||
|
<property name="text">
|
||||||
|
<string>Y max:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="7">
|
||||||
|
<widget class="QLineEdit" name="dispYMax"/>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QCheckBox" name="chkZAxis">
|
||||||
|
<property name="text">
|
||||||
|
<string>Z Axis:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QLineEdit" name="dispZAxis"/>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="3">
|
||||||
|
<widget class="QCheckBox" name="chkZMin">
|
||||||
|
<property name="text">
|
||||||
|
<string>Z min:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="4">
|
||||||
|
<widget class="QLineEdit" name="dispZMin"/>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="6">
|
||||||
|
<widget class="QCheckBox" name="chkZMax">
|
||||||
|
<property name="text">
|
||||||
|
<string>Z max:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="7">
|
||||||
|
<widget class="QLineEdit" name="dispZMax"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>60</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="5">
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>60</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QCheckBox" name="chkTitle">
|
||||||
|
<property name="text">
|
||||||
|
<string>Title:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1" colspan="7">
|
||||||
|
<widget class="QLineEdit" name="dispTitle"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<widget class="QGroupBox" name="box2D">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>170</y>
|
||||||
|
<width>571</width>
|
||||||
|
<height>61</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>2D Plot Options</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="gridLayoutWidget_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>551</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="1">
|
||||||
|
<spacer name="horizontalSpacer_4">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3">
|
||||||
|
<spacer name="horizontalSpacer_5">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QCheckBox" name="chkInterpolate">
|
||||||
|
<property name="text">
|
||||||
|
<string>Interpolate</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QCheckBox" name="chkContour">
|
||||||
|
<property name="text">
|
||||||
|
<string>Contour</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="4">
|
||||||
|
<widget class="QCheckBox" name="chkLogz">
|
||||||
|
<property name="text">
|
||||||
|
<string>Log Scale (Z)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<widget class="QGroupBox" name="box1D">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>90</y>
|
||||||
|
<width>571</width>
|
||||||
|
<height>61</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>1D Plot Options</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="gridLayoutWidget_3">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>551</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<spacer name="horizontalSpacer_8">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>430</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<widget class="QGroupBox" name="boxPlot">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>571</width>
|
||||||
|
<height>61</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Plot Options</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="gridLayoutWidget_4">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>551</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
|
<item row="0" column="1">
|
||||||
|
<spacer name="horizontalSpacer_6">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>10</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3">
|
||||||
|
<spacer name="horizontalSpacer_7">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>300</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QPushButton" name="btnClone">
|
||||||
|
<property name="text">
|
||||||
|
<string>Clone</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QPushButton" name="btnCloseClones">
|
||||||
|
<property name="text">
|
||||||
|
<string>Close All Clones</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
44
slsDetectorGui/forms/form_tab_settings.ui
Normal file
44
slsDetectorGui/forms/form_tab_settings.ui
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>TabSettingsObject</class>
|
||||||
|
<widget class="QWidget" name="TabSettingsObject">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>952</width>
|
||||||
|
<height>445</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QPushButton" name="pushButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>333</x>
|
||||||
|
<y>161</y>
|
||||||
|
<width>75</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>PushButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
58
slsDetectorGui/include/qCloneWidget.h
Normal file
58
slsDetectorGui/include/qCloneWidget.h
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* qCloneWidget.h
|
||||||
|
*
|
||||||
|
* Created on: May 18, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef QCLONEWIDGET_H_
|
||||||
|
#define QCLONEWIDGET_H_
|
||||||
|
|
||||||
|
/** Qt Project Class Headers */
|
||||||
|
class SlsQt1DPlot;
|
||||||
|
class SlsQt2DPlotLayout;
|
||||||
|
/** Qt Include Headers */
|
||||||
|
#include <QFrame>
|
||||||
|
#include <QCloseEvent>
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@short Sets up the clone plot widget
|
||||||
|
*/
|
||||||
|
class qCloneWidget:public QFrame{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** \short The constructor
|
||||||
|
*/
|
||||||
|
qCloneWidget(QWidget *parent,int id,QSize fSize,int numDim,SlsQt1DPlot*& plot1D,SlsQt2DPlotLayout*& plot2D);
|
||||||
|
|
||||||
|
/** Destructor
|
||||||
|
*/
|
||||||
|
~qCloneWidget();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
/** clone window id*/
|
||||||
|
int id;
|
||||||
|
/** clone 1D Plot */
|
||||||
|
SlsQt1DPlot* cloneplot1D;
|
||||||
|
/** clone 2D Plot */
|
||||||
|
SlsQt2DPlotLayout* cloneplot2D;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void closeEvent(QCloseEvent* event);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void CloneClosedSignal(int);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* QCLONEWIDGET_H_ */
|
54
slsDetectorGui/include/qDefs.h
Normal file
54
slsDetectorGui/include/qDefs.h
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* qDefs.h
|
||||||
|
*
|
||||||
|
* Created on: May 4, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef QDEFS_H
|
||||||
|
#define QDEFS_H
|
||||||
|
|
||||||
|
class qDefs
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/** Empty Constructor
|
||||||
|
*/
|
||||||
|
qDefs(){};
|
||||||
|
|
||||||
|
/** unit of time
|
||||||
|
*/
|
||||||
|
enum timeUnit{
|
||||||
|
HOURS, /** hr */
|
||||||
|
MINUTES, /** min */
|
||||||
|
SECONDS, /** s */
|
||||||
|
MILLISECONDS, /** ms */
|
||||||
|
MICROSECONDS, /** us */
|
||||||
|
NANOSECONDS /** ns */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/** returns the value in ns to send to server.
|
||||||
|
* @param unit unit of time
|
||||||
|
* @param value time
|
||||||
|
* returns time value in ns
|
||||||
|
*/
|
||||||
|
static int64_t get64bTime(timeUnit unit, double value){
|
||||||
|
int64_t value64=value;
|
||||||
|
switch(unit){
|
||||||
|
case HOURS: value64*=60;
|
||||||
|
case MINUTES: value64*=60;
|
||||||
|
case SECONDS: value64*=1000;
|
||||||
|
case MILLISECONDS: value64*=1000;
|
||||||
|
case MICROSECONDS: value64*=1000;
|
||||||
|
case NANOSECONDS:
|
||||||
|
default:;
|
||||||
|
}
|
||||||
|
return value64;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* QDEFS_H */
|
161
slsDetectorGui/include/qDetectorMain.h
Normal file
161
slsDetectorGui/include/qDetectorMain.h
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
/*
|
||||||
|
* qDetectorMain.h
|
||||||
|
* Main Window of the GUI
|
||||||
|
* Created on: Apr 30, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
#ifndef QDETECTORMAIN_H
|
||||||
|
#define QDETECTORMAIN_H
|
||||||
|
|
||||||
|
/** Form Header */
|
||||||
|
#include "ui_form_detectormain.h"
|
||||||
|
/** Qt Project Class Headers */
|
||||||
|
class qDrawPlot;
|
||||||
|
class qTabMeasurement;
|
||||||
|
class qTabDataOutput;
|
||||||
|
class qTabPlot;
|
||||||
|
class qTabActions;
|
||||||
|
class qTabAdvanced;
|
||||||
|
class qTabSettings;
|
||||||
|
class qTabDebugging;
|
||||||
|
class qTabDeveloper;
|
||||||
|
/** Project Class Headers */
|
||||||
|
class slsDetectorUtils;
|
||||||
|
#include "sls_detector_defs.h"
|
||||||
|
/** Qt Include Headers */
|
||||||
|
#include <QScrollArea>
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@short Main window of the GUI.
|
||||||
|
*/
|
||||||
|
class qDetectorMain:public QMainWindow, private Ui::DetectorMainObject{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** \short Main Window constructor.
|
||||||
|
* This is mainly used to create detector object and all the tabs
|
||||||
|
* @param argc number of command line arguments for server options
|
||||||
|
* @param argv server options
|
||||||
|
* @param app the qapplication
|
||||||
|
* @param parent makes the parent window 0 by default
|
||||||
|
*/
|
||||||
|
qDetectorMain(int argc, char **argv, QApplication *app, QWidget *parent = 0);
|
||||||
|
|
||||||
|
/**Destructor
|
||||||
|
*/
|
||||||
|
~qDetectorMain();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
/** The Qt Application */
|
||||||
|
QApplication *theApp;
|
||||||
|
|
||||||
|
/** The sls detector object */
|
||||||
|
slsDetectorUtils *myDet;
|
||||||
|
|
||||||
|
/** The Plot widget */
|
||||||
|
qDrawPlot *myPlot;
|
||||||
|
|
||||||
|
/**Tab Widget */
|
||||||
|
QTabWidget *tabs;
|
||||||
|
|
||||||
|
static const int NUMBER_OF_TABS = 8;
|
||||||
|
|
||||||
|
/* Scroll Area for the tabs**/
|
||||||
|
QScrollArea *scroll[NUMBER_OF_TABS];
|
||||||
|
QScrollArea *scrollMain;
|
||||||
|
/**Measurement tab */
|
||||||
|
qTabMeasurement *tab_measurement;
|
||||||
|
/**DataOutput tab */
|
||||||
|
qTabDataOutput *tab_dataoutput;
|
||||||
|
/**Plot tab */
|
||||||
|
qTabPlot *tab_plot;
|
||||||
|
/**Actions tab */
|
||||||
|
qTabActions *tab_actions;
|
||||||
|
/**Advanced tab */
|
||||||
|
qTabAdvanced *tab_advanced;
|
||||||
|
/**Settings tab */
|
||||||
|
qTabSettings *tab_Settings;
|
||||||
|
/**Debugging tab */
|
||||||
|
qTabDebugging *tab_debugging;
|
||||||
|
/**Developer tab */
|
||||||
|
qTabDeveloper *tab_developer;
|
||||||
|
|
||||||
|
/** enumeration of the tabs */
|
||||||
|
enum {Measurement, DataOutput, Plot, Actions, Advanced, Settings, Debugging, Developer };
|
||||||
|
|
||||||
|
|
||||||
|
/**Sets up the layout of the widget
|
||||||
|
*/
|
||||||
|
void SetUpWidgetWindow();
|
||||||
|
|
||||||
|
/**Sets up detector
|
||||||
|
*/
|
||||||
|
void SetUpDetector();
|
||||||
|
|
||||||
|
/**Sets up the signals and the slots
|
||||||
|
*/
|
||||||
|
void Initialization();
|
||||||
|
|
||||||
|
/** Enables the developer tab
|
||||||
|
*/
|
||||||
|
void SetDeveloperMode();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
/** Sets/unsets the debug mode i.e. enables/disables the debug tab
|
||||||
|
* @param b bool TRUE sets, FALSE unsets
|
||||||
|
*/
|
||||||
|
void SetDebugMode(bool b);
|
||||||
|
|
||||||
|
/** Sets/unsets the beamline mode (at the moment it doesn't do anything)
|
||||||
|
* @param b bool TRUE sets, FALSE unsets
|
||||||
|
*/
|
||||||
|
void SetBeamlineMode(bool b);
|
||||||
|
|
||||||
|
/** Sets/unsets the expert mode i.e. enables/disables the advanced and Settings tabs
|
||||||
|
* @param b bool TRUE sets, FALSE unsets
|
||||||
|
*/
|
||||||
|
void SetExpertMode(bool b);
|
||||||
|
|
||||||
|
/** Sets/unsets the dockable plot mode
|
||||||
|
* @param b bool TRUE sets, FALSE unsets
|
||||||
|
*/
|
||||||
|
void SetDockableMode(bool b);
|
||||||
|
|
||||||
|
/** Refreshes the tab each time the tab is changed. Also displays the next enabled tab */
|
||||||
|
void refresh(int index);
|
||||||
|
|
||||||
|
/** Opens Setup */
|
||||||
|
void OpenSetup();
|
||||||
|
|
||||||
|
/** Saves Setup */
|
||||||
|
void SaveSetup();
|
||||||
|
|
||||||
|
/** Measurement Wizard */
|
||||||
|
void MeasurementWizard();
|
||||||
|
|
||||||
|
/** Open Configuration*/
|
||||||
|
void OpenConfiguration();
|
||||||
|
|
||||||
|
/** Save Configuration */
|
||||||
|
void SaveConfiguration();
|
||||||
|
|
||||||
|
/** Executing Energy Calibration */
|
||||||
|
void EnergyCalibration();
|
||||||
|
|
||||||
|
/** Executing Angular Calibration */
|
||||||
|
void AngularCalibration();
|
||||||
|
|
||||||
|
/** Executing Version */
|
||||||
|
void Version();
|
||||||
|
|
||||||
|
/** Executing About */
|
||||||
|
void About();
|
||||||
|
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* QDETECTORMAIN_H */
|
225
slsDetectorGui/include/qDrawPlot.h
Normal file
225
slsDetectorGui/include/qDrawPlot.h
Normal file
@ -0,0 +1,225 @@
|
|||||||
|
/*
|
||||||
|
* qDrawPlot.h
|
||||||
|
*
|
||||||
|
* Created on: May 7, 2012
|
||||||
|
* Author: Ian Johnson
|
||||||
|
*/
|
||||||
|
#ifndef QDRAWPLOT_H
|
||||||
|
#define QDRAWPLOT_H
|
||||||
|
|
||||||
|
/** Form Header */
|
||||||
|
#include "ui_form_drawplot.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
class slsDetectorUtils;
|
||||||
|
/** Qt Project Class Headers */
|
||||||
|
class SlsQtH1D;
|
||||||
|
class SlsQt1DPlot;
|
||||||
|
class SlsQt2DPlotLayout;
|
||||||
|
class qCloneWidget;
|
||||||
|
/** Qt Include Headers */
|
||||||
|
class QTimer;
|
||||||
|
class QGridLayout;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@short Sets up the plot widget
|
||||||
|
*/
|
||||||
|
class qDrawPlot:public QWidget, private Ui::DrawPlotObject{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** \short The constructor
|
||||||
|
*/
|
||||||
|
qDrawPlot(QWidget *parent,slsDetectorUtils*& detector);
|
||||||
|
|
||||||
|
/** Destructor
|
||||||
|
*/
|
||||||
|
~qDrawPlot();
|
||||||
|
|
||||||
|
/** Starts or stop acquisition
|
||||||
|
* Calls startDaq() function
|
||||||
|
* @param stop_if_running is 0 to stop acquisition and 1 to start acquisition
|
||||||
|
*/
|
||||||
|
void StartStopDaqToggle(bool stop_if_running=0);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
/** To select 1D or 2D plot
|
||||||
|
* @param i is 1 for 1D, else 2D plot
|
||||||
|
*/
|
||||||
|
void SelectPlot(int i=2);
|
||||||
|
|
||||||
|
/** To select 1D plot
|
||||||
|
*/
|
||||||
|
void Select1DPlot() {SelectPlot(1);}
|
||||||
|
|
||||||
|
/** To select 2D plot
|
||||||
|
*/
|
||||||
|
void Select2DPlot() {SelectPlot(2);}
|
||||||
|
|
||||||
|
/** To clear plot
|
||||||
|
*/
|
||||||
|
void Clear1DPlot();
|
||||||
|
|
||||||
|
/** Creates a clone of the plot
|
||||||
|
* */
|
||||||
|
void ClonePlot();
|
||||||
|
|
||||||
|
/** Closes all the clone plots
|
||||||
|
* */
|
||||||
|
void CloseClones();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
/** The sls detector object */
|
||||||
|
slsDetectorUtils *myDet;
|
||||||
|
/** Number of Exposures */
|
||||||
|
int number_of_exposures;
|
||||||
|
/** Duration between Exposures */
|
||||||
|
double framePeriod;
|
||||||
|
/** Acquisition Time */
|
||||||
|
double acquisitionTime;
|
||||||
|
|
||||||
|
/** Widgets needed to plot the clone */
|
||||||
|
static const int MAXCloneWindows = 50;
|
||||||
|
/** */
|
||||||
|
qCloneWidget *winClone[MAXCloneWindows];
|
||||||
|
/** */
|
||||||
|
QTimer* plot_update_timer;
|
||||||
|
/** */
|
||||||
|
SlsQt1DPlot* plot1D;
|
||||||
|
/** */
|
||||||
|
SlsQt2DPlotLayout* plot2D;
|
||||||
|
/** */
|
||||||
|
QVector<SlsQtH1D*> plot1D_hists;
|
||||||
|
|
||||||
|
|
||||||
|
/**variables for threads */
|
||||||
|
/** */
|
||||||
|
volatile bool stop_signal;
|
||||||
|
/** */
|
||||||
|
pthread_mutex_t last_image_complete_mutex;
|
||||||
|
|
||||||
|
/**variables for histograms */
|
||||||
|
/** */
|
||||||
|
unsigned int plot_in_scope;
|
||||||
|
/** */
|
||||||
|
unsigned int lastImageNumber;
|
||||||
|
/** */
|
||||||
|
std::string imageTitle;
|
||||||
|
/** */
|
||||||
|
std::string imageXAxisTitle;
|
||||||
|
/** */
|
||||||
|
std::string imageYAxisTitle;
|
||||||
|
/** */
|
||||||
|
std::string imageZAxisTitle;
|
||||||
|
/** */
|
||||||
|
unsigned int nPixelsX;
|
||||||
|
/** */
|
||||||
|
unsigned int nPixelsY;
|
||||||
|
/** */
|
||||||
|
double* lastImageArray;
|
||||||
|
/** */
|
||||||
|
unsigned int nHists;
|
||||||
|
/** */
|
||||||
|
std::string histTitle[10];
|
||||||
|
/** */
|
||||||
|
std::string histXAxisTitle;
|
||||||
|
/** */
|
||||||
|
std::string histYAxisTitle;
|
||||||
|
/** */
|
||||||
|
int histNBins;
|
||||||
|
/** */
|
||||||
|
double* histXAxis;
|
||||||
|
/** */
|
||||||
|
double* histYAxis[10];
|
||||||
|
|
||||||
|
|
||||||
|
/** */
|
||||||
|
int LockLastImageArray() {return pthread_mutex_lock(&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 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* 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* 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
|
||||||
|
|
||||||
|
/** Initializes all its members and the thread */
|
||||||
|
void Initialization();
|
||||||
|
|
||||||
|
/** Sets up the widget */
|
||||||
|
void SetupWidgetWindow();
|
||||||
|
|
||||||
|
/** */
|
||||||
|
int ResetDaqForGui();
|
||||||
|
|
||||||
|
/**acquisition thread stuff */
|
||||||
|
/** */
|
||||||
|
bool StartOrStopThread(bool start);
|
||||||
|
/** */
|
||||||
|
static void* DataAcquisionThread(void *this_pointer);
|
||||||
|
/** */
|
||||||
|
void* AcquireImages();
|
||||||
|
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
/** To update plot
|
||||||
|
*/
|
||||||
|
void UpdatePlot();
|
||||||
|
|
||||||
|
/** To stop updating plot
|
||||||
|
*/
|
||||||
|
void StopUpdatePlot();
|
||||||
|
|
||||||
|
/** To start or stop acquisition
|
||||||
|
* @param start is 1 to start and 0 to stop acquisition
|
||||||
|
*/
|
||||||
|
void StartDaq(bool start);
|
||||||
|
|
||||||
|
void CloneCloseEvent(int id);
|
||||||
|
signals:
|
||||||
|
|
||||||
|
void UpdatingPlotFinished();
|
||||||
|
void InterpolateSignal(bool);
|
||||||
|
void ContourSignal(bool);
|
||||||
|
void LogzSignal(bool);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* QDRAWPLOT_H */
|
52
slsDetectorGui/include/qTabActions.h
Normal file
52
slsDetectorGui/include/qTabActions.h
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* qTabActions.h
|
||||||
|
*
|
||||||
|
* Created on: May 10, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef QTABACTIONS_H_
|
||||||
|
#define QTABACTIONS_H_
|
||||||
|
|
||||||
|
/** Form Header */
|
||||||
|
#include "ui_form_tab_actions.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
class slsDetectorUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@short sets up the acions parameters
|
||||||
|
*/
|
||||||
|
class qTabActions:public QWidget, private Ui::TabActionsObject{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** \short The constructor
|
||||||
|
* @param parent is the parent tab widget
|
||||||
|
* @param detector is the detector returned from the detector tab
|
||||||
|
*/
|
||||||
|
qTabActions(QWidget *parent,slsDetectorUtils*& detector);
|
||||||
|
|
||||||
|
/** Destructor
|
||||||
|
*/
|
||||||
|
~qTabActions();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
/** The sls detector object */
|
||||||
|
slsDetectorUtils *myDet;
|
||||||
|
|
||||||
|
/** Sets up the widget
|
||||||
|
*/
|
||||||
|
void SetupWidgetWindow();
|
||||||
|
|
||||||
|
/** Sets up all the slots and signals
|
||||||
|
*/
|
||||||
|
void Initialization();
|
||||||
|
|
||||||
|
/** Enables/Disables all the widgets
|
||||||
|
*/
|
||||||
|
void Enable(bool enable);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* QTABACTIONS_H_ */
|
62
slsDetectorGui/include/qTabAdvanced.h
Normal file
62
slsDetectorGui/include/qTabAdvanced.h
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* qTabAdvanced.h
|
||||||
|
*
|
||||||
|
* Created on: May 10, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef QTABADVANCED_H_
|
||||||
|
#define QTABADVANCED_H_
|
||||||
|
|
||||||
|
/** Form Header */
|
||||||
|
#include "ui_form_tab_advanced.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
class slsDetectorUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@short sets up the advanced parameters
|
||||||
|
*/
|
||||||
|
class qTabAdvanced:public QWidget, private Ui::TabAdvancedObject{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** \short The constructor
|
||||||
|
* @param parent is the parent tab widget
|
||||||
|
* @param detector is the detector returned from the detector tab
|
||||||
|
*/
|
||||||
|
qTabAdvanced(QWidget *parent,slsDetectorUtils*& detector);
|
||||||
|
|
||||||
|
/** Destructor
|
||||||
|
*/
|
||||||
|
~qTabAdvanced();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
/** The sls detector object */
|
||||||
|
slsDetectorUtils *myDet;
|
||||||
|
|
||||||
|
/** The sls detector object type*/
|
||||||
|
int myDetType;
|
||||||
|
|
||||||
|
/** Sets up the widget
|
||||||
|
*/
|
||||||
|
void SetupWidgetWindow();
|
||||||
|
|
||||||
|
/** Sets up all the slots and signals
|
||||||
|
*/
|
||||||
|
void Initialization();
|
||||||
|
|
||||||
|
/** Enables/Disables all the widgets
|
||||||
|
*/
|
||||||
|
void Enable(bool enable);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
/** Get Temperature data
|
||||||
|
*/
|
||||||
|
void getTemperature();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* QTABADVANCED_H_ */
|
54
slsDetectorGui/include/qTabDataOutput.h
Normal file
54
slsDetectorGui/include/qTabDataOutput.h
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* qTabDataOutput.h
|
||||||
|
*
|
||||||
|
* Created on: May 10, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef QTABDATAOUTPUT_H_
|
||||||
|
#define QTABDATAOUTPUT_H_
|
||||||
|
|
||||||
|
/** Form Header */
|
||||||
|
#include "ui_form_tab_dataoutput.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
class slsDetectorUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@short sets up the DataOutput parameters
|
||||||
|
*/
|
||||||
|
class qTabDataOutput:public QWidget, private Ui::TabDataOutputObject{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** \short The constructor
|
||||||
|
* @param parent is the parent tab widget
|
||||||
|
* @param detector is the detector returned from the detector tab
|
||||||
|
*/
|
||||||
|
qTabDataOutput(QWidget *parent,slsDetectorUtils*& detector);
|
||||||
|
|
||||||
|
/** Destructor
|
||||||
|
*/
|
||||||
|
~qTabDataOutput();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
/** The sls detector object */
|
||||||
|
slsDetectorUtils *myDet;
|
||||||
|
|
||||||
|
/** Sets up the widget
|
||||||
|
*/
|
||||||
|
void SetupWidgetWindow();
|
||||||
|
|
||||||
|
/** Sets up all the slots and signals
|
||||||
|
*/
|
||||||
|
void Initialization();
|
||||||
|
|
||||||
|
/** Enables/Disables all the widgets
|
||||||
|
*/
|
||||||
|
void Enable(bool enable);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* QTABDATAOUTPUT_H_ */
|
54
slsDetectorGui/include/qTabDebugging.h
Normal file
54
slsDetectorGui/include/qTabDebugging.h
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* qTabDebugging.h
|
||||||
|
*
|
||||||
|
* Created on: May 10, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef QTABDEBUGGING_H_
|
||||||
|
#define QTABDEBUGGING_H_
|
||||||
|
|
||||||
|
/** Form Header */
|
||||||
|
#include "ui_form_tab_debugging.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
class slsDetectorUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@short sets up the Debugging parameters
|
||||||
|
*/
|
||||||
|
class qTabDebugging:public QWidget, private Ui::TabDebuggingObject{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** \short The constructor
|
||||||
|
* @param parent is the parent tab widget
|
||||||
|
* @param detector is the detector returned from the detector tab
|
||||||
|
*/
|
||||||
|
qTabDebugging(QWidget *parent,slsDetectorUtils*& detector);
|
||||||
|
|
||||||
|
/** Destructor
|
||||||
|
*/
|
||||||
|
~qTabDebugging();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
/** The sls detector object */
|
||||||
|
slsDetectorUtils *myDet;
|
||||||
|
|
||||||
|
/** Sets up the widget
|
||||||
|
*/
|
||||||
|
void SetupWidgetWindow();
|
||||||
|
|
||||||
|
/** Sets up all the slots and signals
|
||||||
|
*/
|
||||||
|
void Initialization();
|
||||||
|
|
||||||
|
/** Enables/Disables all the widgets
|
||||||
|
*/
|
||||||
|
void Enable(bool enable);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* QTABDEBUGGING_H_ */
|
54
slsDetectorGui/include/qTabDeveloper.h
Normal file
54
slsDetectorGui/include/qTabDeveloper.h
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* qTabDeveloper.h
|
||||||
|
*
|
||||||
|
* Created on: May 10, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef QTABDEVELOPER_H_
|
||||||
|
#define QTABDEVELOPER_H_
|
||||||
|
|
||||||
|
/** Form Header */
|
||||||
|
#include "ui_form_tab_developer.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
class slsDetectorUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@short sets up the Developer parameters
|
||||||
|
*/
|
||||||
|
class qTabDeveloper:public QWidget, private Ui::TabDeveloperObject{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** \short The constructor
|
||||||
|
* @param parent is the parent tab widget
|
||||||
|
* @param detector is the detector returned from the detector tab
|
||||||
|
*/
|
||||||
|
qTabDeveloper(QWidget *parent,slsDetectorUtils*& detector);
|
||||||
|
|
||||||
|
/** Destructor
|
||||||
|
*/
|
||||||
|
~qTabDeveloper();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
/** The sls detector object */
|
||||||
|
slsDetectorUtils *myDet;
|
||||||
|
|
||||||
|
/** Sets up the widget
|
||||||
|
*/
|
||||||
|
void SetupWidgetWindow();
|
||||||
|
|
||||||
|
/** Sets up all the slots and signals
|
||||||
|
*/
|
||||||
|
void Initialization();
|
||||||
|
|
||||||
|
/** Enables/Disables all the widgets
|
||||||
|
*/
|
||||||
|
void Enable(bool enable);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* QTABDEVELOPER_H_ */
|
108
slsDetectorGui/include/qTabMeasurement.h
Normal file
108
slsDetectorGui/include/qTabMeasurement.h
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
/*
|
||||||
|
* qTabMeasurement.h
|
||||||
|
*
|
||||||
|
* Created on: May 2, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
#ifndef QTABMEASUREMENT
|
||||||
|
#define QTABMEASUREMENT
|
||||||
|
|
||||||
|
/** Form Header */
|
||||||
|
#include "ui_form_tab_measurement.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
class slsDetectorUtils;
|
||||||
|
/** Qt Project Class Headers */
|
||||||
|
class qDrawPlot;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@short sets up the measurement parameters
|
||||||
|
*/
|
||||||
|
class qTabMeasurement:public QWidget, private Ui::TabMeasurementObject{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** \short The constructor
|
||||||
|
* This tab allows to change the detector settings, the threshold, the number of (non real time) measurements,
|
||||||
|
* the acquisition time, the file name, the start run index and shows the current progress of the measurement
|
||||||
|
* via a progress bar and labels inidicating the current position, scan variable, frame number etc.
|
||||||
|
* Contains the start and stop acquisition button
|
||||||
|
* @param parent is the parent tab widget
|
||||||
|
* @param detector is the detector returned from the detector tab
|
||||||
|
* @param plot plot object reference
|
||||||
|
*/
|
||||||
|
qTabMeasurement(QWidget *parent,slsDetectorUtils*& detector, qDrawPlot*& plot);
|
||||||
|
|
||||||
|
/** Destructor
|
||||||
|
*/
|
||||||
|
~qTabMeasurement();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
/** The sls detector object */
|
||||||
|
slsDetectorUtils *myDet;
|
||||||
|
|
||||||
|
/** The Plot widget */
|
||||||
|
qDrawPlot *myPlot;
|
||||||
|
|
||||||
|
|
||||||
|
/** methods */
|
||||||
|
/** Sets up the widget
|
||||||
|
*/
|
||||||
|
void SetupWidgetWindow();
|
||||||
|
|
||||||
|
/** Sets up all the slots and signals
|
||||||
|
*/
|
||||||
|
void Initialization();
|
||||||
|
|
||||||
|
/** Enables/Disables all the widgets
|
||||||
|
*/
|
||||||
|
void Enable(bool enable);
|
||||||
|
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
/** update plot is finished,
|
||||||
|
* changes start/stop text and enables/disables all widgets
|
||||||
|
*/
|
||||||
|
void UpdateFinished();
|
||||||
|
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
/** Set settings according to selection
|
||||||
|
* @param index index of selection
|
||||||
|
*/
|
||||||
|
void setSettings(int index);
|
||||||
|
/** Set number of frames
|
||||||
|
* @param val number of frames to be set
|
||||||
|
*/
|
||||||
|
void setNumFrames(int val);
|
||||||
|
|
||||||
|
/** Set acquisition time
|
||||||
|
*/
|
||||||
|
void setAcquisitionTime();
|
||||||
|
|
||||||
|
/** Set frame period between exposures
|
||||||
|
*/
|
||||||
|
void setFramePeriod();
|
||||||
|
|
||||||
|
/** Set file name
|
||||||
|
* @param fName name of file
|
||||||
|
*/
|
||||||
|
void setFileName(const QString& fName);
|
||||||
|
|
||||||
|
/** Set index of file name
|
||||||
|
* @param index index of selection
|
||||||
|
*/
|
||||||
|
void setRunIndex(int index);
|
||||||
|
|
||||||
|
/** starts/stops Acquisition
|
||||||
|
*/
|
||||||
|
void startStopAcquisition();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* QTABMEASUREMENT */
|
74
slsDetectorGui/include/qTabPlot.h
Normal file
74
slsDetectorGui/include/qTabPlot.h
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
* qTabPlot.h
|
||||||
|
*
|
||||||
|
* Created on: May 10, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef QTABPLOT_H_
|
||||||
|
#define QTABPLOT_H_
|
||||||
|
|
||||||
|
/** Form Header */
|
||||||
|
#include "ui_form_tab_plot.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
class slsDetectorUtils;
|
||||||
|
/** Qt Project Class Headers */
|
||||||
|
class qDrawPlot;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@short sets up the Plot parameters
|
||||||
|
*/
|
||||||
|
class qTabPlot:public QWidget, private Ui::TabPlotObject{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** \short The constructor
|
||||||
|
* @param parent is the parent tab widget
|
||||||
|
* @param detector is the detector returned from the detector tab
|
||||||
|
* @param plot plot object reference
|
||||||
|
*/
|
||||||
|
qTabPlot(QWidget *parent,slsDetectorUtils*& detector, qDrawPlot*& plot);
|
||||||
|
|
||||||
|
/** Destructor
|
||||||
|
*/
|
||||||
|
~qTabPlot();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
/** The sls detector object */
|
||||||
|
slsDetectorUtils *myDet;
|
||||||
|
|
||||||
|
/** The Plot widget */
|
||||||
|
qDrawPlot *myPlot;
|
||||||
|
|
||||||
|
|
||||||
|
/** methods */
|
||||||
|
/** Sets up the widget
|
||||||
|
*/
|
||||||
|
void SetupWidgetWindow();
|
||||||
|
|
||||||
|
/** Sets up all the slots and signals
|
||||||
|
*/
|
||||||
|
void Initialization();
|
||||||
|
|
||||||
|
/** Enables/Disables all the widgets
|
||||||
|
*/
|
||||||
|
void Enable(bool enable);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
signals:
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* QTABPLOT_H_ */
|
54
slsDetectorGui/include/qTabSettings.h
Normal file
54
slsDetectorGui/include/qTabSettings.h
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* qTabSettings.h
|
||||||
|
*
|
||||||
|
* Created on: May 10, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef QTABSETTINGS_H_
|
||||||
|
#define QTABSETTINGS_H_
|
||||||
|
|
||||||
|
/** Form Header */
|
||||||
|
#include "ui_form_tab_settings.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
class slsDetectorUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@short sets up the Settings parameters
|
||||||
|
*/
|
||||||
|
class qTabSettings:public QWidget, private Ui::TabSettingsObject{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** \short The constructor
|
||||||
|
* @param parent is the parent tab widget
|
||||||
|
* @param detector is the detector returned from the detector tab
|
||||||
|
*/
|
||||||
|
qTabSettings(QWidget *parent,slsDetectorUtils*& detector);
|
||||||
|
|
||||||
|
/** Destructor
|
||||||
|
*/
|
||||||
|
~qTabSettings();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
/** The sls detector object */
|
||||||
|
slsDetectorUtils *myDet;
|
||||||
|
|
||||||
|
/** Sets up the widget
|
||||||
|
*/
|
||||||
|
void SetupWidgetWindow();
|
||||||
|
|
||||||
|
/** Sets up all the slots and signals
|
||||||
|
*/
|
||||||
|
void Initialization();
|
||||||
|
|
||||||
|
/** Enables/Disables all the widgets
|
||||||
|
*/
|
||||||
|
void Enable(bool enable);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* QTABSETTINGS_H_ */
|
92
slsDetectorGui/slsDetectorGui.pro
Normal file
92
slsDetectorGui/slsDetectorGui.pro
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
DESTDIR = bin
|
||||||
|
MOC_DIR = mocs
|
||||||
|
OBJECTS_DIR = objs
|
||||||
|
UI_HEADERS_DIR = forms/include
|
||||||
|
|
||||||
|
DEFINES += VERBOSE
|
||||||
|
|
||||||
|
target.path += $(DESTDIR)
|
||||||
|
documentation.path = /$(DOCPATH)
|
||||||
|
documentation.files = docs/*
|
||||||
|
INSTALLS += target
|
||||||
|
INSTALLS += documentation
|
||||||
|
QMAKE_CLEAN += docs/*/* \
|
||||||
|
$(DESTDIR)* \
|
||||||
|
forms/include/*
|
||||||
|
|
||||||
|
|
||||||
|
LIBS += -Wl,-Bstatic -L../slsDetectorSoftware -lSlsDetector -Wl,-Bdynamic\
|
||||||
|
-L/usr/local/qwt-5.2.3-svn/lib -lqwt
|
||||||
|
|
||||||
|
DEPENDPATH += \
|
||||||
|
slsDetectorPlotting/include\
|
||||||
|
include\
|
||||||
|
forms/include
|
||||||
|
|
||||||
|
|
||||||
|
INCLUDEPATH += \
|
||||||
|
/usr/local/qwt-5.2.3-svn/include\
|
||||||
|
slsDetectorPlotting/include\
|
||||||
|
include\
|
||||||
|
forms/include\
|
||||||
|
../slsDetectorSoftware/commonFiles\
|
||||||
|
../slsDetectorSoftware/MySocketTCP\
|
||||||
|
../slsDetectorSoftware/slsDetector\
|
||||||
|
../slsDetectorSoftware/slsDetectorAnalysis\
|
||||||
|
../slsDetectorSoftware/multiSlsDetector\
|
||||||
|
../slsDetectorSoftware/usersFunctions
|
||||||
|
|
||||||
|
SOURCES = \
|
||||||
|
slsDetectorPlotting/src/SlsQt1DPlot.cxx\
|
||||||
|
slsDetectorPlotting/src/SlsQt1DZoomer.cxx\
|
||||||
|
slsDetectorPlotting/src/SlsQt2DHist.cxx\
|
||||||
|
slsDetectorPlotting/src/SlsQt2DPlot.cxx\
|
||||||
|
slsDetectorPlotting/src/SlsQt2DPlotLayout.cxx\
|
||||||
|
slsDetectorPlotting/src/SlsQtNumberEntry.cxx\
|
||||||
|
src/qDetectorMain.cpp\
|
||||||
|
src/qDrawPlot.cpp\
|
||||||
|
src/qCloneWidget.cpp\
|
||||||
|
src/qTabMeasurement.cpp\
|
||||||
|
src/qTabDataOutput.cpp\
|
||||||
|
src/qTabPlot.cpp\
|
||||||
|
src/qTabActions.cpp\
|
||||||
|
src/qTabAdvanced.cpp\
|
||||||
|
src/qTabSettings.cpp\
|
||||||
|
src/qTabDebugging.cpp\
|
||||||
|
src/qTabDeveloper.cpp
|
||||||
|
|
||||||
|
HEADERS = \
|
||||||
|
slsDetectorPlotting/include/SlsQt1DPlot.h\
|
||||||
|
slsDetectorPlotting/include/SlsQt1DZoomer.h\
|
||||||
|
slsDetectorPlotting/include/SlsQt2DHist.h\
|
||||||
|
slsDetectorPlotting/include/SlsQt2DPlot.h\
|
||||||
|
slsDetectorPlotting/include/SlsQt2DPlotLayout.h\
|
||||||
|
slsDetectorPlotting/include/SlsQt2DZoomer.h\
|
||||||
|
slsDetectorPlotting/include/SlsQtValidators.h\
|
||||||
|
slsDetectorPlotting/include/SlsQtNumberEntry.h\
|
||||||
|
include/qDefs.h\
|
||||||
|
include/qDetectorMain.h\
|
||||||
|
include/qDrawPlot.h\
|
||||||
|
include/qCloneWidget.h\
|
||||||
|
include/qTabMeasurement.h\
|
||||||
|
include/qTabDataOutput.h\
|
||||||
|
include/qTabPlot.h\
|
||||||
|
include/qTabActions.h\
|
||||||
|
include/qTabAdvanced.h\
|
||||||
|
include/qTabSettings.h\
|
||||||
|
include/qTabDebugging.h\
|
||||||
|
include/qTabDeveloper.h\
|
||||||
|
../slsDetectorSoftware/commonFiles/sls_detector_defs.h
|
||||||
|
|
||||||
|
|
||||||
|
FORMS = \
|
||||||
|
forms/form_detectormain.ui\
|
||||||
|
forms/form_drawplot.ui\
|
||||||
|
forms/form_tab_measurement.ui\
|
||||||
|
forms/form_tab_dataoutput.ui\
|
||||||
|
forms/form_tab_plot.ui\
|
||||||
|
forms/form_tab_actions.ui\
|
||||||
|
forms/form_tab_advanced.ui\
|
||||||
|
forms/form_tab_settings.ui\
|
||||||
|
forms/form_tab_debugging.ui\
|
||||||
|
forms/form_tab_developer.ui
|
145
slsDetectorGui/slsDetectorPlotting/include/SlsQt1DPlot.h
Normal file
145
slsDetectorGui/slsDetectorPlotting/include/SlsQt1DPlot.h
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ian Johnson
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SLSQT1DPLOT_H
|
||||||
|
#define SLSQT1DPLOT_H
|
||||||
|
|
||||||
|
#include <qwt_plot.h>
|
||||||
|
#include <qwt_plot_curve.h>
|
||||||
|
#include <qwt_plot_marker.h>
|
||||||
|
|
||||||
|
#include "SlsQt1DZoomer.h"
|
||||||
|
|
||||||
|
class QPen;
|
||||||
|
class SlsQt1DPlot;
|
||||||
|
|
||||||
|
class SlsQtH1D:public QwtPlotCurve{
|
||||||
|
|
||||||
|
public:
|
||||||
|
SlsQtH1D(QString title, int n, double xmin, double xmax, double* data=0);
|
||||||
|
SlsQtH1D(QString title, int n, double* data_x, double* data_y);
|
||||||
|
~SlsQtH1D();
|
||||||
|
|
||||||
|
void Attach(SlsQt1DPlot* p);
|
||||||
|
void Detach(SlsQt1DPlot* p);
|
||||||
|
|
||||||
|
int SetLineColor(int c=-1);
|
||||||
|
int SetLineWidth(int w=1);
|
||||||
|
void SetLineStyle(int s=0);
|
||||||
|
|
||||||
|
void SetData(int n, double xmin, double xmax, double* d=0);
|
||||||
|
void SetData(int n, double* dx, double* dy);
|
||||||
|
|
||||||
|
double* GetX() {return x;}
|
||||||
|
double* GetY() {return y;}
|
||||||
|
int GetNBinsX() {return ndata;}
|
||||||
|
|
||||||
|
double FillBin(int bx, double v=1);
|
||||||
|
double Fill(double x, double v=1);
|
||||||
|
double SetBinContent(int bx,double v);
|
||||||
|
double SetContent(double x,double v);
|
||||||
|
int FindBinIndex(double px);
|
||||||
|
|
||||||
|
double GetXMin() {return x[0];}
|
||||||
|
double GetFirstXgtZero() {return firstXgt0;}
|
||||||
|
double GetXMax() {return x[ndata-1];}
|
||||||
|
double GetYMin() {return ymin;}
|
||||||
|
double GetFirstYgtZero() {return firstYgt0;}
|
||||||
|
double GetYMax() {return ymax;}
|
||||||
|
|
||||||
|
SlsQtH1D* Add(double v);
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
int ndata;
|
||||||
|
int n_array;
|
||||||
|
double dx;
|
||||||
|
double *x,*y;
|
||||||
|
double ymin,ymax;
|
||||||
|
double firstXgt0,firstYgt0;
|
||||||
|
|
||||||
|
void Initailize();
|
||||||
|
int SetUpArrays(int n);
|
||||||
|
int CheckIndex(int bx);
|
||||||
|
|
||||||
|
QPen* pen_ptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class SlsQtH1DList{
|
||||||
|
public:
|
||||||
|
SlsQtH1DList(SlsQtH1D* hist=0);
|
||||||
|
~SlsQtH1DList();
|
||||||
|
|
||||||
|
SlsQtH1D* Add(SlsQtH1D* h);
|
||||||
|
void Remove(SlsQtH1D* h);
|
||||||
|
void Print();
|
||||||
|
|
||||||
|
SlsQtH1D* Hist() {return the_hist;} //if no hist returns 0
|
||||||
|
SlsQtH1DList* Next() {return the_next;}
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
SlsQtH1DList* the_next;
|
||||||
|
SlsQtH1D* the_hist;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class SlsQt1DPlot:public QwtPlot{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
SlsQt1DPlot(QWidget* = NULL);
|
||||||
|
~SlsQt1DPlot();
|
||||||
|
|
||||||
|
void SetTitle(const char *t);
|
||||||
|
void SetXTitle(const char* title);
|
||||||
|
void SetYTitle(const char* title);
|
||||||
|
|
||||||
|
void InsertHLine(double y);
|
||||||
|
void RemoveHLine();
|
||||||
|
void InsertVLine(double v);
|
||||||
|
void RemoveVLine();
|
||||||
|
|
||||||
|
void SetZoom(double xmin,double ymin,double x_width,double y_width);
|
||||||
|
void SetZoomBase(double xmin,double ymin,double x_width, double y_width){ zoomer->SetZoomBase(xmin,ymin,x_width,y_width);}
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
SlsQtH1DList* hist_list;
|
||||||
|
SlsQt1DZoomer* zoomer;
|
||||||
|
QwtPlotPanner* panner;
|
||||||
|
|
||||||
|
QwtPlotMarker *hline;
|
||||||
|
QwtPlotMarker *vline;
|
||||||
|
|
||||||
|
void SetupZoom();
|
||||||
|
void UnknownStuff();
|
||||||
|
void alignScales();
|
||||||
|
|
||||||
|
void CalculateNResetZoomBase();
|
||||||
|
void NewHistogramAttached(SlsQtH1D* h);
|
||||||
|
void HistogramDetached(SlsQtH1D* h);
|
||||||
|
|
||||||
|
void SetLog(int axisId, bool yes);
|
||||||
|
|
||||||
|
friend void SlsQtH1D::Attach(SlsQt1DPlot* p);
|
||||||
|
friend void SlsQtH1D::Detach(SlsQt1DPlot* p);
|
||||||
|
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void UnZoom();
|
||||||
|
void Update();
|
||||||
|
|
||||||
|
void SetLogX(bool yes=1);
|
||||||
|
void SetLogY(bool yes=1);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
59
slsDetectorGui/slsDetectorPlotting/include/SlsQt1DZoomer.h
Normal file
59
slsDetectorGui/slsDetectorPlotting/include/SlsQt1DZoomer.h
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ian Johnson
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SLSQT1DZOOMER_H
|
||||||
|
#define SLSQT1DZOOMER_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <qwt_plot_zoomer.h>
|
||||||
|
#include <qwt_plot_panner.h>
|
||||||
|
class SlsQtH1D;
|
||||||
|
|
||||||
|
class SlsQt1DZoomer:public QwtPlotZoomer{
|
||||||
|
private:
|
||||||
|
double x0,x1,y0,y1;
|
||||||
|
double firstXgt0,firstYgt0;
|
||||||
|
bool xIsLog,yIsLog;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SlsQt1DZoomer(QwtPlotCanvas *canvas):QwtPlotZoomer(canvas){
|
||||||
|
setTrackerMode(AlwaysOn);
|
||||||
|
xIsLog=yIsLog=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
double x() {return x0;}
|
||||||
|
double x_firstGreaterThan0() {return firstXgt0;}
|
||||||
|
double w() {return x1-x0;}
|
||||||
|
|
||||||
|
double y() {return y0;}
|
||||||
|
double y_firstGreaterThan0() {return firstYgt0;}
|
||||||
|
double h() {return y1-y0;}
|
||||||
|
|
||||||
|
void SetZoomBase(double xmin,double ymin,double x_width, double y_width);
|
||||||
|
void SetZoomBase(SlsQtH1D* h);
|
||||||
|
void ExtendZoomBase(SlsQtH1D* h);
|
||||||
|
void ResetZoomBase();
|
||||||
|
|
||||||
|
bool IsLogX(){ return xIsLog;}
|
||||||
|
bool IsLogY(){ return yIsLog;}
|
||||||
|
bool SetLogX(bool yes) { return xIsLog=yes;}
|
||||||
|
bool SetLogY(bool yes) { return yIsLog=yes;}
|
||||||
|
|
||||||
|
virtual QwtText trackerText(const QwtDoublePoint &pos) const{
|
||||||
|
QColor bg(Qt::white);
|
||||||
|
#if QT_VERSION >= 0x040300
|
||||||
|
bg.setAlpha(200);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QwtText text = QwtPlotZoomer::trackerText(pos);
|
||||||
|
|
||||||
|
text.setBackgroundBrush( QBrush( bg ));
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
113
slsDetectorGui/slsDetectorPlotting/include/SlsQt2DHist.h
Normal file
113
slsDetectorGui/slsDetectorPlotting/include/SlsQt2DHist.h
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ian Johnson
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef SLSQT2DHIST_H
|
||||||
|
#define SLSQT2DHIST_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x040000
|
||||||
|
#include <qprintdialog.h>
|
||||||
|
#endif
|
||||||
|
#include <qwt_color_map.h>
|
||||||
|
#include <qwt_plot_spectrogram.h>
|
||||||
|
#include <qwt_scale_widget.h>
|
||||||
|
#include <qwt_scale_draw.h>
|
||||||
|
|
||||||
|
|
||||||
|
class SlsQt2DHist: public QwtRasterData{
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
double x_min,x_max,y_min,y_max;
|
||||||
|
double x_width,y_width;
|
||||||
|
|
||||||
|
int nx,ny,nb;
|
||||||
|
double *data;
|
||||||
|
double z_min,z_mean,z_max;
|
||||||
|
bool z_mean_has_been_calculated;
|
||||||
|
|
||||||
|
int nx_array,ny_array;
|
||||||
|
|
||||||
|
bool interp;
|
||||||
|
|
||||||
|
static double value_between_points(double p1,double v1,double p2,double v2,double p){ //linear extrap
|
||||||
|
return (v2-v1)/(p2-p1)*(p-p1)+v1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
SlsQt2DHist(int nbinsx=10, double xmin=0, double xmax=10, int nbinsy=10, double ymin=0, double ymax=10, double* d=0,double zmin=0,double zmax=-1);
|
||||||
|
virtual ~SlsQt2DHist();
|
||||||
|
|
||||||
|
double GetXMin() {return x_min;}
|
||||||
|
double GetXMax() {return x_max;}
|
||||||
|
double GetXBinWidth() {return x_width;}
|
||||||
|
double GetYMin() {return y_min;}
|
||||||
|
double GetYMax() {return y_max;}
|
||||||
|
double GetYBinWidth() {return y_width;}
|
||||||
|
double GetMinimum() {return z_min;}
|
||||||
|
double GetMaximum() {return z_max;}
|
||||||
|
double GetMean();
|
||||||
|
|
||||||
|
int GetNBinsX(){return nx;}
|
||||||
|
int GetNBinsY(){return ny;}
|
||||||
|
double GetBinValue(int bx,int by);
|
||||||
|
int GetBinIndex(int bx,int by);
|
||||||
|
double* GetDataPtr(){return data;}
|
||||||
|
|
||||||
|
void Interpolate(bool on=1) {interp=on;}
|
||||||
|
void SetBinValue(int bx,int by,double v);
|
||||||
|
void SetData(int nbinsx, double xmin, double xmax, int nbinsy,double ymin, double ymax,double *d,double zmin=0, double zmax=-1);
|
||||||
|
|
||||||
|
double SetMinimumToFirstGreaterThanZero();
|
||||||
|
void SetMinimum(double zmin) {z_min=zmin;}
|
||||||
|
void SetMaximum(double zmax) {z_max=zmax;}
|
||||||
|
void SetMinMax(double zmin=0,double zmax=-1);
|
||||||
|
|
||||||
|
int FindBinIndex(double x, double y);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
virtual QwtRasterData *copy() const{
|
||||||
|
//this function does not create a new SlsQt2DHistData instance,
|
||||||
|
//just passes a pointer so that data is common to both the copy and the original instance
|
||||||
|
return (QwtRasterData*) this;
|
||||||
|
}
|
||||||
|
virtual QwtDoubleInterval range() const{ return QwtDoubleInterval(z_min,z_max);}
|
||||||
|
|
||||||
|
virtual double value(double x, double y) const{
|
||||||
|
//if(!interp){ //default is box like plot
|
||||||
|
int index = int((x-x_min)/x_width) + int((y-y_min)/y_width)*nx;
|
||||||
|
if(index<0||index>nb) index = nb;
|
||||||
|
if(!interp) return data[index];
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
int x_int = int((x-x_min)/x_width-0.5);
|
||||||
|
if(x_int<0) x_int = 0; else if(x_int>nx-2) x_int = nx-2;
|
||||||
|
int y_int = int((y-y_min)/y_width-0.5);
|
||||||
|
if(y_int<0) y_int = 0; else if(y_int>ny-2) y_int = ny-2;
|
||||||
|
|
||||||
|
int b00 = x_int*ny + y_int;
|
||||||
|
int b01 = x_int*ny + y_int+1;
|
||||||
|
int b10 = (x_int+1)*ny + y_int;
|
||||||
|
int b11 = (x_int+1)*ny + y_int+1;
|
||||||
|
|
||||||
|
//vertical extrap
|
||||||
|
double y0 = y_min+(y_int+0.5)*y_width;
|
||||||
|
double y1 = y_min+(y_int+1.5)*y_width;
|
||||||
|
double left_v = value_between_points(y0,data[b00],y1,data[b01],y);
|
||||||
|
double right_v = value_between_points(y0,data[b10],y1,data[b11],y);
|
||||||
|
//horazontal extrap
|
||||||
|
return value_between_points(x_min+(x_int+0.5)*x_width,left_v,
|
||||||
|
x_min+(x_int+1.5)*x_width,right_v,x);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
79
slsDetectorGui/slsDetectorPlotting/include/SlsQt2DPlot.h
Normal file
79
slsDetectorGui/slsDetectorPlotting/include/SlsQt2DPlot.h
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ian Johnson
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef SLSQT2DPLOT_H
|
||||||
|
#define SLSQT2DPLOT_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <qwt_plot.h>
|
||||||
|
#include <qwt_plot_spectrogram.h>
|
||||||
|
|
||||||
|
#include "SlsQt2DZoomer.h"
|
||||||
|
#include "SlsQt2DHist.h"
|
||||||
|
|
||||||
|
|
||||||
|
class QwtPlotPanner;
|
||||||
|
class QwtScaleWidget;
|
||||||
|
class QwtLinearColorMap;
|
||||||
|
|
||||||
|
|
||||||
|
class SlsQt2DPlot: public QwtPlot{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
private:
|
||||||
|
QwtPlotSpectrogram *d_spectrogram;
|
||||||
|
SlsQt2DHist* hist;
|
||||||
|
SlsQt2DZoomer* zoomer;
|
||||||
|
QwtPlotPanner* panner;
|
||||||
|
QwtScaleWidget *rightAxis;
|
||||||
|
|
||||||
|
QwtLinearColorMap* colorMapLinearScale;
|
||||||
|
QwtLinearColorMap* colorMapLogScale;
|
||||||
|
QwtValueList* contourLevelsLinear;
|
||||||
|
QwtValueList* contourLevelsLog;
|
||||||
|
|
||||||
|
void SetupZoom();
|
||||||
|
void SetupColorMap();
|
||||||
|
|
||||||
|
public:
|
||||||
|
SlsQt2DPlot(QWidget * = NULL);
|
||||||
|
|
||||||
|
// SlsQt2DHist *GetHistogram(){ return hist; }
|
||||||
|
|
||||||
|
void UnZoom();
|
||||||
|
void SetZoom(double xmin,double ymin,double x_width,double y_width);
|
||||||
|
|
||||||
|
double GetZMinimum(){ return hist->GetMinimum();}
|
||||||
|
double GetZMaximum(){ return hist->GetMaximum();}
|
||||||
|
void SetZMinMax(double zmin=0,double zmax=-1);
|
||||||
|
void SetZMinimumToFirstGreaterThanZero(){hist->SetMinimumToFirstGreaterThanZero();}
|
||||||
|
double GetZMean() { return hist->GetMean();}
|
||||||
|
|
||||||
|
void SetData(int nbinsx, double xmin, double xmax, int nbinsy,double ymin, double ymax,double *d,double zmin=0, double zmax=-1){
|
||||||
|
hist->SetData(nbinsx,xmin,xmax,nbinsy,ymin,ymax,d,zmin,zmax);
|
||||||
|
}
|
||||||
|
|
||||||
|
double* GetDataPtr() {return hist->GetDataPtr();}
|
||||||
|
int GetBinIndex(int bx,int by) {return hist->GetBinIndex(bx,by);}
|
||||||
|
int FindBinIndex(double x,double y) {return hist->FindBinIndex(x,y);}
|
||||||
|
void SetBinValue(int bx,int by,double v) {hist->SetBinValue(bx,by,v);}
|
||||||
|
double GetBinValue(int bx,int by) {return hist->GetBinValue(bx,by);}
|
||||||
|
|
||||||
|
|
||||||
|
void FillTestPlot(int i=0);
|
||||||
|
void Update();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void LogZ(bool on=1);
|
||||||
|
void InterpolatedPlot(bool on);
|
||||||
|
void showContour(bool on);
|
||||||
|
void showSpectrogram(bool on);
|
||||||
|
// void printPlot();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
112
slsDetectorGui/slsDetectorPlotting/include/SlsQt2DPlotLayout.h
Normal file
112
slsDetectorGui/slsDetectorPlotting/include/SlsQt2DPlotLayout.h
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* @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
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef SLSQT2DPLOTLAYOUT_H
|
||||||
|
#define SLSQT2DPLOTLAYOUT_H
|
||||||
|
|
||||||
|
#include <qwidget.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
#include "SlsQtNumberEntry.h"
|
||||||
|
#include "SlsQt2DPlot.h"
|
||||||
|
|
||||||
|
class QGridLayout;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
bool logsChecked;
|
||||||
|
|
||||||
|
void ConnectSignalsAndSlots();
|
||||||
|
|
||||||
|
void Layout();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void SetZScaleToLog(bool yes);
|
||||||
|
void ResetRange();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void InterpolateSignal(bool);
|
||||||
|
void ContourSignal(bool);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
51
slsDetectorGui/slsDetectorPlotting/include/SlsQt2DZoomer.h
Normal file
51
slsDetectorGui/slsDetectorPlotting/include/SlsQt2DZoomer.h
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ian Johnson
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef SLSQT2DZOOMER_H
|
||||||
|
#define SLSQT2DZOOMER_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <qwt_plot_zoomer.h>
|
||||||
|
#include <qwt_plot_panner.h>
|
||||||
|
|
||||||
|
#include "SlsQt2DHist.h"
|
||||||
|
|
||||||
|
class SlsQt2DZoomer:public QwtPlotZoomer{
|
||||||
|
private:
|
||||||
|
SlsQt2DHist* hist;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SlsQt2DZoomer(QwtPlotCanvas *canvas):QwtPlotZoomer(canvas){
|
||||||
|
setTrackerMode(AlwaysOn);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetHist(SlsQt2DHist* h){
|
||||||
|
hist=h;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual QwtText trackerText(const QwtDoublePoint &pos) const{
|
||||||
|
QColor bg(Qt::white);
|
||||||
|
#if QT_VERSION >= 0x040300
|
||||||
|
bg.setAlpha(200);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
//QwtText text = QwtPlotZoomer::trackerText(pos);
|
||||||
|
|
||||||
|
static QwtText text;
|
||||||
|
if(hist){
|
||||||
|
static char t[200];
|
||||||
|
sprintf(t,"%3.2f, %3.2f, %3.2f",pos.x(),pos.y(),hist->value(pos.x(),pos.y()));
|
||||||
|
text.setText(t);
|
||||||
|
}else text = QwtPlotZoomer::trackerText(pos);
|
||||||
|
|
||||||
|
text.setBackgroundBrush( QBrush( bg ));
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
140
slsDetectorGui/slsDetectorPlotting/include/SlsQtNumberEntry.h
Normal file
140
slsDetectorGui/slsDetectorPlotting/include/SlsQtNumberEntry.h
Normal file
@ -0,0 +1,140 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ian Johnson
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SLSQTNUMBERENTRY_H
|
||||||
|
#define SLSQTNUMBERENTRY_H
|
||||||
|
|
||||||
|
#include <qwidget.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
class QGridLayout;
|
||||||
|
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QIntValidator;
|
||||||
|
class QDoubleValidator;
|
||||||
|
class QCheckBox;
|
||||||
|
class QComboBox;
|
||||||
|
class QSpinBox;
|
||||||
|
|
||||||
|
#include "SlsQtValidators.h"
|
||||||
|
|
||||||
|
class SlsQtNumberEntry:public QWidget{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
//type=0->units only, type=1->int,type=2->double, type=3->spinbox
|
||||||
|
//adding middle text will automatically add a second number field
|
||||||
|
SlsQtNumberEntry(QWidget *parent,int with_checkbox=0, char *start_string=0, int num_type=0, char *middle_string=0, int num2_type=0, int n_units=0, char** units=0, double* unit_factors=0, char* end_string=0);
|
||||||
|
//without unit box
|
||||||
|
SlsQtNumberEntry(QWidget *parent,int with_checkbox, char *start_strin, int num_type, char *middle_string, int num2_type, char* end_string);
|
||||||
|
|
||||||
|
|
||||||
|
~SlsQtNumberEntry();
|
||||||
|
|
||||||
|
void Enable(bool en_flag=1);
|
||||||
|
void Disable();
|
||||||
|
void EnableNumberField(int which_number_field,bool en_flag=1); //which_number_field is 0 or 1
|
||||||
|
void DisableNumberField(int which_number_field);
|
||||||
|
|
||||||
|
void AddCheckBox();
|
||||||
|
void SetFrontText(char* s);
|
||||||
|
void SetMiddleText(char* s);
|
||||||
|
void SetBackText(char* s);
|
||||||
|
void SetupNumberField(int type,int which_number_field=0);
|
||||||
|
void SetUnits(int n_units,char** units,double* unit_factors);
|
||||||
|
|
||||||
|
void SetMinimumNumberWidth(int nchar_width,int which_number_field=0);
|
||||||
|
void SetNDecimalsOfDoubleValidators(int ndecimals);
|
||||||
|
void SetNDecimalsOfDoubleValidator(int ndecimals,int which_number_field=0);
|
||||||
|
void SetMinimumUnitWidth(int nchar_width);
|
||||||
|
|
||||||
|
bool Enabled();
|
||||||
|
bool CheckBoxState();
|
||||||
|
bool IsValueOk(int which_number_field=0);
|
||||||
|
|
||||||
|
const char* GetFrontText();
|
||||||
|
const char* GetMiddleText();
|
||||||
|
const char* GetBackText();
|
||||||
|
|
||||||
|
int GetNumberInt(int which_number_field=0,bool* ok=0);
|
||||||
|
double GetNumber(int which_number_field=0,bool *ok=0);
|
||||||
|
|
||||||
|
int GetValueInt(int which_number_field=0,bool* ok=0);
|
||||||
|
double GetValue(int which_number_field=0,bool *ok=0);
|
||||||
|
|
||||||
|
int GetComboBoxIndex();
|
||||||
|
double GetComboBoxValue();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void SetupNumberEntry(int with_checkbox=0, char *start_string=0, int num_type=0, char *middle_string=0, int num2_type=0, int n_units=0, char** units=0, double* unit_factors=0, char* end_string=0);
|
||||||
|
|
||||||
|
QGridLayout* layout; //default layout
|
||||||
|
|
||||||
|
QCheckBox* check_box;
|
||||||
|
QLabel* front_text;
|
||||||
|
QLabel* middle_text;
|
||||||
|
QLineEdit* num_field[2];
|
||||||
|
QSpinBox* spin_box[2];
|
||||||
|
bool num_field_enabled[2];
|
||||||
|
|
||||||
|
SlsQtIntValidator* validator_int[2];
|
||||||
|
SlsQtDoubleValidator* validator_double[2];
|
||||||
|
QComboBox* unit_cbb;
|
||||||
|
double* factors;
|
||||||
|
QLabel* back_text;
|
||||||
|
|
||||||
|
void SetText(char* s, QLabel** pp);
|
||||||
|
void SetLayout();
|
||||||
|
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void FirstValueEntered();
|
||||||
|
void SecondValueEntered();
|
||||||
|
void UnitSelected();
|
||||||
|
|
||||||
|
void SetRange(int min, int max, int which_number_field=0);
|
||||||
|
void SetRange(double min, double max, int which_number_field=0);
|
||||||
|
void SetFirstRange(int min, int max) {SetRange(min,max,0);}
|
||||||
|
void SetSecondRange(int min, int max) {SetRange(min,max,1);}
|
||||||
|
|
||||||
|
double SetValue(double v, int which_number_field=0);
|
||||||
|
void SetFirstValue(int v) {SetValue(v,0);}
|
||||||
|
void SetSecondValue(int v) {SetValue(v,1);}
|
||||||
|
void SetFirstValue(double v) {SetValue(v,0);}
|
||||||
|
void SetSecondValue(double v) {SetValue(v,1);}
|
||||||
|
|
||||||
|
// double SetNumber(int v, int which_number_field=0);
|
||||||
|
double SetNumber(double v, int which_number_field=0);
|
||||||
|
void SetFirstNumber(int v) {SetNumber(v,0);}
|
||||||
|
void SetSecondNumber(int v) {SetNumber(v,1);}
|
||||||
|
void SetFirstNumber(double v) {SetNumber(v,0);}
|
||||||
|
void SetSecondNumber(double v) {SetNumber(v,1);}
|
||||||
|
|
||||||
|
int SetComboBoxIndex(int index);
|
||||||
|
|
||||||
|
void CheckBoxClicked();
|
||||||
|
void PrintTheValue();
|
||||||
|
|
||||||
|
void RefreshFirstNumberEntry();
|
||||||
|
void RefreshSecondNumberEntry();
|
||||||
|
void RefreshNumberEntery(int number_field=0);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void CheckBoxChanged(bool state);
|
||||||
|
void CheckBoxChanged(SlsQtNumberEntry* ptr);
|
||||||
|
void AValueChanged(SlsQtNumberEntry* ptr);
|
||||||
|
void FirstValueChanged(int value);
|
||||||
|
void FirstValueChanged(double value);
|
||||||
|
void FirstValueChanged(SlsQtNumberEntry* ptr);
|
||||||
|
void SecondValueChanged(int value);
|
||||||
|
void SecondValueChanged(double value);
|
||||||
|
void SecondValueChanged(SlsQtNumberEntry* ptr);
|
||||||
|
void UnitChanged(double);
|
||||||
|
void UnitChanged(SlsQtNumberEntry* ptr);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
73
slsDetectorGui/slsDetectorPlotting/include/SlsQtValidators.h
Normal file
73
slsDetectorGui/slsDetectorPlotting/include/SlsQtValidators.h
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ian Johnson
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SLSQTVALIDATORS_H
|
||||||
|
#define SLSQTVALIDATORS_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#include <qwidget.h>
|
||||||
|
#include <qvalidator.h>
|
||||||
|
|
||||||
|
using std::cout;
|
||||||
|
using std::endl;
|
||||||
|
|
||||||
|
class SlsQtIntValidator:public QIntValidator{
|
||||||
|
|
||||||
|
public:
|
||||||
|
SlsQtIntValidator(QWidget *parent):QIntValidator(parent){}
|
||||||
|
|
||||||
|
virtual void fixup (QString& text) const {
|
||||||
|
bool ok = 1;
|
||||||
|
int v = text.toInt(&ok);
|
||||||
|
|
||||||
|
if(!ok){
|
||||||
|
v = text.toDouble(&ok);
|
||||||
|
if(ok) text = QString::number(v);
|
||||||
|
else text = QString::number(0);
|
||||||
|
fixup(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(v<bottom()) text = QString::number(bottom());
|
||||||
|
else if(v>top()) text = QString::number(top());
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class SlsQtDoubleValidator:public QDoubleValidator{
|
||||||
|
|
||||||
|
public:
|
||||||
|
SlsQtDoubleValidator(QWidget *parent):QDoubleValidator(parent){}
|
||||||
|
|
||||||
|
virtual void fixup (QString& text) const {
|
||||||
|
|
||||||
|
bool ok = 1;
|
||||||
|
double v = text.toDouble(&ok);
|
||||||
|
|
||||||
|
if(!ok){
|
||||||
|
text = QString::number(0);
|
||||||
|
fixup(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
int nd = this->decimals(); //ndigest behind zero
|
||||||
|
if(v<bottom()){
|
||||||
|
text = QString::number(bottom(),'g',nd);
|
||||||
|
}else{
|
||||||
|
if(nd<0) nd=0;
|
||||||
|
if(v>top()){
|
||||||
|
v = floor(top()*pow(10,nd))/pow(10,nd);
|
||||||
|
text = QString::number(v,'g');
|
||||||
|
}else{
|
||||||
|
v = round(v*pow(10,nd))/pow(10,nd);
|
||||||
|
text = QString::number(v,'g');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
440
slsDetectorGui/slsDetectorPlotting/src/SlsQt1DPlot.cxx
Normal file
440
slsDetectorGui/slsDetectorPlotting/src/SlsQt1DPlot.cxx
Normal file
@ -0,0 +1,440 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ian Johnson
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <qwt_painter.h>
|
||||||
|
#include <qwt_plot_canvas.h>
|
||||||
|
#include <qwt_plot_curve.h>
|
||||||
|
#include <qwt_scale_widget.h>
|
||||||
|
#include <qwt_legend.h>
|
||||||
|
#include <qwt_scale_draw.h>
|
||||||
|
#include <qwt_scale_engine.h>
|
||||||
|
#include <qwt_math.h>
|
||||||
|
#include "SlsQt1DPlot.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
SlsQtH1D::SlsQtH1D(QString title,int n, double min, double max, double* data):QwtPlotCurve(title){
|
||||||
|
Initailize();
|
||||||
|
SetData(n,min,max,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
SlsQtH1D::SlsQtH1D(QString title,int n, double* data_x, double* data_y):QwtPlotCurve(title){
|
||||||
|
Initailize();
|
||||||
|
SetData(n,data_x,data_y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtH1D::Initailize(){
|
||||||
|
ndata=n_array=0;
|
||||||
|
x=y=0;
|
||||||
|
pen_ptr = new QPen();
|
||||||
|
SetLineColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
SlsQtH1D::~SlsQtH1D(){delete x;delete y;delete pen_ptr;}
|
||||||
|
|
||||||
|
void SlsQtH1D::Attach(SlsQt1DPlot* p){
|
||||||
|
attach((QwtPlot*) p);
|
||||||
|
p->NewHistogramAttached(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtH1D::Detach(SlsQt1DPlot* p){
|
||||||
|
detach();
|
||||||
|
p->HistogramDetached(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SlsQtH1D::SetLineColor(int c){
|
||||||
|
static int last_color = 1;
|
||||||
|
if(c<0) c=(last_color+1)%3;
|
||||||
|
|
||||||
|
if(c==0) pen_ptr->setColor(Qt::black);
|
||||||
|
else if(c==1) pen_ptr->setColor(Qt::red);
|
||||||
|
else pen_ptr->setColor(Qt::blue);
|
||||||
|
|
||||||
|
setPen(*pen_ptr);
|
||||||
|
|
||||||
|
return last_color=c;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SlsQtH1D::SetLineWidth(int w){
|
||||||
|
pen_ptr->setWidth(w);
|
||||||
|
setPen(*pen_ptr);
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtH1D::SetLineStyle(int s){
|
||||||
|
if(s==1) pen_ptr->setStyle(Qt::DashLine);
|
||||||
|
else if(s==2) pen_ptr->setStyle(Qt::DotLine);
|
||||||
|
else if(s==3) pen_ptr->setStyle(Qt::DashDotLine);
|
||||||
|
else if(s==4) pen_ptr->setStyle(Qt::DashDotDotLine);
|
||||||
|
else if(s==5) pen_ptr->setStyle(Qt::CustomDashLine);
|
||||||
|
else pen_ptr->setStyle(Qt::SolidLine);
|
||||||
|
setPen(*pen_ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SlsQtH1D::SetData(int n, double xmin, double xmax, double *data){
|
||||||
|
n = SetUpArrays(n);
|
||||||
|
|
||||||
|
ndata=n;
|
||||||
|
if(xmin>xmax){
|
||||||
|
double t=xmin;
|
||||||
|
xmin=xmax;
|
||||||
|
xmax=t;
|
||||||
|
}
|
||||||
|
|
||||||
|
dx = (xmax-xmin)/n;
|
||||||
|
ymin=ymax= data ? data[0]:0;
|
||||||
|
firstXgt0=-1;
|
||||||
|
firstYgt0=-1;
|
||||||
|
|
||||||
|
for(int i=0;i<ndata;i++){
|
||||||
|
x[i] = i ? x[i-1]+dx:xmin;
|
||||||
|
y[i] = data ? data[i]:0;
|
||||||
|
if(data&&ymin>y[i]) ymin = y[i];
|
||||||
|
if(data&&ymax<y[i]) ymax = y[i];
|
||||||
|
if(x[i]>0&&(firstXgt0<0||firstXgt0>x[i])) firstXgt0=x[i];
|
||||||
|
if(y[i]>0&&(firstYgt0<0||firstYgt0>y[i])) firstYgt0=y[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
// cout<<endl<<endl<<"one can think about correcting negative values in the data and recalling the setRawData function in setRawData when plotting on log scales"<<endl;
|
||||||
|
|
||||||
|
// if(firstXgt0<0)firstXgt0=0.001;
|
||||||
|
// if(firstYgt0<0)firstYgt0=0.001;
|
||||||
|
|
||||||
|
setRawData(x,y,ndata);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtH1D::SetData(int n, double* data_x, double *data_y){
|
||||||
|
|
||||||
|
int reverse = (data_x&&n>0&&data_x[0]>data_x[n-1]) ? 1:0;
|
||||||
|
n = SetUpArrays(n);
|
||||||
|
|
||||||
|
ndata=n;
|
||||||
|
dx=-1; //signifies not regular intervals
|
||||||
|
|
||||||
|
ymin=ymax= data_y ? data_y[0]:0;
|
||||||
|
|
||||||
|
firstXgt0=-1;
|
||||||
|
firstYgt0=-1;
|
||||||
|
|
||||||
|
for(int i=0;i<ndata;i++){
|
||||||
|
int b = reverse ? n-i-1:i;
|
||||||
|
x[b] = data_x ? data_x[i]:0;
|
||||||
|
y[b] = data_y ? data_y[i]:0;
|
||||||
|
if(data_y&&ymin>y[b]) ymin = y[b];
|
||||||
|
if(data_y&&ymax<y[b]) ymax = y[b];
|
||||||
|
if(x[b]>0&&(firstXgt0<0||firstXgt0>x[b])) firstXgt0=x[b];
|
||||||
|
if(y[b]>0&&(firstYgt0<0||firstYgt0>y[b])) firstYgt0=y[b];
|
||||||
|
}
|
||||||
|
|
||||||
|
setRawData(x,y,ndata);
|
||||||
|
}
|
||||||
|
|
||||||
|
int SlsQtH1D::SetUpArrays(int n){
|
||||||
|
n = n<1 ? 1 : n; //overflow bin
|
||||||
|
|
||||||
|
if(n+1>n_array){
|
||||||
|
n_array = n+1;
|
||||||
|
if(x) delete x;
|
||||||
|
if(y) delete y;
|
||||||
|
x = new double [n_array];
|
||||||
|
y = new double [n_array];
|
||||||
|
}
|
||||||
|
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
double SlsQtH1D::FillBin(int bx, double v) {
|
||||||
|
bx = CheckIndex(bx);
|
||||||
|
return SetBinContent(bx,y[bx]+v);
|
||||||
|
}
|
||||||
|
double SlsQtH1D::Fill(double x, double v){return FillBin(FindBinIndex(x),v);}
|
||||||
|
|
||||||
|
double SlsQtH1D::SetBinContent(int bx,double v){
|
||||||
|
bx = CheckIndex(bx);
|
||||||
|
y[bx]=v;
|
||||||
|
if(bx<ndata){
|
||||||
|
if(y[bx]<ymin) ymin = y[bx];
|
||||||
|
if(y[bx]>0&&(firstYgt0<=0||y[bx]<firstYgt0)) firstYgt0 = y[bx];
|
||||||
|
if(y[bx]>ymax) ymax = y[bx];
|
||||||
|
}
|
||||||
|
return y[bx];
|
||||||
|
}
|
||||||
|
|
||||||
|
double SlsQtH1D::SetContent(double x,double v) {return SetBinContent(FindBinIndex(x),v); }
|
||||||
|
|
||||||
|
int SlsQtH1D::FindBinIndex(double px){
|
||||||
|
if(dx>0) CheckIndex(int((px-x[0])/dx));
|
||||||
|
|
||||||
|
//find closest bin
|
||||||
|
int b=0; for(;b<ndata;b++) if(x[b]>px) break;
|
||||||
|
|
||||||
|
if(b==0) return 0;
|
||||||
|
else if(fabs(px-x[b-1])<fabs(px-x[b])) return b-1;
|
||||||
|
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SlsQtH1D::CheckIndex(int bx){return (bx<0||bx>ndata) ? ndata : bx;}//ndata is the overflow bin
|
||||||
|
|
||||||
|
SlsQtH1D* SlsQtH1D::Add(double v){ for(int bx=0;bx<ndata;bx++) FillBin(bx,v); return this;}
|
||||||
|
|
||||||
|
|
||||||
|
//1d hist list stuff
|
||||||
|
SlsQtH1DList::SlsQtH1DList(SlsQtH1D* hist){
|
||||||
|
the_hist = hist;
|
||||||
|
the_next = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
SlsQtH1DList::~SlsQtH1DList(){
|
||||||
|
if(the_next) delete the_next;
|
||||||
|
}
|
||||||
|
|
||||||
|
SlsQtH1D* SlsQtH1DList::Add(SlsQtH1D* hist){
|
||||||
|
// cout<<"Adding: "<<hist<<endl;
|
||||||
|
SlsQtH1DList* hl=this;
|
||||||
|
|
||||||
|
while(hl){
|
||||||
|
if(hist==hl->the_hist) return hist; //already added
|
||||||
|
if(!hl->the_next) break;
|
||||||
|
hl=hl->the_next;
|
||||||
|
}
|
||||||
|
if(hl->the_hist) hl->the_next = new SlsQtH1DList(hist);
|
||||||
|
else hl->the_hist = hist;
|
||||||
|
|
||||||
|
// Print();
|
||||||
|
|
||||||
|
return hist;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtH1DList::Print(){
|
||||||
|
// cout<<"Printing List"<<endl;
|
||||||
|
SlsQtH1DList* hl=this;
|
||||||
|
int i=0;
|
||||||
|
while(hl){
|
||||||
|
cout<<" "<<i++<<") "<<hl<<" "<<hl->the_hist<<" "<<hl->the_next<<endl;
|
||||||
|
hl=hl->the_next;
|
||||||
|
if(i>10) break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtH1DList::Remove(SlsQtH1D* hist){
|
||||||
|
// cout<<"Removing: "<<hist<<endl;
|
||||||
|
SlsQtH1DList* hl=this;
|
||||||
|
while(hl){ //every match will be removed
|
||||||
|
if(hl->the_hist!=hist) hl = hl->the_next;
|
||||||
|
else{ //match
|
||||||
|
if(!hl->the_next) hl->the_hist=0; // first the_hist is zero when there's no next
|
||||||
|
else{
|
||||||
|
SlsQtH1DList* t = hl->the_next;
|
||||||
|
hl->the_hist = t->the_hist;
|
||||||
|
hl->the_next = t->the_next;
|
||||||
|
t->the_next = 0;
|
||||||
|
delete t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Print();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//1d plot stuff
|
||||||
|
SlsQt1DPlot::SlsQt1DPlot(QWidget *parent):QwtPlot(parent){
|
||||||
|
// n_histograms_attached=0;
|
||||||
|
hline=vline=0;
|
||||||
|
hist_list = new SlsQtH1DList();
|
||||||
|
|
||||||
|
UnknownStuff();
|
||||||
|
alignScales();
|
||||||
|
SetupZoom();
|
||||||
|
|
||||||
|
// Assign a title
|
||||||
|
insertLegend(new QwtLegend(), QwtPlot::RightLegend);
|
||||||
|
|
||||||
|
axisScaleEngine(QwtPlot::yLeft)->setAttribute(QwtScaleEngine::Floating);
|
||||||
|
axisScaleEngine(QwtPlot::xBottom)->setAttribute(QwtScaleEngine::Floating);
|
||||||
|
}
|
||||||
|
|
||||||
|
SlsQt1DPlot::~SlsQt1DPlot(){
|
||||||
|
delete hist_list;
|
||||||
|
|
||||||
|
if(hline) delete hline;
|
||||||
|
if(vline) delete vline;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DPlot::CalculateNResetZoomBase(){
|
||||||
|
if(hist_list->Hist()) zoomer->SetZoomBase(hist_list->Hist());
|
||||||
|
SlsQtH1DList* hl = hist_list->Next();
|
||||||
|
while(hl){
|
||||||
|
if(hl->Hist()) zoomer->ExtendZoomBase(hl->Hist());
|
||||||
|
hl=hl->Next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DPlot::NewHistogramAttached(SlsQtH1D* h){
|
||||||
|
hist_list->Add(h);
|
||||||
|
CalculateNResetZoomBase();
|
||||||
|
if(!hist_list->Next()) UnZoom();
|
||||||
|
Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DPlot::HistogramDetached(SlsQtH1D* h){
|
||||||
|
hist_list->Remove(h);
|
||||||
|
CalculateNResetZoomBase();
|
||||||
|
Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DPlot::Update(){
|
||||||
|
replot();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DPlot::SetTitle(const char* title){
|
||||||
|
setTitle(title);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DPlot::SetXTitle(const char* title){
|
||||||
|
setAxisTitle(QwtPlot::xBottom,title);
|
||||||
|
}
|
||||||
|
void SlsQt1DPlot::SetYTitle(const char* title){
|
||||||
|
setAxisTitle(QwtPlot::yLeft,title);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DPlot::SetLogX(bool yes){ SetLog(QwtPlot::xBottom,yes);}
|
||||||
|
void SlsQt1DPlot::SetLogY(bool yes){ SetLog(QwtPlot::yLeft,yes);}
|
||||||
|
void SlsQt1DPlot::SetLog(int axisId, bool yes){
|
||||||
|
if(axisId==QwtPlot::xBottom) zoomer->SetLogX(yes);
|
||||||
|
if(axisId==QwtPlot::yLeft) zoomer->SetLogY(yes);
|
||||||
|
|
||||||
|
zoomer->ResetZoomBase(); //needs to be done before setting Engine
|
||||||
|
|
||||||
|
//the old ones are deleted by in the setAxisScaleFunction() function see: 128 of file qwt_plot_axis.cpp
|
||||||
|
if(yes) setAxisScaleEngine(axisId,new QwtLog10ScaleEngine());
|
||||||
|
else setAxisScaleEngine(axisId,new QwtLinearScaleEngine());
|
||||||
|
|
||||||
|
axisScaleEngine(QwtPlot::yLeft)->setAttribute(QwtScaleEngine::Floating);
|
||||||
|
axisScaleEngine(QwtPlot::xBottom)->setAttribute(QwtScaleEngine::Floating);
|
||||||
|
|
||||||
|
Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DPlot::UnZoom(){
|
||||||
|
setAxisScale(QwtPlot::xBottom,zoomer->x(),zoomer->x()+zoomer->w());
|
||||||
|
setAxisScale(QwtPlot::yLeft,zoomer->y(),zoomer->y()+zoomer->h());
|
||||||
|
|
||||||
|
zoomer->setZoomBase();//Call replot for the attached plot before initializing the zoomer with its scales.
|
||||||
|
Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DPlot::SetZoom(double xmin,double ymin,double x_width,double y_width){
|
||||||
|
setAxisScale(QwtPlot::xBottom,xmin,xmin+x_width);
|
||||||
|
setAxisScale(QwtPlot::yLeft ,ymin,ymin+y_width);
|
||||||
|
Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DPlot::RemoveHLine(){
|
||||||
|
if(hline) hline->detach();
|
||||||
|
delete hline;
|
||||||
|
hline=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DPlot::InsertHLine(double y){
|
||||||
|
if(!hline){
|
||||||
|
hline = new QwtPlotMarker();
|
||||||
|
hline->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
|
||||||
|
hline->setLineStyle(QwtPlotMarker::HLine);
|
||||||
|
hline->attach(this);
|
||||||
|
}
|
||||||
|
hline->setYValue(y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DPlot::RemoveVLine(){
|
||||||
|
if(vline) vline->detach();
|
||||||
|
delete vline;
|
||||||
|
vline=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DPlot::InsertVLine(double x){
|
||||||
|
if(!vline){
|
||||||
|
vline = new QwtPlotMarker();
|
||||||
|
vline->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
|
||||||
|
vline->setLineStyle(QwtPlotMarker::VLine);
|
||||||
|
vline->attach(this);
|
||||||
|
}
|
||||||
|
vline->setXValue(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void SlsQt1DPlot::SetupZoom(){
|
||||||
|
// LeftButton for the zooming
|
||||||
|
// MidButton for the panning
|
||||||
|
// RightButton: zoom out by 1
|
||||||
|
// Ctrl+RighButton: zoom out to full size
|
||||||
|
|
||||||
|
zoomer = new SlsQt1DZoomer(canvas());
|
||||||
|
|
||||||
|
#if QT_VERSION < 0x040000
|
||||||
|
zoomer->setMousePattern(QwtEventPattern::MouseSelect2,Qt::RightButton, Qt::ControlButton);
|
||||||
|
#else
|
||||||
|
zoomer->setMousePattern(QwtEventPattern::MouseSelect2,Qt::RightButton, Qt::ControlModifier);
|
||||||
|
#endif
|
||||||
|
zoomer->setMousePattern(QwtEventPattern::MouseSelect3,Qt::RightButton);
|
||||||
|
|
||||||
|
panner = new QwtPlotPanner(canvas());
|
||||||
|
panner->setAxisEnabled(QwtPlot::yRight, false);
|
||||||
|
panner->setMouseButton(Qt::MidButton);
|
||||||
|
|
||||||
|
// Avoid jumping when labels with more/less digits
|
||||||
|
// appear/disappear when scrolling vertically
|
||||||
|
|
||||||
|
const QFontMetrics fm(axisWidget(QwtPlot::yLeft)->font());
|
||||||
|
QwtScaleDraw *sd = axisScaleDraw(QwtPlot::yLeft);
|
||||||
|
sd->setMinimumExtent( fm.width("100.00") );
|
||||||
|
|
||||||
|
const QColor c(Qt::darkBlue);
|
||||||
|
zoomer->setRubberBandPen(c);
|
||||||
|
zoomer->setTrackerPen(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Set a plain canvas frame and align the scales to it
|
||||||
|
void SlsQt1DPlot::alignScales(){
|
||||||
|
// The code below shows how to align the scales to
|
||||||
|
// the canvas frame, but is also a good example demonstrating
|
||||||
|
// why the spreaded API needs polishing.
|
||||||
|
|
||||||
|
canvas()->setFrameStyle(QFrame::Box | QFrame::Plain );
|
||||||
|
canvas()->setLineWidth(1);
|
||||||
|
|
||||||
|
for(int i = 0; i < QwtPlot::axisCnt; i++ ){
|
||||||
|
QwtScaleWidget *scaleWidget = (QwtScaleWidget *)axisWidget(i);
|
||||||
|
if(scaleWidget) scaleWidget->setMargin(0);
|
||||||
|
QwtScaleDraw *scaleDraw = (QwtScaleDraw *)axisScaleDraw(i);
|
||||||
|
if(scaleDraw) scaleDraw->enableComponent(QwtAbstractScaleDraw::Backbone, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DPlot::UnknownStuff(){
|
||||||
|
// Disable polygon clipping
|
||||||
|
QwtPainter::setDeviceClipping(false);
|
||||||
|
// We don't need the cache here
|
||||||
|
canvas()->setPaintAttribute(QwtPlotCanvas::PaintCached, false);
|
||||||
|
canvas()->setPaintAttribute(QwtPlotCanvas::PaintPacked, false);
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x040000
|
||||||
|
#ifdef Q_WS_X11
|
||||||
|
// Qt::WA_PaintOnScreen is only supported for X11, but leads
|
||||||
|
// to substantial bugs with Qt 4.2.x/Windows
|
||||||
|
canvas()->setAttribute(Qt::WA_PaintOnScreen, true);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
99
slsDetectorGui/slsDetectorPlotting/src/SlsQt1DZoomer.cxx
Normal file
99
slsDetectorGui/slsDetectorPlotting/src/SlsQt1DZoomer.cxx
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ian Johnson
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <qwt_plot.h>
|
||||||
|
#include <qwt_scale_div.h>
|
||||||
|
|
||||||
|
#include "SlsQt1DPlot.h"
|
||||||
|
#include "SlsQt1DZoomer.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
void SlsQt1DZoomer::ResetZoomBase(){
|
||||||
|
SetZoomBase(x0,y0,x1-x0,y1-y0); //for going between log and nonlog plots
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DZoomer::SetZoomBase(double xmin,double ymin,double x_width, double y_width){
|
||||||
|
if(xIsLog&&xmin<=0){
|
||||||
|
double xmax = xmin+x_width;
|
||||||
|
xmin = firstXgt0*0.98;
|
||||||
|
if(xmax<=xmin) x_width=firstXgt0;
|
||||||
|
else x_width=xmax-xmin;
|
||||||
|
}
|
||||||
|
if(yIsLog&&ymin<=0){
|
||||||
|
double ymax = ymin+y_width;
|
||||||
|
ymin = firstYgt0*0.98;
|
||||||
|
if(ymax<=ymin) y_width=firstYgt0;
|
||||||
|
else y_width=ymax-ymin;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(plot()){
|
||||||
|
if(xIsLog){
|
||||||
|
#if QWT_VERSION < 0x50200
|
||||||
|
float xmin_curr = plot()->axisScaleDiv(QwtPlot::xBottom)->lBound();
|
||||||
|
float xmax_curr = plot()->axisScaleDiv(QwtPlot::xBottom)->hBound();
|
||||||
|
#else
|
||||||
|
float xmin_curr = plot()->axisScaleDiv(QwtPlot::xBottom)->lowerBound();
|
||||||
|
float xmax_curr = plot()->axisScaleDiv(QwtPlot::xBottom)->upperBound();
|
||||||
|
#endif
|
||||||
|
if(xmin_curr<xmin) xmin_curr=xmin;
|
||||||
|
if(xmax_curr>xmin+x_width) xmax_curr=xmin+x_width;
|
||||||
|
plot()->setAxisScale(QwtPlot::xBottom,xmin_curr,xmax_curr);
|
||||||
|
}
|
||||||
|
if(yIsLog){
|
||||||
|
#if QWT_VERSION < 0x50200
|
||||||
|
float ymin_curr = plot()->axisScaleDiv(QwtPlot::yLeft)->lBound();
|
||||||
|
float ymax_curr = plot()->axisScaleDiv(QwtPlot::yLeft)->hBound();
|
||||||
|
#else
|
||||||
|
float ymin_curr = plot()->axisScaleDiv(QwtPlot::yLeft)->lowerBound();
|
||||||
|
float ymax_curr = plot()->axisScaleDiv(QwtPlot::yLeft)->upperBound();
|
||||||
|
#endif
|
||||||
|
if(ymin_curr<ymin) ymin_curr=ymin;
|
||||||
|
if(ymax_curr>ymin+y_width) ymax_curr=ymin+y_width;
|
||||||
|
plot()->setAxisScale(QwtPlot::yLeft,ymin_curr,ymax_curr);
|
||||||
|
}
|
||||||
|
plot()->replot();
|
||||||
|
}
|
||||||
|
|
||||||
|
setZoomBase(QwtDoubleRect(xmin,ymin,x_width,y_width));
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DZoomer::SetZoomBase(SlsQtH1D* h){
|
||||||
|
x0 = h->GetXMin()<0 ? h->GetXMin()*1.02 : h->GetXMin()/1.02;
|
||||||
|
x1 = h->GetXMax()<0 ? h->GetXMax()/1.02 : h->GetXMax()*1.02;
|
||||||
|
y0 = h->GetYMin()<0 ? h->GetYMin()*1.02 : h->GetYMin()/1.02;
|
||||||
|
y1 = h->GetYMax()<0 ? h->GetYMax()/1.02 : h->GetYMax()*1.02;
|
||||||
|
|
||||||
|
firstXgt0 = h->GetFirstXgtZero(); //for log plots
|
||||||
|
firstYgt0 = h->GetFirstYgtZero(); //for log plots
|
||||||
|
|
||||||
|
ResetZoomBase();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt1DZoomer::ExtendZoomBase(SlsQtH1D* h){
|
||||||
|
double h_x0 = h->GetXMin()<0 ? h->GetXMin()*1.02 : h->GetXMin()/1.02;
|
||||||
|
double h_x1 = h->GetXMax()<0 ? h->GetXMax()/1.02 : h->GetXMax()*1.02;
|
||||||
|
double h_y0 = h->GetYMin()<0 ? h->GetYMin()*1.02 : h->GetYMin()/1.02;
|
||||||
|
double h_y1 = h->GetYMax()<0 ? h->GetYMax()/1.02 : h->GetYMax()*1.02;
|
||||||
|
|
||||||
|
if(h_x0<x0) x0 = h_x0;
|
||||||
|
if(h_x1>x1) x1 = h_x1;
|
||||||
|
if(h_y0<y0) y0 = h_y0;
|
||||||
|
if(h_y1>y1) y1 = h_y1;
|
||||||
|
|
||||||
|
if(h->GetFirstXgtZero()<firstXgt0) firstXgt0 = h->GetFirstXgtZero();
|
||||||
|
if(h->GetFirstYgtZero()<firstYgt0) firstYgt0 = h->GetFirstYgtZero();
|
||||||
|
|
||||||
|
// cout<<"extend "<<h_x0<<" "<<h_y0<<" "<<h_x1<<" "<<h_y1<<endl;
|
||||||
|
// cout<<"extend "<<x0<<" "<<y0<<" "<<x1-x0<<" "<<y1-y0<<endl;
|
||||||
|
ResetZoomBase();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
122
slsDetectorGui/slsDetectorPlotting/src/SlsQt2DHist.cxx
Normal file
122
slsDetectorGui/slsDetectorPlotting/src/SlsQt2DHist.cxx
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ian Johnson
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "SlsQt2DHist.h"
|
||||||
|
|
||||||
|
using std::cout;
|
||||||
|
using std::endl;
|
||||||
|
|
||||||
|
SlsQt2DHist::SlsQt2DHist(int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, double* d,double zmin,double zmax):QwtRasterData(){
|
||||||
|
interp=0;
|
||||||
|
nx_array=ny_array=0;data=0;
|
||||||
|
SetData(nbinsx,xmin,xmax,nbinsy,ymin,ymax,d,zmin,zmax);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SlsQt2DHist::~SlsQt2DHist(){if(data) delete data;}
|
||||||
|
|
||||||
|
int SlsQt2DHist::GetBinIndex(int bx, int by){
|
||||||
|
int b = bx*ny+by;
|
||||||
|
if(b<0 || b>=nb){
|
||||||
|
cout<<"GetBinIndex:: Incorrect indicies bx and by returning overflow bin;"<<endl;
|
||||||
|
return nb;
|
||||||
|
}
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SlsQt2DHist::FindBinIndex(double x, double y){
|
||||||
|
return GetBinIndex(int((x-x_min)/x_width),int((y-y_min)/y_width));
|
||||||
|
}
|
||||||
|
|
||||||
|
double SlsQt2DHist::GetBinValue(int bx,int by){
|
||||||
|
return data[GetBinIndex(bx,by)];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SlsQt2DHist::SetBinValue(int bx,int by,double v){
|
||||||
|
z_mean_has_been_calculated = 0;
|
||||||
|
data[GetBinIndex(bx,by)] = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt2DHist::SetData(int nbinsx, double xmin, double xmax, int nbinsy,double ymin, double ymax, double *d,double zmin,double zmax){
|
||||||
|
z_mean_has_been_calculated = 0;
|
||||||
|
if(xmax<xmin||ymax<ymin) cout<<"Warning input range invalid."<<endl;
|
||||||
|
|
||||||
|
x_width = (xmax - xmin)/nbinsx;
|
||||||
|
y_width = (ymax - ymin)/nbinsy;
|
||||||
|
|
||||||
|
if(x_min!=xmin||x_max!=xmax||y_min!=ymin||y_max!=ymax){
|
||||||
|
x_min=xmin;x_max=xmax;
|
||||||
|
y_min=ymin;y_max=ymax;
|
||||||
|
setBoundingRect(QwtDoubleRect(xmin,ymin,x_max-x_min,y_max-y_min));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(nbinsx*nbinsy<1){
|
||||||
|
cout<<"Exitting: SlsQt2DHist::SetData() number of bins must be greater than zero."<<endl;
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(nbinsx*nbinsy>nx_array*ny_array){
|
||||||
|
if(data) delete data;
|
||||||
|
data = new double [nbinsx*nbinsy+1]; //one for under/overflow bin
|
||||||
|
nx_array = nbinsx;
|
||||||
|
ny_array = nbinsy;
|
||||||
|
}
|
||||||
|
nx=nbinsx;
|
||||||
|
ny=nbinsy;
|
||||||
|
nb=nx*ny;
|
||||||
|
data[nb]=0;//set over flow to zero
|
||||||
|
|
||||||
|
if(d){
|
||||||
|
memcpy(data,d,nb*sizeof(double));
|
||||||
|
SetMinMax(zmin,zmax);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt2DHist::SetMinMax(double zmin,double zmax){
|
||||||
|
if(zmin<zmax){
|
||||||
|
z_min=zmin;
|
||||||
|
z_max=zmax;
|
||||||
|
}else{
|
||||||
|
z_mean_has_been_calculated = 1;
|
||||||
|
z_min=data[0];
|
||||||
|
z_mean=0;
|
||||||
|
z_max=data[0];
|
||||||
|
for(int i=0;i<nb;i++){
|
||||||
|
if(data[i]<z_min) z_min=data[i];
|
||||||
|
if(data[i]>z_max) z_max=data[i];
|
||||||
|
z_mean+=data[i];
|
||||||
|
}
|
||||||
|
z_mean/=nb;
|
||||||
|
if(z_min>0) z_min/=1.02; else z_min*=1.02;
|
||||||
|
if(z_max>0) z_max*=1.02; else z_max/=1.02;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
double SlsQt2DHist::GetMean(){
|
||||||
|
if(!z_mean_has_been_calculated){
|
||||||
|
z_mean_has_been_calculated = 1;
|
||||||
|
z_mean=0;
|
||||||
|
for(int i=0;i<nb;i++) z_mean+=data[i];
|
||||||
|
z_mean/=nb;
|
||||||
|
}
|
||||||
|
|
||||||
|
return z_mean;
|
||||||
|
}
|
||||||
|
|
||||||
|
double SlsQt2DHist::SetMinimumToFirstGreaterThanZero(){
|
||||||
|
z_min=abs(z_max)+1;
|
||||||
|
for(int i=0;i<nb;i++){
|
||||||
|
if(data[i]>0&&data[i]<z_min) z_min=data[i];
|
||||||
|
}
|
||||||
|
return z_min;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
213
slsDetectorGui/slsDetectorPlotting/src/SlsQt2DPlot.cxx
Normal file
213
slsDetectorGui/slsDetectorPlotting/src/SlsQt2DPlot.cxx
Normal file
@ -0,0 +1,213 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ian Johnson
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <qprinter.h>
|
||||||
|
#include <qtoolbutton.h>
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x040000
|
||||||
|
#include <qprintdialog.h>
|
||||||
|
#endif
|
||||||
|
#include <qwt_color_map.h>
|
||||||
|
#include <qwt_plot_spectrogram.h>
|
||||||
|
#include <qwt_scale_widget.h>
|
||||||
|
#include <qwt_scale_draw.h>
|
||||||
|
#include <qwt_plot_zoomer.h>
|
||||||
|
#include <qwt_plot_panner.h>
|
||||||
|
#include <qwt_plot_layout.h>
|
||||||
|
#include <qwt_scale_engine.h>
|
||||||
|
|
||||||
|
#include "SlsQt2DPlot.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
SlsQt2DPlot::SlsQt2DPlot(QWidget *parent):QwtPlot(parent){
|
||||||
|
|
||||||
|
axisScaleEngine(QwtPlot::yLeft)->setAttribute(QwtScaleEngine::Floating);
|
||||||
|
axisScaleEngine(QwtPlot::xBottom)->setAttribute(QwtScaleEngine::Floating);
|
||||||
|
|
||||||
|
d_spectrogram = new QwtPlotSpectrogram();
|
||||||
|
|
||||||
|
hist = new SlsQt2DHist();
|
||||||
|
|
||||||
|
SetupZoom();
|
||||||
|
SetupColorMap();
|
||||||
|
|
||||||
|
d_spectrogram->setData(*hist);
|
||||||
|
d_spectrogram->attach(this);
|
||||||
|
|
||||||
|
plotLayout()->setAlignCanvasToScales(true);
|
||||||
|
|
||||||
|
FillTestPlot();
|
||||||
|
Update();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SlsQt2DPlot::SetupColorMap(){
|
||||||
|
|
||||||
|
colorMapLinearScale = new QwtLinearColorMap(Qt::darkCyan, Qt::red);
|
||||||
|
colorMapLinearScale->addColorStop(0.1, Qt::cyan);
|
||||||
|
colorMapLinearScale->addColorStop(0.4, Qt::blue);
|
||||||
|
colorMapLinearScale->addColorStop(0.6, Qt::green);
|
||||||
|
colorMapLinearScale->addColorStop(0.95, Qt::yellow);
|
||||||
|
d_spectrogram->setColorMap(*colorMapLinearScale);
|
||||||
|
|
||||||
|
|
||||||
|
colorMapLogScale = new QwtLinearColorMap(Qt::darkCyan, Qt::red);
|
||||||
|
colorMapLogScale->addColorStop((pow(10,2*0.10)-1)/99.0, Qt::cyan); //linear scale goes from 0 to 2 and log scale goes from 1 to 100
|
||||||
|
colorMapLogScale->addColorStop((pow(10,2*0.40)-1)/99.0,Qt::blue);
|
||||||
|
colorMapLogScale->addColorStop((pow(10,2*0.60)-1)/99.0,Qt::green);
|
||||||
|
colorMapLogScale->addColorStop((pow(10,2*0.95)-1)/99.0,Qt::yellow);
|
||||||
|
|
||||||
|
contourLevelsLinear = new QwtValueList();
|
||||||
|
for(double level=0.5;level<10.0;level+=1.0 ) (*contourLevelsLinear) += level;
|
||||||
|
d_spectrogram->setContourLevels(*contourLevelsLinear);
|
||||||
|
contourLevelsLog = new QwtValueList();
|
||||||
|
for(double level=0.5;level<10.0;level+=1.0 ) (*contourLevelsLog) += (pow(10,2*level/10.0)-1)/99.0 * 10;
|
||||||
|
|
||||||
|
|
||||||
|
// A color bar on the right axis
|
||||||
|
rightAxis = axisWidget(QwtPlot::yRight);
|
||||||
|
rightAxis->setTitle("Intensity");
|
||||||
|
rightAxis->setColorBarEnabled(true);
|
||||||
|
enableAxis(QwtPlot::yRight);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt2DPlot::FillTestPlot(int mode){
|
||||||
|
static int nx = 50;
|
||||||
|
static int ny = 50;
|
||||||
|
static double *the_data=0;
|
||||||
|
if(the_data==0) the_data = new double [nx*ny];
|
||||||
|
|
||||||
|
double dmax = sqrt(pow(nx/2.0-0.5,2) + pow(ny/2.0-0.5,2));
|
||||||
|
for(int i=0;i<nx;i++){
|
||||||
|
for(int j=0;j<ny;j++){
|
||||||
|
double d = sqrt(pow(nx/2.0-(i+0.5),2) + pow(ny/2.0-(j+0.5),2));
|
||||||
|
|
||||||
|
if(mode%3) the_data[i+j*nx] = 10*d/dmax;
|
||||||
|
else the_data[i+j*nx] = 10*(1-d/dmax);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
hist->SetData(nx,200,822,ny,-0.5,ny-0.5,the_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt2DPlot::SetupZoom(){
|
||||||
|
// LeftButton for the zooming
|
||||||
|
// MidButton for the panning
|
||||||
|
// RightButton: zoom out by 1
|
||||||
|
// Ctrl+RighButton: zoom out to full size
|
||||||
|
|
||||||
|
zoomer = new SlsQt2DZoomer(canvas());
|
||||||
|
zoomer->SetHist(hist);
|
||||||
|
|
||||||
|
#if QT_VERSION < 0x040000
|
||||||
|
zoomer->setMousePattern(QwtEventPattern::MouseSelect2,Qt::RightButton, Qt::ControlButton);
|
||||||
|
#else
|
||||||
|
zoomer->setMousePattern(QwtEventPattern::MouseSelect2,Qt::RightButton, Qt::ControlModifier);
|
||||||
|
#endif
|
||||||
|
zoomer->setMousePattern(QwtEventPattern::MouseSelect3,Qt::RightButton);
|
||||||
|
|
||||||
|
panner = new QwtPlotPanner(canvas());
|
||||||
|
panner->setAxisEnabled(QwtPlot::yRight, false);
|
||||||
|
panner->setMouseButton(Qt::MidButton);
|
||||||
|
|
||||||
|
// Avoid jumping when labels with more/less digits
|
||||||
|
// appear/disappear when scrolling vertically
|
||||||
|
|
||||||
|
const QFontMetrics fm(axisWidget(QwtPlot::yLeft)->font());
|
||||||
|
QwtScaleDraw *sd = axisScaleDraw(QwtPlot::yLeft);
|
||||||
|
sd->setMinimumExtent( fm.width("100.00") );
|
||||||
|
|
||||||
|
const QColor c(Qt::darkBlue);
|
||||||
|
zoomer->setRubberBandPen(c);
|
||||||
|
zoomer->setTrackerPen(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt2DPlot::UnZoom(){
|
||||||
|
|
||||||
|
zoomer->setZoomBase(QwtDoubleRect(hist->GetXMin(),hist->GetYMin(),hist->GetXMax()-hist->GetXMin(),hist->GetYMax()-hist->GetYMin()));
|
||||||
|
|
||||||
|
zoomer->setZoomBase();//Call replot for the attached plot before initializing the zoomer with its scales.
|
||||||
|
// zoomer->zoom(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt2DPlot::SetZoom(double xmin,double ymin,double x_width,double y_width){
|
||||||
|
zoomer->setZoomBase(QwtDoubleRect(xmin,ymin,x_width,y_width));
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt2DPlot::SetZMinMax(double zmin,double zmax){
|
||||||
|
hist->SetMinMax(zmin,zmax);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SlsQt2DPlot::Update(){
|
||||||
|
rightAxis->setColorMap(d_spectrogram->data().range(),d_spectrogram->colorMap());
|
||||||
|
if(!zoomer->zoomRectIndex()) UnZoom();
|
||||||
|
setAxisScale(QwtPlot::yRight,d_spectrogram->data().range().minValue(),
|
||||||
|
d_spectrogram->data().range().maxValue());
|
||||||
|
replot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void SlsQt2DPlot::showContour(bool on){
|
||||||
|
d_spectrogram->setDisplayMode(QwtPlotSpectrogram::ContourMode,on);
|
||||||
|
Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt2DPlot::showSpectrogram(bool on){
|
||||||
|
// static int io=0;
|
||||||
|
// FillTestPlot(io++);
|
||||||
|
d_spectrogram->setDisplayMode(QwtPlotSpectrogram::ImageMode, on);
|
||||||
|
d_spectrogram->setDefaultContourPen(on ? QPen() : QPen(Qt::NoPen));
|
||||||
|
Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt2DPlot::InterpolatedPlot(bool on){
|
||||||
|
hist->Interpolate(on);
|
||||||
|
Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SlsQt2DPlot::LogZ(bool on){
|
||||||
|
if(on){
|
||||||
|
//if(hist->GetMinimum()<=0) hist->SetMinimumToFirstGreaterThanZero();
|
||||||
|
d_spectrogram->setColorMap(*colorMapLogScale);
|
||||||
|
setAxisScaleEngine(QwtPlot::yRight,new QwtLog10ScaleEngine);
|
||||||
|
d_spectrogram->setContourLevels(*contourLevelsLog);
|
||||||
|
}else{
|
||||||
|
d_spectrogram->setColorMap(*colorMapLinearScale);
|
||||||
|
setAxisScaleEngine(QwtPlot::yRight,new QwtLinearScaleEngine);
|
||||||
|
d_spectrogram->setContourLevels(*contourLevelsLinear);
|
||||||
|
}
|
||||||
|
Update();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
void SlsQt2DPlot::printPlot(){
|
||||||
|
QPrinter printer;
|
||||||
|
printer.setOrientation(QPrinter::Landscape);
|
||||||
|
#if QT_VERSION < 0x040000
|
||||||
|
printer.setColorMode(QPrinter::Color);
|
||||||
|
printer.setOutputFileName("spectrogram.ps");
|
||||||
|
if (printer.setup())
|
||||||
|
#else
|
||||||
|
printer.setOutputFileName("spectrogram.pdf");
|
||||||
|
QPrintDialog dialog(&printer);
|
||||||
|
if ( dialog.exec() )
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
print(printer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
212
slsDetectorGui/slsDetectorPlotting/src/SlsQt2DPlotLayout.cxx
Normal file
212
slsDetectorGui/slsDetectorPlotting/src/SlsQt2DPlotLayout.cxx
Normal file
@ -0,0 +1,212 @@
|
|||||||
|
/**
|
||||||
|
* @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
|
||||||
|
* @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->SetNDecimalsOfDoubleValidators(2);
|
||||||
|
z_range_ne->setFixedWidth(402);
|
||||||
|
z_range_ne->hide();
|
||||||
|
|
||||||
|
logsChecked = false;
|
||||||
|
|
||||||
|
Layout();
|
||||||
|
ConnectSignalsAndSlots();
|
||||||
|
}
|
||||||
|
|
||||||
|
SlsQt2DPlotLayout::~SlsQt2DPlotLayout(){
|
||||||
|
|
||||||
|
if(the_layout) delete the_layout;
|
||||||
|
|
||||||
|
|
||||||
|
delete the_plot;
|
||||||
|
delete z_range_ne;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SlsQt2DPlotLayout::Layout(){
|
||||||
|
if(the_layout) delete the_layout;
|
||||||
|
the_layout = new QGridLayout(this);
|
||||||
|
the_layout->addWidget(the_plot,2,1,3,3);
|
||||||
|
the_layout->addWidget(z_range_ne,5,1,1,3);
|
||||||
|
|
||||||
|
the_layout->setMargin(12);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQt2DPlotLayout::ConnectSignalsAndSlots(){
|
||||||
|
connect(this, SIGNAL(InterpolateSignal(bool)), the_plot, SLOT(InterpolatedPlot(bool)));
|
||||||
|
connect(this, SIGNAL(ContourSignal(bool)), the_plot, SLOT(showContour(bool)));
|
||||||
|
connect(z_range_ne, SIGNAL(CheckBoxChanged(bool)), this, SLOT(ResetRange()));
|
||||||
|
connect(z_range_ne, SIGNAL(AValueChanged(SlsQtNumberEntry*)), this, SLOT(ResetRange()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
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(logsChecked) 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){
|
||||||
|
logsChecked=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);
|
||||||
|
}
|
||||||
|
|
506
slsDetectorGui/slsDetectorPlotting/src/SlsQtNumberEntry.cxx
Normal file
506
slsDetectorGui/slsDetectorPlotting/src/SlsQtNumberEntry.cxx
Normal file
@ -0,0 +1,506 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ian Johnson
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#include <qapplication.h>
|
||||||
|
#include <qmessagebox.h>
|
||||||
|
#include <qinputdialog.h>
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qpixmap.h>
|
||||||
|
#include <qcombobox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qcheckbox.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
|
||||||
|
#include <qvalidator.h>
|
||||||
|
|
||||||
|
#include "SlsQtNumberEntry.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
SlsQtNumberEntry::SlsQtNumberEntry(QWidget *parent, int with_checkbox, char *start_string, int num_type, char* middle_string, int num2_type, int n_units, char** units, double* unit_factors,char* end_string):QWidget(parent){
|
||||||
|
SetupNumberEntry(with_checkbox,start_string,num_type,middle_string,num2_type,n_units,units,unit_factors,end_string);
|
||||||
|
}
|
||||||
|
|
||||||
|
//without unit drop box
|
||||||
|
SlsQtNumberEntry::SlsQtNumberEntry(QWidget *parent,int with_checkbox, char *start_string, int num_type, char* middle_string, int num2_type,char* end_string):QWidget(parent){
|
||||||
|
SetupNumberEntry(with_checkbox,start_string,num_type,middle_string,num2_type,0,0,0,end_string);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::SetupNumberEntry(int with_checkbox, char *start_string, int num_type, char* middle_string, int num2_type, int n_units, char** units, double* unit_factors,char* end_string){
|
||||||
|
|
||||||
|
layout = 0;
|
||||||
|
|
||||||
|
check_box = 0;
|
||||||
|
front_text = 0;
|
||||||
|
num_field[0] = 0;
|
||||||
|
spin_box[0] = 0;
|
||||||
|
validator_int[0] = 0;
|
||||||
|
validator_double[0] = 0;
|
||||||
|
middle_text = 0;
|
||||||
|
num_field[1] = 0;
|
||||||
|
spin_box[1] = 0;
|
||||||
|
validator_int[1] = 0;
|
||||||
|
validator_double[1] = 0;
|
||||||
|
unit_cbb = 0;
|
||||||
|
factors = 0;
|
||||||
|
back_text = 0;
|
||||||
|
if(with_checkbox) AddCheckBox();
|
||||||
|
SetFrontText(start_string);
|
||||||
|
|
||||||
|
SetupNumberField(num_type,0);
|
||||||
|
SetMiddleText(middle_string);
|
||||||
|
SetupNumberField(num2_type,1);
|
||||||
|
SetUnits(n_units,units,unit_factors);
|
||||||
|
SetBackText(end_string);
|
||||||
|
|
||||||
|
SetLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SlsQtNumberEntry::~SlsQtNumberEntry(){
|
||||||
|
|
||||||
|
if(check_box) delete check_box;
|
||||||
|
if(front_text) delete front_text;
|
||||||
|
if(middle_text) delete middle_text;
|
||||||
|
if(validator_int[0]) delete validator_int[0];
|
||||||
|
if(validator_double[0]) delete validator_double[0];
|
||||||
|
if(num_field[0]) delete num_field[0];
|
||||||
|
if(spin_box[0]) delete spin_box[0];
|
||||||
|
if(validator_int[1]) delete validator_int[1];
|
||||||
|
if(validator_double[1]) delete validator_double[1];
|
||||||
|
if(num_field[1]) delete num_field[1];
|
||||||
|
if(spin_box[1]) delete spin_box[1];
|
||||||
|
if(unit_cbb) delete unit_cbb;
|
||||||
|
if(factors) delete factors;
|
||||||
|
if(back_text) delete back_text;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::AddCheckBox(){
|
||||||
|
if(check_box) delete check_box;
|
||||||
|
check_box = new QCheckBox(this);
|
||||||
|
connect(check_box,SIGNAL(clicked()),this,SLOT(CheckBoxClicked()));
|
||||||
|
SetLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::SetFrontText(char* s) {SetText(s,&front_text); SetLayout();}
|
||||||
|
void SlsQtNumberEntry::SetMiddleText(char* s) {SetText(s,&middle_text); SetLayout();}
|
||||||
|
void SlsQtNumberEntry::SetBackText(char* s) {SetText(s,&back_text); SetLayout();};
|
||||||
|
void SlsQtNumberEntry::SetText(char* s, QLabel** pp){
|
||||||
|
if(*pp){delete *pp; *pp=0;}
|
||||||
|
if(s){
|
||||||
|
*pp = new QLabel(this);
|
||||||
|
(*pp)->setText(s);
|
||||||
|
}
|
||||||
|
SetLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::SetupNumberField(int type, int which_number_field){
|
||||||
|
int i = (which_number_field<0||which_number_field>1) ? 0:which_number_field;
|
||||||
|
|
||||||
|
num_field_enabled[i]=1;
|
||||||
|
if(spin_box[i]) { delete spin_box[i]; spin_box[i]=0;}
|
||||||
|
if(validator_int[i]) { delete validator_int[i]; validator_int[i]=0;}
|
||||||
|
if(validator_double[i]) { delete validator_double[i]; validator_double[i]=0;}
|
||||||
|
if(num_field[i]) { delete num_field[i]; num_field[i]=0;}
|
||||||
|
|
||||||
|
if(type>0&&type<3){
|
||||||
|
num_field[i] = new QLineEdit(this);
|
||||||
|
num_field[i]->setAlignment(Qt::AlignRight);
|
||||||
|
SetMinimumNumberWidth(3,i);
|
||||||
|
if(type==1){
|
||||||
|
validator_int[i] = new SlsQtIntValidator(num_field[i]);
|
||||||
|
num_field[i]->setValidator(validator_int[i]);
|
||||||
|
SetNumber(0,i);
|
||||||
|
}else{
|
||||||
|
validator_double[i] = new SlsQtDoubleValidator(num_field[i]);
|
||||||
|
num_field[i]->setValidator(validator_double[i]);
|
||||||
|
//default settings
|
||||||
|
SetNDecimalsOfDoubleValidator(3,i); //defalut value
|
||||||
|
SetNumber(0,i);
|
||||||
|
}
|
||||||
|
|
||||||
|
num_field[i]->setAlignment(Qt::AlignRight);
|
||||||
|
|
||||||
|
if(i==0){
|
||||||
|
connect(num_field[i],SIGNAL(lostFocus()),this,SLOT(RefreshFirstNumberEntry()));
|
||||||
|
connect(num_field[i],SIGNAL(returnPressed()),this,SLOT(FirstValueEntered()));
|
||||||
|
connect(num_field[i],SIGNAL(lostFocus()),this,SLOT(FirstValueEntered()));
|
||||||
|
}else{
|
||||||
|
connect(num_field[i],SIGNAL(lostFocus()),this,SLOT(RefreshSecondNumberEntry()));
|
||||||
|
connect(num_field[i],SIGNAL(returnPressed()),this,SLOT(SecondValueEntered()));
|
||||||
|
connect(num_field[i],SIGNAL(lostFocus()),this,SLOT(SecondValueEntered()));
|
||||||
|
}
|
||||||
|
}else if(type==3){
|
||||||
|
spin_box[i] = new QSpinBox();
|
||||||
|
if(i==0) connect(spin_box[i],SIGNAL(editingFinished()),this,SLOT(FirstValueEntered()));
|
||||||
|
else connect(spin_box[i],SIGNAL(editingFinished()),this,SLOT(SecondValueEntered()));
|
||||||
|
spin_box[i]->setAlignment(Qt::AlignRight);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::SetUnits(int n_units, char** units, double* unit_factors){
|
||||||
|
if(unit_cbb){ delete unit_cbb; unit_cbb=0;}
|
||||||
|
if(factors) { delete factors; factors=0;}
|
||||||
|
|
||||||
|
if(n_units>0&&units&&unit_factors){
|
||||||
|
unit_cbb = new QComboBox(this);
|
||||||
|
factors = new double [n_units];
|
||||||
|
|
||||||
|
for(int i=0;i<n_units;i++){
|
||||||
|
unit_cbb->insertItem(i,units[i]);
|
||||||
|
factors[i] = unit_factors[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
connect(unit_cbb,SIGNAL(activated(int)),this,SLOT(UnitSelected()));
|
||||||
|
}
|
||||||
|
|
||||||
|
SetLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::SetLayout(){
|
||||||
|
if(layout) delete layout;
|
||||||
|
layout = new QGridLayout(this);
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
if(check_box) layout->addWidget(check_box,1,i++);
|
||||||
|
if(front_text) layout->addWidget(front_text,1,i++);
|
||||||
|
if(num_field[0]) layout->addWidget(num_field[0],1,i++);
|
||||||
|
if(spin_box[0]) layout->addWidget(spin_box[0],1,i++);
|
||||||
|
if(middle_text) layout->addWidget(middle_text,1,i++);
|
||||||
|
if(num_field[1]) layout->addWidget(num_field[1],1,i++);
|
||||||
|
if(spin_box[1]) layout->addWidget(spin_box[1],1,i++);
|
||||||
|
if(unit_cbb) layout->addWidget(unit_cbb,1,i++);
|
||||||
|
if(back_text) layout->addWidget(back_text,1,i++);
|
||||||
|
|
||||||
|
CheckBoxClicked();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::SetMinimumNumberWidth(int nchar_width,int which_number_field){
|
||||||
|
if(num_field[which_number_field]) num_field[which_number_field]
|
||||||
|
->setMinimumWidth(nchar_width*num_field[which_number_field]->minimumSizeHint().width());
|
||||||
|
if(spin_box[which_number_field]) spin_box[which_number_field]
|
||||||
|
->setMinimumWidth(nchar_width*spin_box[which_number_field]->minimumSizeHint().width());
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::SetNDecimalsOfDoubleValidators(int ndecimals){
|
||||||
|
SetNDecimalsOfDoubleValidator(ndecimals,0);
|
||||||
|
SetNDecimalsOfDoubleValidator(ndecimals,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::SetNDecimalsOfDoubleValidator(int ndecimals, int which_number_field){
|
||||||
|
//0 -> standard, 1->scientific
|
||||||
|
int i = (which_number_field<0||which_number_field>1) ? 0:which_number_field;
|
||||||
|
if(validator_double[i]){
|
||||||
|
validator_double[i]->setDecimals(ndecimals);
|
||||||
|
SetNumber(GetNumber(i),i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::SetMinimumUnitWidth(int nchar_width){
|
||||||
|
if(unit_cbb) unit_cbb->setMinimumWidth(nchar_width*unit_cbb->minimumSizeHint().width());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
double SlsQtNumberEntry::SetNumber(int v,int which_number_field){
|
||||||
|
int i = (which_number_field<0||which_number_field>1) ? 0:which_number_field;
|
||||||
|
|
||||||
|
if(num_field[i]){
|
||||||
|
if(validator_int[i]){
|
||||||
|
QString s = QString::number(v);
|
||||||
|
validator_int[i]->fixup(s);
|
||||||
|
num_field[i]->setText(s);
|
||||||
|
}
|
||||||
|
if(validator_double[i]){
|
||||||
|
QString s = QString::number(v);
|
||||||
|
validator_double[i]->fixup(s);
|
||||||
|
num_field[i]->setText(s);
|
||||||
|
}
|
||||||
|
}else if(spin_box[i]){
|
||||||
|
spin_box[i]->setValue(v);
|
||||||
|
}else return 0;
|
||||||
|
|
||||||
|
return GetNumber(i);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
double SlsQtNumberEntry::SetNumber(double v,int which_number_field){
|
||||||
|
int i = (which_number_field<0||which_number_field>1) ? 0:which_number_field;
|
||||||
|
|
||||||
|
if(num_field[i]){
|
||||||
|
if(validator_int[i]){
|
||||||
|
QString s = QString::number(v);
|
||||||
|
validator_int[i]->fixup(s);
|
||||||
|
num_field[i]->setText(s);
|
||||||
|
}
|
||||||
|
if(validator_double[i]){
|
||||||
|
QString s = QString::number(v);
|
||||||
|
validator_double[i]->fixup(s);
|
||||||
|
num_field[i]->setText(s);
|
||||||
|
}
|
||||||
|
}else if(spin_box[i]){
|
||||||
|
spin_box[i]->setValue(round(v));
|
||||||
|
}else return 0;
|
||||||
|
|
||||||
|
return GetNumber(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::SetRange(int min, int max,int which_number_field){
|
||||||
|
int i = (which_number_field<0||which_number_field>1) ? 0:which_number_field;
|
||||||
|
if(min>max){
|
||||||
|
cout<<"Waring: SetRange(int,int) no effect min > max"<<endl;
|
||||||
|
}else{
|
||||||
|
if(validator_int[i]) validator_int[i]->setRange(min,max);
|
||||||
|
if(validator_double[i]) validator_double[i]->setRange(min,max,validator_double[i]->decimals());
|
||||||
|
if(spin_box[i]) spin_box[i]->setRange(min,max);
|
||||||
|
SetNumber(GetNumber(i),i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::SetRange(double min, double max,int which_number_field){
|
||||||
|
int i = (which_number_field<0||which_number_field>1) ? 0:which_number_field;
|
||||||
|
if(min>max){
|
||||||
|
cout<<"Waring: SetRange(double,double) no effect min >= max"<<endl;
|
||||||
|
}else{
|
||||||
|
if(validator_int[i]) cout<<"Waring can not call SetRange(double,double) with \"int\" type Validator"<<endl;
|
||||||
|
if(validator_double[i]) validator_double[i]->setRange(min,max,validator_double[i]->decimals());
|
||||||
|
if(spin_box[i]) spin_box[i]->setRange(min,max);
|
||||||
|
SetNumber(GetNumber(i),i);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SlsQtNumberEntry::CheckBoxState(){
|
||||||
|
if(check_box&&check_box->checkState()) return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::CheckBoxClicked(){
|
||||||
|
if(check_box){
|
||||||
|
if(check_box->checkState()) Enable();
|
||||||
|
else Disable();
|
||||||
|
|
||||||
|
emit CheckBoxChanged(check_box->checkState());
|
||||||
|
emit CheckBoxChanged(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::Disable(){ Enable(0); }
|
||||||
|
void SlsQtNumberEntry::Enable(bool en_flag){
|
||||||
|
if(check_box) check_box->setChecked(en_flag);
|
||||||
|
if(front_text) front_text->setEnabled(en_flag);
|
||||||
|
if(num_field[0]) num_field[0]->setEnabled(en_flag&&num_field_enabled[0]);
|
||||||
|
if(spin_box[0]) spin_box[0]->setEnabled(en_flag&&num_field_enabled[0]);
|
||||||
|
if(middle_text) middle_text->setEnabled(en_flag);
|
||||||
|
if(num_field[1]) num_field[1]->setEnabled(en_flag&&num_field_enabled[1]);
|
||||||
|
if(spin_box[1]) spin_box[1]->setEnabled(en_flag&&num_field_enabled[1]);
|
||||||
|
if(unit_cbb) unit_cbb->setEnabled(en_flag);
|
||||||
|
if(back_text) back_text->setEnabled(en_flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::DisableNumberField(int which_number_field){ EnableNumberField(which_number_field,0); }
|
||||||
|
void SlsQtNumberEntry::EnableNumberField(int which_number_field,bool en_flag){
|
||||||
|
if(which_number_field>=0||which_number_field<=1){
|
||||||
|
num_field_enabled[which_number_field]=en_flag;
|
||||||
|
if(num_field[which_number_field]) num_field[which_number_field]->setEnabled(num_field_enabled[which_number_field]);
|
||||||
|
if(spin_box[which_number_field]) spin_box[which_number_field]->setEnabled(num_field_enabled[which_number_field]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::UnitSelected(){
|
||||||
|
emit UnitChanged(GetComboBoxValue());
|
||||||
|
emit UnitChanged(this);
|
||||||
|
emit AValueChanged(this);
|
||||||
|
emit FirstValueChanged(GetValueInt(0));
|
||||||
|
emit FirstValueChanged(GetValue(0));
|
||||||
|
emit FirstValueChanged(this);
|
||||||
|
emit SecondValueChanged(GetValueInt(1));
|
||||||
|
emit SecondValueChanged(GetValue(1));
|
||||||
|
emit SecondValueChanged(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::RefreshFirstNumberEntry() { RefreshNumberEntery(0);}
|
||||||
|
void SlsQtNumberEntry::RefreshSecondNumberEntry() { RefreshNumberEntery(1);}
|
||||||
|
void SlsQtNumberEntry::RefreshNumberEntery(int which_number_field){
|
||||||
|
//does not apply to spin boxes
|
||||||
|
if(num_field[which_number_field]){
|
||||||
|
SetNumber(GetNumber(which_number_field),which_number_field);
|
||||||
|
}
|
||||||
|
//refreshes the entery in a general format for ints and fixes doubles,
|
||||||
|
//for example removes leading zeros
|
||||||
|
//However, also moves curser position
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::FirstValueEntered(){
|
||||||
|
emit AValueChanged(this);
|
||||||
|
emit FirstValueChanged(GetValue(0));
|
||||||
|
emit FirstValueChanged(GetValueInt(0));
|
||||||
|
emit FirstValueChanged(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::SecondValueEntered(){
|
||||||
|
emit AValueChanged(this);
|
||||||
|
emit SecondValueChanged(GetValue(1));
|
||||||
|
emit SecondValueChanged(GetValueInt(1));
|
||||||
|
emit SecondValueChanged(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SlsQtNumberEntry::Enabled(){
|
||||||
|
if(check_box && !check_box->checkState()) return 0;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SlsQtNumberEntry::IsValueOk(int which_number_field){
|
||||||
|
int i = (which_number_field<0||which_number_field>1) ? 0:which_number_field;
|
||||||
|
|
||||||
|
bool ok=0;
|
||||||
|
if(validator_int[i]) num_field[i]->text().toInt(&ok);
|
||||||
|
if(validator_double[i]) num_field[i]->text().toDouble(&ok);
|
||||||
|
if(spin_box[i]) ok=true;
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* SlsQtNumberEntry::GetFrontText(){
|
||||||
|
if(front_text) return front_text->text().toStdString().c_str();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
const char* SlsQtNumberEntry::GetMiddleText(){
|
||||||
|
if(middle_text) return middle_text->text().toStdString().c_str();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
const char* SlsQtNumberEntry::GetBackText(){
|
||||||
|
if(back_text) back_text->text().toStdString().c_str();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SlsQtNumberEntry::GetNumberInt(int which_number_field,bool* ok){
|
||||||
|
return round(GetNumber(which_number_field,ok));
|
||||||
|
}
|
||||||
|
|
||||||
|
double SlsQtNumberEntry::GetNumber(int which_number_field,bool* ok){
|
||||||
|
int i = (which_number_field<0||which_number_field>1) ? 0:which_number_field;
|
||||||
|
|
||||||
|
if(ok) *ok = 1;
|
||||||
|
|
||||||
|
if(num_field[i]){
|
||||||
|
if(validator_int[i]) return num_field[i]->text().toInt(ok);
|
||||||
|
else return num_field[i]->text().toDouble(ok);
|
||||||
|
}
|
||||||
|
else if(spin_box[i]) return spin_box[i]->value();
|
||||||
|
else {if(ok) *ok=0;}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
double SlsQtNumberEntry::SetValue(double v,int which_number_field){
|
||||||
|
if(unit_cbb) SetNumber(round(v/GetComboBoxValue()),which_number_field);
|
||||||
|
else SetNumber(v,which_number_field);
|
||||||
|
|
||||||
|
return GetValue(which_number_field);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SlsQtNumberEntry::GetValueInt(int which_number_field,bool* ok){
|
||||||
|
return round(GetValue(which_number_field,ok));
|
||||||
|
}
|
||||||
|
|
||||||
|
double SlsQtNumberEntry::GetValue(int which_number_field,bool* ok){
|
||||||
|
int i = (which_number_field<0||which_number_field>1) ? 0:which_number_field;
|
||||||
|
|
||||||
|
double v;
|
||||||
|
if(ok) *ok = 1;
|
||||||
|
|
||||||
|
if(num_field[i]){
|
||||||
|
if(validator_int[i]) v = num_field[i]->text().toInt(ok);
|
||||||
|
else v = num_field[i]->text().toDouble(ok);
|
||||||
|
}
|
||||||
|
else if(spin_box[i]) v = spin_box[i]->value();
|
||||||
|
else v = 1; //incase there is only a unit pulldown
|
||||||
|
|
||||||
|
|
||||||
|
if(unit_cbb) v *= GetComboBoxValue();
|
||||||
|
|
||||||
|
if(!num_field[i]&&!spin_box[i]&&!unit_cbb){v=0; if(ok) *ok=0;}
|
||||||
|
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SlsQtNumberEntry::SetComboBoxIndex(int index){
|
||||||
|
if(unit_cbb){
|
||||||
|
if(index<0||index>=unit_cbb->count()){
|
||||||
|
cout<<"usage error : can not set combo box index, index out of range."<<endl;
|
||||||
|
}else{
|
||||||
|
unit_cbb->setCurrentIndex(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else cout<<"usage error : can not set combo box index, no combo box."<<endl;
|
||||||
|
|
||||||
|
return GetComboBoxIndex();
|
||||||
|
}
|
||||||
|
|
||||||
|
int SlsQtNumberEntry::GetComboBoxIndex(){
|
||||||
|
if(unit_cbb) return unit_cbb->currentIndex();
|
||||||
|
|
||||||
|
cout<<"usage error : can not get combo box index, no combo box."<<endl;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
double SlsQtNumberEntry::GetComboBoxValue(){
|
||||||
|
if(unit_cbb) return factors[unit_cbb->currentIndex()];
|
||||||
|
|
||||||
|
cout<<"usage error : can not get combo box value, no combo box."<<endl;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SlsQtNumberEntry::PrintTheValue(){
|
||||||
|
|
||||||
|
cout<<endl<<endl<<"Printing value:"<<endl;
|
||||||
|
|
||||||
|
int n_not_printed = 0;
|
||||||
|
if(validator_int[0])
|
||||||
|
cout<<"The interger value has been changed to: "<<GetValue(0)<<endl;
|
||||||
|
else if(validator_double[0])
|
||||||
|
cout<<"The double value has been changed to: "<<GetValue(0)<<endl;
|
||||||
|
else n_not_printed++;
|
||||||
|
|
||||||
|
if(validator_int[1])
|
||||||
|
cout<<"and the integer value of the second field is: "<<GetValue(1)<<endl;
|
||||||
|
else if(validator_double[1])
|
||||||
|
cout<<"and the double value of the second field is: "<<GetValue(1)<<endl;
|
||||||
|
else n_not_printed++;
|
||||||
|
|
||||||
|
if(unit_cbb){
|
||||||
|
cout<<"ComboBox Status: "<<"Index: index = "<<GetComboBoxIndex()<<", v = "<<GetComboBoxValue()<<endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(n_not_printed==2) cout<<"The value of the unit box is: "<<GetValue()<<endl;
|
||||||
|
|
||||||
|
}
|
56
slsDetectorGui/src/qCloneWidget.cpp
Normal file
56
slsDetectorGui/src/qCloneWidget.cpp
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* qCloneWidget.cpp
|
||||||
|
*
|
||||||
|
* Created on: May 18, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** Qt Project Class Headers */
|
||||||
|
#include "qCloneWidget.h"
|
||||||
|
#include "SlsQt1DPlot.h"
|
||||||
|
#include "SlsQt2DPlotLayout.h"
|
||||||
|
/** Qt Include Headers */
|
||||||
|
#include <QFrame>
|
||||||
|
#include <QGridLayout>
|
||||||
|
#include <QGroupBox>
|
||||||
|
|
||||||
|
/** C++ Include Headers */
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
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){
|
||||||
|
|
||||||
|
QGroupBox *cloneBox = new QGroupBox(this);
|
||||||
|
QGridLayout *gridClone = new QGridLayout(cloneBox);
|
||||||
|
cloneBox->setLayout(gridClone);
|
||||||
|
cloneBox->setFlat(1);
|
||||||
|
cloneBox->setTitle("Startup Image");
|
||||||
|
cloneBox->resize(fSize);
|
||||||
|
|
||||||
|
if(numDim==1){
|
||||||
|
cloneplot1D = plot1D;
|
||||||
|
gridClone->addWidget(cloneplot1D,0,0);
|
||||||
|
}else{
|
||||||
|
cloneplot2D = plot2D;
|
||||||
|
gridClone->addWidget(cloneplot2D,0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
qCloneWidget::~qCloneWidget(){
|
||||||
|
delete cloneplot1D;
|
||||||
|
delete cloneplot2D;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qCloneWidget::closeEvent(QCloseEvent* event){
|
||||||
|
emit CloneClosedSignal(id);
|
||||||
|
event->accept();
|
||||||
|
}
|
291
slsDetectorGui/src/qDetectorMain.cpp
Normal file
291
slsDetectorGui/src/qDetectorMain.cpp
Normal file
@ -0,0 +1,291 @@
|
|||||||
|
/** Qt Project Class Headers */
|
||||||
|
#include "qDetectorMain.h"
|
||||||
|
#include "qDrawPlot.h"
|
||||||
|
#include "qTabMeasurement.h"
|
||||||
|
#include "qTabDataOutput.h"
|
||||||
|
#include "qTabPlot.h"
|
||||||
|
#include "qTabActions.h"
|
||||||
|
#include "qTabAdvanced.h"
|
||||||
|
#include "qTabSettings.h"
|
||||||
|
#include "qTabDebugging.h"
|
||||||
|
#include "qTabDeveloper.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
#include "slsDetector.h"
|
||||||
|
#include "multiSlsDetector.h"
|
||||||
|
#include "sls_detector_defs.h"
|
||||||
|
/** Qt Include Headers */
|
||||||
|
/** C++ Include Headers */
|
||||||
|
#include<iostream>
|
||||||
|
#include <string>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
#define Detector_Index 0
|
||||||
|
|
||||||
|
int main (int argc, char **argv) {
|
||||||
|
|
||||||
|
QApplication *theApp = new QApplication(argc, argv);
|
||||||
|
qDetectorMain *det=new qDetectorMain(argc, argv, theApp,0);
|
||||||
|
det->show();
|
||||||
|
theApp->connect( theApp, SIGNAL(lastWindowClosed()), theApp, SLOT(quit()));
|
||||||
|
return theApp->exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app, QWidget *parent) : QMainWindow(parent), theApp(app),myPlot(NULL),tabs(NULL){
|
||||||
|
myDet = 0;
|
||||||
|
setupUi(this);
|
||||||
|
SetUpWidgetWindow();
|
||||||
|
Initialization();
|
||||||
|
SetDeveloperMode();
|
||||||
|
/**need to use argc and argv to determine which slsdet or multidet to use.*/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Qt::ScrollBarAsNeeded
|
||||||
|
|
||||||
|
|
||||||
|
qDetectorMain::~qDetectorMain(){
|
||||||
|
delete myDet;
|
||||||
|
if (menubar) delete menubar;
|
||||||
|
if (centralwidget) delete centralwidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::SetUpWidgetWindow(){
|
||||||
|
|
||||||
|
|
||||||
|
/* scrollMain = new QScrollArea;
|
||||||
|
setCentralWidget(scrollMain);
|
||||||
|
scrollMain ->setWidget(centralwidget);
|
||||||
|
scrollMain->setWidgetResizable(true);*/
|
||||||
|
|
||||||
|
SetUpDetector();
|
||||||
|
|
||||||
|
/** plot setup*/
|
||||||
|
myPlot = new qDrawPlot(framePlot,myDet);
|
||||||
|
|
||||||
|
/**tabs setup*/
|
||||||
|
tabs = new QTabWidget(this);
|
||||||
|
layoutTabs->addWidget(tabs);
|
||||||
|
/** creating all the tab widgets */
|
||||||
|
tab_measurement = new qTabMeasurement (this, myDet,myPlot);
|
||||||
|
tab_dataoutput = new qTabDataOutput (this, myDet);
|
||||||
|
tab_plot = new qTabPlot (this, myDet,myPlot);
|
||||||
|
tab_actions = new qTabActions (this, myDet);
|
||||||
|
tab_advanced = new qTabAdvanced (this, myDet);
|
||||||
|
tab_Settings = new qTabSettings (this, myDet);
|
||||||
|
tab_debugging = new qTabDebugging (this, myDet);
|
||||||
|
tab_developer = new qTabDeveloper (this, myDet);
|
||||||
|
/** creating the scroll area widgets for the tabs */
|
||||||
|
for(int i=0;i<NUMBER_OF_TABS;i++){
|
||||||
|
scroll[i] = new QScrollArea;
|
||||||
|
scroll[i]->setFrameShape(QFrame::NoFrame);
|
||||||
|
}
|
||||||
|
/** setting the tab widgets to the scrollareas*/
|
||||||
|
scroll[Measurement] ->setWidget(tab_measurement);
|
||||||
|
scroll[DataOutput] ->setWidget(tab_dataoutput);
|
||||||
|
scroll[Plot] ->setWidget(tab_plot);
|
||||||
|
scroll[Actions] ->setWidget(tab_actions);
|
||||||
|
scroll[Advanced] ->setWidget(tab_advanced);
|
||||||
|
scroll[Settings] ->setWidget(tab_Settings);
|
||||||
|
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");
|
||||||
|
tabs->insertTab(Plot, scroll[Plot], "Plot");
|
||||||
|
tabs->insertTab(Actions, scroll[Actions], "Actions");
|
||||||
|
tabs->insertTab(Advanced, scroll[Advanced], "Advanced");
|
||||||
|
tabs->insertTab(Settings, scroll[Settings], "Settings");
|
||||||
|
tabs->insertTab(Debugging, scroll[Debugging], "Debugging");
|
||||||
|
tabs->insertTab(Developer, scroll[Developer], "Developer");
|
||||||
|
|
||||||
|
/** mode setup - to set up the tabs initially as disabled, not in form so done here */
|
||||||
|
SetDebugMode(false);
|
||||||
|
SetBeamlineMode(false);
|
||||||
|
SetExpertMode(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::SetUpDetector(){
|
||||||
|
/**instantiate detector and set window title*/
|
||||||
|
myDet = new multiSlsDetector(Detector_Index);
|
||||||
|
if(!myDet->getHostname(Detector_Index).length()){
|
||||||
|
setWindowTitle("SLS Detector GUI : No Detector Connected");
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<endl<<"No Detector Connected"<<endl;
|
||||||
|
#endif
|
||||||
|
myDet = 0;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
setWindowTitle("SLS Detector GUI : "+QString(slsDetectorBase::getDetectorType(myDet->getDetectorsType()).c_str())+" - "+QString(myDet->getHostname(Detector_Index).c_str()));
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<endl<<"Type : "<<slsDetectorBase::getDetectorType(myDet->getDetectorsType())<<"\t\t\tDetector : "<<myDet->getHostname(Detector_Index)<<endl;
|
||||||
|
#endif
|
||||||
|
myDet->setOnline(slsDetectorDefs::ONLINE_FLAG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::Initialization(){
|
||||||
|
|
||||||
|
|
||||||
|
/** tabs */
|
||||||
|
connect(tabs,SIGNAL(currentChanged(int)),this, SLOT(refresh(int)));//( QWidget*)));
|
||||||
|
/** Measurement tab*/
|
||||||
|
/** Plot tab */
|
||||||
|
|
||||||
|
|
||||||
|
/** Plotting */
|
||||||
|
/** When the acquisition is finished, must update the meas tab */
|
||||||
|
connect(myPlot, SIGNAL(UpdatingPlotFinished()), tab_measurement,SLOT(UpdateFinished()));
|
||||||
|
|
||||||
|
|
||||||
|
/** menubar */
|
||||||
|
/** Modes Menu */
|
||||||
|
connect(actionDebug, SIGNAL(toggled(bool)),this,SLOT(SetDebugMode(bool)));
|
||||||
|
connect(actionBeamline, SIGNAL(toggled(bool)),this,SLOT(SetBeamlineMode(bool)));
|
||||||
|
connect(actionExpert, SIGNAL(toggled(bool)),this,SLOT(SetExpertMode(bool)));
|
||||||
|
connect(actionDockable, SIGNAL(toggled(bool)),this,SLOT(SetDockableMode(bool)));
|
||||||
|
|
||||||
|
|
||||||
|
/** Utilities Menu */
|
||||||
|
connect(actionOpenSetup,SIGNAL(triggered()),this,SLOT(OpenSetup()));
|
||||||
|
connect(actionSaveSetup,SIGNAL(triggered()),this,SLOT(SaveSetup()));
|
||||||
|
connect(actionMeasurementWizard,SIGNAL(triggered()),this,SLOT(MeasurementWizard()));
|
||||||
|
connect(actionOpenConfiguration,SIGNAL(triggered()),this,SLOT(OpenConfiguration()));
|
||||||
|
connect(actionSaveConfiguration,SIGNAL(triggered()),this,SLOT(SaveConfiguration()));
|
||||||
|
connect(actionEnergyCalibration,SIGNAL(triggered()),this,SLOT(EnergyCalibration()));
|
||||||
|
connect(actionAngularCalibration,SIGNAL(triggered()),this,SLOT(AngularCalibration()));
|
||||||
|
connect(actionAbout,SIGNAL(triggered()),this,SLOT(About()));
|
||||||
|
connect(actionVersion,SIGNAL(triggered()),this,SLOT(Version()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::SetDeveloperMode(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Enabling Developer Mode "<<endl;
|
||||||
|
#endif
|
||||||
|
tabs->setTabEnabled(Developer,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::SetDebugMode(bool b){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Setting Debug Mode to "<<b<<endl;
|
||||||
|
#endif
|
||||||
|
tabs->setTabEnabled(Debugging,b);
|
||||||
|
}
|
||||||
|
|
||||||
|
void qDetectorMain::SetBeamlineMode(bool b){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Setting Beamline Mode to "<<b<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
tabs->setTabEnabled(Settings,b);
|
||||||
|
tab_advanced->setEnabled(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::refresh(int index){
|
||||||
|
if(!tabs->isTabEnabled(index))
|
||||||
|
tabs->setCurrentIndex((index++)<(tabs->count()-1)?index:Measurement);
|
||||||
|
else{
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::SetDockableMode(bool b){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Setting Dockable Plot Mode to "<<b<<endl;
|
||||||
|
#endif
|
||||||
|
if(b)
|
||||||
|
dockWidgetPlot->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
|
||||||
|
else
|
||||||
|
dockWidgetPlot->setFeatures(QDockWidget::NoDockWidgetFeatures);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::OpenSetup(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Opening Setup"<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::SaveSetup(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Saving Setup"<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::MeasurementWizard(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Measurement Wizard"<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::OpenConfiguration(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Opening Configuration"<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::SaveConfiguration(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Saving Configuration"<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::EnergyCalibration(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Executing Energy Calibration"<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::AngularCalibration(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Executing Angular Calibration"<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::Version(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Executing Version"<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qDetectorMain::About(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Executing About"<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
434
slsDetectorGui/src/qDrawPlot.cpp
Normal file
434
slsDetectorGui/src/qDrawPlot.cpp
Normal file
@ -0,0 +1,434 @@
|
|||||||
|
/*
|
||||||
|
* qDrawPlot.cpp
|
||||||
|
*
|
||||||
|
* Created on: May 7, 2012
|
||||||
|
* Author: Ian Johnson
|
||||||
|
*/
|
||||||
|
/** Qt Project Class Headers */
|
||||||
|
#include "qDrawPlot.h"
|
||||||
|
#include "qCloneWidget.h"
|
||||||
|
#include "SlsQt1DPlot.h"
|
||||||
|
#include "SlsQt2DPlotLayout.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
#include "slsDetector.h"
|
||||||
|
#include "multiSlsDetector.h"
|
||||||
|
/** Qt Include Headers */
|
||||||
|
#include <QTimer>
|
||||||
|
/** C++ Include Headers */
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
#define Detector_Index 0
|
||||||
|
|
||||||
|
|
||||||
|
qDrawPlot::qDrawPlot(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector){
|
||||||
|
if(myDet) {
|
||||||
|
setupUi(this);
|
||||||
|
Initialization();
|
||||||
|
SetupWidgetWindow();
|
||||||
|
StartStopDaqToggle(); //as default
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
qDrawPlot::~qDrawPlot(){
|
||||||
|
/** Clear plot*/
|
||||||
|
Clear1DPlot();
|
||||||
|
for(QVector<SlsQtH1D*>::iterator h = plot1D_hists.begin();h!=plot1D_hists.end();h++){
|
||||||
|
delete *h;
|
||||||
|
}
|
||||||
|
plot1D_hists.clear();
|
||||||
|
|
||||||
|
|
||||||
|
delete[] lastImageArray; lastImageArray=0;
|
||||||
|
StartOrStopThread(0);
|
||||||
|
|
||||||
|
/** delete detector object pointer*/
|
||||||
|
delete myDet;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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(){
|
||||||
|
plot_update_timer = new QTimer(this);
|
||||||
|
connect(plot_update_timer, SIGNAL(timeout()), this, SLOT(UpdatePlot()));
|
||||||
|
|
||||||
|
plot1D = new SlsQt1DPlot(boxPlot);
|
||||||
|
plot1D->SetXTitle("x axis");
|
||||||
|
plot1D->SetYTitle("y axis");
|
||||||
|
plot1D->hide();
|
||||||
|
|
||||||
|
plot2D = new SlsQt2DPlotLayout(boxPlot);
|
||||||
|
plot2D->SetXTitle("pixel");
|
||||||
|
plot2D->SetYTitle("pixel");
|
||||||
|
plot2D->SetZTitle("Intensity");
|
||||||
|
boxPlot->setFlat(1);
|
||||||
|
boxPlot->setTitle("Startup Image");
|
||||||
|
|
||||||
|
plotLayout = new QGridLayout(boxPlot);
|
||||||
|
plotLayout->addWidget(plot1D,1,1,1,1);
|
||||||
|
plotLayout->addWidget(plot2D,1,1,1,1);
|
||||||
|
|
||||||
|
|
||||||
|
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)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qDrawPlot::StartStopDaqToggle(bool stop_if_running){
|
||||||
|
static bool running = 1;
|
||||||
|
if(running){ //stopping
|
||||||
|
StartDaq(0);
|
||||||
|
running=!running;
|
||||||
|
}else if(!stop_if_running){ //then start
|
||||||
|
StartDaq(1);
|
||||||
|
running=!running;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qDrawPlot::StartDaq(bool start){
|
||||||
|
if(start){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Start Daq(1) function"<<endl;
|
||||||
|
#endif
|
||||||
|
number_of_exposures= (int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1);
|
||||||
|
cout<<"\tNumber of Exposures:"<<number_of_exposures<<endl;
|
||||||
|
|
||||||
|
acquisitionTime= ((double)(myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,-1))*1E-9);
|
||||||
|
cout<<"\tAcquisition Time:"<<setprecision (10)<<acquisitionTime<<endl;
|
||||||
|
|
||||||
|
framePeriod= ((double)(myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,-1))*1E-9);
|
||||||
|
cout<<"\tFrame Period:"<<setprecision (10)<<framePeriod<<endl;
|
||||||
|
|
||||||
|
ResetDaqForGui();
|
||||||
|
StartDaqForGui();
|
||||||
|
UpdatePlot();
|
||||||
|
}else{
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Start Daq(0) function"<<endl;
|
||||||
|
#endif
|
||||||
|
StopDaqForGui();
|
||||||
|
StopUpdatePlot();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int qDrawPlot::ResetDaqForGui(){
|
||||||
|
if(!StopDaqForGui()) return 0;
|
||||||
|
lastImageNumber = 0;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool qDrawPlot::StartOrStopThread(bool start){
|
||||||
|
static bool gui_acquisition_thread_running = 0;
|
||||||
|
static pthread_t gui_acquisition_thread;
|
||||||
|
static pthread_mutex_t gui_acquisition_start_stop_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
|
pthread_mutex_lock(&gui_acquisition_start_stop_mutex);
|
||||||
|
//stop part, before start or restart
|
||||||
|
if(gui_acquisition_thread_running){
|
||||||
|
cout<<"Stopping current acquisition thread ...."<<endl;
|
||||||
|
stop_signal = 1;
|
||||||
|
pthread_join(gui_acquisition_thread,NULL); //wait until he's finished, ie. exits
|
||||||
|
gui_acquisition_thread_running = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//start part
|
||||||
|
if(start){
|
||||||
|
stop_signal = 0;
|
||||||
|
cout<<"Starting new acquisition thread ...."<<endl;
|
||||||
|
gui_acquisition_thread_running = !pthread_create(&gui_acquisition_thread, NULL,qDrawPlot::DataAcquisionThread, (void*) this);
|
||||||
|
cout<<"created"<<endl;
|
||||||
|
//myDet->acquire(1);//acquiring
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock(&gui_acquisition_start_stop_mutex);
|
||||||
|
|
||||||
|
return gui_acquisition_thread_running;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void* qDrawPlot::DataAcquisionThread(void *this_pointer){
|
||||||
|
((qDrawPlot*)this_pointer)->AcquireImages();
|
||||||
|
return this_pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void* qDrawPlot::AcquireImages(){
|
||||||
|
//send data to detector
|
||||||
|
|
||||||
|
static unsigned int nx=1280,ny=100;
|
||||||
|
static double* image_data = new double[nx*ny];
|
||||||
|
if(!lastImageArray) lastImageArray = new double[nx*ny];
|
||||||
|
static double* xvalues = new double [nx];
|
||||||
|
static double* yvalues0 = new double [nx];
|
||||||
|
static double* yvalues1 = new double [nx];
|
||||||
|
if(!histXAxis) histXAxis = new double [nx];
|
||||||
|
if(!histYAxis[0]) histYAxis[0] = new double [nx];
|
||||||
|
if(!histYAxis[1]) histYAxis[1] = new double [nx];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
char cIndex[200];
|
||||||
|
|
||||||
|
//string filePath = myDet->getFilePath()+'/'+myDet->getFileName()+'_';
|
||||||
|
//cout<<"filePath:"<<filePath<<endl;
|
||||||
|
//string fileName;
|
||||||
|
|
||||||
|
for(int i=0;i<number_of_exposures;i++){
|
||||||
|
|
||||||
|
/////
|
||||||
|
//fileName.assign(filePath);
|
||||||
|
//sprintf(cIndex,"%d",i);
|
||||||
|
//fileName.append(cIndex);
|
||||||
|
//fileName.append(".raw");
|
||||||
|
//cout<<"filename:"<<fileName<<endl;
|
||||||
|
//short int arg[1280];
|
||||||
|
|
||||||
|
//while(myDet->readDataFile(fileName,arg)==-1);
|
||||||
|
|
||||||
|
|
||||||
|
/////////
|
||||||
|
|
||||||
|
|
||||||
|
//readout detector
|
||||||
|
//fill and write data here
|
||||||
|
for(unsigned int px=0;px<nx;px++)
|
||||||
|
for(unsigned int py=0;py<ny;py++)
|
||||||
|
image_data[py*nx+px] = sqrt(pow(i+1,2)*pow(double(px)-nx/2,2)/pow(nx/2,2)/pow(number_of_exposures+1,2) + pow(double(py)-ny/2,2)/pow(ny/2,2))/sqrt(2);
|
||||||
|
|
||||||
|
for(unsigned int px=0;px<nx;px++){
|
||||||
|
/*
|
||||||
|
xvalues[px] = px;//+10;
|
||||||
|
yvalues0[px] = (double)arg[px];//i + pow(1 - 2*fabs(double(px)-nx/2)/nx,2);
|
||||||
|
yvalues1[px] = 0;//i + pow(1 - 2*fabs(double(px)-nx/2)/nx,4);
|
||||||
|
*/
|
||||||
|
xvalues[px] = px+10;
|
||||||
|
yvalues0[px] = i + pow(1 - 2*fabs(double(px)-nx/2)/nx,2);
|
||||||
|
yvalues1[px] = i + pow(1 - 2*fabs(double(px)-nx/2)/nx,4);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* if(framePeriod<acquisitionTime) usleep((int)acquisitionTime*1e6);
|
||||||
|
else usleep((int)framePeriod*1e6);*/
|
||||||
|
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;
|
||||||
|
|
||||||
|
lastImageNumber = i+1;
|
||||||
|
char temp_title[2000];
|
||||||
|
//1d image stuff
|
||||||
|
nHists = 2;
|
||||||
|
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,"Channel Number"); histXAxisTitle=temp_title;
|
||||||
|
sprintf(temp_title,"Intensity"); histYAxisTitle=temp_title;
|
||||||
|
histNBins = nx;
|
||||||
|
memcpy(histXAxis, xvalues,nx*sizeof(double));
|
||||||
|
memcpy(histYAxis[0],yvalues0,nx*sizeof(double));
|
||||||
|
memcpy(histYAxis[1],yvalues1,nx*sizeof(double));
|
||||||
|
|
||||||
|
//2d image stuff
|
||||||
|
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;
|
||||||
|
nPixelsY = ny;
|
||||||
|
memcpy(lastImageArray,image_data,nx*ny*sizeof(double));
|
||||||
|
|
||||||
|
pthread_mutex_unlock(&last_image_complete_mutex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qDrawPlot::SelectPlot(int i){ //1 for 1D otherwise 2D
|
||||||
|
if(i==1){
|
||||||
|
plot1D->show();
|
||||||
|
plot2D->hide();
|
||||||
|
}else{
|
||||||
|
plot1D->hide();
|
||||||
|
plot2D->show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qDrawPlot::Clear1DPlot(){
|
||||||
|
for(QVector<SlsQtH1D*>::iterator h = plot1D_hists.begin();
|
||||||
|
h!=plot1D_hists.end();h++) (*h)->Detach(plot1D); //clear plot
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qDrawPlot::UpdatePlot(){
|
||||||
|
//emit UpdatingPlot();
|
||||||
|
|
||||||
|
plot_update_timer->stop();
|
||||||
|
|
||||||
|
LockLastImageArray();
|
||||||
|
//1-d plot stuff
|
||||||
|
if(GetHistNBins()){
|
||||||
|
plot1D->SetXTitle(GetHistXAxisTitle());
|
||||||
|
plot1D->SetYTitle(GetHistYAxisTitle());
|
||||||
|
for(int hist_num=0;hist_num<GetNHists();hist_num++){
|
||||||
|
SlsQtH1D* h;
|
||||||
|
if(hist_num+1>plot1D_hists.size()){
|
||||||
|
plot1D_hists.append(h=new SlsQtH1D("1d plot",GetHistNBins(),GetHistXAxis(),GetHistYAxis(hist_num)));
|
||||||
|
h->SetLineColor(hist_num+1);
|
||||||
|
}else{
|
||||||
|
h=plot1D_hists.at(hist_num);
|
||||||
|
h->SetData(GetHistNBins(),GetHistXAxis(),GetHistYAxis(hist_num));
|
||||||
|
}
|
||||||
|
h->setTitle(GetHistTitle(hist_num));
|
||||||
|
h->Attach(plot1D);
|
||||||
|
}
|
||||||
|
plot1D->UnZoom();
|
||||||
|
}
|
||||||
|
|
||||||
|
//2-d plot stuff
|
||||||
|
static int last_plot_number = 0;
|
||||||
|
if(GetLastImageArray()){
|
||||||
|
if(GetLastImageNumber()&&last_plot_number!=GetLastImageNumber() && //there is a new plot
|
||||||
|
GetNPixelsX()>0&&GetNPixelsY()>0){
|
||||||
|
plot2D->GetPlot()->SetData(GetNPixelsX(),-0.5,GetNPixelsX()-0.5,GetNPixelsY(),-0.5,GetNPixelsY()-0.5,GetLastImageArray());
|
||||||
|
//as it inherits a widget
|
||||||
|
boxPlot->setTitle(GetImageTitle());
|
||||||
|
plot2D->SetXTitle(GetImageXAxisTitle());
|
||||||
|
plot2D->SetYTitle(GetImageYAxisTitle());
|
||||||
|
plot2D->SetZTitle(GetImageZAxisTitle());
|
||||||
|
plot2D->UpdateNKeepSetRangeIfSet(); //this will keep a "set" z range, and call Plot()->Update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
last_plot_number=GetLastImageNumber();
|
||||||
|
UnlockLastImageArray();
|
||||||
|
|
||||||
|
if(PlotInScope()==1) SelectPlot(1);
|
||||||
|
else if(PlotInScope()==2) SelectPlot(2);
|
||||||
|
|
||||||
|
if(number_of_exposures==last_plot_number){
|
||||||
|
StartStopDaqToggle(1);
|
||||||
|
emit UpdatingPlotFinished();
|
||||||
|
}else{
|
||||||
|
plot_update_timer->start(500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qDrawPlot::StopUpdatePlot(){
|
||||||
|
plot_update_timer->stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qDrawPlot::ClonePlot(){
|
||||||
|
int i=0;
|
||||||
|
bool found = false;
|
||||||
|
for(i=0;i<MAXCloneWindows;i++)
|
||||||
|
if(!winClone[i]){
|
||||||
|
found=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(!found){
|
||||||
|
cout<<"Too many clones"<<endl;
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
winClone[i] = new qCloneWidget(this,i,boxPlot->size(),(int)PlotInScope(),plot1D,plot2D);
|
||||||
|
if(PlotInScope()==1)
|
||||||
|
plot1D = new SlsQt1DPlot(boxPlot);
|
||||||
|
else
|
||||||
|
plot2D = new SlsQt2DPlotLayout(boxPlot);
|
||||||
|
plotLayout->addWidget(plot1D,1,1,1,1);
|
||||||
|
plotLayout->addWidget(plot2D,1,1,1,1);
|
||||||
|
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();
|
||||||
|
connect(winClone[i], SIGNAL(CloneClosedSignal(int)),this, SLOT(CloneCloseEvent(int)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void qDrawPlot::CloseClones(){
|
||||||
|
for(int i=0;i<MAXCloneWindows;i++)
|
||||||
|
if(winClone[i])
|
||||||
|
winClone[i]->close();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qDrawPlot::CloneCloseEvent(int id){
|
||||||
|
winClone[id]=0;
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Closing Clone Window id:"<<id<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
58
slsDetectorGui/src/qTabActions.cpp
Normal file
58
slsDetectorGui/src/qTabActions.cpp
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* qTabActions.cpp
|
||||||
|
*
|
||||||
|
* Created on: May 10, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
/** Qt Project Class Headers */
|
||||||
|
#include "qTabActions.h"
|
||||||
|
#include "qDefs.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
#include "slsDetector.h"
|
||||||
|
#include "multiSlsDetector.h"
|
||||||
|
/** C++ Include Headers */
|
||||||
|
#include<iostream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
#define Detector_Index 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qTabActions::qTabActions(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector){
|
||||||
|
setupUi(this);
|
||||||
|
if(myDet)
|
||||||
|
{
|
||||||
|
SetupWidgetWindow();
|
||||||
|
Initialization();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qTabActions::~qTabActions(){
|
||||||
|
delete myDet;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabActions::SetupWidgetWindow(){
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabActions::Initialization(){
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabActions::Enable(bool enable){
|
||||||
|
//this->setEnabled(enable);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
84
slsDetectorGui/src/qTabAdvanced.cpp
Normal file
84
slsDetectorGui/src/qTabAdvanced.cpp
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
/*
|
||||||
|
* qTabAdvanced.cpp
|
||||||
|
*
|
||||||
|
* Created on: May 10, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
#include "qTabAdvanced.h"
|
||||||
|
#include "qDefs.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
#include "slsDetector.h"
|
||||||
|
#include "multiSlsDetector.h"
|
||||||
|
/** C++ Include Headers */
|
||||||
|
#include<iostream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
#define Detector_Index 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qTabAdvanced::qTabAdvanced(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector){
|
||||||
|
setupUi(this);
|
||||||
|
if(myDet)
|
||||||
|
{
|
||||||
|
myDetType = (int)myDet->getDetectorsType();
|
||||||
|
SetupWidgetWindow();
|
||||||
|
Initialization();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qTabAdvanced::~qTabAdvanced(){
|
||||||
|
delete myDet;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabAdvanced::SetupWidgetWindow(){
|
||||||
|
/** Temperature */
|
||||||
|
if(myDetType==slsDetectorDefs::GOTTHARD)
|
||||||
|
getTemperature(); //check if gotthard???
|
||||||
|
else{
|
||||||
|
btnTemp->setEnabled(false);
|
||||||
|
dispTempAdc->setEnabled(false);
|
||||||
|
dispTempFpga->setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabAdvanced::Initialization(){
|
||||||
|
/** Temperature */
|
||||||
|
connect(btnTemp,SIGNAL(clicked()),this,SLOT(getTemperature()));//check if gotthard???
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabAdvanced::Enable(bool enable){
|
||||||
|
btnTemp->setEnabled(enable);
|
||||||
|
dispTempAdc->setEnabled(enable);
|
||||||
|
dispTempFpga->setEnabled(enable);
|
||||||
|
pushButton->setEnabled(enable);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qTabAdvanced::getTemperature(){
|
||||||
|
char ctemp[200];
|
||||||
|
/** adc */
|
||||||
|
float tempadc = myDet->getADC(slsDetectorDefs::TEMPERATURE_ADC);
|
||||||
|
sprintf(ctemp,"%f%cC",tempadc,0x00B0);
|
||||||
|
dispTempAdc->setText(QString(ctemp));
|
||||||
|
/** fpga */
|
||||||
|
float tempfpga = myDet->getADC(slsDetectorDefs::TEMPERATURE_FPGA);
|
||||||
|
sprintf(ctemp,"%f%cC",tempfpga,0x00B0);
|
||||||
|
dispTempFpga->setText(QString(ctemp));
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Temperature of ADC: "<<tempadc<<"°C and FPGA: "<<tempfpga<<"°C"<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
55
slsDetectorGui/src/qTabDataOutput.cpp
Normal file
55
slsDetectorGui/src/qTabDataOutput.cpp
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* qTabDataOutput.cpp
|
||||||
|
*
|
||||||
|
* Created on: May 10, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
#include "qTabDataOutput.h"
|
||||||
|
#include "qDefs.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
#include "slsDetector.h"
|
||||||
|
#include "multiSlsDetector.h"
|
||||||
|
/** C++ Include Headers */
|
||||||
|
#include<iostream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
#define Detector_Index 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qTabDataOutput::qTabDataOutput(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector){
|
||||||
|
setupUi(this);
|
||||||
|
if(myDet)
|
||||||
|
{
|
||||||
|
SetupWidgetWindow();
|
||||||
|
Initialization();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qTabDataOutput::~qTabDataOutput(){
|
||||||
|
delete myDet;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabDataOutput::SetupWidgetWindow(){
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabDataOutput::Initialization(){
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabDataOutput::Enable(bool enable){
|
||||||
|
//this->setEnabled(enable);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
55
slsDetectorGui/src/qTabDebugging.cpp
Normal file
55
slsDetectorGui/src/qTabDebugging.cpp
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* qTabDebugging.cpp
|
||||||
|
*
|
||||||
|
* Created on: May 10, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
#include "qTabDebugging.h"
|
||||||
|
#include "qDefs.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
#include "slsDetector.h"
|
||||||
|
#include "multiSlsDetector.h"
|
||||||
|
/** C++ Include Headers */
|
||||||
|
#include<iostream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
#define Detector_Index 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qTabDebugging::qTabDebugging(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector){
|
||||||
|
setupUi(this);
|
||||||
|
if(myDet)
|
||||||
|
{
|
||||||
|
SetupWidgetWindow();
|
||||||
|
Initialization();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qTabDebugging::~qTabDebugging(){
|
||||||
|
delete myDet;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabDebugging::SetupWidgetWindow(){
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabDebugging::Initialization(){
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabDebugging::Enable(bool enable){
|
||||||
|
//this->setEnabled(enable);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
55
slsDetectorGui/src/qTabDeveloper.cpp
Normal file
55
slsDetectorGui/src/qTabDeveloper.cpp
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* qTabDeveloper.cpp
|
||||||
|
*
|
||||||
|
* Created on: May 10, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
#include "qTabDeveloper.h"
|
||||||
|
#include "qDefs.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
#include "slsDetector.h"
|
||||||
|
#include "multiSlsDetector.h"
|
||||||
|
/** C++ Include Headers */
|
||||||
|
#include<iostream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
#define Detector_Index 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qTabDeveloper::qTabDeveloper(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector){
|
||||||
|
setupUi(this);
|
||||||
|
if(myDet)
|
||||||
|
{
|
||||||
|
SetupWidgetWindow();
|
||||||
|
Initialization();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qTabDeveloper::~qTabDeveloper(){
|
||||||
|
delete myDet;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabDeveloper::SetupWidgetWindow(){
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabDeveloper::Initialization(){
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabDeveloper::Enable(bool enable){
|
||||||
|
//this->setEnabled(enable);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
195
slsDetectorGui/src/qTabMeasurement.cpp
Normal file
195
slsDetectorGui/src/qTabMeasurement.cpp
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
/*
|
||||||
|
* qTabMeasurement.cpp
|
||||||
|
*
|
||||||
|
* Created on: May 2, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** Qt Project Class Headers */
|
||||||
|
#include "qTabMeasurement.h"
|
||||||
|
#include "qDefs.h"
|
||||||
|
#include "qDrawPlot.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
#include "slsDetector.h"
|
||||||
|
#include "multiSlsDetector.h"
|
||||||
|
/** C++ Include Headers */
|
||||||
|
#include<iostream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
#define Detector_Index 0
|
||||||
|
#define UndefinedSettings 7
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qTabMeasurement::qTabMeasurement(QWidget *parent,slsDetectorUtils*& detector, qDrawPlot*& plot):QWidget(parent),myDet(detector),myPlot(plot){
|
||||||
|
setupUi(this);
|
||||||
|
if(myDet)
|
||||||
|
{
|
||||||
|
SetupWidgetWindow();
|
||||||
|
Initialization();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qTabMeasurement::~qTabMeasurement(){
|
||||||
|
delete myDet;
|
||||||
|
delete myPlot;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabMeasurement::SetupWidgetWindow(){
|
||||||
|
/** all set initially to reflect the detector's actual parameter values*/
|
||||||
|
|
||||||
|
/** Settings */
|
||||||
|
comboSettings->setCurrentIndex(myDet->getSettings(Detector_Index)); //set it to default acc to detector???
|
||||||
|
/** Number of Measurements/Frames*/
|
||||||
|
setNumFrames(2000);
|
||||||
|
/** Acquisition Time */
|
||||||
|
setAcquisitionTime();
|
||||||
|
/** Frame Period between exposures*/
|
||||||
|
setFramePeriod();
|
||||||
|
/** File Name*/
|
||||||
|
setFileName("run");
|
||||||
|
/** File Index*/
|
||||||
|
setRunIndex(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabMeasurement::Initialization(){
|
||||||
|
/** Settings */
|
||||||
|
connect(comboSettings,SIGNAL(currentIndexChanged(int)),this,SLOT(setSettings(int)));
|
||||||
|
/** Number of Measurements/Frames*/
|
||||||
|
connect(spinNumMeasurements,SIGNAL(valueChanged(int)),this,SLOT(setNumFrames(int)));
|
||||||
|
/** Acquisition Time */
|
||||||
|
connect(spinExpTime,SIGNAL(valueChanged(double)),this,SLOT(setAcquisitionTime()));
|
||||||
|
connect(comboExpUnit,SIGNAL(currentIndexChanged(int)),this,SLOT(setAcquisitionTime()));
|
||||||
|
/** Frame Period between exposures*/
|
||||||
|
connect(spinPeriod,SIGNAL(valueChanged(double)),this,SLOT(setFramePeriod()));
|
||||||
|
connect(comboPeriodUnit,SIGNAL(currentIndexChanged(int)),this,SLOT(setFramePeriod()));
|
||||||
|
/** File Name*/
|
||||||
|
connect(dispFileName,SIGNAL(textChanged(const QString&)),this,SLOT(setFileName(const QString&)));
|
||||||
|
/** File Index*/
|
||||||
|
connect(spinIndex,SIGNAL(valueChanged(int)),this,SLOT(setRunIndex(int)));
|
||||||
|
/** Start/Stop Acquisition*/
|
||||||
|
connect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//enabled other tabs as well??
|
||||||
|
void qTabMeasurement::Enable(bool enable){
|
||||||
|
//this->setEnabled(enable);
|
||||||
|
comboSettings->setEnabled(enable);
|
||||||
|
spinNumMeasurements->setEnabled(enable);
|
||||||
|
spinExpTime->setEnabled(enable);
|
||||||
|
comboExpUnit->setEnabled(enable);
|
||||||
|
spinPeriod->setEnabled(enable);
|
||||||
|
comboPeriodUnit->setEnabled(enable);
|
||||||
|
dispFileName->setEnabled(enable);
|
||||||
|
spinIndex->setEnabled(enable);
|
||||||
|
if(!enable) btnStartStop->setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabMeasurement::startStopAcquisition(){
|
||||||
|
if(!btnStartStop->text().compare("Start")){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<endl<<endl<<"Starting Acquisition"<<endl;
|
||||||
|
#endif
|
||||||
|
btnStartStop->setText("Stop");
|
||||||
|
Enable(0);
|
||||||
|
}else{
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Stopping Acquisition"<<endl;
|
||||||
|
#endif
|
||||||
|
btnStartStop->setText("Start");
|
||||||
|
Enable(1);
|
||||||
|
}
|
||||||
|
myPlot->StartStopDaqToggle();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qTabMeasurement::UpdateFinished(){
|
||||||
|
disconnect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
|
||||||
|
btnStartStop->setText("Start");
|
||||||
|
Enable(1);
|
||||||
|
connect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabMeasurement::setSettings(int index){
|
||||||
|
slsDetectorDefs::detectorSettings sett = myDet->setSettings((slsDetectorDefs::detectorSettings)index,Detector_Index);
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Settings have been set to "<<myDet->slsDetectorBase::getDetectorSettings(sett)<<endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qTabMeasurement::setNumFrames(int val){
|
||||||
|
myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,val);
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Setting Frame number to " << (int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1)<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void qTabMeasurement::setAcquisitionTime(){
|
||||||
|
int64_t exptime64;
|
||||||
|
/** Get the 64 bit value of timer*/
|
||||||
|
exptime64 = qDefs::get64bTime((qDefs::timeUnit)comboExpUnit->currentIndex(),spinExpTime->value());
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Setting acquisition time to " << exptime64 << " clocks" << endl;
|
||||||
|
#endif
|
||||||
|
myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,exptime64);
|
||||||
|
|
||||||
|
//float t=exptime64;
|
||||||
|
//emit acquisitionTimeChanged(t/(100E+6)); ??????????????????????
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabMeasurement::setFramePeriod(){
|
||||||
|
int64_t exptime64;
|
||||||
|
/** Get the 64 bit value of timer*/
|
||||||
|
exptime64 = qDefs::get64bTime((qDefs::timeUnit)comboPeriodUnit->currentIndex(),spinPeriod->value());
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Setting frame period between exposures to " << exptime64 << " clocks" << endl;
|
||||||
|
#endif
|
||||||
|
myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,exptime64);
|
||||||
|
|
||||||
|
//float t=exptime64;
|
||||||
|
//emit acquisitionTimeChanged(t/(100E+6)); ??????????????????????
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabMeasurement::setFileName(const QString& fName){
|
||||||
|
// emit fileNameChanged(fName);
|
||||||
|
// thred-->fileName=s;myDet->setFileName(fName.ascii());
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Setting File name to " << myDet->getFileName()<<endl;
|
||||||
|
#endif
|
||||||
|
myDet->setFileName(fName.toAscii().data());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabMeasurement::setRunIndex(int index){
|
||||||
|
myDet->setFileIndex(index);
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout<<"Setting File Index to " << myDet->getFileIndex()<<endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
68
slsDetectorGui/src/qTabPlot.cpp
Normal file
68
slsDetectorGui/src/qTabPlot.cpp
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* qTabPlot.cpp
|
||||||
|
*
|
||||||
|
* Created on: May 10, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "qTabPlot.h"
|
||||||
|
#include "qDefs.h"
|
||||||
|
#include "qDrawPlot.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
#include "slsDetector.h"
|
||||||
|
#include "multiSlsDetector.h"
|
||||||
|
/** C++ Include Headers */
|
||||||
|
#include<iostream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
#define Detector_Index 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qTabPlot::qTabPlot(QWidget *parent,slsDetectorUtils*& detector, qDrawPlot*& plot):QWidget(parent),myDet(detector),myPlot(plot){
|
||||||
|
setupUi(this);
|
||||||
|
if(myDet)
|
||||||
|
{
|
||||||
|
SetupWidgetWindow();
|
||||||
|
Initialization();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qTabPlot::~qTabPlot(){
|
||||||
|
delete myDet;
|
||||||
|
delete myPlot;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabPlot::SetupWidgetWindow(){
|
||||||
|
box1D->setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabPlot::Initialization(){
|
||||||
|
/** Plot box*/
|
||||||
|
connect(btnClone, SIGNAL(clicked()),myPlot, SLOT(ClonePlot()));
|
||||||
|
connect(btnCloseClones, SIGNAL(clicked()),myPlot, SLOT(CloseClones()));
|
||||||
|
/** 2D Plot box*/
|
||||||
|
connect(chkInterpolate, SIGNAL(toggled(bool)),myPlot, SIGNAL(InterpolateSignal(bool)));
|
||||||
|
connect(chkContour, SIGNAL(toggled(bool)),myPlot, SIGNAL(ContourSignal(bool)));
|
||||||
|
connect(chkLogz, SIGNAL(toggled(bool)),myPlot, SIGNAL(LogzSignal(bool)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabPlot::Enable(bool enable){
|
||||||
|
boxPlot->setEnabled(enable);
|
||||||
|
box1D->setEnabled(enable);
|
||||||
|
box2D->setEnabled(enable);
|
||||||
|
boxPlotAxis->setEnabled(enable);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
56
slsDetectorGui/src/qTabSettings.cpp
Normal file
56
slsDetectorGui/src/qTabSettings.cpp
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* qTabSettings.cpp
|
||||||
|
*
|
||||||
|
* Created on: May 10, 2012
|
||||||
|
* Author: l_maliakal_d
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "qTabSettings.h"
|
||||||
|
#include "qDefs.h"
|
||||||
|
/** Project Class Headers */
|
||||||
|
#include "slsDetector.h"
|
||||||
|
#include "multiSlsDetector.h"
|
||||||
|
/** C++ Include Headers */
|
||||||
|
#include<iostream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
#define Detector_Index 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qTabSettings::qTabSettings(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector){
|
||||||
|
setupUi(this);
|
||||||
|
if(myDet)
|
||||||
|
{
|
||||||
|
SetupWidgetWindow();
|
||||||
|
Initialization();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qTabSettings::~qTabSettings(){
|
||||||
|
delete myDet;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabSettings::SetupWidgetWindow(){
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabSettings::Initialization(){
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void qTabSettings::Enable(bool enable){
|
||||||
|
//this->setEnabled(enable);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user