Commit Graph

121 Commits

Author SHA1 Message Date
Lorenzo Marcantonio 0e903dba5b Angle and distances cleanup (preparing for angles in doubles)
- Removed spurious int casts (these are truncated anyway and will break
  doubles)

- Applied the Distance, GetLineLength, EuclideanNorm, DEG2RAD, RAD2DEG
  ArcTangente and NORMALIZE* functions where possible

- ArcTangente now returns double and handles the 0,0 case like atan2, so
  it's no longer necessary to check for it before calling

- Small functions in trigo moved as inline
2013-05-01 19:32:36 +02:00
Lorenzo Marcantonio b525e3be55 Factored out text anchor drawing
More layer classification cleanup
2013-04-09 18:00:46 +02:00
Lorenzo Marcantonio 9fd79dfa91 Implemented the LAYER_NUM typedef (LAYER was already taken as a class name...) to represent a layer number. 2013-03-31 15:27:46 +02:00
jean-pierre charras 7a5386a1a1 Minor fixes and cleanup 2013-02-26 12:25:30 +01:00
jean-pierre charras 4343eb5b8d Fix Bug #1132416. Minor update in templates. 2013-02-24 18:31:18 +01: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 93ebdb2cd0 All: better code to handle opened frames libview, libedit, modview, modedit.
Other minor fixes.
2012-09-12 11:53:11 +02:00
jean-pierre charras b810135e4e Code cleaning, minor fixes and minor coding style fixes. wxWidgets 2.9.4 compatibility fix( deprecated function MakeModal ) 2012-09-11 21:03:21 +02:00
jean-pierre charras 7f07b48e88 Pcbnew: Update incorrect or incomplete copyrights in many files.
Minor code cleaning in autoroute files.
2012-06-08 11:56:42 +02:00
Marco Mattila fd8bfe0cb1 Move pcbnew find dialog into dialogs subdirectory and use wxFormBuilder for it. 2012-05-28 23:01:51 +03:00
Dick Hollenbeck fb9e1ea010 Make drawframe.cpp's StatusBar use field widths which are dynamically determined
base on expected text and current window font.

Expand the virtual world to 2.14 meters in the nanometer build of PCBNEW.
This seems to be holding up for now.
2012-05-06 18:32:01 -05:00
Dick Hollenbeck 86e04b4fb3 more nanometer work, see comment at line 66 of pcbnew/classpcb.cpp 2012-05-06 15:10:43 -05:00
jean-pierre charras 4125ea7789 Gerbview: remove dependencies from Pcbnew.
Should allow Pcbnew code easier to change and Gerbview code more understandable and easier to maintain.
Code cleaning (remove dead code, add comments).
Minor other enhancements.
2012-05-04 19:44:42 +02:00
Dick Hollenbeck 33616f3051 * Add DRECT, DPOINT, and DSIZE (double rect, point, and size) using Torsten's vector2d.h
as a starting point
* Make double Distance() take double arguments and remove internal range checking.
* Start on EDA_DRAW_FRAME::AdjustScrollBars() and use "double" for most all calculations
  in anticipation of setting INT_MAX INT_MIN limits eventually.
2012-04-23 16:56:26 -05:00
Wayne Stambaugh bf5802f1f7 Removal of internal units.
* Remove internal units from BASE_SCREEN and it's derivatives.
* Remove internal units from EDA_DRAW_FRAME and it's derivatives.
* Use build time code to replace internal units conversions.
* Fix scaling bug in page layout sample window that I created in my
  last commit.
2012-04-16 19:31:29 -04:00
Wayne Stambaugh 57d75a75a8 More internal unit improvements.
* Move all convert from internal to user units functions into separate file.
* Remove internal units parameter from all moved conversion functions.
* Revise all source code that calls the moved conversion functions.
* Compile these conversion routines separately for the appropriate pcb or
  schematic internal units.
* Move internal units specific status bar update code into the appropriate
  application for updating the status bar.
