If the printer is paused and the method is called with only_pause=True, nothing will happen.
If the printer is printing and the method is called with only_resume=True, nothing will happen.
- _nack_lines, _nack_lock, _nacks_before_resend => _sent_lines, _sent_lock, _sent_before_resend
- some reordering in the message processing
- referal to MESSAGE and COMMAND instances via self.__class__ instead of RepRapProtocol => allows sub classes to override MESSAGE and COMMAND definitions
entries.
After sending the sent entry is now not removed from the queue by a
pop but an explicit remove instead. Removal maintains the queue's
heap invariant.
This way it will also be possible to easily add another qrcode to the user api key later. Refused to work for now (value binding doesn't update), so commented out right now, but works in theory.
- self._clear_for_send was decremented at wrong location
- added semaphore for use in fill queue processing (max entries 20, fill queue acquires, send queue releases upon send)
- added signal of state for use in fill queue processing, no more sleep-wake-check-loops there
- CommandQueue.peek also was not synchronized
Found a couple of issue to tackle next (see TODOs)
These appear to be the used rx cache sizes:
- Marlin on AT90USB boards (e.g. Printrboard) => 63 bytes
- Marlin anywhere else, using MarlinSerial implementation => 127 bytes
- Repetier by default => 127 bytes
- Repetier if EXTERNALSERIAL is defined in Configuration => 63 bytes
63 bytes should be pretty much safe in any case, user can increase that if falling into the 127 bytes group.
Write blocks on the serial interface are now handled gracefully (also the write timeout has been set to a more sane value, maybe that can be lowered more?).
I'm still observing some weird "stops" when printing the valentine dragon thingy on a Printrbot Simple, still trying to find out what's happening there exactly.
Split command processing into "queued", "sent" and "acknowledged" events, added command acknowledgement tracking via nack_line queue, using that too for resend implementation
Problem: Deadlock when using a real printer after receiving first "ok" response to "N0 M110 S0" right at the beginning of the print.