mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
QIP
This commit is contained in:
@ -23,7 +23,9 @@
|
||||
#include <QPainter>
|
||||
|
||||
qCloneWidget::qCloneWidget(QWidget *parent, int id, QString title, QString xTitle, QString yTitle, QString zTitle,
|
||||
int numDim, std::string FilePath, bool displayStats, QString min, QString max, QString sum) : QMainWindow(parent), id(id), filePath(FilePath), cloneplot1D(0), cloneplot2D(0) {
|
||||
int numDim, std::string FilePath, bool displayStats, QString min, QString max, QString sum) :
|
||||
QMainWindow(parent), id(id), filePath(FilePath), cloneplot1D(nullptr), cloneplot2D(nullptr),
|
||||
marker(nullptr), nomarker(nullptr), mainLayout(nullptr), cloneBox(nullptr), lblHistTitle(nullptr) {
|
||||
// Window title
|
||||
char winTitle[300], currTime[50];
|
||||
strcpy(currTime, GetCurrentTimeStamp());
|
||||
@ -41,10 +43,21 @@ qCloneWidget::qCloneWidget(QWidget *parent, int id, QString title, QString xTitl
|
||||
}
|
||||
|
||||
qCloneWidget::~qCloneWidget() {
|
||||
delete cloneplot1D;
|
||||
delete cloneplot2D;
|
||||
delete cloneBox;
|
||||
cloneplot1D_hists.clear();
|
||||
if (cloneplot1D)
|
||||
delete cloneplot1D;
|
||||
if (cloneplot2D)
|
||||
delete cloneplot2D;
|
||||
cloneplot1D_hists.clear();
|
||||
if (marker)
|
||||
delete marker;
|
||||
if (nomarker)
|
||||
delete nomarker;
|
||||
if (mainLayout)
|
||||
delete mainLayout;
|
||||
if (cloneBox)
|
||||
delete cloneBox;
|
||||
if (lblHistTitle)
|
||||
delete lblHistTitle;
|
||||
}
|
||||
|
||||
SlsQt1DPlot* qCloneWidget::Get1dPlot() {
|
||||
@ -110,7 +123,7 @@ void qCloneWidget::SetupWidgetWindow(QString title, QString xTitle, QString yTit
|
||||
resize(500, 350);
|
||||
}
|
||||
|
||||
void qCloneWidget::SetCloneHists(int nHists, int histNBins, double *histXAxis, double *histYAxis[], std::string histTitle[], bool lines, bool markers) {
|
||||
void qCloneWidget::SetCloneHists(int nHists, int histNBins, double *histXAxis, std::vector<double*> histYAxis, std::vector<std::string> histTitle, bool lines, bool markers) {
|
||||
//for each plot, create hists
|
||||
for (int hist_num = 0; hist_num < nHists; ++hist_num) {
|
||||
SlsQtH1D *k;
|
||||
@ -146,45 +159,6 @@ void qCloneWidget::SetCloneHists(int nHists, int histNBins, double *histXAxis, d
|
||||
}
|
||||
}
|
||||
|
||||
void qCloneWidget::SetCloneHists(int nHists, int histNBins, double *histXAxis, double *histYAxis, std::string histTitle[], bool lines, bool markers) {
|
||||
// for each plot create hists
|
||||
for (int hist_num = 0; hist_num < nHists; ++hist_num) {
|
||||
SlsQtH1D *k;
|
||||
if (hist_num + 1 > cloneplot1D_hists.size()) {
|
||||
cloneplot1D_hists.append(k = new SlsQtH1D("1d plot", histNBins, histXAxis, histYAxis));
|
||||
k->SetLineColor(hist_num + 1);
|
||||
} else {
|
||||
k = cloneplot1D_hists.at(hist_num);
|
||||
k->SetData(histNBins, histXAxis, histYAxis);
|
||||
}
|
||||
//style of plot
|
||||
if (lines)
|
||||
k->setStyle(QwtPlotCurve::Lines);
|
||||
else
|
||||
k->setStyle(QwtPlotCurve::Dots);
|
||||
if (markers) {
|
||||
QwtSymbol *marker = new QwtSymbol();
|
||||
marker->setStyle(QwtSymbol::Cross);
|
||||
marker->setSize(5, 5);
|
||||
#if QWT_VERSION < 0x060000
|
||||
k->setSymbol(*marker);
|
||||
#else
|
||||
k->setSymbol(marker);
|
||||
#endif
|
||||
} else {
|
||||
QwtSymbol *noMarker = new QwtSymbol();
|
||||
#if QWT_VERSION < 0x060000
|
||||
k->setSymbol(*noMarker);
|
||||
#else
|
||||
k->setSymbol(noMarker);
|
||||
#endif
|
||||
}
|
||||
//set title and attach plot
|
||||
lblHistTitle->setText(QString(histTitle[0].c_str()));
|
||||
k->Attach(cloneplot1D);
|
||||
}
|
||||
}
|
||||
|
||||
void qCloneWidget::SetCloneHists2D(int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, double *d) {
|
||||
cloneplot2D->GetPlot()->SetData(nbinsx, xmin, xmax, nbinsy, ymin, ymax, d);
|
||||
cloneplot2D->KeepZRangeIfSet();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -11,7 +11,18 @@ QWidget(parent), myDet(detector) {
|
||||
FILE_LOG(logDEBUG) << "Advanced ready";
|
||||
}
|
||||
|
||||
qTabAdvanced::~qTabAdvanced(){}
|
||||
qTabAdvanced::~qTabAdvanced(){
|
||||
for (int i = 0; i < lblFromX.size(); ++i) {
|
||||
delete lblFromX[i];
|
||||
delete lblFromY[i];
|
||||
delete lblToX[i];
|
||||
delete lblToY[i];
|
||||
delete spinFromX[i];
|
||||
delete spinFromY[i];
|
||||
delete spinToX[i];
|
||||
delete spinToY[i];
|
||||
}
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetupWidgetWindow(){
|
||||
// palette
|
||||
|
@ -10,13 +10,16 @@
|
||||
#include <string>
|
||||
|
||||
|
||||
qTabDataOutput::qTabDataOutput(QWidget *parent, multiSlsDetector *detector) : QWidget(parent), myDet(detector) {
|
||||
qTabDataOutput::qTabDataOutput(QWidget *parent, multiSlsDetector *detector) : QWidget(parent), myDet(detector), btnGroupRate(nullptr) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
FILE_LOG(logDEBUG) << "DataOutput ready";
|
||||
}
|
||||
|
||||
qTabDataOutput::~qTabDataOutput() {}
|
||||
qTabDataOutput::~qTabDataOutput() {
|
||||
if (btnGroupRate)
|
||||
delete btnGroupRate;
|
||||
}
|
||||
|
||||
void qTabDataOutput::SetupWidgetWindow() {
|
||||
// button group for rate
|
||||
|
@ -8,13 +8,22 @@
|
||||
#include <iostream>
|
||||
|
||||
qTabDebugging::qTabDebugging(QWidget *parent, multiSlsDetector *detector) :
|
||||
QWidget(parent), myDet(detector), treeDet(0), lblDetectorHostname(0), lblDetectorFirmware(0), lblDetectorSoftware(0) {
|
||||
QWidget(parent), myDet(detector), treeDet(nullptr), lblDetectorHostname(nullptr), lblDetectorFirmware(nullptr), lblDetectorSoftware(nullptr) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
FILE_LOG(logDEBUG) << "Debugging ready";
|
||||
}
|
||||
|
||||
qTabDebugging::~qTabDebugging() {}
|
||||
qTabDebugging::~qTabDebugging() {
|
||||
if (treeDet)
|
||||
delete treeDet;
|
||||
if (lblDetectorHostname)
|
||||
delete lblDetectorHostname;
|
||||
if (lblDetectorFirmware)
|
||||
delete lblDetectorFirmware;
|
||||
if (lblDetectorSoftware)
|
||||
delete lblDetectorSoftware;
|
||||
}
|
||||
|
||||
|
||||
void qTabDebugging::SetupWidgetWindow() {
|
||||
|
@ -21,13 +21,39 @@
|
||||
|
||||
qTabDeveloper::qTabDeveloper(QWidget *parent, multiSlsDetector *detector) :
|
||||
QWidget(parent), myDet(detector), detType(slsDetectorDefs::GENERIC), numDACWidgets(0), numADCWidgets(0),
|
||||
boxDacs(nullptr), boxAdcs(nullptr), lblHV(nullptr), comboHV(nullptr), dacLayout(nullptr), comboDetector(nullptr) {
|
||||
boxDacs(nullptr), boxAdcs(nullptr), lblHV(nullptr), comboHV(nullptr), spinHV(nullptr), dacLayout(nullptr), comboDetector(nullptr), layout(nullptr) {
|
||||
SetupWidgetWindow();
|
||||
Initialization();
|
||||
FILE_LOG(logDEBUG) << "Developer ready";
|
||||
}
|
||||
|
||||
qTabDeveloper::~qTabDeveloper() {}
|
||||
qTabDeveloper::~qTabDeveloper() {
|
||||
for (int i = 0; i < lblDacs.size(); ++i) {
|
||||
delete lblDacs[i];
|
||||
delete lblDacsmV[i];
|
||||
delete spinDacs[i];
|
||||
}
|
||||
for (int i = 0; i < lblAdcs.size(); ++i) {
|
||||
delete lblAdcs[i];
|
||||
delete spinAdcs[i];
|
||||
}
|
||||
if (boxDacs)
|
||||
delete boxDacs;
|
||||
if (boxAdcs)
|
||||
delete boxAdcs;
|
||||
if (lblHV)
|
||||
delete lblHV;
|
||||
if (comboHV)
|
||||
delete comboHV;
|
||||
if (spinHV)
|
||||
delete spinHV;
|
||||
if (dacLayout)
|
||||
delete dacLayout;
|
||||
if (comboDetector)
|
||||
delete comboDetector;
|
||||
if (layout)
|
||||
delete layout;
|
||||
}
|
||||
|
||||
void qTabDeveloper::SetupWidgetWindow() {
|
||||
detType = myDet->getDetectorTypeAsEnum();
|
||||
|
@ -8,13 +8,17 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
qTabMeasurement::qTabMeasurement(QWidget *parent, multiSlsDetector *detector, qDrawPlot *plot) : QWidget(parent), myDet(detector), myPlot(plot) {
|
||||
qTabMeasurement::qTabMeasurement(QWidget *parent, multiSlsDetector *detector, qDrawPlot *plot) : QWidget(parent), myDet(detector), myPlot(plot),
|
||||
progressTimer(nullptr) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
FILE_LOG(logDEBUG) << "Measurement ready";
|
||||
}
|
||||
|
||||
qTabMeasurement::~qTabMeasurement() {}
|
||||
qTabMeasurement::~qTabMeasurement() {
|
||||
if (progressTimer)
|
||||
delete progressTimer;
|
||||
}
|
||||
|
||||
bool qTabMeasurement::GetStartStatus(){
|
||||
return (!btnStart->isEnabled());
|
||||
@ -523,8 +527,6 @@ void qTabMeasurement::SetFileWrite(bool val) {
|
||||
|
||||
try {
|
||||
myDet->setFileWrite(val);
|
||||
// for file save enable
|
||||
myPlot->SetFileWrite(val);
|
||||
dispFileName->setEnabled(chkFile->isChecked());
|
||||
} catch (const sls::NonCriticalError &e) {
|
||||
qDefs::ExceptionMessage("Could not set file write enable.", e.what(), "qTabMeasurement::SetFileWrite");
|
||||
@ -602,7 +604,7 @@ void qTabMeasurement::ResetProgress() {
|
||||
void qTabMeasurement::UpdateProgress() {
|
||||
FILE_LOG(logDEBUG) << "Updating progress";
|
||||
progressBar->setValue(myPlot->GetProgress());
|
||||
lblCurrentFrame->setText(QString::number(myPlot->GetFrameIndex()));
|
||||
lblCurrentFrame->setText(QString::number(myPlot->GetCurrentFrameIndex()));
|
||||
}
|
||||
|
||||
int qTabMeasurement::VerifyOutputDirectoryError() {
|
||||
|
@ -13,14 +13,19 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
qTabMessages::qTabMessages(QWidget *parent) : QWidget(parent) {
|
||||
qTabMessages::qTabMessages(QWidget *parent) : QWidget(parent),
|
||||
dispLog(nullptr), btnSave(nullptr), btnClear(nullptr) {
|
||||
SetupWidgetWindow();
|
||||
Initialization();
|
||||
FILE_LOG(logDEBUG) << "Messages ready";
|
||||
}
|
||||
|
||||
qTabMessages::~qTabMessages() {
|
||||
delete dispLog;
|
||||
if (dispLog)
|
||||
delete dispLog;
|
||||
if (btnSave)
|
||||
delete btnSave;
|
||||
if (btnClear)
|
||||
delete btnClear;
|
||||
}
|
||||
|
||||
void qTabMessages::SetupWidgetWindow() {
|
||||
@ -49,6 +54,8 @@ void qTabMessages::SetupWidgetWindow() {
|
||||
|
||||
qDebugStream(std::cout, this);
|
||||
qDebugStream(std::cerr, this);
|
||||
|
||||
Initialization();
|
||||
}
|
||||
|
||||
void qTabMessages::Initialization() {
|
||||
|
@ -27,7 +27,18 @@ qTabPlot::qTabPlot(QWidget *parent, multiSlsDetector *detector, qDrawPlot *plot)
|
||||
FILE_LOG(logDEBUG) << "Plot ready";
|
||||
}
|
||||
|
||||
qTabPlot::~qTabPlot() {}
|
||||
qTabPlot::~qTabPlot() {
|
||||
if (btnGroupPlotType)
|
||||
delete btnGroupPlotType;
|
||||
if (stackedLayout)
|
||||
delete stackedLayout;
|
||||
if (spinNthFrame)
|
||||
delete spinNthFrame;
|
||||
if (spinTimeGap)
|
||||
delete spinTimeGap;
|
||||
if (comboTimeGapUnit)
|
||||
delete comboTimeGapUnit;
|
||||
}
|
||||
|
||||
void qTabPlot::SetupWidgetWindow() {
|
||||
// button group for plot type
|
||||
@ -157,7 +168,6 @@ void qTabPlot::Initialization() {
|
||||
|
||||
// Save
|
||||
connect(btnSave, SIGNAL(clicked()), myPlot, SLOT(SavePlot()));
|
||||
connect(chkSaveAll, SIGNAL(toggled(bool)), myPlot, SLOT(SaveAll(bool)));
|
||||
|
||||
// Snapshot box
|
||||
connect(btnClone, SIGNAL(clicked()), myPlot, SLOT(ClonePlot()));
|
||||
@ -236,6 +246,8 @@ void qTabPlot::SetPlot() {
|
||||
SetZRange();
|
||||
}
|
||||
}
|
||||
|
||||
myPlot->SetDataCallBack(plotEnable);
|
||||
}
|
||||
|
||||
void qTabPlot::Set1DPlotOptionsRight() {
|
||||
|
Reference in New Issue
Block a user