110 Commits

Author SHA1 Message Date
Jaime van Kessel
7ae8d96775 Simply reset the authentication when requesting a new one.
Only changing the state caused a whole lot of issues.
2017-03-30 16:47:08 +02:00
Jack Ha
3135dc7d77 Solved MC 2017-03-30 16:20:08 +02:00
Lipu Fei
bfd77f915d Compress gcode lines in batch
CURA-3604
2017-03-30 16:09:17 +02:00
Lipu Fei
c785e84b86 Check len(materialLengths) before using
CURA-3604
2017-03-30 16:09:16 +02:00
Jaime van Kessel
f7bbb243b8 Moved authentication request state change 2017-03-30 11:02:56 +02:00
Ghostkeeper
f62488fd11
Catch JSONDecodeErrors on decoding messages from the network
The network can corrupt packages or the printer can only send partial messages. Cura shouldn't break on that. It's just a warning. This warning says more than the original stack trace does, because the stack trace only said like 'unexpected comma there and there' while this message actually says what message contained the error.
2017-03-29 10:34:27 +02:00
Jaime van Kessel
38a07d75c7 Merge branch 'master' of github.com:Ultimaker/Cura 2017-03-28 13:16:00 +02:00
Jaime van Kessel
db1fb8e692 Moved authentication request state change 2017-03-28 13:14:47 +02:00
Tim Kuipers
7a67ab4e66 Merge branch '2.5' 2017-03-28 12:55:18 +02:00
Jaime van Kessel
910ff7acea No longer check printer state when no material lengths are known
This fixes issues with g-code from g-code reader not having material lengths set.

CURA-3604
2017-03-28 11:59:07 +02:00
Jaime van Kessel
4b7b8600ec Shortened the logging of the auth key. Turned out it was extremely long 2017-03-24 11:22:57 +01:00
Jaime van Kessel
adab4a1110 Added "blurred" auth key logging.
The getSafeaAuthKey prints a key of the same length, but only the last 5 chars are real. The rest is blurred out with *
THis is a bit like how most payment services hide your credit card number.
2017-03-24 11:04:08 +01:00
Jaime van Kessel
e620d8fd9a Added extra logging to authentication loading to indicate difference between no auth at all or (some) loaded auth 2017-03-17 10:30:04 +01:00
Jaime van Kessel
7993d9e95e Added **kwargs option to request write
CURA-3496
2017-03-14 13:30:47 +01:00
Jaime van Kessel
c06ffe6cae Moved auth state changed check to first thing set auth checks
This should contribute to the windows authentication issues.
Most windows devices seemed to get all the auth state messages twice.
2017-03-07 11:55:29 +01:00
Jaime van Kessel
6dcd3b44b6 Removed uneeded debug code
The method is always put, so no need to log it.
2017-03-07 11:44:40 +01:00
Jaime van Kessel
85d979cf50 Removed unneeded check from network printing.
We used to not have a printer_state so this check was needed.
2017-03-07 11:41:18 +01:00
Jaime van Kessel
356d4f9288 Heated bed timeout time now hides correctly if time ran out
CURA-3360
2017-03-06 14:41:33 +01:00
Ghostkeeper
7bb486a34b
Don't process status updates of pre-heating while request is going on
There was the problem that you'd click on pre-heat, so locally it would display the time-out. Then a package came in with the out-dated print status saying that the printer is not pre-heating, so the pre-heat was cancelled on Cura's side. Then the next status update came in saying that the pre-heat is now busy, so the pre-heat is resumed on Cura's side. So the button was flicking back and forth once after pressing. This commit makes Cura ignore any status updates that come while the put-request is still going on, because they may be outdated. It'll appear nicer to the user, mostly.

Contributes to issue CURA-3360.
2017-02-24 17:44:37 +01:00
Ghostkeeper
39920c95f3
Interpret cancelling pre-heat properly
If someone on a different computer cancels the pre-heat, this is now correctly updated locally.

Contributes to issue CURA-3360.
2017-02-24 17:14:54 +01:00
Ghostkeeper
d60014fa30
Sync remaining pre-heat time with printer
If multiple instances of Cura are running or Cura is restarted, it now properly syncs the remaining pre-heat time with the printer, so that all instances display the proper time.
There's still a bug in here that pressing cancel has no effect the first time since the remaining pre-heat time is updated immediately from the printer before the command to cancel got through remotely. I'll see what I can do to amend that. Also, cancelling is not yet synced.

Contributes to issue CURA-3360.
2017-02-24 14:53:00 +01:00
Ghostkeeper
d2fa6dbae2
Notify to update remaining time when it drastically changes
When the time passes normally it doesn't trigger this signal but just go on counting, but when the pre-heat starts or cancels it updates via this signal. This is handy for the future, when we want to update the remaining time from the printer information. However for now it is also nice because we can make the pre-heat timer dependent on this signal so we know when to have it running. This fixes the problem that the pre-heat seems to have been cancelled in the GUI when you switch away the tab, because the timer running is now dependent on the property rather than always false.

Contributes to issue CURA-3161.
2017-02-16 12:58:39 +01:00
Ghostkeeper
3cc11ecae5
Log when pre-heating or cancelling pre-heat
To help debugging and because it's a user interaction.

Contributes to issue CURA-3161.
2017-02-16 12:58:39 +01:00
Ghostkeeper
75a50b73c2
Move pre-heat timer into PrinterOutputDevice
If it's held inside the device that has two advantages: It's being held per-device, so switching connection doesn't stop the timer. And also, the logic is no longer in the GUI.

