landam / grass-gis-git-migration-test

0 stars 0 forks source link

wxGUI: don't allow for negative column number #9

Open landam opened 5 years ago

landam commented 5 years ago

Reported by msieczka on 4 Sep 2008 11:51 UTC A command that requires a data table column number input, should not allow to enter a negative value. For example, in v.in.ascii one shouldn't be able to enter or select with the spin box e.g. z=-32 cat=-8.

GRASS GIS version and provenance

svn-trunk

Migrated-From: https://trac.osgeo.org/grass/ticket/278

landam commented 5 years ago

Attachment from @landam on 5 Sep 2008 13:09 UTC parse undef;min/max ranges https://trac.osgeo.org/grass/attachment/ticket/278/range-undef.diff

landam commented 5 years ago

Comment by @landam on 5 Sep 2008 13:09 UTC The attached patch allows to define ranges:

1- -> <1; undef)
-1- -> <-1; undef)
-1 -> (undef, 1>
--1 -> (undef, -1>
landam commented 5 years ago

Modified by marisn on 15 Nov 2008 18:36 UTC

landam commented 5 years ago

Comment by @landam on 28 Nov 2008 21:16 UTC ...any comments or objections to committing the patch?

landam commented 5 years ago

Comment by hamish on 29 Nov 2008 00:43 UTC the syntax is still a bit complicated / vague / tricky to me, e.g. how to set int_opt=-1 when you want to set just -1.0?

is the patch to help the programmer set opt_xcol->options = ">=1"; ? if so, why not add some magic code to parse <>= instead of a new & unintuitive "--1" "-1-" syntax? (ie not to say it is broken, just that it fails the transferable knowledge test badly)

for v.in.ascii, column >=0 checks added in https://trac.osgeo.org/grass/changeset/34608, https://trac.osgeo.org/grass/changeset/34609.

At this stage, we should not make new non-critical changes to lib/gis/parser.c in devbr6 IMHO. As the specific reported issue of v.in.ascii is fixed, changing bug's target to g7.

I leave GUI spinbox controls to others, but guess that it is dependent on parser support for ->options as above.

Hamish

landam commented 5 years ago

Comment by wenzeslaus on 22 Jul 2014 04:43 UTC

In GRASS, values > 0 should be now specified in C as:

...
opt->options = "1-";

and in Python as:

...
#% options: 1-

So, v.in.ascii needs this fix, so that standard Parser mechanism is used instead of custom error handling.

GUI now allows to input negative numbers but label contains "valid range 1-" and Run gives an standard error message generated by module (parser):

ERROR: Value <-4> out of range for parameter <x>
        Legal range: 1-

GUI would not allow to input values out of range if both limits would be specified. GUI needs to be improved, so it can handle also range with min or max only.

Modules using custom range handling, such as v.in.ascii, should be chanaged to use parser.

landam commented 5 years ago

Modified by @landam on 12 May 2016 06:42 UTC

landam commented 5 years ago

Modified by neteler on 2 Oct 2016 21:02 UTC

landam commented 5 years ago

Modified by neteler on 1 Mar 2018 23:02 UTC

landam commented 5 years ago

Modified by @landam on 28 Sep 2018 10:16 UTC

landam commented 5 years ago

Comment by neteler on 22 Oct 2018 20:50 UTC Ticket retargeted after milestone closed

landam commented 5 years ago

Comment by @landam on 11 Dec 2018 11:35 UTC Bump milestone to 7.4.4

landam commented 5 years ago

Comment by neteler on 4 Jan 2019 19:23 UTC Ticket retargeted after milestone closed