From d94dd54c3ea56ec0ebec10b907b0cf0924464a69 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Tue, 22 Oct 2024 11:10:45 -0300 Subject: [PATCH] [DOCs][Updated] Including new preflight --- CHANGELOG.md | 2 + docs/samples/generic_plot.kibot.yaml | 12 ++ docs/source/Changelog.rst | 4 + .../preflights/DrawFancyStackupOptions.rst | 39 +++++ .../preflights/DrawStackupOptions.rst | 2 +- .../preflights/SUColumnsFancy.rst | 9 + .../preflights/draw_fancy_stackup.rst | 24 +++ docs/source/configuration/sup_preflights.rst | 1 + tests/GUI/preflights | 159 ++++++++++++++++++ tests/GUI/stats | 77 +++++---- 10 files changed, 292 insertions(+), 37 deletions(-) create mode 100644 docs/source/configuration/preflights/DrawFancyStackupOptions.rst create mode 100644 docs/source/configuration/preflights/SUColumnsFancy.rst create mode 100644 docs/source/configuration/preflights/draw_fancy_stackup.rst diff --git a/CHANGELOG.md b/CHANGELOG.md index bf77fe7d7..694bae6cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.8.2] - UNRELEASED ### Added - Experimental GUI +- Preflights: + - Draw Fancy Stackup: which includes the type of vias used (#699) - SVG: `use_aux_axis_as_origin` option (#681) - Report: thickness units (#685) - PCB Print: diff --git a/docs/samples/generic_plot.kibot.yaml b/docs/samples/generic_plot.kibot.yaml index 513d85817..38b2afc94 100644 --- a/docs/samples/generic_plot.kibot.yaml +++ b/docs/samples/generic_plot.kibot.yaml @@ -49,6 +49,18 @@ preflight: # creates significant changes to a layer use the CheckZoneFill internal template . # [boolean=false] Enable this preflight. check_zone_fills: true + # Draw Fancy Stackup + # Draw the PCB stackup. Needs KiCad 7 or newer. + # To specify the position and size of the drawing you can use two methods. + # You can specify it using the *pos_x*, *pos_y*, *width* and *layer* options. + # But you can also draw a rectangle in your PCB with the size and layer you want. + # Then draw another thing inside the rectangle, select both and create a group + # (right mouse button, then Grouping -> Group). Now edit the group and change its name + # to *kibot_fancy_stackup*. After running this preflight the rectangle will contain the + # stackup. Note that the height is not determined by the group height, but by the number + # of layers and spacing between layers. . + # [boolean|dict=false] Use a boolean for simple cases or fine-tune its behavior. + draw_fancy_stackup: true # Draw Stackup # Draw the PCB stackup. Needs KiCad 7 or newer. # To specify the position and size of the drawing you can use two methods. diff --git a/docs/source/Changelog.rst b/docs/source/Changelog.rst index 693180b91..777e67482 100644 --- a/docs/source/Changelog.rst +++ b/docs/source/Changelog.rst @@ -20,6 +20,10 @@ Added ~~~~~ - Experimental GUI +- Preflights: + + - Draw Fancy Stackup: which includes the type of vias used (#699) + - SVG: ``use_aux_axis_as_origin`` option (#681) - Report: thickness units (#685) - PCB Print: diff --git a/docs/source/configuration/preflights/DrawFancyStackupOptions.rst b/docs/source/configuration/preflights/DrawFancyStackupOptions.rst new file mode 100644 index 000000000..c0784af98 --- /dev/null +++ b/docs/source/configuration/preflights/DrawFancyStackupOptions.rst @@ -0,0 +1,39 @@ +.. _DrawFancyStackupOptions: + + +DrawFancyStackupOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **columns** :index:`: ` [:ref:`SUColumnsFancy parameters `] [:ref:`list(dict) ` | :ref:`list(string) `] (default: computed for your project) List of columns to display. + Can be just the name of the column. + Available columns are *drawing*, *material*, *layer*, *thickness*, *dielectric*, *layer_type*, *gerber*. + When empty KiBot will add them in the above order, skipping the *gerber* if not available. +- **draw_stackup** :index:`: ` [:ref:`boolean `] (default: ``true``) Choose whether to display the stackup drawing or not. +- **gerber** :index:`: ` [:ref:`string `] (default: ``''``) Name of the output used to generate the gerbers. This is needed only when you + want to include the *gerber* column, containing the gerber file names. +- **gerber_extension_only** :index:`: ` [:ref:`boolean `] (default: ``true``) Only display the gerber file extension instead of full gerber name. +- ``column_spacing`` :index:`: ` [:ref:`number `] (default: ``2``) Blank space (in number of characters) between columns in the stackup table.. +- ``core_extra_spacing_ratio`` :index:`: ` [:ref:`number `] (default: ``2``) Extra vertical space given to the core layers.. +- ``draw_vias`` :index:`: ` [:ref:`boolean `] (default: ``true``) Enable drawing vias (thru, blind, buried) in the stackup table.. +- ``drawing_border_spacing`` :index:`: ` [:ref:`number `] (default: ``10``) Space (in number of characters) between stackup drawing borders and via drawings.. +- ``enabled`` :index:`: ` [:ref:`boolean `] (default: ``true``) Enable the check. This is the replacement for the boolean value. +- ``group_name`` :index:`: ` [:ref:`string `] (default: ``'kibot_fancy_stackup'``) Name for the group containing the drawings. If KiBot can't find it will create + a new group at the specified coordinates for the indicated layer. +- ``layer`` :index:`: ` [:ref:`string `] (default: ``'Cmts.User'``) Layer used for the stackup. Only used when the group can't be found. + Otherwise we use the layer for the first object in the group. +- ``layer_spacing`` :index:`: ` [:ref:`number `] (default: ``3``) Space (in number of characters) between layers on the stackup table/drawing.. +- ``note`` :index:`: ` [:ref:`string `] (default: ``''``) Note to write at the bottom of the stackup table. Leave empty if no note is to be written.. +- ``pos_x`` :index:`: ` [:ref:`number `] (default: ``19``) X position in the PCB. The units are defined by the global *units* variable. + Only used when the group can't be found. +- ``pos_y`` :index:`: ` [:ref:`number `] (default: ``100``) Y position in the PCB. The units are defined by the global *units* variable. + Only used when the group can't be found. +- ``stackup_to_text_lines_spacing`` :index:`: ` [:ref:`number `] (default: ``3``) Space (in number of characters) between stackup drawing and stackup table.. +- ``via_spacing`` :index:`: ` [:ref:`number `] (default: ``8``) Space (in number of characters) between vias in the stackup drawing.. +- ``via_width`` :index:`: ` [:ref:`number `] (default: ``4``) Width (in number of characters) of a via in the stackup drawing.. +- ``width`` :index:`: ` [:ref:`number `] (default: ``120``) Width for the drawing. The units are defined by the global *units* variable. + Only used when the group can't be found. + +.. toctree:: + :caption: Used dicts + + SUColumnsFancy diff --git a/docs/source/configuration/preflights/DrawStackupOptions.rst b/docs/source/configuration/preflights/DrawStackupOptions.rst index 31bdbc395..31102916c 100644 --- a/docs/source/configuration/preflights/DrawStackupOptions.rst +++ b/docs/source/configuration/preflights/DrawStackupOptions.rst @@ -14,7 +14,7 @@ DrawStackupOptions parameters - ``enabled`` :index:`: ` [:ref:`boolean `] (default: ``true``) Enable the check. This is the replacement for the boolean value. - ``group_name`` :index:`: ` [:ref:`string `] (default: ``'kibot_stackup'``) Name for the group containing the drawings. If KiBot can't find it will create a new group at the specified coordinates for the indicated layer. -- ``height`` :index:`: ` [:ref:`number `] (default: ``200``) Height for the drawing. The units are defined by the global *units* variable. +- ``height`` :index:`: ` [:ref:`number `] (default: ``100``) Height for the drawing. The units are defined by the global *units* variable. Only used when the group can't be found. - ``layer`` :index:`: ` [:ref:`string `] (default: ``'Cmts.User'``) Layer used for the stackup. Only used when the group can't be found. Otherwise we use the layer for the first object in the group. diff --git a/docs/source/configuration/preflights/SUColumnsFancy.rst b/docs/source/configuration/preflights/SUColumnsFancy.rst new file mode 100644 index 000000000..d176ceba3 --- /dev/null +++ b/docs/source/configuration/preflights/SUColumnsFancy.rst @@ -0,0 +1,9 @@ +.. _SUColumnsFancy: + + +SUColumnsFancy parameters +~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **type** :index:`: ` '' +- **width** :index:`: ` [:ref:`number `] (default: ``30``) Relative width. Is computed automatically according to the defined group width. + diff --git a/docs/source/configuration/preflights/draw_fancy_stackup.rst b/docs/source/configuration/preflights/draw_fancy_stackup.rst new file mode 100644 index 000000000..2fedeee7d --- /dev/null +++ b/docs/source/configuration/preflights/draw_fancy_stackup.rst @@ -0,0 +1,24 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Draw Fancy Stackup; draw_fancy_stackup + +Draw Fancy Stackup +~~~~~~~~~~~~~~~~~~ + +Draw the PCB stackup. Needs KiCad 7 or newer. +To specify the position and size of the drawing you can use two methods. |br| +You can specify it using the *pos_x*, *pos_y*, *width* and *layer* options. |br| +But you can also draw a rectangle in your PCB with the size and layer you want. |br| +Then draw another thing inside the rectangle, select both and create a group +(right mouse button, then Grouping -> Group). Now edit the group and change its name +to *kibot_fancy_stackup*. After running this preflight the rectangle will contain the +stackup. Note that the height is not determined by the group height, but by the number +of layers and spacing between layers. |br| + + - **draw_fancy_stackup** :index:`: ` [:ref:`DrawFancyStackupOptions parameters `] [:ref:`boolean ` | :ref:`dict `] (default: ``false``) Use a boolean for simple cases or fine-tune its behavior. + +.. toctree:: + :caption: Used dicts + + DrawFancyStackupOptions diff --git a/docs/source/configuration/sup_preflights.rst b/docs/source/configuration/sup_preflights.rst index 6e40b4bf5..6f93c6928 100644 --- a/docs/source/configuration/sup_preflights.rst +++ b/docs/source/configuration/sup_preflights.rst @@ -10,6 +10,7 @@ Supported preflights preflights/annotate_power preflights/check_fields preflights/check_zone_fills + preflights/draw_fancy_stackup preflights/draw_stackup preflights/drc preflights/erc diff --git a/tests/GUI/preflights b/tests/GUI/preflights index 74f01172b..e5fdf08b2 100644 --- a/tests/GUI/preflights +++ b/tests/GUI/preflights @@ -170,6 +170,165 @@ null ] ], + "draw_fancy_stackup": [ + [ + "draw_fancy_stackup", + [ + "DataTypeDict", + "DataTypeBoolean" + ], + [ + [ + "enabled", + [ + "DataTypeBoolean" + ], + null + ], + [ + "pos_x", + [ + "DataTypeNumber" + ], + null + ], + [ + "pos_y", + [ + "DataTypeNumber" + ], + null + ], + [ + "width", + [ + "DataTypeNumber" + ], + null + ], + [ + "layer", + [ + "DataTypeString" + ], + null + ], + [ + "group_name", + [ + "DataTypeString" + ], + null + ], + [ + "gerber", + [ + "DataTypeString" + ], + null + ], + [ + "gerber_extension_only", + [ + "DataTypeBoolean" + ], + null + ], + [ + "draw_stackup", + [ + "DataTypeBoolean" + ], + null + ], + [ + "columns", + [ + "DataTypeListDictOrString" + ], + [ + [ + "type", + [ + "DataTypeChoice" + ], + null + ], + [ + "width", + [ + "DataTypeNumber" + ], + null + ] + ] + ], + [ + "draw_vias", + [ + "DataTypeBoolean" + ], + null + ], + [ + "drawing_border_spacing", + [ + "DataTypeNumber" + ], + null + ], + [ + "stackup_to_text_lines_spacing", + [ + "DataTypeNumber" + ], + null + ], + [ + "via_width", + [ + "DataTypeNumber" + ], + null + ], + [ + "via_spacing", + [ + "DataTypeNumber" + ], + null + ], + [ + "core_extra_spacing_ratio", + [ + "DataTypeNumber" + ], + null + ], + [ + "layer_spacing", + [ + "DataTypeNumber" + ], + null + ], + [ + "column_spacing", + [ + "DataTypeNumber" + ], + null + ], + [ + "note", + [ + "DataTypeString" + ], + null + ] + ] + ] + ], "draw_stackup": [ [ "draw_stackup", diff --git a/tests/GUI/stats b/tests/GUI/stats index 3dca8aa4b..80870da2f 100644 --- a/tests/GUI/stats +++ b/tests/GUI/stats @@ -181,15 +181,16 @@ Used as single data type: - String,StringDict: 1 ['pcbdraw.options.remap'] ================================================================================ ================================================================================ -21 preflights types with a total of 120 different parameters -Single type parameters: 114 (95 %) -Multi type parameters: 6 (5 %) +22 preflights types with a total of 142 different parameters +Single type parameters: 135 (95 %) +Multi type parameters: 7 (5 %) Average parameters: 6 -Maximum number of parameters: 18 +Maximum number of parameters: 22 Minimum number of parameters: 1 Histogram: 0- 9: **************** 10- 19: ***** + 20- 29: * Preflights sorted by parameters: - annotate_power: 1 - check_zone_fills: 1 @@ -212,14 +213,15 @@ Preflights sorted by parameters: - draw_stackup: 15 - erc: 15 - drc: 18 -Average depth: 1.8095238095238095 +- draw_fancy_stackup: 22 +Average depth: 1.8636363636363635 Maximum depth: 3 Minimum depth: 1 Histogram: 0: 1: ********* 2: ******* -3: ***** +3: ****** Preflights sorted by depth: - annotate_power: 1 - check_zone_fills: 1 @@ -237,6 +239,7 @@ Preflights sorted by depth: - run_erc: 2 - set_text_variables: 2 - update_xml: 2 +- draw_fancy_stackup: 3 - draw_stackup: 3 - drc: 3 - erc: 3 @@ -244,29 +247,29 @@ Preflights sorted by depth: - sch_replace: 3 -------------------------------------------------------------------------------- 9 different data types -- String: 40 -- Boolean: 38 -- Choice: 15 -- Number: 11 -- Dict: 9 +- String: 44 +- Boolean: 43 +- Number: 22 +- Choice: 16 +- Dict: 10 - ListStringSingular: 5 - ListDictSingular: 4 - ListDict: 3 -- ListDictOrString: 1 +- ListDictOrString: 2 -------------------------------------------------------------------------------- Used as single data type: -- String: 40 -- Boolean: 32 -- Choice: 15 -- Number: 11 +- String: 44 +- Boolean: 36 +- Number: 22 +- Choice: 16 - ListStringSingular: 5 ['drc.drc.format', 'drc.drc.category', 'erc.erc.format', 'erc.erc.category', 'update_footprint.update_footprint'] - ListDictSingular: 4 ['check_fields.check_fields', 'pcb_replace.pcb_replace.replace_tags', 'sch_replace.sch_replace.replace_tags', 'set_text_variables.set_text_variables'] - ListDict: 3 ['filters.filters', 'drc.drc.filters', 'erc.erc.filters'] - Dict: 3 ['annotate_pcb.annotate_pcb', 'pcb_replace.pcb_replace', 'sch_replace.sch_replace'] -- ListDictOrString: 1 ['draw_stackup.draw_stackup.columns'] +- ListDictOrString: 2 ['draw_fancy_stackup.draw_fancy_stackup.columns', 'draw_stackup.draw_stackup.columns'] -------------------------------------------------------------------------------- 1 different data type combinations -- Boolean,Dict: 6 ['draw_stackup.draw_stackup', 'drc.drc', 'erc.erc', 'run_drc.run_drc', 'run_erc.run_erc', 'update_xml.update_xml'] +- Boolean,Dict: 7 ['draw_fancy_stackup.draw_fancy_stackup', 'draw_stackup.draw_stackup', 'drc.drc', 'erc.erc', 'run_drc.run_drc', 'run_erc.run_erc', 'update_xml.update_xml'] ================================================================================ ================================================================================ 12 filters types with a total of 138 different parameters @@ -384,16 +387,16 @@ Used as single data type: - Number,String: 15 ================================================================================ ================================================================================ -84 totals types with a total of 2202 different parameters -Single type parameters: 2007 (91 %) -Multi type parameters: 195 (9 %) +85 totals types with a total of 2224 different parameters +Single type parameters: 2028 (91 %) +Multi type parameters: 196 (9 %) Average parameters: 26 Maximum number of parameters: 213 Minimum number of parameters: 1 Histogram: 0- 9: *********************** 10- 19: ************** - 20- 29: ************************* + 20- 29: ************************** 30- 39: ******** 40- 49: ****** 50- 59: ** @@ -455,6 +458,7 @@ Totals sorted by parameters: - navigate_results: 21 - populate: 21 - download_datasheets: 22 +- draw_fancy_stackup: 22 - rot_footprint: 22 - dxf_sch_print: 23 - kicanvas: 23 @@ -498,14 +502,14 @@ Totals sorted by parameters: - pcb_print: 89 - bom: 145 - panelize: 213 -Average depth: 2.1666666666666665 +Average depth: 2.176470588235294 Maximum depth: 5 Minimum depth: 1 Histogram: 0: 1: ***************** 2: ***************************************** -3: ********************** +3: *********************** 4: *** 5: * Totals sorted by depth: @@ -584,6 +588,7 @@ Totals sorted by depth: - ps: 3 - qr_lib: 3 - svg: 3 +- draw_fancy_stackup: 3 - draw_stackup: 3 - drc: 3 - erc: 3 @@ -595,14 +600,14 @@ Totals sorted by depth: - bom: 5 -------------------------------------------------------------------------------- 14 different data types -- String: 987 -- Boolean: 557 -- Number: 295 +- String: 991 +- Boolean: 562 +- Number: 306 - ListStringSingular: 251 -- Choice: 124 -- Dict: 88 +- Choice: 125 +- Dict: 89 - ListDict: 30 -- ListDictOrString: 22 +- ListDictOrString: 23 - Combo: 14 - ListString: 12 - ListDictSingular: 10 @@ -611,16 +616,16 @@ Totals sorted by depth: - NumberChoice: 1 -------------------------------------------------------------------------------- Used as single data type: -- String: 818 -- Boolean: 495 +- String: 822 +- Boolean: 499 - ListStringSingular: 248 -- Number: 186 -- Choice: 121 +- Number: 197 +- Choice: 122 - Dict: 73 - ListDict: 30 - ListString: 12 - ListDictSingular: 10 ['blender_export.options.outputs', 'blender_export.options.light', 'blender_export.options.point_of_view', 'kikit_present.options.boards', 'qr_lib.options.qrs', 'check_fields.check_fields', 'pcb_replace.pcb_replace.replace_tags', 'sch_replace.sch_replace.replace_tags', 'set_text_variables.set_text_variables', 'spec_to_field.specs'] -- ListDictOrString: 6 ['bom.options.columns', 'bom.options.cost_extra_columns', 'bom.options.xlsx.specs_columns', 'kibom.options.conf.columns', 'position.options.columns', 'draw_stackup.draw_stackup.columns'] +- ListDictOrString: 7 ['bom.options.columns', 'bom.options.cost_extra_columns', 'bom.options.xlsx.specs_columns', 'kibom.options.conf.columns', 'position.options.columns', 'draw_fancy_stackup.draw_fancy_stackup.columns', 'draw_stackup.draw_stackup.columns'] - ListListString: 4 ['bom.options.component_aliases', 'kibom.options.conf.component_aliases', 'rot_footprint.rotations', 'rot_footprint.offsets'] - Combo: 2 ['report.options.template', 'step.options.origin'] - StringDict: 1 ['download_datasheets.options.classify_extra'] @@ -630,7 +635,7 @@ Used as single data type: - Number,String: 107 - Boolean,String: 52 - Combo,ListDictOrString: 12 -- Boolean,Dict: 6 ['draw_stackup.draw_stackup', 'drc.drc', 'erc.erc', 'run_drc.run_drc', 'run_erc.run_erc', 'update_xml.update_xml'] +- Boolean,Dict: 7 ['draw_fancy_stackup.draw_fancy_stackup', 'draw_stackup.draw_stackup', 'drc.drc', 'erc.erc', 'run_drc.run_drc', 'run_erc.run_erc', 'update_xml.update_xml'] - Dict,String: 5 ['blender_export.options.pcb3d', 'excellon.options.report', 'gerb_drill.options.report', 'kibom.options.conf', 'pcbdraw.options.style'] - ListDictOrString,String: 4 ['bom.options.columns.join', 'bom.options.cost_extra_columns.join', 'bom.options.xlsx.specs_columns.join', 'panelize.options.configs'] - Boolean,ListStringSingular: 3 ['bom.options.html.lcsc_link', 'bom.options.xlsx.lcsc_link', 'kibom.options.conf.lcsc_link']