Commit Graph

144 Commits

Author SHA1 Message Date
Julian Fellinger dcf058d91e added vrml export via python api 2020-08-28 16:41:09 +00:00
Jeff Young 9e12ea9bb6 Cleanup some dead code and make better use of iterators.
Also applies coding style around auto and lambdas.
2020-08-28 11:05:58 +01:00
Mark Roszko 1082402b33 Convert UNDO_REDO_T to an enum class 2020-08-26 18:04:32 +00:00
Ian McInerney e8b11c911e Migrate Pcbnew/footprint viewer/footprint editor to the new UI update system 2020-08-16 19:10:26 +00:00
Jon Evans bd14f8a82a ADDED: New appearance control widget for PcbNew
Featuring:
- Layer view presets
- Per-type opacity for tracks, vias, pads, zones
- Net and netclass color and visibility controls

CHANGED: Simplified object visibilty controls

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1951
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1981
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2003
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2173
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2254
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4325
2020-08-15 15:24:28 -04:00
Qbort b41892e4da Rename class GROUP in pcbnew to PCB_GROUP
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5156
2020-08-12 15:36:08 +01:00
Ian McInerney 47f7c616f8 Fix Python environment variable handling
The variables in the common settings struct are only updated on
save, so Python must use the ones from Pgm to get its values.
This does lead to the observation that Python's changes to the
variables do affect KiCad (they can break resolvers). So apparently
it can mess with us but we can't mess with it easily.

Also, improve the environment variable tracing infrastructure to capture
more changes.
2020-08-12 00:14:19 +01:00
Joshua Redstone ee428876ec ADDED: Group/Ungroup function
This implements the group/ungroup functions to mark a set of EDA_ITEMs as a unit, allowing them to be moved and rotated as a unit
2020-08-11 19:37:07 +00:00
Ian McInerney 0a0ed9e064 Escape all env var strings sent to the Python interpreter
Fixes https://gitlab.com/kicad/code/kicad/issues/5130
2020-08-11 00:51:02 +01:00
qu1ck 1bb6d4e22c Fix pads python api compatibility
* Add GetCustomShapeAsPolygon() to swig wrapper
* Make shared_ptr<SHAPE_POLY_SET> usable for GetEffectivePolygon()

Fixes #4999
2020-08-10 03:22:24 +00:00
Ian McInerney c458b50fd9 Ensure the environment variables are synchronized between KiCad and Python
Before this, the environment variables inside Python wouldn't reflect
the updates to them made after the interpreter was started in Pcbnew.
This will call into Python and set the variables when they are changed,
since Python can't synchronize itself when running in an embedded
interpreter.

Fixes https://gitlab.com/kicad/code/kicad/issues/5071
2020-08-09 19:56:12 +01:00
jean-pierre charras 0c774aa163 Pcbnew: fix a python interface issue ( a not defined constant in some modules).
Was due to incorrect order of definitions in board.i interface.
2020-07-30 10:42:23 +02:00
Jeff Young 7340c97ef9 Undo for schematic-wide operations.
Editing value/footprint fields of multi-unit components.
Find/Change.
Annotation.
Back annotation.

Fixes https://gitlab.com/kicad/code/kicad/issues/2122

Fixes https://gitlab.com/kicad/code/kicad/issues/4869

Fixes https://gitlab.com/kicad/code/kicad/issues/3933

Fixes https://gitlab.com/kicad/code/kicad/issues/4871

Fixes https://gitlab.com/kicad/code/kicad/issues/3899
2020-07-13 12:32:17 +01:00
Jon Evans 4dbbe1cf68 Project settings fixes from review
- Fix file extension for new project
- Fixes for exceptions on MSW
- Fix some ASAN issues
- Allow SETTINGS_MANAGER to run headless
- Don't flag schematic as modified after schematic setup is closed
- Don't automatically unload projects when LoadProject is called
- Don't unload project if it's the same as the current one
- Make sure to properly init/de-init template field names
2020-07-02 22:08:54 -04:00
Jon Evans c0aa6965de Migrate PcbNew project settings to new framework
Various architecture upgrades to support this.
Creating a BOARD now requires a valid PROJECT, which caused
some (mostly transparent) changes to the Python API internals.

