开云体育

Locked Re: Add Numerical Display to Spped Table


 

Hi Bob,

I just did a CVS update and run to have a look at the value boxes on top of
the sliders and yes the font is pretty small. Even when you set the value to
255 the text only fills about 2/3 of the box width.

I had a play around with the box and font size by tweaking the following
lines:

a) In the DecVariableValue constructor I changed:
_value = new JTextField("0",4);
to
_value = new JTextField("0",3);

b) In SpeedTableVarValue.getRep I changed:

float newSize = (v.getFont().getSize()+0.5f)/2.f;
to
float newSize = v.getFont().getSize() * 0.8f;

This gives me a font size of about 10 and it makes a space between the
sliders of about 1 mm so the page does not change much and makes the text
quite readable.

Looking at the code I'm not really sure what actually determines the width
of the text box and what I tweaked may not have made a difference as with
the above settings there is almost room for another character.
That sounds like a big improvement over the way I left it. Could you commit those changes?

Also I see you mention some buttons that set the curve to some preset shapes
but they don't show up when I run the code. Maybe they are not checked-in
yet...
Sorry, I was behind on checking in the source. I just committed a couple of things:

a) The buttons on the speed table

b) Convenience fixes to the roster menu filehandling so that it goes to a reasonable place when it opens the first time, and it remembers where you were later.

c) A new "Speedometer" tool, available under the Development menu in the JmriDemo program. It times the interval between two input sensors going inactive or active and converts that to scale MPH. Still rudimentary, but I wanted to see how well it would actually work. Note that senors only work with LocoNet now; NCE/Lenz feedback is polled, and I don't have any code to do that.

More to follow...

Bob
--
--------------
Bob Jacobsen (Bob_Jacobsen@..., 510-486-7355, fax 510-495-2957)

Join [email protected] to automatically receive all group messages.