:wq
B:wq
:wq
:wq
B
B
B
B

B
A
A
C
This commit is contained in:
jussi 2018-12-13 21:31:36 +02:00
commit 7f741daacb
10 changed files with 37846 additions and 0 deletions

425
editprofile.cpp Normal file
View File

@ -0,0 +1,425 @@
#include "editprofile.h"
#include "ui_editprofile.h"
#include "mainwindow.h"
editProfile::editProfile(QWidget *parent) :
QDialog(parent),
ui(new Ui::editProfile)
{
ui->setupUi(this);
// Define the filler line vectors and graphs so they don't need to be recreated every update
leftLineX.append(x_lower);
leftLineX.append(0);
leftLineY.append(0);
leftLineY.append(0);
rightLineX.append(0);
rightLineX.append(x_upper);
rightLineY.append(0);
rightLineY.append(0);
ui->curvePlot->addGraph();
ui->curvePlot->addGraph();
ui->curvePlot->addGraph();
ui->curvePlot->graph(0)->setScatterStyle(QCPScatterStyle::ssCircle);
ui->curvePlot->graph(0)->setLineStyle(QCPGraph::lsLine);
//ui->curvePlot->setInteractions(QCP::iSelectItems | QCP::iSelectPlottables);
//ui->curvePlot->graph(0)->setSelectable(QCP::SelectionType::stSingleData);
ui->curvePlot->xAxis->setLabel("Temperature");
ui->curvePlot->yAxis->setLabel("Fan speed (%)");
ui->curvePlot->xAxis->setRange(x_lower, (x_upper+5));
ui->curvePlot->yAxis->setRange(y_lower, (y_upper+5));
//connect(ui->curvePlot, SIGNAL(on_clickedGraph(QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent*)), SLOT(getDataIndex(QCPAbstractPlottable *plottable, int dataIndex)));
connect(ui->curvePlot, SIGNAL(mouseDoubleClick(QMouseEvent*)), SLOT(clickedGraph(QMouseEvent*)));
//connect(ui->curvePlot, SIGNAL(mouseMove(QMouseEvent*)), SLOT(getPixelLength(QMouseEvent*)));
connect(ui->curvePlot, SIGNAL(plottableClick(QCPAbstractPlottable*,int,QMouseEvent*)), SLOT(clickedPoint(QCPAbstractPlottable*,int,QMouseEvent*)));
connect(ui->curvePlot, SIGNAL(mousePress(QMouseEvent*)), SLOT(detectPress(QMouseEvent*)));
connect(ui->curvePlot, SIGNAL(mouseMove(QMouseEvent*)), SLOT(detectMove(QMouseEvent*)));
connect(ui->curvePlot, SIGNAL(mouseRelease(QMouseEvent*)), SLOT(detectRelease(QMouseEvent*)));
connect(ui->curvePlot, SIGNAL(mouseMove(QMouseEvent*)), SLOT(getYcoordValue(QMouseEvent*)));
}
editProfile::~editProfile()
{
delete ui;
}
void editProfile::addPoint(double x, double y)
{
y = round(y);
x = round(x);
checkForDuplicatePoint(x, y);
if ((x_lower<=x) && (x<=x_upper) && (y_lower<=y) && (y<=y_upper) && !duplicatePoint) {
qv_x.append(x);
qv_y.append(y);
}
}
void editProfile::rePlot()
{
ui->curvePlot->replot();
ui->curvePlot->update();
}
void editProfile::clickedGraph(QMouseEvent *event)
{
QPoint point = event->pos();
addPoint(ui->curvePlot->xAxis->pixelToCoord(point.x()), ui->curvePlot->yAxis->pixelToCoord(point.y()));
ui->curvePlot->graph(0)->setData(qv_x, qv_y);
drawFillerLines();
}
void editProfile::clickedPoint(QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent *event)
{
checkForNearbyPoints(event);
//double ycoord = ui->curvePlot->graph(0)->dataMainValue(dataIndex);
//double xcoord = ui->curvePlot->graph(0)->dataSortKey(dataIndex);
ycoord = round(ycoord);
xcoord = round(xcoord);
if (isNearbyPoint) {
for (int i=0; i<qv_y.length(); i++ ) {
qv_y[i] = round(qv_y[i]);
qv_x[i] = round(qv_x[i]);
if ((qv_x[i] == xcoord) && (qv_y[i] == ycoord)) {
qv_x.remove(i);
qv_y.remove(i);
break;
}
}
ui->curvePlot->graph(0)->setData(qv_x, qv_y);
rePlot();
drawFillerLines();
}
}
bool editProfile::checkForNearbyPoints(QMouseEvent *event)
{
QPoint point = event->pos();
double pointerxcoord = ui->curvePlot->xAxis->pixelToCoord(point.x());
double pointerycoord = ui->curvePlot->yAxis->pixelToCoord(point.y());
for (int i=0; i<qv_x.length(); i++) {
if ((abs(pointerxcoord - qv_x[i]) < selectionPrecision) && abs(pointerycoord - qv_y[i]) < selectionPrecision) {
isNearbyPoint = true;
break;
}
else {
isNearbyPoint = false;
}
}
return isNearbyPoint;
}
int editProfile::getDataIndex(QCPAbstractPlottable *plottable, int dataIndex)
{
dataIndex = pointIndex;
qDebug() << pointIndex;
return pointIndex;
}
bool editProfile::checkForDuplicatePoint(int x, int y)
// Return true if there is a duplicate point
{
for (int i=0; i<qv_x.length(); i++) {
qv_x[i] = round(qv_x[i]);
qv_y[i] = round(qv_y[i]);
if ((x == qv_x[i]) && (y == qv_y[i])) {
duplicatePoint = true;
}
}
return duplicatePoint;
}
int editProfile::getXcoordValue(int xcoord)
{
getXPointIndex(xcoord, ycoord);
return xcoord;
}
int editProfile::getYcoordValue(QMouseEvent *event)
{
//Gets the indices of points that match the current cursor location
QPoint point = event->pos();
double pointerycoord = ui->curvePlot->yAxis->pixelToCoord(point.y());
double pointerxcoord = ui->curvePlot->xAxis->pixelToCoord(point.x());
for (int i=0; i<qv_y.length(); i++) {
if ((abs(pointerxcoord - qv_x[i]) < selectionPrecision) && abs(pointerycoord - qv_y[i]) < selectionPrecision) {
xcoord = qv_x[i];
ycoord = qv_y[i];
break;
}
}
getXcoordValue(xcoord);
return ycoord;
}
bool editProfile::detectMove(QMouseEvent *event)
{
mouseMoving = true;
if (mouseMoving && mousePressed) {
initializeDragging(event);
}
return mouseMoving;
}
bool editProfile::detectPress(QMouseEvent *event)
{
mousePressed = true;
if (mouseMoving && mousePressed) {
initializeDragging(event);
}
return mousePressed;
}
bool editProfile::initializeDragging(QMouseEvent *event)
{
// Decides whether to start dragging the point
mouseDragging = true;
checkForNearbyPoints(event);
if (isNearbyPoint || draggingPoint) {
dragPoint(index_x, index_y, event);
draggingPointSet();
}
return mouseDragging;
}
int editProfile::getXPointIndex(int xcoord, int ycoord)
{
// Gets the indices of the point that the mouse has hovered over
if (qv_x.length() > 0) {
for (int i=0; i<qv_x.length(); i++) {
if ((qv_x[i] == xcoord) && (qv_y[i] == ycoord)) {
index_x = i;
index_y = i;
break;
}
}
getYPointIndex(index_y);
return index_x;
}
}
int editProfile::getYPointIndex(int index_y)
{
qDebug() << index_x << index_y;
return index_y;
}
void editProfile::dragPoint(int index_x, int index_y, QMouseEvent* event)
{
// Moves the selected point by index
// Sleep here so we don't take up so much CPU time
QThread::msleep(10);
ui->curvePlot->clearItems();
drawCoordtext(index_x, index_y);
QPoint point = event->pos();
qv_y[index_y] = round(ui->curvePlot->yAxis->pixelToCoord(point.y()));
qv_x[index_x] = round(ui->curvePlot->xAxis->pixelToCoord(point.x()));
if (qv_x[index_x] > x_upper) {
qv_x[index_x] = x_upper;
}
if (qv_x[index_x] < x_lower) {
qv_x[index_x] = x_lower;
}
if (qv_y[index_y] > y_upper) {
qv_y[index_y] = y_upper;
}
if (qv_y[index_y] < y_lower) {
qv_y[index_y] = y_lower;
}
ui->curvePlot->graph(0)->setData(qv_x, qv_y);
drawFillerLines();
}
void editProfile::drawCoordtext(int index_x, int index_y)
{
QCPItemText *coordText = new QCPItemText(ui->curvePlot);
if (draggingPoint) {
if (qv_x[index_x] > x_upper) {
qv_x[index_x] = x_upper;
}
if (qv_x[index_x] < x_lower) {
qv_x[index_x] = x_lower;
}
if (qv_y[index_y] > y_upper) {
qv_y[index_y] = y_upper;
}
if (qv_y[index_y] < y_lower) {
qv_y[index_y] = y_lower;
}
coordText->position->setType(QCPItemPosition::ptPlotCoords);
coordText->position->setCoords(qv_x[index_x], qv_y[index_y] + 4);
QString xString = QString::number(qv_x[index_x]);
QString yString = QString::number(qv_y[index_y]);
coordText->setText(xString + ", " + yString);
}
if (!mouseDragging) {
ui->curvePlot->clearItems();
}
}
void editProfile::drawFillerLines()
{
// Draw the filler lines separately so they don't interfere with the main data. graph(1) = leftward line, graph(2) = rightward line
leftLineX[1] = ui->curvePlot->graph(0)->dataSortKey(0);
leftLineY[0] = ui->curvePlot->graph(0)->dataMainValue(0);
leftLineY[1] = ui->curvePlot->graph(0)->dataMainValue(0);
ui->curvePlot->graph(1)->setData(leftLineX, leftLineY);
rightLineX[0] = ui->curvePlot->graph(0)->dataSortKey(qv_x.length() -1);
rightLineY[0] = ui->curvePlot->graph(0)->dataMainValue(qv_x.length() -1);
rightLineY[1] = ui->curvePlot->graph(0)->dataMainValue(qv_x.length() -1);
ui->curvePlot->graph(2)->setData(rightLineX, rightLineY);
rePlot();
}
bool editProfile::detectRelease(QMouseEvent *event)
{
mousePressed = false;
resetMouseMove();
resetMouseDragging();
draggedIndicesUnset();
draggingPointUnset();
drawCoordtext(index_x, index_y);
return mousePressed;
}
bool editProfile::draggingPointUnset()
{
draggingPoint = false;
return draggingPoint;
}
bool editProfile::draggingPointSet()
{
draggingPoint = true;
return draggingPoint;
}
bool editProfile::draggedIndicesSet()
{
indicesSet = true;
return indicesSet;
}
bool editProfile::draggedIndicesUnset()
{
indicesSet = false;
return indicesSet;
}
bool editProfile::resetMouseMove()
{
mouseMoving = false;
return mouseMoving;
}
bool editProfile::resetMouseDragging()
{
mouseDragging = false;
return mouseDragging;
}
double editProfile::getPixelLength(QMouseEvent *event)
{
QPoint point = event->pos();
qDebug() << ui->curvePlot->graph(0)->selectTest(point, 2);
qDebug() << pixelLength;
return pixelLength;
}
void editProfile::on_pushButton_clicked()
{
MainWindow mw;
ui->curvePlot->clearItems();
qDebug() << mw.voltInt;
}
void editProfile::on_saveButton_clicked()
{
/*QFile file("C:/Users/Gnometech/Documents/rojekti/test.xml");
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
document.setContent(&file);
file.close();
// Remove existing xpoints and ypoints attributes
QDomElement root = document.firstChildElement();
QDomNodeList ypoints =root.elementsByTagName("ypoints");
QDomNode ypntnode = ypoints.item(0);
QDomNodeList xpoints =root.elementsByTagName("xpoints");
QDomNode xpntnode = xpoints.item(0);
QString xString;
QString yString;
// Add the curve points to strings
for (int i=0; i<qv_x.length(); i++) {
QString x = QString::number(ui->curvePlot->graph(0)->dataSortKey(i));
QString y = QString::number(ui->curvePlot->graph(0)->dataMainValue(i));
xString.append(x + ", ");
yString.append(y + ", ");
if (ypntnode.isElement()) {
QDomElement elem = ypntnode.toElement();
if (elem.hasAttribute("ypoints")) {
elem.removeAttribute("ypoints");
elem.setAttribute("ypoints", yString);
}
}
if (xpntnode.isElement()) {
QDomElement elem = xpntnode.toElement();
elem.removeAttribute("xpoints");
elem.setAttribute("xpoints", xString);
}
}
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream stream(&file);
stream << document.toString();
file.close();
qDebug() << "valmis";
}
} */
QString xString;
QString yString;
for (int i=0; i<qv_x.length(); i++) {
QString x = QString::number(ui->curvePlot->graph(0)->dataSortKey(i));
QString y = QString::number(ui->curvePlot->graph(0)->dataMainValue(i));
xString.append(x + ", ");
yString.append(y + ", ");
}
QVariant xarray = xString;
QVariant yarray = yString;
qDebug() << xarray.toString() << yarray.toString();
QSettings settings("nvfancurve");
settings.setValue("profile/curveXpoints", xarray);
settings.setValue("profile/curveYpoints", yarray);
}
void editProfile::on_clearButton_clicked()
{
MainWindow mw;
qv_x.clear();
qv_y.clear();
qDebug() << mw.currentProfile;
ui->curvePlot->graph(0)->setData(qv_x, qv_y);
drawFillerLines();
}

