Commit Graph

1256 Commits

Author SHA1 Message Date
Dick Hollenbeck 2aa27122b0 Eliminate many assumptions in Pcbnew's library manager, pertaining to locality of libraries and
their type, by using the more abstract PLUGIN::Footprint*() functions.

This is an intermediate phase only, other changes will be necessary as library table support comes in.
Encapsulate usage of library path searching, since that will go away as library table support comes in.
Add FOOTPRINT_EDIT_FRAME::{get,set}LibPath() and FOOTPRINT_EDIT_FRAME::{get,set}LibNickName() functions
to provide this encapsulation.
2012-11-19 10:19:38 -06:00
Dick Hollenbeck a93637b14f remove -std=c++0x compiler option since nobody is ready for it, and accordingly back into auto_ptr from unique_ptr 2012-11-15 10:04:10 -06:00
Dick Hollenbeck 9bbff22d96 1) Switch to boost hashtable support from wx macros which did not handle std::string.
This required the additional compiler command line option "-std=c++0x".

2) Switch to unique_ptr from auto_ptr which is C++ deprecated.

3) Change to new English layer names per mailing list discussion, see class_board.cpp.

4) When saving to *.kicad_pcb or *.kicad_mod, identify opportunities to use wildcard
   layer sets, for pads so far.

5) Switch to two std::string hashtables in pcb_parser.cpp, away from one wxString based one
   for layer names and layer sets mapping. One hashtable holds the mask, the other the index.
   Layer sets are only in the mask table.

6) Move "LOCALE_IO toggle" into PCB_IO::Format() since it is a public API function and
   caller should find it as convenient as possible to use.  LOCALE_IO should handle
   nesting OK in the case where public Format() is called from one of the Footprint*()
   functions.

7) Drop support for "export module to new library".  Creating new libraries will have to
   be handled in concert with library table entries, and we've talked recently about
   creating a better footprint library manager, one that resides in a DLL/DSO.  So
   this kind of functionality needs to be handled in there in the near future.

8) Change name of exported PCB_IO module/footprint to *.kicad_mod and not *.emp.
2012-11-14 01:15:59 -06:00
Dick Hollenbeck 4612ef9d50 switch to new s-expression format for footprint exports, use english layernames for naked footprints, dodge conflict with pythons HAVE_GETC_UNLOCKED 2012-11-10 00:39:18 -06:00
Dick Hollenbeck 272936ef21 populate PCB_PARSER::m_layerMap with English layernames so footprints
can be parsed, since they do not have an overriding layer name map
like a BOARD does.

Avoid doubly looking up hashtable entries in m_layerMap.

Minor code reformatting.
2012-11-09 00:58:00 -06:00
jean-pierre charras 96a77d7618 Pcbnew: Add a min width parameter to plot solder mask layers.
* If this param is set to 0, the previous behavior is used.
* Else the solder mask is plotted as polygon, with shapes near than  this min width value are  merged.
Pcbnew in nanometer version: fix a serious rounding issue due to the fact dialogs were using 4 digits for mantissa.
* This is not enough for nanometer coordinates ( 8 are needed to display a value in inches),
*  so sometimes after closing a dialog, some coordinates were modified, although no new value was entered.
Minor other bug fixed.
2012-11-06 18:58:53 +01:00
jean-pierre charras 703293fa30 Add a min width parameter to plot solder mask layers. 2012-11-05 21:20:34 +01:00
Dick Hollenbeck 7c5e42b4d0 switch from STREAM_OUTPUTFORMATTER to FILE_OUTPUTFORMATTER mostly throughout,and minor richio factoring 2012-10-25 10:41:20 -05:00
Wayne Stambaugh 58ae2e1920 Add missing scripting build flags to EDA_BASE_FRAME::CopyVersionInfoToClipboard. 2012-10-25 10:27:35 -04:00
Dick Hollenbeck d32333a012 streamline the FILE_OUTPUTFORMATTER API for ease of use 2012-10-25 02:10:59 -05:00
jean-pierre charras 292c1f0912 Kicad: bug fix in menubar when changing the selected locale.
fctsys.h: remove useless define.
Fix minor issues and add minor enhancements.
2012-10-18 21:31:40 +02:00
Dick Hollenbeck 58299fc921 more fp_lib_table work 2012-10-17 10:12:17 -05:00
jean-pierre charras f03b9048fe Fix a minor compatibility issue in .pro file for new boards, between decimils and nanometers versions of Pcbnew. 2012-10-17 12:57:21 +02:00
Dick Hollenbeck 69dbeab90f decouple wxGridTableBase from FP_LIB_TABLE, this was poor information hiding 2012-10-16 20:00:25 -05:00
Dick Hollenbeck fb43f4ad6f fp_lib_table dialog work 2012-10-16 01:56:57 -05:00
Dick Hollenbeck 80693fa7c1 add dialog for fp_lib_table 2012-10-15 17:37:08 -05:00
Dick Hollenbeck ae19bbfa33 add dialog for fp_lib_table 2012-10-15 17:30:01 -05:00
Wayne Stambaugh b1ea9d0eb5 Minor FP_LIB_ID object changes. 2012-10-15 16:48:01 -04:00
Dick Hollenbeck 0dc4d9c19e Commit Dick's changes to the FP_LIB_TABLE object. 2012-10-15 12:19:42 -04:00
Wayne Stambaugh 77e1a4c03c Initial commit of footprint library table code. 2012-10-14 21:38:32 -04: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
marco. eee9738755 OSX: Corrected issue with Menus, workaround/fix for an issue with Mountain Lion 2012-10-13 20:23:03 +02:00
Wayne Stambaugh 87e773b6f6 Add Boost version to EDA_BASE_FRAME::CopyVersionInfoToClipboard(). 2012-10-09 11:31:55 -04:00
Wayne Stambaugh c11f3407b8 Check for getc_unlocked() and fall back to getc() in richio if it's not available. 2012-10-09 10:31:36 -04:00
Dick Hollenbeck bb383e22b3 optimize isSpace for negative 8 bit bytes 2012-10-08 15:01:17 -05:00
Dick Hollenbeck 56796a950c *) Use fgetc() technique to avoid strlen() in FILE_LINE_READER::ReadLine(),
which was having difficulty with embedded nuls in files coming from PCAD.

