Commit Graph

397 Commits

Author SHA1 Message Date
Marek Roszko 16e3e59495 Split out arrayDim and MIRROR templates from macros.h
These were not macros
2020-11-17 20:21:04 -05:00
Jeff Young 024812e5dd Resolve legacy netclass definitions read from PCB file.
Fixes https://gitlab.com/kicad/code/kicad/issues/6415
2020-11-18 00:17:07 +00:00
Jeff Young ec020dd19f First-class support for filled shapes. 2020-11-14 01:40:32 +00:00
Jeff Young bdbb68f813 MODULE -> FOOTPRINT. 2020-11-13 16:04:03 +00:00
Jeff Young 522d64968e Yet more module -> footprint. 2020-11-13 15:16:24 +00:00
Jeff Young 52a46341db More module -> footprint. 2020-11-13 15:16:24 +00:00
Jeff Young f5443de7f9 D_PAD -> PAD. 2020-11-13 15:16:24 +00:00
Jeff Young 84dd5108ba Remove some "class_" prefixes from files. 2020-11-13 15:16:23 +00:00
Jan Mrázek fc8bf6f0fe
Allow a user to remap layers in Eagle import
ADDED Allow for user mapping of layers in Eagle import
ADDED Support required and optional layers in the layer mapping dialog
ADDED Add base class for plugins supporting remappable layers
2020-11-12 11:37:04 +01:00
Jeff Young 6417015b8a Harvest -> Export 2020-11-09 17:21:47 +00:00
Marek Roszko a785f70ea1 msgpanel is a widget, shove it to the right folder. 2020-10-25 20:01:12 -04:00
Jon Evans 2153a7655b Try harder not to give a read-only path to save dialog
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5937
2020-10-21 20:55:43 -04:00
Jeff Young adfc9f1288 Move File > Archive Footprints to Tools > Harvest Footprints.
CHANGED.

Also corrects references so they fit the generic pattern.

Fixes https://gitlab.com/kicad/code/kicad/issues/4518
2020-10-21 12:41:37 +01:00
Jon Evans 6a3384e764 Properly set up new boards when creating from the command line
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5913
2020-10-13 19:16:48 -04:00
Jeff Young 04c4012ee6 Make track/via sizes UI more predictable and compatible with DRC.
Two main changes: netclass values need to go through the DRC engine
so they can interact with other rules.  They're also now dependent
on the layer being routed as well as the start object.

Also make the controls adjust to each other better.  For instance,
copy-track-width needs to turn off when you select a particular
track width, and a particular track width needs to zero out when
you choose copy-track-width.

Fixes https://gitlab.com/kicad/code/kicad/issues/5951
2020-10-10 19:32:30 +01:00
Jeff Young 37906511f5 Class renaming.
DRAWSEGMENT  -> PCB_SHAPE
EDGE_MODULE  -> FP_SHAPE
TEXTE_PCB    -> PCB_TEXT
TEXTE_MODULE -> FP_TEXT
2020-10-05 11:55:33 +01:00
Jeff Young 7a4900b8dc PCB_LINE_T -> PCB_SHAPE_T and PCB_MODULE_EDGE_T -> PCB_FP_SHAPE_T
Also updated footprint text and zone types for consistencey.
2020-10-04 16:49:04 +01:00
Roberto Fernandez Bautista 8c783687a9 pcbnew: Add "All supported formats" drop-down to the "Import Non Kicad Board" file dialog 2020-10-03 02:19:13 +00:00
Roberto Fernandez Bautista 72d9a36fd6 ADDED: Dialog to handle import of unmatched layers from CADSTAR 2020-10-03 01:21:57 +00:00
jean-pierre charras 13304d0870 more cleanup about removing useless include 2020-10-02 13:40:00 +02:00
Roberto Fernandez Bautista 72b904a978 ADDED: CADSTAR Archive project importer 2020-09-27 23:50:20 +00:00
Jon Evans 5d78e9512f Don't check for a control that doesn't exist
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5759
2020-09-22 18:00:12 -04:00
Jon Evans e345e7d17a Allow creating an empty project when saving a board standalone 2020-09-21 23:55:02 -04:00
Roberto Fernandez Bautista 7ca4f0b375 CADSTAR PCB Archive Importer: Formatting fixes 2020-09-08 21:21:21 +00:00
Roberto Fernandez Bautista 3b3af5327f CADSTAR PCB Archive Importer: Move code into common/plugins and pcbnew/plugins folders 2020-09-08 21:21:20 +00:00
Roberto Fernandez Bautista 86bf592bac ADDED: CADSTAR PCB Archive Importer
Initial commit
- Imports directly mappable layer stackup (only physical board fabrication layers for now)
2020-09-08 21:21:20 +00:00
Jon Evans 9f7bca38b3 A better way of handling standalone project files 2020-08-30 16:04:39 -04:00
Jon Evans dc7e1783b3 Make sure a project is loaded at all times
For now, much of KiCad depends on Prj() working, so when we
are asked to unload a project, immediately load the null project
so that nothing breaks.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5374
2020-08-26 18:37:34 -04:00
Jon Evans 24435fcc62 Don't create new project files when opening boards/schematics
Display warning infobar in the board/schematic setup when no project
is loaded, since most of the settings in those dialogs are saved in
the project and not in the board/schematic file.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4868
2020-08-24 22:17:21 -04:00
Jon Evans 67a5ed15c7 Make sure appearance panel builds after project has been loaded
OnBoardChanged must run after LoadProjectSettings.
Move the local overrides to PCB_EDIT_FRAME::onBoardLoaded
so that they are run after the panel is initialized.
2020-08-24 19:39:18 -04:00
Jeff Young d41f196d7f Appearance panel must be initialized from board before setting active layer. 2020-08-24 00:49:08 +01:00
Jon Evans 6720473db9 Move net visibility/color controls to a wxGrid
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5235
Might improve https://gitlab.com/kicad/code/kicad/-/issues/5210
2020-08-23 13:15:07 -04:00
Jon Evans 0fa755ebb8 Don't refresh appearance panel until after project is loaded 2020-08-22 15:40:43 -04:00
Jeff Young 6450ee2f2c Prevent crash if board doesn't have any layers in the layer preset. 2020-08-20 00:51:16 +01:00
Jeff Young 27b047ab3f Cache project text vars as properties in the PCB board file.
Fixes https://gitlab.com/kicad/code/kicad/issues/5255

