Details
The AYABInterface
subsystem is designed to manage the intricate interactions with the AYAB knitting machine. It establishes a clear separation of concerns, with the AYAB Application Interface
acting as the central orchestrator, handling high-level commands and maintaining the overall knitting pattern context. Communication with the physical machine is managed by the Communication Orchestrator
, which ensures structured message exchange. The Action Dispatcher
translates abstract knitting operations into concrete machine commands, while the Message Processor
interprets machine responses to update the application's internal state. Complementing these, the Machine State Query
component continuously assesses and provides the current physical configuration of the knitting machine, ensuring that both actions and communication are informed by real-time machine conditions.
AYAB Application Interface
The top-level interface for external applications, providing high-level control and status retrieval for the AYAB knitting machine. It acts as the orchestrator for user commands and machine interactions, and holds the overall knitting pattern context including colors
.
Communication Orchestrator
Manages the sequence of high-level communication with the AYAB machine. It initiates queries for machine state (e.g., carriage limits, needle positions) and coordinates the processing of incoming messages, ensuring a structured dialogue with the hardware.
Action Dispatcher
Translates high-level action requests (e.g., move carriage, switch machine on, put color) into specific, lower-level machine commands. It provides an abstraction layer for executing physical operations on the knitting machine, leveraging machine state and pattern data.
Message Processor
Responsible for parsing and interpreting raw messages received from the AYAB machine. It updates the application's internal state based on machine responses and triggers subsequent logic, crucial for the command/response pattern.
Machine State Query
Gathers and calculates the current operational state of the knitting machine, specifically focusing on needle positions and configurations. It provides critical feedback for application logic and state management. This component also encompasses the logic for determining carriage boundaries (left_end_needle
, right_end_needle
) and row-specific needle calculations (_get_row_needles
).