Commit graph

807 commits

Author SHA1 Message Date
Gina Häußge
06518b5374 Some changes to increase readability and reuse and remove redundancy 2015-04-28 12:16:54 +02:00
Marc
2a5a0282cb Updated the Check routine and put it into a temp. fcuntion for better readability 2015-04-27 20:55:06 +02:00
Marc
d4a96c53c3 Merge branch 'devel' of github.com:foosel/OctoPrint into fixControl 2015-04-27 19:39:37 +02:00
Gina Häußge
5e54f3a523 Persist package name for plugins loaded from entry point
This allows later deinstallation even if module and package name differ.
2015-04-27 18:43:00 +02:00
Gina Häußge
e96dcadc70 Fix: Receiving a "start" from the firmware triggers another handshake attempt
Fixes #869
2015-04-27 18:42:05 +02:00
Gina Häußge
fb5aaffdc1 Added a "fake ack" button to terminal tab, as counter measure for lost "ok"s
In case an ok gets lost on the line, this allows to have the communication between
OctoPrint and the printer take up again.
2015-04-27 18:13:39 +02:00
Gina Häußge
4ea6bcd1de Smoothie compat fix: Only wait for ok's after GCODE commands
Any unknown commands should just be piped through and not use up an acknowledgement. This
new behaviour can be overridden via the new feature flag "unknownCommandsNeedAck", which will
restore the former behaviour causing even unknown commands to use up an "ok".

Also no line numbering or checksumming will happen. Shouldn't usually be of relevance for other
firmwares, but in case of any compatibility issues introduced by this also added a new feature
flag "sendChecksumWithNonGcode" that causes even unknown commands to be sent with a
checksum if necessary.
2015-04-27 17:24:34 +02:00
Gina Häußge
5765180462 Fix: moved line number incrementing to send loop
Should fix issues where too fast a temperature polling could cause skipped line numbers, triggering nasty resend loops in the process.
2015-04-27 17:15:57 +02:00
Gina Häußge
4c1ba0fd0b [doc] <pluginname> => <plugin identifier> 2015-04-27 16:10:23 +02:00
Marc
159eb4ce59 Fix 2015-04-24 15:39:31 +02:00
Marc
17889a2b46 Slider DefaultValue always an Int and in range(min, max) 2015-04-24 14:46:41 +02:00
Gina Häußge
3ebc6f0f1d Fix: Reselect current printer profile if it was updated and deny deleting the current printer profile 2015-04-24 12:05:38 +02:00
Gina Häußge
9ee9f7bffb Workaround for idle temperature polling not working with Repetier Firmware
Repetier always first sends the ok and then any command output. In case of M105, that makes the response look like from an externally triggered heatup (no ok on the same line), causing polling to stop until that falsely detected heatup is complete. Added a configuration option to disable heatup detection. The disadvantage of this is that when printing via Repetier Firmware from SD, the heatup times won't be substractable from the total print time, leading to a less accurate print time left estimation.

 Closes #835
2015-04-24 09:36:43 +02:00
Dan Lipsitt
013d221398 BadRequest is actually in werkzeug.exceptions. 2015-04-23 13:17:39 -07:00
Gina Häußge
a55de71233 Merge branch 'pr/Salandora/patch3' into devel 2015-04-23 10:41:34 +02:00
Gina Häußge
2c50861c44 Removed unnecessary a tag in custom section headers, we can just use the h1 to toggle 2015-04-23 10:41:22 +02:00
Gina Häußge
d0e7cd46ce Removed id attribute again since we don't need it anymore 2015-04-23 10:27:15 +02:00
Gina Häußge
e0027c3cba Made baudrate detection a bit more solid 2015-04-23 10:07:05 +02:00
Gina Häußge
19918b7221 Suggestion for custom controls to allow for collapsable sections while keeping close to the same visual appearance 2015-04-22 19:27:44 +02:00
Marc
7c4c8485b4 Fixed Layout 2015-04-22 18:05:49 +02:00
Gina Häußge
88af79509f Delect selected files upon comm disconnect in the printer handler
Should solve #861
2015-04-22 11:42:41 +02:00
Gina Häußge
a42c5edaa3 Merge pull request #865 from DanLipsitt/feature/flask-0.10
Use BadRequest instead of JSONBadRequest.
2015-04-22 11:16:27 +02:00
Marc
ef9034e380 Fixed linendings and encoding 2015-04-22 10:20:15 +02:00
Marc
f24ae37bd8 Missing ; added 2015-04-22 10:01:09 +02:00
Marc
3f1cbb20d3 renamed deflt and default to defaultValue
+ adds a div container around the each Input
2015-04-22 10:00:58 +02:00
Marc
483e19adb6 exc.stack -> (exc.stack || exc) so if exc is a message (e.g. knockout sends a message) you'll get the message instead of undefined 2015-04-22 10:00:45 +02:00
Marc
3304a7e341 Deleted unnecessary css style 2015-04-22 10:00:29 +02:00
Marc
2edb92112a Custom control containers are now Collapsable if user wants so. 2015-04-22 10:00:02 +02:00
Marc
de8484b6f8 Added IDs to CustomControls and made Containers with names collapsable 2015-04-22 09:59:45 +02:00
Marc
88a81b186b Update CSS + LESS 2015-04-22 09:59:31 +02:00
Marc
15d4525b71 Added OnSettingsBeforeSave event + using onEventSettingsUpdated to sync the controls 2015-04-22 09:59:19 +02:00
Marc
032c76a944 Fixed horizontal and horizontal_grid to work properly 2015-04-22 09:58:57 +02:00
Marc
525709eb38 Added showConfirmationDialog function 2015-04-22 09:58:43 +02:00
Marc
232dbe5459 Patched Context Menu, to include also the object wich has the ContextMenu binding 2015-04-22 09:58:27 +02:00
Gina Häußge
3f14fdb51b Allow disabling the cache during development
Set "devel > cache > enabled" to false in config.yaml to disable the cache. Defaults to true.
2015-04-22 09:45:25 +02:00
Dan Lipsitt
ca914bd419 Use BadRequest instead of JSONBadRequest.
JSONBadRequest is removed in Flask version 0.10. BadRequest is backwards
compatible with Flask 0.9.
2015-04-21 23:10:03 -07:00
Gina Häußge
2ce40c4847 Added new callback to viewmodels, allowing to react to login events
Removed old loginstate.subscribe method and migrated existing code to new mechanism.

