소스 검색

- fixed the HPGL preprocessor

Marius Stanciu 6 년 전
부모
커밋
435648171e
4개의 변경된 파일20개의 추가작업 그리고 7개의 파일을 삭제
  1. 4 2
      README.md
  2. 1 1
      flatcamGUI/ObjectUI.py
  3. 2 2
      flatcamGUI/PreferencesUI.py
  4. 13 2
      preprocessors/hpgl.py

+ 4 - 2
README.md

@@ -13,11 +13,13 @@ CAD program, and create G-Code for Isolation routing.
 
 - in Geometry Editor added support for Jump To function such as that it works within the Editor Tools themselves. For now it works only in absolute jumps
 - modified the Jump To method such that now allows relative jump from the current mouse location
-- fixed the Defaults upgrade overwrting the new version number with the old one
+- fixed the Defaults upgrade overwriting the new version number with the old one
 - fixed issue with clear_polygon3() - the one who makes 'lines' and fixed the NCC Tool
-- some small changes in the FlatCAMGeoemtry.on_tool_add() method
+- some small changes in the FlatCAMGeometry.on_tool_add() method
 - made sure that in Geometry Editor the self.app.mouse attribute is updated with the current mouse position (x, y)
 - updated the preprocessor files
+- fixed the HPGL preprocessor
+
 
 15.12.2019
 

+ 1 - 1
flatcamGUI/ObjectUI.py

@@ -883,7 +883,7 @@ class ExcellonObjectUI(ObjectUI):
         self.ois_tcz_e = OptionalInputSection(self.toolchange_cb, [self.toolchangez_entry])
 
         # Start move Z:
-        self.estartz_label = QtWidgets.QLabel('%s:' % _("Start move Z"))
+        self.estartz_label = QtWidgets.QLabel('%s:' % _("Start Z"))
         self.estartz_label.setToolTip(
             _("Height of the tool just after start.\n"
               "Delete the value if you don't need this feature.")

+ 2 - 2
flatcamGUI/PreferencesUI.py

@@ -2584,7 +2584,7 @@ class ExcellonAdvOptPrefGroupUI(OptionsGroupUI):
         self.toolchangexy_entry = FCEntry()
         grid1.addWidget(self.toolchangexy_entry, 1, 1)
 
-        startzlabel = QtWidgets.QLabel('%s:' % _('Start move Z'))
+        startzlabel = QtWidgets.QLabel('%s:' % _('Start Z'))
         startzlabel.setToolTip(
             _("Height of the tool just after start.\n"
               "Delete the value if you don't need this feature.")
@@ -3429,7 +3429,7 @@ class GeometryAdvOptPrefGroupUI(OptionsGroupUI):
         grid1.addWidget(self.toolchangexy_entry, 1, 1)
 
         # Start move Z
-        startzlabel = QtWidgets.QLabel('%s:' % _('Start move Z'))
+        startzlabel = QtWidgets.QLabel('%s:' % _('Start Z'))
         startzlabel.setToolTip(
             _("Height of the tool just after starting the work.\n"
               "Delete the value if you don't need this feature.")

+ 13 - 2
preprocessors/hpgl.py

@@ -49,8 +49,19 @@ class hpgl(FlatCAMPostProc):
             y = p.y
 
         # we need to have the coordinates as multiples of 0.025mm
-        x = round(x / 0.025) * 25 / 1000
-        y = round(y / 0.025) * 25 / 1000
+        x = round(x * 40)
+        y = round(y * 40)
+
+        # constrain the x and y values within the domain of valid values: [-32767 ... 32768]
+        if x <= -32767:
+            x = -32767
+        if x >= 32768:
+            x = 32768
+
+        if y <= -32767:
+            y = -32767
+        if y >= 32768:
+            y = 32768
 
         return ('PA' + self.coordinate_format + ',' + self.coordinate_format + ';') % \
                (p.coords_decimals, x, p.coords_decimals, y)