Rev 2212 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2212 | Rev 2214 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | *****************************************************************************/ |
35 | *****************************************************************************/ |
36 | //############################################################################ |
36 | //############################################################################ |
37 | //# HISTORY followme.c |
37 | //# HISTORY followme.c |
38 | //# |
38 | //# |
39 | //# |
39 | //# |
40 | //# |
40 | //# 14.10.2015 Starter |
41 | //# |
41 | //# - Added Offset to FollowMe |
- | 42 | //# - Stuff in FollowMeStep2 only for debug! |
|
42 | //# |
43 | //# |
43 | //# 22.09.2015 Starter |
44 | //# 22.09.2015 Starter |
44 | //# - FollowMeStep2 erweitert mit Kreisberechnung und test auf PKT |
45 | //# - FollowMeStep2 erweitert mit Kreisberechnung und test auf PKT |
45 | //# - PKT-Pos von lat lon auf latitude und longitude umbenannt |
46 | //# - PKT-Pos von lat lon auf latitude und longitude umbenannt |
46 | //# |
47 | //# |
Line 206... | Line 207... | ||
206 | int8_t xoffs; |
207 | int8_t xoffs; |
207 | int8_t yoffs; |
208 | int8_t yoffs; |
208 | Point_t FollowMe; |
209 | Point_t FollowMe; |
209 | uint8_t mktimeout = false; |
210 | uint8_t mktimeout = false; |
Line 210... | Line -... | ||
210 | - | ||
- | 211 | ||
- | 212 | nmeaPOS NMEApos; |
|
Line 211... | Line 213... | ||
211 | 213 | nmeaPOS NMEAtarget; |
|
Line 212... | Line 214... | ||
212 | 214 | ||
Line 492... | Line 494... | ||
492 | if( (NMEA.SatsInUse > 5) && (NMEA.SatFix == 1 || NMEA.SatFix == 2) ) |
494 | if( (NMEA.SatsInUse > 5) && (NMEA.SatFix == 1 || NMEA.SatFix == 2) ) |
493 | { |
495 | { |
494 | //Config.FM_Refresh |
496 | //Config.FM_Refresh |
Line 495... | Line 497... | ||
495 | 497 | ||
496 | // FollowMeStep2 |
498 | // FollowMeStep2 |
497 | followMeOffset.latitude = 2000; |
499 | followMeOffset.latitude = Config.FM_Offest_Latitude; |
- | 500 | followMeOffset.longitude = Config.FM_Offset_Longitude; |
|
- | 501 | ||
- | 502 | NMEApos.latitude = NMEA.Latitude; |
|
- | 503 | NMEApos.longitude = NMEA.Longitude; |
|
498 | followMeOffset.longitude = 2000; |
504 | |
Line 499... | Line 505... | ||
499 | followme_add_offset(&NMEA, &NMEA, &followMeOffset); |
505 | followme_add_offset(&NMEApos, &NMEAtarget, &followMeOffset); |
500 | 506 | ||
501 | FollowMe.Position.Status = NEWDATA; |
507 | FollowMe.Position.Status = NEWDATA; |
502 | FollowMe.Position.Longitude = NMEA.Longitude; |
508 | FollowMe.Position.Longitude = NMEAtarget.longitude; |
503 | FollowMe.Position.Latitude = NMEA.Latitude; |
509 | FollowMe.Position.Latitude = NMEAtarget.latitude; |
Line 504... | Line 510... | ||
504 | FollowMe.Position.Altitude = 1; // 20.7.2015 CB |
510 | FollowMe.Position.Altitude = 1; // 20.7.2015 CB |
505 | // FollowMe.Position.Altitude = NMEA.Altitude; // ist das wirklich ok? NEIN C.B. |
511 | // FollowMe.Position.Altitude = NMEA.Altitude; // ist das wirklich ok? NEIN C.B. |
Line 638... | Line 644... | ||
638 | } |
644 | } |
Line 639... | Line 645... | ||
639 | 645 | ||
640 | writex_gpspos( 1, 2, NMEApos.latitude, MNORMAL, 0,0 ); // GPS-Maus: Latitude |
646 | writex_gpspos( 1, 2, NMEApos.latitude, MNORMAL, 0,0 ); // GPS-Maus: Latitude |
Line 641... | Line 647... | ||
641 | writex_gpspos(10, 2, NMEApos.longitude, MNORMAL, 0,0 ); // GPS-Maus: Longitude |
647 | writex_gpspos(10, 2, NMEApos.longitude, MNORMAL, 0,0 ); // GPS-Maus: Longitude |
Line 642... | Line 648... | ||
642 | 648 | ||
643 | followme_calculate_offset(Config.FM_Distance, Config.FM_Azimuth, &followMeOffset); |
649 | followme_calculate_offset(Config.FM_Offset_Longitude, Config.FM_Offest_Latitude, &followMeOffset); |
644 | 650 | ||
645 | #ifdef DEBUG |
651 | #ifdef DEBUG |
646 | writex_gpspos( 1, 6, (int32_t)Config.FM_Azimuth*100, MNORMAL, 0, 0 ); |
652 | writex_gpspos( 1, 6, (int32_t)Config.FM_Offest_Latitude*100, MNORMAL, 0, 0 ); |
647 | writex_gpspos( 10, 6, (int32_t)Config.FM_Distance*100, MNORMAL, 0, 0 ); |
653 | writex_gpspos( 10, 6, (int32_t)Config.FM_Offset_Longitude*100, MNORMAL, 0, 0 ); |
Line 648... | Line 654... | ||
648 | writex_gpspos( 1, 7, (int32_t)followMeOffset.latitude*100, MNORMAL, 0, 0 ); |
654 | writex_gpspos( 1, 7, (int32_t)followMeOffset.latitude*100, MNORMAL, 0, 0 ); |
Line 671... | Line 677... | ||
671 | redraw = true; |
677 | redraw = true; |
672 | } |
678 | } |
Line 673... | Line 679... | ||
673 | 679 | ||
674 | if( get_key_press(1 << KEY_MINUS) ) |
680 | if( get_key_press(1 << KEY_MINUS) ) |
675 | { |
681 | { |
676 | Config.FM_Azimuth -= 10; |
682 | Config.FM_Offest_Latitude -= 10; |
677 | redraw = true; |
683 | redraw = true; |
678 | } |
684 | } |
679 | if( get_key_press(1 << KEY_PLUS) ) |
685 | if( get_key_press(1 << KEY_PLUS) ) |
680 | { |
686 | { |
681 | Config.FM_Azimuth += 10; |
687 | Config.FM_Offest_Latitude += 10; |
682 | redraw = true; |
688 | redraw = true; |
683 | } |
689 | } |
684 | } |
690 | } |