knitout_to_dat_python.dat_file_structure.Dat_to_Knitout_Converter module
Module containing the Dat_to_Knitout_Converter class.
This module provides functionality to convert Shima Seiki DAT files back into knitout instructions. It handles the complete reverse conversion pipeline including DAT file reading, pixel decoding, instruction reconstruction, and knitout file generation.
- class Dat_to_Knitout_Converter(dat_filename: str, pattern_buffer: int = 4)[source]
Bases:
object
Class to convert a Shima Seiki Dat file to knitout instructions.
This class provides functionality to read DAT files, parse their pixel data and option lines, and convert them back into equivalent knitout instructions. It handles the complete reverse conversion pipeline including pixel decoding, instruction reconstruction, and knitout file generation.
- __init__(dat_filename: str, pattern_buffer: int = 4)[source]
Initialize a Dat_to_Knitout_Converter.
- Parameters:
dat_filename (
str
) – Path to the input DAT file to convert.pattern_buffer (
int, optional
) – Buffer space around the pattern. Defaults to 4.
- Raises:
ValueError – If DAT file format is invalid or cannot be processed.
AssertionError – If raster pattern width exceeds expected pattern width.
-
rasters:
list
[Pixel_Carriage_Pass_Converter
] List of converters for each pixel row.
-
process:
list
[Knitout_Instruction
|Carriage_Pass
] The converted knitout process instructions.
- Type:
list[Knitout_Instruction | Carriage_Pass]
-
executed_instructions:
list
[Knitout_Instruction
] List of individual executed instructions from the process.
- Type:
list[Knitout_Instruction]