/
mainwindow.cpp
818 lines (637 loc) · 22 KB
/
mainwindow.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMessageBox>
#include <QtSerialPort/QSerialPort>
#include <QDebug>
#include <QLabel>
#include <QPixmap>
#include <QFile>
#include <QTextStream>
#include <QInputDialog>
#include <QFileDialog>
#include <QTimer>
#include <QSettings>
//#include<unistd.h>
// a backup plan for talking to printer on linux would be to use the echo "G28" >> /dev/ttyACM0
// code used for this.
//https://stackoverflow.com/questions/51209822/qtserialport-not-writing-to-serial-port
//http://www.howtobuildsoftware.com/index.php/how-do/cBtm/c-qt-serial-port-writing-qt-serial-port-not-working
//todo
//verify all buttons working
//parse m114 readData() from listbox to get valid position
//movement buttons need current position to move around better
//keyboard jog mode
//launch commands list for parser
//verify successful print from sd
//verify successful print to printer iron out buffersize to keepthings fast
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
this->setWindowTitle("QPrint3d");
// m_pSerial = new SerialThread(this);
// connect(m_pSerial, &SerialThread::conected, this, &MainWindow::onSerialPortConnected);
// connect(m_pSerial, &SerialThread::responseRecieved, this, &MainWindow::onSerialPortResponseRecieved);
// connect(m_pSerial, &SerialThread::error, this, &MainWindow::onSerialPortError);
// connect(m_pSerial, &SerialThread::timeout, this, &MainWindow::onSerialPortTimeout);
//! [1]
// settings = new SettingsDialog;
serial = new QSerialPort(this);
connect(serial, SIGNAL(error(QSerialPort::SerialPortError)), this,
SLOT(handleError(QSerialPort::SerialPortError)));
// connect(serial, SIGNAL(readyRead()), this, SLOT(readData()));
ui->setupUi(this);
ui->emstopbtn->setStyleSheet("background-color: red");
timer = new QTimer(this);
// setup signal and slot
connect(timer, SIGNAL(timeout()),
this, SLOT(on_timedevent()));
// msec
timer->start(1000);
// this->setWindowOpacity(0.55);
// this->setAttribute(Qt::WA_TranslucentBackground, true);
// this->setStyleSheet("background-color: yellow;");
m_settings = QApplication::applicationDirPath().left(1) + ":/settings.ini";
saveSettings();
loadSettings();
// QOpenGLWidget *widget = new QOpenGLWidget();
//QWidget* tab_11 = ui->tab_11;
/*drawer = new GLWidget(ui->tab_11);
drawer->setGeometry(20, 10, 611, 341);
QGLFormat format;
format.setDepthBufferSize(24);
format.setStencilBufferSize(8);
format.setVersion(3, 2);
drawer->setFormat(format);*/
//ui->widget->setFormat(format);
msgBox("For Testing Purposes, its not ready unless you know how to code try in a month");
}
void MainWindow::handleError(QSerialPort::SerialPortError error)
{
if (error == QSerialPort::ResourceError) {
QMessageBox::critical(this, tr("Critical Error"), serial->errorString());
serial->close();
}
}
void MainWindow::loadSettings()
{
QSettings settings(m_settings, QSettings::NativeFormat);
QString sText = settings.value("text", "").toString();
// if (label)
// {
// ui->label->setText(sText);
// }
}
void MainWindow::saveSettings()
{
QSettings settings(m_settings, QSettings::NativeFormat);
QString sText = "testing";//(label) ? label->text() : "";
settings.setValue("text", sText);
//if (label)
//{
// ui->label->setText(sText);
//}
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::msgBox(QString message){
QMessageBox Msgbox;
Msgbox.setText(message);
Msgbox.exec();
// QMessageBox::critical(this, tr("Critical Error"), serial->errorString());
}
void MainWindow::sendCommand(QString commandstr)
{
QString command = commandstr + "\n";
// QString command = "G28/n";
// QString command = "M70 P200 Message\n";
QByteArray x = command.toLocal8Bit();
if (serial->isOpen() && serial->isWritable())
{
// serial->write("G28;\n");
serial->write(x);
// serial->transaction(commandstr);
ui->label->setText("sent");
}
else {
msgBox("not connected");
}
}
void MainWindow::on_sendbtn_clicked()
{
QString command = ui->lineEdit->text() + "\n"; //"G28;\n";
// QString command = "M70 P200 Message\n";
QByteArray x = command.toLocal8Bit();
if (serial->isOpen() && serial->isWritable())
{
// serial->transaction(command);
serial->write(x);
ui->label->setText("sent"+ x);
}
}
void MainWindow::writeData(const QByteArray &data)
{
serial->write(data);
}
void MainWindow::readData()
{
// QByteArray data = serial->readAll();
// ui->console->append(data);
while (serial->bytesAvailable() > 0) {
QByteArray newData = serial->readAll();
buffer.append(newData);
// Process complete lines
while (buffer.contains('\n')) {
int newlineIndex = buffer.indexOf('\n');
QByteArray line = buffer.left(newlineIndex + 1); // Include the newline character
buffer.remove(0, newlineIndex + 1); // Remove the processed line from the buffer
// Handle the complete line (e.g., print it)
qDebug() << "Received line:" << line;
ui->console->append("UART:" + line);
// You can emit a signal with the line if needed
// emit lineReceived(line);
}
}
}
void MainWindow::onSerialPortTimeout(){
}
void MainWindow::serialReceived()
{
QByteArray output;
while (serial->bytesAvailable() > 0) {
output = serial->readLine();//readAll();
QByteArray newData = output;
buffer.append(newData);
// Process complete lines
while (buffer.contains('\n')) {
int newlineIndex = buffer.indexOf('\n');
QByteArray line = buffer.left(newlineIndex + 1); // Include the newline character
buffer.remove(0, newlineIndex + 1); // Remove the processed line from the buffer
// Handle the complete line (e.g., print it)
qDebug() << "Received line:" << line;
ui->console->append("UART:" + line);
// You can emit a signal with the line if needed
// emit lineReceived(line);
}
}
//ui->label->setText("output");
// qInfo() << output;
//qInfo("testing");
// ui->console->append(output);
QString datas = QString(output);
// int x = QString::compare(str1, str2, Qt::CaseInsensitive); // if strings are equal x should return 0
// QString data = ui->data->toPlainText();
QString search= "X:";
// datas.contains(match)
// if (datas.at(0)=="X" && datas.at(1)==":"){//todo check second char is a :
if ( datas.contains(search)){//todo check second char is a :
QStringList strList = datas.split(" ");
QString X1 = strList.value(0);
QString Y1 = strList.value(1);
QString Z1 = strList.value(2);
QString E1 = strList.value(2);
strList = X1.split(":");
X1 = strList.value(1);
strList = Y1.split(":");
Y1 = strList.value(1);
strList = Z1.split(":");
Z1 = strList.value(1);
strList = E1.split(":");
E1 = strList.value(1);
ui->xcoord->setText(X1);
ui->ycoord->setText(Y1);
ui->zcoord->setText(Z1);
ui->xposlabel->setText("X: "+X1);
ui->yposlabel->setText("Y: "+Y1);
ui->zposlabel->setText("Z: "+Z1);
ui->eposlabel->setText("E: "+E1);
// strList.
// ui->label->setText(X1+Y1+Z1);
validm114=true;
}
search= "T:";
//T:12.78 / 0 B:10.75 / 0 B@:0 @:0
if ( datas.contains(search)){//todo check second char is a :
QStringList strList = datas.split(" ");
QString T1 = strList.value(0);
QString B1 = strList.value(3);
// QString T2 = strList.value(2);
strList = T1.split(" ");
T1 = strList.value(0);
strList = T1.split(":");
T1 = strList.value(1);
strList = B1.split(" ");
B1 = strList.value(0);
qInfo() << B1;
strList = B1.split(":");
B1 = strList.value(1);
qInfo() << B1;
// ui->xcoord->setText(X1);
// ui->ycoord->setText(X1);
ui->tiptemp->setText(T1);
ui->bedtemp->setText(B1);
ui->tiptempslide->setValue(T1.toFloat()) ;
ui->bedtempslide->setValue(B1.toFloat()) ;
// strList.
//ui->label->setText(X1+Y1+Z1);
// validm114=true;
}
}
void MainWindow::onSerialPortResponseRecieved(const QString &response) {
ui->console->append(response);
// int x = QString::compare(str1, str2, Qt::CaseInsensitive); // if strings are equal x should return 0
// QString data = ui->data->toPlainText();
// if (response.at(0)=="X" && response.at(1)==":"){//todo check second char is a :
// QStringList strList = response.split(" ");
// QString X1 = strList.value(0);
// QString Y1 = strList.value(1);
// QString Z1 = strList.value(2);
// QString E1 = strList.value(2);
// strList = X1.split(":");
// X1 = strList.value(1);
// strList = Y1.split(":");
// Y1 = strList.value(1);
// strList = Z1.split(":");
// Z1 = strList.value(1);
// strList = E1.split(":");
// E1 = strList.value(1);
// ui->xcoord->setText(X1);
// ui->ycoord->setText(X1);
// ui->zcoord->setText(X1);
// // strList.
// // ui->label->setText(X1+Y1+Z1);
// validm114=true;
// }
}
//void MainWindow::onSerialPortError(QSerialPort::SerialPortError error) {
// if(error == QSerialPort::OpenError){
// ui->label->setText("Error: Failed to connect");
// }
// if (error == QSerialPort::ResourceError) {
// QMessageBox::critical(this, tr("Critical Error"), m_pSerial->serialPortErrorString());
// m_pSerial->disconnectPort();
// }
//}
void MainWindow::onSerialPortConnected(){
ui->label->setText("Connected to Printer!!");
ui->connectionbtn->setText("Disconnect");
ui->connectionbtn->setStyleSheet("background-color: red");
}
void MainWindow::on_connectionbtn_clicked()
{
QString btnstatus = ui->connectionbtn->text();
ui->label->setText(btnstatus);
//if (btnstatus.toStdString().c_str() == "Connect"){
if (btnstatus.compare("Connect")==0){
serial->setPortName(ui->portBox->currentText());
connect(serial,SIGNAL(readyRead()),this,SLOT(serialReceived()));
// serial->setPortName(QString('/dev/ttyACM0'));
serial->setBaudRate(115200);
serial->setDataBits(QSerialPort::Data8);
serial->setParity(QSerialPort::NoParity);
serial->setStopBits(QSerialPort::OneStop);;
serial->setFlowControl(QSerialPort::NoFlowControl);
if (serial->open(QIODevice::ReadWrite)) {
ui->label->setText("Connected to Printer!!");
} else {
ui->label->setText("Error: Failed to connect");
}
if (serial->isOpen() && serial->isWritable())
{
ui->connectionbtn->setText("Disconnect");
ui->connectionbtn->setStyleSheet("background-color: red");
// sendCommand("M114;");
}
}else{
// ui->label->setText("closing port");
//closeSerialPort();
serial->close();
if (!serial->isOpen())
{
ui->connectionbtn->setText("Connect");
ui->connectionbtn->setStyleSheet("background-color: rgb(155,255,0);");
serial->clear();
disconnect(serial,SIGNAL(readyRead()),this,SLOT(serialReceived()));
}
}
//check if printer in ascii mode by lookikng for checksum error ?
}
//M70 P200 Message
void MainWindow::on_pushButton_4_clicked()
{
}
void MainWindow::on_pushButton_3_clicked() // open file to listview not needed
{
QString fileName = QFileDialog::getOpenFileName(this,
tr("Open GCode"), "./", tr("GCode Files (*.gcode)"));
//https://stackoverflow.com/questions/28408542/how-to-populate-qt-listview-with-content-from-a-text-file
QStringList *allLines = new QStringList(); //Your list for lines from the file.
allLines->clear();
QStringListModel *linesModel = new QStringListModel(*allLines, NULL); //Your model to set to the view.
QFile file(fileName);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
return;
while (!file.atEnd()) {
QByteArray line = file.readLine(); //Lines are read as QByteArray.
const char *line_c = line.data(); //convert to const char*
QString line_str = QString(QLatin1String(line_c)); //And finally convert to QString
allLines->append(line_str); //Add to the list
}
linesModel->setStringList(*allLines); //Set your model's list your stringlist
ui->listView_2->setModel(linesModel); //set model of your listView linesModel. You need to use your listView's name, which might be ui->listView.
ui->listView_2->
setEditTriggers(QAbstractItemView::AnyKeyPressed |
QAbstractItemView::DoubleClicked);
}
void MainWindow::on_opengcodebtn_clicked() // lineedit
{
QString fileName = QFileDialog::getOpenFileName(this,
tr("Open GCode"), "./", tr("GCode Files (*.gcode)"));
QFile file(fileName);
file.open(QIODevice::ReadOnly);
QTextStream stream(&file);
QString content = stream.readAll();
file.close();
ui->textBrowser->append(content);
QString text = ui->textBrowser->toPlainText();
QTextStream * stream2 = new QTextStream(&text , QIODevice::ReadOnly);
// QVector<QString > lines;
while (!stream2->atEnd())
{
lines << stream2->readLine();
}
this->setWindowTitle("QPrint3d "+fileName);
// ui->filenamelabel->setText(fileName);
ui->widget->loadGCode(fileName);
connect(ui->widget, &GLWidget::layerMinMaxChanged, this, &MainWindow::onLayerMinMaxChanged);
}
void MainWindow::onLayerMinMaxChanged(int min, int max){
ui->verticalSlider->setMinimum(min);
ui->verticalSlider->setMaximum(max);
ui->verticalSlider->setValue(min);
}
void MainWindow::on_uploadsdbtn_clicked()
{
QString text3 = QInputDialog::getText(this,"Pick Filename to save","gcode");
QString text = ui->textBrowser->toPlainText();
QTextStream * stream2 = new QTextStream(&text , QIODevice::ReadOnly);
if (1){
sendCommand("M21;"); // get sdcard ready
sendCommand("M28 "+text3); //write to file
while (!stream2->atEnd()) {
sendCommand(stream2->readLine());
//sleep(10);
}
// send code here
sendCommand("M29;"); //stop writing
sendCommand("M23 filename.txt;"); //
}
}
void MainWindow::on_uploadprintbtn_clicked()
{
on_uploadsdbtn_clicked();
sendCommand("M24;"); //start printing
sendCommand("M114;");
}
void MainWindow::on_printbtn_clicked()
{
//btnstatus.compare("Disconnect")
//check for printer connection
int buffercount=10;
int count=0;
//read file if gcodeedit is empty
// int lcount=lines.count();
// int icount=0;
// while (lcount >= icount){ // loop whole buffer
QString text = ui->textBrowser->toPlainText();
QTextStream * stream2 = new QTextStream(&text , QIODevice::ReadOnly);
// QVector<QString > lines;
bool bstoploop=0;
while (!stream2->atEnd() && !bstoploop)
{
// << stream2->readLine();
//update progress bar / tip position
//on_timedevent();
//wait for receive position
validm114=1; // everything should be homed maybe do a 0,0,0 check unless resuming
int printbuffersize=10;
while (validm114) { //or specified time
//for (int i=1;10,i++;){
// QString currentline = lines[1].toStdString();
QString currentline = stream2->readLine();
// lines.pop_front();
sendCommand(currentline);
if (count >= printbuffersize){ validm114=0; count++;}; //send m114 every buffer length to see where its at
}
sendCommand("M114;");
// validm114=1; //parse and wait for valid before sending more
count=0;
}
}
void MainWindow::on_printbtn_2_clicked()
{
on_printbtn_clicked();
}
void MainWindow::on_console_textChanged()
{
}
void MainWindow::on_tiptempslide_actionTriggered(int action)
{
int maxtiptemp=230; // if temp higer do software drop
int maxbedtemp=60;
// ui->label->setText("tempchange");
// ui->console->append("test");
// qInfo() << ui->tiptempslide->value();
}
void MainWindow::on_tiptempslide_sliderReleased()
{
sendCommand("M114;");
}
void MainWindow::on_bedtempslide_sliderReleased()
{
// qint8 slidevalue = ui->bedtempslide->value()
// QString text = ;
ui->setbedinput->setText( QString(QString::number(ui->bedtempslide->value())) );
}
void MainWindow::on_lineEdit_returnPressed()
{
on_sendbtn_clicked();
}
void MainWindow::on_timedevent(){
//refresh
ui->tiptempslide->setMaximum( 230) ;
ui->tiptempslide->setRange(0,250) ;
ui->bedtempslide->setMaximum( 110) ;
ui->bedtempslide->setRange(0,110) ;
ui->bedtempslide->setValue(50) ;
ui->tiptempslide->setValue(144) ;
QString btnstatus = ui->connectionbtn->text();
//check printer still connected
if (!serial->isOpen() && !btnstatus.compare("Disconnect"))
{
ui->connectionbtn->setText("Reconnect");
ui->connectionbtn->setStyleSheet("background-color: rgb(155,255,0);");
disconnect(serial,SIGNAL(readyRead()),this,SLOT(serialReceived()));
}
else if (btnstatus.compare("Disconnect")==0 ){
// sendCommand("M114;");
// sendCommand("M105;");
}
}
void MainWindow::on_tiptempslide_valueChanged(int value)
{
ui->settipinput->setText( QString(QString::number(ui->tiptempslide->value())) );
}
void MainWindow::on_setTipbutton_clicked()
{
//ui->tiptempslide->setValue(QString::number(ui->settipinput->text())) ;
}
void MainWindow::on_em50btn_clicked()
{
sendCommand("G0 E-50;");
sendCommand("M114;");
}
void MainWindow::on_em10btn_clicked()
{
sendCommand("G0 E-10;");
sendCommand("M114;");
}
void MainWindow::on_em1btn_clicked()
{
sendCommand("G0 E-1;");
sendCommand("M114;");
}
void MainWindow::on_e1btn_clicked()
{
sendCommand("G0 E1;");
sendCommand("M114;");
}
void MainWindow::on_e10btn_clicked()
{
sendCommand("G0 E10;");
sendCommand("M114;");
}
void MainWindow::on_zm10_clicked()
{
sendCommand("G0 Z-10;");
sendCommand("M114;");
}
void MainWindow::on_zm1btn_clicked()
{
sendCommand("G0 Z-1;");
sendCommand("M114;");
}
void MainWindow::on_z1btn_clicked()
{
sendCommand("G0 Z1;");
sendCommand("M114;");
}
void MainWindow::on_z10btn_clicked()
{
sendCommand("G0 Z10;");
sendCommand("M114;");
}
void MainWindow::on_x1btn_clicked()
{
sendCommand("G0 X1;");
sendCommand("M114;");
}
void MainWindow::on_x10btn_clicked()
{
sendCommand("G0 X10;");
}
void MainWindow::on_xm1_clicked()
{
sendCommand("G28 X-1;");
}
void MainWindow::on_xm10btn_clicked()
{
sendCommand("G28 X-10;");
sendCommand("M114;");
}
void MainWindow::on_ym10btn_clicked()
{
sendCommand("G28 Y-10;");
sendCommand("M114;");
}
void MainWindow::on_ym1btn_clicked()
{
sendCommand("G28 Y-1;");
sendCommand("M114;");
}
void MainWindow::on_y1btn_clicked()
{
float currentpos = ui->ycoord->text().toFloat();
float pos=currentpos+1;
// QString yposstr = QString::number(ypos);
sendCommand("G0 Y" + QString::number(pos) + ";");
sendCommand("M114;");
}
void MainWindow::on_y10btn_clicked()
{
float currentpos = ui->ycoord->text().toFloat();
//QString b;
// b.setNum(ui->ycoord->text());
float pos=currentpos+10;
// QString yposstr = QString::number(ypos);
sendCommand("G0 Y" + QString::number(pos) + ";");
sendCommand("M114;");
}
void MainWindow::on_homeallbtn_clicked()
{
sendCommand("G28;");
sendCommand("M114;");
}
void MainWindow::on_homexbtn_clicked()
{
sendCommand("G28 X0;");
sendCommand("M114;");
}
void MainWindow::on_homeybtn_clicked()
{
sendCommand("G28 Y0;");
sendCommand("M114;");
}
void MainWindow::on_homezbtn_clicked()
{
sendCommand("G28 Z0;");
sendCommand("M114;");
}
void MainWindow::on_emstopbtn_clicked()
{
// sendCommand("M117;");
sendCommand("M114;");
}
void MainWindow::on_pausebtn_clicked()
{
sendCommand("M226;");
sendCommand("M114;");
}
void MainWindow::on_pauseSDbtn_clicked()
{
sendCommand("M24;");
sendCommand("M114;");
}
void MainWindow::on_pauseSDbtn_2_clicked()
{
sendCommand("M25;");
}
void MainWindow::on_uploadprintbtn_3_clicked()
{
on_uploadprintbtn_clicked();
}
void MainWindow::on_uploadsdbtn2_clicked()
{
on_uploadsdbtn_clicked();
}
void MainWindow::on_actionExit_triggered()
{
QApplication::quit();
}
void MainWindow::on_verticalSlider_valueChanged(int value)
{
ui->widget->setLayer(value);
qDebug() << "Slider Value changed" << value;
}