100
editprofile.h Normal file
View File

@ -0,0 +1,100 @@
#ifndef EDITPROFILE_H
#define EDITPROFILE_H
#include <QDialog>
#include <QVector>
#include "qcustomplot.h"
#include <QFile>
#include <QDomNode>
#include <QString>
#include <QTextStream>
#include <QPainter>
#include <QLine>
namespace Ui {
class editProfile;
}
class editProfile : public QDialog
{
Q_OBJECT
public:
explicit editProfile(QWidget *parent = nullptr);
~editProfile();
QVector<double> qv_x, qv_y;
QVector<int> cpoints_x, cpoints_y;
signals:
void on_clickedPoint(QMouseEvent *event);
void on_dragPoint(bool);
void on_clickedGraph(bool);
private slots:
void clickedGraph(QMouseEvent *event);
void rePlot();
void addPoint(double x, double y);
void on_pushButton_clicked();
void clickedPoint(QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent *event);
//void getDataPoints();
void on_saveButton_clicked();
void drawCoordtext(int index_x, int index_y);
double getPixelLength(QMouseEvent *event);
bool initializeDragging(QMouseEvent *event);
bool detectMove(QMouseEvent *event);
bool detectPress(QMouseEvent *event);
bool detectRelease(QMouseEvent *event);
bool checkForDuplicatePoint(int x, int y);
int getDataIndex(QCPAbstractPlottable *plottable, int dataIndex);
int getYcoordValue(QMouseEvent *event);
int getXcoordValue(int xcoord);
int getXPointIndex(int xcoord, int ycoord);
int getYPointIndex(int index_y);
bool resetMouseMove();
bool resetMouseDragging();
bool checkForNearbyPoints(QMouseEvent *event);
bool draggedIndicesSet();
bool draggedIndicesUnset();
void dragPoint(int index_x, int index_y, QMouseEvent *event);
bool draggingPointSet();
bool draggingPointUnset();
void drawFillerLines();
void on_clearButton_clicked();
private:
Ui::editProfile *ui;
QDomDocument document;
//QVector<double> qv_x, qv_y;
QVector<double> leftLineX;
QVector<double> leftLineY;
QVector<double> rightLineX;
QVector<double> rightLineY;
QVector<int> curvepoints;
QPair<int, int> curvepoint;
//QCPItemText *coordText;
int x_lower = 0;
int x_upper = 100;
int y_lower = 0;
int y_upper = 100;
double pixelLength;
double selectionPrecision = 2;
bool mouseMoving = false;
bool mousePressed = false;
bool mouseDragging = false;
bool duplicatePoint = false;
bool isNearbyPoint = false;
bool coordTextCreated = false;
int pointIndex;
int y_length;
int x_length;
int xcoord;
int ycoord;
int index_x = 0;
int index_y = 0;
bool indicesSet = false;
bool draggingPoint = false;
};
#endif // EDITPROFILE_H