This should allow plugins to only request their sensitive data if a user is a) logged in and has b) the necessary rights for a request. The server should still do additional auth checks, but this way no unnecessary request have to be made.
2015-04-21 19:39:48 +02:00
Gina Häußge
3f272b209d Added method to SimpleApiPlugins to allow locking API to only admins 2015-04-21 19:39:48 +02:00
Jarek Szczepanski
26f43de07d Fixed sorting log files on settings dialog 2015-04-21 15:09:45 +02:00
Lucas Clemente
579fd3bbfb Add support for high-DPI screens to gcode renderer
window.devicePixelRatio is used to scale the canvas, extrusion line
width, retract spot size and mouse event position.
2015-04-18 12:14:47 +02:00
Gina Häußge
a996f7b6fb New hook octoprint.filemanager.preprocessor
Allows preprocessing files that are uploaded or otherwise added to the system (e.g. through slicing) before their contents are saved to disk
2015-04-17 14:45:58 +02:00
Gina Häußge
6bb4a3e28c Potential fix for the "No PKG-INFO found for package" issue 2015-04-16 18:37:03 +02:00
Gina Häußge
023b6f9d81 Small fixes prior to merge of #849
* Renamed userjson to userdata, removed original userdata (developers will live if they need to ensure their supplied userdata is valid JSON)
   * Input validation for userdata parameter - a HTTP 400 response will be generated if userdata can't be parsed as JSON
   * Adjusted documentation accordingly
2015-04-16 16:05:23 +02:00
Gina Häußge
694a8febb5 Merge branch 'jm/feature-metadata-endpoint' of https://github.com/Voxel8/OctoPrint into pr/jminardi/feature-metadata-endpoint 2015-04-16 15:39:35 +02:00
Gina Häußge
cd244f341d Small fixes prior to merge of #852
* Proper origin visualization in gcode viewer for centered rectangular
   * Validation of origin profile entry
   * Auto-migration of existing profiles upon load
   * Added changelog entry
2015-04-16 15:20:18 +02:00
Gina Häußge
12310c5e3a Merge branch 'centeredorigin' of https://github.com/markwal/OctoPrint into pr/markwal/centeredorigin 2015-04-16 13:33:26 +02:00
Gina Häußge
1d98135f58 New hook "octoprint.filemanager.extension_tree"
Allows extending the list of supported file extensions for the file manager.

See also discussion on #850
2015-04-16 13:09:05 +02:00
Gina Häußge
8ac375fc9b Some minor changes before merging the PR
* moved virtual printer into plugin
  * made default serial factory use supplied parameters instead of directly utilizing self._port and similar
  * documented new hook
