mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
WIP
This commit is contained in:
@ -36,7 +36,7 @@ class qCloneWidget : public QMainWindow {
|
||||
* @param lines style of plot if lines or dots
|
||||
* @param markers style of plot markers or not
|
||||
*/
|
||||
void SetCloneHists(unsigned int nHists, int histNBins, double *histXAxis, std::vector<double*> histYAxis, std::vector<std::string> histTitle, bool lines, bool markers);
|
||||
void SetCloneHists(unsigned int nHists, int histNBins, double *histXAxis, std::vector<double*> histYAxis, QString histTitle, bool lines, bool markers);
|
||||
|
||||
/**
|
||||
* Get the 1D hist values to plot for angle plotting
|
||||
|
@ -79,13 +79,11 @@ class qDrawPlot : public QWidget {
|
||||
private slots:
|
||||
void SetSaveFileName(QString val);
|
||||
void CloneCloseEvent(int id);
|
||||
|
||||
|
||||
void UpdatePlot();
|
||||
void AcquireThread();
|
||||
|
||||
signals:
|
||||
void UpdatingPlotFinished();
|
||||
void UpdatePlotSignal();
|
||||
void AcquireSignal();
|
||||
void AcquireFinishedSignal();
|
||||
|
||||
private:
|
||||
void SetupWidgetWindow();
|
||||
@ -98,23 +96,15 @@ class qDrawPlot : public QWidget {
|
||||
void GetStatistics(double &min, double &max, double &sum, double *array, int size);
|
||||
void DetachHists();
|
||||
void UpdateXYRange();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool StartOrStopThread(bool start);
|
||||
void SetupMeasurement();
|
||||
static void *DataStartAcquireThread(void *this_pointer);
|
||||
static int GetDataCallBack(detectorData *data, int fIndex, int subIndex, void *this_pointer);
|
||||
int GetData(detectorData *data, int fIndex, int subIndex);
|
||||
static int GetAcquisitionFinishedCallBack(double currentProgress, int detectorStatus, void *this_pointer);
|
||||
int AcquisitionFinished(double currentProgress, int detectorStatus);
|
||||
static int GetMeasurementFinishedCallBack(int currentMeasurementIndex, int fileIndex, void *this_pointer);
|
||||
int MeasurementFinished(int currentMeasurementIndex, int fileIndex);
|
||||
static int GetProgressCallBack(double currentProgress, void *this_pointer);
|
||||
static void GetProgressCallBack(double currentProgress, void *this_pointer);
|
||||
static void GetAcquisitionFinishedCallBack(double currentProgress, int detectorStatus, void *this_pointer);
|
||||
static void GetMeasurementFinishedCallBack(int currentMeasurementIndex, void *this_pointer);
|
||||
static void GetDataCallBack(detectorData *data, uint64_t frameIndex, uint32_t subFrameIndex, void *this_pointer);
|
||||
void AcquisitionFinished(double currentProgress, int detectorStatus);
|
||||
void MeasurementFinished(int currentMeasurementIndex);
|
||||
void GetData(detectorData *data, uint64_t frameIndex, uint32_t subFrameIndex);
|
||||
void toDoublePixelData(double *dest, char *source, int size, int databytes, int dr, double *gaindest = NULL);
|
||||
|
||||
void UpdatePlot();
|
||||
|
||||
static const int NUM_PEDESTAL_FRAMES = 20;
|
||||
multiSlsDetector *myDet;
|
||||
@ -131,14 +121,10 @@ class qDrawPlot : public QWidget {
|
||||
|
||||
bool is1d{true};
|
||||
bool isRunning{false};
|
||||
int progress{0};
|
||||
|
||||
|
||||
// titles
|
||||
QString plotTitle{""};
|
||||
QString plotTitle_prefix{""};
|
||||
QLabel *lblFrameIndexTitle1d{nullptr};
|
||||
std::vector<std::string> title1d;
|
||||
std::string title2d{""};
|
||||
QString xTitle1d{"Channel Number"};
|
||||
QString yTitle1d{"Counts"};
|
||||
QString xTitle2d{"Pixel"};
|
||||
@ -155,11 +141,12 @@ class qDrawPlot : public QWidget {
|
||||
double *data2d{nullptr};
|
||||
|
||||
//options
|
||||
bool binary{false};
|
||||
bool plotEnable{true};
|
||||
bool binary{false};
|
||||
int binaryFrom{0};
|
||||
int binaryTo{0};
|
||||
int persistency{0};
|
||||
int currentPersistency0};
|
||||
int currentPersistency{0};
|
||||
bool isLines{true};
|
||||
bool isMarkers{false};
|
||||
QwtSymbol *marker{nullptr};
|
||||
@ -191,9 +178,9 @@ class qDrawPlot : public QWidget {
|
||||
double endPixel{0};
|
||||
double pixelWidth{0};
|
||||
|
||||
int progress{0};
|
||||
int64_t currentMeasurement{0};
|
||||
int64_t currentFrame{0};
|
||||
int64_t lastImageNumber{0};
|
||||
pthread_mutex_t lastImageCompleteMutex;
|
||||
|
||||
const static int npixelsx_jctb = 400;
|
||||
|
@ -124,7 +124,7 @@ void qCloneWidget::SetupWidgetWindow(QString title, QString xTitle, QString yTit
|
||||
resize(500, 350);
|
||||
}
|
||||
|
||||
void qCloneWidget::SetCloneHists(unsigned int nHists, int histNBins, double *histXAxis, std::vector<double*> histYAxis, std::vector<std::string> histTitle, bool lines, bool markers) {
|
||||
void qCloneWidget::SetCloneHists(unsigned int nHists, int histNBins, double *histXAxis, std::vector<double*> histYAxis, QString histTitle, bool lines, bool markers) {
|
||||
//for each plot, create hists
|
||||
for (unsigned int hist_num = 0; hist_num < nHists; ++hist_num) {
|
||||
SlsQtH1D *h = new SlsQtH1D("1d plot", histNBins, histXAxis, histYAxis[hist_num]);
|
||||
@ -138,13 +138,14 @@ void qCloneWidget::SetCloneHists(unsigned int nHists, int histNBins, double *his
|
||||
cloneplot1D_hists.append(h);
|
||||
h->Attach(cloneplot1D);
|
||||
|
||||
lblHistTitle->setText(QString(histTitle[0].c_str()));
|
||||
lblHistTitle->setText(histTitle);
|
||||
}
|
||||
}
|
||||
|
||||
void qCloneWidget::SetCloneHists2D(int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, double *d) {
|
||||
void qCloneWidget::SetCloneHists2D(int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, double *d, QwtText frameIndexTitle) {
|
||||
cloneplot2D->GetPlot()->SetData(nbinsx, xmin, xmax, nbinsy, ymin, ymax, d);
|
||||
cloneplot2D->KeepZRangeIfSet();
|
||||
cloneplot2D->setTitle(frameIndexTitle);
|
||||
}
|
||||
|
||||
void qCloneWidget::SetRange(bool IsXYRange[], double XYRange[]) {
|
||||
|
@ -699,7 +699,7 @@ void qDetectorMain::EnableTabs() {
|
||||
tabDeveloper->Refresh();
|
||||
|
||||
tabPlot->Refresh();
|
||||
myPlot->StartStopDaqToggle();
|
||||
myPlot->StartAcquisition();
|
||||
} else { // to enable scan box
|
||||
tabPlot->Refresh();
|
||||
// to start adc timer
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -523,16 +523,18 @@ void qTabMeasurement::SetRunIndex(int val) {
|
||||
|
||||
void qTabMeasurement::ResetProgress() {
|
||||
FILE_LOG(logDEBUG) << "Resetting progress";
|
||||
lblCurrentFrame->setText(QString::number(0));
|
||||
lblCurrentMeasurement->setText(QString::number(0));
|
||||
lblCurrentFrame->setText("");
|
||||
lblCurrentMeasurement->setText("");
|
||||
progressBar->setValue(0);
|
||||
}
|
||||
|
||||
void qTabMeasurement::UpdateProgress() {
|
||||
FILE_LOG(logDEBUG) << "Updating progress";
|
||||
progressBar->setValue(myPlot->GetProgress());
|
||||
lblCurrentFrame->setText(QString::number(myPlot->GetCurrentFrameIndex()));
|
||||
lblCurrentMeasurement->setText(QString::number(myPlot->GetCurrentMeasurementIndex()));
|
||||
int64_t temp = myPlot->GetCurrentFrameIndex();
|
||||
lblCurrentFrame->setText(temp >= 0 ? QString::number(temp) : "");
|
||||
temp = myPlot->GetCurrentMeasurementIndex();
|
||||
lblCurrentMeasurement->setText(temp >= 0 ? QString::number(temp) : "");
|
||||
}
|
||||
|
||||
int qTabMeasurement::VerifyOutputDirectoryError() {
|
||||
@ -574,8 +576,8 @@ void qTabMeasurement::StartAcquisition() {
|
||||
}
|
||||
|
||||
FILE_LOG(logINFOBLUE) << "Starting Acquisition";
|
||||
lblCurrentFrame->setText(QString::number(0));
|
||||
lblCurrentMeasurement->setText(QString::number(0));
|
||||
lblCurrentFrame->setText("");
|
||||
lblCurrentMeasurement->setText("");
|
||||
Enable(0);
|
||||
progressBar->setValue(0);
|
||||
progressTimer->start(100);
|
||||
|
Reference in New Issue
Block a user