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. 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
  3. 19 Feb, 2012 1 commit
  4. 23 Jan, 2012 1 commit
  5. 22 Jan, 2012 1 commit
  6. 16 Dec, 2011 1 commit
  7. 14 Dec, 2011 1 commit
  8. 12 Dec, 2011 1 commit
  9. 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
  10. 24 Nov, 2011 1 commit
  11. 15 Nov, 2011 1 commit
  12. 11 Nov, 2011 1 commit
  13. 01 Oct, 2011 1 commit
  14. 30 Sep, 2011 1 commit
    • Wayne Stambaugh's avatar
      Application name capitalization fixes. · 4b853ded
      Wayne Stambaugh authored
      * 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.
      4b853ded
  15. 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
  16. 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
  17. 06 Sep, 2011 1 commit
  18. 29 Aug, 2011 1 commit
  19. 12 Mar, 2011 1 commit
  20. 01 Mar, 2011 1 commit
    • Wayne Stambaugh's avatar
      PCBNew control update bug fixes, fixes lp:725963. · 1010601a
      Wayne Stambaugh authored
      * 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.
      1010601a
  21. 28 Feb, 2011 1 commit
  22. 25 Feb, 2011 1 commit
  23. 20 Jan, 2011 1 commit
    • Wayne Stambaugh's avatar
      Schematic object encapsulation and other minor improvements. · e560573c
      Wayne Stambaugh authored
      * Encapsulate file name member of base screen object.
      * Encapsulate associated screen member of schematic sheet object.
      * Create add screen method to schematic sheet object to simplify setting
        the associated screen.
      * Move the change file name code in the schematic sheet object to the edit
        sheet method in the schematic editor frame object to eliminate message
        dialogs.
      * Improve reference counting in schematic screen object.
      * Add helper type definitions for changing schematic object storage to C++
        containers.
      e560573c
  24. 19 Jan, 2011 1 commit
  25. 15 Jan, 2011 2 commits
  26. 08 Dec, 2010 1 commit
  27. 23 Aug, 2010 1 commit
  28. 19 Aug, 2010 1 commit
  29. 19 Apr, 2010 2 commits