Commit Graph

4267 Commits

Author SHA1 Message Date
Jon Evans 356ccd0314 Eeschema: improve simulator behavior for two-source DC analysis
Fixes: lp:1830478
* https://bugs.launchpad.net/kicad/+bug/1830478
2019-05-27 18:13:07 -04:00
Seth Hillbrand b4e70e56a6 Eagle: Fix crash when importing Eagle V6
This fixes multiple issues when importing Eagle V6 files.

Crashes occured when arcs of 0-length were found and when parts were
referenced in the schematic that were not found in the library.  This
could happen if the library and schematic were different cases.

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

(cherry picked from commit 0e5cc54ec9)
2019-05-26 20:34:05 -07:00
Jon Evans 720b26d11e Eeschema: fix worksheet and background color for printing
Fixes: lp:1820611
* https://bugs.launchpad.net/kicad/+bug/1820611
2019-05-26 14:25:57 -04:00
Jon Evans e35be13b23 Eeschema: use worksheet color when plotting
Fixes: lp:1825568
* https://bugs.launchpad.net/kicad/+bug/1825568
2019-05-26 12:21:08 -04:00
Wayne Stambaugh 6db7cb8937 Symbol Editor: fix datasheet field bug loading old symbol libraries.
This only applies to the root symbol when the datasheet field is not
empty and the datasheet for root symbol alias in the document file is
empty.  Use the root symbol datasheet field value when adding a new
symbol that meets this criteria.

The root symbol datasheet field gets copied to the root symbol alias
datasheet member variable so if the symbol is modified and saved, the
datasheet information is saved in the .dcm file.

https://bugs.launchpad.net/kicad/+bug/1830078

Fixes lp:1830078

(cherry picked from commit c52ff1ca23)
2019-05-23 09:02:21 -04:00
Wayne Stambaugh 6afc572eae Eeschema: fix datasheet field bug loading old symbol libraries.
This only applies to the root symbol when the datasheet field is not
empty and the datasheet for root symbol alias in the document file is
empty.  Use the root symbol datasheet field value when adding a new
symbol that meets this criteria.

https://bugs.launchpad.net/kicad/+bug/1830083

Fixes lp:1830083

(cherry picked from commit 300f5cb082)
2019-05-23 07:35:10 -04:00
Seth Hillbrand ec6fd23636 EAGLE: Prevent numeric-only component references
KiCad does not allow references to be numeric only.  This prefixes such
references with "UNK" to note that the reference designator type is
unknown.

(cherry picked from commit a62a89eac3)
2019-05-22 10:38:16 -07:00
jean-pierre charras 764986a9b0 Fix a compil issue 2019-05-22 18:35:58 +02:00
jean-pierre charras c4efa95b4a * Eeschema: Ensure axis are always drawn in libedit and viewlib
(From master branch)
2019-05-22 17:56:08 +02:00
Wayne Stambaugh 5a655779d7 Eeschema: fix broken cursor after mouse wheel pan.
Fixes lp:1827787

https://bugs.launchpad.net/kicad/+bug/1827787
2019-05-21 14:21:53 -04:00
Wayne Stambaugh 0403437ad0 Eeschema: replace invalid characters when converting from text to label.
Fixes lp:1829664

https://bugs.launchpad.net/kicad/+bug/1829664
2019-05-20 14:49:49 -04:00
jean-pierre charras 9c0e4cae74 Eeschema: fix incorrect position of fields of a hierarchical sheet when rotated
(From master branch)

Fixes: lp:1829048
https://bugs.launchpad.net/kicad/+bug/1829048
2019-05-17 08:36:09 +02:00
Wayne Stambaugh ae139403e4 Fix library table editor dialog environment variable grid column names.
Fixes lp:1825977

https://bugs.launchpad.net/kicad/+bug/1828459
(cherry picked from commit 6f27ef7f66)
2019-05-14 07:59:22 -04:00
Wayne Stambaugh d3c9154f9a Fix frame name capitalization in all about dialogs.
This is a stop gap fix.  It should be possible to use the wxFrame title
string for this but some of the frame windows have appropriated the title
string for configuration file naming purposes which is less than ideal.

Fixes lp:1825977

https://bugs.launchpad.net/kicad/+bug/1825977
(cherry picked from commit 3c4f8c1bf7)
2019-05-13 16:22:52 -04:00
jean-pierre charras 3f48531da7 DIALOG_EDIT_COMPONENT_IN_LIBRARY: fix a dialog resize issue (grid not resized). 2019-05-11 10:09:32 +02:00
Wayne Stambaugh 8e93eda449 Eeschema: fix corrupted schematic and symbol library files.
Prevent user from pasting text with carriage return and/or line feed
characters in field value edit control in the schematic symbol and symbol
library properties dialogs.

Make all objects derived from GRID_CELL_TEXT_BUTTON use validators
correctly.

Add validators to FIELDS_GRID_TABLE object for field values other than
the mandatory fields.

Create a validator to check that a string is a valid LIB_ID.

Fixes lp:1828214

https://bugs.launchpad.net/kicad/+bug/1828214
(cherry picked from commit ae54f34392)
2019-05-10 09:16:38 -04:00
jean-pierre charras bb40f86daa * Eeschema: fix incorrect display of the page number in a complex hierarchy.
When, inside a complex hierarchy, one switch from an instance of a sheet to an other instance of this sheet,
the page number shown in the worksheet was not updated on screen, and the initial number was displayed.

Fix from master branch.
2019-05-07 11:02:05 +02:00
Wayne Stambaugh 616061a6ca Eeschema: fix broken symbol library links.
Force the symbol library links whenever the symbol library table has been
modified.  This will use the cache as a fallback when a library has been
removed that contains links in the schematic rather than display.

Fix the SCH_COMPONENT symbol resolver when falling back to the cache.  The
resolver was using the LIB_ID ':' notation which was failing.  Replacing
':' with '_' fixed this issue.  This was also an issue when generating the
symbol message panel information.

