diff --git a/Wizard.pro b/Wizard.pro index 2c550b3..6cc4591 100644 --- a/Wizard.pro +++ b/Wizard.pro @@ -14,13 +14,16 @@ TEMPLATE = app SOURCES += main.cpp\ mainwindow.cpp \ - settingswindow.cpp + settingswindow.cpp \ + aboutwindow.cpp HEADERS += mainwindow.h \ - settingswindow.h + settingswindow.h \ + aboutwindow.h FORMS += mainwindow.ui \ - settingswindow.ui + settingswindow.ui \ + aboutwindow.ui RESOURCES += \ - settings.qrc + graphics.qrc diff --git a/aboutwindow.ui b/aboutwindow.ui index e210f43..73fd8a3 100644 --- a/aboutwindow.ui +++ b/aboutwindow.ui @@ -1,38 +1,71 @@ + - - - AboutWindow 0 0 - 400 - 300 + 424 + 308 - Dialog + About - - - - 30 - 240 - 341 - 32 - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - + + + + + About RepRaptor + + + false + + + + + + false + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/pics/logo" /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">RepRaptor</span> is a free and open source software for controlling RepRap and similar mashines. This software is distributed by terms of <a href="https://www.gnu.org/licenses/gpl-2.0.html"><span style=" text-decoration: underline; color:#0000ff;">GPL v2 licence.</span></a></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; text-decoration: underline; color:#0000ff;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">RepRaptor's main goal is to be as simple as possible and fast, yet functional. This software is being developed as a primary host software for <span style=" font-weight:600;">MGTU MIREA</span> university's 3D printing labratory.</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/NeoTheFox/RepRaptor"><span style=" text-decoration: underline; color:#0000ff;">GitHub</span></a></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.reprap.org"><span style=" text-decoration: underline; color:#0000ff;">RepRap</span></a></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; text-decoration: underline; color:#0000ff;"><br /></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; text-decoration: underline; color:#0000ff;"><br /></p></body></html> + + + true + + + true + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + - diff --git a/mainwindow.cpp b/mainwindow.cpp index 45faf39..8908e01 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -15,8 +15,6 @@ MainWindow::MainWindow(QWidget *parent) : ui->consoleGroup->setDisabled(true); ui->pauseBtn->setDisabled("true"); - //ui->extruderlcd->setSegmentStyle(); - ui->baudbox->addItem(QString::number(4800)); ui->baudbox->addItem(QString::number(9600)); ui->baudbox->addItem(QString::number(115200)); @@ -47,7 +45,7 @@ MainWindow::MainWindow(QWidget *parent) : statusTimer.start(); if(settings.value("core/senderinterval").toInt()) sendTimer.setInterval(settings.value("core/senderinterval").toInt()); - else sendTimer.setInterval(50); + else sendTimer.setInterval(5); sendTimer.start(); } @@ -70,7 +68,8 @@ MainWindow::~MainWindow() void MainWindow::open() { QString filename; - filename = QFileDialog::getOpenFileName(this, tr("Open GCODE"), "/home/", tr("GCODE (*.g *.gcode *.nc)")); + QDir home; + filename = QFileDialog::getOpenFileName(this, tr("Open GCODE"),home.home().absolutePath(), tr("GCODE (*.g *.gcode *.nc)")); gfile.setFileName(filename); if(!recentFiles.contains(filename)) @@ -327,6 +326,7 @@ void MainWindow::readSerial() { QString extmp = ""; QString btmp = ""; + for(int i = 2; data.at(i) != '/'; i++) { extmp+=data.at(i); @@ -338,6 +338,7 @@ void MainWindow::readSerial() ui->extruderlcd->display(extmp.toDouble()); ui->bedlcd->display(btmp.toDouble()); + sinceLastTemp.restart(); } else if(data.startsWith("ok") || data.startsWith("wait")) commandDone = true; printMsg(QString(data)); @@ -431,7 +432,7 @@ void MainWindow::on_pauseBtn_clicked() void MainWindow::checkStatus() { - if(checkingTemperature) sendLine("M105"); + if(checkingTemperature && sinceLastTemp.elapsed() < statusTimer.interval()) sendLine("M105"); } void MainWindow::on_checktemp_stateChanged(int arg1) @@ -451,3 +452,15 @@ void MainWindow::on_releasebtn_clicked() { sendLine("M84"); } + +void MainWindow::on_actionAbout_triggered() +{ + AboutWindow aboutwindow(this); + + aboutwindow.exec(); +} + +void MainWindow::updateRecent() +{ + +} diff --git a/mainwindow.h b/mainwindow.h index 1bbded6..d2c905a 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -10,8 +10,10 @@ #include #include #include +#include #include "settingswindow.h" +#include "aboutwindow.h" namespace Ui { @@ -30,6 +32,7 @@ public: QVector gcode; QTimer sendTimer; QTimer statusTimer; + QElapsedTimer sinceLastTemp; QSettings settings; QStringList recentFiles; @@ -57,6 +60,7 @@ private slots: void printMsg(const char* text); void sendNext(); void checkStatus(); + void updateRecent(); void xplus(); void yplus(); @@ -85,6 +89,7 @@ private slots: void on_checktemp_stateChanged(int arg1); void on_actionSettings_triggered(); void on_releasebtn_clicked(); + void on_actionAbout_triggered(); }; #endif // MAINWINDOW_H diff --git a/mainwindow.ui b/mainwindow.ui index dd61b44..b6be493 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -123,6 +123,9 @@ false + + false + @@ -156,6 +159,9 @@ Control + + true + @@ -465,7 +471,14 @@ + + + Help + + + + @@ -512,6 +525,14 @@ Settings + + Ctrl+P + + + + + About + diff --git a/settingswindow.cpp b/settingswindow.cpp index ce6e441..f1ece73 100644 --- a/settingswindow.cpp +++ b/settingswindow.cpp @@ -8,7 +8,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) : ui->setupUi(this); if(settings.value("core/senderinterval").toInt()) ui->senderbox->setValue(settings.value("core/senderinterval").toInt()); - else ui->senderbox->setValue(50); + else ui->senderbox->setValue(5); if(settings.value("core/statusinterval").toInt()) ui->statusbox->setValue(settings.value("core/statusinterval").toInt()); else ui->senderbox->setValue(3000);