Fixes https://gitlab.com/kicad/code/kicad/issues/5005
2020-08-19 19:32:20 +01:00
Wayne Stambaugh ede39780e2 Remove all debugging output that cannot be disabled.
The use of printf, wxLogDebug, and std::err/std::out causes excessive
debugging output which makes finding specific debugging messages more
difficult than it needs to be.

There is still some debugging output in test code that really needs to
be moved into a unit test.

Add debugging output section to the coding policy regarding debugging
output.
2020-08-18 10:17:36 -04: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
Marek Roszko 9278660b10 Add support for the windows application restart api 2020-07-28 14:32:39 -04:00
Jon Evans a2041073ee Skip project backup in standalone mode
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4867
2020-07-12 11:42:05 -04:00
Jon Evans b1b9cef5fb Full-project automatic backup system
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4763
2020-07-09 13:55:19 +00:00
Jon Evans afd432e687 Infrastructure for net hiding
LoadProjectSettings changed to take place after the board
has been loaded so that board-specific project settings can
be applied (such as net visibility and color overrides)
2020-07-08 21:59:34 -04:00
Jon Evans b084305b12 Clean up some pcbnew file handling bugs 2020-07-06 21:53:28 -04:00
Jeff Young 2819570d1e Push panel_setup_netclasses down into common. 2020-07-06 20:00:50 +01:00
Jon Evans 3ebd5b317b Don't try to switch projects during autosave
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4800
2020-07-05 11:02:48 -04: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 fe5959b625 Remove the schematic and board backup file system
Per discussion on the developers list, this old system
no longer provides much value and is seen as annoying
by many users.  The new save logic should prevent any
cases of file corruption on save, which was a major
reason for the backup file system existing.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2012
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
Jon Evans a4fadfcdf2 Begin moving project file load to new system 2020-07-02 22:08:54 -04:00
Jon Evans a7708fa6dc Add PROJECT_FILE and basic load/unload methods 2020-07-02 22:08:54 -04:00
Jon Evans 09cb75b8a1 Use a temporary file when saving boards/schematics to make the operation more atomic
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4517
2020-06-19 23:31:26 +00:00
Seth Hillbrand eb89d1c68b pcbnew: Minor update to ratsnest calc
BuildConnectivity updates the ratsnest after it completes.  By compiling
the ratsnest before connectivity, we update it twice with the dirty flag
being reset after connectivity updates.
2020-06-17 19:43:11 -07:00
Seth Hillbrand 8c57821e9b pcbnew: Move ratsnest items to separate folder 2020-06-16 11:15:14 -07:00
Jeff Young 160981ee71 Better error reporting for DRC rule parsing. 2020-05-25 22:51:47 +01:00
jean-pierre charras 91b9e928dc minor code cleanup. 2020-05-25 12:06:27 +02:00
Jeff Young 0aaccfbb28 Save hole-to-hole-min to file. 2020-05-19 20:48:47 +01:00
Jeff Young cec857c0f4 Complete hookup of zone filler to new clearance engine. 2020-05-18 19:20:46 +01:00
Ian McInerney 613c020920 Move the file history into the frames 2020-05-17 00:12:49 +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
Jeff Young fd6dffe170 Only save changed severities etc. if the modify bit is set.
(Also means we need to set said bit when changing them.)

