12-03-2014 09:33 AM
Hi to all,
I'm trying to get a numeric control with a suitable addition for the order of magnitude.
For example, I have a frontpanel for an osziloscope, sometimes I sample over a few ns, sometimes some seconds, sometimes a few milivolts, sometimes several volts, who knows, right 😉
I was playing around with the units of numeric controls, but this doesn't quite fit my needs. I can change the prefix of a unit on runtime, e.g. from microseconds to seconds, but then I have to change the number as well, because on changing the prefix, the previous number is only muliplied by the according factor, e.g. by 1000, so 5 us become 5e-6 s. So changing the record length from the default value of 500ms to 100ns would require two klicks and typing, and instead I can just type '100e-9' which is good as well.
However, I would like to have an numeric control from 0 to 1000 combined with e.g. a dial knob for the prefix i.e. nano, micro, mili etc. and combine this values internaly, i.e. mulitplying accordingly. But I couldn't set the increment to "3 orders of magnitude" even with the log scale option.
I'm aware, I could use an enum with the according names and values, but thats not very satisfying.
So maybe the question would be: Is it possible to combine two numeric control, one or the value and one for the prefix, in a suitable and easy way? Or how do you handle numerical values over several orders of magnitude in a case like mine?
Thanks for your answers in advance,
Best,
bastlwastl
Solved! Go to Solution.
12-03-2014 09:40 AM
Display format == SI units
It helps in these situations
12-03-2014 09:45 AM
12-03-2014 09:49 AM
I usually just use the SI notation in the display of my numerics. Then you can see the prefix as part of the control. You can actually type "1M" into any numeric control and the value will be 1,000,000.
12-03-2014 10:41 AM
Hi,
the display format in SI-units is nice, i didn't knew this. Thanks.
The "enum-solution" would require some kind of wrapping or extra code to get the correct value, and it will always be 2 objects. The "Display-format-solution" will give me the right value directly and it's only a single object, in case I want to change something programaticaly, like setting a readout value. Then code will get mesy when I have to distiguish between "single-object"-objects and "combined-object" where I have to respect to enum value etc.
Why complicated when it could be easy?
Thanks for your answers,
Best
bastlwastl
12-03-2014 10:49 AM - edited 12-03-2014 10:53 AM
@bastlwastl wrote:
Hi,