I am starting to look at implementing a plug in.. minor inconvenience of having to learn python first.. I wonder if someone could give me some pointers on how to get access to the gcode analysis data. I am specifically looking for the zmax/min and slice thickness values so I can determine a current slice count. I could not find the slice count/current slice data stored explicitly - the gcode viewer calculates it on the fly for display.
I am currently using the MQTT plug in to provide a published feed to Home Assistant. The existing Home Assistant Integration polls and gets upset when octoprint is offline. The only info I am missing for my planned interface is the slices/current slice. Still trying to determine if its something I can bolt on to the MQTT plugin, or if i will need to attack it another way. Very new to octoprint. MQ messaging expert.
I'm not sure if it will give you all the information you need, but from the python side you could retrieve the metadata of a file.
https://docs.octoprint.org/en/master/modules/filemanager.html#octoprint.filemanager.storage.StorageInterface.get_metadata
You pass it the internal path to the file so something like self._file_manager.get_metadata("local", "3DBenchy_PET_1.75.gcode")
should work to return what's stored in the metadata.
{
"3DBenchy_PET_1.75.gcode": {
"thumbnail_src": "prusaslicerthumbnails",
"hash": "0a9e1700ec1cc1b5c46be5340903265d89ba6167",
"thumbnail": "plugin/prusaslicerthumbnails/thumbnail/3DBenchy_PET_1.75.png?20200506171229",
"analysis": {
"estimatedPrintTime": 4229.236067879765,
"printingArea": {
"maxZ": 47.88,
"minX": 113.029,
"maxX": 290.0,
"maxY": 290.0,
"minY": 130.792,
"minZ": 0.28
},
"dimensions": {
"width": 176.971,
"depth": 159.208,
"height": 47.6
},
"filament": {
"tool0": {
"volume": 10.73116891151654,
"length": 4461.501590000148
}
}
}
}
}