Commit graph

2470 commits

Author SHA1 Message Date
Gina Häußge
61af59cca1 New hooks for command processing in comm layer
Added phase specific hooks for queuing, queued, sending and sent phases of a command ("octoprint.comm.protocol.gcode.<phase>"). Removed old queuing phase hook and declared as obsolete hook in plugin manager to prevent plugins that depend on it from being enabled.

Adding those new hooks also necessitated refactoring the whole command processing, made it more modular and added phase specific handler functions that allow handling all blocking commands centrally for example.
2015-05-28 17:06:24 +02:00
Gina Häußge
1458503561 Logging for the virtual printer... 2015-05-28 17:03:03 +02:00
Gina Häußge
046fffdd14 Fixed a deadlock in the communication layer when pausing via M0
Using reentrant locks to allow sending of additional commands
2015-05-28 16:10:48 +02:00
Gina Häußge
2cfa3d9218 Refuse to enable plugins that utilize obsolete hooks
Since it cannot be reliably determined by the system if a hook is essential for a plugin's functionality or not, it makes more sense to just disable plugins that utilize obsolete hooks then risk running half working plugins.
2015-05-28 12:56:42 +02:00
Gina Häußge
ceb0e29da3 Changed existing octoprint.server.http.* hooks to prefix routes with /plugin/<identifier>/
This will hopefully prevent conflicting routes between multiple plugins from being registered and also ensures a more consistent behaviour compared to BlueprintPlugin mixins.

 Thanks to @Salandora for bringing this up.
2015-05-27 14:30:41 +02:00
Gina Häußge
3823216319 Some new styles for forms usable by plugins 2015-05-27 13:36:33 +02:00
Gina Häußge
3ac2d5dd34 Fixed Z-Timelapse for Z changes on `G1` moves
Solves #909
2015-05-26 18:46:50 +02:00
Gina Häußge
5a89cc6a2a [doc] Added example for the octoprint.server.http.routes hook 2015-05-26 14:29:22 +02:00
Gina Häußge
5c2a9ce5db Allow downloading all uploaded files, not just gcode and stl
Hidden files (starting with .) will produce a 404. This also excludes .metadata.yaml from being downloadable. The alternative of adding all extensions defined by plugins to the regex dynamically was not chosen since that would necessitate to make plugins implementing the "octoprint.filemanager.extension_tree" hook restart needing plugins in the lifecycle management for a minimal gain in perceived security.

Solves #897
2015-05-26 13:55:04 +02:00
Gina Häußge
2317d0cf27 Documentation for new hook "octoprint.server.http.routes" 2015-05-26 13:16:57 +02:00
Gina Häußge
ad054338b5 More/fixed documentation on the octoprint.server.util module 2015-05-26 13:16:01 +02:00
Gina Häußge
7263fb74a9 Merge pull request #901 from markwal/handleErrorsShortform
Only eat two characters when the error indicator is '!!'
2015-05-21 19:04:23 +02:00
Gina Häußge
e8ca6709b9 New hook "octoprint.server.http.routes" to extend static tornado routes through plugins
TODO: docs

Thanks @Salandora
2015-05-21 18:07:15 +02:00
Mark Walker
50c95e439d Only eat two characters when the error indicator is '!!' 2015-05-20 20:06:24 -07:00
Gina Häußge
fa57f160dc Log cancelled prints only once
Thanks to @imrahil for the headsup
2015-05-13 14:00:12 +02:00
Gina Häußge
45cda586d2 Fix: Make pip install -e . work properly by linking to ./src, not ./ 2015-05-13 08:37:36 +02:00
Gina Häußge
24a020a5f0 Added "plugins" extra to OctoPrint
Installs dependencies necessary/recommended for plugin development. At the moment that is only cookiecutter.
2015-05-12 21:38:04 +02:00
Gina Häußge
37ee1d6780 octoprint.setuptools => octoprint_setuptools (own package)
Otherwise we get import issues during build since the octoprint module depends on the dependencies already being present what they obviously can't be at the beginning of setup.
2015-05-12 20:36:38 +02:00
Gina Häußge
9e9189727f Removed javascript babel files superseded by new central i18n js template 2015-05-12 17:38:22 +02:00
Gina Häußge
05fd4fbc8a Some final touches to the new setuptools submodule
CleanCommand should never touch .git subfolders. Plugin CleanCommand should remove plugin's egg-info files
2015-05-12 17:34:00 +02:00
Gina Häußge
95062747ef Extracted setuptools related things into reusable package
Babel related commands and the Clean command for setup.py are not reusable by plugins as well. Also added a factory method for plugin setup parameters.
2015-05-12 17:20:31 +02:00
Gina Häußge
6465e2dc2f Don't try to include a i18n js file when g.locale is not set 2015-05-12 13:54:36 +02:00
Gina Häußge
074d7a017e Wrapped some texts in translation brackets 2015-05-12 12:22:26 +02:00
Gina Häußge
739a185d1b Logging for flask view caching 2015-05-12 12:22:10 +02:00
Gina Häußge
9f54985ce5 Also support client side translations for plugins 2015-05-12 11:58:48 +02:00
Gina Häußge
b908ff5821 Enhanced flask-babel to also allow plugins to provide translated strings
This way plugins can maintain their own translations of their UIs. Some monkey patching was necessary, not the cleanest solution but it should work.
2015-05-11 18:44:30 +02:00
Gina Häußge
098df12d94 Added changelog entry for #888 2015-05-11 16:54:37 +02:00
Gina Häußge
6029340f78 Merge branch 'sockjslikebunnies' of https://github.com/markwal/OctoPrint into pr/markwal/sockjslikebunnies 2015-05-11 16:22:34 +02:00
Gina Häußge
4c7520efb9 New hook "octoprint.server.http.bodysize" and lifecycle support for restart needing hooks
The new hook allows extending the list of rules for maximum body sizes differing from the default of 100KB and can be used by plugins to allow uploads to them that exceed that file size.

