Navigation: Indicator Controls > Canvas Control >

Indexed With Decimal Selection

 

 

 

 

For the 7-Segment displays, a property of decimalPlace was added to allow selecting which decimal value to use, in the range of 7 to -7, so that a value such as 123.45 can be displayed across separate canvas controls.

 

0 = no selection

1 = 1's place

2 = 10's place

3 = 100's place

up to 7.

 

-1 = .1's place

-2 = .01's place

-3 = .001's place

down to -7

 

Due to math involved, some rounding errors can occur with decimal values, such as 0.6 showing 0.5.

 

The index math will take place after this decimal place selection. To properly scale to use the values as-is for each place, the following property values should be set:

indexMin =0    (for 10 image indexes, 0-9)

indexMax = 9

indexScaleMin = 0  (for the value range of 0 - 9)

indexScaleMax = 9

 

The example shown has decimalPlace values set from left to right as: 4, 3, 2, 1,    -1, -2, -3,-4,-5 and the value entered was: -66.34 for [ain0] ,which all used as the Update Value.

 

The negative sign can be achieved for that digit by turning off imageIndexOn and using the event code of:

<analog>!if [ain0] < 0 !then !this.backImage =indicators/7seg_-.jpg !else !this.backImage=indicators/7seg_.jpg

 

 

 

 

 

Copyright © 2024 SelmaWare Solutions, LLC