virtual_knitting_machine.machine_components.Side_of_Needle_Bed module

Module containing the Carriage_Side enumeration for knitting machine carriage positioning.

This module defines the two sides of a knitting machine that the carriage can be positioned on and provides utility methods for determining appropriate movement directions from each side.

class Side_of_Needle_Bed(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Enumeration containing the two sides the machine carriage can be positioned on.

This enum provides methods for determining opposite sides and appropriate movement directions for continuing or reversing carriage movement from each side position.

Left_Side = 'Left_Side'
Right_Side = 'Right_Side'
property opposite: Side_of_Needle_Bed

Get the opposite side of the machine from this side.

Returns:

The opposite side of this carriage side.

Return type:

Side_of_Needle_Bed

slot(rightmost_slot=540)[source]
Parameters:

rightmost_slot (int, optional) – The number of needles on the needle bed used to determine the rightmost slot value. Defaults to 540.

Returns:

The slot number associated with this carriage side.

Return type:

int

__neg__()[source]

Get the opposite side using unary minus operator.

Returns:

The opposite carriage side.

Return type:

Side_of_Needle_Bed

__invert__()[source]

Get the opposite side using bitwise invert operator.

Returns:

The opposite carriage side.

Return type:

Side_of_Needle_Bed

__str__()[source]

Return string representation of the carriage side.

Returns:

String representation of the side value.

Return type:

str

__repr__()[source]

Return string representation of the carriage side.

Returns:

String representation of the side value.

Return type:

str

__lt__(other)[source]
Parameters:

other (Side_of_Needle_Bed | int | Slotted_Position) – The position on a needle bed to compare to.

Returns:

True if this is positioned to the left of the given position. False otherwise.

Return type:

bool

classmethod __contains__(member)

Return True if member is a member of this enum raises TypeError if member is not an enum member

note: in 3.12 TypeError will no longer be raised, and True will also be returned if member is the value of a member in this enum

classmethod __getitem__(name)

Return the member matching name.

classmethod __iter__()

Return members in definition order.

classmethod __len__()

Return the number of members (no aliases)