1. 19 Apr, 2012 1 commit
    • Dick Hollenbeck's avatar
      // Dick Hollenbeck's KiROUND R&D · c24863c0
      Dick Hollenbeck authored
      // 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;
      }
      c24863c0
  2. 09 Apr, 2012 1 commit
  3. 26 Mar, 2012 1 commit
    • Wayne Stambaugh's avatar
      Minor code improvements and coding policy fixes. · 45445dd8
      Wayne Stambaugh authored
      * 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.
      45445dd8
  4. 26 Feb, 2012 1 commit
  5. 25 Feb, 2012 1 commit
  6. 08 Feb, 2012 1 commit
  7. 02 Feb, 2012 1 commit
  8. 23 Jan, 2012 1 commit
  9. 10 Jan, 2012 1 commit
  10. 27 Dec, 2011 1 commit
  11. 16 Dec, 2011 2 commits
    • Wayne Stambaugh's avatar
      Encapsulate EDA_APP class. · 0e27f45f
      Wayne Stambaugh authored
      0e27f45f
    • Wayne Stambaugh's avatar
      More encapsulation work and other minor improvements. · fac288cf
      Wayne Stambaugh authored
      * 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.
      fac288cf
  12. 14 Dec, 2011 2 commits
  13. 05 Dec, 2011 1 commit
    • Dick Hollenbeck's avatar
      ++PCBNew · b26580d5
      Dick Hollenbeck authored
        * 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()
      b26580d5
  14. 29 Nov, 2011 1 commit
  15. 26 Nov, 2011 1 commit
  16. 24 Nov, 2011 1 commit
  17. 15 Nov, 2011 1 commit
  18. 11 Nov, 2011 1 commit
  19. 10 Nov, 2011 1 commit
    • Wayne Stambaugh's avatar
      Memory allocation improvements and other minor fixes. · cc7e7fc5
      Wayne Stambaugh authored
      * 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.
      cc7e7fc5
  20. 01 Nov, 2011 1 commit
  21. 13 Oct, 2011 1 commit
    • Wayne Stambaugh's avatar
      Pcbnew auto save improvements. · 70569edb
      Wayne Stambaugh authored
      * Factor auto save common code into base frame class so all frame windows
        can take advantage of the shiny new auto save goodness.
      * Use a timer instead of depending on mouse and keyboard events to trigger
        an auto save.
      * Check for auto save file when opening a board and ask user if they
        wish to use the auto save file or the last saved board file.
      * Protect all base frame public members.
      70569edb
  22. 01 Oct, 2011 1 commit
  23. 23 Sep, 2011 1 commit
    • Wayne Stambaugh's avatar
      PCB common library header rationalization. · edd35b4e
      Wayne Stambaugh authored
      * 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.
      edd35b4e
  24. 17 Sep, 2011 1 commit
  25. 15 Sep, 2011 1 commit
  26. 11 Sep, 2011 1 commit
    • jean-pierre charras's avatar
      Fix issues with new icons: · b5d27a56
      jean-pierre charras authored
      * Replace use of wxICON by new icons declaration.
      * Remove unused files.
      * Fix filenames inconsistencies between old and new icons.
      * dialog_erc handle variable size icons in erc matrix.
      b5d27a56
  27. 07 Sep, 2011 1 commit
    • Wayne Stambaugh's avatar
      Lots and lots of PCBNew code cleaning and fix build bug introduced in r3108. · 0c443357
      Wayne Stambaugh authored
      * 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.
      0c443357
  28. 06 Sep, 2011 1 commit
  29. 01 Sep, 2011 1 commit
    • Wayne Stambaugh's avatar
      Add menu item function fixes and other minor improvements. · 4a7dc4ad
      Wayne Stambaugh authored
      * Rename all ADD_MENUITEM_* functions to AddMenuItem and move them to
        wxstruct.h since they are used by the Kicad main frame classes.
      * Move SET_BITMAP and SETBITMAPS definitions to wxstruct.h.
      * Fix a bug in SET_BITMAPS that prevented enabling menu item images on
        OSX.
      * Rename MsgItem to EDA_MSG_ITEM.
      * Remove redundant includes from modified files.
      * Doxygen and coding style policy fixes.
      4a7dc4ad
  30. 29 Aug, 2011 2 commits
  31. 28 Aug, 2011 1 commit
  32. 18 Aug, 2011 1 commit
    • Wayne Stambaugh's avatar
      Add user write permission tests to EESchama and other minor fixes. · c64a6937
      Wayne Stambaugh authored
      * Add general purpose user write permission test function to base
        window class.
      * Check user write permissions before saving project, schematic and
        library files.
      * Remove displaying file dialog every time the project file is saved.
      * Display absolute paths for non-root sheet file in title bar.
      * Remove redundant command table entry from schematic editor.
      * Remove unused variables to fix GCC 4.6 warnings.
      * The usual Doxygen comment and coding style policy fixes.
      c64a6937
  33. 03 Aug, 2011 1 commit
    • Wayne Stambaugh's avatar
      Change PCBNew and CVPCB 3D viewer focus behavior. (fixes lp:818890) · 04bf11c2
      Wayne Stambaugh authored
      * Raise 3D frame in PCB editor and module editor instead of displaying a message
        dialog indicating that the 3D viewer is already open.
      * Raise 3D viewer and module viewer in CVPCB to mimic the behavior changed in
        PCBNew.
      * Set focus to OpenGL canvas when creating 3D viewer so mouse wheel events
        are handled on Windows without having to click on the canvas.
      * Rename 3D viewer frame class from WinEDA3D_DrawFrame to EDA_3D_FRAME.
      * The usual smattering of coding policy fixes.
      04bf11c2
  34. 05 Jul, 2011 1 commit
  35. 22 May, 2011 1 commit
  36. 13 May, 2011 1 commit
  37. 13 Apr, 2011 1 commit