[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [brprint3d] /: Call for new method
From:       Lays Rodrigues <laysrodriguessilva () gmail ! com>
Date:       2015-12-01 1:35:02
Message-ID: E1a3ZqQ-0000XT-VN () scm ! kde ! org
[Download RAW message or body]

Git commit 02a7382c64d2d1818b45e21d141d0b82a993b90e by Lays Rodrigues.
Committed on 01/12/2015 at 01:28.
Pushed by laysrodrigues into branch 'master'.

Call for new method

Set a signal and connection to a FilCount Method inside
ManualControlWidget

Signed-off-by: Lays Rodrigues <laysrodriguessilva@gmail.com>

M  +15   -11   brprint3d.cpp
M  +3    -0    brprint3d.h

http://commits.kde.org/brprint3d/02a7382c64d2d1818b45e21d141d0b82a993b90e

diff --git a/brprint3d.cpp b/brprint3d.cpp
index 89c701c..5c15079 100755
--- a/brprint3d.cpp
+++ b/brprint3d.cpp
@@ -68,6 +68,7 @@ BrPrint3D::BrPrint3D(QWidget *parent) : QMainWindow(parent),
     connect(ui->_ManualControl,&ManualControlWidget::checkConnectButton,bt_connect,&BigButton::setChecked);
     connect(ui->_PrinterSettings,&PrinterSettingsWidget::updateCube,vtkView,&vtkWidget::updateCube);
     connect(vtkView,&vtkWidget::layersCount,ui->_ManualControl,&ManualControlWidget::setLayersCount);
+    connect(this,&BrPrint3D::callFilCount,ui->_ManualControl,&ManualControlWidget::setFilCount);
 
     connect(vtkView,&vtkWidget::layersCount,ui->_ManualControl,&ManualControlWidget::setLayersCount);
 
@@ -102,18 +103,21 @@ void BrPrint3D::openFile()
     if(sender()==bt_open){
         filePath = QFileDialog::getOpenFileName(this, "Open File", QDir::homePath(), typeAll);
     }
-    if (!filePath.isEmpty() && QFileInfo(filePath).completeSuffix() == "gcode") {
-        QFile gcode(filePath);
-        if (gcode.open(QFile::ReadOnly | QFile::Text)) {
-            QTextStream in(&gcode);
-            QString text = in.readAll();
-            vtkView->renderGcode(text);
-            gcode.close();
-            ui->_ManualControl->setGcodePreview(text);
-            if (bt_connect->isChecked())
-                bt_play->setEnabled(true);
+        if (!filePath.isEmpty() && QFileInfo(filePath).completeSuffix() == "gcode") {
+            QFile gcode(filePath);
+            if (gcode.open(QFile::ReadOnly | QFile::Text)) {
+                QTextStream in(&gcode);
+                QString text = in.readAll();
+                vtkView->renderGcode(text);
+                gcode.close();
+                emit callFilCount(filePath);
+                ui->_ManualControl->setGcodePreview(text);
+                if (bt_connect->getCheckedStatus())
+                    bt_play->setEnabled(true);
+
+            }
         }
-    }
+
     else if(QFileInfo(filePath).completeSuffix()=="STL" ||QFileInfo(filePath).completeSuffix()=="stl"){
         vtkView->renderSTL(filePath);
     }
diff --git a/brprint3d.h b/brprint3d.h
index 433abac..29cbf17 100755
--- a/brprint3d.h
+++ b/brprint3d.h
@@ -48,6 +48,8 @@
 #include <QInputDialog>
 #include <QStandardPaths>
 
+
+
 namespace Ui
 {
 class BrPrint3D;
@@ -89,6 +91,7 @@ private slots:
 signals:
     void s_playStatus(bool b);
     void s_pauseStatus(bool b);
+    void callFilCount(QString filePath);
 
 };
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic