+
Line #:
-
@@ -147,7 +146,7 @@
Line:
-
Position
+ Position:
@@ -205,7 +204,7 @@
State:
-
+
@@ -224,14 +223,13 @@
State:
-
-
Controller Messages
-
+
+
Controller Messages
-
+
diff --git a/templates/zaxis_mobile.html b/templates/zaxis_mobile.html
index 53f7889b..1c7a9f09 100644
--- a/templates/zaxis_mobile.html
+++ b/templates/zaxis_mobile.html
@@ -13,7 +13,7 @@
-
+
@@ -21,14 +21,14 @@
-
+
-
+
-
+
@@ -37,4 +37,6 @@
{% block javascript %}
+
+
{% endblock %}
From 7500e77ba8b84ee371ad32c89dd14607a2ef3768 Mon Sep 17 00:00:00 2001
From: gb0101010101 <7369439+gb0101010101@users.noreply.github.com>
Date: Thu, 16 Jan 2020 14:30:26 -0800
Subject: [PATCH 3/4] Hide 'Web Control' text from navbar so that all elements
fit on one line.
---
static/scripts/base.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/static/scripts/base.js b/static/scripts/base.js
index c57eb008..f11cba63 100644
--- a/static/scripts/base.js
+++ b/static/scripts/base.js
@@ -230,6 +230,7 @@ function setupStatusButtons(){
$('#mobileClientStatus').show();
$('#mobileCPUUsage').show();
$('#mobileControllerStatusAlert').show();
+ $('.navbar-brand').hide();
} else {
$('#mobileClientStatus').hide();
$('#mobileCPUUsage').hide();
From 74569693da2e62c8154860f75018f60e4f8a0d38 Mon Sep 17 00:00:00 2001
From: gb0101010101 <7369439+gb0101010101@users.noreply.github.com>
Date: Thu, 16 Jan 2020 19:54:09 -0800
Subject: [PATCH 4/4] Proof of concept to detect and skip through gcode comment
sections.
---
Actions/actions.py | 27 +++++++++++++++++++++++++++
DataStructures/data.py | 2 ++
File/gcodeFile.py | 5 +++++
static/styles/frontpage.css | 5 +++++
templates/frontpage3d.html | 8 +++++++-
5 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/Actions/actions.py b/Actions/actions.py
index 68ed9f05..f5a885bd 100644
--- a/Actions/actions.py
+++ b/Actions/actions.py
@@ -133,6 +133,9 @@ def processAction(self, msg):
elif msg["data"]["command"] == "moveGcodeZ":
if not self.moveGcodeZ(int(msg["data"]["arg"])):
self.data.ui_queue1.put("Alert", "Alert", "Error with moving to Z move")
+ elif msg["data"]["command"] == "moveGcodeSection":
+ if not self.moveGcodeSection(int(msg["data"]["arg"])):
+ self.data.ui_queue1.put("Alert", "Alert", "Error with moving to comment section")
elif msg["data"]["command"] == "moveGcodeGoto":
if not self.moveGcodeIndex(int(msg["data"]["arg"]), True):
self.data.ui_queue1.put("Alert", "Alert", "Error with moving to Z move")
@@ -644,6 +647,30 @@ def moveGcodeZ(self, moves):
self.data.console_queue.put(str(e))
return False
+ def moveGcodeSection(self, moves):
+ '''
+ Moves the gcode index to the next comment section.
+ :param moves:
+ :return:
+ '''
+ try:
+ dist = 0
+ #determine the number of lines to move to reach the next comment section.
+ for index, sectionComments in enumerate(self.data.sectionIndex):
+ if moves > 0 and sectionComments > self.data.gcodeIndex:
+ dist = self.data.sectionIndex[index + moves - 1] - self.data.gcodeIndex
+ break
+ if moves < 0 and sectionComments < self.data.gcodeIndex:
+ dist = self.data.sectionIndex[index + moves + 1] - self.data.gcodeIndex
+ if self.moveGcodeIndex(dist):
+ # this command will continue on in the moveGcodeIndex "if"
+ return True
+ else:
+ return False
+ except Exception as e:
+ self.data.console_queue.put(str(e))
+ return False
+
def moveGcodeIndex(self, dist, index=False):
'''
Moves the gcodeIndex by either the distance or, in index is True, uses the dist as the index.
diff --git a/DataStructures/data.py b/DataStructures/data.py
index e9ede004..e08de69a 100644
--- a/DataStructures/data.py
+++ b/DataStructures/data.py
@@ -57,6 +57,8 @@ class Data:
gcodeIndex = 0
# Index of changes in z
zMoves = []
+ # Index of section comments
+ sectionIndex = []
# Holds the current value of the feed rate
feedRate = 20
# holds the address of the g-code file so that the gcode can be refreshed
diff --git a/File/gcodeFile.py b/File/gcodeFile.py
index 137b0447..833424c2 100644
--- a/File/gcodeFile.py
+++ b/File/gcodeFile.py
@@ -146,8 +146,13 @@ def loadUpdateFile(self, gcode=""):
# Find gcode indicies of z moves
self.data.zMoves = [0]
+ self.data.sectionIndex = [0]
zList = []
for index, line in enumerate(self.data.gcode):
+ # Matches text "(" + any alphanumeric characters + ")" but ignores "(MSG, gcode message text)"
+ s = re.search("^\((?!MSG,).+\)", line)
+ if s:
+ self.data.sectionIndex.append(index)
filtersparsed = re.sub(r'\(([^)]*)\)', '', line) # replace mach3 style gcode comments with newline
line = re.sub(r';([^.]*)?', '',filtersparsed) # replace standard ; initiated gcode comments with newline
if not line.isspace(): # if all spaces, don't send. likely a comment. #if line.find("(") == -1:
diff --git a/static/styles/frontpage.css b/static/styles/frontpage.css
index e56f5b6d..8f03420b 100644
--- a/static/styles/frontpage.css
+++ b/static/styles/frontpage.css
@@ -144,3 +144,8 @@ html, body{
}
#controllerMessage { overflow-wrap: anywhere; }
+
+.moveButtons .btn {
+ padding-left: .125rem;
+ padding-left: .125rem;
+}
diff --git a/templates/frontpage3d.html b/templates/frontpage3d.html
index 1636e279..116e624c 100644
--- a/templates/frontpage3d.html
+++ b/templates/frontpage3d.html
@@ -89,7 +89,10 @@
Controls