63
editprofile.ui Normal file
View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>editProfile</class>
<widget class="QDialog" name="editProfile">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>663</width>
<height>565</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="3">
<widget class="QCustomPlot" name="curvePlot" native="true">
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This graph defines the relation of fan speed to the GPU temperature.&lt;/p&gt;&lt;p&gt;To add a point, double click on the area.&lt;/p&gt;&lt;p&gt;To remove a point, click on it,&lt;/p&gt;&lt;p&gt;To move a point, drag it.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="clearButton">
<property name="text">
<string>Clear curve points</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="saveButton">
<property name="maximumSize">
<size>
<width>794</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Save</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>testinappi</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QCustomPlot</class>
<extends>QWidget</extends>
<header>qcustomplot.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

12
main.cpp Normal file
View File

@ -0,0 +1,12 @@
#include "mainwindow.h"
#include <QApplication>
#include "editprofile.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}

130
mainwindow.cpp Normal file
View File

@ -0,0 +1,130 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "editprofile.h"
#include "ui_editprofile.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
checkForProfiles();
ui->frequencySlider->setRange(-100, 1000);
ui->frequencySpinBox->setRange(-100, 1000);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_actionEdit_current_profile_triggered(bool)
{
//editProfile editprof;
//editprof.setModal(false);
//editprof.exec();
editProfile *editprof = new editProfile(this);
editprof->show();
}
void MainWindow::on_pushButton_clicked()
{
qDebug() << currentProfile;
queryGPUSettings();
}
void MainWindow::checkForProfiles()
{
// If there are no profiles, create one, then list all the entries whose isProfile is true in the profile selection combo box
QSettings settings("nvfancurve");
QStringList groups = settings.childGroups();
QString isProfile = "/isProfile";
for (int i=0; i<groups.length(); i++) {
// Make a query $profile/isProfile
QString group = groups[i];
QString query = group.append(isProfile);
if (settings.value(query).toBool()) {
noProfiles = false;
break;
}
}
if (noProfiles) {
settings.setValue("New Profile/isProfile", true);
}
// Redefine child groups so it contains the newly created profile if it was made
QStringList newgroups = settings.childGroups();
for (int i=0; i<newgroups.length(); i++) {
// Make a query $profile/isProfile
QString group = newgroups[i];
QString query = group.append(isProfile);
if (settings.value(query).toBool()) {
ui->profileComboBox->addItem(newgroups[i]);
}
}
}
void MainWindow::on_profileComboBox_activated(const QString &arg1)
{
// Change currentProfile to combobox selection
currentProfile = arg1;
}
void MainWindow::getGPUInfo()
{
}
void MainWindow::queryGPUSettings()
{
QString volt;
QProcess process;
process.start(nvVoltQ);
process.waitForFinished(-1);
volt = process.readLine();
volt.chop(1);
voltInt = volt.toInt()/1000;
qDebug() << voltInt;
QString voltOfs;
process.start(nvVoltOfsQ);
process.waitForFinished(-1);
voltOfs = process.readLine();
voltOfs.chop(1);
voltOfsInt = voltOfs.toInt();
qDebug() << voltOfsInt;
QString coreFreqOfs;
process.start(nvCoreClkOfsQ);
process.waitForFinished(-1);
coreFreqOfs = process.readLine();
coreFreqOfs.chop(1);
coreFreqOfsInt = coreFreqOfs.toInt();
qDebug() << coreFreqOfsInt;
QString currentLimits;
QString nvclockmax = "nvclockmax";
QRegExp exp;
process.start(nvCurrentLimitsQ);
process.waitForFinished(-1);
currentLimits = process.readAll();
currentLimits.remove(0, (currentLimits.lastIndexOf("perf=3")));
//currentLimits.remove(0, (currentLimits.lastIndexOf("nvclockmax")));
exp.setPattern(nvclockmax);
//exp.setPatternSyntax(QRegExp::)
qDebug() << currentLimits;
}
void MainWindow::on_frequencySlider_valueChanged(int value)
{
// Sets the input field value to slider value
QString freqText = QString::number(value);
ui->frequencySpinBox->setValue(value);
}
void MainWindow::on_frequencySpinBox_valueChanged(int arg1)
{
ui->frequencySlider->setValue(arg1);
}

