quilt_knit.swatch.wale_wise_merging.Wale_Merge_Process module
Module containing the class structure for the Vertical Swatch Merge Process.
- class Merge_Comment(comment)[source]
Bases:
Knitout_Comment_LineSuper class of comments added during the merge process.
- add_follow_comment(comment_line)
Add a comment line to comments that follow this line.
- property comment_str: str
Get the comment as a formatted string.
- Returns:
The comment formatted as a string with appropriate formatting.
- execute(machine_state)
Execute the instruction on the machine state.
- Parameters:
machine_state (
Knitting_Machine) – The knitting machine state to update.- Return type:
- Returns:
True if the process completes an update.
- id_str()
Get string representation with original line number if present.
- Return type:
- Returns:
String with original line number added if present.
- class Pre_Merge_Comment[source]
Bases:
Merge_Comment- __init__()[source]
Initialize a comment line.
- Parameters:
comment – The comment text, or a Knitout_Line to convert to a comment.
- add_follow_comment(comment_line)
Add a comment line to comments that follow this line.
- property comment_str: str
Get the comment as a formatted string.
- Returns:
The comment formatted as a string with appropriate formatting.
- execute(machine_state)
Execute the instruction on the machine state.
- Parameters:
machine_state (
Knitting_Machine) – The knitting machine state to update.- Return type:
- Returns:
True if the process completes an update.
- id_str()
Get string representation with original line number if present.
- Return type:
- Returns:
String with original line number added if present.
- class Post_Merge_Comment[source]
Bases:
Merge_Comment- __init__()[source]
Initialize a comment line.
- Parameters:
comment – The comment text, or a Knitout_Line to convert to a comment.
- add_follow_comment(comment_line)
Add a comment line to comments that follow this line.
- property comment_str: str
Get the comment as a formatted string.
- Returns:
The comment formatted as a string with appropriate formatting.
- execute(machine_state)
Execute the instruction on the machine state.
- Parameters:
machine_state (
Knitting_Machine) – The knitting machine state to update.- Return type:
- Returns:
True if the process completes an update.
- id_str()
Get string representation with original line number if present.
- Return type:
- Returns:
String with original line number added if present.
- class Wale_Merge_Process(swatch_connection, seam_search_space=None, max_rack=3)[source]
Bases:
Merge_ProcessClass to manage the vertical merging of two swatches.
- Parameters:
swatch_connection (
Wale_Wise_Connection)seam_search_space (
Optional[Wale_Seam_Search_Space])max_rack (
int)
- __init__(swatch_connection, seam_search_space=None, max_rack=3)[source]
- Parameters:
swatch_connection (
Wale_Wise_Connection)seam_search_space (
Optional[Wale_Seam_Search_Space])max_rack (
int)
- property wale_wise_connection: Wale_Wise_Connection
Returns: Wale_Wise_Connection: The connection between the two swatches being merged.
- property seam_search_space: Wale_Seam_Search_Space
Returns: Wale_Seam_Search_Space: The seam search space between entrance-exit instructions along the swatch boundaries being merged.
- merge_swatches()[source]
Merges the swatches. The resulting program is written to self.merged_instructions and the machine state of the merge program is updated as the merge is completed.
- Return type:
- compile_to_dat(merge_name=None)
Creates a knitout file and compiled DAT file of the given merge name of the merged instructions from this merger.
- property current_swatch_all_needle_rack: bool
Returns: bool: True if the machine state of the current swatch is set to all needle rack. False, otherwise.
- property current_swatch_rack: int
Returns: int: The rack value of the machine state of the current swatch.
- get_merged_instructions()
Updates the merged instructions with comments specifying the origin swatch and updated line numbers for the merged program.
- Returns:
List of instructions in the merged program.
- Return type:
list[Knitout_Line]
- instruction_requires_release(next_instruction)
- Parameters:
next_instruction (Knitout_Line) – The next instruction to test if it requires a releasehook.
- Returns:
True if the specified next instruction would trigger a releasehook from the current merged program machine state.
- Return type: