Skip to content

Commit

Permalink
1.0.37 - added progressbar
Browse files Browse the repository at this point in the history
  • Loading branch information
petervanderwalt committed Aug 1, 2018
1 parent a9c2f81 commit 292b341
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
9 changes: 7 additions & 2 deletions app/index.html
Expand Up @@ -498,7 +498,7 @@

<div id="_target_1">
<div id="editor"></div>
<div class="fixed-bottom m-3 mb-8">
<div class="fixed-bottom m-3 mb-9">
<button data-toggle="tooltip" data-placement="bottom" title="Find and Replace" class="button dark" onclick="editor.execCommand('replace')"><i class="fas fa-search"></i></button>
<button data-toggle="tooltip" data-placement="bottom" title="Select All" class="button dark" onclick="editor.execCommand('selectall')"><i class="far fa-check-square"></i></button>
<button data-toggle="tooltip" data-placement="bottom" title="Undo" class="button dark" onclick="editor.execCommand('undo')"><i class="fas fa-undo"></i></button>
Expand All @@ -511,7 +511,7 @@
</div>
<div id="_target_2">
<div id="console"></div>
<div class="fixed-bottom m-3 mb-8">
<div class="fixed-bottom m-3 mb-9">
<form class="inline-form">
<input data-prepend="&nbsp;<i class='fas fa-terminal'></i>" data-role="input" data-clear-button="false" data-role="input" id="command" type="text" autocomplete="on" class="needs-connection" style="width: calc(100vw - 170px);" />
<button id="sendCommand" class="button dark needs-connection" type="button" data-role="hint" data-hint-position="top" data-hint-text="Execute Command" data-cls-hint="bg-light fg-dark drop-shadow">
Expand Down Expand Up @@ -564,6 +564,11 @@
</div>
</div>
</div>
<div class="row">
<div class="cell-12">
<div data-role="progress" id="progressbar" data-value="0"></div>
</div>
</div>
</div>
</div>
</div>
Expand Down
20 changes: 10 additions & 10 deletions app/js/ui.js
Expand Up @@ -130,8 +130,8 @@ function setJogPanel(val, status) {
if (val == 0) { // Not Connected Yet
// Show panel and resize editor
$("#jogcontrols").slideUp("fast");
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 210 + 'px)');
$("#console").css('height', 'calc(' + 100 + 'vh - ' + 210 + 'px)');
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 270 + 'px)');
$("#console").css('height', 'calc(' + 100 + 'vh - ' + 270 + 'px)');
$('#console').scrollTop($("#console")[0].scrollHeight - $("#console").height());
editor.resize()
$('.jogbtn').attr('disabled', true);
Expand All @@ -141,8 +141,8 @@ function setJogPanel(val, status) {
} else if (val == 0 || val == 2) { // Connected, but not Playing yet
// Show panel and resize editor
$("#jogcontrols").slideDown("fast");
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 450 + 'px)');
$("#console").css('height', 'calc(' + 100 + 'vh - ' + 490 + 'px)');
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 460 + 'px)');
$("#console").css('height', 'calc(' + 100 + 'vh - ' + 500 + 'px)');
$('#console').scrollTop($("#console")[0].scrollHeight - $("#console").height());
editor.resize()
$('.jogbtn').attr('disabled', false);
Expand All @@ -151,8 +151,8 @@ function setJogPanel(val, status) {
}
} else if (val == 3) { // Busy Streaming GCODE
// Show panel and resize editor
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 450 + 'px)');
$("#console").css('height', 'calc(' + 100 + 'vh - ' + 490 + 'px)');
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 460 + 'px)');
$("#console").css('height', 'calc(' + 100 + 'vh - ' + 500 + 'px)');
$('#console').scrollTop($("#console")[0].scrollHeight - $("#console").height());
editor.resize()
$("#jogcontrols").slideDown("fast");
Expand All @@ -163,8 +163,8 @@ function setJogPanel(val, status) {
} else if (val == 4) { // Paused
// Show panel and resize editor
$("#jogcontrols").slideDown("fast");
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 450 + 'px)');
$("#console").css('height', 'calc(' + 100 + 'vh - ' + 490 + 'px)');
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 460 + 'px)');
$("#console").css('height', 'calc(' + 100 + 'vh - ' + 500 + 'px)');
$('#console').scrollTop($("#console")[0].scrollHeight - $("#console").height());
editor.resize()
$('.jogbtn').attr('disabled', true);
Expand All @@ -174,8 +174,8 @@ function setJogPanel(val, status) {
} else if (val == 5) { // Alarm State
// Show panel and resize editor
$("#jogcontrols").slideUp("fast");
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 210 + 'px)');
$("#console").css('height', 'calc(' + 100 + 'vh - ' + 210 + 'px)');
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 270 + 'px)');
$("#console").css('height', 'calc(' + 100 + 'vh - ' + 270 + 'px)');
$('#console').scrollTop($("#console")[0].scrollHeight - $("#console").height());
editor.resize()
$('.jogbtn').attr('disabled', true);
Expand Down
8 changes: 8 additions & 0 deletions app/js/websocket.js
Expand Up @@ -154,6 +154,14 @@ function initSocket() {
}
}
$('#gcodesent').html("Queue: " + parseInt(data[0]));

// calc percentage
var left = parseInt(data[0])
var total = parseInt(data[1])
var done = total - left;
var donepercent = parseInt(done / total * 100)
var progressbar = $("#progressbar").data("progress");
progressbar.val(donepercent);
// }
sduploading = data[2];
if (sduploading) {
Expand Down
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -2287,7 +2287,7 @@ if (electronApp) {
// Create the browser window.
jogWindow = new BrowserWindow({
width: 660,
height: 710,
height: 730,
fullscreen: false,
center: true,
resizable: true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "OpenBuildsMachineDriver",
"version": "1.0.36",
"version": "1.0.37",
"license": "AGPL-3.0",
"description": "Machine Interface Driver for OpenBuilds",
"author": "github.com/openbuilds <webmaster@openbuilds.com>",
Expand Down

0 comments on commit 292b341

Please sign in to comment.