Some more dev release preparations

This commit is contained in:
NeoTheFox 2015-02-28 20:36:58 +03:00
parent 4afb645f63
commit a28523beaa
6 changed files with 108 additions and 33 deletions

View File

@ -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

View File

@ -1,38 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<author/>
<comment/>
<exportmacro/>
<class>AboutWindow</class>
<widget class="QDialog" name="AboutWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>424</width>
<height>308</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string>About</string>
</property>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="geometry">
<rect>
<x>30</x>
<y>240</y>
<width>341</width>
<height>32</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>About RepRaptor</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QTextBrowser" name="textBrowser">
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;img src=&quot;:/pics/logo&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;RepRaptor&lt;/span&gt; is a free and open source software for controlling RepRap and similar mashines. This software is distributed by terms of &lt;a href=&quot;https://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;GPL v2 licence.&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;-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;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;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 &lt;span style=&quot; font-weight:600;&quot;&gt;MGTU MIREA&lt;/span&gt; university's 3D printing labratory.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;https://github.com/NeoTheFox/RepRaptor&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;GitHub&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://www.reprap.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;RepRap&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;-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;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;-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;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="openLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<pixmapfunction/>
<resources/>
<connections>
<connection>

View File

@ -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()
{
}

View File

@ -10,8 +10,10 @@
#include <QTextStream>
#include <QTimer>
#include <QSettings>
#include <QElapsedTimer>
#include "settingswindow.h"
#include "aboutwindow.h"
namespace Ui {
@ -30,6 +32,7 @@ public:
QVector<QString> 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

View File

@ -123,6 +123,9 @@
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="openLinks">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0">
@ -156,6 +159,9 @@
<property name="title">
<string>Control</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="8">
<widget class="QPushButton" name="homexbtn">
@ -465,7 +471,14 @@
<addaction name="separator"/>
<addaction name="actionExit"/>
</widget>
<widget class="QMenu" name="menuAbout">
<property name="title">
<string>Help</string>
</property>
<addaction name="actionAbout"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuAbout"/>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
@ -512,6 +525,14 @@
<property name="text">
<string>Settings</string>
</property>
<property name="shortcut">
<string>Ctrl+P</string>
</property>
</action>
<action name="actionAbout">
<property name="text">
<string>About</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>

View File

@ -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);