Commit Graph

86 Commits

Author SHA1 Message Date
Jeff Young eacaa39aa2 Remove global units usage from GetSelectionText...
... and GetMsgPanelInfo.

Step 4 in the g_UserUnit eradication effort.

Also removes a couple of conversion routines that were close
enough to extinction.

(cherry picked from commit c75da51)
2018-07-17 15:11:09 +01:00
Seth Hillbrand a061fe1f99 Eeschema: Adding connection block selections
This adjusts the selection addition criteria for
blocks to allow items such as labels to connect to
lines not at the endpoints.  It also uses the same
logic to correctly gather bus-wire, bus-bus entries.

Fixes: lp:1738941
* https://bugs.launchpad.net/kicad/+bug/1738941
2017-12-20 10:04:25 -05:00
Maciej Suminski 422b7dd551 Removed declaration of non-existent method (SCH_SHEET::Load()) 2017-11-20 09:16:13 +01:00
Wayne Stambaugh a0473614b5 Remove all schematic object load and save code.
All of the schematic object load and save code is implemented in the
legacy schematic plugin so it is no longer required.

Remove unused file with old schematic file loader.

Doxygen comment cleaning.
2017-11-18 08:53:13 -05:00
Wayne Stambaugh e176fc181d Fix schematic sheet resizing bug.
Calculate the proper minimum height when resizing sheets to prevent resized
sheet height from always increasing.

Prevent the sheet pins from being drawn in the corners of the sheet when
updating the edge constraints on resize.  This ensures that the sheet pin
is always drawn within the bounds of the sheet.  Please note that this fix
may not be 100% accurate as is assumes the default grid size of 50 mils.
This may not be what the user expected but it guarantees that wires will
connect to the pin properly.

Fixes lp:1699796

https://bugs.launchpad.net/kicad/+bug/1699796
2017-08-23 13:19:31 -04:00
Maciej Suminski 0dc88bb4cf Changed COLOR4D defines to static consts 2017-02-22 17:35:00 +01:00
Jon Evans a52250a91e Change from EDA_COLOR_T to COLOR4D globally; arbitrary color support
eeschema now supports arbitrary colors for all object types, and
pcbnew does in GAL canvas.  When switching from GAL to legacy canvas,
pcbnew will convert colors to the nearest legacy color.
2017-02-22 17:35:00 +01:00
John Beard a8eea6155a Move bitmaps.h out of base_struct.h
bitmaps.h was included in nearly every file in the project due to it
being included by base_struct.h

Only about 130 files actually use the XPM definitions defined there, and
many of those already included bitmaps.h themselves, or via
menu_helpers.h. However, touching bitmaps.h would result in over 400
rebuilt files for pcbnew alone.

This commit moves the bitmap-related types like BITMAT_DEF out to a new
header, which is still included by base_struct.h, which is less
avoidable for now, it's it's used in the interface.

The icon list is still in bitmaps.h. This has the side effect that's
it's now easier to automatically generate this file.

Many classes in pcbnew and eeschema needed some functions moved
to the implementaitons from the headers too.
2017-02-21 09:50:15 -05:00
Dick Hollenbeck 0c459ced97 EDA_TEXT object refactor.
Make all EDA_TEXT data private and rename accessors to avoid function
name collisions in derived classes.

Overload EDA_TEXT's SetTextAngle() and SetEffects() in TEXTE_PCB.

Add support for preserving Reference text position, size, orientation
during a netlist import into a BOARD, as well as the one off footprint
update dialog.
2017-01-25 08:03:32 -05:00
Simon Richter ad088db6d2 Add more "override" markers. 2016-09-25 13:59:41 -04:00
Simon Richter 59c81976dc Explicitly mark overriding functions. 2016-09-24 14:53:15 -04:00
Dick Hollenbeck c2b8a4ee43 Move from class INSPECTOR as the EDA_ITEM::Visit() callback interface to a std::function
callback.  This improves conciseness and encourages use of Visit() due to the lower cost
of entry in C++.
2016-07-12 15:05:54 -04:00
Wayne Stambaugh 4ed346ea64 Eeschema: initial schematic I/O plugin.
* Factor out PROPERTIES object from the PCB plugin code and move it into
  common so it can be used by both the Pcbnew and Eeschema plugins.

* Add schematic I/O plugin manager for loading and saving schematic and
  component library files.

* Add initial attempt at a parser for current schematic file format.  This
  parser will be infinitely more strict than the current parser which is very
  forgiving in what it parses.

* Make minor changes to the base bitmap class to support the new parser.

* Add find root sheet support to sheet object to allow fetching the root
  sheet from any sheet in the stack.
2016-07-06 05:22:56 -04:00
Simon Richter 1b2fd6a382 Replace BOOST_FOREACH with C++11 range based for. 2016-06-29 16:07:55 -04:00
Dick Hollenbeck e47f0df068 Cleanups
* coding standard fixes
* library part not library component (no such thing as a library component)
* string concatenation fix
* and an inline harmless debug/dump function
2016-06-24 12:55:54 +02:00
Wayne Stambaugh b7e56ae1cb Eeschema: SCH_SHEET_PATH refactor.
* Derive SCH_SHEET_PATH from std::vector< SCH_SHEET* > and remove unnecessary
  assignment operator and list management functions.
