[Ctk-developers] Command Line Modules: Constraints and defaults

Clarkson, Matt m.clarkson at ucl.ac.uk
Wed Jan 8 21:54:02 UTC 2014


Hi there,

John reported the error below to me.

Looks to me like the .xsl file in CTK could be at fault.

1. The integer spin box has a Qt default of [0,99].
2. The .xsl file applies a default of -999999999 to 999999999 but only if the constraints element does not exist. So, if it does exist, this bit is missed.
3. Then the default of 300 is clamped to 99.
4. Then the specific constraint of 1-9999 is applied

So, either steps 3 or 4 need the ordering reversed, or step 2 needs to apply this range regardless of whether the constrains element is present.

Can anyone advise? My XSD/XSLT/XML knowledge is limited.
Thanks

Matt


________________________________________
From: John Hipwell <j.hipwell at ucl.ac.uk>
Sent: 08 January 2014 18:04

It looks to me as though the CLI module parsing clips default values at
2 digits. For instance the following:

     <integer>
       <name>iterations</name>
       <longflag>mi</longflag>
       <description>Maximum number of iterations per level.</description>
       <label>Maximum number of iterations per level</label>
       <default>300</default>
       <constraints>
         <minimum>1</minimum>
         <maximum>9999</maximum>
         <step>1</step>
       </constraints>
     </integer>

results in a default value of '99' appearing in the corresponding text
box of the GUI. Has anyone noticed this?

Removing the constraints results in the correct value of '300' being
displayed.

Curious....
John






More information about the Ctk-developers mailing list