diff --git a/README.md b/README.md index 4ffc8167..f15ea21d 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ Notes: - Show KiAuto installation information for `info` (v2.0.0) - Print the page frame in GUI mode for `pcb_print` (v1.6.7) -[**KiKit**](https://github.com/yaqwsx/KiKit) [![Tool](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/llave-inglesa-22x22.png)](https://github.com/yaqwsx/KiKit) ![Auto-download](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/auto_download-22x22.png) +[**KiKit**](https://github.com/yaqwsx/KiKit) v1.3.0 [![Tool](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/llave-inglesa-22x22.png)](https://github.com/yaqwsx/KiKit) ![Auto-download](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/auto_download-22x22.png) - Mandatory for: `panelize`, `stencil_3d`, `stencil_for_jig` - Optional to separate multiboard projects for general use diff --git a/kibot/dep_downloader.py b/kibot/dep_downloader.py index a727b5cc..9a8cb564 100644 --- a/kibot/dep_downloader.py +++ b/kibot/dep_downloader.py @@ -73,6 +73,7 @@ Dependencies: github: yaqwsx/KiKit pypi: KiKit downloader: pytool + version: 1.3.0 - from: KiKit role: Separate multiboard projects - name: Xvfbwrapper diff --git a/src/kibot-check b/src/kibot-check index 8f932bf7..436aae4c 100755 --- a/src/kibot-check +++ b/src/kibot-check @@ -716,28 +716,44 @@ deps = '{\ "mandatory": false,\ "max_version": null,\ "output": "global",\ - "version": null\ + "version": [\ + 1,\ + 3,\ + 0\ + ]\ },\ {\ "desc": null,\ "mandatory": true,\ "max_version": null,\ "output": "panelize",\ - "version": null\ + "version": [\ + 1,\ + 3,\ + 0\ + ]\ },\ {\ "desc": null,\ "mandatory": true,\ "max_version": null,\ "output": "stencil_3d",\ - "version": null\ + "version": [\ + 1,\ + 3,\ + 0\ + ]\ },\ {\ "desc": null,\ "mandatory": true,\ "max_version": null,\ "output": "stencil_for_jig",\ - "version": null\ + "version": [\ + 1,\ + 3,\ + 0\ + ]\ }\ ],\ "tests": [],\ diff --git a/tests/reference/6_0_8/light_control-panel.png b/tests/reference/6_0_8/light_control-panel.png new file mode 100644 index 00000000..22dbc64c Binary files /dev/null and b/tests/reference/6_0_8/light_control-panel.png differ diff --git a/tests/reference/6_0_8/light_control-stencil_3d_top.png b/tests/reference/6_0_8/light_control-stencil_3d_top.png new file mode 100644 index 00000000..6c2b1434 Binary files /dev/null and b/tests/reference/6_0_8/light_control-stencil_3d_top.png differ diff --git a/tests/reference/6_0_8/light_control-stencil_for_jig_top.png b/tests/reference/6_0_8/light_control-stencil_for_jig_top.png new file mode 100644 index 00000000..b333a80a Binary files /dev/null and b/tests/reference/6_0_8/light_control-stencil_for_jig_top.png differ diff --git a/tests/reference/7_0_0/light_control-panel.png b/tests/reference/7_0_0/light_control-panel.png new file mode 100644 index 00000000..2d2036fa Binary files /dev/null and b/tests/reference/7_0_0/light_control-panel.png differ diff --git a/tests/reference/7_0_0/light_control-stencil_3d_top.png b/tests/reference/7_0_0/light_control-stencil_3d_top.png new file mode 120000 index 00000000..c942960c --- /dev/null +++ b/tests/reference/7_0_0/light_control-stencil_3d_top.png @@ -0,0 +1 @@ +../6_0_8/light_control-stencil_3d_top.png \ No newline at end of file diff --git a/tests/reference/7_0_0/light_control-stencil_for_jig_top.png b/tests/reference/7_0_0/light_control-stencil_for_jig_top.png new file mode 120000 index 00000000..231acf60 --- /dev/null +++ b/tests/reference/7_0_0/light_control-stencil_for_jig_top.png @@ -0,0 +1 @@ +../6_0_8/light_control-stencil_for_jig_top.png \ No newline at end of file diff --git a/tests/test_plot/test_misc.py b/tests/test_plot/test_misc.py index 705022dd..fa9f42c4 100644 --- a/tests/test_plot/test_misc.py +++ b/tests/test_plot/test_misc.py @@ -1595,3 +1595,34 @@ def test_lcsc_field_specified(test_dir): assert ctx.search_err('User selected.*Cryptic') r, _, _ = ctx.load_csv(prj+'_bom_jlc.csv') assert r[0][3] == 'C1234' + + +@pytest.mark.skipif(context.ki5(), reason="KiKit is v6+") +def test_stencil_3D_1(test_dir): + prj = 'light_control' + ctx = context.TestContext(test_dir, prj, 'stencil_3D_1', 'stencil/3D') + ctx.run(extra=[]) + ctx.expect_out_file_d(prj+'-stencil_3d_top.stl') + ctx.compare_image(prj+'-stencil_3d_top.png', sub=True, tol=100) + ctx.clean_up(keep_project=True) + + +@pytest.mark.slow +@pytest.mark.skipif(context.ki5(), reason="KiKit is v6+") +def test_stencil_steel_1(test_dir): + prj = 'light_control' + ctx = context.TestContext(test_dir, prj, 'stencil_for_jig_1', 'stencil/Jig') + ctx.run(extra=[]) + ctx.expect_out_file_d(prj+'-stencil_for_jig_top.stl') + ctx.compare_image(prj+'-stencil_for_jig_top.png', sub=True, tol=100) + ctx.clean_up(keep_project=True) + + +@pytest.mark.slow +@pytest.mark.skipif(context.ki5(), reason="KiKit is v6+") +def test_panelize_1(test_dir): + prj = 'light_control' + ctx = context.TestContext(test_dir, prj, 'panelize_2') + ctx.run(extra=[]) + ctx.compare_image(prj+'-panel.png') + ctx.clean_up(keep_project=True) diff --git a/tests/utils/context.py b/tests/utils/context.py index 7856ef3b..63a66128 100644 --- a/tests/utils/context.py +++ b/tests/utils/context.py @@ -486,7 +486,7 @@ class TestContext(object): return self.search_not_in_file(os.path.join(self.sub_dir, file), texts) def compare_image(self, image, reference=None, diff='diff.png', ref_out_dir=False, fuzz='5%', tol=0, height='87%', - off_y='0'): + off_y='0', sub=False): """ For images and single page PDFs """ if reference is None: reference = image @@ -494,7 +494,7 @@ class TestContext(object): reference = self.get_out_path(reference) else: reference = os.path.join(REF_DIR, reference) - image = self.get_out_path(image) + image = self.get_out_path(image, sub) png_ref = None if reference[-3:] == 'svg': png_ref = reference[:-3]+'png' diff --git a/tests/yaml_samples/panelize_2.kibot.yaml b/tests/yaml_samples/panelize_2.kibot.yaml new file mode 100644 index 00000000..dc50c3b7 --- /dev/null +++ b/tests/yaml_samples/panelize_2.kibot.yaml @@ -0,0 +1,63 @@ +# Example KiBot config file for a basic panel +kibot: + version: 1 + +outputs: + - name: 'panel' + comment: "Create a 4x4 complex panel" + type: panelize + options: + title: '+ (Panel)' + units: mm + create_preview: true + configs: + - layout: + rows: 2 + cols: 2 + space: 2 + hbackbone: 5 + vbackbone: 5 + hboneskip: 1 + vboneskip: 1 + page: + size: A3 + tabs: + type: fixed + width: 3 + vcount: 2 + hcount: 0 + cuts: + type: mousebites + drill: 0.5 + spacing: 1mm + offset: 0.2 + prolong: 0.5 + framing: + type: railstb + width: 5 + space: 3 + copperfill: + type: hatched + clearance: 2 + spacing: 0.5 + width: 0.5 + tooling: + type: 3hole + hoffset: 2.5 + voffset: 2.5 + size: 1.5 + fiducials: + type: 3fid + hoffset: 5 + voffset: 2.5 + coppersize: 2 + opening: 1 + text: + type: simple + text: My panel + anchor: mt + voffset: 2.5 + hjustify: center + vjustify: center + post: + millradius: 1