← Back to team overview

kicad-developers team mailing list archive

Re: 0.1 degrees

 

I agree that a new wxValidator is the best way to go. From discussions
on IRC, people have been asking for:

a) ability to use "." or "," regardless of the language setting - assuming
no sensible person ever enters a thousands separator in CAD software
(I don't know any CAD software which accepts thousands separators).

b) ability to specify a unit as a suffix:  0.001m, 1mm, 0.03937in,
also 'mil' and for the Australians 'thou'.

People have also been asking to have angle suffixes: rad/deg/mrad
but in my opinion such a thing would have to be implemented in
a different validator - maybe an AngleFloatValidator vs a
UnitFloatValidator  - or else the validator will need to be able to
change its behavior based on some kind of flag.

The current input text boxes in my opinion have a number of bugs:
1. you can put alphabetic characters anywhere
2. if the unit is not known or a mistake is made then the conversion
result is "0" which is obviously wrong. In such a case the validator
should prevent the user from changing the value at all and somehow
signal the user of the mistake so the user can correct it. Naturally it
is impossible to tell if there is a mistake with "m" vs "mm".

If we implement a new validator which works on all platforms then
we can go back to the existing dialogs and fix their inconvenient
behavior.

- Cirilo

On Mon, Apr 11, 2016 at 11:12 PM, Chris Pavlina <pavlina.chris@xxxxxxxxx>
wrote:

> Making a derivative entry box is silly. If wxFloatingPointValidator is
> broken
> we should make a new wxValidator, not a new entry box, as that is the
> idiomatic
> way to do this in wx. I'm sure Wayne would concur on that. I'd have no
> problem
> developing that, too.
>
> On Mon, Apr 11, 2016 at 03:09:33PM +0200, jp charras wrote:
> > Le 11/04/2016 14:10, Chris Pavlina a écrit :
> > > ...why would I make some special entry box for this? What's wrong with
> what
> > > I've already done?
> >
> > Nothing really wrong, but:
> >
> > * At least on Windows, wxFloatingPointValidator does not work fine:
> >   - as long you are using the default language, it works.
> >   - if you are switching to an other language (in my case from French
> (default) to English, it does
> > not work anymore (neither the '.' nor the ',' are accepted, you cannot
> enter a value with mantissa)
> > This was already reported in a bug report (See
> https://bugs.launchpad.net/kicad/+bug/1568302).
> > * in all other dialogs which accept floating point coordinates, both the
> separators are accepted (.
> > or ,) and correctly parsed and the value is correctly converted, This is
> a very serious enhancement
> > for guys like me who are living in countries using the ',' as separator.
> >
> > So, I agree with Lorenzo: a derivative entry box which works on Windows,
> handles both separators and
> > returns the right value is better than a wxFloatingPointValidator which
> does not work very well.
> >
> > > On Apr 11, 2016 2:18 AM, "Lorenzo Marcantonio" <
> l.marcantonio@xxxxxxxxxxxxx>
> > > wrote:
> > >
> > >> On Sat, Apr 09, 2016 at 10:37:43AM -0400, Chris Pavlina wrote:
> > >>> Anyone mind if I go through and fix the "in 0.1 degrees" units that
> are
> > >> all
> > >>> over pcbnew? I don't see any reason why we can't let the user enter
> unit
> > >>> degrees with a decimal point.
> > >>
> > >> Probably stems for avoiding floats around the code, which is a good
> > >> idea... we sometime went thru horrible linear algebra things to avoid
> > >> trigonometric code and the resulting rounding issues.
> > >>
> > >> If you really want to fix it I'd suggest to make a derivative entry
> box
> > >> that handles it and returns the value in decidegrees. Look how the
> > >> current 'mils/inch/mm' entry box does it to centralize the
> > >> conversion/check.
> > >>
> > >> --
> > >> Lorenzo Marcantonio
> > >> CZ Srl - Parma
> > >>
> >
> >
> > --
> > Jean-Pierre CHARRAS
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help   : https://help.launchpad.net/ListHelp
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References