This commit is contained in:
maliakal_d 2019-06-07 18:53:57 +02:00
parent ca5a0b4cc8
commit f0872174cf
11 changed files with 771 additions and 1227 deletions

View File

@ -34,10 +34,10 @@
<widget class="QGroupBox" name="boxProgress">
<property name="geometry">
<rect>
<x>30</x>
<y>153</y>
<x>21</x>
<y>130</y>
<width>319</width>
<height>116</height>
<height>103</height>
</rect>
</property>
<property name="sizePolicy">
@ -55,9 +55,9 @@
<widget class="QProgressBar" name="progressBar">
<property name="geometry">
<rect>
<x>10</x>
<y>75</y>
<width>300</width>
<x>-2</x>
<y>67</y>
<width>319</width>
<height>23</height>
</rect>
</property>
@ -68,9 +68,9 @@
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>10</x>
<x>1</x>
<y>25</y>
<width>91</width>
<width>96</width>
<height>16</height>
</rect>
</property>
@ -78,10 +78,10 @@
<string>Current Frame: </string>
</property>
</widget>
<widget class="QLabel" name="lblProgressIndex">
<widget class="QLabel" name="lblCurrentFrame">
<property name="geometry">
<rect>
<x>101</x>
<x>99</x>
<y>25</y>
<width>101</width>
<height>16</height>
@ -94,7 +94,7 @@
<widget class="QLabel" name="lblCurrentMeasurement">
<property name="geometry">
<rect>
<x>150</x>
<x>145</x>
<y>45</y>
<width>76</width>
<height>16</height>
@ -122,9 +122,9 @@
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>10</x>
<x>1</x>
<y>45</y>
<width>136</width>
<width>146</width>
<height>16</height>
</rect>
</property>
@ -136,10 +136,10 @@
<widget class="QFrame" name="frameTimeResolved">
<property name="geometry">
<rect>
<x>390</x>
<x>368</x>
<y>8</y>
<width>362</width>
<height>281</height>
<width>403</width>
<height>332</height>
</rect>
</property>
<property name="frameShape">
@ -151,14 +151,14 @@
<widget class="QWidget" name="gridLayoutWidget">
<property name="geometry">
<rect>
<x>0</x>
<x>3</x>
<y>10</y>
<width>357</width>
<height>264</height>
<width>390</width>
<height>314</height>
</rect>
</property>
<layout class="QGridLayout" name="gridTimeResolved">
<item row="1" column="1">
<item row="3" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -174,7 +174,7 @@
</property>
</spacer>
</item>
<item row="3" column="3">
<item row="5" column="3">
<widget class="QComboBox" name="comboPeriodUnit">
<property name="enabled">
<bool>false</bool>
@ -230,7 +230,7 @@ Frame period between exposures.
</item>
</widget>
</item>
<item row="0" column="2" colspan="2">
<item row="1" column="2" colspan="2">
<widget class="QComboBox" name="comboTimingMode">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -242,11 +242,6 @@ Frame period between exposures.
<string>Timing Mode of the detector.
#timing#</string>
</property>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>Auto</string>
@ -269,7 +264,7 @@ Frame period between exposures.
</item>
</widget>
</item>
<item row="4" column="0">
<item row="6" column="0">
<widget class="QLabel" name="lblNumTriggers">
<property name="enabled">
<bool>false</bool>
@ -283,7 +278,7 @@ Frame period between exposures.
</property>
</widget>
</item>
<item row="4" column="2" colspan="2">
<item row="6" column="2" colspan="2">
<widget class="QSpinBox" name="spinNumTriggers">
<property name="enabled">
<bool>false</bool>
@ -324,7 +319,7 @@ Frame period between exposures.
</property>
</widget>
</item>
<item row="5" column="0">
<item row="7" column="0">
<widget class="QLabel" name="lblDelay">
<property name="enabled">
<bool>false</bool>
@ -338,7 +333,7 @@ Frame period between exposures.
</property>
</widget>
</item>
<item row="5" column="2">
<item row="7" column="2">
<widget class="QDoubleSpinBox" name="spinDelay">
<property name="enabled">
<bool>false</bool>
@ -373,7 +368,7 @@ Frame period between exposures.
</property>
</widget>
</item>
<item row="5" column="3">
<item row="7" column="3">
<widget class="QComboBox" name="comboDelayUnit">
<property name="enabled">
<bool>false</bool>
@ -426,7 +421,7 @@ Frame period between exposures.
</item>
</widget>
</item>
<item row="1" column="0">
<item row="3" column="0">
<widget class="QLabel" name="lblNumFrames">
<property name="enabled">
<bool>false</bool>
@ -436,7 +431,7 @@ Frame period between exposures.
</property>
</widget>
</item>
<item row="1" column="2" colspan="2">
<item row="3" column="2" colspan="2">
<widget class="QSpinBox" name="spinNumFrames">
<property name="enabled">
<bool>false</bool>
@ -477,7 +472,7 @@ Frame period between exposures.
</property>
</widget>
</item>
<item row="2" column="0">
<item row="4" column="0">
<widget class="QLabel" name="lblExpTime">
<property name="enabled">
<bool>true</bool>
@ -494,7 +489,7 @@ Exposure Time of a frame.
</property>
</widget>
</item>
<item row="2" column="2">
<item row="4" column="2">
<widget class="QDoubleSpinBox" name="spinExpTime">
<property name="enabled">
<bool>true</bool>
@ -532,7 +527,7 @@ Exposure Time of a frame.
</property>
</widget>
</item>
<item row="2" column="3">
<item row="4" column="3">
<widget class="QComboBox" name="comboExpUnit">
<property name="enabled">
<bool>true</bool>
@ -588,7 +583,7 @@ Exposure Time of a frame.
</item>
</widget>
</item>
<item row="3" column="0">
<item row="5" column="0">
<widget class="QLabel" name="lblPeriod">
<property name="enabled">
<bool>false</bool>
@ -605,7 +600,7 @@ Frame period between exposures.
</property>
</widget>
</item>
<item row="3" column="2">
<item row="5" column="2">
<widget class="QDoubleSpinBox" name="spinPeriod">
<property name="enabled">
<bool>false</bool>
@ -643,14 +638,14 @@ Frame period between exposures.
</property>
</widget>
</item>
<item row="0" column="0">
<item row="1" column="0">
<widget class="QLabel" name="lblTimingMode">
<property name="text">
<string>Timing Mode:</string>
</property>
</widget>
</item>
<item row="6" column="0">
<item row="8" column="0">
<widget class="QLabel" name="lblNumSamples">
<property name="enabled">
<bool>false</bool>
@ -664,7 +659,7 @@ Frame period between exposures.
</property>
</widget>
</item>
<item row="6" column="2" colspan="2">
<item row="8" column="2" colspan="2">
<widget class="QSpinBox" name="spinNumSamples">
<property name="enabled">
<bool>false</bool>
@ -705,47 +700,14 @@ Frame period between exposures.
</property>
</widget>
</item>
</layout>
</widget>
<zorder>gridLayoutWidget</zorder>
<zorder>spinNumSamples</zorder>
</widget>
<widget class="QFrame" name="frameNotTimeResolved">
<property name="geometry">
<rect>
<x>20</x>
<y>5</y>
<width>336</width>
<height>159</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<widget class="QWidget" name="gridLayoutWidget_3">
<property name="geometry">
<rect>
<x>10</x>
<y>13</y>
<width>321</width>
<height>130</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Number of Measurements:</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<item row="2" column="2" colspan="2">
<widget class="QSpinBox" name="spinNumMeasurements">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -773,7 +735,7 @@ Frame period between exposures.
<string/>
</property>
<property name="minimum">
<number>1</number>
<number>-1</number>
</property>
<property name="maximum">
<number>2000000000</number>
@ -783,6 +745,37 @@ Frame period between exposures.
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QFrame" name="frameNotTimeResolved">
<property name="geometry">
<rect>
<x>10</x>
<y>5</y>
<width>336</width>
<height>96</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<widget class="QWidget" name="gridLayoutWidget_3">
<property name="geometry">
<rect>
<x>10</x>
<y>13</y>
<width>321</width>
<height>76</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="1" column="1" colspan="2">
<widget class="QLineEdit" name="dispFileName">
<property name="sizePolicy">
@ -865,8 +858,8 @@ Frame period between exposures.
<widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry">
<rect>
<x>30</x>
<y>298</y>
<x>20</x>
<y>270</y>
<width>318</width>
<height>34</height>
</rect>
@ -933,7 +926,7 @@ Frame period between exposures.
</property>
<property name="maximumSize">
<size>
<width>70</width>
<width>90</width>
<height>16777215</height>
</size>
</property>
@ -962,7 +955,6 @@ Frame period between exposures.
</widget>
</widget>
<tabstops>
<tabstop>spinNumMeasurements</tabstop>
<tabstop>chkFile</tabstop>
<tabstop>dispFileName</tabstop>
<tabstop>spinIndex</tabstop>