Convert wxLogDebug to wxLogTrace in symbol resolver code path.  Add new
trace type KICAD_SYM_RESOLVE.

Fixes lp:1821606

https://bugs.launchpad.net/kicad/+bug/1821606
(cherry picked from commit 7d803437e2)
2019-05-02 12:13:30 -04:00
John Beard 89d39cf8ff Pcbnew: use same null check as eeschema for recently used
When Pcbnew's add footprint browser is run up, it constructs
the recently used list without checking for nulls.

Although the DoAddLibrary call does internally check for
null, it's easier to filter these out before placing into
the vector in the first place.

The same logic in the symbol tree is already handled in the
same way.

(cherry picked from commit 42d20cbd96)
2019-04-29 17:00:42 +01:00
John Beard 454585d3d2 GAL: add some trace to GAL display options config
This can be helpful when tracing where certain configurations
come from (some apps load from other apps' config basenames).

(cherry picked from commit fcc4a84e0e)
2019-04-27 14:58:50 +01:00
John Beard 65a6e341ad Eeschema: Symbol preview widget needs common config for Hi-DPI
Currently, this widget doesn't read the common library settings.
This means it doesn't use the configured DPI scaling or anti-aliasing
settings.

Use the ReadConfig method on the GAL options to fix (rather than
only ReadAppConfig).

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

(cherry picked from commit 33fe9a2761)
2019-04-27 14:58:50 +01:00
John Beard fc933034db Eeschema: fix resizing of pin table and edit symbol dialog
These dialogs had logic to avoid a table re-adjustment unless
the width changed. This was done to avoid spurious resizing
calls under GTK+3. This was commit
13249b723b, fixing bug lp:1817810.

However, by only calling event.Skip() when the width changed,
redraws were inhibited when only the height changed.

Placing the Skip() outside the width-change check fixes this,
and does not re-introduce the lp:1817810 bug (it is the column
adjust call that causes that).

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

(cherry picked from commit eccadd92fb)
2019-04-27 14:12:00 +01:00
Jeff Young 6e8979d8d8 Add try/catch block around writing a new library.
Fixes: lp:1825203
* https://bugs.launchpad.net/kicad/+bug/1825203

(cherry picked from commit 2bcf38d2b6)
2019-04-18 22:02:24 +01:00
Jon Evans d18b12c1a3 Hide simulator settings tabs that aren't implemented yet
Calling Hide() is apparently not enough in Windows

(cherry picked from commit 895d4c9e1a)
2019-04-15 23:21:31 -04:00
Seth Hillbrand c4be74a9d0 eeschema: Prevent invalid '0' element in components
In the component, an m_unit/m_convert element is 1-indexed as opposed to
the library where they are 0-indexed.  The 0-index in the library is
reserved for those elements that are shared across all conversion/unit
whereas it is invalid for the component.

Fixes: lp:1824764
* https://bugs.launchpad.net/kicad/+bug/1824764
2019-04-15 12:32:29 -07:00
Jon Evans 593a5181d7 Fix rotation of global and hierarchical labels
Fixes: lp:1824432
* https://bugs.launchpad.net/kicad/+bug/1824432
2019-04-13 17:02:33 -04:00
Jon Evans c29274e760 Fix ngspice nested DC sweep command
Fixes: lp:1824336
* https://bugs.launchpad.net/kicad/+bug/1824336
2019-04-13 16:38:31 -04:00
Jon Evans 216573bf48 Fix ngspice netlisting when net names contain '/'
Fixes: lp:1821502
* https://bugs.launchpad.net/kicad/+bug/1821502
2019-04-13 15:35:00 -04:00
Jon Evans 1c235a5c89 Properly initialize sheets when loading them from ERC dialog
When displaying a sheet from this path, it's possible the sheet will
not have been initialized yet.  Call DisplayCurrentSheet() to make sure
it is initialized, and then call RedrawScreen to update the zoom level.

Fixes: lp:1824362
* https://bugs.launchpad.net/kicad/+bug/1824362
2019-04-13 12:25:06 -04:00
John Beard 2d43fcf9ee GAL opts: move config reading into GAL_DISPLAY_OPTIONS
Move repeated GAL config reading routines into GAL_DISPLAY_OPTIONS.
THe app-level config is in here already, do the same for the
common config.

This means that the configs are loaded consistently, which fixes
the symbol-chooser preview window, which previously didn't use the
same config routine as other GAL canvases.

Future work could move these functions to free functions that
act on the public interface of GAL_DISPLAY_OPTIONS to avoid
GAL_DISPLAY_OPTIONS having to know about wxConfig and wxWindow.

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

(cherry picked from commit ab2281d26f)
2019-04-12 16:48:50 +01:00
Jeff Young cb5948d3a5 When checking for duplicate aliases look in the dialog not the symbol.
Fixes: lp:1821543
* https://bugs.launchpad.net/kicad/+bug/1821543

(cherry picked from commit e90452d0e2)
2019-04-10 21:23:14 +01:00
Jeff Young 15cb032ab7 Readjust Edit Symbol Properties when symbol references changes.
The new reference may contain different numbers of units and/or
different deMorgan conversion settings.

Fixes: lp:1822316
* https://bugs.launchpad.net/kicad/+bug/1822316
2019-04-09 17:02:29 +01:00
Wayne Stambaugh bc821ff47d Eeschema: fix schematic text object plotting issue.
Save and restore text thickness in SCH_TEXT::Plot() function to prevent
the plotting default thickness value from stepping on the original text
thickness and causing all of the text objects to magically change to bold.

Fixes lp:1823165

https://bugs.launchpad.net/kicad/+bug/1823165
(cherry picked from commit 3d33cba574)
2019-04-09 10:18:08 -04:00
Jeff Young 42d9f42807 Allow no-connects to be dragged.
Fixes: lp:1821342
* https://bugs.launchpad.net/kicad/+bug/1821342

(cherry picked from commit c78c3c8198)
2019-04-09 11:20:03 +01:00
Wayne Stambaugh a533514763 Minor symbol library rescue dialog fixes.
Adjust the sizer proportions slightly to eliminate the reported bug.
This may not be the ideal way to do this and there could be some issues
on other platforms but it does resolve the issue on gtk3.

Fixes lp:1820084

https://bugs.launchpad.net/kicad/+bug/1820084

(cherry picked from commit 615c49315f)
2019-04-06 08:19:06 -04:00
Wayne Stambaugh e07ef3be9c Minor schematic formatter fix.
Apparently at some point in KiCad's development, a '~' character was
prefixed to the symbol name to indicate that it was not visible.  The
visibility state is now saved in the name field so remove the prefix.
The parser was kept unchanged.

Fixes lp:1632048

https://bugs.launchpad.net/kicad/+bug/1632048

(cherry picked from commit ee14da3093)
2019-04-04 10:50:23 -04:00
Jeff Young 3899ec136b Use a bigger hammer when refreshing fields in table.
Fixes: lp:1823050
* https://bugs.launchpad.net/kicad/+bug/1823050
2019-04-04 12:27:29 +01:00
John Beard 3a5e01c44a QA: Enable eeschema tests
Redesignate the eagle test as eeschema tests and build
more like the other unit tests.

Enable as a test in Ctest now that the test executes without
crashing.

The loading of the file with the hardocded part is still
not enabled, as this needs more infrastructure to support it.

(cherry picked from commit 4eb30f6b85)
2019-04-02 19:08:26 +01:00
John Beard d4883da98b Eeschema: construct simulator cursors on demand
Statically constructing wxCursors as used for the probe
and tune cursors crashes the qa_eagle_plugin test
instantly.

Fix this by introducing a new class CURSOR_STORE,
which allows to abstract the platform wierdness of wxCursors
and allow the simulator to laziliy init its own cursors
at runtime.

This code isn't properly tested, as these cursors are never
actually used. However, it does allow the eeschema unit test
to run.

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

(cherry picked from commit 6f1c3f5ef8)
2019-04-02 19:08:26 +01:00
Michael Kavanagh 7cc3e9a16d Add Ctrl+, hotkey to preferences dialog
Also change interactive router settings from Ctrl+, to Ctrl+Shift+,

(cherry picked from commit b0674b8802)
2019-04-02 13:17:37 -04:00
Michael Kavanagh 9ad352d4bd Fix 'hokey' -> 'hotkey' typo
(cherry picked from commit fe6bc411dd)
2019-04-02 13:17:18 -04:00
Jeff Young b57e9492b1 Disable alias controls when no alias is selected.
Fixes: lp:1821698
* https://bugs.launchpad.net/kicad/+bug/1821698
2019-04-01 13:47:31 +01:00
Jeff Young 95858b77c1 Ignore BRIGHTENED state when printing.
Fixes: lp:1788480
* https://bugs.launchpad.net/kicad/+bug/1788480
2019-04-01 13:46:46 +01:00
Jeff Young 4afbce5ad6 Fixes for importing board setup properties.
Save/restore default netclass.
Read layers back in with correct syntax ('.' between keyword and layer name).
Write layers to project file.
Read/write layer enablement bits.
Don't set solder paste margin min to 0 (most of them are negative).

Fixes: lp:1811990
* https://bugs.launchpad.net/kicad/+bug/1811990
2019-04-01 13:46:33 +01:00
jean-pierre charras 77993ced7e Symbol editor, DIALOG_LIB_EDIT_PIN_TABLE: fix crash when trying to delete a pin when the table is empty.
Fixes: lp:1822406
https://bugs.launchpad.net/kicad/+bug/1822406
2019-03-30 09:32:32 +01:00
Wayne Stambaugh f1a70662c5 Eeschema: do not merge graphical lines with different attributes.
Fixes lp:1821728

https://bugs.launchpad.net/kicad/+bug/1821728

(cherry picked from commit 2447933b54)
2019-03-28 13:47:58 -04:00
jean-pierre charras b154c9a5c4 Eeschema: Force time stamp to 32 bits unsigned values, and make it
tolerant to files using 64 bits values. define timestamp_t as uint32_t.

This fix is adapted from master, commit 175a2bc0b (bug fix lp:1821476)
2019-03-27 13:17:54 +01:00
jean-pierre charras 12255e3680 Eeschema: fix incorrect handling of Escape key. Key events do not have to be skipped after they are handled. 2019-03-27 13:17:54 +01:00
John Beard 473c41ddbf Eeschema: internal tidying of field editor ApplyData
Make a few things const (specficially the reference into
m_fieldStore - we should commit to not modifying that in this
function.

Also avoid a couple of needless string copies.

Also explicitly dereference the into a (non-const) reference at the outset.
For the whole if this function, comp is the same object and may not
be null (as it is used unchecked).

(cherry picked from commit edd94ce2d6)
2019-03-27 10:29:36 +00:00
Baranovskiy Konstantin b93382831c Eeschema: place new field near parent component
For now fields created in Fields Editor are placed at
position (0, 0).
Every new field must be placed at the origin of
the parent component.

(cherry picked from commit 11f03c8551)
2019-03-27 10:29:36 +00:00
Brian Henning 4e8f191f43 Added an include to tell the compiler where to find wxIsdigit 2019-03-24 15:38:59 +01:00
Jon Evans 5f9fa05e21 Fix loading of components with convert parameter set to zero
(cherry picked from commit ab74445df4)
2019-03-23 18:58:17 -04:00
Wayne Stambaugh ee92fa51bc Symbol editor: improve tooltip in symbol properties dialog.
Make the "Define as power symbol" checkbox tooltip more descriptive so
the user has a better understanding of enabling this option.

Fixes lp:1804932

https://bugs.launchpad.net/kicad/+bug/1804932

(cherry picked from commit a7c8df5666)
2019-03-20 15:58:11 -04:00
Seth Hillbrand 168fa09f5f 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

(cherry picked from commit 078320e2fb)
2019-03-18 10:27:09 -07:00
Seth Hillbrand 4facd57cb7 libedit: Don't move the field below the last item
There needs to be at least one item below the one we want to move down
in order to allow the action.

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

(cherry picked from commit 0943c176a3)
2019-03-18 10:27:09 -07:00
Wayne Stambaugh e999636048 Symbol editor: fix superfluous dialog display.
Call base object TransferDataFromWindow() to prevent Validate() from
being called twice.  Validation is handled completely under the hood
so there is no need to call Validate() directly.

Fixes lp:1820301

https://bugs.launchpad.net/kicad/+bug/1820301
2019-03-18 11:46:03 -04:00
jean-pierre charras af0cb68c1b Eeschema: do not draw dangling symbol (circle) for PIN_NC pin types. These pins are never connected, so a dangling symbol makes no sense.
Fix also a fex minor coding style issues.
2019-03-17 20:52:42 +01:00
jean-pierre charras c537e8a892 Eeschema: shows the opened sheet info in title bar.
Fixes: lp:1819564
https://bugs.launchpad.net/kicad/+bug/1819564
2019-03-17 08:52:00 +01:00
Wayne Stambaugh f7b4a20066 Replace isdigit() with wxIsdigit() when testing wxString characters.
This is a continuation of commit 8a03025a.  All known instances of
using isdigit() to test a character in a wxString have been replaced
by wxIsdigit().
2019-03-15 15:54:49 -04:00
Seth Hillbrand 5685ec525b GAL: Handle negative line widths
When displaying negative line width elements, the outline of the item
should be hidden rather than displayed.

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

(cherry picked from commit c61ec8ee3b)
2019-03-11 12:38:26 -07:00
Seth Hillbrand 5be59ea8dd eeschema: Fix plot line width for negative lines
Negative width lines are used to hide the outline of shapes in eeschema.
Plot should not show these lines.

(cherry picked from commit 94fa734c61)
2019-03-11 12:38:19 -07:00
Seth Hillbrand 5855f2d909 Ensure LIB_ALIAS elements are always drawn
We add LIB_ALIAS to the VIEW rtree when choosing a new symbol or
browsing.  The actual display element may change based on the unit or
demorgan representation but there will only ever be a single one drawn.
This will set the view bbox to maximum to ensure it is always checked
for drawing.

 Related to lp:1796960
 https://bugs.launchpad.net/kicad/+bug/1796960

(cherry picked from commit d25d62295a)
2019-03-10 20:18:12 -07:00
Seth Hillbrand de22148b44 Move env var substitution into GetAssociatedDocument
We always want the documents to have their variables replaced when
opening the associated file.

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

(cherry picked from commit 9bfce26ce7)
2019-03-10 10:44:23 -07:00
jean-pierre charras 26acd39129 Fix a few Coverity warnings. 2019-03-07 20:01:47 +01:00
Jeff Young 69f003ba4a Remove previous cell selection fixes in favour of slow-click hack.
wxWidgets has several bugs that result in cell editors being closed
right after they're opened.  There are two wxWidgets hacks to
partially address this: the SetInSetFocus() hack, and a slow-click
hack.  We used to try and work-around these bugs ourselves for
single-click access, but this changelist moves those over to
wxWidget's slow-click hack.

Fixes: lp:1817965
* https://bugs.launchpad.net/kicad/+bug/1817965
2019-03-04 11:09:33 +00:00
jean-pierre charras a128ffdea6 DIALOG_LIB_NEW_COMPONENT_BASE: fix minor issues.
Fixes: lp:1818471
https://bugs.launchpad.net/kicad/+bug/1818471
2019-03-04 08:27:00 +01:00
Seth Hillbrand 38be0fccb7 Symlib table: Need button handler for files
The folder button handler works will for footprint libraries but we
needed a specific class for the schematic libraries as well.

Fixes: lp:1818346
* https://bugs.launchpad.net/kicad/+bug/1818346
2019-03-02 20:05:28 -08:00
Seth Hillbrand db31b7902a libedit: Resolve path substitutions
Fixes: lp:1818220
* https://bugs.launchpad.net/kicad/+bug/1818220
2019-03-02 08:00:54 -08:00
Seth Hillbrand 84a1772e66 libedit: Control resize requests
Another GTK3 dialog with excessive resize requests.  Control the number
for re-draws based on grid size.

Fixes: lp:1818325
* https://bugs.launchpad.net/kicad/+bug/1818325
2019-03-02 05:49:18 -08:00
jean-pierre charras c2a7e5536e Eeschema: fix regression: set the max number of units per package to 64.
64 is the max number of units per package in 5.0.x

Fixes: lp:1818061
https://bugs.launchpad.net/kicad/+bug/1818061
2019-03-01 16:47:31 +01:00
Frank Severinsen 71a62bb782 Change pin on grid test in symbol editor.
The pin on grid test always used a fixed grid spacing of 25 mils.  The
change uses the current grid setting for the on grid test.  Grid sizes
below 25 mils are clamped to 25 mils to prevent issues when connecting
wires to pins in the schematic editor.

Fixes lp:1817896

https://bugs.launchpad.net/kicad/+bug/1817896
2019-02-28 09:46:57 -05:00
Seth Hillbrand 13249b723b Handle excessive resize requests
For unknown reasons, GTK3 may send resize events when editing grid
fields.  This can cause the grid editor to exit, losing the focus and
overwritting the characters at the next input.

We avoid this by filtering the size events when the size doesn't change.

Fixes: lp:1817810
* https://bugs.launchpad.net/kicad/+bug/1817810
2019-02-27 11:32:30 -08:00
Jeff Young 22229fbba4 Re-parent items being copied from the clipboard.
Their original parent might have been freed by now if they came
from a different symbol.

Fixes: lp:1815525
* https://bugs.launchpad.net/kicad/+bug/1815525
2019-02-27 19:09:45 +00:00
Jeff Young f494a24404 Resync lib_tree after editing aliases.
This also fixes an unrelated bug where the current part highlighting
would get lost after a rename.

Fixes: lp:1817639
* https://bugs.launchpad.net/kicad/+bug/1817639
2019-02-27 18:13:49 +00:00
Wayne Stambaugh 5315d1be22 Eeschema: fix an option toolbar refresh bug.
For some reason, changing languages was causing the options (left) toolbar
to get redrawn with some of the main toolbar entries.  Changing the window
size causes the toolbar to be redrawn correctly.  The normal call to
function wxWindow::Refresh() does not.

Fixes lp:1816492

https://bugs.launchpad.net/kicad/+bug/1816492
2019-02-25 13:26:14 -05:00
jean-pierre charras 8ad15b1d66 Symbol editor: fix issues related to axis not shown.
In Symbol editor, axis are always shown. However after switching the backend, axis were no longer drawn.
In Cairo engine, fix a bug preventing axis to be shown.
2019-02-24 12:56:17 +01:00
Seth Hillbrand 643d9901c7 eeschema: Refresh canvas after clearing
Forces a canvas update to change the highlighting after clearing the
selected item.

Fixes: lp:1809731
* https://bugs.launchpad.net/kicad/+bug/1809731
2019-02-23 11:07:00 -08:00
Seth Hillbrand f002382b4a eeschema: Set modifying transparency on edits
While modifying elements in eeschema/libedit, they are overdrawn on the
rest of the schematic.  This prevents alignment with existing elements
as the underlying elements are not visible.  We set a slight
transparency on elements while being modified to allow the user to view
existing elements at the same time.

Fixes: lp:1817233
* https://bugs.launchpad.net/kicad/+bug/1817233
2019-02-23 08:19:50 -08:00
John Beard 82734e7116 Adjust tab ordering in some dialogs
Introduce a shortcut method to set tab ordering and use it in
the dialogs that override the tab traversal orders:

* Eeschema sheet properties
* Pcbnew Move exact
* Pcbnew Move relative

Also set some initial focus fields in the same dialogs.

Tidy a few includes.

Fixes: lp:1816009
* https://bugs.launchpad.net/kicad/+bug/1816009
2019-02-23 14:49:38 +00:00
John Beard 29c8f92c27 Eeschema: move EDIT_COMPONENT_IN_SCHEMATIC to own header
Move the class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC to its own
header, and move the SCH_EDIT_FRAME::EditComponent out of the
dialog implementation file. Thus, users of the dialog are
coupled only by the dialog header, as usual.

Also tidy some includes and comments.
2019-02-21 10:04:29 +00:00
John Beard 75406e2742 Libedit: Fix cancel button in symbol edit dialog
In DIALOG_EDIT_COMPONENT_IN_SCHEMATIC, the Cancel button is
connected to a dedicated handler to deal with the footprint
browser widget. DIALOG_EDIT_COMPONENT_IN_LIBRARY should have
the same logic.

Fixes: lp:1816636
* https://bugs.launchpad.net/kicad/+bug/1816636
2019-02-20 23:00:22 +00:00
Seth Hillbrand f40dfa2765 eeschema: Refresh canvas when the options change
Windows doesn't appear to properly re-paint after an options change.
This forces the repaint when setting options

Fixes: lp:1816506
* https://bugs.launchpad.net/kicad/+bug/1816506
2019-02-19 17:04:51 -08:00
Seth Hillbrand b4c0af021e eeschema: Handle Windows click ordering
Click to add/edit footprint filters under MSW requires handling the
listbox double click first before the item is handled.

Fixes: lp:1816182
* https://bugs.launchpad.net/kicad/+bug/1816182
2019-02-19 12:51:40 -08:00
Seth Hillbrand d1c9dd67ac eeschema: Clean up last RefreshRect
Unimplemented call in GAL canvas.
2019-02-19 10:52:38 -08:00
Tomasz Włostowski 9a8afdf6fd eeschema: SCH_PAINTER should draw LIB_BEZIERs too! 2019-02-19 10:42:23 +01:00
Seth Hillbrand ef60e523a1 libedit: Fix missing canvas selection
Analogous to fp editor, libedit needs the ability to switch between
fallback and accelerated while running.
2019-02-18 18:26:03 -08:00
Jeff Young 23aa838a03 Mark block for AppendUndo when a command is executed.
This (aside from getting both parts into a single undo stack item)
will ensure that we clean up both parts on an abort.

Fixes: lp:1816284
* https://bugs.launchpad.net/kicad/+bug/1816284
2019-02-17 10:38:06 +00:00
Jeff Young d751fecd8a Tooltip and error message improvements. 2019-02-17 10:20:29 +00:00
Tomasz Włostowski bbee30671a gal: pixel alignment hacks, works for Retina display too now.
gal: pixel alignment for Cairo.
gal: pixel alignment for OpenGL

Cleanup of pixel alignment patches

gal/opengl: more pixel alignment patches:
- works on Retina displays now
- pixel alignment for circles
- correct 1-pixel strokes
- fixed unfinished 1-pixel line ends

GAL: Restore antialiasing options in Cairo
GAL: Fix arc drawing

Removes DrawArcSegment, which drew arcs whose edge was optionally
stroked (a feature that we did not use).  Fixes Cairo arc drawing issue
where arcs were not visible in pcbnew.

gal: further cleanup
gal: removed unused shader parameter
2019-02-16 20:03:13 +01:00
Seth Hillbrand 813578eba6 Fix a few coverity errors 2019-02-15 20:15:04 -08:00
Seth Hillbrand bf814b25da eeschema: Update pin cache after conversion
Pin caches need to be updated when the unit is converted as the pin
location may have changed in conversion.

Fixes: lp:1816207
* https://bugs.launchpad.net/kicad/+bug/1816207
2019-02-15 18:30:45 -08:00
Seth Hillbrand 6de8997624 libedit: Connect click actions to add/edit
Connects standard add/edit actions to mouse events in the footprint
filter listbox

Fixes: lp:1816182
* https://bugs.launchpad.net/kicad/+bug/1816182
2019-02-15 16:52:28 -08:00
Seth Hillbrand c37aac56e6 libedit: Set initial pin properties when editing
This allows the invisible pins to be drawn as grey

Fixes: lp:1816178
* https://bugs.launchpad.net/kicad/+bug/1816178
2019-02-15 16:00:39 -08:00
jean-pierre charras 24185f45f2 Symbol editor: fix bug: Italic style ignored when drawing fields.
Fixes: lp:1815997
https://bugs.launchpad.net/kicad/+bug/1815997
2019-02-15 15:56:41 +01:00
jean-pierre charras e6a200b09e Pcbnew: avoid integer overflow when displaying local coordinates.
Minor cleanup in code.
2019-02-14 10:57:22 +01:00
Seth Hillbrand a246d905fb libedit: Add appropriate view menu subitems
This synchronizes the view menu options in libedit with the options in
eeschema.

Fixes: lp:1815789
* https://bugs.launchpad.net/kicad/+bug/1815789
2019-02-13 10:27:23 -08:00
Seth Hillbrand 3524bed75a libtree: Remember pane width
Stores the library pane width in settings to keep user preferences
2019-02-12 10:06:36 -08:00
Seth Hillbrand ea84020b1f eeschema: Recache bitmaps when changing
Clearing the cache removes all items from screen until the cache is
refreshed.  Instead, we wanted to re-cache the items to take into
account the bitmap changes.

Fixes: lp:1815443
* https://bugs.launchpad.net/kicad/+bug/1815443
2019-02-12 08:16:23 -08:00
jean-pierre charras 869bdc2b3c Eeschema: regression fix: re-enable hold down control+shift to disable grid snapping when moving the mouse.
Fixes: lp:1815487
https://bugs.launchpad.net/kicad/+bug/1815487
2019-02-12 13:12:06 +01:00
Seth Hillbrand 6a4d700dc8 eeschema: Show ERC buttons in all pages
This places the Delete markers/Run/Close buttons at the bottom of the
form rather that inside the panel.  Allows the user to access the
functions even when on a different panel.

Fixes: lp:1815102
* https://bugs.launchpad.net/kicad/+bug/1815102
2019-02-09 19:17:53 -08:00
Seth Hillbrand 191679676d eeschema: Export coupling constants to netlist
Patch suggested by Holger Vogt.  Exports text lines following the SPICE
K### <inductor1> <inductor2> format.

Fixes: lp:1815281
* https://bugs.launchpad.net/kicad/+bug/1815281
2019-02-09 18:58:33 -08:00
John Beard d06f0de1eb Libedit: transfer current screen settings on part load
When loading a part in libedit, also transfer certain screen
settings to the incoming SCH_SCREEN, from the current
SCH_SCREEN.

Currently, the grid settings are transferred, but this could
also do other settings if needed.

Also remove some duplicate commentary and mention why the
grid is set in a SCH_SCREEN even though the BASE_SCREEN ctor
sets the same default.

Fixes: lp:1815108
* https://bugs.launchpad.net/kicad/+bug/1815108
2019-02-08 22:56:05 +00:00
Seth Hillbrand 5da4e18664 bitmaps: Handle mask colors
Some transparent bitmaps use masking colors to show the binary
opaque/transparent.

Fixes: lp:1814893
* https://bugs.launchpad.net/kicad/+bug/1814893
2019-02-07 21:27:43 -08:00
Wayne Stambaugh 7789ec4bf1 Eeschema: fix highlight hierarchical pin name in properties dialog.
Fixes lp:1785840

https://bugs.launchpad.net/kicad/+bug/1785840
2019-02-07 13:03:38 -05:00
Wayne Stambaugh 6bb8fde48a Eeschema: fix broken modified flag handling. 2019-02-06 13:20:34 -05:00
Wayne Stambaugh 44cb979e91 Decouple SCH_EDIT_FRAME from symbol rescue and remap dialogs.
Do not keep pointer to SCH_EDIT_FRAME in the rescuer object to prevent
it from creating dialogs with itself as the parent when call from the
rescue dialog which is itself a grandchild of the frame window.
2019-02-05 12:43:46 -05:00
John Beard 0c6ec7dbb3 LIB_TABLE_BASE: Const and unsigned fixes
* Make LIB_TABLE_BASE::GetCount() return unsigned. This is more
  consistent with the behaviour of STL containers (especially the
  boost::ptr_vector this is really accessing). Sadly
  wxGridTableBase() forces an int, so a cast is still required
  at the WX interface.
* Make LIB_TABLE_BASE::At() return a reference. First, this is more
  consistent with normal STL indexing operator[]'s, and secondly, it
  allows an idiomatic const index method (so you can access const
  LIB_TABLE_ROWs from a const LIB_TABLE_BASE).

The motivation is to allow use of this class and LIB_TABLE_ROW
in a test program, where the LIB_TABLE_BASE is const.
2019-02-05 08:49:52 -08:00
John Beard e6a6266f3d Build: libpolygon provides its own includes
Libpolygon can provide its own includes via target_include_dirs PUBLIC.
This means any linking targets do not need to specifiy them manually.

As common requires polygon, the polygon dep is also now no longer
required downstream of libcommon, as it's transisitvely implied
by libcommon's target_link_libraries.

This resolves a circular dependency previously detected and also
simplifies CMakeLists.
2019-02-04 19:29:31 -08:00
John Beard bb2ae8e13b Bitmaps: move bitmap defs to bitmaps library
The bitmap definitions (BITMAP_DEF and so on) do not
have any dependencies on other libs, including WX. This
means the bitmaps library can be isolated from the other
dependencies.

Common now depends on bitmaps, and libraries that depend
on common can pick it up from the common target_link_libraries,
as it is PUBLIC. This means a lot of targets no longer
need manual bitmap linkage.

This avoids a circular dependency that was previously reported
by static analysis.

Avoiding pulling in WX and other headers into the include
tree of each bitmap .cpp is a huge speed up (around 10x) in
compilation, and the generated static library is also 10x
smaller (20MB vs 200MB)

Add common as a link library to pnsrouter,connectivity.
THese library do still use common code (including bitmaps,
via base_screen.h) and this allows them to pick up the libcommon
includes correctly.
2019-02-04 19:29:31 -08:00
Jeff Young 8ca76177c0 Prevent hiding of reference column.
Using the quantity column for the collapse/expand controls feels too odd
when you expand and everything under the parent is a '1'.

Fixes: lp:1780847
* https://bugs.launchpad.net/kicad/+bug/1780847
2019-02-03 23:38:02 +00:00
jean-pierre charras 5edf3503ca Symbol Editor: Switching from a multi unit symbol to a single unit symbol do not reset the unit selection.
Thus creating issue if the unit selection is not the first unit.

Fixes: lp:1814441
https://bugs.launchpad.net/kicad/+bug/1814441
2019-02-03 15:29:41 +01:00
Seth Hillbrand c08736e245 Assign stack pointer to lib table
When creating new lib table rows, the pointer becomes managed by the new
table through the boost::ptr_vector.  The row is non-copyable, however,
so we lose the reference as soon as it goes out of scope. Creating a
clone provides a new pointer that is moved into the table on creation.

Fixes: lp:1792456
* https://bugs.launchpad.net/kicad/+bug/1792456
2019-02-03 05:20:50 +01:00
Seth Hillbrand 5c3f6f2abf eeschema: Fix grid assignment error
Assignment of columns was offset based on the quantity column.  This
cleans the implementation as well as setting the correct width

Fixes: lp:1814380
* https://bugs.launchpad.net/kicad/+bug/1814380
2019-02-02 18:42:51 +01:00
Jeff Young a375edf9ac Perform cancel action by hand.
Fixes: lp:1814138
* https://bugs.launchpad.net/kicad/+bug/1814138
2019-01-31 19:07:07 +00:00
Tomasz Włostowski 47e28cb5be eeschema: don't clear freshly selected block in HandleBlockEnd() at the first mouse event
Fixes: lp:1813971
* https://bugs.launchpad.net/kicad/+bug/1813971
2019-01-31 02:49:58 +01:00
Jeff Young ba7b970817 Add pre-select architecture to grid helper icon-text-buttons.
Fixes: lp:1813973
* https://bugs.launchpad.net/kicad/+bug/1813973
2019-01-31 01:09:03 +00:00
Seth Hillbrand 88d9f946a2 eeschema: Don't break Eagle junctions on import
Eagle can label nets independently of the connection point position.  In
an "interestingly" designed circuit, this can lead to a junction of a
pin, wire endpoint and unrelated wire.  While this is bad practice,
KiCad shouldn't force an incorrect net connection during the import.  In
this case, we skip the addition of junctions to ensure that we don't
create a schematic error.

Fixes: lp:1788019
* https://bugs.launchpad.net/kicad/+bug/1788019
2019-01-30 17:02:24 -08:00
Seth Hillbrand b14bc1bead svg: Use grouping
Uses existing grouping in SVG output.  Sets schematic components as a
grouped element in SVG as well as pcbnew elements per layer.

Fixes: lp:1011754
* https://bugs.launchpad.net/kicad/+bug/1011754
2019-01-30 16:58:33 -08:00
John Beard 88f9f6f072 Break out ref-des-centric functions to own header
This breaks the following functions out to a general-purposed refdes utils
header:

* MODULE::GetReferencePrefix()
* kicad_string.h RefDesStringCompare()

This acheives:

* Slimming of MODULE interface
* Placement of refdes code in common rather than pcbnew
** Testing of this code in qa_common
* Tighter and smaller includes for code that only needed refdes functions

Note: there are failing tests commited (as expected failures). These
are the cause of lp:1813669 and will be fixed as a follow-up commit.
2019-01-30 15:41:36 -08:00
Jeff Young f425f49c19 Fetch active sym before launching browser so we can start with it.
Fixes: lp:1813882
* https://bugs.launchpad.net/kicad/+bug/1813882
2019-01-30 21:50:35 +00:00
Jeff Young ca0164aa07 Unify library browser terminology.
Fixes: lp:1813882
* https://bugs.launchpad.net/kicad/+bug/1813882
2019-01-30 19:52:15 +00:00
Jeff Young 626dc7d9cf Load currently selected alias when browsing.
Fixes: lp:1813882
* https://bugs.launchpad.net/kicad/+bug/1813882
2019-01-30 19:43:52 +00:00
Jeff Young 19c9ae7ecb Use updated value when checking for empty.
Fixes: lp:1813640
* https://bugs.launchpad.net/kicad/+bug/1813640
2019-01-30 16:29:21 +00:00
Seth Hillbrand 872f0eb44c eeschema: Set grid editor to use qty as the drop-down
Symbol fields uses a custom expander control.  This should be tied to a
column that cannot be hidden in order to ensure the ability to view sub
elements remains intact, like the standard control.

Fixes: lp:1780847
* https://bugs.launchpad.net/kicad/+bug/1780847
2019-01-29 17:10:58 -08:00
John Beard 016a544606 Eeschema: fix grammar for text for ERCE_PIN_NOT_DRIVEN
Reported by Kevin Cozens on the mailing list.
2019-01-29 18:09:11 -05:00
Seth Hillbrand 4901481e12 eeschema: Rotate bus wire entry components
These components were rotatable as a block but not individually.

Fixes: lp:1809448
* https://bugs.launchpad.net/kicad/+bug/1809448
2019-01-28 09:55:56 -08:00
Seth Hillbrand e2b3a1118d Eeschema: Filled labels
Fill label bg for clearer schematic view
2019-01-28 08:58:10 -08:00
Tomasz Włostowski 6afb082a08 eeschema: fix disappearing graphics when block move is aborted after rotation/flipping
Fixes: lp:1809444
* https://bugs.launchpad.net/kicad/+bug/1809444
2019-01-28 14:46:21 +01:00
Tomasz Włostowski ef2af9145e eeschema: implement left click emulation with Enter/Return key in library editor
Fixes: lp:1788075
* https://bugs.launchpad.net/kicad/+bug/1788075
2019-01-28 14:17:59 +01:00
Wayne Stambaugh a55d9819bc Do not use project path when searching for default library tables.
When no default library tables are found, set the default wxFilePickerCtrl
to the users configuration path instead of the current project path to
prevent any project library tables from being used as the default.

Fixes lp:1809769

https://bugs.launchpad.net/kicad/+bug/1809769
2019-01-26 16:19:02 -05:00
jean-pierre charras b8cfabd22e Fix some issues in I10n strings
Fix typo and missing I10n identifier for 2 strings
2019-01-26 09:25:12 +01:00
Seth Hillbrand 8d777dd5c3 eeschema: Take stroke thickness into account
Spacing text for plotters uses the thickness of text for two separate
classes.  This sets the thickness in the EDA_TEXT class as well to allow
the multiple line positions to be correctly set

Fixes: lp:1799605
* https://bugs.launchpad.net/kicad/+bug/1799605
2019-01-25 14:22:19 -08:00
jean-pierre charras 4cd41e3941 Eeschema: avoid using a incorrect background color the first time a SCH_DRAW_PANEL is displayed
When starting Eeschema, or a frame/dialog using a SCH_DRAW_PANEL, the bg color was initialized too late,
thus creating a flicker or an annoying draw artifact (in SYMBOL_PREVIEW_WIDGET for instance) if a Paint event
is fired before the right bg color is initialized.
Initializing the bg color earlier fix this issue.

Fixes: lp:1797203
https://bugs.launchpad.net/kicad/+bug/1797203
2019-01-25 20:32:46 +01:00
jean-pierre charras 70c2380fc2 Minor fixes in code: remove dead code. 2019-01-24 18:23:57 +01:00
jean-pierre charras 56879a964b Fix cross-probing issue when a net or pin name contains a space.
Fixes: lp:1812902
https://bugs.launchpad.net/kicad/+bug/1812902
2019-01-23 11:30:10 +01:00
Wayne Stambaugh 2dcba4723d Lay groundwork for loading the initial global footprint library table.
Factor out common dialog code from global symbol library table dialog for
loading initial library table.

Update global symbol library table code to user factored out common dialog
code.
2019-01-20 13:09:49 -05:00
Baranovskiy Konstantin 62bf4614ad Component fields grid: copy/paste boolean values.
NEW: Add ability to copy/paste from/to cells with boolean values
(checkboxes) in grid control of component properties dialog of Eeschema.
2019-01-19 14:54:43 -05:00
Baranovskiy Konstantin 8400ee41c0 Grid tricks: cell selection fixes.
CHANGED: First click sets a cursor to the specified cell, second click
activates editor (current realization, where first click activates cell
editor, is very buggy especially with cells selection).

Set cursor on cell of reference on mouse left click in Fields editor of
Eeschema.
2019-01-19 14:54:37 -05:00
Baranovskiy Konstantin 4ea08d477d Clear comp highlighting before highlight new one.
On clicking a reference cell in the field editor of Eeschema a
corresponding component is highlighted in Eeschema. But previously
highlighted components are staying highlighted.

With current patch all highlightings are cleared before highlighting
selected component.
2019-01-19 14:54:29 -05:00
Seth Hillbrand c3a295df1a Fix segfaults from not checking index
Return value of wxArrayString.Index() always needs to be check for
existence.
2019-01-17 10:23:25 -08:00
jean-pierre charras 7f6801bc27 Eeschema: block rotate and block mirror: fix missing screen refresh.
Remove also outdated comments.
2019-01-17 15:25:47 +01:00
Tomasz Włostowski 786ee0ec69 eeschema: fix assertion fail when aborting a paste block operation after the pasted block has been rotated
Fixes: lp:1812073
* https://bugs.launchpad.net/kicad/+bug/1812073
2019-01-17 00:46:59 +01:00
joel-bertrand-JKB 2d5752f51d Fix duplicate directives in Spice netlist inside .control ... .endc
Fixes: lp:1812082
https://bugs.launchpad.net/kicad/+bug/1812082
2019-01-16 19:54:03 +01:00
Seth Hillbrand 72c885797e Eeschema: prevent schematic images with bad scales
Prevent obvious scale issues (0.0, nan, etc) from corrupting display of
schematic images.  In these cases, we reset the scale value to 1.0 and
allow the user to input the appropriate value when editing the
schematic.

Fixes: lp:1811066
* https://bugs.launchpad.net/kicad/+bug/1811066
2019-01-15 07:42:22 -08:00
jean-pierre charras e7fa02a9f0 DIALOG_BOM: fix a few issues. Mainly an annoying issue when a plugin file was not found
Previously, all the dialog setup was lost.
2019-01-14 13:14:13 +01:00
Seth Hillbrand a0a4e5e18d libedit: Small edit component cleanup
Initialize local variables and ensure that the SPICE edit button is not
shown in compiles that do not support it.
2019-01-12 06:58:40 -08:00
Seth Hillbrand 634d02bd04 libedit: Check proper field grid type
Fixes segfault where pointers are not zeroed

Fixes: lp:1811519
* https://bugs.launchpad.net/kicad/+bug/1811519
2019-01-12 06:51:09 -08:00
Seth Hillbrand 353bda6792 eeschema: Add directly connected items to block
Allow components to connect to both components and junctions

Fixes: lp:1798968
* https://bugs.launchpad.net/kicad/+bug/1798968
2019-01-10 17:28:29 -08:00
Jeff Young 81a0ab4d7e Don't return wxID_OK from a cancel.
Also fixes the Save icon not getting enabled/disabled.

Fixes: lp:1810116
* https://bugs.launchpad.net/kicad/+bug/1810116
2019-01-10 17:41:33 +00:00
Jeff Young 15af0cc43d Don't inherit previously-selected alias properties when deleting.
Fixes: lp:1810768
* https://bugs.launchpad.net/kicad/+bug/1810768
2019-01-10 17:41:33 +00:00