*) Make dsnlexer.cpp's isSpace() treat nuls as whitespace.
2012-10-08 14:34:46 -05:00
Dick Hollenbeck fdc7e9a818 Commit Dick's INPUTSTREAM_LINE_READER patch. 2012-10-07 17:26:41 -04:00
Wayne Stambaugh 1468a4ae31 Pcbnew s-experssion footprint library implementation.
* Add footprint methods to PCB_IO.
* Add FP_CACHE and FP_CACHE_ITEM for handling new footprint library design.
* Add code to save legacy libraries in new format.
* Change behavior of BOARD_ITEM::GetLayerName() to return the default layer
  name when the item does not have a BOARD as a parent.
* Minor changes to the module output formatter when writing to module library
  files (no BOARD as parent).
* Add new (and some that I forgot along the way) CMake flags to
  EDA_BASE_FRAME::CopyVersionInfoToClipboard().
* Add -Wno-narrowing to GCC flags to stop GCC 4.7 from complaining about
  a conversion from int to unsigned in the Boost polygon library.
* Add INPUT_STREAM_READER to richio.cpp to allow using any object derived
  from wxInputStream as a LINE_READER (needs to be validated).
2012-10-07 11:37:25 -04:00
jean-pierre charras c41bb774e4 Pcbnew: drill files creation: better dialog to create driil files, map files and report file. Code cleaning 2012-10-05 14:25:12 +02:00
jean-pierre charras 5951a7f9bc Pcbnew: fix an issue when collecting vias (for instance when left clicking on a via, it was not always detected)
This bug was mainly noticeable when using buried vias (some were never detected)
Minor other fixes (typos, strings hard to translate ...)
2012-10-04 19:47:28 +02:00
jean-pierre charras 7c0af1bf9d More dialogs derived from DIALO_SHIM 2012-10-04 08:57:15 +02:00
jean-pierre charras 143af26952 Eeschema: code cleanup, remove dead code and some global and useless variables 2012-09-28 19:47:41 +02:00
marco. 92f8f006fa MacOSX - Fixed some issues launching bundles/binaries 2012-09-26 00:33:42 +02:00
jean-pierre charras cc47e88b9e Pcbnew, plot functions: fix bug in SVG plotter, fix a minor other bug when using PS plotter (trcak width fine adjust not working)
and plot code cleaning continued
2012-09-24 08:39:59 +02:00
jean-pierre charras b660b033ad All: remove macros MAX, MIN, ABS from macros.h and replace these macros by std::max, std::min and std::abs (mainly found in old code). 2012-09-22 13:19:37 +02:00
jean-pierre charras 9e0960615a dcsvg (and therefore KicadSVGFileDC) is now unused. Use SVG plotter only to export a board SVG file.
SVG export does not use no more wxWidgets wxDC.
In pcbnew SVG files can be created by plot menu (in B&W) or export SVG menu (B&W or Color).
Export SVG menu is more suitable to create a view of a board, and plot menu is better to create a B&W document of silkscreen layers.
(In the future, the 2 menus could be merged, because they are not very different).
Note: pcbnew plot code is cleaned, mainly in dialog files, but still needs more cleanup.
2012-09-20 20:58:41 +02:00
Craig Southeren 436c17f60b This fixes a MSVC compile error caused by a static scalar initialiser. 2012-09-20 08:54:35 -05:00
jean-pierre charras 5179ed926b eeschema: plot functions: code cleaning.
SVG plotter: fix issues in draw arc and draw rectangle.
2012-09-18 16:50:30 +02:00
jean-pierre charras c3ecce2ec6 Eescheam: plot HPGL: add comments and minor fix. 2012-09-18 10:39:56 +02:00
jean-pierre charras 16064881be Eeschema: Plot dialogs: unify 5 dialogs (which means 5 duplicate code) to only one plot dialog (like in Pcbnew)
clean duplicate code.
Simplify HPGL dialog: plot offet removed and replace by only one option (plot origin to center of sheet or not)
This is surely enought.
2012-09-17 19:42:27 +02:00
jean-pierre charras a9744e3f84 Pcbnew: added: SVG plotter. Need refinements, but works.
Mainly to plot drill maps, but can be used to plot boards, for documentation.
The print svg still exists, but the plot SVG has more options (mirroring, holes in pads),
however  print svg allows color print, and full board printing, and plot does not.
2012-09-15 14:13:03 +02: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 bb6795ddf1 Pcbnew: drag functions: serious cleanup and better code. Use now the connectivity functions to find tracks connected to pads,
and therefore  tracks are now dragged when a end point is inside a pad, not necessary on the pad position.
However, drag functions still need more cleanup.
2012-09-11 09:33:17 +02:00
jean-pierre charras 3668f4ccc3 Pcbnew: cleanup functions: now, cleanup uses same algorithm as connectivity calculations to detect pads connections, and is faster.
therefore tracks which have a end point inside a pad, but not necessaryexactly  to the pad position are seen as connected, and are no more removed.
Side effect: reconnect to pads option is removed, because it is useless.
TODO: use this algorithm in drag functions.
Minor other fixes
2012-09-07 21:29:44 +02:00
jean-pierre charras 05dc1bbf3d fix compil errors 2012-09-02 18:38:52 +02:00
Lorenzo Marcantonio 34c74d17b4 Probable fix for compilation under wx 2.9 (doesnt hurt anyway) 2012-09-02 16:13:50 +02:00
Lorenzo Marcantonio e771112259 Enforced EDA_COLOR_T type and minor const-ification 2012-09-02 14:06:47 +02:00
Lorenzo Marcantonio 3157b4d188 Enforced EDA_COLOR_T type and minor const-ification 2012-09-02 13:01:12 +02:00
Lorenzo Marcantonio 082d901d60 Encapsulated drawmode as an enum for type checking 2012-09-01 15:38:27 +02:00
jean-pierre charras 92b43c7407 Fix 0 length segment in outline zone creation, that breaks zone chamfer option. 2012-08-31 15:58:23 +02:00
jean-pierre charras 37ee239449 Pcbnew: in SVG export, add option to export only the board area, not the full page.
dialog plot functions: fix compil warnings with wxWidgets 2.8
2012-08-31 09:43:37 +02:00
Lorenzo Marcantonio fef8347176 Script plotting patch 2012-08-29 18:59:50 +02:00
jean-pierre charras 79d55c0460 Minor cosmetic enhancements.
Kicad manager: shows now svg files in tree files.
Pcbnew: fix incorrect printing (board out of page) when creating drill map in postscript format ( noticeable mainly for small boards)
2012-08-29 14:40:09 +02:00
Dick Hollenbeck 0c4c65d7a2 wxServer was a confusing define, since it is also a wxWidgets class, do not use it 2012-08-24 06:31:09 -05:00
Gregor Riepl 96771ccc03 The listener is opened on INADDR_ANY, so it will accept any network
connection, no matter if it is originating locally or from the outside
of the host. There is no check in place to discard non-local
connections. The only security against a malicious attack would be
provided by a local firewall, which is not guaranteed to be installed on
every workstation kicad is used on.

