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