Commit Graph

114 Commits

Author SHA1 Message Date
Dick Hollenbeck 2c67c3ff80 * KIWAY Milestone A): Make major modules into DLL/DSOs.
!   The initial testing of this commit should be done using a Debug build so that
    all the wxASSERT()s are enabled.  Also, be sure and keep enabled the
    USE_KIWAY_DLLs option.  The tree won't likely build without it.  Turning it
    off is senseless anyways.  If you want stable code, go back to a prior version,
    the one tagged with "stable".

*   Relocate all functionality out of the wxApp derivative into more finely
    targeted purposes:
    a) DLL/DSO specific
    b) PROJECT specific
    c) EXE or process specific
    d) configuration file specific data
    e) configuration file manipulations functions.

    All of this functionality was blended into an extremely large wxApp derivative
    and that was incompatible with the desire to support multiple concurrently
    loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
    An amazing amount of organization come from simply sorting each bit of
    functionality into the proper box.

*   Switch to wxConfigBase from wxConfig everywhere except instantiation.
*   Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
    PGM_SINGLE_TOP,
*   Remove "Return" prefix on many function names.
*   Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
*   Fix building boost for use in a DSO on linux.
*   Remove some of the assumptions in the CMakeLists.txt files that windows had
    to be the host platform when building windows binaries.
*   Reduce the number of wxStrings being constructed at program load time via
    static construction.
*   Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
    these functions are useful even when the wxConfigBase comes from another
    source, as is the case in the KICAD_MANAGER_FRAME.
*   Move the setting of the KIPRJMOD environment variable into class PROJECT,
    so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
*   Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
    its child wxFrames and wxDialogs now have a Kiway() member function which
    returns a KIWAY& that that window tree branch is in support of.  This is like
    wxWindows DNA in that child windows get this member with proper value at time
    of construction.
*   Anticipate some of the needs for milestones B) and C) and make code
    adjustments now in an effort to reduce work in those milestones.
*   No testing has been done for python scripting, since milestone C) has that
    being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
jean-pierre charras ce6b907fe3 Add specific bitmaps in export IDF and export DSN menus.
Add missing calls to Show( false ) to some main frames (Kicad, eeschema, gerbview), to force config saving when closing these windows.
Code cleanup and minor coding style fixes  in footprint_wizard_frame
2014-01-29 18:01:42 +01:00
jean-pierre charras 50743cf3ba Initial release of pl_editor, the page layout and title block editor. 2013-07-19 20:27:22 +02:00
Wayne Stambaugh a56d3235e3 Prevent GTK printing build error on Linux
* Do not fail to build when wxWidgets is built with either --with-gnomeprint
  or --with-gtkprint are not configured.  Only display warning.
* Move warning code from include/common.h to common/common.cpp so it only
  shows the warning once instead of every source file that includes common.h
2013-06-28 12:29:39 -04:00
jean-pierre charras 57b30ad254 Pcbnew: Fix Bug #1185556. fix issue about Solder Paste Ratio value which was accepting only one digit in mantissa in 3 dialogs (now 6 digits in all dialogs).
fix potential issue in .kicad_pcb file creation, in some places where a %g or %.16g format was used:
al least under Mingw/gcc4.7.2, the floating number was written using scientific notation, not accepted by the S-expr reader.
2013-05-30 21:32:00 +02:00
Lorenzo Marcantonio 26f2c04f13 Make title block date field modifiable by hand. 2013-05-23 14:45:23 -04:00
Lorenzo Marcantonio db09deedf7 New color palette 2013-04-05 19:23:56 +02:00
Lorenzo Marcantonio d12a45923b More work on EDA_COLOR_T and layers.
In particular the new mechanism for handling extended color palettes is in place,
included renaming the ini keys and saving the color name instead of its index; this means better forward compatibility with palette changes.