49
mainwindow.h Normal file
View File

@ -0,0 +1,49 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QDir>
#include <QFileInfo>
#include "editprofile.h"
#include <QProcess>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
QString settingsDir = "C:/Users/Gnometech/Documents/rojekti/";
QString currentProfile = "profile";
QString nvFanQ = "nvidia-settings -q GPUCurrentFanSpeed -t";
QString nvVoltQ = "nvidia-settings -q GPUCurrentCoreVoltage -t";
QString nvVoltOfsQ = "nvidia-settings -q GPUOverVoltageOffset -t";
QString nvCoreClkOfsQ = "nvidia-settings -q GPUGraphicsClockOffset -t";
QString nvCurrentLimitsQ = "nvidia-settings -q GPUPerfModes -t";
int voltInt;
int voltOfsInt;
int coreFreqOfsInt;
private slots:
void on_actionEdit_current_profile_triggered(bool checked);
void on_pushButton_clicked();
void checkForProfiles();
void on_profileComboBox_activated(const QString &arg1);
void queryGPUSettings();
void getGPUInfo();
void on_frequencySlider_valueChanged(int value);
void on_frequencySpinBox_valueChanged(int arg1);
private:
Ui::MainWindow *ui;
bool noProfiles;
};
#endif // MAINWINDOW_H

