-
- Key |
-
- Function |
-
-
-
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
- |
-
-
-
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
- |
-
-
-
-
-
-
- Page
- Up
- |
-
-
-
- Page
- Down
-
- |
-
-
- |
-
-
-
-
-
- |
-
-
-
- Esc
- |
-
-
-
- |
-
-
-
diff --git a/app/jog/app.js b/app/jog/app.js
new file mode 100644
index 0000000..1a2fd19
--- /dev/null
+++ b/app/jog/app.js
@@ -0,0 +1,13 @@
+if ('serviceWorker' in navigator) {
+ navigator.serviceWorker
+ .register('/service-worker.js')
+ .then(function(registration) {
+ console.log(
+ 'Service Worker registration successful with scope: ',
+ registration.scope
+ );
+ })
+ .catch(function(err) {
+ console.log('Service Worker registration failed: ', err);
+ });
+}
diff --git a/app/jog/assets/PWA-Logo.sketch b/app/jog/assets/PWA-Logo.sketch
new file mode 100644
index 0000000..c6797c1
Binary files /dev/null and b/app/jog/assets/PWA-Logo.sketch differ
diff --git a/app/jog/assets/PWA-Splash-Screens.sketch b/app/jog/assets/PWA-Splash-Screens.sketch
new file mode 100644
index 0000000..335ae27
Binary files /dev/null and b/app/jog/assets/PWA-Splash-Screens.sketch differ
diff --git a/app/jog/assets/logo.png b/app/jog/assets/logo.png
new file mode 100644
index 0000000..2c4ce54
Binary files /dev/null and b/app/jog/assets/logo.png differ
diff --git a/app/jog/assets/pwa-lighthouse.png b/app/jog/assets/pwa-lighthouse.png
new file mode 100644
index 0000000..1c0791e
Binary files /dev/null and b/app/jog/assets/pwa-lighthouse.png differ
diff --git a/app/jog/images/splash/launch-1125x2436.png b/app/jog/images/splash/launch-1125x2436.png
new file mode 100644
index 0000000..d05d428
Binary files /dev/null and b/app/jog/images/splash/launch-1125x2436.png differ
diff --git a/app/jog/images/splash/launch-1242x2148.png b/app/jog/images/splash/launch-1242x2148.png
new file mode 100644
index 0000000..27946df
Binary files /dev/null and b/app/jog/images/splash/launch-1242x2148.png differ
diff --git a/app/jog/images/splash/launch-1536x2048.png b/app/jog/images/splash/launch-1536x2048.png
new file mode 100644
index 0000000..eda1f3b
Binary files /dev/null and b/app/jog/images/splash/launch-1536x2048.png differ
diff --git a/app/jog/images/splash/launch-1668x2224.png b/app/jog/images/splash/launch-1668x2224.png
new file mode 100644
index 0000000..8aa99d3
Binary files /dev/null and b/app/jog/images/splash/launch-1668x2224.png differ
diff --git a/app/jog/images/splash/launch-2048x2732.png b/app/jog/images/splash/launch-2048x2732.png
new file mode 100644
index 0000000..92ac5c0
Binary files /dev/null and b/app/jog/images/splash/launch-2048x2732.png differ
diff --git a/app/jog/images/splash/launch-640x1136.png b/app/jog/images/splash/launch-640x1136.png
new file mode 100644
index 0000000..a700732
Binary files /dev/null and b/app/jog/images/splash/launch-640x1136.png differ
diff --git a/app/jog/images/splash/launch-750x1294.png b/app/jog/images/splash/launch-750x1294.png
new file mode 100644
index 0000000..0df5205
Binary files /dev/null and b/app/jog/images/splash/launch-750x1294.png differ
diff --git a/app/jog/index.html b/app/jog/index.html
index cc743cf..2e0381c 100644
--- a/app/jog/index.html
+++ b/app/jog/index.html
@@ -5,8 +5,32 @@
OpenBuilds Machine Driver
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -100,8 +124,9 @@
Stop
-
+
+
@@ -307,7 +332,7 @@
-
+
|
@@ -320,7 +345,6 @@
diff --git a/app/jog/manifest.json b/app/jog/manifest.json
new file mode 100644
index 0000000..6f8ed9f
--- /dev/null
+++ b/app/jog/manifest.json
@@ -0,0 +1,23 @@
+{
+ "name": "PWA Splash",
+ "short_name": "PWA Splash",
+ "description": "PWA SPlash Screens",
+ "scope": ".",
+ "start_url": "/",
+ "display": "standalone",
+ "orientation": "portrait",
+ "theme_color": "#ffffff",
+ "background_color": "#ffffff",
+ "icons": [
+ {
+ "src": "images/icons/android-chrome-192x192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "images/icons/android-chrome-512x512.png",
+ "sizes": "512x512",
+ "type": "image/png"
+ }
+ ]
+}
diff --git a/app/jog/service-worker.js b/app/jog/service-worker.js
new file mode 100644
index 0000000..4d85ec0
--- /dev/null
+++ b/app/jog/service-worker.js
@@ -0,0 +1,29 @@
+self.addEventListener('install', function(event) {
+ console.log('[Service Worker] Installing Service Worker ...', event);
+ event.waitUntil(
+ caches.open('static').then(function(cache) {
+ cache.addAll(['/', '/index.html', '/app.js', '/manifest.json']);
+ })
+ );
+});
+
+self.addEventListener('activate', function(event) {
+ console.log('[Service Worker] Activating Service Worker ....', event);
+});
+
+self.addEventListener('fetch', function(event) {
+ event.respondWith(
+ caches.match(event.request).then(function(response) {
+ if (response) {
+ return response;
+ } else {
+ return fetch(event.request).then(function(res) {
+ return caches.open('dynamic').then(function(cache) {
+ cache.put(event.request.url, res.clone());
+ return res;
+ });
+ });
+ }
+ })
+ );
+});
diff --git a/app/js/mobilejog.js b/app/js/mobilejog.js
index da8ee02..6edc497 100644
--- a/app/js/mobilejog.js
+++ b/app/js/mobilejog.js
@@ -7,24 +7,26 @@ SVG.on(document, 'DOMContentLoaded', function() {
$(document).ready(function() {
$("#svgview").swipe(function(direction, offset, eventstate) {
- event.preventDefault();
- draw.clear()
- console.log("Moving", direction.x, "and", direction.y);
- console.log("Touch moved by", offset.x, "horizontally and", offset.y, "vertically");
- console.log("Event state ", eventstate)
- var height = draw.node.clientHeight;
- var width = draw.node.clientWidth;
- line = draw.line(width / 2, height / 2, (width / 2) + offset.x, (height / 2) + offset.y * -1).stroke({
- width: 5
- })
- if (eventstate == 'up') {
- var feedrate = $('#jograte').val();
- jogXY((offset.x / 10).toFixed(2), (offset.y / 10).toFixed(2), feedrate)
- Metro.toast.create("Delta move: X: " + (offset.x / 10).toFixed(2) + " / Y: " + (offset.y / 10).toFixed(2), null, 1000);
- setTimeout(function() {
- draw.clear()
- }, 1000)
+ if (laststatus.comms.connectionStatus == 1 || laststatus.comms.connectionStatus == 2) {
+ event.preventDefault();
+ draw.clear()
+ console.log("Moving", direction.x, "and", direction.y);
+ console.log("Touch moved by", offset.x, "horizontally and", offset.y, "vertically");
+ console.log("Event state ", eventstate)
+ var height = draw.node.clientHeight;
+ var width = draw.node.clientWidth;
+ line = draw.line(width / 2, height / 2, (width / 2) + offset.x, (height / 2) + offset.y * -1).stroke({
+ width: 5
+ })
+ if (eventstate == 'up') {
+ var feedrate = $('#jograte').val();
+ jogXY((offset.x / 10).toFixed(2), (offset.y / 10).toFixed(2), feedrate)
+ Metro.toast.create("Delta move: X: " + (offset.x / 10).toFixed(2) + " / Y: " + (offset.y / 10).toFixed(2), null, 1000);
+ setTimeout(function() {
+ draw.clear()
+ }, 1000)
+ }
}
});
});
\ No newline at end of file
diff --git a/app/js/ui.js b/app/js/ui.js
index 491de0d..832ed68 100644
--- a/app/js/ui.js
+++ b/app/js/ui.js
@@ -96,7 +96,7 @@ function setControlBar(val, status) {
$('#toolBtn').hide().attr('disabled', true);
$('#homeBtn').hide().attr('disabled', true);
$('.estop').hide()
- } else if (val == 0 || val == 2) { // Connected, but not Playing yet
+ } else if (val == 1 || val == 2) { // Connected, but not Playing yet
if (typeof ace !== 'undefined') {
$('#runBtn').show().attr('disabled', editor.session.getLength() < 2);
} else {
@@ -138,6 +138,7 @@ function setControlBar(val, status) {
function setJogPanel(val, status) {
if (val == 0) { // Not Connected Yet
// Show panel and resize editor
+ $("#svgview").css('background-color', '#f5f6f7');
$("#jogcontrols").slideUp(20);
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 290 + 'px)');
$("#console").css('height', 'calc(' + 100 + 'vh - ' + 290 + 'px)');
@@ -149,8 +150,13 @@ function setJogPanel(val, status) {
if ($('#jograte').attr('disabled')) {
$('#jograte').attr('disabled', false);
}
- } else if (val == 0 || val == 2) { // Connected, but not Playing yet
+ $('#xPos').html('0.00');
+ $('#yPos').html('0.00');
+ $('#zPos').html('0.00');
+
+ } else if (val == 1 || val == 2) { // Connected, but not Playing yet
// Show panel and resize editor
+ $("#svgview").css('background-color', '#ffffff');
$("#jogcontrols").slideDown(20);
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 480 + 'px)');
$("#console").css('height', 'calc(' + 100 + 'vh - ' + 480 + 'px)');
@@ -164,6 +170,7 @@ function setJogPanel(val, status) {
}
} else if (val == 3) { // Busy Streaming GCODE
// Show panel and resize editor
+ $("#svgview").css('background-color', '#f5f6f7');
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 480 + 'px)');
$("#console").css('height', 'calc(' + 100 + 'vh - ' + 480 + 'px)');
// $('#console').scrollTop($("#console")[0].scrollHeight - $("#console").height());
@@ -177,6 +184,7 @@ function setJogPanel(val, status) {
}
} else if (val == 4) { // Paused
// Show panel and resize editor
+ $("#svgview").css('background-color', '#f5f6f7');
$("#jogcontrols").slideDown(20);
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 480 + 'px)');
$("#console").css('height', 'calc(' + 100 + 'vh - ' + 480 + 'px)');
@@ -190,6 +198,7 @@ function setJogPanel(val, status) {
}
} else if (val == 5) { // Alarm State
// Show panel and resize editor
+ $("#svgview").css('background-color', '#f5f6f7');
$("#jogcontrols").slideUp(20);
$("#editor").css('height', 'calc(' + 100 + 'vh - ' + 290 + 'px)');
$("#console").css('height', 'calc(' + 100 + 'vh - ' + 290 + 'px)');
diff --git a/app/js/websocket.js b/app/js/websocket.js
index 9a38623..0c24560 100644
--- a/app/js/websocket.js
+++ b/app/js/websocket.js
@@ -216,18 +216,6 @@ function initSocket() {
}
}
- // Set the Connection Toolbar option
- setConnectBar(status.comms.connectionStatus, status);
- setControlBar(status.comms.connectionStatus, status)
- setJogPanel(status.comms.connectionStatus, status)
- setConsole(status.comms.connectionStatus, status)
- if (status.comms.connectionStatus != 5) {
- bellstate = false
- };
- if (status.comms.connectionStatus == 0) {
- showGrbl(false)
- }
-
$('#runStatus').html("Controller: " + status.comms.runStatus);
@@ -390,6 +378,18 @@ function initSocket() {
//
// }
+ // Set the Connection Toolbar option
+ setConnectBar(status.comms.connectionStatus, status);
+ setControlBar(status.comms.connectionStatus, status)
+ setJogPanel(status.comms.connectionStatus, status)
+ setConsole(status.comms.connectionStatus, status)
+ if (status.comms.connectionStatus != 5) {
+ bellstate = false
+ };
+ if (status.comms.connectionStatus == 0) {
+ showGrbl(false)
+ }
+
laststatus = status;
});
diff --git a/app/lib/jquery/jquery-swipe.js b/app/lib/jquery/jquery-swipe.js
index 214d0a0..f7c2a55 100644
--- a/app/lib/jquery/jquery-swipe.js
+++ b/app/lib/jquery/jquery-swipe.js
@@ -20,11 +20,17 @@ $(function() {
};
function swipeInfo(event) {
+ console.log(event.originalEvent)
+ if (event.originalEvent.touches) {
+ var x = event.originalEvent.touches[0].pageX,
+ y = event.originalEvent.touches[0].pageY,
+ dx, dy;
+ } else {
+ var x = event.originalEvent.pageX,
+ y = event.originalEvent.pageY,
+ dx, dy;
+ }
- // console.log(event.originalEvent.touches[0])
- var x = event.originalEvent.touches[0].pageX,
- y = event.originalEvent.touches[0].pageY,
- dx, dy;
dx = (x > originalPosition.x) ? "right" : "left";
dy = (y > originalPosition.y) ? "down" : "up";
@@ -44,10 +50,18 @@ $(function() {
$el.on("touchstart mousedown", function(event) {
touchDown = true;
info.eventstate = 'down';
- originalPosition = {
- x: event.originalEvent.touches[0].pageX,
- y: event.originalEvent.touches[0].pageY
- };
+ if (event.originalEvent.touches) {
+ originalPosition = {
+ x: event.originalEvent.touches[0].pageX,
+ y: event.originalEvent.touches[0].pageY
+ };
+ } else {
+ originalPosition = {
+ x: event.originalEvent.x,
+ y: event.originalEvent.y
+ };
+ }
+
callback(info.direction, info.offset, info.eventstate, originalPosition);
});
diff --git a/package.json b/package.json
index a98c982..664af69 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "OpenBuildsMachineDriver",
- "version": "1.0.76",
+ "version": "1.0.78",
"license": "AGPL-3.0",
"description": "Machine Interface Driver for OpenBuilds",
"author": "github.com/openbuilds ",