Since ini keys are changed, colors will be reset
2013-04-04 23:35:01 +02:00
jean-pierre charras 51291b0965 Fix many issues in config functions, mainly a rounding issue when a double is stored in wxConfig file (was stored only using 4 digits in mantissa)
Remove dead or obsolete code.
2013-03-30 10:28:59 +01:00
Carl Poirier 8421cacef4 Add library column to component and module select dialog. 2013-03-18 21:25:19 -04:00
Jacobo Aragunde Perez 295b5b5dea Add patch from Jacobo Aragunde Perez <Log of opened and closed applications in KiCad launcher> 2013-01-18 11:42:23 +01:00
Lorenzo Marcantonio e771112259 Enforced EDA_COLOR_T type and minor const-ification 2012-09-02 14:06:47 +02:00
Lorenzo Marcantonio 925774760c Rationalize numeric time stamps to type time_t. 2012-05-24 21:52:04 -04: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
jean-pierre charras e96f1aeb3d Remove valeur_param(), that does not work in Kicad Nanometer 2012-04-27 16:15:11 +02: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 597833b55e touch ups 2012-04-17 01:13:22 -05: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
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
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
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
Alexander Zakamaldin 625e964c8d Alexander's patches, with refinements 2012-03-26 16:45:05 -05: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 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 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 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 148aecf963 improved comments 2012-01-05 12:16:21 -06:00
Dick Hollenbeck 1393eb0f11 finish up SCH_SHEET::{Set,Get}PageSettings() switch over 2012-01-05 02:07:11 -06:00
Dick Hollenbeck d3afe95ca8 remove page size globals from eeschema 2012-01-04 00:18:38 -06: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
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
jean-pierre charras bcbde5d813 All: fix a collision name between accessor function GetTimeStamp and GetTimeStamp in common.cpp.
In common.cpp GetTimeStamp is renamed GetNewTimeStamp (a better name).
Pcbnew: prepare work to calculate connections between pads that inteserct and therefore can be connected without any track (composite pads).
2011-12-07 16:49:32 +01:00
Wayne Stambaugh d9e0ab0241 Improve Eeschema find code and add initial replace plumbing.
* Replace Eeschema find code with a collector based implementation.
* Fixed a search bug when all subsequent searches of an item would ignore
  the remaining valid child items when an item had more than one child
  item that matched the search criteria.
* Add SCH_FIND_COLLECTOR class to find all items that meet the specified
  search criteria.
* Add SCH_FIND_COLLECT0R_DATA to keep track of information for all matching
  items.
* Use collector to iterate over the list of items that match the search
  criteria rather than trying to start at the last matched item.
* Remove unused searching methods from sheet path and sheet path list
  objects.
* Add replace and replace all functionality to Eeschema find dialog.
* Push matching methods down to EDA_ITEM class so they can be used by
  other derived objects.
* Add method to EDA_ITEM to test if item supports replacing.
* Add flag to find/replace data to support replace feature.
* Disable wild card matching check box when dialog is in replace mode as
  wild card replacement is not supported at this time.
* The usual Doxygen comment and coding policy fixes.
2011-12-01 11:49:28 -05:00
Dick Hollenbeck cc097762c7 Temporarily reverse out the evolving support for finer Board Internal Units (BIU)s. 2011-11-24 11:32:51 -06:00
Vladimir Ur 09a61396ba Some code restyling: VECTOR_PCB is an array. Cleanup uncontrolled definitions of abs, max, etc. max is now overloaded function and MAX is a macro. 2011-11-15 22:26:06 +04:00
Vladimir Ur 4b9b2f4e66 Nanometric work. Design rules, D_PAD (except m_Pos) is now in new units. Metric files can be loaded w/o KICAD_NANOMETRE flag set but saved only with this flag, this could help to gain some compatibility during transition process. ifdef'd code is somewhat minimized by using transition macros. Some potential code bugs are commented. 2011-11-14 20:56:05 +04:00
Wayne Stambaugh cc7e7fc5ca Memory allocation improvements and other minor fixes.
* Replace C malloc() and free() functions with C++ new and delete
  operators or the appropriate STL container.
* Add option to end mouse capture function to skip executing the end
  mouse capture callback.
* Lots of coding policy and Doxygen comment goodness.
2011-11-10 10:55:05 -05:00
Vladimir Ur 0fdf71a80e General design rules tab converted to nanoscale. A bit of refactorisation in via sizes. And build key is KICAD_NANOMETRE not KICAD_NANOMETRIC (as I stated in previous commit). 2011-11-09 21:35:16 +04:00
Vladimir Ur a273b7bdb5 Work on internal (nano)metric length units started.
Added configuartion option KICAD_NANOMETRIC for this.
* With option set to false: *
- it should work and compile as usual
- some values are saved with decimal point (which should be backward/forward compatible as old versions should just drop fractional part)
* With option set to true: *
- lengths in Global Design Rules should be settable 1nm steps.
FROM/TO_LEGACY_LU(_DBL) macros introduced for easy interconnection between old and new units.
2011-11-09 17:25:49 +04:00
Wayne Stambaugh 4b853dedb4 Application name capitalization fixes.
* Correct all user strings and comments for the correct capitalization of
  application names according to JP.  They are KiCad, Pcbnew, CvPcb,
  Eeschema, and GerbView.