I tested this, and a host running eeschema accepts connections on TCP
port 4243 from other hosts on the internet.

A patch to remedy this potentially serious security hole is attached. It
creates the listener on localhost instead. A flag is provided to allow
the creation of sockets on 0.0.0.0 instead, if required. localhost is
the default.
2012-08-24 06:19:52 -05:00
jean-pierre charras b19cc14ef2 3d-viewer and polygon functions: remove duplicate code about conversion from basic shapes to polygons. 2012-08-23 21:15:58 +02:00
Dick Hollenbeck 367bfb4e14 fix problem with eeschema print dialog showing up on missing monitor 2012-08-15 12:55:48 -05:00
jean-pierre charras 1f277fd66d Remove Kbool from Kicad. Use Clipper instead. 2012-08-04 11:43:27 +02:00
Miguel Angel Ajo 9259b21ffa Footprint wizard converts from user units to internal units back and forth, so user can type in mm or mils now 2012-07-23 00:23:17 +02:00
Miguel Angel Ajo 5d0dee1364 Adam Vašíček patches for WIN32 compilation of kicad scripting 2012-07-22 14:15:38 +02:00
Marco Mattila 9e20800f8c Fix axis offset issue in pcbnew gerber circular interpolation. 2012-07-18 22:32:47 +03:00
Miguel Angel Ajo 863c1b4823 Merged with testing 2012-07-15 22:38:25 +02:00
Marco Mattila 5a6c088bd9 Use circular interpolation for circles and arcs in pcbnew gerber plots. 2012-07-15 20:28:52 +03:00
jean-pierre charras f20bf0d217 Pcbnew: more about keepout areas: remove keepout for pads option and add keepout for copper zones option.
Export keepout to Specctra DSN file.
2012-07-14 18:27:25 +02:00
jean-pierre charras 018b080001 Pcbnew: Add keepout areas (Copper zones without tracks or/and vias).
This is *a work in progress*, so some features are missing, and/or could be modified.
Mainly keepout zones are not yet exported to autorouters, and pads are not taken in account.
Some code cleanup in polygon.*
2012-07-13 20:55:29 +02:00
l. 8234b9e184 All: Fix Assertion on sheet properties, in debug mode 2012-07-11 10:02:47 +02:00
jean-pierre charras af0d21474d Pcbnew: commit Lorenzo Marcantonio's patch for THT thermals (added loading/saving using S. expr).
Fix incorrect import of smd pads from Gpcb.
Very minor change in dialog print.
2012-07-09 09:10:07 +02:00
Jean-Pierre Charras 1b08d1874f Commit JP's custom page size fix for Pcbnew s-expressions file format with minor changes. Thanks JP. 2012-06-25 19:52:57 -04:00
jean-pierre charras 0c946870c5 All: fix a truncation issue in ReturnValueFromString that creates sometimes a small error for values entered in dialogs.
Pcbnew: fix a compatibility issue with nano version for zones parameters.
2012-06-25 22:59:19 +02:00
Miguel Angel Ajo db427cb2cd merge with lp:kicad 2012-06-25 22:51:19 +02:00
Wayne Stambaugh 4019284e66 Minor Pcbnew s-expression improvements.
* Put text effects on a single line.
* Remove size token when defining drill sizes.
* Don't save net in pad definition when pad has no connection.
2012-06-23 21:19:41 -04:00
jean-pierre charras 3a8bf14c9f Fix an issue (only found using gcc under mingw) in dsnlexer.cpp, using ::isspace( ) function that accepts only a 7 bit ASCII value under gcc/ mingw. 2012-06-20 22:33:05 +02:00
jean-pierre charras 025d550955 Pcbnew: small cosmetic enhancement: add a bitmap for zone duplicate command. 2012-06-20 11:57:36 +02:00
Wayne Stambaugh 8c72db6631 Pcbnew s-expression file parser bug fixes and file size improvements.
* Use index when saving layers to handle translated layer names.
* Add LOCALE_IO switcher when loading s-expression format.
* Make SEGVIA default to through hole to improve file size.
* Don't save default orientation of 0 degrees in TEXTE_MODULE and TEXTE_PCB.
* Don't save default zone configuration parameters.
* Save multiple zone corners on a single line.
* Fixed missing ( check in graphic and module arc parsers.
* Consistency improvements for DRAWSEGMENT and EDGE_MODULE objects.
* Minor tweaks to D_PAD formatting.
2012-06-16 18:49:24 -04:00
Wayne Stambaugh 3b2be428f4 Pcbnew s-expression file parser bug fixes.
* Change save order of drawings to match legacy file format object order.
* Set end point of SEGVIA to start point so the round trip back to legacy
  format is the same.
* Fixed bug saving and loading oval pad drill parameters.
* Fixed bug saving and loading rectangular pad deltas.
* Fixed missing layer for PCB_TARGET.
* Fixed EDA_TEXT italic bug.  Thanks Dick!
* Remove some left over debug logging statements.
2012-06-13 19:04:42 -04:00
Dick Hollenbeck a71857baaa Commit Dick's Pcbnew s-expression file parser bug fixes.
* Apply Dick's patch along with a few minor changes to fix some clashes with
  changes in my branch.  Thanks Dick!
* Added missing DRAWSEGMENT line angle.
* Fix thru hole pad layer mask issue.
2012-06-10 20:47:15 -04:00
Wayne Stambaugh 2d0d805014 Add Pcbnew s-expression file parser.
* Add s-expression file parser object and keyword files.
* Fix minor issues with s-expression file formatting.
* Fix a minor bug the zone container fill state parsing in the legacy plugin.
* Move EDA_TEXT visibility definition to eda_text.h.
* Add minor BOARD_ITEM object improvements to support s-expression file
  parser.
2012-06-09 13:00:13 -04:00
jean-pierre charras de471744cd Fix some minor bugs in plot functions 2012-06-09 11:38:58 +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
Miguel Angel Ajo b5c0cada0d merges tip, conflict resolved 2012-06-03 22:21:53 +02:00
Miguel Angel Ajo 30e251bfba merge 1 with tip 2012-06-03 22:06:51 +02:00
Dick Hollenbeck b3fd915f59 add translation to static file filters, comments 2012-05-30 09:14:42 -05:00
Dick Hollenbeck b68fa7cdfd generalize the BOARD loading process PCB_EDIT_FRAME::LoadOnePcbFile() to use any supported PLUGIN 2012-05-29 16:01:17 -05:00
Lorenzo Marcantonio 28bcad847e Rename BASE_SCREEN member m_NumberOfScreen to m_NumberOfScreens. 2012-05-26 20:19:12 -04:00
Lorenzo Marcantonio 925774760c Rationalize numeric time stamps to type time_t. 2012-05-24 21:52:04 -04:00
jean-pierre charras 4812968129 Eeschema: Fix a minor issue in block command
Very minor code cleaning
2012-05-20 21:18:06 +02:00
Dick Hollenbeck 5cda6bc1a6 eagle plugin first work 2012-05-20 08:14:46 -05:00
jean-pierre charras 30c7e31839 Very minor fixes. 2012-05-19 21:04:03 +02:00
Dick Hollenbeck ffd57d88d7 move all hashtable declarations into include/hashtables.h, prepare for boost usage 2012-05-15 21:00:25 -05:00
henner zeller 42f1b9e415 commit patch from henner zeller (make EDA_LIST_DIALOG resizable) 2012-05-14 17:23:20 +02:00
jean-pierre charras 40c5a46f38 Libedit: fix Bug #994014.
Pcbnew: fix Pcbnew name capitalization in messages.
About dialog: add a link to kicad-pcb.org
2012-05-13 17:31:58 +02:00
jean-pierre charras f6551172d2 Fix capitalization issues in title bar and config files (broken by bzr rev 3543) 2012-05-10 08:25:27 +02:00
Dick Hollenbeck 2e0941a1de Fix some comments. Enhance LEGACY_PLUGIN such that it can tolerate, then fix bad legacy footprint libraries containing duplicate footprint names.
This may have been an undocumented bug from more than a year ago, which manifested itself in *.mod files containing duplicate names.
LEGACY_PLUGIN loads those now quietly, but appends "_v2", "_v3", etc. to each succeeding duplicate sharing the same name.
2012-05-08 19:26:15 -05:00
Dick Hollenbeck 6824dc7199 this helps zooming on some window types 2012-05-08 16:09:18 -05:00
Dick Hollenbeck 40ccdd5763 Fix Pcbnew markers in nanometer build with proper scaling factor. Use double in Zoom() 2012-05-07 16:47:25 -05: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
Jerry Jacobs 5f5c504288 Cosmetic UI changes mostly for Mac OS X, see CHANGELOG.txt 2012-05-05 18:02:09 +02:00
Dick Hollenbeck 173c93969d Remove zip library by switching to wxZlibOutputStream for PDF plotter.
Delete LEGACY_PLUGIN cache after deleting library of same name.
Remove automatically generted freerouter help header.
Add Normalize() to BOX2.
Clamp some values in the virtual space of drawframe.cpp
2012-05-04 23:55:36 -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
jean-pierre charras 684d98ecca Add missing files 2012-05-03 21:08:14 +02:00
jean-pierre charras 61acac28e1 Add patch from Lorenzo Marcantonio. Fix some warning issues, and zlib issue under Windows (zlib sources added) 2012-05-03 20:37:56 +02:00
Miguel Angel Ajo f35037238c merged to testing, fixed some scripting imports 2012-04-30 18:05:22 +02:00
Dick Hollenbeck 3fa7c200b7 Add tools/parser_gen.cpp which is the beginnings of an s-expression parser
generation tool.  For now, it is just an s-expression beautifier using
our "non-specctra mode" version of s-expressions.
2012-04-29 21:57:48 -05:00
jean-pierre charras e96f1aeb3d Remove valeur_param(), that does not work in Kicad Nanometer 2012-04-27 16:15:11 +02:00
jean-pierre charras 758f22161a All: change MILS_TO_IU_SCALING_FACTOR constant to IU_PER_MILS ( and MM_TO_IU_SCALING_FACTOR to IU_PER_MM)
Also fix bug 985654.
2012-04-26 23:34:20 +02:00
jean-pierre charras 3b671e09d1 All: change MILS_TO_IU_SCALING_FACTOR constant to MILS_PER_IU ( and MM_TO_IU_SCALING_FACTOR to MM_PER_IU)
Also fix bug 985654.
2012-04-26 22:21:31 +02:00
jean-pierre charras fa3ebc4043 Define MM_TO_IU_SCALING_FACTOR (scaling factor from mm to internal units) only in convert_to_biu.h
Other scaling factors (MILS_TO_IU_SCALING_FACTOR and DECIMILS_TO_IU_SCALING_FACTOR)
also defined only in convert_to_biu.h.
Allows different scaling value for Gerbview.
Needs more tests.
2012-04-25 21:33:24 +02:00
Dick Hollenbeck 2140efdce3 Somebody else spelled rectangle as badly as me, fix the mingw build 2012-04-23 21:39:56 -05: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
Miguel Angel Ajo d719282aaf wxArrayString typemaps, class missing yet 2012-04-23 08:59:37 +02:00
Wayne Stambaugh d8b60a14e1 Pcbnew s-expression file format improvements.
* Move board item object Format() functions into PCB_IO object.
* Change file format to use layer names instead of numbers.
* Change file extension to kicad_pcb.
2012-04-22 11:16:39 -04:00
Miguel Angel Ajo aef92a345c Merged to testing, needs some fixes 2012-04-21 22:04:02 +02:00
Dick Hollenbeck e594732646 missing include 2012-04-19 15:07:36 -05:00
Dick Hollenbeck c24863c078 // Dick Hollenbeck's KiROUND R&D
// This provides better project control over rounding to int from double
// than wxRound() did.  This scheme provides better logging in Debug builds
// and it provides for compile time calculation of constants.


#include <stdio.h>
#include <assert.h>
#include <limits.h>

//-----<KiROUND KIT>------------------------------------------------------------

/**
 * KiROUND
 * rounds a floating point number to an int using
 * "round halfway cases away from zero".
 * In Debug build an assert fires if will not fit into an int.
 */

#if defined( DEBUG )

// DEBUG: a macro to capture line and file, then calls this inline

static inline int KiRound( double v, int line, const char* filename )
{
    v = v < 0 ? v - 0.5 : v + 0.5;
    if( v > INT_MAX + 0.5 )
    {
        printf( "%s: in file %s on line %d, val: %.16g too ' > 0 ' for int\n", __FUNCTION__, filename, line, v );
    }
    else if( v < INT_MIN - 0.5 )
    {
        printf( "%s: in file %s on line %d, val: %.16g too ' < 0 ' for int\n", __FUNCTION__, filename, line, v );
    }
    return int( v );
}

#define KiROUND( v )    KiRound( v, __LINE__, __FILE__ )

#else

// RELEASE: a macro so compile can pre-compute constants.

#define KiROUND( v )  int( (v) < 0 ? (v) - 0.5 : (v) + 0.5 )

#endif


//-----</KiROUND KIT>-----------------------------------------------------------

// Only a macro is compile time calculated, an inline function causes a static constructor
// in a situation like this.
// Therefore the Release build is best done with a MACRO not an inline function.
int Computed = KiROUND( 14.3 * 8 );


int main( int argc, char** argv )
{
    for( double d = double(INT_MAX)-1;  d < double(INT_MAX)+8;  d += 2.0 )
    {
        int i = KiROUND( d );

        printf( "t: %d  %.16g\n", i, d );
    }

    return 0;
}
2012-04-19 01:55:45 -05:00
Dick Hollenbeck 72d4b2353b uncrustify math_for_graphics, add copyright legacy_plugin.h 2012-04-17 09:18:14 -05:00
Dick Hollenbeck 597833b55e touch ups 2012-04-17 01:13:22 -05:00
Dick Hollenbeck e88bc8e58b LEGACY_PLUGIN is now in full use:
*) for footprint access into *.mod files and 
*) BOARD save/load

