Rev 410 | Rev 453 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 410 | Rev 412 | ||
---|---|---|---|
Line 68... | Line 68... | ||
68 | char stats_item_0[] PROGMEM = "max Altitude:"; |
68 | char stats_item_0[] PROGMEM = "max Altitude:"; |
69 | char stats_item_1[] PROGMEM = "max Speed :"; |
69 | char stats_item_1[] PROGMEM = "max Speed :"; |
70 | char stats_item_2[] PROGMEM = "max Distance:"; |
70 | char stats_item_2[] PROGMEM = "max Distance:"; |
71 | char stats_item_3[] PROGMEM = "min voltage :"; |
71 | char stats_item_3[] PROGMEM = "min voltage :"; |
72 | char stats_item_4[] PROGMEM = "max time :"; |
72 | char stats_item_4[] PROGMEM = "max time :"; |
- | 73 | char stats_item_5[] PROGMEM = "longitude :"; |
|
- | 74 | char stats_item_6[] PROGMEM = "latitude :"; |
|
73 | char* stats_item_pointers[] PROGMEM = {stats_item_0, stats_item_1, stats_item_2, |
75 | char* stats_item_pointers[] PROGMEM = {stats_item_0, stats_item_1, stats_item_2, |
74 | stats_item_3, stats_item_4}; |
76 | stats_item_3, stats_item_4, stats_item_5, stats_item_6}; |
Line 75... | Line 77... | ||
75 | 77 | ||
76 | // store more fixed strings in progmen |
78 | // store more fixed strings in progmen |
77 | char ON[] PROGMEM = "ON "; |
79 | char ON[] PROGMEM = "ON "; |
Line 510... | Line 512... | ||
510 | // motors are on, assume we were/are flying |
512 | // motors are on, assume we were/are flying |
511 | COSD_FLAGS |= COSD_WASFLYING; |
513 | COSD_FLAGS |= COSD_WASFLYING; |
512 | } else { |
514 | } else { |
513 | // stats |
515 | // stats |
514 | if ((COSD_FLAGS & COSD_WASFLYING) && (COSD_FLAGS & COSD_FLAG_STATS)) { |
516 | if ((COSD_FLAGS & COSD_WASFLYING) && (COSD_FLAGS & COSD_FLAG_STATS)) { |
515 | write_ascii_string_pgm(2, 5, stats_item_pointers[0]); // max Altitude |
517 | write_ascii_string_pgm(2, 4, stats_item_pointers[0]); // max Altitude |
516 | write_ndigit_number_s(18, 5, max_Altimeter / 30, 1000, 0); |
518 | write_ndigit_number_s(18, 4, max_Altimeter / 30, 1000, 0); |
517 | write_char_xy(22, 5, 204); // small meters m |
519 | write_char_xy(22, 4, 204); // small meters m |
518 | write_ascii_string_pgm(2, 6, stats_item_pointers[1]); // max Speed |
520 | write_ascii_string_pgm(2, 5, stats_item_pointers[1]); // max Speed |
519 | write_ndigit_number_u(19, 6, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t)9) / (uint32_t)250), 100, 0); |
521 | write_ndigit_number_u(19, 5, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t)9) / (uint32_t)250), 100, 0); |
520 | write_char_xy(22, 6, 203); // km/h |
522 | write_char_xy(22, 5, 203); // km/h |
521 | write_ascii_string_pgm(2, 7, stats_item_pointers[2]); // max Distance |
523 | write_ascii_string_pgm(2, 6, stats_item_pointers[2]); // max Distance |
522 | write_ndigit_number_u(19, 7, max_Distance / 10, 100, 0); |
524 | write_ndigit_number_u(19, 6, max_Distance / 10, 100, 0); |
523 | write_char_xy(22, 7, 204); // small meters m |
525 | write_char_xy(22, 6, 204); // small meters m |
524 | write_ascii_string_pgm(2, 8, stats_item_pointers[3]); // min voltage |
526 | write_ascii_string_pgm(2, 7, stats_item_pointers[3]); // min voltage |
525 | write_ndigit_number_u_10th(18, 8, min_UBat, 100, 0); |
527 | write_ndigit_number_u_10th(18, 7, min_UBat, 100, 0); |
526 | write_char_xy(22, 8, 0x9E); // small v |
528 | write_char_xy(22, 7, 0x9E); // small v |
527 | write_ascii_string_pgm(2, 9, stats_item_pointers[4]); // max time |
529 | write_ascii_string_pgm(2, 8, stats_item_pointers[4]); // max time |
528 | write_time(16, 9, max_FlyingTime); |
530 | write_time(16, 8, max_FlyingTime); |
529 | write_char_xy(22, 9, 210); // fly clock |
531 | write_char_xy(22, 8, 210); // fly clock |
- | 532 | write_ascii_string_pgm(2, 9, stats_item_pointers[5]); // longitude |
|
- | 533 | write_gps_pos(15, 9, naviData.CurrentPosition.Longitude); |
|
- | 534 | write_ascii_string_pgm(2, 10, stats_item_pointers[6]); // latitude |
|
- | 535 | write_gps_pos(15, 10, naviData.CurrentPosition.Latitude); |
|
530 | } else if (COSD_FLAGS & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon |
536 | } else if (COSD_FLAGS & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon |
531 | draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll); |
537 | draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll); |
532 | } |
538 | } |
533 | } |
539 | } |
534 | if (COSD_FLAGS & COSD_FLAG_BIGVARIO) { |
540 | if (COSD_FLAGS & COSD_FLAG_BIGVARIO) { |
Line 568... | Line 574... | ||
568 | 574 | ||
569 | //write_number_s(8, 5, RxDataLen); |
575 | //write_number_s(8, 5, RxDataLen); |
Line 570... | Line 576... | ||
570 | //write_number_s(16, 5, setsReceived++); |
576 | //write_number_s(16, 5, setsReceived++); |
571 | 577 | ||
572 | // remember statistics (only when engines running) |
578 | // remember statistics (only when engines running) |
573 | if (naviData.MKFlags & FLAG_MOTOR_RUN) { |
579 | if (naviData.MKFlags & FLAG_MOTOR_RUN) { |
574 | if (naviData.Altimeter > max_Altimeter) max_Altimeter = naviData.Altimeter; |
580 | if (naviData.Altimeter > max_Altimeter) max_Altimeter = naviData.Altimeter; |
575 | if (naviData.GroundSpeed > max_GroundSpeed) max_GroundSpeed = naviData.GroundSpeed; |
581 | if (naviData.GroundSpeed > max_GroundSpeed) max_GroundSpeed = naviData.GroundSpeed; |
576 | if (naviData.HomePositionDeviation.Distance > max_Distance) { |
582 | if (naviData.HomePositionDeviation.Distance > max_Distance) { |
577 | max_Distance = naviData.HomePositionDeviation.Distance; |
583 | max_Distance = naviData.HomePositionDeviation.Distance; |
578 | } |
584 | } |
579 | if (naviData.UBat < min_UBat) min_UBat = naviData.UBat; |
585 | if (naviData.UBat < min_UBat) min_UBat = naviData.UBat; |
Line 580... | Line 586... | ||
580 | if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime; |
586 | if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime; |
581 | } |
587 | } |
582 | 588 | ||
583 | old_MKFlags = naviData.MKFlags; |
589 | old_MKFlags = naviData.MKFlags; |