How to use the kervi.spine.Spine function in kervi

To help you get started, we’ve selected a few kervi 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 kervi / kervi / kervi / halx.py View on Github external
def logger(self):
        return Spine().log
github kervi / kervi / kervi / dashboards / __init__.py View on Github external
def __init__(self, panel_id, **kwargs):
        #KerviComponent.__init__(self, panel_id, "Dashboard-panel", name)
        self.spine = spine.Spine()
        self.panel_id = panel_id

        self.ui_parameters = {
            "title":kwargs.pop("title", ""),
            "width":kwargs.pop("width", 0),
            "height":kwargs.pop("height", 0),
            "userLog":kwargs.pop("user_log", False),
            "logLength":kwargs.pop("log_length", 5),
            "gauge_width":kwargs.pop("gauge_width", 0),
            "gauge_height":kwargs.pop("gauge_height", 0),
        }
        self.dashboard = None
        self.panel_id = panel_id
        self._user_groups = kwargs.pop("user_groups", [])
github kervi / kervi / kervi / dashboard.py View on Github external
def __init__(self, panels=None, **kwargs):
        #KerviComponent.__init__(self, panel_id, "Dashboard-panel", name)
        self.spine = spine.Spine()
        self.group_id = kwargs.get("title", None)
        self.ui_parameters = {
            "title":kwargs.get("title", ""),
            "width":kwargs.get("width", 0),
            "height":kwargs.get("height", 0),
            "gauge_width":kwargs.get("gauge_width", 0),
            "gauge_height":kwargs.get("gauge_height", 0),
            "panel_width":kwargs.get("panel_width", 0),
            "panel_height":kwargs.get("panel_height", 0),
        }
        self._dashboard = None
        self._user_groups = []
        self._panels = []

        for panel in panels:
            self.add_panel(panel)
github kervi / kervi / kervi / kervi / application / __init__.py View on Github external
self._logger.verbose("kervi version: %s", VERSION)

        import kervi.hal as hal
        hal_driver = hal._load(self.config.platform.driver)
        if hal_driver:
            self._logger.verbose("platform driver: %s", hal_driver)
            self._logger.verbose("board: %s", hal.get_board_name())
            
        from kervi.plugin.message_bus.bus_manager import BusManager
        self.bus_manager = BusManager(self._log_queue)
        self.config.network.ipc_root_port = nethelper.get_free_port([self.config.network.ipc_root_port])
        self.bus_manager.load("kervi-main", self.config.network.ipc_root_port, None, self.config.network.ipc_root_address)
        
        from kervi import spine
        self.spine = spine.Spine()
        self.spine.register_query_handler("GetApplicationInfo", self._get_application_info)
        self.spine.register_query_handler("getProcessInfo", self.get_process_info)
        self.spine.register_event_handler("modulePing", self._module_ping)
        self.spine.register_event_handler("processReady", self._process_ready, scope="app-" + self.config.application.id)
        self.spine.register_event_handler("WebAppReady", self._webapp_ready, scope="app-" + self.config.application.id)
        self.spine.register_event_handler("websocketReady", self._websocket_ready, scope="app-" + self.config.application.id)
        self._module_processes = []
        self._process_info = []
        self._process_info_lock = threading.Lock()

        self._kervi_modules = []
        self._kervi_modules_lock = threading.Lock()

        from kervi.storage.storage_manager import StorageManager
        self._storage_manager = StorageManager(self._log_queue)
github kervi / kervi / kervi / kervi / messaging / __init__.py View on Github external
def __init__(self, **kwargs):
        self.spine = kwargs.get("spine", Spine())
github kervi / kervi / kervi / build / lib / kervi / vision / camera.py View on Github external
def __init__(self, camera, mutex):
        KerviThread.__init__(self)
        self.spine = spine.Spine()
        self.alive = False
        self.camera = camera
        self.mutex = mutex
        if self.spine:
            self.spine.register_command_handler("startThreads", self._start_command)
            self.spine.register_command_handler("stopThreads", self._stop_command)
        #KerviThread.__init__(self)
github kervi / kervi / kervi / utility / component.py View on Github external
def __init__(self, component_id, component_type, name, **kwargs):
        self.spine = kwargs.get("spine", spine.Spine())
        self._component_id = component_id
        self._component_type = component_type
        self._admin_groups = kwargs.get("admin_groups", [])
        self._user_groups = kwargs.get("user_groups", [])
        self._user_groups += self.admin_groups
        self._name = name
        self._icon = None
        self._visible = True
        self._dashboard_links = []
        self._ui_parameters = {}
        self._settings = Settings(self.component_type + "_" + self.component_id)
        if self.spine:
            self.spine.log.debug("component created:{0}", self.component_id)
            self.spine.register_query_handler(
                "getDashboardComponents",
                self._get_dashboard_components,