virtual_knitting_machine.knitting_machine_warnings.Carriage_Warning module
A module containing warnings related to carriage movements and positioning on knitting machines. This module provides warning classes for carriage position violations such as attempting to move the carriage beyond the machine’s physical needle bed boundaries.
- exception Carriage_Off_Edge_Warning(target_position, edge, left_most_needle, right_most_position)[source]
Bases:
Knitting_Machine_Warning
A warning for carriage movements that attempt to position the carriage beyond the machine’s edge boundaries. This warning occurs when the carriage is instructed to move to a position outside the valid needle range, and the position is automatically corrected to the nearest valid edge position.
- Parameters:
target_position (
int
)edge (
Carriage_Side
)left_most_needle (
int
)right_most_position (
int
)
- __init__(target_position, edge, left_most_needle, right_most_position)[source]
Initialize a carriage off-edge warning.
- Parameters:
target_position (int) – The originally requested carriage position that was out of bounds.
edge (Carriage_Side) – The side of the machine where the boundary was exceeded.
left_most_needle (int) – The leftmost valid needle position on the machine.
right_most_position (int) – The rightmost valid needle position on the machine.
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.