* Remove function BuildSheetPathInfoFromSheetPathValue() since it was
  effectively an assignment operation.
* Replace all calls to BuildSheetPathInfoFromSheetPathValue() with assignment
  operator.
* Replace list management functions with vector management functions.
* Fix a error message that wasn't translatable.
2016-02-27 14:35:45 -05:00
Wayne Stambaugh 97949ffde9 Undo commit -r 6353. 2016-02-15 15:24:59 -05:00
Wayne Stambaugh 03bf559465 Undo commit -r 6368. 2016-02-15 15:22:45 -05:00
Wayne Stambaugh af2e19d7d9 Undo commit -r 6380. 2016-02-15 15:21:18 -05:00
Wayne Stambaugh 3d963166c7 Undo commit -r 6389. 2016-02-15 15:19:22 -05:00
Wayne Stambaugh 73dc53dc35 Undo commit -r 6413. 2016-02-15 15:18:32 -05:00
Wayne Stambaugh 4007317606 Undo commit -r 6428. 2016-02-15 15:17:51 -05:00
Wayne Stambaugh 1866b61a56 Undo commit -r 6457. 2016-02-15 15:16:54 -05:00
Wayne Stambaugh 27b587025d Undo commit -r 6506. 2016-02-15 15:14:48 -05:00
Wayne Stambaugh 5a5fffb349 Undo commit -r6509. 2016-02-15 15:14:07 -05:00
Wayne Stambaugh 7b5823185a Undo commit -r 6535. 2016-02-15 15:12:42 -05:00
Wayne Stambaugh 9eda45a97e Undo commit -r 6539 2016-02-15 15:11:50 -05:00
Wayne Stambaugh ee23342e31 Undo commit -r6541. 2016-02-15 15:10:57 -05:00
Wayne Stambaugh 61454bf04c Eeschema: fix annotation bugs. (fixes lp:1542579)
* Ensure proper SCH_SHEET object page numbering which caused annotation to
  calculate incorrect reference designators when annotating by using page offsets.
* Added SetPageNumbers to SCH_SHEET for setting sheet page numbers after
  schematic is loaded.
2016-02-07 09:01:28 -05:00
Wayne Stambaugh cb13e57973 Eeschema: move find sheet by name from SCH_SHEET_PATH to SCH_SHEET.
* Move FindSheetByName() function from SCH_SHEEET_PATH to SCH_SHEET object
  and update calls to FindSheetByName() accordingly.
* Remove SCH_SHEET_PATH::FindSheet() which was unused.
* Add sorting option to SCH_SHEET::GetSheets().
2016-02-05 08:33:28 -05:00
Wayne Stambaugh 0ef1eee2c6 Eeschema: move recursion check from SCH_SHEET_PATH to SCH_SHEET.
* Add const and non-const version of GetRootSheet() to SCH_SHEET.
* Add GetSheetPaths() function to SCH_SHEET which behaves the same way
  as SCH_SHEET_LIST except it uses standard C++ containers and is a much
  simpler design.
2016-02-02 19:45:43 -05:00
Wayne Stambaugh 2aac71700b Eeschema: move is complex hierarchy and find next item from SCH_SHEET_PATH to SCH_SHEET.
* Add function to get a list pointers to this sheet and all of it's  sub-sheets
  to SCH_SHEET.
* Remove unused function SetFootprintField() from SCH_SHEET_PATH.
2016-01-24 15:46:14 -05:00
Wayne Stambaugh ac30be332f Eeschema: move get multi-unit components from SCH_SHEET_PATH to SCH_SHEET. 2016-01-21 19:01:34 -05:00
Wayne Stambaugh cdba425bad Eeschema: move get components from SCH_SHEET_PATH to SCH_SHEET.
* Add sheet number that is set by schematic file load order.  This duplicates
  the previous SCH_SHEET_PATH behavior.
* Uncouple SCH_REFERENCE and SCH_REFERENCE_LIST from SCH_SHEET_PATH.
* Add - operator to SCH_SHEET for comparison purposes.  This duplicates the
  behavior of SCH_SHEET_PATH::Cmp().
2016-01-12 21:31:34 -05:00
Wayne Stambaugh e8e0a75b8c Eeschema: move update all screen references from SCH_SHEET_PATH to SCH_SHEET.
* Uncouple SCH_COMPONENT::GetRef() from  SCH_SHEET_PATH and use SCH_SHEET
  instead.
* Uncouple SCH_COMPONENT::GetUnitSelection() from  SCH_SHEET_PATH and use
  SCH_SHEET instead.
* Fix all calls to GetRef() and GetUnitSelection() to pass a pointer to the
  appropriate SCH_SHEET object instead of an SCH_SHEET_PATH object.
