leveling: Added speed settings parameter

This commit is contained in:
mfm 2018-01-24 19:05:28 +01:00
parent c3b56364b9
commit ce7546b781
3 changed files with 31 additions and 8 deletions

View File

@ -24,6 +24,8 @@ class KlipperPlugin(
macros=[{'name':"Echo", 'macro':"ECHO"}],
probeHeight=0,
probeLift=5,
probeSpeedXy=800,
probeSpeedZ=500,
probePoints=[{'x':0, 'y':0}])
def get_template_configs(self):

View File

@ -14,23 +14,23 @@ $(function() {
self.startLeveling = function() {
self.activePoint(0);
OctoPrint.control.sendGcode("G28")
self.moveToPoint(self.activePoint);
self.moveToPoint(self.activePoint());
}
self.stopLeveling = function() {
self.activePoint(-1);
OctoPrint.control.sendGcode("G1 Z" + self.settings.settings.plugins.klipper.probeHeight() + self.settings.settings.plugins.klipper.probeLift());
OctoPrint.control.sendGcode("G1 Z" + (self.settings.settings.plugins.klipper.probeHeight()*1 + self.settings.settings.plugins.klipper.probeLift()*1));
OctoPrint.control.sendGcode("G28")
}
self.nextPoint = function() {
self.activePoint(self.activePoint()+1);
self.moveToPoint(self.activePoint);
self.moveToPoint(self.activePoint());
}
self.previousPoint = function() {
self.activePoint(self.activePoint()-1);
self.moveToPoint(self.activePoint);
self.moveToPoint(self.activePoint());
}
self.pointCount = function() {
@ -40,9 +40,18 @@ $(function() {
self.moveToPoint = function(index) {
var point = self.settings.settings.plugins.klipper.probePoints()[index];
OctoPrint.control.sendGcode("G1 Z" + self.settings.settings.plugins.klipper.probeHeight() + self.settings.settings.plugins.klipper.probeLift());
OctoPrint.control.sendGcode("G1 X" + point.x() + " Y" + point.y());
OctoPrint.control.sendGcode("G1 Z" + self.settings.settings.plugins.klipper.probeHeight());
OctoPrint.control.sendGcode(
"G1 Z" + (self.settings.settings.plugins.klipper.probeHeight()*1 + self.settings.settings.plugins.klipper.probeLift()*1) +
" F" + self.settings.settings.plugins.klipper.probeSpeedZ()
);
OctoPrint.control.sendGcode(
"G1 X" + point.x() + " Y" + point.y() +
" F" + self.settings.settings.plugins.klipper.probeSpeedXy()
);
OctoPrint.control.sendGcode(
"G1 Z" + self.settings.settings.plugins.klipper.probeHeight() +
" F" + self.settings.settings.plugins.klipper.probeSpeedZ()
);
}
}

View File

@ -67,7 +67,19 @@
<div class="controls">
<input type="text" class="input-block-level span3" data-bind="value: settings.settings.plugins.klipper.probeLift">
</div>
</div>
</div>
<div class="control-group">
<label class="control-label">Probe Speed XY</label>
<div class="controls">
<input type="text" class="input-block-level span3" data-bind="value: settings.settings.plugins.klipper.probeSpeedXy">
</div>
</div>
<div class="control-group">
<label class="control-label">Probe Speed Z</label>
<div class="controls">
<input type="text" class="input-block-level span3" data-bind="value: settings.settings.plugins.klipper.probeSpeedZ">
</div>
</div>
<div class="control-group">
<h5>{{ _('Probe Points') }}</h5>
</div>