How to use the cfclient.ui.tab.Tab function in cfclient

To help you get started, we’ve selected a few cfclient examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bitcraze / crazyflie-clients-python / src / cfclient / ui / tabs / PlotTab.py View on Github external
if not index.isValid() or not 0 <= index.row() < len(self._nodes):
            return None
        if role == Qt.DisplayRole:
            return self._nodes[index.row()].name
        return None

    def reset(self):
        """Reset the model"""
        self._nodes = []
        self.layoutChanged.emit()

    def get_config(self, i):
        return self._nodes[i]


class PlotTab(Tab, plot_tab_class):
    """Tab for plotting logging data"""

    _log_data_signal = pyqtSignal(int, object, object)
    _log_error_signal = pyqtSignal(object, str)
    _disconnected_signal = pyqtSignal(str)
    _connected_signal = pyqtSignal(str)

    colors = [
        (60, 200, 60),    # green
        (40, 100, 255),   # blue
        (255, 130, 240),  # magenta
        (255, 26, 28),    # red
        (255, 170, 0),    # orange
        (40, 180, 240),   # cyan
        (153, 153, 153),  # grey
        (176, 96, 50),    # brown
github bitcraze / crazyflie-clients-python / src / cfclient / ui / tabs / ParamTab.py View on Github external
"""Re-implemented function for getting the flags for a certain index"""
        flag = super(ParamBlockModel, self).flags(index)
        node = index.internalPointer()
        if index.column() == 3 and node.parent and node.access == "RW":
            flag |= Qt.ItemIsEditable
        return flag

    def reset(self):
        """Reset the model"""
        self._nodes = []
        super(ParamBlockModel, self).beginResetModel()
        super(ParamBlockModel, self).endResetModel()
        self.layoutChanged.emit()


class ParamTab(Tab, param_tab_class):
    """
    Show all the parameters in the TOC and give the user the ability to edit
    them
    """
    _expand_all_signal = pyqtSignal()
    _connected_signal = pyqtSignal(str)
    _disconnected_signal = pyqtSignal(str)

    def __init__(self, tabWidget, helper, *args):
        """Create the parameter tab"""
        super(ParamTab, self).__init__(*args)
        self.setupUi(self)

        self.tabName = "Parameters"
        self.menuName = "Parameters"
github bitcraze / crazyflie-clients-python / src / cfclient / ui / tabs / QualisysTab.py View on Github external
self.discovering = True
        start_async_task(self._discover_qtm(interface))

    async def _discover_qtm(self, interface):
        try:
            async for qtm_instance in qtm.Discover(interface):
                info = qtm_instance.info.decode("utf-8").split(",")[0]
                self.discoveredQTM.emit(info, qtm_instance.host)

        except Exception as e:
            logger.info("Exception during qtm discovery: %s", e)

        self.discovering = False


class QualisysTab(Tab, qualisys_tab_class):
    """
        Tab for controlling the crazyflie using
        Qualisys Motion Capturing system
    """

    _connected_signal = pyqtSignal(str)
    _disconnected_signal = pyqtSignal(str)
    _log_data_signal = pyqtSignal(int, object, object)
    _log_error_signal = pyqtSignal(object, str)
    _param_updated_signal = pyqtSignal(str, str)
    _imu_data_signal = pyqtSignal(int, object, object)

    _flight_path_select_row = pyqtSignal(int)
    _flight_path_set_model = pyqtSignal(object)
    _path_selector_add_item = pyqtSignal(str)
    _path_selector_set_index = pyqtSignal(int)
github bitcraze / crazyflie-clients-python / src / cfclient / ui / tabs / LogTab.py View on Github external
import cfclient
from cfclient.ui.tab import Tab
from PyQt5 import QtWidgets
from PyQt5 import uic
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtCore import Qt

__author__ = 'Bitcraze AB'
__all__ = ['LogTab']

param_tab_class = uic.loadUiType(cfclient.module_path +
                                 "/ui/tabs/logTab.ui")[0]


class LogTab(Tab, param_tab_class):
    connectedSignal = pyqtSignal(str)
    disconnectedSignal = pyqtSignal(str)

    def __init__(self, tabWidget, helper, *args):
        super(LogTab, self).__init__(*args)
        self.setupUi(self)

        self.tabName = "Log TOC"
        self.menuName = "Log TOC"

        self.helper = helper
        self.tabWidget = tabWidget

        self.cf = helper.cf

        # Init the tree widget
github bitcraze / crazyflie-clients-python / src / cfclient / ui / tabs / LogBlockDebugTab.py View on Github external
"""

from PyQt5 import QtCore, QtWidgets, uic
from PyQt5.QtCore import Qt, pyqtSignal

import cfclient
from cfclient.ui.tab import Tab

__author__ = 'Bitcraze AB'
__all__ = ['LogBlockDebugTab']

logblock_tab_class = uic.loadUiType(cfclient.module_path +
                                    "/ui/tabs/logBlockDebugTab.ui")[0]


class LogBlockDebugTab(Tab, logblock_tab_class):
    """
    Used to show debug-information about log status.
    """

    _blocks_updated_signal = pyqtSignal(object, bool)
    _disconnected_signal = pyqtSignal(str)

    def __init__(self, tabWidget, helper, *args):
        super(LogBlockDebugTab, self).__init__(*args)
        self.setupUi(self)

        self.tabName = "Log Blocks Debugging"
        self.menuName = "Log Blocks Debugging"

        self._helper = helper
        self.tabWidget = tabWidget
github bitcraze / crazyflie-clients-python / src / cfclient / ui / tabs / GpsTab.py View on Github external
from PyQt4 import QtCore
from PyQt4 import QtGui
from PyQt4 import QtNetwork
from PyQt4 import QtWebKit
from PyQt4 import uic

__author__ = 'Bitcraze AB'
__all__ = ['GpsTab']

logger = logging.getLogger(__name__)

gps_tab_class = uic.loadUiType(cfclient.module_path +
                               "/ui/tabs/gpsTab.ui")[0]


class GpsTab(Tab, gps_tab_class):
    """Tab for plotting logging data"""

    _log_data_signal = pyqtSignal(int, object, object)
    _log_error_signal = pyqtSignal(object, str)

    _disconnected_signal = pyqtSignal(str)
    _connected_signal = pyqtSignal(str)
    _console_signal = pyqtSignal(str)

    def __init__(self, tabWidget, helper, *args):
        super(GpsTab, self).__init__(*args)
        self.setupUi(self)

        self.tabName = "GPS"
        self.menuName = "GPS"
github bitcraze / crazyflie-clients-python / src / cfclient / ui / tabs / LogBlockTab.py View on Github external
if hasattr(QSysInfo, 'MacintoshVersion') and \
                        QSysInfo.MacintoshVersion >= QSysInfo.MV_10_9 and \
                        style.state & QStyle.State_Enabled:
            self._paint_checkbox_osx_workaround(style, painter)
        else:
            QApplication.style().drawControl(
                QStyle.CE_CheckBox, style, painter)

    def _paint_checkbox_osx_workaround(self, style, painter):
        painter.save()
        painter.translate(style.rect.topLeft())
        QApplication.style().drawControl(QStyle.CE_CheckBox, style, painter)
        painter.restore()


class LogBlockTab(Tab, logblock_tab_class):
    """
    Used to show debug-information about logblock status.
    """

    _blocks_updated_signal = pyqtSignal(bool)
    _disconnected_signal = pyqtSignal(str)

    def __init__(self, tabWidget, helper, *args):
        """Initialize the tab"""
        super(LogBlockTab, self).__init__(*args)
        self.setupUi(self)

        self.tabName = "Log Blocks"
        self.menuName = "Log Blocks"

        self._helper = helper
github bitcraze / crazyflie-clients-python / lib / cfclient / ui / tabs / FlightTab.py View on Github external
from cfclient.ui.widgets.ai import AttitudeIndicator

from cfclient.utils.guiconfig import GuiConfig
from cflib.crazyflie.log import Log

from cfclient.ui.tab import Tab

from cfclient.utils.logconfigreader import LogVariable, LogConfig

flight_tab_class = uic.loadUiType(sys.path[0] +
                                  "/cfclient/ui/tabs/flightTab.ui")[0]

MAX_THRUST = 65365.0


class FlightTab(Tab, flight_tab_class):

    uiSetupReadySignal = pyqtSignal()

    _motor_data_signal = pyqtSignal(object)
    _imu_data_signal = pyqtSignal(object)
    _hover_data_signal = pyqtSignal(object)
    _baro_data_signal = pyqtSignal(object)

    _input_updated_signal = pyqtSignal(float, float, float, float, bool)
    _rp_trim_updated_signal = pyqtSignal(float, float)
    _emergency_stop_updated_signal = pyqtSignal(bool)

    #UI_DATA_UPDATE_FPS = 10

    connectionFinishedSignal = pyqtSignal(str)
    disconnectedSignal = pyqtSignal(str)
github bitcraze / crazyflie-clients-python / src / cfclient / ui / tabs / ConsoleTab.py View on Github external
from PyQt5 import uic
from PyQt5.QtCore import pyqtSignal

import cfclient
from cfclient.ui.tab import Tab

__author__ = 'Bitcraze AB'
__all__ = ['ConsoleTab']

logger = logging.getLogger(__name__)

console_tab_class = uic.loadUiType(cfclient.module_path +
                                   "/ui/tabs/consoleTab.ui")[0]


class ConsoleTab(Tab, console_tab_class):
    """Console tab for showing printouts from Crazyflie"""
    _connected_signal = pyqtSignal(str)
    _disconnected_signal = pyqtSignal(str)
    _update = pyqtSignal(str)

    def __init__(self, tabWidget, helper, *args):
        super(ConsoleTab, self).__init__(*args)
        self.setupUi(self)

        self.tabName = "Console"
        self.menuName = "Console"

        self.tabWidget = tabWidget
        self._helper = helper

        # Always wrap callbacks from Crazyflie API though QT Signal/Slots
github bitcraze / crazyflie-clients-python / src / cfclient / ui / tabs / ExampleTab.py View on Github external
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtWidgets import QMessageBox

import cfclient
from cfclient.ui.tab import Tab

__author__ = 'Bitcraze AB'
__all__ = ['ExampleTab']

logger = logging.getLogger(__name__)

example_tab_class = uic.loadUiType(cfclient.module_path +
                                   "/ui/tabs/exampleTab.ui")[0]


class ExampleTab(Tab, example_tab_class):
    """Tab for plotting logging data"""

    _connected_signal = pyqtSignal(str)
    _disconnected_signal = pyqtSignal(str)
    _log_data_signal = pyqtSignal(int, object, object)
    _log_error_signal = pyqtSignal(object, str)
    _param_updated_signal = pyqtSignal(str, str)

    def __init__(self, tabWidget, helper, *args):
        super(ExampleTab, self).__init__(*args)
        self.setupUi(self)

        self.tabName = "Example"
        self.menuName = "Example Tab"
        self.tabWidget = tabWidget