Really a nice bit of ruby to toy around with...!
But there's a little problem using it on a localized (german) OS - as some of you may know we're using a comma to separate the decimal places (and a point for the thousands); but the protrude plugin can't handle that, every floating point value is truncated to the integer value.
@unknownuser said:
{"dmax"=>["65"], "7"=>[nil], "omin"=>["0"], "dmin"=>["35"], "hmax"=>["1"], "1"=>[nil], "tmin"=>["0"], "hmin"=>["1"]}
rcvd callback: "protrude()"
(values were 1,1 for hmin & and 1,7 for hmax)
If I call the 'Set Reasonable Values' function, the calculated values also use the decimal comma format - and protrude won't work, too.
@unknownuser said:
rcvd callback: "setReasonableValues()"
setResonableValues:
{"dmax"=>["65"], "00m"=>[nil], "omin"=>["0"], "dmin"=>["35"], "tmin"=>["0"], "60m"=>[nil], "hmin"=>["6"]}
rcvd callback: "protrude()"
(hmin=6,00m & omin=0,60m)
When trying values with a decimal point an error occurs:
@unknownuser said:
{"dmax"=>["65"], "omin"=>["0"], "dmin"=>["35"], "hmax"=>["1.7"], "tmin"=>["0"], "hmin"=>["1.1"]}
rcvd callback: "protrude()"
Error: #<ArgumentError: (eval):269:in to_l': Cannot convert "1.1" to Length> (eval):66:in
initialize'
(eval):63:in eval' (eval):66:in
initialize'
(eval):63:in `call'
The only workaround that will work is to adjust the numbers format (decimal point and comma separating the thousands) in windows itself, so SU will use the same number format as the plugin; the disadvantage is, every other program uses it as well.
Is there a (known) way to adjust the script to accept the comma values as well, or do I have to dig into ruby scripting myself...?
Regards,
Stefan