kopia lustrzana https://github.com/OpenBuilds/OpenBuilds-CONTROL
Grbl Settings
rodzic
8bf189d85e
commit
f78fd8b094
|
@ -19,6 +19,22 @@ body {
|
|||
margin-top: 5px;
|
||||
}
|
||||
|
||||
#grblPanel {
|
||||
max-height: calc(100vh - 190px);
|
||||
height: calc(100vh - 190px);
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
overflow-x: none;
|
||||
padding: 8px;
|
||||
-webkit-touch-callout: text; /* iOS Safari */
|
||||
-webkit-user-select: text; /* Safari */
|
||||
-khtml-user-select: text; /* Konqueror HTML */
|
||||
-moz-user-select: text; /* Firefox */
|
||||
-ms-user-select: text; /* Internet Explorer/Edge */
|
||||
user-select: text; /* Non-prefixed version, currently
|
||||
supported by Chrome and Opera */
|
||||
}
|
||||
|
||||
#console {
|
||||
/*font-family: "Courier New", Courier, monospace;*/
|
||||
font-family: "Lucida Console", Monaco, monospace;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
<nav data-role="ribbonmenu" class="mt-1">
|
||||
<ul class="tabs-holder">
|
||||
<li><a href="#section-one" onclick="connectionPanel();">Connection</a></li>
|
||||
<li id="grblSettings" style="display: none;"><a href="#section-grbl" onclick="grblPanel();">Grbl Settings</a></li>
|
||||
<li><a href="#section-two" onclick="manualcontrolPanel();">Control</a></li>
|
||||
</ul>
|
||||
<div class="content-holder">
|
||||
|
@ -48,7 +49,7 @@
|
|||
</div>
|
||||
<span class="title">Machine Interface</span>
|
||||
</div>
|
||||
<div class="group" style="width: 140px;">
|
||||
<div class="group" style="width: 190px;">
|
||||
<div id="grblButtons" style="display: none;">
|
||||
<div class="ribbon-group">
|
||||
<button class="ribbon-icon-button" onclick="sendGcode(String.fromCharCode(0x18))">
|
||||
|
@ -57,17 +58,72 @@
|
|||
</span>
|
||||
<span class="caption">Reset</span>
|
||||
</button>
|
||||
<button class="ribbon-icon-button" onclick="sendGcode('$X')">
|
||||
<!-- <button class="ribbon-icon-button" onclick="sendGcode('$X')">
|
||||
<span class="icon">
|
||||
<span class="mif-unlock"></span>
|
||||
</span>
|
||||
<span class="caption">Unlock</span>
|
||||
</button> -->
|
||||
<button class="ribbon-icon-button" onclick="sendGcode('$$')">
|
||||
<span class="icon">
|
||||
<span class="mif-cogs"></span>
|
||||
</span>
|
||||
<span class="caption">Settings</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<span class="title" id="firmwarename"></span>
|
||||
</div>
|
||||
<div class="group" style="width: 50px;">
|
||||
<div class="group" style="width: 100px;">
|
||||
<button class="ribbon-button" onclick="socket.emit('clearAlarm', 2)">
|
||||
<span class="icon">
|
||||
<span class="fa-layers" data-toggle="tooltip" data-placement="bottom" title="Flashes red when machine has entered ALARM state, click Clear Alarm button">
|
||||
<i id="navbellBtn1" class="fas fa-bell fg-red" style="display: none;"></i>
|
||||
<i class="far fa-bell"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="caption">Unlock<br>Alarm</span>
|
||||
</button>
|
||||
<button class="ribbon-button" onclick="socket.emit('stop', true);">
|
||||
<span class="icon">
|
||||
<span class="fa-layers fa-fw">
|
||||
<i class="fas fa-circle fg-red" data-fa-transform="grow-8"></i>
|
||||
<i class="fa-inverse far fa-hand-paper" data-fa-transform="grow-1 left-0.5"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="caption">Stop<br>Job</span>
|
||||
</button>
|
||||
<span class="title">E-Stop</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="section-grbl">
|
||||
<div class="group" style="width: calc(100vw - 40px);">
|
||||
<button class="ribbon-button" onclick="grblSaveSettings();">
|
||||
<span class="icon">
|
||||
<i class="fas fa-save fg-grayBlue" data-fa-transform="grow-8"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="caption">Save<br> to Firmware</span>
|
||||
</button>
|
||||
<button class="ribbon-button" onclick="$('#grblPlaceholder').show(); $('#grblconfig').hide();sendGcode('$$');">
|
||||
<span class="icon">
|
||||
<i class="fas fa-sync-alt"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="caption">Refresh<br>from Firmware</span>
|
||||
</button>
|
||||
<span class="title">Grbl Settings</span>
|
||||
</div>
|
||||
<div class="group" style="width: 100px;">
|
||||
<button class="ribbon-button" onclick="socket.emit('clearAlarm', 2)">
|
||||
<span class="icon">
|
||||
<span class="fa-layers" data-toggle="tooltip" data-placement="bottom" title="Flashes red when machine has entered ALARM state, click Clear Alarm button">
|
||||
<i id="navbellBtn3" class="fas fa-bell fg-red" style="display: none;"></i>
|
||||
<i class="far fa-bell"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="caption">Unlock<br>Alarm</span>
|
||||
</button>
|
||||
<button class="ribbon-button" onclick="socket.emit('stop', true)">
|
||||
<span class="icon">
|
||||
<span class="fa-layers fa-fw">
|
||||
|
@ -81,7 +137,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="section" id="section-two">
|
||||
<div class="group" style="width: calc(100vw - 40px);">
|
||||
<div class="group" style="width: calc(100vw - 90px);">
|
||||
<label href="#" class="ribbon-button btn-file m-2" title="Open a GCODE file">
|
||||
<span class="icon">
|
||||
<i class="far fa-folder-open fg-amber"></i>
|
||||
|
@ -95,7 +151,6 @@
|
|||
</span>
|
||||
<span id="playpauseresumelabel" class="caption">Run<br>Job</span>
|
||||
</button>
|
||||
|
||||
<div>
|
||||
<button class="ribbon-button dropdown-toggle grblmode">
|
||||
<span class="icon">
|
||||
|
@ -127,18 +182,18 @@
|
|||
</span>
|
||||
<span class="caption grblmode">Home<br>All</span>
|
||||
</button>
|
||||
<span class="title">Control</span>
|
||||
</div>
|
||||
<div class="group" style="width: 100px;">
|
||||
<button class="ribbon-button" onclick="socket.emit('clearAlarm', 2)">
|
||||
<span class="icon">
|
||||
<span class="fa-layers" data-toggle="tooltip" data-placement="bottom" title="Flashes red when machine has entered ALARM state, click Clear Alarm button">
|
||||
<i id="navbellBtn" class="fas fa-bell fg-red" style="display: none;"></i>
|
||||
<i id="navbellBtn2" class="fas fa-bell fg-red" style="display: none;"></i>
|
||||
<i class="far fa-bell"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="caption">Clear<br>Alarm</span>
|
||||
<span class="caption">Unlock<br>Alarm</span>
|
||||
</button>
|
||||
<span class="title">Control</span>
|
||||
</div>
|
||||
<div class="group" style="width: 50px;">
|
||||
<button class="ribbon-button" onclick="socket.emit('stop', true)">
|
||||
<span class="icon">
|
||||
<span class="fa-layers fa-fw">
|
||||
|
@ -328,12 +383,12 @@
|
|||
</table>
|
||||
</div>
|
||||
<div class="cell" id="frocell">
|
||||
<input id="fro" data-on-stop="feedOverride(arguments[0])" data-role="slider" data-vertical="true" data-size="160" data-accuracy="5" data-min="-50" data-max="200" data-value="100" data-hint="true" data-hint-always="true" data-hint-position="bottom" data-hint-mask="Feed: $1%"
|
||||
<input id="fro" data-on-stop="feedOverride(arguments[0])" data-role="slider" data-vertical="true" data-size="160" data-accuracy="10" data-min="-50" data-max="200" data-value="100" data-hint="true" data-hint-always="true" data-hint-position="bottom" data-hint-mask="Feed: $1%"
|
||||
data-cls-hint="bg-light
|
||||
fg-dark shadow-1" data-cls-complete="bg-grayBlue">
|
||||
</div>
|
||||
<div class="cell" id="trocell">
|
||||
<input id="tro" data-on-stop="spindleOverride(arguments[0])" data-role="slider" data-vertical="true" data-size="160" data-accuracy="5" data-min="-50" data-max="200" data-value="100" data-hint="true" data-hint-always="true" data-hint-position="bottom"
|
||||
<input id="tro" data-on-stop="spindleOverride(arguments[0])" data-role="slider" data-vertical="true" data-size="160" data-accuracy="10" data-min="-50" data-max="200" data-value="100" data-hint="true" data-hint-always="true" data-hint-position="bottom"
|
||||
data-hint-mask="Tool: $1%" data-cls-hint="bg-light
|
||||
fg-dark shadow-1" data-cls-complete="bg-grayBlue">
|
||||
</div>
|
||||
|
@ -342,6 +397,9 @@
|
|||
<div id="editor"></div>
|
||||
</center>
|
||||
</div>
|
||||
<div id="grblPanel">
|
||||
<div id="grblconfig"></div>
|
||||
</div>
|
||||
|
||||
<!-- Bottom StatusBar -->
|
||||
<div class="fixed-bottom">
|
||||
|
|
|
@ -43,36 +43,49 @@ function grblSettings(data) {
|
|||
var param = grblconfig[i].split('=')[1]
|
||||
grblParams[key] = param
|
||||
}
|
||||
$('#grbl-placeholder').hide();
|
||||
$('#grblconfig').show();
|
||||
grblPopulate();
|
||||
$('#grblSaveBtn').removeAttr('disabled');
|
||||
$('#grblFirmwareBtn').removeAttr('disabled');
|
||||
// $('#grblconfig').show();
|
||||
// grblPopulate();
|
||||
// $('#grblSaveBtn').removeAttr('disabled');
|
||||
// $('#grblFirmwareBtn').removeAttr('disabled');
|
||||
$('#grblSettings').show()
|
||||
}
|
||||
|
||||
function grblPopulate() {
|
||||
console.log('called already')
|
||||
$('#grblPlaceholder').hide();
|
||||
$('#grblconfig').show();
|
||||
$('#grblconfig').empty();
|
||||
var template = `
|
||||
<table class="table table-striped"><tr><th>Parameter</th><th>Value</th><th></th></tr>
|
||||
<tr><td>X-axis steps per millimeter [$100]</td><td><input class="form-control" value="` + grblParams['$100'] + `" id="val-` + 100 + `-input"></td></tr>
|
||||
<tr><td>X-axis maximum rate, mm/min [$110]</td><td><input class="form-control" value="` + grblParams['$110'] + `" id="val-` + 110 + `-input"></td></tr>
|
||||
<tr><td>X-axis acceleration, mm/sec<sup>2</sup> [$120]</td><td><input class="form-control" value="` + grblParams['$120'] + `" id="val-` + 120 + `-input"></td></tr>
|
||||
<tr><td>X-axis maximum travel, millimeters [$130]</td><td><input class="form-control" value="` + grblParams['$130'] + `" id="val-` + 130 + `-input"></td></tr>
|
||||
<table data-role="table" class="table compact striped row-hover row-border" data-show-rows-steps="false" data-rows="200" data-show-pagination="false" data-show-table-info="false">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="sortable-column">Key</th>
|
||||
<th class="sortable-column">Parameter</th>
|
||||
<th>Value</th>
|
||||
|
||||
<tr><td>Y-axis steps per millimeter [$101]</td><td><input class="form-control" value="` + grblParams['$101'] + `" id="val-` + 101 + `-input"></td></tr>
|
||||
<tr><td>Y-axis maximum rate, mm/min [$111]</td><td><input class="form-control" value="` + grblParams['$111'] + `" id="val-` + 111 + `-input"></td></tr>
|
||||
<tr><td>Y-axis acceleration, mm/sec<sup>2</sup> [$121]</td><td><input class="form-control" value="` + grblParams['$121'] + `" id="val-` + 121 + `-input"></td></tr>
|
||||
<tr><td>Y-axis maximum travel, millimeters [$131]</td><td><input class="form-control" value="` + grblParams['$131'] + `" id="val-` + 131 + `-input"></td></tr>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tr><td>Z-axis steps per millimeter [$102]</td><td><input class="form-control" value="` + grblParams['$102'] + `" id="val-` + 102 + `-input"></td></tr>
|
||||
<tr><td>Z-axis maximum rate, mm/min [$112]</td><td><input class="form-control" value="` + grblParams['$112'] + `" id="val-` + 112 + `-input"></td></tr>
|
||||
<tr><td>Z-axis acceleration, mm/sec<sup>2</sup> [$122]</td><td><input class="form-control" value="` + grblParams['$122'] + `" id="val-` + 122 + `-input"></td></td></tr>
|
||||
<tr><td>Z-axis maximum travel, millimeters [$132]</td><td><input class="form-control" value="` + grblParams['$132'] + `" id="val-` + 132 + `-input"></td></tr>
|
||||
<tbody>
|
||||
<tr><td>$100</td><td>X-axis steps per millimeter</td><td><input type="text" value="` + grblParams['$100'] + `" id="val-` + 100 + `-input"></td></tr>
|
||||
<tr><td>$110</td><td>X-axis maximum rate, mm/min</td><td><input type="text" value="` + grblParams['$110'] + `" id="val-` + 110 + `-input"></td></tr>
|
||||
<tr><td>$120</td><td>X-axis acceleration, mm/sec<sup>2</sup></td><td><input type="text" value="` + grblParams['$120'] + `" id="val-` + 120 + `-input"></td></tr>
|
||||
<tr><td>$130</td><td>X-axis maximum travel, millimeters</td><td><input type="text" value="` + grblParams['$130'] + `" id="val-` + 130 + `-input"></td></tr>
|
||||
|
||||
<tr><td>Soft limits enable [$20] <small>(Enable and Save Homing first before enabling)<small></td><td><select id="val-` + 20 + `-input" class="form-control" value="` + grblParams['$20'] + `"><option value="0"> Disable</option><option value="1"> Enable</option></select></td></tr>
|
||||
<tr><td>Hard limits enable [$21]</td><td><select id="val-` + 21 + `-input" class="form-control" value="` + grblParams['$21'] + `"><option value="0"> Disable</option><option value="1"> Enable</option></select></td></tr>
|
||||
<tr><td>Homing cycle enable [$22]</td><td><select id="val-` + 22 + `-input" class="form-control" value="` + grblParams['$22'] + `"><option value="0"> Disable</option><option value="1"> Enable</option></select></td></tr>
|
||||
<tr><td>Homing direction invert [$23]</td><td><select id="val-` + 23 + `-input" class="form-control" value="` + grblParams['$23'] + `">
|
||||
<tr><td>$101</td><td>Y-axis steps per millimeter</td><td><input type="text" value="` + grblParams['$101'] + `" id="val-` + 101 + `-input"></td></tr>
|
||||
<tr><td>$111</td><td>Y-axis maximum rate, mm/min</td><td><input type="text" value="` + grblParams['$111'] + `" id="val-` + 111 + `-input"></td></tr>
|
||||
<tr><td>$121</td><td>Y-axis acceleration, mm/sec<sup>2</sup>]</td><td><input type="text" value="` + grblParams['$121'] + `" id="val-` + 121 + `-input"></td></tr>
|
||||
<tr><td>$131</td><td>Y-axis maximum travel, millimeters</td><td><input type="text" value="` + grblParams['$131'] + `" id="val-` + 131 + `-input"></td></tr>
|
||||
|
||||
<tr><td>$102</td><td>Z-axis steps per millimeter</td><td><input type="text" value="` + grblParams['$102'] + `" id="val-` + 102 + `-input"></td></tr>
|
||||
<tr><td>$112</td><td>Z-axis maximum rate, mm/min</td><td><input type="text" value="` + grblParams['$112'] + `" id="val-` + 112 + `-input"></td></tr>
|
||||
<tr><td>$122</td><td>Z-axis acceleration, mm/sec<sup>2</sup></td><td><input type="text" value="` + grblParams['$122'] + `" id="val-` + 122 + `-input"></td></td></tr>
|
||||
<tr><td>$132</td><td>Z-axis maximum travel, millimeters</td><td><input type="text" value="` + grblParams['$132'] + `" id="val-` + 132 + `-input"></td></tr>
|
||||
|
||||
<tr><td>$20</td><td>Soft limits enable <small>(Enable and Save Homing first before enabling)<small></td><td><select id="val-` + 20 + `-input" value="` + grblParams['$20'] + `"><option value="0"> Disable</option><option value="1"> Enable</option></select></td></tr>
|
||||
<tr><td>$21</td><td>Hard limits enable</td><td><select id="val-` + 21 + `-input" value="` + grblParams['$21'] + `"><option value="0"> Disable</option><option value="1"> Enable</option></select></td></tr>
|
||||
<tr><td>$22</td><td>Homing cycle enable</td><td><select id="val-` + 22 + `-input" value="` + grblParams['$22'] + `"><option value="0"> Disable</option><option value="1"> Enable</option></select></td></tr>
|
||||
<tr><td>$23</td><td>Homing direction invert</td><td><select id="val-` + 23 + `-input" value="` + grblParams['$23'] + `">
|
||||
<option value="0">X: Y: Z:</option>
|
||||
<option value="1">X: Y: Z:</option>
|
||||
<option value="2">X: Y: Z:</option>
|
||||
|
@ -82,23 +95,23 @@ function grblPopulate() {
|
|||
<option value="6">X: Y: Z:</option>
|
||||
<option value="7">X: Y: Z:</option>
|
||||
</select></td></tr>
|
||||
<tr><td>Homing locate feed rate, mm/min [$24]</td><td><input class="form-control" value="` + grblParams['$24'] + `" id="val-` + 24 + `-input"></td></tr>
|
||||
<tr><td>Homing search seek rate, mm/min [$25]</td><td><input class="form-control" value="` + grblParams['$25'] + `" id="val-` + 25 + `-input"></td></tr>
|
||||
<tr><td>Homing switch debounce delay, milliseconds [$26]</td><td><input class="form-control" value="` + grblParams['$26'] + `" id="val-` + 26 + `-input"></td></tr>
|
||||
<tr><td>Homing switch pull-off distance, millimeters [$27]</td><td><input class="form-control" value="` + grblParams['$27'] + `" id="val-` + 27 + `-input"></td></tr>
|
||||
<tr><td>Invert limit pins [$5]</td><td><select id="val-` + 5 + `-input" class="form-control" value="` + grblParams['$5'] + `"><option value="0"> Disable</option><option value="1"> Enable</option></select></td></tr>
|
||||
<tr><td>Invert probe pin [$6]</td><td><select id="val-` + 6 + `-input" class="form-control" value="` + grblParams['$6'] + `"><option value="0"> Disable</option><option value="1"> Enable</option></select></td></tr>
|
||||
<tr><td>$24</td><td>Homing locate feed rate, mm/min</td><td><input type="text" value="` + grblParams['$24'] + `" id="val-` + 24 + `-input"></td></tr>
|
||||
<tr><td>$25</td><td>Homing search seek rate, mm/min</td><td><input type="text" value="` + grblParams['$25'] + `" id="val-` + 25 + `-input"></td></tr>
|
||||
<tr><td>$26</td><td>Homing switch debounce delay, milliseconds</td><td><input type="text" value="` + grblParams['$26'] + `" id="val-` + 26 + `-input"></td></tr>
|
||||
<tr><td>$27</td><td>Homing switch pull-off distance, millimeters</td><td><input type="text" value="` + grblParams['$27'] + `" id="val-` + 27 + `-input"></td></tr>
|
||||
<tr><td>$5</td><td>Invert limit pins</td><td><select id="val-` + 5 + `-input" value="` + grblParams['$5'] + `"><option value="0"> Disable</option><option value="1"> Enable</option></select></td></tr>
|
||||
<tr><td>$6</td><td>Invert probe pin</td><td><select id="val-` + 6 + `-input" value="` + grblParams['$6'] + `"><option value="0"> Disable</option><option value="1"> Enable</option></select></td></tr>
|
||||
|
||||
<tr><td>Laser-mode enable [$32]</td><td><select id="val-` + 32 + `-input" class="form-control" value="` + grblParams['$32'] + `"><option value="0"> Disable</option><option value="1"> Enable</option></select></td></tr>
|
||||
<tr><td>Minimum spindle speed, RPM [$31]</td><td><input class="form-control" value="` + grblParams['$31'] + `" id="val-` + 31 + `-input"></td></tr>
|
||||
<tr><td>Maximum spindle speed, RPM [$30]</td><td><input class="form-control" value="` + grblParams['$30'] + `" id="val-` + 30 + `-input"></td></tr>
|
||||
<tr><td>$32</td><td>Laser-mode enable</td><td><select id="val-` + 32 + `-input" value="` + grblParams['$32'] + `"><option value="0"> Disable</option><option value="1"> Enable</option></select></td></tr>
|
||||
<tr><td>$31</td><td>Minimum spindle speed, RPM</td><td><input type="text" value="` + grblParams['$31'] + `" id="val-` + 31 + `-input"></td></tr>
|
||||
<tr><td>$30</td><td>Maximum spindle speed, RPM</td><td><input type="text" value="` + grblParams['$30'] + `" id="val-` + 30 + `-input"></td></tr>
|
||||
|
||||
<tr><td>Step pulse time, microseconds [$0]</td><td><input class="form-control" value="` + grblParams['$0'] + `" id="val-` + 0 + `-input"></td></tr>
|
||||
<tr><td>Step idle delay, milliseconds [$1]</td><td><input class="form-control" value="` + grblParams['$1'] + `" id="val-` + 1 + `-input"></td></tr>
|
||||
<tr>
|
||||
<td>Step pulse invert [$2]</td>
|
||||
<tr><td>$0</td><td>Step pulse time, microseconds</td><td><input type="text" value="` + grblParams['$0'] + `" id="val-` + 0 + `-input"></td></tr>
|
||||
<tr><td>$1</td><td>Step idle delay, milliseconds</td><td><input type="text" value="` + grblParams['$1'] + `" id="val-` + 1 + `-input"></td></tr>
|
||||
<tr><td>$2</td>
|
||||
<td>Step pulse invert</td>
|
||||
<td>
|
||||
<select id="val-` + 2 + `-input" class="form-control" value="` + grblParams['$2'] + `">
|
||||
<select id="val-` + 2 + `-input" value="` + grblParams['$2'] + `">
|
||||
<option value="0">X: Y: Z:</option>
|
||||
<option value="1">X: Y: Z:</option>
|
||||
<option value="2">X: Y: Z:</option>
|
||||
|
@ -110,7 +123,7 @@ function grblPopulate() {
|
|||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>Step direction invert [$3]</td><td><select id="val-` + 3 + `-input" class="form-control" value="` + grblParams['$3'] + `">
|
||||
<tr><td>$3</td><td>Step direction invert</td><td><select id="val-` + 3 + `-input" value="` + grblParams['$3'] + `">
|
||||
<option value="0">X: Y: Z:</option>
|
||||
<option value="1">X: Y: Z:</option>
|
||||
<option value="2">X: Y: Z:</option>
|
||||
|
@ -120,16 +133,17 @@ function grblPopulate() {
|
|||
<option value="6">X: Y: Z:</option>
|
||||
<option value="7">X: Y: Z:</option>
|
||||
</select></td></tr>
|
||||
<tr><td>Invert step enable pin [$4]</td><td><select id="val-` + 4 + `-input" class="form-control" value="` + grblParams['$4'] + `"><option value="0"> Disable</option><option value="1"> Enable</option></select></td></tr>
|
||||
<tr><td>$4</td><td>Invert step enable pin</td><td><select id="val-` + 4 + `-input" value="` + grblParams['$4'] + `"><option value="0"> Disable</option><option value="1"> Enable</option></select></td></tr>
|
||||
|
||||
<tr><td>Status report options [$10]</td><td><select id="val-` + 10 + `-input" class="form-control" value="` + grblParams['$10'] + `">
|
||||
<tr><td>$10</td><td>Status report options</td><td><select id="val-` + 10 + `-input" value="` + grblParams['$10'] + `">
|
||||
<option value="0">WPos: MPos: Buf:</option>
|
||||
<option value="1">WPos: MPos: Buf:</option>
|
||||
<option value="2">WPos: MPos: Buf:</option>
|
||||
</select></td></tr>
|
||||
<tr><td>Junction deviation, millimeters [$11]</td><td><input class="form-control" value="` + grblParams['$11'] + `" id="val-` + 11 + `-input"></td></tr>
|
||||
<tr><td>Arc tolerance, millimeters [$12]</td><td><input class="form-control" value="` + grblParams['$12'] + `" id="val-` + 12 + `-input"></td></tr>
|
||||
<tr><td>Report in inches [$13]</td><td><select id="val-` + 13 + `-input" class="form-control" value="` + grblParams['$13'] + `"><option value="0"> Disable</option><option value="1"> Enable</option></select></td></tr>
|
||||
<tr><td>$11</td><td>Junction deviation, millimeters</td><td><input type="text" value="` + grblParams['$11'] + `" id="val-` + 11 + `-input"></td></tr>
|
||||
<tr><td>$12</td><td>Arc tolerance, millimeters</td><td><input type="text" value="` + grblParams['$12'] + `" id="val-` + 12 + `-input"></td></tr>
|
||||
<tr><td>$13</td><td>Report in inches</td><td><select id="val-` + 13 + `-input" value="` + grblParams['$13'] + `"><option value="0"> Disable</option><option value="1"> Enable</option></select></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>`
|
||||
|
@ -147,23 +161,27 @@ function grblPopulate() {
|
|||
$("#val-3-input").val(parseInt(grblParams['$3'])).trigger("change");
|
||||
$("#val-4-input").val(parseInt(grblParams['$4'])).trigger("change");
|
||||
$("#val-10-input").val(parseInt(grblParams['$10'])).trigger("change");
|
||||
}, 500);;
|
||||
|
||||
}, 100);;
|
||||
}
|
||||
|
||||
function grblSaveSettings() {
|
||||
for (var key in grblParams) {
|
||||
if (grblParams.hasOwnProperty(key)) {
|
||||
var j = key.substring(1)
|
||||
var newVal = $("#val-" + j + "-input").val();
|
||||
var newVal = parseFloat($("#val-" + j + "-input").val());
|
||||
console.log(key + '=' + newVal);
|
||||
sendGcode(key + '=' + newVal);
|
||||
}
|
||||
}
|
||||
$('#grblModal').modal('hide');
|
||||
$('#grblPlaceholder').show();
|
||||
$('#grblconfig').empty();
|
||||
$('#grblconfig').append("Please Wait...");
|
||||
sendGcode('$$');
|
||||
}
|
||||
setTimeout(function() {
|
||||
setTimeout(function() {
|
||||
sendGcode('$$');
|
||||
}, 200);
|
||||
grblPopulate();
|
||||
}, 2200);
|
||||
|
||||
function grblModal() {
|
||||
$('#grblModal').modal('show');
|
||||
grblPopulate();
|
||||
}
|
|
@ -28,18 +28,19 @@ function confirmQuit() {
|
|||
function connectionPanel() {
|
||||
$('#connectionPanel').show()
|
||||
$('#manualControlPanel').hide()
|
||||
$('#jobPanel').hide()
|
||||
$('#grblPanel').hide()
|
||||
|
||||
}
|
||||
|
||||
function manualcontrolPanel() {
|
||||
$('#connectionPanel').hide()
|
||||
$('#manualControlPanel').show()
|
||||
$('#jobPanel').hide()
|
||||
$('#grblPanel').hide()
|
||||
}
|
||||
|
||||
function jobcontrolPanel() {
|
||||
function grblPanel() {
|
||||
grblPopulate();
|
||||
$('#connectionPanel').hide()
|
||||
$('#manualControlPanel').hide()
|
||||
$('#jobPanel').show()
|
||||
$('#grblPanel').show()
|
||||
}
|
|
@ -121,12 +121,12 @@ function initSocket() {
|
|||
|
||||
socket.on('toastError', function(data) {
|
||||
// console.log("toast", data)
|
||||
toast("<i class='fas fa-exclamation-triangle'></i> " + data, null, 5000, "bg-red fg-white");
|
||||
toast("<i class='fas fa-exclamation-triangle'></i> " + data, null, 2300, "bg-red fg-white");
|
||||
//
|
||||
});
|
||||
socket.on('toastSuccess', function(data) {
|
||||
console.log("toast", data)
|
||||
toast("<i class='fas fa-exclamation-triangle'></i> " + data, null, 5000, "bg-green fg-white");
|
||||
toast("<i class='fas fa-exclamation-triangle'></i> " + data, null, 2300, "bg-green fg-white");
|
||||
//
|
||||
});
|
||||
|
||||
|
@ -342,20 +342,23 @@ function initSocket() {
|
|||
if (laststatus) {
|
||||
if (laststatus.comms.connectionStatus == 5) {
|
||||
if (bellstate == false) {
|
||||
// $('#navbell').addClass("text-dark");
|
||||
// $('#navbell').removeClass("text-danger");
|
||||
$('#navbell').hide();
|
||||
$('#navbellBtn').hide();
|
||||
$('#navbellBtn1').hide();
|
||||
$('#navbellBtn2').hide();
|
||||
$('#navbellBtn3').hide();
|
||||
bellstate = true
|
||||
} else {
|
||||
// $('#navbell').removeClass("text-dark");
|
||||
// $('#navbell').addClass("text-danger");
|
||||
$('#navbell').show();
|
||||
$('#navbellBtn').show();
|
||||
$('#navbellBtn1').show();
|
||||
$('#navbellBtn2').show();
|
||||
$('#navbellBtn3').show();
|
||||
bellstate = false
|
||||
}
|
||||
} else {
|
||||
$('#navbell').hide();
|
||||
$('#navbellBtn1').hide();
|
||||
$('#navbellBtn2').hide();
|
||||
$('#navbellBtn3').hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
21
index.js
21
index.js
|
@ -687,9 +687,9 @@ io.on("connection", function(socket) {
|
|||
case 'grbl':
|
||||
grblBufferSize.shift();
|
||||
var errorCode = parseInt(data.split(':')[1]);
|
||||
console.log('error: ' + errorCode + ' - ' + grblStrings.errors(errorCode));
|
||||
io.sockets.emit('data', 'error: ' + errorCode + ' - ' + grblStrings.errors(errorCode));
|
||||
socket.emit("toastError", 'error: ' + errorCode + ' - ' + grblStrings.errors(errorCode))
|
||||
console.log('error: ' + errorCode + ' - ' + grblStrings.errors(errorCode) + " [ " + command + " ]");
|
||||
io.sockets.emit('data', 'error: ' + errorCode + ' - ' + grblStrings.errors(errorCode) + " [ " + command + " ]");
|
||||
socket.emit("toastError", 'error: ' + errorCode + ' - ' + grblStrings.errors(errorCode) + " [ " + command + " ]")
|
||||
break;
|
||||
case 'smoothie':
|
||||
io.sockets.emit('data', data);
|
||||
|
@ -1353,6 +1353,7 @@ function machineSend(gcode) {
|
|||
if (port.isOpen) {
|
||||
var queueLeft = (gcodeQueue.length - queuePointer)
|
||||
var queueTotal = gcodeQueue.length
|
||||
// console.log("Q: " + queueLeft)
|
||||
var data = []
|
||||
data.push(queueLeft);
|
||||
data.push(queueTotal);
|
||||
|
@ -1484,20 +1485,20 @@ function parseFeedback(data) {
|
|||
var state = data.substring(1, data.search(/(,|\|)/));
|
||||
status.comms.runStatus = state
|
||||
if (state == "Alarm") {
|
||||
console.log("ALARM: " + data)
|
||||
// console.log("ALARM: " + data)
|
||||
status.comms.connectionStatus = 5;
|
||||
isAlarmed = true;
|
||||
switch (status.machine.firmware.type) {
|
||||
case 'grbl':
|
||||
grblBufferSize.shift();
|
||||
var alarmCode = parseInt(data.split(':')[1]);
|
||||
console.log('ALARM: ' + alarmCode + ' - ' + grblStrings.alarms(alarmCode));
|
||||
// console.log('ALARM: ' + alarmCode + ' - ' + grblStrings.alarms(alarmCode));
|
||||
status.comms.alarm = alarmCode + ' - ' + grblStrings.alarms(alarmCode)
|
||||
if (alarmCode == 10) {
|
||||
io.sockets.emit("toastError", 'alarm: ' + alarmCode + ' - Locked. Please Unlock or Clear Alarm');
|
||||
} else {
|
||||
io.sockets.emit("toastError", 'alarm: ' + alarmCode + ' - ' + grblStrings.alarms(alarmCode));
|
||||
}
|
||||
// if (alarmCode == 10) {
|
||||
// io.sockets.emit("toastError", 'alarm: ' + alarmCode + ' - Locked. Please Unlock or Clear Alarm');
|
||||
// } else {
|
||||
// io.sockets.emit("toastError", 'alarm: ' + alarmCode + ' - ' + grblStrings.alarms(alarmCode));
|
||||
// }
|
||||
break;
|
||||
case 'smoothie':
|
||||
status.comms.alarm = data;
|
||||
|
|
Ładowanie…
Reference in New Issue