Rev 18 | Rev 20 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 18 | Rev 19 | ||
|---|---|---|---|
| Line 227... | Line 227... | ||
| 227 | DisplayInfo[Observation].Units, Min[ItemIndex]); |
227 | DisplayInfo[Observation].Units, Min[ItemIndex]); |
| 228 | cur_rdg = ConveriMFDRaw2Data(Observation, |
228 | cur_rdg = ConveriMFDRaw2Data(Observation, |
| 229 | DisplayInfo[Observation].Units, DataVal); |
229 | DisplayInfo[Observation].Units, DataVal); |
| 230 | 230 | ||
| 231 | int dp_pos; // where to print the decimal place |
231 | int dp_pos; // where to print the decimal place |
| - | 232 | float scale = 1.0; |
|
| 232 | switch (DisplayInfo[Observation].DP) |
233 | switch (DisplayInfo[Observation].DP) |
| 233 | { |
234 | { |
| 234 | case 0: |
235 | case 0: |
| 235 | int_rdg = (int) (cur_rdg); |
- | |
| 236 | int_max = (int) (max_rdg); |
- | |
| 237 | int_min = (int) (min_rdg); |
236 | scale = 1.0; |
| 238 | dp_pos = 100; |
237 | dp_pos = 100; |
| 239 | break; |
238 | break; |
| 240 | case 1: |
239 | case 1: |
| 241 | int_rdg = (int) (cur_rdg * 10.0); |
- | |
| 242 | int_max = (int) (max_rdg * 10.0); |
- | |
| 243 | int_min = (int) (min_rdg * 10.0); |
240 | scale = 10.0; |
| 244 | dp_pos = 3; |
241 | dp_pos = 1; |
| 245 | break; |
242 | break; |
| 246 | case 2: |
243 | case 2: |
| 247 | int_rdg = (int) (cur_rdg * 100.0); |
- | |
| 248 | int_max = (int) (max_rdg * 100.0); |
- | |
| 249 | int_min = (int) (min_rdg * 100.0); |
244 | scale = 100.0; |
| 250 | dp_pos = 2; |
245 | dp_pos = 2; |
| 251 | break; |
246 | break; |
| 252 | } |
247 | } |
| - | 248 | int_rdg = (int) (cur_rdg * scale); |
|
| - | 249 | int_max = (int) (max_rdg * scale); |
|
| - | 250 | int_min = (int) (min_rdg * scale); |
|
| 253 | 251 | ||
| 254 | cur_rdg -= DisplayInfo[Observation].Low; |
252 | cur_rdg -= DisplayInfo[Observation].Low; |
| 255 | cur_rdg = 100 * cur_rdg |
253 | cur_rdg = 100 * cur_rdg |
| 256 | / (DisplayInfo[Observation].High |
254 | / (DisplayInfo[Observation].High |
| 257 | - DisplayInfo[Observation].Low); |
255 | - DisplayInfo[Observation].Low); |
| Line 264... | Line 262... | ||
| 264 | dial_draw_needle(dial1[dial]); |
262 | dial_draw_needle(dial1[dial]); |
| 265 | } |
263 | } |
| 266 | dial_draw_needle(dial0[dial]); |
264 | dial_draw_needle(dial0[dial]); |
| 267 | // print value overlaid by needle |
265 | // print value overlaid by needle |
| 268 | // this is actual reading |
266 | // this is actual reading |
| 269 | print_digits(20, 30, 5, dp_pos, int_rdg); |
267 | print_digits(30, 30, 5, dp_pos, int_rdg); |
| 270 | font_gotoxy(0,0); |
268 | font_gotoxy(0,0); |
| 271 | font_digits(5,dp_pos,int_min); |
269 | font_digits(5,dp_pos,int_min); |
| 272 | 270 | ||
| 273 | font_gotoxy(0,1); |
271 | font_gotoxy(0,1); |
| 274 | font_puts("Min"); |
272 | font_puts("Min"); |