The item_io.cpp and ioascii.cpp have been set off to the side for reference
as *.notused, for awhile.

The CMake options USE_NEW_PCBNEW_LOAD and USE_NEW_PCBNEW_SAVE are gone,
this is now the mandatory usage of the LEGACY_PLUGIN.  This should reduce
code maintenance for awhile until the s-expression plugin comes into 
play.  But at least for legacy format, there is not two code bodies
to maintain any more.

A new LEGACY_PLUGIN footprint library caching scheme is in place which 
needs some testing.  It should not be any faster, but might give better 
results in a networked environment if there is *.mod files on the server.
2012-04-16 22:12:53 -05:00
Dick Hollenbeck 3341669fc6 more footprint support for LEGACY_PLUGIN 2012-04-16 20:35:43 -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 6468805c27 More internal unit improvements.
* Move all convert from user to internal units into base_units.cpp.
* Remove internal units parameters from all moved conversion functions.
* Revise all source code that calls the moved conversion functions.
* Remove internal units from all dialog text control helper classes.
2012-04-16 13:39:32 -04:00
jean-pierre charras 5d5eb7d38c Fix a serious bug in EDA_RECT::Intersects
Kicad manager: code cleaning. Dead code removed and minor fixes. support of new .kicad_brd extension.
2012-04-16 14:56:01 +02:00
Dick Hollenbeck a42490e0f3 work on footprint plugin API 2012-04-15 22:18:41 -05:00
Wayne Stambaugh 8c0dc01fdd Pcbnew nanometer internal unit fixes.
* Scale page reference border and title block, grid sizes, and zoom factors
  correctly for nanometers.
