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

Fixed bug failing to generate new unique names for objects.

Juan Pablo Caram 11 лет назад
Родитель
Сommit
84bd8d14c6
6 измененных файлов с 46 добавлено и 18 удалено
  1. 2 2
      FlatCAMApp.py
  2. 7 0
      FlatCAMDraw.py
  3. 1 1
      defaults.json
  4. 10 2
      manual/_theme/sphinx_rtd_theme/layout.html
  5. 25 12
      manual/basics.rst
  6. 1 1
      recent.json

+ 2 - 2
FlatCAMApp.py

@@ -612,10 +612,10 @@ class App(QtCore.QObject):
         App.log.debug("new_object()")
 
         ### Check for existing name
-        if name in self.collection.get_names():
+        while name in self.collection.get_names():
             ## Create a new name
             # Ends with number?
-            App.log.debug("new_object(): Object name exists, changing.")
+            App.log.debug("new_object(): Object name (%s) exists, changing." % name)
             match = re.search(r'(.*[^\d])?(\d+)$', name)
             if match:  # Yes: Increment the number!
                 base = match.group(1) or ''

+ 7 - 0
FlatCAMDraw.py

@@ -491,6 +491,13 @@ class FlatCAMDraw:
         self.plot_all()
 
     def edit_fcgeometry(self, fcgeometry):
+        """
+        Imports the geometry from the given FlatCAM Geometry object
+        into the editor.
+
+        :param fcgeometry: FlatCAMGeometry
+        :return: None
+        """
         try:
             _ = iter(fcgeometry.solid_geometry)
             geometry = fcgeometry.solid_geometry

+ 1 - 1
defaults.json

@@ -1 +1 @@
-{"gerber_cutoutgapsize": 0.15, "gerber_noncopperrounded": false, "geometry_paintoverlap": 0.15, "cncjob_append": "", "excellon_feedrate": 3.0, "serial": "q808lhee8dc0k21d0o7b", "stats": {"on_file_openproject": 3, "on_options_app2project": 33, "save_defaults": 8918, "on_delete": 3, "on_about": 1, "geometry_on_paint_button": 4, "on_fileopengerber": 1, "on_toolbar_replot": 7, "gerber_on_generatebb_button": 1, "gerber_on_iso_button": 6, "geometry_on_generatecnc_button": 2, "on_file_new": 33, "on_file_saveproject": 1, "exec_command": 4}, "gerber_plot": true, "excellon_drillz": -0.1, "geometry_feedrate": 3.0, "units": "IN", "excellon_travelz": 0.1, "gerber_multicolored": false, "gerber_solid": true, "gerber_isopasses": 1, "excellon_plot": true, "gerber_isotooldia": 0.016, "cncjob_tooldia": 0.016, "geometry_travelz": 0.1, "gerber_cutoutmargin": 0.1, "excellon_solid": false, "geometry_paintmargin": 0.0, "geometry_cutz": -0.002, "gerber_noncoppermargin": 0.0, "gerber_cutouttooldia": 0.07, "gerber_gaps": "4", "gerber_bboxmargin": 0.0, "cncjob_plot": true, "geometry_plot": true, "gerber_isooverlap": 0.15, "gerber_bboxrounded": false, "geometry_cnctooldia": 0.016, "geometry_painttooldia": 0.07}
+{}

+ 10 - 2
manual/_theme/sphinx_rtd_theme/layout.html

