Commit graph

64 commits

Author SHA1 Message Date
Gina Häußge
65753a0539 Convert to new viewmodel declaration
We've been supporting the new object based view model declaration
format since 1.3.0, time to move the bundled view models towards
actually using it.
2017-11-21 10:17:52 +01:00
Gina Häußge
21cc58ad14 GCO viewer: Persist options to localStorage
See #443
2017-10-20 19:34:39 +02:00
Gina Häußge
b65a3bb903 GCO viewer: Add advanced options
Allow user toggling of sortLayers and hideEmptyLayers.

As suggested in #1973
2017-10-20 19:24:33 +02:00
Gina Häußge
b82d955ec7 Fix printer profile update on temperature tab & gcode viewer
As reported in #2033
2017-07-27 12:40:27 +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
cbd94a9020 Ignore coordinates outside bed for zoom/centering in gcode viewer
They might be nozzle priming routines which are not actually part of
the model proper and hence it doesn't make sense trying to keep them
visible when zooming in on the model, or allowing them to offset the
model center.
2017-06-13 15:59:30 +02:00
Gina Häußge
0feae3ba18 Centralized browser detection 2017-05-31 10:45:19 +02:00
Gina Häußge
dba95ee94f Handle G90/G91 and M82/M83 distinct by default
By default G90/G91 define relativeMode, M82/M83 define relativeE. The
extruder coordinate will be viewed as relative when either
relativeMode or relativeE are set. This mirrors the implementation in
Marlin (current and legacy forks) as well as Repetier.

SmoothieWare's implementation resets the relative mode of the
extruder on a G90/G91. To still accomodate this different
implementation a new settings has been added under Settings >
Feature: "G90/G91 overrides relative extruder mode". Checking this
switches to the alternative interpretation for future gcode analysis
and visualization.

The only difference between the two of them is that the following
segment of GCODE:

    M83
    G90

will have the extruder still set to relative on Marlin and
Repetier but set to absolute on Smoothieware.

Please note that the setting in all likelihood will be moved to
the printer profile in the future, since it makes more sense to have
it on a per printer basis. It's not part of the set of features
available for auto detection since it's required for GCODE analysis
and hence needs to be known even outside of a connection to the
printer.

Implements #1818
2017-05-10 16:43:20 +02:00
Gina Häußge
a0e5f79483 Only load file into GCODE viewer when that is actually visible
Reduces needed bandwidth on page load, might help to mitigate
bandwidth related issues described in #1241.
2017-03-08 18:03:16 +01:00
Gina Häußge
7ab3eabe0f Support for shared nozzle setups
Support multi-extruder setups that share a single nozzle and heater,
like the E3D Cyclops, Diamon hotend or probably the upcoming Prusa Mk2
multi-extruder upgrade.

The Control tab will still allow tool switching and extruding for
the configured extruders, the Temperature tab will only display
one hotend temperature though.

Printer profiles have been extended by a new option
extruder.sharedNozzle that defaults to False. Extruder offsets are
not displayed in the profile editor if that setting is checked and
reset to (0,0).
2017-01-26 13:33:42 +01:00
Salandora
f1891fedb4 Fixed a bug which caused the layer up/down keyboard implementation to fail. 2016-10-06 19:20:04 +02:00
Gina Häußge
64d484bd09 Merge branch 'maintenance' into devel
# Conflicts:
#	src/octoprint/server/__init__.py
#	src/octoprint/util/jinja.py
2016-09-07 17:22:37 +02:00
Gina Häußge
d4428de9a0 Some rewording 2016-09-07 11:55:17 +02:00
Gina Häußge
e42ef3d070 Small fixes on the layer buttons
Removed unnecessary (and broken) call to event.preventDefault,
moved styles to less/css and also made sure to disable the buttons
not currently usable.
2016-08-31 17:20:23 +02:00
Gina Häußge
79c95aa3b4 Merge branch 'maintenance' into devel
Conflicts:
	src/octoprint/filemanager/storage.py
	src/octoprint/templates/sidebar/state.jinja2
2016-08-16 09:34:49 +02:00
Gina Häußge
d81ec15f43 Improvements in fuzzy print time algorithm
Also use new fuzzy print time in gcode viewer to have some consistency.
2016-08-15 15:42:06 +02:00
Gina Häußge
d91c6256b4 Have GCODE viewer use file path instead of name
That way it should also work for GCODE files contained in folders.
2016-07-08 10:57:33 +02:00
Gina Häußge
5a9852e7b8 Merge branch 'maintenance' into devel
Conflicts:
	src/octoprint/util/gcodeInterpreter.py
2016-07-05 14:37:17 +02:00
Gina Häußge
93b247b088 Display fuzzy time estimates in frontend 2016-07-05 13:15:20 +02:00
Gina Häußge
b32c231c47 Merge branch 'maintenance' into devel
Conflicts:
	CHANGELOG.md
	src/octoprint/plugins/virtual_printer/virtual.py
	src/octoprint/static/js/app/viewmodels/gcode.js
