Commit graph

2492 commits

Author SHA1 Message Date
Gina Häußge
a3f24c59e9 Don't render untranslated strings to messages.js 2017-01-26 17:22:07 +01:00
Gina Häußge
eaadf8743b Allow multiple instances of the JS client
We now have a global OctoPrintClient, which is the class from which
all clients are derived, and a global OctoPrint, which is a single
instance already setup and ready to use in case we only need one.

It would be cleaner to have clients create that singular instance
themselves, but we need to maintain backward compatibility for now
with how we established the client to work with the 1.3.0 release.

New clients can be create with

    client = new OctoPrintClient({ /* options */ });

Alternatively the options can be left out and set at a later point:

    client = new OctoPrintClient();
    /* ... */
    client.options = { /* options */ };

Individual client components register themselves with OctoPrintClient
via OctoPrintClient.registerComponent(name, component) from the
component JS files. Just like before their instances are then
available in the individual client instances under "<client>.<name>",
 e.g. "OctoPrint.files".

Plugin components register themselves with OctoPrintClient via
OctoPrintClient.registerPluginComponent(name, component) from the
component JS files. Just like before their instances are then
available in the individual client instances under "<client>.plugins
.<name>", e.g. "OctoPrint.plugins.softwareupdate".

This should make it possible to create dashboard pages utilizing the
JS client that monitor the status of multiple OctoPrint instances,
without workarounds such as having to swap out the options globally
before each request.

See #1681 for the corresponding discussion.
2017-01-26 14:59:56 +01:00
Gina Häußge
b0cd742bf4 Fix UMD pattern 2017-01-26 14:59:54 +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
Gina Häußge
8f3b6dca79 Fix stupid typo 2017-01-25 16:21:15 +01:00
Gina Häußge
29a2c6abec Allow new locales to be provided by plugins
Core translations still win over plugin translations, but at least
this way it's possible to provide full blown translations via plugins.
2017-01-25 16:02:25 +01:00
Gina Häußge
9250cd0c3b Whitespace, comments & added @eyal0 to AUTHORS.md
(cherry picked from commit c7f67cc)
2017-01-24 11:38:52 +01:00
Eyal Soha
6b2f28240e Ignore a leading v or V in github release tags.
This fixes foosel/OctoPrint#1723 .

(cherry picked from commit f1c3829)
2017-01-24 11:38:46 +01:00
Gina Häußge
c8dfe363bc Only offer daemon subcommand on linux 2017-01-20 17:10:59 +01:00
Gina Häußge
e20fcd9ce5 Merge branch 'rc/maintenance' into maintenance 2017-01-20 16:28:42 +01:00
Gina Häußge
3da3cfd8a0 Fixed passing of "daemon" legacy parameter on CLI
This time this hopefully really solves #1641
2017-01-20 15:33:24 +01:00
Gina Häußge
88a8bdf7b3 Add "Restart in safe mode" system menu entry 2017-01-20 14:27:06 +01:00
Gina Häußge
a948050c54 SWU: Fixed update configs without restart 2017-01-19 14:07:04 +01:00
Gina Häußge
0d76df2cd5 SWU: Fixed python_checker and python_updater 2017-01-19 14:06:33 +01:00
Gina Häußge
3b5c2fe519 SWU: Config version 4 didn't properly migrate old commands -> version 5 2017-01-19 12:33:45 +01:00
Gina Häußge
6f5ee4d291 Fixed doctests of software update version checks 2017-01-19 12:33:44 +01:00
Gina Häußge
507ddde9dd Improved error resilience in plugin repository handling 2017-01-19 12:33:43 +01:00
Gina Häußge
a646fff5ff Fix persistence of config version on settings migration 2017-01-19 12:33:27 +01:00
Gina Häußge
6268e27dd7 Fix settings not allowing to delete values not in defaults anymore 2017-01-19 12:33:25 +01:00
Gina Häußge
caa84d7918 Don't kill manual software update configs during migration
See lengthy comment in source added through this commit for details.
2017-01-19 12:11:01 +01:00
Gina Häußge
6d1e28ae9c We still need _read_lines after all in the streamed file info 2017-01-18 13:04:01 +01:00
Gina Häußge
1e482369b8 Further synchronization in comm layer
Prevent concurrent sending of commands from the monitor thread for
incoming ok's while processing the start, pause, resume or cancel
of a print job.
2017-01-18 12:58:38 +01:00
Gina Häußge
a6c4f8ba3b Fix potential race condition on print start
When the sending of the first line of a file to print is still taking
place while an "ok" from the firmware comes in, it's possible
that two threads will try to access the file handle in parallel. That
can lead to trouble within Python's codecs module.

Synchronizing all access to the handle should do the trick.
2017-01-17 17:46:20 +01:00
Gina Häußge
6bd788a83f Always define pixfmt for timelapse in video filter chain
Apparently having a chain AND the pix_fmt parameter
produces issues with higher resolutions.

Should fix #1317
2017-01-17 13:03:27 +01:00
Gina Häußge
4c971a92db from ... import * is only allowed at module level 2017-01-13 14:17:39 +01:00
Gina Häußge
1f0e67f85e Added FAQ link to footer 2017-01-13 13:42:53 +01:00
Noah Martin
74597483dc Added a mask icon for Safari pinned tab and touchbar
(cherry picked from commit ff02192)
2017-01-13 13:33:21 +01:00
Noah Martin
b1057a4cc8 Simplified install process on Mac
(cherry picked from commit 726eec8)
2017-01-13 13:29:11 +01:00
Gina Häußge
20cd13904d Cura: Fix selection of which start/end gcode to choose
So far the plugin selected the gcode script corresponding to the number of
extruders configured in the printer profile. After a close look into the
implementation in Cura itself, prompted by #1708, it turns out that this is
in fact wrong.

Cura selects the gcode script to use based on the maximum of the number of
extruders needed for printing the models in the scene and the minimum number
of extruders needed for generating support (if support extruder is "both" or "first"
or there is only one extruder, that's 1, if it's "second" and there is more than one
extruder, it's 2).

This commit changes the plugin's implementation to mirror this implementation.
The difference to Cura is that we have the number of extruders needed for the
models in the scene hard coded to 1 since we only support STL right now which
can never contain more than one object. If we ever decide to support merging of
multiple STLs into one single multi-extruder print or other model files like AMF
or OBJ from OctoPrint's slicer support, we need to change this.
2017-01-13 12:54:01 +01:00
Gina Häußge
95e4ad82b4 Cura: Fix off-by-one error for placeholder replacement
Affected print_temperature and filament_diameter placeholders.

E.g. `print_temperature2` was wrongly attempting to fetch `print_temperatures[2]`
 instead of `print_temperatures[1]` (0-based-indexing!)

 Partially fixes #1708
2017-01-13 11:25:08 +01:00
Gina Häußge
9e3d2bed65 Merge branch 'improve/passwordManagers' into maintenance 2017-01-12 18:59:39 +01:00
Gina Häußge
7f3d4a8380 Allow configuration of analysis throttling via config.yaml 2017-01-12 18:16:50 +01:00
Gina Häußge
e6dd37e26e Various analysis queue fixes
* Fix priority queue sorting (sorts ascending, not descending!)
  * Abort low priority jobs when a high priority job comes in
  * Utilize queue for tracking aborted jobs too
  * Abort analysis for items that are to be deleted/moved (also
    fixes issue under Windows where it was impossible to delete
    a file for which the analysis was still running).
2017-01-12 18:16:42 +01:00
Gina Häußge
d69c166f10 Fix unanalysed files from subfolders to not be found on startup 2017-01-12 15:15:02 +01:00
Gina Häußge
f6875c0df4 Update german translation 2017-01-12 14:34:00 +01:00
Gina Häußge
3ef7b37dc9 Hide login form when we are already logged in
Otherwise the Lastpass stuff will show up after all, despite
the positioning hack.
2017-01-12 14:23:44 +01:00
Gina Häußge
03085ab39b Fix width/height of login button in navbar 2017-01-12 14:22:34 +01:00
Gina Häußge
de0ee08e05 Fix Lastpass input button handling in login form
* move hidden login form to the left to hide overlayed
    Lastpass context buttons
  * do dropdown toggling for login form manually to
    not only ignore clicks into form but also into overlayed
    Lastpass context buttons for closing the dropdown again;
    do close dropdown for included a and button elements
    though
2017-01-12 13:32:10 +01:00
Gina Häußge
881d3bb212 Merge branch 'maintenance' into main/supportPasswordManagers 2017-01-11 19:03:31 +01:00
Gina Häußge
fb5d5682e6 Do not eat 0% progress
Fixes #1344 (this time for good I hope)
2017-01-11 17:57:45 +01:00
Gina Häußge
071c32fff1 Ported fix of solid layer count from Ultimaker/CuraEngine#140
Fixes #1692
2017-01-11 16:15:43 +01:00
Gina Häußge
7c74594f06 Adjusted Cura profile handling to match latest Cura Legacy version
* Added/changed mappings of profile to engine settings to
    match Cura Legacy mapping:
    * perimeterBeforeInfill: taken from perimeter_before_infill (new,
      fixes #1693)
    * skinSpeed: taken from solidarea_speed (new)
    * raftAirGapLayer0: sum of raft_airgap and raft_airgap_all
    * raftAirGap: taken from raft_airgap_all (new)
    * raftFanSpeed: changed to 0
    * raftSurfaceThickness: taken from raft_surface_thickness (new)
    * raftSurfaceLinewidth & raftSurfaceLineSpacing: taken from
      raft_surface_linewidth (new)
  * Mach3 Gcode Flavor replaces S parameter with P parameter in
    temperature commands within generated GCODE, like in Cura
    Legacy
2017-01-11 14:50:09 +01:00
Gina Häußge
d83440d32d Use full path instead of only the file name for busy detection 2017-01-11 13:53:28 +01:00
Gina Häußge
c0dff1359b Fix file_in_path for windows environments 2017-01-11 13:51:40 +01:00
Gina Häußge
2ab7fa4d3a Support volume calculate for S3D files 2017-01-11 12:11:16 +01:00
Gina Häußge
f20e985d0d profile => slicing_profile & removed filament 0 check
If the slicer returns values for a tool we want it in our analysis
result, even if it's zero. That way the result will be the same as
if we have our own built in gcode analyser take a look at the
file.

(cherry picked from commit 818ae92)
2017-01-11 12:04:13 +01:00
derpicknicker1
58f934e2c1 Fix issue in getting file metadata after slicing
This fixes the issue that there were no informations about filament
usage in metadata after slicing with cura plugin. Trying to call
profile.get_float("filament_diameter") ended in en exception with
message " 'module' object has no attribute 'get_float' ". So i defined
profile before using profile and now it works.
See issue #1685
Also inserted a check to determine if filament usage is > 0 to exclude
tools with no filament usage in metadata.

(cherry picked from commit c9b38bd)
2017-01-11 12:04:02 +01:00
Gina Häußge
6e474d9096 Fix model size calculation during GCODE analysis
* Properly handle G0/G1 with no X, Y, Z coordinates in relative mode
    instead of duplicating coordinates - should fix #1675
  * Only take move commands with X, Y, Z coordinates into account for
    model size calculation - this makes our internal GCODE analysis behave
    like the GCODE viewer's analysis and produce the same model size. The
    downside is that extrusions on the origin are no longer taken into account
    for checking if a model is within bounds of the print bed, but that should
    hopefully not produce any issues in the real world.
2017-01-10 12:16:33 +01:00
Gina Häußge
f3f60674fc Allow a retraction z hop of 0 in timelapse configuration
See comment by @markwal at
https://github.com/foosel/OctoPrint/pull/1148#pullrequestreview-14802655
2017-01-09 17:00:10 +01:00
Marc Hannappel
dc3182c872 Fix folders doesn't get listed when performing a filtering in file section, issue #1667
(cherry picked from commit 8a8b88a)
2017-01-09 16:54:55 +01:00
Paul de Vries
6cc84a1473 Make the login overlay always 'visible' in the DOM so that password managers can auto-submit their credentials 2016-12-31 13:13:01 +01:00
Paul de Vries
ce1344eb0c Remove legacy onKeyUp and ignored autocomplete 2016-12-30 20:56:08 +01:00
Gina Häußge
84e8f8e1ca Fix terminal filter regexes & add filter for wait 2016-12-16 13:01:56 +01:00
Gina Häußge
2669e79778 Change wording of buttons in cancel confirmation
"Cancel" and "Proceed" is misleading.

Closes #1656
2016-12-16 12:31:07 +01:00
Gina Häußge
42e3922053 Don't care about common params on CLI
--basedir, --config, --verbose, --safe may now come before or after
subcommands and should still be evaluated.

For the server commands (legacy, "server" and "daemon"), the same
should now hold true for the related parameters --host, --port, --debug,
--logging, --iknowwhatimdoing and also --pid (for daemon command).

While having the parameters belong to the individual commands and only
there (which is click's basic approach) is way more cleaner, too many people
were running into issues with that strict approach after all.

I just hope the somewhat hackish approach with context injection needed to
get the less strict version to work won't backfire badly in the long run.

See also #1633 and #1657
2016-12-16 12:18:05 +01:00
Gina Häußge
a735bcc18d Take keyboard control setting into account for possible check
Solves #1660
2016-12-16 10:13:53 +01:00
Gina Häußge
0560009204 Merge branch 'dev/supportPasswordManagers' into maintenance 2016-12-13 14:43:45 +01:00
Gina Häußge
cb9fba73a2 Move cancel confirmation checkbox up a bit 2016-12-13 14:28:44 +01:00
Gina Häußge
cbbfb4af20 Merge branch 'dev/cancelconfirm' of https://github.com/ntoff/OctoPrint into pr/ntoff/dev/cancelconfirm 2016-12-13 14:03:26 +01:00
Gina Häußge
50e55ed30d Do not have CLI interpret OCTOPRINT_VERSION env var
--version is a flag, not an actual parameter (wouldn't really make sense
too). I'm not sure why that isn't the default behaviour of the built-in
version_option decorator tbh.

See #1647
2016-12-12 10:59:22 +01:00
Gina Häußge
d0ff9cb65e Fix octoprint --daemon backwards compatibility 2016-12-12 10:05:11 +01:00
ntoff
e458e3dd18 cancel confirmation option
display or not the confirmation to cancel a print
2016-12-11 00:52:47 +10:00
Gina Häußge
6773ae221d Gracefully handle suddenly vanished files in storage listing 2016-12-09 14:34:40 +01:00
Gina Häußge
ccbf71a96a Fix file that starts with same name as a folder being perceived as in folder
Solves #1637
2016-12-09 13:40:06 +01:00
Gina Häußge
d1f7d39ca9 Embarrassing mistake in .de translation :) 2nd try 2016-12-09 10:49:52 +01:00
Gina Häußge
8d2681ae3f Make OctoPrint.upload's url behave like others
So far only was interpreted relatively to the defined base url.
We want this to behave like other requests from the client lib
though, so now it does.
2016-12-07 10:54:20 +01:00
Gina Häußge
0de6718af3 Fix filesize not being defined 2016-12-07 10:53:48 +01:00
Paul de Vries
6d158cb0d0 Fix small bug on unreliable submit event + seperate onKeyUp event 2016-12-05 15:34:48 +01:00
Paul de Vries
e52fbf061d Add support to save credentials to a password manager #1607 2016-12-05 13:56:19 +01:00
Gina Häußge
229f3a2744 Preparing release of 1.3.0rc3 2016-12-02 12:39:28 +01:00
Gina Häußge
c00b3de40c Fix temperature history on server reconnect
Two problems solved:

  * Make sure to only process temperature data once we
    have printer profile information on hand to evaluate
    the heater data. If we don't have that yet, create a client
    side backlog and process that once we have the necessary
    data on hand.
  * Do not use uninitialized history cutoff values - if our cutoff
    value hasn't yet synced (no settings response arrived yet),
    just don't perform the cutoff.
2016-12-02 11:06:01 +01:00
Gina Häußge
3d3c93c67d Fix yet another settings caching issue
That api endpoint really is a tough nut. ETag calculation now also
takes full settings dump from settings plugins into account, because
those might be providing custom keys through custom on_settings_load
implementations, for which we will not notice any changes if we are
only looking at the effective config.

Of course, the more we put into that ETag calculation, the slower it will
be and the less sense it will make. Somewhat annoying :/
2016-12-01 13:47:41 +01:00
Gina Häußge
1e84f2ee6e Fix handling of new structures in getOnlyChangedData
Not testing if oldRoot was actually set and contained the
key in question could cause issues if a completely new data
structure was sent to the backend that was not mirrored by
the default settings. Things like e.g. complex configuration
items in a by default empty object.
2016-12-01 13:46:20 +01:00
Gina Häußge
e8a4750379 Improved (manually to run) doc test for latest release selector 2016-11-30 14:33:36 +01:00
Gina Häußge
a66e6b603f Make sure our command line calls always exit
sarge's "wait_events" is unreliable. If an asynchronous
job is started but stops immediately and raises a sarge
Exception (inside the async thread), the associated
command's event will never be set event though the
process finished. So we'd wait indefinitely here.

We circumvent this by first waiting until the commands
are parsed and processed (p.commands contains
elements), then until said commands are started and then
making sure the command's process is actually set. Only
then do we actually have a background process running
that we'll be able to monitor further down, otherwise
the command immediately failed.
2016-11-25 15:45:43 +01:00
Gina Häußge
528e99898f Better error and subprocess handling
Removed a potential deadlock, added logging for all
raised exceptions, made _to_error more solid and
removed another potential encoding issue when
creating diffs
2016-11-25 14:58:09 +01:00
Gina Häußge
8beedce98f Slight rewording in Cura wizard 2016-11-24 12:56:00 +01:00
Gina Häußge
23744cdba9 onWizardTabChange => onBeforeWizardTabChange 2016-11-24 11:56:37 +01:00
Gina Häußge
462ab5aa37 Prevent SWU popup when wizard is open 2016-11-24 11:28:45 +01:00
Gina Häußge
01b221ab30 Prepare release of 1.3.0rc2 2016-11-24 11:08:43 +01:00
Gina Häußge
d37a6a9114 Actually add config subcommand to CLI 2016-11-24 10:55:03 +01:00
Gina Häußge
9875617046 SWU: "busy" spinner while checking for updates 2016-11-23 17:52:16 +01:00
Gina Häußge
ccf77a5dae Restrict pause_position and cancel_position to relevant GCODE scripts 2016-11-23 17:41:43 +01:00
Gina Häußge
6cc3846512 Add M600 (filament change) to long running commands 2016-11-23 15:53:05 +01:00
Gina Häußge
4ed0ed5f99 Fix working dialog of pgmr and swu being closeable while active
Only the close button should work now
2016-11-23 15:11:35 +01:00
Gina Häußge
5c39e9a8a3 Demote pip upgrade message from stderr to stdout in client output
Having that output stay on stderr and hence in shiny red looks way
too alarming considering that it's only a pip update that is not THAT
critical usually (and we don't want to do it automatically anyhow
considering how often that appears to break stuff).
2016-11-23 14:28:50 +01:00
Gina Häußge
5b910b557e Fixed a rare race condition causing a "settings changed" popup in case of local changes
If the SettingsUpdated event for whatever reason got slightly delayed and arrived AFTER
the save request was already processed, in rare situations it could happen that the
"Settings Changed" popup was triggered even though the settings had already been
successfully saved.

Modified such that we now keep track of if we already saw the SettingsUpdated event
associated with our save request and if not we ignore the next one.

To ensure that we don't get out of sync due to that when a settings update request is
sent, but no settings are actually change, we also now always trigger the SettingsUpdated
event, even in such cases. Clients can use the hashs in the payload to test if something
 actually changed - if necessary.
2016-11-23 11:34:58 +01:00
Gina Häußge
4a0d91315c Fix update of webcam streamURL not being recognized
We used to track our webcam stream URL by the global variable
CONFIG_WEBCAMURL. That's still a left over from the architecture
about four years ago and completely obsolete these days.

Additionally it causes issues now that anything rendered into
the page (as this variable value is through initscript.jinja2)
will not be changed unless the page cache is refreshed.

Taking the stream URL from the settings view model instead
solves that problem and is way cleaner anyhow.
2016-11-22 16:17:00 +01:00
donovan6000
1b9bfc6d04 Inapplicable pip arguments can be blacklisted when installing or uninstalling a package 2016-11-22 14:58:39 +01:00
Gina Häußge
def5fd4ad3 Changed help text slightly 2016-11-22 14:44:17 +01:00
Gina Häußge
9ed5e37fc8 Reduced code duplication as suggested 2016-11-22 14:00:08 +01:00
Gina Häußge
5424d42b60 Merge branch 'feature/timelapse_repeat_frames' of https://github.com/dattas/OctoPrint into pr/dattas/feature/timelapse_repeat_frames 2016-11-22 13:53:51 +01:00
Gina Häußge
2fc3819afd Another update of the german translation 2016-11-21 17:43:20 +01:00
Gina Häußge
a24beb25a3 _snippets => snippets - because babel ignores folders starting with _ 2016-11-21 17:43:04 +01:00
Gina Häußge
07bbbff038 Fix error border after successfull install of plugin archive
Was caused by incorrectly resetting the uploadFilename.
2016-11-21 16:25:53 +01:00
Gina Häußge
c9c2946db2 Allow closing of all pmgr notifications & remove on server disconnect 2016-11-21 16:14:09 +01:00
Gina Häußge
8034a4bb98 Merge branch 'maintenance' into devel 2016-11-21 14:39:24 +01:00
Gina Häußge
a88cd9fcfc Copy settings in on_settings_load so we don't mutate them 2016-11-21 13:44:26 +01:00
Gina Häußge
59e4394cdd Allow type specific default values for restricted settings
See #1567
2016-11-21 13:43:53 +01:00
Gina Häußge
d991eab87e Only insert divider in system menu if there are custom commands 2016-11-18 15:01:53 +01:00
Gina Häußge
71581c9c93 Fix deletion of migrated system commands
We need to process the deletion in reverse order, or we'll
delete the wrong (or no) commands due to the changing
list size.
2016-11-18 14:54:02 +01:00
Gina Häußge
7489d2da80 Updated german translation 2016-11-18 14:07:51 +01:00
Gina Häußge
7c1bb5c115 Cache templates per locale, otherwise we might get a language mix 2016-11-18 14:07:31 +01:00
Gina Häußge
b8278b6a93 Don't safe config.yaml when migrating settings overlays 2016-11-18 13:40:25 +01:00
Gina Häußge
7709150a2b Make backup of config before system command migration 2016-11-18 13:39:31 +01:00
Gina Häußge
fc06c91ae8 Auto-migrate manual server system commands in config
If there are custom system menu entries for restart, reboot and/or
shutdown, they are deleted. If the corresponding server command is
not yet configured, the command from the system menu entry is
transfered.
2016-11-18 13:07:19 +01:00
Gina Häußge
2564820d16 Fix ordering of core system commands & slight rewording 2016-11-18 13:05:26 +01:00
Gina Häußge
f83625acba New "octoprint config" CLI
Allows getting and setting settings values
2016-11-18 13:04:59 +01:00
Gina Häußge
97bf331307 Add safe mode that disables all third party plugins
Can be enabled either through new --safe command line
parameter or through server.startOnceInSafeMode in
config.yaml

When running in safe mode the plugin manager will
only allow to disable or uninstall third party plugins. Enabling
third party plugins or installing new plugins is disabled.

That will hopefully allow for more straightforward recovery
in case of a misbehaving plugin.
2016-11-18 13:02:16 +01:00
Gina Häußge
e4d34f4130 Fix logging during settings initialization
We record the messages logged during that time to a recording
log handler, then playback anything we caught after startup.
2016-11-18 10:25:24 +01:00
Gina Häußge
b68ee4df98 If l10n is set on page load, set OctoPrint.options.locale to its value
That way API requests will be made with the locale the page was requested
in.

See #1593
2016-11-18 07:56:56 +01:00
Gina Häußge
0d13c3b439 Add OctoPrint.options.locale and if set send X-Locale header on requests
See #1593
2016-11-18 07:56:49 +01:00
Gina Häußge
1a75dcd5ee Allow locale definition via request header
Important for session less API calls that might return
localized content (e.g. the system commands).

See #1593
2016-11-18 07:56:35 +01:00
Gina Häußge
d1cb8ca98a Fix premature parse stop on M114 and M115 response with ok-prefix 2016-11-17 17:30:10 +01:00
Gina Häußge
f1a1b851ee Better resilience against exceptions in view models in callViewModels 2016-11-17 17:15:28 +01:00
Gina Häußge
07382d3918 Add (optional) firmware auto detection
If enabled (which it is by default), OctoPrint will now send
an M115 to the printer on initial connection in order to try
to figure out what kind of firmware it is. For FIRMWARE_NAME
values containing "repetier" (case insensitive), all Repetier-
specific flags will be set on the comm layer. For FIRMWARE_NAME
values containing "reprapfirmware", all RepRapFirmware-
specific flags will be set on the comm layer.

For now no other handling will be performed.
2016-11-17 17:13:36 +01:00
Gina Häußge
ec12e52865 virtual printer: small fix of temperature responses 2016-11-17 14:46:56 +01:00
Gina Häußge
d5a73b8b4f Add chunks util function 2016-11-17 12:14:10 +01:00
Gina Häußge
b87348be3b Add support for M115 to virtual printer 2016-11-17 12:13:52 +01:00
Gina Häußge
0ad057cdbb Fix PrintFailed event
Was missing the new fields in the payload
2016-11-16 16:09:42 +01:00
Gina Häußge
1a5f4e0b9f Stop focusing files in list after deleted file
Looks weird, especially with the new yellow highlight.
2016-11-16 16:04:43 +01:00
Gina Häußge
f688786fd5 Make cache validation for settings API depend on effective config 2016-11-16 15:38:13 +01:00
Gina Häußge
a58b167bed Utilize settings chain maps for plugin default settings too 2016-11-16 15:37:49 +01:00
Gina Häußge
83a08cd927 Fix a small issue with estimator output when no file is selected 2016-11-16 14:12:37 +01:00
Gina Häußge
c194cabdcf Fix for select&print not working for SD files anymore
Timing issue, "OctoPrint.job.start()" would be called at a time
when the file had not yet been selected on the server. Hence
a different approach, calculating printerAfterLoading parameter
based on existing information at the time of clicking the
load button and using the print parameter on the select
file API again, as previously.
2016-11-16 14:12:00 +01:00
Gina Häußge
174ffdf06f Simplified a line 2016-11-15 17:26:41 +01:00
Gina Häußge
7ae6240de2 Make CommandLineCaller use unicode instead of bytes
p.(stdout|stderr).text is unicode. p.(stdout|stderr).readline isn't, so decode
manually.

Should hopefully solve #1586 for good now...
2016-11-15 17:26:11 +01:00
Gina Häußge
f9253adf72 Remove accidentally commited plugin file 2016-11-15 13:03:18 +01:00
Gina Häußge
cc5f119f1b Include position in PrintPaused and PrintCancelled events
If available. Updated docs accordingly.
2016-11-15 11:56:30 +01:00
Gina Häußge
a8ff23abe4 Also track F parameters in G28 commands 2016-11-15 11:55:34 +01:00
Gina Häußge
e6c4e0a808 Query byte position on cancel of SD print 2016-11-15 11:55:09 +01:00
Gina Häußge
58835cfd8e Add tracking of cancel position & make public 2016-11-15 11:54:35 +01:00
Gina Häußge
e04bdb3571 Allow access to the current printed file position 2016-11-15 10:28:14 +01:00
Gina Häußge
06f7abdb2d Manually track position in file
self._handle.tell lies because of line based reading and
buffering
2016-11-15 10:25:40 +01:00
Gina Häußge
2429ebc1a2 Virtual Printer: Simplified temperature output 2016-11-14 13:45:22 +01:00
Gina Häußge
c6b8b1725a Fixed duplicated M140 line (merge error) 2016-11-14 13:26:05 +01:00
Gina Häußge
4a67762ead virtual printer: Track F and flow/feedrate factors 2016-11-14 13:24:56 +01:00
Gina Häußge
0a9475661f SWU: more verbose output on restart fail 2016-11-11 15:26:36 +01:00
Gina Häußge
2c6fb68544 SWU: Fix issue with log output containing non ASCII characters
See #1586
2016-11-11 15:20:19 +01:00
Gina Häußge
b4215c885c Support M114 responses without whitespace between coordinates
Because apparently there exist some firmware variants/forks which don't
have spaces between the coordinate entries. Who needs standards :)
2016-11-11 13:24:00 +01:00
Gina Häußge
c8273785cd Fix position tracking of virtual printer
Wasn't taking relative moves into account for coordinate persistence.
2016-11-11 11:52:33 +01:00
Gina Häußge
5446dc645c Use default settings preprocessors if none are provided
Re-enables feedback controls.

Closes #1588
2016-11-11 11:45:17 +01:00
Gina Häußge
fac83e91f2 Invalidate timelapse cache when config changes 2016-11-09 16:31:43 +01:00
Gina Häußge
153ebc3692 Fixed retractionZHop setting for Z timelapses
Solves issue reported in #1148 for 1.3.0rc1
2016-11-09 16:30:51 +01:00
Gina Häußge
b74a5db4d8 Get rid of double scroll bar in printer profile editor 2016-11-09 15:45:39 +01:00
Gina Häußge
47a3e0340e Allow to define a custom bounding box for printer head movements
That bounding box may have larger dimensions than the print volume
(but not smaller ones). That allows to define safe areas for which no
"exceeds print volume" messages need to be triggered.

Solves #1551
2016-11-09 15:45:25 +01:00
Gina Häußge
d28e0988fb Merge branch 'maintenance' into devel 2016-11-07 16:18:26 +01:00
Gina Häußge
2952b2622e Do not hiccup on ipv6 addresses in the HTTP Host header
Fixed port extraction. Now supports hostname, hostname + port,
ipv4, ipv4 + port, ipv6, ipv6 + port

Fixes #1571
2016-11-07 16:17:16 +01:00
Gina Häußge
970880dee6 Added user roles and enabled plugins to settings ETag
Otherwise the cache of /api/settings would not be properly invalidated
on a change in either the user login state or the set of active plugins.

See also #1576
2016-11-07 11:55:26 +01:00
Gina Häußge
4689a405a3 Merge branch 'dev/positionRecordingOnPause' into devel 2016-11-04 12:12:38 +01:00
Gina Häußge
fae27c77b5 Have virtual printer coordinates start at 0.0 2016-11-04 12:12:30 +01:00
Gina Häußge
3f0bfa0fc8 New POSITION_UPDATE event for responses to M114 2016-11-04 12:11:16 +01:00
Gina Häußge
35cf623f81 Merge pull request #1550 from dattas/feature/cancel-confirmation
Add confirmation dialog to cancel to prevent accidental cancel of prints
2016-10-26 11:03:40 +02:00
Gina Häußge
7abd35196e Merge pull request #1554 from FHeilmann/FHeilmann-adjust_values_func
Adjust output of values() classmethod to not include function itself
2016-10-26 11:02:12 +02:00
donovan6000
6114ee4f32 Fixed Cura plugin's get_pos_x/y returning the wrong value when self._posX/Y is 0 2016-10-25 22:46:32 -07:00
Florian Heilmann
5ac934bcc4 Fix Typos
Note to self: double and triple check more!

turn "=" into "=="
2016-10-22 12:53:32 +02:00
Florian Heilmann
fd1016695f Adjust output of values() classmethod
The way it was before, the function would also return itself. This isn't really a problem here, but if someone takes this function as a guide (like me) they can run into problems when iterating over the returned array, as it contains an element representing "values()" itself.

Another approach would be make use of the inspect package and replace name="values" with inspect.ismethod(name)
2016-10-22 12:39:16 +02:00
Gina Häußge
728172136a Record position on pause & track F 2016-10-21 20:38:15 +02:00
Gina Häußge
d3cc96523e Fix M114 in virtual printer 2016-10-21 20:37:41 +02:00
Dattas Moonchaser
7e2382fed4 Add option to repeat last captured frame instead of capturing new frames for the end of a timelapse. Defaults to current behavior (capturing new frames for the time after). Implements foosel/OctoPrint#1422 2016-10-20 19:06:26 -06:00
Dattas Moonchaser
7fb2745f8f Add confirmation dialog to cancel to prevent accidental cancel of print (which is hard to undo!) 2016-10-19 15:22:15 -06:00
Gina Häußge
0fcef2a8aa Updated german translation 2016-10-19 12:17:34 +02:00
Gina Häußge
6b41b8826e Slight rewording in Cura wizard 2016-10-19 12:17:17 +02:00
Gina Häußge
d96991bbf6 Fix detection if webcam wizard is required 2016-10-19 11:05:05 +02:00
Gina Häußge
8c336afeab Mark support annountement as seen by default
devel has wizard screen to hint people at support page
2016-10-19 11:03:49 +02:00
Gina Häußge
bfae91d737 Another jquery update 2016-10-18 12:58:26 +02:00
Gina Häußge
8e90555381 Updated & renamed some JS dependencies 2016-10-18 12:31:56 +02:00
Gina Häußge
df5eae91a6 Adjust empty asset handling to match style in devel 2016-10-17 14:31:56 +02:00
Gina Häußge
c66be226b1 Merge branch 'maintenance' into devel
# Conflicts:
#	CHANGELOG.md
2016-10-17 14:24:17 +02:00
Gina Häußge
7efdeced62 Merge branch 'rc/maintenance' into maintenance 2016-10-17 14:23:43 +02:00
Gina Häußge
88f8077b77 Plugin JS files might be empty, need to handle that
Otherwise webassets will explode with empty file list on bundle creation.
2016-10-17 12:16:53 +02:00
Gina Häußge
2f7a400c5a Support for M116
When encountered: set heatup and long_running_command flags to True, set heatup start time
2016-10-17 11:50:23 +02:00
Gina Häußge
4724153637 Restrict upload dialogs for plugins and language packs to supported extensions 2016-10-17 11:33:23 +02:00
Gina Häußge
93196993d1 Last modified may be any of int, long, float
... and complex for good measure. Basically: a number.
2016-10-17 10:46:49 +02:00
Gina Häußge
696979789e Merge branch 'improve/supportRinTempCommands' into devel
# Conflicts:
#	src/octoprint/plugins/virtual_printer/virtual.py
2016-10-17 10:44:18 +02:00
Gina Häußge
696904bc49 Support M1{09|90} R<temp> in virtual printer too 2016-10-17 10:41:39 +02:00
Gina Häußge
cd578dc2e1 Checking M109/M190 for R should actually check for R and not S
Thanks @FHeilmann
2016-10-17 10:29:16 +02:00
Gina Häußge
0d8fdfae26 Trust Tc over T when parsing temps from the firmware 2016-10-17 10:27:06 +02:00
Gina Häußge
534b56b721 Merge branch 'improve/supportRinTempCommands' into devel 2016-10-17 09:48:15 +02:00
Gina Häußge
e15956883a Add support for R parameter in M109/M190 2016-10-14 18:19:08 +02:00
Gina Häußge
9fb8883923 Merge branch 'fix/issue1541' into devel 2016-10-14 16:24:43 +02:00
Gina Häußge
3f8dde75d5 Persist settings after changing default printer profile
Fixes #1541
2016-10-14 16:23:47 +02:00
Gina Häußge
6e39ea046f Merge branch 'fix/issue1543' into devel 2016-10-14 16:02:00 +02:00
Gina Häußge
bc5044b125 Fix target temperature propagation from comm layer
When setting the tracked target temperature from a sent temperature
command, the changes in tracked temperature were not propagated
from the comm layer to registered callbacks.

But since the standard printer also didn't make a copy of the mutable
dict of tool temperatures, those were in fact updated even without
propagation in the printer implementation when the values in the
comm layer got updated, whereas the bed temperature - an immutable
tupel - was not.

Two wrongs sometimes do in fact make a right. In this case that led
to target temperature changes on the tools immediately reflecting
in printer.get_current_temperatures after the command was sent,
but changes to the bed target taking until the next M105 response
to propagate.

Decoupling the data structures and adding propagation commands
to the comm layer solves this issue.

Fixes #1543
2016-10-14 16:01:03 +02:00
Gina Häußge
f7eb12a3ee Docs for {Reload|Restart}NeedingPlugin 2016-10-14 14:15:33 +02:00
Gina Häußge
ee92fc6907 Docs for CLI of software update plugin 2016-10-14 13:57:01 +02:00
Gina Häußge
62939ef11b Clarification regarding webcam URL formats 2016-10-14 12:35:01 +02:00
Gina Häußge
5f60017bb2 Merge branch 'improve/curaImporter' into devel
# Conflicts:
#	src/octoprint/plugins/cura/templates/cura_settings.jinja2
2016-10-14 12:00:17 +02:00
Gina Häußge
c863562d12 Limit cura profile importer to .ini files and clarified support again 2016-10-14 11:58:39 +02:00
Gina Häußge
44402fda3a Use CleaningTimedRotatingFileHandler in virtual printer 2016-10-14 09:37:06 +02:00
Gina Häußge
7714aaca89 Merge branch 'fix/timelapseFramerateParameter' into devel 2016-10-13 19:23:26 +02:00
Gina Häußge
27fb397681 ffmpeg: Only modify the -framerate parameter for setting video fps
-r only allows a limited set of target framerates according to the mpeg2
 standard, but -framerate allows to specify how long each frame should
 be shown, giving us full control over "virtual" fps without causing errors
 when the user selects a non-standard frame rate
2016-10-13 19:23:15 +02:00
Gina Häußge
3606ed126a Fix a merge error causing timeouts on the virtual printer
Long lines (longer than rx buffer) could not be processed at all, leading
to a serial timeout exception thrown by the virtual printer. Adjusted
to allow for partial processing like on maintenance
2016-10-13 17:43:03 +02:00
Gina Häußge
613363379f Merge branch 'maintenance' into devel
# Conflicts:
#	CHANGELOG.md
#	src/octoprint/templates/javascripts.jinja2
2016-10-13 17:17:44 +02:00
Gina Häußge
6cd6b98c2b Core JS needs to go after plugin JS, or we might run into race conditions 2016-10-13 16:11:13 +02:00
Gina Häußge
5626b6d40b Merge branch 'maintenance' into devel
# Conflicts:
#	src/octoprint/templates/javascripts.jinja2
2016-10-13 15:52:03 +02:00
Gina Häußge
99004f14ba Core JS needs to go after plugin JS, or we might run into race conditions 2016-10-13 15:51:38 +02:00
Gina Häußge
9de78001dd Merge branch 'maintenance' into devel
# Conflicts:
#	CHANGELOG.md
#	docs/plugins/concepts.rst
#	src/octoprint/__init__.py
#	src/octoprint/server/__init__.py
#	src/octoprint/templates/javascripts.jinja2
#	src/octoprint/timelapse.py

Merge branch 'devel' into dev/wizard

# Conflicts:
#	octoprint_octobullet/__init__.py
#	octoprint_octobullet/templates/octobullet_settings.jinja2

Merge branch 'devel' into dev/wizard

# Conflicts:
#	octoprint_octobullet/__init__.py
#	octoprint_octobullet/templates/octobullet_settings.jinja2
2016-10-13 14:22:40 +02:00
Gina Häußge
419f3370a2 Split JS/CSS/LESS assets between core+bundled plugins and external plugins
That way a JS error in an external plugin won't nuke the whole UI, which IMHO
is worth the additional requests needed to load the split up files.

See #1544 for an example of such a situation.
2016-10-13 12:07:00 +02:00
Gina Häußge
1370c7a9cc Inject plugin_info object into plugin implementations as well 2016-10-13 12:03:05 +02:00