@@ -116,9 +116,17 @@
 
     {# SIDE NAV, TOGGLES ON MOBILE #}
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
-      <div class="wy-side-nav-search">
+      <div class="wy-side-nav-search" style="background-color: #3d3d3d;">
         <!--<a href="{{ pathto(master_doc) }}" class="icon icon-home"> {{ project }}</a>-->
-        <a href="http://flatcam.org" class="icon icon-home"> {{ project }}</a>
+        <!--<a href="http://flatcam.org" class="icon icon-home"> {{ project }}</a>-->
+        <a href="http://flatcam.org">
+            <img src="http://flatcam.org/static/images/fcweblogo1_halloween.png"
+                    style="height: auto;
+                    width: auto;
+                    border-radius: 0px;
+                    background-color: #3d3d3d;
+                    margin: auto">
+        </a>
         {% include "searchbox.html" %}
       </div>
 

+ 25 - 12
manual/basics.rst

@@ -1,13 +1,6 @@
 Basics
 ======
 
-Creating, Saving and Loading Projects
--------------------------------------
-
-A project is everything that you have loaded, created and set inside the program. A new project is created every time you load the program or run File→New.
-
-By running File→Save Project, File→Save Project As… or File→Save a Project Copy… you are saving everything currently in the environment including project options. File→Open Project… lets you load a saved project.
-
 Source Files
 ------------
 
@@ -19,15 +12,35 @@ Supported source files are:
 
 These source files can be loaded by selecting File→Open Gerber…, File→Open Excellon… or File→Open G-Code… respectively. The objects created from source files are automatically added to the current project when loaded.
 
+
+Objects and Tasks
+-----------------
+
+Data in FlatCAM is in the form of 4 different kinds of objects: Gerber, Excellon, Geometry and CNC Job. Gerber, Excellon and CNC Jos objects are directly created by reading files in Gerber, Excellon and G-Code formats. Geometry objects are an intermediate step available to manipulate data. The diagram bellow illustrates the relationship between files and objects. The arrows connecting objects represent a sub-set of the tasks that can be performed in FlatCAM.
+
+.. image:: objects_flow.png
+    :align: center
+
+
+Creating, Saving and Loading Projects
+-------------------------------------
+
+A project is everything that you have loaded, created and set inside the program. A new project is created every time you load the program or run File→New.
+
+By running File→Save Project, File→Save Project As… or File→Save a Project Copy… you are saving everything currently in the environment including project options. File→Open Project… lets you load a saved project.
+
+
 Navigating Plots
 ----------------
 
-Plots for open objectsPlots for open objects (Gerber, drills, g-code, etc…) are automatically shown on screen. A plot for a given can be updated by clicking “Update Plot” in the “Selected” tab, in case any parameters that would have changed the plot have been modified. (Gerber, drills, g-code, etc…) are automatically shown on screen. A plot for a given can be updated by clicking “Update Plot” in the “Selected” tab, in case any parameters that would have changed the plot have been modified.
+Plots for open objects (Gerber, drills, g-code, etc…) are automatically shown on screen. A plot for a given can be updated by clicking “Update Plot” in the “Selected” tab, in case any parameters that would have changed the plot have been modified.
 
 Zooming plots in and out is accomplished by clicking on the plot and using the mouse **scroll wheel** or hitting one of the following keys:
 
-* **‘1’**: Fits all graphics to the available plotting area.
-* **‘2’**: Zooms out
-* **‘3’**: Zooms in
+* ``1``: Fits all graphics to the available plotting area.
+* ``2``: Zooms out
+* ``3``: Zooms in
+
+When zooming in or out, the point under the cursor stays at the same location.
 
-When zooming in or out, the point under the cursor stays at the same location. To move around the plot, first zoom out, move the cursor to a point of interest and zoom in again.
+To scroll left-right or up-down, hold the ``shift`` or ``control`` key respectively while turning the mouse **scroll wheel**.

+ 1 - 1
recent.json

@@ -1 +1 @@
-[{"kind": "gerber", "filename": "C:/Users/jpcaram/Dropbox/CNC/pcbcam/test_files/Top2.gbr"}, {"kind": "project", "filename": "C:/Users/jpcaram/Dropbox/CNC/pcbcam/test_files/easy_eda_test/easy_eda.fc"}]
+[{"kind": "excellon", "filename": "C:/Users/jpcaram/Dropbox/CNC/pcbcam/test_files/FlatCam_Drilling_Test/FlatCam_Drilling_Test.drl"}, {"kind": "gerber", "filename": "C:/Users/jpcaram/Dropbox/CNC/pcbcam/test_files/Top2.gbr"}, {"kind": "project", "filename": "C:/Users/jpcaram/Dropbox/CNC/pcbcam/test_files/easy_eda_test/easy_eda.fc"}]