← Back to team overview

kicad-developers team mailing list archive

Re: specctra roundtripper

 

Le 11/04/2012 16:19, Wayne Stambaugh a écrit :
On 4/11/2012 6:47 AM, jean-pierre charras wrote:
Le 10/04/2012 18:31, Dick Hollenbeck a écrit :
I updated this to support the PCBNEW nanometers.

Might have broken something on the non-nanometer build, did not test
that.



Also, Jean-Pierre,

I think there is still some incompatibility in the zone hatches.
There may be too many of
them being constructed.

Might want to instrument the perimeter crosshatch line building code
with some printf()s
and see how many are being built in both compile modes.

There is a lot of CPU cycles being burned in crosshatch line drawing
from what I can tell.

I fixed this.
I also moved in convert_to_biu.h the function DMils2iu( int dmils ),
and added a new function Mils2iu( int mils ),
because we have *a lot* of constant values (in decimil and sometimes mils)
  in constructors and dialogs we need to convert to new units.
I am thinking all these values should be converted using one of these
functions, and never assigned
using something like:
#if defined( USE_PCBNEW_NANOMETRES )
     ...
#else
     ...
#endif

So if we have issues with nanometers, it will be more easy later to
modify pcbnew.

Also these functions could be useful in Cvpcb and Gerbview (in export to
pcbnew functions)



JP,

Please let me know if you are planning to add any more internal unit
conversion macros or functions to convert_to_iu.h.  I had already
created a base_units.h/cpp in my development tree with almost the exact
same conversion macro.  I want to prevent duplication as much as
possible.  For now, go ahead and keep convert_to_iu.h.  We can reconcile
the duplicate conversion code at a later date.  Also, you may want to
change Mils2iu to use wxRound() so it will work for negative values.  I
am also thinking that should use internal units for everything as much
as possible.  This would eliminate the need to constantly scale things
such as grid sizes, sheet references, and title blocks.  That way, all
scaling and offsetting is done in the base units which should simplify
things significantly.  I'm not sure when I will finish killing off
m_internalUnits.  It is proving more difficult that I had anticipated.

Wayne

Currently, Mils2iu() and DMils2iu() are enough to replace hard coded constants
in dialogs and constructors (mainly DMils2iu(), previously existing in pcbnew.h),
when needed.
More functions are needed to handle grid and zoom lists,
but I am thinking you are working on.

Perhaps you should commit your base_units.h/cpp files, to avoid duplicate work.

Thanks.

--
Jean-Pierre CHARRAS



Follow ups

References