moggieuk / Happy-Hare

MMU software driver for Klipper (ERCF, Tradrack, Box Turtle, Night Owl, Angry Beaver, 3MS, ...)
GNU General Public License v3.0
506 stars 129 forks source link

Spoolman integration enhancements #332

Open CooperGerman opened 4 months ago

CooperGerman commented 4 months ago

Hi, firstly very big thanks for this outstanding work! I just switched my ercf v1.1b to HH and must say i am very happy with the proposed features as for now.

I don't know if this is the place to discuss this but i have several thoughts about the spoolman integration and would like to discuss some (and maybe contribute). See my fork of moonraker

In my previous setup i had added pre print checks to the ercf software based on the spoolman.py compoment enhancement.

The bold features are the one i managed to find in HH and i was wondering if it was planned to add the features I'm currently missing. I'm willing to try and rework my previous fork of moonraker in order to accomodate HH.

For future discussion, i found out about this PR in OrcaSlicer that might help for a very nice user experience. I learned that it is possible to use the "extra" field in order to store custom information, i was hoping to use it to store the gate mapping for the current machine there. For now i was using the location field with something like <hostname>:<slot_nb>.

Thanks again for all this great (and very well documented) work!

moggieuk commented 4 months ago

Sorry for the delay -- been traveling.

In reading your list and trying to infer the exact need, it sounds like almost all of this is available now, sans a little bit of custom macro to setup the TTG (tool-to-gate map) automatically prior to print.

Have a read of: https://github.com/moggieuk/Happy-Hare/wiki/Tool-and-Gate-Maps

I think the only thing needed would be to tack on the spoolman id to the "Slicer tool map".

Then the macro to setup TTG would be easy.

Let me know

CooperGerman commented 4 months ago

Hi, thanks for the reply, I'm not in a hurry :wink:

I've been carefully reading all your doc and code, and started adding some features into my own fork of HH.

I primarily wanted to keep the previous functionality i had working on my custom ercf software environment:

I understand a lot can be achieved through macros but i was willing to offer my help in order to develop a more builtin version.

I added a enable_remote_gate_map to the mmu_parameters.cfg file which enables setting the mmu_gate_map to be persistent in the spoolman db through the usage of a machine_name field (set to printer_hostname for now) and a mmu_gate_map field used to store to the gate number the spool is mapped to for machine machine_name.

My PR for now offers the above mentioned but is still in draft.

I really would like to add the following:

Thank you for taking the time to discuss this with me, have a nice day !

CooperGerman commented 4 months ago

335 has been updated with more detailed explanation of the implemented features

fluetke commented 1 month ago

thank you very much for your awesome work, may I just add one little idea to the spoolman enhancements:

Currently the slicer toolmap is generated from the gcode and colors of each tool are included depending on the slicers configuration, these colors are then displayed in the "extruder" section in mainsail. Would it be possible to instead use the info stored in spoolman, to display the tool colors in the extruder section?

It seems to me that the most up to date information on tool-colors and materials would come from the MMU_GATE_MAP (when spool-ids are assigned to all the gates), instead of the theoretical values stored in the slicers gcode (especially given the current issues with extruder_colour, vs. filament_colour).

Maybe I'm missing something, but I couldn't find info on how to achieve that.

CooperGerman commented 1 month ago

Hi, let me make sure i understand your point. I understand you would like for colors to be fetched from the spoolman db when being displayed in mainsail instead of the colors beeing retrieved from the slicer (metadata from the gcode file) ?

To me this looks like it is beeing supported as for now. You can indeed enable the spoolman feature in push/pull or readonly mode and it would then use attributes for the spools fetched from spoolman.

#
#                    | Activate/  | Fetch filament attributes | Filament gate    | Filament gate     |
#   spoolman_support | Deactivate | attributes from spoolman  | assignment shown | assignment pulled |
#                    | spool?     | based on spool_id?        | in spoolman db?  | from spoolman db? |
#   -----------------+------------+---------------------------+------------------+-------------------+
#        off         |     no     |           no              |        no        |        no         |
#        readonly    |     yes    |           yes             |        no        |        no         |
#        push        |     yes    |           yes             |        yes       |        no         |
#        pull        |     yes    |           yes             |        yes       |        yes        |

Also see : this section of the doc for info about GATE_MAP and this one for infor about extruder/filament color being displayed in mainsail

As i understand your point you would want to have the displayed colors in mainsail to match the ones set in the spoolman db ?

To me this behavior is the current one but if it isn't this might give birth to a git issue.

Side note: if slicer and db are not set up with matching names, colors etc... then the automap feature will be trickier to set up.

fluetke commented 1 month ago

I understand you would like for colors to be fetched from the spoolman db when being displayed in mainsail instead of the colors beeing retrieved from the slicer (metadata from the gcode file) ?

Yes, that is the behavior I was looking for, looks like I totally missed the section on mainsail/fluid integration.

Thank you so much for the clarification and the pointers in the right direction.