Просмотр исходного кода

- changed some debug messages in camlib.py and in FlatCAMObj.py

Marius Stanciu 6 лет назад
Родитель
Сommit
97e262e47c
2 измененных файлов с 46 добавлено и 7 удалено
  1. 9 2
      FlatCAMObj.py
  2. 37 5
      camlib.py

+ 9 - 2
FlatCAMObj.py

@@ -1129,6 +1129,7 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
         :return: None
         :return: None
         :rtype: None
         :rtype: None
         """
         """
+        log.debug("FlatCAMObj.FlatCAMGerber.convert_units()")
 
 
         factor = Gerber.convert_units(self, units)
         factor = Gerber.convert_units(self, units)
 
 
@@ -2768,8 +2769,9 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
         self.app.worker_task.emit({'fcn': job_thread, 'params': [self.app]})
         self.app.worker_task.emit({'fcn': job_thread, 'params': [self.app]})
 
 
     def convert_units(self, units):
     def convert_units(self, units):
-        factor = Excellon.convert_units(self, units)
+        log.debug("FlatCAMObj.FlatCAMExcellon.convert_units()")
 
 
+        factor = Excellon.convert_units(self, units)
         self.options['drillz'] = float(self.options['drillz']) * factor
         self.options['drillz'] = float(self.options['drillz']) * factor
         self.options['travelz'] = float(self.options['travelz']) * factor
         self.options['travelz'] = float(self.options['travelz']) * factor
         self.options['feedrate'] = float(self.options['feedrate']) * factor
         self.options['feedrate'] = float(self.options['feedrate']) * factor
@@ -4956,6 +4958,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
         :return: None
         :return: None
         :rtype: None
         :rtype: None
         """
         """
+        log.debug("FlatCAMObj.FlatCAMGeometry.scale()")
 
 
         try:
         try:
             xfactor = float(xfactor)
             xfactor = float(xfactor)
@@ -5025,6 +5028,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
         :return: None
         :return: None
         :rtype: None
         :rtype: None
         """
         """
+        log.debug("FlatCAMObj.FlatCAMGeometry.offset()")
 
 
         try:
         try:
             dx, dy = vect
             dx, dy = vect
@@ -5055,6 +5059,8 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
         self.app.inform.emit(_("[success] Geometry Offset done."))
         self.app.inform.emit(_("[success] Geometry Offset done."))
 
 
     def convert_units(self, units):
     def convert_units(self, units):
+        log.debug("FlatCAMObj.FlatCAMGeometry.convert_units()")
+
         self.ui_disconnect()
         self.ui_disconnect()
 
 
         factor = Geometry.convert_units(self, units)
         factor = Geometry.convert_units(self, units)
@@ -6022,8 +6028,9 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
         self.annotation.redraw()
         self.annotation.redraw()
 
 
     def convert_units(self, units):
     def convert_units(self, units):
+        log.debug("FlatCAMObj.FlatCAMECNCjob.convert_units()")
+
         factor = CNCjob.convert_units(self, units)
         factor = CNCjob.convert_units(self, units)
