Presently, one might accidentally terminate a print with a CTR-D while
printing. Now we ask the user to confirm exiting if there is a print
going when they try to exit.
Presently, when you connect to a printer using pronsole, one sees
something like:
uninitialized>start
uninitialized>Printer is now online
uninitialized>echo: External Reset
printer>Marlin 1.0.0 RC2
...
With a few carriage returns and some string hackery, we clean up
the output so that one sees:
No port specified - connecting to /dev/ttyACM0 at 115200bps
start
Printer is now online
External Reset
Marlin 1.0.0 RC2
Much cleaner!
The monitor command now:
* Has more pythonic code
* Limits precision of progress elements (12.3% instead of 12.347812...%)
* Uses a carriage return to have print progress replace the previous
progress line.
For example:
Monitoring printer, use ^C to interrupt.
Updating values every 5.000000 seconds.
Print progress: 0.3%
Previously, the line "Print progress: 0.3%" was "Print progress: 0.2%",
etc.
* Prompts are now generated based off of string templates,
for example: "%(bold)sT:%(extruder_temp_fancy)s %(progress_fancy)s
>%(normal)s "
* We have a dictionary of prompt string templates for different
situations.
* We have bold support for the prompt.
* We have extruder temperature support for the prompt.
* We have progress support for the prompt.
Before, when there was an error while connecting, user didn't know, when
Pronterface wasn't launched from the terminal.
So you could just hit Connect button several times and all you've get was:
Connecting...
Connecting...
Connecting...
Now, when there is an exception during the connection, the user will notice:
Connecting...
Error: You are trying to connect to a non-exisiting port.
Or:
Connecting...
Error: You don't have permission to open /dev/ttyUSB0.
You might need to add yourself to the dialout group.
Unfortunately pyserial's SerialException doesn't provide errno yet, so the
message isn't so user friendly:
Connecting...
could not open port None: [Errno 2] No such file or directory: 'None'
I've filled a bug report with patch to pyserial.
Together with this I've realised, there is unnecessary UTF8 decoding of the
output. When user has UTF-8 locale, there was an exception when printing the
exception to the output (almost an exception inception). So I have dropped it,
but feel free to add it back, if I broke anything else.
In order to do this, we consolidate handeling of printer status
with a Status class. The status class is updated by recvcb.
This has the side effect of simplifying the implementation of gettemp.
We also detect whether there is a heated build platform or not, and
don't display info about it if there isn't.
If I install Printrun via setup.py, I don't have gcoder.py and I cannot even
use pronterface.py:
Traceback (most recent call last):
File "/bin/pronterface.py", line 46, in <module>
import pronsole
File "/usr/bin/pronsole.py", line 23, in <module>
from gcoder import GCode
So I've added this to setup.py.
Also, pronsole.ico is missing, added that to (not needed at runtime, but is
usefull for desktop files)