2012-04-15 21:25:26 -04:00
lajos kamocsay add5321328 Commit patch fixing an issue in pan with middle mouse button (from lajos kamocsay)
Other minor fixes.
2012-04-15 12:33:35 +02:00
Miguel Angel Ajo 55c0eafd6f merged testing branch 2012-04-14 23:18:27 +02: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
jean-pierre charras b28e976e35 Eeschema: BOM list generation: some fixes and enhancements.
drawframe.cpp: commit a fix about scrollbars  from lajos kamocsay
2012-04-13 20:44:02 +02:00
Wayne Stambaugh bed96be750 Internal unit improvements and Pcbnew s-expression file format changes.
* Move EDA_TEXT object into separate header and source file.
* Compile EDA_TEXT class separately for BOARD_ITEM and SCH_ITEM units.
* Compile PAGE_INFO  class separately for BOARD_ITEM and SCH_ITEM units.
* Minor formatting tweaks to Pcbnew s-expression file.
* Move internal unit formatting functions into BOARD_ITEM and SCH_ITEM.
2012-04-12 17:31:31 -04:00
lajos kamocsay 38ea600803 Fix small issue when panning with middle button. 2012-04-12 09:58:12 +02:00
jean-pierre charras f0dc54340d All: new middle mouse pan feature, from lajos kamocsay (and jp charras for some enhancements).
If enable in preference menu, allow the pan with drag mouse with middle button down.
both unlimited and limited pan is allowed.
2012-04-11 20:54:20 +02:00
jean-pierre charras 8f62c6aa05 Move AddMenuItem inline functions outside wxstruct.h in a new file (menu_helpers.h)
Enhancements in AddMenuItem (that accepts now a menu type)
Partial use of the Edwin van den Oetelaar's patch (patch not fully working or correct)
2012-04-09 11:16:47 +02:00
Miguel Angel Ajo a201522f6b lajos kamocsay compilation patches 2012-04-09 08:53:24 +02:00
Alexander Zakamaldin f2f0f66a50 This bug is not evident for the first glance because most PS viewers fix this issue and print well.
But when using raw printing (for linux - 'lpr some_file.ps') the bug gets out.