ADDED: Project local settings file
CHANGED: Board design settings are no longer stored in PCB file
CHANGED: Net classes are no longer stored in PCB file
CHANGED: Importing board settings now reads boards, not just projects

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2578
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4070
2020-07-02 22:08:54 -04:00
Ian McInerney 52856a8ce4 Move scaled toolbar separator into ACTION_TOOLBAR
* Ensure all separators are scaled separators
* Clean up toolbar creation functions
2020-06-26 21:29:03 +00:00
Jeff Young e376750f62 Flatten CS_PAD_PRIMITIVE out in favour of reusing DRAWSEGMENT.
(In prep for the eventual replacement of DRAWSEGMENT internals with
SHAPE.)
2020-06-24 12:22:42 +01:00
Paul Ewing 40250c427a Expose the footprint library table to Python 2020-06-05 22:21:41 +00:00
Hufo 992a553d43 pcbnew: Refactor D_PAD::AddPrimitives() and allow use from python
Rename all the D_PAD::AddPrimitive methods to clean up their API,
and expose the vector<PAD_CS_PRIMITIVE> type in the python API.
2020-02-27 23:54:19 +00:00
Seth Hillbrand 8c19b4b6ae pcbnew: Adding arcs to PNS
This is allows ARCs in tracks to be synchronized with
the PNS router.  Note this does not yet include the UI components
to route curved traces
2020-02-21 16:11:41 -08:00
Jon Evans 1a216f3703 Change action plugin settings storage to preserve hidden buttons 2020-02-20 11:01:49 -05:00
Jon Evans e59a3d981e Implement a new settings framework across all of KiCad
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme

Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
2020-02-19 23:44:56 -05:00
Jon Evans ce4542cced ADDED: Allow exporting IPC-356D netlists from Python 2020-02-04 13:31:56 +00:00
Jeff Young 17710c15d3 Fix leak of empty PICKED_ITEMS_LIST. 2020-01-11 21:29:25 +00:00
Ian McInerney a8d9fcb4e0 Fix event handler type casting
The old methods were very clunky and not recommended (and didn't
properly cast the function types). This changes to useing the
recommended way of declaring events and casting the event handlers.
2020-01-09 18:08:49 +00:00
Ian McInerney 5d46e721e5 pcbnew: Cleanup includes of pcbnew_id.h
* Remove unused IDs from the enum
* Remove the include statements from files that no longer need it
2020-01-03 15:39:05 +00:00
Mark Roszko 19ceb11ae7 Change more enums over to scoped enums 2019-12-28 00:55:11 +00:00
Ian McInerney 7fb56cf9a3 Fix compile error due to enum changes
Merge request !23 changed to strongly typed enums,
so we now need to explicitly cast the output in the
Python getters.
2019-12-20 14:47:41 +00:00
Seth Hillbrand 4d2e953f42 Cleanup: Replace C-only deprecated headers
This replaces headers deprecated by C++14 with their equivalent
replacement
2019-12-05 11:03:15 -08:00
jean-pierre charras 840c77fa9c pcbnew/swig/pcbnew_action_plugins.cpp: fix crash due to broken detection of deleted items after running a script.
the old way was not compatible with the current management if board item lists.
The crash was probably due to double deletions.
Note also the management of undo command in pcbnew_action_plugins needs serious optimization.

Fixes: lp:1844880
https://bugs.launchpad.net/kicad/+bug/1844880
2019-09-23 14:07:45 +02:00
Jeff Young e269b5d1b9 Workaround an issue where a throw terminates (even when there's a catch for it).
You can trigger it before this fix by running Cvpcb when a .kicad_mod file is
incorrectly set as "Legacy" in your footprint table.
2019-08-31 15:18:27 +01:00
Dave Vandenbout 44734dc059 python: Return copy of netclasses not reference
Fix Board.GetAllNetClasses() so it no longer creates a duplicate of the Default netclass in the design rules net classes list.

Fixes: lp:1803623
* https://bugs.launchpad.net/kicad/+bug/1803623
2019-07-06 07:40:33 -07:00
Jeff Young 8f84c3ec4f Grid rid of GetCanvas/GetGalCanvas distinction now that there's only gal. 2019-06-13 19:58:37 +01:00
Jeff Young 5e49517781 Move hotkeys to ACTION architecture. 2019-06-10 23:46:00 +01:00
qu1ck 3cb90063a1 Pcbnew scripting fixes
* Remove infinite recursion calls in footprint.i
* Extend DRAWINGS deque iterator to auto cast contained BOARD_ITEMS,
similar to what dlist implementation did.
2019-06-04 19:29:31 -07:00
Jeff Young 568c8c336b Move DRC control to a tool; move assorted commands to ACTIONS. 2019-06-03 21:08:30 +01:00
Seth Hillbrand 1f30d0c803 pcbnew: remove the last dlist components from pcbnew 2019-06-02 20:06:11 -07:00
Seth Hillbrand 6a45446496 pcbnew: Remove the last dlist from modules/pcbnew 2019-06-01 20:55:32 -07:00
Seth Hillbrand 888c01d11b pcbnew: Move tracks to std::deque 2019-06-01 09:53:23 -07:00
Seth Hillbrand d1877d7c1b Moving modules from DLIST to std::deque 2019-06-01 09:53:23 -07:00
Seth Hillbrand 961b22d603 pcbnew: Changing drawings from dlist to std::deque 2019-06-01 09:51:57 -07:00
Jeff Young 7553cc2651 Clean up some dangling legacy odds and ends. 2019-06-01 01:17:46 +01:00
Jeff Young c2662b0e11 Retire EDA_DRAW_PANEL and legacy_wx/EDA_DRAW_FRAME. 2019-05-31 21:55:30 +01:00
Jeff Young d6e9bdf07b Convert remaining legacy drawing code to print code. 2019-05-31 21:54:22 +01:00
Jeff Young d2daab808c Remove some legacy cursor handling stuff. 2019-05-31 21:54:22 +01:00
Jeff Young a27e4246e0 Move some more menu commands to ACTIONs. 2019-05-29 00:26:29 +01:00
Jeff Young 9d9745b555 Remove more legacy editing code. 2019-05-27 18:47:20 +01:00
Jeff Young 323bb0f8e1 Moving PageLayout editor to GAL canvas and modern toolset. 2019-05-24 19:49:09 +01:00
Wayne Stambaugh 816f6db310 Pcbnew: Python scripting support clean up.
Always check the return value of PyRun_SimpleString() for errors when a
Python script is run and show an error message rather than fail silently.

Enable Python interpreter I/O redirection in debug builds so that script
string errors will be shown when PyRun_SimpleString() is called.

Do not call PyErr_Print() after a PyRun_SimpleString() call failure.  It
doesn't do anything useful.

Do not call Py_Finalize() after a PyRun_SimpleString() call failure.  It
seems to cause Pcbnew to crash.
2019-05-24 07:32:38 -04:00
Andrei Pozolotin 3e4913adce Pcbnew export/import scripting functions.
Discussion can be found at
https://forum.kicad.info/t/pcbnew-export-import-scripting-functions/16343

Fixes lp:1824668

https://bugs.launchpad.net/kicad/+bug/1824668
2019-05-04 09:55:25 -04:00