Esempio n. 1
0
            def cb_read(red_file, result):
                red_file.release()

                if result and result.data is not None:
                    self.brickd_conf = config_parser.parse(result.data.decode('utf-8'))
                    self.update_brickd_widget_data()
                else:
                    QtGui.QMessageBox.critical(get_main_window(),
                                               'Settings | Brickd',
                                               'Error reading brickd config file.')

                self.brickd_button_refresh_enabled(True)
                self.brickd_button_save_enabled(False)
Esempio n. 2
0
            def cb_read(red_file, result):
                red_file.release()

                if result and result.data is not None:
                    self.brickd_conf = config_parser.parse(
                        result.data.decode('utf-8'))
                    self.update_brickd_widget_data()
                else:
                    QtGui.QMessageBox.critical(
                        get_main_window(), 'Settings | Brickd',
                        'Error reading brickd config file.')

                self.brickd_button_refresh_enabled(True)
                self.brickd_button_save_enabled(False)
Esempio n. 3
0
    def cb_file_read(self, result):
        self.red_file_crc_error_count.release()

        if result.error == None:
            do_update = True
            config = config_parser.parse(result.data.decode('utf-8'))

            try:
                _ = int(config['crc_errors'])
            except:
                do_update = False

            if do_update:
                self.label_crc_errors.setText(config['crc_errors'])

        self.timer_update_crc_error_count.start(self.update_interval_crc_error_count)
Esempio n. 4
0
    def cb_file_read(self, result):
        self.red_file_crc_error_count.release()

        if result.error == None:
            do_update = True
            config = config_parser.parse(result.data.decode('utf-8'))

            try:
                _ = int(config['crc_errors'])
            except:
                do_update = False

            if do_update:
                self.label_crc_errors.setText(config['crc_errors'])

        self.timer_update_crc_error_count.start(self.update_interval_crc_error_count)
Esempio n. 5
0
    def cb_file_read(self, extension, result):
        self.red_file[extension].release()

        if result.error == None:
            config = config_parser.parse(result.data.decode('utf-8'))
            try:
                t = int(config['type'])
            except:
                t = 0

            if t == 2:
                self.tab_widget.addTab(RS485(self, extension, config), 'RS485')
            elif t == 4:
                self.tab_widget.addTab(Ethernet(self, extension, config), 'Ethernet')

        self.config_read_counter += 1

        if self.config_read_counter == 2:
            self.update_ui_state()
Esempio n. 6
0
    def cb_file_read(self, extension, result):
        self.red_file[extension].release()

        if result.error == None:
            config = config_parser.parse(result.data.decode('utf-8'))
            try:
                t = int(config['type'])
            except:
                t = 0

            if t == 2:
                self.tab_widget.addTab(RS485(self, extension, config), 'RS485')
            elif t == 4:
                self.tab_widget.addTab(Ethernet(self, extension, config),
                                       'Ethernet')

        self.config_read_counter += 1

        if self.config_read_counter == 2:
            self.update_ui_state()
Esempio n. 7
0
        def cb_file_read(ext, result):
            red_file[ext].release()
            self.completed_counter += 1

            if result.error == None:
                config = config_parser.parse(result.data.decode('utf-8'))

                try:
                    t = int(config['type'])
                except:
                    t = 0

                names = {
                    1: 'Chibi Extension',
                    2: 'RS485 Extension',
                    3: 'WIFI Extension',
                    4: 'Ethernet Extension',
                    5: 'WIFI Extension 2.0'
                }

                name = names[t] if t in names else 'Unknown'

                extension = 'ext' + str(ext)
                self.device_info.extensions[ext] = ExtensionInfo()
                self.device_info.extensions[ext].name = name
                self.device_info.extensions[
                    ext].extension_type = name + ' Extension'
                self.device_info.extensions[ext].position = extension
                self.device_info.extensions[ext].master_info = self.device_info

                self.extension_configs.append((ext, config))

                inventory.sync()

            if self.completed_counter == len(red_file):
                self.tab_extension.extension_query_finished(
                    self.extension_configs)

                if next_function != None:
                    QTimer.singleShot(250, next_function)
Esempio n. 8
0
    def cb_file_read(self, extension, result):
        self.red_file[extension].release()

        if result.error == None:
            config = config_parser.parse(result.data.decode('utf-8'))
            try:
                t = int(config['type'])
            except:
                t = 0

            if t == 2:
                self.tabbed_extension_widgets.append(RS485(self, extension, config))
                self.tab_widget.addTab(self.tabbed_extension_widgets[len(self.tabbed_extension_widgets) - 1],
                                       'RS485')
                self.tabbed_extension_widgets[len(self.tabbed_extension_widgets) - 1].start_update_data()
            elif t == 4:
                self.tabbed_extension_widgets.append(Ethernet(self, extension, config))
                self.tab_widget.addTab(self.tabbed_extension_widgets[len(self.tabbed_extension_widgets) - 1],
                                       'Ethernet')
                self.tabbed_extension_widgets[len(self.tabbed_extension_widgets) - 1].start_update_data()
            else:
                extension_name = 'Unknown Extension'
                if t == 1:
                    extension_name = 'Chibi Extension'
                elif t == 3:
                    extension_name = 'WIFI Extension'
                elif t == 5:
                    extension_name = 'WIFI Extension 2.0'

                self.tabbed_extension_widgets.append(Unsupported(self, extension, config))
                self.tab_widget.addTab(self.tabbed_extension_widgets[len(self.tabbed_extension_widgets) - 1],
                                       extension_name)
                self.tabbed_extension_widgets[len(self.tabbed_extension_widgets) - 1].start_update_data()

        self.config_read_counter += 1

        if self.config_read_counter == 2:
            self.update_ui_state()
Esempio n. 9
0
    def cb_file_read(self, extension, result):
        self.red_file[extension].release()

        if result.error == None:
            config = config_parser.parse(result.data.decode('utf-8'))
            try:
                t = int(config['type'])
            except:
                t = 0

            if t == 2:
                self.tabbed_extension_widgets.append(RS485(self, extension, config))
                self.tab_widget.addTab(self.tabbed_extension_widgets[len(self.tabbed_extension_widgets) - 1],
                                       'RS485')
                self.tabbed_extension_widgets[len(self.tabbed_extension_widgets) - 1].start_update_data()
            elif t == 4:
                self.tabbed_extension_widgets.append(Ethernet(self, extension, config))
                self.tab_widget.addTab(self.tabbed_extension_widgets[len(self.tabbed_extension_widgets) - 1],
                                       'Ethernet')
                self.tabbed_extension_widgets[len(self.tabbed_extension_widgets) - 1].start_update_data()
            else:
                extension_name = 'Unknown Extension'
                if t == 1:
                    extension_name = 'Chibi Extension'
                elif t == 3:
                    extension_name = 'WIFI Extension'
                elif t == 5:
                    extension_name = 'WIFI Extension 2.0'

                self.tabbed_extension_widgets.append(Unsupported(self, extension, config))
                self.tab_widget.addTab(self.tabbed_extension_widgets[len(self.tabbed_extension_widgets) - 1],
                                       extension_name)
                self.tabbed_extension_widgets[len(self.tabbed_extension_widgets) - 1].start_update_data()

        self.config_read_counter += 1

        if self.config_read_counter == 2:
            self.update_ui_state()