* Move millimeter user units rounding function to common.cpp.
2012-04-13 14:51:24 -04:00
Dick Hollenbeck f8490ff4af Remove g_PcbPlotOptions, use wxformbuilder to subclass DIALOG_SHIM on several dialogs 2012-04-05 13:27:56 -05:00
jean-pierre charras fa470d5c4a Pcbnew: Added: modview. This footprint viewer frame which has the same purpose as Viewlib in Eeschema.
this viewer is built using the new  FOOTPRINT_VIEWER_FRAME class.
2012-02-09 21:33:38 +01:00
Dick Hollenbeck 6c04e60587 see CHANGELOG.txt 2012-02-05 23:44:19 -06:00
Dick Hollenbeck 716d21d88a get rid of some globals, share BOARD_DESIGN_SETTINGS from PCB_EDIT_FRAME with FOOTPRINT_EDIT_FRAME 2012-02-02 11:45:37 -06:00
Dick Hollenbeck b8a0ab4c52 switch to <> for includes from "" per conversation with Jean-Pierre and Wayne, adjust search paths 2012-01-22 22:33:36 -06:00
jean-pierre charras 1c98200721 Pcbnew: fix issue when KICAD_NANOMETER is defined: when zones use htcth to show zones areas, hatch lines were incorrectly calculated (hunded of thousand lines created)
Eeschema: fix issue in search: search not made in reference strings.
Minor fixes, code cleaning and comment enhancements.
2012-01-10 21:12:46 +01:00
Dick Hollenbeck 0cad6e7913 carve out TITLE_BLOCK class from BASE_SCREEN, add hashtables.h for PROPERTIES 2012-01-09 02:35:06 -06:00
Dick Hollenbeck dd091fc6b9 merge in mainline into KICAD_PLUGIN work, which is for the PCBNEW nanometer support 2012-01-05 10:30:58 -06:00
Dick Hollenbeck 1393eb0f11 finish up SCH_SHEET::{Set,Get}PageSettings() switch over 2012-01-05 02:07:11 -06:00
Wayne Stambaugh b774d96fb0 Minor coding policy and code readability improvements. 2012-01-03 12:14:17 -05:00
Dick Hollenbeck 697f912307 moving objects into BOARD which are saved in a *.brd file, for PLUGIN access 2011-12-30 23:44:00 -06:00
Wayne Stambaugh 8985a1807b Encapsulation and other minor improvements.
* EDA_DRAW_PANEL completely encapsulated.
* Moved OSX m_overlay member from EDA_DRAW_PANEL to EDA_DRAW_FRAME where
  it is used.
* Doxygen comment warning fixes.
2011-12-29 15:11:42 -05:00
Dick Hollenbeck 929d5c7a3f merge in testing 2011-12-22 16:12:21 -06:00
Dick Hollenbeck 0d4598656b rename Ki_PageDescr to PAGE_INFO, encapsulate it in accessors, and move it into the BOARD 2011-12-22 15:57:50 -06:00
Wayne Stambaugh c2e5fcaec8 More encapsulation improvements.
* EDA_DRAW_FRAME completely encapsulated.
* Encapsulate the the low hanging fruit in EDA_DRAW_PANEL.
2011-12-22 08:28:11 -05:00
Wayne Stambaugh 0e27f45ffd Encapsulate EDA_APP class. 2011-12-16 15:12:49 -05:00
Wayne Stambaugh fac288cffa More encapsulation work and other minor improvements.
* EDA_DRAW_FRAME completely encapsulated except for DrawFrame member.
* Moved members specific to Pcbnew from EDA_DRAW_FRAME to PCB_BASE_FRAME
  or PCB_EDIT_FRAME as appropriate.
* Replace EDA_TOOLBAR with wxAuiToolBar as EDA_TOOL bar provided no
  additional functionality and made code less readable.
* Remove EDA_TOOLBAR class definition from wxstruct.h and delete file
  wineda_toolbar.cpp.
* Rename tool bar members to something more descriptive since the
  horizontal and vertical references wont mean anything once the
  tool bars are movable.
* Lots of dead code removal.
2011-12-16 08:32:23 -05:00
Guillaume Simard cc70c1a463 fix 2011-12-14 16:35:03 -06:00
Wayne Stambaugh 95891006cd More EDA_DRAW_FRAME encapsulation work. 2011-12-14 15:03:15 -05:00
Dick Hollenbeck b26580d5df ++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
    having a BOARD being edited by more than one editor, it was a bad design.
    And this meant removing m_PcbFrame from BOARD.
  * removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
  * Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
  * added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
  * a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
    such as dialog_mask_clearance, dialog_drc, etc.
  * Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
    with build_version.h's #define BOARD_FILE_VERSION, although there may be a
    better place for this constant.
  * Made the public functions in PARAM_CFG_ARRAY be type const.
    void SaveParam(..) const and void ReadParam(..) const
  * PARAM_CFG_BASE now has virtual destructor since we have various way of
    destroying the derived class and boost::ptr_vector must be told about this.
  * Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
    an automatic PARAM_CFG_ARRAY which is on the stack.\
  * PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
    since it has to access the current BOARD and the BOARD can change.
    Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
  * Made the m_BoundingBox member private, this was a brutally hard task,
    and indicative of the lack of commitment to accessors and object oriented
    design on the part of KiCad developers.  We must do better.
    Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
  * Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 00:15:33 -06:00
Wayne Stambaugh 393e020442 Fix cursor warping out of client when zooming bug.
* Modify algorithm to correctly calculate the virtual drawing size and
  offset required to place the drawing correctly under all conditions.