2015-04-16 11:43:30 +02:00
Gina Häußge
5588deb925 Merge branch 'serialhooknew' of https://github.com/markwal/OctoPrint into pr/markwal/serialhooknew 2015-04-16 09:40:14 +02:00
Gina Häußge
8d6d7a1bf5 Added two missing ; 2015-04-16 09:19:10 +02:00
Gina Häußge
db739c05b8 Merge branch 'patch1' of https://github.com/Salandora/OctoPrint into pr/Salandora/patch-1 2015-04-16 09:17:10 +02:00
Mark Walker
e8f61e2dda Fix server error 500 when user is logged out
f98ebaaf moved the passive_logon code to a new function from
api/__init__.py to util/flask.py.  Before that move any fallthrough
would hit return NO_CONTENT, but now it returns nothing which makes
flask complain.
2015-04-15 17:17:19 -07:00
Mark Walker
7b1d1d2592 Also include the hook discovery line 2015-04-15 15:05:58 -07:00
Mark Walker
e4d8d67f65 Add a plugin hook for opening the serial port
This hook allows the plugin to create the serial port object (or pass to
the next hook or the builtin serial port handler) which allows for
serial communication filtering or a different communication transport.

Use @foosel's code to use the same loop for hooks as well as the
builtin.
2015-04-15 14:51:03 -07:00
Marc
c71b29b77e Added missing observableArray for dynamical Control loading 2015-04-15 23:20:03 +02:00
Marc
f24475b996 Added ContextMenu 2015-04-15 23:18:17 +02:00
Gina Häußge
d5e7149f99 Merge branch 'devel' into dev/pluginLifecycleMgmt 2015-04-15 15:30:26 +02:00
Gina Häußge
29e2bbd2a7 Undo: Changes to make behaviour on mobile safari better caused issues with everything else 2015-04-15 15:30:11 +02:00
Gina Häußge
c7146cf432 Merge branch 'devel' into dev/pluginLifecycleMgmt 2015-04-15 14:20:15 +02:00
Gina Häußge
d58a2fd4c6 Renamed temperature and SD status timeout to interval 2015-04-15 14:19:41 +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
5804825dc3 Fix: Made initial connection to printer a bit more responsive
Having to wait for the first serial timeout before sending the first M105 even when not waiting for seeing a "start" caused unnecessary wait times for reaching the "Operational" state.
2015-04-15 09:14:36 +02:00
Gina Häußge
24495d046f Renamed temperature and SD status timeout to interval 2015-04-15 09:04:54 +02:00
Gina Häußge
2aa31024e6 Finalizing first version of plugin lifecycle management 2015-04-14 17:55:46 +02:00
Gina Häußge
fc00ef032e Merge branch 'devel' into dev/pluginLifecycleMgmt 2015-04-13 18:24:20 +02:00
Gina Häußge
41c10a759a Better behaviour of the settings dialog on low-width devices
Navigation and content also now scroll independently from each other.

Compare #823.
2015-04-13 17:33:06 +02:00
Gina Häußge
dd3455d598 Merge branch 'devel' of https://github.com/webmonger/OctoPrint into webmonger-devel 2015-04-13 13:21:23 +02:00
Mark Walker
88bc0b7a92 Show .gcode .gco and .g files in the SD file list
(cherry picked from commit e91b103)
2015-04-13 13:13:36 +02:00
Gina Häußge
f480e29342 Fixed implementation/docs mismatch: header_addon -> template_header
Closes #848, thanks to @markwal for spotting and reporting
2015-04-13 12:53:19 +02:00
Mark Walker
b25443d142 foosel/Octoprint #841: Can't login using IE
Add computed property "name" to function objects if not provided by the
browser, to avoid dropping out of main.js before it is finished.
(cherry picked from commit 68215c6)
2015-04-13 12:36:12 +02:00
Gina Häußge
354e064969 Only resend next line after first resend is through
Tracking the "ok" attached to a resend is necessary in order to make sure that it does not trigger the resend of the next line after the requested one right after, causing resend loops in some cases, e.g. "> 100", "> 101" , "< rs 100", "ok", "> 100", "< expected 100, got 101, rs 100" -- here the last error from the firmware could not be processed as "false negative" correctly (101 was already sent to the printer when it detected the error for 100, so this error just needs to be ignored) since the resend flag was already cleared due to line 100 and 101 having been enqueued, 100 in the resend handler, 101 due to the following ok. This patch fixes the latter, thus solving the problem.
2015-04-13 12:24:43 +02:00
Gina Häußge
594636e0e3 Make sure to operate on unicode when sanitzing sd filenames
Should fix #834
2015-04-13 12:24:42 +02:00
Jack Minardi
426fef6e4a accept arbitrary metadata at the file upload endpoint 2015-04-06 16:45:10 -04:00
Gina Häußge
97aecdf4cf First throw at working plugin lifecycle management
Plugins may be enabled and disabled during runtime. If they are of types which allow hot loading, this will be done. Otherwise they will be marked as pending and updated after a restart. Same for installation and uninstallation.
2015-04-02 23:02:42 +02:00
Gina Häußge
a34cbc58dc Merge pull request #828 from Voxel8/update-selected-event
update FileSelected event to be more consistent with other events
2015-04-02 22:14:12 +02:00
Gina Häußge
f0b48a6b43 Merge branch 'devel' into dev/pluginLifecycleMgmt
Conflicts:
	src/octoprint/plugin/core.py
