Commit graph

4612 commits

Author SHA1 Message Date
Gina Häußge
6f5707a0fc Attach identity reset to logout signals
Safer than doing it manually
2017-07-17 13:14:45 +02:00
Gina Häußge
cf053ddbed Temperatures may in fact be negative
E.g. in case of a disconnected thermistor, or when it is really
really cold. Make sure our parsing doesn't get confuse by this and
thinks that

  ok T:150.0/210.0 T0:-55.7/0 T1:150.0/210.0

is actually only T and T1 being reported by the firmware, causing
stuff to be wrongly canonicalized thanks to T/T1 being Smoothie's way
of reporting dual extruder setups.

Fixes #2007
2017-07-14 11:18:04 +02:00
Gina Häußge
b1101f5150 Virtual printer: support pinning of temperatures
Helpful for simulating disconnected thermistors, preparation for
debugging #2007
2017-07-14 11:07:25 +02:00
Gina Häußge
3a9d581423 Decouple writing of print log from everything else
Fixes delay in cancel processing as observed by @capnbry with regards
to #1946.

More tests necessary to ensure this was the only cause.
2017-07-13 20:00:45 +02:00
Gina Häußge
142a1b0dcb Progress might be 0, don't divide by it then 2017-07-13 15:48:22 +02:00
Gina Häußge
a33f44ea25 Fix File(Added|Removed) and Folder(Added|Removed) events
Were defined as 1-tuple instead of a string thanks to a syntax error.
2017-07-12 16:13:51 +02:00
Gina Häußge
23e58d2fc1 Make sure resent lines always win before regular ones
Introduced a custom send queue type that actually contains two queues,
one for resends, one for regular lines. A flag indicates whether
lines should be returned from both or only resends. That way we
ensure that as soon as we have an active resend request we ignore
what was already in the queue and only send the lines we need to resend.

Also: PrependQueue => PrependableQueue
2017-07-11 17:10:02 +02:00
Gina Häußge
2e897f19ac Synchronize all writing access to the send queue 2017-07-07 15:56:22 +02:00
Gina Häußge
16e96743c5 Docs for api_user/api_password on bitbucket_commit 2017-07-06 16:30:44 +02:00
Gina Häußge
4c6c764c5c Small simplifications and clarifications 2017-07-06 16:18:55 +02:00
Gina Häußge
e86ba9a395 Merge branch 'f_bitbucket_swupdate3' of https://github.com/mrbeam/OctoPrint into pr/mrbeam/f_bitbucket_swupdate3 2017-07-06 15:33:19 +02:00
Gina Häußge
c1c09d417d Removed a line that was accidentally committed 2017-07-05 17:58:33 +02:00
Gina Häußge
f8d225a768 Support for parsing GCODE subcodes
Hook handlers will get any parsed subcode as optional keyword argument
"subcode".
2017-07-05 17:56:46 +02:00
Gina Häußge
4c3f4c2a8b Fix "additional data" toggle in file list 2017-07-05 16:37:39 +02:00
Gina Häußge
cc3d34635e Add API function to (re)analyse files 2017-07-05 16:37:03 +02:00
Gina Häußge
c81c93896b Apply tool offsets immediately and only once
Less tracking of offsets and also more similar to how
firmware does this.

We rewrite our current position on tool change to current position
plus tool offset instead of applying it for every single
position change.
2017-07-05 15:16:08 +02:00
Gina Häußge
3cdc59d7f1 Fix offset passing to analysis subprocess 2017-07-05 08:58:42 +02:00
Gina Häußge
5156cdbe68 Very minor refactoring & cleanup 2017-07-05 08:58:08 +02:00
Gina Häußge
0915c45f72 Merge branch 'maintenance' of github.com:foosel/OctoPrint into maintenance 2017-07-04 16:48:42 +02:00
Gina Häußge
b2c1bb4b53 Option to automatically send temperature fine adjustments
As suggested by a loyal Patron ;)
2017-07-04 16:44:23 +02:00
Andy Werner
3bb06a1a33 SW Update check type 'bitbucket_commit' now supports API credentials for private repos 2017-07-03 17:17:43 +02:00
Gina Häußge
8ad165c625 Fix blur of temp input focus on submit
Also separated "clear offset" button in offset editor from input
field, looks better this way.
2017-07-03 16:08:41 +02:00
Gina Häußge
841b86a017 Merge branch 'maintenance' into improve/temperatureInput 2017-07-03 16:07:19 +02:00
Mark Walker
c0c249ece9 Typo: red->read 2017-07-01 10:37:51 -07:00
Gina Häußge
5fc194accd Docs: Added sequence diagrams for web interface lifecycle
For now only startup and reconnect to server.
2017-06-30 18:28:49 +02:00
Gina Häußge
ed6c01c12a Remove current_user from template contexts
That should never have been enabled for our usage scenario in the
first place.
2017-06-30 14:37:37 +02:00
Gina Häußge
e309646504 Prevent unnecessary settings fetch during startup
We fetch settings once explicitly after passive login but before
completed startup. Without this patch we fetched them again after
onUserLoggedIn got fired (if it got fired by the passive login)
during startup. That's not necessary because we did the passive login
before our initial settings fetch, so IF that already logged us in,
our settings fetch already was done with us logged in as well and
the onUserLoggedIn later only tells us what we already knew.
2017-06-30 14:36:18 +02:00
Gina Häußge
96ee80afd2 Only trigger onUserLogged(In|Out) if login state actually changed
This also includes triggering an initial onUserLoggedIn after
initialization if the user turned out to be logged in by passive login.
2017-06-30 14:34:05 +02:00
Gina Häußge
8aec836d22 Minor refactoring of the web interface startup (again)
We still had some concurrent requests triggered through onStartup that
managed to overtake the passive login (and hence nuke the session
data on the client). This should now really not be possible any longer.