Fixes https://gitlab.com/kicad/code/kicad/issues/4164
2020-04-24 23:09:10 +01:00
Thomas Pointhuber b707c84b62 Use Record handling for parsing
Now, we know how big a record is, and should be able to parse all boards without missing bytes?
2020-04-03 23:22:24 +00:00
Jeff Young 85c2e0d23a Add user-defined severities, exclusions and colors to DRC markers.
Exclusions are currently persisted in the project file.

Fixes https://gitlab.com/kicad/code/kicad/issues/1989
2020-03-04 00:39:28 +00:00
Ian McInerney 879a8f4efb Rework the file history menus to not need references to the file history
Keeping a pointer to the actual file history inside a special
file history menu led to many cases of use after free crashes,
so instead rework the actual file history to add the menu
items.

Fixes https://gitlab.com/kicad/code/kicad/issues/3741
2020-02-25 16:18:10 +00:00
Jon Evans 28222d3bd0 Use existing pcb filename for Save As where possible 2020-01-06 14:26:03 +00:00
Ian McInerney b9d8849b28 Unify unsaved changes detection logic in all frames
Create an IsContentModified() function in each frame
that provides if the content has been modified, and
use that instead of always copying the checks.
2019-12-19 15:34:01 +00:00
Ian McInerney f7ded3040c pcbnew: Modify new file to have a better prompt when closing old board
CHANGED: The new file prompt now asks to save the board if needed

Fixes: lp:1853338
* https://bugs.launchpad.net/kicad/+bug/1853338
2019-11-24 14:51:29 +00:00
jean-pierre charras 6f2cbe5982 Pcbnew: housekeeping: move netlist code to netlist_reader sub directory. 2019-11-17 13:58:38 +01:00
Jeff Young 6179dfde37 Default keep upright to false in design settings.
The board file only writes out a token if it's true, so the value
must default to false.

Fixes: lp:1845883
* https://bugs.launchpad.net/kicad/+bug/1845883
2019-10-02 10:56:13 +01:00
jean-pierre charras b25ffc0aa8 Pcbnew, layer manager: fix flicker when loading a file, and incorrect size on start when no file is loaded
Fixes: lp:1840591
https://bugs.launchpad.net/kicad/+bug/1840591
2019-08-19 10:42:22 +02:00
Jeff Young 562ab0bdea Move layer defaults and diff-pair dimensions to board file. 2019-07-06 00:04:54 +01: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 0ea75cb4e7 Another attempt to fix build failure. 2019-06-04 16:26:45 +01:00
Jeff Young ea3c29e3ec Now that we allow multiple 3DViewers, we need to make sure we have the right one.
Note that FindWindow() searches children, whereas FindWindowByName() searches
all windows.
2019-06-04 13:56:54 +01:00
Jeff Young 3912c7407f Move global commands to ACTIONs.
Also fixes a crash bug opening Edit Tracks and Vias dialog.
2019-06-03 21:08:30 +01: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 03bab2f4a9 Remove some more legacy drawing stuff. 2019-05-31 21:54:22 +01:00
Jeff Young edc8438ef0 Start the process of removing the legacy draw panel. 2019-05-31 21:54:21 +01:00
Seth Hillbrand e7e20b85b5 Don't change the board without user action
Grid and ratsnest visibility are stored in the board file and should not
be changed without the user explicitly modifying them.

In the future, we'll move these settings out of the board file but we
shouldn't cause extra file-churn for flipped bits.

Fixes: lp:1828285
* https://bugs.launchpad.net/kicad/+bug/1828285
2019-05-29 11:25:44 -07:00
Jeff Young 9d9745b555 Remove more legacy editing code. 2019-05-27 18:47:20 +01:00
Jeff Young e9e28b9aac Retire legacy block architecture. 2019-05-27 11:58:56 +01:00
jean-pierre charras 6e6063b258 Pcbnew: release the lock file if a board was loaded, and when clearing the board currently edited.
When the board is cleared, the previous loaded board is no longer in edit.
2019-05-20 18:36:24 +02:00
jean-pierre charras 5137b54bd8 Pcbnew: fix a (minor) lock file issue: the lock was too early set.
If the file was (for some reason) not actually loaded, it was locked.
Now, the file is locked only if it is actually loaded.
2019-05-19 11:03:44 +02:00
Jeff Young dae41b7460 Remove legacy segment-based zones.
Give the user the option of cancelling a file open if there are
segment zones; otherwise they're converted to polygon fills.

Fixes: lp:1823087
* https://bugs.launchpad.net/kicad/+bug/1823087
2019-04-12 20:19:23 +01:00
Jeff Young 77f15eeeaf Support synchronous messaging over KIWAY EXPRESS.
This allows us to make the various netlist and pcb update routines
more atomic and less reliant on carefully sequenced asynchronous
messages.

This is also a prelude to adding support for footprint testing
without a netlist.
2019-04-08 13:26:09 +01:00
Jeff Young 1ae47b6069 Implement a copper-to-edge-clearance setting.
For legacy boards, the setting is picked up from the board outline
thickness.  If the board outline has mixed thicknesses, then the
max is used and a warning is displayed.

Fixes: lp:1797787
* https://bugs.launchpad.net/kicad/+bug/1797787
2019-04-05 22:18:44 +01:00
Seth Hillbrand 078320e2fb Unify and correct Autosave functions
Autosave was not working correctly, partly due to different
implementations in eeschema and pcbnew and partly due to a mistaken
refactor at some point during v5 development.  This unifies the expected
autosave prefix to _autosave- for both pcbnew and eeschema.  It also
unifies the expected suffix for the backup files to -bak.

Fixes: lp:1820433
* https://bugs.launchpad.net/kicad/+bug/1820433
2019-03-18 10:25:26 -07:00
Jeff Young 73f0b3087c Initialize grid visibility correctly when opening project files. 2019-02-26 18:24:07 +00:00
Seth Hillbrand 1e5ba6f1b1 Replace DIM() macro
The standard DIM() macro was not typesafe as it happily deferred errors
to runtime that can be caught at compile time.  Replacing it with a
generic C++11 constexpr allows for typecasting, comparison and compile
time error checking.
2019-01-06 08:43:12 -08:00
Seth Hillbrand aeedb3543b pcbnew: Update strings
Moving pcbnew error strings that may be seen by the user to translated
strings.  Strings that denote unexpected cases are moved to debug logs
as they are essentially asserts that should never be shown.  The
exceptions are the messages shown when files are loaded.  All unknown
items should show an error here.
2019-01-02 14:43:55 -08:00
Jeff Young 78daaa8825 Allow cancel, delete or rescue when opening pcbs with undefined layers.
Fixes: lp:1796596
* https://bugs.launchpad.net/kicad/+bug/1796596
2018-12-07 00:26:10 +00:00
Wayne Stambaugh e5ff4f8582 Pcbnew: fix lock file bug on windows.
The lock file code would reset the lock file every other time the same
board file was opened in Pcbnew in the stand alone mode.  This created
the perfect toggle switch causing the board to be reloaded every other
time the same board was selected.

Please note that wxSingleInstanceChecker is broken on Linux and most
likely MacOS as well due to a bug in wxWidgets.  On these platforms,
the already opened file is reopened rather than displaying a warning
that the file is already opened.

Fixes lp:1777599

https://bugs.launchpad.net/kicad/+bug/1777599
2018-09-22 08:20:04 -04:00
Jeff Young 4b1a31ffad Regularize save-changes dialogs. 2018-08-12 00:02:37 +01:00
Jeff Young d8d4f75fa1 Fix button order and genralize Exit dialog so it can be shared more.
This also fixes a bunch of bugs where an error during save would
still close the window (rather than cancelling the close action).

Fixes: lp:1785034
* https://bugs.launchpad.net/kicad/+bug/1785034
2018-08-02 11:01:03 +01:00
Seth Hillbrand 13b96799ea pcbnew: remove duplicate rebuild in GAL
When running GAL, the connectivity is built when the board loads, so the
extra call to rebuild connectivity is not needed.
2018-07-31 15:13:12 -07:00
Jeff Young 49ea6e1670 Fix occurrences of "edition" which should be "editing"
Fixes: lp:1778168
* https://bugs.launchpad.net/kicad/+bug/1778168

(cherry picked from commit bcb1220)
2018-07-17 15:12:39 +01:00
Jeff Young aab97c8385 Consolidate design rules UI.
Implement new Board Setup paged dialog which includes:
  Layers Setup
  Design Rules
  Solder Mask & Paste
  Text & Drawings

Moves line width and text properties to a layer-class-based
system.  Renames unlocked to upright (which also reverses the
logic).

New Edit Text and Graphic Properties dialog which replaces
Edit Footprint Text and adds layer-class-based editing and the
italic, upright and visibility properties.

Adds Import Settings functionality which allows settings to
be imported from another project at page granularity.

Also UNIT_BINDERizes the dialog and adds editing of pcb text.

Fixes: lp:1731952
* https://bugs.launchpad.net/kicad/+bug/1731952

Fixes: lp:1743464
* https://bugs.launchpad.net/kicad/+bug/1743464

Fixes: lp:1664761
* https://bugs.launchpad.net/kicad/+bug/1664761

Fixes: lp:1753362
* https://bugs.launchpad.net/kicad/+bug/1753362

Fixes: lp:1545427
* https://bugs.launchpad.net/kicad/+bug/1545427