2016-06-21 16:10:02 +02:00
Gina Häußge
611c1ccf4a Disable GCODE viewer if browser is unsupported 2016-06-16 12:08:46 +02:00
Gina Häußge
797d24e01d Small whitespace corrections 2016-05-09 15:09:57 +02:00
Ishwar Agarwal
5937c0cc39 merged conflicts 2016-04-13 15:36:23 +00:00
Ishwar Agarwal
4f793de999 Replaced jquery with ko functions e.g. the button clicks and enabling button. Fixed an error in last commit: renamed a function that was already being used, self.changeLayer to self.shiftLayer. 2016-04-13 15:18:34 +00:00
eykrevooh
09559c5bbc Renamed the self.incrementLayer to self.changeLayer in all four instances 2016-04-11 23:13:00 -04:00
agarwali
e5a8d4ad94 Added buttons to change layer in the gcodeviewer canvas, and fixed bug for layer up and down key-binding. It is now disabled when no file is uploaded 2016-04-07 23:28:41 -04:00
Salandora
146c4b4165 Added the ability to control the layer slider of the gcodeViewer with the keyboard (Up Arrow, Down Arrow, Page Up, Page Down) as requested in Issue #1149 2016-03-26 16:54:29 +01:00
Gina Häußge
e28ca60f21 Merge branch 'maintenance' into devel
Conflicts:
	CHANGELOG.md
2016-02-10 16:46:56 +01:00
Gina Häußge
5955d3d32e Added estimates total time from gcode viewer to gcode viewer tab
Implements request in #1204
2016-02-10 09:58:40 +01:00
Gina Häußge
1e5cc9b086 Merge branch 'fix/knockout3.4' into devel
Conflicts:
	src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js
	src/octoprint/static/js/app/viewmodels/files.js
	src/octoprint/static/js/app/viewmodels/firstrun.js
	src/octoprint/static/js/app/viewmodels/loginstate.js
2016-01-27 17:37:31 +01:00
Gina Häußge
7f1394a8d6 Migrated ko.computed to ko.pureComputed where it made sense 2016-01-27 17:33:03 +01:00
Gina Häußge
91ade13ded Merge branch 'fix/browserTabAwareness' into devel
Conflicts:
	src/octoprint/static/js/app/main.js
	src/octoprint/static/js/app/viewmodels/control.js
	src/octoprint/static/js/app/viewmodels/gcode.js
2015-11-20 11:44:09 +01:00
Gina Häußge
a52a5ca338 GCodeViewer: Even if off screen render 100% view on PrintDone event
Otherwise the GCODE Viewer will get stuck "half way through" if
"sync with progress" is enabled but the tab/browser tab loses focus
during printing and only regains it after the print has finished.
2015-11-20 11:40:06 +01:00
Gina Häußge
acc85127c5 Track browser tab visibility, only activate webcam/gcode viewer when visible
This might help with #1065 if indeed is related to background tab suspending behaviours in
browsers, but is a completely blind guess at this point since I still have not been able to
reproduce that issue myself.

Backported.

(cherry picked from commit 720cdad)
2015-11-20 11:06:25 +01:00
Gina Häußge
720cdadfbb Track browser tab visibility, only activate webcam/gcode viewer when visible
This might help with #1065 if indeed is related to background tab suspending behaviours in
browsers, but is a completely blind guess at this point since I still have not been able to
reproduce that issue myself.
2015-11-18 17:13:41 +01:00
Salandora
ac6cfbc0ea Stopped GCodeViewer from rendering if GCode Viewer tab is not active
Anything else is normally processed
(cherry picked from commit 426e9f3)
2015-10-01 17:31:46 +02:00
Gina Häußge
73c235d67f Migrate SettingsViewModel.requestData to using promises
Fallback implementation for old callback parameter is still present,
logs warning about deprecation.
2015-09-28 18:17:43 +02:00
Gina Häußge
bbd728c51b Migrated existing javascript application files to use client lib
TODO: Testing & Debugging
2015-09-25 13:53:42 +02:00
Gina Häußge
84cda5cfe2 Fix: Only show the "too big" dialog in the gcode viewer if no file loading is currently taking place
Possible fix for #825
2015-05-05 18:33:45 +02:00
Mark Walker
5a27ab6e54 Move the centered option into printer volume
Also, modify the cura slicer to recognize the setting and avoid
adjusting the model position, just leave it in the center where it would
be on a circular platform
2015-04-15 04:05:48 -07:00
Mark Walker
a4df56dcb7 Undo so we can go another way 2015-04-15 04:04:34 -07:00
Mark Walker
fbe50e33d3 Add a printer profile option to allow centered origin on rectangular
beds

Some printers have (0, 0) at the center of the bed.  Circular beds
commonly, but also some rectangular beds.
2015-04-15 02:33:31 -07:00
Gina Häußge
bb0a607891 Fixed gcode and terminal view models not properly handling missing elements 2015-02-23 21:41:19 +01:00
Gina Häußge
3a41ec2e20 Refactored view models, switched from underscore to lodash
Also added loglevel.js to allow for level based logging and added sprintf.js separately
2015-02-23 13:54:40 +01:00
Gina Häußge
60a747620c Bit more error resilience for the gcode viewer ui elements 2015-02-22 21:49:33 +01:00
Gina Häußge
3c33401b48 GCODE viewer: Only try to instantiate sliders if their elements are available 2015-02-17 13:51:34 +01:00
Gina Häußge
2ba681573f Key controls are now enabled when you mouse over the webcam picture, indicated by an overlay
Also moved key control help in that overlay
2015-01-12 09:40:45 +01:00
Gina Häußge
05e54fa0c6 Internal representation for extruder offsets changed, adjusted gcode viewer view model to be able to cope 2014-12-01 16:36:08 +01:00
Gina Häußge
0203e6da31 More work on the printer profiles, connection dialog and Settings dialog are now working. GCODE viewer makes trouble 2014-12-01 16:26:55 +01:00
Gina Häußge
93a852e6ea WIP: Printer profiles & management now functional, but integration with connection dialog still broken
The API documentation is also still missing.
2014-11-29 20:55:30 +01:00