← Back to team overview

kicad-developers team mailing list archive

Re: Converting KiCAD to metric units: The approach


В сообщении от Понедельник 27 июня 2011 00:17:05 автор Dick Hollenbeck 
> Vladimir,
> The above sounds good.  Vladimir, I see your point to the two argument
> function, and find it superior to my suggestion.
> I see these being used in the load and save to disk functions.
> Let us know if you still want to do this work.  There will be no surprise
> to learn that you are no longer interested.  That would be typical in the
> open source world where egos get damaged, and volunteers decide how they
> are to do anything, and if they are to do anything.

I REALLY want to do this work. And I really do not want to be at loggerheads 
with KiCAD community.

> Vladimir, if you are no longer interested, at least be communicative.  
> Perhaps someone else can then put off painting his/her back porch a little

(It seems I do not completely understood english phraseology:))

> longer.   Not sure who that would be however.  So we do appreciate your
> efforts, sincerely.

I would say something like a 'final statement'.

> I think the feature you have brought up will be a valuable enhancement.
> According to Jean-Pierre's concerns, some of our integer arithmetic may
> begin to overflow as written.  We do have the option of putting a cast to
> 64 bit int on the temporary products of those calculations.  This is a
> fairly simple solution in some cases, and causes a modern day computer no
> grief.
> #define SCALE_WHAT  ?  // a constant int number
> int x;
> int y;
> int z;
> x =  ( int64_t( y ) * SCALE_WHAT ) / z;
> Wayne has pointed out that MS VC++ has no int64_t stuff and that there is a
> wx equivalent to assist poor little Microsoft.  Maybe we should simply
> define int64_t, if MS VC++, so we can use a int standard type rather than
> the wxInt64 (or whatever it is).    Unnecessary allegience to wx over pure
> C++ seems unnecessary.

I can even do 64 bit arithmetic having no 64 bit type at all. :)

> Thanks,
> Dick

I do things the way I do. :) Using classes is may debugging tool.

I can write the class, so it:
- will catch assignemts between length and non-length variables, track 
dimensions (length/area/volume/reciprocal length...) to help debug complex 
- will catch overflows (underflows, unwanted roundings);
- will do 64 bit arithmetics in safe way (even if there's no 64 bit data 
- will... (anything else i/you wish)

You all right in the sense that all the arithmetic can be done with plain int, 
but is it so easy to debug and mantain? I do not think so.

Wrapping short/int/longs in classes and typedefs is very popular in DSP world, 
as it very helps in terms of debuggability and portability, and it is already 
proven its potency.

If the community do not want to see this i will do not do it, i just let do 
this work to someone else.


--- KeyFP: DC07 D4C3 BB33 E596 CF5E  CEF9 D4E3 B618 65BA 2B61

Follow ups