Fixes: lp:1753775
* https://bugs.launchpad.net/kicad/+bug/1753775

Fixes: lp:1777692
* https://bugs.launchpad.net/kicad/+bug/1777692

Fixes: lp:1780670
* https://bugs.launchpad.net/kicad/+bug/1780670

Fixes: lp:1519601
* https://bugs.launchpad.net/kicad/+bug/1519601

(cherry picked from commit 3944a5e)
2018-07-17 15:12:34 +01:00
Wayne Stambaugh 81843c37a4 Organize trace debugging code for ease of maintenance. 2018-04-13 09:59:01 -04:00
jean-pierre charras 9ea360f168 Pcbnew: avoid useless validation dialog about modifications when closing pcbnew or opening a file, when the initial board is empty.
Some changes (enable/disable a layer) set the dirty bit even for empty boards.
So when closing pcbnew, the dialog asking for saving the board was shown, even when no board loaded.
2018-04-10 20:17:47 +02:00
Maciej Suminski 419a16ae58 Eagle import: fix footprint LIB_IDs in the imported board 2018-03-04 16:45:42 +01:00
Maciej Suminski a3941b1dec Eagle import plugin: remap zones/tracks/vias using net name remapping
There are a few steps to assign correct nets to zones/track/vias:
- create a net name to pad map
- perform 2 stage netlist update (fix timestamps and then references)
- compare new net names with the previously created net map, save the
    differences as a old net to new net map
- remap zones/tracks/vias using the map created in the previous step

The main advantage here is it correctly handles unnamed nets (i.e. ones
without any net labels attached), which might be changed by KiCad
netlist generator.
2018-03-04 16:45:42 +01:00
Maciej Suminski 1f078f533b Refactor Eagle project import to use Kiway::ExpressMail() 2018-03-04 16:45:42 +01:00
Russell Oliver 9016344bb3 Eagle Schematic Import: Fix netlist mapping for zones and vias. 2018-03-04 16:45:11 +01:00
Wayne Stambaugh aeae32b1a2 Fix file naming bug when importing Eagle projects with . in file name.
Fixes lp:1747470

https://bugs.launchpad.net/kicad/+bug/1747470
2018-03-03 08:35:53 -05:00
Jon Evans cfd67163a1 Refactor post-load actions in PcbNew and apply them consistently
Fixes: lp:1751589
* https://bugs.launchpad.net/kicad/+bug/1751589
2018-02-25 17:47:36 -05:00
Jeff Young 4bae901dc8 Centralize zoom-to-fit code.
Fixes a bunch of errors:
- libedit and libbrowser would zoom to bounding box but centre on canvas
- libedit, libbrowser and gerbview didn’t take the scroll bars into account
- pcbnew didn’t take scroll bars into account or apply the 10% margin
- appending a board file would re-centre, but not re-zoom

Fixes: lp:1504302
* https://bugs.launchpad.net/kicad/+bug/1504302
2018-02-13 20:06:03 -05:00
Russell Oliver 864c152a5b Add converted footprint library to library table during Eagle project. 2018-02-08 13:54:40 -05:00
jean-pierre charras 8552f3fedf fix code after renaming files 2018-01-29 22:00:44 +01:00
Simon Richter a9ccf1161b Fix quotes in UI messages
This replaces all single and angle bracket quotes in UI messages with
double quotes, for consistency.

Sorry to all translators.
2017-12-15 07:33:07 -05:00
Wayne Stambaugh 652b969193 GTK+ file dialog wildcard improvements.
The GTK+ file dialog is case sensitive however it does support regular
expressions.  Most of the file dialog wildcards are lower case so only
files with the lower case extensions will show up in the file dialog.
This code adds a method to convert file extensions of any case to the
appropriate (sch -> [sS][cC][hH]) regular expression on GTK+ builds so
all file extension case combinations will show up in the file dialog.

A note to developers: make sure to add a file extension when setting
when setting the default file argument.  If you do don't set an
extension, the GTK+ file dialog will happily append the regular
expression as the file extension which is surely not what you want.

There are still a few known places (mostly gerbview) where there are
some complex wildcard code that has not been converted.

Fixes lp:1720542

