Prechádzať zdrojové kódy

- some fixes on the app.jump_to() method
- made sure that the ToolFilm will not start saving a file if there are no objects loaded

Marius Stanciu 6 rokov pred
rodič
commit
face1d0f64
5 zmenil súbory, kde vykonal 23 pridanie a 6 odobranie
  1. 5 1
      FlatCAMApp.py
  2. 3 1
      README.md
  3. 7 0
      flatcamGUI/VisPyCanvas.py
  4. 4 0
      flatcamTools/ToolFilm.py
  5. 4 4
      requirements.txt

+ 5 - 1
FlatCAMApp.py

@@ -7346,7 +7346,11 @@ class App(QtCore.QObject):
 
             canvas_origin = self.plotcanvas.native.mapToGlobal(QtCore.QPoint(0, 0))
             jump_loc = self.plotcanvas.translate_coords_2((cal_location[0], cal_location[1]))
-            j_pos = (canvas_origin.x() + jump_loc[0], (canvas_origin.y() + jump_loc[1]))
+
+            j_pos = (
+                int(canvas_origin.x() + round(jump_loc[0])),
+                int(canvas_origin.y() + round(jump_loc[1]))
+            )
             cursor.setPos(j_pos[0], j_pos[1])
         else:
             # find the canvas origin which is in the top left corner

+ 3 - 1
README.md

@@ -15,13 +15,15 @@ CAD program, and create G-Code for Isolation routing.
 - Calibration Tool - added preferences values
 - Calibration Tool - more work on it
 - reverted this change: "selected object in Project used to ask twice for UI build" because it will not build the UI when a tab is closed for Document object and the object is selected
-- fixed issue after Geometry object edit; the GCode made from and edited object did not reflect the changes in the object
+- fixed issue after Geometry object edit; the GCode made from an edited object did not reflect the changes in the object
 - in Object UI, the Scale FCDoubleSpinner will no longer work for Return key press due of issues of unwanted scaling on focusOut event
 - in FlatCAMGeometry fixed the scale and offset methods to always process the self.solid_geometry
 - Calibration Tool - finished the calibrated object creation method
 - updated the POT file
 - fixed an error in the German PO file
 - updated the languages PO files
+- some fixes on the app.jump_to() method
+- made sure that the ToolFilm will not start saving a file if there are no objects loaded
 
 8.12.2019
 

+ 7 - 0
flatcamGUI/VisPyCanvas.py

@@ -108,10 +108,17 @@ class VisPyCanvas(scene.SceneCanvas):
         # self.measure_fps()
 
     def translate_coords(self, pos):
+        """
+        Translate pixels to FlatCAM units.
+
+        """
         tr = self.grid.get_transform('canvas', 'visual')
         return tr.map(pos)
 
     def translate_coords_2(self, pos):
+        """
+        Translate FlatCAM units to pixels.
+        """
         tr = self.grid.get_transform('visual', 'document')
         return tr.map(pos)
 

+ 4 - 0
flatcamTools/ToolFilm.py

@@ -669,6 +669,10 @@ class Film(FlatCAMTool):
                                  _("No FlatCAM object selected. Load an object for Box and retry."))
             return
 
+        if name == '' or boxname == '':
+            self.app.inform.emit('[ERROR_NOTCL] %s' % _("No FlatCAM object selected."))
+            return
+
         scale_stroke_width = float(self.film_scale_stroke_entry.get_value())
         source = self.source_punch.get_value()
         file_type = self.file_type_radio.get_value()

+ 4 - 4
requirements.txt

@@ -1,11 +1,11 @@
 # This file contains python only requirements to be installed with pip
 # Python packages that cannot be installed with pip (e.g. PyQt5, GDAL) are not included.
 # Usage: pip3 install -r requirements.txt
-numpy>=1.16
+numpy >=1.16
 matplotlib>=3.1
 cycler>=0.10
 python-dateutil>=2.1
-kiwisolver>=1.0.1
+kiwisolver>=1.1
 six
 setuptools
 dill
@@ -21,6 +21,6 @@ fontTools
 rasterio
 lxml
 ezdxf
-qrcode>=6.0
-reportlab>=3.0
+qrcode>=6.1
+reportlab>=3.5
 svglib