revarbat / mandoline-py

A 3D printing STL-to-GCode slicer based on the Clipper library.
BSD 2-Clause "Simplified" License
87 stars 25 forks source link

Issues when adding new configurations #9

Open eduvillasr opened 3 years ago

eduvillasr commented 3 years ago

Thank you so much for this great library! I have been trying to add a power configuration named "power" in order to use it with my machine. However, I keep getting the following error:

C:\Users\edujo\Research>mandoline -S power=350 -w Loading configs from C:\Users\edujo\AppData\Local\Mandoline\Mandoline Ignoring unknown config option: power Saving configs to C:\Users\edujo\AppData\Local\Mandoline\Mandoline

I have already added the configuration into the dictionary in the slicer.py file as well as saved it as "power=350.0" in the txt file.

Here is the configuration in the dictionary:

('power', float, 350., (100., 500.), "Power (mm/s)"),


If possible, I would also love to get some help with the function of the configuration. I need it to display S2 = 350 (or whatever value) in the gcode it is outputting. This is the function that I created for it:

def power(self, filename):
    power = self.conf['power']
    power = 'S2='+power
    with open(filename, "w") as f:
        f.write(power)

Thank you so much for your help!