Alexander.
2012-04-08 18:37:26 -05:00
Wayne Stambaugh 9c16a218c0 Pcbnew s-expression file format changes.
* Save dialog now supports saving boards to new file format.
* Add CMake option to build s-expression file save.
* Add check to main CMakeList.txt file to make sure nanometers are
  enables when the new file format is built.
* Minor tweaks to object format functions for improved output.
* Rename kicad_plugin.h/cpp to legacy_plugin.h/cpp.
2012-04-07 14:05:56 -04:00
jean-pierre charras d739f03c5f Remove old xpm icons files 2012-04-07 13:09:57 +02: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 7ce97878e8 pcb_calculator: enhancement in Regulators page dialog:
* support for 3 terminal regulators
* add a data file management to store parameters for regulators ( name, vref value, Iadj value, type)
Needs some refinements, but it is already very useable.

 Commit dialog page setting patch from Alexander Zakamaldin
2012-04-02 20:11:00 +02:00
Wayne Stambaugh d7feb9ab45 Initial Pcbnew s-expression file format commit.
* Add s-expression Format() function to all objects derived from
  BOARD_ITEM.
* Add s-expression Format() function to base objects as required.
* Add functions to convert coordinates from base internal units
  (nanometers) to millimeter string for writing to s-expression
  file.
* Add temporary dummy conversion functions to prevent link errors
  until schematic and board object and action code can be separated
  into DSO/DLL.
* Add CMake build option to build Pcbnew with nanometer internal
  units.
2012-04-01 16:51:56 -04:00
jean-pierre charras e356e6dc6b Fix issues about translations:
Eeschema: one string with a bad char (\a, not useable in internationalized strings).
Dialog_page_settings: use not translated strings in code, so strings can be freely translated for the UI.
(Initial code was not working with existing translations)
Update 2 icons.
2012-03-27 18:41:13 +02:00
Wayne Stambaugh 45445dd88f Minor code improvements and coding policy fixes.
* BLOCK_SELECTOR class is not longer derived from EDA_ITEM.
* Encapsulate BLOCK_SELECTOR class member variables and add access methods.
* Move HandleBlockBegin() function from block_commande.cpp to drawframe.cpp.
* Remove virtual methods from top level derived objects per future
  coding policy change.
* Remove Doxygen copydoc statement from objects derived from EDA_ITEM
  since the comments are automatically copied to the derived object.
* Removed copy and pasted Doxygen comments from objects derived from
  EDA_ITEM.
2012-03-26 19:47:08 -04:00
Alexander Zakamaldin 625e964c8d Alexander's patches, with refinements 2012-03-26 16:45:05 -05:00
jean-pierre charras cf9864766b class EDA_RECT: is no more derived from EDA_ITEM, just from EDA_RECT (reason: does not use anything in EDA_ITEM)
issue in cast to wxRect fixed (EDA_RECT accepts negative size, but not wxRect, so the wxRectcast  is normalized now).
This fixes some bugs.
A minor other bug fix in Pcbnew.
2012-03-24 15:25:30 +01:00
Dick Hollenbeck 31a84b84ec Add include/dialog_shim.h and common/dialog_shim.cpp for use by wxformbuilder's "subclass a wxDialog" support.
This works, but in my version of wxformbuilder there is a bug which does not properly show the 
subclass property, even though it is still in play.  This happens after saving then loading the *.fbp file.
So it is a nuisance bug, but does not affect functionality.
2012-03-22 02:02:49 -05:00
jean-pierre charras b5cac30abd Eeschema: fix a bug in bool SCH_LINE::MergeOverlap( SCH_LINE* aLine ): ends point of resulting segment incorrects.
remove unused icon files.
2012-03-19 08:48:29 +01:00
Wayne Stambaugh 058e17edf7 Minor code and Doxygen comment improvements.
* Remove double Clone() function calls from all classes derived from
  EDA_ITEM.
