Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
dfa64ec
Rewrite actions to remove huge if->elif block at top of class to grou…
gb0101010101 Mar 11, 2020
0c0f416
Remove unused functions move() and moveZ() which have been replaced w…
gb0101010101 Mar 14, 2020
f40828e
Backup Webcontrol: Change datestamp format to make more legible, remo…
gb0101010101 Mar 16, 2020
9e91be1
Restore WebControl Backup: Pass '.zip' mimetype to importFile.html te…
gb0101010101 Mar 16, 2020
62de3ca
Import GroundControl.ini: Restrict file selection to *.ini files.
gb0101010101 Mar 16, 2020
82e8d57
logger.py -> deleteLogFiles() iterateates from 0 -> 1000 for no reaso…
gb0101010101 Mar 16, 2020
fbcf5ef
Import WebControl.json: Use title case for 'WebControl'. Restrict fil…
gb0101010101 Mar 16, 2020
ac32e86
ClearLogs: Remove unneccesary - for x in range (0, 1000).
gb0101010101 Mar 17, 2020
5c76a88
Improve Alert messages when methods fail.
gb0101010101 Mar 17, 2020
3d8930d
Fix macro execution.
gb0101010101 Mar 17, 2020
17c1aa5
Improve Alert message when creating directory fails.
gb0101010101 Mar 17, 2020
6b301dd
Remove duplicate variable declarartion, fix TODO comment so it works …
gb0101010101 Mar 17, 2020
5a539c7
Todo message.
gb0101010101 Mar 17, 2020
bfc8c09
Make all todo items use default uppercase TODO so they show up in IDE…
gb0101010101 Mar 17, 2020
eb8c665
Add pauseRun() back as it was accidentally deleted.
gb0101010101 Mar 17, 2020
02d595f
Code format.
gb0101010101 Mar 17, 2020
5817493
Fix check of safe commands during gcode upload.
gb0101010101 Mar 18, 2020
0b7f5d4
Fix merge conflict with upstream/master adding method 'optimizeGcode()'.
gb0101010101 Mar 18, 2020
5650767
Merge remote-tracking branch 'upstream/master' into gb0101010101-acti…
gb0101010101 Mar 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,640 changes: 942 additions & 698 deletions Actions/actions.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Background/UIProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,8 @@ def processMessage(self, _message):
elif msg["message"] == "distToMoveUpdateZ":
self.distToMoveUpdateZ()
elif msg["message"] == "updateTimer":
# Todo: clean this up .. edit: sendCalibrationMessage got deleted somewhere.
#self.sendCalibrationMessage("updateTimer", json.loads(msg["data"]))
# TODO: clean this up .. edit: sendCalibrationMessage got deleted somewhere.
# self.sendCalibrationMessage("updateTimer", json.loads(msg["data"]))
pass
elif msg["message"] == "updateCamera":
self.sendCameraMessage("updateCamera", json.loads(msg["data"]))
Expand Down
25 changes: 11 additions & 14 deletions DataStructures/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,23 +155,20 @@ def deleteLogFiles(self):
"""
Delete log files
"""

success1 = False
for x in range(0, 1000):
try:
os.remove(self.home+"/.WebControl/"+"log.txt")
success1 = True
break
except:
success1 = False
try:
os.remove(self.home+"/.WebControl/"+"log.txt")
success1 = True
except:
success1 = False

success2 = False
for x in range(0, 1000):
try:
os.remove(self.home+"/.WebControl/"+"alog.txt")
success2 = True
break
except:
success2 = False
try:
os.remove(self.home+"/.WebControl/"+"alog.txt")
success2 = True
except:
success2 = False

if success1 and success2:
return True
Expand Down
9 changes: 5 additions & 4 deletions WebPageProcessor/webPageProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import socket
from github import Github
import markdown
import mimetypes