https://bugs.launchpad.net/kicad/+bug/1720542
2017-11-11 19:32:26 -05:00
Russell Oliver 2a0a999350 Eeschema Eagle Import: Code clean-up and formatting 2017-10-20 09:34:32 +02:00
Russell Oliver 3b0855d204 Eagle Project Import: Code cleanup and documentation.
- Also makes the project and file import functions filetype dependent.
- The change from IO_MGR::KICAD to IO_MGR::KICAD_SEXP removes a conflict from a compile definition for KICAD when compiling kicad/import_project.cpp
2017-10-20 08:58:40 +02:00
Russell Oliver b9973a1c67 PcbNew Eagle Import: Archives footprints in pretty library automatically on eagle project import. 2017-10-20 08:58:40 +02:00
Russell Oliver 869743d573 Kicad Eagle Project Import Improvements. -- schematic and board files are both visible in file selection dialog. -- Allows for the selection of either the board or schematic file. -- silently fails on not detecting the corrosponding board or schematic file. -- all new kicad files are generated in new project directory -- Silently read netlist without generating annotation warnings which synchronises timestamps and paths based on given eagle references, otherwise renumbering schematic references will break links accross schematic and pcbnew. 2017-10-20 08:58:40 +02:00
Russell Oliver 433aa653fe Kicad: Add Project import function. -- add menu entry -- add ImportFile kiway function -- expose functions for creating/reading netlist -- add example eagle boad file as well 2017-10-20 08:38:42 +02:00
jean-pierre charras 4d0c1577d2 Fix Pcbnew Python: LoadBoard does not rebuild connectivity database, and later, SaveBoard does not save net class memberships
Fixes: lp:1711268
https://bugs.launchpad.net/kicad/+bug/1711268
2017-08-17 18:00:34 +02:00
Oliver Walters c27f5b725d Improved various error messages
- Moved developer "jargon" to details pane
- Changed error messages to "WHAT" rather than "WHY" or "WHERE"
2017-07-25 07:37:14 -04:00
Tomasz Włostowski 3b16d3cffe further DLIST/Iterators cleanup, some code formatting 2017-06-23 11:12:37 +02:00
Tomasz Włostowski 3cba1007eb Removed legacy connectivity/ratsnest algorithm, replaced with the new one. No legacy autorouting for the moment 2017-06-23 11:12:37 +02:00
Tomasz Włostowski 9ad886344b New connectivity algorithm. 2017-06-23 11:12:36 +02:00
Jon Evans 3ec28e2acf Refactor layer enumerations to all live in the same place 2017-03-30 16:01:48 -04:00
Dick Hollenbeck 9ad49dc2d1 Split IO_ERROR out of richio.* and store Problem() and Where() separately 2016-09-20 11:56:18 -04:00
Wayne Stambaugh a4570f74bb Pcbnew: fix several auto save file issues.
* When Pcbnew is launched in the stand alone mode with no board file command
  line option, the project path is set to the current working directory.  The
  user may not have write access to the current working directory which would
  cause the auto save to generate an error.  If the user does not have write
  access to the current working directory, set the path to a platform specific
  temporary path that the user has write permission.

* When Pcbnew is launched in the stand alone mode with no board file command
  line option, the default BOARD object has no file name.  Set the file name
  to "noname.kicad_pcb" to fix incorrect auto save file name and set the path
  to the user's platform specific document folder.

* Delete orphaned auto save files when closing without saving due to broken
  auto save file generation logic which prepended the file name with "$" rather
  than "_autosave-".

* Fixes: lp:1596382
2016-08-11 15:13:47 -04:00
Mrio Luzeiro d8eab321f7 3D Viewer: complete refactor of the 3D viewer.
* Split and rewrite the preview window and canvas.
* Create a new class for handling the board information.
* Adds new render targets: openGL, legacy, and ray tracing.
* Render targets take full advantage of the new 3D plugins system and 3D cache
  for a fast 3D model loading.
* Faster board loading.
* New OpenGL render is faster than the old one.
* New ray tracing render target with a post processing shader.
* Use of new 3D plugins (WRL, X3D, STEP and IGES) and 3D model caching.
* Preview of 3D model while browsing the file name.
* 3D preview of the footprint while adding / align 3D shapes.
* Render of 3D models according to attributes: Normal, Normal+Insert, Virtual.
* Pivot rotation centered in one point over the PCB board.
* Shortcuts keys improved for XYZ orientation..
* Animated camera.
2016-07-19 13:35:25 -04:00
jean-pierre charras b7955001c1 zone_filling_algorithm.cpp: a small code cleanup, fix incorrect return type in a few methods, and add better comments. 2016-07-14 09:27:32 +02:00
jean-pierre charras 05f849a746 Pcbnew: fix potential issue (crash) when loading board files with a missing net section (like created by Gerbview) due to an initialization made to late. 2016-07-05 17:01:41 +02:00
Chris Pavlina f9386fcbc0 Add support for PCB and footprint format versioning
Currently, kicad_pcb files have a (version ...) tag, but it is ignored. This
commit does the following:

1. Parse the version. If it's later than the last supported version, present an
alternative error message suggesting an upgrade if the file does not load
correctly. The version will be interpreted as an integer YYYYMMDD to suggest
a KiCad release date.

2. Accept a (version ...) tag also in kicad_mod files, but do not write them
yet. If no version tag is present in these files, assume the version to be that
of the current format version at the time of this commit.