* Lots of Doxygen comment warning fixes.
2012-03-17 10:39:27 -04:00
Joe Ferner ffbbd64c73 Joe Ferner's merge 2012-03-16 22:01:53 -05:00
Joe Ferner aad54ec406 Added a toolbar button to cvpcb to filter by pin/pad count. 2012-03-15 14:20:22 -04:00
Wayne Stambaugh 6375497825 Hit test method rationalization and other minor improvements.
* All objects derived from EDA_ITEM now have consistent hit test method
  definitions.
* Remove double function calls from all classes derived from SCH_ITEM.
* Lots of Doxygen comment fixes.
2012-03-15 10:31:16 -04:00
Andrey Fedorushkov 389656e58c all: add display distance to local coordinates in status bar 2012-03-13 13:33:39 +04:00
Dick Hollenbeck 2e29b4f152 * Add PCB_EDIT_FRAME::syncLayerVisibilities(), PCB_LAYER_MANAGER::SyncLayerVisibilities().
* Save all visibilities, layer and render, in BOARD and restore on load.
2012-03-11 19:40:48 -05:00
jean-pierre charras 909c2a6051 Dialog exit: better icon.
Pcbnew:
 * graphic_item_properties_base.fbp * dialog pad edit: make some strings more easier to translate.
 * global pad edition: fix a bug that change pad position instead of pad size (round pas only).
Eeschema:
 * fix a bug: new created wires were not alwaes shows until the screen was redrawn.
2012-03-09 19:58:58 +01:00
jean-pierre charras e90cc8adf5 All: added a standard exit dialog called by int DisplayExitDialog( wxWindow* aParent, const wxString& aMessage )
Called when closing pcbnew, cvpcb and eeschema.
Minor code cleaning: remove duplicate or not used strings (mainly file extensions and wildcards)
2012-03-08 18:47:23 +01:00
jean-pierre charras 5e5ec6f1a9 All: try to fix incorrect acs in plot SVG under wxWidgets 2.9:
wxWidgets 2.9 knows wxSVGFILEDC device context.
Unfortunately, arcs are drawn as pies (this is a feature, not a bug).
This is not correct for Kicad.
So Kicad has its own wxSVGFILEDC (named KicadSVGFileDC) that is basically the same as wxSVGFILEDC,
but with arcs drawn as arcs, not pies.
Note also under wxWidgets 2.8 does not know wxSVGFILEDC , so kicad had already its own SVG device context.
2012-03-07 21:18:00 +01:00
Dick Hollenbeck db7c8cfd92 remove clamping from PAGE_INFO setters 2012-03-06 14:10:12 -06:00
jean-pierre charras ed5585eb6c Libedit: fix bug (svg export does not work)
other minor fixes.
2012-03-06 15:08:59 +01:00
Alexander Zakamaldin f13e020314 Problem with the Help link "getting started in kicad" 2012-03-01 09:53:34 -06:00
jean-pierre charras 75d2dc7311 Pcbnew: Hight contrast mode: commit last patch from Miguel Angel Ajo Pelayo, which also fixes an old bug.
All: prepare better compatibility with wxWidgets 2.9.4. Works fine with 2.8.x (I hope...)
2012-02-28 21:14:17 +01:00
jean-pierre charras 6219291ddc ModEdit (and ModView): make "invisible" texts visible. They are not visible in the board editor, but must be visible in the footprint editor.
Minor doc update.
2012-02-26 19:49:00 +01:00
Wayne Stambaugh aaa1cc3e02 Eeschema object list and other minor improvements.
* Convert Eeschema from manually linked list to DLIST for storing
  SCH_ITEM objects.
* Add helper functions to SCH_SCREEN for appending list of SCH_ITEM
  objects.
* Fix bug in wire editing code for accurate undo/redo behavior.
* Add member to DLIST to append another DLIST.
* Other minor code cleaning.
2012-02-26 13:39:39 -05:00
Simon Schubert bcd66579d9 Pcbnew: fix bad arcs in plot postscript (from Simon Schubert) 2012-02-24 18:17:03 +01:00
jean-pierre charras 477e98dc6c Fix 2 minor bugs:
* Pcbnew: in hight contrast mode the 'V' hotkey did not always refresh the screen.
* Eeschema: incorrect print scale when the option 'Show page limits' is disable.
2012-02-20 19:46:56 +01:00
jean-pierre charras f1e5be9a67 Fix @JP messages (no bugs, just comment lines)
Eeschema: Viewlib is now accessible from Libedit (to browse libs or load a component to edit)
Libedit: uses now the same dialog as the schematic editor to load a component
Some code cleaning.
2012-02-19 20:53:11 +01:00
Marco Mattila 9ef6ae5b49 Use wxStandardPaths to find out the path to binaries in linux. 2012-02-19 21:13:53 +02:00
Dick Hollenbeck 5208bf9976 * remove global g_Pad_Master global and put it into BOARD_DESIGN_SETTINGS
which is in turn already within BOARD.
  * encapsulate class D_PAD with accessors, making data private.
  * make D_PAD::GetBoundingRadius() do its longer calculation lazily, based on
    m_boundingRadius == -1.
