Closed peteruithoven closed 10 years ago
No, to prevent duplicating the firmware type check code I think i'm going to move it all to the client side and send the processed endcode with the stop api request.
Done, we now send the endcode with the API:printer/stop request.
The api printer/stop sends the endcode to for example home the printer and make it return to preheat temperature. Because the endcode can contain variables like {preheatTemperature} it needs to be processed, like also happens when generating the gcode for a print on the client side. Now this code is duplicated in the api. I think we do all the variable replacement in the API, this also takes away this responsibility for anyone who wants to use the API without the Doodle3D webinterface.
To support multiple printers the right endcode needs to be selected, according to the selected printer type. This would also need to be duplicated.