Skip to content

Commit aa87edc

Browse files
committed
Change_Filament 0.3.0
New settings: * Pause Before Park: Send M0 to pause Octoprint before parking. Issue jim-p#6 * Retract Before Park: Perform a small retract before parking. This was performed unconditionally in previous versions. Issue jim-p#6 * Home Before Park: Home X/Y before moving to the X/Y parking position (But after Z Park). Fixes jim-p#3 Also fixed M117 text after load action
1 parent cd4e5c4 commit aa87edc

File tree

5 files changed

+56
-4
lines changed

5 files changed

+56
-4
lines changed

extras/Change_Filament.md

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ Configuration:
4040
* **Unload Speed**: How fast to unload the filament, in mm/m.
4141
* **Load Length**: Length of filament to extrude when loading, in mm.
4242
* **Load Speed**: How fast to extrude when loading filament, in mm/m.
43+
* **Pause Before Park**: Send M0 to pause Octoprint before parking.
44+
* **Retract Before Park**: Perform a small retract before parking.
45+
* **Home Before Park**: Home X/Y before moving to the X/Y parking position.
4346
* **Y Park**: Position on the Y axis where the head will be moved when loading or unloading.
4447
* **X Park**: Position on the X axis where the head will be moved when loading or unloading. Depending on the filament path, may be best set to the midpoint of the X axis.
4548
* **Z Lift Relative**: How high to move the Z axis before unloading, in mm.

octoprint_Change_Filament/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ def get_settings_defaults(self):
4343
unload_speed=1600,
4444
load_length=50,
4545
load_speed=60,
46+
pause_before_park=False,
47+
retract_before_park=False,
48+
home_before_park=False,
4649
y_park=0,
4750
x_park=0,
4851
z_lift_relative=30,

octoprint_Change_Filament/static/js/Change_Filament.js

+22-3
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,33 @@ $(function() {
3939
self.getAdditionalControls = function() {
4040
var settings = self.settings.settings.plugins.Change_Filament;
4141

42+
var preparkpause = '';
43+
if (settings.pause_before_park() != false) {
44+
preparkpause = 'M0';
45+
}
46+
47+
var preparkhome = '';
48+
if (settings.home_before_park() != false) {
49+
preparkhome = 'G28 X0 Y0';
50+
}
51+
52+
var preparkextrude0 = '';
53+
var preparkextrude1 = '';
54+
if (settings.retract_before_park() != false) {
55+
preparkextrude0 = 'M83';
56+
preparkextrude1 = 'G1 E-5 F50';
57+
}
58+
4259
return [{
4360
'customClass': '', 'layout': 'horizontal_grid', 'name': 'Change Filament', 'children':[
4461
{'width': '2', 'commands': [
4562
'M117 Parking nozzle',
46-
'M83',
47-
'G1 E-5 F50',
63+
preparkpause,
64+
preparkextrude0,
65+
preparkextrude1,
4866
'G91',
4967
'G0 Z' + settings.z_lift_relative() + ' F' + settings.park_speed(),
68+
preparkhome,
5069
'G90',
5170
'G0 Y' + settings.y_park() + ' X' + settings.x_park() + ' F' + settings.park_speed(),
5271
'M117 Nozzle parked'
@@ -64,7 +83,7 @@ $(function() {
6483
'M117 Loading filament',
6584
'M83',
6685
'G1 E' + settings.load_length() + ' F' + settings.load_speed(),
67-
'M117 Replace filament, set new temp, click Load'
86+
'M117 New Filament Loaded'
6887
],
6988
'customClass': 'btn', 'additionalClasses': 'nowrap btn-warning fa fa-step-forward', 'name': ' Load'},
7089
{'width': '2', 'commands': [

octoprint_Change_Filament/templates/Change_Filament_settings.jinja2

+27
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,33 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8080
</div>
8181

8282
<h3>{{ _('Print Head Settings') }}</h3>
83+
<div class="control-group">
84+
<label class="control-label">{{ _('Pause Before Park') }}:</label>
85+
<div class="controls">
86+
<div class="input-append">
87+
<input type="checkbox" data-bind="checked: settings.plugins.Change_Filament.pause_before_park">
88+
</div>
89+
<span class="help-block">{{ _('Send M0 to pause Octoprint before parking.') }}</span>
90+
</div>
91+
</div>
92+
<div class="control-group">
93+
<label class="control-label">{{ _('Retract Before Park') }}:</label>
94+
<div class="controls">
95+
<div class="input-append">
96+
<input type="checkbox" data-bind="checked: settings.plugins.Change_Filament.retract_before_park">
97+
</div>
98+
<span class="help-block">{{ _('Perform a small retract before parking.') }}</span>
99+
</div>
100+
</div>
101+
<div class="control-group">
102+
<label class="control-label">{{ _('Home Before Park') }}:</label>
103+
<div class="controls">
104+
<div class="input-append">
105+
<input type="checkbox" data-bind="checked: settings.plugins.Change_Filament.home_before_park">
106+
</div>
107+
<span class="help-block">{{ _('Home X/Y before moving to the X/Y parking position.') }}</span>
108+
</div>
109+
</div>
83110
<div class="control-group">
84111
<label class="control-label">{{ _('Y Park') }}:</label>
85112
<div class="controls">

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugin_identifier = "Change_Filament"
22
plugin_package = "octoprint_Change_Filament"
33
plugin_name = "Change_Filament"
4-
plugin_version = "0.2.0"
4+
plugin_version = "0.3.0"
55
plugin_description = """Facilitates changing filament (unloads old, loads new)"""
66
plugin_author = "Jim Pingle"
77
plugin_author_email = "jim@pingle.org"

0 commit comments

Comments
 (0)