2015-04-01 11:55:48 +02:00
Gina Häußge
0ed8afd999 Fix: Validate plugins separately from constructor
Otherwise plugins that inject data via __plugin_init__ won't work properly
2015-04-01 11:54:11 +02:00
Gina Häußge
68fa2f9fa3 WIP 2015-04-01 11:51:08 +02:00
Gina Häußge
3ebf5e5240 Merge branch 'devel' into dev/pluginLifecycleMgmt
Conflicts:
	src/octoprint/plugin/core.py
2015-04-01 11:02:05 +02:00
Gina Häußge
66e3ee28b6 Started work on plugin lifecycle management
Plugins may be loaded, unloaded, activated and deactivated. Errors while trying to load a plugin or initializing an implementation will only result in it staying deactive but registered in the system, allowing it to be further processed e.g. by a plugin manager
2015-04-01 10:55:13 +02:00
Gina Häußge
8a41cef00b [Doc] Restructured the plugins section so it makes more sense 2015-03-31 20:08:32 +02:00
Gina Häußge
5c228e6071 [Doc] Big overhaul of TemplatePlugin docs & component ordering 2015-03-31 18:23:18 +02:00
Gina Häußge
8a3993ca59 To determine order of template components, first use user order, then default order, then type ordering
Also moved suffix calculation for template keys into _process_template_config
2015-03-31 18:22:38 +02:00
Gina Häußge
c9f5476588 Settings now allow providing a custom "config" dict to work on
Can be used to always retrieve the defaults (by providing an empty config dict) or to utilize the get method with other settings than the system settings.
2015-03-31 18:20:44 +02:00
Gina Häußge
2d54ab5fcf Fix: identifer => identifier (is it really that hard to type foosel?) 2015-03-30 22:08:49 +02:00
Gina Häußge
86cd162784 Fix: get_implementations now returns a list instead of a dict 2015-03-30 22:03:36 +02:00
Gina Häußge
8ff0096eb6 Fix & Docs: Plugins may only have one mixin implementation
Multiple mixins are allowed of course. Allowing multiple implementations lead to too many problems due to plugin names for referring to the APIs of SimpleApiPlugins or the assets of AssetPlugins.

 Hence __plugin_implementations__ has been deprecated in favor of __plugin_implementation__. The plugin subsystem will automatically copy the first implementation from __plugin_implementations__ to __plugin_implementation__ and log a deprecation warning.

 Adjusted documentation accordingly. Also added docs for helpers.
2015-03-30 16:50:06 +02:00
Gina Häußge
79336ca108 Fix: Improved handling of data coming in from the printer
Hopefully closes #829
2015-03-30 13:15:52 +02:00
Jack Minardi
2478b73ee5 update FileSelected event to be more consistent with other events 2015-03-29 23:44:19 -04:00
Gina Häußge
2fa0673e0b Fix: javascript custom controls should now work again 2015-03-27 17:10:48 +01:00
Gina Häußge
d62ac5239b [Doc] PluginSettings.getFoo -> PluginSettings.get_foo, also fixed an example for settings preprocessors 2015-03-27 11:18:55 +01:00
Gina Häußge
9b3daeea01 Exception.message => str(Exception) 2015-03-26 12:04:05 +01:00
Gina Häußge
fb2719ce8a [Doc] let's see if moving the figures out of the tables solves the PDF issue 2015-03-26 10:55:51 +01:00
Gina Häußge
45bf398494 [Docs] Added an example for octoprint.comm.protocol.action handler
Used same example to illustrate hook handlers within mixin implementations.
2015-03-25 19:30:49 +01:00
Gina Häußge
974e19fa3a Removed version numbers from bundled plugins
Missing version numbers will not be displayed as "(unknown)" anymore, and bundled plugins don't necessarily need their own version.
2015-03-25 18:56:59 +01:00
Gina Häußge
954397b6a6 Changed logging of plugin subsystem slightly
Detected plugins are now logged in a better readable way and with additional information.

Also marked folder for bundled plugins as bundled - forgot to do that earlier.
2015-03-25 18:56:11 +01:00
Gina Häußge
c6e4057add [Docs] Documented octoprint.comm.protocol.gcode hook
Experimenting with including examples stored on github, let's see if RTD likes that.
2015-03-25 18:24:51 +01:00
Gina Häußge
af7d2bb8c7 Utilize adaptive interval for temperature and sd status polling
This way user adjustments to those timeouts via the settings
will take immediate effect even while the connection to the
printer is already established.
2015-03-25 17:27:59 +01:00