From 3a11106535f6f50a738a9ffc0507a29d768d3b61 Mon Sep 17 00:00:00 2001 From: Adriaan Wormgoor Date: Sat, 7 Sep 2013 17:08:52 +0200 Subject: [PATCH] code for new printprogressmeter and new thermometer --- js/Printer.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/js/Printer.js b/js/Printer.js index d27ea8f..0d0467e 100644 --- a/js/Printer.js +++ b/js/Printer.js @@ -1,3 +1,28 @@ +var $printProgressContainer = $("#printProgressContainer"); +var $progressbar = $("#progressbar"); +var $progressAmount = $(".progressAmount"); +function setPrintprogress(val) { + if (isNaN(val)) return; +// console.log("f:setPrintprogress() >> val " + val); + $progressbar.css("width", val*100 + "%"); + $progressAmount.text(Math.floor(val*100) + "%"); +} + +var thermoVal = 0; +var thermocounter = 0; +var $displayThermometer = $("#thermometerContainer"); +var $thermometer = $("#thermometer"); +//var thermoInterval; +function updateThermometer(curr, targ) { + console.log("f:updateThermometer() >> curr temp " + curr + ", targ temp " + targ); + if (isNaN(curr) || isNaN(targ)) return; + + $thermometer.css("height", (curr/targ)*100 + "%"); + // $thermometer.css("background-position", -val*100 + "%"); + $(".thermoAmount").text(curr+"/"+targ); +} + + function Printer() { this.temperature = 0; this.targetTemperature = 0;