Also created a sequence diagram of the new process and linked it from
a lengthy comment.
2017-06-30 11:59:52 +02:00
Gina Häußge
697df4f3ce And fixed connection accordion toggling again
#1001 said hi once more after fixing the onUserLogged(In|Out) events
not firing...
2017-06-30 09:48:57 +02:00
Gina Häußge
ac3f4d598c Fixed onUserLoggedIn/Out not firing correctly on startup anymore
Introduced by b205e84d4b
2017-06-30 09:39:14 +02:00
Gina Häußge
836fbef6d8 Fixed an error in the temp graph when not connected 2017-06-30 09:24:07 +02:00
Gina Häußge
ce4cf38547 Removed log prefixing again
It caused issues with our line number tracking in the browser
developer tools and I don't see any way to avoid this considering
that we can't adjust the arguments supplied to console.log without in
fact wrapping it :/
2017-06-29 17:37:01 +02:00
Gina Häußge
38a5da1c35 Fix connection accordion again
Slightly different order of things caused #1001 to resurface.
2017-06-29 16:51:04 +02:00
Gina Häußge
b205e84d4b Refactored web startup to minimise risks of race conditions
Under specific circumstances it could happen that the passive login
response was overtaken by a response from an earlier still
unauthenticated request which would then effectively overwrite the
session cookie immediately and hence cause the browser to use its
login session against the server, but without displaying that to the
user. See #1881 for what is probably an issue caused by exactly this
kind of scenario.

Additionally a couple of requests needed to be done a second time
after login, just moments after having done them for an anonymous
user. See #1572 for a request to change this behaviour.

This patch changes the startup order of the web interface like this:

  1. connect to the websocket, postpone any events triggered by
     this (e.g. "fromHistoryData") until 3
  2. perform a passive login, postpone any events triggered by this
     (e.g. "onUserLoggedIn", "onUserLoggedOut") until 4
  3. trigger postponed events from 1
  4. trigger "onStartup" (triggers postponed events from 2)
  5. fetch settings
  6. bind view models etc

A connection close of the websocket will disable event processing on the
socket until it is marked as initialized again by the passive login
processing, which will also be triggered immediately on server connect.

That way under normal circumstances nothing should ever get triggered
in the registered view models that might generated requests to the
server API until a passive login has been done, a server session
initialized and if necessary a user properly authenticated.
2017-06-29 15:42:19 +02:00
Gina Häußge
7ab4d12548 Better error resilience against wrong user manager
Also improved get_class by using importlib instead of complicated
climbing through the whole module tree.
2017-06-29 15:07:17 +02:00
Gina Häußge
f6c3e5991d PMGR: Detect if plugin needs printer reconnect 2017-06-28 10:30:35 +02:00
Gina Häußge
188b59a319 Added id to tabs content div
cc @Salandora
2017-06-27 15:47:39 +02:00
Gina Häußge
b3594e367e Remove superfluous <br> tag from progress dialog output lines 2017-06-27 15:07:00 +02:00
Gina Häußge
12d40122d1 Use wrapt.ObjectProxy for SessionUser wrapper class
Our old manual wrapped didn't properly work in some aspects, this
version now should hopefully take care of most common proxy object
pitfalls.
2017-06-27 15:03:37 +02:00
Gina Häußge
2e11a7b860 Introduced pre-output css class for line based output pres
Easier to just put this on all output pre tags than defining
display:block on the contained spans for all individually.
2017-06-27 11:54:15 +02:00
Gina Häußge
f20185db3a Better handling of timelapse deletion errors
Closes #1975
2017-06-27 11:32:42 +02:00
Gina Häußge
0db323d0c5 Removed unused import 2017-06-26 17:14:03 +02:00
Gina Häußge
639d8d4c5f Perform gcode analysis in subprocess 2017-06-26 16:19:18 +02:00
Gina Häußge
5e0b53b651 Better thread safety for SockJS
Heartbeat messages could still be sent out of turn, causing message
corruption or other weird things. This should hopefully fix this.
2017-06-23 17:56:17 +02:00
Gina Häußge
1ebfa4b1dd New event ToolChange and tool change GCODE scripts
(cherry picked from commit 5f79aa6)
2017-06-23 16:06:44 +02:00
Gina Häußge
35c45df86c Allow multi line commands in sending phase
(cherry picked from commit 1018946)
2017-06-23 14:55:34 +02:00
Gina Häußge
a50e8bbbb5 Merge branch 'improve/temperatureGraphCrosshair' into maintenance 2017-06-22 17:33:09 +02:00
Gina Häußge
4665070601 last_temperatures -> last_temperature (for consistency) 2017-06-22 12:47:55 +02:00
Gina Häußge
b34fc8e05e Merge branch 'improve/temperatureInScripts' into maintenance
# Conflicts:
#	src/octoprint/util/comm.py
2017-06-22 12:45:50 +02:00