1. 01 May, 2012 1 commit
  2. 25 Apr, 2012 1 commit
  3. 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
  4. 17 Apr, 2012 1 commit
  5. 11 Apr, 2012 1 commit
  6. 09 Apr, 2012 1 commit
  7. 07 Apr, 2012 1 commit
  8. 15 Mar, 2012 2 commits
  9. 08 Mar, 2012 1 commit
  10. 16 Feb, 2012 1 commit
  11. 15 Feb, 2012 1 commit
  12. 11 Feb, 2012 1 commit
  13. 09 Feb, 2012 1 commit
  14. 07 Feb, 2012 1 commit
  15. 01 Feb, 2012 1 commit
  16. 28 Jan, 2012 1 commit
  17. 25 Jan, 2012 1 commit
  18. 23 Jan, 2012 2 commits
  19. 22 Jan, 2012 1 commit
  20. 16 Jan, 2012 1 commit
  21. 04 Jan, 2012 1 commit
  22. 31 Dec, 2011 1 commit
  23. 29 Dec, 2011 1 commit
  24. 22 Dec, 2011 1 commit
  25. 18 Dec, 2011 1 commit
  26. 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
  27. 14 Dec, 2011 2 commits
  28. 12 Dec, 2011 2 commits
  29. 07 Dec, 2011 1 commit
  30. 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
  31. 28 Nov, 2011 1 commit
  32. 08 Nov, 2011 1 commit
    • Wayne Stambaugh's avatar
      Minor fixes, dead code removal, and coding policy fixes. · cd0b2316
      Wayne Stambaugh authored
      * Use version of DateAndTime that returns a wxString and delete the
        version that takes a char* as it is no longer required.
      * Merge StrNumICmp() and StrLenNumICmp() into StrLenNumCmp() to create a
        single function for comparing strings with integers and remove a lot
        of duplicate code.
      * Remove unused strupper from string.cpp.
      * Use wxArrayString for sorting the EDA_LIST_DIALOG contents.
      cd0b2316
  33. 20 Oct, 2011 1 commit
  34. 17 Oct, 2011 1 commit
    • Wayne Stambaugh's avatar
      Minor dialog fixes and code cleaning. · 2c251196
      Wayne Stambaugh authored
      * Grammar and spelling fixes in Eeschema, CvPcb, and Pcbnew path and
        library dialog tool tips.
      * Translate the French file name subrill.cpp to highlight.cpp.
      * Lots of coding style policy fixes.
      2c251196
  35. 16 Oct, 2011 1 commit