コード例 #1
0
 def __init__(self, **kwargs):
     super(LapStatsView, self).__init__(**kwargs)
     self.register_event_type('on_config_updated')
     self.ids.lapstats.setControl(SettingsSwitch())
     self.ids.lapstats.bind(on_setting=self.on_lapstats_enabled)
     self.ids.predtime.setControl(SettingsSwitch())
     self.ids.predtime.bind(on_setting=self.on_predtime_enabled)
コード例 #2
0
    def config_updated(self, config):

        self.wifi_config = config.wifi_config
        Logger.debug("WifiConfig: got config: {}".format(self.wifi_config.to_json()))

        wifi_switch = self.ids.wifi_enabled
        wifi_switch.setControl(SettingsSwitch(active=self.wifi_config.active))
        wifi_switch.control.bind(active=self.on_wifi_enable_change)

        wifi_client_switch = self.ids.client_mode
        wifi_client_switch.setControl(SettingsSwitch(active=self.wifi_config.client_mode_active))
        wifi_client_switch.control.bind(active=self.on_client_mode_enable_change)

        wifi_ap_switch = self.ids.ap_mode
        wifi_ap_switch.setControl(SettingsSwitch(active=self.wifi_config.ap_mode_active))
        wifi_ap_switch.control.bind(active=self.on_ap_mode_enable_change)

        ap_encryption = self.ids.ap_encryption
        ap_encryption.bind(on_setting=self.on_ap_encryption)
        encryption_spinner = SettingsMappedSpinner()
        self.load_ap_encryption_spinner(encryption_spinner, self.wifi_config.ap_encryption)
        ap_encryption.setControl(encryption_spinner)

        ap_channel = self.ids.ap_channel
        channel_spinner = SettingsMappedSpinner()
        self.build_ap_channel_spinner(channel_spinner, str(self.wifi_config.ap_channel))
        ap_channel.bind(on_setting=self.on_ap_channel)
        ap_channel.setControl(channel_spinner)

        self.ids.client_ssid.text = self.wifi_config.client_ssid
        self.ids.client_password.text = self.wifi_config.client_password

        self.ids.ap_ssid.text = self.wifi_config.ap_ssid
        self.ids.ap_password.text = self.wifi_config.ap_password
コード例 #3
0
    def __init__(self, **kwargs):
        super(WirelessConfigView, self).__init__(**kwargs)
        self.register_event_type('on_config_updated')

        btEnable = kvFind(self, 'rcid', 'btEnable') 
        btEnable.bind(on_setting=self.on_bt_enable)
        btEnable.setControl(SettingsSwitch())
        
        #btConfig = kvFind(self, 'rcid', 'btconfig')
        #btConfig.bind(on_setting=self.on_bt_configure)
        #btConfig.setControl(SettingsButton(text='Configure', disabled=True))
        
        cellEnable = kvFind(self, 'rcid', 'cellEnable')
        cellEnable.bind(on_setting=self.on_cell_enable)
        cellEnable.setControl(SettingsSwitch())

        cellProvider = kvFind(self, 'rcid', 'cellprovider')
        cellProvider.bind(on_setting=self.on_cell_provider)
        apnSpinner = SettingsMappedSpinner()
        self.loadApnSettingsSpinner(apnSpinner)
        self.apnSpinner = apnSpinner
        cellProvider.setControl(apnSpinner)
    
        self.apnHostField = kvFind(self, 'rcid', 'apnHost')
        self.apnUserField = kvFind(self, 'rcid', 'apnUser')
        self.apnPassField = kvFind(self, 'rcid', 'apnPass')
コード例 #4
0
    def __init__(self, **kwargs):
        super(CANConfigView, self).__init__(**kwargs)
        self.register_event_type('on_config_updated')

        btEnable = kvFind(self, 'rcid', 'canEnabled')
        btEnable.bind(on_setting=self.on_can_enabled)
        btEnable.setControl(SettingsSwitch())
コード例 #5
0
    def init_view(self, rc_config):
        self.rc_config = rc_config
        if None in [self.base_dir, self.rc_config]:
            raise Exception('Invalid state for cellular config view')

        def init_listeners(dt):
            # We have to enable listeners later b/c Kivy seems to be triggering
            # the event internally, probably around widget setup,
            # causing on_modified to trigger
            self.ids.apn_host.bind(text=self.on_apn_host)
            self.ids.apn_user.bind(text=self.on_apn_user)
            self.ids.apn_pass.bind(text=self.on_apn_pass)

        cell_enable = self.ids.cell_enable
        cell_enable.setControl(
            SettingsSwitch(active=self.rc_config.connectivityConfig.cellConfig.
                           cellEnabled))
        cell_enable.control.bind(active=self.on_cell_change)

        cell_provider = self.ids.cell_provider
        cell_provider.bind(on_setting=self.on_cell_provider)
        apn_spinner = SettingsMappedSpinner()

        self.load_apn_settings_spinner(apn_spinner)
        self.apn_spinner = apn_spinner
        cell_provider.setControl(apn_spinner)
        self._update_from_config()
        Clock.schedule_once(init_listeners, 0.5)
        self.loaded = True
コード例 #6
0
 def __init__(self, **kwargs):
     super(SDLoggingControlView, self).__init__(**kwargs)
     self.view_loaded = False
     self.register_event_type('on_modified')
     settings = self.ids.enabled
     settings.bind(on_setting=self.on_setting_enabled)
     settings.setControl(SettingsSwitch())
コード例 #7
0
    def on_config_updated(self, rcpCfg):

        self.connectivityConfig = rcpCfg.connectivityConfig

        bg_stream_switch = self.ids.bgStream
        bg_stream_switch.setControl(SettingsSwitch(active=self.connectivityConfig.telemetryConfig.backgroundStreaming))
        bg_stream_switch.control.bind(active=self.on_bg_stream)
