0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-12-22 13:13:48 +01:00

Display send percentage in status message #126

This commit is contained in:
peteruithoven 2013-12-19 17:33:06 +01:00
parent 8222591041
commit f0492e9246
2 changed files with 25 additions and 21 deletions

View File

@ -14,29 +14,29 @@ function Message() {
var autohideTimeout;
this.init = function($element) {
console.log("Message:init");
this.$element = $element;
console.log("$element: ",$element);
}
this.set = function(text,mode,autoHide) {
console.log("Message:set: ",text,mode,autoHide);
self.hide(function() {
self.show();
self.clear();
self.$element.text(text);
self.$element.addClass(mode);
self.show();
self.mode = mode;
clearTimeout(autohideTimeout);
if(autoHide) {
autohideTimeout = setTimeout(function(){ self.hide()},autoHideDelay);
}
});
this.set = function(text,mode,autoHide,disableEffect) {
console.log("Message:set: ",text,mode,autoHide,disableEffect);
if(disableEffect) {
self.fill(text,mode,autoHide)
} else{
self.hide(function() {
self.show();
self.fill(text,mode,autoHide)
});
}
}
this.fill = function(text,mode,autoHide) {
//console.log("Message:fill: ",text,mode,autoHide);
self.clear();
self.$element.text(text);
self.$element.addClass(mode);
self.mode = mode;
clearTimeout(autohideTimeout);
if(autoHide) {
autohideTimeout = setTimeout(function(){ self.hide()},autoHideDelay);
}
}
this.clear = function($element) {
this.$element.text("");

View File

@ -144,6 +144,10 @@ function Printer() {
this.sendPrintPart = function(sendIndex,sendLength) {
console.log("Printer:sendPrintPart sendIndex: " + sendIndex + "/" + this.gcode.length + ", sendLength: " + sendLength);
var sendPercentage = Math.round(sendIndex/this.gcode.length*100);
message.set("Sending doodle to printer: "+sendPercentage+"%",Message.NOTICE,false,true);
var firstOne = (sendIndex == 0)? true : false;
var start = firstOne; // start printing right away