More settings and UI bugfixes
This commit is contained in:
parent
1f287f3b58
commit
c174c93ed8
@ -13,9 +13,9 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
ui->progressBar->setValue(0);
|
||||
ui->controlBox->setDisabled(true);
|
||||
ui->consoleGroup->setDisabled(true);
|
||||
ui->pauseBtn->setDisabled("true");
|
||||
ui->actionPrint_from_SD->setDisabled("true");
|
||||
ui->actionSet_SD_printing_mode->setDisabled("true");
|
||||
ui->pauseBtn->setDisabled(true);
|
||||
ui->actionPrint_from_SD->setDisabled(true);
|
||||
ui->actionSet_SD_printing_mode->setDisabled(true);
|
||||
|
||||
ui->baudbox->addItem(QString::number(4800));
|
||||
ui->baudbox->addItem(QString::number(9600));
|
||||
@ -45,6 +45,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
|
||||
autolock = settings.value("core/lockcontrols").toBool();
|
||||
sendingChecksum = settings.value("core/checksums").toBool();
|
||||
chekingSDStatus = settings.value("core/checksdstatus").toBool();
|
||||
|
||||
sending = false;
|
||||
paused = false;
|
||||
@ -83,7 +84,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
sendTimer.start();
|
||||
|
||||
progressSDTimer.setInterval(3000);
|
||||
progressSDTimer.start();
|
||||
if(chekingSDStatus)progressSDTimer.start();
|
||||
|
||||
tempWarning.setInterval(10000);
|
||||
|
||||
@ -146,6 +147,7 @@ void MainWindow::parseFile(QFile &file)
|
||||
{
|
||||
if(sendingChecksum)
|
||||
{
|
||||
//Checksum algorithm from RepRap wiki
|
||||
line = "N"+QString::number(n)+line+"*";
|
||||
int cs = 0;
|
||||
for(int i = 0; line.at(i) != '*'; i++) cs = cs ^ line.at(i).toLatin1();
|
||||
@ -160,6 +162,8 @@ void MainWindow::parseFile(QFile &file)
|
||||
file.close();
|
||||
sdprinting = false;
|
||||
ui->fileBox->setEnabled(true);
|
||||
ui->progressBar->setEnabled(true);
|
||||
ui->sendBtn->setText("Send");
|
||||
ui->filename->setText(file.fileName().split("/").last());
|
||||
ui->filelines->setText(QString::number(gcode.size()) + QString("/0 lines"));
|
||||
}
|
||||
@ -234,8 +238,8 @@ void MainWindow::serialconnect()
|
||||
ui->progressBar->setValue(0);
|
||||
ui->controlBox->setDisabled(false);
|
||||
ui->consoleGroup->setDisabled(false);
|
||||
ui->actionPrint_from_SD->setEnabled("true");
|
||||
ui->actionSet_SD_printing_mode->setEnabled("true");
|
||||
ui->actionPrint_from_SD->setEnabled(true);
|
||||
ui->actionSet_SD_printing_mode->setEnabled(true);
|
||||
//if(checkingTemperature) injectCommand("M105");
|
||||
}
|
||||
}
|
||||
@ -250,8 +254,8 @@ void MainWindow::serialconnect()
|
||||
ui->progressBar->setValue(0);
|
||||
ui->controlBox->setDisabled(true);
|
||||
ui->consoleGroup->setDisabled(true);
|
||||
ui->actionPrint_from_SD->setDisabled("true");
|
||||
ui->actionSet_SD_printing_mode->setDisabled("true");
|
||||
ui->actionPrint_from_SD->setDisabled(true);
|
||||
ui->actionSet_SD_printing_mode->setDisabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -483,7 +487,7 @@ void MainWindow::readSerial()
|
||||
sdprinting=false;
|
||||
ui->progressBar->setValue(0);
|
||||
ui->filename->setText("");
|
||||
ui->fileBox->setDisabled("true");
|
||||
ui->fileBox->setDisabled(true);
|
||||
}
|
||||
else if(data.startsWith("start") && checkingTemperature) injectCommand("M105");
|
||||
else if(data.startsWith("SD pr"))
|
||||
@ -531,8 +535,8 @@ void MainWindow::on_sendBtn_clicked()
|
||||
sending = false;
|
||||
ui->sendBtn->setText("Send");
|
||||
ui->pauseBtn->setText("Pause");
|
||||
ui->pauseBtn->setDisabled("true");
|
||||
if(autolock) ui->controlBox->setChecked("true");
|
||||
ui->pauseBtn->setDisabled(true);
|
||||
if(autolock) ui->controlBox->setChecked(true);
|
||||
paused = false;
|
||||
}
|
||||
else if(!sending && !sdprinting)
|
||||
@ -540,8 +544,8 @@ void MainWindow::on_sendBtn_clicked()
|
||||
sending=true;
|
||||
ui->sendBtn->setText("Stop");
|
||||
ui->pauseBtn->setText("Pause");
|
||||
ui->pauseBtn->setEnabled("true");
|
||||
if(autolock) ui->controlBox->setChecked("false");
|
||||
ui->pauseBtn->setEnabled(true);
|
||||
if(autolock) ui->controlBox->setChecked(false);
|
||||
paused = false;
|
||||
}
|
||||
else if(sdprinting)
|
||||
@ -551,7 +555,7 @@ void MainWindow::on_sendBtn_clicked()
|
||||
injectCommand("M27");
|
||||
ui->sendBtn->setText("Send");
|
||||
ui->pauseBtn->setText("Pause");
|
||||
if(autolock) ui->controlBox->setChecked("true");
|
||||
if(autolock) ui->controlBox->setChecked(true);
|
||||
paused = false;
|
||||
}
|
||||
|
||||
@ -574,7 +578,7 @@ void MainWindow::sendNext()
|
||||
sending = false;
|
||||
currentLine = 0;
|
||||
ui->sendBtn->setText("Send");
|
||||
ui->pauseBtn->setDisabled("true");
|
||||
ui->pauseBtn->setDisabled(true);
|
||||
ui->filelines->setText(QString::number(gcode.size())
|
||||
+ QString("/")
|
||||
+ QString::number(currentLine)
|
||||
@ -672,8 +676,8 @@ void MainWindow::serialError(QSerialPort::SerialPortError error)
|
||||
ui->pauseBtn->setDisabled(true);
|
||||
ui->controlBox->setDisabled(true);
|
||||
ui->consoleGroup->setDisabled(true);
|
||||
ui->actionPrint_from_SD->setDisabled("true");
|
||||
ui->actionSet_SD_printing_mode->setDisabled("true");
|
||||
ui->actionPrint_from_SD->setDisabled(true);
|
||||
ui->actionSet_SD_printing_mode->setDisabled(true);
|
||||
|
||||
qDebug() << error;
|
||||
|
||||
@ -804,8 +808,14 @@ void MainWindow::selectSDfile(QString file)
|
||||
QString filename = file.remove(" "+bytes);
|
||||
|
||||
ui->filename->setText(filename);
|
||||
if(chekingSDStatus)
|
||||
{
|
||||
ui->filelines->setText(bytes + QString("/0 bytes"));
|
||||
ui->progressBar->setEnabled(true);
|
||||
ui->progressBar->setValue(0);
|
||||
}
|
||||
else ui->progressBar->setDisabled(true);
|
||||
ui->sendBtn->setText("Start");
|
||||
sdBytes = bytes.toDouble();
|
||||
|
||||
userCommands.clear();
|
||||
@ -827,7 +837,7 @@ void MainWindow::updateSDStatus()
|
||||
|
||||
void MainWindow::checkSDStatus()
|
||||
{
|
||||
if(sdprinting && sdWatcher.isFinished()) injectCommand("M27");
|
||||
if(sdprinting && chekingSDStatus && sdWatcher.isFinished()) injectCommand("M27");
|
||||
}
|
||||
|
||||
void MainWindow::on_stepspin_valueChanged(const QString &arg1)
|
||||
|
||||
@ -37,6 +37,7 @@ public:
|
||||
explicit MainWindow(QWidget *parent = 0);
|
||||
~MainWindow();
|
||||
|
||||
protected:
|
||||
QFile gfile;
|
||||
QVector<QString> gcode;
|
||||
QQueue <QString> userCommands;
|
||||
@ -68,6 +69,7 @@ private:
|
||||
bool sdprinting;
|
||||
bool echo;
|
||||
bool sendingChecksum;
|
||||
bool chekingSDStatus;
|
||||
long int currentLine;
|
||||
int readyRecieve;
|
||||
unsigned long int sdBytes;
|
||||
|
||||
@ -965,6 +965,12 @@ STOP</string>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QGroupBox" name="statusGroup">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>190</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Status</string>
|
||||
</property>
|
||||
@ -1223,8 +1229,8 @@ STOP</string>
|
||||
<slot>serialupdate()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>82</x>
|
||||
<y>84</y>
|
||||
<x>100</x>
|
||||
<y>110</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>247</x>
|
||||
@ -1255,8 +1261,8 @@ STOP</string>
|
||||
<slot>serialconnect()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>82</x>
|
||||
<y>116</y>
|
||||
<x>100</x>
|
||||
<y>142</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>247</x>
|
||||
@ -1271,8 +1277,8 @@ STOP</string>
|
||||
<slot>xhome()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>455</x>
|
||||
<y>81</y>
|
||||
<x>454</x>
|
||||
<y>108</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>383</x>
|
||||
@ -1288,7 +1294,7 @@ STOP</string>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>739</x>
|
||||
<y>331</y>
|
||||
<y>376</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>654</x>
|
||||
@ -1303,8 +1309,8 @@ STOP</string>
|
||||
<slot>xplus()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>323</x>
|
||||
<y>110</y>
|
||||
<x>329</x>
|
||||
<y>138</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>383</x>
|
||||
@ -1320,11 +1326,11 @@ STOP</string>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>739</x>
|
||||
<y>360</y>
|
||||
<y>405</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>739</x>
|
||||
<y>389</y>
|
||||
<y>434</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
@ -1335,8 +1341,8 @@ STOP</string>
|
||||
<slot>yminus()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>285</x>
|
||||
<y>139</y>
|
||||
<x>289</x>
|
||||
<y>168</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>383</x>
|
||||
@ -1351,8 +1357,8 @@ STOP</string>
|
||||
<slot>yplus()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>285</x>
|
||||
<y>81</y>
|
||||
<x>289</x>
|
||||
<y>108</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>383</x>
|
||||
@ -1367,8 +1373,8 @@ STOP</string>
|
||||
<slot>xminus()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>110</y>
|
||||
<x>250</x>
|
||||
<y>138</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>189</x>
|
||||
@ -1383,8 +1389,8 @@ STOP</string>
|
||||
<slot>zplus()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>367</x>
|
||||
<y>81</y>
|
||||
<x>368</x>
|
||||
<y>108</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>356</x>
|
||||
@ -1399,8 +1405,8 @@ STOP</string>
|
||||
<slot>zminus()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>367</x>
|
||||
<y>139</y>
|
||||
<x>368</x>
|
||||
<y>168</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>209</x>
|
||||
@ -1415,8 +1421,8 @@ STOP</string>
|
||||
<slot>ezero()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>411</x>
|
||||
<y>110</y>
|
||||
<x>408</x>
|
||||
<y>138</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>220</x>
|
||||
@ -1431,8 +1437,8 @@ STOP</string>
|
||||
<slot>zhome()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>455</x>
|
||||
<y>139</y>
|
||||
<x>454</x>
|
||||
<y>168</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>209</x>
|
||||
@ -1447,8 +1453,8 @@ STOP</string>
|
||||
<slot>yhome()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>455</x>
|
||||
<y>110</y>
|
||||
<x>454</x>
|
||||
<y>138</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>383</x>
|
||||
@ -1463,8 +1469,8 @@ STOP</string>
|
||||
<slot>eplus()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>411</x>
|
||||
<y>81</y>
|
||||
<x>408</x>
|
||||
<y>108</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>397</x>
|
||||
@ -1479,8 +1485,8 @@ STOP</string>
|
||||
<slot>eminus()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>411</x>
|
||||
<y>139</y>
|
||||
<x>408</x>
|
||||
<y>168</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>475</x>
|
||||
@ -1495,8 +1501,8 @@ STOP</string>
|
||||
<slot>bedcenter()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>285</x>
|
||||
<y>110</y>
|
||||
<x>289</x>
|
||||
<y>138</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>321</x>
|
||||
@ -1511,8 +1517,8 @@ STOP</string>
|
||||
<slot>homeall()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>257</x>
|
||||
<y>165</y>
|
||||
<x>329</x>
|
||||
<y>198</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>200</x>
|
||||
@ -1520,6 +1526,22 @@ STOP</string>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>sendtext</sender>
|
||||
<signal>returnPressed()</signal>
|
||||
<receiver>sendtext</receiver>
|
||||
<slot>clear()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>558</x>
|
||||
<y>394</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>494</x>
|
||||
<y>397</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<slots>
|
||||
<slot>open()</slot>
|
||||
|
||||
@ -26,6 +26,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) :
|
||||
|
||||
ui->lockbox->setChecked(settings.value("core/lockcontrols").toBool());
|
||||
ui->checksumbox->setChecked(settings.value("core/checksums").toBool());
|
||||
ui->sdbox->setChecked(settings.value("core/checksdstatus").toBool());
|
||||
|
||||
}
|
||||
|
||||
@ -43,4 +44,5 @@ void SettingsWindow::on_buttonBox_accepted()
|
||||
settings.setValue("core/echo", ui->echobox->isChecked());
|
||||
settings.setValue("core/lockcontrols", ui->lockbox->isChecked());
|
||||
settings.setValue("core/checksums", ui->checksumbox->isChecked());
|
||||
settings.setValue("core/checksdstatus", ui->sdbox->isChecked());
|
||||
}
|
||||
|
||||
@ -89,10 +89,10 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>ms</string>
|
||||
<string>Sender</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -103,14 +103,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Sender</string>
|
||||
<string>ms</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<item row="6" column="0">
|
||||
<widget class="QCheckBox" name="checksumbox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -142,6 +142,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="3">
|
||||
<widget class="QCheckBox" name="sdbox">
|
||||
<property name="text">
|
||||
<string>Check SD printing status</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user