Message: range checking broken in 10.1? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None range checking broken in 10.1?  

Forum: (Graphical) User Interfaces
Date: 19 Feb, 2016
From: Ben Loer <Ben Loer>

I'm trying to define a new command and set range boundaries for the parameters using G4UIcommand::SetRange. According to the application developer's guide : "Use C++ notation, e.g., "x > 0 && x < 10", with variable name(s) defined by the SetParameterName() method. For the case of a G4ThreeVector, you can set the relation between parameters, e.g., "x > y".

But if I build a command within a messenger like
testcmd = new G4UIcmdWith3Vector("/test",this);
testcmd->SetParameterName("x","y","z",false);
testcmd->SetRange("x > 0 && y > x");
I get
PreInit> help /test         

Command /test
Guidance :
 Range of parameters : x > 0 && y > x

Parameter : x
 Parameter type  : d
 Omittable       : False

Parameter : y
 Parameter type  : d
 Omittable       : False

Parameter : z
 Parameter type  : d
 Omittable       : False

PreInit> /test 1 2 3        
parameter out of range: x > 0 && y > x

It seems to work OK for simpler statements that don't relate between parameters like "x>0". But I was originially working with a command consisting of a string, two doubles, and a unit and there even simple tests always failed.

Is there some magic incantation I'm missing here?

 Add Message Add Message
to: "range checking broken in 10.1? "

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]