🚸 Add default extrusion length to printer profile (#4416)
Implements #4353
This commit is contained in:
1 parent
16f1e939c6
commit
169abe7af7
8 files changed
+43
-12
No files matched your search
@@ -626,6 +626,12 @@ Profile
|
||||
- 0..1
|
||||
- ``float``
|
||||
- The diameter of the printer's nozzle(s) in mm.
|
||||
* - ``extruder.sharedNozzle``
|
||||
- ``boolean``
|
||||
- Whether there's only one nozzle shared among all extruders (true) or one nozzle per extruder (false).
|
||||
* - ``extruder.defaultExtrusionLength``
|
||||
- ``int``
|
||||
- Default extrusion length used in Control tab on initial page load in mm.
|
||||
* - ``extruder.count``
|
||||
- 0..1
|
||||
- ``int``
|
||||
|
||||
@@ -372,8 +372,6 @@ mapped, with the following exceptions:
|
||||
- Maps to ``folder.timelapse_tmp`` in ``config.yaml``
|
||||
* - ``plugins``
|
||||
- Plugin settings as available from ``config.yaml`` and :class:`~octoprint.plugin.SettingsPlugin` implementations
|
||||
* - ``printer.defaultExtrusionLength``
|
||||
- Maps to ``printerParameters.defaultExtrusionLength`` in ``config.yaml``
|
||||
* - ``scripts.gcode``
|
||||
- Whole subtree of configured :ref:`GCODE scripts <sec-features-gcode_scripts>`
|
||||
* - ``serial.port``
|
||||
|
||||
@@ -83,6 +83,9 @@ A printer profile is a ``dict`` of the following structure:
|
||||
* - ``extruder.sharedNozzle``
|
||||
- ``boolean``
|
||||
- Whether there's only one nozzle shared among all extruders (true) or one nozzle per extruder (false).
|
||||
* - ``extruder.defaultExtrusionLength``
|
||||
- ``int``
|
||||
- Default extrusion length used in Control tab on initial page load in mm.
|
||||
* - ``axes``
|
||||
- ``dict``
|
||||
- Information about the printer axes
|
||||
@@ -242,6 +245,7 @@ class PrinterProfileManager:
|
||||
"offsets": [(0, 0)],
|
||||
"nozzleDiameter": 0.4,
|
||||
"sharedNozzle": False,
|
||||
"defaultExtrusionLength": 5,
|
||||
},
|
||||
"axes": {
|
||||
"x": {"speed": 6000, "inverted": False},
|
||||
|
||||
@@ -114,11 +114,6 @@ def getSettings():
|
||||
"closeModalsWithClick": s.getBoolean(["appearance", "closeModalsWithClick"]),
|
||||
"showInternalFilename": s.getBoolean(["appearance", "showInternalFilename"]),
|
||||
},
|
||||
"printer": {
|
||||
"defaultExtrusionLength": s.getInt(
|
||||
["printerParameters", "defaultExtrusionLength"]
|
||||
)
|
||||
},
|
||||
"webcam": {
|
||||
"webcamEnabled": s.getBoolean(["webcam", "webcamEnabled"]),
|
||||
"timelapseEnabled": s.getBoolean(["webcam", "timelapseEnabled"]),
|
||||
|
||||
@@ -305,7 +305,7 @@ default_settings = {
|
||||
"sendAutomaticallyAfter": 1,
|
||||
},
|
||||
"printerProfiles": {"default": None},
|
||||
"printerParameters": {"pauseTriggers": [], "defaultExtrusionLength": 5},
|
||||
"printerParameters": {"pauseTriggers": []},
|
||||
"appearance": {
|
||||
"name": "",
|
||||
"color": "default",
|
||||
|
||||
@@ -22,6 +22,7 @@ $(function () {
|
||||
self.isLoading = ko.observable(undefined);
|
||||
|
||||
self.extrusionAmount = ko.observable(undefined);
|
||||
|
||||
self.controls = ko.observableArray([]);
|
||||
|
||||
self.distances = ko.observableArray([0.1, 1, 10, 100]);
|
||||
@@ -82,10 +83,18 @@ $(function () {
|
||||
|
||||
self.settings.printerProfiles.currentProfileData.subscribe(function () {
|
||||
self._updateExtruderCount();
|
||||
self._updateExtrusionAmount();
|
||||
self.settings.printerProfiles
|
||||
.currentProfileData()
|
||||
.extruder.count.subscribe(self._updateExtruderCount);
|
||||
});
|
||||
self._updateExtrusionAmount = function () {
|
||||
self.extrusionAmount(
|
||||
self.settings.printerProfiles
|
||||
.currentProfileData()
|
||||
.extruder.defaultExtrusionLength()
|
||||
);
|
||||
};
|
||||
self._updateExtruderCount = function () {
|
||||
var tools = [];
|
||||
|
||||
@@ -617,7 +626,11 @@ $(function () {
|
||||
}
|
||||
self._enableWebcam();
|
||||
|
||||
self.extrusionAmount(self.settings.printer_defaultExtrusionLength());
|
||||
self.extrusionAmount(
|
||||
self.settings.printerProfiles
|
||||
.currentProfileData()
|
||||
.extruder.defaultExtrusionLength()
|
||||
);
|
||||
};
|
||||
|
||||
self.syncWebcamElements = function () {
|
||||
|
||||
@@ -25,7 +25,8 @@ $(function () {
|
||||
count: 1,
|
||||
offsets: [[0, 0]],
|
||||
nozzleDiameter: 0.4,
|
||||
sharedNozzle: false
|
||||
sharedNozzle: false,
|
||||
defaultExtrusionLength: 5
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -72,6 +73,7 @@ $(function () {
|
||||
self.extruders = ko.observable();
|
||||
self.extruderOffsets = ko.observableArray();
|
||||
self.sharedNozzle = ko.observable();
|
||||
self.defaultExtrusionLength = ko.observable();
|
||||
|
||||
self.axisXSpeed = ko.observable();
|
||||
self.axisYSpeed = ko.observable();
|
||||
@@ -233,6 +235,7 @@ $(function () {
|
||||
|
||||
self.nozzleDiameter(data.extruder.nozzleDiameter);
|
||||
self.sharedNozzle(data.extruder.sharedNozzle);
|
||||
self.defaultExtrusionLength(data.extruder.defaultExtrusionLength);
|
||||
self.extruders(data.extruder.count);
|
||||
var offsets = [];
|
||||
if (data.extruder.count > 1) {
|
||||
@@ -298,7 +301,11 @@ $(function () {
|
||||
self.nozzleDiameter(),
|
||||
defaultProfile.extruder.nozzleDiameter
|
||||
),
|
||||
sharedNozzle: self.sharedNozzle()
|
||||
sharedNozzle: self.sharedNozzle(),
|
||||
defaultExtrusionLength: validInt(
|
||||
self.defaultExtrusionLength(),
|
||||
defaultProfile.extruder.defaultExtrusionLength
|
||||
)
|
||||
},
|
||||
axes: {
|
||||
x: {
|
||||
|
||||
+9
-1
@@ -51,7 +51,15 @@
|
||||
<!-- /ko -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="settings-defaultExtrusionLength">{{ _('Default extrusion length') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
<input type="number" class="input-mini text-right" min="1" data-bind="value: defaultExtrusionLength" id="settings-defaultExtrusionLength">
|
||||
<span class="add-on">mm</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
<small>{{ _('This information is used for the graph and controls available in the "Temperature" tab, the GCODE viewer, when slicing from within OctoPrint and for deciding which toolchange commands are safe to send to the printer.') }}</small>
|
||||
</p>
|
||||
|
||||
Reference in new issue
Block a user