class WebPageProcessor:
Expand Down Expand Up @@ -226,15 +227,15 @@ def createWebPage(self, pageID, isMobile, args):
return page, "Upload GCode", False, "medium", "content", "footerSubmit"
elif pageID == "importGCini":
url = "importFile"
page = render_template("importFile.html", url=url)
page = render_template("importFile.html", url=url, mimetypes=".ini")
return page, "Import groundcontrol.ini", False, "medium", "content", False
elif pageID == "importWCJSON":
url = "importFileWCJSON"
page = render_template("importFile.html", url=url)
return page, "Import webcontrol.json", False, "medium", "content", False
page = render_template("importFile.html", url=url, mimetypes=".json")
return page, "Import WebControl.json", False, "medium", "content", False
elif pageID == "restoreWebControl":
url = "importRestoreWebControl"
page = render_template("importFile.html", url=url)
page = render_template("importFile.html", url=url, mimetypes=".zip")
return page, "Restore WebControl", False, "medium", "content", False
elif pageID == "actions":
if self.data.controllerFirmwareVersion < 100:
Expand Down
4 changes: 1 addition & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,14 +533,12 @@ def backupWebControl():
if request.method == "GET":
returnVal = app.data.actions.backupWebControl()
if returnVal != False:
print(returnVal)
return send_file(returnVal)
return send_file(returnVal, as_attachment=True)
else:
resp = jsonify("failed")
resp.status_code = 500
return resp


@app.route("/editBoard", methods=["POST"])
def editBoard():
app.data.logger.resetIdler()
Expand Down
29 changes: 11 additions & 18 deletions static/scripts/baseSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,26 +252,19 @@ function setListeners(){

}

function action(command, arg, arg1){
if (arg==null)
arg = "";
if (arg1==null)
arg1 = "";
console.log("action="+command);
socket.emit('action',{data:{command:command,arg:arg, arg1:arg1}});
function action() {
var msg = {"command": arguments[0]};
if (arguments.length > 1 ) {
var args = new Array()
for (var i=1; i < arguments.length; i++) {
args[i-1] = arguments[i];
}
msg["args"] = args;
}
console.log("action=" + arguments[0]);
socket.emit('action', msg);
}

function move(direction){
distToMove = $("#distToMove").val();
console.log(distToMove)
socket.emit('move',{data:{direction:direction,distToMove:distToMove}});
}

function moveZ(direction){
distToMoveZ = $("#distToMoveZ").val();
console.log(distToMoveZ)
socket.emit('moveZ',{data:{direction:direction,distToMoveZ:distToMoveZ}});
}

function settingRequest(section,setting){
console.log("requesting..")
Expand Down
2 changes: 1 addition & 1 deletion templates/actions.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h4 class="card-title">Diagnostics/Maintenance</h4>
<div class="card-body">
<h4 class="card-title">Calibration/Setup</h4>
<button type="button" class="btn btn-lg btn-block btn-secondary" onclick="requestPage('importGCini');$('#contentModal').modal('hide');">Import groundcontrol.ini File</button>
<button type="button" class="btn btn-lg btn-block btn-secondary" onclick="requestPage('importWCJSON');$('#contentModal').modal('hide');">Import webcontrol.json File</button>
<button type="button" class="btn btn-lg btn-block btn-secondary" onclick="requestPage('importWCJSON');$('#contentModal').modal('hide');">Import WebControl.json File</button>
<button type="button" class="btn btn-lg btn-block btn-secondary" onclick="requestPage('quickConfigure');$('#contentModal').modal('hide');">Quick Configure</button>
<button type="button" class="btn btn-lg btn-block btn-secondary" onclick="requestPage('setSprockets');$('#contentModal').modal('hide');">Set Sprockets & Chains</button>
<button type="button" class="btn btn-lg btn-block btn-secondary" onclick="requestPage('resetChains');$('#contentModal').modal('hide');">Reset Chains</button>
Expand Down
2 changes: 1 addition & 1 deletion templates/importFile.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<form id="importForm" method="post" enctype=multipart/form-data>
<div class="form-group">
<label for="importFile">Import File</label>
<input type="file" class="form-control-file" name="file" id="importFile">
<input type="file" class="form-control-file" name="file" id="importFile" {{ 'accept=' ~ mimetypes + '' if mimetypes is defined }}>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
Expand Down