You're missing something. The GUI will never talk to the generator. It won't import a generator or have any knowledge that such a thing exists. The GUI will primarily interact with the operation class. It can query the operation to get the values for enumerations (comboboxes). It gets current operation property values and sets the UI controls to match. When the UI control contents change, it updates the operation and sets property values. If the operation is long-running like adaptive, it might have a button to tell the operation to terminate current recalculation. That's about it.onekk wrote: ↑Mon Jan 24, 2022 5:19 pmOK, better explanation:sliptonic wrote: ↑Mon Jan 24, 2022 5:05 pmThe GUI should never call the generator. It should have no knowledge that generators exist. That is coupling at a level we do not want. The implementation of generator logic should be done at the operation level.So in future we should have a Pocket operations, ...
Likewise the GUI should never handle Path commands/Gcode. The GUI handles user interaction. Controls, clicks, drags, etc.
The GUI will never generate directly GCode commands, it will simply pass the generator some data and pass to the Operation the GCode.
Some place for GCode generation will be left, but I could think of a pocket on which you could choose different strategies, like "spiral pocket", "plain pocket" "helical pockets" and so on and the GUI will call the appropriate generator and retrieve the Gcode to be put on Operation.
Or I'm missing something?
Sidebar: The GUI is also involved in configuring the target geometry that the operation will work on. That is a larger topic that I don't want to get into yet. Suffice to say that the GUI's role in that job will be minimal and the work of interpreting the user selection and building intermediate geometry will be handled outside the GUI.
In your example, The Gui would display a combobox with values like 'spiral pocket', 'zigzag' etc. The GUI knows nothing about these, just that they're values to show in a combobox. When the user selects one, the gui tells the operation, that the value of 'pattern' is now 'zigzag'. That's all the guI does.
The operation does the rest.