Compare commits
3 commits
stable-1.2
...
camera_sup
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20906bca4d | ||
|
|
ac0ed5e9b5 | ||
|
|
1cc6ed6a61 |
22 changed files with 2045 additions and 2292 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
OctoPrint
|
OctoPrint
|
||||||
=========
|
=========
|
||||||
What I did was take the MrBeam fork of Octoprint (because I have a MrBeam, and I like it) - and modify it for pen plotting with an axidraw v3 clone.
|
|
||||||
|
|
||||||
[](https://flattr.com/submit/auto?user_id=foosel&url=https://github.com/foosel/OctoPrint&title=OctoPrint&language=&tags=github&category=software)
|
[](https://flattr.com/submit/auto?user_id=foosel&url=https://github.com/foosel/OctoPrint&title=OctoPrint&language=&tags=github&category=software)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ def update_source(git_executable, folder, target, force=False):
|
||||||
raise RuntimeError("Could not update, \"git reset --hard\" failed with returncode %d: %s" % (returncode, stdout))
|
raise RuntimeError("Could not update, \"git reset --hard\" failed with returncode %d: %s" % (returncode, stdout))
|
||||||
|
|
||||||
print(">>> Running: git pull")
|
print(">>> Running: git pull")
|
||||||
returncode, stdout = _git(["pull", "origin", "stable-1.2.2"], folder, git_executable=git_executable)
|
returncode, stdout = _git(["pull"], folder, git_executable=git_executable)
|
||||||
if returncode != 0:
|
if returncode != 0:
|
||||||
raise RuntimeError("Could not update, \"git pull\" failed with returncode %d: %s" % (returncode, stdout))
|
raise RuntimeError("Could not update, \"git pull\" failed with returncode %d: %s" % (returncode, stdout))
|
||||||
print(stdout)
|
print(stdout)
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ $(function() {
|
||||||
text += "<small>" + gettext("Those components marked with <i class=\"icon-ok\"></i> can be updated directly.") + "</small>";
|
text += "<small>" + gettext("Those components marked with <i class=\"icon-ok\"></i> can be updated directly.") + "</small>";
|
||||||
|
|
||||||
var options = {
|
var options = {
|
||||||
title: gettext("Mr Beam Update Available"),
|
title: gettext("Update Available"),
|
||||||
text: text,
|
text: text,
|
||||||
hide: false
|
hide: false
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -270,7 +270,7 @@ class SvgToGcodePlugin(octoprint.plugin.SlicerPlugin,
|
||||||
feedrate = max(1,data["defaultFeedrate"])
|
feedrate = max(1,data["defaultFeedrate"])
|
||||||
s.set(["defaultFeedrate"], feedrate)
|
s.set(["defaultFeedrate"], feedrate)
|
||||||
if "svgDPI" in data and data["svgDPI"]:
|
if "svgDPI" in data and data["svgDPI"]:
|
||||||
s.set_int(["svgDPI"], data["svgDPI"])
|
s.set(["svgDPI"], data["svgDPI"])
|
||||||
if "debug_logging" in data:
|
if "debug_logging" in data:
|
||||||
old_debug_logging = s.get_boolean(["debug_logging"])
|
old_debug_logging = s.get_boolean(["debug_logging"])
|
||||||
new_debug_logging = data["debug_logging"] in octoprint.settings.valid_boolean_trues
|
new_debug_logging = data["debug_logging"] in octoprint.settings.valid_boolean_trues
|
||||||
|
|
@ -357,8 +357,6 @@ class SvgToGcodePlugin(octoprint.plugin.SlicerPlugin,
|
||||||
converter_path = '/home/teja/workspace/mrbeam-inkscape-ext'
|
converter_path = '/home/teja/workspace/mrbeam-inkscape-ext'
|
||||||
elif("denkbrett" in hostname):
|
elif("denkbrett" in hostname):
|
||||||
converter_path = '/home/flo/mrbeam/git/mrbeam-inkscape-ext'
|
converter_path = '/home/flo/mrbeam/git/mrbeam-inkscape-ext'
|
||||||
elif ("clems-Air" in hostname):
|
|
||||||
converter_path = '/Users/clem/Dropbox/mrBeam/mrbeam-inkscape-ext'
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
sys.path.append(converter_path)
|
sys.path.append(converter_path)
|
||||||
|
|
|
||||||
|
|
@ -1160,7 +1160,6 @@ ul.dropdown-menu li a {
|
||||||
#control_zaxis {
|
#control_zaxis {
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
width: 80px;
|
width: 80px;
|
||||||
margin: 1em auto 0;
|
|
||||||
}
|
}
|
||||||
#control_zaxis_focus {
|
#control_zaxis_focus {
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
|
|
@ -1542,7 +1541,7 @@ td.settings_printerProfiles_profiles_action a.disabled {
|
||||||
.nav-pills>li>a,
|
.nav-pills>li>a,
|
||||||
select,
|
select,
|
||||||
textarea,
|
textarea,
|
||||||
input, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"],
|
input,
|
||||||
input.search-query,
|
input.search-query,
|
||||||
.uneditable-input,
|
.uneditable-input,
|
||||||
.input-append .add-on:last-child,
|
.input-append .add-on:last-child,
|
||||||
|
|
|
||||||
|
|
@ -102,28 +102,3 @@ svg text {
|
||||||
.overrideSlider span {
|
.overrideSlider span {
|
||||||
padding-left: .6em;
|
padding-left: .6em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.repeatGcode .btn-group {
|
|
||||||
width: 145px;
|
|
||||||
}
|
|
||||||
.repeatGcode input, .repeatGcode button {
|
|
||||||
width: 33%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.repeatGcode input {
|
|
||||||
margin-bottom:0;
|
|
||||||
padding-left: 0;
|
|
||||||
padding-right: 0;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.repeatGcode>span {
|
|
||||||
padding-left: .6em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.manual_position_input {
|
|
||||||
padding-top: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#manual_position.warning {
|
|
||||||
color: #DD0000;
|
|
||||||
}
|
|
||||||
|
|
@ -41,10 +41,8 @@ $(function(){
|
||||||
// image engraving stuff
|
// image engraving stuff
|
||||||
// preset values are a good start for wood engraving
|
// preset values are a good start for wood engraving
|
||||||
self.images_placed = ko.observable(false);
|
self.images_placed = ko.observable(false);
|
||||||
self.text_placed = ko.observable(false);
|
|
||||||
self.show_image_parameters = ko.computed(function(){
|
self.show_image_parameters = ko.computed(function(){
|
||||||
return (self.images_placed() || self.text_placed()
|
return self.images_placed() || (self.fill_areas() && self.show_vector_parameters());
|
||||||
|| (self.fill_areas() && self.show_vector_parameters()));
|
|
||||||
});
|
});
|
||||||
self.imgIntensityWhite = ko.observable(0);
|
self.imgIntensityWhite = ko.observable(0);
|
||||||
self.imgIntensityBlack = ko.observable(500);
|
self.imgIntensityBlack = ko.observable(500);
|
||||||
|
|
@ -87,7 +85,6 @@ $(function(){
|
||||||
self.show_vector_parameters(self.workingArea.getPlacedSvgs().length > 0);
|
self.show_vector_parameters(self.workingArea.getPlacedSvgs().length > 0);
|
||||||
self.show_fill_areas_checkbox(self.workingArea.hasFilledVectors())
|
self.show_fill_areas_checkbox(self.workingArea.hasFilledVectors())
|
||||||
self.images_placed(self.workingArea.getPlacedImages().length > 0);
|
self.images_placed(self.workingArea.getPlacedImages().length > 0);
|
||||||
self.text_placed(self.workingArea.hasTextItems());
|
|
||||||
//self.show_image_parameters(self.workingArea.getPlacedImages().length > 0);
|
//self.show_image_parameters(self.workingArea.getPlacedImages().length > 0);
|
||||||
|
|
||||||
if(self.show_vector_parameters() || self.show_image_parameters()){
|
if(self.show_vector_parameters() || self.show_image_parameters()){
|
||||||
|
|
|
||||||
|
|
@ -30,15 +30,14 @@ Snap.plugin(function (Snap, Element, Paper, global) {
|
||||||
*/
|
*/
|
||||||
Element.prototype.bake = function (toCubics, dec) {
|
Element.prototype.bake = function (toCubics, dec) {
|
||||||
var elem = this;
|
var elem = this;
|
||||||
|
if (!elem || !elem.paper) // don't handle unplaced elements. this causes double handling.
|
||||||
if (!elem || !elem.paper || elem.type !== "text" || elem.type !== "#text" || elem.type !== "tspan"){
|
|
||||||
return;
|
return;
|
||||||
} // don't handle unplaced elements. this causes double handling.
|
|
||||||
|
|
||||||
if (typeof (toCubics) === 'undefined')
|
if (typeof (toCubics) === 'undefined')
|
||||||
toCubics = false;
|
toCubics = false;
|
||||||
if (typeof (dec) === 'undefined')
|
if (typeof (dec) === 'undefined')
|
||||||
dec = 5;
|
dec = 5;
|
||||||
|
//var children = elem.selectAll('*')
|
||||||
var children = elem.children();
|
var children = elem.children();
|
||||||
if (children.length > 0) {
|
if (children.length > 0) {
|
||||||
for (var i = 0; i < children.length; i++) {
|
for (var i = 0; i < children.length; i++) {
|
||||||
|
|
@ -54,43 +53,14 @@ Snap.plugin(function (Snap, Element, Paper, global) {
|
||||||
elem.type !== "line" &&
|
elem.type !== "line" &&
|
||||||
elem.type !== "polygon" &&
|
elem.type !== "polygon" &&
|
||||||
elem.type !== "polyline" &&
|
elem.type !== "polyline" &&
|
||||||
elem.type !== "image" &&
|
elem.type !== "path"){
|
||||||
elem.type !== "path" &&
|
|
||||||
elem.type !== "text" &&
|
// if(elem.type !== 'g' && elem.type !== 'desc' && elem.type !== 'defs')
|
||||||
elem.type !== "tspan" &&
|
// console.log('skipping unsupported element ', elem.type);
|
||||||
elem.type !== "#text"){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (elem.type == 'image' || elem.type == "text" || elem.type == "#text"){
|
|
||||||
// TODO ...
|
|
||||||
var x = parseFloat(elem.attr('x')),
|
|
||||||
y = parseFloat(elem.attr('y')),
|
|
||||||
w = parseFloat(elem.attr('width')),
|
|
||||||
h = parseFloat(elem.attr('height'));
|
|
||||||
|
|
||||||
// Validity checks from http://www.w3.org/TR/SVG/shapes.html#RectElement:
|
|
||||||
// If 'x' and 'y' are not specified, then set both to 0. // CorelDraw is creating that sometimes
|
|
||||||
if (!isFinite(x)) {
|
|
||||||
console.log('No attribute "x" in image tag. Assuming 0.')
|
|
||||||
x = 0;
|
|
||||||
}
|
|
||||||
if (!isFinite(y)) {
|
|
||||||
console.log('No attribute "y" in image tag. Assuming 0.')
|
|
||||||
y = 0;
|
|
||||||
}
|
|
||||||
var transform = elem.transform();
|
|
||||||
var matrix = transform['totalMatrix'];
|
|
||||||
var transformedX = matrix.x(x, y);
|
|
||||||
var transformedY = matrix.y(x, y);
|
|
||||||
var transformedW = matrix.x(x+w, y+h) - transformedX;
|
|
||||||
var transformedH = matrix.y(x+w, y+h) - transformedY;
|
|
||||||
|
|
||||||
elem.attr({x: transformedX, y: transformedY, width: transformedW, height: transformedH});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if(elem.type !== 'path') console.log("bake: converting " + elem.type + " to path");
|
||||||
var path_elem = elem.convertToPath();
|
var path_elem = elem.convertToPath();
|
||||||
|
|
||||||
if (!path_elem || path_elem.attr('d') === '' || path_elem.attr('d') === null)
|
if (!path_elem || path_elem.attr('d') === '' || path_elem.attr('d') === null)
|
||||||
|
|
@ -439,19 +409,6 @@ Snap.plugin(function (Snap, Element, Paper, global) {
|
||||||
// Possibly the cubed root of 6, but 1.81 works best
|
// Possibly the cubed root of 6, but 1.81 works best
|
||||||
var num = 1.81;
|
var num = 1.81;
|
||||||
var tag = old_element.type;
|
var tag = old_element.type;
|
||||||
|
|
||||||
var convertMMtoPixel = function (val) {
|
|
||||||
attrList = ['rx','ry','r','cx','cy','x1','x2','y1','y2','x','y','width','height'];
|
|
||||||
for(var attrIdx in attrList) {
|
|
||||||
if(val.attr(attrList[attrIdx]) != null && val.attr(attrList[attrIdx]).indexOf('mm') > -1) {
|
|
||||||
var tmp = parseFloat(val.attr(attrList[attrIdx])) * 3.5433;
|
|
||||||
val.attr(attrList[attrIdx], tmp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
convertMMtoPixel(old_element);
|
|
||||||
|
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
case 'ellipse':
|
case 'ellipse':
|
||||||
case 'circle':
|
case 'circle':
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ Snap.plugin(function (Snap, Element, Paper, global) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(elem.type === 'image' || elem.type === "text" || elem.type === "#text"){
|
if(elem.type === 'image'){
|
||||||
selection.push(elem);
|
selection.push(elem);
|
||||||
} else {
|
} else {
|
||||||
if(fillPaths && elem.is_filled()){
|
if(fillPaths && elem.is_filled()){
|
||||||
|
|
@ -74,10 +74,7 @@ Snap.plugin(function (Snap, Element, Paper, global) {
|
||||||
elem.type !== "line" &&
|
elem.type !== "line" &&
|
||||||
elem.type !== "polygon" &&
|
elem.type !== "polygon" &&
|
||||||
elem.type !== "polyline" &&
|
elem.type !== "polyline" &&
|
||||||
elem.type !== "path" //&&
|
elem.type !== "path" ){
|
||||||
// elem.type !== "text" &&
|
|
||||||
// elem.type !== "#text"
|
|
||||||
){
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -124,7 +121,7 @@ Snap.plugin(function (Snap, Element, Paper, global) {
|
||||||
|
|
||||||
// get svg as dataUrl
|
// get svg as dataUrl
|
||||||
var svgStr = elem.outerSVG();
|
var svgStr = elem.outerSVG();
|
||||||
var svgDataUri = 'data:image/svg+xml;base64,' + window.btoa(unescape(encodeURIComponent(svgStr))); //deprecated unescape needed!
|
var svgDataUri = 'data:image/svg+xml;base64,' + window.btoa(svgStr);
|
||||||
var source = new Image();
|
var source = new Image();
|
||||||
source.src = svgDataUri;
|
source.src = svgDataUri;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,5 @@
|
||||||
$(function(){
|
$(function(){
|
||||||
|
|
||||||
// Opera 8.0+
|
|
||||||
var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
|
|
||||||
// Firefox 1.0+
|
|
||||||
var isFirefox = typeof InstallTrigger !== 'undefined';
|
|
||||||
// At least Safari 3+: "[object HTMLElementConstructor]"
|
|
||||||
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
|
|
||||||
// Internet Explorer 6-11
|
|
||||||
var isIE = /*@cc_on!@*/false || !!document.documentMode;
|
|
||||||
// Edge 20+
|
|
||||||
var isEdge = !isIE && !!window.StyleMedia;
|
|
||||||
// Chrome 1+
|
|
||||||
var isChrome = !!window.chrome && !!window.chrome.webstore;
|
|
||||||
// Blink engine detection
|
|
||||||
var isBlink = (isChrome || isOpera) && !!window.CSS;
|
|
||||||
|
|
||||||
function WorkingAreaViewModel(params) {
|
function WorkingAreaViewModel(params) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
|
@ -59,6 +44,8 @@ $(function(){
|
||||||
}
|
}
|
||||||
var dim = [w,h];
|
var dim = [w,h];
|
||||||
return dim;
|
return dim;
|
||||||
|
} else {
|
||||||
|
return [0,0];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -107,45 +94,34 @@ $(function(){
|
||||||
self.clear = function(){
|
self.clear = function(){
|
||||||
snap.selectAll('#userContent>*').remove();
|
snap.selectAll('#userContent>*').remove();
|
||||||
snap.selectAll('#placedGcodes>*').remove();
|
snap.selectAll('#placedGcodes>*').remove();
|
||||||
snap.selectAll('rect:not(#coordGrid)').remove();
|
|
||||||
self.placedDesigns([]);
|
self.placedDesigns([]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
self.trigger_resize = function(){
|
self.trigger_resize = function(){
|
||||||
if(typeof(snap) !== 'undefined') self.abortFreeTransforms();
|
self.abortFreeTransforms();
|
||||||
self.availableHeight(document.documentElement.clientHeight - $('body>nav').outerHeight() - $('footer>*').outerHeight() - 39); // magic number
|
self.availableHeight(document.documentElement.clientHeight - $('body>nav').outerHeight() - $('footer>*').outerHeight() - 39); // magic number
|
||||||
self.availableWidth($('#workingarea div.span8').innerWidth());
|
self.availableWidth($('#workingarea div.span8').innerWidth());
|
||||||
};
|
};
|
||||||
|
|
||||||
self.move_laser = function(data, evt){
|
self.move_laser = function(el){
|
||||||
self.abortFreeTransforms();
|
self.abortFreeTransforms();
|
||||||
if(self.state.isOperational() && !self.state.isPrinting()){
|
if(self.state.isOperational() && !self.state.isPrinting()){
|
||||||
var coord = self.getXYCoord(evt);
|
var x = self.px2mm(event.offsetX);
|
||||||
|
var y = self.px2mm(event.toElement.ownerSVGElement.offsetHeight - event.offsetY); // hopefully this works across browsers
|
||||||
|
x = Math.min(x, self.workingAreaWidthMM());
|
||||||
|
y = Math.min(y, self.workingAreaHeightMM());
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: API_BASEURL + "printer/printhead",
|
url: API_BASEURL + "printer/printhead",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
contentType: "application/json; charset=UTF8",
|
contentType: "application/json; charset=UTF8",
|
||||||
data: JSON.stringify({"command": "position", x:coord.x, y:coord.y})
|
data: JSON.stringify({"command": "position", x:x, y:y})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
self.getXYCoord = function(evt){
|
|
||||||
if(/firefox/.test(navigator.userAgent.toLowerCase())) {
|
|
||||||
var scale = evt.target.parentElement.transform.baseVal[0].matrix.a;
|
|
||||||
var x = self.px2mm(evt.offsetX) * scale;
|
|
||||||
var y = self.px2mm(parseFloat(evt.target.attributes.height.value) - evt.offsetY) * scale;
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
var x = self.px2mm(evt.offsetX);
|
|
||||||
var y = self.px2mm(parseFloat(evt.target.farthestViewportElement.clientHeight) - evt.offsetY);
|
|
||||||
}
|
|
||||||
x = Math.min(x, self.workingAreaWidthMM());
|
|
||||||
y = Math.min(y, self.workingAreaHeightMM());
|
|
||||||
return {x:x, y:y};
|
|
||||||
}
|
|
||||||
|
|
||||||
self.crosshairX = function(){
|
self.crosshairX = function(){
|
||||||
var pos = self.state.currentPos();
|
var pos = self.state.currentPos();
|
||||||
|
|
@ -153,7 +129,7 @@ $(function(){
|
||||||
|
|
||||||
};
|
};
|
||||||
self.crosshairY = function(){
|
self.crosshairY = function(){
|
||||||
var h = Snap($('#area_preview')[0]).getBBox().height;
|
var h = document.getElementById('area_preview').clientHeight;
|
||||||
var pos = self.state.currentPos();
|
var pos = self.state.currentPos();
|
||||||
return pos !== undefined ? (h - self.mm2px(pos.y) - 15) : -100; // subtract height/2;
|
return pos !== undefined ? (h - self.mm2px(pos.y) - 15) : -100; // subtract height/2;
|
||||||
};
|
};
|
||||||
|
|
@ -243,26 +219,11 @@ $(function(){
|
||||||
var url = self._getSVGserveUrl(file);
|
var url = self._getSVGserveUrl(file);
|
||||||
callback = function (f) {
|
callback = function (f) {
|
||||||
var newSvgAttrs = {};
|
var newSvgAttrs = {};
|
||||||
if(f.select('svg') == null){
|
var root_attrs = f.select('svg').node.attributes;
|
||||||
root_attrs = f.node.attributes;
|
|
||||||
} else {
|
|
||||||
var root_attrs = f.select('svg').node.attributes;
|
|
||||||
}
|
|
||||||
var doc_width = null;
|
var doc_width = null;
|
||||||
var doc_height = null;
|
var doc_height = null;
|
||||||
var doc_viewbox = null;
|
var doc_viewbox = null;
|
||||||
|
|
||||||
// find clippath elements
|
|
||||||
var clipPathEl = f.selectAll('clipPath');
|
|
||||||
if(clipPathEl.length != 0){
|
|
||||||
console.warn("Warning: removed unsupported clipPath element in SVG");
|
|
||||||
self.svg_contains_clipPath_warning();
|
|
||||||
clipPathEl.remove()
|
|
||||||
}
|
|
||||||
|
|
||||||
// find all elements with "display=none" and remove them
|
|
||||||
f.selectAll("[display=none]").remove()
|
|
||||||
|
|
||||||
// iterate svg tag attributes
|
// iterate svg tag attributes
|
||||||
for(var i = 0; i < root_attrs.length; i++){
|
for(var i = 0; i < root_attrs.length; i++){
|
||||||
var attr = root_attrs[i];
|
var attr = root_attrs[i];
|
||||||
|
|
@ -278,19 +239,9 @@ $(function(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// find Illustrator comment and notify
|
|
||||||
f.node.childNodes.forEach(function(entry) {
|
|
||||||
if(entry.nodeType == 8) { // Nodetype 8 = comment
|
|
||||||
if(entry.textContent.indexOf('Illustrator') > -1) {
|
|
||||||
new PNotify({title: gettext("Illustrator SVG Detected"), text: "Illustrator SVG detected! To preserve coorect scale, please go to the \'Settings\' menu and change the \'SVG dpi\' field under \'Plugins/Svg Conversion\' according to your file. And add it again.", type: "info", hide: false});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// scale matrix
|
// scale matrix
|
||||||
var mat = self.getDocumentViewBoxMatrix(doc_width, doc_height, doc_viewbox);
|
var mat = self.getDocumentViewBoxMatrix(doc_width, doc_height, doc_viewbox);
|
||||||
var dpiscale = 90 / self.settings.settings.plugins.svgtogcode.svgDPI();
|
var scaleMatrixStr = new Snap.Matrix(mat[0][0],mat[0][1],mat[1][0],mat[1][1],mat[0][2],mat[1][2]).toTransformString();
|
||||||
var scaleMatrixStr = new Snap.Matrix(mat[0][0],mat[0][1],mat[1][0],mat[1][1],mat[0][2],mat[1][2]).scale(dpiscale).toTransformString();
|
|
||||||
newSvgAttrs['transform'] = scaleMatrixStr;
|
newSvgAttrs['transform'] = scaleMatrixStr;
|
||||||
|
|
||||||
var newSvg = snap.group(f.selectAll("svg>*"));
|
var newSvg = snap.group(f.selectAll("svg>*"));
|
||||||
|
|
@ -396,7 +347,7 @@ $(function(){
|
||||||
dx = -svgBB.x + 0.01;
|
dx = -svgBB.x + 0.01;
|
||||||
outside = true;
|
outside = true;
|
||||||
} else if(svgBB.x2 > waBB.x2){
|
} else if(svgBB.x2 > waBB.x2){
|
||||||
dx = -svgBB.x + 0.01;
|
dx = -svgBB.x2 + waBB.x2 - 0.01;
|
||||||
outside = true;
|
outside = true;
|
||||||
}
|
}
|
||||||
if(svgBB.y < waBB.y){
|
if(svgBB.y < waBB.y){
|
||||||
|
|
@ -416,20 +367,8 @@ $(function(){
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
self.svg_contains_clipPath_warning = function(){
|
|
||||||
var error = "<p>" + gettext("The SVG file contains clipPath elements.<br/>clipPath is not supported yet and has been removed from file.") + "</p>";
|
|
||||||
//error += pnotifyAdditionalInfo("<pre>" + data.jqXHR.responseText + "</pre>");
|
|
||||||
new PNotify({
|
|
||||||
title: "clipPath elements removed",
|
|
||||||
text: error,
|
|
||||||
type: "warn",
|
|
||||||
hide: false
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
self.svg_contains_text_warning = function(svg){
|
self.svg_contains_text_warning = function(svg){
|
||||||
var error = "<p>" + gettext("The SVG file contains text elements.<br/>If you want to laser just their outlines,<br/>please convert them to paths.<br/>Otherwise they will be engraved with infill.") + "</p>";
|
var error = "<p>" + gettext("The svg file contains text elements.<br/>Please convert them to paths.<br/>Otherwise they will be ignored.") + "</p>";
|
||||||
//error += pnotifyAdditionalInfo("<pre>" + data.jqXHR.responseText + "</pre>");
|
//error += pnotifyAdditionalInfo("<pre>" + data.jqXHR.responseText + "</pre>");
|
||||||
new PNotify({
|
new PNotify({
|
||||||
title: "Text elements found",
|
title: "Text elements found",
|
||||||
|
|
@ -437,6 +376,7 @@ $(function(){
|
||||||
type: "warn",
|
type: "warn",
|
||||||
hide: false
|
hide: false
|
||||||
});
|
});
|
||||||
|
svg.selectAll('text,tspan').remove();
|
||||||
};
|
};
|
||||||
|
|
||||||
self.svg_misfitting_warning = function(svg, misfitting){
|
self.svg_misfitting_warning = function(svg, misfitting){
|
||||||
|
|
@ -488,16 +428,10 @@ $(function(){
|
||||||
};
|
};
|
||||||
|
|
||||||
self.getUsefulDimensions = function(wpx, hpx){
|
self.getUsefulDimensions = function(wpx, hpx){
|
||||||
var maxWidthMM = wpx * 0.25; // TODO parametrize
|
var maxWidthMM = wpx * 0.25; // TODO parametrize
|
||||||
var maxHeightMM = hpx * 0.25; // TODO parametrize
|
var aspectRatio = wpx / hpx;
|
||||||
var aspectRatio = wpx / hpx;
|
var destWidthMM = Math.min(self.workingAreaWidthMM() - 2, maxWidthMM);
|
||||||
var destWidthMM = Math.min(self.workingAreaWidthMM() - 2, maxWidthMM);
|
var destHeightMM = destWidthMM / aspectRatio;
|
||||||
var destHeightMM = Math.min(self.workingAreaHeightMM() - 2, maxHeightMM);
|
|
||||||
if ((destWidthMM / aspectRatio) > destHeightMM) {
|
|
||||||
destWidthMM = destHeightMM * aspectRatio;
|
|
||||||
} else {
|
|
||||||
destHeightMM = destWidthMM / aspectRatio;
|
|
||||||
}
|
|
||||||
var destWidthPT = self.mm2svgUnits(destWidthMM);
|
var destWidthPT = self.mm2svgUnits(destWidthMM);
|
||||||
var destHeightPT = self.mm2svgUnits(destHeightMM);
|
var destHeightPT = self.mm2svgUnits(destHeightMM);
|
||||||
return [destWidthPT, destHeightPT];
|
return [destWidthPT, destHeightPT];
|
||||||
|
|
@ -681,12 +615,14 @@ $(function(){
|
||||||
};
|
};
|
||||||
|
|
||||||
self.abortFreeTransforms = function(){
|
self.abortFreeTransforms = function(){
|
||||||
var tip = snap.selectAll('._freeTransformInProgress');
|
if(typeof(snap) !== 'undefined'){
|
||||||
for (var i = 0; i < tip.length; i++) {
|
var tip = snap.selectAll('._freeTransformInProgress');
|
||||||
var el = tip[i];
|
for (var i = 0; i < tip.length; i++) {
|
||||||
el.ftRemoveHandles();
|
var el = tip[i];
|
||||||
|
el.ftRemoveHandles();
|
||||||
|
}
|
||||||
|
self.check_sizes_and_placements();
|
||||||
}
|
}
|
||||||
self.check_sizes_and_placements();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
self.getCompositionSVG = function(fillAreas, callback){
|
self.getCompositionSVG = function(fillAreas, callback){
|
||||||
|
|
@ -742,16 +678,6 @@ $(function(){
|
||||||
return snap.selectAll("#userContent image");
|
return snap.selectAll("#userContent image");
|
||||||
};
|
};
|
||||||
|
|
||||||
self.hasTextItems = function () {
|
|
||||||
if(snap.selectAll("#userContent tspan").length > 0 ||
|
|
||||||
snap.selectAll("#userContent text").length > 0 ||
|
|
||||||
snap.selectAll("userContent #text").length > 0) {
|
|
||||||
return true
|
|
||||||
}else{
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
self.getPlacedGcodes = ko.computed(function() {
|
self.getPlacedGcodes = ko.computed(function() {
|
||||||
var gcodeFiles = [];
|
var gcodeFiles = [];
|
||||||
ko.utils.arrayForEach(self.placedDesigns(), function(design) {
|
ko.utils.arrayForEach(self.placedDesigns(), function(design) {
|
||||||
|
|
@ -836,12 +762,7 @@ $(function(){
|
||||||
self._embedAllImages = function(svg, callback){
|
self._embedAllImages = function(svg, callback){
|
||||||
|
|
||||||
var allImages = svg.selectAll('image');
|
var allImages = svg.selectAll('image');
|
||||||
var linkedImages = allImages.items.filter(function(i){
|
var linkedImages = allImages.items.filter(function(i){ return !i.attr('href').startsWith('data:') });
|
||||||
if(i.attr('xlink:href') != null) {
|
|
||||||
return !i.attr('xlink:href').startsWith('data:');
|
|
||||||
} else if(i.attr('href') != null) {
|
|
||||||
return !i.attr('href').startsWith('data:');
|
|
||||||
}});
|
|
||||||
if(linkedImages.length > 0){
|
if(linkedImages.length > 0){
|
||||||
var callbackCounter = linkedImages.length;
|
var callbackCounter = linkedImages.length;
|
||||||
for (var i = 0; i < linkedImages.length; i++) {
|
for (var i = 0; i < linkedImages.length; i++) {
|
||||||
|
|
@ -874,7 +795,7 @@ $(function(){
|
||||||
for (var i = 0; i < fillings.length; i++) {
|
for (var i = 0; i < fillings.length; i++) {
|
||||||
var item = fillings[i];
|
var item = fillings[i];
|
||||||
|
|
||||||
if (item.type === 'image' || item.type === "text" || item.type === "#text") {
|
if (item.type === 'image') {
|
||||||
// remove filter effects on images for proper rendering
|
// remove filter effects on images for proper rendering
|
||||||
var style = item.attr('style');
|
var style = item.attr('style');
|
||||||
if (style !== null) {
|
if (style !== null) {
|
||||||
|
|
@ -911,6 +832,38 @@ $(function(){
|
||||||
$('#tmpSvg').remove();
|
$('#tmpSvg').remove();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
self.onTabChange = function (current, previous) {
|
||||||
|
if (current === "#workingarea") {
|
||||||
|
|
||||||
|
//self.trigger_resize();
|
||||||
|
//self.check_sizes_and_placements();
|
||||||
|
|
||||||
|
if (self.webcamDisableTimeout !== undefined) {
|
||||||
|
clearTimeout(self.webcamDisableTimeout);
|
||||||
|
}
|
||||||
|
var webcamImage = $("#webcam_image");
|
||||||
|
var currentSrc = webcamImage.attr("src");
|
||||||
|
if (currentSrc === undefined || currentSrc.trim() == "") {
|
||||||
|
var newSrc = CONFIG_WEBCAM_STREAM;
|
||||||
|
if (CONFIG_WEBCAM_STREAM.lastIndexOf("?") > -1) {
|
||||||
|
newSrc += "&";
|
||||||
|
} else {
|
||||||
|
newSrc += "?";
|
||||||
|
}
|
||||||
|
newSrc += new Date().getTime();
|
||||||
|
|
||||||
|
//self.updateRotatorWidth();
|
||||||
|
webcamImage.attr("src", newSrc);
|
||||||
|
}
|
||||||
|
} else if (previous === "#workingArea") {
|
||||||
|
// only disable webcam stream if tab is out of focus for more than 5s, otherwise we might cause
|
||||||
|
// more load by the constant connection creation than by the actual webcam stream
|
||||||
|
self.webcamDisableTimeout = setTimeout(function () {
|
||||||
|
$("#webcam_image").attr("src", "");
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
self.onBeforeBinding = function(){
|
self.onBeforeBinding = function(){
|
||||||
self.files.workingArea = self;
|
self.files.workingArea = self;
|
||||||
};
|
};
|
||||||
|
|
@ -920,6 +873,6 @@ $(function(){
|
||||||
// view model class, parameters for constructor, container to bind to
|
// view model class, parameters for constructor, container to bind to
|
||||||
ADDITIONAL_VIEWMODELS.push([WorkingAreaViewModel,
|
ADDITIONAL_VIEWMODELS.push([WorkingAreaViewModel,
|
||||||
["loginStateViewModel", "settingsViewModel", "printerStateViewModel", "gcodeFilesViewModel"],
|
["loginStateViewModel", "settingsViewModel", "printerStateViewModel", "gcodeFilesViewModel"],
|
||||||
[document.getElementById("area_preview"), document.getElementById("working_area_files")]]);
|
[document.getElementById("area_preview"), document.getElementById("working_area_files"), document.getElementById("webcam_container")]]);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -331,7 +331,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
|
||||||
def position(self, x, y):
|
def position(self, x, y):
|
||||||
printer_profile = self._printerProfileManager.get_current_or_default()
|
printer_profile = self._printerProfileManager.get_current_or_default()
|
||||||
movement_speed = min(printer_profile["axes"]["x"]["speed"], printer_profile["axes"]["y"]["speed"])
|
movement_speed = min(printer_profile["axes"]["x"]["speed"], printer_profile["axes"]["y"]["speed"])
|
||||||
self.commands(["G90", "G0 X%.3f Y%.3f F%d" % (x, y, movement_speed)])
|
self.commands(["G90", "G0 X%.3f Y%.3f F%d" % (x, y, movement_speed), "?"])
|
||||||
|
|
||||||
def _convert_rate_value(self, factor, min=0, max=200):
|
def _convert_rate_value(self, factor, min=0, max=200):
|
||||||
if not isinstance(factor, (int, float, long)):
|
if not isinstance(factor, (int, float, long)):
|
||||||
|
|
@ -433,22 +433,6 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
|
||||||
payload["origin"] = FileDestinations.SDCARD
|
payload["origin"] = FileDestinations.SDCARD
|
||||||
eventManager().fire(Events.PRINT_FAILED, payload)
|
eventManager().fire(Events.PRINT_FAILED, payload)
|
||||||
|
|
||||||
def increase_passes(self):
|
|
||||||
"""
|
|
||||||
increase the number of passes by one.
|
|
||||||
"""
|
|
||||||
if self._comm is None:
|
|
||||||
return
|
|
||||||
self._comm.increasePasses()
|
|
||||||
|
|
||||||
def degrease_passes(self):
|
|
||||||
"""
|
|
||||||
degrease the number of passes by one.
|
|
||||||
"""
|
|
||||||
if self._comm is None:
|
|
||||||
return
|
|
||||||
self._comm.degreasePasses()
|
|
||||||
|
|
||||||
def get_state_string(self):
|
def get_state_string(self):
|
||||||
"""
|
"""
|
||||||
Returns a human readable string corresponding to the current communication state.
|
Returns a human readable string corresponding to the current communication state.
|
||||||
|
|
|
||||||
|
|
@ -473,7 +473,7 @@ def gcodeConvertCommand():
|
||||||
import os
|
import os
|
||||||
name, _ = os.path.splitext(data['gcode'])
|
name, _ = os.path.splitext(data['gcode'])
|
||||||
|
|
||||||
filename = target + "/temp.svg"
|
filename = target + "/" + name + ".svg"
|
||||||
class Wrapper(object):
|
class Wrapper(object):
|
||||||
def __init__(self, filename, content):
|
def __init__(self, filename, content):
|
||||||
self.filename = filename
|
self.filename = filename
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,7 @@ def controlJob():
|
||||||
"start": [],
|
"start": [],
|
||||||
"restart": [],
|
"restart": [],
|
||||||
"pause": [],
|
"pause": [],
|
||||||
"cancel": [],
|
"cancel": []
|
||||||
"incpasses": [],
|
|
||||||
"degpasses": []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
command, data, response = get_json_command_from_request(request, valid_commands)
|
command, data, response = get_json_command_from_request(request, valid_commands)
|
||||||
|
|
@ -50,15 +48,6 @@ def controlJob():
|
||||||
if not activePrintjob:
|
if not activePrintjob:
|
||||||
return make_response("Printer is neither printing nor paused, 'cancel' command cannot be performed", 409)
|
return make_response("Printer is neither printing nor paused, 'cancel' command cannot be performed", 409)
|
||||||
printer.cancel_print()
|
printer.cancel_print()
|
||||||
elif command == "incpasses":
|
|
||||||
if not activePrintjob:
|
|
||||||
return make_response("Printer is neither printing nor paused, 'incpasses' command cannot be performed", 409)
|
|
||||||
printer.increase_passes()
|
|
||||||
elif command == "degpasses":
|
|
||||||
if not activePrintjob:
|
|
||||||
return make_response("Printer is neither printing nor paused, 'degpasses' command cannot be performed", 409)
|
|
||||||
printer.degrease_passes()
|
|
||||||
|
|
||||||
return NO_CONTENT
|
return NO_CONTENT
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.7 KiB |
|
|
@ -404,11 +404,6 @@ $(function() {
|
||||||
self.onStartup = function () {
|
self.onStartup = function () {
|
||||||
self.requestData();
|
self.requestData();
|
||||||
self._configureJogDistanceSlider();
|
self._configureJogDistanceSlider();
|
||||||
$('#manual_position').keyup(function(e) {
|
|
||||||
if (e.which === 13){ // 13 == enter
|
|
||||||
self.manualPosition();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
self.updateRotatorWidth = function() {
|
self.updateRotatorWidth = function() {
|
||||||
|
|
@ -612,24 +607,6 @@ $(function() {
|
||||||
self.sendCustomCommand({type: 'command', command: "G92 X0 Y0"});
|
self.sendCustomCommand({type: 'command', command: "G92 X0 Y0"});
|
||||||
};
|
};
|
||||||
|
|
||||||
self.manualPosition = function(){
|
|
||||||
$('#manual_position').removeClass('warning');
|
|
||||||
var s = $('#manual_position').val();
|
|
||||||
var tmp = s.split(/[^0-9.,-\\+]+/);
|
|
||||||
if (tmp.length === 2) {
|
|
||||||
var x = parseFloat(tmp[0]);
|
|
||||||
var y = parseFloat(tmp[1]);
|
|
||||||
if(!isNaN(x) && !isNaN(y)) {
|
|
||||||
self.sendCustomCommand({type: 'command', command: "G0X"+x+"Y"+y});
|
|
||||||
$('#manual_position').val('');
|
|
||||||
} else {
|
|
||||||
$('#manual_position').addClass('warning');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$('#manual_position').addClass('warning');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
self.jogDistanceInMM = ko.observable(undefined);
|
self.jogDistanceInMM = ko.observable(undefined);
|
||||||
|
|
||||||
self.focus_on = function () {
|
self.focus_on = function () {
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@ $(function() {
|
||||||
self.feedrateOverride = ko.observable(100);
|
self.feedrateOverride = ko.observable(100);
|
||||||
self.intensityOverride.extend({ rateLimit: 500 });
|
self.intensityOverride.extend({ rateLimit: 500 });
|
||||||
self.feedrateOverride.extend({ rateLimit: 500 });
|
self.feedrateOverride.extend({ rateLimit: 500 });
|
||||||
self.numberOfPasses = ko.observable(1);
|
|
||||||
|
|
||||||
self.TITLE_PRINT_BUTTON_PAUSED = gettext("Restarts the print job from the beginning");
|
self.TITLE_PRINT_BUTTON_PAUSED = gettext("Restarts the print job from the beginning");
|
||||||
self.TITLE_PRINT_BUTTON_UNPAUSED = gettext("Starts the print job");
|
self.TITLE_PRINT_BUTTON_UNPAUSED = gettext("Starts the print job");
|
||||||
|
|
@ -217,8 +216,6 @@ $(function() {
|
||||||
$("#confirmation_dialog .confirmation_dialog_acknowledge").click(
|
$("#confirmation_dialog .confirmation_dialog_acknowledge").click(
|
||||||
function (e) {
|
function (e) {
|
||||||
if (typeof callback === 'function') {
|
if (typeof callback === 'function') {
|
||||||
self.resetOverrideSlider();
|
|
||||||
self.numberOfPasses(1);
|
|
||||||
callback(e);
|
callback(e);
|
||||||
$("#confirmation_dialog").modal("hide");
|
$("#confirmation_dialog").modal("hide");
|
||||||
$("#confirmation_dialog .confirmation_dialog_message").html('');
|
$("#confirmation_dialog .confirmation_dialog_message").html('');
|
||||||
|
|
@ -334,30 +331,16 @@ $(function() {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
self.increasePasses = function(){
|
|
||||||
self.numberOfPasses(self.numberOfPasses()+1);
|
|
||||||
self._jobCommand("incpasses");
|
|
||||||
}
|
|
||||||
self.decreasePasses = function(){
|
|
||||||
var passes = Math.max(self.numberOfPasses()-1, 1);
|
|
||||||
self.numberOfPasses(passes);
|
|
||||||
self._jobCommand("degpasses");
|
|
||||||
}
|
|
||||||
|
|
||||||
self.onEventPrintDone = function(){
|
self.onEventPrintDone = function(){
|
||||||
self.resetOverrideSlider();
|
self.feedrateOverrideSlider.slider('setValue', 100);
|
||||||
|
self.intensityOverrideSlider.slider('setValue', 100);
|
||||||
|
self.intensityOverride(100);
|
||||||
|
self.feedrateOverride(100);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.onStartup = function() {
|
self.onStartup = function() {
|
||||||
self._configureOverrideSliders();
|
self._configureOverrideSliders();
|
||||||
};
|
};
|
||||||
|
|
||||||
self.resetOverrideSlider = function() {
|
|
||||||
self.feedrateOverrideSlider.slider('setValue', 100);
|
|
||||||
self.intensityOverrideSlider.slider('setValue', 100);
|
|
||||||
self.intensityOverride(100);
|
|
||||||
self.feedrateOverride(100);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OCTOPRINT_VIEWMODELS.push([
|
OCTOPRINT_VIEWMODELS.push([
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title data-bind="text: title">Mr Draw</title>
|
<title data-bind="text: title">Mr Beam</title>
|
||||||
|
|
||||||
<link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}">
|
<link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}">
|
||||||
<link rel="apple-touch-icon" sizes="114x114" href="{{ url_for('static', filename='img/apple-touch-icon-114x114.png') }}">
|
<link rel="apple-touch-icon" sizes="114x114" href="{{ url_for('static', filename='img/apple-touch-icon-114x114.png') }}">
|
||||||
|
|
@ -16,11 +16,11 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="navbar-header brand" style="min-width: 272px;">
|
<div class="navbar-header brand" style="min-width: 272px;">
|
||||||
<a class="navbar-brand" href="#">
|
<a class="navbar-brand" href="#">
|
||||||
<img alt="Mr Draw Logo" src="{{ url_for('static', filename='img/mr-draw-red_x120.png') }}">
|
<img alt="Mr Beam Logo" src="{{ url_for('static', filename='img/mr-typo-red_x120.png') }}">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<!-- Navbar -->
|
<!-- Navbar -->
|
||||||
<ul class="nav nav-pills">
|
<ul class="nav nav-pills" id="tabs">
|
||||||
<li class="active"><a href="#workingarea" data-toggle="tab" id="wa_tab_btn">working area</a></li>
|
<li class="active"><a href="#workingarea" data-toggle="tab" id="wa_tab_btn">working area</a></li>
|
||||||
<li><a href="#designlib" data-toggle="tab">design library</a></li>
|
<li><a href="#designlib" data-toggle="tab">design library</a></li>
|
||||||
<li><a href="#focus" data-toggle="tab">focus</a></li>
|
<li><a href="#focus" data-toggle="tab">focus</a></li>
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
|
|
||||||
<div id="control" class="accordion-inner" data-bind="visible: isReady() || isLocked() || isFlashing()">
|
<div id="control" class="accordion-inner" data-bind="visible: isReady() || isLocked() || isFlashing()">
|
||||||
<div data-bind="visible: isLocked ">
|
<div data-bind="visible: isLocked ">
|
||||||
Mr Draw is in a locked state as it does not know its position.
|
Mr Beam is in a locked state as it does not know its position.
|
||||||
First remove any objects blocking the gantry's travel range.
|
First remove any objects blocking the gantry's travel range.
|
||||||
Then do a homing cycle.
|
Then do a homing cycle.
|
||||||
<div style='text-align: center; padding:.5em;'>
|
<div style='text-align: center; padding:.5em;'>
|
||||||
|
|
@ -123,10 +123,6 @@
|
||||||
<div class="distance">
|
<div class="distance">
|
||||||
<input type="text" id="jogDistance" />
|
<input type="text" id="jogDistance" />
|
||||||
</div>
|
</div>
|
||||||
<div class="input-append manual_position_input">
|
|
||||||
<input id="manual_position" placeholder="x.xx y.yy" onsubmit="manualPosition"/>
|
|
||||||
<button class="" data-bind="click: manualPosition">Go</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -172,19 +168,6 @@
|
||||||
<input id="feedrate_override_slider" type="text" data-bind="sliderValue: feedrateOverride">
|
<input id="feedrate_override_slider" type="text" data-bind="sliderValue: feedrateOverride">
|
||||||
<span data-bind="text:feedrateOverride()">100</span>% Feedrate
|
<span data-bind="text:feedrateOverride()">100</span>% Feedrate
|
||||||
</div>
|
</div>
|
||||||
<div class="repeatGcode">
|
|
||||||
<div class="btn-group">
|
|
||||||
<button type="button" class="btn btn-default btn-number" data-bind="enable: numberOfPasses() > 1, click:decreasePasses">
|
|
||||||
<span class="icon-minus"></span>
|
|
||||||
</button>
|
|
||||||
<input type="text" class="input-mini text-right" value="1" min="1" max="10" data-bind="value:numberOfPasses()">
|
|
||||||
<button type="button" class="btn btn-default btn-number" data-bind="click:increasePasses">
|
|
||||||
<span class="icon-plus"></span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<span>Passes</span>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- {{ _('Print Time') }}: <strong data-bind="text: printTimeString"></strong><br>
|
<!-- {{ _('Print Time') }}: <strong data-bind="text: printTimeString"></strong><br>
|
||||||
|
|
@ -299,54 +282,70 @@
|
||||||
<!-- end sidebar -->
|
<!-- end sidebar -->
|
||||||
|
|
||||||
<div class="span8">
|
<div class="span8">
|
||||||
<svg id="area_preview" class="workingarea"
|
<div style="position:relative">
|
||||||
data-bind="style: {
|
{% if webcamStream %}
|
||||||
backgroundPosition: crosshairX()+'px'+' '+crosshairY()+'px',
|
<div id="webcam_container" tabindex="0"
|
||||||
width: workingAreaWidthPx()+'px',
|
style="position:absolute; top:0;left:0"
|
||||||
height: workingAreaHeightPx()+'px'
|
data-bind="style: {
|
||||||
}
|
width: workingAreaWidthPx()+'px'
|
||||||
">
|
}">
|
||||||
<filter id="grayscale_filter">
|
<div id="webcam_rotator" data-bind="css: { rotate90: settings.webcam_rotate90() }">
|
||||||
<feColorMatrix in="SourceGraphic" type="saturate" values="0"/>
|
<img id="webcam_image"
|
||||||
</filter>
|
data-bind="css: { flipH: settings.webcam_flipH(), flipV: settings.webcam_flipV() },
|
||||||
<filter id="gcimage_preview">
|
style: {
|
||||||
<feComponentTransfer>
|
width: workingAreaWidthPx()+'px',
|
||||||
<feFuncR type="table" tableValues="1"></feFuncR>
|
}"/>
|
||||||
<feFuncG type="table" tableValues="0.2 1"></feFuncG>
|
</div>
|
||||||
<feFuncB type="table" tableValues="0.2 1"></feFuncB>
|
</div>
|
||||||
</feComponentTransfer>
|
{% endif %}
|
||||||
</filter>
|
<svg id="area_preview" class="workingarea"
|
||||||
<g id="scaleGroup" data-bind="attr: { transform: scaleMatrix() }">
|
data-bind="style: {
|
||||||
|
backgroundPosition: crosshairX()+'px'+' '+crosshairY()+'px',
|
||||||
<text
|
width: workingAreaWidthPx()+'px',
|
||||||
xml:space="preserve"
|
height: workingAreaHeightPx()+'px'
|
||||||
data-bind="visible: working_area_empty"
|
}
|
||||||
style="font-size:64px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#DDDDDD;fill-opacity:1;stroke:none;font-family:DIN-BoldAlternate, Helvetica, Arial, Sans-serif;"
|
">
|
||||||
x="396.81018"
|
<filter id="grayscale_filter">
|
||||||
y="552.36218"
|
<feColorMatrix in="SourceGraphic" type="saturate" values="0"/>
|
||||||
id="add_designs_hint"
|
</filter>
|
||||||
>
|
<filter id="gcimage_preview">
|
||||||
<tspan
|
<feComponentTransfer>
|
||||||
id="tspan2987" x="368.571426" y="532.36218"
|
<feFuncR type="table" tableValues="1"></feFuncR>
|
||||||
style="text-anchor:middle;text-align:center">add designs via </tspan>
|
<feFuncG type="table" tableValues="0.2 1"></feFuncG>
|
||||||
<tspan
|
<feFuncB type="table" tableValues="0.2 1"></feFuncB>
|
||||||
x="500" y="592.36218" id="tspan2989"
|
</feComponentTransfer>
|
||||||
style="text-anchor:middle;text-align:center">the design library </tspan>
|
</filter>
|
||||||
<tspan
|
<g id="scaleGroup" data-bind="attr: { transform: scaleMatrix() }">
|
||||||
x="568.571426" y="652.36218" id="tspan2993"
|
|
||||||
style="text-anchor:middle;text-align:center">or drag 'n' drop </tspan>
|
|
||||||
<tspan
|
|
||||||
x="368.571426" y="712.36218" id="tspan2991"
|
|
||||||
style="text-anchor:middle;text-align:center" /></text>
|
|
||||||
<g id="placedGcodes" data-bind="visible: !state.isPrinting() && !state.isPaused(), attr: { transform: scaleMatrixMMtoDisplay() }"></g>
|
|
||||||
<g id="gCodePreview" data-bind="visible: state.isPrinting() || state.isPaused(), attr: { transform: scaleMatrixMMtoDisplay() }"></g>
|
|
||||||
<rect data-bind="click: move_laser"
|
|
||||||
id="coordGrid" x="0" y="0" width="0" height="0"
|
|
||||||
stroke="none" fill="none"></rect>
|
|
||||||
<g id="userContent" data-bind="visible: !state.isPrinting() && !state.isPaused()"></g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
|
<text
|
||||||
|
xml:space="preserve"
|
||||||
|
data-bind="visible: working_area_empty"
|
||||||
|
style="font-size:64px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#DDDDDD;fill-opacity:1;stroke:none;font-family:DIN-BoldAlternate, Helvetica, Arial, Sans-serif;"
|
||||||
|
x="396.81018"
|
||||||
|
y="552.36218"
|
||||||
|
id="add_designs_hint"
|
||||||
|
>
|
||||||
|
<tspan
|
||||||
|
id="tspan2987" x="368.571426" y="532.36218"
|
||||||
|
style="text-anchor:middle;text-align:center">add designs via </tspan>
|
||||||
|
<tspan
|
||||||
|
x="500" y="592.36218" id="tspan2989"
|
||||||
|
style="text-anchor:middle;text-align:center">the design library </tspan>
|
||||||
|
<tspan
|
||||||
|
x="568.571426" y="652.36218" id="tspan2993"
|
||||||
|
style="text-anchor:middle;text-align:center">or drag 'n' drop </tspan>
|
||||||
|
<tspan
|
||||||
|
x="368.571426" y="712.36218" id="tspan2991"
|
||||||
|
style="text-anchor:middle;text-align:center" /></text>
|
||||||
|
<g id="placedGcodes" data-bind="visible: !state.isPrinting() && !state.isPaused(), attr: { transform: scaleMatrixMMtoDisplay() }"></g>
|
||||||
|
<g id="gCodePreview" data-bind="visible: state.isPrinting() || state.isPaused(), attr: { transform: scaleMatrixMMtoDisplay() }"></g>
|
||||||
|
<rect data-bind="click: move_laser"
|
||||||
|
id="coordGrid" x="0" y="0" width="0" height="0"
|
||||||
|
stroke="none" fill="none"></rect>
|
||||||
|
<g id="userContent" data-bind="visible: !state.isPrinting() && !state.isPaused()"></g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -657,10 +656,12 @@
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<ul class="focus_steps">
|
<ul class="focus_steps">
|
||||||
<li>1. Place your material on the working area</li>
|
<li>1. Place your material on the working area</li>
|
||||||
<li>2. Move the pen over the material</li>
|
<li>2. Move the laser over the material</li>
|
||||||
<li>→ Now enable the pen calibration mode</li>
|
<li>3. Put on your safety glasses</li>
|
||||||
<li>5. Adjust the pen until it touches the paper</li>
|
<li>4. Turn the laser safety switch to on</li>
|
||||||
<li>→ Disable the pen calibration mode. </li>
|
<li>→ Now enable the focus mode</li>
|
||||||
|
<li>5. Adjust the focus until the laser beam is as small as possible</li>
|
||||||
|
<li>→ Disable the focus mode. </li>
|
||||||
</ul>
|
</ul>
|
||||||
<div style="text-align:center">
|
<div style="text-align:center">
|
||||||
<div class="btn-group" role="group" aria-label="focus mode control" style="">
|
<div class="btn-group" role="group" aria-label="focus mode control" style="">
|
||||||
|
|
|
||||||
|
|
@ -568,8 +568,8 @@ msgstr ""
|
||||||
"aktualisiert werden."
|
"aktualisiert werden."
|
||||||
|
|
||||||
#: src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js:131
|
#: src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js:131
|
||||||
msgid "Mr Beam Update Available"
|
msgid "Update Available"
|
||||||
msgstr "Mr Beam Aktualisierung verfügbar"
|
msgstr "Aktualisierung verfügbar"
|
||||||
|
|
||||||
#: src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js:143
|
#: src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js:143
|
||||||
msgid "Ignore"
|
msgid "Ignore"
|
||||||
|
|
|
||||||
|
|
@ -84,11 +84,9 @@ class MachineCom(object):
|
||||||
self._actual_intensity = None
|
self._actual_intensity = None
|
||||||
self._feedrate_dict = {}
|
self._feedrate_dict = {}
|
||||||
self._intensity_dict = {}
|
self._intensity_dict = {}
|
||||||
self._passes = 1
|
|
||||||
self._finished_passes = 0
|
|
||||||
|
|
||||||
# regular expressions
|
# regular expressions
|
||||||
self._regex_command = re.compile("^\s*\$?([GM]\d+|[THX])")
|
self._regex_command = re.compile("^\s*\$?([GM]\d+|[TH])")
|
||||||
self._regex_feedrate = re.compile("F\d+", re.IGNORECASE)
|
self._regex_feedrate = re.compile("F\d+", re.IGNORECASE)
|
||||||
self._regex_intensity = re.compile("S\d+", re.IGNORECASE)
|
self._regex_intensity = re.compile("S\d+", re.IGNORECASE)
|
||||||
|
|
||||||
|
|
@ -147,7 +145,7 @@ class MachineCom(object):
|
||||||
elif line.startswith('['): # feedback message
|
elif line.startswith('['): # feedback message
|
||||||
self._handle_feedback_message(line)
|
self._handle_feedback_message(line)
|
||||||
elif line.startswith('Grb'): # Grbl startup message
|
elif line.startswith('Grb'): # Grbl startup message
|
||||||
self._handle_startup_message(line)
|
self._handle_startup_message()
|
||||||
except:
|
except:
|
||||||
self._logger.exception("Something crashed inside the monitoring loop, please report this to Mr. Beam")
|
self._logger.exception("Something crashed inside the monitoring loop, please report this to Mr. Beam")
|
||||||
errorMsg = "See octoprint.log for details"
|
errorMsg = "See octoprint.log for details"
|
||||||
|
|
@ -166,15 +164,8 @@ class MachineCom(object):
|
||||||
if cmd is not None:
|
if cmd is not None:
|
||||||
self.sendCommand(cmd)
|
self.sendCommand(cmd)
|
||||||
self._callback.on_comm_progress()
|
self._callback.on_comm_progress()
|
||||||
else:
|
elif len(self._acc_line_buffer) == 0:
|
||||||
if self._finished_passes >= self._passes:
|
self._set_print_finished()
|
||||||
if len(self._acc_line_buffer) == 0:
|
|
||||||
self._set_print_finished()
|
|
||||||
self._currentFile.resetToBeginning()
|
|
||||||
cmd = self._getNext()
|
|
||||||
if cmd is not None:
|
|
||||||
self.sendCommand(cmd)
|
|
||||||
self._callback.on_comm_progress()
|
|
||||||
|
|
||||||
self._sendCommand()
|
self._sendCommand()
|
||||||
self._send_event.wait(1)
|
self._send_event.wait(1)
|
||||||
|
|
@ -320,9 +311,7 @@ class MachineCom(object):
|
||||||
if self._finished_currentFile is False:
|
if self._finished_currentFile is False:
|
||||||
line = self._currentFile.getNext()
|
line = self._currentFile.getNext()
|
||||||
if line is None:
|
if line is None:
|
||||||
self._finished_passes += 1
|
self._finished_currentFile = True
|
||||||
if self._finished_passes >= self._passes:
|
|
||||||
self._finished_currentFile = True
|
|
||||||
return line
|
return line
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
@ -405,7 +394,7 @@ class MachineCom(object):
|
||||||
elif line[1:].startswith('Dis'): # [Disabled]
|
elif line[1:].startswith('Dis'): # [Disabled]
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def _handle_startup_message(self, line):
|
def _handle_startup_message(self):
|
||||||
if self.isOperational():
|
if self.isOperational():
|
||||||
errorMsg = "Machine reset."
|
errorMsg = "Machine reset."
|
||||||
self._cmd = None
|
self._cmd = None
|
||||||
|
|
@ -420,14 +409,7 @@ class MachineCom(object):
|
||||||
self._changeState(self.STATE_LOCKED)
|
self._changeState(self.STATE_LOCKED)
|
||||||
eventManager().fire(Events.ERROR, {"error": self.getErrorString()})
|
eventManager().fire(Events.ERROR, {"error": self.getErrorString()})
|
||||||
else:
|
else:
|
||||||
versionMatch = re.search("Grbl (?P<grbl>.+?)(_(?P<git>[0-9a-f]{7})(?P<dirty>-dirty)?)? \[.+\]", line)
|
self._onConnected(self.STATE_LOCKED)
|
||||||
if versionMatch:
|
|
||||||
versionDict = versionMatch.groupdict()
|
|
||||||
self._writeGrblVersionToFile(versionDict)
|
|
||||||
if self._compareGrblVersion(versionDict) is False:
|
|
||||||
self._flashGrbl()
|
|
||||||
else:
|
|
||||||
self._onConnected(self.STATE_LOCKED)
|
|
||||||
|
|
||||||
def _update_grbl_pos(self, line):
|
def _update_grbl_pos(self, line):
|
||||||
# line example:
|
# line example:
|
||||||
|
|
@ -618,7 +600,7 @@ class MachineCom(object):
|
||||||
params = ["avrdude", "-patmega328p", "-carduino", "-b" + str(self._baudrate), "-P" + str(self._port), "-D", "-Uflash:w:" + pathToGrblHex]
|
params = ["avrdude", "-patmega328p", "-carduino", "-b" + str(self._baudrate), "-P" + str(self._port), "-D", "-Uflash:w:" + pathToGrblHex]
|
||||||
rc = subprocesscall(params)
|
rc = subprocesscall(params)
|
||||||
|
|
||||||
if rc == 0:
|
if rc is False:
|
||||||
self._log("successfully flashed new grbl version")
|
self._log("successfully flashed new grbl version")
|
||||||
self._openSerial()
|
self._openSerial()
|
||||||
self._changeState(self.STATE_CONNECTING)
|
self._changeState(self.STATE_CONNECTING)
|
||||||
|
|
@ -755,10 +737,6 @@ class MachineCom(object):
|
||||||
self._changeState(self.STATE_HOMING)
|
self._changeState(self.STATE_HOMING)
|
||||||
return cmd
|
return cmd
|
||||||
|
|
||||||
def _gcode_X_sent(self, cmd, cmd_type=None):
|
|
||||||
self._changeState(self.STATE_HOMING) # TODO: maybe change to seperate $X mode
|
|
||||||
return cmd
|
|
||||||
|
|
||||||
def _gcode_Hold_sent(self, cmd, cmd_type=None):
|
def _gcode_Hold_sent(self, cmd, cmd_type=None):
|
||||||
self._changeState(self.STATE_PAUSED)
|
self._changeState(self.STATE_PAUSED)
|
||||||
return cmd
|
return cmd
|
||||||
|
|
@ -846,12 +824,6 @@ class MachineCom(object):
|
||||||
if self._currentFile is None:
|
if self._currentFile is None:
|
||||||
raise ValueError("No file selected for printing")
|
raise ValueError("No file selected for printing")
|
||||||
|
|
||||||
# reset feedrate and intesity factor in case they where changed in a previous run
|
|
||||||
self._feedrate_factor = 1
|
|
||||||
self._intensity_factor = 1
|
|
||||||
self._passes = 1
|
|
||||||
self._finished_passes = 0
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# ensure fan is on whatever gcode follows.
|
# ensure fan is on whatever gcode follows.
|
||||||
self.sendCommand("M08")
|
self.sendCommand("M08")
|
||||||
|
|
@ -921,14 +893,6 @@ class MachineCom(object):
|
||||||
self._send_event.set()
|
self._send_event.set()
|
||||||
eventManager().fire(Events.PRINT_PAUSED, payload)
|
eventManager().fire(Events.PRINT_PAUSED, payload)
|
||||||
|
|
||||||
def increasePasses(self):
|
|
||||||
self._passes += 1
|
|
||||||
self._log("increased Passes to %d" % self._passes)
|
|
||||||
|
|
||||||
def degreasePasses(self):
|
|
||||||
self._passes -= 1
|
|
||||||
self._log("degrease Passes to %d" % self._passes)
|
|
||||||
|
|
||||||
def getStateString(self):
|
def getStateString(self):
|
||||||
if self._state == self.STATE_NONE:
|
if self._state == self.STATE_NONE:
|
||||||
return "Offline"
|
return "Offline"
|
||||||
|
|
@ -1169,9 +1133,6 @@ class PrintingGcodeFileInformation(PrintingFileInformation):
|
||||||
|
|
||||||
if not os.path.exists(self._filename) or not os.path.isfile(self._filename):
|
if not os.path.exists(self._filename) or not os.path.isfile(self._filename):
|
||||||
raise IOError("File %s does not exist" % self._filename)
|
raise IOError("File %s does not exist" % self._filename)
|
||||||
|
|
||||||
self._stripCommments()
|
|
||||||
|
|
||||||
self._size = os.stat(self._filename).st_size
|
self._size = os.stat(self._filename).st_size
|
||||||
self._pos = 0
|
self._pos = 0
|
||||||
|
|
||||||
|
|
@ -1194,12 +1155,6 @@ class PrintingGcodeFileInformation(PrintingFileInformation):
|
||||||
pass
|
pass
|
||||||
self._handle = None
|
self._handle = None
|
||||||
|
|
||||||
def resetToBeginning(self):
|
|
||||||
"""
|
|
||||||
resets the file handle so you can read from the beginning again.
|
|
||||||
"""
|
|
||||||
self._handle = open(self._filename, "r")
|
|
||||||
|
|
||||||
def getNext(self):
|
def getNext(self):
|
||||||
"""
|
"""
|
||||||
Retrieves the next line for printing.
|
Retrieves the next line for printing.
|
||||||
|
|
@ -1225,16 +1180,6 @@ class PrintingGcodeFileInformation(PrintingFileInformation):
|
||||||
self._logger.exception("Exception while processing line")
|
self._logger.exception("Exception while processing line")
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
def _stripCommments(self):
|
|
||||||
dir = os.path.dirname(os.path.abspath(self._filename))
|
|
||||||
tmpfile = open(dir + '/gcode.tmp', 'w')
|
|
||||||
with open(self._filename, "r") as fileobject:
|
|
||||||
for line in fileobject:
|
|
||||||
if process_gcode_line(line) is not None:
|
|
||||||
tmpfile.write(line)
|
|
||||||
tmpfile.close()
|
|
||||||
self._filename = dir + '/gcode.tmp'
|
|
||||||
|
|
||||||
def convert_pause_triggers(configured_triggers):
|
def convert_pause_triggers(configured_triggers):
|
||||||
triggers = {
|
triggers = {
|
||||||
"enable": [],
|
"enable": [],
|
||||||
|
|
@ -1299,7 +1244,6 @@ def serialList():
|
||||||
baselist = baselist \
|
baselist = baselist \
|
||||||
+ glob.glob("/dev/ttyUSB*") \
|
+ glob.glob("/dev/ttyUSB*") \
|
||||||
+ glob.glob("/dev/ttyACM*") \
|
+ glob.glob("/dev/ttyACM*") \
|
||||||
+ glob.glob("/dev/ttyAMA*") \
|
|
||||||
+ glob.glob("/dev/tty.usb*") \
|
+ glob.glob("/dev/tty.usb*") \
|
||||||
+ glob.glob("/dev/cu.*") \
|
+ glob.glob("/dev/cu.*") \
|
||||||
+ glob.glob("/dev/cuaU*") \
|
+ glob.glob("/dev/cuaU*") \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue