machinekoder / NGCWriter

NGC (RS-274 GCode) output plugin for Cura
GNU Affero General Public License v3.0
6 stars 5 forks source link

Use GCodeWriter to obtain the input g-code #1

Closed Ghostkeeper closed 6 years ago

Ghostkeeper commented 6 years ago

In the current master version of Cura, this plug-in is broken because we changed the BuildPlateModel class in a recent refactor. I'm tasked to review your plug-in for inclusion in Cura's plug-in browser, but because we broke your API I'm helping you out a bit to fix the stuff that we broke in your plug-in... Sorry about that.

This change causes the plug-in to call Cura's g-code writer plug-in to obtain the original g-code. This will break less often when Ultimaker decides to change the way that it stores g-code internally, because the g-code writer will change accordingly. This should work with Cura 3.0, 3.1, 3.2 and the future 3.3.

This also causes post-processing plug-ins to function again with the NGCWriter.

Most of these changes are required because the GCodeWriter doesn't produce a list of layers but just one string of g-code. I think it simplifies a lot of code slightly.

Ghostkeeper commented 6 years ago

I've tested the plug-in after this change in our current master (soon to be the Cura 3.3 beta). It seems to work fine, so if this PR gets merged I'll upload the plug-in to our browser for Cura 3.3.

If not, let me know what we can do to make it work in 3.3.

Ghostkeeper commented 6 years ago

I can give you a build of our current Cura master branch if you need one to test with. Let me know.

machinekoder commented 6 years ago

@Ghostkeeper Looks good, the only thing weird is that it suggests .ngc.ngc as the file extensions in the file dialog of Cura 3.2.1, but I suppose that's fixed with 3.3.

Ghostkeeper commented 6 years ago

Nothing changed in that regard as far as I know though.

That sort of thing often depends on the operating system and how well Qt supports it. Maybe that's why I didn't see it.

machinekoder commented 6 years ago

Okay great.