progress in direct lasering the working area

This commit is contained in:
Teja 2015-01-20 21:55:37 +01:00
parent 33c3bd401c
commit aab27fa181
9 changed files with 55 additions and 15 deletions

View file

@ -182,7 +182,7 @@ class FileManager(object):
self.add_file(dest_location, dest_path, file_obj, links=links, allow_overwrite=True)
end_time = time.time()
eventManager().fire(Events.SLICING_DONE, {"stl": source_path, "gcode": dest_path, "time": end_time - start_time})
eventManager().fire(Events.SLICING_DONE, {"stl": source_path, "gcode": dest_path, "gcode_location": dest_location, "time": end_time - start_time})
if callback is not None:
if callback_args is None:

View file

@ -179,9 +179,9 @@ var UI_API_KEY = "{{ uiApiKey }}";
<div class="jog-panel" id="control_zaxis">
Z-Axis
<div class="btn-group-vertical" role="group" aria-label="z-axis control">
<button class="btn xbox" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('z',1) }"><i class="icon-arrow-up"></i></button>
<button class="btn" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('z',1) }"><i class="icon-arrow-up"></i></button>
<!--<button class="btn box" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendHomeCommand(['z']) }"><i class="icon-home"></i></button>-->
<button class="btn xbox" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('z',-1) }"><i class="icon-arrow-down"></i></button>
<button class="btn" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('z',-1) }"><i class="icon-arrow-down"></i></button>
</div>
</div>
{% endif %}

View file

@ -201,8 +201,10 @@ class Printer():
self.command("?")
def home(self, axes):
#self.commands(["G91", "G28 %s" % " ".join(map(lambda x: "%s0" % x.upper(), axes)), "G90"])
self.commands(["$H", "G92X0Y0Z0", "G90", "G21"])
if(settings().getBoolean(["feature", "grbl"])):
self.commands(["$H", "G92X0Y0Z0", "G90", "G21"])
else:
self.commands(["G91", "G28 %s" % " ".join(map(lambda x: "%s0" % x.upper(), axes)), "G90"])
def extrude(self, amount):
extrusionSpeed = settings().get(["printerParameters", "movementSpeed", "e"])

View file

@ -377,8 +377,6 @@ def gcodeConvertCommand():
import re
svg = data['svg']
#svg = re.sub(r"inkscape:[a-zA-Z_-]+=\".*?\" ", "", svg)
#svg = re.sub(r"sodipodi:[a-zA-Z_-]+=\".*?\" ", "", svg)
del data['svg']
@ -401,9 +399,6 @@ def gcodeConvertCommand():
fileObj = Wrapper(filename, svg)
fileManager.add_file(target, filename, fileObj, links=None, allow_overwrite=True)
#fh = open(filename, 'w')
#fh.write(svg)
#fh.close()
slicer = "svgtogcode";
if "slicer" in data.keys() and data["slicer"]:

View file

@ -33,7 +33,8 @@ default_settings = {
"connection": 2,
"communication": 10,
"temperature": 5,
"sdStatus": 1
"sdStatus": 1,
"position": 0.5
},
"additionalPorts": []
},

View file

@ -1623,6 +1623,22 @@ input.search-query,
min-height:24px;
}
.safety_glasses_heads_up {
background-image:url(../img/safety_glasses_heads_up500.png);
background-repeat: no-repeat;
background-position: center;
background-size: contain;
width:250px;
height:150px;
float: right;
margin: 0em 1em;
}
.safety_glasses_warning {
font-size: large;
font-weight: bold;
}
#settingsTabs li.saveInProgress a:after {
content:"\f021";
font-family: FontAwesome;

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View file

@ -117,6 +117,7 @@ function GcodeFilesViewModel(printerStateViewModel, loginStateViewModel, slicing
self._otherRequestInProgress = false;
self.requestData = function(filenameToFocus, locationToFocus) {
console.log("requestData", filenameToFocus, locationToFocus);
if (self._otherRequestInProgress) return;
self._otherRequestInProgress = true;
@ -125,6 +126,7 @@ function GcodeFilesViewModel(printerStateViewModel, loginStateViewModel, slicing
method: "GET",
dataType: "json",
success: function(response) {
console.log("requestData api/files/response", response);
self.fromResponse(response, filenameToFocus, locationToFocus);
self._otherRequestInProgress = false;
},
@ -357,7 +359,30 @@ function GcodeFilesViewModel(printerStateViewModel, loginStateViewModel, slicing
};
self.onSlicingDone = function(payload) {
self.requestData();
//self.requestData();
jQuery('<div/>', {
class: "safety_glasses_heads_up"
}).appendTo("#confirmation_dialog .confirmation_dialog_message");
jQuery('<div/>', {
class: "safety_glasses_warning",
text: gettext("The laser will now start. Protect yourself and everybody in the room appropriately before proceeding!")
}).appendTo("#confirmation_dialog .confirmation_dialog_message");
//$("#confirmation_dialog .confirmation_dialog_message").text(gettext("The laser will now start. Protect yourself and everybody in the room appropriately before proceeding!"));
$("#confirmation_dialog .confirmation_dialog_acknowledge").unbind("click");
$("#confirmation_dialog .confirmation_dialog_acknowledge").click(
function(e) {
e.preventDefault();
$("#confirmation_dialog").modal("hide");
var url = API_BASEURL + "files/" + payload.gcode_location + "/" + payload.gcode;
$.ajax({
url: url,
type: "POST",
dataType: "json",
contentType: "application/json; charset=UTF-8",
data: JSON.stringify({command: "select", print: true})
});
});
$("#confirmation_dialog").modal("show");
};
self.onMetadataAnalysisFinished = function(payload) {

View file

@ -938,7 +938,7 @@ class MachineCom(object):
self.close()
### Operational
elif self._state == self.STATE_OPERATIONAL or self._state == self.STATE_PAUSED:
elif self._state == self.STATE_OPERATIONAL or self._state == self.STATE_PAUSED or self.STATE_LOCKED:
#Request the temperature on comm timeout (every 5 seconds) when we are not printing.
if line == "" or "wait" in line:
if self._resendDelta is not None:
@ -951,7 +951,8 @@ class MachineCom(object):
else:
self._sendCommand("M105")
tempRequestTimeout = getNewTimeout("detection") if self._grbl else getNewTimeout("temperature")
tempRequestTimeout = getNewTimeout("detection") if self._grbl else getNewTimeout("position")
###print(tempRequestTimeout)
# resend -> start resend procedure from requested line
elif line.lower().startswith("resend") or line.lower().startswith("rs"):
@ -979,7 +980,7 @@ class MachineCom(object):
if time.time() > tempRequestTimeout and not self.isStreaming():
if self._grbl:
self._commandQueue.put("?")
tempRequestTimeout = getNewTimeout("detection")
tempRequestTimeout = getNewTimeout("position")
else:
self._commandQueue.put("M105")
tempRequestTimeout = getNewTimeout("temperature")