From 2b319c5dd6dda12394283cb9d8484dbbf14a88fc Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 23 Oct 2013 16:45:24 +0200 Subject: [PATCH] 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; }