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.
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).
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.
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
* 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).
* 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
* 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