Exemple #1
0
    def __init__(self, pump: ContiFlowPump, sila2_conf):
        """
        Class initialiser.

        :param pump: A valid `qxmixpump.ContiFlowPump` for this service to use
        :param sila2_conf: The config of the server
        """

        self.pump = pump
        self.sila2_conf = sila2_conf
        self.system =  ApplicationSystem()

        self.ALLOWED_SWITCHING_MODES = {
            'SwitchingCrossFlow': ContiFlowSwitchingMode.CROSS_FLOW
            # more to come
        }

        logging.debug('Started server in mode: {mode}'.format(mode='Real'))

        try:
            self._restore_last_drive_position_counters()
            self._restore_last_contiflow_params()
        except NoSectionError as err:
            logging.error("No section for %s in SiLA2 config file: %s", self.pump.get_pump_name(), err)
        except (NoOptionError, KeyError) as err:
            logging.error("Cannot read config file option in %s", err)
            logging.error("Couldn't restore drive position counters and contiflow parameters. You'll need to re-configure the contiflow!")
Exemple #2
0
    def __init__(self, balance: SartoriusBalance = None):
        """Class initialiser"""

        self.balance = balance
        self.system = ApplicationSystem()

        logging.debug('Started server in mode: {mode}'.format(mode='Real'))
Exemple #3
0
    def __init__(self, pump: qmixpump.Pump):
        """Class initialiser"""

        logging.debug('Started server in mode: {mode}'.format(mode='Real'))

        self.pump = pump
        self.system = ApplicationSystem()
Exemple #4
0
    def __init__(self):
        """
        Class initialiser
        """

        self.system = ApplicationSystem()

        logging.debug('Started server in mode: {mode}'.format(mode='Real'))
    def __init__(self, valve: Valve = None, valve_gateway: ValveGatewayService = None):
        """Class initialiser"""

        logging.debug('Started server in mode: {mode}'.format(mode='Real'))

        self.valve = valve
        self.valve_gateway: ValveGatewayService = valve_gateway
        self.valve_positions: Dict[Valve, int] = dict()
        self.system = ApplicationSystem()
    def __init__(self):
        """
        Class initialiser

        :param channel_gateway: The ChannelGatewayService feature that provides
                                the channels that this feature can operate on
        """

        self.states = {True: 'On', False: 'Off'}
        self.system = ApplicationSystem()

        logging.debug('Started server in mode: {mode}'.format(mode='Real'))
    def __init__(self, pump: ContiFlowPump, simulation_mode: bool = True):
        """
        Class initialiser.

        :param pump: A valid `qxmixpump.ContiFlowPump` for this service to use
        :param simulation_mode: Sets whether at initialisation the simulation mode is active or the real mode.
        """

        self.pump = pump
        self.timer = PollingTimer(30000)
        self.system = ApplicationSystem()

        logging.debug('Started server in mode: {mode}'.format(mode='Real'))
Exemple #8
0
    def __init__(self, pump: qmixpump.Pump, sila2_conf: ConfigParser):
        """Class initialiser"""

        logging.debug('Started server in mode: {mode}'.format(mode='Real'))

        self.CALIBRATION_TIMEOUT = 60  # seconds

        self.pump = pump
        self.calibration_uuid = str()
        self.sila2_conf = sila2_conf
        self.system = ApplicationSystem()

        self._restore_last_drive_position_counter()
    def __init__(self, axis_system: AxisSystem, device_properties: Dict[str,
                                                                        Any]):
        """
        Class initialiser.

        :param axis_system: The axis system that this feature shall operate on
        :param device_properties: Additional device properties that cannot be retrieved using QmixSDK functions
        """

        self.system = ApplicationSystem()
        self.axis_system = axis_system
        self.movement_uuid = ''

        self.axes: Dict[str, Axis] = {
            self.axis_system.get_axis_device(i).get_device_name():
            self.axis_system.get_axis_device(i)
            for i in range(self.axis_system.get_axes_count())
        }

        if 'jib_length' in device_properties:
            self.positioning_shape = \
                self._create_positioning_shape(device_properties['jib_length'])
        else:
            x_axis = self.axis_system.get_axis_device(0)
            y_axis = self.axis_system.get_axis_device(1)
            self.positioning_shape = geom.box(x_axis.get_position_min(),
                                              y_axis.get_position_min(),
                                              x_axis.get_position_max(),
                                              y_axis.get_position_max())
        # plt.plot(*self.positioning_shape.exterior.xy)
        # plt.savefig('fig.png')

        PROPERTY_SAFE_ROTATION_HEIGHT = 0
        try:
            # safe rotation height only supported by rotAXYS (non-360) but not by others
            self.axis_system.set_device_property(PROPERTY_SAFE_ROTATION_HEIGHT,
                                                 1)
        except DeviceError:
            pass

        logging.debug('Started server in mode: {mode}'.format(mode='Real'))
Exemple #10
0
    def __init__(self, axis_system: AxisSystem):
        """
        Class initialiser.

        :param axis_system: The axis system that this feature shall operate on
        """

        self.system = ApplicationSystem()
        self.axis_system = axis_system

        self.axes: Dict[str, Axis] = {
            self.axis_system.get_axis_device(i).get_device_name():
            self.axis_system.get_axis_device(i)
            for i in range(self.axis_system.get_axes_count())
        }
        self.uuid_to_axis: Dict[str, Axis] = dict()

        for name, axis in self.axes.items():
            unit = axis.get_position_unit()
            unit_string = (unit.prefix.name if unit.prefix.name != 'unit' else
                           '') + unit.unitid.name
            logging.debug(f"{name}, {unit_string}")

        logging.debug('Started server in mode: {mode}'.format(mode='Real'))