diff --git a/about.png b/about.png new file mode 100644 index 0000000..07cfce8 Binary files /dev/null and b/about.png differ diff --git a/customSplashScreen.cpp b/customSplashScreen.cpp new file mode 100644 index 0000000..18f2d3e --- /dev/null +++ b/customSplashScreen.cpp @@ -0,0 +1,33 @@ +#include "customSplashScreen.h" + +customSplashScreen::customSplashScreen(const QPixmap& pixmap) +{ + QSplashScreen::setPixmap(pixmap); +} + +customSplashScreen::~customSplashScreen() +{ +} + +void customSplashScreen::drawContents(QPainter *painter) +{ + QPixmap textPix = QSplashScreen::pixmap(); + painter->setPen(this->color); + painter->drawText(this->rect, this->alignement, this->message); +} + +void customSplashScreen::showStatusMessage(const QString &message, const QColor &color) +{ + this->message = message; + this->color = color; + this->showMessage(this->message, this->alignement, this->color); +} + +void customSplashScreen::setMessageRect(QRect rect, int alignement) +{ + this->rect = rect; + this->alignement = alignement; +} + + + diff --git a/customSplashScreen.h b/customSplashScreen.h new file mode 100644 index 0000000..8381fba --- /dev/null +++ b/customSplashScreen.h @@ -0,0 +1,22 @@ +#ifndef CUSTOMSPLASHSCREEN_H +#define CUSTOMSPLASHSCREEN_H + +#include +#include + +class customSplashScreen : public QSplashScreen +{ +public: + customSplashScreen(const QPixmap& pixmap); + ~customSplashScreen(); + virtual void drawContents(QPainter *painter); + void showStatusMessage(const QString &message, const QColor &color = Qt::black); + void setMessageRect(QRect rect, int alignment = Qt::AlignLeft); +private: + QString message; + int alignement; + QColor color; + QRect rect; +}; + +#endif // CUSTOMSPLASHSCREEN_H diff --git a/dialogshowpic.cpp b/dialogshowpic.cpp new file mode 100644 index 0000000..dadb127 --- /dev/null +++ b/dialogshowpic.cpp @@ -0,0 +1,99 @@ +#include "dialogshowpic.h" +#include "ui_dialogshowpic.h" + +#include "qcustomplot.h" +#include "mainwindow.h" +#include "Toolkit.h" + +DialogShowPic::DialogShowPic(QWidget *parent) : + QDialog(parent), + ui(new Ui::DialogShowPic) +{ + ui->setupUi(this); + + setupShowGraph(ui->widget); +} + +int number=1; + +void DialogShowPic::setupShowGraph(QCustomPlot *customPlot) +{ + TMatrixF matrix = MainWindow::getTMatrix(number); + // TMatrixF matrix(1,1); + + QCPColorMap *colorMap = new QCPColorMap(customPlot->xAxis,customPlot->yAxis); + customPlot->axisRect()->setupFullAxesBox(true); + customPlot->xAxis->setLabel("x [pixel]"); + customPlot->yAxis->setLabel("y [pixel]"); + + //customPlot->addPlottable(colorMap); + colorMap->data()->setSize(matrix.GetColUpb(), matrix.GetColUpb()); + colorMap->data()->setRange(QCPRange(0, matrix.GetColUpb()), QCPRange(0, matrix.GetColUpb())); + + for (int x=0; xdata()->setCell(x, y, matrix(x,y)); + colorMap->setGradient(QCPColorGradient::gpJet); + colorMap->rescaleDataRange(true); + customPlot->rescaleAxes(); + colorMap->setDataRange(QCPRange(0,256)); + customPlot->replot(); +} + + +DialogShowPic::~DialogShowPic() +{ + delete ui; +} + +void DialogShowPic::replotGraph() +{ + TMatrixF matrix = MainWindow::getTMatrix(number); + + ui->widget->clearPlottables(); + + ui->widget->xAxis->setRange(QCPRange(0, matrix.GetColUpb())); + ui->widget->yAxis->setRange(QCPRange(0, matrix.GetColUpb())); + QCPColorMap *colorMap = new QCPColorMap( ui->widget->xAxis, ui->widget->yAxis); + + Int_t a = matrix.GetColUpb(); + Int_t b = matrix.GetNcols(); + //cout<widget->addPlottable(colorMap); + + colorMap->data()->setSize(matrix.GetNcols(), matrix.GetNcols()); + colorMap->data()->setRange(QCPRange(0, matrix.GetColUpb()), QCPRange(0, matrix.GetColUpb())); + + for (int x=0; xdata()->setCell(x, y, matrix(x,y)); + colorMap->setGradient(QCPColorGradient::gpCold); + colorMap->rescaleDataRange(true); + ui->widget->rescaleAxes(); + colorMap->setDataRange(QCPRange(0,256)); + ui->widget->replot(); +} + +void DialogShowPic::on_pushButtonPlus_clicked() +{ + number++; + + int newInt = number+1; + string numberString = castIntToString(newInt); + ui->labelNo->setText(QString::fromStdString(numberString)); + replotGraph(); +} + +void DialogShowPic::on_pushButtonMinus_clicked() +{ + if (number>0) + { + number--; + int newInt = number+1; + string numberString = castIntToString(newInt); + ui->labelNo->setText(QString::fromStdString(numberString)); + replotGraph(); + } +} + + diff --git a/dialogshowpic.h b/dialogshowpic.h new file mode 100644 index 0000000..0d3f166 --- /dev/null +++ b/dialogshowpic.h @@ -0,0 +1,32 @@ +#ifndef DIALOGSHOWPIC_H +#define DIALOGSHOWPIC_H + +#include +#include "qcustomplot.h" +//#include "mainwindow.h" + +namespace Ui { +class DialogShowPic; +} + +class DialogShowPic : public QDialog +{ + Q_OBJECT + +public: + explicit DialogShowPic(QWidget *parent = 0); + ~DialogShowPic(); + + void setupShowGraph(QCustomPlot *customPlot); + void replotGraph(); + +private slots: + void on_pushButtonPlus_clicked(); + + void on_pushButtonMinus_clicked(); + +private: + Ui::DialogShowPic *ui; +}; + +#endif // DIALOGSHOWPIC_H