Marius Stanciu 5 лет назад
Родитель
Сommit
49911c2390
3 измененных файлов с 7 добавлено и 5 удалено
  1. 3 2
      AppObjects/AppObject.py
  2. 3 3
      AppObjects/FlatCAMGerber.py
  3. 1 0
      CHANGELOG.md

+ 3 - 2
AppObjects/AppObject.py

@@ -48,6 +48,7 @@ class AppObject(QtCore.QObject):
     def __init__(self, app):
     def __init__(self, app):
         super(AppObject, self).__init__()
         super(AppObject, self).__init__()
         self.app = app
         self.app = app
+        self.inform = app.inform
 
 
         # signals that are emitted when object state changes
         # signals that are emitted when object state changes
         self.object_created.connect(self.on_object_created)
         self.object_created.connect(self.on_object_created)
@@ -127,7 +128,7 @@ class AppObject(QtCore.QObject):
         t1 = time.time()
         t1 = time.time()
         log.debug("%f seconds before initialize()." % (t1 - t0))
         log.debug("%f seconds before initialize()." % (t1 - t0))
         try:
         try:
-            return_value = initialize(obj, self)
+            return_value = initialize(obj, self.app)
         except Exception as e:
         except Exception as e:
             msg = '[ERROR_NOTCL] %s' % _("An internal error has occurred. See shell.\n")
             msg = '[ERROR_NOTCL] %s' % _("An internal error has occurred. See shell.\n")
             msg += _("Object ({kind}) failed because: {error} \n\n").format(kind=kind, error=str(e))
             msg += _("Object ({kind}) failed because: {error} \n\n").format(kind=kind, error=str(e))
@@ -347,7 +348,7 @@ class AppObject(QtCore.QObject):
         def task(t_obj):
         def task(t_obj):
             with self.app.proc_container.new(_("Plotting")):
             with self.app.proc_container.new(_("Plotting")):
                 if t_obj.kind == 'cncjob':
                 if t_obj.kind == 'cncjob':
-                    t_obj.plot(kind=self.defaults["cncjob_plot_kind"])
+                    t_obj.plot(kind=self.app.defaults["cncjob_plot_kind"])
                 else:
                 else:
                     t_obj.plot()
                     t_obj.plot()
 
 

+ 3 - 3
AppObjects/FlatCAMGerber.py

@@ -968,7 +968,7 @@ class GerberObject(FlatCAMObj, Gerber):
                     else:
                     else:
                         iso_name = outname
                         iso_name = outname
 
 
-                def iso_init(geo_obj, app_obj):
+                def iso_init(geo_obj, fc_obj):
                     # Propagate options
                     # Propagate options
                     geo_obj.options["cnctooldia"] = str(self.options["isotooldia"])
                     geo_obj.options["cnctooldia"] = str(self.options["isotooldia"])
                     if self.ui.tool_type_radio.get_value() == 'v':
                     if self.ui.tool_type_radio.get_value() == 'v':
@@ -983,7 +983,7 @@ class GerberObject(FlatCAMObj, Gerber):
                                                   nr_passes=i)
                                                   nr_passes=i)
 
 
                     if geom == 'fail':
                     if geom == 'fail':
-                        app_obj.inform.emit('[ERROR_NOTCL] %s' % _("Isolation geometry could not be generated."))
+                        fc_obj.inform.emit('[ERROR_NOTCL] %s' % _("Isolation geometry could not be generated."))
                         return 'fail'
                         return 'fail'
 
 
                     geo_obj.solid_geometry = geom
                     geo_obj.solid_geometry = geom
@@ -1060,7 +1060,7 @@ class GerberObject(FlatCAMObj, Gerber):
                     if empty_cnt == len(geo_obj.solid_geometry):
                     if empty_cnt == len(geo_obj.solid_geometry):
                         raise ValidationError("Empty Geometry", None)
                         raise ValidationError("Empty Geometry", None)
                     else:
                     else:
-                        app_obj.inform.emit('[success] %s: %s' %
+                        fc_obj.inform.emit('[success] %s: %s' %
                                             (_("Isolation geometry created"), geo_obj.options["name"]))
                                             (_("Isolation geometry created"), geo_obj.options["name"]))
                     geo_obj.multigeo = False
                     geo_obj.multigeo = False
 
 

+ 1 - 0
CHANGELOG.md

@@ -28,6 +28,7 @@ CHANGELOG for FlatCAM beta
 - moved more methods out of App_Main class
 - moved more methods out of App_Main class
 - added confirmation messages for toggle of HUD, Grid, Grid Snap, Axis
 - added confirmation messages for toggle of HUD, Grid, Grid Snap, Axis
 - added icon in status bar for HUD; clicking on it will toggle the HUD (heads up display)
 - added icon in status bar for HUD; clicking on it will toggle the HUD (heads up display)
+- fixes due of recent changes
 
 
 17.05.2020
 17.05.2020