* Add a note the the user interface policy about the correct capitalization.
2011-09-30 14:15:37 -04:00
Andrey Fedorushkov 9f98995a46 pcbnew:
* Add hotkey "P" - place item
* Add record and play macros for sequence hotkey.
Macros set to numeric key 0..9.
<Ctrl>+<numkey> - start record macros
<hotkey> <mouse move> ... <hotkey>|<mouse place>
<Ctrl>+<numkey> - end record macros
<numkey> - play macros
* Add menu save/read macros to/from xml-file
* Add configure rotate angle for rotate module: 45 or 90 deg.
* fix segfault when move/drag segment if disconnected to pad
2011-09-07 13:27:02 +04:00
Wayne Stambaugh 750f84c19a Coding style policy fixes and dead code removal. 2011-09-06 15:42:46 -04:00
Andrey Fedorushkov 0dd4c05c4f pcbnew: add trace length from pad to die on chip (module) 2011-06-30 10:02:07 +04:00
Wayne Stambaugh 86b6feb95d Replace WinEDA_TextFrame with wxSingleChoiceDialog. 2011-04-19 10:28:34 -04:00
Wayne Stambaugh 5c8894f928 Coding policy fixes and other minor improvements.
* Change class WinEDA_MsgPanel name to EDA_MSG_PANEL per coding policy.
* Change some old set message panel code in PCBNew with updated message
  panel methods in EDA_DRAW_FRAME.
* Remove unused global function Affiche_1_Parametre.
* Minor Doxygen warning fixes.
2011-04-12 10:19:59 -04:00
jean-pierre charras f2b0e18510 Minor fixes to prepare wxWidget 2.9.1 use:
* store selected language by name instead of wx language id (that changes between wxWidgets version)
* accept always comma and point as flotating point separator.
2011-04-01 19:10:16 +02:00
Wayne Stambaugh 175fab48f8 EESchema multiple item hit testing and other minor improvements.
* Add item clarification context menu to EESchema when multiple unresolved
  items are found at the current cross hair position.
* Add collector class SCH_COLLECTOR for supporting multiple item hit testing.
* Removed bit wise masked filtering from schematic item hit testing.
* Removed all old hit testing functions and methods scattered about the
  EESchema source code.
* Move terminal point test function into SCH_SCREEN object.
* Fixed bug in terminal point test when terminating a bus to a label.
* Define the < operator for sorting schematic items.
* Add area calculation method to EDA_Rect item.
* Add method for returning an item's bitmap for menu display purposes.
* Add method for returning an item's menu text for menu display purposes.
* Changed EDA_ITEMS container from boost::ptr_vector to std::vector.
* Factor coordinate string conversion code from EDA_DRAW_FRAME to function
  CoordinateToString().
2011-03-25 15:16:05 -04:00
Wayne Stambaugh ee003180bc Global variable removal and minor Doxygen comment fixes.
* Remove global key press variable.  The key press is know passed to
  GeneralControl().
* Removed unused old mouse buttons global variable.
2011-02-22 11:43:03 -05:00
Wayne Stambaugh 73e38ce98c EESchema code refactoring and coding policy naming fixes.
* Move schematic wire and bus break code into schematic screen object.
* Move schematic test for dangling ends into schematic screen object.
* Remove left over debugging output in schematic screen object.
* Remove unused file eeschema/cleanup.cpp.
* Fix bug in schematic line object hit test algorithm.
* Fix a string concatenation compile error added in r2752.
* Rename class WinEDA_BasicFrame to EDA_BASE_FRAME.
* Rename class WinEDA_DrawFrame to EDA_DRAW_FRAME.
* Rename class WinEDA_DrawPanel to EDA_DRAW_PANEL.
2011-01-21 14:30:59 -05:00