diff --git a/modules/helper/maptile.py b/modules/helper/maptile.py index 1d7474f9..b2b704f9 100644 --- a/modules/helper/maptile.py +++ b/modules/helper/maptile.py @@ -144,9 +144,10 @@ def get_headwind(wind_speed, wind_track, track): return np.nan if wind_speed == 0: return 0 + rad_diff = math.radians(wind_track-track) # plus: headwind, minus: tailwind - return round(math.cos(math.radians(wind_track-track)) * wind_speed, 1) - + return round(math.cos(rad_diff) * wind_speed, 1) + # abs(round(math.sin(rad_diff) * wind_speed, 1)) # crosswind def conv_image(image, map_name): res = None @@ -542,6 +543,7 @@ async def update_jpn_scw_timeline(self, map_settings, update_basetime): self.get_scw_lock = True f_name = self.update_jpn_scw_timeline.__name__ if not await self.config.network.open_bt_tethering(f_name): + self.get_scw_lock = False return # app_logger.info("get_scw_list connection start...") diff --git a/modules/helper/network.py b/modules/helper/network.py index 393a4b37..240bd24f 100644 --- a/modules/helper/network.py +++ b/modules/helper/network.py @@ -277,6 +277,8 @@ async def open_bt_tethering(self, f_name): if not self.config.G_AUTO_BT_TETHERING: return True + elif self.config.G_AUTO_BT_TETHERING and not self.config.G_BT_USE_ADDRESS: + return False if detect_network(): if bool(self.bt_tethering_status): @@ -316,6 +318,11 @@ async def close_bt_tethering(self, f_name): if not self.config.G_AUTO_BT_TETHERING: return True + elif self.config.G_AUTO_BT_TETHERING and not self.config.G_BT_USE_ADDRESS: + return True + + # if BT tethering is ON + # return True self.bt_tethering_status[f_name] = False if ( diff --git a/modules/pyqt/menu/pyqt_system_menu_widget.py b/modules/pyqt/menu/pyqt_system_menu_widget.py index b6ffc7a8..9d8eb3c9 100644 --- a/modules/pyqt/menu/pyqt_system_menu_widget.py +++ b/modules/pyqt/menu/pyqt_system_menu_widget.py @@ -155,6 +155,7 @@ def __init__(self, parent, page_name, config): super().__init__(parent=parent, page_name=page_name, config=config) def preprocess(self, run_bt_tethering=True): + super().preprocess() self.run_bt_tethering = run_bt_tethering def get_default_value(self):