Commit Graph

122 Commits

Author SHA1 Message Date
jean-pierre charras 72ce955066 Gerbview: fix some issues related to comments and primitives in macros:
- comments on more than one line were not fully skipped, creating read errors
- in macros, some primitives (not all) were incorrectly rotated: they must be
rotated around the aperture macro origin, not the primitive origin.
- a new test file with rotated primitives in macros is added.
Fixes #16049
https://gitlab.com/kicad/code/kicad/-/issues/16049
2023-11-08 10:45:13 +01:00
Marek Roszko 11de95778b Unwrap the FROM_UTF8 macro in favor of direct function
The extern just gets annoying to try to export the func later. We also yeet TO_UTF8 to string_utils.h for parity.
2023-09-09 00:10:57 -04:00
Marek Roszko ea077bc34d Banish ignore.h to core 2023-04-18 22:44:04 -04:00
qu1ck 0c049eccc7 Fix a bunch of compiler warnings 2023-04-11 17:01:30 +00:00
jean-pierre charras 54b4f0e673 Gerbview: Aperture Macro: handle overwriting of variables
Gerbview did not handle redefinition of variable like $3 = $3 / 2
This redefinition is sometimes found in Gerber files.
This is a long standing issue now fixed.
Fixes #7222
https://gitlab.com/kicad/code/kicad/issues/7222
2023-02-11 18:22:29 +01:00
jean-pierre charras 79d246b8fe Gerbview: more code cleanup. remove duplicate code. 2023-02-10 16:10:29 +01:00
jean-pierre charras fa1591d021 Gerbview: code refactor: change name of a D_CODE member:
D_CODE::m_Shape -> m_ApertType (it is not a shape, it is a aperture type)
Fix also an outdated/incorrect comment
No actual code change.
2023-02-10 11:20:16 +01:00
jean-pierre charras be420a0cf5 Gerbview, Aperture macros handling: use accessors for some internal data
and add comments. No actual code change.
2023-01-28 18:00:12 +01:00
jean-pierre charras 00d77f624a Gerbview: fix coding style (better names for variable members is some classes).
(no actual change in code)
2023-01-14 17:08:44 +01:00
Daniil Nikolaev 605d177810 Gerbview: Check RS274X AD command's template parameters
If user opens a specially crafted gerber file, this check prevents Gerbview from infinitely consuming memory.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13235
2022-12-22 21:23:19 +00:00
Marek Roszko e6ed275c25 Repoint IU_PER_MILS 2022-09-16 21:09:26 -04:00
Jeff Young 4e3109a633 Wide string decls for gerbview. 2022-02-05 22:34:45 +00:00
Jeff Young 4eac8d7c66 Remove unit-less angles from geometry lib APIs. 2022-01-20 21:10:04 +00:00
Marek Roszko ac715d2e51 Scoop up some more wxPoint instances 2022-01-03 20:00:53 -05:00
Seth Hillbrand 548e5f49bd Clean up unused variable usage
Unused variables in function calls can be commented out.  Unused
return variables get a new routine `ignore_unused()` that silences the
warnings with zero overhead.
2021-10-05 10:00:30 -07:00
luz paz f968fc8719 Fix source comment / documentation typos 2021-06-09 19:32:58 +00:00
Ian McInerney ecd9bf696e Be consistent about using nullptr instead of 0
0 can be too easily overloaded into an int, so ensure we use nullptr
when we mean pointers.
2021-04-22 22:20:34 +01:00
jean-pierre charras c1197903e4 Gerbview: fix regression: missing DCode highlight commands.
DCode selected by context menu or from toolbar is now highlighted.
2021-03-13 18:45:33 +01:00
Jon Evans ff4c01c4a4 Don't say a gerber is an X2 unless the whole attribute is loaded
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7303
2021-01-27 17:17:44 -05:00
Marek Roszko e928b2d8fd Split EDA_UNITS out from common. 2020-10-25 00:02:52 -04:00
Marek Roszko a1c75748a0 Remove GetChars(), a wxWidgets 2.9 compatibility hack 2020-10-15 20:53:25 -04:00
jean-pierre charras 04aa5519d0 Gerbview: code cleanup. Remove many include, now useless. 2020-09-30 12:56:55 +02:00
Ian McInerney 70a7d1bc7c Cleanup variable usage and assignment in gerber reader 2020-09-21 12:19:49 +01:00
Ian McInerney 7dfbb3cb18 Cleanup formatting 2020-09-21 12:15:03 +01:00
Ian McInerney 99dcadf7e6 Introduce new KI_FALLTHROUGH macro
Annotate purposeful fallthroughs in switch statements with the
KI_FALLTHROUGH macro.
2020-04-25 00:44:09 +01:00
jean-pierre charras 9e656fe5eb Gerbview: fix incorrect rendering of oval vertical standard aperture with hole.
Fix also incorrect display of dcode size in toolbal: was Y size  X size.
Now is X size Y size, as expected.
2020-04-10 16:02:15 +02:00
jean-pierre charras 7206b567ac Gerbview: Gerber attributes display: fix incorrect attributes deletion.
The Gerber attribute deletion command (%TD,xxx) always cleared all attributes,
instead of clearing xxx attribute.
Therefore some attributes were not always displayed.
2020-02-23 09:42:02 +01:00
Ian McInerney 13b6028e1b Refactor all math into a new kimath library
* Split up the thirdparty code into the thirdparty folder (#3637)
* Create a new kimath static library containing all the math functions

This is part of cleaning the build system for #1906.
2020-01-07 17:12:59 +00:00
jean-pierre charras 71cd8c57bf ADDED: Pcbnew, add "pin function" (pin name in eeschema) to pads.
The pin name defined in Eeschema is now available as pad info.
Useful for the board designer (the pin function is displayed in the message panel).
Needed for the Gerber P&P files.
2019-11-23 09:12:43 +01:00
jean-pierre charras 32043cfa26 Gerbview: add parsing of optional Aperture Macro parameter.
AMP_CIRCLE primitive has 4 or 5 parameters (last is optional)
Reading the optional parameter was missing.

Fixes: lp:1852924
https://bugs.launchpad.net/kicad/+bug/1852924
2019-11-18 09:06:43 +01:00
jean-pierre charras 4a0bd46ed6 More work on Gerber pick and place files
In P&P files, user strings are now quoted, and use UTF8 encoding
2019-11-01 08:34:24 +01:00
Jeff Young a25368cc6b Improve spelling.
The groundwork here is thanks to kunda1.

Fixes: lp:1831510
* https://bugs.launchpad.net/kicad/+bug/1831510
2019-08-20 19:14:05 +01:00
jean-pierre charras 4136aca221 Gerbview: Excellon drill files reader: add a better support of routing mode.
Previously, the M and G00, G01, G02 and G03 commands were read, but nothing was actually done.
The current support is a bit rough, but it allows reading some drill files with routing commands.
2018-09-24 13:12:47 +02:00
jean-pierre charras ef38a198d1 GerbView: incorrect handling of polygon primitive: broken parameters rotation and drill size.
Fixes: lp:1778459
https://bugs.launchpad.net/kicad/+bug/1778459
2018-06-25 11:00:53 +02:00
jean-pierre charras d8687e4eaf Gerbview: minor code cleanup 2018-05-14 09:05:11 +02:00
jean-pierre charras 8da242c593 Gerbview: accept any structured comment as X2 attribute.
A structured comment is a comment line starting by "G04 #@! " and in fact containing
a X2 attribute. It is used to create Gerber files contianing X2 metadata, but compatible
with X1 file format
2018-05-14 09:05:09 +02:00
jean-pierre charras fa41026f36 Fix issue in aperture macro with some strange gerber files.
Fixes: lp:1755623
https://bugs.launchpad.net/kicad/+bug/1755623
2018-03-14 14:55:51 +01:00
jean-pierre charras 66d5d10b49 Gerbview: bigger line buffer to read some gerber files that have only one (very long) line.
small code refactor.
2018-03-14 10:42:18 +01:00
jean-pierre charras a0ac1a48c2 Gerbview: fix code after renaming files 2018-01-29 13:26:58 +01:00
jean-pierre charras cffe1b51e2 Gerbview: avoid a crash with malformed Gerber files.
Fix also incorrect handling of %LN (Load Name) deprecated command
2017-10-24 18:09:33 +02:00
Seth Hillbrand 5b2248fad8 gerbview: Corrects handling of %FSD statement 2017-09-29 07:40:58 +02:00
Jon Evans 915e51e1f0 GerbView GAL support part 1: changes to existing files
- New GAL draw layers for GerbView
- Improved bounding boxes for Gerber shapes
- Switched to use of SHAPE_POLY_SET for polygons
- Add GAL methods to support selection and rendering
- Add GUI support of editing GAL options
- Rename get/setActiveLayer to Get/SetActiveLayer to match convention
2017-09-25 13:35:01 +02:00
jean-pierre charras b0bfbd4f41 Gerbview: remove analysis of fully outdated (and never used) gerber commands 2017-08-11 11:21:33 +02:00
jean-pierre charras 996bcdf458 Fix a few doxygen warnings 2017-06-16 09:18:31 +02:00
jean-pierre charras 36255d8523 Gerbview: Fix a few issues in aperture macro definitions. 2017-04-08 15:35:11 +02:00
jean-pierre charras ba517db96c Gerbview: fix a subtle issue when reading parameter values in Gerber files.
In Gerber files the char 'X' is used as separator.
But when reading parameter values, the sequence "0xnnn" is a number in hexadecimal format, and the 'X' char is not seen as separator by usual strtod or strtol C functions.
This is now fixed.
2017-04-08 12:53:40 +02:00
Simon Richter bfb6e0bbb2 Convert remaining occurences of stri[n]cmp to str[n]casecmp.
This also reverses the substitution logic if strcasecmp is missing (config.h.cmake)
2016-08-16 10:27:09 +02:00
jean-pierre charras f1226afc89 Gerbview: support of %TA.AperFunction (aperture attribute) and better support of %TO (currently work in progress) object attribute. 2016-08-16 12:56:20 +02:00
Chris Pavlina e5a5f9552b Fix RS274X Unicode decoding 2016-08-08 13:21:27 -04:00
jean-pierre charras 984146c37d Gerbview: better support of advanced X2 attributes. 2016-08-01 19:47:35 +02:00