From f7bcd6e7c447e0dfcf871a2299e7d8397baa37b9 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 23 Oct 2013 12:16:39 +0200 Subject: [PATCH 1/6] Spelling correction --- js_src/Printer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js_src/Printer.js b/js_src/Printer.js index 5cf9e78..3f344b5 100644 --- a/js_src/Printer.js +++ b/js_src/Printer.js @@ -159,7 +159,7 @@ function Printer() { this.gcode = []; btnStop.css("display","block"); // hack self.removeLeaveWarning(); - message.set("Doodle is send to printer...",Message.INFO,true); + message.set("Doodle is sent to printer...",Message.INFO,true); //self.targetTemperature = settings["printer.temperature"]; // slight hack } else { // only if the state hasn't bin changed (by for example pressing stop) we send more gcode From cc2bcf962c5ff5f6ed2ece2a453ee0aed23a0956 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 23 Oct 2013 12:45:41 +0200 Subject: [PATCH 2/6] Prevent preheat while buffering/printing/stopping --- js_src/Printer.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js_src/Printer.js b/js_src/Printer.js index 3f344b5..45066b7 100644 --- a/js_src/Printer.js +++ b/js_src/Printer.js @@ -70,6 +70,13 @@ function Printer() { this.preheat = function() { console.log("Printer:preheat"); + + if( this.state == Printer.BUFFERING_STATE || + this.state == Printer.PRINTING_STATE || + this.state == Printer.STOPPING_STATE) { + return; + } + var self = this; if (communicateWithWifibox) { $.ajax({ From 11c176407400220cf7068f1ac4628725a42219bc Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 23 Oct 2013 15:32:28 +0200 Subject: [PATCH 3/6] Settings validation messages are properly cleared --- js_src/SettingsWindow.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/js_src/SettingsWindow.js b/js_src/SettingsWindow.js index 9eb7191..c345fcf 100644 --- a/js_src/SettingsWindow.js +++ b/js_src/SettingsWindow.js @@ -245,16 +245,13 @@ function SettingsWindow() { } this.displayValidationError = function(key,msg) { var formElement = self.form.find("[name|='"+key+"']"); - console.log("formElement: ",formElement); formElement.addClass("error"); var errorMsg = "

"+msg+"

" formElement.after(errorMsg); } this.clearValidationErrors = function() { - var formElements = self.form.find(".error"); - formElements.each( function(index,element) { - $(element).removeClass("error"); - }); + self.form.find(".errorMsg").remove(); + self.form.find(".error").removeClass("error"); } this.readForm = function() { From 580b0ef33e7a52e1fb8ad1631ce3fbcde9e2c613 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 23 Oct 2013 15:33:10 +0200 Subject: [PATCH 4/6] Messages auto hide after 2 > 5 seconds --- js_src/Message.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js_src/Message.js b/js_src/Message.js index dc3cab3..54c347e 100644 --- a/js_src/Message.js +++ b/js_src/Message.js @@ -10,7 +10,7 @@ function Message() { this.$element; var self = this; - var autoHideDelay = 2000; + var autoHideDelay = 5000; var autohideTimeout; this.init = function($element) { From 2b319c5dd6dda12394283cb9d8484dbbf14a88fc Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 23 Oct 2013 16:45:24 +0200 Subject: [PATCH 5/6] Also showing warning when gcode file is to big --- js_src/Printer.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js_src/Printer.js b/js_src/Printer.js index 45066b7..5e245c9 100644 --- a/js_src/Printer.js +++ b/js_src/Printer.js @@ -46,7 +46,7 @@ function Printer() { this.retryStopDelay; // retry setTimout instance this.retryPreheatDelay; // retry setTimout instance - this.maxGCodeSize = 10; // max size of gcode in MB's (estimation) + Printer.MAX_GCODE_SIZE = 10; // max size of gcode in MB's (estimation) this.stateOverruled = false; @@ -121,7 +121,8 @@ function Printer() { var gcodeSize = gcodeLineSize*gcode.length/1024/1024; // estimate gcode size in MB's console.log(" gcodeSize: ",gcodeSize); - if(gcodeSize > this.maxGCodeSize) { + if(gcodeSize > Printer.MAX_GCODE_SIZE) { + alert("Error: Printer:print: gcode file is probably to big ("+gcodeSize+"MB) (max: "+this.maxGCodeSize+"MB)"); console.log("Error: Printer:print: gcode file is probably to big ("+gcodeSize+"MB) (max: "+this.maxGCodeSize+"MB)"); return; } From 8bd62c93ec88d428715cedb24f8b9272e255d599 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 23 Oct 2013 16:45:41 +0200 Subject: [PATCH 6/6] Lowering max drawing complexity --- js_src/gcodeGenerating.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js_src/gcodeGenerating.js b/js_src/gcodeGenerating.js index 8cd3a4c..ca37665 100644 --- a/js_src/gcodeGenerating.js +++ b/js_src/gcodeGenerating.js @@ -25,7 +25,7 @@ gcodeEnd.push("G90"); // absolute positioning gcodeEnd.push("M117 Done "); // display message (20 characters to clear whole screen)*/ -var MAX_POINTS_TO_PRINT = 400000; //80000; //40000; +var MAX_POINTS_TO_PRINT = 200000; //400000; //80000; //40000; var gcode = []; function generate_gcode() { @@ -139,9 +139,11 @@ function generate_gcode() { //console.log(" pointsToPrint: ",pointsToPrint); //console.log(" MAX_POINTS_TO_PRINT: ",MAX_POINTS_TO_PRINT); + console.log("pointsToPrint: ",pointsToPrint); + if(pointsToPrint > MAX_POINTS_TO_PRINT) { alert("Sorry, your doodle to to complex and / or to high"); - console.log("WARNING: to many points to convert to gcode"); + console.log("ERROR: to many points to convert to gcode"); return []; }