def check_load_suggested_lap(self, new_session_id): sessions_view = self.ids.sessions_view if len(sessions_view.selected_laps) == 0: best_lap = self._datastore.get_channel_min('LapTime', [new_session_id], ['LapCount']) best_lap_id = best_lap[1] if best_lap_id: Logger.info( 'AnalysisView: Convenience selected a suggested session {} / lap {}' .format(new_session_id, best_lap_id)) main_chart = self.ids.mainchart main_chart.select_channels( AnalysisView.SUGGESTED_CHART_CHANNELS) self.ids.channelvalues.select_channels( AnalysisView.SUGGESTED_CHART_CHANNELS) sessions_view.select_lap(new_session_id, best_lap_id, True) HelpInfo.help_popup('suggested_lap', main_chart, arrow_pos='left_mid') else: Logger.info( 'AnalysisView: No best lap could be determined; selecting first lap by default for session {}' .format(new_session_id)) sessions_view.select_lap(new_session_id, 0, True)
def check_load_suggested_lap(self, new_session_id): sessions_view = self.ids.sessions_view if len(sessions_view.selected_laps) == 0: best_lap = self._datastore.get_channel_min('LapTime', [new_session_id], ['LapCount']) if best_lap: best_lap_id = best_lap[1] Logger.info('AnalysisView: Convenience selected a suggested session {} / lap {}'.format(new_session_id, best_lap_id)) sessions_view.select_lap(new_session_id, best_lap_id, True) main_chart = self.ids.mainchart main_chart.select_channels(AnalysisView.SUGGESTED_CHART_CHANNELS) HelpInfo.help_popup('suggested_lap', main_chart, arrow_pos='left_mid') else: Logger.warn('AnalysisView: Could not determine best lap for session {}'.format(new_session_id))
def check_load_suggested_lap(self, new_session_id): sessions_view = self.ids.sessions_view if len(sessions_view.selected_laps) == 0: if self._datastore.session_has_laps(new_session_id): best_lap = self._datastore.get_channel_min('LapTime', [new_session_id], ['LapCount']) best_lap_id = best_lap[1] if best_lap_id: Logger.info('AnalysisView: Convenience selected a suggested session {} / lap {}'.format(new_session_id, best_lap_id)) main_chart = self.ids.mainchart sessions_view.select_lap(new_session_id, best_lap_id, True) HelpInfo.help_popup('suggested_lap', main_chart, arrow_pos='left_mid') else: Logger.info('AnalysisView: No best lap could be determined; selecting first lap by default for session {}'.format(new_session_id)) sessions_view.select_lap(new_session_id, 1, True) else: sessions_view.select_lap(new_session_id, 1, True)
def _update_warning_msg(self): gps_cfg = self.gpsConfig if not gps_cfg: return warning_messages = [] if gps_cfg.sampleRate >= GPSChannelsView.SAMPLE_RATE_WARNING_THRESHOLD: warning_messages.append('- High sample rates requires optimal GPS conditions') if not (gps_cfg.positionEnabled and gps_cfg.distanceEnabled and gps_cfg.speedEnabled) or gps_cfg.sampleRate == 0: warning_messages.append('- Disabling these channels will also disable lap timing') warning_msg = '' warning = self.ids.warning warning_pane = self.ids.warning_pane warning_icon = self.ids.warning_icon if len(warning_messages) > 0: warning_msg = '' for msg in warning_messages: warning_msg += msg + '\n' warning_pane.size_hint_y = float(len(warning_messages) * 0.1) warning_icon.size_hint_y = 1.0 / len(warning_messages) warning.text = warning_msg Clock.schedule_once(lambda dt: HelpInfo.help_popup('gps_warning', self, arrow_pos='top_mid'), GPSChannelsView.GPS_WARNING_DELAY) else: warning_pane.size_hint_y = 0.0 warning_icon.size_hint_y = 1.0 warning.text = ''
def _init_view(self): databus = self._databus settings = self._settings self._init_global_gauges() # add the initial set of empty screens screens = self._screens screens += self._filter_dashboard_screens( self._settings.userPrefs.get_dashboard_screens()) for i in range(0, len(screens)): self.ids.carousel.add_widget(AnchorLayout()) # Find all of the global and set the objects they need gauges = list(kvFindClass(self, DigitalGauge)) for gauge in gauges: gauge.settings = settings gauge.data_bus = databus # Initialize our alert type widgets self._alert_widgets['pit_stop'] = PitstopTimerView(databus, 'Pit Stop') self._notify_preference_listeners() self._show_last_view() if self._rc_api.connected: self._race_setup() self._rc_api.add_connect_listener(self._on_rc_connect) self._initialized = True Clock.schedule_once( lambda dt: HelpInfo.help_popup( 'dashboard_gauge_help', self, arrow_pos='right_mid'), 2.0)
def _init_view(self): databus = self._databus settings = self._settings dashboard_state = self._dashboard_state self._init_global_gauges() # add the initial set of empty screens screens = self._screens screens += self._filter_dashboard_screens(self._settings.userPrefs.get_dashboard_screens()) for i in range (0, len(screens)): self.ids.carousel.add_widget(AnchorLayout()) # Find all of the global and set the objects they need gauges = list(kvFindClass(self, DigitalGauge)) for gauge in gauges: gauge.settings = settings gauge.data_bus = databus gauge.dashboard_state = dashboard_state # Initialize our alert type widgets self._alert_widgets['pit_stop'] = PitstopTimerView(databus, 'Pit Stop') self._notify_preference_listeners() self._show_last_view() if self._rc_api.connected: self._race_setup() self._rc_api.add_connect_listener(self._on_rc_connect) self._rc_api.addListener('alertmessage', self._on_alertmessage) self._initialized = True Clock.schedule_once(lambda dt: HelpInfo.help_popup('dashboard_gauge_help', self, arrow_pos='right_mid'), 2.0)
def updateControls(self): Logger.debug("ConfigView: data is stale: " + str(self.writeStale)) write_button = self.ids.write write_button.disabled = not self.writeStale write_button.pulsing = self.writeStale Clock.schedule_once( lambda dt: HelpInfo.help_popup( 'rc_write_config', self, arrow_pos='left_mid'), 1.0)
def init_view(self): self.init_datastore() mainchart = self.ids.mainchart mainchart.settings = self._settings mainchart.datastore = self._datastore channelvalues = self.ids.channelvalues channelvalues.datastore = self._datastore channelvalues.settings = self._settings self.ids.analysismap.track_manager = self._track_manager self.ids.analysismap.datastore = self._datastore Clock.schedule_once(lambda dt: HelpInfo.help_popup('beta_analysis_welcome', self, arrow_pos='right_mid'), 0.5)
def init_view(self): self.init_datastore() mainchart = self.ids.mainchart mainchart.settings = self._settings mainchart.datastore = self._datastore channelvalues = self.ids.channelvalues channelvalues.datastore = self._datastore channelvalues.settings = self._settings self.ids.analysismap.track_manager = self._track_manager self.ids.analysismap.datastore = self._datastore Clock.schedule_once( lambda dt: HelpInfo.help_popup( 'beta_analysis_welcome', self, arrow_pos='right_mid'), 0.5)
def _apply_preset(): channel_cfg.__dict__.update(obd2_preset.__dict__) Clock.schedule_once(lambda dt: HelpInfo.help_popup('obdii_preset_help', self, arrow_pos='left_mid'), 1.0) self.load_tabs()
def _wifi_modified(self): if is_mobile_platform(): Clock.schedule_once( lambda dt: HelpInfo.help_popup('wifi_warning', self.parent. parent), 1.0) self.dispatch('on_modified')
def _wifi_modified(self): if is_mobile_platform(): Clock.schedule_once(lambda dt: HelpInfo.help_popup('wifi_warning', self.parent.parent), 1.0) self.dispatch('on_modified')
def on_channel_selected(self, instance, channel_cfg): Clock.schedule_once( lambda dt: HelpInfo.help_popup( 'can_mapping_help', self, arrow_pos='left_mid'), 1.0)
def cancelled_track(): # user cancelled, store current location as where they cancelled # so we prevent bugging the user again self._settings.userPrefs.set_last_selected_track( 0, 0, str(self._gps_sample.geopoint)) HelpInfo.help_popup('lap_setup', self)
def cancelled_track(): # user cancelled, store current location as where they cancelled # so we prevent bugging the user again self._settings.userPrefs.set_last_selected_track(0, 0, str(self._gps_sample.geopoint)) HelpInfo.help_popup('lap_setup', self)