2016-01-06 19:07:30 -05:00
Wayne Stambaugh 133b8f6b96 Eeschema: move annotate power symbols from SCH_SHEET_PATH to SCH_SHEET.
1
* Uncouple SCH_COMPONENT::SetRef() from  SCH_SHEET_PATH and use SCH_SHEET  instead.
2016-01-03 08:58:27 -05:00
Wayne Stambaugh 81e6af6c81 Eeschema: move auto-save test from SCH_SHEET_PATH to SCH_SHEET. 2015-12-20 15:58:18 -05:00
Wayne Stambaugh 1bd860d1aa Eeschema: move modification state code from SCH_SHEET_LIST to SCH_SHEET. 2015-12-16 19:27:53 -05:00
Wayne Stambaugh c6d591b534 Eeschema: uncouple clearing annotation from SCH_SHEET_PATH.
* Add code to SCH_SHEET object to clear annotation.
* Change SCH_COMPONENT::GetPath() to derive path from SCH_SHEET object instead
  of SCH_SHEET_PATH object.
* Remove clear annotation code from SCH_SCREENS object.
2015-12-12 12:06:24 -05:00
Wayne Stambaugh 2667109c44 Eeschema: SCH_SHEET improvements for Eeschema refactor.
* Make SCH_SHEET parent the SCH_SHEET object that loaded it.  This preserves
  the hierarchy when the schematic is loaded.
* Add function to SCH_SHEET to find the root sheet from any sheet in the
  hierarchy.
* Add functions to SCH_SHEET to create the path and human readable paths for
  any sheet without relying on the external SCH_SHEET_PATH object.
* Remove function LocatePathOfScreen from SCH_SHEET since it was not used
  anywhere.
* Add human readable path to message panel information for SCH_SHEET.
* Set the name of the root sheet to "root" instead of the default generated
  when a new SCH_SHEET is created.
* Set the empty sheet name and file name to "root" and "noname.sch" when
  Eeschema is opened with no schematic.
* When no item is at the current position on a left mouse click, show the
  current sheet information in the message panel.
* Add less than operator for sorting SCH_SHEET objects by path length and
  time stamps when the path lengths are the same.
2015-12-07 19:37:11 -05:00
jean-pierre charras 9b9c7945a2 Many minor fixes (like bug #1477213). Better help in dialog environment variables editor (the tooltip was never shown on Windows) 2015-07-24 12:23:34 +02:00
jean-pierre charras 7be1d32a10 Fix minor issues (included Bug #1469358 hierarchical sheet pin not redrawn after edition) 2015-06-27 11:12:32 +02:00
jean-pierre charras 00f8994ee1 Eeschema: Fix a (minor but annoying) bug detected by coverity which prevent Eeschema to draw components in "fast mode" (i;e. without pin texts) when they are moved, due to a draw parameter which was incorrectly used.
Move items rework: enhancements: for some items (sheets, components, bus entries) the mouse cursor is no more wrapped to the anchor. For large symbols, this is better: they are more easy to place.
There is also a change when starting a move item command: the full screen is redraw, and therefore there is no artifact due to the XOR draw mode.
Some other minor coverity fixes (uninitialized members).
2015-02-28 17:56:09 +01:00
Povilas Kanapickas 7f12513c7e Remove some uses of using namespace std. 2013-12-13 10:27:30 -06:00
jean-pierre charras 5f01f123de All: GetBoundingBox returns now a const EDA_RECT.
Pcbnew: Code cleaning and bug fix in autoplace functions
Dialog exchange footprints has now a separate button to update the .cmp file, only on request.
2013-11-24 18:48:14 +01:00
jean-pierre charras daeeee5617 Eeschema: Rework on netlist generator: code clenenig and enhancement.
Fix an annoying issue about not named nets:
now, these nets are named from the component references and pin names which are connected.
therefore, unless the net or the footprint references are modified, the net name is not modified between 2 netlist calculations.
2013-09-25 21:09:57 +02:00
Wayne Stambaugh f8a56d446f Base object decoupling improvements.
* Improve MSG_PANEL_ITEM to handle message panel information.
* Create containers for passing message panel items between objects and
  the message panel.
* Rename EDA_ITEM::DisplayInfo to EDA_ITEM::GetMsgPanelInfo.
* Remove all direct manipulation of EDA_DRAW_FRAME from all objects derived
  from EDA_ITEM.
2013-01-12 12:32:24 -05:00
jean-pierre charras 621a43c4ad Eeschema: always stores sheet filename in unix-like notation, and fix a bug when editing sheet file name.
Pcbnew: add PDF format  for drill map generation.
Plotter classes: tweaking code.
2012-10-13 20:54:33 +02:00
Lorenzo Marcantonio e771112259 Enforced EDA_COLOR_T type and minor const-ification 2012-09-02 14:06:47 +02:00
Lorenzo Marcantonio 082d901d60 Encapsulated drawmode as an enum for type checking 2012-09-01 15:38:27 +02:00