Contributes to issue CURA-3161.
2017-02-16 12:58:32 +01:00
Jaime van Kessel
b34bb26a1a Fixed broken getInstance caused by refactor 2017-02-15 13:51:53 +01:00
Jaime van Kessel
b187cf89a5 Fixed broken logging 2017-02-15 13:50:02 +01:00
Ghostkeeper
42982b7a86
Fix link to UM.Version.Version
The Version object is no longer exposed via UM.__init__, so we have to dig inside the UM.Version module to get it.

Contributes to issue CURA-2917.
2017-02-14 17:03:37 +01:00
Ghostkeeper
5055c534c5
Fix links to ContainerRegistry
ContainerRegistry is no longer exposed in UM.Settings.__init__, so we must dig the class up from inside the module.

Contributes to issue CURA-2917.
2017-02-14 16:57:21 +01:00
Jaime van Kessel
e8c5f81c79 Merge branch 'feature_preheat_bed' of github.com:Ultimaker/Cura 2017-02-13 14:16:50 +01:00
Jaime van Kessel
cc396d5357 Fixed target temp never updating 2017-02-13 14:16:22 +01:00
Jaime van Kessel
f62030dae5 setTargetBed temperature now directly sets target temp
This is instead of sending /bed/temperature a json which contains target & temp as keyvalue.
2017-02-13 13:30:51 +01:00
Jaime van Kessel
6deaf5bd65 Failure logging for network printing is now more explicit (also prints what the operation was) 2017-02-13 13:28:32 +01:00
Jaime van Kessel
8d7b813318 All good 20x http replies are now accepted 2017-02-13 13:26:36 +01:00
Jaime van Kessel
5e3782e6c3 Added more authentication logging to network printing 2017-02-10 15:44:45 +01:00
Ghostkeeper
0c9b9a3033
Add fallback name property in PrinterOutputDevice
It'll call this property, which gives an empty string, if the device doesn't implement giving a name.

Contributes to issue CURA-3161.
2017-02-09 17:34:51 +01:00
Ghostkeeper
27c30006da
Give no address instead of a wrong address if unknown
Contributes to issue CURA-3161.
2017-02-09 10:33:14 +01:00
Ghostkeeper
1395735ece
No longer mention printer name in status
The printer name is displayed right above it, so mentioning the name again is double.

Contributes to issue CURA-3161.
2017-02-08 12:53:54 +01:00
Ghostkeeper
da4574cb32
Use fallback without time-out if preheating bed on old firmware
It manually sets the temperature just like what happens when you print via USB.

Contributes to issue CURA-3161.
2017-02-08 11:38:03 +01:00
Ghostkeeper
28e488dad7
Fix setting target bed temperature
The previous implementation just emitted the signal twice, once in setTargetBedTemperature and once in _setTargetBedTemperature. I've made the private one actually set the temperature.

Contributes to issue CURA-3161.
2017-02-08 11:37:04 +01:00
Ghostkeeper
9354a80504
Document no longer that pre-heating defaults to 15m
Because that was removed.

Contributes to issue CURA-3161.
2017-02-07 17:17:45 +01:00
Ghostkeeper
4ccadc6208
Round pre-heat temperature and duration to integer but allow floats
We want to allow floats in the interface since the interface needs to be agnostic of what device it is connected to. But the UM3 API only allows integers, so we still need to round it to the nearest integer.

Contributes to issue CURA-3161.
2017-02-07 16:57:20 +01:00
Ghostkeeper
785f10966e
Don't send a time-out for preheat if timeout is 0
The printer doesn't accept 0.

Contributes to issue CURA-3161.
2017-02-07 16:48:27 +01:00
Ghostkeeper
1a902b21bb
Store default pre-heat time in central location
Its default is 900s or 15 minutes. QML now requests the time-out time and sends it on to the printer.

Contributes to issue CURA-3161.
2017-02-07 16:29:41 +01:00
Ghostkeeper
d751285713
Provide pre-heat command with integer parameters
The firmware only accepts integers, apparently.

Contributes to issue CURA-3161.
2017-02-07 14:44:28 +01:00
Ghostkeeper
b27a9e6535
Implement tracking target bed temperature
I had already assumed it was tracking this but apparently it wasn't. This works though.

Contributes to issue CURA-3161.
2017-02-07 13:52:44 +01:00
Ghostkeeper
3618ae0d4f
Properly float-format input of preheatBed
It rounds to 3 digits. The specification of the feature in the API doesn't mention how detailed the temperature and duration can go, but thousands seems more than enough. This also eliminates pesky problems with the JSON brackets in the format function.

Contributes to issue CURA-3161.
2017-02-07 13:35:09 +01:00
Ghostkeeper
559b40867e
Call pre-heat if pre-heat button is pressed
Contributes to issue CURA-3161.
2017-02-07 13:29:57 +01:00
Ghostkeeper
0df4afff33
Convert parameters to string before including them
This way you can provide normal floating point values instead of providing strings with numbers in them.

Contributes to issue CURA-3161.
2017-02-07 13:26:10 +01:00
Ghostkeeper
d7bf23ca21
Add function to cancel pre-heating the bed
You could also do this by calling preheatBed with a temperature of 0. In fact, that's what this function does.

Contributes to issue CURA-3161.
2017-02-07 13:23:56 +01:00
Ghostkeeper
9d8034d14f
Add default for duration parameter of preheatBed
It defaults to 15 minutes.

Contributes to issue CURA-3161.
2017-02-07 13:22:21 +01:00