* Ignore default wxWidgets scroll keys on Windows in EDA_DRAW_PANEL key
  event handler.
2011-11-07 14:04:24 -05:00
Wayne Stambaugh 121b65bfb8 More auto save improvements.
* Factor test for auto save file into base frame class.
* Added auto save feature to Eeschema for saving schematics, addresses
  launchpad question 173631.
* Add auto save interval control to Eeschema options dialog.
* Fix problem with subsequent auto saves in last commit.
2011-10-15 09:25:57 -04:00
Wayne Stambaugh edd35b4e90 PCB common library header rationalization.
* All header files used to create the PCB common library now compile as
  stand alone code.  This prevents the need to define them in a specific
  order to make source code compile properly.  It should also now be
  possible to relocate the source code to build the common PCB library
  to a separate folder.
2011-09-23 09:57:12 -04:00
Wayne Stambaugh cb78c9452b Undo changes from my last commit that caused a trace drag bug. 2011-09-14 11:08:44 -04:00
Wayne Stambaugh efc93aa52b PCBNew locate code refactoring.
* Move various locate functions into the appropriate board item object.
* Unified best zoom for all frames derived from PCB_BASE_FRAME.
* Remove track.cpp as it is no longer needed.
* Dead code removal.
* Remove scary frame window pointer member from board item objects.
* Add draw bounding box to gerber draw item for debugging purposes.
2011-09-13 09:29:43 -04:00
Roman Bashkov c5e1c249bb pcbnew:
* Add hotkey fast switch to two grids: for place and trace
	Alt+"1" - switch grid for place module
	Alt+"2" - switch grid for trace
  This two grid set in dialog - menu Preferences->Dimensions->Grid.
* Add hotkey switch grid:
	"`" - switch to next grid
	Ctrl+"`" - switch to previous grid
* Add hotkey switch track width:
	"W" - switch to next track width
	Ctrl+"W" - switch to previous track width
cmakemodules:
* Add GOST to KICAD_BUILD_VERSION if define KICAD_GOST.
2011-09-09 15:02:03 +04:00
Wayne Stambaugh 0c44335795 Lots and lots of PCBNew code cleaning and fix build bug introduced in r3108.
* Changed <wx-2.8/xml/xml.h> to "xnode.h" in pcbnew_config.cpp to fix bug
  when building against wxWidgets 2.9 and above.
* Convert broken wxXmlNode code to use XNODE.
* Overloaded XNODE constructor for creating child nodes.
* Translate French naming conventions.
* Translate French comments.
* Remove tabs from several source files.
* Coding style policy and Doxygen comment fixes.
2011-09-07 15:41:04 -04:00
Wayne Stambaugh 750f84c19a Coding style policy fixes and dead code removal. 2011-09-06 15:42:46 -04:00
Wayne Stambaugh ebc7259a91 Rename WinEDA_App class to EDA_APP and remove redundant includes. 2011-09-06 10:09:40 -04:00
jean-pierre charras f00696e835 Pcbnew: fix bug 804780.
All: use double instead of int to store zoom values.
2011-07-05 14:46:14 +02:00
jean-pierre charras 16e9ddc27a * Gerbview, Pcbnew: add SetLocaleTo_Default() after reading double in config to fix issues with decimal separator (when the separator is not a point).
(WxWidgets 2.9.1 seems call setlocale( LC_NUMERIC, "" ) when wxConfig read doubles stored in config, but forget to back to current locale.)
Note: perhaps there are some dialogs that need this call to  SetLocaleTo_Default() ).
* Minor  code cleanup in pcbnew/netlist.cpp
2011-04-02 18:14:07 +02:00
Wayne Stambaugh 283cfa67ff Set default button on all dialogs. Fixes lp:665703
* Set default button on all dialogs that do not already have a defined
  default button.  The only exception is the EESchema net list dialog
  which needs converted over to wxFormBuilder and due to it's design makes
  setting the default button in any tab other than the default tab
  problematic.
* Fix escape key dialog handling bug in EESchema print post script
  dialog.
2011-03-14 11:17:18 -04:00
Wayne Stambaugh 1010601a78 PCBNew control update bug fixes, fixes lp:725963.
* Fix grid select box update bug on context menu.
* Fix via size and track width select box update bugs.
* Fix layer pair indicator button update bug.
* Fix auto track width tool bar control enable bug.
* Fix via size and track width select status bug in context menu.
* Fix layer select box and layer control widget select bug when current
  layer is removed.
* Add virtual function to notify objects derived from EDA_DRAW_FRAME that
  the units setting has changed.
* Coding policy class naming fixes.
2011-03-01 14:26:17 -05:00
Marco Mattila 97003fefae Change board bounding box calculation to include all board items by default in pcbnew. Add a parameter to look for board edges only. 2011-02-25 18:23:24 +02:00