Writing support for new print drivers
Much like the rest of Photonic3d, printer drivers can be created rather easily.
Writing support for a new Printer Driver requires two steps:
First let's tackle step 1. Here are the methods you'll need to implement for the printer controls page. None of these methods are required for actual printing, but if you'd like to to use all of the buttons on the print controls page, they will require an implementation:
`public String executeSetAbsolutePositioning()`
`public String executeSetRelativePositioning()`
`public String executeMoveX(double dist)`
`public String executeMoveY(double dist)`
`public String executeMoveZ(double dist)`
`public String executeMotorsOn()`
`public String executeMotorsOff()`
`public String executeXHome()`
`public String executeYHome()`
`public String executeZHome()`
`public String executeHomeAll()`
`public String executeSingleCommand(String cmd)`: This method is already implemented, but may need to be overridden in the event your printer doesn't use a serial port to communicate.
The following methods are required to print:
`public String readWelcomeChitChatFromFirmwareSerialPort() throws IOException`: Just leave the method blank if the printer doesn't have a chit chat when you first start communicating with it. In the future this method may be renamed to “initializePrinter()” or something more generic for none serial port based printers.
`public String executeCommands(PrintJob printJob, String commands, boolean stopSendingGCodeWhenPrintInactive) throws InappropriateDeviceException`: This method is the main work method, each of the templating commands(header, footer, preslice, pause, resume) will use this method to perform work. Here you will interpret the printer commands in whatever manner you deem necessary.
Step 2: Add your printer driver to the list of printer drivers in your `config.properties` file:
- class name(must extend `org.area515.resinprinter.gcode.PrinterController`)
driver name(the name that is saved in your printer configuration)
pretty name(the name shown in the Photonic3d gui)
Here is the json format for the printer drivers line:
Here are a few examples of print drivers in Photonic3D: