leveling: better layout and home button

This commit is contained in:
Martin Muehlhaeuser 2018-02-02 19:46:27 +00:00
parent f6556f6e3d
commit 82dcf442a6
2 changed files with 43 additions and 17 deletions

View File

@ -17,12 +17,16 @@ $(function() {
}
self.stopLeveling = function() {
self.activePoint(-1);
OctoPrint.control.sendGcode("G1 Z" +
(self.settings.settings.plugins.klipper.probeHeight()*1 +
self.settings.settings.plugins.klipper.probeLift()*1)
);
OctoPrint.control.sendGcode("G28")
self.gotoHome();
}
self.gotoHome = function() {
OctoPrint.control.sendGcode("G28");
self.activePoint(-1);
}
self.nextPoint = function() {

View File

@ -4,21 +4,43 @@
<h3 id="leveling_dialog_label">Assisted Bed Leveling</h3>
</div>
<div class="modal-body">
<div class="row-fluid">
<div class="span3">
<button class="btn btn-block" data-bind="click: startLeveling"><i class="icon-play"></i> Start</button>
<button class="btn btn-block" data-bind="click: previousPoint, enable: (activePoint() > 0)"><i class="icon-step-backward"></i> Previous</button>
<button class="btn btn-block" data-bind="click: nextPoint, enable: (activePoint() < pointCount()-1)"><i class="icon-step-forward"></i> Next</button>
<button class="btn btn-block" data-bind="click: stopLeveling" data-dismiss="modal"><i class="icon-stop"></i> Stop</button>
</div>
<div class="span8">
<div data-bind="foreach: settings.settings.plugins.klipper.probePoints" >
<div class="row-fluid">
<div class="span1"><i class="fa fa-arrow-right" data-bind="visible: ($index()==$parent.activePoint())"></i></div>
<button class="btn btn-mini btn-info" data-bind="click: $parent.jumpToPoint"><span data-bind="text: $index"></span>: (<span data-bind="text: x"></span>, <span data-bind="text: y"></span>)</button>
</div>
<div class="row-fluid">
<div class="span1">
<i class="fa fa-arrow-right pull-right" data-bind="visible: (activePoint() == -1)"></i>
</div>
<div class="span1"></div>
<div class="span1">
<button class="btn btn-mini btn-info btn-block" data-bind="click: gotoHome">
Home
</button>
</div>
<div class="span7">&nbsp;</div>
</div>
<div data-bind="foreach: settings.settings.plugins.klipper.probePoints">
<div class="row-fluid">
<div class="span1">
<i class="fa fa-arrow-right pull-right" data-bind="visible: ($index()==$parent.activePoint())"></i>
</div>
<div data-bind="text: $index" class="span1"></div>
<div class="span3">
<button class="btn btn-mini btn-info btn-block" data-bind="click: $parent.jumpToPoint">
( <span data-bind="text: x"></span>, <span data-bind="text: y"></span> )
</button>
</div>
<div class="span7">&nbsp;</div>
</div>
</div>
<div class="row-fluid">
<div class="span2"></div>
<div class="btn-toolbar span8">
<div class="btn-group">
<button class="btn" data-bind="click: startLeveling"><i class="icon-play"></i> Start</button>
<button class="btn" data-bind="click: previousPoint, enable: (activePoint() > 0)"><i class="icon-chevron-left"></i> Previous</button>
<button class="btn" data-bind="click: nextPoint, enable: (activePoint() < pointCount()-1)">Next <i class="icon-chevron-right"></i></button>
<button class="btn" data-bind="click: stopLeveling" data-dismiss="modal"><i class="icon-stop"></i> Stop</button>
</div>
</div>
</div>
</div>
<div class="span2"></div>
</div>
</div>
</div>