carriages Module

This module contains the carriages which are communicated by the firmware.

class AYABInterface.communication.carriages.NullCarriage(needle_position)[source]

Bases: AYABInterface.communication.carriages.Carriage

This is an empty carriage.

class AYABInterface.communication.carriages.KnitCarriage(needle_position)[source]

Bases: AYABInterface.communication.carriages.Carriage

The carriage for knitting.

is_knit_carriage()[source]

This is a knit carriage.

Return type:bool
Returns:True
class AYABInterface.communication.carriages.HoleCarriage(needle_position)[source]

Bases: AYABInterface.communication.carriages.Carriage

The carriage for creating holes.

is_hole_carriage()[source]

This is a knit carriage.

Return type:bool
Returns:True
class AYABInterface.communication.carriages.UnknownCarriage(needle_position)[source]

Bases: AYABInterface.communication.carriages.Carriage

The carriage type if the type is not known.

is_unknown_carriage()[source]

The type of this carriage is unknown.

Return type:bool
Returns:True
AYABInterface.communication.carriages.id_to_carriage_type(carriage_id)[source]

Return the carriage type for an id.

Return type:type
Returns:a subclass of Carriage
class AYABInterface.communication.carriages.Carriage(needle_position)[source]

Bases: object

A base class for carriages.

__init__(needle_position)[source]

Create a new carriage.

Parameters:needle_position (int) – the position of the carriage
__weakref__

list of weak references to the object (if defined)

is_hole_carriage()[source]

Whether this is a hole carriage.

Return type:bool
Returns:False
is_knit_carriage()[source]

Whether this is a knit carriage.

Return type:bool
Returns:False
is_unknown_carriage()[source]

Whether the type of this carriage is unkown.

Return type:bool
Returns:False
needle_position

The needle position of the carriages.

Returns:the needle position of the carriage counted from the left, starting with 0
Return type:int