Skip to content

Twomag

This module contains the TwoMagStirrer class, which is a wrapper for the TwoMagDevice class.

CLASS DESCRIPTION
TwoMagStirrer

A class that wraps the TwoMagDevice class and provides a higher level of abstraction for the 2Mag stirrer.

Documentation last updated: 2025-02-22

TwoMagStirrer

TwoMagStirrer(
    port: str,
    address: str = "A",
    model: str = MTP6,
    *,
    verbose: bool = False,
    simulation: bool = False,
    **kwargs,
)

Bases: Maker

2Mag stirrer class

ATTRIBUTE DESCRIPTION
address

The address of the device

TYPE: str

model

The model of the device

TYPE: str

power

Power of device in percentage

TYPE: int

speed

Speed of device in RPM

TYPE: int

connection_details

connection details for the device

TYPE: dict

device

device object that communicates with physical tool

TYPE: Device

flags

flags for the class

TYPE: SimpleNamespace[str, bool]

is_busy

whether the device is busy

TYPE: bool

is_connected

whether the device is connected

TYPE: bool

verbose

verbosity of class

TYPE: bool

METHOD DESCRIPTION
connect

connect to the device

disconnect

disconnect from the device

execute

execute task

resetFlags

reset all flags to class attribute _default_flags

run

alias for execute()

shutdown

shutdown procedure for tool

getPower

get the power of the device

getSpeed

get the speed of the device

getStatus

get the status of the device

setDefault

set the device to default

setPower

set the power of the device

setSpeed

set the speed of the device

start

start the device

stop

stop the device

Initialize a TwoMagStirrer object

PARAMETER DESCRIPTION
port

The port to which the device is connected

TYPE: str

address

The address of the device. Defaults to 'A'.

TYPE: str DEFAULT: 'A'

model

The model of the device. Defaults to MIXdrive.MTP6.

TYPE: str DEFAULT: MTP6

verbose

Whether to print out debug information. Defaults to False.

TYPE: bool DEFAULT: False

simulation

Whether to simulate the device. Defaults to False.

TYPE: bool DEFAULT: False

power property

power: int

Power of device in percentage

speed property

speed: int

Speed of device in RPM

getPower

getPower() -> int

Get the power of the device

RETURNS DESCRIPTION
int

The power of the device in percentage

TYPE: int

getSpeed

getSpeed() -> int

Get the speed of the device

RETURNS DESCRIPTION
int

The speed of the device in RPM

TYPE: int

getStatus

getStatus() -> tuple[str, str]

Get the status of the device

RETURNS DESCRIPTION
tuple[str, str]

tuple[str,str]: A tuple containing the status of the device

setDefault

setDefault() -> bool

Set the device to default

RETURNS DESCRIPTION
bool

Whether the device was set to default

TYPE: bool

setPower

setPower(power: int) -> int

Set the power of the device

PARAMETER DESCRIPTION
power

The power to set the device to

TYPE: int

RETURNS DESCRIPTION
int

The power of the device in percentage

TYPE: int

setSpeed

setSpeed(speed: int) -> int

Set the speed of the device

PARAMETER DESCRIPTION
speed

The speed to set the device to

TYPE: int

RETURNS DESCRIPTION
int

The speed of the device in RPM

TYPE: int

start

start() -> bool

Start the device

RETURNS DESCRIPTION
bool

Whether the device was started

TYPE: bool

stop

stop() -> bool

Stop the device

RETURNS DESCRIPTION
bool

Whether the device was stopped

TYPE: bool