Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental branch merging #108 #112 #115 #117

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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,689 changes: 986 additions & 703 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 @@ -532,14 +532,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
21 changes: 10 additions & 11 deletions static/scripts/frontpage3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var homeY = 0;

var renderer = new THREE.WebGLRenderer();
var w = $("#workarea").width();//-20;
var h = $("#workarea").height();//-20;
var h = $("#workarea").height()- 10;//-20;
renderer.setSize( w, h );
//console.log("w="+w+", h="+h);

Expand Down Expand Up @@ -245,26 +245,25 @@ animate();
window.addEventListener( 'resize', onWindowResize, false );

function onWindowResize(){

//w=window.innerWidth;
//h=window.innerHeight;
//console.log("wr="+w+", hr="+h);
we = $("#workarea").width(); //-20;
he = $("#workarea").height(); //-20;
// Make canvas tiny so the container can shrink.
renderer.setSize( 10, 10 );
// Get new size of fluid container.
we = $("#workarea").width();
// Can't find the source of this 10px offset.
// Needed to stop unneccesary scrool bar on main window.
he = $("#workarea").height() - 10;
//console.log("we="+we+", he="+he);

//cameraO.aspect = window.innerWidth / window.innerHeight;
cameraO.left = we/-2*scale;
cameraO.right = we/2*scale;
cameraO.top = he/2*scale;
cameraO.bottom = he/-2*scale;
cameraO.updateProjectionMatrix();
//cameraP.aspect = window.innerWidth / window.innerHeight;

cameraP.aspect = we / he;
cameraP.updateProjectionMatrix();

// Finally resize the canvas.
renderer.setSize( we, he );

}


Expand Down
125 changes: 62 additions & 63 deletions static/styles/base.css
Original file line number Diff line number Diff line change
@@ -1,101 +1,100 @@
.modalxlg > .modal-dialog {
max-width: 90% !important;
width: 90% !important;
}
.modalxlg>.modal-dialog {
max-width: 90% !important;
width: 90% !important;
}

.disabler {
}

.alert {
margin-bottom: 1px;
height: 30px;
line-height:30px;
padding:0px 15px;
line-height: 30px;
padding: 0px 15px;
}


#contentModalText {
max-height: 70vh;
overflow-y: auto;
max-height: 70vh;
overflow-y: auto;
}

#fpCircle {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 150px;
height: 150px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 150px;
height: 150px;
}

#gcCircle {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 150px;
height: 150px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 150px;
height: 150px;
}

#notificationCircle {
position: absolute;
top: 70%;
left: 50%;
transform: translate(-50%,-30%);
width: 80px;
height: 80px;
position: absolute;
top: 70%;
left: 50%;
transform: translate(-50%, -30%);
width: 80px;
height: 80px;
}

#notificationModal {
z-index: 1051;
z-index: 1051;
}


.loader {
width: calc(100% - 0px);
height: calc(100% - 0px);
border: 8px solid #162534;
border-top: 8px solid #09f;
border-radius: 50%;
animation: rotate 5s linear infinite;
width: calc(100% - 0px);
height: calc(100% - 0px);
border: 8px solid #162534;
border-top: 8px solid #09f;
border-radius: 50%;
animation: rotate 5s linear infinite;
}

@keyframes rotate {
100% {transform: rotate(360deg);}
}

#editor {
margin: 0;
position: relative;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 60vh;
}
#editor {
margin: 0;
position: relative;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 60vh;
}

.alert-circle.alert-sm {
width: 16px;
height: 16px;
padding: 6px 0px;
border-radius: 8px;
font-size: 8px;
text-align: center;
width: 16px;
height: 16px;
padding: 6px 0px;
border-radius: 8px;
font-size: 8px;
text-align: center;
}

.dot {
height: 15px;
width: 15px;
background-color: red;
border-radius: 50%;
display: inline-block;
}
height: 15px;
width: 15px;
background-color: red;
border-radius: 50%;
display: inline-block;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
/* display: none; <- Crashes Chrome on hover */
-webkit-appearance: none;
margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
/* display: none; <- Crashes Chrome on hover */
-webkit-appearance: none;
margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}

input[type=number] {
-moz-appearance:textfield; /* Firefox */
}
-moz-appearance: textfield; /* Firefox */
}
Loading