135
mainwindow.ui Normal file
View File

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>513</width>
<height>762</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QLabel" name="profileNameLabel">
<property name="geometry">
<rect>
<x>0</x>
<y>490</y>
<width>261</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QComboBox" name="profileComboBox">
<property name="geometry">
<rect>
<x>340</x>
<y>650</y>
<width>151</width>
<height>31</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>testinappi</string>
</property>
</widget>
<widget class="QSlider" name="frequencySlider">
<property name="geometry">
<rect>
<x>70</x>
<y>560</y>
<width>271</width>
<height>20</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QSpinBox" name="frequencySpinBox">
<property name="geometry">
<rect>
<x>350</x>
<y>560</y>
<width>71</width>
<height>21</height>
</rect>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>513</width>
<height>28</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>Fi&amp;le</string>
</property>
<addaction name="actionQuit"/>
</widget>
<widget class="QMenu" name="menuProfiles">
<property name="title">
<string>P&amp;rofiles</string>
</property>
<addaction name="actionEdit_current_profile"/>
<addaction name="actionAdd_new_profile"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuProfiles"/>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<action name="actionQuit">
<property name="text">
<string>&amp;Quit</string>
</property>
</action>
<action name="actionEdit_current_profile">
<property name="text">
<string>&amp;Edit current profile</string>
</property>
</action>
<action name="actionAdd_profile_from_file">
<property name="text">
<string>Add profile from file...</string>
</property>
</action>
<action name="actionAdd_new_profile">
<property name="text">
<string>&amp;Add new profile</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>

30214
qcustomplot.cpp Normal file

File diff suppressed because it is too large Load Diff

6673
qcustomplot.h Normal file

File diff suppressed because it is too large Load Diff

45
rojekti.pro Normal file
View File

@ -0,0 +1,45 @@
#-------------------------------------------------
#
# Project created by QtCreator 2018-11-02T23:09:52
#
#-------------------------------------------------
QT += core gui xml
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
TARGET = rojekti
TEMPLATE = app
# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
CONFIG += c++11
SOURCES += \
main.cpp \
mainwindow.cpp \
qcustomplot.cpp \
editprofile.cpp
HEADERS += \
mainwindow.h \
qcustomplot.h \
editprofile.h
FORMS += \
mainwindow.ui \
editprofile.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target