This is meant to be merged to the 4.x stable series, and preps for KiCad 5
which will start emitting version tags also in footprints - users with what
will then be 'old stable' will not get a parse error when we introduce this for
footprints, and we can safely increment the format version later.
2016-05-10 15:07:35 -04:00
jean-pierre charras ba038ac507 Pcbnew, File menu: break Open (board) into 2 menu items: Open (only for Kicad board files) and Import (only for non Kicad board files) 2016-03-04 19:48:08 +01:00
jean-pierre charras d1559b129d Pcbnew: fix 2 issues:
* File import: use case insensitive comparison to choose import plugin, from the file extension (It is not always in lower cases, especially on Windows.)
* onleftclick.cpp: fis a minor issue, which happens after switching form GAL to Legacy canvas: sometimes a board item is left selected from GAL, and creates false warning message in legacy.
2016-02-19 15:10:23 +01:00
Simon Richter a568f35978 Fix preprocessor logic
The C++ preprocessor is actually not required to process "true" and "false"
correctly. This works in C if <stdbool.h> is included, because these are
then macros themselves, and resolved correctly, but C++ requires them to be
keywords, so no such macros exist, and the preprocessor can treat both as
undefined/zero.
2016-01-14 20:48:44 -05:00
Simon Richter 1190b7880a Fix double class name
Mostly cosmetic change, although there are compilers that choke on this.

The C++ standard specifies that classes contain themselves as members,
probably so they shadow any other definition of the same name for their own
member functions, but there is really no reason why the class name should
be duplicated here.
2016-01-14 20:43:38 -05:00
jean-pierre charras a11bbffe9b Code reorganization, and change the way 3D viewer frame is managed (now using wxWidgets wxWindow::FindWindowByName() to know if it is existing) , to prepare others fixes. 2015-12-21 12:52:00 +01:00
Maciej Suminski 843c9b99d5 Fixed ratsnest for PCBs imported using plugins (GAL). 2015-12-10 16:29:12 +01:00
Wayne Stambaugh a6a9d8eedf Default and most recently used path fixes. (fixes: 1494210)
* Rename Eda_FileSelector to EDA_FILE_SELECTOR.
* Add optional pointer to wxString to save the most recently used path to EDA_FILE_SELECTOR.
* Rename Eda_DirectorySelector to EDA_PATH_SELECTOR.
* Replace wxGetCwd() with wxStandardPaths::GetDocumentsDir().  This fixes the windows issue
  where wxGetCwd() returns the path where the executable files are located.
* Add code to handle most recently used path to EDA_BASE_FRAME.
* Fix string formatting error in kicad/files-io.cpp.
* Remove setting and restoring current working directory when launching GerbView.  Setting the CWD
  has no effect on the launched executable which starts with it's own CWD.
* Allow project path to be passed to GerbView when launched from KiCad.
* Note: this is a work in progress.  Do not expect every path and/or file selection dialog to properly
  update the most recently used path.  The correct solution to this problem requires a much more
  well though out solution which will not happen until after the next stable release.
