Changing dial parameters
Is there a way to dynamically change the parameters of a dial. For example, a fuel gauge may be max of 20 gallons on one vehicle and 40 gallons on another. Is there a way to set the max of the gauge dynamically
-
This is from two months ago -- but here is my input.
1. The answer is yes with work.
2. You will have to create "scaled" values that are used on the gauge
3. You will also have to create/write the gauge major tick mark readings.
As an example -- we will start w/ your 20 gallon fuel tank configuration.
1. Assume the gauge is setup for values from 0 to 1000. 0 = 0 gallons and 1000 = 20 gallons
2. Assume 5 major tick marks (i.e. 0, 5, 10, 15, and 20 gallons). These convert to "scaled" values as (X/20) * 1000. where X = [0, 5, 10, 15, 20]
3. Actual "scaled" needle position = (Y/20) * 1000 where Y = fuel tank level in gallons
Based on this example -- you can see that the basic calibration equation from tank size to scale values is (X/Fuel Tank Size) * 1000.
Hope this help.
Ron Roth
Please sign in to leave a comment.
Comments
1 comment