-        FlatCAMApp.App.log.debug("FlatCAMCNCjob.convert_units()")
         self.options["tooldia"] = float(self.options["tooldia"]) * factor
         self.options["tooldia"] = float(self.options["tooldia"]) * factor
 
 
         param_list = ['cutz', 'depthperpass', 'travelz', 'feedrate', 'feedrate_z', 'feedrate_rapid',
         param_list = ['cutz', 'depthperpass', 'travelz', 'feedrate', 'feedrate_z', 'feedrate_rapid',

+ 37 - 5
camlib.py

@@ -229,7 +229,8 @@ class Geometry(object):
         # fixed issue of getting bounds only for one level lists of objects
         # fixed issue of getting bounds only for one level lists of objects
         # now it can get bounds for nested lists of objects
         # now it can get bounds for nested lists of objects
 
 
-        log.debug("Geometry->bounds()")
+        log.debug("camlib.Geometry.bounds()")
+
         if self.solid_geometry is None:
         if self.solid_geometry is None:
             log.debug("solid_geometry is None")
             log.debug("solid_geometry is None")
             return 0, 0, 0, 0
             return 0, 0, 0, 0
@@ -1278,7 +1279,7 @@ class Geometry(object):
         :return: Scaling factor resulting from unit change.
         :return: Scaling factor resulting from unit change.
         :rtype: float
         :rtype: float
         """
         """
-        log.debug("Geometry.convert_units()")
+        log.debug("camlib.Geometry.convert_units()")
 
 
         if units.upper() == self.units.upper():
         if units.upper() == self.units.upper():
             return 1.0
             return 1.0
@@ -1378,6 +1379,7 @@ class Geometry(object):
         :type point: list
         :type point: list
         :return: None
         :return: None
         """
         """
+        log.debug("camlib.Geometry.mirror()")
 
 
         px, py = point
         px, py = point
         xscale, yscale = {"X": (1.0, -1.0), "Y": (-1.0, 1.0)}[axis]
         xscale, yscale = {"X": (1.0, -1.0), "Y": (-1.0, 1.0)}[axis]
@@ -1420,6 +1422,7 @@ class Geometry(object):
         See shapely manual for more information:
         See shapely manual for more information:
         http://toblerity.org/shapely/manual.html#affine-transformations
         http://toblerity.org/shapely/manual.html#affine-transformations
         """
         """
+        log.debug("camlib.Geometry.rotate()")
 
 
         px, py = point
         px, py = point
 
 
@@ -1460,6 +1463,8 @@ class Geometry(object):
         See shapely manual for more information:
         See shapely manual for more information:
         http://toblerity.org/shapely/manual.html#affine-transformations
         http://toblerity.org/shapely/manual.html#affine-transformations
         """
         """
+        log.debug("camlib.Geometry.skew()")
+
         px, py = point
         px, py = point
 
 
         def skew_geom(obj):
         def skew_geom(obj):
@@ -3298,7 +3303,8 @@ class Gerber (Geometry):
         # fixed issue of getting bounds only for one level lists of objects
         # fixed issue of getting bounds only for one level lists of objects
         # now it can get bounds for nested lists of objects
         # now it can get bounds for nested lists of objects
 
 
-        log.debug("Gerber->bounds()")
+        log.debug("camlib.Gerber.bounds()")
+
         if self.solid_geometry is None:
         if self.solid_geometry is None:
             log.debug("solid_geometry is None")
             log.debug("solid_geometry is None")
             return 0, 0, 0, 0
             return 0, 0, 0, 0
@@ -3442,6 +3448,8 @@ class Gerber (Geometry):
         :type vect: tuple
         :type vect: tuple
         :return: None
         :return: None
         """
         """
+        log.debug("camlib.Gerber.offset()")
+
         try:
         try:
             dx, dy = vect
             dx, dy = vect
         except TypeError:
         except TypeError:
@@ -3504,6 +3512,7 @@ class Gerber (Geometry):
         :type point: list
         :type point: list
         :return: None
         :return: None
         """
         """
+        log.debug("camlib.Gerber.mirror()")
 
 
         px, py = point
         px, py = point
         xscale, yscale = {"X": (1.0, -1.0), "Y": (-1.0, 1.0)}[axis]
         xscale, yscale = {"X": (1.0, -1.0), "Y": (-1.0, 1.0)}[axis]
@@ -3554,6 +3563,7 @@ class Gerber (Geometry):
         See shapely manual for more information:
         See shapely manual for more information:
         http://toblerity.org/shapely/manual.html#affine-transformations
         http://toblerity.org/shapely/manual.html#affine-transformations
         """
         """
+        log.debug("camlib.Gerber.skew()")
 
 
         px, py = point
         px, py = point
 
 
@@ -3596,6 +3606,7 @@ class Gerber (Geometry):
         :param point:
         :param point:
         :return:
         :return:
         """
         """
+        log.debug("camlib.Gerber.rotate()")
 
 
         px, py = point
         px, py = point
 
 
@@ -4631,7 +4642,7 @@ class Excellon(Geometry):
         # fixed issue of getting bounds only for one level lists of objects
         # fixed issue of getting bounds only for one level lists of objects
         # now it can get bounds for nested lists of objects
         # now it can get bounds for nested lists of objects
 
 
-        log.debug("Excellon() -> bounds()")
+        log.debug("camlib.Excellon.bounds()")
         # if self.solid_geometry is None:
         # if self.solid_geometry is None:
         #     log.debug("solid_geometry is None")
         #     log.debug("solid_geometry is None")
         #     return 0, 0, 0, 0
         #     return 0, 0, 0, 0
@@ -4691,6 +4702,8 @@ class Excellon(Geometry):
         :type str: IN or MM
         :type str: IN or MM
         :return:
         :return:
         """
         """
+        log.debug("camlib.Excellon.convert_units()")
+
         factor = Geometry.convert_units(self, units)
         factor = Geometry.convert_units(self, units)
 
 
         # Tools
         # Tools
@@ -4711,6 +4724,8 @@ class Excellon(Geometry):
         :return: None
         :return: None
         :rtype: NOne
         :rtype: NOne
         """
         """
+        log.debug("camlib.Excellon.scale()")
+
         if yfactor is None:
         if yfactor is None:
             yfactor = xfactor
             yfactor = xfactor
 
 
@@ -4755,6 +4770,7 @@ class Excellon(Geometry):
         :type vect: tuple
         :type vect: tuple
         :return: None
         :return: None
         """
         """
+        log.debug("camlib.Excellon.offset()")
 
 
         dx, dy = vect
         dx, dy = vect
 
 
@@ -4795,6 +4811,8 @@ class Excellon(Geometry):
         :type point: list
         :type point: list
         :return: None
         :return: None
         """
         """
+        log.debug("camlib.Excellon.mirror()")
+
         px, py = point
         px, py = point
         xscale, yscale = {"X": (1.0, -1.0), "Y": (-1.0, 1.0)}[axis]
         xscale, yscale = {"X": (1.0, -1.0), "Y": (-1.0, 1.0)}[axis]
 
 
@@ -4842,6 +4860,8 @@ class Excellon(Geometry):
         See shapely manual for more information:
         See shapely manual for more information:
         http://toblerity.org/shapely/manual.html#affine-transformations
         http://toblerity.org/shapely/manual.html#affine-transformations
         """
         """
+        log.debug("camlib.Excellon.skew()")
+
         if angle_x is None:
         if angle_x is None:
             angle_x = 0.0
             angle_x = 0.0
 
 
@@ -4900,6 +4920,7 @@ class Excellon(Geometry):
         :param point: tuple of coordinates (x, y)
         :param point: tuple of coordinates (x, y)
         :return:
         :return:
         """
         """
+        log.debug("camlib.Excellon.rotate()")
 
 
         def rotate_geom(obj, origin=None):
         def rotate_geom(obj, origin=None):
             if type(obj) is list:
             if type(obj) is list:
@@ -5092,8 +5113,9 @@ class CNCjob(Geometry):
         return self.__dict__
         return self.__dict__
 
 
     def convert_units(self, units):
     def convert_units(self, units):
+        log.debug("camlib.CNCJob.convert_units()")
+
         factor = Geometry.convert_units(self, units)
         factor = Geometry.convert_units(self, units)
-        log.debug("CNCjob.convert_units()")
 
 
         self.z_cut = float(self.z_cut) * factor
         self.z_cut = float(self.z_cut) * factor
         self.z_move *= factor
         self.z_move *= factor
@@ -6987,6 +7009,8 @@ class CNCjob(Geometry):
         # fixed issue of getting bounds only for one level lists of objects
         # fixed issue of getting bounds only for one level lists of objects
         # now it can get bounds for nested lists of objects
         # now it can get bounds for nested lists of objects
 
 
+        log.debug("camlib.CNCJob.bounds()")
+
         def bounds_rec(obj):
         def bounds_rec(obj):
             if type(obj) is list:
             if type(obj) is list:
                 minx = Inf
                 minx = Inf
@@ -7058,6 +7082,7 @@ class CNCjob(Geometry):
         :return: None
         :return: None
         :rtype: None
         :rtype: None
         """
         """
+        log.debug("camlib.CNCJob.scale()")
 
 
         if yfactor is None:
         if yfactor is None:
             yfactor = xfactor
             yfactor = xfactor
@@ -7207,6 +7232,8 @@ class CNCjob(Geometry):
         :type vect: tuple
         :type vect: tuple
         :return: None
         :return: None
         """
         """
+        log.debug("camlib.CNCJob.offset()")
+
         dx, dy = vect
         dx, dy = vect
 
 
         def offset_g(g):
         def offset_g(g):
@@ -7271,6 +7298,8 @@ class CNCjob(Geometry):
         :param point: tupple of coordinates (x,y)
         :param point: tupple of coordinates (x,y)
         :return:
         :return:
         """
         """
+        log.debug("camlib.CNCJob.mirror()")
+
         px, py = point
         px, py = point
         xscale, yscale = {"X": (1.0, -1.0), "Y": (-1.0, 1.0)}[axis]
         xscale, yscale = {"X": (1.0, -1.0), "Y": (-1.0, 1.0)}[axis]
 
 
@@ -7296,6 +7325,8 @@ class CNCjob(Geometry):
         See shapely manual for more information:
         See shapely manual for more information:
         http://toblerity.org/shapely/manual.html#affine-transformations
         http://toblerity.org/shapely/manual.html#affine-transformations
         """
         """
+        log.debug("camlib.CNCJob.skew()")
+
         px, py = point
         px, py = point
 
 
         for g in self.gcode_parsed:
         for g in self.gcode_parsed:
@@ -7312,6 +7343,7 @@ class CNCjob(Geometry):
         :param point: tupple of coordinates (x,y)
         :param point: tupple of coordinates (x,y)
         :return:
         :return:
         """
         """
+        log.debug("camlib.CNCJob.rotate()")
 
 
         px, py = point
         px, py = point