Various control for jogging, speed reduced
parent
142d07be21
commit
4035ebcec5
|
@ -187,11 +187,11 @@ def jog():
|
|||
if "x" in request.values.keys():
|
||||
# jog x
|
||||
x = request.values["x"]
|
||||
printer.commands(["G91", "G1 X" + x + " F6000", "G90"])
|
||||
printer.commands(["G91", "G1 X" + x + " F3000", "G90"])
|
||||
if "y" in request.values.keys():
|
||||
# jog y
|
||||
y = request.values["y"]
|
||||
printer.commands(["G91", "G1 Y" + y + " F6000", "G90"])
|
||||
printer.commands(["G91", "G1 Y" + y + " F3000", "G90"])
|
||||
if "z" in request.values.keys():
|
||||
# jog z
|
||||
z = request.values["z"]
|
||||
|
|
|
@ -155,14 +155,18 @@ table th.timelapse_files_action, table td.timelapse_files_action {
|
|||
margin-right: 20px;
|
||||
}
|
||||
|
||||
#controls .jog-panel > h4 {
|
||||
border-bottom: 1px solid #ddd;
|
||||
#controls h1 {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#controls .jog-panel > div {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#controls .jog-panel > div.distance {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#controls .box {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
|
@ -177,6 +181,15 @@ table th.timelapse_files_action, table td.timelapse_files_action {
|
|||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#controls .btn-group {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#controls .btn-group > .btn {
|
||||
min-width: 50px;
|
||||
}
|
||||
|
||||
.text-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
|
|
@ -409,12 +409,14 @@ function ControlsViewModel() {
|
|||
return control;
|
||||
}
|
||||
|
||||
self.sendJogCommand = function(axis, distance) {
|
||||
self.sendJogCommand = function(axis, multiplier, distance) {
|
||||
if (typeof distance === "undefined")
|
||||
distance = $('#jog_distance button.active').data('distance');
|
||||
$.ajax({
|
||||
url: AJAX_BASEURL + "control/jog",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: axis + "=" + distance
|
||||
data: axis + "=" + ( distance * multiplier )
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -169,32 +169,43 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="controls">
|
||||
<div class="jog-panel">
|
||||
<!-- XY jogging control panel -->
|
||||
<div class="jog-panel">
|
||||
<h1>X/Y</h1>
|
||||
<div>
|
||||
<button class="btn box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendJogCommand('y', 10) }"><i class="icon-arrow-up"></i></button>
|
||||
<button class="btn box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendJogCommand('y',1) }"><i class="icon-arrow-up"></i></button>
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendJogCommand('x', -10) }"><i class="icon-arrow-left"></i></button>
|
||||
<button class="btn box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendJogCommand('x',-1) }"><i class="icon-arrow-left"></i></button>
|
||||
<button class="btn box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendHomeCommand('XY') }"><i class="icon-home"></i></button>
|
||||
<button class="btn box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendJogCommand('x', 10) }"><i class="icon-arrow-right"></i></button>
|
||||
<button class="btn box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendJogCommand('x',1) }"><i class="icon-arrow-right"></i></button>
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendJogCommand('y', -10) }"><i class="icon-arrow-down"></i></button>
|
||||
<button class="btn box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendJogCommand('y',-1) }"><i class="icon-arrow-down"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Z jogging control panel -->
|
||||
<div class="jog-panel">
|
||||
<h1>Z</h1>
|
||||
<div>
|
||||
<button class="btn box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendJogCommand('z', 10) }"><i class="icon-arrow-up"></i></button>
|
||||
<button class="btn box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendJogCommand('z',1) }"><i class="icon-arrow-up"></i></button>
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendHomeCommand('Z') }"><i class="icon-home"></i></button>
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendJogCommand('z', -10) }"><i class="icon-arrow-down"></i></button>
|
||||
<button class="btn box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendJogCommand('z',-1) }"><i class="icon-arrow-down"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Jog distance -->
|
||||
<div class="distance">
|
||||
<div class="btn-group" data-toggle="buttons-radio" id="jog_distance">
|
||||
<button type="button" class="btn" data-distance="0.1">0.1</button>
|
||||
<button type="button" class="btn" data-distance="1">1</button>
|
||||
<button type="button" class="btn active" data-distance="10">10</button>
|
||||
<button type="button" class="btn" data-distance="100">100</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Extrusion control panel -->
|
||||
|
|
Loading…
Reference in New Issue