コード例 #8
0
    def config_updated(self, rcpCfg):

        cellEnable = kvFind(self, 'rcid', 'cellEnable')
        cellEnable.setControl(
            SettingsSwitch(
                active=rcpCfg.connectivityConfig.cellConfig.cellEnabled))
        cellEnable.control.bind(active=self.on_cell_change)

        cellProvider = kvFind(self, 'rcid', 'cellprovider')
        cellProvider.bind(on_setting=self.on_cell_provider)
        apnSpinner = SettingsMappedSpinner()

        self.loadApnSettingsSpinner(apnSpinner)
        self.apnSpinner = apnSpinner
        cellProvider.setControl(apnSpinner)

        self.apnHostField.text = rcpCfg.connectivityConfig.cellConfig.apnHost
        self.apnUserField.text = rcpCfg.connectivityConfig.cellConfig.apnUser
        self.apnPassField.text = rcpCfg.connectivityConfig.cellConfig.apnPass

        existingApnName = self.update_controls_state()
        if existingApnName:
            self.apnSpinner.text = existingApnName

        self.connectivityConfig = rcpCfg.connectivityConfig
コード例 #9
0
    def __init__(self, **kwargs):
        Builder.load_file(CAN_CONFIG_VIEW_KV)
        super(CANConfigView, self).__init__(**kwargs)

        self.register_event_type('on_config_updated')
        btEnable = self.ids.can_enabled
        btEnable.bind(on_setting=self.on_can_enabled)
        btEnable.setControl(SettingsSwitch())
コード例 #10
0
    def config_updated(self, config):
        self.config = config

        value = self.config.connectivityConfig.bluetoothConfig.btEnabled

        bluetooth_enabled = self.ids.bt_enable
        bluetooth_enabled.setControl(SettingsSwitch(active=value))
        bluetooth_enabled.control.bind(active=self.on_bluetooth_enabled_change)
コード例 #11
0
    def __init__(self, **kwargs):
        super(CANConfigView, self).__init__(**kwargs)
        self.can_config = None
        self.view_loaded = False

        self.register_event_type('on_config_updated')
        btEnable = self.ids.can_enabled
        btEnable.bind(on_setting=self.on_can_enabled)
        btEnable.setControl(SettingsSwitch())
コード例 #12
0
 def __init__(self, **kwargs):
     super(OBD2ChannelsView, self).__init__(**kwargs)
     self.register_event_type('on_config_updated')
     self.obd2Grid = kvFind(self, 'rcid', 'obd2grid')
     obd2Enable = kvFind(self, 'rcid', 'obd2enable')
     obd2Enable.bind(on_setting=self.on_obd2_enabled)
     obd2Enable.setControl(SettingsSwitch())
     
     self.obd2Settings = OBD2Settings()
     
     self.update_view_enabled()
コード例 #13
0
 def __init__(self, **kwargs):    
     super(TelemetryConfigView, self).__init__(**kwargs)
     self.register_event_type('on_config_updated')
 
     deviceId = kvFind(self, 'rcid', 'deviceId') 
     deviceId.bind(on_setting=self.on_device_id)
     deviceId.setControl(SettingsTextField())
     
     bgStream = kvFind(self, 'rcid', 'bgStream')
     bgStream.bind(on_setting=self.on_bg_stream)
     bgStream.setControl(SettingsSwitch())
コード例 #14
0
 def __init__(self, **kwargs):
     super(CANChannelsView, self).__init__(**kwargs)
     self.register_event_type('on_config_updated')
     self.can_grid = self.ids.can_grid
     self._base_dir = kwargs.get('base_dir')
     self.max_can_channels = 0
     can_channels_enable = self.ids.can_channels_enable
     can_channels_enable.bind(on_setting=self.on_can_channels_enabled)
     can_channels_enable.setControl(SettingsSwitch())
     self.update_view_enabled()
     self.can_filters = UnitsConversionFilters(self._base_dir)
     self._resource_cache = None
コード例 #15
0
    def __init__(self, **kwargs):
        super(CameraControlView, self).__init__(**kwargs)
        self.view_loaded = False
        self.register_event_type('on_modified')

        settings = self.ids.enabled
        settings.bind(on_setting=self.on_setting_enabled)
        settings.setControl(SettingsSwitch())

        camera_type = self.ids.makemodel
        camera_type.bind(on_setting=self._on_setting_makemodel)
        camera_type.setControl(CameraMakeModelSpinner())
コード例 #16
0
    def __init__(self, **kwargs):
        super(OBD2ChannelsView, self).__init__(**kwargs)
        self.register_event_type('on_config_updated')
        self.obd2_grid = self.ids.obd2grid
        obd2_enable = self.ids.obd2enable
        obd2_enable.bind(on_setting=self.on_obd2_enabled)
        obd2_enable.setControl(SettingsSwitch())
        self.base_dir = kwargs.get('base_dir')

        self.obd2_settings = OBD2Settings(base_dir=self.base_dir)

        self.update_view_enabled()
コード例 #17
0
    def init_view(self):
        if None in [self.base_dir, self.rc_config]:
            return

        cell_enable = self.ids.cell_enable
        cell_enable.setControl(
            SettingsSwitch(active=self.rc_config.connectivityConfig.cellConfig.
                           cellEnabled))
        cell_enable.control.bind(active=self.on_cell_change)

        cell_provider = self.ids.cell_provider
        cell_provider.bind(on_setting=self.on_cell_provider)
        apn_spinner = SettingsMappedSpinner()

        self.load_apn_settings_spinner(apn_spinner)
        self.apn_spinner = apn_spinner
        cell_provider.setControl(apn_spinner)
        self._update_from_config()
        self.loaded = True