mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-18 16:22:19 +01:00
WIP
This commit is contained in:
@@ -1,7 +1,23 @@
|
||||
#include "qCloneWidget.h"
|
||||
#include "qDefs.h"
|
||||
#include "SlsQt1DPlot.h"
|
||||
#include "SlsQt2DPlotLayout.h"
|
||||
|
||||
#include "qwt_symbol.h"
|
||||
#include <QWidget>
|
||||
#include <QCloseEvent>
|
||||
#include <QGridLayout>
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
#include <QAction>
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLineEdit>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QPushButton>
|
||||
#include <QSpacerItem>
|
||||
#include <QFileDialog>
|
||||
#include <QImage>
|
||||
#include <QPainter>
|
||||
@@ -24,7 +40,6 @@ qCloneWidget::qCloneWidget(QWidget *parent, int id, QString title, QString xTitl
|
||||
DisplayStats(displayStats, min, max, sum);
|
||||
}
|
||||
|
||||
|
||||
qCloneWidget::~qCloneWidget() {
|
||||
delete cloneplot1D;
|
||||
delete cloneplot2D;
|
||||
@@ -32,12 +47,10 @@ qCloneWidget::~qCloneWidget() {
|
||||
cloneplot1D_hists.clear();
|
||||
}
|
||||
|
||||
|
||||
SlsQt1DPlot* qCloneWidget::Get1dPlot() {
|
||||
return cloneplot1D;
|
||||
}
|
||||
|
||||
|
||||
void qCloneWidget::SetupWidgetWindow(QString title, QString xTitle, QString yTitle, QString zTitle, int numDim) {
|
||||
|
||||
QMenuBar* menubar = new QMenuBar(this);
|
||||
@@ -97,7 +110,6 @@ 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) {
|
||||
//for each plot, create hists
|
||||
for (int hist_num = 0; hist_num < nHists; ++hist_num) {
|
||||
@@ -134,7 +146,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) {
|
||||
@@ -174,13 +185,11 @@ void qCloneWidget::SetCloneHists(int nHists, int histNBins, double *histXAxis, d
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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->UpdateNKeepSetRangeIfSet();
|
||||
}
|
||||
|
||||
|
||||
void qCloneWidget::SetRange(bool IsXYRange[], double XYRangeValues[]) {
|
||||
double XYCloneRangeValues[4];
|
||||
|
||||
@@ -226,7 +235,6 @@ void qCloneWidget::SetRange(bool IsXYRange[], double XYRangeValues[]) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void qCloneWidget::SavePlot() {
|
||||
char cID[10];
|
||||
sprintf(cID, "%d", id);
|
||||
@@ -257,7 +265,6 @@ void qCloneWidget::SavePlot() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int qCloneWidget::SavePlotAutomatic() {
|
||||
char cID[10];
|
||||
sprintf(cID, "%d", id);
|
||||
@@ -280,13 +287,11 @@ int qCloneWidget::SavePlotAutomatic() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
void qCloneWidget::closeEvent(QCloseEvent *event) {
|
||||
emit CloneClosedSignal(id);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
|
||||
char *qCloneWidget::GetCurrentTimeStamp() {
|
||||
char output[30];
|
||||
char *result;
|
||||
@@ -300,7 +305,6 @@ char *qCloneWidget::GetCurrentTimeStamp() {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void qCloneWidget::DisplayStats(bool enable, QString min, QString max, QString sum) {
|
||||
if (enable) {
|
||||
QWidget *widgetStatistics = new QWidget(this);
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
#include "qDetectorMain.h"
|
||||
#include "qDefs.h"
|
||||
#include "qServer.h"
|
||||
#include "qTabAdvanced.h"
|
||||
#include "qDrawPlot.h"
|
||||
#include "qTabMeasurement.h"
|
||||
#include "qTabDataOutput.h"
|
||||
#include "qTabPlot.h"
|
||||
#include "qTabAdvanced.h"
|
||||
#include "qTabSettings.h"
|
||||
#include "qTabDebugging.h"
|
||||
#include "qTabDeveloper.h"
|
||||
#include "qTabMessages.h"
|
||||
#include "qTabPlot.h"
|
||||
#include "qTabSettings.h"
|
||||
#include "qServer.h"
|
||||
|
||||
#include "multiSlsDetector.h"
|
||||
#include "sls_detector_defs.h"
|
||||
#include "versionAPI.h"
|
||||
|
||||
#include <QGridLayout>
|
||||
#include <QResizeEvent>
|
||||
#include <QScrollArea>
|
||||
#include <QFileDialog>
|
||||
#include <QPlastiqueStyle>
|
||||
#include <QSizePolicy>
|
||||
|
||||
#include <iostream>
|
||||
#include <getopt.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
@@ -111,7 +115,6 @@ qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app,
|
||||
setupUi(this);
|
||||
SetUpDetector(fname, multiId);
|
||||
SetUpWidgetWindow();
|
||||
Initialization();
|
||||
}
|
||||
|
||||
qDetectorMain::~qDetectorMain() {
|
||||
@@ -277,6 +280,8 @@ void qDetectorMain::SetUpDetector(const std::string fName, int multiID) {
|
||||
//FIXME: not needed anymore due to client creating socket each time
|
||||
//myDet->setOnline(slsDetectorDefs::ONLINE_FLAG);
|
||||
//myDet->setReceiverOnline(slsDetectorDefs::ONLINE_FLAG);
|
||||
|
||||
Initialization();
|
||||
}
|
||||
|
||||
void qDetectorMain::Initialization() {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
#include "qTabPlot.h"
|
||||
#include "qDefs.h"
|
||||
#include "qDrawPlot.h"
|
||||
// Project Class Headers
|
||||
#include "multiSlsDetector.h"
|
||||
// Qt Include Headers
|
||||
|
||||
#include <QStandardItemModel>
|
||||
// C++ Include Headers
|
||||
#include <QStackedLayout>
|
||||
#include <QButtonGroup>
|
||||
#include <QAbstractButton>
|
||||
|
||||
#include <iostream>
|
||||
#include <math.h>
|
||||
#include <string>
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// const QString qTabPlot::modeNames[5] = {"None", "Energy Scan", "Threshold Scan", "Trimbits Scan", "Custom Script Scan"};
|
||||
|
||||
QString qTabPlot::defaultPlotTitle("");
|
||||
QString qTabPlot::defaultHistXAxisTitle("Channel Number");
|
||||
@@ -20,7 +20,6 @@ QString qTabPlot::defaultImageXAxisTitle("Pixel");
|
||||
QString qTabPlot::defaultImageYAxisTitle("Pixel");
|
||||
QString qTabPlot::defaultImageZAxisTitle("Intensity");
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
qTabPlot::qTabPlot(QWidget *parent, multiSlsDetector *detector, qDrawPlot *plot) : QWidget(parent),
|
||||
myDet(detector),
|
||||
@@ -41,15 +40,12 @@ qTabPlot::qTabPlot(QWidget *parent, multiSlsDetector *detector, qDrawPlot *plot)
|
||||
FILE_LOG(logDEBUG) << "Plot ready";
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
qTabPlot::~qTabPlot() {
|
||||
delete myDet;
|
||||
delete myPlot;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetupWidgetWindow() {
|
||||
//error for interval between plots
|
||||
red = new QPalette();
|
||||
@@ -181,7 +177,6 @@ void qTabPlot::SetupWidgetWindow() {
|
||||
qDefs::checkErrorMessage(myDet, "qTabPlot::SetupWidgetWindow");
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetPlotOptionsRightPage() {
|
||||
if (isOneD) {
|
||||
@@ -201,8 +196,6 @@ void qTabPlot::SetPlotOptionsRightPage() {
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetPlotOptionsLeftPage() {
|
||||
if (isOneD) {
|
||||
int i = stackedWidget->currentIndex();
|
||||
@@ -221,8 +214,6 @@ void qTabPlot::SetPlotOptionsLeftPage() {
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::Select1DPlot(bool b) {
|
||||
#ifdef VERBOSE
|
||||
if (b)
|
||||
@@ -256,8 +247,6 @@ void qTabPlot::Select1DPlot(bool b) {
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::Initialization() {
|
||||
// Plot arguments box
|
||||
connect(btnGroupPlotType, SIGNAL(buttonClicked(int)), this, SLOT(SetPlot()));
|
||||
@@ -349,8 +338,6 @@ void qTabPlot::Initialization() {
|
||||
connect(chkGapPixels, SIGNAL(toggled(bool)), this, SLOT(EnableGapPixels(bool)));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::EnablePersistency(bool enable) {
|
||||
#ifdef VERBOSE
|
||||
if (enable)
|
||||
@@ -366,8 +353,6 @@ void qTabPlot::EnablePersistency(bool enable) {
|
||||
myPlot->SetPersistency(0);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetTitles() {
|
||||
#ifdef VERBOSE
|
||||
cout << "Setting Plot Titles" << endl;
|
||||
@@ -394,8 +379,6 @@ void qTabPlot::SetTitles() {
|
||||
myPlot->SetImageZAxisTitle(dispZAxis->text());
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::EnableTitles() {
|
||||
// Plot Title
|
||||
dispTitle->setEnabled(chkTitle->isChecked());
|
||||
@@ -433,15 +416,12 @@ void qTabPlot::EnableTitles() {
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::checkAspectRatio() {
|
||||
if (chkAspectRatio->isChecked()) {
|
||||
maintainAspectRatio(-1);
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::maintainAspectRatio(int axis) {
|
||||
#ifdef VERBOSE
|
||||
@@ -581,8 +561,6 @@ void qTabPlot::maintainAspectRatio(int axis) {
|
||||
myPlot->SetXYRange(true);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::EnableXRange() {
|
||||
#ifdef VERBOSE
|
||||
cout << "Enable X Axis Range" << endl;
|
||||
@@ -620,8 +598,6 @@ void qTabPlot::EnableXRange() {
|
||||
EnableRange();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::EnableYRange() {
|
||||
#ifdef VERBOSE
|
||||
cout << "Enable Y Axis Range" << endl;
|
||||
@@ -659,8 +635,6 @@ void qTabPlot::EnableYRange() {
|
||||
EnableRange();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::EnableRange() {
|
||||
#ifdef VERBOSE
|
||||
cout << "Enable Axes Range" << endl;
|
||||
@@ -673,8 +647,6 @@ void qTabPlot::EnableRange() {
|
||||
SetAxesRange();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetXAxisRange() {
|
||||
#ifdef VERBOSE
|
||||
cout << "Setting X Axis Range" << endl;
|
||||
@@ -705,8 +677,6 @@ void qTabPlot::SetXAxisRange() {
|
||||
SetAxesRange();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetYAxisRange() {
|
||||
#ifdef VERBOSE
|
||||
cout << "Setting Y Axis Range" << endl;
|
||||
@@ -737,8 +707,6 @@ void qTabPlot::SetYAxisRange() {
|
||||
SetAxesRange();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetAxesRange() {
|
||||
#ifdef VERBOSE
|
||||
cout << "Setting Axes Range" << endl;
|
||||
@@ -773,7 +741,6 @@ void qTabPlot::SetAxesRange() {
|
||||
myPlot->SetXYRange(true);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetZRange() {
|
||||
emit ResetZMinZMaxSignal(
|
||||
@@ -783,7 +750,6 @@ void qTabPlot::SetZRange() {
|
||||
dispZMax->text().toDouble());
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::EnableZRange() {
|
||||
|
||||
@@ -802,7 +768,6 @@ void qTabPlot::EnableZRange() {
|
||||
connect(dispZMax, SIGNAL(editingFinished()), this, SLOT(SetZRange()));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
bool qTabPlot::CheckZRange(QString value) {
|
||||
if (value.isEmpty())
|
||||
@@ -820,7 +785,6 @@ bool qTabPlot::CheckZRange(QString value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetPlot() {
|
||||
#ifdef VERBOSE
|
||||
@@ -890,7 +854,6 @@ void qTabPlot::SetPlot() {
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetFrequency() {
|
||||
#ifdef VERBOSE
|
||||
@@ -1029,8 +992,6 @@ void qTabPlot::SetFrequency() {
|
||||
qDefs::checkErrorMessage(myDet, "qTabPlot::SetFrequency");
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::EnableScanBox(){
|
||||
#ifdef VERBOSE
|
||||
cout << "Entering Enable Scan Box"<< endl;
|
||||
@@ -1218,7 +1179,6 @@ void qTabPlot::SetFrequency() {
|
||||
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetScanArgument(){
|
||||
#ifdef VERYVERBOSE
|
||||
@@ -1332,7 +1292,6 @@ void qTabPlot::SetFrequency() {
|
||||
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetBinary() {
|
||||
//1d
|
||||
@@ -1387,7 +1346,6 @@ void qTabPlot::SetBinary() {
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::SetHistogramOptions() {
|
||||
if (radioHistIntensity->isChecked()) {
|
||||
@@ -1399,7 +1357,6 @@ void qTabPlot::SetHistogramOptions() {
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::EnableGapPixels(bool enable) {
|
||||
#ifdef VERBOSE
|
||||
@@ -1415,7 +1372,6 @@ void qTabPlot::EnableGapPixels(bool enable) {
|
||||
connect(chkGapPixels, SIGNAL(toggled(bool)), this, SLOT(EnableGapPixels(bool)));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabPlot::Refresh() {
|
||||
#ifdef VERBOSE
|
||||
|
||||
Reference in New Issue
Block a user