2012-02-18 22:10:49 -06:00
Dick Hollenbeck 9e2eb0c856 see CHANGELOG.txt 2012-02-18 22:02:19 -06:00
jean-pierre charras 827352511a Layers manager: add in popup menu option to hide all coppers layers but active layer.
Design rules: increase number of vias and tracks sizes
Pcbnew: netlist reader: change from my recent commits to keep netnames in pads for footprints not in netlist
(allow an user to place some footprints by hand, set pads netnames and do not lost these netnames when loading a netlsit)
Fix other very minor issues.
2012-02-17 20:43:43 +01:00
jean-pierre charras ba689c10e3 Kicad project manager: add .cmp, .drl .pos and .rpt files management.
Code cleaning and other minor fixes.
2012-02-16 21:03:33 +01:00
Dick Hollenbeck b90d657cb8 fix bug 921553 2012-02-08 09:06:06 -06:00
Dick Hollenbeck e7b3ed2e88 merge 2012-02-06 01:14:51 -06:00
Dick Hollenbeck 6c04e60587 see CHANGELOG.txt 2012-02-05 23:44:19 -06:00
jean-pierre charras 08ef741770 Undo redo change and code cleanup. 2012-02-05 14:02:46 +01: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
jean-pierre charras f9e2f9dc77 Pcbnew and Cvpcb: more about new netlist support: see CHANGELOG (important changes).
Also commit updated icnos from Fabrizio.
2012-02-01 20:49:37 +01:00
Andrey Fedorushkov 9eb7cba156 revert my bug commit 3389 2012-02-01 15:53:32 +04:00
Andrey Fedorushkov 0c00c88f11 fix DXF plot arc 2012-02-01 13:36:43 +04:00
marco. 96f435202c MacOSX: Handling exec 2012-01-26 20:48:45 +01:00
Dick Hollenbeck 23172cce23 compile base_screen.cpp separately for {pcbnew,cvpcb} and eeschema, so we can diverge internal units at compile time, not runtime 2012-01-22 22:53:21 -06:00
Dick Hollenbeck 2b394c7ccb dialog_page_settings needed right border space, retain last dialog size and position 2012-01-22 22:45:57 -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
Dick Hollenbeck e6c8515873 switch to C++'s false and true from C's FALSE and TRUE 2012-01-22 11:20:22 -06:00
Dick Hollenbeck 708aef8522 towards making KICAD_GOST a runtime option, hoping for unified paper size 2012-01-18 09:02:50 -06:00
Dick Hollenbeck a7b251450f portrait setting was being overwritten in dialog_page_settings.cpp, add updatePortrait(), improve comments 2012-01-17 08:58:58 -06:00
Dick Hollenbeck 2c84a28f6b switch to combobox on page size dialogs, fix PLUGIN header 2012-01-16 14:48:32 -06:00
Dick Hollenbeck 286c62d898 fix order of cvpcb link libraries, make some PAGE_INFO functions inline 2012-01-15 23:38:11 -06:00
Dick Hollenbeck b76d05f591 fix syntax error in kicad_plugin.cpp, carve out class_page_info.cpp, and add PAGE_INFO::Custom 2012-01-15 23:17:23 -06:00
Dick Hollenbeck 0025ac7d38 Add "portrait" support to the page size settings for all standard paper
sizes.  Tested with postscript output only.  Required minor file format changes
    to reflect the "portrait" setting.  common/dialogs/dialog_page_settings.cpp
    uses a checkbox but its name is "Landscape", which is inverted from portrait,
    but since it is the more common choice, I used that rather than portrait.
    The tooltip for that checkbox makes it clear.  No portrait mode is supported
    for "User" paper size.
2012-01-15 22:11:43 -06:00
Dick Hollenbeck 9147e66dce fix bug with user page size not taking effect immediately 2012-01-15 15:07:01 -06:00
Dick Hollenbeck 9431c2a60a changes 2012-01-14 19:31:39 -06:00
Wayne Stambaugh 5289c22087 Pcbnew object improvements.
* Remove unnecessary copy constructors from board and module library
  objects.
* Add doClone() method to board and library objects.
* Add comment to class definitions where the default copy constructor
  generated by the compiler was adequate.
* Replace copy method with clone method where applicable.
* Remove DuplicateStruct() function.
* Remove track object copy function.
2012-01-14 14:50:32 -05:00
Dick Hollenbeck 5a9fcf6f11 fix windows version of GetRunningMicroSecs() 2012-01-13 11:11:34 -06:00
Dick Hollenbeck 3421863c01 add GetRunningMicroSecs() to libcommon for debug timing 2012-01-13 03:46:02 -06:00
marco. f40a92561c MacOSX: Grid now is displayed correctly 2012-01-10 23:27:31 +01:00
marco. 54c20b57f2 MacOSX: Main issue catch! wxPen with size 0 draws NOTHING (8 months to spot it) 2012-01-10 20:52:48 +01:00
Wayne Stambaugh 409d6e8ea2 Eeschema schematic object improvements.
* Remove unnecessary copy constructors from schematic and component
  library objects.
* Add comment to class definitions where the default copy constructor
  generated by the compiler was adequate.
* Add assignment operator to EDA_ITEM, SCH_ITEM, and all schematic
  objects where the default assignment operator generated by the
  compiler would not be adequate.
2012-01-09 15:26:55 -05:00
Andrey Fedorushkov d000d48653 fix build when defined KICAD_GOST 2012-01-09 23:13:20 +04: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
Александр Закамалдин 2caa72f063 This patch implements width tuning (width correction) for PS plotting of tracks, pads and vias.
This feature is very useful for electronics hobbyists who use DIY PCB technology 
(both toner transfer and photoresist methods).
Also width correction may be useful for PCB designers who take care of track width etching.
This patch also fixes some minor PS plotting issues.
2012-01-07 00:02:38 -06:00
Dick Hollenbeck 148aecf963 improved comments 2012-01-05 12:16:21 -06:00