2015-09-25 15:38:09 -04:00
Chris Pavlina 872a43ff92 Pcbnew: assertion work around when automatically saving an unnamed file. 2015-06-19 09:27:06 -04:00
jean-pierre charras bbbb84e6c2 Fix a few minor coverity warnings.
Fix minor 3D viewer issues (includling change number of segments and its optimization to draw pad holes.)
Fix Bug #1439132 (track and via list on toolbar not always refresh after loading a board).
Remove useless tool in Modedit.
2015-04-02 13:18:19 +02:00
unknown eef494d9c5 Pcbnew: Fix an Incorrect save-on-quit in pcbnew with unamed board 2015-03-17 08:34:02 +01:00
jean-pierre charras 1a74913063 Minor fixes: fix issue Bug #1420910 (Linux specific).
Rename eeschema/dialogs/dialog_sch_find.fbp to dialog_schematic_find_base.fbp, to be consistent with other dialogs. 
Pcbnew run from the project manager: add menu Save Copy As..., which is the same command as Save As ... in stand alone mode, but with the constraints of a project (no cwd change, no board filename change, and keep project settings)
2015-02-14 13:43:11 +01:00
jean-pierre charras 9cfb97d8b4 Add hight contrast option in Modedit. In hight contrast mode, solder masks and solder paste are shown.
this option was possible only by modifying the way display options are managed.
before these changes, display options were a global DISPLAY_OPTIONS class instance.
Now each EDA_DRAW_FRAME(and derivated classes)  includes its own DISPLAY_OPTIONS class instance.
As a consequence, some duplicate display option variables in these classes have been removed, because there were just duplicate variables of the  DISPLAY_OPTIONS class instance.
2015-01-10 11:27:49 +01:00
jean-pierre charras 24f516f6ae Fix many doxygen warnings (due to missing info, old comments, typo ...) when building the doxygen doc. 2014-11-02 17:25:04 +01:00
jean-pierre charras 24ed7f50f5 Pcbnew: fix Bug #1370321 (Change Segment function applies last netclass used).
Also update main toolbar track width and via size info in pns router mode, when starting a track, and other very minor update issue.
2014-09-28 16:44:47 +02:00
jean-pierre charras 980ffac1c3 Pcbnew: add append board function, only available when Pcbnew is run in standalone mode (outside a project), to allow a basic panelization.
(this function is not compatible with a project, because it breaks the coherency with the schematic)
2014-09-24 18:56:20 +02:00
jean-pierre charras efd4c123eb Fix bug #1369281 ( Pcbnew, initial save broken ) 2014-09-14 19:12:56 +02:00
Dick Hollenbeck 3e861db371 Lock file improvements. 2014-09-07 15:01:26 -04:00
jean-pierre charras 5a38d2b657 Rework on env. variable KISYS3DMOD. Until now, was used in different files using different ways, so no consistency between files.
code cleanup.
2014-08-24 09:05:07 +02:00
Dick Hollenbeck 7e483f69bd Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
     get disassociated from their true PROJECT.
  *) Allow loading eeschema library editor from kicad.exe
  *) Allow loading pcbnew library editor from kicad.exe
  *) Rename LIB_COMPONENT to LIB_PART.
  *) Add class PART_LIBS, and PART_LIB.
  *) Make PART_LIBS non-global, i.e. PROJECT specific.
  *) Implement "data on demand" for PART_LIBS
  *) Implement "data on demand" for schematic SEARCH_STACK.
  *) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
  *) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
     a weak pointer.
  *) Remove all chdir() calls so projects don't need to be CWD.
  *) Romove APPEND support from OpenProjectFiles().
  *) Make OpenProjectFiles() robust, even for creating new projects.
  *) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
     and save them in the .eeschema config file, not in the project file.
  *) Fix bug with wxDir() while accessing protected dirs in kicad.exe
  *) Consolidate template copying into PROJECT class, not in kicad.exe source.
  *) Generally untangle eeschema, making its libraries not global but rather
     held in the PROJECT.
2014-08-13 15:28:54 -05:00
Dick Hollenbeck 84a14c3a51 back annotation when CVPCB and EESCHEMA are running under KICAD 2014-07-06 23:12:04 -05:00
Dick Hollenbeck 4578ea8b9e 1) Add 32 Cu Layers.
2) Change from legacy Cu stack to counting down from top=(F_Cu or 0).
   The old Cu stack required knowing the count of Cu layers to make
   sense of the layer number when converting to many exported file types.
   The new Cu stack is more commonly used, although ours still gives
   B_Cu a fixed number.
3) Introduce class LSET and enum LAYER_ID.
4) Change *.kicad_pcb file format version to 4 from 3.
5) Change fixed names Inner1_Cu-Inner14_Cu to In1_Cu-In30_Cu and their
   meanings are typically flipped.
6) Moved the #define LAYER_N_* stuff into legacy_plugin.cpp where they
   can die a quiet death, and switch to enum LAYER_ID symbols throughout.
7) Removed the LEGACY_PLUGIN::Save() and FootprintSave() functions.
   You will need to convert to the format immediately, *.kicad_pcb and
   *.kicad_mod (=pretty) since legacy format was never going to know
   about 32 Cu layers and additional technical layers and the reversed Cu
   stack.
2014-06-24 11:17:18 -05:00
jean-pierre charras 218cb8e7c1 Pcbnew: fix Bug #1325311 ("New Board" warning refusal broken) 2014-06-01 16:58:17 +02:00
Maciej Suminski 4fcaf4c586 Minor BOARD_DESIGN_SETTINGS refactoring.
Removed SetCurrentClassName() (it was not used anywhere and less safe than SetCurrentClass()).
Added BOARD_DESIGN_SETTIGNS::GetDefault() to make some pieces of shorter and clearer.
2014-05-15 10:51:08 +02:00
Maciej Suminski d9eb15c9fa Moved NETCLASSES to BOARD_DESIGN_SETTINGS.
Most of the changes are just adding GetDesignSettings() before every occurence of m_NetClasses.
More complex changes:
class_netclass.cpp - NETCLASS does not store the pointer to the parent BOARD anymore. Added function SetParams( BOARD_DESIGN_SETTINGS& ).
class_netclass.h - Removed GetTrackMinWidth(), GetViaMinDiameter(), GetViaMinDrill(), GetuViaMinDiameter(), GetuViaMinDrill() as they were refering to BOARD_DESIGN_SETTINGS anyway (they are not net class specific).
kicad_plugin.cpp - filters out empty nets (that are anyway not saved) when storing net class information. Previously it was done in NETCLASS::Format() function.
2014-05-13 11:22:51 +02:00