(self,data,callback)
| 285 | callback({'success': 'no_error'}) |
| 286 | |
| 287 | def extrude(self,data,callback): |
| 288 | |
| 289 | pm = printerManager() |
| 290 | |
| 291 | if not pm.isOperational(): |
| 292 | callback("Printer is not operational", True) |
| 293 | return |
| 294 | |
| 295 | if pm.isPrinting(): |
| 296 | # do not extrude when a print job is running |
| 297 | callback("Printer is currently printing", True) |
| 298 | return |
| 299 | |
| 300 | amount = data["amount"] |
| 301 | speed = data["speed"] |
| 302 | tool = data["tool"] |
| 303 | |
| 304 | if not isinstance(amount, (int, long, float)): |
| 305 | callback("Not a number for extrusion amount: " + amount, True) |
| 306 | return |
| 307 | |
| 308 | if speed and not isinstance(speed, (int, long, float)): |
| 309 | speed = None |
| 310 | |
| 311 | pm.extrude(tool, amount, speed) |
| 312 | |
| 313 | callback({'success': 'no_error'}) |
| 314 | return |
| 315 | |
| 316 | def getNumberOfExtruders(self,data,sendResponse=None): |
| 317 | ppm = printerProfileManager() |
nothing calls this directly
no test coverage detected