How to use the harvesters._private.core.observer.Observer function in harvesters

To help you get started, we’ve selected a few harvesters 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 genicam / harvesters_gui / src / harvesters_gui / _private / frontend / pyqt5 / device_list.py View on Github external
# limitations under the License.
#
# ----------------------------------------------------------------------------


# Standard library imports

# Related third party imports
from PyQt5.QtWidgets import QComboBox

# Local application/library specific imports
from harvesters._private.core.observer import Observer
from harvesters_gui._private.frontend.pyqt5.helper import get_system_font


class ComboBoxDeviceList(QComboBox, Observer):
    def __init__(self, parent=None):
        super().__init__(parent)
        self.setFont(get_system_font())

    def update(self):
        if self.parent().parent().harvester_core.has_revised_device_info_list:
            self.clear()
            separator = '::'
            for d in self.parent().parent().harvester_core.device_info_list:
                name = d.vendor
                name += separator
                name += d.model

                try:
                    _ = d.serial_number
                except:  # We know it's too broad:
github genicam / harvesters / src / harvesters / _private / frontend / pyqt5 / device_list.py View on Github external
# ----------------------------------------------------------------------------


# Standard library imports

# Related third party imports
from PyQt5.QtWidgets import QComboBox
from genicam2.gentl import NotImplementedException, NotAvailableException, \
    InvalidParameterException

# Local application/library specific imports
from harvesters._private.frontend.pyqt5.helper import get_system_font
from harvesters._private.core.observer import Observer


class ComboBox(QComboBox, Observer):
    def __init__(self, parent=None):
        super().__init__(parent)
        self.setFont(get_system_font())

    def update(self):
        if self.parent().parent().harvester_core.has_revised_device_info_list:
            self.clear()
            separator = '::'
            for d in self.parent().parent().harvester_core.device_info_list:
                name = d.parent.parent.vendor  # i.e., system.vendor
                name += separator
                name += d.vendor
                name += separator
                name += d.model
                if d.serial_number:
                    name += separator
github genicam / harvesters / harvesters / _private / frontend / pyqt5 / device_list.py View on Github external
#
# ----------------------------------------------------------------------------


# Standard library imports

# Related third party imports
from PyQt5.QtWidgets import QComboBox
from genicam2.gentl import NotImplementedException, NotAvailableException

# Local application/library specific imports
from harvesters._private.frontend.pyqt5.helper import get_system_font
from harvesters._private.core.observer import Observer


class ComboBox(QComboBox, Observer):
    def __init__(self, parent=None):
        super().__init__(parent)
        self.setFont(get_system_font())

    def update(self):
        if self.parent().parent().harvester_core.has_revised_device_info_list:
            self.clear()
            separator = '::'
            for d in self.parent().parent().harvester_core.device_info_list:
                name = d.parent.parent.vendor  # i.e., system.vendor
                name += separator
                name += d.vendor
                name += separator
                name += d.model
                if d.serial_number:
                    name += separator