osecore.gui.cut_list¶
Package for code relating to creating a cut list in the GUI.
Name |
Description |
---|---|
Represents an item in a cut-list. |
|
Create a task panel to copy a cut-list to the user’s clipboard. |
|
Create a task panel to save a cut-list to the user’s filesystem. |
-
class
CutListItem
(quantity: str, description: str, length: str)¶ Bases:
tuple
Represents an item in a cut-list.
Used for typing purposes only.
-
property
description
¶ Alias for field number 1
-
property
length
¶ Alias for field number 2
-
property
quantity
¶ Alias for field number 0
-
property
-
create_copy_cut_list_to_clipboard_task_panel
(cut_list_items: List[osecore.gui.cut_list._create_cut_list_task_panel.cut_list_item.CutListItem], merge_cut_list_items_by_length: bool = False, note: Optional[str] = None) → osecore.gui.cut_list._create_cut_list_task_panel.task_panel.copy_cut_list_to_clipboard_task_panel.CopyCutListToClipboardTaskPanel¶ Create a task panel to copy a cut-list to the user’s clipboard.
Simple Usage
cut_list = [ {'quantity': '1', 'description': 'Foo', 'length': '3 in'}, {'quantity': '1', 'description': 'Bar', 'length': '3 in'}] panel = create_copy_cut_list_to_clipboard_task_panel(cut_list) Gui.Control.showDialog(panel)
Merge Cut List Items by Length
cut_list = [ {'quantity': '1', 'description': 'Foo', 'length': '3 in'}, {'quantity': '1', 'description': 'Bar', 'length': '3 in'}] panel = create_copy_cut_list_to_clipboard_task_panel(cut_list, merge_cut_list_items_by_length=True) Gui.Control.showDialog(panel)
- Parameters
cut_list_items (List[CutListItem]) – A cut list.
merge_cut_list_items_by_length (bool, optional) – Whether to merge cut-list items by length, defaults to
False
note (str, optional) – A note to display underneath cut-list table, defaults to None
- Returns
Copy Cut List to Clipboard Task Panel
- Return type
CopyCutListToClipboardTaskPanel
-
create_save_cut_list_to_file_task_panel
(cut_list_items: List[osecore.gui.cut_list._create_cut_list_task_panel.cut_list_item.CutListItem], merge_cut_list_items_by_length: bool = False, note: Optional[str] = None) → osecore.gui.cut_list._create_cut_list_task_panel.task_panel.save_cut_list_as_csv_task_panel.SaveCutListAsCsvTaskPanel¶ Create a task panel to save a cut-list to the user’s filesystem.
Simple Usage
cut_list = [ {'quantity': '1', 'description': 'Foo', 'length': '3 in'}, {'quantity': '1', 'description': 'Bar', 'length': '3 in'}] panel = create_save_cut_list_to_file_task_panel(cut_list) Gui.Control.showDialog(panel)
Merge Cut List Items by Length & Note
cut_list = [ {'quantity': '1', 'description': 'Foo', 'length': '3 in'}, {'quantity': '1', 'description': 'Bar', 'length': '3 in'}] panel = create_save_cut_list_to_file_task_panel(cut_list, merge_cut_list_items_by_length=True, note='example note') Gui.Control.showDialog(panel)
- Parameters
cut_list_items (List[CutListItem]) – A cut list.
merge_cut_list_items_by_length (bool, optional) – Whether to merge cut-list items by length, defaults to
False
note (str, optional) – A note to display underneath cut-list table, defaults to None
- Returns
Save Cut List to File Task Panel
- Return type
SaveCutListAsCsvTaskPanel