LowellObservatory / Ultimonitor

A job/print monitor for the Ultimaker 3 Extended (or any printer supporting that style API), that takes snapshots and emails about them as well as manages statistics gathering
Mozilla Public License 2.0
1 stars 0 forks source link

Saved state #5

Open astrobokonon opened 4 years ago

astrobokonon commented 4 years ago

Save the state of the print currently being monitored to a json file on disk (or something) to allow persistence of info between code restarts. Only way to avoid duplicate notices.

Could make the file a sort of snapshot of progress/parameters, too, which might be nice. Needs a little more thought.

astrobokonon commented 4 years ago

Going to start with just a json dump of the notices, with the print job UUID thrown in for good measure. That should give a pretty easy way to see if we were already monitoring a job, and an easy way to discard things if the UUIDs don't match. Will probably store the last percentage and job time too because it's easy enough.

astrobokonon commented 4 years ago

Turns out this is also wrapped up with issue #1 since I'll need to keep close tabs on printer state changes to figure out the database query times.

astrobokonon commented 4 years ago

This is probably best accomplished using a class to represent the states rather than the simple dict I have; that way I can more easily store things.