Also extended the plugin manager to detect plugins that implement restart needing hooks (such as the above one) and handling those plugins the same as plugins containing implementations that inherit from octoprint.plugin.core.RestartNeedingPlugin
2015-05-11 15:47:40 +02:00
Mark Walker
c8b8bcb22e Magic CLOSE_NORMAL
See https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
WebSocket defines 1000 as CLOSE_NORMAL, SockJS uses it without
a name and doesn't provide one for us, so for now we define our own
2015-05-11 05:52:36 -07:00
Gina Häußge
797a5c8a5c Cura plugin: Fix potential key error in error reporting 2015-05-11 13:10:23 +02:00
Gina Häußge
6323ce56ed Fix: Properly close selected files in case of errors or intentional disconnects on the serial interface
File handle was formerly kept open. Thanks to @Salandora for the initial work on this. See also PR #883
2015-05-11 12:23:56 +02:00
Gina Häußge
86a4e7f495 Only treat wait as ack while printing 2015-05-11 11:47:15 +02:00
Mark Walker
91bdffab33 Stop sockjs from multiplying on reconnect
Have you ever noticed when developing that every time you stop and start
the server, the terminal window gets an extra duplicate line for every
reconnect attempt?  Well, it's because (I think) "delete" in javascript
just removes the indicated name from the namespace, it doesn't actually
free up an object. Those zombie objects are still there and wake up (for
some transports) on reconnect. Might be different in SockJS v1 or later.
2015-05-10 18:58:18 -07:00
Gina Häußge
9568806219 Fix: Don't reload page when disabling access control in first run dialog
Cache clearing doesn't work reliably with location.reload(true), leading to cache induced infinite loop when disabling access control (since generated template still assumes first run dialog to be active). Disabling for now, need to find a better way to reload the page while clearing the browser's and server's cache (same issue exists for plugins needing a client side triggered reload).

Fixes #886
2015-05-10 00:54:44 +02:00
Gina Häußge
5fa30e4145 Ignore feed rates of 0, those don't make sense anyhow
Fixes #887
2015-05-10 00:36:09 +02:00
Gina Häußge
fa9821083d Support fast communication recovery during printing when printer sends "wait" line
Common setting in Repetier, Marlin might support this sooner or later as well.
2015-05-08 13:47:52 +02:00
Gina Häußge
9d3a029e10 Added missing event when closing the settings dialog 2015-05-07 15:23:40 +02:00
Gina Häußge
ea93ba6a77 Fixed grid in GCODE viewer for rectangular bed with origin in lower left 2015-05-07 13:05:43 +02:00
Gina Häußge
9b010db0b8 Removed obsolete elif branch in file upload code 2015-05-07 12:51:23 +02:00
Gina Häußge
aed9e905f2 Cura Plugin: added more logging
Trying to get to the ground of #878
2015-05-07 11:06:11 +02:00
Gina Häußge
ad2bdb1242 Added a bunch of changelog entries 2015-05-07 09:59:05 +02:00
Gina Häußge
d43bc2e17e Allow different timestamps (zones or dates) between client and server while keeping the temperature graph working
The server now sends the current server time with each temperature update as well as the initial temperature data, allowing the client to translate the timestamps contained in the temperature logs to its local timescale.

 Followup to commit f19d0f0360 which caused a problem with large deviations between server and client time.
2015-05-06 17:23:01 +02:00
Gina Häußge
9ecd59c6e1 Merge branch 'gcode-renderer-retina' of https://github.com/lucas-clemente/OctoPrint into pr/lucas-clemente/gcode-renderer-retina
Conflicts:
	CHANGELOG.md
2015-05-05 22:04:22 +02:00
Gina Häußge
d34b73cd7c Merge pull request #884 from Salandora/vp_dropConnection2
Adds !!DEBUG:drop_connection to the virtual Printer
2015-05-05 21:59:00 +02:00
Gina Häußge
3e5298fcab Merge pull request #879 from markwal/onSettingsShown
onSettingsShown/Hidden call only on parent dialog shown/hidden
2015-05-05 21:57:34 +02:00
Marc
e5de00095f Adds !!DEBUG:drop_connection to the virtual Printer 2015-05-05 21:01:00 +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
Gina Häußge
f19d0f0360 Base cut off point for temperature graph on timestamps instead of data points
Cut off of the temperature graph is now not based on the number of data points any more but on the actual time of the data points. Anything older than ``n`` minutes will be cut off, with ``n`` defaulting to 30min. This value can be changed under "Temperatures" in the Settings

Closes #343
2015-05-05 18:18:55 +02:00
Gina Häußge
ede2e8c593 Virtual printer now allows sending of custom action commands
Sending "!!DEBUG:action_custom foo 1 2 3" will result in the virtual printer sending "// action:foo 1 2 3" back. Sending "!!DEBUG:action_custom bar" will result in the virtual printer sending "// action:bar" back.
2015-05-05 17:30:35 +02:00