From 5a2232d5cd3a3ceae8e07982b73c095eb5627302 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Sat, 16 Sep 2023 10:47:25 +0000 Subject: Add Gerber and Excellon drill files --- data/freedesktop.org.xml.in | 35 ++++++++ tests/mime-detection/list | 16 ++++ tests/mime-detection/pcb-drillFile.drl | 10 +++ tests/mime-detection/pcb-drillFileNoExt | 10 +++ tests/mime-detection/pcb-gerber-CommentNoExt | 5 ++ tests/mime-detection/pcb-gerber-FSLANoExt | 5 ++ tests/mime-detection/pcb-gerber-G75NoExt | 7 ++ tests/mime-detection/pcb-gerber-MONoExt | 5 ++ tests/mime-detection/pcb-gerber-TFNoExt | 15 ++++ tests/mime-detection/pcb-gerber.gbr | 5 ++ tests/mime-detection/pcb-gerber.gts | 8 ++ tests/mime-detection/pcb-gerberjob.gbrjob | 119 +++++++++++++++++++++++++++ 12 files changed, 240 insertions(+) create mode 100644 tests/mime-detection/pcb-drillFile.drl create mode 100644 tests/mime-detection/pcb-drillFileNoExt create mode 100644 tests/mime-detection/pcb-gerber-CommentNoExt create mode 100644 tests/mime-detection/pcb-gerber-FSLANoExt create mode 100644 tests/mime-detection/pcb-gerber-G75NoExt create mode 100644 tests/mime-detection/pcb-gerber-MONoExt create mode 100644 tests/mime-detection/pcb-gerber-TFNoExt create mode 100644 tests/mime-detection/pcb-gerber.gbr create mode 100644 tests/mime-detection/pcb-gerber.gts create mode 100644 tests/mime-detection/pcb-gerberjob.gbrjob diff --git a/data/freedesktop.org.xml.in b/data/freedesktop.org.xml.in index c3e8e6c..9e7979a 100644 --- a/data/freedesktop.org.xml.in +++ b/data/freedesktop.org.xml.in @@ -8212,4 +8212,39 @@ command to generate the output files. + + Gerber file + + + + + + + + + + + + + + + + + + + Gerber job file + + + + + + Excellon drill file + + + + + + + + diff --git a/tests/mime-detection/list b/tests/mime-detection/list index 499fbde..2148dcc 100644 --- a/tests/mime-detection/list +++ b/tests/mime-detection/list @@ -978,3 +978,19 @@ test.nimble text/x-nimscript ox # Typst document test.typ text/x-typst ox + +# PCB Fabrication data transfer formats +# Both GIMP brush and Gerber files share the glob for .gbr, so we can't use filename-based +# tests here because the files are identified as GIMP brushes using the glob. +pcb-gerber.gbr application/vnd.gerber x +pcb-gerber.gts application/vnd.gerber x +pcb-gerber-CommentNoExt application/vnd.gerber x +pcb-gerber-FSLANoExt application/vnd.gerber x +pcb-gerber-G75NoExt application/vnd.gerber x +pcb-gerber-MONoExt application/vnd.gerber x +pcb-gerber-TFNoExt application/vnd.gerber x + +pcb-gerberjob.gbrjob application/x-gerber-job ox + +pcb-drillFile.drl application/x-excellon +pcb-drillFileNoExt application/x-excellon x diff --git a/tests/mime-detection/pcb-drillFile.drl b/tests/mime-detection/pcb-drillFile.drl new file mode 100644 index 0000000..85110e7 --- /dev/null +++ b/tests/mime-detection/pcb-drillFile.drl @@ -0,0 +1,10 @@ +M48 +;DRILL file {Pcbnew (2013-june-11)-stable} date Sun 22 Dec 2013 07:48:59 PM CST +;FORMAT={-:-/ absolute / inch / decimal} +FMAT,2 +INCH,TZ +T1C0.025 +T2C0.032 +T3C0.032 +T4C0.120 +T5C0.126 diff --git a/tests/mime-detection/pcb-drillFileNoExt b/tests/mime-detection/pcb-drillFileNoExt new file mode 100644 index 0000000..85110e7 --- /dev/null +++ b/tests/mime-detection/pcb-drillFileNoExt @@ -0,0 +1,10 @@ +M48 +;DRILL file {Pcbnew (2013-june-11)-stable} date Sun 22 Dec 2013 07:48:59 PM CST +;FORMAT={-:-/ absolute / inch / decimal} +FMAT,2 +INCH,TZ +T1C0.025 +T2C0.032 +T3C0.032 +T4C0.120 +T5C0.126 diff --git a/tests/mime-detection/pcb-gerber-CommentNoExt b/tests/mime-detection/pcb-gerber-CommentNoExt new file mode 100644 index 0000000..3045ff1 --- /dev/null +++ b/tests/mime-detection/pcb-gerber-CommentNoExt @@ -0,0 +1,5 @@ +G04 (created by PCBNEW (2013-june-11)-stable) date Sun 22 Dec 2013 07:48:57 PM CST* +%MOIN*% +G04 Gerber Fmt 3.4, Leading zero omitted, Abs format* +%FSLAX34Y34*% +G01* diff --git a/tests/mime-detection/pcb-gerber-FSLANoExt b/tests/mime-detection/pcb-gerber-FSLANoExt new file mode 100644 index 0000000..be23765 --- /dev/null +++ b/tests/mime-detection/pcb-gerber-FSLANoExt @@ -0,0 +1,5 @@ +%FSLAX34Y34*% +G04 (created by PCBNEW (2013-june-11)-stable) date Sun 22 Dec 2013 07:48:57 PM CST* +%MOIN*% +G04 Gerber Fmt 3.4, Leading zero omitted, Abs format* +G01* diff --git a/tests/mime-detection/pcb-gerber-G75NoExt b/tests/mime-detection/pcb-gerber-G75NoExt new file mode 100644 index 0000000..3b819a6 --- /dev/null +++ b/tests/mime-detection/pcb-gerber-G75NoExt @@ -0,0 +1,7 @@ +G75* +G70* +%OFA0B0*% +%FSLAX24Y24*% +%IPPOS*% +%LPD*% +%AMOC8* diff --git a/tests/mime-detection/pcb-gerber-MONoExt b/tests/mime-detection/pcb-gerber-MONoExt new file mode 100644 index 0000000..5b36cb8 --- /dev/null +++ b/tests/mime-detection/pcb-gerber-MONoExt @@ -0,0 +1,5 @@ +%MOIN*% +%FSLAX34Y34*% +G04 (created by PCBNEW (2013-june-11)-stable) date Sun 22 Dec 2013 07:48:57 PM CST* +G04 Gerber Fmt 3.4, Leading zero omitted, Abs format* +G01* diff --git a/tests/mime-detection/pcb-gerber-TFNoExt b/tests/mime-detection/pcb-gerber-TFNoExt new file mode 100644 index 0000000..d7f1a93 --- /dev/null +++ b/tests/mime-detection/pcb-gerber-TFNoExt @@ -0,0 +1,15 @@ +%TF.GenerationSoftware,KiCad,Pcbnew,(5.99.0-9879-gcc9787e47a)*% +%TF.CreationDate,2021-03-20T01:50:30+00:00*% +%TF.ProjectId,pic_programmer,7069635f-7072-46f6-9772-616d6d65722e,rev?*% +%TF.SameCoordinates,Original*% +%TF.FileFunction,Copper,L2,Bot*% +%TF.FilePolarity,Positive*% +%FSLAX46Y46*% +G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* +G04 Created by KiCad (PCBNEW (5.99.0-9879-gcc9787e47a)) date 2021-03-20 01:50:30* +%MOMM*% +%LPD*% +G01* +G04 APERTURE LIST* +G04 Aperture macros list* +%AMRoundRect* diff --git a/tests/mime-detection/pcb-gerber.gbr b/tests/mime-detection/pcb-gerber.gbr new file mode 100644 index 0000000..3045ff1 --- /dev/null +++ b/tests/mime-detection/pcb-gerber.gbr @@ -0,0 +1,5 @@ +G04 (created by PCBNEW (2013-june-11)-stable) date Sun 22 Dec 2013 07:48:57 PM CST* +%MOIN*% +G04 Gerber Fmt 3.4, Leading zero omitted, Abs format* +%FSLAX34Y34*% +G01* diff --git a/tests/mime-detection/pcb-gerber.gts b/tests/mime-detection/pcb-gerber.gts new file mode 100644 index 0000000..5c9fd0b --- /dev/null +++ b/tests/mime-detection/pcb-gerber.gts @@ -0,0 +1,8 @@ +G04 (created by PCBNEW (2013-june-11)-stable) date Sun 22 Dec 2013 07:48:57 PM CST* +%MOIN*% +G04 Gerber Fmt 3.4, Leading zero omitted, Abs format* +%FSLAX34Y34*% +G01* +G70* +G90* +G04 APERTURE LIST* diff --git a/tests/mime-detection/pcb-gerberjob.gbrjob b/tests/mime-detection/pcb-gerberjob.gbrjob new file mode 100644 index 0000000..3eac85a --- /dev/null +++ b/tests/mime-detection/pcb-gerberjob.gbrjob @@ -0,0 +1,119 @@ +{ + "Header": { + "GenerationSoftware": { + "Vendor": "KiCad", + "Application": "Pcbnew", + "Version": "(5.99.0-10960-g5f1e9bc8a7-dirty)" + }, + "CreationDate": "2021-07-08T02:55:20+01:00" + }, + "GeneralSpecs": { + "ProjectId": { + "Name": "", + "GUID": "58585858-5858-4585-9858-585858585858", + "Revision": "rev?" + }, + "Size": { + "X": 0.0, + "Y": 0.0 + }, + "LayerNumber": 2, + "BoardThickness": 1.6, + "Finish": "None" + }, + "DesignRules": [ + { + "Layers": "Outer", + "PadToPad": 0.2, + "PadToTrack": 0.2, + "TrackToTrack": 0.2 + } + ], + "FilesAttributes": [ + { + "Path": "-F_Cu.gbr", + "FileFunction": "Copper,L1,Top", + "FilePolarity": "Positive" + }, + { + "Path": "-B_Cu.gbr", + "FileFunction": "Copper,L2,Bot", + "FilePolarity": "Positive" + }, + { + "Path": "-F_Paste.gbr", + "FileFunction": "SolderPaste,Top", + "FilePolarity": "Positive" + }, + { + "Path": "-B_Paste.gbr", + "FileFunction": "SolderPaste,Bot", + "FilePolarity": "Positive" + }, + { + "Path": "-F_Silkscreen.gbr", + "FileFunction": "Legend,Top", + "FilePolarity": "Positive" + }, + { + "Path": "-B_Silkscreen.gbr", + "FileFunction": "Legend,Bot", + "FilePolarity": "Positive" + }, + { + "Path": "-F_Mask.gbr", + "FileFunction": "SolderMask,Top", + "FilePolarity": "Negative" + }, + { + "Path": "-B_Mask.gbr", + "FileFunction": "SolderMask,Bot", + "FilePolarity": "Negative" + }, + { + "Path": "-Edge_Cuts.gbr", + "FileFunction": "Profile", + "FilePolarity": "Positive" + } + ], + "MaterialStackup": [ + { + "Type": "Legend", + "Name": "Top Silk Screen" + }, + { + "Type": "SolderPaste", + "Name": "Top Solder Paste" + }, + { + "Type": "SolderMask", + "Name": "Top Solder Mask" + }, + { + "Type": "Copper", + "Name": "F.Cu" + }, + { + "Type": "Dielectric", + "Material": "FR4", + "Name": "F.Cu/B.Cu", + "Notes": "Type: dielectric layer 1 (from F.Cu to B.Cu)" + }, + { + "Type": "Copper", + "Name": "B.Cu" + }, + { + "Type": "SolderMask", + "Name": "Bottom Solder Mask" + }, + { + "Type": "SolderPaste", + "Name": "Bottom Solder Paste" + }, + { + "Type": "Legend", + "Name": "Bottom Silk Screen" + } + ] +} -- cgit v1.2.3