From b978b5ada57ce1e6dfdb5a78957b557a3eee774f Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Thu, 17 Oct 2013 14:40:33 +0200 Subject: [PATCH] Integrated progressbar --- js/buttonbehaviors.js | 9 +++------ js/main.js | 8 +++----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/js/buttonbehaviors.js b/js/buttonbehaviors.js index 1a97e3b..c604b38 100644 --- a/js/buttonbehaviors.js +++ b/js/buttonbehaviors.js @@ -12,7 +12,6 @@ var btnOops, btnStop, btnClear; var btnMoveUp, btnMoveDown, btnTwistLeft, btnTwistRight; var btnInfo, btnSettings; //var btnDebug; // debug -var displayTemp, displayProgress; var state; var prevState; @@ -35,8 +34,6 @@ function initButtonBehavior() { btnNew = $(".btnNew"); btnPrint= $(".btnPrint"); btnStop = $(".btnStop"); - displayTemp = $("#thermometerContainer"); - displayProgress = $("#printProgressContainer"); btnPrevious = $(".btnPrevious"); btnNext = $(".btnNext"); @@ -317,7 +314,7 @@ function update() { setState(printer.state,printer.hasControl); thermometer.update(printer.temperature, printer.targetTemperature); - //TODO: update progress + progressbar.update(printer.currentLine, printer.totalLines); } function setState(newState,newHasControl) { //TODO add hasControl @@ -362,10 +359,10 @@ function setState(newState,newHasControl) { //TODO add hasControl // progress indicator switch(newState) { case Printer.PRINTING_STATE: - displayProgress.show(); // TODO: Show progress + progressbar.show(); break; default: - displayProgress.hide(); // TODO: hide progress + progressbar.hide(); break; } diff --git a/js/main.js b/js/main.js index 2fcf0ff..af4f505 100644 --- a/js/main.js +++ b/js/main.js @@ -53,8 +53,6 @@ $(function() { initVerticalShapes(); thermometer.init($("#thermometerCanvas"), $("#thermometerContainer")); - - progressbar = new Progressbar(); progressbar.init($("#progressbarCanvas"), $("#progressbarCanvasContainer")); @@ -98,10 +96,10 @@ $(function() { }, 1000); //*/ } - showhideInterval = setInterval(showOrHideThermo, 2500); + //showhideInterval = setInterval(showOrHideThermo, 2500); }); -var showhideInterval; +/*var showhideInterval; var showOrHide = false; function showOrHideThermo() { @@ -115,7 +113,7 @@ function showOrHideThermo() { } showOrHide = !showOrHide; -} +}*/ function settingsLoaded() { console.log("settingsLoaded");