actions Module

These are the actions that can be executed by the users.

class AYABInterface.actions.ActionMetaClass(name, bases, attributes)[source]

Bases: type

Metaclass for the actions.

This class makes sure each Action has tests.

If a class is named MyAction, each Action gets the method is_my_action() which returns False for all Actions expcept for MyAction it returns True.

__init__(name, bases, attributes)[source]

Create a new Action subclass.

class AYABInterface.actions.Action(*arguments)[source]

Bases: object

A base class for actions.

__eq__(other)[source]

Whether this object is equal to the other.

Return type:bool
__hash__()[source]

The hash of the object.

Return type:int
Returns:the hash() of the object
__init__(*arguments)[source]

Create a new Action.

Parameters:arguments (tuple) – The arguments passed to the action. These are also used to determine equality and the hash.
__repr__()[source]

Return this object as string.

Return type:str
__weakref__

list of weak references to the object (if defined)

is_action()

Test whether this is a Action.

Return type:bool
Returns:True
is_move_carriage_over_left_hall_sensor()

Test whether this is a MoveCarriageOverLeftHallSensor.

Return type:bool
Returns:False
is_move_carriage_to_the_left()

Test whether this is a MoveCarriageToTheLeft.

Return type:bool
Returns:False
is_move_carriage_to_the_right()

Test whether this is a MoveCarriageToTheRight.

Return type:bool
Returns:False
is_move_needles_into_position()

Test whether this is a MoveNeedlesIntoPosition.

Return type:bool
Returns:False
is_put_color_in_nut_a()

Test whether this is a PutColorInNutA.

Return type:bool
Returns:False
is_put_color_in_nut_b()

Test whether this is a PutColorInNutB.

Return type:bool
Returns:False
is_switch_carriage_to_mode_kc()

Test whether this is a SwitchCarriageToModeKc.

Return type:bool
Returns:False
is_switch_carriage_to_mode_nl()

Test whether this is a SwitchCarriageToModeNl.

Return type:bool
Returns:False
is_switch_off_machine()

Test whether this is a SwitchOffMachine.

Return type:bool
Returns:False
is_switch_on_machine()

Test whether this is a SwitchOnMachine.

Return type:bool
Returns:False
class AYABInterface.actions.SwitchCarriageToModeKc(*arguments)[source]

Bases: AYABInterface.actions.Action

The user switches the mode of the carriage to KC.

is_switch_carriage_to_mode_kc()

Test whether this is a SwitchCarriageToModeKc.

Return type:bool
Returns:True
class AYABInterface.actions.SwitchCarriageToModeNl(*arguments)[source]

Bases: AYABInterface.actions.Action

The user switches the mode of the carriage to NL.

is_switch_carriage_to_mode_nl()

Test whether this is a SwitchCarriageToModeNl.

Return type:bool
Returns:True
class AYABInterface.actions.MoveCarriageOverLeftHallSensor(*arguments)[source]

Bases: AYABInterface.actions.Action

The user moves the carriage over the left hall sensor.

is_move_carriage_over_left_hall_sensor()

Test whether this is a MoveCarriageOverLeftHallSensor.

Return type:bool
Returns:True
class AYABInterface.actions.MoveCarriageToTheLeft(*arguments)[source]

Bases: AYABInterface.actions.Action

The user moves the carriage to the left.

is_move_carriage_to_the_left()

Test whether this is a MoveCarriageToTheLeft.

Return type:bool
Returns:True
class AYABInterface.actions.MoveCarriageToTheRight(*arguments)[source]

Bases: AYABInterface.actions.Action

The user moves the carriage to the right.

is_move_carriage_to_the_right()

Test whether this is a MoveCarriageToTheRight.

Return type:bool
Returns:True
class AYABInterface.actions.PutColorInNutA(*arguments)[source]

Bases: AYABInterface.actions.Action

The user puts a color into nut A.

is_put_color_in_nut_a()

Test whether this is a PutColorInNutA.

Return type:bool
Returns:True
class AYABInterface.actions.PutColorInNutB(*arguments)[source]

Bases: AYABInterface.actions.Action

The user puts a color into nut B.

is_put_color_in_nut_b()

Test whether this is a PutColorInNutB.

Return type:bool
Returns:True
class AYABInterface.actions.MoveNeedlesIntoPosition(*arguments)[source]

Bases: AYABInterface.actions.Action

The user moves needles into position.

is_move_needles_into_position()

Test whether this is a MoveNeedlesIntoPosition.

Return type:bool
Returns:True
class AYABInterface.actions.SwitchOffMachine(*arguments)[source]

Bases: AYABInterface.actions.Action

The user switches off the machine.

is_switch_off_machine()

Test whether this is a SwitchOffMachine.

Return type:bool
Returns:True
class AYABInterface.actions.SwitchOnMachine(*arguments)[source]

Bases: AYABInterface.actions.Action

The user switches on the machine.

is_switch_on_machine()

Test whether this is a SwitchOnMachine.

Return type:bool
Returns:True