From 5bfa50535a1dd4d13c2b60e3072129d70f889146 Mon Sep 17 00:00:00 2001 From: CaptainBandages <72171093+CaptainBandages@users.noreply.github.com> Date: Tue, 22 Jun 2021 15:08:25 -0700 Subject: [PATCH 1/2] Fix for F16 Entries When the coord's end in 0 , the 0 gets dropped and the jet won't take it. I'm no coder but this seemed to fix the entries for the F16. --- src/drivers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers.py b/src/drivers.py index 9197660..3bed43a 100644 --- a/src/drivers.py +++ b/src/drivers.py @@ -662,7 +662,7 @@ def enter_elevation(self, elev): self.icp_btn("ENTR") def enter_coords(self, latlong): - lat_str, lon_str = latlon_tostring(latlong, decimal_minutes_mode=True, easting_zfill=3, precision=3) + lat_str, lon_str = latlon_tostring(latlong, decimal_minutes_mode=True, easting_zfill=3, zfill_minutes=3, one_digit_seconds=False, precision=3) self.logger.debug(f"Entering coords string: {lat_str}, {lon_str}") if latlong.lat.degree > 0: @@ -699,4 +699,4 @@ def enter_waypoints(self, wps): self.icp_data("RTN") def enter_all(self, profile): - self.enter_waypoints(self.validate_waypoints(profile.all_waypoints_as_list)) \ No newline at end of file + self.enter_waypoints(self.validate_waypoints(profile.all_waypoints_as_list)) From b69a8c849dccdaf8688796f66a53457a85505597 Mon Sep 17 00:00:00 2001 From: CaptainBandages <72171093+CaptainBandages@users.noreply.github.com> Date: Thu, 24 Jun 2021 09:18:06 -0700 Subject: [PATCH 2/2] Viper Fix --- src/drivers.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/drivers.py b/src/drivers.py index 3bed43a..9a719cc 100644 --- a/src/drivers.py +++ b/src/drivers.py @@ -40,14 +40,14 @@ def latlon_tostring(latlong, decimal_minutes_mode=False, easting_zfill=2, zfill_ return lat_deg + lat_min + lat_sec, lon_deg + lon_min + lon_sec else: lat_deg = str(abs(round(latlong.lat.degree))) - lat_min = str(round(latlong.lat.decimal_minute, precision)) + lat_min = str(format(latlong.lat.decimal_minute, str(precision/10)+"f")) lat_min_split = lat_min.split(".") lat_min_split[0] = lat_min_split[0].zfill(zfill_minutes) lat_min = ".".join(lat_min_split) lon_deg = str(abs(round(latlong.lon.degree))).zfill(easting_zfill) - lon_min = str(round(latlong.lon.decimal_minute, precision)) + lon_min = str(format(latlong.lon.decimal_minute, str(precision/10)+"f")) lon_min_split = lon_min.split(".") lon_min_split[0] = lon_min_split[0].zfill(zfill_minutes) @@ -278,17 +278,6 @@ def stations_order(x): sorted_stations.append(stations[k]) self.lmdi("19") - self.lmdi("15") - # select stations - if 8 in stations: - self.lmdi("14") - if 2 in stations: - self.lmdi("11") - if 7 in stations: - self.lmdi("13") - if 3 in stations: - self.lmdi("12") - self.lmdi("15") self.lmdi("4") for msns in sorted_stations: @@ -301,7 +290,6 @@ def stations_order(x): n += 1 self.lmdi("13") - self.lmdi("6") def enter_all(self, profile): self.enter_missions(self.validate_waypoints(profile.msns_as_list)) @@ -662,7 +650,7 @@ def enter_elevation(self, elev): self.icp_btn("ENTR") def enter_coords(self, latlong): - lat_str, lon_str = latlon_tostring(latlong, decimal_minutes_mode=True, easting_zfill=3, zfill_minutes=3, one_digit_seconds=False, precision=3) + lat_str, lon_str = latlon_tostring(latlong, decimal_minutes_mode=True, easting_zfill=3, zfill_minutes=2, precision=3) self.logger.debug(f"Entering coords string: {lat_str}, {lon_str}") if latlong.lat.degree > 0: @@ -700,3 +688,4 @@ def enter_waypoints(self, wps): def enter_all(self, profile): self.enter_waypoints(self.validate_waypoints(profile.all_waypoints_as_list)) +