View File

@ -65,7 +65,7 @@ public:
int GetFrameIndex(){return currentFrameIndex;};
/** sets file write enable , if not enabled,
* file index wont increase and so you need secondary titles to differentitate between plots*/
void SetEnableFileWrite(bool enable){fileSaveEnable = enable;};
void SetFileWriteEnable(bool enable){fileSaveEnable = enable;};
/** sets plot Title prefix*/
void SetPlotTitlePrefix(QString title) {plotTitle_prefix = title;}

View File

@ -1,288 +1,75 @@
#pragma once
#include "qDefs.h"
#include "sls_detector_defs.h"
#include "ui_form_tab_advanced.h"
class multiSlsDetector;
#include <QStackedLayout>
#include <QSpacerItem>
/**
*@short sets up the advanced parameters
*/
class qTabAdvanced:public QWidget, private Ui::TabAdvancedObject{
Q_OBJECT
public:
/**
* The constructor
* @param parent is the parent tab widget
* @param detector is the detector returned from the detector tab
*/
qTabAdvanced(QWidget *parent, multiSlsDetector* detector);
/**
* Destructor
*/
~qTabAdvanced();
public slots:
/**
* To refresh and update widgets
*/
void Refresh();
private slots:
/**
* Select Readout
* @param index position index of readout
*/
void SetDetector(int index);
/**
* Sets control port
* @param port control port
*/
void SetControlPort(int port);
/**
* Sets stop port
* @param port stop port
*/
void SetStopPort(int port);
/**
* Sets detector udp ip
*/
void SetDetectorUDPIP();
/**
* Sets detector udp mac
*/
void SetDetectorUDPMAC();
/**
* Sets client zmq port
* @param port client zmq port
*/
void SetCltZMQPort(int port);
/**
* Sets client zmq ip to listen to
*/
void SetCltZMQIP();
/**
* Sets the receiver hostname
*/
void SetRxrHostname();
/**
* Sets receiver tcp port
* @param port receiver tcp port
*/
void SetRxrTCPPort(int port);
/**
* Sets receiver udp port
* @param port receiver udp port
*/
void SetRxrUDPPort(int port);
/**
* Sets receiver ip
*/
void SetRxrUDPIP();
/**
* Sets reciever mac
*/
void SetRxrUDPMAC();
/**
* Sets receiver zmq port
* @param port receiver zmq port
*/
void SetRxrZMQPort(int port);
/**
* Sets receiver zmq ip to stream from
*/
void SetRxrZMQIP();
/**
* Add ROI
*/
void AddROISlot();
/**
* Gets ROIs from detector and updates it
*/
void GetROI();
/**
* Clears ROI in detector
*/
void ClearROI();
/**
* Sets ROI in detector
*/
void SetROI();
/**
* Set all trimbits to a value
*/
void SetAllTrimbits();
/**
* Set number of additional storage cells
* @param value value to set to
*/
void SetNumStoragecells(int value);
/**
* Set sub frame exposure time
*/
void SetSubExposureTime();
/**
* Set sub frame dead time
*/
void SetSubDeadTime();
private:
/**
* Sets up the widget
*/
void SetupWidgetWindow();
/**
* Sets up all the slots and signals
*/
void Initialization();
/**
* Populate detectors
*/
void PopulateDetectors();
/**
* Gets detector online
*/
void GetOnline();
/**
* Gets control port
*/
void GetControlPort();
/**
* Gets stop port
*/
void GetStopPort();
/**
* Gets detector udp ip
*/
void GetDetectorUDPIP();
/**
* Gets detector udp mac
*/
void GetDetectorUDPMAC();
/**
* Gets client zmq receiver port
*/
void GetCltZMQPort();
/**
* Gets client zmq ip to listen to
*/
void GetCltZMQIP();
/**
* Gets receiver hostname
*/
void GetRxrHostname();
/**
* Sets receiver online
*/
void GetReceiverOnline();
/**
* Gets receiver tcp port
*/
void GetRxrTCPPort();
/**
* Gets receiver udp port
*/
void GetRxrUDPPort();
/**
* Gets receiver udp ip
*/
void GetRxrUDPIP();
/**
* Gets receiver udp mac
*/
void GetRxrUDPMAC();
/**
* Gets receiver zmq transmitting port
*/
void GetRxrZMQPort();
/**
* Gets receiver zmq transmitting ip
*/
void GetRxrZMQIP();
/**
* Clears all the ROI widgets
*/
void ClearROIWidgets();
/**
* Get all trimbits
*/
void GetAllTrimbits();
/**
* Get number of additional storage cells
*/
void GetNumStoragecells();
/**
* Get sub frame exposure time
*/
void GetSubExposureTime();
/**
* Get sub frame dead time
*/
void GetSubDeadTime();
/** The multi detector object */
multiSlsDetector *myDet;
/** Tool Tip */
QString errOnlineTip;
QString detOnlineTip;
QString rxrOnlineTip;
QPalette red;
/** ROI */
std::vector <QLabel*> lblFromX;
std::vector <QSpinBox*> spinFromX;

View File

@ -1,167 +1,60 @@
#pragma once
#include "qDefs.h"
#include "ui_form_tab_dataoutput.h"
class multiSlsDetector;
#include <QString>
#include <QButtonGroup>
/**
*@short sets up the DataOutput parameters
*/
class qTabDataOutput:public QWidget, private Ui::TabDataOutputObject{
Q_OBJECT
public:
/**
* The constructor
* @param parent is the parent tab widget
* @param detector is the detector returned from the detector tab
*/
qTabDataOutput(QWidget *parent,multiSlsDetector* detector);
/**
* Destructor
*/
~qTabDataOutput();
/**
* To refresh and update widgets
*/
void Refresh();
private slots:
/**
* Get output directory
*/
void GetOutputDir();
/**
* Open dialog to choose the output directory
*/
void BrowseOutputDir();
/**
* Set output directory
*/
void SetOutputDir();
/**
* Set file format
* @param format file format
*/
void SetFileFormat(int format);
/**
* Set overwrite enable
* @param enable enable
*/
void SetOverwriteEnable(bool enable);
/**
* Enable/Disable 10GbE
* @param enable enable
*/
void SetTenGigaEnable(bool enable);
/**
* Enable rate correction
*/
void EnableRateCorrection();
/**
* Set rate correction
*/
void SetRateCorrection();
/**
* Set speed
* @param speed speed chosen
*/
void SetSpeed(int speed);
/**
* Set flags
*/
void SetFlags();
private:
/**
* Sets up the widget
*/
void SetupWidgetWindow();
/**
* Sets up all the slots and signals
*/
void Initialization();
/**
* Populate the readouts
*/
void PopulateDetectors();
/**
* Enable browse
*/
void EnableBrowse();
void GetFileEnable();
void GetFileName();
/**
* Get file format
*/
void GetFileFormat();
/**
* Get overwrite enable
*/
void GetFileOverwrite();
/**
* Get Ten Giga Enable
*/
void GetTenGigaEnable();
/**
* Set Get rate correction
*/
void GetRateCorrection();
/**
* Get speed
*/
void GetSpeed();
/**
* Get flags
*/
void GetFlags();
/** The sls detector object */
multiSlsDetector *myDet;
/** Button group for radiobuttons for rate*/
// Button group for radiobuttons for rate
QButtonGroup *btnGroupRate;
/** enum for the Eiger clock divider */
// enum for the Eiger clock divider
enum {
FULLSPEED,
HALFSPEED,
QUARTERSPEED,
NUMBEROFSPEEDS
};
/** enum for the Eiger readout flags1 */
// enum for the Eiger readout flags1
enum {
CONTINUOUS,
STOREINRAM
};
/** enum for the Eiger readout flags2 */
// enum for the Eiger readout flags2
enum {
PARALLEL,
NONPARALLEL

View File

@ -1,204 +1,86 @@
#pragma once
#include "qDefs.h"
#include "ui_form_tab_measurement.h"
class qDrawPlot;
class multiSlsDetector;
#include <QStandardItemModel>
#include "qDrawPlot.h"
class qDetectorMain;
class QStandardItemModel;
/**
*@short sets up the measurement parameters
*/
class qTabMeasurement:public QWidget, private Ui::TabMeasurementObject{
Q_OBJECT
public:
/**
* The constructor
* This tab allows to change measurement parameters and to start/stop an acquisition
* @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, multiSlsDetector* detector, qDrawPlot* plot);
/**
* Destructor
*/
~qTabMeasurement();
/**
* Returns the status of the acquisition in gui
*/
bool GetStartStatus();
/**
* Click the Start/Stop Acquisition button
* This is used if this command came from gui client
*/
void ClickStartStop();
/**
* Returns progress bar value
*/
void ClentStartAcquisition();
int GetProgress();
/**
* Refresh and update widgets
*/
void Refresh();
public slots:
/**
* Update plot is finished,
* changes start/stop text and enables/disables all widgets
*/
void UpdateFinished();
/**
* Updates the current measurement
* @param val the value to be updated
*/
void SetCurrentMeasurement(int val);
void UpdateFinished();
void StopAcquisition();
private slots:
/**
* Set number of measurements
* @param num number of measurements to be set
*/
void setNumMeasurements(int num);
/**
* Set number of frames
* @param val number of frames to be set
*/
void setNumFrames(int val);
/**
* Set acquisition time
*/
void setExposureTime();
/**
* Set frame period between exposures
*/
void setAcquisitionPeriod();
/**
* Set number of triggers
* @param val number of triggers to be set
*/
void setNumTriggers(int val);
/**
* Set delay
*/
void setDelay();
/**
* Set number of samples
* @param val number of samples to be set
*/
void setNumSamples(int val);
/**
* Set file name
*/
void setFileName();
/**
* Enable write to file
*/
void EnableFileWrite(bool enable);
/**
* Set index of file name
* @param index index of selection
*/
void setRunIndex(int index);
/**
* Update progress
*/
void UpdateProgress();
/**
* starts Acquisition
*/
void startAcquisition();
/**
* stops Acquisition
*/
void stopAcquisition();
/**
* Sets the timing mode
* @param mode timing mode
*/
void SetTimingMode(int mode);
void SetNumMeasurements(int num);
void SetNumFrames(int val);
void SetNumTriggers(int val);
void SetNumSamples(int val);
void SetExposureTime();
void SetAcquisitionPeriod();
void SetDelay();
void SetFileWriteEnable(bool enable);
void SetFileName();
void SetRunIndex(int val);
void UpdateProgress();
void StartAcquisition();
private:
/**
* Sets up the widget
*/
void SetupWidgetWindow();
/**
* Sets up the timing mode
*/
void SetupTimingMode();
/**
* Sets up all the slots and signals
*/
void Initialization();
void SetupTimingMode();
void EnableWidgetsforTimingMode();
/**
* Get timing mode from detector
* @param startup is true when gui has just started up
*/
void GetTimingModeFromDetector(bool startup = false);
/**
* Enables/Disables widgetframes to avoid setting measurement during an acquisition
*/
void Enable(bool enable);
/**
* Checks if acquisition period is greater than exposure time
*/
void GetTimingMode();
void GetNumMeasurements();
void GetNumFrames();
void GetNumTriggers();
void GetNumSamples();
void GetExposureTime();
void GetAcquisitionPeriod();
void CheckAcqPeriodGreaterThanExp();
void GetDelay();
void GetFileWriteEnable();
void GetFileName();
void GetRunIndex();
/**
* Verify if output directory existing error is set
* @returns OK or FAIL
*/
void ResetProgress();
void Enable(bool enable);
int VerifyOutputDirectoryError();
/** The sls detector object */
multiSlsDetector *myDet;
/** The Plot widget */
qDrawPlot *myPlot;
/** detector type */
slsDetectorDefs::detectorType detType;
/** enum for the timing mode */
enum{AUTO, TRIGGER, GATED, BURST_TRIGGER, NUM_TIMING_MODES};
/** timer to update the progress*/
// enum for the timing mode
enum{
AUTO,
TRIGGER,
GATED,
BURST_TRIGGER,
NUMTIMINGMODES
};
QTimer *progressTimer;
/** tool tip variables*/
//tool tip variables
QString acqPeriodTip;
QString errPeriodTip;
QPalette red;
/** to access items in settings combobox */
QStandardItemModel* model;
bool delayImplemented;
bool sampleImplemented;
signals:
void StartSignal();

View File

@ -1,91 +1,32 @@
#pragma once
#include "qDefs.h"
#include "ui_form_tab_settings.h"
class multiSlsDetector;
/**
*@short sets up the Settings parameters
*/
class qTabSettings: public QWidget, private Ui::TabSettingsObject{
Q_OBJECT
public:
/**
* The constructor
* @param parent is the parent tab widget
* @param detector is the detector returned from the detector tab
*/
qTabSettings(QWidget *parent, multiSlsDetector* detector);
/**
* Destructor
*/
~qTabSettings();
/**
* Refresh and update widgets
*/
void Refresh();
private slots:
/**
* Set settings according to selection
* @param index index of selection
*/
void SetSettings(int index);
/**
* Set dynamic range if possible
* @param index selection
*/
void SetDynamicRange(int index);
/**
* Set threshold energy
* @param index selection
*/
void SetThresholdEnergy(int index);
private:
/**
* Sets up the widget
*/
void SetupWidgetWindow();
/**
* Sets up the detector settings
*/
void SetupDetectorSettings();
/**
* Sets up all the slots and signals
*/
void Initialization();
/**
* Get Settings
*/
void GetSettings();
/**
* Gets the dynamic range and sets it on the gui
*/
void GetDynamicRange();
/**
* Gets the threshold energy and update widget
*/
void GetThresholdEnergy();
/** The sls detector object */
multiSlsDetector *myDet;
enum {
STANDARD,
FAST,
@ -104,7 +45,6 @@ private:
UNINITIALIZED,
NUMSETTINGS
};
enum {
DYNAMICRANGE_32,
DYNAMICRANGE_16,

View File

@ -753,12 +753,16 @@ void qDetectorMain::SetZoomToolTip(bool disable) {
int qDetectorMain::StartStopAcquisitionFromClient(bool start) {
FILE_LOG(logINFO) << (start ? "Start" : "Stop")
<< " Acquisition From Clien";
<< " Acquisition From Client";
if (start) {
if (tabMeasurement->GetStartStatus() != start) {
tabMeasurement->ClickStartStop();
tabMeasurement->ClentStartAcquisition();
while (myPlot->GetClientInitiated())
;
usleep(500);
}
} else {
tabMeasurement->StopAcquisition();
}
return slsDetectorDefs::OK;

View File

@ -1,7 +1,5 @@
#include "qTabAdvanced.h"
#include "qDrawPlot.h"
#include "multiSlsDetector.h"
#include "qDefs.h"
#include <iostream>
@ -366,7 +364,7 @@ void qTabAdvanced::GetRxrZMQIP() {
}
void qTabAdvanced::SetDetector(int index) {
FILE_LOG(logDEBUG) << "Set Detector: " << index;
FILE_LOG(logDEBUG) << "Set Detector: " << comboDetector->currentText().toAscii().data();
GetOnline();
GetControlPort();
@ -776,7 +774,7 @@ void qTabAdvanced::GetSubExposureTime() {
void qTabAdvanced::SetSubExposureTime() {
double timeNS = qDefs::getNSTime((qDefs::timeUnit)comboSubExpTimeUnit->currentIndex(), spinSubExpTime->value());
FILE_LOG(logINFO) << "Setting sub frame acquisition time to " << timeNS << " clocks" <<
FILE_LOG(logINFO) << "Setting sub frame acquisition time to " << timeNS << " ns" <<
"/" << spinSubExpTime->value() << qDefs::getUnitString((qDefs::timeUnit)comboSubExpTimeUnit->currentIndex());
try {
myDet->setTimer(slsDetectorDefs::SUBFRAME_ACQUISITION_TIME, (int64_t)timeNS, -1);
@ -813,7 +811,7 @@ void qTabAdvanced::GetSubDeadTime() {
void qTabAdvanced::SetSubDeadTime() {
double timeNS = qDefs::getNSTime((qDefs::timeUnit)comboSubDeadTimeUnit->currentIndex(), spinSubDeadTime->value());
FILE_LOG(logINFO) << "Setting sub frame dead time to " << timeNS << " clocks" <<
FILE_LOG(logINFO) << "Setting sub frame dead time to " << timeNS << " ns" <<
"/" << spinSubDeadTime->value() << qDefs::getUnitString((qDefs::timeUnit)comboSubDeadTimeUnit->currentIndex());
try {
myDet->setTimer(slsDetectorDefs::SUBFRAME_DEADTIME, (int64_t)timeNS, -1);
@ -825,7 +823,7 @@ void qTabAdvanced::SetSubDeadTime() {
void qTabAdvanced::Refresh(){
FILE_LOG(logDEBUG) << endl << "**Updating Advanced Tab";
FILE_LOG(logDEBUG) << "**Updating Advanced Tab";
// trimming
if (tab_trimming->isEnabled()) {

View File

@ -1,9 +1,10 @@
#include "qTabDataOutput.h"
#include "multiSlsDetector.h"
#include "qDefs.h"
#include <QFileDialog>
#include <QStandardItemModel>
#include <QButtonGroup>
#include <QString>
#include <iostream>
#include <string>
@ -83,6 +84,7 @@ void qTabDataOutput::PopulateDetectors() {
}
void qTabDataOutput::EnableBrowse() {
FILE_LOG(logDEBUG) << "Getting browse enable";
try {
std::string receiverHostname = myDet->getReceiverHostname(comboDetector->currentIndex() - 1);
if (receiverHostname == "localhost") {
@ -107,6 +109,32 @@ void qTabDataOutput::EnableBrowse() {
}
}
void qTabDataOutput::GetFileWriteEnable() {
FILE_LOG(logDEBUG) << "Getting file write enable";
try {
int retval = myDet->getFileWrite();
if (retval == -1) {
qDefs::Message(qDefs::WARNING, "File write is inconsistent for all detectors.", "qTabDataOutput::GetFileWriteEnable");
boxFileWriteEnabled->setEnabled(true);
} else {
boxFileWriteEnabled->setEnabled(retval == 0 ? false : true);
}
} catch (const sls::RuntimeError &e) {
qDefs::ExceptionMessage("Could not get file enable.", e.what(), "qTabDataOutput::GetFileWriteEnable");
boxFileWriteEnabled->setEnabled(true);
}
}
void qTabDataOutput::GetFileName() {
FILE_LOG(logDEBUG) << "Getting file name";
try {
auto retval = myDet->getFileName();
dispFileName->setText(QString(retval.c_str()));
} catch (const sls::NonCriticalError &e) {
qDefs::ExceptionMessage("Could not get file name prefix.", e.what(), "qTabDataOutput::GetFileName");
}
}
void qTabDataOutput::GetOutputDir() {
FILE_LOG(logDEBUG) << "Getting file path";
@ -182,7 +210,7 @@ void qTabDataOutput::GetFileFormat() {
}
void qTabDataOutput::SetFileFormat(int format) {
FILE_LOG(logINFO) << "Setting File Format to " << slsDetectorDefs::getFileFormatType((slsDetectorDefs::fileFormat)format);
FILE_LOG(logINFO) << "Setting File Format to " << comboFileFormat->currentText().toAscii().data();
try {
myDet->setFileFormat((slsDetectorDefs::fileFormat)comboFileFormat->currentIndex());
} catch (const sls::NonCriticalError &e) {
@ -337,7 +365,7 @@ void qTabDataOutput::GetSpeed() {
}
void qTabDataOutput::SetSpeed(int speed) {
FILE_LOG(logINFO) << "Setting Speed to " << ((speed = FULLSPEED) ? "full" : ((speed == HALFSPEED) ? "half" : "quarter")) << " speed";
FILE_LOG(logINFO) << "Setting Speed to " << comboEigerClkDivider->currentText().toAscii().data();;
try {
myDet->setSpeed(slsDetectorDefs::CLOCK_DIVIDER, speed);
} catch (const sls::NonCriticalError &e) {
@ -390,29 +418,27 @@ void qTabDataOutput::SetFlags() {
//set to continous or storeinram
switch (comboEigerFlags1->currentIndex()) {
case STOREINRAM:
FILE_LOG(logINFO) << "Setting Readout Flags to Store in Ram";
flag1 = slsDetectorDefs::STORE_IN_RAM;
break;
default:
FILE_LOG(logINFO) << "Setting Readout Flags to Continuous";
flag1 = slsDetectorDefs::CONTINOUS_RO;
break;
}
//set to parallel, nonparallel or safe
//set to parallel or nonparallel
switch (comboEigerFlags2->currentIndex()) {
case PARALLEL:
FILE_LOG(logINFO) << "Setting Readout Flags to Parallel";
flag2 = slsDetectorDefs::PARALLEL;
break;
default:
FILE_LOG(logINFO) << "Setting Readout Flags to Non Parallel";
flag2 = slsDetectorDefs::NONPARALLEL;
break;
}
try {
FILE_LOG(logINFO) << "Setting Readout Flags to " << comboEigerFlags1->currentText().toAscii().data();
myDet->setReadOutFlags(flag1);
FILE_LOG(logINFO) << "Setting Readout Flags to " << comboEigerFlags2->currentText().toAscii().data();
myDet->setReadOutFlags(flag2);
} catch (const sls::NonCriticalError &e) {
qDefs::ExceptionMessage("Could not set readout flags.", e.what(), "qTabDataOutput::SetFlags");
@ -430,7 +456,8 @@ void qTabDataOutput::Refresh() {
FILE_LOG(logDEBUG) << "**Updating DataOutput Tab";
EnableBrowse();
dispFileName->setText(QString(myDet->getFileName().c_str()));
GetFileWriteEnable();
GetFileName();
GetOutputDir();
GetFileOverwrite();
GetFileFormat();

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,5 @@
#include "qTabSettings.h"
#include "multiSlsDetector.h"
#include "qDefs.h"
#include <QStandardItemModel>
@ -135,6 +134,24 @@ void qTabSettings::GetSettings() {
connect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSettings(int)));
}
void qTabSettings::SetSettings(int index) {
// settings
auto val = static_cast<slsDetectorDefs::detectorSettings>(index);
FILE_LOG(logINFO) << "Setting Settings to " << myDet->slsDetectorDefs::getDetectorSettings(val);
try {
myDet->setSettings(val);
} catch (const sls::NonCriticalError &e) {
qDefs::ExceptionMessage("Could not set settings.", e.what(), "qTabSettings::SetSettings");
GetSettings();
}
// threshold
if (spinThreshold->isEnabled()) {
SetThresholdEnergy(spinThreshold->value());
}
}
void qTabSettings::GetDynamicRange() {
FILE_LOG(logDEBUG) << "Getting dynamic range";
disconnect(comboDynamicRange, SIGNAL(activated(int)), this, SLOT(SetDynamicRange(int)));
@ -170,6 +187,32 @@ void qTabSettings::GetDynamicRange() {
connect(comboDynamicRange, SIGNAL(activated(int)), this,SLOT(SetDynamicRange(int)));
}
void qTabSettings::SetDynamicRange(int index) {
FILE_LOG(logINFO) << "Setting dynamic range to " << comboDynamicRange->currentText().toAscii().data()
try {
switch (index) {
case DYNAMICRANGE_32:
myDet->setDynamicRange(32);
break;
case DYNAMICRANGE_16:
myDet->setDynamicRange(16);
break;
case DYNAMICRANGE_8:
myDet->setDynamicRange(8);
break;
case DYNAMICRANGE_4:
myDet->setDynamicRange(4);
break;
default:
qDefs::Message(qDefs::WARNING, std::string("Unknown dynamic range: ") + std::to_string(index), "qTabSettings::SetDynamicRange");
break;
}
} catch (const sls::NonCriticalError &e) {
qDefs::ExceptionMessage("Could not set dynamic range.", e.what(), "qTabSettings::SetDynamicRange");
GetDynamicRange();
}
}
void qTabSettings::GetThresholdEnergy() {
FILE_LOG(logDEBUG) << "Getting theshold energy";
disconnect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetThresholdEnergy()));
@ -189,53 +232,6 @@ void qTabSettings::GetThresholdEnergy() {
connect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetThresholdEnergy()));
}
void qTabSettings::SetSettings(int index) {
// settings
auto val = static_cast<slsDetectorDefs::detectorSettings>(index);
FILE_LOG(logINFO) << "Setting Settings to " << myDet->slsDetectorDefs::getDetectorSettings(val);
try {
myDet->setSettings(val);
} catch (const sls::NonCriticalError &e) {
qDefs::ExceptionMessage("Could not set settings.", e.what(), "qTabSettings::SetSettings");
GetSettings();
}
// threshold
if (spinThreshold->isEnabled()) {
SetThresholdEnergy(spinThreshold->value());
}
}
void qTabSettings::SetDynamicRange(int index) {
try {
switch (index) {
case DYNAMICRANGE_32:
FILE_LOG(logINFO) << "Setting dynamic range to 32";
myDet->setDynamicRange(32);
break;
case DYNAMICRANGE_16:
FILE_LOG(logINFO) << "Setting dynamic range to 16";
myDet->setDynamicRange(16);
break;
case DYNAMICRANGE_8:
FILE_LOG(logINFO) << "Setting dynamic range to 8";
myDet->setDynamicRange(8);
break;
case DYNAMICRANGE_4:
FILE_LOG(logINFO) << "Setting dynamic range to 4";
myDet->setDynamicRange(4);
break;
default:
qDefs::Message(qDefs::WARNING, std::string("Unknown dynamic range: ") + std::to_string(index), "qTabSettings::SetDynamicRange");
break;
}
} catch (const sls::NonCriticalError &e) {
qDefs::ExceptionMessage("Could not set dynamic range.", e.what(), "qTabSettings::SetDynamicRange");
GetDynamicRange();
}
}
void qTabSettings::SetThresholdEnergy(int index) {
FILE_LOG(logINFO) << "Setting Threshold Energy to " << index << " eV";
try {