diff --git a/other-scripts/Steel-Gauges/web_server/RGraph.common.core.min.js b/other-scripts/Steel-Gauges/web_server/RGraph.common.core.min.js new file mode 100644 index 0000000..a269991 --- /dev/null +++ b/other-scripts/Steel-Gauges/web_server/RGraph.common.core.min.js @@ -0,0 +1 @@ +function pd(n){RGraph.pr(n)}function p(n){RGraph.pr(n)}function a(n){alert(n)}function cl(n){return console.log(n)}typeof RGraph=="undefined"&&(RGraph={isRGraph:!0,type:"common"}),RGraph.Registry={},RGraph.Registry.store=[],RGraph.Registry.store["chart.event.handlers"]=[],RGraph.Registry.store.__rgraph_event_listeners__=[],RGraph.background={},RGraph.objects=[],RGraph.Resizing={},RGraph.events=[],RGraph.cursor=[],RGraph.DOM2Events={},RGraph.ObjectRegistry={},RGraph.ObjectRegistry.objects={},RGraph.ObjectRegistry.objects.byUID=[],RGraph.ObjectRegistry.objects.byCanvasID=[],HALFPI=Math.PI/2,PI=Math.PI,TWOPI=PI*2,ISOPERA=navigator.userAgent.indexOf("Opera")!=-1,RGraph.getScale=function(n,t){var f,e,i,o,u,r;if(n==0)return["0.2","0.4","0.6","0.8","1.0"];if(f=n,n<=1){if(n>.5)return[.2,.4,.6,.8,Number(1).toFixed(1)];if(n>=.1)return t.Get("chart.scale.round")?[.2,.4,.6,.8,1]:[.1,.2,.3,.4,.5];for(e=n,i=0;e<1.01;)i+=1,e*=10;return o=["2e-"+i,"4e-"+i,"6e-"+i,"8e-"+i,"10e-"+i],n<="5e-"+i&&(o=["1e-"+i,"2e-"+i,"3e-"+i,"4e-"+i,"5e-"+i]),o}for(String(n).indexOf(".")>0&&(n=String(n).replace(/\.\d+$/,"")),u=Math.pow(10,Number(String(Number(n)).length-1)),r=u;rNumber(r)&&(r+=u/2),n<10&&(r=Number(f)<=5?5:10),t&&typeof t.Get("chart.scale.round")=="boolean"&&t.Get("chart.scale.round")&&(r=10*u),[r*.2,r*.4,r*.6,r*.8,r]},RGraph.array_max=function(n){var i=null,t,r;if(typeof n=="number")return n;for(t=0;tn.canvas.height-r?n.canvas.height-(r+i):40);if(t.stroke(),n.Get("chart.background.grid")){if(n.Get("chart.background.grid.autofit")&&(n.Get("chart.background.grid.autofit.align")&&(n.Set("chart.background.grid.autofit.numhlines",n.Get("chart.ylabels.count")),n.type=="line"?n.Get("chart.labels")&&n.Get("chart.labels").length?n.Set("chart.background.grid.autofit.numvlines",n.Get("chart.labels").length-1):n.Set("chart.background.grid.autofit.numvlines",n.data[0].length-1):n.type=="bar"&&n.Get("chart.labels")&&n.Get("chart.labels").length&&n.Set("chart.background.grid.autofit.numvlines",n.Get("chart.labels").length)),b=(n.canvas.width-u-o)/n.properties["chart.background.grid.autofit.numvlines"],k=(n.canvas.height-f-r)/n.properties["chart.background.grid.autofit.numhlines"],n.Set("chart.background.grid.vsize",b),n.Set("chart.background.grid.hsize",k)),t.beginPath(),t.lineWidth=n.Get("chart.background.grid.width")?n.Get("chart.background.grid.width"):1,t.strokeStyle=n.Get("chart.background.grid.color"),n.Get("chart.background.grid.hlines"))for(e=RGraph.GetHeight(n)-r,y=f;y=1&&(t+=31),i>=2&&(t+=28),r>=2008&&r%4==0&&(t+=1),i>=3&&(t+=31),i>=4&&(t+=30),i>=5&&(t+=31),i>=6&&(t+=30),i>=7&&(t+=31),i>=8&&(t+=31),i>=9&&(t+=30),i>=10&&(t+=31),i>=11&&(t+=30),t)},RGraph.array_clone=function(n){var i,t;if(n==null||typeof n!="object")return n;for(i=[],t=0;t0)return String(u+String(t)+s);for(t=String(t),t.indexOf(".")>0&&(h=t,t=t.replace(/\.(.*)/,""),f=h.replace(/(.*)\.(.*)/,"$2")),c=v,r=t.length-1,e=0;r>=0;e++,r--)l=t.charAt(r),e%3==0&&e!=0&&(i+=c),i+=l;for(o=i,i="",r=o.length-1;r>=0;r--)i+=o.charAt(r);return i.indexOf("-"+n.Get("chart.scale.thousand"))==0&&(i="-"+i.substr(("-"+n.Get("chart.scale.thousand")).length)),f.length&&(i=i+a+f,f="",RegExp.$1=""),i.charAt(0)=="-"&&(i=i.replace(/-/,""),u="-"+u),u+i+s},RGraph.DrawBars=function(n){var t=n.Get("chart.background.hbars"),f,e;for(n.context.beginPath(),i=0;in.max&&(t[i][1]=n.max-t[i][0]),Math.abs(t[i][1])>n.max&&(t[i][1]=-1*n.max),Math.abs(t[i][0])>n.max&&(t[i][0]=n.max),t[i][0]+t[i][1]<-1*n.max&&(t[i][1]=-1*(n.max+t[i][0])),n.Get("chart.xaxispos")=="bottom"&&(t[i][0]<0||t[i][1]+t[i][1]<0)&&alert("["+n.type.toUpperCase()+" (ID: "+n.id+") BACKGROUND HBARS] You have a negative value in one of your background hbars values, whilst the X axis is in the center"),f=n.grapharea-(t[i][0]-n.min)/(n.max-n.min)*n.grapharea,e=Math.min(t[i][1],n.max-t[i][0])/(n.max-n.min)*n.grapharea,n.Get("chart.xaxispos")=="center"&&(f/=2,e/=2),f+=n.Get("chart.gutter.top");var o=n.Get("chart.gutter.left"),r=f-e,s=n.canvas.width-n.Get("chart.gutter.left")-n.Get("chart.gutter.right"),u=e;navigator.userAgent.indexOf("Opera")!=-1&&n.Get("chart.xaxispos")=="center"&&u<0&&(u*=-1,r=r-u),n.Get("chart.xaxispos")=="top"&&(r=n.canvas.height-r,u*=-1),n.context.fillStyle=t[i][2],n.context.fillRect(o,r,s,u)}n.context.fill()},RGraph.DrawInGraphLabels=function(n){var a=n.canvas,i=n.context,c=n.Get("chart.labels.ingraph"),r=[],l,t,h,o,s;if(c){for(t=0;t0)for(t=0;t0)){var u=n.type=="bar"?h[0]+h[2]/2:h[0],f=n.type=="bar"?h[1]+h[3]/2:h[1],e=typeof r[t][4]=="number"?r[t][4]:25;i.beginPath(),i.fillStyle="black",i.strokeStyle="black",n.type=="bar"?(n.Get("chart.xaxispos")=="top"&&(e*=-1),n.Get("chart.variant")=="dot"?(i.moveTo(Math.round(u),n.coords[t][1]-5),i.lineTo(Math.round(u),n.coords[t][1]-5-e),o=Math.round(u),s=n.coords[t][1]-5-e):n.Get("chart.variant")=="arrow"?(i.moveTo(Math.round(u),n.coords[t][1]-5),i.lineTo(Math.round(u),n.coords[t][1]-5-e),o=Math.round(u),s=n.coords[t][1]-5-e):(i.arc(Math.round(u),f,2.5,0,6.28,0),i.moveTo(Math.round(u),f),i.lineTo(Math.round(u),f-e),o=Math.round(u),s=f-e),i.stroke(),i.fill()):n.type=="line"&&(typeof r[t]=="object"&&typeof r[t][3]=="number"&&r[t][3]==-1?(i.moveTo(Math.round(u),f+5),i.lineTo(Math.round(u),f+5+e),i.stroke(),i.beginPath(),i.moveTo(Math.round(u),f+5),i.lineTo(Math.round(u)-3,f+10),i.lineTo(Math.round(u)+3,f+10),i.closePath(),o=u,s=f+5+e):(o=u,s=f-5-e,i.moveTo(Math.round(u),f-5),i.lineTo(Math.round(u),f-5-e),i.stroke(),i.beginPath(),i.moveTo(Math.round(u),f-5),i.lineTo(Math.round(u)-3,f-10),i.lineTo(Math.round(u)+3,f-10),i.closePath()),i.fill()),i.beginPath(),i.fillStyle=typeof r[t]=="object"&&typeof r[t][1]=="string"?r[t][1]:"black",RGraph.Text(i,n.Get("chart.text.font"),n.Get("chart.text.size"),o,s,typeof r[t]=="object"&&typeof r[t][0]=="string"?r[t][0]:r[t],"bottom","center",!0,null,typeof r[t]=="object"&&typeof r[t][2]=="string"?r[t][2]:"white"),i.fill()}}},RGraph.FixEventObject=function(n){var n,t;return ISOLD&&(n=event,n.pageX=event.clientX+document.body.scrollLeft,n.pageY=event.clientY+document.body.scrollTop,n.target=event.srcElement,!document.body.scrollTop&&document.documentElement.scrollTop&&(n.pageX+=parseInt(document.documentElement.scrollLeft),n.pageY+=parseInt(document.documentElement.scrollTop))),typeof n.offsetX=="undefined"&&typeof n.offsetY=="undefined"&&(t=RGraph.getMouseXY(n),n.offsetX=t[0],n.offsetY=t[1]),n.stopPropagation||(n.stopPropagation=function(){window.event.cancelBubble=!0}),n},RGraph.HideCrosshairCoords=function(){var n=RGraph.Registry.Get("chart.coordinates.coords.div");n&&n.style.opacity==1&&n.__object__.Get("chart.crosshairs.coords.fadeout")&&(setTimeout(function(){RGraph.Registry.Get("chart.coordinates.coords.div").style.opacity=.9},50),setTimeout(function(){RGraph.Registry.Get("chart.coordinates.coords.div").style.opacity=.8},100),setTimeout(function(){RGraph.Registry.Get("chart.coordinates.coords.div").style.opacity=.7},150),setTimeout(function(){RGraph.Registry.Get("chart.coordinates.coords.div").style.opacity=.6},200),setTimeout(function(){RGraph.Registry.Get("chart.coordinates.coords.div").style.opacity=.5},250),setTimeout(function(){RGraph.Registry.Get("chart.coordinates.coords.div").style.opacity=.4},300),setTimeout(function(){RGraph.Registry.Get("chart.coordinates.coords.div").style.opacity=.3},350),setTimeout(function(){RGraph.Registry.Get("chart.coordinates.coords.div").style.opacity=.2},400),setTimeout(function(){RGraph.Registry.Get("chart.coordinates.coords.div").style.opacity=.1},450),setTimeout(function(){RGraph.Registry.Get("chart.coordinates.coords.div").style.opacity=0},500),setTimeout(function(){RGraph.Registry.Get("chart.coordinates.coords.div").style.display="none"},550))},RGraph.Draw3DAxes=function(n){var r=n.Get("chart.gutter.left"),f=n.Get("chart.gutter.right"),e=n.Get("chart.gutter.top"),u=n.Get("chart.gutter.bottom"),t=n.context,i=n.canvas;t.strokeStyle="#aaa",t.fillStyle="#ddd",t.beginPath(),t.moveTo(r,e),t.lineTo(r+10,e-5),t.lineTo(r+10,i.height-u-5),t.lineTo(r,i.height-u),t.closePath(),t.stroke(),t.fill(),t.beginPath(),t.moveTo(r,i.height-u),t.lineTo(r+10,i.height-u-5),t.lineTo(i.width-f+10,i.height-u-5),t.lineTo(i.width-f,i.height-u),t.closePath(),t.stroke(),t.fill()},RGraph.OldBrowserCompat=function(n){n&&(n.measureText||(n.measureText=function(n){var t=document.createElement("DIV"),i;return t.innerHTML=n,t.style.position="absolute",t.style.top="-100px",t.style.left=0,document.body.appendChild(t),i={width:t.offsetWidth},t.style.display="none",i}),n.fillText||(n.fillText=function(){return!1}),n.canvas.addEventListener||(window.addEventListener=function(n,t){return this.attachEvent("on"+n,t)},n.canvas.addEventListener=function(n,t){return this.attachEvent("on"+n,t)}))},RGraph.strokedCurvyRect=function(n,t,i,r,u){var f=arguments[5]?arguments[5]:3,e=arguments[6]||arguments[6]==null?!0:!1,o=arguments[7]||arguments[7]==null?!0:!1,s=arguments[8]||arguments[8]==null?!0:!1,h=arguments[9]||arguments[9]==null?!0:!1;n.beginPath(),n.moveTo(t+(e?f:0),i),n.lineTo(t+r-(o?f:0),i),o&&n.arc(t+r-f,i+f,f,PI+HALFPI,TWOPI,!1),n.lineTo(t+r,i+u-(s?f:0)),s&&n.arc(t+r-f,i-f+u,f,TWOPI,HALFPI,!1),n.lineTo(t+(h?f:0),i+u),h&&n.arc(t+f,i-f+u,f,HALFPI,PI,!1),n.lineTo(t,i+(e?f:0)),e&&n.arc(t+f,i+f,f,PI,PI+HALFPI,!1),n.stroke()},RGraph.filledCurvyRect=function(n,t,i,r,u){var f=arguments[5]?arguments[5]:3,e=arguments[6]||arguments[6]==null?!0:!1,o=arguments[7]||arguments[7]==null?!0:!1,s=arguments[8]||arguments[8]==null?!0:!1,h=arguments[9]||arguments[9]==null?!0:!1;n.beginPath(),e?(n.moveTo(t+f,i+f),n.arc(t+f,i+f,f,PI,PI+HALFPI,!1)):n.fillRect(t,i,f,f),o?(n.moveTo(t+r-f,i+f),n.arc(t+r-f,i+f,f,PI+HALFPI,0,!1)):(n.moveTo(t+r-f,i),n.fillRect(t+r-f,i,f,f)),s?(n.moveTo(t+r-f,i+u-f),n.arc(t+r-f,i-f+u,f,0,HALFPI,!1)):(n.moveTo(t+r-f,i+u-f),n.fillRect(t+r-f,i+u-f,f,f)),h?(n.moveTo(t+f,i+u-f),n.arc(t+f,i-f+u,f,HALFPI,PI,!1)):(n.moveTo(t,i+u-f),n.fillRect(t,i+u-f,f,f)),n.fillRect(t+f,i,r-f-f,u),n.fillRect(t,i+f,f+1,u-f-f),n.fillRect(t+r-f-1,i+f,f+1,u-f-f),n.fill()},RGraph.HideZoomedCanvas=function(){var t=15,i=10,n,r;if(typeof __zoomedimage__=="object")obj=__zoomedimage__.obj;else return;if(obj.Get("chart.zoom.fade.out")){for(n=i,r=1;n>=0;--n,++r)typeof __zoomedimage__=="object"&&setTimeout("__zoomedimage__.style.opacity = "+String(n/10),r*t);typeof __zoomedbackground__=="object"&&setTimeout("__zoomedbackground__.style.opacity = "+String(n/i),r*t)}typeof __zoomedimage__=="object"&&setTimeout("__zoomedimage__.style.display = 'none'",obj.Get("chart.zoom.fade.out")?i*t+10:0),typeof __zoomedbackground__=="object"&&setTimeout("__zoomedbackground__.style.display = 'none'",obj.Get("chart.zoom.fade.out")?i*t+10:0)},RGraph.AddCustomEventListener=function(n,t,i){return typeof RGraph.events[n.uid]=="undefined"&&(RGraph.events[n.uid]=[]),RGraph.events[n.uid].push([n,t,i]),RGraph.events[n.uid].length-1},RGraph.FireCustomEvent=function(n,t){var i,r;if(n&&n.isRGraph&&(n[t]&&n[t](n),i=n.uid,typeof i=="string"&&typeof RGraph.events=="object"&&typeof RGraph.events[i]=="object"&&RGraph.events[i].length>0))for(r=0;rr.length?n.Get("chart.labels")[i]:r;return n.context.font=n.Get("chart.text.size")+"pt "+n.Get("chart.text.font"),f=n.context.measureText(r).width+5,n.type=="hbar"?f/3:f},RGraph.SetConfig=function(n,t){for(i in t)typeof i=="string"&&n.Set(i,t[i]);return n},RGraph.RemoveAllCustomEventListeners=function(){var n=arguments[0];n&&RGraph.events[n]?RGraph.events[n]=[]:RGraph.events=[]},RGraph.RemoveCustomEventListener=function(n,t){typeof RGraph.events=="object"&&typeof RGraph.events[n.id]=="object"&&typeof RGraph.events[n.id][t]=="object"&&(RGraph.events[n.id][t]=null)},RGraph.DrawBackgroundImage=function(n){var t,i,r;if(typeof n.Get("chart.background.image")=="string"){typeof n.canvas.__rgraph_background_image__=="undefined"?(t=new Image,t.__object__=n,t.__canvas__=n.canvas,t.__context__=n.context,t.src=n.Get("chart.background.image"),n.canvas.__rgraph_background_image__=t):t=n.canvas.__rgraph_background_image__,t.onload=function(){n.__rgraph_background_image_loaded__=!0,RGraph.Clear(n.canvas),RGraph.RedrawCanvas(n.canvas)};var u=n.Get("chart.gutter.left"),o=n.Get("chart.gutter.right"),f=n.Get("chart.gutter.top"),s=n.Get("chart.gutter.bottom"),h=n.Get("chart.background.image.stretch"),e=n.Get("chart.background.image.align");typeof e=="string"?(i=e.indexOf("right")!=-1?n.canvas.width-t.width-o:u,r=e.indexOf("bottom")!=-1?n.canvas.height-t.height-s:f):(i=u,r=f);var i=typeof n.Get("chart.background.image.x")=="number"?n.Get("chart.background.image.x"):i,r=typeof n.Get("chart.background.image.y")=="number"?n.Get("chart.background.image.y"):r,c=h?n.canvas.width-u-o:t.width,l=h?n.canvas.height-f-s:t.height;typeof n.Get("chart.background.image.w")=="number"&&(c=n.Get("chart.background.image.w")),typeof n.Get("chart.background.image.h")=="number"&&(l=n.Get("chart.background.image.h")),n.context.drawImage(t,i,r,c,l)}},RGraph.hasTooltips=function(n){if(typeof n.Get("chart.tooltips")=="object"&&n.Get("chart.tooltips")){for(var t=0;t=0;--t)if(i=r[t].getObjectByXY(n),i)return i},RGraph.ObjectRegistry.getObjectsByXY=function(n){for(var f=n.target,r=[],u=RGraph.ObjectRegistry.getObjectsByCanvasID(f.id),i,t=u.length-1;t>=0;--t)i=u[t].getObjectByXY(n),i&&r.push(i);return r},RGraph.ObjectRegistry.getObjectByUID=function(n){for(var i=RGraph.ObjectRegistry.objects.byUID,t=0;t=n&&r>=t?u+=TWOPI:i>=n&&rTWOPI&&(u-=TWOPI),u},RGraph.getHypLength=function(n,t,i,r){return Math.sqrt((i-n)*(i-n)+(r-t)*(r-t))},RGraph.getRadiusEndPoint=function(n,t,i,r){var u=n+Math.cos(i)*r,f=t+Math.sin(i)*r;return[u,f]},RGraph.InstallEventListeners=function(n){RGraph.isOld()||(RGraph.InstallCanvasClickListener?(RGraph.InstallWindowMousedownListener(n),RGraph.InstallWindowMouseupListener(n),RGraph.InstallCanvasMousemoveListener(n),RGraph.InstallCanvasMouseupListener(n),RGraph.InstallCanvasMousedownListener(n),RGraph.InstallCanvasClickListener(n)):(RGraph.hasTooltips(n)||n.Get("chart.adjustable")||n.Get("chart.annotatable")||n.Get("chart.contextmenu")||n.Get("chart.resizable")||n.Get("chart.key.interactive")||n.Get("chart.events.click")||n.Get("chart.events.mousemove"))&&alert("[RGRAPH] You appear to have used dynamic features but not included the file: RGraph.common.dynamic.js"))},RGraph.pr=function(n){var t="",i=arguments[2]?arguments[2]:"",r;switch(typeof n){case"number":i==""&&(t+="Number: "),t+=String(n);break;case"string":i==""&&(t+="String ("+n.length+"):"),t+='"'+String(n)+'"';break;case"object":if(n==null){t+="null";break}t+="Object\n"+i+"(\n";for(r in n)(typeof r=="string"||typeof r=="number")&&(t+=i+" "+r+" => "+RGraph.pr(n[r],!0,i+" ")+"\n");t=t+i+")";break;case"function":t+=n;break;case"boolean":t+="Boolean: "+(n?"true":"false")}if(arguments[1])return t;alert(t)},RGraph.DashedLine=function(n,t,i,r,u){var h=5;typeof arguments[5]=="number"&&(h=arguments[5]);var f=r-t,e=u-i,o=Math.floor(Math.sqrt(f*f+e*e)/h),c=f/o,l=e/o,s=0;do s%2==0&&s>0?n.lineTo(t,i):n.moveTo(t,i),t+=c,i+=l;while(s++<=o)},RGraph.AJAX=function(n,t){var i;window.XMLHttpRequest?i=new XMLHttpRequest:window.ActiveXObject&&(i=new ActiveXObject("Microsoft.XMLHTTP")),i.onreadystatechange=function(){this.readyState==4&&this.status==200&&(this.__user_callback__=t,this.__user_callback__())},i.open("GET",n,!0),i.send()},RGraph.RotateCanvas=function(n,t,i,r){var u=n.getContext("2d");u.translate(t,i),u.rotate(r),u.translate(0-t,0-i)},RGraph.DrawAxes=RGraph.DrawYAxis=function(n,t){var w,p,h,r,f;for(r in t)typeof r=="string"&&(w=r.replace(/^chart\./,"axis."),t[w]=t[r]);var a=n.gutterTop,at=n.gutterBottom,i=t["axis.context"]?t["axis.context"]:n.context,u=t["axis.x"],f=n.properties["chart.gutter.top"],b=t["axis.min"]?t["axis.min"]:0,tt=t["axis.max"],v=t["axis.color"]?t["axis.color"]:"black",k=t["axis.title"]?t["axis.title"]:"",it=t["axis.title.color"]?t["axis.title.color"]:v,rt=t["axis.text.color"]?t["axis.color"]:v,e=n.canvas.height-n.gutterBottom-n.gutterTop,y=typeof t["axis.numticks"]=="number"?t["axis.numticks"]:10,o=t["axis.numlabels"]?t["axis.numlabels"]:5,d=t["axis.font"]?t["axis.font"]:"Arial",c=t["axis.text.size"]?t["axis.text.size"]:10,s=typeof t["axis.align"]=="string"?t["axis.align"]:"left",g=t["axis.scale.formatter"],ut=t["axis.scale.decimals"],ft=t["axis.scale.invert"],et=t["axis.units.pre"],ot=t["axis.units.post"],st=t["axis.linewidth"]?t["axis.linewidth"]:1,ht=t["axis.noendtick.top"],ct=t["axis.noendtick.bottom"],lt=t["axis.noyaxis"];if(i.lineWidth=st+.001,i.strokeStyle=v,!lt&&(i.beginPath(),i.moveTo(Math.round(u),f),i.lineTo(Math.round(u),f+e),i.stroke(),y)){for(p=e/y,i.beginPath(),r=ht?1:0;r<=y-(ct?1:0);++r)i.moveTo(s=="right"?u+3:u-3,Math.round(f+p*r)),i.lineTo(u,Math.round(f+p*r));i.stroke()}for(i.fillStyle=rt,i.beginPath(),h=0,r=0;r<=o;++r){var nt=(tt-b)*((o-r)/o)+b,l=RGraph.number_format(n,nt.toFixed(ut),et,ot),l=String(typeof g=="function"?g(n,nt):l),h=Math.max(h,i.measureText(l).width);f=ft?a+(e-e/o*r):a+e/o*r,RGraph.Text(i,d,c,u-(s=="right"?-5:5),f,l,"center",s=="right"?"left":"right")}i.stroke(),k&&(i.beginPath(),i.fillStyle=it,RGraph.Text(i,d,c+2,s=="right"?u+c+h+2:u-c-h-2,e/2+a,k,"center","center",null,s=="right"?90:-90),i.stroke())},RGraph.DrawXAxis=function(n,t){var d,i,b,it,o,k;for(i in t)typeof i=="string"&&(d=i.replace(/^chart\./,"axis."),t[d]=t[i]);var r=t["axis.context"]?t["axis.context"]:n.context,l=n.gutterLeft,yt=n.gutterRight,o=n.properties["chart.gutter.left"],u=t["axis.y"],g=t["axis.min"]?t["axis.min"]:0,nt=t["axis.max"]?t["axis.max"]:null,f=t["axis.labels"]?t["axis.labels"]:null,rt=typeof t["axis.labels.position"]=="string"?t["axis.labels.position"]:"section",y=t["axis.color"]?t["axis.color"]:"black",ut=t["axis.title.color"]?t["axis.title.color"]:y,ft=t["axis.text.color"]?t["axis.text.color"]:y,e=n.canvas.width-n.gutterLeft-n.gutterRight,pt=n.canvas.height-n.gutterBottom-n.gutterTop,a=t["axis.text.font"]?t["axis.text.font"]:"Arial",s=t["axis.text.size"]?t["axis.text.size"]:10,v=typeof t["axis.align"]=="string"?t["axis.align"]:"bottom",c=t["axis.numlabels"]?t["axis.numlabels"]:5,tt=t["axis.scale.formatter"],et=Number(t["axis.scale.decimals"]),ot=t["axis.scale.invert"],st=t["axis.units.pre"]?t["axis.units.pre"]:"",ht=t["axis.units.post"]?t["axis.units.post"]:"",p=t["axis.title"]?t["axis.title"]:"",w=typeof t["axis.numticks"]=="number"?t["axis.numticks"]:f&&f.length?f.length:10,h=t["axis.hmargin"]?t["axis.hmargin"]:0,ct=t["axis.linewidth"]?t["axis.linewidth"]:1,lt=t["axis.noendtick.left"],at=t["axis.noendtick.right"],vt=t["axis.noxaxis"];if(r.lineWidth=ct+.001,r.strokeStyle=y,!vt){for(r.beginPath(),r.moveTo(o,Math.round(u)),r.lineTo(o+e,Math.round(u)),r.stroke(),r.beginPath(),i=lt?1:0;i<=w-(at?1:0);++i)r.moveTo(Math.round(o+e/w*i),u),r.lineTo(Math.round(o+e/w*i),u+(v=="bottom"?3:-3));r.stroke()}if(r.fillStyle=ft,f){for(c=f.length,r.beginPath(),i=0;i"),u.style.fontFamily=i,u.style.fontWeight=t?"bold":"normal",u.style.fontSize=r+"pt",r=[u.offsetWidth,u.offsetHeight],__rgraph_measuretext_cache__[f]=r,r)},RGraph.AddEffects||(RGraph.AddEffects=function(){}),RGraph.LinearGradient=function(n,t,i,r,u){for(var e=n.context.createLinearGradient(t,i,r,u),h=arguments.length-5,o,s,f=5;f=0;t--)i.push(n[t]);return i},RGraph.Registry.Set=function(n,t){return RGraph.Registry.store[n]=t,t},RGraph.Registry.Get=function(n){return RGraph.Registry.store[n]},RGraph.degrees2Radians=function(n){return n*(PI/180)},RGraph.log=function(){var n=Math.log;return function(t,i){return n(t)/(i?n(i):1)}}(),RGraph.is_array=function(n){return n!=null&&n.constructor.toString().indexOf("Array")!=-1},RGraph.trim=function(n){return RGraph.ltrim(RGraph.rtrim(n))},RGraph.ltrim=function(n){return n.replace(/^(\s|\0)+/,"")},RGraph.rtrim=function(n){return n.replace(/(\s|\0)+$/,"")},RGraph.GetHeight=function(n){return n.canvas.height},RGraph.GetWidth=function(n){return n.canvas.width},RGraph.is_null=function(n){return n==null||typeof n=="object"&&!n?!0:!1},RGraph.Timer=function(n){var t=new Date;console.log(n+": "+t.getSeconds()+"."+t.getMilliseconds())},RGraph.Async=function(n){return setTimeout(n,arguments[1]?arguments[1]:1)},RGraph.isIE=function(){return navigator.userAgent.indexOf("MSIE")>0},ISIE=RGraph.isIE(),RGraph.isIE6=function(){return navigator.userAgent.indexOf("MSIE 6")>0},ISIE6=RGraph.isIE6(),RGraph.isIE7=function(){return navigator.userAgent.indexOf("MSIE 7")>0},ISIE7=RGraph.isIE7(),RGraph.isIE8=function(){return navigator.userAgent.indexOf("MSIE 8")>0},ISIE8=RGraph.isIE8(),RGraph.isIE9=function(){return navigator.userAgent.indexOf("MSIE 9")>0},ISIE9=RGraph.isIE9(),RGraph.isIE10=function(){return navigator.userAgent.indexOf("MSIE 10")>0},ISIE10=RGraph.isIE10(),RGraph.isIE9up=function(){return navigator.userAgent.match(/MSIE (\d+)/),Number(RegExp.$1)>=9},ISIE9UP=RGraph.isIE9up(),RGraph.isIE10up=function(){return navigator.userAgent.match(/MSIE (\d+)/),Number(RegExp.$1)>=10},ISIE10UP=RGraph.isIE10up(),RGraph.isOld=function(){return ISIE6||ISIE7||ISIE8},ISOLD=ISIE6||ISIE7||ISIE8,RGraph.Reset=function(n){n.width=n.width,RGraph.ObjectRegistry.Clear(n),n.__rgraph_aa_translated__=!1} \ No newline at end of file diff --git a/other-scripts/Steel-Gauges/web_server/RGraph.rose.min.js b/other-scripts/Steel-Gauges/web_server/RGraph.rose.min.js new file mode 100644 index 0000000..4e21f88 --- /dev/null +++ b/other-scripts/Steel-Gauges/web_server/RGraph.rose.min.js @@ -0,0 +1 @@ +typeof RGraph=="undefined"&&(RGraph={}),RGraph.Rose=function(n,t){var r,i;for(this.id=n,this.canvas=document.getElementById(n),this.context=this.canvas.getContext("2d"),this.data=t,this.canvas.__object__=this,this.type="rose",this.isRGraph=!0,this.uid=RGraph.CreateUID(),this.canvas.uid=this.canvas.uid?this.canvas.uid:RGraph.CreateUID(),this.colorsParsed=!1,RGraph.OldBrowserCompat(this.context),this.centerx=0,this.centery=0,this.radius=0,this.max=0,this.angles=[],this.properties={"chart.background.axes":!0,"chart.background.axes.color":"black","chart.background.grid":!0,"chart.background.grid.color":"#ccc","chart.background.grid.size":null,"chart.background.grid.spokes":null,"chart.background.grid.count":5,"chart.centerx":null,"chart.centery":null,"chart.radius":null,"chart.colors":["rgba(255,0,0,0.5)","rgba(255,255,0,0.5)","rgba(0,255,255,0.5)","rgb(0,255,0)","gray","blue","rgb(255,128,255)","green","pink","gray","aqua"],"chart.colors.sequential":!1,"chart.colors.alpha":null,"chart.margin":0,"chart.strokestyle":"#aaa","chart.gutter.left":25,"chart.gutter.right":25,"chart.gutter.top":25,"chart.gutter.bottom":25,"chart.title":"","chart.title.background":null,"chart.title.hpos":null,"chart.title.vpos":null,"chart.title.bold":!0,"chart.title.font":null,"chart.title.x":null,"chart.title.y":null,"chart.title.halign":null,"chart.title.valign":null,"chart.labels":null,"chart.labels.position":"center","chart.labels.axes":"nsew","chart.labels.offset":0,"chart.text.color":"black","chart.text.font":"Arial","chart.text.size":10,"chart.key":null,"chart.key.background":"white","chart.key.position":"graph","chart.key.halign":"right","chart.key.shadow":!1,"chart.key.shadow.color":"#666","chart.key.shadow.blur":3,"chart.key.shadow.offsetx":2,"chart.key.shadow.offsety":2,"chart.key.position.gutter.boxed":!0,"chart.key.position.x":null,"chart.key.position.y":null,"chart.key.color.shape":"square","chart.key.rounded":!0,"chart.key.linewidth":1,"chart.key.colors":null,"chart.contextmenu":null,"chart.tooltips":null,"chart.tooltips.event":"onclick","chart.tooltips.effect":"fade","chart.tooltips.css.class":"RGraph_tooltip","chart.tooltips.highlight":!0,"chart.highlight.stroke":"rgba(0,0,0,0)","chart.highlight.fill":"rgba(255,255,255,0.7)","chart.annotatable":!1,"chart.annotate.color":"black","chart.zoom.factor":1.5,"chart.zoom.fade.in":!0,"chart.zoom.fade.out":!0,"chart.zoom.hdir":"right","chart.zoom.vdir":"down","chart.zoom.frames":25,"chart.zoom.delay":16.666,"chart.zoom.shadow":!0,"chart.zoom.background":!0,"chart.zoom.action":"zoom","chart.resizable":!1,"chart.resize.handle.adjust":[0,0],"chart.resize.handle.background":null,"chart.adjustable":!1,"chart.ymax":null,"chart.ymin":0,"chart.scale.decimals":null,"chart.scale.point":".","chart.scale.thousand":",","chart.variant":"stacked","chart.exploded":0,"chart.events.mousemove":null,"chart.events.click":null,"chart.animation.roundrobin.factor":1,"chart.animation.roundrobin.radius":!0,"chart.animation.grow.multiplier":1},r=RGraph.array_linearize(this.data),i=0;i0&&this.Get("chart.key").length>=3&&(this.centerx=this.centerx-this.Get("chart.gutter.right")+5),typeof this.Get("chart.centerx")=="number"&&(this.centerx=this.Get("chart.centerx")),typeof this.Get("chart.centery")=="number"&&(this.centery=this.Get("chart.centery")),typeof this.Get("chart.radius")=="number"&&(this.radius=this.Get("chart.radius")),this.colorsParsed||(this.parseColors(),this.colorsParsed=!0),this.DrawBackground(),this.DrawRose(),this.DrawLabels(),this.Get("chart.contextmenu")&&RGraph.ShowContext(this),this.Get("chart.resizable")&&RGraph.AllowResizing(this),this.Get("chart.adjustable")&&RGraph.AllowAdjusting(this),RGraph.InstallEventListeners(this),RGraph.FireCustomEvent(this,"ondraw")},RGraph.Rose.prototype.DrawBackground=function(){var t,n;if(this.context.lineWidth=1,this.properties["chart.background.grid"]){for(typeof this.properties["chart.background.grid.count"]=="number"&&(this.properties["chart.background.grid.size"]=this.radius/this.properties["chart.background.grid.count"]),this.context.beginPath(),this.context.strokeStyle=this.properties["chart.background.grid.color"],n=this.properties["chart.background.grid.size"];n<=this.radius;n+=this.properties["chart.background.grid.size"])this.context.arc(this.centerx,this.centery,n,0,TWOPI,!1);if(this.context.stroke(),this.context.beginPath(),typeof this.properties["chart.background.grid.spokes"]=="number")for(t=360/this.properties["chart.background.grid.spokes"],n=t;n<=360;n+=t)this.context.arc(this.centerx,this.centery,this.radius,n/(180/PI)-HALFPI,(n+.0001)/(180/PI)-HALFPI,0),this.context.lineTo(this.centerx,this.centery);else for(n=15;n<=360;n+=15)this.context.arc(this.centerx,this.centery,this.radius,n/(180/PI)-HALFPI,(n+.0001)/(180/PI)-HALFPI,!1),this.context.lineTo(this.centerx,this.centery);this.context.stroke()}if(this.Get("chart.background.axes")){for(this.context.beginPath(),this.context.strokeStyle=this.Get("chart.background.axes.color"),this.context.moveTo(this.centerx-this.radius,Math.round(this.centery)),this.context.lineTo(this.centerx+this.radius,Math.round(this.centery)),this.context.moveTo(Math.round(this.centerx-this.radius),this.centery-5),this.context.lineTo(Math.round(this.centerx-this.radius),this.centery+5),this.context.moveTo(Math.round(this.centerx+this.radius),this.centery-5),this.context.lineTo(Math.round(this.centerx+this.radius),this.centery+5),n=this.centerx-this.radius;n-1&&(RGraph.Text(i,t,n,this.centerx,this.centery-u*.2,RGraph.number_format(this,Number(this.scale[0]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx,this.centery-u*.4,RGraph.number_format(this,Number(this.scale[1]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx,this.centery-u*.6,RGraph.number_format(this,Number(this.scale[2]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx,this.centery-u*.8,RGraph.number_format(this,Number(this.scale[3]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx,this.centery-u,RGraph.number_format(this,Number(this.scale[4]).toFixed(o),f,e),"center","center",!0,!1,r)),s.indexOf("s")>-1&&(RGraph.Text(i,t,n,this.centerx,this.centery+u*.2,RGraph.number_format(this,Number(this.scale[0]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx,this.centery+u*.4,RGraph.number_format(this,Number(this.scale[1]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx,this.centery+u*.6,RGraph.number_format(this,Number(this.scale[2]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx,this.centery+u*.8,RGraph.number_format(this,Number(this.scale[3]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx,this.centery+u,RGraph.number_format(this,Number(this.scale[4]).toFixed(o),f,e),"center","center",!0,!1,r)),s.indexOf("e")>-1&&(RGraph.Text(i,t,n,this.centerx+u*.2,this.centery,RGraph.number_format(this,Number(this.scale[0]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx+u*.4,this.centery,RGraph.number_format(this,Number(this.scale[1]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx+u*.6,this.centery,RGraph.number_format(this,Number(this.scale[2]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx+u*.8,this.centery,RGraph.number_format(this,Number(this.scale[3]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx+u,this.centery,RGraph.number_format(this,Number(this.scale[4]).toFixed(o),f,e),"center","center",!0,!1,r)),s.indexOf("w")>-1&&(RGraph.Text(i,t,n,this.centerx-u*.2,this.centery,RGraph.number_format(this,Number(this.scale[0]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx-u*.4,this.centery,RGraph.number_format(this,Number(this.scale[1]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx-u*.6,this.centery,RGraph.number_format(this,Number(this.scale[2]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx-u*.8,this.centery,RGraph.number_format(this,Number(this.scale[3]).toFixed(o),f,e),"center","center",!0,!1,r),RGraph.Text(i,t,n,this.centerx-u,this.centery,RGraph.number_format(this,Number(this.scale[4]).toFixed(o),f,e),"center","center",!0,!1,r)),s.length>0&&RGraph.Text(i,t,n,this.centerx,this.centery,typeof this.Get("chart.ymin")=="number"?RGraph.number_format(this,Number(this.Get("chart.ymin")).toFixed(this.Get("chart.scale.decimals")),f,e):"0","center","center",!0,!1,r)},RGraph.Rose.prototype.DrawCircularLabels=function(n,t,i,r,u){for(var s=this.Get("chart.variant"),c=this.Get("chart.labels.position"),u=u+5+this.Get("chart.labels.offset"),e,o,h,f=0;fthis.centerx?"left":o==this.centerx?"center":"right",RGraph.Text(n,i,r,o,h,String(t[f]),"center",halign)},RGraph.Rose.prototype.getShape=RGraph.Rose.prototype.getSegment=function(n){var t,e;RGraph.FixEventObject(n);var a=this.canvas,c=this.context,i=this.angles;for(t=0;t0?this.context.arc(n.x,n.y,n["radius.start"],n["angle.end"],n["angle.start"],!0):this.context.lineTo(n.x,n.y),this.context.closePath(),this.context.stroke(),this.context.fill())},RGraph.Rose.prototype.getObjectByXY=function(n){var t=RGraph.getMouseXY(n),i=RGraph.getHypLength(this.centerx,this.centery,t[0],t[1]);if(t[0]>this.centerx-this.radius&&t[0]this.centery-this.radius&&t[1]document.body.offsetWidth-10?(r.style.left=s[0]+c+Math.cos(o)*e-h*.9+"px",r.style.top=s[1]+l+Math.sin(o)*e-a-5+"px",f.style.left=h*.9-8.5+"px"):(r.style.left=s[0]+c+Math.cos(o)*e-h/2+"px",r.style.top=s[1]+l+Math.sin(o)*e-a-5+"px",f.style.left=h*.5-8.5+"px")},RGraph.Rose.prototype.getRadius=function(n){if(n<0||n>this.max)return null;return n/this.max*this.radius},RGraph.Rose.prototype.parseColors=function(){for(var n=0;n&pageUpdate=its-me + digitalFont : false, // Font control for the gauges & timer + digitalForecast : false, // Font control for the status display, set this to false for languages that use accented characters in the forecasts + showPopupData : true, // Pop-up data displayed + showPopupGraphs : true, // If pop-up data is displayed, show the graphs? + mobileShowGraphs : false, // If false, on a mobile/narrow display, always disable the graphs + showWindVariation : true, // Show variation in wind direction over the last 10 minutes on the direction gauge + showWindMetar : false, // Show the METAR substring for wind speed/direction over the last 10 minutes on the direction gauge popup + showIndoorTempHum : true, // Show the indoor temperature/humidity options + showCloudGauge : true, // Display the Cloud Base gauge + showUvGauge : true, // Display the UV Index gauge + showSolarGauge : true, // Display the Solar gauge + showSunshineLed : true, // Show 'sun shining now' LED on solar gauge + showRoseGauge : true, // Show the optional Wind Rose gauge + showRoseGaugeOdo : true, // Show the optional Wind Rose gauge wind run Odometer + showRoseOnDirGauge : true, // Show the rose data as sectors on the direction gauge + showGaugeShadow : true, // Show a drop shadow outside the gauges + roundCloudbaseVal : true, // Round the value shown on the cloud base gauge to make it easier to read + // The realtime files should be absolute paths, "/xxx.txt" refers to the public root of your web server + realTimeUrlLongPoll: 'realtimegauges-longpoll.php', // *** ALL Users: If using long polling, change to your location of the PHP long poll realtime file *** + // *** the supplied file is for Cumulus only + realTimeUrlCumulus : 'realtimegauges.txt', // *** Cumulus Users: Change to your location of the realtime file *** + realTimeUrlWD : 'customclientraw.txt', // *** WD Users: Change to your location of the ccr file *** + realTimeUrlVWS : 'steelseriesVWSjson.php', // *** VWS Users: Change to your location of the JSON script generator *** + realTimeUrlWC : 'realtimegaugesWC.txt', // *** WeatherCat Users: Change to your location of the JSON script generator *** + realTimeUrlMB : 'MBrealtimegauges.txt', // *** Meteobridge Users: Change to the location of the JSON file + realTimeUrlWView : 'customclientraw.txt', // *** WView Users: Change to your location of the customclientraw.txt file *** + realTimeUrlWeewx : 'gauge-data.txt', // *** WeeWX Users: Change to your location of the gauge data file *** + realTimeUrlWLCOM : 'WLrealtimegauges.php', // *** WLCOM Users: change to location of WLCOMtags.php file *** + useCookies : true, // Persistently store user preferences in a cookie? + tipImages : [], + dashboardMode : false, // Used by Cumulus MX dashboard - SET TO FALSE OTHERWISE + dewDisplayType : 'app' // Initial 'scale' to display on the 'dew point' gauge. + // 'dew' - Dewpoint + // 'app' - Apparent temperature + // 'wnd' - Wind Chill + // 'hea' - Heat Index + // 'hum' - Humidex + }, + + // Gauge global look'n'feel settings + gaugeGlobals = { + minMaxArea : 'rgba(212,132,134,0.3)', // area sector for today's max/min. (red, green, blue, transparency) + windAvgArea : 'rgba(132,212,134,0.3)', + windVariationSector : 'rgba(120,200,120,0.7)', // only used when rose data is shown on direction gauge + frameDesign : steelseries.FrameDesign.TILTED_GRAY, + background : steelseries.BackgroundColor.BEIGE, + foreground : steelseries.ForegroundType.TYPE1, + pointer : steelseries.PointerType.TYPE8, + pointerColour : steelseries.ColorDef.RED, + dirAvgPointer : steelseries.PointerType.TYPE8, + dirAvgPointerColour : steelseries.ColorDef.BLUE, + gaugeType : steelseries.GaugeType.TYPE4, + lcdColour : steelseries.LcdColor.STANDARD, + knob : steelseries.KnobType.STANDARD_KNOB, + knobStyle : steelseries.KnobStyle.SILVER, + labelFormat : steelseries.LabelNumberFormat.STANDARD, + tickLabelOrientation : steelseries.TickLabelOrientation.HORIZONTAL, // was .NORMAL up to v1.6.4 + rainUseSectionColours : false, // Only one of these colour options should be true + rainUseGradientColours: false, // Set both to false to use the pointer colour + tempTrendVisible : true, + pressureTrendVisible : true, + uvLcdDecimals : 1, + // sunshine threshold values + sunshineThreshold : 50, // the value in W/m² above which we can consider the Sun to be shining, *if* the current value exceeds... + sunshineThresholdPct : 75, // the percentage of theoretical solar irradiance above which we consider the Sun to be shining + // default gauge ranges - before auto-scaling/ranging + tempScaleDefMinC : -20, + tempScaleDefMaxC : 40, + tempScaleDefMinF : 0, + tempScaleDefMaxF : 100, + baroScaleDefMinhPa : 990, + baroScaleDefMaxhPa : 1030, + baroScaleDefMinkPa : 99, + baroScaleDefMaxkPa : 103, + baroScaleDefMininHg : 29.2, + baroScaleDefMaxinHg : 30.4, + windScaleDefMaxMph : 20, + windScaleDefMaxKts : 20, + windScaleDefMaxMs : 10, + windScaleDefMaxKmh : 30, + rainScaleDefMaxmm : 10, + rainScaleDefMaxIn : 0.5, + rainRateScaleDefMaxmm : 10, + rainRateScaleDefMaxIn : 0.5, + uvScaleDefMax : 10, // Northern Europe may be lower - max. value recorded in the UK is 8, so use a scale of 10 for UK + solarGaugeScaleMax : 1000, // Max value to be shown on the solar gauge - theoretical max without atmosphere ~ 1374 W/m² + // - but Davis stations can read up to 1800, use 1000 for Northern Europe? + cloudScaleDefMaxft : 3000, + cloudScaleDefMaxm : 1000, + shadowColour : 'rgba(0,0,0,0.3)' // Colour to use for gauge shadows - default 30% transparent black + }, + + commonParams = { + // Common parameters for all the SteelSeries gauges + fullScaleDeflectionTime: 4, // Bigger numbers (seconds) slow the gauge pointer movements more + gaugeType : gaugeGlobals.gaugeType, + minValue : 0, + niceScale : true, + ledVisible : false, + frameDesign : gaugeGlobals.frameDesign, + backgroundColor : gaugeGlobals.background, + foregroundType : gaugeGlobals.foreground, + pointerType : gaugeGlobals.pointer, + pointerColor : gaugeGlobals.pointerColour, + knobType : gaugeGlobals.knob, + knobStyle : gaugeGlobals.knobStyle, + lcdColor : gaugeGlobals.lcdColour, + lcdDecimals : 1, + digitalFont : config.digitalFont, + tickLabelOrientation : gaugeGlobals.tickLabelOrientation, + labelNumberFormat : gaugeGlobals.labelFormat + }, + firstRun = true, // Used to set-up units & scales etc + userUnitsSet = false, // Tracks if the display units have been set by a user preference + data = {}, // Stores all the values from realtime.txt + tickTockInterval, // The 1s clock interval timer + + // ajaxDelay, used by long polling, the delay between getting a response and queueing the next request, as the default PHP + // script runtime timout is 30 seconds, we do not want the PHP task to run for more than 20 seconds. So queue the next + // request half of the realtime interval, or 20 seconds before it is due, which ever is the larger. + ajaxDelay = config.longPoll ? Math.max(config.realtimeInterval - 20, 0) : config.realtimeInterval, + downloadTimer, // Stores a reference to the ajax download setTimout() timer + timestamp = 0, // the timestamp of last data update on the server. + jqXHR = null, // handle to the jQuery web request + displayUnits = null, // Stores the display units cookie settings + sampleDate, + realtimeVer, // minimum version of the realtime JSON file required + programLink = [ + 'Cumulus', + 'Weather Display', + 'Virtual Weather Station', + 'WeatherCat', + 'Meteobridge', + 'Wview', + 'weewx', + 'Weatherlink.com' + ], + + ledIndicator, statusScroller, statusTimer, + + gaugeTemp, gaugeDew, gaugeRain, gaugeRRate, + gaugeHum, gaugeBaro, gaugeWind, gaugeDir, + gaugeUV, gaugeSolar, gaugeCloud, gaugeRose, + + /* _imgBackground, // Uncomment if using a background image on the gauges */ + + // ================================================================================================================== + // Nothing below this line needs to be modified for the gauges as supplied + // - unless you really know what you are doing + // - but remember, if you break it, it's up to you to fix it ;-) + // ================================================================================================================== + + // + // init() Called when the document is ready, pre-draws the Status Display then calls + // the first Ajax fetch of realtimegauges.txt. First draw of the gauges now deferred until + // the Ajax data is available as a 'speed up'. + // + init = function (dashboard) { + // Cumulus, Weather Display, VWS, WeatherCat? + switch (config.weatherProgram) { + case 0: + // Cumulus + realtimeVer = 12; // minimum version of the realtime JSON file required + config.realTimeURL = config.longPoll ? config.realTimeUrlLongPoll : config.realTimeUrlCumulus; + // the trend images to be used for the pop-up data, used in conjunction with config.imgPathURL + // by default this is configured for the Cumulus 'standard' web site + // ** If you specify one image in a sub-array, then you MUST provide images for all the other sub-elements + config.tipImgs = [ // config.tipImgs for Cumulus users using the 'default' weather site + ['temp.png', 'intemp.png'], // Temperature: outdoor, indoor + // Temperature: dewpoint, apparent, windChill, heatIndex, humidex + ['temp.png', 'temp.png', 'temp.png', 'temp.png', 'temp.png'], + 'raint.png', // Rainfall + 'rain.png', // Rainfall rate + ['hum.png', 'hum.png'], // Humidity: outdoor, indoor + 'press.png', // Pressure + 'wind.png', // Wind speed + 'windd.png', // Wind direction + (config.showUvGauge ? 'uv.png' : null), // UV graph if UV sensor is present | =null if no UV sensor + (config.showSolarGauge ? 'solar.png' : null), // Solar rad graph if Solar sensor is present | Solar =null if no Solar sensor + (config.showRoseGauge ? 'windd.png' : null), // Wind direction if Rose is enabled | =null if Rose is disabled + (config.showCloudGauge ? 'press.png' : null) // Pressure for cloud height | =null if Cloud Height is disabled + ]; + break; + case 1: + // Weather Display + realtimeVer = 14; // minimum version of the realtime JSON file required + config.realTimeURL = config.longPoll ? config.realTimeUrlLongPoll : config.realTimeUrlWD; + config.tipImgs = [ // config.tipImgs for Weather Display users with wxgraph + ['temp+hum_24hr.php', 'indoor_temp_24hr.php'], // Temperature: outdoor, indoor + // Temperature: dewpnt, apparent, windChill, HeatIndx, humidex + ['temp+dew+hum_1hr.php', 'temp+dew+hum_1hr.php', 'temp+dew+hum_1hr.php', 'temp+dew+hum_1hr.php', 'temp+dew+hum_1hr.php'], + 'rain_24hr.php', // Rainfall + 'rain_1hr.php', // Rainfall rate + ['humidity_1hr.php', 'humidity_7days.php'], // Humidity: outdoor, indoor + 'baro_24hr.php', // Pressure + 'windgust_1hr.php', // Wind speed + 'winddir_24hr.php', // Wind direction + (config.showUvGauge ? 'uv_24hr.php' : null), // UV graph if UV sensor is present | =null if no UV sensor + (config.showSolarGauge ? 'solar_24hr.php' : null), // Solar rad graph if Solar sensor is present | Solar =null if no Solar sensor + (config.showRoseGauge ? 'winddir_24hr.php' : null), // Wind direction if Rose is enabled | =null if Rose is disabled + (config.showCloudGauge ? 'baro_24hr.php' : null) // Pressure for cloud height | =null if Cloud Height is disabled + ]; + // WD useer generally use wxgraphs - tweak the CSS to accomadate the different aspect ratio + $('.tipimg').css({ + width : '360px', + height: '260px'}); + break; + case 2: + // WVS + realtimeVer = 11; // minimum version of the realtime JSON file required + config.realTimeURL = config.longPoll ? config.realTimeUrlLongPoll : config.realTimeUrlVWS; + config.showRoseGauge = false; // no wind rose data from VWS + config.showCloudGauge = false; + config.tipImgs = [ // config.tipImgs for VWS users + ['vws742.jpg', 'vws741.jpg'], // Temperature: outdoor, indoor + // Temperature: dewpnt, apparent, windChill, HeatIndx, humidex + ['vws757.jpg', 'vws762.jpg', 'vws754.jpg', 'vws756.jpg', null], + 'vws744.jpg', // Rainfall + 'vws859.jpg', // Rainfall rate + ['vws740.jpg', 'vws739.jpg'], // Humidity: outdoor, indoor + 'vws758.jpg', // Pressure + 'vws737.jpg', // Wind speed + 'vws736.jpg', // Wind direction + (config.showUvGauge ? 'vws752.jpg' : null), // UV graph if UV sensor is present | =null if no UV sensor + (config.showSolarGauge ? 'vws753.jpg' : null), // Solar rad graph if Solar sensor is present | Solar =null if no Solar sensor + (config.showRoseGauge ? 'vws736.jpg' : null), // Wind direction if Rose is enabled | =null if Rose is disabled + (config.showCloudGauge ? 'vws758.jpg' : null) // Pressure for cloud height | =null if Cloud Height is disabled + ]; + break; + case 3: + // WeatherCat + realtimeVer = 14; // minimum version of the realtime JSON file required + config.realTimeURL = config.longPoll ? config.realTimeUrlLongPoll : config.realTimeUrlWC; + config.tipImgs = [ // config.tipImgs - WeatherCat users using the 'default' weather site + ['temperature1.jpg', 'tempin1.jpg'], // Temperature: outdoor, indoor + // Temperature: dewpoint, apparent, windChill, heatIndex, humidex + ['dewpoint1.jpg', 'temperature1.jpg', 'windchill1.jpg', 'heatindex1.jpg', 'temperature1.jpg'], + 'precipitationc1.jpg', // Rainfall + 'precipitation1.jpg', // Rainfall rate + ['rh1.jpg', 'rhin1.jpg'], // Humidity: outdoor, indoor + 'pressure1.jpg', // Pressure + 'windspeed1.jpg', // Wind speed + 'winddirection1.jpg', // Wind direction + (config.showUvGauge ? 'uv1.jpg' : null), // UV graph if UV sensor is present | =null if no UV sensor + (config.showSolarGauge ? 'solarrad1.jpg' : null), // Solar rad graph if Solar sensor is present | Solar =null if no Solar sensor + (config.showRoseGauge ? 'winddirection1.jpg' : null), // Wind direction if Rose is enabled | =null if Rose is disabled + (config.showCloudGauge ? 'cloudbase1.jpg' : null) // Pressure for cloud height | =null if Cloud Height is disabled + ]; + break; + case 4: + // Meteobridge + realtimeVer = 10; // minimum version of the realtime JSON file required + config.realTimeURL = config.longPoll ? config.realTimeUrlLongPoll : config.realTimeUrlMB; + config.showPopupGraphs = false; // config.tipImgs - no Meteobridge images available + config.showRoseGauge = false; // no windrose data from MB + config.showCloudGauge = false; + config.tipImgs = null; // config.tipImgs - no Meteobridge images available + config.showWindVariation = false; // no wind variation data from MB + break; + case 5: + // WView + realtimeVer = 11; // minimum version of the realtime JSON file required + config.realTimeURL = config.longPoll ? config.realTimeUrlLongPoll : config.realTimeUrlWView; + config.showSunshineLed = false; // WView does not provide the current theoretical solar max required to determine sunshine + config.showWindVariation = false; // no wind variation from WView + config.showRoseGauge = false; // No wind rose array from WView by default - there is a user supplied modification to enable it though. + config.showCloudGauge = false; + config.tipImgs = [ // config.tipImgs for WView users + ['tempdaycomp.png', 'indoor_temp.png'], // Temperature: outdoor, indoor + // Temperature: dewpnt, apparent, windChill, HeatIndx, humidex + ['tempdaycomp.png', 'tempdaycomp.png', 'heatchillcomp.png', 'heatchillcomp.png', 'tempdaycomp.png'], + 'rainday.png', // Rainfall + 'rainrate.png', // Rainfall rate + ['humidday.png', 'humidday.png'], // Humidity: outdoor, indoor + 'baromday.png', // Pressure + 'wspeeddaycomp.png', // Wind speed + 'wdirday.png', // Wind direction + (config.showUvGauge ? 'uvday.png' : null), // UV graph if UV sensor is present | =null if no UV sensor + (config.showSolarGauge ? 'solarday.png' : null), // Solar rad graph if Solar sensor is present | Solar =null if no Solar sensor + (config.showRoseGauge ? 'windroseday.png' : null), // Wind direction if Rose is enabled | =null if Rose is disabled + (config.showCloudGauge ? 'baromday.png' : null) // Pressure for cloud height | =null if Cloud Height is disabled + ]; + break; + case 6: + // weewx + realtimeVer = 14; // minimum version of the realtime JSON file required + config.realTimeURL = config.longPoll ? config.realTimeUrlLongPoll : config.realTimeUrlWeewx; + config.showSunshineLed = true; + config.showWindVariation = true; + config.tipImgs = [ // config.tipImgs for weewx + ['dayinouttemp.png', 'dayinouttemp.png'], // Temperature: outdoor, indoor + // Temperature: dewpnt, apparent, windChill, HeatIndx, humidex + ['dayouttemphum.png', 'dayouttemphum.png', 'dayouttemphum.png', 'dayouttemphum.png', 'dayouttemphum.png'], + 'dayrain.png', // Rainfall + 'dayrainrate.png', // Rainfall rate + ['dayinouthum.png', 'dayinouthum.png'], // Humidity: outdoor, indoor + 'daybarometer.png', // Pressure + 'daywind.png', // Wind speed + 'daywinddir.png', // Wind direction + (config.showUvGauge ? 'dayuv.png' : null), // UV graph if UV sensor is present | =null if no UV sensor + (config.showSolarGauge ? 'dayradiation.png' : null), // Solar rad graph if Solar sensor is present | Solar =null if no Solar sensor + (config.showRoseGauge ? 'daywindvec.png' : null), // Wind direction if Rose is enabled | =null if Rose is disabled + (config.showCloudGauge ? 'daybarometer.png' : null) // Pressure for cloud height | =null if Cloud Height is disabled + ]; + break; + case 7: + // WLCOM + realtimeVer = 10; // minimum version of the realtime JSON file required + config.realTimeURL = config.realTimeUrlWLCOM; + config.showPopupGraphs = false; // config.tipImgs - no WL images available + config.showRoseGauge = false; // no windrose data from WL + config.showCloudGauge = false; + config.tipImgs = null; // config.tipImgs - no WL images available + config.showWindVariation = false; // no wind variation data from WL + break; + default: + // Who knows! + realtimeVer = 0; // minimum version of the realtime JSON file required + config.realtimeURL = null; + config.showPopupGraphs = false; + config.tipImgs = null; // config.tipImgs - unknown + } + + // Are we running on a phone device (or really low res screen)? + if ($(window).width() < 480) { + // Change the gauge scaling + config.gaugeScaling = config.gaugeMobileScaling; + // Switch off graphs? + config.showPopupGraphs = config.mobileShowGraphs; + } else { + config.gaugeScaling = 1; + } + + // Logo images are used to 'personalise' the gauge backgrounds + // To add a logo to a gauge, add the parameter: + // params.customLayer = _imgBackground; + // to the corresponding drawXxxx() function below. + // + // These are for demo only, to add them remove the comments around the following lines, and + // the _imgBackground definition line above... + /* + _imgBackground = document.createElement('img'); // small logo + $(_imgBackground).attr('src', config.imgPathURL + 'logoSmall.png'); + */ + // End of logo images + + // Get the display units the user last used when they visited before - if present + displayUnits = getCookie('units'); + // Set 'units' radio buttons to match preferred units + if (displayUnits !== null) { + // User wants specific units + userUnitsSet = true; + + // temperature + setRadioCheck('rad_unitsTemp', displayUnits.temp); + data.tempunit = '°' + displayUnits.temp; + // rain + setRadioCheck('rad_unitsRain', displayUnits.rain); + data.rainunit = displayUnits.rain; + // pressure + setRadioCheck('rad_unitsPress', displayUnits.press); + data.pressunit = displayUnits.press; + // wind + setRadioCheck('rad_unitsWind', displayUnits.wind); + data.windunit = displayUnits.wind; + displayUnits.windrun = getWindrunUnits(data.windunit); + // cloud base + setRadioCheck('rad_unitsCloud', displayUnits.cloud); + data.cloudunit = displayUnits.cloud; + } else { + // Set the defaults to metric ) + // DO NOT CHANGE THESE - THE SCRIPT DEPENDS ON THESE DEFAULTS + // The units actually displayed will be read from the realtime.txt file, or from the users last visit cookie + displayUnits = { + temp : 'C', + rain : 'mm', + press : 'hPa', + wind : 'km/h', + windrun: 'km', + cloud : 'm' + }; + + data.tempunit = '°C'; + data.rainunit = 'mm'; + data.pressunit = 'hPa'; + data.windunit = 'km/h'; + data.cloudunit = 'm'; + } + + // enable popup data + if (config.showPopupData) { + ddimgtooltip.showTips = config.showPopupData; + } + + if (config.showPopupGraphs) { + // Note the number of array elements must match 'i' in ddimgtooltip.tiparray() + ddimgtooltip.tiparray[0][0] = (config.tipImgs[0][0] === null ? null : ''); + ddimgtooltip.tiparray[1][0] = (config.tipImgs[1][0] === null ? null : ''); + ddimgtooltip.tiparray[2][0] = (config.tipImgs[2] === null ? null : ''); + ddimgtooltip.tiparray[3][0] = (config.tipImgs[3] === null ? null : ''); + ddimgtooltip.tiparray[4][0] = (config.tipImgs[4][0] === null ? null : ''); + ddimgtooltip.tiparray[5][0] = (config.tipImgs[5] === null ? null : ''); + ddimgtooltip.tiparray[6][0] = (config.tipImgs[6] === null ? null : ''); + ddimgtooltip.tiparray[7][0] = (config.tipImgs[7] === null ? null : ''); + ddimgtooltip.tiparray[8][0] = (config.tipImgs[8] === null ? null : ''); + ddimgtooltip.tiparray[9][0] = (config.tipImgs[9] === null ? null : ''); + ddimgtooltip.tiparray[10][0] = (config.tipImgs[10] === null ? null : ''); + ddimgtooltip.tiparray[11][0] = (config.tipImgs[11] === null ? null : ''); + } + + // draw the status gadgets first, they will display any errors in the initial set-up + ledIndicator = singleLed.getInstance(); + statusScroller = singleStatus.getInstance(); + statusTimer = singleTimer.getInstance(); + + gaugeTemp = singleTemp.getInstance(); + // Export gaugeTemp.update() so it can be called from the HTML code + if (gaugeTemp) {gauges.doTemp = gaugeTemp.update;} + + gaugeDew = singleDew.getInstance(); + // Export gaugeDew.update() so it can be called from the HTML code + if (gaugeDew) {gauges.doDew = gaugeDew.update;} + + gaugeHum = singleHum.getInstance(); + // Export gaugeHum.update() so it can be called from the HTML code + if (gaugeHum) {gauges.doHum = gaugeHum.update;} + + gaugeBaro = singleBaro.getInstance(); + + gaugeWind = singleWind.getInstance(); + gaugeDir = singleDir.getInstance(); + + gaugeRain = singleRain.getInstance(); + gaugeRRate = singleRRate.getInstance(); + + // remove the UV gauge? + if (!config.showUvGauge) { + $('#canvas_uv').parent().remove(); + } else { + gaugeUV = singleUV.getInstance(); + } + + // remove the Solar gauge? + if (!config.showSolarGauge) { + $('#canvas_solar').parent().remove(); + } else { + gaugeSolar = singleSolar.getInstance(); + } + + // remove the Wind Rose? + if (!config.showRoseGauge) { + $('#canvas_rose').parent().remove(); + } else { + gaugeRose = singleRose.getInstance(); + } + + // remove the cloud base gauge? + if (!config.showCloudGauge) { + $('#canvas_cloud').parent().remove(); + // and remove cloudbase unit selection options + $('#cloud').parent().remove(); + } else { + gaugeCloud = singleCloudBase.getInstance(); + } + + // Set the language + changeLang(strings, false); + + if (!dashboard) { + // Go do get the data! + getRealtime(); + + // start a timer to update the status time + tickTockInterval = setInterval( + function () { + $.publish('gauges.clockTick', null); + }, + 1000); + + // start a timer to stop the page updates after the timeout period + if (config.pageUpdateLimit > 0 && getUrlParam('pageUpdate') !== config.pageUpdatePswd) { + setTimeout(pageTimeout, config.pageUpdateLimit * 60 * 1000); + } + } + }, + + // + // singleXXXX functions define a singleton for each of the gauges + // + + // + // Singleton for the LED Indicator + // + singleLed = (function () { + var instance; // Stores a reference to the Singleton + var led; // Stores a reference to the SS LED + + function init() { + // create led indicator + if ($('#canvas_led').length) { + led = new steelseries.Led( + 'canvas_led', { + ledColor: steelseries.LedColor.GREEN_LED, + size : $('#canvas_led').width() + }); + + setTitle(strings.led_title); + } + + function setTitle(newTitle) { + $('#canvas_led').attr('title', newTitle); + } + + function setLedColor(newColour) { + if (led) { + led.setLedColor(newColour); + } + } + + function setLedOnOff(onState) { + if (led) { + led.setLedOnOff(onState); + } + } + + function blink(blinkState) { + if (led) { + led.blink(blinkState); + } + } + + return { + setTitle : setTitle, + setLedColor: setLedColor, + setLedOnOff: setLedOnOff, + blink : blink + }; + } + + return { + // Get the Singleton instance if one exists + // or create one if it doesn't + getInstance: function () { + if (!instance) { + instance = init(); + } + return instance; + } + }; + })(), + + // + // Singleton for the Status Scroller + // + singleStatus = (function () { + var instance; // Stores a reference to the Singleton + var scroller; // Stores a reference to the SS scrolling display + + function init() { + // create forecast display + if ($('#canvas_status').length) { + scroller = new steelseries.DisplaySingle( + 'canvas_status', { + width : $('#canvas_status').width(), + height : $('#canvas_status').height(), + lcdColor : gaugeGlobals.lcdColour, + unitStringVisible: false, + value : strings.statusStr, + digitalFont : config.digitalForecast, + valuesNumeric : false, + autoScroll : true, + alwaysScroll : false + }); + } + + function setValue(newTxt) { + if (scroller) { + scroller.setValue(newTxt); + } + } + + return {setText: setValue}; + } + + return { + // Get the Singleton instance if one exists + // or create one if it doesn't + getInstance: function () { + if (!instance) { + instance = init(); + } + return instance; + } + }; + })(), + + // + // Singleton for the Status Timer + // + singleTimer = (function () { + var instance, // Stores a reference to the Singleton + lcd, // Stores a reference to the SS LED + count = 1; + + function init() { + function tick() { + if (lcd) { + lcd.setValue(count); + count += config.longPoll ? 1 : -1; + } + } + + function reset(val) { + count = val; + } + + function setValue(newVal) { + if (lcd) { + lcd.setValue(newVal); + } + } + + // create timer display + if ($('#canvas_timer').length) { + lcd = new steelseries.DisplaySingle( + 'canvas_timer', { + width : $('#canvas_timer').width(), + height : $('#canvas_timer').height(), + lcdColor : gaugeGlobals.lcdColour, + lcdDecimals : 0, + unitString : strings.timer, + unitStringVisible: true, + digitalFont : config.digitalFont, + value : count + }); + // subscribe to data updates + $.subscribe('gauges.clockTick', tick); + } + + return { + reset : reset, + setValue: setValue + }; + } + + return { + // Get the Singleton instance if one exists + // or create one if it doesn't + getInstance: function () { + if (!instance) { + instance = init(); + } + return instance; + } + }; + })(), + + // + // Singleton for the Temperature Gauge + // + singleTemp = (function () { + var instance; // Stores a reference to the Singleton + var ssGauge; // Stores a reference to the SS Gauge + var cache = {}; // Stores various config values and parameters + + function init() { + var params = $.extend(true, {}, commonParams); + + // define temperature gauge start values + cache.sections = createTempSections(true); + cache.areas = []; + cache.minValue = gaugeGlobals.tempScaleDefMinC; + cache.maxValue = gaugeGlobals.tempScaleDefMaxC; + cache.title = strings.temp_title_out; + cache.value = gaugeGlobals.tempScaleDefMinC + 0.0001; + cache.maxMinVisible = false; + cache.selected = 'out'; + + // create temperature radial gauge + if ($('#canvas_temp').length) { + params.size = Math.ceil($('#canvas_temp').width() * config.gaugeScaling); + params.section = cache.sections; + params.area = cache.areas; + params.minValue = cache.minValue; + params.maxValue = cache.maxValue; + params.thresholdVisible = false; + params.minMeasuredValueVisible = cache.maxMinVisible; + params.maxMeasuredValueVisible = cache.maxMinVisible; + params.titleString = cache.title; + params.unitString = data.tempunit; + params.trendVisible = gaugeGlobals.tempTrendVisible; + // params.customLayer = _imgBackground; // uncomment to add a background image - See Logo Images above + + ssGauge = new steelseries.Radial('canvas_temp', params); + ssGauge.setValue(cache.value); + + // over-ride CSS applied size? + if (config.gaugeScaling !== 1) { + $('#canvas_temp').css({width: params.size + 'px', height: params.size + 'px'}); + } + + // add a shadow to the gauge + if (config.showGaugeShadow) { + $('#canvas_temp').css(gaugeShadow(params.size)); + } + + // remove indoor temperature/humidity options? + if (!config.showIndoorTempHum) { + $('#rad_temp1').remove(); + $('#lab_temp1').remove(); + $('#rad_temp2').remove(); + $('#lab_temp2').remove(); + $('#rad_hum1').remove(); + $('#lab_hum1').remove(); + $('#rad_hum2').remove(); + $('#lab_hum2').remove(); + } + + // subscribe to data updates + $.subscribe('gauges.dataUpdated', update); + $.subscribe('gauges.graphUpdate', updateGraph); + } else { + // cannot draw gauge, return null + return null; + } + + function update() { + var sel = cache.selected; + + // Argument length === 1 when called from radio input + // Argument length === 2 when called from event handler + if (arguments.length === 1) { + sel = arguments[0].value; + } + + // if rad isn't specified, just use existing value + var t1, scaleStep, tip; + + cache.minValue = data.tempunit[1] === 'C' ? gaugeGlobals.tempScaleDefMinC : gaugeGlobals.tempScaleDefMinF; + cache.maxValue = data.tempunit[1] === 'C' ? gaugeGlobals.tempScaleDefMaxC : gaugeGlobals.tempScaleDefMaxF; + + if (sel === 'out') { + cache.low = extractDecimal(data.tempTL); + cache.high = extractDecimal(data.tempTH); + cache.lowScale = getMinTemp(cache.minValue); + cache.highScale = getMaxTemp(cache.maxValue); + cache.value = extractDecimal(data.temp); + cache.title = strings.temp_title_out; + cache.loc = strings.temp_out_info; + cache.trendVal = extractDecimal(data.temptrend); + cache.popupImg = 0; + if (gaugeGlobals.tempTrendVisible) { + t1 = tempTrend(+cache.trendVal, data.tempunit, false); + if (t1 === -9999) { + // trend value isn't currently available + cache.trend = steelseries.TrendState.OFF; + } else if (t1 > 0) { + cache.trend = steelseries.TrendState.UP; + } else if (t1 < 0) { + cache.trend = steelseries.TrendState.DOWN; + } else { + cache.trend = steelseries.TrendState.STEADY; + } + } + } else { + // Indoor + cache.title = strings.temp_title_in; + cache.loc = strings.temp_in_info; + cache.value = extractDecimal(data.intemp); + cache.popupImg = 1; + if (data.intempTL && data.intempTH) { + // Indoor - and Max/Min values supplied + cache.low = extractDecimal(data.intempTL); + cache.high = extractDecimal(data.intempTH); + cache.lowScale = getMinTemp(cache.minValue); + cache.highScale = getMaxTemp(cache.maxValue); + } else { + // Indoor - no Max/Min values supplied + cache.low = cache.value; + cache.lowScale = cache.value; + cache.high = cache.value; + cache.highScale = cache.value; + } + if (gaugeGlobals.tempTrendVisible) { + cache.trend = steelseries.TrendState.OFF; + } + } + + // has the gauge type changed? + if (cache.selected !== sel) { + cache.selected = sel; + // Change gauge title + ssGauge.setTitleString(cache.title); + ssGauge.setMaxMeasuredValueVisible(cache.maxMinVisible); + ssGauge.setMinMeasuredValueVisible(cache.maxMinVisible); + if (config.showPopupGraphs && config.tipImgs[0][cache.popupImg] !== null) { + var cacheDefeat = '?' + $('#imgtip0_img').attr('src').split('?')[1]; + $('#imgtip0_img').attr('src', config.imgPathURL + config.tipImgs[0][cache.popupImg] + cacheDefeat); + } + } + + // auto scale the ranges + scaleStep = data.tempunit[1] === 'C' ? 10 : 20; + while (cache.lowScale < cache.minValue) { + cache.minValue -= scaleStep; + if (cache.highScale <= cache.maxValue - scaleStep) { + cache.maxValue -= scaleStep; + } + } + while (cache.highScale > cache.maxValue) { + cache.maxValue += scaleStep; + if (cache.minValue >= cache.minValue + scaleStep) { + cache.minValue += scaleStep; + } + } + + if (cache.minValue !== ssGauge.getMinValue() || cache.maxValue !== ssGauge.getMaxValue()) { + ssGauge.setMinValue(cache.minValue); + ssGauge.setMaxValue(cache.maxValue); + ssGauge.setValue(cache.minValue); + } + if (cache.selected === 'out') { + cache.areas = [steelseries.Section(+cache.low, +cache.high, gaugeGlobals.minMaxArea)]; + } else if (data.intempTL && data.intempTH) { + // Indoor and min/max avaiable + cache.areas = [steelseries.Section(+cache.low, +cache.high, gaugeGlobals.minMaxArea)]; + } else { + // Nndoor no min/max avaiable + cache.areas = []; + } + + if (gaugeGlobals.tempTrendVisible) { + ssGauge.setTrend(cache.trend); + } + ssGauge.setArea(cache.areas); + ssGauge.setValueAnimated(+cache.value); + + if (ddimgtooltip.showTips) { + // update tooltip + if (cache.selected === 'out') { + tip = cache.loc + ' - ' + strings.lowestF_info + ': ' + cache.low + data.tempunit + ' ' + strings.at + ' ' + data.TtempTL + + ' | ' + + strings.highestF_info + ': ' + cache.high + data.tempunit + ' ' + strings.at + ' ' + data.TtempTH; + if (cache.trendVal !== -9999) { + tip += '
' + + strings.temp_trend_info + ': ' + tempTrend(cache.trendVal, data.tempunit, true) + + ' ' + cache.trendVal + data.tempunit + '/h'; + } + } else if (data.TintempTL && data.TintempTH) { + // Indoor and min/max available + tip = cache.loc + ' - ' + strings.lowestF_info + ': ' + cache.low + data.tempunit + ' ' + strings.at + ' ' + data.TintempTL + + ' | ' + + strings.highestF_info + ': ' + cache.high + data.tempunit + ' ' + strings.at + ' ' + data.TintempTH; + } else { + // Indoor no min/max + tip = cache.loc + ': ' + data.intemp + data.tempunit; + } + $('#imgtip0_txt').html(tip); + } + } // End of update() + + function updateGraph(evnt, cacheDefeat) { + if (config.tipImgs[0][cache.popupImg] !== null) { + $('#imgtip0_img').attr('src', config.imgPathURL + config.tipImgs[0][cache.popupImg] + cacheDefeat); + } + } + + return { + data : cache, + update: update, + gauge : ssGauge + }; + } // End of init() + + return { + // Get the Singleton instance if one exists + // or create one if it doesn't + getInstance: function () { + if (!instance) { + instance = init(); + } + return instance; + } + }; + })(), // End singleTemp() + + // + // Singleton for the Dewpoint Gauge + // + singleDew = (function () { + var instance; // Stores a reference to the Singleton + var ssGauge; // Stores a reference to the SS Gauge + var cache = {}; // Stores various config values and parameters + + function init() { + var params = $.extend(true, {}, commonParams); + var tmp; + + // define dew point gauge start values + cache.sections = createTempSections(true); + cache.areas = []; + cache.minValue = gaugeGlobals.tempScaleDefMinC; + cache.maxValue = gaugeGlobals.tempScaleDefMaxC; + cache.value = gaugeGlobals.tempScaleDefMinC + 0.0001; + // Has the end user selected a preferred 'scale' before + tmp = getCookie('dewGauge'); + cache.selected = tmp !== null ? tmp : config.dewDisplayType; + setRadioCheck('rad_dew', cache.selected); + switch (cache.selected) { + case 'dew': + cache.title = strings.dew_title; + cache.popupImg = 0; + break; + case 'app': + cache.title = strings.apptemp_title; + cache.popupImg = 1; + break; + case 'wnd': + cache.title = strings.chill_title; + cache.popupImg = 2; + break; + case 'hea': + cache.title = strings.heat_title; + cache.popupImg = 3; + break; + case 'hum': + cache.title = strings.humdx_title; + cache.popupImg = 4; + // no default + } + cache.minMeasuredVisible = false; + cache.maxMeasuredVisible = false; + + // create dew point radial gauge + if ($('#canvas_dew').length) { + params.size = Math.ceil($('#canvas_dew').width() * config.gaugeScaling); + params.section = cache.sections; + params.area = cache.areas; + params.minValue = cache.minValue; + params.maxValue = cache.maxValue; + params.thresholdVisible = false; + params.titleString = cache.title; + params.unitString = data.tempunit; + + ssGauge = new steelseries.Radial('canvas_dew', params); + ssGauge.setValue(cache.value); + + // over-ride CSS applied size? + if (config.gaugeScaling !== 1) { + $('#canvas_dew').css({width: params.size + 'px', height: params.size + 'px'}); + } + + // add a shadow to the gauge + if (config.showGaugeShadow) { + $('#canvas_dew').css(gaugeShadow(params.size)); + } + + // subscribe to data updates + $.subscribe('gauges.dataUpdated', update); + $.subscribe('gauges.graphUpdate', updateGraph); + } else { + // cannot draw gauge, return null + return null; + } + + function update() { + // if rad isn't specified, just use existing value + var sel = cache.selected; + + // Argument length === 2 when called from event handler + if (arguments.length === 1) { + sel = arguments[0].value; + // save the choice in a cookie + setCookie('dewGauge', sel); + } + + var tip, scaleStep; + + cache.minValue = data.tempunit[1] === 'C' ? gaugeGlobals.tempScaleDefMinC : gaugeGlobals.tempScaleDefMinF; + cache.maxValue = data.tempunit[1] === 'C' ? gaugeGlobals.tempScaleDefMaxC : gaugeGlobals.tempScaleDefMaxF; + + cache.lowScale = getMinTemp(cache.minValue); + cache.highScale = getMaxTemp(cache.maxValue); + + switch (sel) { + case 'dew': // dew point + cache.low = extractDecimal(data.dewpointTL); + cache.high = extractDecimal(data.dewpointTH); + cache.value = extractDecimal(data.dew); + cache.areas = [steelseries.Section(+cache.low, +cache.high, gaugeGlobals.minMaxArea)]; + cache.title = strings.dew_title; + cache.minMeasuredVisible = false; + cache.maxMeasuredVisible = false; + cache.popupImg = 0; + tip = strings.dew_info + ':' + + '
' + + '- ' + strings.lowest_info + ': ' + cache.low + data.tempunit + ' ' + strings.at + ' ' + data.TdewpointTL + + ' | ' + strings.highest_info + ': ' + cache.high + data.tempunit + ' ' + strings.at + ' ' + data.TdewpointTH; + break; + case 'app': // apparent temperature + cache.low = extractDecimal(data.apptempTL); + cache.high = extractDecimal(data.apptempTH); + cache.value = extractDecimal(data.apptemp); + cache.areas = [steelseries.Section(+cache.low, +cache.high, gaugeGlobals.minMaxArea)]; + cache.title = strings.apptemp_title; + cache.minMeasuredVisible = false; + cache.maxMeasuredVisible = false; + cache.popupImg = 1; + tip = tip = strings.apptemp_info + ':' + + '
' + + '- ' + strings.lowestF_info + ': ' + cache.low + data.tempunit + ' ' + strings.at + ' ' + data.TapptempTL + + ' | ' + strings.highestF_info + ': ' + cache.high + data.tempunit + ' ' + strings.at + ' ' + data.TapptempTH; + break; + case 'wnd': // wind chill + cache.low = extractDecimal(data.wchillTL); + cache.high = extractDecimal(data.wchill); + cache.value = extractDecimal(data.wchill); + cache.areas = []; + cache.title = strings.chill_title; + cache.minMeasuredVisible = true; + cache.maxMeasuredVisible = false; + cache.popupImg = 2; + tip = strings.chill_info + ':' + + '
' + + '- ' + strings.lowest_info + ': ' + cache.low + data.tempunit + ' ' + strings.at + ' ' + data.TwchillTL; + break; + case 'hea': // heat index + cache.low = extractDecimal(data.heatindex); + cache.high = extractDecimal(data.heatindexTH); + cache.value = extractDecimal(data.heatindex); + cache.areas = []; + cache.title = strings.heat_title; + cache.minMeasuredVisible = false; + cache.maxMeasuredVisible = true; + cache.popupImg = 3; + tip = strings.heat_info + ':' + + '
' + + '- ' + strings.highest_info + ': ' + cache.high + data.tempunit + ' ' + strings.at + ' ' + data.TheatindexTH; + break; + case 'hum': // humidex + cache.low = extractDecimal(data.humidex); + cache.high = extractDecimal(data.humidex); + cache.value = extractDecimal(data.humidex); + cache.areas = []; + cache.title = strings.humdx_title; + cache.minMeasuredVisible = false; + cache.maxMeasuredVisible = false; + cache.popupImg = 4; + tip = strings.humdx_info + ': ' + cache.value + data.tempunit; + break; + // no default + } + + if (cache.selected !== sel) { + cache.selected = sel; + // change gauge title + ssGauge.setTitleString(cache.title); + // and graph image + if (config.showPopupGraphs && config.tipImgs[1][cache.popupImg] !== null) { + var cacheDefeat = '?' + $('#imgtip1_img').attr('src').split('?')[1]; + $('#imgtip1_img').attr('src', config.imgPathURL + config.tipImgs[1][cache.popupImg] + cacheDefeat); + } + } + + // auto scale the ranges + scaleStep = data.tempunit[1] === 'C' ? 10 : 20; + while (cache.lowScale < cache.minValue) { + cache.minValue -= scaleStep; + if (cache.highScale <= cache.maxValue - scaleStep) { + cache.maxValue -= scaleStep; + } + } + while (cache.highScale > cache.maxValue) { + cache.maxValue += scaleStep; + if (cache.minValue >= cache.minValue + scaleStep) { + cache.minValue += scaleStep; + } + } + + if (cache.minValue !== ssGauge.getMinValue() || cache.maxValue !== ssGauge.getMaxValue()) { + ssGauge.setMinValue(cache.minValue); + ssGauge.setMaxValue(cache.maxValue); + ssGauge.setValue(cache.minValue); + } + ssGauge.setMinMeasuredValueVisible(cache.minMeasuredVisible); + ssGauge.setMaxMeasuredValueVisible(cache.maxMeasuredVisible); + ssGauge.setMinMeasuredValue(+cache.low); + ssGauge.setMaxMeasuredValue(+cache.high); + ssGauge.setArea(cache.areas); + ssGauge.setValueAnimated(+cache.value); + + if (ddimgtooltip.showTips) { + // update tooltip + $('#imgtip1_txt').html(tip); + } + } + + function updateGraph(evnt, cacheDefeat) { + if (config.tipImgs[1][cache.popupImg] !== null) { + $('#imgtip1_img').attr('src', config.imgPathURL + config.tipImgs[1][cache.popupImg] + cacheDefeat); + } + } + + return { + data : cache, + update: update, + gauge : ssGauge + }; + } // End of init() + + return { + // Get the Singleton instance if one exists + // or create one if it doesn't + getInstance: function () { + if (!instance) { + instance = init(); + } + return instance; + } + }; + })(), // End of singleDew() + + // + // Singleton for the Rainfall Gauge + // + singleRain = (function () { + var instance; // Stores a reference to the Singleton + var ssGauge; // Stores a reference to the SS Gauge + var cache = {}; // Stores various config values and parameters + + function init() { + var params = $.extend(true, {}, commonParams); + + // define rain gauge start values + cache.maxValue = gaugeGlobals.rainScaleDefMaxmm; + cache.value = 0.0001; + cache.title = strings.rain_title; + cache.lcdDecimals = 1; + cache.scaleDecimals = 1; + cache.labelNumberFormat = gaugeGlobals.labelFormat; + cache.sections = (gaugeGlobals.rainUseSectionColours ? createRainfallSections(true) : []); + cache.valGrad = (gaugeGlobals.rainUseGradientColours ? createRainfallGradient(true) : null); + + // create rain radial bargraph gauge + if ($('#canvas_rain').length) { + params.size = Math.ceil($('#canvas_rain').width() * config.gaugeScaling); + params.maxValue = cache.maxValue; + params.thresholdVisible = false; + params.titleString = cache.title; + params.unitString = data.rainunit; + params.valueColor = steelseries.ColorDef.BLUE; + params.valueGradient = cache.valGrad; + params.useValueGradient = gaugeGlobals.rainUseGradientColours; + params.useSectionColors = gaugeGlobals.rainUseSectionColour; + params.useSectionColors = gaugeGlobals.rainUseSectionColours; + params.labelNumberFormat = cache.labelNumberFormat; + params.fractionalScaleDecimals = cache.scaleDecimals; + params.niceScale = false; + + ssGauge = new steelseries.RadialBargraph('canvas_rain', params); + ssGauge.setValue(cache.value); + + // over-ride CSS applied size? + if (config.gaugeScaling !== 1) { + $('#canvas_rain').css({width: params.size + 'px', height: params.size + 'px'}); + } + + // add a shadow to the gauge + if (config.showGaugeShadow) { + $('#canvas_rain').css(gaugeShadow(params.size)); + } + + // subscribe to data updates + $.subscribe('gauges.dataUpdated', update); + $.subscribe('gauges.graphUpdate', updateGraph); + } else { + // cannot draw gauge, return null + return null; + } + + function update() { + cache.value = extractDecimal(data.rfall); + if (data.rainunit === 'mm') { // 10, 20, 30... + cache.maxValue = Math.max(nextHighest(cache.value, 10), gaugeGlobals.rainScaleDefMaxmm); + } else { + // inches 0.5, 1.0, 2.0, 3.0 ... 10.0, 12.0, 14.0 + if (cache.value <= 1) { + cache.maxValue = Math.max(nextHighest(cache.value, 0.5), gaugeGlobals.rainScaleDefMaxIn); + } else if (cache.value <= 6) { + cache.maxValue = Math.max(nextHighest(cache.value, 1), gaugeGlobals.rainScaleDefMaxIn); + } else { + cache.maxValue = Math.max(nextHighest(cache.value, 2), gaugeGlobals.rainScaleDefMaxIn); + } + cache.scaleDecimals = cache.maxValue < 1 ? 2 : 1; + } + + if (cache.maxValue !== ssGauge.getMaxValue()) { + // Gauge scale is too low, increase it. + // First set the pointer back to zero so we get a nice animation + ssGauge.setValue(0); + // and redraw the gauge with the new scale + ssGauge.setFractionalScaleDecimals(cache.scaleDecimals); + ssGauge.setMaxValue(cache.maxValue); + } + ssGauge.setValueAnimated(cache.value); + + if (ddimgtooltip.showTips) { + // update tooltip + $('#imgtip2_txt').html(strings.LastRain_info + ': ' + data.LastRained); + } + } // End of update() + + function updateGraph(evnt, cacheDefeat) { + if (config.tipImgs[2] !== null) { + $('#imgtip2_img').attr('src', config.imgPathURL + config.tipImgs[2] + cacheDefeat); + } + } + + return { + data : cache, + update: update, + gauge : ssGauge + }; + } // End of init() + + return { + // Get the Singleton instance if one exists + // or create one if it doesn't + getInstance: function () { + if (!instance) { + instance = init(); + } + return instance; + } + }; + })(), + + // + // Singleton for the Rainfall Rate Gauge + // + singleRRate = (function () { + var instance; // Stores a reference to the Singleton + var ssGauge; // Stores a reference to the SS Gauge + var cache = {}; // Stores various config values and parameters + + function init() { + var params = $.extend(true, {}, commonParams); + + // define rain rate gauge start values + cache.maxMeasured = 0; + cache.maxValue = gaugeGlobals.rainRateScaleDefMaxmm; + cache.value = 0.0001; + cache.title = strings.rrate_title; + cache.lcdDecimals = 1; + cache.scaleDecimals = 0; + cache.labelNumberFormat = gaugeGlobals.labelFormat; + cache.sections = createRainRateSections(true); + + // create rain rate radial gauge + if ($('#canvas_rrate').length) { + params.size = Math.ceil($('#canvas_rrate').width() * config.gaugeScaling); + params.section = cache.sections; + params.maxValue = cache.maxValue; + params.thresholdVisible = false; + params.maxMeasuredValueVisible = true; + params.titleString = cache.title; + params.unitString = data.rainunit + '/h'; + params.lcdDecimals = cache.lcdDecimals; + params.labelNumberFormat = cache.labelNumberFormat; + params.fractionalScaleDecimals = cache.scaleDecimals; + params.niceScale = false; + + ssGauge = new steelseries.Radial('canvas_rrate', params); + ssGauge.setMaxMeasuredValue(cache.maxMeasured); + ssGauge.setValue(cache.value); + + // over-ride CSS applied size? + if (config.gaugeScaling !== 1) { + $('#canvas_rrate').css({width: params.size + 'px', height: params.size + 'px'}); + } + + // add a shadow to the gauge + if (config.showGaugeShadow) { + $('#canvas_rrate').css(gaugeShadow(params.size)); + } + + // subscribe to data updates + $.subscribe('gauges.dataUpdated', update); + $.subscribe('gauges.graphUpdate', updateGraph); + } else { + // cannot draw gauge, return null + return null; + } + + function update() { + var tip; + + cache.value = extractDecimal(data.rrate); + cache.maxMeasured = extractDecimal(data.rrateTM); + cache.overallMax = Math.max(cache.maxMeasured, cache.value); // workaround for VWS bug, not supplying correct max value today + + if (data.rainunit === 'mm') { // 10, 20, 30... + cache.maxValue = nextHighest(cache.overallMax, 10); + } else { + // inches 0.5, 1.0, 2.0, 3.0 ... 10, 20, 30... + if (cache.overallMax <= 0.5) { + cache.maxValue = 0.5; + } else if (cache.overallMax <= 10) { + cache.maxValue = nextHighest(cache.overallMax, 1); + } else { + cache.maxValue = nextHighest(cache.overallMax, 10); + } + cache.scaleDecimals = cache.maxValue < 1 ? 2 : (cache.maxValue < 7 ? 1 : 0); + } + + if (cache.maxValue !== ssGauge.getMaxValue()) { + ssGauge.setValue(0); + ssGauge.setFractionalScaleDecimals(cache.scaleDecimals); + ssGauge.setMaxValue(cache.maxValue); + } + + ssGauge.setValueAnimated(cache.value); + ssGauge.setMaxMeasuredValue(cache.maxMeasured); + + if (ddimgtooltip.showTips) { + // update tooltip + tip = strings.rrate_info + ':
' + + '- ' + strings.maximum_info + ': ' + data.rrateTM + ' ' + data.rainunit + '/h ' + strings.at + ' ' + data.TrrateTM + + ' | ' + strings.max_hour_info + ': ' + extractDecimal(data.hourlyrainTH) + ' ' + data.rainunit + ' ' + + strings.at + ' ' + data.ThourlyrainTH; + $('#imgtip3_txt').html(tip); + } + } // End of update() + + function updateGraph(evnt, cacheDefeat) { + if (config.tipImgs[3] !== null) { + $('#imgtip3_img').attr('src', config.imgPathURL + config.tipImgs[3] + cacheDefeat); + } + } + return { + data : cache, + update: update, + gauge : ssGauge + }; + } // End of init() + + return { + // Get the Singleton instance if one exists + // or create one if it doesn't + getInstance: function () { + if (!instance) { + instance = init(); + } + return instance; + } + }; + })(), + + // + // Singleton for the Humidity Gauge + // + singleHum = (function () { + var instance; // Stores a reference to the Singleton + var ssGauge; // Stores a reference to the SS Gauge + var cache = {}; // Stores various config values and parameters + + function init() { + var params = $.extend(true, {}, commonParams); + + // define humidity gauge start values + cache.areas = []; + cache.value = 0.0001; + cache.title = strings.hum_title_out; + cache.selected = 'out'; + + // create humidity radial gauge + if ($('#canvas_hum').length) { + params.size = Math.ceil($('#canvas_hum').width() * config.gaugeScaling); + params.section = [ + steelseries.Section(0, 20, 'rgba(255,255,0,0.3)'), + steelseries.Section(20, 80, 'rgba(0,255,0,0.3)'), + steelseries.Section(80, 100, 'rgba(255,0,0,0.3)') + ]; + params.area = cache.areas; + params.maxValue = 100; + params.thresholdVisible = false; + params.titleString = cache.title; + params.unitString = 'RH%'; + + ssGauge = new steelseries.Radial('canvas_hum', params); + ssGauge.setValue(cache.value); + + // over-ride CSS applied size? + if (config.gaugeScaling !== 1) { + $('#canvas_hum').css({width: params.size + 'px', height: params.size + 'px'}); + } + + // add a shadow to the gauge + if (config.showGaugeShadow) { + $('#canvas_hum').css(gaugeShadow(params.size)); + } + + // subscribe to data updates + $.subscribe('gauges.dataUpdated', update); + $.subscribe('gauges.graphUpdate', updateGraph); + } else { + // cannot draw gauge, return null + return null; + } + + function update() { + var radio; + // Argument length === 2 when called from event handler + if (arguments.length === 1) { + radio = arguments[0]; + } + + // if rad isn't specified, just use existing value + var sel = (typeof radio === 'undefined' ? cache.selected : radio.value), + tip; + + if (sel === 'out') { + cache.value = extractDecimal(data.hum); + cache.areas = [steelseries.Section(+extractDecimal(data.humTL), +extractDecimal(data.humTH), gaugeGlobals.minMaxArea)]; + cache.title = strings.hum_title_out; + cache.popupImg = 0; + } else { + cache.value = extractDecimal(data.inhum); + if (data.inhumTL && data.inhumTH) { + cache.areas = [steelseries.Section(+extractDecimal(data.inhumTL), +extractDecimal(data.inhumTH), gaugeGlobals.minMaxArea)]; + } else { + cache.areas = []; + } + cache.title = strings.hum_title_in; + cache.popupImg = 1; + } + + if (cache.selected !== sel) { + cache.selected = sel; + // Change gauge title + ssGauge.setTitleString(cache.title); + if (config.showPopupGraphs && config.tipImgs[4][cache.popupImg] !== null) { + var cacheDefeat = '?' + $('#imgtip4_img').attr('src').split('?')[1]; + $('#imgtip4_img').attr('src', config.imgPathURL + config.tipImgs[4][cache.popupImg] + cacheDefeat); + } + } + + ssGauge.setArea(cache.areas); + ssGauge.setValueAnimated(cache.value); + + if (ddimgtooltip.showTips) { + // update tooltip + if (cache.selected === 'out') { + tip = strings.hum_out_info + ':' + + '
' + + '- ' + strings.minimum_info + ': ' + extractDecimal(data.humTL) + '% ' + strings.at + ' ' + data.ThumTL + + ' | ' + strings.maximum_info + ': ' + extractDecimal(data.humTH) + '% ' + strings.at + ' ' + data.ThumTH; + } else if (data.inhumTL && data.inhumTH) { + // we have indoor high/low data + tip = strings.hum_in_info + ':' + + '
' + + '- ' + strings.minimum_info + ': ' + extractDecimal(data.inhumTL) + '% ' + strings.at + ' ' + data.TinhumTL + + ' | ' + strings.maximum_info + ': ' + extractDecimal(data.inhumTH) + '% ' + strings.at + ' ' + data.TinhumTH; + } else { + // no indoor high/low data + tip = strings.hum_in_info + ': ' + extractDecimal(data.inhum) + '%'; + } + $('#imgtip4_txt').html(tip); + } + } // End of update() + + function updateGraph(evnt, cacheDefeat) { + if (config.tipImgs[4][cache.popupImg] !== null) { + $('#imgtip4_img').attr('src', config.imgPathURL + config.tipImgs[4][cache.popupImg] + cacheDefeat); + } + } + + return { + data : cache, + update: update, + gauge : ssGauge + }; + } // End of init() + + return { + // Get the Singleton instance if one exists + // or create one if it doesn't + getInstance: function () { + if (!instance) { + instance = init(); + } + return instance; + } + }; + })(), + + // + // Singleton for the Barometer Gauge + // + singleBaro = (function () { + var instance; // Stores a reference to the Singleton + var ssGauge; // Stores a reference to the SS Gauge + var cache = {}; // Stores various config values and parameters + + function init() { + var params = $.extend(true, {}, commonParams); + + // define pressure/barometer gauge start values + cache.sections = []; + cache.areas = []; + cache.minValue = gaugeGlobals.baroScaleDefMinhPa; + cache.maxValue = gaugeGlobals.baroScaleDefMaxhPa; + cache.value = cache.minValue + 0.0001; + cache.title = strings.baro_title; + cache.lcdDecimals = 1; + cache.scaleDecimals = 0; + cache.labelNumberFormat = gaugeGlobals.labelFormat; + + // create pressure/barometric radial gauge + if ($('#canvas_baro').length) { + params.size = Math.ceil($('#canvas_baro').width() * config.gaugeScaling); + params.section = cache.sections; + params.area = cache.areas; + params.minValue = cache.minValue; + params.maxValue = cache.maxValue; + params.niceScale = false; + params.thresholdVisible = false; + params.titleString = cache.title; + params.unitString = data.pressunit; + params.lcdDecimals = cache.lcdDecimals; + params.trendVisible = gaugeGlobals.pressureTrendVisible; + params.labelNumberFormat = cache.labelNumberFormat; + params.fractionalScaleDecimals = cache.scaleDecimals; + + ssGauge = new steelseries.Radial('canvas_baro', params); + ssGauge.setValue(cache.value); + + // over-ride CSS applied size? + if (config.gaugeScaling !== 1) { + $('#canvas_baro').css({width: params.size + 'px', height: params.size + 'px'}); + } + + // add a shadow to the gauge + if (config.showGaugeShadow) { + $('#canvas_baro').css(gaugeShadow(params.size)); + } + + // subscribe to data updates + $.subscribe('gauges.dataUpdated', update); + $.subscribe('gauges.graphUpdate', updateGraph); + } else { + // cannot draw gauge, return null + return null; + } + + function update() { + var tip, t1, dps; + + cache.recLow = +extractDecimal(data.pressL); + cache.recHigh = +extractDecimal(data.pressH); + cache.todayLow = +extractDecimal(data.pressTL); + cache.todayHigh = +extractDecimal(data.pressTH); + cache.value = +extractDecimal(data.press); + // Convert the WD change over 3 hours to an hourly rate + cache.trendVal = +extractDecimal(data.presstrendval) / (config.weatherProgram === 2 ? 3 : 1); + + if (data.pressunit === 'hPa' || data.pressunit === 'mb') { + // default min range 990-1030 - steps of 10 hPa + cache.minValue = Math.min(nextLowest(cache.recLow - 2, 10), gaugeGlobals.baroScaleDefMinhPa); + cache.maxValue = Math.max(nextHighest(cache.recHigh + 2, 10), gaugeGlobals.baroScaleDefMaxhPa); + dps = 1; // 1 decimal place + } else if (data.pressunit === 'kPa') { + // default min range 99-105 - steps of 1 kPa + cache.minValue = Math.min(nextLowest(cache.recLow - 0.2, 1), gaugeGlobals.baroScaleDefMinkPa); + cache.maxValue = Math.max(nextHighest(cache.recHigh + 0.2, 1), gaugeGlobals.baroScaleDefMaxkPa); + dps = 2; + } else { + // inHg: default min range 29.5-30.5 - steps of 0.5 inHg + cache.minValue = Math.min(nextLowest(cache.recLow - 0.1, 0.5), gaugeGlobals.baroScaleDefMininHg); + cache.maxValue = Math.max(nextHighest(cache.recHigh + 0.1, 0.5), gaugeGlobals.baroScaleDefMaxinHg); + dps = 3; + } + cache.trendValRnd = cache.trendVal.toFixed(dps); + cache.todayLowRnd = cache.todayLow.toFixed(dps); + cache.todayHighRnd = cache.todayHigh.toFixed(dps); + + if (cache.minValue !== ssGauge.getMinValue() || cache.maxValue !== ssGauge.getMaxValue()) { + ssGauge.setMinValue(cache.minValue); + ssGauge.setMaxValue(cache.maxValue); + ssGauge.setValue(cache.minValue); + } + if (cache.recHigh === cache.todayHigh && cache.recLow === cache.todayLow) { + // VWS does not provide record hi/lo values + cache.sections = []; + cache.areas = [steelseries.Section(cache.todayLow, cache.todayHigh, gaugeGlobals.minMaxArea)]; + } else { + cache.sections = [ + steelseries.Section(cache.minValue, cache.recLow, 'rgba(255,0,0,0.5)'), + steelseries.Section(cache.recHigh, cache.maxValue, 'rgba(255,0,0,0.5)') + ]; + cache.areas = [ + steelseries.Section(cache.minValue, cache.recLow, 'rgba(255,0,0,0.5)'), + steelseries.Section(cache.recHigh, cache.maxValue, 'rgba(255,0,0,0.5)'), + steelseries.Section(cache.todayLow, cache.todayHigh, gaugeGlobals.minMaxArea) + ]; + } + + if (gaugeGlobals.pressureTrendVisible) { + // Use the baroTrend rather than simple arithmetic test - steady is more/less than zero! + t1 = baroTrend(cache.trendVal, data.pressunit, false); + if (t1 === -9999) { + // trend value isn't currently available + cache.trend = steelseries.TrendState.OFF; + } else if (t1 > 0) { + cache.trend = steelseries.TrendState.UP; + } else if (t1 < 0) { + cache.trend = steelseries.TrendState.DOWN; + } else { + cache.trend = steelseries.TrendState.STEADY; + } + ssGauge.setTrend(cache.trend); + } + + ssGauge.setArea(cache.areas); + ssGauge.setSection(cache.sections); + ssGauge.setValueAnimated(cache.value); + + if (ddimgtooltip.showTips) { + // update tooltip + tip = strings.baro_info + ':' + + '
' + + '- ' + strings.minimum_info + ': ' + cache.todayLowRnd + ' ' + data.pressunit + ' ' + strings.at + ' ' + data.TpressTL + + ' | ' + strings.maximum_info + ': ' + cache.todayHighRnd + ' ' + data.pressunit + ' ' + strings.at + ' ' + data.TpressTH; + if (cache.trendVal !== -9999) { + tip += '
' + + '- ' + strings.baro_trend_info + ': ' + baroTrend(cache.trendVal, data.pressunit, true) + ' ' + + (cache.trendValRnd > 0 ? '+' : '') + cache.trendValRnd + ' ' + data.pressunit + '/h'; + } + $('#imgtip5_txt').html(tip); + } + } // End of update() + + function updateGraph(evnt, cacheDefeat) { + if (config.tipImgs[5] !== null) { + $('#imgtip5_img').attr('src', config.imgPathURL + config.tipImgs[5] + cacheDefeat); + } + } + + return { + data : cache, + update: update, + gauge : ssGauge + }; + } // End of init() + + return { + // Get the Singleton instance if one exists + // or create one if it doesn't + getInstance: function () { + if (!instance) { + instance = init(); + } + return instance; + } + }; + })(), + + // + // Singleton for the Wind Speed Gauge + // + singleWind = (function () { + var instance; // Stores a reference to the Singleton + var ssGauge; // Stores a reference to the SS Gauge + var cache = {}; // Stores various config values and parameters + + function init() { + var params = $.extend(true, {}, commonParams); + + // define wind gauge start values + cache.maxValue = gaugeGlobals.windScaleDefMaxKph; + cache.areas = []; + cache.maxMeasured = 0; + cache.value = 0.0001; + cache.title = strings.wind_title; + + // create wind speed radial gauge + if ($('#canvas_wind').length) { + params.size = Math.ceil($('#canvas_wind').width() * config.gaugeScaling); + params.area = cache.areas; + params.maxValue = cache.maxValue; + params.niceScale = false; + params.thresholdVisible = false; + params.maxMeasuredValueVisible = true; + params.titleString = cache.title; + params.unitString = data.windunit; + + ssGauge = new steelseries.Radial('canvas_wind', params); + ssGauge.setMaxMeasuredValue(cache.maxMeasured); + ssGauge.setValue(cache.value); + + // over-ride CSS applied size? + if (config.gaugeScaling !== 1) { + $('#canvas_wind').css({width: params.size + 'px', height: params.size + 'px'}); + } + + // add a shadow to the gauge + if (config.showGaugeShadow) { + $('#canvas_wind').css(gaugeShadow(params.size)); + } + + // subscribe to data updates + $.subscribe('gauges.dataUpdated', update); + $.subscribe('gauges.graphUpdate', updateGraph); + } else { + // cannot draw gauge, return null + return null; + } + + function update() { + var tip; + + cache.value = extractDecimal(data.wlatest); + cache.average = extractDecimal(data.wspeed); + cache.gust = extractDecimal(data.wgust); + cache.maxGustToday = extractDecimal(data.wgustTM); + cache.maxAvgToday = extractDecimal(data.windTM); + + switch (data.windunit) { + case 'mph': + case 'kts': + cache.maxValue = Math.max(nextHighest(cache.maxGustToday, 10), gaugeGlobals.windScaleDefMaxMph); + break; + case 'm/s': + cache.maxValue = Math.max(nextHighest(cache.maxGustToday, 5), gaugeGlobals.windScaleDefMaxMs); + break; + default: + cache.maxValue = Math.max(nextHighest(cache.maxGustToday, 20), gaugeGlobals.windScaleDefMaxKmh); + } + cache.areas = [ + steelseries.Section(0, +cache.average, gaugeGlobals.windAvgArea), + steelseries.Section(+cache.average, +cache.gust, gaugeGlobals.minMaxArea) + ]; + if (cache.maxValue !== ssGauge.getMaxValue()) { + ssGauge.setValue(0); + ssGauge.setMaxValue(cache.maxValue); + } + + ssGauge.setArea(cache.areas); + ssGauge.setMaxMeasuredValue(cache.maxGustToday); + ssGauge.setValueAnimated(cache.value); + + if (ddimgtooltip.showTips) { + // update tooltip + tip = strings.tenminavgwind_info + ': ' + cache.average + ' ' + data.windunit + ' | ' + + strings.maxavgwind_info + ': ' + cache.maxAvgToday + ' ' + data.windunit + '
' + + strings.tenmingust_info + ': ' + cache.gust + ' ' + data.windunit + ' | ' + + strings.maxgust_info + ': ' + cache.maxGustToday + ' ' + data.windunit + ' ' + + strings.at + ' ' + data.TwgustTM + ' ' + strings.bearing_info + ': ' + data.bearingTM + + (isNaN(parseFloat(data.bearingTM)) ? '' : '° (' + getord(+data.bearingTM) + ')'); + $('#imgtip6_txt').html(tip); + } + } // End of update() + + function updateGraph(evnt, cacheDefeat) { + if (config.tipImgs[6] !== null) { + $('#imgtip6_img').attr('src', config.imgPathURL + config.tipImgs[6] + cacheDefeat); + } + } + + return { + data : cache, + update: update, + gauge : ssGauge + }; + } // End of init() + + return { + // Get the Singleton instance if one exists + // or create one if it doesn't + getInstance: function () { + if (!instance) { + instance = init(); + } + return instance; + } + }; + })(), // End of singleWind() + + // + // Singleton for the Wind Direction Gauge + // + singleDir = (function () { + var instance; // Stores a reference to the Singleton + var ssGauge; // Stores a reference to the SS Gauge + var cache = {}; // Stores various config values and parameters + + function init() { + var params = $.extend(true, {}, commonParams); + + // define wind direction gauge start values + cache.valueLatest = 0; + cache.valueAverage = 0; + cache.titles = [strings.latest_web, strings.tenminavg_web]; + + // create wind direction/compass radial gauge + if ($('#canvas_dir').length) { + params.size = Math.ceil($('#canvas_dir').width() * config.gaugeScaling); + params.pointerTypeLatest = gaugeGlobals.pointer; // default TYPE8, + params.pointerTypeAverage = gaugeGlobals.dirAvgPointer; // default TYPE8 + params.pointerColorAverage = gaugeGlobals.dirAvgPointerColour; + params.degreeScale = true; // Show degree scale rather than ordinal directions + params.pointSymbols = strings.compass; + params.roseVisible = false; + params.lcdTitleStrings = cache.titles; + params.useColorLabels = false; + + ssGauge = new steelseries.WindDirection('canvas_dir', params); + ssGauge.setValueAverage(+cache.valueAverage); + ssGauge.setValueLatest(+cache.valueLatest); + + // over-ride CSS applied size? + if (config.gaugeScaling !== 1) { + $('#canvas_dir').css({width: params.size + 'px', height: params.size + 'px'}); + } + + // add a shadow to the gauge + if (config.showGaugeShadow) { + $('#canvas_dir').css(gaugeShadow(params.size)); + } + + // subscribe to data updates + $.subscribe('gauges.dataUpdated', update); + $.subscribe('gauges.graphUpdate', updateGraph); + } else { + // cannot draw gauge, return null + return null; + } + + function update() { + var windSpd, windGst, range, tip, i, + rosePoints = 0, + roseMax = 0, + roseSectionAngle = 0, + roseAreas = []; + + cache.valueLatest = extractInteger(data.bearing); + cache.valueAverage = extractInteger(data.avgbearing); + cache.bearingFrom = extractInteger(data.BearingRangeFrom10); + cache.bearingTo = extractInteger(data.BearingRangeTo10); + + ssGauge.setValueAnimatedAverage(+cache.valueAverage); + if (cache.valueAverage === 0) { + cache.valueLatest = 0; + } + ssGauge.setValueAnimatedLatest(+cache.valueLatest); + + if (config.showWindVariation) { + windSpd = +extractDecimal(data.wspeed); + windGst = +extractDecimal(data.wgust); + switch (data.windunit.toLowerCase()) { + case 'mph': + cache.avgKnots = 0.868976242 * windSpd; + cache.gstKnots = 0.868976242 * windGst; + break; + case 'kts': + cache.avgKnots = windSpd; + cache.gstKnots = windGst; + break; + case 'm/s': + cache.avgKnots = 1.94384449 * windSpd; + cache.gstKnots = 1.94384449 * windGst; + break; + case 'km/h': + cache.avgKnots = 0.539956803 * windSpd; + cache.gstKnots = 0.539956803 * windGst; + break; + // no default + } + cache.avgKnots = Math.round(cache.avgKnots); + cache.gstKnots = Math.round(cache.gstKnots); + if (config.showWindMetar) { + ssGauge.VRB = ' - METAR: ' + ('0' + data.avgbearing).slice(-3) + ('0' + cache.avgKnots).slice(-2) + + 'G' + ('0' + cache.gstKnots).slice(-2) + 'KT '; + } else { + ssGauge.VRB = ''; + } + if (windSpd > 0) { + // If variation less than 60 degrees, then METAR = Steady + // Unless range = 0 and from/to direction = avg + 180 + range = (+cache.bearingTo < +cache.bearingFrom ? 360 + (+cache.bearingTo) : +cache.bearingTo) - (+cache.bearingFrom); + + if (cache.avgKnots < 3) { // Europe uses 3kts, USA 6kts as the threshold + if (config.showRoseOnDirGauge) { + ssGauge.setSection([steelseries.Section(cache.bearingFrom, cache.bearingTo, gaugeGlobals.windVariationSector)]); + ssGauge.setSection([]); + } else { + ssGauge.setSection([steelseries.Section(cache.bearingFrom, cache.bearingTo, gaugeGlobals.minMaxArea)]); + ssGauge.setArea([]); + } + } else if (config.showRoseOnDirGauge) { + ssGauge.setSection([steelseries.Section(cache.bearingFrom, cache.bearingTo, gaugeGlobals.windVariationSector)]); + } else { + ssGauge.setSection([]); + ssGauge.setArea([steelseries.Section(cache.bearingFrom, cache.bearingTo, gaugeGlobals.minMaxArea)]); + } + if (config.showWindMetar) { + if ((range < 60 && range > 0) || range === 0 && cache.bearingFrom === cache.valueAverage) { + ssGauge.VRB += ' STDY'; + } else if (cache.avgKnots < 3) { // Europe uses 3kts, USA 6kts as the threshold + ssGauge.VRB += ' VRB'; + } else { + ssGauge.VRB += ' ' + cache.bearingFrom + 'V' + cache.bearingTo; + } + } + } else { + // Zero wind speed, calm + if (config.showWindMetar) { + ssGauge.VRB = ' - METAR: 00000KT'; + } + ssGauge.setSection([]); + if (!config.showRoseOnDirGauge) { + ssGauge.setArea([]); + } + } + } else { + ssGauge.VRB = ''; + } + + // optional rose data on direction gauge + if (config.showRoseOnDirGauge && data.WindRoseData) { + // Process rose data + rosePoints = data.WindRoseData.length; + roseSectionAngle = 360 / rosePoints; + // Find total for all directions + for (i = 0; i < rosePoints; i++) { + roseMax = Math.max(roseMax, data.WindRoseData[i]); + } + // Check we actually have some data, bad things happen if roseMax=0! + if (roseMax > 0) { + // Find relative value for each point, and create a gauge area for it + for (i = 0; i < rosePoints; i++) { + roseAreas[i] = steelseries.Section( + i * roseSectionAngle - roseSectionAngle / 2, + (i + 1) * roseSectionAngle - roseSectionAngle / 2, + 'rgba(' + gradient('2020D0', 'D04040', data.WindRoseData[i] / roseMax) + ',' + + (data.WindRoseData[i] / roseMax).toFixed(2) + ')' + ); + } + } + ssGauge.setArea(roseAreas); + } + + if (ddimgtooltip.showTips) { + // update tooltip + tip = strings.latest_title + ' ' + strings.bearing_info + ': ' + cache.valueLatest + '° (' + getord(+cache.valueLatest) + ')' + + ssGauge.VRB + '
' + strings.tenminavg_web + ' ' + strings.bearing_info + ': ' + cache.valueAverage + '° (' + + getord(+cache.valueAverage) + '), ' + strings.dominant_bearing + ': ' + data.domwinddir; + if (!config.showRoseGauge) { + // Wind run is shown on the wind rose if it is available + tip += '
' + strings.windruntoday + ': ' + data.windrun + ' ' + displayUnits.windrun; + } + $('#imgtip7_txt').html(tip); + } + } // End of update() + + function updateGraph(evnt, cacheDefeat) { + if (config.tipImgs[7] !== null) { + $('#imgtip7_img').attr('src', config.imgPathURL + config.tipImgs[7] + cacheDefeat); + } + } + + return { + data : cache, + update: update, + gauge : ssGauge + }; + } // End of init() + + return { + // Get the Singleton instance if one exists + // or create one if it doesn't + getInstance: function () { + if (!instance) { + instance = init(); + } + return instance; + } + }; + })(), + + // + // Singleton for the Wind Rose Gauge + // + singleRose = (function () { + var instance; // Stores a reference to the Singleton + var ssGauge; // Stores a reference to the SS Gauge + + var buffers = {}; // Stores references to the various canvas buffers + var cache = {}; // various parameters to store for the life time of gauge + var ctxRoseCanvas; // 2D context for the plotted gauge + + cache.firstRun = true; + cache.odoDigits = 5; // Total number of odometer digits including the decimal + + function init() { + var div, roseCanvas; + // Get the context of the gauge canvas on the HTML page + if ($('#canvas_rose').length) { + cache.gaugeSize = Math.ceil($('#canvas_rose').width() * config.gaugeScaling); + cache.gaugeSize2 = cache.gaugeSize / 2; + cache.showOdo = config.showRoseGaugeOdo || false; + + cache.compassStrings = strings.compass; + cache.titleString = strings.windrose; + cache.gaugeOdoTitle = strings.km; + + // Create a hidden div to host the Rose plot + div = document.createElement('div'); + div.style.display = 'none'; + document.body.appendChild(div); + + // Calcuate the size of the gauge background and so the size of rose plot required + cache.plotSize = Math.floor(cache.gaugeSize * 0.68); + cache.plotSize2 = cache.plotSize / 2; + + // rose plot canvas buffer + buffers.plot = document.createElement('canvas'); + buffers.plot.width = cache.plotSize; + buffers.plot.height = cache.plotSize; + buffers.plot.id = 'rosePlot'; + buffers.ctxPlot = buffers.plot.getContext('2d'); + div.appendChild(buffers.plot); + + // Create a steelseries gauge frame + buffers.frame = document.createElement('canvas'); + buffers.frame.width = cache.gaugeSize; + buffers.frame.height = cache.gaugeSize; + buffers.ctxFrame = buffers.frame.getContext('2d'); + steelseries.drawFrame( + buffers.ctxFrame, + gaugeGlobals.frameDesign, + cache.gaugeSize2, + cache.gaugeSize2, + cache.gaugeSize, + cache.gaugeSize + ); + + // Create a steelseries gauge background + buffers.background = document.createElement('canvas'); + buffers.background.width = cache.gaugeSize; + buffers.background.height = cache.gaugeSize; + buffers.ctxBackground = buffers.background.getContext('2d'); + steelseries.drawBackground( + buffers.ctxBackground, + gaugeGlobals.background, + cache.gaugeSize2, + cache.gaugeSize2, + cache.gaugeSize, + cache.gaugeSize + ); + + // Optional - add a background image + /* + if (g_imgSmall !== null) { + var drawSize = g_size * 0.831775; + var x = (g_size - drawSize) / 2; + buffers.ctxBackground.drawImage(g_imgSmall, x, x, cache.gaugeSize, cache.gaugeSize); + } + */ + // Add the compass points + drawCompassPoints(buffers.ctxBackground, cache.gaugeSize); + + // Create a steelseries gauge foreground + buffers.foreground = document.createElement('canvas'); + buffers.foreground.width = cache.gaugeSize; + buffers.foreground.height = cache.gaugeSize; + buffers.ctxForeground = buffers.foreground.getContext('2d'); + steelseries.drawForeground( + buffers.ctxForeground, + gaugeGlobals.foreground, + cache.gaugeSize, + cache.gaugeSize, + false + ); + + roseCanvas = document.getElementById('canvas_rose'); + ctxRoseCanvas = roseCanvas.getContext('2d'); + // over-ride CSS applied size? + if (config.gaugeScaling !== 1) { + $('#canvas_rose').css({width: cache.gaugeSize + 'px', height: cache.gaugeSize + 'px'}); + } + // resize canvas on main page + roseCanvas.width = cache.gaugeSize; + roseCanvas.height = cache.gaugeSize; + // add a shadow to the gauge + if (config.showGaugeShadow) { + $('#canvas_rose').css(gaugeShadow(cache.gaugeSize)); + } + + // Render an empty gauge, looks better than just the shadow background and odometer ;) + // Paint the gauge frame + ctxRoseCanvas.drawImage(buffers.frame, 0, 0); + + // Paint the gauge background + ctxRoseCanvas.drawImage(buffers.background, 0, 0); + + // Paint the gauge foreground + ctxRoseCanvas.drawImage(buffers.foreground, 0, 0); + + // Create an odometer + if (cache.showOdo) { + cache.odoHeight = Math.ceil(cache.gaugeSize * 0.08); // Sets the size of the odometer + cache.odoWidth = Math.ceil(Math.floor(cache.odoHeight * 0.68) * cache.odoDigits); // 'Magic' number, do not alter + // Create a new canvas for the oodometer + buffers.Odo = document.createElement('canvas'); + $(buffers.Odo).attr({ + id : 'canvas_odo', + width : cache.odoWidth, + height: cache.odoHeight + }); + // Position it + $(buffers.Odo).attr("class", "odo"); + // Insert it into the DOM before the Rose gauge + $(buffers.Odo).insertBefore('#canvas_rose'); + // Create the odometer + ssGauge = new steelseries.Odometer('canvas_odo', { + height : cache.odoHeight, + digits : cache.odoDigits - 1, + decimals: 1 + }); + } + // subscribe to data updates + $.subscribe('gauges.dataUpdated', update); + $.subscribe('gauges.graphUpdate', updateGraph); + } else { + // cannot draw gauge, return null + return null; + } + + cache.firstRun = false; + + function update() { + var rose, offset; + + if (ctxRoseCanvas && !cache.firstRun) { + // Clear the gauge + ctxRoseCanvas.clearRect(0, 0, cache.gaugeSize, cache.gaugeSize); + + // Clear the existing rose plot + buffers.ctxPlot.clearRect(0, 0, cache.plotSize, cache.plotSize); + + // Create a new rose plot + rose = new RGraph.Rose('rosePlot', data.WindRoseData); + rose.Set('chart.strokestyle', 'black'); + rose.Set('chart.background.axes.color', 'gray'); + rose.Set('chart.colors.alpha', 0.5); + rose.Set('chart.colors', ['Gradient(#408040:red:#7070A0)']); + rose.Set('chart.margin', Math.ceil(40 / data.WindRoseData.length)); + + rose.Set('chart.title', cache.titleString); + rose.Set('chart.title.size', Math.ceil(0.05 * cache.plotSize)); + rose.Set('chart.title.bold', false); + rose.Set('chart.title.color', gaugeGlobals.background.labelColor.getRgbColor()); + rose.Set('chart.gutter.top', 0.2 * cache.plotSize); + rose.Set('chart.gutter.bottom', 0.2 * cache.plotSize); + + rose.Set('chart.tooltips.effect', 'snap'); + rose.Set('chart.labels.axes', ''); + rose.Set('chart.background.circles', true); + rose.Set('chart.background.grid.spokes', 16); + rose.Set('chart.radius', cache.plotSize2); + rose.Draw(); + + // Add title to windrun odometer to the plot + if (cache.showOdo) { + drawOdoTitle(buffers.ctxPlot); + } + + // Paint the gauge frame + ctxRoseCanvas.drawImage(buffers.frame, 0, 0); + + // Paint the gauge background + ctxRoseCanvas.drawImage(buffers.background, 0, 0); + + // Paint the rose plot + offset = Math.floor(cache.gaugeSize2 - cache.plotSize2); + ctxRoseCanvas.drawImage(buffers.plot, offset, offset); + + // Paint the gauge foreground + ctxRoseCanvas.drawImage(buffers.foreground, 0, 0); + + // update the odometer + if (cache.showOdo) { + ssGauge.setValueAnimated(extractDecimal(data.windrun)); + } + + // update tooltip + if (ddimgtooltip.showTips) { + $('#imgtip10_txt').html( + strings.dominant_bearing + ': ' + data.domwinddir + '
' + + strings.windruntoday + ': ' + data.windrun + ' ' + displayUnits.windrun + ); + } + } + } // End of update() + + function updateGraph(evnt, cacheDefeat) { + if (config.tipImgs[10] !== null) { + $('#imgtip10_img').attr('src', config.imgPathURL + config.tipImgs[10] + cacheDefeat); + } + } + + // Helper function to put the compass points on the background + function drawCompassPoints(ctx, size) { + ctx.save(); + // set the font + ctx.font = 0.08 * size + 'px serif'; + ctx.strokeStyle = gaugeGlobals.background.labelColor.getRgbaColor(); + ctx.fillStyle = gaugeGlobals.background.labelColor.getRgbColor(); + ctx.textAlign = 'center'; + ctx.textBaseline = 'middle'; + + // Draw the compass points + for (var i = 0; i < 4; i++) { + ctx.translate(size / 2, size * 0.125); + ctx.fillText(cache.compassStrings[i * 2], 0, 0, size); + ctx.translate(-size / 2, -size * 0.125); + // Move to center + ctx.translate(size / 2, size / 2); + ctx.rotate(Math.PI / 2); + ctx.translate(-size / 2, -size / 2); + } + ctx.restore(); + } + + function drawOdoTitle(ctx) { + ctx.save(); + ctx.textAlign = 'center'; + ctx.textBaseline = 'middle'; + ctx.font = 0.05 * cache.gaugeSize + 'px Arial,Verdana,sans-serif'; + ctx.strokeStyle = gaugeGlobals.background.labelColor.getRgbaColor(); + ctx.fillStyle = gaugeGlobals.background.labelColor.getRgbaColor(); + ctx.fillText(cache.gaugeOdoTitle, cache.plotSize2, cache.plotSize * 0.75, cache.plotSize * 0.5); + ctx.restore(); + } + + function setTitle(newTitle) { + cache.titleString = newTitle; + } + + function setOdoTitle(newTitle) { + cache.gaugeOdoTitle = newTitle; + } + + function setCompassStrings(newArray) { + cache.compassStrings = newArray; + if (!cache.firstRun) { + // Redraw the background + steelseries.drawBackground( + buffers.ctxBackground, + gaugeGlobals.background, + cache.gaugeSize2, + cache.gaugeSize2, + cache.gaugeSize, + cache.gaugeSize + ); + // Add the compass points + drawCompassPoints(buffers.ctxBackground, cache.gaugeSize); + } + } + + return { + update : update, + gauge : ssGauge, + drawCompassPoints: drawCompassPoints, + setTitle : setTitle, + setCompassStrings: setCompassStrings, + setOdoTitle : setOdoTitle + }; + } // End of init() + + return { + // Get the Singleton instance if one exists + // or create one if it doesn't + getInstance: function () { + if (!instance) { + instance = init(); + } + return instance; + } + }; + })(), + + // + // Singleton for the UV-Index Gauge + // + singleUV = (function () { + var instance; // Stores a reference to the Singleton + var ssGauge; // Stores a reference to the SS Gauge + var cache = {}; // Stores various config values and parameters + + function init() { + var params = $.extend(true, {}, commonParams); + + // define UV start values + cache.value = 0.0001; + cache.sections = [ + steelseries.Section(0, 2.9, '#289500'), + steelseries.Section(2.9, 5.8, '#f7e400'), + steelseries.Section(5.8, 7.8, '#f85900'), + steelseries.Section(7.8, 10.9, '#d8001d'), + steelseries.Section(10.9, 20, '#6b49c8') + ]; + // Define value gradient for UV + cache.gradient = new steelseries.gradientWrapper(0, 16, + [0, 0.1, 0.19, 0.31, 0.45, 0.625, 1], + [ + new steelseries.rgbaColor(0, 200, 0, 1), + new steelseries.rgbaColor(0, 200, 0, 1), + new steelseries.rgbaColor(255, 255, 0, 1), + new steelseries.rgbaColor(248, 89, 0, 1), + new steelseries.rgbaColor(255, 0, 0, 1), + new steelseries.rgbaColor(255, 0, 144, 1), + new steelseries.rgbaColor(153, 140, 255, 1) + ] + ); + cache.useSections = false; + cache.useValueGradient = true; + + // create UV bargraph gauge + if ($('#canvas_uv').length) { + params.size = Math.ceil($('#canvas_uv').width() * config.gaugeScaling); + params.gaugeType = steelseries.GaugeType.TYPE3; + params.maxValue = gaugeGlobals.uvScaleDefMax; + params.titleString = strings.uv_title; + params.niceScale = false; + params.section = cache.sections; + params.useSectionColors = cache.useSections; + params.valueGradient = cache.gradient; + params.useValueGradient = cache.useValueGradient; + params.lcdDecimals = gaugeGlobals.uvLcdDecimals; + + ssGauge = new steelseries.RadialBargraph('canvas_uv', params); + ssGauge.setValue(cache.value); + + // over-ride CSS applied size? + if (config.gaugeScaling !== 1) { + $('#canvas_uv').css({width: params.size + 'px', height: params.size + 'px'}); + } + + // add a shadow to the gauge + if (config.showGaugeShadow) { + $('#canvas_uv').css(gaugeShadow(params.size)); + } + + // subscribe to data updates + $.subscribe('gauges.dataUpdated', update); + $.subscribe('gauges.graphUpdate', updateGraph); + } else { + // cannot draw gauge, return null + return null; + } + + function update() { + var tip, indx; + + cache.value = extractDecimal(data.UV); + + if (+cache.value === 0) { + indx = 0; + } else if (cache.value < 2.5) { + indx = 1; + } else if (cache.value < 5.5) { + indx = 2; + } else if (cache.value < 7.5) { + indx = 3; + } else if (cache.value < 10.5) { + indx = 4; + } else { + indx = 5; + } + + cache.maxValue = Math.max(nextHighest(cache.value, 2), gaugeGlobals.uvScaleDefMax); + if (cache.maxValue !== ssGauge.getMaxValue()) { + ssGauge.setValue(0); + ssGauge.setMaxValue(cache.maxValue); + } + + cache.risk = strings.uv_levels[indx]; + cache.headLine = strings.uv_headlines[indx]; + cache.detail = strings.uv_details[indx]; + ssGauge.setUnitString(cache.risk); + ssGauge.setValueAnimated(cache.value); + + if (ddimgtooltip.showTips) { + // update tooltip + tip = '' + strings.uv_title + ': ' + cache.value + ' - ' + strings.solar_maxToday + ': ' + data.UVTH + '
'; + tip += '' + cache.headLine + '
'; + tip += cache.detail; + $('#imgtip8_txt').html(tip); + } + } // End of update() + + function updateGraph(evnt, cacheDefeat) { + if (config.tipImgs[8] !== null) { + $('#imgtip8_img').attr('src', config.imgPathURL + config.tipImgs[8] + cacheDefeat); + } + } + + return { + update: update, + gauge : ssGauge + }; + } // End of init() + + return { + // Get the Singleton instance if one exists + // or create one if it doesn't + getInstance: function () { + if (!instance) { + instance = init(); + } + return instance; + } + }; + })(), + + // + // Singleton for the Solar Irradiation Gauge + // + singleSolar = (function () { + var instance; // Stores a reference to the Singleton + var ssGauge; // Stores a reference to the SS Gauge + var cache = {}; // Stores various config values and parameters + + function init() { + var params = $.extend(true, {}, commonParams); + + // define Solar start values + cache.value = 0.0001; + cache.sections = [ + steelseries.Section(0, 600, 'rgba(40,149,0,0.3)'), + steelseries.Section(600, 800, 'rgba(248,89,0,0.3)'), + steelseries.Section(800, 1000, 'rgba(216,0,29,0.3)'), + steelseries.Section(1000, 1800, 'rgba(107,73,200,0.3)') + ]; + + // create Solar gauge + if ($('#canvas_solar').length) { + params.size = Math.ceil($('#canvas_solar').width() * config.gaugeScaling); + params.section = cache.sections; + params.maxValue = gaugeGlobals.solarGaugeScaleMax; + params.titleString = strings.solar_title; + params.unitString = 'W/m\u00B2'; + params.niceScale = false; + params.thresholdVisible = false; + params.lcdDecimals = 0; + + if (config.showSunshineLed) { + params.userLedVisible = true; + params.userLedColor = steelseries.LedColor.YELLOW_LED; + } + + ssGauge = new steelseries.Radial('canvas_solar', params); + ssGauge.setValue(cache.value); + + // over-ride CSS applied size? + if (config.gaugeScaling !== 1) { + $('#canvas_solar').css({width: params.size + 'px', height: params.size + 'px'}); + } + + // add a shadow to the gauge + if (config.showGaugeShadow) { + $('#canvas_solar').css(gaugeShadow(params.size)); + } + // subscribe to data updates + $.subscribe('gauges.dataUpdated', update); + $.subscribe('gauges.graphUpdate', updateGraph); + } else { + // cannot draw gauge, return null + return null; + } + + function update() { + var tip, percent; + + cache.value = +extractInteger(data.SolarRad); + cache.maxToday = extractInteger(data.SolarTM); + cache.currMaxValue = +extractInteger(data.CurrentSolarMax); + percent = (+cache.currMaxValue === 0 ? '--' : Math.round(+cache.value / +cache.currMaxValue * 100)); + + // Need to rescale the gauge? + cache.maxValue = Math.max(cache.value, cache.currMaxValue, cache.maxToday, gaugeGlobals.solarGaugeScaleMax); + cache.maxValue = nextHighest(cache.maxValue, 100); + if (cache.maxValue !== ssGauge.getMaxValue()) { + ssGauge.setValue(0); + ssGauge.setMaxValue(cache.maxValue); + } + + // Set a section (15% of maxScale wide) to show current theoretical max value + if (data.CurrentSolarMax !== 'N/A') { + ssGauge.setArea([ + // Sunshine threshold + steelseries.Section( + Math.max(cache.currMaxValue * gaugeGlobals.sunshineThresholdPct / 100, gaugeGlobals.sunshineThreshold), + cache.currMaxValue, + 'rgba(255,255,50,0.4)' + ), + // Over max threshold + steelseries.Section( + cache.currMaxValue, + Math.min(cache.currMaxValue + cache.maxValue * 0.15, cache.maxValue), + 'rgba(220,0,0,0.5)' + ) + ]); + } + + // Set the values + ssGauge.setMaxMeasuredValue(cache.maxToday); + ssGauge.setValueAnimated(cache.value); + + if (config.showSunshineLed) { + ssGauge.setUserLedOnOff( + percent !== '--' && + percent >= gaugeGlobals.sunshineThresholdPct && + +cache.value >= gaugeGlobals.sunshineThreshold + ); + } + + if (ddimgtooltip.showTips) { + // update tooltip + tip = '' + strings.solar_title + ': ' + cache.value + ' W/m² - ' + + '' + percent + '% ' + strings.solar_ofMax + '
' + + strings.solar_currentMax + ': ' + cache.currMaxValue + ' W/m²'; + if (typeof data.SolarTM !== 'undefined') { + tip += '
' + strings.solar_maxToday + ': ' + cache.maxToday + ' W/m²'; + } + $('#imgtip9_txt').html(tip); + } + } // End of update() + + function updateGraph(evnt, cacheDefeat) { + if (config.tipImgs[9] !== null) { + $('#imgtip9_img').attr('src', config.imgPathURL + config.tipImgs[9] + cacheDefeat); + } + } + + return { + update: update, + gauge : ssGauge + }; + } // End of init() + + return { + // Get the Singleton instance if one exists + // or create one if it doesn't + getInstance: function () { + if (!instance) { + instance = init(); + } + return instance; + } + }; + })(), + + // + // Singleton for the Cloudbase Gauge + // + singleCloudBase = (function () { + var instance; // Stores a reference to the Singleton + var ssGauge; // Stores a reference to the SS Gauge + var cache = {}; // Stores various config values and parameters + + function init() { + var params = $.extend(true, {}, commonParams); + + cache.sections = createCloudBaseSections(true); + cache.value = 0.0001; + cache.maxValue = gaugeGlobals.cloudScaleDefMaxm; + + // create Cloud base radial gauge + if ($('#canvas_cloud').length) { + params.size = Math.ceil($('#canvas_cloud').width() * config.gaugeScaling); + params.section = cache.sections; + params.maxValue = cache.maxValue; + params.titleString = strings.cloudbase_title; + params.unitString = strings.metres; + params.thresholdVisible = false; + params.lcdDecimals = 0; + + ssGauge = new steelseries.Radial('canvas_cloud', params); + ssGauge.setValue(cache.value); + + // over-ride CSS applied size? + if (config.gaugeScaling !== 1) { + $('#canvas_cloud').css({width: params.size + 'px', height: params.size + 'px'}); + } + + // add a shadow to the gauge + if (config.showGaugeShadow) { + $('#canvas_cloud').css(gaugeShadow(params.size)); + } + // subscribe to data updates + $.subscribe('gauges.dataUpdated', update); + $.subscribe('gauges.graphUpdate', updateGraph); + } else { + // cannot draw gauge, return null + return null; + } + + function update() { + cache.value = extractInteger(data.cloudbasevalue); + + if (data.cloudbaseunit === 'm') { + // adjust metre gauge in jumps of 1000 metres, don't downscale during the session + cache.maxValue = Math.max(nextHighest(cache.value, 1000), gaugeGlobals.cloudScaleDefMaxm, cache.maxValue); + if (cache.value <= 1000 && config.roundCloudbaseVal) { + // and round the value to the nearest 10 m + cache.value = Math.round(cache.value / 10) * 10; + } else if (config.roundCloudbaseVal) { + // and round the value to the nearest 50 m + cache.value = Math.round(cache.value / 50) * 50; + } + } else { + // adjust feet gauge in jumps of 2000 ft, don't downscale during the session + cache.maxValue = Math.max(nextHighest(cache.value, 2000), gaugeGlobals.cloudScaleDefMaxft, cache.maxValue); + if (cache.value <= 2000 && config.roundCloudbaseVal) { + // and round the value to the nearest 50 ft + cache.value = Math.round(cache.value / 50) * 50; + } else if (config.roundCloudbaseVal) { + // and round the value to the nearest 100 ft + cache.value = Math.round(cache.value / 100) * 100; + } + } + + if (cache.maxValue !== ssGauge.getMaxValue()) { + if (ssGauge.getMaxValue() > cache.maxValue) { + // Gauge currently showing more than our max (nice scale effct), + // so reset our max to match + cache.maxValue = ssGauge.getMaxValue(); + } else { + // Gauge scale is too low, increase it. + // First set the pointer back to zero so we get a nice animation + ssGauge.setValue(0); + // and redraw the gauge with teh new scale + ssGauge.setMaxValue(cache.maxValue); + } + } + ssGauge.setValueAnimated(cache.value); + + if (config.showPopupData) { + // static tooltip on cloud gauge + $('#imgtip11_txt').html('' + strings.cloudbase_popup_title + '
' + strings.cloudbase_popup_text); + } + } // End of update() + + function updateGraph(evnt, cacheDefeat) { + if (config.tipImgs[11] !== null) { + $('#imgtip11_img').attr('src', config.imgPathURL + config.tipImgs[11] + cacheDefeat); + } + } + + return { + data : cache, + update: update, + gauge : ssGauge + }; + } // End of init() + + return { + // Get the Singleton instance if one exists + // or create one if it doesn't + getInstance: function () { + if (!instance) { + instance = init(); + } + return instance; + } + }; + })(), + + // + // getRealtime() fetches the realtimegauges JSON data from the server + // + getRealtime = function () { + var url = config.realTimeURL; + if ($.active > 0 && undefined != jqXHR) { + // kill any outstanding requests + jqXHR.abort(); + } + if (config.longPoll) { + url += '?timestamp=' + timestamp; + } + jqXHR = $.ajax({ + url : url, + cache : (config.longPoll), + dataType: 'json', + timeout : config.longPoll ? (Math.min(config.realtimeInterval, 20) + 21) * 1000 : 21000 // 21 second time-out by default + }).done(function (data) { + checkRtResp(data); + }).fail(function (xhr, status, err) { + checkRtError(xhr, status, err); + }); + }, + + // + // checkRtResp() called by the Ajax fetch once data has been downloaded + // + checkRtResp = function (response) { + var delay; + statusTimer.reset(config.longPoll ? 1 : config.realtimeInterval); + if (config.longPoll && response.status !== 'OK') { + checkRtError(null, 'PHP Error', response.status); + } else { + if (processData(response)) { + delay = ajaxDelay; + } else { + delay = 5; + } + if (delay > 0) { + downloadTimer = setTimeout(getRealtime, delay * 1000); + } else { + getRealtime(); + } + } + }, + + // + // checkRtError() called by the Ajax fetch if an error occurs during the fetching realtimegauges.txt + // + checkRtError = function (xhr, status, error) { + if (xhr == null || xhr.statusText !== 'abort') { + // Clear any existing download timer + clearTimeout(downloadTimer); + // Set the status LED to off + ledIndicator.setLedOnOff(false); + ledIndicator.setTitle(strings.led_title_unknown); + statusScroller.setText(status + ': ' + error); + // wait 5 seconds, then try again... + downloadTimer = setTimeout(getRealtime, 5000); + } + }, + + // + // processData() massages the data returned in realtimegauges.txt, and posts a gauges.dataUpdated event to update the page + // + processData = function (dataObj) { + var str, dt, tm, today, now, then, tmp, elapsedMins, retVal; + // copy the realtime fields into the global 'data' object + if (config.longPoll) { + timestamp = dataObj.timestamp; + data = dataObj.data; + } else { + // normal polling + data = dataObj; + } + + // and check we have the expected version number + if (typeof data.ver !== 'undefined' && data.ver >= realtimeVer) { + // mainpulate the last rain time into something more friendly + try { + str = data.LastRainTipISO.split(' '); + dt = str[0].replace(/\//g, '-').split('-'); // WD uses dd/mm/yyyy, we use a '-' + tm = str[1].split(':'); + today = new Date(); + today.setHours(0, 0, 0, 0); + if (typeof data.dateFormat === 'undefined') { + data.dateFormat = 'y/m/d'; + } else { + // frig for WD bug which leaves a trailing % character from the tag + data.dateFormat = data.dateFormat.replace('%', ''); + } + if (data.dateFormat === 'y/m/d') { + // ISO/Cumulus format + then = new Date(dt[0], dt[1] - 1, dt[2], tm[0], tm[1], 0, 0); + } else if (data.dateFormat === 'd/m/y') { + then = new Date(dt[2], dt[1] - 1, dt[0], tm[0], tm[1], 0, 0); + } else { // m/d/y + then = new Date(dt[2], dt[0] - 1, dt[1], tm[0], tm[1], 0, 0); + } + if (then.getTime() >= today.getTime()) { + data.LastRained = strings.LastRainedT_info + ' ' + str[1]; + } else if (then.getTime() + 86400000 >= today.getTime()) { + data.LastRained = strings.LastRainedY_info + ' ' + str[1]; + } else { + data.LastRained = then.getDate().toString() + ' ' + strings.months[then.getMonth()] + ' ' + strings.at + ' ' + str[1]; + } + } catch (e) { + data.LastRained = data.LastRainTipISO; + } + if (data.tempunit.length > 1) { + // clean up temperature units - remove html encoded degree symbols + data.tempunit = data.tempunit.replace(/&\S*;/, '°'); // old Cumulus versions uses °, WeatherCat uses ° + } else { + // using new realtimegaugesT.txt with Cumulus > 1.9.2 + data.tempunit = '°' + data.tempunit; + } + + // Check for station off-line + now = Date.now(); + tmp = data.timeUTC.split(','); + sampleDate = Date.UTC(tmp[0], tmp[1] - 1, tmp[2], tmp[3], tmp[4], tmp[5]); + if (now - sampleDate > config.stationTimeout * 60 * 1000) { + elapsedMins = Math.floor((now - sampleDate) / (1000 * 60)); + // the realtimegauges.txt file isn't being updated + ledIndicator.setLedColor(steelseries.LedColor.RED_LED); + ledIndicator.setTitle(strings.led_title_offline); + ledIndicator.blink(true); + if (elapsedMins < 120) { + // up to 2 hours ago + tm = elapsedMins.toString() + ' ' + strings.StatusMinsAgo; + } else if (elapsedMins < 2 * 24 * 60) { + // up to 48 hours ago + tm = Math.floor(elapsedMins / 60).toString() + ' ' + strings.StatusHoursAgo; + } else { + // days ago! + tm = Math.floor(elapsedMins / (60 * 24)).toString() + ' ' + strings.StatusDaysAgo; + } + data.forecast = strings.led_title_offline + ' ' + strings.StatusLastUpdate + ' ' + tm; + } else if (+data.SensorContactLost === 1) { + // Fine Offset sensor status + ledIndicator.setLedColor(steelseries.LedColor.RED_LED); + ledIndicator.setTitle(strings.led_title_lost); + ledIndicator.blink(true); + data.forecast = strings.led_title_lost; + } else { + ledIndicator.setLedColor(steelseries.LedColor.GREEN_LED); + ledIndicator.setTitle(strings.led_title_ok + '. ' + strings.StatusLastUpdate + ': ' + data.date); + ledIndicator.blink(false); + ledIndicator.setLedOnOff(true); + } + + // de-encode the forecast string if required (Cumulus support for extended characters) + data.forecast = $('
').html(data.forecast).text(); + data.forecast = data.forecast.trim(); + + data.pressunit = data.pressunit.trim(); // WView sends ' in', ' mb', or ' hPa' + if (data.pressunit === 'in') { // Cumulus and WView send 'in' + data.pressunit = 'inHg'; + } + + data.windunit = data.windunit.trim(); // WView sends ' kmh' etc + data.windunit = data.windunit.toLowerCase(); // WeatherCat sends "MPH" + if (data.windunit === 'knots') { // WeatherCat/weewx send "Knots", we use "kts" + data.windunit = 'kts'; + } + + if (data.windunit === 'kmh' || data.windunit === 'kph') { // WD wind unit omits '/', weewx sends 'kph' + data.windunit = 'km/h'; + } + + data.rainunit = data.rainunit.trim(); // WView sends ' mm' etc + + // take a look at the cloud base data... + // change WeatherCat units from Metres/Feet to m/ft + try { + if (data.cloudbaseunit.toLowerCase() === 'metres') { + data.cloudbaseunit = 'm'; + } else if (data.cloudbaseunit.toLowerCase() === 'feet') { + data.cloudbaseunit = 'ft'; + } + } catch (e) { + data.cloudbaseunit = ''; + } + if (config.showCloudGauge && ( + (config.weatherProgram === 4 || config.weatherProgram === 5) || + data.cloudbasevalue === '')) { + // WeatherCat and VWS (and WView?) do not provide a cloud base value, so we have to calculate it... + // assume if the station uses an imperial wind speed they want cloud base in feet, otherwise metres + data.cloudbaseunit = (data.windunit === 'mph' || data.windunit === 'kts') ? 'ft' : 'm'; + data.cloudbasevalue = calcCloudbase(data.temp, data.tempunit, data.dew, data.cloudbaseunit); + } + + // Temperature data conversion for display required? + if (data.tempunit[1] !== displayUnits.temp && userUnitsSet) { + // temp needs converting + if (data.tempunit[1] === 'C') { + convTempData(c2f); + } else { + convTempData(f2c); + } + } else if (firstRun) { + displayUnits.temp = data.tempunit[1]; + setRadioCheck('rad_unitsTemp', displayUnits.temp); + } + + // Rain data conversion for display required? + if (data.rainunit !== displayUnits.rain && userUnitsSet) { + // rain needs converting + convRainData(displayUnits.rain === 'mm' ? in2mm : mm2in); + } else if (firstRun) { + displayUnits.rain = data.rainunit; + setRadioCheck('rad_unitsRain', displayUnits.rain); + } + + // Wind data conversion for display required? + if (data.windunit !== displayUnits.wind && userUnitsSet) { + // wind needs converting + convWindData(data.windunit, displayUnits.wind); + } else if (firstRun) { + displayUnits.wind = data.windunit; + displayUnits.windrun = getWindrunUnits(data.windunit); + setRadioCheck('rad_unitsWind', displayUnits.wind); + } + + // Pressure data conversion for display required? + if (data.pressunit !== displayUnits.press && userUnitsSet) { + convBaroData(data.pressunit, displayUnits.press); + } else if (firstRun) { + displayUnits.press = data.pressunit; + setRadioCheck('rad_unitsPress', displayUnits.press); + } + + // Cloud height data conversion for display required? + if (data.cloudbaseunit !== displayUnits.cloud && userUnitsSet) { + // Cloud height needs converting + convCloudBaseData(displayUnits.cloud === 'm' ? ft2m : m2ft); + } else if (firstRun) { + displayUnits.cloud = data.cloudbaseunit; + setRadioCheck('rad_unitsCloud', displayUnits.cloud); + } + + statusScroller.setText(data.forecast); + + // first time only, setup units etc + if (firstRun) { + doFirst(); + } + + // publish the update, use the shared data object rather than transferring it + $.publish('gauges.dataUpdated', {}); + + retVal = true; + } else { + // set an error message + if (data.ver < realtimeVer) { + statusTimer.setValue(0); + statusScroller.setText('Your ' + config.realTimeURL.substr(config.realTimeURL.lastIndexOf('/') + 1) + ' file template needs updating!'); + return false; + } else { + // oh-oh! The number of data fields isn't what we expected + statusScroller.setText(strings.realtimeCorrupt); + } + ledIndicator.setLedOnOff(false); + ledIndicator.setTitle(strings.led_title_unknown); + + retVal = false; + } + return retVal; + }, + + // + // pagetimeout() called once every config.pageUpdateLimit minutes to stop updates and prevent page 'sitters' + // + pageTimeout = function () { + statusScroller.setText(strings.StatusPageLimit); + ledIndicator.setLedColor(steelseries.LedColor.RED_LED); + ledIndicator.setTitle(strings.StatusPageLimit); + ledIndicator.blink(true); + ledIndicator.setTitle(strings.StatusTimeout); + + // stop any pending download + clearTimeout(downloadTimer); + + // stop any long polling in progress + if ($.active > 0) { + jqXHR.abort(); + } + + // stop the clock + clearInterval(tickTockInterval); + + // clear the timer display + statusTimer.setValue(0); + + // set an onclick event on the LED to restart everything + $('#canvas_led').click( + function click() { + // disable the onClick event again + $('#canvas_led').unbind('click'); + // reset the timer count to 1 + statusTimer.reset(1); + // restart the timer to update the status time + tickTockInterval = setInterval( + function tick() { + $.publish('gauges.clockTick', null); + }, + 1000 + ); + + // restart the page timeout timer, so we hit this code again + setTimeout(pageTimeout, config.pageUpdateLimit * 60 * 1000); + + // refresh the page data + getRealtime(); + } + ); + }, + + // + // doFirst() called by doUpdate() the first time the page is updated to set-up various things that are + // only known when the realtimegauges.txt data is available + // + doFirst = function () { + var cacheDefeat = '?' + (new Date()).getTime().toString(); + + if (data.tempunit[1] === 'F') { + displayUnits.temp = 'F'; + setRadioCheck('rad_unitsTemp', 'F'); + setTempUnits(false); + } + + if (data.pressunit !== 'hPa') { + displayUnits.press = data.pressunit; + setRadioCheck('rad_unitsPress', data.pressunit); + setBaroUnits(data.pressunit); + } + + if (data.windunit !== 'km/h') { + displayUnits.wind = data.windunit; + setRadioCheck('rad_unitsWind', data.windunit); + setWindUnits(data.windunit); + } + + if (data.rainunit !== 'mm') { + displayUnits.rain = data.rainunit; + setRadioCheck('rad_unitsRain', data.rainunit); + setRainUnits(false); + } + + if (config.showSolarGauge && typeof data.SolarTM !== 'undefined' && gaugeSolar) { + gaugeSolar.gauge.setMaxMeasuredValueVisible(true); + } + + if (config.showCloudGauge && data.cloudbaseunit !== 'm') { + displayUnits.cloud = data.cloudbaseunit; + setRadioCheck('rad_unitsCloud', data.cloudbaseunit); + setCloudBaseUnits(false); + } + + // set the script version on the page + $('#scriptVer').html(config.scriptVer); + // set the version information from the station + $('#programVersion').html(data.version); + $('#programBuild').html(data.build); + $('#programName').html(programLink[config.weatherProgram]); + + if (config.showPopupData) { + // now initialise the pop-up script and download the trend images + // - has to be done here as doFirst may remove elements from the page + // - and we delay the download of the images speeding up page display + ddimgtooltip.init('[id^="tip_"]'); + // Are we running on a phone device (or really low res screen)? + if ($(window).width() < 480) { + $('.ddimgtooltip').filter(':hidden').width('200px'); + } + } + + if (config.showPopupData && config.showPopupGraphs) { + // now download the trend images + // - has to be done here as doFirst may remove elements from the page + // - and we delay the download of the images speeding up page display + // + $('#imgtip0_img').attr('src', config.imgPathURL + config.tipImgs[0][0] + cacheDefeat); + if (gaugeDew) { + $('#imgtip1_img').attr('src', config.imgPathURL + config.tipImgs[1][gaugeDew.data.popupImg] + cacheDefeat); + } + $('#imgtip2_img').attr('src', config.imgPathURL + config.tipImgs[2] + cacheDefeat); + $('#imgtip3_img').attr('src', config.imgPathURL + config.tipImgs[3] + cacheDefeat); + $('#imgtip4_img').attr('src', config.imgPathURL + config.tipImgs[4][0] + cacheDefeat); + $('#imgtip5_img').attr('src', config.imgPathURL + config.tipImgs[5] + cacheDefeat); + $('#imgtip6_img').attr('src', config.imgPathURL + config.tipImgs[6] + cacheDefeat); + $('#imgtip7_img').attr('src', config.imgPathURL + config.tipImgs[7] + cacheDefeat); + $('#imgtip8_img').attr('src', config.imgPathURL + config.tipImgs[8] + cacheDefeat); + $('#imgtip9_img').attr('src', config.imgPathURL + config.tipImgs[9] + cacheDefeat); + $('#imgtip10_img').attr('src', config.imgPathURL + config.tipImgs[10] + cacheDefeat); + $('#imgtip11_img').attr('src', config.imgPathURL + config.tipImgs[11] + cacheDefeat); + // start a timer for popup graphic updates + setInterval( + function timeout() { + $.publish('gauges.graphUpdate', '?' + (new Date()).getTime().toString()); + }, + config.graphUpdateTime * 60 * 1000 + ); + } + + firstRun = false; + }, + + // + // createTempSections() creates an array of gauge sections appropriate for Celsius or Fahrenheit scales + // + createTempSections = function (celsius) { + var section; + if (celsius) { + section = [ + steelseries.Section(-100, -35, 'rgba(195, 92, 211, 0.4)'), + steelseries.Section(-35, -30, 'rgba(139, 74, 197, 0.4)'), + steelseries.Section(-30, -25, 'rgba(98, 65, 188, 0.4)'), + steelseries.Section(-25, -20, 'rgba(62, 66, 185, 0.4)'), + steelseries.Section(-20, -15, 'rgba(42, 84, 194, 0.4)'), + steelseries.Section(-15, -10, 'rgba(25, 112, 210, 0.4)'), + steelseries.Section(-10, -5, 'rgba(9, 150, 224, 0.4)'), + steelseries.Section(-5, 0, 'rgba(2, 170, 209, 0.4)'), + steelseries.Section(0, 5, 'rgba(0, 162, 145, 0.4)'), + steelseries.Section(5, 10, 'rgba(0, 158, 122, 0.4)'), + steelseries.Section(10, 15, 'rgba(54, 177, 56, 0.4)'), + steelseries.Section(15, 20, 'rgba(111, 202, 56, 0.4)'), + steelseries.Section(20, 25, 'rgba(248, 233, 45, 0.4)'), + steelseries.Section(25, 30, 'rgba(253, 142, 42, 0.4)'), + steelseries.Section(30, 40, 'rgba(236, 45, 45, 0.4)'), + steelseries.Section(40, 100, 'rgba(245, 109, 205, 0.4)') + ]; + } else { + section = [ + steelseries.Section(-200, -30, 'rgba(195, 92, 211, 0.4)'), + steelseries.Section(-30, -25, 'rgba(139, 74, 197, 0.4)'), + steelseries.Section(-25, -15, 'rgba(98, 65, 188, 0.4)'), + steelseries.Section(-15, -5, 'rgba(62, 66, 185, 0.4)'), + steelseries.Section(-5, 5, 'rgba(42, 84, 194, 0.4)'), + steelseries.Section(5, 15, 'rgba(25, 112, 210, 0.4)'), + steelseries.Section(15, 25, 'rgba(9, 150, 224, 0.4)'), + steelseries.Section(25, 32, 'rgba(2, 170, 209, 0.4)'), + steelseries.Section(32, 40, 'rgba(0, 162, 145, 0.4)'), + steelseries.Section(40, 50, 'rgba(0, 158, 122, 0.4)'), + steelseries.Section(50, 60, 'rgba(54, 177, 56, 0.4)'), + steelseries.Section(60, 70, 'rgba(111, 202, 56, 0.4)'), + steelseries.Section(70, 80, 'rgba(248, 233, 45, 0.4)'), + steelseries.Section(80, 90, 'rgba(253, 142, 42, 0.4)'), + steelseries.Section(90, 110, 'rgba(236, 45, 45, 0.4)'), + steelseries.Section(110, 200, 'rgba(245, 109, 205, 0.4)') + ]; + } + return section; + }, + + // + // createRainSections() returns an array of section highlights for the Rain Rate gauge + // + /* + Assumes 'standard' descriptive limits from UK met office: + < 0.25 mm/hr - Very light rain + 0.25mm/hr to 1.0mm/hr - Light rain + 1.0 mm/hr to 4.0 mm/hr - Moderate rain + 4.0 mm/hr to 16.0 mm/hr - Heavy rain + 16.0 mm/hr to 50 mm/hr - Very heavy rain + > 50.0 mm/hour - Extreme rain + + Roughly translated to the corresponding Inch rates + < 0.001 + 0.001 to 0.05 + 0.05 to 0.20 + 0.20 to 0.60 + 0.60 to 2.0 + > 2.0 + */ + createRainRateSections = function (metric) { + var factor = metric ? 1 : 1 / 25; + return [ + steelseries.Section(0, 0.25 * factor, 'rgba(0, 140, 0, 0.5)'), + steelseries.Section(0.25 * factor, 1 * factor, 'rgba(80, 192, 80, 0.5)'), + steelseries.Section(1 * factor, 4 * factor, 'rgba(150, 203, 150, 0.5)'), + steelseries.Section(4 * factor, 16 * factor, 'rgba(212, 203, 109, 0.5)'), + steelseries.Section(16 * factor, 50 * factor, 'rgba(225, 155, 105, 0.5)'), + steelseries.Section(50 * factor, 1000 * factor, 'rgba(245, 86, 59, 0.5)') + ]; + }, + + // + // createRainFallSections()returns an array of section highlights for total rainfall in mm or inches + // + createRainfallSections = function (metric) { + var factor = metric ? 1 : 1 / 25; + return [ + steelseries.Section(0, 5 * factor, 'rgba(0, 250, 0, 1)'), + steelseries.Section(5 * factor, 10 * factor, 'rgba(0, 250, 117, 1)'), + steelseries.Section(10 * factor, 25 * factor, 'rgba(218, 246, 0, 1)'), + steelseries.Section(25 * factor, 40 * factor, 'rgba(250, 186, 0, 1)'), + steelseries.Section(40 * factor, 50 * factor, 'rgba(250, 95, 0, 1)'), + steelseries.Section(50 * factor, 65 * factor, 'rgba(250, 0, 0, 1)'), + steelseries.Section(65 * factor, 75 * factor, 'rgba(250, 6, 80, 1)'), + steelseries.Section(75 * factor, 100 * factor, 'rgba(205, 18, 158, 1)'), + steelseries.Section(100 * factor, 125 * factor, 'rgba(0, 0, 250, 1)'), + steelseries.Section(125 * factor, 500 * factor, 'rgba(0, 219, 212, 1)') + ]; + }, + + // + // createRainfallGradient() returns an array of SS colours for continuous gradient colouring of the total rainfall LED gauge + // + createRainfallGradient = function (metric) { + var grad = new steelseries.gradientWrapper( + 0, + (metric ? 100 : 4), + [0, 0.1, 0.62, 1], + [ + new steelseries.rgbaColor(15, 148, 0, 1), + new steelseries.rgbaColor(213, 213, 0, 1), + new steelseries.rgbaColor(213, 0, 25, 1), + new steelseries.rgbaColor(250, 0, 0, 1) + ] + ); + return grad; + }, + + // + // createClousBaseSections() returns an array of section highlights for the Cloud Base gauge + // + createCloudBaseSections = function (metric) { + var section; + if (metric) { + section = [ + steelseries.Section(0, 150, 'rgba(245, 86, 59, 0.5)'), + steelseries.Section(150, 300, 'rgba(225, 155, 105, 0.5)'), + steelseries.Section(300, 750, 'rgba(212, 203, 109, 0.5)'), + steelseries.Section(750, 1000, 'rgba(150, 203, 150, 0.5)'), + steelseries.Section(1000, 1500, 'rgba(80, 192, 80, 0.5)'), + steelseries.Section(1500, 2500, 'rgba(0, 140, 0, 0.5)'), + steelseries.Section(2500, 5500, 'rgba(19, 103, 186, 0.5)') + ]; + } else { + section = [ + steelseries.Section(0, 500, 'rgba(245, 86, 59, 0.5)'), + steelseries.Section(500, 1000, 'rgba(225, 155, 105, 0.5)'), + steelseries.Section(1000, 2500, 'rgba(212, 203, 109, 0.5)'), + steelseries.Section(2500, 3500, 'rgba(150, 203, 150, 0.5)'), + steelseries.Section(3500, 5500, 'rgba(80, 192, 80, 0.5)'), + steelseries.Section(5500, 8500, 'rgba(0, 140, 0, 0.5)'), + steelseries.Section(8500, 18000, 'rgba(19, 103, 186, 0.5)') + ]; + } + return section; + }, + + // + // --------------- Helper functions ------------------ + // + + // + // getord() converts a value in degrees (0-360) into a localised compass point (N, ENE, NE, etc) + // + getord = function (deg) { + if (deg === 0) { + // Special case, 0=No wind, 360=North + return strings.calm; + } else { + return (strings.coords[Math.floor((deg + 11.25) / 22.5) % 16]); + } + }, + + // + // getUrlParam() extracts the named parameter from the current page URL + // + getUrlParam = function (paramName) { + var name, regexS, regex, results; + name = paramName.replace(/(\[|\])/g, '\\$1'); + regexS = '[\\?&]' + name + '=([^&#]*)'; + regex = new RegExp(regexS); + results = regex.exec(window.location.href); + if (results === null) { + return ''; + } else { + return results[1]; + } + }, + + // + // extractDecimal() returns a decimal number from a string, the decimal point can be either a dot or a comma + // it ignores any text such as pre/appended units + // + extractDecimal = function (str, errVal) { + try { + return (/[-+]?[0-9]+\.?[0-9]*/).exec(str.replace(',', '.'))[0]; + } catch (e) { + // error condition + return errVal || -9999; + } + }, + + // + // extractInteger() returns an integer from a string + // it ignores any text such as pre/appended units + // + extractInteger = function (str, errVal) { + try { + return (/[-+]?[0-9]+/).exec(str)[0]; + } catch (e) { + // error condition + return errVal || -9999; + } + }, + + // + // tempTrend() converts a temperature trend value into a localised string, or +1, 0, -1 depending on the value of bTxt + // + tempTrend = function (trend, units, bTxt) { + // Scale is over 3 hours, in Celsius + var val = trend * 3 * (units[1] === 'C' ? 1 : (5 / 9)), + ret; + if (trend === -9999) { + ret = (bTxt ? '--' : trend); + } else if (val > 5) { + ret = (bTxt ? strings.RisingVeryRapidly : 1); + } else if (val > 3) { + ret = (bTxt ? strings.RisingQuickly : 1); + } else if (val > 1) { + ret = (bTxt ? strings.Rising : 1); + } else if (val > 0.5) { + ret = (bTxt ? strings.RisingSlowly : 1); + } else if (val >= -0.5) { + ret = (bTxt ? strings.Steady : 0); + } else if (val >= -1) { + ret = (bTxt ? strings.FallingSlowly : -1); + } else if (val >= -3) { + ret = (bTxt ? strings.Falling : -1); + } else if (val >= -5) { + ret = (bTxt ? strings.FallingQuickly : -1); + } else { + ret = (bTxt ? strings.FallingVeryRapidly : -1); + } + return ret; + }, + + // + // baroTrend() converts a pressure trend value into a localised string, or +1, 0, -1 depending on the value of bTxt + // + baroTrend = function (trend, units, bTxt) { + var val = trend * 3, + ret; + // The terms below are the UK Met Office terms for a 3 hour change in hPa + // trend is supplied as an hourly change, so multiply by 3 + if (units === 'inHg') { + val *= 33.8639; + } else if (units === 'kPa') { + val *= 10; + // assume everything else is hPa or mb, could be dangerous! + } + if (trend === -9999) { + ret = (bTxt ? '--' : trend); + } else if (val > 6.0) { + ret = (bTxt ? strings.RisingVeryRapidly : 1); + } else if (val > 3.5) { + ret = (bTxt ? strings.RisingQuickly : 1); + } else if (val > 1.5) { + ret = (bTxt ? strings.Rising : 1); + } else if (val > 0.1) { + ret = (bTxt ? strings.RisingSlowly : 1); + } else if (val >= -0.1) { + ret = (bTxt ? strings.Steady : 0); + } else if (val >= -1.5) { + ret = (bTxt ? strings.FallingSlowly : -1); + } else if (val >= -3.5) { + ret = (bTxt ? strings.Falling : -1); + } else if (val >= -6.0) { + ret = (bTxt ? strings.FallingQuickly : -1); + } else { + ret = (bTxt ? strings.FallingVeryRapidly : -1); + } + return ret; + }, + + // + // getMinTemp() returns the lowest temperature today for gauge scaling + // + getMinTemp = function (deflt) { + return Math.min( + extractDecimal(data.tempTL, deflt), + extractDecimal(data.dewpointTL, deflt), + extractDecimal(data.apptempTL, deflt), + extractDecimal(data.wchillTL, deflt)); + }, + + // + // getMaxTemp() returns the highest temperature today for gauge scaling + // + getMaxTemp = function (deflt) { + return Math.max( + extractDecimal(data.tempTH, deflt), + extractDecimal(data.apptempTH, deflt), + extractDecimal(data.heatindexTH, deflt), + extractDecimal(data.humidex, deflt)); + }, + + // Celsius to Fahrenheit + c2f = function (val) { + return (extractDecimal(val) * 9 / 5 + 32).toFixed(1); + }, + // Fahrenheit to Celsius + f2c = function (val) { + return ((extractDecimal(val) - 32) * 5 / 9).toFixed(1); + }, + // kph to ms + kmh2ms = function (val) { + return (extractDecimal(val) * 0.2778).toFixed(1); + }, + // ms to kph + ms2kmh = function (val) { + return (extractDecimal(val) * 3.6).toFixed(1); + }, + kmh2ms = function (val){ + return (extractDecimal(val) / 3.6).toFixed(1); + }, + // mm to inches + mm2in = function (val) { + return (extractDecimal(val) / 25.4).toFixed(2); + }, + // inches to mm + in2mm = function (val) { + return (extractDecimal(val) * 25.4).toFixed(1); + }, + // miles to km + miles2km = function (val) { + return (extractDecimal(val) * 1.609344).toFixed(1); + }, + // nautical miles to km + nmiles2km = function (val) { + return (extractDecimal(val) * 1.85200).toFixed(1); + }, + // km to miles + km2miles = function (val) { + return (extractDecimal(val) / 1.609344).toFixed(1); + }, + // km to nautical miles + km2nmiles = function (val) { + return (extractDecimal(val) / 1.85200).toFixed(1); + }, + // hPa to inHg (@0°C) + hpa2inhg = function (val, decimals) { + return (extractDecimal(val) * 0.029528744).toFixed(decimals || 3); + }, + // inHg to hPa (@0°C) + inhg2hpa = function (val) { + return (extractDecimal(val) / 0.029528744).toFixed(1); + }, + // kPa to hPa + kpa2hpa = function (val) { + return (extractDecimal(val) * 10).toFixed(1); + }, + // hPa to kPa + hpa2kpa = function (val, decimals) { + return (extractDecimal(val) / 10).toFixed(decimals || 2); + }, + // m to ft + m2ft = function (val) { + return (val * 3.2808399).toFixed(0); + }, + // ft to m + ft2m = function (val) { + return (val / 3.2808399).toFixed(0); + }, + + // + // setCookie() writes the 'obj' in cookie 'name' for persistent storage + // + setCookie = function (name, obj) { + var date = new Date(), + expires; + // cookies valid for 1 year + date.setYear(date.getFullYear() + 1); + expires = '; expires=' + date.toGMTString(); + document.cookie = name + '=' + encodeURIComponent(JSON.stringify(obj)) + expires; + }, + + // + // getCookie() reads the value of cookie 'name' from persistent storage + // + getCookie = function (name) { + var i, x, y, + ret = null, + arrCookies = document.cookie.split(';'); + + for (i = arrCookies.length; i--;) { + x = arrCookies[i].split('='); + if (x[0].trim() === name) { + try { + y = decodeURIComponent(x[1]); + } catch (e) { + y = x[1]; + } + ret = JSON.parse(unescape(y)); + break; + } + } + return ret; + }, + + // + // setRadioCheck() sets the desired value of the HTML radio buttons to be selected + // + setRadioCheck = function (obj, val) { + $('input:radio[name="' + obj + '"]').filter('[value="' + val + '"]').prop('checked', true); + }, + + // + // convTempData() converts all the temperature values using the supplied conversion function + // + convTempData = function (convFunc) { + data.apptemp = convFunc(data.apptemp); + data.apptempTH = convFunc(data.apptempTH); + data.apptempTL = convFunc(data.apptempTL); + data.dew = convFunc(data.dew); + data.dewpointTH = convFunc(data.dewpointTH); + data.dewpointTL = convFunc(data.dewpointTL); + data.heatindex = convFunc(data.heatindex); + data.heatindexTH = convFunc(data.heatindexTH); + data.humidex = convFunc(data.humidex); + data.intemp = convFunc(data.intemp); + if (data.intempTL && data.intempTH) { + data.intempTL = convFunc(data.intempTL); + data.intempTH = convFunc(data.intempTH); + } + data.temp = convFunc(data.temp); + data.tempTH = convFunc(data.tempTH); + data.tempTL = convFunc(data.tempTL); + data.wchill = convFunc(data.wchill); + data.wchillTL = convFunc(data.wchillTL); + if (convFunc === c2f) { + data.temptrend = (+extractDecimal(data.temptrend) * 9 / 5).toFixed(1); + data.tempunit = '°F'; + } else { + data.temptrend = (+extractDecimal(data.temptrend) * 5 / 9).toFixed(1); + data.tempunit = '°C'; + } + }, + + // + // convRainData() converts all the rain data units using the supplied conversion function + // + convRainData = function (convFunc) { + data.rfall = convFunc(data.rfall); + data.rrate = convFunc(data.rrate); + data.rrateTM = convFunc(data.rrateTM); + data.hourlyrainTH = convFunc(data.hourlyrainTH); + data.rainunit = convFunc === mm2in ? 'in' : 'mm'; + }, + + // + // convWindData() converts all the wind values using the supplied conversion function + // + convWindData = function (from, to) { + var fromFunc1, toFunc1, + fromFunc2, toFunc2, + dummy = function (val) { + return val; + }; + + // convert to km/h & km + switch (from) { + case 'mph': + fromFunc1 = miles2km; + fromFunc2 = miles2km; + break; + case 'kts': + fromFunc1 = nmiles2km; + fromFunc2 = nmiles2km; + break; + case 'm/s': + fromFunc1 = ms2kmh; + fromFunc2 = dummy; + break; + case 'km/h': + // falls through + default: + fromFunc1 = dummy; + fromFunc2 = dummy; + } + // conversion function from km to required units + switch (to) { + case 'mph': + toFunc1 = km2miles; + toFunc2 = km2miles; + displayUnits.windrun = 'miles'; + break; + case 'kts': + toFunc1 = km2nmiles; + toFunc2 = km2nmiles; + displayUnits.windrun = 'n.miles'; + break; + case 'm/s': + toFunc1 = kmh2ms; + toFunc2 = dummy; + displayUnits.windrun = 'km'; + break; + case 'km/h': + // falls through + default: + toFunc1 = dummy; + toFunc2 = dummy; + displayUnits.windrun = 'km'; + } + // do the conversions + data.wgust = toFunc1(fromFunc1(data.wgust)); + data.wgustTM = toFunc1(fromFunc1(data.wgustTM)); + data.windTM = toFunc1(fromFunc1(data.windTM)); + data.windrun = toFunc2(fromFunc2(data.windrun)); + data.wlatest = toFunc1(fromFunc1(data.wlatest)); + data.wspeed = toFunc1(fromFunc1(data.wspeed)); + data.windunit = to; + }, + + // + // convBaroData() converts all the pressure values using the supplied conversion function + // + convBaroData = function (from, to) { + var fromFunc, toFunc, + dummy = function (val) { + return val; + }; + + // convert to hPa + switch (from) { + case 'hPa': + // falls through + case 'mb': + fromFunc = dummy; + break; + case 'inHg': + fromFunc = inhg2hpa; + break; + case 'kPa': + fromFunc = kpa2hpa; + break; + // no default + } + // convert to required units + switch (to) { + case 'hPa': + // falls through + case 'mb': + toFunc = dummy; + break; + case 'inHg': + toFunc = hpa2inhg; + break; + case 'kPa': + toFunc = hpa2kpa; + break; + // no default + } + + data.press = toFunc(fromFunc(data.press)); + data.pressH = toFunc(fromFunc(data.pressH)); + data.pressL = toFunc(fromFunc(data.pressL)); + data.pressTH = toFunc(fromFunc(data.pressTH)); + data.pressTL = toFunc(fromFunc(data.pressTL)); + data.presstrendval = toFunc(fromFunc(data.presstrendval), 3); + data.pressunit = to; + }, + + // + // convCloudBaseData() converts all the cloud base data units using the supplied conversion function + // + convCloudBaseData = function (convFunc) { + data.cloudbasevalue = convFunc(data.cloudbasevalue); + data.cloudbaseunit = convFunc === m2ft ? 'ft' : 'm'; + }, + + // + // setUnits() Main data conversion routine, calls all the setXXXX() sub-routines + // + setUnits = function (radio) { + var sel = radio.value; + + userUnitsSet = true; + + switch (sel) { + // == Temperature == + case 'C': + displayUnits.temp = sel; + if (data.tempunit[1] !== sel) { + setTempUnits(true); + convTempData(f2c); + if (gaugeTemp) {gaugeTemp.update();} + if (gaugeDew) {gaugeDew.update();} + } + break; + case 'F': + displayUnits.temp = sel; + if (data.tempunit[1] !== sel) { + setTempUnits(false); + convTempData(c2f); + if (gaugeTemp) {gaugeTemp.update();} + if (gaugeDew) {gaugeDew.update();} + } + break; + // == Rainfall == + case 'mm': + displayUnits.rain = sel; + if (data.rainunit !== sel) { + setRainUnits(true); + convRainData(in2mm); + if (gaugeRain) {gaugeRain.update();} + if (gaugeRRate) {gaugeRRate.update();} + } + break; + case 'in': + displayUnits.rain = sel; + if (data.rainunit !== sel) { + setRainUnits(false); + convRainData(mm2in); + if (gaugeRain) {gaugeRain.update();} + if (gaugeRRate) {gaugeRRate.update();} + } + break; + // == Pressure == + case 'hPa': + // falls through + case 'inHg': + // falls through + case 'mb': + // falls through + case 'kPa': + displayUnits.press = sel; + if (data.pressunit !== sel) { + convBaroData(data.pressunit, sel); + setBaroUnits(sel); + if (gaugeBaro) {gaugeBaro.update();} + } + break; + // == Wind speed == + case 'mph': + // falls through + case 'kts': + // falls through + case 'm/s': + // falls through + case 'km/h': + displayUnits.wind = sel; + if (data.windunit !== sel) { + convWindData(data.windunit, sel); + setWindUnits(sel); + if (gaugeWind) {gaugeWind.update();} + if (gaugeDir) {gaugeDir.update();} + if (gaugeRose) {gaugeRose.update();} + } + break; + // == CloudBase == + case 'm': + displayUnits.cloud = sel; + if (data.cloudbaseunit !== sel) { + setCloudBaseUnits(true); + convCloudBaseData(ft2m); + if (gaugeCloud) {gaugeCloud.update();} + } + break; + case 'ft': + displayUnits.cloud = sel; + if (data.cloudbaseunit !== sel) { + setCloudBaseUnits(false); + convCloudBaseData(m2ft); + if (gaugeCloud) {gaugeCloud.update();} + } + break; + // no default + } + if (config.useCookies) { + setCookie('units', displayUnits); + } + }, + + setTempUnits = function (celsius) { + if (celsius) { + data.tempunit = '°C'; + if (gaugeTemp) { + gaugeTemp.data.sections = createTempSections(true); + gaugeTemp.data.minValue = gaugeGlobals.tempScaleDefMinC; + gaugeTemp.data.maxValue = gaugeGlobals.tempScaleDefMaxC; + } + if (gaugeDew) { + gaugeDew.data.sections = createTempSections(true); + gaugeDew.data.minValue = gaugeGlobals.tempScaleDefMinC; + gaugeDew.data.maxValue = gaugeGlobals.tempScaleDefMaxC; + } + } else { + data.tempunit = '°F'; + if (gaugeTemp) { + gaugeTemp.data.sections = createTempSections(false); + gaugeTemp.data.minValue = gaugeGlobals.tempScaleDefMinF; + gaugeTemp.data.maxValue = gaugeGlobals.tempScaleDefMaxF; + } + if (gaugeDew) { + gaugeDew.data.sections = createTempSections(false); + gaugeDew.data.minValue = gaugeGlobals.tempScaleDefMinF; + gaugeDew.data.maxValue = gaugeGlobals.tempScaleDefMaxF; + } + } + if (gaugeTemp) { + gaugeTemp.gauge.setUnitString(data.tempunit); + gaugeTemp.gauge.setSection(gaugeTemp.data.sections); + } + if (gaugeDew) { + gaugeDew.gauge.setUnitString(data.tempunit); + gaugeDew.gauge.setSection(gaugeTemp.data.sections); + } + }, + + setRainUnits = function (mm) { + if (mm) { + data.rainunit = 'mm'; + if (gaugeRain) { + gaugeRain.data.lcdDecimals = 1; + gaugeRain.data.scaleDecimals = 1; + gaugeRain.data.labelNumberFormat = gaugeGlobals.labelFormat; + gaugeRain.data.sections = (gaugeGlobals.rainUseSectionColours ? createRainfallSections(true) : []); + gaugeRain.data.maxValue = gaugeGlobals.rainScaleDefMaxmm; + gaugeRain.data.grad = (gaugeGlobals.rainUseGradientColours ? createRainfallGradient(true) : null); + } + if (gaugeRRate) { + gaugeRRate.data.lcdDecimals = 1; + gaugeRRate.data.scaleDecimals = 0; + gaugeRRate.data.labelNumberFormat = gaugeGlobals.labelFormat; + gaugeRRate.data.sections = createRainRateSections(true); + gaugeRRate.data.maxValue = gaugeGlobals.rainRateScaleDefMaxmm; + } + } else { + data.rainunit = 'in'; + if (gaugeRain) { + gaugeRain.data.lcdDecimals = 2; + gaugeRain.data.scaleDecimals = gaugeGlobals.rainScaleDefMaxIn < 1 ? 2 : 1; + gaugeRain.data.labelNumberFormat = steelseries.LabelNumberFormat.FRACTIONAL; + gaugeRain.data.sections = (gaugeGlobals.rainUseSectionColours ? createRainfallSections(false) : []); + gaugeRain.data.maxValue = gaugeGlobals.rainScaleDefMaxIn; + gaugeRain.data.grad = (gaugeGlobals.rainUseGradientColours ? createRainfallGradient(false) : null); + } + if (gaugeRRate) { + gaugeRRate.data.lcdDecimals = 2; + gaugeRRate.data.scaleDecimals = gaugeGlobals.rainRateScaleDefMaxIn < 1 ? 2 : 1; + gaugeRRate.data.labelNumberFormat = steelseries.LabelNumberFormat.FRACTIONAL; + gaugeRRate.data.sections = createRainRateSections(false); + gaugeRRate.data.maxValue = gaugeGlobals.rainRateScaleDefMaxIn; + } + } + if (gaugeRain) { + gaugeRain.data.value = 0; + gaugeRain.gauge.setUnitString(data.rainunit); + gaugeRain.gauge.setSection(gaugeRain.data.sections); + gaugeRain.gauge.setGradient(gaugeRain.data.grad); + gaugeRain.gauge.setFractionalScaleDecimals(gaugeRain.data.scaleDecimals); + gaugeRain.gauge.setLabelNumberFormat(gaugeRain.data.labelNumberFormat); + gaugeRain.gauge.setLcdDecimals(gaugeRain.data.lcdDecimals); + gaugeRain.gauge.setValue(0); + gaugeRain.gauge.setMaxValue(gaugeRain.data.maxValue); + } + if (gaugeRRate) { + gaugeRRate.data.value = 0; + gaugeRRate.gauge.setUnitString(data.rainunit + '/h'); + gaugeRRate.gauge.setSection(gaugeRRate.data.sections); + gaugeRRate.gauge.setFractionalScaleDecimals(gaugeRRate.data.scaleDecimals); + gaugeRRate.gauge.setLabelNumberFormat(gaugeRRate.data.labelNumberFormat); + gaugeRRate.gauge.setLcdDecimals(gaugeRRate.data.lcdDecimals); + gaugeRRate.gauge.setValue(0); + gaugeRRate.gauge.setMaxValue(gaugeRRate.data.maxValue); + } + }, + + setWindUnits = function (to) { + var maxVal; + data.windunit = to; + if (gaugeWind) { + // conversion function to required units + switch (to) { + case 'mph': + maxVal = gaugeGlobals.windScaleDefMaxMph; + break; + case 'kts': + maxVal = gaugeGlobals.windScaleDefMaxKts; + break; + case 'km/h': + maxVal = gaugeGlobals.windScaleDefMaxKmh; + break; + case 'm/s': + maxVal = gaugeGlobals.windScaleDefMaxMs; + break; + // no default + } + // set the gauges + gaugeWind.data.maxValue = maxVal; + gaugeWind.gauge.setUnitString(data.windunit); + gaugeWind.gauge.setValue(0); + } + if (gaugeRose) { + gaugeRose.setOdoTitle(strings[getWindrunUnits(data.windunit)]); + } + }, + + setBaroUnits = function (to) { + var minVal, maxVal; + + if (!gaugeBaro) {return;} + + // set to the required units + switch (to) { + case 'hPa': + // falls through + case 'mb': + minVal = gaugeGlobals.baroScaleDefMinhPa; + maxVal = gaugeGlobals.baroScaleDefMaxhPa; + gaugeBaro.data.lcdDecimals = 1; + gaugeBaro.data.scaleDecimals = 0; + gaugeBaro.data.labelNumberFormat = gaugeGlobals.labelFormat; + break; + case 'inHg': + minVal = gaugeGlobals.baroScaleDefMininHg; + maxVal = gaugeGlobals.baroScaleDefMaxinHg; + gaugeBaro.data.lcdDecimals = 2; + gaugeBaro.data.scaleDecimals = 1; + gaugeBaro.data.labelNumberFormat = steelseries.LabelNumberFormat.FRACTIONAL; + break; + case 'kPa': + minVal = gaugeGlobals.baroScaleDefMinkPa; + maxVal = gaugeGlobals.baroScaleDefMaxkPa; + gaugeBaro.data.lcdDecimals = 2; + gaugeBaro.data.scaleDecimals = 1; + gaugeBaro.data.labelNumberFormat = steelseries.LabelNumberFormat.FRACTIONAL; + break; + // no default + } + + data.pressunit = to; + gaugeBaro.gauge.setUnitString(to); + gaugeBaro.gauge.setLcdDecimals(gaugeBaro.data.lcdDecimals); + gaugeBaro.gauge.setFractionalScaleDecimals(gaugeBaro.data.scaleDecimals); + gaugeBaro.gauge.setLabelNumberFormat(gaugeBaro.data.labelNumberFormat); + gaugeBaro.data.minValue = minVal; + gaugeBaro.data.maxValue = maxVal; + gaugeBaro.data.value = gaugeBaro.data.minValue; + }, + + setCloudBaseUnits = function (m) { + if (!gaugeCloud) {return;} + + if (m) { + gaugeCloud.data.sections = createCloudBaseSections(true); + gaugeCloud.data.maxValue = gaugeGlobals.cloudScaleDefMaxm; + } else { + gaugeCloud.data.sections = createCloudBaseSections(false); + gaugeCloud.data.maxValue = gaugeGlobals.cloudScaleDefMaxft; + } + gaugeCloud.data.value = 0; + gaugeCloud.gauge.setUnitString(m ? strings.metres : strings.feet); + gaugeCloud.gauge.setSection(gaugeCloud.data.sections); + }, + + // + // setLang() switches the HTML page language set, called by changeLang() in language.js + // + setLang = function (newLang) { + // reset to the new language + strings = newLang; + + // temperature + if (gaugeTemp) { + if (config.showIndoorTempHum) { + if ($('#rad_temp1').is(':checked')) { + gaugeTemp.data.title = strings.temp_title_out; + } else { + gaugeTemp.data.title = strings.temp_title_in; + } + } else { + gaugeTemp.data.title = strings.temp_title_out; + } + gaugeTemp.gauge.setTitleString(gaugeTemp.data.title); + if (data.ver) {gaugeTemp.update();} + } + if (gaugeDew) { + switch ($('input[name="rad_dew"]:checked').val()) { + case 'dew': + gaugeDew.data.title = strings.dew_title; + break; + case 'app': + gaugeDew.data.title = strings.apptemp_title; + break; + case 'wnd': + gaugeDew.data.title = strings.chill_title; + break; + case 'hea': + gaugeDew.data.title = strings.heat_title; + break; + case 'hum': + gaugeDew.data.title = strings.humdx_title; + break; + // no default + } + gaugeDew.gauge.setTitleString(gaugeDew.data.title); + if (data.ver) {gaugeDew.update();} + } + // rain + if (gaugeRain) { + gaugeRain.data.title = strings.rain_title; + gaugeRain.gauge.setTitleString(gaugeRain.data.title); + if (data.ver) {gaugeRain.update();} + } + // rrate + if (gaugeRRate) { + gaugeRRate.data.title = strings.rrate_title; + gaugeRRate.gauge.setTitleString(gaugeRRate.data.title); + if (data.ver) {gaugeRRate.update();} + } + // humidity + if (gaugeHum) { + if (config.showIndoorTempHum) { + if ($('#rad_hum1').is(':checked')) { + gaugeHum.data.title = strings.hum_title_out; + } else { + gaugeHum.data.title = strings.hum_title_in; + } + } else { + gaugeHum.data.title = strings.hum_title_out; + } + gaugeHum.gauge.setTitleString(gaugeHum.data.title); + if (data.ver) {gaugeHum.update();} + } + // barometer + if (gaugeBaro) { + gaugeBaro.data.title = strings.baro_title; + gaugeBaro.gauge.setTitleString(gaugeBaro.data.title); + if (data.ver) {gaugeBaro.update();} + } + // wind + if (gaugeWind) { + gaugeWind.data.title = strings.wind_title; + gaugeWind.gauge.setTitleString(gaugeWind.data.title); + if (data.ver) {gaugeWind.update();} + } + if (gaugeDir) { + gaugeDir.gauge.setPointSymbols(strings.compass); + gaugeDir.data.titles = [strings.latest_web, strings.tenminavg_web]; + gaugeDir.gauge.setLcdTitleStrings(gaugeDir.data.titles); + if (data.ver) {gaugeDir.update();} + } + if (gaugeUV) { + gaugeUV.gauge.setTitleString(strings.uv_title); + if (data.ver) {gaugeUV.update();} + } + if (gaugeSolar) { + gaugeSolar.gauge.setTitleString(strings.solar_title); + if (data.ver) {gaugeSolar.update();} + } + if (gaugeRose) { + gaugeRose.setTitle(strings.windrose); + gaugeRose.setCompassStrings(strings.compass); + gaugeRose.setOdoTitle(strings[getWindrunUnits(displayUnits.wind)]); + if (data.ver) {gaugeRose.update();} + } + if (gaugeCloud) { + // Cloudbase + gaugeCloud.data.units = data.cloudunit === 'm' ? strings.metres : strings.feet; + gaugeCloud.gauge.setTitleString(strings.cloudbase_title); + gaugeCloud.gauge.setUnitString(gaugeCloud.data.units); + if (data.ver) {gaugeCloud.update();} + } + }, + + // + // return windrun units based on the windspeed units + // + getWindrunUnits = function (spdUnits) { + var retVal; + switch (spdUnits) { + case 'mph': + retVal = 'miles'; + break; + case 'kts': + retVal = 'n_miles'; + break; + case 'km/h': + // falls through + case 'm/s': + // falls through + default: + retVal = 'km'; + break; + } + return retVal; + }, + + // + // performs a simple cloudbase calculation for those weather programs that don't supply it + // + calcCloudbase = function (temp, tempunit, dew, cloudbaseunit) { + var sprd = temp - dew; + var cb = sprd * (tempunit[1] === 'C' ? 400 : 227.3); // cloud base in feet + if (cloudbaseunit === 'm') { + cb = ft2m(cb); + } + return cb; + }, + + // + // create a shadow effect for the gauge using CSS + // + gaugeShadow = function (size) { + var offset = Math.floor(size * 0.015); + return { + 'box-shadow' : offset + 'px ' + offset + 'px ' + offset + 'px ' + gaugeGlobals.shadowColour, + 'border-radius': Math.floor(size / 2) + 'px' + }; + }, + + // + // generate a colour gradient based on start and end values + // + gradient = function (startCol, endCol, fraction) { + var redOrigin, grnOrigin, bluOrigin, + gradientSizeRed, gradientSizeGrn, gradientSizeBlu; + + redOrigin = parseInt(startCol.substr(0, 2), 16); + grnOrigin = parseInt(startCol.substr(2, 2), 16); + bluOrigin = parseInt(startCol.substr(4, 2), 16); + + gradientSizeRed = parseInt(endCol.substr(0, 2), 16) - redOrigin; // Graduation Size Red + gradientSizeGrn = parseInt(endCol.substr(2, 2), 16) - grnOrigin; + gradientSizeBlu = parseInt(endCol.substr(4, 2), 16) - bluOrigin; + + return (redOrigin + (gradientSizeRed * fraction)).toFixed(0) + ',' + + (grnOrigin + (gradientSizeGrn * fraction)).toFixed(0) + ',' + + (bluOrigin + (gradientSizeBlu * fraction)).toFixed(0); + }, + // + // returns the next highest number in the step sequence + // + nextHighest = function (value, step) { + return +value == 0 ? step : Math.ceil(+value / step) * step; + }, + // + // returns the next lowest number in the step sequence + // + nextLowest = function (value, step) { + return +value == 0 ? -step : Math.floor(+value / step) * step; + }; + // ######################################################## + // End of gauges() var declarations + // ######################################################## + + // + // Execution starts here + // + + // test for canvas support before we do anything else, especially reference steelseries which will cause the script to abort! + if (!document.createElement('canvas').getContext) { + // failed, no canvas support detected + $('body').html(strings.canvasnosupport); + setTimeout(function () { + window.location = config.oldGauges; + }, 3000); + return false; + } else { + // + // Called when the document object has loaded + // This starts the whole script. + // + $(document).ready(function () { + // Kick it all off - false for web page, true for dashboard + init(config.dashboardMode); + }); + } + + return { + setLang : setLang, + setUnits : setUnits, + processData: processData, + config : config, + init : init + }; +}()); + +// =============================================================================================================================== +// =============================================================================================================================== +// =============================================================================================================================== + + /*! + * Image w/ description tooltip v2.0 - For FF1+ IE6+ Opr8+ + * Created: April 23rd, 2010. This notice must stay intact for usage + * Author: Dynamic Drive at http://www.dynamicdrive.com/ + * Visit http://www.dynamicdrive.com/ for full source code + * Modified: M Crossley June 2011, January 2012 + * v2.- + */ +var ddimgtooltip; +ddimgtooltip = { + tiparray: (function () { + var style = {background: '#FFFFFF', color: 'black', border: '2px ridge darkblue'}, + i = 12, // set to number of tooltips required + tooltips = []; + for (;i--;) { + tooltips[i] = [null, ' ', style]; + } + return tooltips; + }()), + + tooltipoffsets: [20, -30], // additional x and y offset from mouse cursor for tooltips + + tipDelay: 1000, + + delayTimer: 0, + + tipprefix: 'imgtip', // tooltip DOM ID prefixes + + createtip: function ($, tipid, tipinfo) { + if ($('#' + tipid).length === 0) { // if this tooltip doesn't exist yet + return $('
') + .html( + ((tipinfo[1]) ? '
' + tipinfo[1] + '
' : '') + + (tipinfo[0] !== null ? '
' : '') + ) + .css(tipinfo[2] || {}) + .appendTo(document.body); + } + return null; + }, + + positiontooltip: function ($, $tooltip, e) { + var x = e.pageX + this.tooltipoffsets[0], + y = e.pageY + this.tooltipoffsets[1], + tipw = $tooltip.outerWidth(), + tiph = $tooltip.outerHeight(), + wWidth = $(window).width(), + wHght = $(window).height(), + dTop = $(document).scrollTop(); + + x = (x + tipw > $(document).scrollLeft() + wWidth) ? x - tipw - (ddimgtooltip.tooltipoffsets[0] * 2) : x; + y = (y + tiph > dTop + wHght) ? dTop + wHght - tiph - 10 : y; + // last ditch attempt to keep the graphs 'on page' + x = Math.max(x, 0); + if (tipw >= wWidth) { + $($tooltip.attr('id') + '_img').css({width: wWidth - 20}); + $('#' + $tooltip.attr('id') + '_img').css({width: wWidth - 20}); + y = e.pageY + 5; + } + $tooltip.css({left: x, top: y}); + }, + + delaybox: function ($, $tooltip) { + if (this.showTips) { + ddimgtooltip.delayTimer = setTimeout( + function () { + ddimgtooltip.showbox($tooltip); + }, ddimgtooltip.tipDelay); + } + }, + + showbox: function (tooltip) { + if (this.showTips) { + // $(tooltip).show(); + $(tooltip).fadeIn(); + } + }, + + hidebox: function ($, $tooltip) { + clearTimeout(ddimgtooltip.delayTimer); + // $tooltip.hide(); + $tooltip.fadeOut(); + }, + + showTips: false, + + init: function (targetselector) { + var tiparray = ddimgtooltip.tiparray, + $targets = $(targetselector); + + if ($targets.length === 0) { + return; + } + $targets.each(function () { + var $target = $(this), + tipsuffix, tipid, + $tooltip; + var ind = ($target.attr('id').match(/_(\d+)/) || [])[1] || ''; // match d of attribute id='tip_d' + tipsuffix = parseInt(ind, 10); // get d as integer + tipid = this.tipid = ddimgtooltip.tipprefix + tipsuffix; // construct this tip's ID value and remember it + $tooltip = ddimgtooltip.createtip($, tipid, tiparray[tipsuffix]); + + $target.mouseenter(function (e) { + var $tooltip = $('#' + this.tipid); + // ddimgtooltip.showbox($, $tooltip, e); + ddimgtooltip.delaybox($, $tooltip, e); + }); + $target.mouseleave(function () { + var $tooltip = $('#' + this.tipid); + ddimgtooltip.hidebox($, $tooltip); + }); + $target.mousemove(function (e) { + var $tooltip = $('#' + this.tipid); + ddimgtooltip.positiontooltip($, $tooltip, e); + }); + if ($tooltip) { // add mouseenter to this tooltip (only if event hasn't already been added) + $tooltip.mouseenter(function () { + ddimgtooltip.hidebox($, $(this)); + }); + } + }); + } +}; + +// if String doesn't offer a .trim() method, add it +String.prototype.trim = String.prototype.trim || function trim() { + return this.replace(/^\s+|\s+$/g, ''); +}; diff --git a/other-scripts/Steel-Gauges/web_server/language.min.js b/other-scripts/Steel-Gauges/web_server/language.min.js new file mode 100644 index 0000000..dcfc399 --- /dev/null +++ b/other-scripts/Steel-Gauges/web_server/language.min.js @@ -0,0 +1,2 @@ +/*! Version: 2.7.0 - Updated: 28 March 2019 (Added Polish) */ +var LANG=LANG||{};function changeLang(e,t){(t=void 0===t||t)&&gauges.setLang(e),$("#lang_weather").html(e.weather),$("#lang_latitude").html(e.latitude),$("#lang_longitude").html(e.longitude),$("#lang_elevation").html(e.elevation),$("#lab_temp1").html(e.temp_out_web),$("#lab_temp2").html(e.temp_in_web),$("#lab_dew1").html(e.dew_web),$("#lab_dew2").html(e.apptemp_web),$("#lab_dew3").html(e.chill_web),$("#lab_dew4").html(e.heat_web),$("#lab_dew5").html(e.humdx_web),$("#lab_hum1").html(e.hum_out_web),$("#lab_hum2").html(e.hum_in_web),$("#lang_temperature").html(e.temp_title_out),$("#lang_rainfall").html(e.rain_title),$("#lang_pressure").html(e.baro_title),$("#lang_windSpeed").html(e.wind_title),$("#lang_cloudbase").html(e.cloudbase_title)}LANG.EN={canvasnosupport:"No HTML5 Canvas support in your browser... Sorry...
Try upgrading your browser to a more recent version - nearly all browsers support Canvas now, even IE9!

Redirecting you to an 'old' gauges page...",led_title:"Remote sensor status unkonwn",led_title_ok:"Remote sensor OK",led_title_lost:"Remote sensor contact lost!",led_title_unknown:"Remote sensor status unknown!",led_title_offline:"The weather station is currently offline.",weather:"weather",latitude:"Latitude",longitude:"Longitude",elevation:"Elevation",statusStr:"Loading...",StatusMsg:"Downloading...",StatusHttp:"HTTP Request Failed",StatusRetry:"Retrying...",StatusRetryIn:"Retry in...",StatusTimeout:"Timed out",StatusPageLimit:"Page auto-update limit reached, click the status LED to continue",StatusLastUpdate:"Last update",StatusMinsAgo:"minutes ago",StatusHoursAgo:"hours ago",StatusDaysAgo:"days ago",realtimeCorrupt:"Text file download corrupted! Retrying...",timer:"seconds",at:"at",temp_title_out:"Temperature",temp_title_in:"Inside Temp",temp_out_info:"Outside Temperature",temp_out_web:"Outside",temp_in_info:"Inside Temperature",temp_in_web:"Inside",temp_trend_info:"Temperature Trend",dew_title:"Dew Point",dew_info:"Dew Point",dew_web:"Dew Point",apptemp_title:"Apparent",apptemp_info:"Apparent (Feels-Like) Temperature",apptemp_web:"Apparent",chill_title:"Wind Chill",chill_info:"Wind Chill",chill_web:"Wind Chill",heat_title:"Heat Index",heat_info:"Heat Index",heat_web:"Heat Index",humdx_title:"Humidex",humdx_info:"Humidex",humdx_web:"Humidex",rain_title:"Rainfall",rrate_title:"Rain Rate",rrate_info:"Rain Rate",LastRain_info:"Last Rain",LastRainedT_info:"Today at",LastRainedY_info:"Yesterday at",hum_title_out:"Humidity",hum_title_in:"Inside Hum",hum_out_info:"Outside Humidity",hum_in_info:"Inside Humidity",hum_out_web:"Outside",hum_in_web:"Inside",baro_title:"Pressure",baro_info:"Barometric Pressure",baro_trend_info:"Pressure Trend",wind_title:"Wind Speed",tenminavg_title:"Average Wind Speed",tenminavgwind_info:"Average wind speed (10 min)",maxavgwind_info:"Maximum average wind speed",tenmingust_info:"Gust (10 min)",maxgust_info:"Maximum gust",latest_title:"Latest Wind",latestwind_info:"Latest Wind Speed",bearing_info:"Bearing",latest_web:"Latest",tenminavg_web:"Average",dominant_bearing:"Dominant wind today",calm:"calm",windrose:"Wind Rose",windruntoday:"Wind run today",uv_title:"UV Index",uv_levels:["None","No danger","Moderate risk","High risk","Very high risk","Extreme risk"],uv_headlines:["No measurable UV Index","No danger to the average person","Moderate risk of harm from unprotected sun exposure","High risk of harm from unprotected sun exposure","Very high risk of harm from unprotected sun exposure","Extreme risk of harm from unprotected sun exposure"],uv_details:["It is still night time or it is a very cloudy day.","Wear sunglasses on bright days; use sunscreen if there is snow on the ground,
which reflects UV radiation, or if you have particularly fair skin.","Wear sunglasses and use SPF 30+ sunscreen, cover the body with clothing and
a hat, and seek shade around midday when the sun is most intense.","Wear sunglasses and use SPF 30+ sunscreen, cover the body with sun protective
clothing and a wide-brim hat, and reduce time in the sun from two hours before
to three hours after solar noon (roughly 11:00 AM to 4:00 PM during summer in
zones that observe daylight saving time).","Wear SPF 30+ sunscreen, a shirt, sunglasses, and a hat.
Do not stay out in the sun for too long.","Take all precautions, including: wear sunglasses and use SPF 30+ sunscreen,
cover the body with a long-sleeve shirt and trousers, wear a very broad hat, and
avoid the sun from two hours before to three hours after solar noon (roughly 11:00 AM
to 4:00 PM during summer in zones that observe daylight saving time)."],solar_title:"Solar Radiation",solar_currentMax:"Current theoretical maximum reading",solar_ofMax:"of maximum",solar_maxToday:"Today's maximum reading",cloudbase_title:"Cloud Base",cloudbase_popup_title:"Theoretical cloud base",cloudbase_popup_text:"The calculation is a simple one; 1000 feet for every 4.4 degrees Fahrenheit
difference between the temperature and the dew point. Note that this simply
gives the theoretical height at which Cumulus clouds would begin to form, the
air being saturated",feet:"feet",metres:"metres",miles:"miles",n_miles:"n.miles",km:"km",lowest_info:"Lowest",highest_info:"Highest",lowestF_info:"Lowest",highestF_info:"Highest",RisingVeryRapidly:"Rising very rapidly",RisingQuickly:"Rising quickly",Rising:"Rising",RisingSlowly:"Rising slowly",Steady:"Steady",FallingSlowly:"Falling slowly",Falling:"Falling",FallingQuickly:"Falling quickly",FallingVeryRapidly:"Falling very rapidly",maximum_info:"Maximum",max_hour_info:"Max per hour",minimum_info:"Minimum",coords:["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"],compass:["N","NE","E","SE","S","SW","W","NW"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},LANG.FR={canvasnosupport:"Votre navigateur ne supporte pas la fonction Canvas de HTML5 ...Désolé...
Une mise à jour de votre navigateur à une version plus récente est requise - presque tous les navigateurs supportent HTML5 maintenant, incluant IE9!

Je vous redirige vers le site contenant les anciennes jauges...",led_title:"Statut du capteur - inconnu",led_title_ok:"Statut du capteur - OK",led_title_lost:"Contact avec le capteur - interrompu!",led_title_unknown:"Contact avec le capteur - inconnu!",led_title_offline:"La station météo est actuellement hors-ligne.",weather:"Météo",latitude:"Latitude",longitude:"Longitude",elevation:"Élévation",statusStr:"Chargement...",StatusMsg:"Téléchargement...",StatusHttp:"La requête HTTP a échoué",StatusRetry:"Réessai...",StatusRetryIn:"Tentative dans...",StatusTimeout:"Dépassement de temps",StatusPageLimit:"Délais de rafraîchissement automatique atteint, cliquez la DEL de status pour continuer",StatusLastUpdate:"Dernière mise à jour - il y a",StatusMinsAgo:"minutes",StatusHoursAgo:"heures",StatusDaysAgo:"jours",realtimeCorrupt:"Le téléchargement du fichier texte est corrompu! Réessai...",timer:"secondes",at:"à",temp_title_out:"Température",temp_title_in:"Intérieure",temp_out_info:"Température à l'extérieure",temp_out_web:"À l'extérieur",temp_in_info:"Température à l'intérieure",temp_in_web:"À l'intérieur",temp_trend_info:"Tendances de la température",dew_title:"Point de rosée",dew_info:"Point de rosée",dew_web:"Point de rosée",apptemp_title:"Sensation",apptemp_info:"Sensation - température ressentie",apptemp_web:"Sensation",chill_title:"Refroidissement",chill_info:"Refroidissement éolien",chill_web:"Refroidissement",heat_title:"Indice chaleur",heat_info:"Indice de chaleur",heat_web:"Indice chaleur",humdx_title:"Humidex",humdx_info:"Humidex",humdx_web:"Humidex",rain_title:"Précipitations",rrate_title:"Débit de pluie",rrate_info:"Débit de pluie",LastRain_info:"Dernière pluie",LastRainedT_info:"aujourd'hui à",LastRainedY_info:"hier à",hum_title_out:"Humidité",hum_title_in:"Intérieure",hum_out_info:"Humidité à l'extérieur",hum_in_info:"Humidité à l'intérieur",hum_out_web:"À l'extérieur",hum_in_web:"À l'intérieur",baro_title:"Pression",baro_info:"Pression barométrique",baro_trend_info:"tendance barométrique",wind_title:"Vitesse du vent",tenminavg_title:"Vitesse moyenne",tenminavgwind_info:"Vitesse moyenne du vent (10 min)",maxavgwind_info:"vitesse moyenne maximale",tenmingust_info:"Rafale (10 min)",maxgust_info:"Rafale maximale",latest_title:"Vent récent",latestwind_info:"Vitesse du vent (récente)",bearing_info:"direction",latest_web:"Récente",tenminavg_web:"Moyenne",dominant_bearing:"Vent dominant aujourd'hui",calm:"calme",windrose:"Rose des Vents",windruntoday:"Parcours du Vent auj.",uv_title:"l’indice UV",uv_levels:["Nul","Bas","Modéré","Élevé","Très élevé","Extrême"],uv_headlines:["Aucun indice UV quantifiable","Sans danger pour l'individu moyen","Peu de risques de brûlures causées par l'exposition au soleil sans protection","Haut risque de brûlures si exposition au soleil sans protection","Risque très élevé de brûlure si exposition au soleil sans protection","Très haut risque de brûlure si exposition au soleil sans protection"],uv_details:["Il fait encore nuit ou c'est une journée très nuageuse.","Protection solaire minime requise pour les activités normales.
Portez des lunettes de soleil lors de journées ensoleillées. Si vous restez à l’extérieur pendant plus d’une heure, couvrez-vous et utilisez un écran solaire.
La réflexion par la neige peut presque doubler l’intensité des rayons UV. Portez des lunettes de soleil et appliquez un écran solaire sur votre visage.","Prenez des précautions : couvrez-vous, portez un chapeau et des lunettes de soleil, et appliquez un écran solaire, surtout si vous êtes à l’extérieur pendant 30 minutes ou plus.
Cherchez l’ombre à mi-journée, le soleil y est à son plus fort.","Protection nécessaire – les rayons UV endommagent la peau et peuvent causer des coups de soleil.
Évitez le soleil entre 11 h et 16 h, prenez toutes les précautions : cherchez l’ombre, couvrez-vous, portez un chapeau, des lunettes de soleil et appliquez un écran solaire.","Précautions supplémentaires nécessaires : la peau non protégée sera endommagée et peut brûler rapidement.
Évitez le soleil entre 11 h et 16 h. Cherchez l’ombre, couvrez-vous, portez un chapeau et des lunettes de soleil et appliquez un écran solaire.","Les valeurs de 11 ou plus sont très rares. Cependant, l’indice UV peut atteindre 14 ou plus dans les tropiques ou le sud des États-Unis.
Prenez toutes les précautions. La peau non protégée sera endommagée et peut brûler en quelques minutes. Évitez le soleil entre 11 h et 16 h, couvrez-vous, portez un chapeau et des lunettes de soleil et appliquez un écran solaire.
N’oubliez pas que le sable blanc et les autres surfaces brillantes réfléchissent les rayons UV et augmentent l’exposition à ces rayons."],solar_title:"Rayonnement solaire",solar_currentMax:"Lecture maximale théorique courante",solar_ofMax:"du maximum",solar_maxToday:"Lecture maximale de la journée",cloudbase_title:"Plafond nuageux",cloudbase_popup_title:"Plafond nuageux théorique",cloudbase_popup_text:"Le calcul est simple; 1000 pieds pour chaque différence de 4.4 degrés Fahrenheit
entre la température et le point de rosée. A noter que cela donne simplement la
hauteur théorique à laquelle des cumulus commenceront à se former, l'air étant saturé.",feet:"feet",metres:"mètres",miles:"miles",n_miles:"miles.n",km:"km",lowest_info:"le plus bas",highest_info:"le plus élevé",lowestF_info:"la plus basse",highestF_info:"la plus élevée",RisingVeryRapidly:"Augmentation très rapide",RisingQuickly:"Augmentation rapide",Rising:"Augmentation",RisingSlowly:"Augmentation lente",Steady:"Constante",FallingSlowly:"Baisse lentement",Falling:"Baisse",FallingQuickly:"Baisse rapidement",FallingVeryRapidly:"Baisse très rapidement",maximum_info:"maximum",max_hour_info:"maximum par heure",minimum_info:"minimum",coords:["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSO","SO","OSO","O","ONO","NO","NNO"],compass:["N","NE","E","SE","S","SO","O","NO"],months:["Jan","Fév","Mar","Avr","Mai","Jui","Jul","Aoû","Sep","Oct","Nov","Déc"]},LANG.DE={canvasnosupport:"Ihr Browser hat keine HTML5 Canvas Unterstützung.
Aktualisieren Sie Ihren Browser auf eine neuere Version, fast alle Browser unterstützen Canvas heutzutage, sogar der IE9!

Sie werden auf eine 'Alte' Gauge Seite umgeleitet...",led_title:"Fernsensor: Status unbekannt",led_title_ok:"Fernsensor: OK",led_title_lost:"Fernsensor: Kontakt verloren!",led_title_unknown:"Fernsensor: Status unbekannt!",led_title_offline:"Die Wetterstation ist derzeit offline.",weather:"Wetter",latitude:"Breitengrad",longitude:"Längengrad",elevation:"Höhe",statusStr:"Lade...",StatusMsg:"Lade Daten...",StatusHttp:"HTTP Anfrage fehlgeschlagen",StatusRetry:"Wiederhole...",StatusRetryIn:"Wiederhole in...",StatusTimeout:"Zeitüberschreitung",StatusPageLimit:"Automatisches Seitenupdate: Zeitlimit erreicht. Um fortzufahren auf die Status-LED klicken.",StatusLastUpdate:"Letzte Aktualisierung vor",StatusMinsAgo:"Minuten",StatusHoursAgo:"Stunden",StatusDaysAgo:"Tagen",realtimeCorrupt:"Geladene Textdatei ist beschädigt! Wiederhole...",timer:"Sekunden",at:"um",temp_title_out:"Temperatur",temp_title_in:"Temp. Innen",temp_out_info:"Außentemperatur",temp_out_web:"Außen",temp_in_info:"Innentemperatur",temp_in_web:"Innen",temp_trend_info:"Temperatur Trend",dew_title:"Taupunkt",dew_info:"Taupunkt",dew_web:"Taupunkt",apptemp_title:"Gefühlt",apptemp_info:"Gefühlte Temperatur",apptemp_web:"Gefühlt",chill_title:"Windkühle",chill_info:"Windkühle",chill_web:"Windkühle",heat_title:"Hitzeindex",heat_info:"Hitzeindex",heat_web:"Hitzeindex",humdx_title:"Humidex",humdx_info:"Humidex",humdx_web:"Humidex",rain_title:"Regen",rrate_title:"Regenmenge",rrate_info:"Regenmenge",LastRain_info:"Letzter Regen",LastRainedT_info:"Heute um",LastRainedY_info:"Gestern um",hum_title_out:"Luftfeuchte",hum_title_in:"Luftfeuchte In",hum_out_info:"Luftfeuchte Außen",hum_in_info:"Luftfeuchte Innen",hum_out_web:"Außen",hum_in_web:"Innen",baro_title:"Luftdruck",baro_info:"Barometrischer Luftdruck",baro_trend_info:"Luftdruck Trend",wind_title:"Windstärke ",tenminavg_title:"Mittelwert Windstärke",tenminavgwind_info:"Mittelwert Windstärke (10 min)",maxavgwind_info:"Höchster Mittelwert Windstärke",tenmingust_info:"Windböe (10 min)",maxgust_info:"Höchste Windböe",latest_title:"Aktueller Wind",latestwind_info:"Aktuelle Windstärke",bearing_info:"Windrichtung",latest_web:"Aktuell",tenminavg_web:"Mittelwert",dominant_bearing:"vorherrschende Windrichtung Heute",calm:"ruhig",windrose:"Windrose",windruntoday:"Windmenge heute",uv_title:"UV Index",uv_levels:["keiner","keine Gefahr","kleines Risiko","hohes Risiko","sehr hohes Risiko","extremes Risiko"],uv_headlines:["Kein messbarer UV Index","Keine Gefahr für die durchschnittliche Person","Kleines Risiko einer Schädigung durch ungeschützten Aufenthalt in der Sonne","Grosses Risiko einer Schädigung durch ungeschützten Aufenthalt in der Sonne","Sehr hohes Risiko einer Schädigung durch ungeschützten Aufenthalt in der Sonne","Extremes Risiko einer Schädigung durch ungeschützten Aufenthalt in der Sonne"],uv_details:["Es ist entweder Nacht oder ein sehr bewölkter Tag.","Tragen Sie an hellen Tagen eine Sonnenbrille; verwenden Sie Sonnenschutzmittel
wenn Sie besonders helle Haut haben oder wenn Schnee liegt welcher UV-Strahlung
reflektiert.","Tragen Sie eine Sonnenbrille und verwenden Sie Sonnencreme mit Lichtschutzfaktor
30 oder höher. Bedecken Sie den Körper mit Kleidung und tragen Sie einen Hut.
Suchen Sie um die Mittagszeit, wenn die Sonne am stärksten ist, Schatten auf.","Tragen Sie eine Sonnenbrille und verwenden Sie Sonnencreme mit Lichtschutzfaktor
30 oder höher. Schützen Sie den Körper durch entsprechende Kleidung und einen
breitkrempigen Hut. Begrenzen Sie den Aufenthalt in der Sonne zwei Stunden vor bis
drei Stunden nach dem solaren Mittag (ca. 11:00 - 16:00 Uhr in Ländern mit
Sommerzeit) auf ein Minimum.","Benutzen Sie Sonnencreme, Lichtschutzfaktor 30 oder höher. Tragen Sie eine
Sonnenbrille, T-Shirt und einen Hut. Bleiben Sie nicht zu lange in der Sonne.","Treffen Sie alle Vorsichtsmaßnahmen: tragen Sie eine Sonnenbrille und benutzen Sie
Sonnencreme, Lichtschutzfaktor 30 oder höher, bedecken Sie den Körper mit einem
langärmeligen T-Shirt, tragen Sie lange Hosen und einen breiten Hut, meiden Sie die
Sonne zwei Stunden vor bis drei Stunden nach dem solaren Mittag (ca. 11:00 - 16:00
Uhr in Ländern mit Sommerzeit)."],solar_title:"Sonnenstrahlung",solar_currentMax:"Aktueller theoretischer maximaler Messwert",solar_ofMax:"vom Maximum",solar_maxToday:"Heutiger maximaler Messwert",cloudbase_title:"Wolkenuntergrenze",cloudbase_popup_title:"Theoretische Wolkenuntergrenze",cloudbase_popup_text:"Die Berechnung ist einfach: 122 Meter für je 1,0 Grad Celsius Differenz zwischen
Temperatur und Taupunkt. Beachte, dass dies nur die theoretische Höhe angibt,
in der sich Cumulus Wolken formen, wenn die Luft gesättigt ist.",feet:"Fuß",metres:"Meter",miles:"Meilen",n_miles:"Seemeilen",km:"km",lowest_info:"Niedrigster",highest_info:"Höchster",lowestF_info:"Niedrigste",highestF_info:"Höchste",RisingVeryRapidly:"sehr schnell steigend",RisingQuickly:"schnell steigend",Rising:"steigend",RisingSlowly:"langsam steigend ",Steady:"konstant",FallingSlowly:"langsam fallend",Falling:"fallend",FallingQuickly:"schnell fallend",FallingVeryRapidly:"sehr schnell fallend",maximum_info:"Maximum",max_hour_info:"Max pro Stunde",minimum_info:"Minimum",coords:["N","NNO","NO","ONO","O","OSO","SO","SSO","S","SSW","SW","WSW","W","WNW","NW","NNW"],compass:["N","NO","O","SO","S","SW","W","NW"],months:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"]},LANG.NL={canvasnosupport:"Uw browser ondersteunt geen HTML5 Canvas .
Gebruik een modernere browser of de laatste versie, bijna alle browsers ondersteunen Canvas nu, zelfs IE9!

Je wordt naar de 'oude' meters omgeleid ...",led_title:"Buitensensor status onbekend",led_title_ok:"Buitensensor OK",led_title_lost:"Buitensensor kontakt verloren!",led_title_unknown:"Buitensensor status onbekend!",led_title_offline:"Het weerstation is momenteel offline.",weather:"Weer",latitude:"Breedtegraad",longitude:"Lengtegraad",elevation:"Hoogte",statusStr:"Laden..",StatusMsg:"Data laden...",StatusHttp:"HTTP Aanvraag afgebroken",StatusRetry:"Opnieuw...",StatusRetryIn:"Opnieuw over..",StatusTimeout:"Tijd voorbij",StatusPageLimit:"Pagina auto-update limiet bereikt, pagina herladen om door te gaan",StatusLastUpdate:"Laatste update",StatusMinsAgo:"minuten geleden",StatusHoursAgo:"uren geleden",StatusDaysAgo:"dagen geleden",realtimeCorrupt:"Data zijn fout! Opnieuw...",timer:"Seconden",at:"om",temp_title_out:"Temperatuur",temp_title_in:"Binnentemperatuur",temp_out_info:"Buitentemperatuur",temp_out_web:"Buiten",temp_in_info:"Binnentemperatuur",temp_in_web:"Binnen",temp_trend_info:"Temperatuurtrend",dew_title:"Dauwpunt",dew_info:"Dauwpunt",dew_web:"Dauwpunt",apptemp_title:"Gevoel",apptemp_info:"Gevoelstemperatuur",apptemp_web:"Gevoel",chill_title:"Windchill",chill_info:"Windchill",chill_web:"Windchill",heat_title:"Hitteindex",heat_info:"Hitteindex",heat_web:"Hitteindex",humdx_title:"Humidex",humdx_info:"Humidex",humdx_web:"Humidex",rain_title:"Regen",rrate_title:"Regenintensiteit",rrate_info:"Regenintensiteit",LastRain_info:"Laatste regen",LastRainedT_info:"Vandaag om",LastRainedY_info:"Gisteren om",hum_title_out:"Luchtvochtigheid",hum_title_in:"Luchtvochtigheid binnen",hum_out_info:"Luchtvochtigheid buiten",hum_in_info:"Luchtvochtigheid binnen",hum_out_web:"Buiten",hum_in_web:"Binnen",baro_title:"Luchtdruk",baro_info:"Barometer luchtdruk",baro_trend_info:"Barometer trend",wind_title:"Wind ",tenminavg_title:"Gemiddelde windsnelheid",tenminavgwind_info:"Gemiddelde windsnelheid (10 min)",maxavgwind_info:"Hoogste gemiddelde windsnelheid",tenmingust_info:"Wind (10 min)",maxgust_info:"Zwaarste windvlagen",latest_title:"Huidige",latestwind_info:"Huidige windsnelheid",bearing_info:"Windrichting",latest_web:"Momenteel",tenminavg_web:"Gemiddelde",dominant_bearing:"Overheersende Windrichting",calm:"kalm",windrose:"Windroos",windruntoday:"Wind run vandaag",uv_title:"UV-Index",uv_levels:["Geen","Geen gevaar","Weinig gevaar","Hoog risico","Zeer hoog risico","Extreem risico"],uv_headlines:["Geen meetbare UV Index","Geen gevaar voor de gewone mens","Kleine kans op zonnebrand bij onbeschermde huid","Hoog risico op zonnebrand bij onbeschermde huid","Zeer hoog risico op zonnebrand bij onbeschermde huid","Extreem risico op zonnebrand bij onbeschermde huid"],uv_details:["Het is nog steeds nacht of het is een zeer bewolkte dag.","Draag een zonnebril bij heldere dagen, gebruik zonnecreme bij een sneeuwlaag,
omdat die UV-straling terugkaatst, of bij zeer bleke huid.","Draag een zonnebril en gebruik creme met beschermingsfactor 30 of hoger, draag beschermende kledij en
een hoed en ga uit de zon tijdens de middaguren wanneer de zon op zijn hoogst staat.","Draag een zonnebril en gebruik creme met beschermingsfactor 30 of hoger, smeer u goed in
draag beschermende kledij met een breedgerande hoed, beperk uw tijd in de zon van twee uur voor
tot drie uur na de middagzon (ongeveer van 11:00 uur tot 16:00 uur tijdens de zomertijd.","Draag een zonnebril en gebruik creme met beschermingsfactor 30 of hoger, beschermende kledij en een hoed.
Blijf niet te lang in de zon.","Neem alle voorzorgen, waaronder: zonnebril, zonnecreme met beschermingsfactor 30 of meer,
een t-shirt met lange mouwen, een broek en een breedgerande hoed, en
vermijd de middagzon vanaf 11:00 uur tot 16:00 uur, tijdens de zomer."],solar_title:"Zonnestraling",solar_currentMax:"Huidige theoretische maximale waarde",solar_ofMax:"van maximum",solar_maxToday:"Maximale waarde vandaag",cloudbase_title:"Wolkenbasis",cloudbase_popup_title:"Theoretische wolkenbasis",cloudbase_popup_text:"De berekening is ongecompliceerd; 1000 voet voor elke 4.4 graden Fahrenheit
verschil tussen de temperatuur en dauwpunt. Let op dat dit eenvoudig
de theoretische hoogte weergeeft wanneer Cumulus wolken zich zouden vormen, en de
lucht verzadigd wordt",feet:"feet",metres:"meter",miles:"mijl",n_miles:"zeemijlen",km:"km",lowest_info:"Laagste",highest_info:"Hoogste",lowestF_info:"Laagste",highestF_info:"Hoogste",RisingVeryRapidly:"Zeer snel stijgend",RisingQuickly:"Snel stijgend",Rising:"Stijgend",RisingSlowly:"Langzaam stijgend",Steady:"Constant",FallingSlowly:"Langzaam dalend",Falling:"Dalend",FallingQuickly:"Snel dalend",FallingVeryRapidly:"Zeer snel dalend",maximum_info:"Maximum",max_hour_info:"Max per uur",minimum_info:"Minimum",coords:["N","NNO","NO","ONO","O","OZO","ZO","ZZO","Z","ZZW","ZW","WZW","W","WNW","NW","NNW"],compass:["N","NO","O","ZO","Z","ZW","W","NW"],months:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"]},LANG.SE={canvasnosupport:"Tyvärr... Ingen HTML5 Canvas support i din webläsare...
Pröva att uppgradera din webläsare till en senare version!

Styr om till en äldre sida med mätare...",led_title:"Väderstationens status är okänd",led_title_ok:"Väderstationen OK",led_title_lost:"Har tappat kontakten med väderstationen!",led_title_unknown:"Väderstationens status är okänd!",led_title_offline:"Väderstationen är för närvarande ej nåbar.",weather:"väder",latitude:"Latitud",longitude:"Longitud",elevation:"Altitud",statusStr:"Laddar...",StatusMsg:"Laddar ned...",StatusHttp:"HTTP-begäran misslyckades",StatusRetry:"Försöker på nytt...",StatusRetryIn:"Försök om...",StatusTimeout:"Timed out",StatusPageLimit:"Page auto-update limit reached, refresh your browser to continue",StatusLastUpdate:"Senaste uppdatering för",StatusMinsAgo:"minuter sedan",StatusHoursAgo:"timmar sedan",StatusDaysAgo:"dagar sedan",realtimeCorrupt:"Den nedladdade filen är felaktig! Försöker på nytt...",timer:"sekunder",at:"vid",temp_title_out:"Temperatur",temp_title_in:"Innetemp",temp_out_info:"Utetemp",temp_out_web:"Ute",temp_in_info:"Innetemp",temp_in_web:"Inne",temp_trend_info:"Trend - temp",dew_title:"Daggpunkt",dew_info:"Daggpunkt",dew_web:"Daggpunkt",apptemp_title:"Upplevd",apptemp_info:"Upplevd (känns som) temperatur",apptemp_web:"Upplevd",chill_title:"Köldeffekt",chill_info:"Köldeffekt",chill_web:"Köldeffekt",heat_title:"Värmeindex",heat_info:"Värmeindex",heat_web:"Värmeindex",humdx_title:"Fuktindex",humdx_info:"Fuktindex",humdx_web:"Fuktindex",rain_title:"Nederbörd",rrate_title:"Nederbörd",rrate_info:"Nederbördintensitet",LastRain_info:"Senaste nederbörd",LastRainedT_info:"Idag vid",LastRainedY_info:"Igår vid",hum_title_out:"Fukt. ute",hum_title_in:"Fukt. inne",hum_out_info:"Fukt. ute",hum_in_info:"Fukt. inne",hum_out_web:"Fukt. ute",hum_in_web:"Fukt. inne",baro_title:"Lufttryck",baro_info:"Lufttryck",baro_trend_info:"Trend - lufttryck",wind_title:"Vind",tenminavg_title:"Medelvind",tenminavgwind_info:"Medelvind (10 min)",maxavgwind_info:"Max medelvind",tenmingust_info:"Byvind (10 min)",maxgust_info:"Max byvind",latest_title:"Senaste vind",latestwind_info:"Senaste vind",bearing_info:"Riktning",latest_web:"Senaste",tenminavg_web:"Medel",dominant_bearing:"Dominerande vindriktning",calm:"lugn",windrose:"Vindros",windruntoday:"Vindsträcka",uv_title:"UV Index",uv_levels:["None","Ingen fara","Liten risk","Hög risk","Mycket hög risk","Extrem risk"],uv_headlines:["No measurable UV Index","Ingen fara för normalindividen","Liten skaderisk vid oskyddad solexponering","Hög skaderisk vid oskyddad solexponering","Väldigt hög skaderisk vid oskyddad solexponering","Extrem skaderisk vid oskyddad solexponering"],uv_details:["It is still night time or it is a very cloudy day.","Använd solglasögon molnfria dagar, använd solskydd om det finns snö på marken,
som reflekterar UV-strålningen, eller om du har omtålig hy.","Använd solglasögon och solskyddsfaktor 30+, täck hud med klädsel och
huvudbonad, sök skugga vid middagstid då solen är som intensivast.","Använd solglasögon och solskyddsfaktor 30+, täck hud med solskyddande klädsel och
bredbrättad huvudbonad, begränsa tiden i solen under två timmar före
och tre timmar efter då solen står som högst (~11:00 till 16:00 under sommarperioden i
områden med sommartid).","Använd solskyddsfaktor 30+, skjorta, solglasögon och huvudbonad.
Vistas inte utomhus onödigt mycket.","Vidtag alla försiktighetsåtgärder: använd solglasögon och solskyddsfaktor 30+,
täck kroppen med långärmad skjorta och långbyxor, använd bredbrättad huvudbonad,
undvik solen under två timmar före och tre timmar efter då solen står som högst (~11:00 till
16:00 under sommarperioden i områden med sommartid)."],solar_title:"Solar Radiation",solar_currentMax:"Current theoretical maximum reading",solar_ofMax:"of maximum",solar_maxToday:"Today's maximum reading",cloudbase_title:"Molnbas",cloudbase_popup_title:"Teoretisk molnbas",cloudbase_popup_text:"Beräkningen är enkel; 1000 fot för varje 4.4 grader Fahrenheit
skillnaden mellan temperaturen och daggpunkten. Observera att detta bara
ger den teoretiska höjden där Cumulusmoln skulle börja bildas, när
luften är mättad",feet:"feet",metres:"meter",miles:"miles",n_miles:"sjömil",km:"km",lowest_info:"Lägsta",highest_info:"Högsta",lowestF_info:"Lägsta",highestF_info:"Högsta",RisingVeryRapidly:"Stiger mycket snabbt",RisingQuickly:"Stiger snabbt",Rising:"Stigande",RisingSlowly:"Stigande långsamt",Steady:"Konstant",FallingSlowly:"Faller långsamt",Falling:"Fallande",FallingQuickly:"Fallande snabbt",FallingVeryRapidly:"Fallande mycket snabbt",maximum_info:"Max",max_hour_info:"Max per timma",minimum_info:"Min",coords:["N","NNO","NO","ONO","O","OSO","SO","SSO","S","SSW","SW","WSW","W","WNW","NW","NNW"],compass:["N","NO","O","SO","S","SW","W","NW"],months:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"]},LANG.DK={canvasnosupport:"Din browser understøtter ikke HTML5 lærred...
Opdatere din browser til en nyere version - næsten alle browsere understøter lærred nu - selv Internet Explorer 9!

Du omdirigeres til vores gamle forside...",led_title:"Status ukendt",led_title_ok:"Status OK",led_title_lost:"Ingen kontakt til vejrstationen!",led_title_unknown:"Status ukendt!",led_title_offline:"Vejrstationen er pt. offline.",weather:"vejret",latitude:"Breddegrad",longitude:"Længdegrad",elevation:"Højde over havet",statusStr:"Henter...",StatusMsg:"Downloader...",StatusHttp:"HTTP forespørgsel fejlede",StatusRetry:"Prøver igen...",StatusRetryIn:"Prøver om...",StatusTimeout:"Timed out",StatusPageLimit:"Sidens grænse for opdateringer blev nået, opdater din browser for at fortsætte",StatusLastUpdate:"Seneste opdatering",StatusMinsAgo:"minutter siden",StatusHoursAgo:"timer siden",StatusDaysAgo:"dage siden",realtimeCorrupt:"Fejl på vejrdatafilen - prøver igen...",timer:"sekunder",at:"kl.",temp_title_out:"Temperatur",temp_title_in:"Inde temp",temp_out_info:"Ude temperatur",temp_out_web:"Ude",temp_in_info:"Inde temperatur",temp_in_web:"Inde",temp_trend_info:"Temperatur tendens",dew_title:"Dugpunkt",dew_info:"Dugpunkt",dew_web:"Dugpunkt",apptemp_title:"Komfort",apptemp_info:"Komfort (føles som) temperatur",apptemp_web:"Komfort",chill_title:"Vindchill",chill_info:"Vindchill",chill_web:"Vindchill",heat_title:"Hedeindex",heat_info:"Hedeindex",heat_web:"Hedeindex",humdx_title:"Humidex",humdx_info:"Humidex",humdx_web:"Humidex",rain_title:"Regn",rrate_title:"Regnrate",rrate_info:"Regnrate",LastRain_info:"Seneste regn",LastRainedT_info:"I dag kl.",LastRainedY_info:"I går kl.",hum_title_out:"Fugtighed",hum_title_in:"Inde fugt",hum_out_info:"Ude fugtighed",hum_in_info:"Inde fugtighed",hum_out_web:"Ude",hum_in_web:"Inde",baro_title:"Barometer",baro_info:"Barometer",baro_trend_info:"Barometer tendens",wind_title:"Vindhastighed",tenminavg_title:"Gennemsnitlig vindhastighed",tenminavgwind_info:"Gennemsnitlig vindhastighed (10 min)",maxavgwind_info:"Maximum gennemsnitlig vindhastighed",tenmingust_info:"Vindstød (10 min)",maxgust_info:"Maximum vindstød",latest_title:"Seneste vind",latestwind_info:"Seneste vindhastighed",bearing_info:"Retning",latest_web:"Seneste",tenminavg_web:"Gennemsnit",dominant_bearing:"Dominant wind today",calm:"calm",windrose:"Wind Rose",windruntoday:"Wind run today",uv_title:"UV index",uv_levels:["Ingen","Ingen fare","Lille risiko","Høj risiko","Meget høj risiko","Ekstrem risko"],uv_headlines:["Ingen målbar UV index","Ingen fare for personskade","Lille risiko for skade hvis der ikke bruges solbeskyttelse","Stor risiko for skade, hvis der ikke bruges solbeskyttelse","Meget stor risiko for skade, hvis der ikke bruges solbeskyttelse","Ekstrem risiko for skade, hvis der ikke bruges solbeskyttelse"],uv_details:["Det er stadig mørkt - eller en meget skyet dag.","Brug solbriller på lyse dage, brug solcreme hvis der er sne på jorden,
som reflekterer UV stråling, eller hvis du har en særlig sart hud.","Brug solbriller og solcreme faktor 30+, tildæk kroppen med tøj og
hat, og søg skygge mellem 12 og 14, hvor solen er mest intens.","Brug solbriller og solcreme faktor 30+, tildæk kroppen med solbeskyttende
tøjh og brug en bredskygget hat. Søg skygge mellem 11 og 15
","Brug solcreme faktor 30+, trøje, solbriller og en hat.
Ophold dig ikke i solen i lang tid.","Tag alle forholdsregler: Brug solbriller og solcreme faktor 30+,
tildæk korppen med langærmet trøje og bukser. Brug en meget stor hat og
undgå solen mellem 11 og 15"],solar_title:"Solstråling",solar_currentMax:"Max. muligt",solar_ofMax:"af maximum",solar_maxToday:"Maximum i dag",cloudbase_title:"skyhøjde basen",cloudbase_popup_title:"Theoretical cloud base",cloudbase_popup_text:"The calculation is a simple one; 1000 feet for every 4.4 degrees Fahrenheit
difference between the temperature and the dew point. Note that this simply
gives the theoretical height at which Cumulus clouds would begin to form, the
air being saturated",feet:"feet",metres:"meters",miles:"miles",n_miles:"sømil",km:"km",lowest_info:"Laveste",highest_info:"Højeste",lowestF_info:"Laveste",highestF_info:"Højeste",RisingVeryRapidly:"Meget hurtigt stigende",RisingQuickly:"Hurtigt stigende",Rising:"Stigende",RisingSlowly:"Langsomt stigende",Steady:"Stabil",FallingSlowly:"Langsomt faldende",Falling:"Faldende",FallingQuickly:"Hurtigt faldende",FallingVeryRapidly:"Meget hurtigt faldende",maximum_info:"Maximum",max_hour_info:"Max pr. time",minimum_info:"Minimum",coords:["N","NNØ","NØ","ØNØ","Ø","ØSØ","SØ","SSØ","S","SSV","SV","VSV","V","VNV","NV","NNV"],compass:["N","NØ","Ø","SØ","S","SV","V","NV"],months:["Jan","Feb","Mar","Apr","MaJ","Jun","Jul","Aug","Sep","OKt","Nov","Dec"]},LANG.FI={canvasnosupport:"Selaimesi ei tue HTML5 Canvas tekniikkaa... Sorry...
Päivitä selain uudempaan versioon - melkein kaikki tukevat Canvas tekniikkaa, myös IE9!

Siirrytään sivulle ilman HMTL5/Canvas mittareita...",led_title:"Päivityksen tila tuntematon",led_title_ok:"Päivitys OK",led_title_lost:"Tietoliikenneyhteys poikki!",led_title_unknown:"Päivityksen tila tuntematon!",led_title_offline:"Sääasema on offline tilassa.",weather:"sää",latitude:"Latitude",longitude:"Longitude",elevation:"Korkeus merenpinnasta",statusStr:"Ladataan...",StatusMsg:"Ladataan...",StatusHttp:"HTTP pyyntö epäonnistui",StatusRetry:"Yritetään uudelleen...",StatusRetryIn:"Uusi yritys...",StatusTimeout:"Aikakatkaistiin",StatusPageLimit:"Sivun automaattisten latausten lukumäärä on saavutettu, päivitä selaimen näkymä jatkaaksesi!",StatusLastUpdate:"Päivitetty",StatusMinsAgo:"minuuttia sitten",StatusHoursAgo:"tuntia sitten",StatusDaysAgo:"päivää sitten",realtimeCorrupt:"Tekstitiedoston lataus epäonnistui! Yritetään uudelleen...",timer:"sekuntia",at:"klo.",temp_title_out:"Lämpötila",temp_title_in:"Sisälämpötila",temp_out_info:"Ulkolämpötila",temp_out_web:"Ulko",temp_in_info:"Sisälämpötila",temp_in_web:"Sisä",temp_trend_info:"Lämpötilan muutos",dew_title:"Kastepiste",dew_info:"Kastepiste",dew_web:"Kastepiste",apptemp_title:"Näennäinen",apptemp_info:"Näennäinen (tuntuu-kuin) lämpötila",apptemp_web:"Näennäinen",chill_title:"Hyytävyys",chill_info:"Hyytävyys",chill_web:"Hyytävyys",heat_title:"Tukaluus",heat_info:"Tukaluus",heat_web:"Tukaluus",humdx_title:"Kosteusindeksi",humdx_info:"Kosteusindeksi",humdx_web:"Kosteusindeksi",rain_title:"Sademäärä",rrate_title:"Voimakkuus",rrate_info:"Sateen voimakkuus",LastRain_info:"Viimeksi satanut",LastRainedT_info:"Tänään",LastRainedY_info:"Eilen",hum_title_out:"Ilmankosteus",hum_title_in:"Sisäilmankosteus",hum_out_info:"Ilmankosteus",hum_in_info:"Sisäilmankosteus",hum_out_web:"Ulko",hum_in_web:"Sisä",baro_title:"Ilmanpaine",baro_info:"Ilmanpaine",baro_trend_info:"Ilmanpaineen muutos",wind_title:"Tuulen nopeus",tenminavg_title:"Keskimääräinen tuulen nopeus",tenminavgwind_info:"Keskimääräinen tuulen nopeus (10 min)",maxavgwind_info:"Korkein keskituulen nopeus",tenmingust_info:"Puuskatuuli (10 min)",maxgust_info:"Kovin tuulen puuska",latest_title:"Viimeisin tuuli",latestwind_info:"Viimeisin tuulen nopeus",bearing_info:"Suunta",latest_web:"Viimeisin",tenminavg_web:"Keskimäärin",dominant_bearing:"Hallitseva tuulen suunta tänään",calm:"tyyntä",windrose:"Tuuliruusu",windruntoday:"Tuulen matka tänään",uv_title:"UV Indeksi",uv_levels:["n/a","Heikko","Kohtalainen","Voimakas","Hyvin voimakas","Äärimmäisen voimakas"],uv_headlines:["Ei mitattavissa olevaa UV säteilyä","Ei vaaraa normaali henkilölle","Vähäinen vaara suojaamattomassa auringonpaisteessa","Vaara suojaamattomassa auringonpaisteessa","Suuri vaara suojaamattomassa auringonpaisteessa","Äärimmäisen suuri vaara suojaamattomassa auringonpaisteessa"],uv_details:["On yöaika tai erittäin pilvistä.","Käytä aurinkolaseja. Käytä aurinkosuojavoidetta jos maassa on lunta tai jos ihosi on erityisen herkkä.","Käytä aurinkolaseja ja aurinkosuojavoidetta. Suojaa iho vaatteilla ja päähineellä
ja pysyttele varjoisassa ympäristössä keskipäivän tienoilla, kun auringon paiste on voimakkaimmillaan.","Käytä aurinkolaseja ja aurinkosuojavoidetta, jonka suojakerroin on vähintään 15.
Suojaa iho vaatteilla ja leveälierisellä päähineellä. Vähennä ulkonaoloa kello 11:n ja 16:n välillä.","Käytä aurinkolaseja ja aurinkosuojavoidetta, jonka suojakerroin on vähintään 15.
Suojaa iho vaatteilla ja leveälierisellä päähineellä. Vähennä ulkonaoloa kello 11:n ja 16:n välillä.","Varaudu säteilyyn kaikin mahdollisin tavoin, käytä aurinkolaseja ja aurinkovoidetta,
suojaa vartalo pitkähihaisella paidalla ja pitkillä housuilla, käytä leveälieristä päähinettä
ja vältä aurinkoa kello 11:n ja 16:n välillä."],solar_title:"Auringon säteilyteho",solar_currentMax:"Teorettinen maksimisäteily nyt",solar_ofMax:"maksimista",solar_maxToday:"Maksimisäteily tänään",cloudbase_title:"Pilvien korkeus",cloudbase_popup_title:"Teoreettinen pilvien korkeus",cloudbase_popup_text:"Laskentatapa on yksinkertainen; 1000 jalkaa jokaista 4.4 Fahrenheit aste-

eroa lämpötilan ja kastepisteen välillä. Huomaa että tämä yksinkertaisesti
antaa vain teoreettisen korkeuden jossa kumpupilviä alkaisi muodostua,
ilman ollessa kylläinen",feet:"feet",metres:"metriä",miles:"miles",n_miles:"n.miles",km:"km",lowest_info:"Alin",highest_info:"Korkein",lowestF_info:"Alin",highestF_info:"Korkein",RisingVeryRapidly:"Nousee erittäin nopeasti",RisingQuickly:"Nousee nopeasti",Rising:"Nousee",RisingSlowly:"Nousee hitaasti",Steady:"Vakaa",FallingSlowly:"Laskee hitaasti",Falling:"Laskee",FallingQuickly:"Laskee nopeasti",FallingVeryRapidly:"Laskee erittäin nopeasti",maximum_info:"Korkein",max_hour_info:"Suurin sademäärä tunnissa",minimum_info:"Alin",coords:["P","PKO","KO","IKO","I","IKA","KA","EKA","E","ELO","LO","LLO","L","LLU","LU","PLU"],compass:["P","KO","I","KA","E","LO","L","LU"],months:["Tammikuuta","Helmikuuta","Maaliskuuta","Huhtikuuta","Toukokuuta","Kesäkuuta","Heinäkuuta","Elokuuta","Syyskuuta","Lokakuuta","Marraskuuta","Joulukuuta"]},LANG.NO={canvasnosupport:"Ingen HTML5 Canvas-støtte i nettleseren din ... Beklager ...
Prøv å oppgradere nettleseren til en nyere versjon - nesten alle nettlesere støtter Canvas nå, selv IE9!

Omdirigerer deg til den 'gamle' målersiden ...",led_title:"Fjernsensor: Status ukjent",led_title_ok:"Fjernsensor: OK",led_title_lost:"Fjernsensor: Mistet kontakt!",led_title_unknown:"Fjernsensor: Status ukjent!",led_title_offline:"Værstasjonen er ikke aktiv.",weather:"vær",latitude:"Breddegrad",longitude:"Lengdegrad",elevation:"Høyde",statusStr:"Laster...",StatusMsg:"Laster ned...",StatusHttp:"HTTP forespørsel mislyktes",StatusRetry:"Prøver igjen...",StatusRetryIn:"Prøver igjen om...",StatusTimeout:"Tidsavbrutt",StatusPageLimit:"Sidens automatiske oppdatering er nådd, du må oppdatere (F5) siden for å fortsette",StatusLastUpdate:"Siste oppdatering",StatusMinsAgo:"minutter siden",StatusHoursAgo:"timer siden",StatusDaysAgo:"dager siden",realtimeCorrupt:"Tekstfilnedlasting avbrutt! Prøver på nytt ...",timer:"sekunder",at:"klokken",temp_title_out:"Utetemperatur",temp_title_in:"Innetemperatur",temp_out_info:"Utetemperatur",temp_out_web:"Utendørs",temp_in_info:"Innetemperatur",temp_in_web:"Innendørs",temp_trend_info:"Temperaturtrend",dew_title:"Duggpunkt",dew_info:"Duggpunkt",dew_web:"Duggpunkt",apptemp_title:"Følt",apptemp_info:"Følt temperatur",apptemp_web:"Følt",chill_title:"Vindfaktor",chill_info:"Vindfaktor",chill_web:"Vindfaktor",heat_title:"Varmeindeks",heat_info:"Varmeindeks",heat_web:"Varmeindeks",humdx_title:"Luftfuktighet",humdx_info:"Luftfuktighet",humdx_web:"Luftfuktighet",rain_title:"Nedbør",rrate_title:"Nedbør",rrate_info:"Nedbørsrate",LastRain_info:"Sist nedbør",LastRainedT_info:"I dag klokken",LastRainedY_info:"I går klokken",hum_title_out:"Luftfuktighet",hum_title_in:"Luftfuktighet inne",hum_out_info:"Luftfuktighet ute",hum_in_info:"Luftfuktighet inne",hum_out_web:"Utendørs",hum_in_web:"Innendørs",baro_title:"Trykk",baro_info:"Barometrisk trykk",baro_trend_info:"Trykktrend",wind_title:"Vindhastighet",tenminavg_title:"Snitt vindhastighet",tenminavgwind_info:"Snitt vindhastighet (10 min)",maxavgwind_info:"Maks. snitt vindhastighet",tenmingust_info:"Vindkast (10 min)",maxgust_info:"Høyeste vindkast",latest_title:"Siste vind",latestwind_info:"Siste vindhastighet",bearing_info:"Retning",latest_web:"Siste",tenminavg_web:"Snitt",dominant_bearing:"Dominerende vind i dag",calm:"stille",windrose:"Vindrose",windruntoday:"Vindstrekning i dag",uv_title:"UV Indeks",uv_levels:["Ingen","Ingen fare","Liten risiko","Høy risiko","Veldig høy risiko","Ekstrem risiko"],uv_headlines:["Ingen målbar UV Indeks","Ingen fare for en 'gjennomsnittlig' person","Liten risiko for skade fra ubeskyttet soling","Høy risiko for skade fra ubeskyttet soling","Svært høy risiko for skade fra ubeskyttet soling","Ekstrem risiko for skade fra ubeskyttet soling"],uv_details:["Det er fortsatt natt - eller det er en veldig overskyet dag.","Bruk solbriller på lyse dager, bruk solkrem hvis det er snø på bakken,
som reflekterer UV-stråling - hvis du ikke har spesielt god hud.","Bruk solbriller og SPF30 + solkrem, dekk kroppen med klær og
en lue, søk skygge midt på dagen når solen er mest intens.","Bruk solbriller og SPF30 + solkrem, dekk kroppen med solbeskyttende
klær og en skyggelue, reduser tid i solen fra to timer før
til tre timer etter at solen er på det høyeste (ca 11:00 til 16:00 om sommeren i
(soner som bruker sommertid).","Bruk SPF30 + solkrem, en skjorte, solbriller og solhatt.
Ikke være ute i solen for lenge.","Ta alle forholdsregler, inkludert: bruk av solbriller samt bruk SPF30 + solkrem,
dekk kroppen med en langermet skjorte og bukse, bruk skyggelue og
unngå solen fra to timer før til tre timer etter at solen er på det høyeste (ca 11:00
til 16:00 om sommeren i soner som bruker sommertid)."],solar_title:"Solstråling",solar_currentMax:"Nåværende teoretiske maksimale måling",solar_ofMax:"av maksimalt",solar_maxToday:"Dagens maksimale måling",cloudbase_title:"Skybase",cloudbase_popup_title:"Teoretisk skybase",cloudbase_popup_text:"Beregningen er en enkel en; 1000 feet for hver 4,4 grader Fahrenheit
forskjell mellom temperaturen og duggpunktet. Legg merke til at dette
gir bare den teoretiske høyden hvor cumulusskyer ville begynne å dannes, når
luften er mettet.",feet:"feet",metres:"meter",miles:"miles",n_miles:"n.mil",km:"km",lowest_info:"Lavest",highest_info:"Høyest",lowestF_info:"Lavest",highestF_info:"Høyest",RisingVeryRapidly:"Øker veldig raskt",RisingQuickly:"Øker raskt",Rising:"Øker",RisingSlowly:"Øker sakte",Steady:"Jevn",FallingSlowly:"Faller sakte",Falling:"Faller",FallingQuickly:"Faller raskt",FallingVeryRapidly:"Faller veldig raskt",maximum_info:"Maks.",max_hour_info:"Maks. pr. time",minimum_info:"Min.",coords:["N","NNØ","NØ","ØNØ","Ø","ØSØ","SØ","SSØ","S","SSV","SV","VSV","V","VNV","NV","NNV"],compass:["N","NØ","Ø","SØ","S","SV","V","NV"],months:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"]},LANG.IT={canvasnosupport:"HTML5 Canvas non supportato dal tuo browser... Spiacente...
Prova ad aggiornare il tuo browser ad una versione piè recente - quasi tutti i browser supportano Canvas adesso, eccetto IE9!

Ti sto reindirizzando ad una pagina dei calibri precedente...",led_title:"Sensori: stato sconosciuto",led_title_ok:"Sensori: comumicazione OK",led_title_lost:"Sensori: comunicazione non OK",led_title_unknown:"Sensori: stato sconosciuto",led_title_offline:"Stazione meteo temporaneamente OFFLINE",weather:"meteo",latitude:"Latitudine",longitude:"Longitudine",elevation:"Altezza",statusStr:"Caricamento...",StatusMsg:"Downloading...",StatusHttp:"Richiesta HTTP Fallita",StatusRetry:"Sto riprovando...",StatusRetryIn:"Riprovo in...",StatusTimeout:"Timed out",StatusPageLimit:"Raggiunto limite auto-aggiornamento pagina, aggiorna la pagina per continuare",StatusLastUpdate:"Ultimo aggiornamento",StatusMinsAgo:"minuti fa",StatusHoursAgo:"ore fa",StatusDaysAgo:"giorni fa",realtimeCorrupt:"File di testo scaricato corrotto! Sto riprovando...",timer:"secondi",at:"alle",temp_title_out:"Temp. est.",temp_title_in:"Temp. int.",temp_out_info:"Temp. esterna",temp_out_web:"Esterna",temp_in_info:"Temp. interna",temp_in_web:"Interna",temp_trend_info:"Variaz. temp.",dew_title:"Dew Point",dew_info:"Dew Point",dew_web:"Dew Point",apptemp_title:"T. apparen.",apptemp_info:"Temp. apparente",apptemp_web:"Temp. apparente",chill_title:"Wind Chill",chill_info:"Wind Chill",chill_web:"Wind Chill",heat_title:"Ind. calor.",heat_info:"Indice di calore",heat_web:"Indice di calore",humdx_title:"Ind. umid.",humdx_info:"Indice di umidità",humdx_web:"Indice di umidità",rain_title:"Precipitaz.",rrate_title:"Rain Rate",rrate_info:"Rateo precipitaz.",LastRain_info:"Ultime precipit.",LastRainedT_info:"Oggi alle",LastRainedY_info:"Ieri alle",hum_title_out:"Umidità",hum_title_in:"Umid. int.",hum_out_info:"Umid. esterna",hum_in_info:"Umid. interna",hum_out_web:"Esterna",hum_in_web:"Interna",baro_title:"Pressione",baro_info:"Pressione barometrica",baro_trend_info:"Variaz. press.",wind_title:"Vel. vento",tenminavg_title:"Vel. media",tenminavgwind_info:"Vel. media vento (10 min. media)",maxavgwind_info:"Vel. max. vento (10 min. media)",tenmingust_info:"Raffica max. (ultimi 10 min.)",maxgust_info:"Raffica max.",latest_title:"Ult. mis.",latestwind_info:"Ultima vel. misurata",bearing_info:"Direzione",latest_web:"Ultima direz.",tenminavg_web:"Direz. media",dominant_bearing:"Vento dominante oggi",calm:"calmo",windrose:"Direz. dominante",windruntoday:"Wind run odierno",uv_title:"Indice UV",uv_levels:["Nessuna","Nessun pericolo","Rischio basso","Rischio alto","Rischio molto alto","Rischio estremo"],uv_headlines:["Indice UV non misurabile","Nessun pericolo per la maggior parte delle persone","Lieve pericolo di scottatura da una esposizione al sole non adeguatamente protetta","Alto rischio di scottature da una esposizione al sole non adeguatamente protetta","Rischio molto alto di scottature da una esposizione al sole non adeguatamente protetta","Rischio estremo di scottature da una esposizione al sole non adeguatamente protetta"],uv_details:["E' ancora notte o è molto nuvoloso.","Indossa occhiali da sole nei giorni con molta luce; usa lenti da sole con neve al suolo,
che potrebbe riflettere radiazioni UV, o se hai pelle particolarmente chiara.","Indossa occhiali da sole ed utilizza protezioni solari SPF 30+, mantieni i vestiti ed indossa
un cappello, riparati all'ombra durante le ore centrali quando il sole è più intenso.","Indossa occhiali da sole ed utilizza protezioni solari SPF 30+, proteggi il corpo indossando vestiti chiari
e un cappello a tesa larga, riduci inoltre l'esposizione al sole da due ore prima
a tre ore dopo mezzogiorno (approssimativamente dalle 11:00 alle 16:00 durante l'estate nelle
zone che osservano l'ora legale).","Utilizza protezioni solari SPF 30+, una t-shirt, occhiali da sole, ed un cappello.
Non stare al sole troppo a lungo.","Prendi tutte le precauzioni, incluso: occhiali da sole, utilizzo protezioni solari SPF 30+,
proteggi il corpo con una t-shirt a maniche lunghe e pantaloni, indossa un cappello con tesa, ed
evita il sole da due ore prima a tre ore dopo mezzogiorno (approssimativamente dalle 11:00
alle 16:00 durante l'estate nelle zone che osservano l'ora legale)."],solar_title:"Radiazione solare",solar_currentMax:"Attuale massima lettura teorica",solar_ofMax:"del massimo",solar_maxToday:"Lettura massima odierna",cloudbase_title:"Base nuvola",cloudbase_popup_title:"base nuvola teorica",cloudbase_popup_text:"Il calcolo è semplice; 1000 piedi per ogni 4,4 gradi Fahrenheit
differenza tra la temperatura e il punto di rugiada. Si noti che questo semplicemente
dà l'altezza teorica a cui Cumulus nuvole avrebbero cominciato a formare,
perché l'aria essere satura",feet:"piedi",metres:"metri",miles:"miglia",n_miles:"miglia n.",km:"km",lowest_info:"Minimo",highest_info:"Massimo",lowestF_info:"Minima",highestF_info:"Massima",RisingVeryRapidly:"In crescita molto rapida",RisingQuickly:"In crescita rapida",Rising:"In crescita",RisingSlowly:"In crescita lenta",Steady:"Costante",FallingSlowly:"In lento calo",Falling:"In calo",FallingQuickly:"In veloce calo",FallingVeryRapidly:"In calo molto rapido",maximum_info:"Massimo",max_hour_info:"Max. per ora",minimum_info:"Minimo",coords:["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSO","SO","OSO","O","ONO","NO","NNO"],compass:["N","NE","E","SE","S","SO","O","NO"],months:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"]},LANG.ES={canvasnosupport:"No hay soporte para HTML5 en su navegador ... Lo siento ...
Trate de actualizar su navegador a una versión más reciente - casi todos los navegadores son compatibles con él ahora, incluso IE9!

Redirigir a la antigua página de medidores ...",led_title:"Sensor remoto en estado desconocido",led_title_ok:"Sensor remoto funcionando correctamente",led_title_lost:"Contacto perdido con el sensor remoto",led_title_unknown:"Sensor remoto en estado desconocido",led_title_offline:"La estación meteorológica no está conectada",weather:"estado del tiempo",latitude:"Latitud",longitude:"Longitud",elevation:"Elevación",statusStr:"Cargando ...",StatusMsg:"Recibiendo ...",StatusHttp:"Error en petición HTTP",StatusRetry:"Volviendo a probar ...",StatusRetryIn:"Reintentando ...",StatusTimeout:"Tiempo excedido",StatusPageLimit:"Se ha alcanzado el limite de tiempo de actualizacion automatica, recargue la pagina para continuar",StatusLastUpdate:"Ultima actualización a las",StatusMinsAgo:"minutos",StatusHoursAgo:"horas",StatusDaysAgo:"días",realtimeCorrupt:"Archivo dañado! Reintentando ...",timer:"Segundos",at:"a las",temp_title_out:"Temperatura",temp_title_in:"Temp. interior",temp_out_info:"Temperatura exterior",temp_out_web:"Exterior",temp_in_info:"Temperatura interior",temp_in_web:"Interior",temp_trend_info:"Tendencia",dew_title:"Rocío",dew_info:"Temperatura de rocío",dew_web:"Rocío",apptemp_title:"Temp. aparente",apptemp_info:"Temperatura aparente",apptemp_web:"Temperatura aparente",chill_title:"Windchill",chill_info:"Windchill",chill_web:"Windchill",heat_title:"Indice de calor",heat_info:"Indice de calor",heat_web:"Indice de calor",humdx_title:"Humidex",humdx_info:"Humidex",humdx_web:"Humidex",rain_title:"Precipitación",rrate_title:"Intensidad de lluvia",rrate_info:"Intensidad de lluvia",LastRain_info:"Llovió por última vez",LastRainedT_info:"Hoy a las",LastRainedY_info:"Ayer a las",hum_title_out:"Humedad",hum_title_in:"Humedad interior",hum_out_info:"Humedad Exterior",hum_in_info:"Humedad interior",hum_out_web:"Exterior",hum_in_web:"Interior",baro_title:"Presión",baro_info:"Presión",baro_trend_info:"Tendencia de presión",wind_title:"Velocidad Viento",tenminavg_title:"Velocidad media actual",tenminavgwind_info:"Velocidad media actual (10 min)",maxavgwind_info:"Velocidad media máxima",tenmingust_info:"Rácha (10 min)",maxgust_info:"Racha máxima",latest_title:"Viento actual",latestwind_info:"Última lectura de viento",bearing_info:"Dirección",latest_web:"Actual",tenminavg_web:"Media",dominant_bearing:"Viento dominante hoy",calm:"calma",windrose:"Rosa de los Vientos",windruntoday:"Recorrido del viento hoy",uv_title:"Indice UV",uv_levels:["Nulo","Sin riesgo","Riesgo bajo","Riesgo alto","Riesgo muy alto","Riesgo extremo"],uv_headlines:["Indice UV no medible","Sin riesgo para la población media","Riesgo bajo de quemadura por exposición al sol sin protección","Riesgo alto de quemadura por exposición al sol sin protección","Riesgo muy alto de quemadura por exposición al sol sin protección","Riesgo extremo de quemadura por exposición al sol sin protección"],uv_details:["Es aun de noche o el día está muy nublado.","Use gafas de sol en días soleados; use protección solar si hay nieve en el suelo,
que refleja la radiación UV, o si tiene la piel particularmente sensible.","Use gafas de sol y protector solar factor 30 o superior, cubra el cuerpo con ropa y
una gorra, y busque zonas de sombra al mediodía cuando el sol es más intenso.","Use gafas de sol y protección solar factor 30 o superior, cubra el cuerpo con ropas que protejan del sol
y sombreros anchos, y reduzca el tiempo al sol desde dos horas antes hasta
tres horas después del mediodía solar (aproximadamente desde las 11:00 hasta las 16:00 en verano).","Use protección solar factor 30 o superior, camisa, gafas de sol, y gorra.
No permanezca al sol durante mucho tiempo.","Tome todas las precauciones, incluyendo: usar gafas de sol y protección solar factor 30 o superior,
cubrir el cuerpo con camisas de manga larga y pantalones, llevar sombreros de ala ancha, y
evitar el sol desde dos horas antes hasta tres horas después del mediodía solar
(aproximadamente desde las 11:00 hasta las 16:00 PM en verano)."],solar_title:"Radiación solar",solar_currentMax:"Máximo teórico en este momento",solar_ofMax:"del máximo teórico",solar_maxToday:"Valor máximo real hoy",cloudbase_title:"base de las nubes",cloudbase_popup_title:"Theoretical cloud base",cloudbase_popup_text:"The calculation is a simple one; 1000 feet for every 4.4 degrees Fahrenheit
difference between the temperature and the dew point. Note that this simply
gives the theoretical height at which Cumulus clouds would begin to form, the
air being saturated",feet:"feet",metres:"metros",miles:"millas",n_miles:"millas n.",km:"km",lowest_info:"Mínima",highest_info:"Máxima",lowestF_info:"Mínima",highestF_info:"Máxima",RisingVeryRapidly:"Subiendo muy rápidamente",RisingQuickly:"Subiendo rápidamente",Rising:"Subiendo",RisingSlowly:"Subiendo lentamente",Steady:"Estable",FallingSlowly:"Bajando lentamente",Falling:"Bajando",FallingQuickly:"Bajando rápidamente",FallingVeryRapidly:"Bajando muy rápidamente",maximum_info:"Máxima",max_hour_info:"Máxima por hora",minimum_info:"Mínima",coords:["N","NNE","NE","ENE","E","ESE","SE","SSE","S","OSO","O","OSO","O","ONO","NO","NNO","ONO"],compass:["N","NE","E","SE","S","SO","O","NO"],months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},LANG.CT={canvasnosupport:"No hi ha suport per HTML5 en el seu navegador ... Ho sento ...
Intenta actualitzar el vostre navegador a una versió més recent - gairebé tots els navegadors són compatibles amb HTML5 ara, fins i tot IE9!

Redirigir a una 'vella' pàgina de mesuradors ...",led_title:"Estat del sensor remot desconegut",led_title_ok:"Sensor remot correcte",led_title_lost:"Perdut contacte amb el sensor remot",led_title_unknown:"Estat del sensor remot desconegut ",led_title_offline:"L'estació meteorològica està fora de línea",weather:"El Temps",latitude:"Latitud",longitude:"Longuitud",elevation:"Elevació",statusStr:"Carregant ...",StatusMsg:"Descàrrega de dades ...",StatusHttp:"Petició HTTP Error",StatusRetry:"Tornant a provar ...",StatusRetryIn:"Tornant a provar en ..",StatusTimeout:"Temps d'espera esgotat",StatusPageLimit:"La autoactualització de la pàgina ha arribat al límit, actualitza el teu navegador per a continuar",StatusLastUpdate:"Última actualització",StatusMinsAgo:"minuts",StatusHoursAgo:"hores",StatusDaysAgo:"dies",realtimeCorrupt:"Descàrrega de l'arxiu de text corrupte! reintentant ...",timer:"segons",at:"a les ",temp_title_out:"Temperatura",temp_title_in:"°T Interior",temp_out_info:"Temp exterior",temp_out_web:"Exterior",temp_in_info:"Temp interior",temp_in_web:"Interior",temp_trend_info:"Tendència",dew_title:"Rosada",dew_info:"Punt de rosada",dew_web:"Punt de rosada",apptemp_title:"Temp aparent",apptemp_info:"Temperatura aparent",apptemp_web:"Aparent",chill_title:"°T sensació",chill_info:"°T sensació",chill_web:"°T sensació",heat_title:"Índex de calor",heat_info:"Índex de calor",heat_web:"Índex de calor",humdx_title:"°T xafogor",humdx_info:"°T xafogor",humdx_web:"°T xafogor",rain_title:"Pluja",rrate_title:"Intensitat de pluja",rrate_info:"Intensitat de pluja",LastRain_info:"Últim dia de pluja",LastRainedT_info:"Avui a les",LastRainedY_info:"Ahir a les",hum_title_out:"Humitat Exterior",hum_title_in:"Humitat Interior",hum_out_info:"Humitat Exterior",hum_in_info:"Humitat Interior",hum_out_web:"Exterior",hum_in_web:"Interior",baro_title:"Pressió",baro_info:"Pressió",baro_trend_info:"Tendència",wind_title:"Velocitat del Vent",tenminavg_title:"Velocitat mitjana del vent",tenminavgwind_info:" Vel. del Vent (promig 10')",maxavgwind_info:"Vent Màxim (promig 10')",tenmingust_info:"Ràfega màxima (últims 10 min)",maxgust_info:"Ràfega màxima",latest_title:"Direcció del vent",latestwind_info:"Últimes velocitat del vent",bearing_info:"última",latest_web:"Darrer",tenminavg_web:"Mitjana",dominant_bearing:"Vent dominant avui",calm:"calma",windrose:"Rosa dels Vents",windruntoday:"Recorregut del vent avui",uv_title:"Index UV",uv_levels:["Cap","Sense perill","Risc mínim","Risc alt","Risc molt alt","Risc extrem"],uv_headlines:["Index UV no mesurable","Sense perill per a la mitjana de les persones","Risc baix de lesions per exposició al sol sense protecció","Risc alt de lesions per exposició al sol sense protecció","Risc molt alt de lesions per exposició al sol sense protecció","Risc extrem de lesions per exposició al sol sense protecció"],uv_details:["Encara és de nit o és un dia molt tapat.","Utilitza ulleres de sol en dies clars; feu servir protecció solar si hi ha neu al terra,
que reflecteix la radiació UV, o si té la pell particularment clara.","Utilitzar ulleres de sol i protecció solar SPF 30+, cobrir el cos amb roba i
barret, busqui ombra per migdia quan el sol és més intens.","Utilitzi ulleres de sol i protecció solar SPF 30+, cobriu el cos amb roba
i un barret, reduiu l'exposició al sol de dos
a tres hores abans del migdia solar (normalment de 11:00 AM a 4:00 PM durant l'estiu en
zones que fan servir l'horari d'estiu).","Utilitzar protecció solar SPF 30+, una camisa, ulleres de sol i barret.
No estar al sol durant llargs períodes de temps.","Prengui totes les precaucions, incloent: utilitzar ulleres de sol i protecció solar SPF 30+,
cobrir el cos amb camises de màniga llarga i pantalons llargs, utilitzar un barret ampli, i
evitar el sol a partir de dues hores abans o tres hores després del migdia solar (aprox. de 11:00 AM
a 4:00 PM durant l'estiu en zones que fan servir l'horari d'estiu)."],solar_title:"Radiació Solar",solar_currentMax:"Màxima lectura teòrica actual",solar_ofMax:"del màxim",solar_maxToday:"Lectura màxima d'avui",cloudbase_title:"base dels núvols",cloudbase_popup_title:"Theoretical cloud base",cloudbase_popup_text:"The calculation is a simple one; 1000 feet for every 4.4 degrees Fahrenheit
difference between the temperature and the dew point. Note that this simply
gives the theoretical height at which Cumulus clouds would begin to form, the
air being saturated",feet:"feet",metres:"metres",miles:"milles",n_miles:"milles n.",km:"km",lowest_info:"Mínima",highest_info:"Màxima",lowestF_info:"Mínima",highestF_info:"Màxima",RisingVeryRapidly:"Pujant molt ràpidament",RisingQuickly:"Pujant ràpidament",Rising:"Pujant",RisingSlowly:"Pujant lentament",Steady:"Estable",FallingSlowly:"Baixant lentament",Falling:"Baixant",FallingQuickly:"Baixant ràpidament",FallingVeryRapidly:"Baixant molt ràpidament",maximum_info:"Màxim",max_hour_info:"Pluja horària màxima",minimum_info:"Mínim",coords:["N","NNE","NE","ENE","E","ESE","SE","SSE","S","WSW","W","WSW","W","WNW","NW","NNW","WNW"],compass:["N","NE","E","ES","S","SW","W","NW"],months:["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"]},LANG.GR={canvasnosupport:"Η έκδοση του browser που χρησιμοποιήτε δεν υποστηρίζει την γλώσσα HTML-5
Αναβαθμίστε τον browser που χρησιμοποιήτε σε εκδοση που υποστηρίζει HTML-5

Ανακατεύθνση σελίδας στην παλιά.. gauges page...",led_title:"Απώλεια επαφής με τον αισθητήρα",led_title_ok:"Αισθητήρα εντάξει",led_title_lost:"Απώλεια επαφής!",led_title_unknown:"Αγωστη κατάσταση αισθητήρα!",led_title_offline:"Ο μετεωρολογικός σταθμός είναι εκτός δικτύου.",weather:"Καιρός",latitude:"Βόρειο πλάτος",longitude:"Ανατολικό μήκος",elevation:"Υψόμετρο",statusStr:"Φορτώνει...",StatusMsg:"Φότρωση δεδομένων....",StatusHttp:"Απώλεια διεύθυνσης http...",StatusRetry:"Επανάληψη...",StatusRetryIn:"Επανάληψη σε...",StatusTimeout:"Λήξη χρόνου",StatusPageLimit:"Παρακαλώ ανανεώστε τον browser....",StatusLastUpdate:"Τελευταία λήψη δεδομένων",StatusMinsAgo:"λεπτά πρίν",StatusHoursAgo:"ώρες πρίν",StatusDaysAgo:"μέρες πριν",realtimeCorrupt:"Προσπάθεια ανάκτησης δεδομένων, επανάληψη",timer:"Δευτερόλεπτα",at:"στις",temp_title_out:"Θερμόμετρο",temp_title_in:"Εσωτερική θερμοκρασία",temp_out_info:"Εξωτερική θερμοκρασία",temp_out_web:"Εξωτερική",temp_in_info:"Εσωτερική θερμοκρασία",temp_in_web:"Εσωτερική",temp_trend_info:"Τάση θερμοκρασίας",dew_title:"Σημείο δρόσου",dew_info:"Σημείο δρόσου",dew_web:"Σημείο δρόσου",apptemp_title:"Αισθητή θερμοκρασία",apptemp_info:"Αισθητή θερμοκρασία",apptemp_web:"Αισθητή θερμοκρασία",chill_title:"Αίσθηση ψύχους",chill_info:"Αίσθηση ψύχους",chill_web:"Αίσθηση ψύχους",heat_title:"Δείκτης δυσφορίας",heat_info:"Δείκτης δυσφορίας",heat_web:"Δείκτης δυσφορίας",humdx_title:"Δείκτης υγρασίας",humdx_info:"Δείκτης υγρασίας",humdx_web:"Δείκτης υγρασίας",rain_title:"Βροχόπτωση",rrate_title:"Ενταση βροχόπτωσης",rrate_info:"Ενταση βροχόπτωσης",LastRain_info:"Τελευταία βροχόπτωση",LastRainedT_info:"Σήμερα στις",LastRainedY_info:"χθες στις",hum_title_out:"Υγρασία",hum_title_in:"Εσωτερική υγρασία",hum_out_info:"Εξωτερική υγρασία",hum_in_info:"Εσωτερική υγρασία",hum_out_web:"Εξωτερική",hum_in_web:"Εσωτερική",baro_title:"Βαρόμετρο",baro_info:"Ατμοσφαιρική πίεση",baro_trend_info:"Τάση πίεσης",wind_title:"Aνεμόμετρο",tenminavg_title:"Μέση ταχύτητα ανέμου",tenminavgwind_info:"Μέση 10λεπτη ταχύτητα ανέμου",maxavgwind_info:"Μέγιστη μέση ταχύτητα ανέμου",tenmingust_info:"Ριπή ανέμου",maxgust_info:"Μέγιστη ριπή ανέμου",latest_title:"Τελευταία ένδειξη ανέμου",latestwind_info:"Τελευταία ταχύτητα ανέμου",bearing_info:"Διέυθυνση",latest_web:"Τελευταία",tenminavg_web:"Μέση",dominant_bearing:"Επικρατέστερη διέυθυνση",calm:"Νηνεμία",windrose:"Ανεμούριο",windruntoday:"Τρέξιμο Αέρα",uv_title:"UV Ενδειξη",uv_levels:["Μηδενικό","Ακίνδυνο","Μικρή Επικυνδυνότητα","Υψηλή Επικυνδυνότητα","Πολύ υψηλή επικυνδυνότητα","Ακραία επικυνδυνότητα"],uv_headlines:["Μη μετρήσιμη UV ένδεικη","Ακίνδυνη στο μέσο επίπεδο","Μικρός κίνδυνος στην ηλιακή ακτινοβολία","Υψηλός κίνδυνος στην ηλιακή ακτινοβολία","Πολύ υψηλός κίνδυνος στην ηλιακή ακτινοβολία","Eξαιρετικά υψηλός κίνδυνος στην ηλιακή ακτινοβολία"],uv_details:["Ακόμα είναι νύχτα ή η μέρα είναι πολύ συννεφιασμένη.","Φοράμε γυαλιά ηλίου; φοράμε γυαλιά ηλίου όταν το έδαφος είναι χιονοσκεπές,
φοράμε ρούχα που αντανακλούν την ηλιακή UV ακτινοβολία.","Φοράμε γυαλιά και αντηλιακό με δείκτη SPF 30+ , Ντυνόμαστε με ανοιχτόχρωμα ρούχα
καπέλο, και αποφεύγουμε τον ήλιο τις θερμές ώρες της ημέρας.","Φοράμε γυαλιά και αντηλιακό με δείκτη SPF 30+ , καλύπτουμε το σώμα με αντηλιακό
Προγραμματίζουμε τις εξωτερικές δουλειές
3 ώρες μετά την μέγιστη ακτινοβολία (από τις 11 το πρωί ως τις 4 το αποευμα
Οι ζώνες της θερινής ώρας).","Φοράμε αντηλιακό με δείκτη SPF 30+ , Μπλουζάκι ανοιχτόχρωμο γυαλιά ηλίου και καπέλο.
Απόφέυγουμε την μακροχρόνια παραμονή στον ήλιο.","Παίρνουμς όλες τις προφυλάξεις, συμπεριλαμβανομένων: γυαλιά ηλίου και αντηλιακό με δείκτη SPF 30+,
Ντυνόμαστε με ανοιχτόχρωμα ρούχα ,καπέλο, και
Αποφεύγουμε τελείως τον ήλιο 2 ώρες πρίν και τρείς ώρες μετά το μέγιστο της ηλιακής ακτινοβολίας (από τις 11 το πρωί
ως τις 4 το απόγευμα )."],solar_title:"Ηλιακή ακτινοβολία",solar_currentMax:"Τρέχουσα μέγιστη θεωρητικά ένδειξη",solar_ofMax:"της μέγιστης",solar_maxToday:"Σημερινή μέγιστη ένδειξη",cloudbase_title:"Υψος βάσης νεφών",cloudbase_popup_title:"Θεωρητικό ύψος βάσης νεφών",cloudbase_popup_text:"Ο υπολογισμός είναι απλός; 1000 πόδια για κάθε 4.4 Βαθμούς Φαρενάιτ.
Είναι η διαφορά μεταξύ της θερμοκρασίας και του σημείου δρόσου. Αυτή είναι απλή
Δίνει το θεωρητικό ύψος των νεφών στη βάση τους,
οταν ο αέρας είναι κορεσμένος",feet:"πόδια",metres:"μέτρα",miles:"μίλια",n_miles:"v.μίλια",km:"km",lowest_info:"Eλάχιστη",highest_info:"Μέγιστη",lowestF_info:"Ελάχιστη",highestF_info:"Μέγιστη",RisingVeryRapidly:"Ραγδαία πτώση",RisingQuickly:"ταχεία πτώση",Rising:"πτώση",RisingSlowly:"Αργή πτώση",Steady:"Σταθερή",FallingSlowly:"Αργή άνοδος",Falling:"Ανοδος",FallingQuickly:"Ταχεία πτώση",FallingVeryRapidly:"Ραγδαία πτώση",maximum_info:"Mέγιστη",max_hour_info:"Mέγιστη ωριαία",minimum_info:"Ελάχιστη",coords:["Β","ΒΒΑ","ΒΑ","ΑΒΑ","Α","ΑΝΑ","ΝΑ","ΝΝΑ","Ν","ΝΝΔ","ΝΔ","ΝΔΝ","Δ","ΔΒΔ","ΒΔ","ΒΒΔ"],compass:["Β","ΒΑ","Α","ΝΑ","Ν","ΝΔ","Δ","ΒΔ"],months:["Ιαν","Φεβ","Μαρ","Απρ","Μαι","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"]},LANG.PT={canvasnosupport:"O seu browser não suporta HTML5...
Actualize o seu navegador para uma versão mais recente!

Vai ser redirecionado para uma página compativel...",led_title:"Sensor remoto, estado desconhecido",led_title_ok:"Aceitar sensor remoto",led_title_lost:"Perdido o contacto com o sensor remoto",led_title_unknown:"Sensor remoto em estado desconhecido",led_title_offline:"A estação metereológica está Offline",weather:"clima",latitude:"Latitude",longitude:"Longitude",elevation:"Altitude",statusStr:"A carregar ...",StatusMsg:"Descarga de ...",StatusHttp:"Erro no pedido HTTP",StatusRetry:"Voltando a tentar...",StatusRetryIn:"Voltando a tentar em ...",StatusTimeout:"Tempo esgotado",StatusPageLimit:"Foi atingido o tempo limite para auto-actualização desta página, recarregue a página para continuar.",StatusLastUpdate:"Última actualização",StatusMinsAgo:"minutos atrás",StatusHoursAgo:"horas atrás",StatusDaysAgo:"dias atrás",realtimeCorrupt:"Ficheiro de dados corrompido! Tentando de novo...",timer:"Segundos",at:"a",temp_title_out:"Temperatura",temp_title_in:"Temp. Interior",temp_out_info:"Temperatura Exterior",temp_out_web:"Exterior",temp_in_info:"Temperatura Interior",temp_in_web:"Interior",temp_trend_info:"Tendência Temperatura",dew_title:"Pt. Orvalho",dew_info:"Ponto de Orvalho",dew_web:"Ponto de Orvalho",apptemp_title:"Temp. Aparente",apptemp_info:"Temperatura Aparente",apptemp_web:"Temp. Aparente",chill_title:"Índice Frio",chill_info:"Índice Frio",chill_web:"Índice Frio",heat_title:"Índice de Calor",heat_info:"Índice de Calor",heat_web:"Índice de Calor",humdx_title:"Humidex",humdx_info:"Humidex",humdx_web:"Humidex",rain_title:"Pluviosidade",rrate_title:"Taxa Pluv.",rrate_info:"Taxa Pluviosidade",LastRain_info:"Pluviosidade",LastRainedT_info:"Hoje às",LastRainedY_info:"Ontem às",hum_title_out:"Humidade",hum_title_in:"Humidade Interior",hum_out_info:"Humidade Exterior",hum_in_info:"Humidade Interior",hum_out_web:"Exterior",hum_in_web:"Interior",baro_title:"Pressão Atm.",baro_info:"Pressão",baro_trend_info:"Tendência da Pressão",wind_title:"Vel. Vento",tenminavg_title:"Velocidade Média do Vento",tenminavgwind_info:"Velocidade Média do Vento (10 min)",maxavgwind_info:"Média da Vel. Máxima do Vento",tenmingust_info:"Rajada (10 min)",maxgust_info:"Rajada máxima",latest_title:"Vento, última",latestwind_info:"Última Vel. do Vento",bearing_info:"Direção",latest_web:"Último",tenminavg_web:"Média",dominant_bearing:"Vento dominante hoje",calm:"Calmo",windrose:"Rosa dos Ventos",windruntoday:"Wind Run hoje",uv_title:"Índice UV",uv_levels:["Nenhum","Sem perigo","Pequeno risco","Alto risco","Risco muito alto","Risco extremo"],uv_headlines:["Índice UV não mensurável","Sem perigo para a maioria das pessoas","Pequeno risco de danos por exposição ao sol sem protecção","Alto risco de danos por exposição ao sol sem protecção","Risco muito alto de danos por exposição ao sol sem protecção","Risco extremo de danos por exposição ao sol sem protecção"],uv_details:["Ainda é noite, ou o dia está com céu muito nublado.","Use óculos de sol em dias ensolarados; caso tenha uma pele particularmente sencível,
ou exista neve no solo que reflete radiação UV, utilize protector solar.","Utilize óculos de sol, e protector solar SPF 30+, proteja o corpo com roupa e use
chapéu. Por volta do meio dia, quando o sol está mais intenso, procure estar à sombra.","Utilize óculos de sol, e protector solar SPF 30+, proteja o corpo com roupas de protecção
solar e use um chapéu com abas. Reduza a exposição ao sol nas duas horas anteriores e até às
tres horas posteriores ao meio dia solar (cerca das 11:00 até às 16:00 durante o verão nas
zonas que praticam horário de verão).","Usar protetor solar FPS 30+, camisa, óculos de sol e um chapéu.
Não fique ao sol por muito tempo.","Tome todas as precauções, incluindo: Usar óculos de sol, protetor solar FPS 30+,
cubra o corpo com roupa com mangas, vista calças, e use um chapéu de abas largas.
Evite a exposição ao sol nas duas horas anteriores e até às tres horas posteriores ao meio dia solar
(cerca das 11:00 até às 16:00 durante o verão nas zonas que praticam horário de verão)."],solar_title:"Rad. Solar",solar_currentMax:"Valor máximo teórico actual",solar_ofMax:"do máximo",solar_maxToday:"Hoje, valor máximo",cloudbase_title:"Base das Nuvens",cloudbase_popup_title:"Base das Nuvens Teórica",cloudbase_popup_text:"É um cálculo simples; 1000 pés por cada 4.4 graus Fahrenheit de diferença
entre a temperatura e o ponto de orvalho. Note que isto dá simplesmente
a altura teórica em que nuvens tipo Cumulus se começam a formar, e o
ar começa a ficar saturado",feet:"pés",metres:"metros",miles:"milhas",n_miles:"milhas n.",km:"km",lowest_info:"Mais Baixa",highest_info:"Máxima",lowestF_info:"Mínima",highestF_info:"Máxima",RisingVeryRapidly:"A subir muito rápidamente",RisingQuickly:"A subir rápidamente",Rising:"A subir",RisingSlowly:"A subir lentamente",Steady:"Estável",FallingSlowly:"A descer lentamente",Falling:"A descer",FallingQuickly:"A descer rápidamente",FallingVeryRapidly:"A descer muito rápidamente",maximum_info:"Máximo",max_hour_info:"Máx. por Hora",minimum_info:"Mínimo",coords:["N","NNE","NE","ENE","E","ESE","SE","SSE","S","OSO","O","OSO","O","ONO","NO","NNO","ONO"],compass:["N","NE","E","SE","S","SO","O","NO"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"]},LANG.CS={canvasnosupport:"Ve vašem prohlížeči není podpora pro HTML5 Canvas... Lituji...
Zkuste aktualizovat svůj prohlížeč na novější verzi - téměř všechny prohlížeče podporují nyní Canvas, i IE9!

Budete přesměrováni na původní stránku měřidel...",led_title:"Senzor dálkového ovládání stav neznámý",led_title_ok:"Remote sensor OK",led_title_lost:"Senzor dálkového ovládání kontakt ztracen!",led_title_unknown:"Senzor dálkového ovládání stav neznámý!",led_title_offline:"Meteorologická stanice je nyní v režimu offline.",weather:"počasí",latitude:"Zeměpisná délka",longitude:"Zeměpisná šířka",elevation:"Nadm. výška",statusStr:"Nahrávání...",StatusMsg:"Stahování...",StatusHttp:"HTTP požadavek selhal",StatusRetry:"Opakování...",StatusRetryIn:"Opakování za...",StatusTimeout:"Vypršel časový limit",StatusPageLimit:"Automatická aktualizace stránky hotova, klepněte na stavovou LED pro pokračování",StatusLastUpdate:"Poslední aktualizace před",StatusMinsAgo:"minutami",StatusHoursAgo:"hodinami",StatusDaysAgo:"dny",realtimeCorrupt:"Stahovaný textový soubor poškozen! Opakování...",timer:"sec.",at:"v",temp_title_out:"Teplota",temp_title_in:"Vn. teplota",temp_out_info:"Venkovní teplota",temp_out_web:"Venkovní",temp_in_info:"Vnitřní teplota",temp_in_web:"Vnitřní",temp_trend_info:"Teplotní trend",dew_title:"Rosný bod",dew_info:"Rosný bod",dew_web:"Rosný bod",apptemp_title:"Zdánl. tepl.",apptemp_info:"Zdánlivá teplota",apptemp_web:"Zdánl. teplota",chill_title:"Chlad větru",chill_info:"Chlad větru",chill_web:"Chlad větru",heat_title:"Index horka",heat_info:"Index horka",heat_web:"Index horka",humdx_title:"Humidex",humdx_info:"Humidex",humdx_web:"Humidex",rain_title:"Srážky",rrate_title:"Intenzita",rrate_info:"Intenzita srážek",LastRain_info:"Poslední srážky",LastRainedT_info:"Dnes v",LastRainedY_info:"Včera v",hum_title_out:"Vlhkost",hum_title_in:"Vn. vlhkost",hum_out_info:"Venkovní vlhkost",hum_in_info:"Vnitřní vlhkost",hum_out_web:"Venkovní",hum_in_web:"Vnitřní",baro_title:"Tlak vzd.",baro_info:"Barometrický tlak",baro_trend_info:"Tlaková tendence",wind_title:"Vítr rychlost",tenminavg_title:"Prům. rychlost větru",tenminavgwind_info:"Prům. rychlost větru (10 min)",maxavgwind_info:"Max prům. rychlost větru",tenmingust_info:"Náraz (10 min)",maxgust_info:"Maximum náraz",latest_title:"Poslední vítr",latestwind_info:"Poslední rychlost větru",bearing_info:"Směr větru",latest_web:"Poslední",tenminavg_web:"Průměr",dominant_bearing:"Převažující směr větru dnes",calm:"bezvětří",windrose:"Větrná růžice",windruntoday:"Denní proběh větru",uv_title:"UV Index",uv_levels:["Žádné riziko","Nízké riziko","Střední riziko","Vysoké riziko","Velmi vysoké riziko","Extrémní riziko"],uv_headlines:["Neměřitelný UV Index","Bez nebezpečí pro průměrné osoby","Riziko při nechráněném pobytu na slunci","Velké riziko při nechráněném pobytu na slunci","Vysoké riziko při nechráněném pobytu na slunci","Extreme riziko při nechráněném pobytu na slunci"],uv_details:["Je ještě noc nebo je velmi zatažený den.","Noste sluneční brýle za jasných dnů, používejte opalovací krém, pokud je na zemi sníh,
který odráží UV záření, nebo máte-li zvlášť světlou pokožku.","Noste sluneční brýle a používejte krém na opalování SPF 30+, zakryjte tělo oblečením a
kloboukem, vyhledejte stín kolem poledne, kdy je slunce nejintenzivnější.","Noste sluneční brýle a používejte krém na opalování SPF 30+, zakryjte tělo ochranným
oděvem a kloboukem se širokou krempou, zkraťte dobu pobytu na slunci v době mezi 11:00 a 16:00 hod.,
tj. kolem slunečního poledne letního času na tři hodiny během léta v oblastech,
které používají letního času.","Používejte krém na opalování SPF 30+, košili, sluneční brýle a klobouk.
Nezůstávejte na slunci příliš dlouho.","Učiňte veškerá opatření, včetně nošení slunečních brýlí a použití krému na opalování SPF 30+,
zakryjte tělo košilí s dlouhým rukávem a kalhotami, noste velmi široký klobouk a
vyhněte se slunci od dvou hodin před až po tři hodiny po slunečním poledni (v době od 11:00
do 16:00 v létě v oblastech, které používají letního času)."],solar_title:"Sluneční záření",solar_currentMax:"Aktuální teoretické maximum záření",solar_ofMax:"maximum",solar_maxToday:"Dnešní maximum záření",lowest_info:"Nejnižší",highest_info:"Nejvyšší",lowestF_info:"Nejnižší",highestF_info:"Nejvyšší",RisingVeryRapidly:"Prudký vzestup",RisingQuickly:"Silný vzestup",Rising:"Vzestup",RisingSlowly:"Slabý vzestup",Steady:"Ustálený stav",FallingSlowly:"Slabý pokles",Falling:"Pokles",FallingQuickly:"Silný pokles",FallingVeryRapidly:"Prudký pokles",maximum_info:"Maximum",max_hour_info:"Max za hodinu",minimum_info:"Minimum",coords:["S","SSV","SV","VSV","V","VJV","JV","JJV","J","JJZ","JZ","ZJZ","Z","ZSZ","SZ","SSZ"],compass:["S","SV","V","JV","J","JZ","Z","SZ"],months:["Led","Úno","Bře","Dub","Kvě","Čer","Čec","Srp","Zář","Říj","Lis","Pro"],cloudbase_title:"Základna mraků",cloudbase_popup_title:"Teoretická základna mraků",cloudbase_popup_text:"Výpočet je jednoduchý; 1000 ft na každých 4,4 stupňů Fahrenheita
rozdílu mezi teplotou a teplotou rosného bodu. Všimněte si, že to prostě
dává teoretickou výšku, ve které se kupovité mraky začínají tvořit, kdy
vzduch je nasycen",feet:"feet",metres:"metrů",miles:"míle",n_miles:"n.míle",km:"km"},LANG.PL={canvasnosupport:"Brak wsparcia dla HTML5 w Twojej przeglądarce...
Spróbuj zaktualizować przeglądarkę do nowszej wersji

Przekierowanie na 'stary' wygląd strony...",led_title:"Nieznany status zdalnego sensora",led_title_ok:"Zdalny sensor OK",led_title_lost:"Stracone połączenie ze zdalnym sensorem!",led_title_unknown:"Nieznany status zdalnego sensora!",led_title_offline:"Stacja pogoda aktualnie jest wyłączona.",weather:"pogoda",latitude:"Długość geograficzna",longitude:"Szerokość geograficzna",elevation:"Wysokość",statusStr:"Ładowanie...",StatusMsg:"Ściąganie...",StatusHttp:"Błąd przetwarzania HTTP",StatusRetry:"Ponawianie...",StatusRetryIn:"Ponowienie za...",StatusTimeout:"Przekroczony czas",StatusPageLimit:"Autoodświeżanie strony osiągnęlo limit, naciśnij diodę LED, aby odświeżyć.",StatusLastUpdate:"Ostatni odczyt",StatusMinsAgo:"minut temu",StatusHoursAgo:"godzin temu",StatusDaysAgo:"dni temu",realtimeCorrupt:"Ściąganie pliku tekstowego nie powiodło się. Ponawianie...",timer:"sekund",at:"o",temp_title_out:"Temperatura",temp_title_in:"Temperatura wewnątrz",temp_out_info:"Temperatura na zewnątrz",temp_out_web:"Na zewnątrz",temp_in_info:"Wewnątrz",temp_in_web:"Wewnątrz",temp_trend_info:"Trend temperatury",dew_title:"Punkt rosy",dew_info:"Punkt rosy",dew_web:"Punkt rosy",apptemp_title:"Odczuwalna",apptemp_info:"Temperatura odczuwalna",apptemp_web:"Odczuwalna",chill_title:"Chłod wiatru",chill_info:"Chłod wiatru",chill_web:"Chłód wiatru",heat_title:"Indeks ciepła",heat_info:"Indeks ciepła",heat_web:"Indeks ciepła",humdx_title:"Humidex",humdx_info:"Humidex",humdx_web:"Humidex",rain_title:"Opady deszczu",rrate_title:"Stopa opadów",rrate_info:"Stopa opadów",LastRain_info:"Ostatnie opady",LastRainedT_info:"Dzisiaj o",LastRainedY_info:"Wczoraj o",hum_title_out:"Wilgotność",hum_title_in:"Wilgotność wewnątrz",hum_out_info:"Wilgotność na zewnątrz",hum_in_info:"Wilgotność wewnątrz",hum_out_web:"Na zewnątrze",hum_in_web:"Wewnątrz",baro_title:"Ciśnienie",baro_info:"Ciśnienie barometryczne",baro_trend_info:"Trend ciśnienia",wind_title:"Prędkość wiatru",tenminavg_title:"Średnia prędkość wiatru",tenminavgwind_info:"Średnia prędkość wiatru z ostatnich 10 minut",maxavgwind_info:"Maksymalna średnia prędkość wiatru",tenmingust_info:"Porywy wiatru z ostatnich 10 minut",maxgust_info:"Maksymalny poryw wiatru",latest_title:"Ostatni wiatr",latestwind_info:"Ostatnia prędkość wiatru",bearing_info:"kierunek",latest_web:"Ostatni",tenminavg_web:"Średni",dominant_bearing:"Dzisiejszy dominujący wiatr",calm:"spokojnie",windrose:"Róża wiatru",windruntoday:"Dzisiejszy wiatr",uv_title:"UV Indeks",uv_levels:["Brak","Brak ryzyka","Średnie ryzyko","Wysokie ryzyko","Bardzo wysokie ryzyko","Ekstremalne ryzyko"],uv_headlines:["Brak pomiarów indeksu UV","Brak ryzyka dla statystycznej osoby","Umiarkowane ryzyko szkód wynikających z nieosłoniętego nasłonecznienia","Wysokie ryzyko szkód spowodowanych nieosłoniętą ekspozycją na słońce","Bardzo wysokie ryzyko szkód spowodowanych nieosłoniętą ekspozycją na słońce","Ekstremalne ryzyko szkód spowodowanych nieosłoniętym nasłonecznieniem"],uv_details:["Nadal jest noc lub jest bardzo pochmurny dzień.","Noś okulary przeciwsłoneczne w jasne dni, użyj ochrony przeciwsłonecznej, jeśli śnieg jest na ziemi,
który odbija promieniowanie UV, lub jeśli masz szczególnie jasną skórę.","Noś okulary przeciwsłoneczne i używaj kremów przeciwsłonecznych SPF 30+, zakryj ciało
ubraniem i kapeluszem, a gdy słońce jest najbardziej intensywne, szukaj cienia około południa.","Noś okulary przeciwsłoneczne i używaj kremu przeciwsłonecznego SPF 30+, zakryj ciało
z ochroną przeciwsłoneczną i ubraniem oraz kapelusz z szerokim rondem i skróć czas na
słońcu z dwóch godzin przed do trzech godzin po słonecznym południu (około 11:00
do 16:00 latem w strefach, w których obserwuje się czas letni)","Stosuj filtr przeciwsłoneczny SPF 30+, noś koszulę, okulary przeciwsłoneczne i kapelusz.
Nie zostawaj zbyt długo w słońcu.","Podejmij wszelkie środki ostrożności, w tym:
noś okulary przeciwsłoneczne i używać kremu do opalania z filtrem SPF 30+,
przykryj ciało koszulą z długim rękawem i spodniami, załóż bardzo szeroki kapelusz, i
unikaj słońca od dwóch godzin przed do trzech godzin po słonecznym południu (około 11:00
do 16:00 latem w strefach, które obserwują czas letni)"],solar_title:"Promieniowanie słoneczne",solar_currentMax:"Obecne teoretyczne maksymalne promieniowanie",solar_ofMax:"z maksimum",solar_maxToday:"Dzisiejszy maksymalny odczyt",lowest_info:"Najniższa",highest_info:"Najwyższa",lowestF_info:"Najniższa",highestF_info:"Najwyższa",RisingVeryRapidly:"Rośnie bardzo szybko",RisingQuickly:"Rośnie szybko",Rising:"Rośnie",RisingSlowly:"Rośnie powoli",Steady:"Stabilne",FallingSlowly:"Opada wolno",Falling:"Opada",FallingQuickly:"Opada szybko",FallingVeryRapidly:"Opada bardzo szybko",maximum_info:"Maksimum",max_hour_info:"Maksymalnie na godzine",minimum_info:"Minimum",coords:["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"],compass:["N","NE","E","SE","S","SW","W","NW"],months:["Sty","Lut","Mar","Kwi","Maj","Cze","Lip","Sie","Wrz","Paź","Lis","Gru"],cloudbase_title:"Poziom chmur",cloudbase_popup_title:"Teoretyczny poziom chmur",cloudbase_popup_text:"Obliczenia są proste:
1000 stóp na każde 4,4 stopnia Fahrenheita różnicy między temperaturą, a punktem rosy.
Zauważ, że to teoretyczna wysokość, w której chmury Cumulus zaczęłyby się formować,
a powietrze było nasycone",feet:"stopy",metres:"metry",miles:"mile",n_miles:"mile morskie",km:"km"}; \ No newline at end of file diff --git a/other-scripts/Steel-Gauges/web_server/steelseries_tween.min.js b/other-scripts/Steel-Gauges/web_server/steelseries_tween.min.js new file mode 100644 index 0000000..6bc8914 --- /dev/null +++ b/other-scripts/Steel-Gauges/web_server/steelseries_tween.min.js @@ -0,0 +1,55 @@ +/*! + * Name : steelseries.js + * Authors : Gerrit Grunwald, Mark Crossley + * Last modified : 01.12.2015 + * Revision : 0.14.16 + * + * Copyright (c) 2011, Gerrit Grunwald, Mark Crossley + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * # Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * # Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +var steelseries=function(){function u(n,t){var i="#"===n.charAt(0)?n.substring(1,7):n,r=parseInt(i.substring(0,2),16),u=parseInt(i.substring(2,4),16),f=parseInt(i.substring(4,6),16);return"rgba("+r+","+u+","+f+","+t+")"}function kt(t,i,r,u,f){var c=1/255,e=t.getRed(),o=t.getGreen(),s=t.getBlue(),h=t.getAlpha(),p=i.getRed()-e,w=i.getGreen()-o,b=i.getBlue()-s,k=i.getAlpha()*c-h*c,l=p/r*u,a=w/r*u,v=b/r*u,y=k/r*u;return f=f||!1,f?[(e+l).toFixed(0),(o+a).toFixed(0),(s+v).toFixed(0),h+y]:new n((e+l).toFixed(0),(o+a).toFixed(0),(s+v).toFixed(0),h+y)}function gi(n,t,i){return{start:n,stop:t,color:i}}function k(n,t){var r=Math.floor(Math.log10(n)),i=n/Math.pow(10,r),u;return u=t?1.5>i?1:3>i?2:7>i?5:10:1>=i?1:2>=i?2:5>=i?5:10,u*Math.pow(10,r)}function dt(n,t,i,r,u,f){var e=t+r,o=i+u;n.beginPath();n.moveTo(t+f,i);n.lineTo(e-f,i);n.quadraticCurveTo(e,i,e,i+f);n.lineTo(e,i+u-f);n.quadraticCurveTo(e,o,e-f,o);n.lineTo(t+f,o);n.quadraticCurveTo(t,o,t,o-f);n.lineTo(t,i+f);n.quadraticCurveTo(t,i,t+f,i);n.closePath()}function r(n,t){var i=d.createElement("canvas");return i.width=n,i.height=t,i}function ii(n,t,i){var r=d.createElement("canvas");return r.width=n,r.height=t,i(r.getContext("2d")),r}function rt(n){var t,i=ii(1,1,function(t){t.fillStyle=n;t.beginPath();t.rect(0,0,1,1);t.fill()});return t=i.getContext("2d").getImageData(0,0,2,2).data,[t[0],t[1],t[2],t[3]]}function ei(t){var u,f,e,o,s,r=rt(t),i=new n(r[0],r[1],r[2],r[3]);return u=oi(i,.32),f=oi(i,.62),e=ri(i,.84),o=ri(i,.94),s=ri(i,1),new y(u,f,i,e,o,s)}function st(n,t,i){var r,u,f,h=Math.floor(n*6),c=n*6-h,e=i*(1-t),o=i*(1-c*t),s=i*(1-(1-c)*t);switch(h%6){case 0:r=i;u=s;f=e;break;case 1:r=o;u=i;f=e;break;case 2:r=e;u=i;f=s;break;case 3:r=e;u=o;f=i;break;case 4:r=s;u=e;f=i;break;case 5:r=i;u=e;f=o}return[Math.floor(r*255),Math.floor(u*255),Math.floor(f*255)]}function ot(n,t,i){var e,r,u,o,s,f;if(n=n/255,t=t/255,i=i/255,r=Math.max(n,t,i),e=Math.min(n,t,i),s=r,f=r-e,o=r===0?0:f/r,r===e)u=0;else{switch(r){case n:u=(t-i)/f+(tt?t:n}function oi(t,i){var r=Math.floor(t.getRed()*(1-i)),u=Math.floor(t.getGreen()*(1-i)),f=Math.floor(t.getBlue()*(1-i));return r=p(r,255),u=p(u,255),f=p(f,255),new n(r,u,f,t.getAlpha())}function ri(t,i){var r=Math.round(t.getRed()*(1+i)),u=Math.round(t.getGreen()*(1+i)),f=Math.round(t.getBlue()*(1+i));return r=p(r,255),u=p(u,255),f=p(f,255),new n(r,u,f,t.getAlpha())}function nr(n,t,i){var r,u;if(i<=t)throw"Rotary bounds are of negative or zero size";return r=i-t,u=Math.floor((n-t)/r),n-u*r}function si(n,t){return nr(t-n,-180,180)}function ht(n){var t=typeof n=="string"||n instanceof String?d.getElementById(n):n;return t.getContext("2d")}var i=Math.PI*.5,t=Math.PI*2,o=Math.PI,c=Math.PI/180,pt=180/Math.PI,d=document,wt="LCDMono2Ultra,Arial,Verdana,sans-serif",s="Arial,Verdana,sans-serif",hi=function(n,u){var yi;u=u||{};var vt=undefined===u.gaugeType?steelseries.GaugeType.TYPE4:u.gaugeType,f=undefined===u.size?0:u.size,h=undefined===u.minValue?0:u.minValue,b=undefined===u.maxValue?h+100:u.maxValue,ve=undefined===u.niceScale?!0:u.niceScale,gt=undefined===u.threshold?(b-h)/2+h:u.threshold,ti=undefined===u.thresholdRising?!0:u.thresholdRising,ci=undefined===u.section?null:u.section,li=undefined===u.area?null:u.area,vu=undefined===u.titleString?"":u.titleString,yu=undefined===u.unitString?"":u.unitString,pu=undefined===u.frameDesign?steelseries.FrameDesign.METAL:u.frameDesign,wu=undefined===u.frameVisible?!0:u.frameVisible,ai=undefined===u.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:u.backgroundColor,bu=undefined===u.backgroundVisible?!0:u.backgroundVisible,oi=undefined===u.pointerType?steelseries.PointerType.TYPE1:u.pointerType,ku=undefined===u.pointerColor?steelseries.ColorDef.RED:u.pointerColor,ye=undefined===u.knobType?steelseries.KnobType.STANDARD_KNOB:u.knobType,vi=undefined===u.knobStyle?steelseries.KnobStyle.SILVER:u.knobStyle,di=undefined===u.lcdColor?steelseries.LcdColor.STANDARD:u.lcdColor,iu=undefined===u.lcdVisible?!0:u.lcdVisible,du=undefined===u.lcdDecimals?2:u.lcdDecimals,pe=undefined===u.digitalFont?!1:u.digitalFont,gu=undefined===u.fractionalScaleDecimals?1:u.fractionalScaleDecimals,ru=undefined===u.ledColor?steelseries.LedColor.RED_LED:u.ledColor,uu=undefined===u.ledVisible?!0:u.ledVisible,fu=undefined===u.userLedColor?steelseries.LedColor.GREEN_LED:u.userLedColor,eu=undefined===u.userLedVisible?!1:u.userLedVisible,nf=undefined===u.thresholdVisible?!0:u.thresholdVisible,ou=undefined===u.minMeasuredValueVisible?!1:u.minMeasuredValueVisible,su=undefined===u.maxMeasuredValueVisible?!1:u.maxMeasuredValueVisible,tf=undefined===u.foregroundType?steelseries.ForegroundType.TYPE1:u.foregroundType,rf=undefined===u.foregroundVisible?!0:u.foregroundVisible,uf=undefined===u.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:u.labelNumberFormat,rr=undefined===u.playAlarm?!1:u.playAlarm,ff=undefined===u.alarmSound?!1:u.alarmSound,we=undefined===u.customLayer?null:u.customLayer,be=undefined===u.tickLabelOrientation?vt===steelseries.GaugeType.TYPE1?steelseries.TickLabelOrientation.TANGENT:steelseries.TickLabelOrientation.NORMAL:u.tickLabelOrientation,hu=undefined===u.trendVisible?!1:u.trendVisible,lr=undefined===u.trendColors?[steelseries.LedColor.RED_LED,steelseries.LedColor.GREEN_LED,steelseries.LedColor.CYAN_LED]:u.trendColors,ar=undefined===u.useOdometer?!1:u.useOdometer,si=undefined===u.odometerParams?{}:u.odometerParams,ke=undefined===u.odometerUseValue?!1:u.odometerUseValue,ef=undefined===u.fullScaleDeflectionTime?2.5:u.fullScaleDeflectionTime,e=ht(n);f===0&&(f=Math.min(e.canvas.width,e.canvas.height));e.canvas.width=f;e.canvas.height=f;rr&&ff!==!1&&(yi=d.createElement("audio"),yi.setAttribute("src",ff),yi.setAttribute("preload","auto"));var p=h,vr=h,of=this,pi=b,wi=h,ut=!1,yr=!1,sf=0,cu=0,bi,ki=!1,hf=steelseries.TrendState.OFF,pr=f*.06,wr=f*.29,br=f*.36,gi,yt,kr,pt,kt,lu=yt+(p-h)*kt,y=f,rt=f,st=y/2,lt=rt/2,ii=f*.093457,de=.6*y,ge=.4*rt,no=vt===steelseries.GaugeType.TYPE3?.6*y:st-ii/2,to=vt===steelseries.GaugeType.TYPE3?.72*rt:.75*rt,au=Math.floor(y/10),io=au+"px "+s,ro=au+"px "+wt,cf=rt*.13,ur=y*.4,lf=(y-ur)/2,af=rt*.57,vf,uo=rt*.61,yf=y*.006,pf=!1,dr=h,gr=b,fr=b-h,ri=gr-dr,nu=0,ui=0,nr=10,wf=10,fo=function(){ve?(fr=k(b-h,!1),ui=k(fr/(wf-1),!0),dr=Math.floor(h/ui)*ui,gr=Math.ceil(b/ui)*ui,nu=k(ui/(nr-1),!0),h=dr,b=gr,ri=b-h):(fr=b-h,dr=h,gr=b,ri=fr,ui=k(fr/(wf-1),!0),nu=k(ui/(nr-1),!0));switch(vt.type){case"type1":gi=0;yt=o;kr=i;pt=i;kt=pt/ri;break;case"type2":gi=0;yt=o;kr=i;pt=o;kt=pt/ri;break;case"type3":gi=0;yt=i;kr=0;pt=1.5*o;kt=pt/ri;break;case"type4":default:gi=60*c;yt=i+gi/2;kr=0;pt=t-gi;kt=pt/ri}lu=yt+(p-h)*kt},er=r(f,f),bf=er.getContext("2d"),or=r(f,f),at=or.getContext("2d"),kf,tr=r(ii,ii),df=tr.getContext("2d"),hi=r(ii,ii),gf=hi.getContext("2d"),ir=hi,ei=r(ii,ii),ne=ei.getContext("2d"),ni=r(ii,ii),te=ni.getContext("2d"),dt=ni,ie=r(Math.ceil(f*.028037),Math.ceil(f*.028037)),eo=ie.getContext("2d"),re=r(Math.ceil(f*.028037),Math.ceil(f*.028037)),oo=re.getContext("2d"),sr=r(f,f),ue=sr.getContext("2d"),hr=r(f,f),fe=hr.getContext("2d"),ee,oe,se,he,ce,tu,le;ar&&iu&&(tu=r(10,10),le=tu.getContext("2d"));var so=function(n,t){n.restore();n.save();n.textAlign="right";n.strokeStyle=di.textColor;n.fillStyle=di.textColor;(di===steelseries.LcdColor.STANDARD||di===steelseries.LcdColor.STANDARD_GREEN)&&(n.shadowColor="gray",n.shadowOffsetX=y*.007,n.shadowOffsetY=y*.007,n.shadowBlur=y*.007);n.font=pe?ro:io;n.fillText(t.toFixed(du),lf+ur-ur*.05,af+cf*.5+au*.38,ur*.9);n.restore()},ho=function(n){n.save();"type1"===vt.type&&n.drawImage(l(Math.ceil(rt*.037383),steelseries.KnobType.STANDARD_KNOB,vi),y*.523364,rt*.130841);("type1"===vt.type||"type2"===vt.type)&&n.drawImage(l(Math.ceil(rt*.037383),steelseries.KnobType.STANDARD_KNOB,vi),y*.130841,rt*.514018);("type2"===vt.type||"type3"===vt.type)&&n.drawImage(l(Math.ceil(rt*.037383),steelseries.KnobType.STANDARD_KNOB,vi),y*.831775,rt*.514018);"type3"===vt.type&&n.drawImage(l(Math.ceil(rt*.037383),steelseries.KnobType.STANDARD_KNOB,vi),y*.523364,rt*.831775);"type4"===vt.type&&(n.drawImage(l(Math.ceil(rt*.037383),steelseries.KnobType.STANDARD_KNOB,vi),y*.336448,rt*.803738),n.drawImage(l(Math.ceil(rt*.037383),steelseries.KnobType.STANDARD_KNOB,vi),y*.626168,rt*.803738));n.restore()},co=function(){var t=d.createElement("canvas"),n,i;return t.width=Math.ceil(f*.046728),t.height=Math.ceil(t.width*.9),n=t.getContext("2d"),n.save(),i=n.createLinearGradient(0,.1,0,t.height*.9),i.addColorStop(0,"#520000"),i.addColorStop(.3,"#fc1d00"),i.addColorStop(.59,"#fc1d00"),i.addColorStop(1,"#520000"),n.fillStyle=i,n.beginPath(),n.moveTo(t.width*.5,.1),n.lineTo(t.width*.9,t.height*.9),n.lineTo(t.width*.1,t.height*.9),n.lineTo(t.width*.5,.1),n.closePath(),n.fill(),n.strokeStyle="#FFFFFF",n.stroke(),n.restore(),t},ae=function(n,t,i,r,u){if(tb&&(t=b),ib&&(i=b),!(t>=i)){n.save();n.strokeStyle=r;n.fillStyle=r;n.lineWidth=y*.035;var f=pt/ri*t-pt/ri*h,e=f+(i-t)/(ri/pt);n.translate(st,lt);n.rotate(yt);n.beginPath();u?(n.moveTo(0,0),n.arc(0,0,y*.365-n.lineWidth/2,f,e,!1)):n.arc(0,0,y*.365,f,e,!1);u?(n.moveTo(0,0),n.fill()):n.stroke();n.translate(-st,-lt);n.restore()}},lo=function(n,t){var w=Math.ceil(y*.04),f=yt,r=kt*nu,u,e=h,c=nr-1,a=y*.38,k=y*.35,d=y*.355,g=y*.36,p=y*.3,l=y*.1,nt=nr/2,tt=parseFloat(b.toFixed(2)),v;for(ai.labelColor.setAlpha(1),n.save(),n.textAlign="center",n.textBaseline="middle",n.font=w+"px "+s,n.strokeStyle=ai.labelColor.getRgbaColor(),n.fillStyle=ai.labelColor.getRgbaColor(),n.translate(st,lt),n.rotate(yt),(vt.type==="type1"||vt.type==="type2")&&(l=y*.04),v=h;parseFloat(v.toFixed(2))<=tt;v+=nu){if(u=r+i,c++,c===nr){n.lineWidth=1.5;n.beginPath();n.moveTo(a,0);n.lineTo(k,0);n.closePath();n.stroke();n.save();n.translate(p,0);switch(be.type){case"horizontal":u=-f;break;case"tangent":u=f<=i+o?o:0;break;case"normal":default:u=i}n.rotate(u);switch(t.format){case"fractional":n.fillText(e.toFixed(gu),0,0,l);break;case"scientific":n.fillText(e.toPrecision(2),0,0,l);break;case"standard":default:n.fillText(e.toFixed(0),0,0,l)}n.translate(-p,0);n.restore();e+=ui;c=0;n.rotate(r);f+=r;continue}0==nr%2&&c===nt?(n.lineWidth=1,n.beginPath(),n.moveTo(a,0),n.lineTo(d,0),n.closePath(),n.stroke()):(n.lineWidth=.5,n.beginPath(),n.moveTo(a,0),n.lineTo(g,0),n.closePath(),n.stroke());n.rotate(r);f+=r}n.translate(-st,-lt);n.restore()},ot=function(n){var t,r,e;n=n||{};var o=undefined===n.frame?!1:n.frame,u=undefined===n.background?!1:n.background,s=undefined===n.led?!1:n.led,c=undefined===n.userLed?!1:n.userLed,l=undefined===n.pointer?!1:n.pointer,v=undefined===n.foreground?!1:n.foreground,b=undefined===n.trend?!1:n.trend,k=undefined===n.odo?!1:n.odo;if(pf=!0,fo(),o&&wu&&g(bf,pu,st,lt,y,rt),u&&bu&&(nt(at,ai,st,lt,y,rt),bt(at,we,st,lt,y,rt)),s&&(df.drawImage(a(Math.ceil(f*.093457),1,ru),0,0),gf.drawImage(a(Math.ceil(f*.093457),0,ru),0,0)),c&&(ne.drawImage(a(Math.ceil(f*.093457),1,fu),0,0),te.drawImage(a(Math.ceil(f*.093457),0,fu),0,0)),ou&&eo.drawImage(et(Math.ceil(f*.028037),steelseries.ColorDef.BLUE.dark.getRgbaColor(),!0,!0),0,0),su&&oo.drawImage(et(Math.ceil(f*.028037),steelseries.ColorDef.RED.medium.getRgbaColor(),!0),0,0),u&&bu){if(ho(at),null!==ci&&0b?b:n;return p!==t&&(p=t,p>wi&&(wi=p),p=gt&&!ut&&ti||p<=gt&&!ut&&!ti?(ut=!0,cr(ut),rr&&yi.play()):(pgt&&ut&&!ti)&&(ut=!1,cr(ut),rr&&yi.pause()),this.repaint()),this},this.getValue=function(){return p},this.setOdoValue=function(n){n=parseFloat(n);var t=n<0?0:n;return vr!==t&&(vr=t,this.repaint()),this},this.getOdoValue=function(){return vr},this.setValueAnimated=function(n,t){n=parseFloat(n);var r=nb?b:n,u=this,i;return p!==r&&(undefined!==bi&&bi.isPlaying&&bi.stop(),i=ef*Math.abs(r-p)/(b-h),i=Math.max(i,ef/5),bi=new Tween({},"",Tween.regularEaseInOut,p,r,i),bi.onMotionChanged=function(n){p=n.target._pos;p>=gt&&!ut&&ti||p<=gt&&!ut&&!ti?(ut=!0,cr(ut),rr&&yi.play()):(pgt&&ut&&!ti)&&(ut=!1,cr(ut),rr&&yi.pause());p>wi&&(wi=p);pb?b:n;return wi=t,this.repaint(),this},this.setMinMeasuredValue=function(n){n=parseFloat(n);var t=nb?b:n;return pi=t,this.repaint(),this},this.setTitleString=function(n){return vu=n,ct({background:!0}),ot({background:!0}),this.repaint(),this},this.setUnitString=function(n){return yu=n,ct({background:!0}),ot({background:!0}),this.repaint(),this},this.setMinValue=function(n){return h=parseFloat(n),ct({frame:!0,background:!0}),ot({frame:!0,background:!0}),this.repaint(),this},this.getMinValue=function(){return h},this.setMaxValue=function(n){return b=parseFloat(n),ct({frame:!0,background:!0}),ot({frame:!0,background:!0}),this.repaint(),this},this.getMaxValue=function(){return b},this.setThreshold=function(n){n=parseFloat(n);var t=nb?b:n;return gt=t,ct({background:!0}),ot({background:!0}),this.repaint(),this},this.setArea=function(n){return li=n,ct({background:!0,foreground:!0}),ot({background:!0,foreground:!0}),this.repaint(),this},this.setSection=function(n){return ci=n,ct({background:!0,foreground:!0}),ot({background:!0,foreground:!0}),this.repaint(),this},this.setThresholdVisible=function(n){return nf=!!n,this.repaint(),this},this.setThresholdRising=function(n){return ti=!!n,ut=!ut,cr(ut),this.repaint(),this},this.setLcdDecimals=function(n){return du=parseInt(n,10),this.repaint(),this},this.setFrameDesign=function(n){return ct({frame:!0}),pu=n,ot({frame:!0}),this.repaint(),this},this.setBackgroundColor=function(n){return ct({background:!0,pointer:oi.type==="type2"||oi.type==="type13"?!0:!1}),ai=n,ot({background:!0,pointer:oi.type==="type2"||oi.type==="type13"?!0:!1}),this.repaint(),this},this.setForegroundType=function(n){return ct({foreground:!0}),tf=n,ot({foreground:!0}),this.repaint(),this},this.setPointerType=function(n){return ct({pointer:!0,foreground:!0}),oi=n,ot({pointer:!0,foreground:!0}),this.repaint(),this},this.setPointerColor=function(n){return ct({pointer:!0}),ku=n,ot({pointer:!0}),this.repaint(),this},this.setLedColor=function(n){return ct({led:!0}),ru=n,ot({led:!0}),this.repaint(),this},this.setUserLedColor=function(n){return ct({userLed:!0}),fu=n,ot({userLed:!0}),this.repaint(),this},this.toggleUserLed=function(){return dt=dt===ei?ni:ei,this.repaint(),this},this.setUserLedOnOff=function(n){return dt=!0===n?ei:ni,this.repaint(),this},this.blinkUserLed=function(n){return n?yr||(yo(!0),yr=!0):yr&&(clearInterval(cu),yr=!1),this},this.setLedVisible=function(n){return uu=!!n,this.repaint(),this},this.setUserLedVisible=function(n){return eu=!!n,this.repaint(),this},this.setLcdColor=function(n){return di=n,ct({background:!0}),ot({background:!0}),this.repaint(),this},this.setTrend=function(n){return hf=n,this.repaint(),this},this.setTrendVisible=function(n){return hu=!!n,this.repaint(),this},this.setFractionalScaleDecimals=function(n){return gu=parseInt(n,10),ct({background:!0}),ot({background:!0}),this.repaint(),this},this.setLabelNumberFormat=function(n){return uf=n,ct({background:!0}),ot({background:!0}),this.repaint(),this},this.repaint=function(){if(pf||ot({frame:!0,background:!0,led:!0,userLed:!0,pointer:!0,trend:!0,foreground:!0,odo:!0}),e.clearRect(0,0,f,f),wu&&e.drawImage(er,0,0),e.drawImage(or,0,0),iu&&(ar?(ce.setValue(ke?p:vr),e.drawImage(tu,vf,uo)):so(e,p)),uu&&e.drawImage(ir,de,ge),eu&&e.drawImage(dt,no,to),hu)switch(hf.state){case"up":e.drawImage(ee,wr,br);break;case"steady":e.drawImage(oe,wr,br);break;case"down":e.drawImage(se,wr,br);break;case"off":e.drawImage(he,wr,br)}ou&&(e.save(),e.translate(st,lt),e.rotate(yt+i+(pi-h)*kt),e.translate(-st,-lt),e.drawImage(ie,e.canvas.width*.4865,e.canvas.height*.105),e.restore());su&&(e.save(),e.translate(st,lt),e.rotate(yt+i+(wi-h)*kt),e.translate(-st,-lt),e.drawImage(re,e.canvas.width*.4865,e.canvas.height*.105),e.restore());lu=yt+i+(p-h)*kt;e.save();e.translate(st,lt);e.rotate(lu);e.translate(-st,-lt);e.shadowColor="rgba(0, 0, 0, 0.8)";e.shadowOffsetX=e.shadowOffsetY=yf;e.shadowBlur=yf*2;e.drawImage(sr,0,0);e.restore();rf&&e.drawImage(hr,0,0);ki=!1},this.repaint(),this},ci=function(n,u){var li;u=u||{};var hi=undefined===u.gaugeType?steelseries.GaugeType.TYPE4:u.gaugeType,h=undefined===u.size?0:u.size,f=undefined===u.minValue?0:u.minValue,l=undefined===u.maxValue?f+100:u.maxValue,re=undefined===u.niceScale?!0:u.niceScale,gt=undefined===u.threshold?(l-f)/2+f:u.threshold,ni=undefined===u.thresholdRising?!0:u.thresholdRising,ci=undefined===u.section?null:u.section,su=undefined===u.useSectionColors?!1:u.useSectionColors,hu=undefined===u.titleString?"":u.titleString,cu=undefined===u.unitString?"":u.unitString,lu=undefined===u.frameDesign?steelseries.FrameDesign.METAL:u.frameDesign,au=undefined===u.frameVisible?!0:u.frameVisible,yi=undefined===u.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:u.backgroundColor,vu=undefined===u.backgroundVisible?!0:u.backgroundVisible,sr=undefined===u.valueColor?steelseries.ColorDef.RED:u.valueColor,pi=undefined===u.lcdColor?steelseries.LcdColor.STANDARD:u.lcdColor,yu=undefined===u.lcdVisible?!0:u.lcdVisible,pu=undefined===u.lcdDecimals?2:u.lcdDecimals,ue=undefined===u.digitalFont?!1:u.digitalFont,wu=undefined===u.fractionalScaleDecimals?1:u.fractionalScaleDecimals,fe=undefined===u.customLayer?null:u.customLayer,dr=undefined===u.ledColor?steelseries.LedColor.RED_LED:u.ledColor,gr=undefined===u.ledVisible?!0:u.ledVisible,nu=undefined===u.userLedColor?steelseries.LedColor.GREEN_LED:u.userLedColor,tu=undefined===u.userLedVisible?!1:u.userLedVisible,bu=undefined===u.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:u.labelNumberFormat,ku=undefined===u.foregroundType?steelseries.ForegroundType.TYPE1:u.foregroundType,du=undefined===u.foregroundVisible?!0:u.foregroundVisible,gi=undefined===u.playAlarm?!1:u.playAlarm,gu=undefined===u.alarmSound?!1:u.alarmSound,nr=undefined===u.valueGradient?null:u.valueGradient,nf=undefined===u.useValueGradient?!1:u.useValueGradient,ee=undefined===u.tickLabelOrientation?hi===steelseries.GaugeType.TYPE1?steelseries.TickLabelOrientation.TANGENT:steelseries.TickLabelOrientation.NORMAL:u.tickLabelOrientation,iu=undefined===u.trendVisible?!1:u.trendVisible,hr=undefined===u.trendColors?[steelseries.LedColor.RED_LED,steelseries.LedColor.GREEN_LED,steelseries.LedColor.CYAN_LED]:u.trendColors,tf=undefined===u.fullScaleDeflectionTime?2.5:u.fullScaleDeflectionTime,p=ht(n);h===0&&(h=Math.min(p.canvas.width,p.canvas.height));p.canvas.width=h;p.canvas.height=h;gi&&gu!==!1&&(li=d.createElement("audio"),li.setAttribute("src",gu),li.setAttribute("preload","auto"));var ft=f,vt=l-f,rt=!1,rf=0,cr=!1,ru=0,ai,uf=this,vi=!1,at,ot,wi,ui,b,ti,kt,oe,bi=[],lr=!1,uu=!1,e=h,st=h,et=e/2,ct=st/2,fu=Math.floor(e/10),se=fu+"px "+s,he=fu+"px "+wt,eu=st*.13,tr=e*.4,ff=(e-tr)/2,ef=st/2-eu/2,ce=e*.116822,le=e*.485981,y=Math.ceil(h*.093457),of=e*.53,sf=st*.61,ae=hi===steelseries.GaugeType.TYPE3?.7*e:et-y/2,ve=hi===steelseries.GaugeType.TYPE3?.61*st:.75*st,hf=steelseries.TrendState.OFF,ar=h*.06,vr=h*.38,yr=h*.57;switch(hi.type){case"type1":at=0;ot=o;wi=0;ui=i;b=i;ti=b*pt;kt=b/vt;break;case"type2":at=0;ot=o;wi=0;ui=i;b=o;ti=b*pt;kt=b/vt;break;case"type3":at=0;ot=i;wi=-i;ui=0;b=1.5*o;ti=b*pt;kt=b/vt;break;case"type4":default:at=60*c;ot=i+at/2;wi=-t/6;ui=0;b=t-at;ti=b*pt;kt=b/vt}var ir=r(h,h),cf=ir.getContext("2d"),rr=r(h,h),oi=rr.getContext("2d"),lf,ur=r(Math.ceil(h*.060747),Math.ceil(h*.023364)),ou=ur.getContext("2d"),ki=r(y,y),af=ki.getContext("2d"),si=r(y,y),vf=si.getContext("2d"),di=si,ii=r(y,y),yf=ii.getContext("2d"),dt=r(y,y),pf=dt.getContext("2d"),yt=dt,ye,fr=r(h,h),wf=fr.getContext("2d"),bf,kf,df,gf,ne=!1,pr=f,wr=l,er=l-f;vt=wr-pr;var br=0,ri=0,kr=10,te=10,pe=function(){re?(er=k(l-f,!1),ri=k(er/(te-1),!0),pr=Math.floor(f/ri)*ri,wr=Math.ceil(l/ri)*ri,br=k(ri/(kr-1),!0),f=pr,l=wr,vt=l-f):(er=l-f,pr=f,wr=l,vt=er,ri=k(er/(te-1),!0),br=k(ri/(kr-1),!0));switch(hi.type){case"type1":at=0;ot=o;ui=i;b=i;kt=b/vt;break;case"type2":at=0;ot=o;ui=i;b=o;kt=b/vt;break;case"type3":at=0;ot=i;ui=0;b=1.5*o;kt=b/vt;break;case"type4":default:at=60*c;ot=i+at/2;ui=0;b=t-at;kt=b/vt}oe=ot+(ft-f)*kt},ut=function(n){var t;n=n||{};var r=undefined===n.frame?!1:n.frame,i=undefined===n.background?!1:n.background,u=undefined===n.led?!1:n.led,o=undefined===n.userLed?!1:n.userLed,s=undefined===n.value?!1:n.value,h=undefined===n.foreground?!1:n.foreground,c=undefined===n.trend?!1:n.trend;if(ne=!0,pe(),r&&au&&g(cf,lu,et,ct,e,st),i&&vu&&(nt(oi,yi,et,ct,e,st),bt(oi,fe,et,ct,e,st)),u&&(af.drawImage(a(y,1,dr),0,0),vf.drawImage(a(y,0,dr),0,0),ye=oi.getImageData(of,sf,y,y)),o&&(yf.drawImage(a(Math.ceil(y),1,nu),0,0),pf.drawImage(a(Math.ceil(y),0,nu),0,0)),i&&we(oi),i&&vu&&(ke(oi,bu),fi(oi,e,st,hu,cu,yi,!0,!0)),i&&yu&&(lf=it(tr,eu,pi),oi.drawImage(lf,ff,ef)),lr=!1,su&&null!==ci&&0l?l:n;return ft!==t&&(ft=t,ft>=gt&&!rt&&ni||ft<=gt&&!rt&&!ni?(rt=!0,or(rt),gi&&li.play()):(ftgt&&rt&&!ni)&&(rt=!1,or(rt),gi&&li.pause()),this.repaint()),this},this.getValue=function(){return ft},this.setValueAnimated=function(n,t){n=parseFloat(n);var r=nl?l:n,u=this,i;return ft!==r&&(undefined!==ai&&ai.isPlaying&&ai.stop(),i=tf*Math.abs(r-ft)/(l-f),i=Math.max(i,tf/5),ai=new Tween({},"",Tween.regularEaseInOut,ft,r,i),ai.onMotionChanged=function(n){ft=n.target._pos;ft>=gt&&!rt&&ni||ft<=gt&&!rt&&!ni?(rt=!0,or(rt),gi&&li.play()):(ftgt&&rt&&!ni)&&(rt=!1,or(rt),gi&&li.pause());vi||(vi=!0,v(u.repaint))},t&&typeof t=="function"&&(ai.onMotionFinished=t),ai.start()),this},this.setFrameDesign=function(n){return lt({frame:!0}),lu=n,ut({frame:!0}),this.repaint(),this},this.setBackgroundColor=function(n){return lt({background:!0,led:!0}),yi=n,ut({background:!0,led:!0}),this.repaint(),this},this.setForegroundType=function(n){return lt({foreground:!0}),ku=n,ut({foreground:!0}),this.repaint(),this},this.setValueColor=function(n){return lt({value:!0}),sr=n,ut({value:!0}),this.repaint(),this},this.setLedColor=function(n){return lt({led:!0}),dr=n,ut({led:!0}),this.repaint(),this},this.setUserLedColor=function(n){return lt({userLed:!0}),nu=n,ut({userLed:!0}),this.repaint(),this},this.toggleUserLed=function(){return yt=yt===ii?dt:ii,this.repaint(),this},this.setUserLedOnOff=function(n){return yt=!0===n?ii:dt,this.repaint(),this},this.blinkUserLed=function(n){return n?cr||(de(!0),cr=!0):cr&&(clearInterval(ru),cr=!1),this},this.setLedVisible=function(n){return gr=!!n,this.repaint(),this},this.setUserLedVisible=function(n){return tu=!!n,this.repaint(),this},this.setLcdColor=function(n){return pi=n,lt({background:!0}),ut({background:!0}),this.repaint(),this},this.setLcdDecimals=function(n){return pu=parseInt(n,10),this.repaint(),this},this.setSection=function(n){return ci=n,ut(),this.repaint(),this},this.setSectionActive=function(n){return su=n,ut(),this.repaint(),this},this.setGradient=function(n){return nr=n,ut(),this.repaint(),this},this.setGradientActive=function(n){return nf=n,ut(),this.repaint(),this},this.setMinValue=function(n){return f=n,lt({background:!0}),ut({background:!0}),this.repaint(),this},this.getMinValue=function(){return f},this.setMaxValue=function(n){return l=n,lt({background:!0}),ut({background:!0}),this.repaint(),this},this.getMaxValue=function(){return l},this.setThreshold=function(n){n=parseFloat(n);var t=nl?l:n;return gt=t,lt({background:!0}),ut({background:!0}),this.repaint(),this},this.setThresholdRising=function(n){return ni=!!n,rt=!rt,or(rt),this.repaint(),this},this.setTitleString=function(n){return hu=n,lt({background:!0}),ut({background:!0}),this.repaint(),this},this.setUnitString=function(n){return cu=n,lt({background:!0}),ut({background:!0}),this.repaint(),this},this.setTrend=function(n){return hf=n,this.repaint(),this},this.setTrendVisible=function(n){return iu=!!n,this.repaint(),this},this.setFractionalScaleDecimals=function(n){wu=parseInt(n,10);lt({background:!0});ut({background:!0});this.repaint()},this.setLabelNumberFormat=function(n){return bu=n,lt({background:!0}),ut({background:!0}),this.repaint(),this},this.repaint=function(){var s=(ft-f)/(l-f)*ti,t,u=sr,n,i,e,o,r;for(ne||ut({frame:!0,background:!0,led:!0,userLed:!0,value:!0,trend:!0,foreground:!0}),p.clearRect(0,0,h,h),au&&p.drawImage(ir,0,0),p.drawImage(rr,0,0),n=0;n<=s;n+=5){if(t=sr,uu)e=f+n/ti*(l-f),o=nr.getEnd()-nr.getStart(),r=(e-f)/o,r=Math.max(Math.min(r,1),0),t=ei(nr.getColorAt(r).getRgbaColor());else if(lr)for(i=0;i=bi[i].start&&ne-4?c||(o=h>e*.8?e-h-e*.2:0,c=!0,clearTimeout(b),b=setTimeout(d,200)):et&&h<=e-4&&(o=0,c=!1),i.fillText(n,e-2-o,f*.5+w*.38));i.restore()},ri=function(n,t,i,u){var tt=r(n,t),f=tt.getContext("2d");f.save();var h=0,et=n,it=t,ut=Math.min(n,t)*.095,s=f.createLinearGradient(0,h,0,h+it);s.addColorStop(0,"#4c4c4c");s.addColorStop(.08,"#666666");s.addColorStop(.92,"#666666");s.addColorStop(1,"#e6e6e6");f.fillStyle=s;dt(f,0,h,et,it,ut);f.fill();f.restore();f.save();var c=rt(i),e=ot(c[0],c[1],c[2]),l=rt(u.gradientStartColor),ht=ot(l[0],l[1],l[2]),a=rt(u.gradientFraction1Color),ct=ot(a[0],a[1],a[2]),v=rt(u.gradientFraction2Color),lt=ot(v[0],v[1],v[2]),y=rt(u.gradientFraction3Color),at=ot(y[0],y[1],y[2]),p=rt(u.gradientStopColor),vt=ot(p[0],p[1],p[2]),w=st(e[0],e[1],ht[2]-.31),b=st(e[0],e[1],ct[2]-.31),k=st(e[0],e[1],lt[2]-.31),d=st(e[0],e[1],at[2]-.31),g=st(e[0],e[1],vt[2]-.31),nt=1,yt=n-2,ft=t-2,pt=ut-1,o=f.createLinearGradient(0,nt,0,nt+ft);return o.addColorStop(0,"rgb("+w[0]+", "+w[1]+", "+w[2]+")"),o.addColorStop(.03,"rgb("+b[0]+","+b[1]+","+b[2]+")"),o.addColorStop(.49,"rgb("+k[0]+","+k[1]+","+k[2]+")"),o.addColorStop(.5,"rgb("+d[0]+","+d[1]+","+d[2]+")"),o.addColorStop(1,"rgb("+g[0]+","+g[1]+","+g[2]+")"),f.fillStyle=o,dt(f,1,nt,yt,ft,pt),f.fill(),f.restore(),tt},ui=function(n){var t=rt(n),r=ot(t[0],t[1],t[2]),i=st(r[0],.57,.83);return"rgb("+i[0]+", "+i[1]+", "+i[2]+")"},d=function(){c?(o>e&&(o=-h),o+=2,b=setTimeout(d,50)):o=0;k||(k=!0,v(ti.repaint))},g=function(){var n;if(at=!0,vt=it(l,a,y),null!==u&&0=u[n].start&&p<=u[n].stop){t=yt[n];r=pt[n];break}i.drawImage(t,0,0);ii(p,r);k=!1},this.repaint(),this},ai=function(n,u){u=u||{};var o=undefined===u.size?0:u.size,hi=undefined===u.frameDesign?steelseries.FrameDesign.METAL:u.frameDesign,ci=undefined===u.frameVisible?!0:u.frameVisible,rt=undefined===u.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:u.backgroundColor,li=undefined===u.backgroundVisible?!0:u.backgroundVisible,dt=undefined===u.pointerTypeLatest?steelseries.PointerType.TYPE1:u.pointerTypeLatest,ai=undefined===u.pointerTypeAverage?steelseries.PointerType.TYPE8:u.pointerTypeAverage,ii=undefined===u.pointerColor?steelseries.ColorDef.RED:u.pointerColor,ri=undefined===u.pointerColorAverage?steelseries.ColorDef.BLUE:u.pointerColorAverage,ar=undefined===u.knobType?steelseries.KnobType.STANDARD_KNOB:u.knobType,vr=undefined===u.knobStyle?steelseries.KnobStyle.SILVER:u.knobStyle,vi=undefined===u.foregroundType?steelseries.ForegroundType.TYPE1:u.foregroundType,yi=undefined===u.foregroundVisible?!0:u.foregroundVisible,h=undefined===u.pointSymbols?["N","NE","E","SE","S","SW","W","NW"]:u.pointSymbols,yr=undefined===u.pointSymbolsVisible?!0:u.pointSymbolsVisible,pr=undefined===u.customLayer?null:u.customLayer,wr=undefined===u.degreeScale?!0:u.degreeScale,ui=undefined===u.degreeScaleHalf?!1:u.degreeScaleHalf,wi=undefined===u.roseVisible?!1:u.roseVisible,lt=undefined===u.lcdColor?steelseries.LcdColor.STANDARD:u.lcdColor,bi=undefined===u.lcdVisible?!0:u.lcdVisible,br=undefined===u.digitalFont?!1:u.digitalFont,et=undefined===u.section?null:u.section,ot=undefined===u.area?null:u.area,gt=undefined===u.lcdTitleStrings?["Latest","Average"]:u.lcdTitleStrings,ki=undefined===u.titleString?"":u.titleString,di=undefined===u.useColorLabels?!1:u.useColorLabels,ni=undefined===u.fullScaleDeflectionTime?2.5:u.fullScaleDeflectionTime,st,ct,y=0,p=0,at=c,gi=this.valueLatest,fi=this.valueAverage,kr=-i,nr=t,tr=360,l=!1,e=ht(n);o===0&&(o=Math.min(e.canvas.width,e.canvas.height));e.canvas.width=o;e.canvas.height=o;var f=o,w=o,b=f/2,k=w/2,ei=Math.floor(f/10),dr=ei+"px "+s,gr=ei+"px "+wt,ti=f*.3,ir=w*.12,rr=(f-ti)/2,ur=w*.32,fr=w*.565,er=!1,vt=r(o,o),ut=vt.getContext("2d"),oi,yt=r(o,o),or=yt.getContext("2d"),pt=r(o,o),sr=pt.getContext("2d"),kt=r(o,o),hr=kt.getContext("2d"),cr=function(n,t){for(e.save(),e.textAlign="center",e.strokeStyle=lt.textColor,e.fillStyle=lt.textColor;n<-180;)n+=360;!ui&&n<0&&(n+=360);ui&&n>180&&(n=-(360-n));n>=0?(n="00"+Math.round(n),n=n.substring(n.length,n.length-3)):(n="00"+Math.abs(Math.round(n)),n="-"+n.substring(n.length,n.length-3));(lt===steelseries.LcdColor.STANDARD||lt===steelseries.LcdColor.STANDARD_GREEN)&&(e.shadowColor="gray",e.shadowOffsetX=f*.007,e.shadowOffsetY=f*.007,e.shadowBlur=f*.007);e.font=br?gr:dr;e.fillText(n+"°",f/2+ti*.05,(t?ur:fr)+ir*.5+ei*.38,ti*.9);e.restore()},lr=function(n,t,i,r,u){n.save();n.strokeStyle=r;n.fillStyle=r;n.lineWidth=f*.035;var e=nr/tr*t,o=e+(i-t)/(tr/nr);n.translate(b,k);n.rotate(kr);n.beginPath();u?(n.moveTo(0,0),n.arc(0,0,f*.365-n.lineWidth/2,e,o,!1)):n.arc(0,0,f*.365,e,o,!1);u?(n.moveTo(0,0),n.fill()):n.stroke();n.translate(-b,-k);n.restore()},nu=function(n){var l=f*.38,a=f*.35,p=f*.36,c=f*.1,v=f*.31,u=f*.36,r,e,t,o,y;if(n.textAlign="center",n.textBaseline="middle",n.save(),n.strokeStyle=rt.labelColor.getRgbaColor(),n.fillStyle=rt.labelColor.getRgbaColor(),n.translate(b,k),wr)for(r=Math.floor(.1*f)+"px serif bold",e=Math.floor(f*.04)+"px "+s,n.rotate(at*5),t=5;360>=t;t+=5){if(n.save(),yr)switch(t){case 360:n.translate(u,0);n.rotate(i);n.font=r;n.fillText(h[2],0,0,c);n.translate(-u,0);break;case 90:n.translate(u,0);n.rotate(i);n.font=r;n.fillText(h[4],0,0,c);n.translate(-u,0);break;case 180:n.translate(u,0);n.rotate(i);n.font=r;n.fillText(h[6],0,0,c);n.translate(-u,0);break;case 270:n.translate(u,0);n.rotate(i);n.font=r;n.fillText(h[0],0,0,c);n.translate(-u,0);break;case 5:case 85:case 95:case 175:case 185:case 265:case 275:case 355:break;default:(t+90)%20?(n.lineWidth=(t+90)%5?1.5:1,n.beginPath(),n.moveTo(l,0),y=(t+90)%10?p:a,n.lineTo(y,0),n.closePath(),n.stroke()):(n.lineWidth=1.5,n.beginPath(),n.moveTo(l,0),n.lineTo(a,0),n.closePath(),n.stroke(),o=(t+90)%360,n.translate(v,0),n.rotate(i),n.font=e,n.fillText("0".substring(o>=100)+o,0,0,c),n.translate(-v,0))}else(t+90)%20?(n.lineWidth=(t+90)%5?1.5:1,n.beginPath(),n.moveTo(l,0),y=(t+90)%10?p:a,n.lineTo(y,0),n.closePath(),n.stroke()):(n.lineWidth=1.5,n.beginPath(),n.moveTo(l,0),n.lineTo(a,0),n.closePath(),n.stroke(),o=(t+90)%360,ui&&o>180&&(o=-(360-o)),n.translate(v,0),n.rotate(i),n.font=e,n.fillText(o,0,0,c),n.translate(-v,0));n.restore();n.rotate(at*5)}else for(r=.12*f+"px serif",e=.06*f+"px serif",n.lineWidth=1,n.strokeStyle=rt.symbolColor.getRgbaColor(),t=0;360>t;t+=2.5){0==t%5&&(n.beginPath(),n.moveTo(f*.38,0),n.lineTo(f*.36,0),n.closePath(),n.stroke());n.save();switch(t){case 0:n.translate(f*.35,0);n.rotate(i);n.font=r;n.fillText(h[2],0,0);n.translate(-f*.35,0);break;case 45:n.translate(f*.29,0);n.rotate(i);n.font=e;n.fillText(h[3],0,0);n.translate(-f*.29,0);break;case 90:n.translate(f*.35,0);n.rotate(i);n.font=r;n.fillText(h[4],0,0);n.translate(-f*.35,0);break;case 135:n.translate(f*.29,0);n.rotate(i);n.font=e;n.fillText(h[5],0,0);n.translate(-f*.29,0);break;case 180:n.translate(f*.35,0);n.rotate(i);n.font=r;n.fillText(h[6],0,0);n.translate(-f*.35,0);break;case 225:n.translate(f*.29,0);n.rotate(i);n.font=e;n.fillText(h[7],0,0);n.translate(-f*.29,0);break;case 270:n.translate(f*.35,0);n.rotate(i);n.font=r;n.fillText(h[0],0,0);n.translate(-f*.35,0);break;case 315:n.translate(f*.29,0);n.rotate(i);n.font=e;n.fillText(h[1],0,0);n.translate(-f*.29,0)}n.restore();wi&&(0===t||22.5===t||45===t||67.5===t||90===t||112.5===t||135===t||157.5===t||180===t||202.5===t||225===t||247.5===t||270===t||292.5===t||315===t||337.5===t||360===t)&&(n.save(),n.beginPath(),t%45?n.moveTo(f*.29,0):n.moveTo(f*.38,0),n.lineTo(f*.1,0),n.closePath(),n.restore(),n.stroke());n.rotate(at*2.5)}n.translate(-b,-k);n.restore()},tu=function(n){gt.length>0&&(n.save(),n.textAlign="center",n.textBaseline="middle",n.fillStyle=di?ii.medium.getRgbaColor():rt.labelColor.getRgbaColor(),n.font=.04*f+"px "+s,n.fillText(gt[0],f/2,w*.29,f*.3),n.fillStyle=di?ri.medium.getRgbaColor():rt.labelColor.getRgbaColor(),n.fillText(gt[1],f/2,w*.71,f*.3),ki.length>0&&(n.fillStyle=rt.labelColor.getRgbaColor(),n.font=.0467*f+"px "+s,n.fillText(ki,f/2,w*.5,f*.3)))},a=function(n){var t,i,u;n=n||{};var r=undefined===n.background?!1:n.background,e=undefined===n.pointer?!1:n.pointer,o=undefined===n.foreground?!1:n.foreground;if(er=!0,r&&ci&&g(ut,hi,b,k,f,w),r&&li){if(nt(ut,rt,b,k,f,w),bt(ut,pr,b,k,f,w),null!==et&&00)for(u.rect(0,0,f,s*1.1),u.fillStyle=ct,u.fill(),u.strokeStyle="#f0f0f0",u.lineWidth="1px",u.moveTo(0,0),u.lineTo(0,s*1.1),u.stroke(),u.strokeStyle="#202020",u.moveTo(f,0),u.lineTo(f,s*1.1),u.stroke(),u.textAlign="center",u.textBaseline="middle",u.font=g,u.fillStyle=lt,n=9;n<21;n++)u.fillText(n%10,f*.5,h*(n-9)+h/2);for(n=0;n=o;o+=90)n.beginPath(),n.moveTo(u*.560747,f*.584112),n.lineTo(u*.640186,f*.644859),n.lineTo(u*.584112,f*.560747),n.lineTo(u*.560747,f*.584112),n.closePath(),n.fillStyle=h,n.fill(),n.stroke(),n.beginPath(),n.moveTo(u*.523364,f*.397196),n.lineTo(u*.5,f*.196261),n.lineTo(u*.471962,f*.397196),n.lineTo(u*.523364,f*.397196),n.closePath(),s=n.createLinearGradient(.476635*u,0,.518691*u,0),s.addColorStop(0,"rgb(222, 223, 218)"),s.addColorStop(.48,"rgb(222, 223, 218)"),s.addColorStop(.49,h),s.addColorStop(1,h),n.fillStyle=s,n.fill(),n.stroke(),n.translate(i,r),n.rotate(o*c),n.translate(-i,-r);n.beginPath();n.translate(i,r);n.arc(0,0,u*.1,0,t,!1);n.lineWidth=u*.022;n.stroke();n.translate(-i,-r);n.restore()},ft=function(n,i,u,f,e){var c,o,s,h,l=i.toString()+u.type+f.light.getHexColor()+f.medium.getHexColor();if(!ft.cache[l]){c=r(i,i);o=c.getContext("2d");switch(u.type){case"type2":s=o.createLinearGradient(0,i*.471962,0,i*.130841);s.addColorStop(0,e.getRgbaColor());s.addColorStop(.36,e.getRgbaColor());s.addColorStop(.361,f.light.getRgbaColor());s.addColorStop(1,f.light.getRgbaColor());o.fillStyle=s;o.beginPath();o.moveTo(i*.518691,i*.471962);o.lineTo(i*.509345,i*.462616);o.lineTo(i*.509345,i*.341121);o.lineTo(i*.504672,i*.130841);o.lineTo(i*.495327,i*.130841);o.lineTo(i*.490654,i*.341121);o.lineTo(i*.490654,i*.462616);o.lineTo(i*.481308,i*.471962);o.closePath();o.fill();break;case"type3":o.beginPath();o.rect(i*.495327,i*.130841,i*.009345,i*.373831);o.closePath();o.fillStyle=f.light.getRgbaColor();o.fill();break;case"type4":s=o.createLinearGradient(.467289*i,0,.528036*i,0);s.addColorStop(0,f.dark.getRgbaColor());s.addColorStop(.51,f.dark.getRgbaColor());s.addColorStop(.52,f.light.getRgbaColor());s.addColorStop(1,f.light.getRgbaColor());o.fillStyle=s;o.beginPath();o.moveTo(i*.5,i*.126168);o.lineTo(i*.514018,i*.135514);o.lineTo(i*.53271,i*.5);o.lineTo(i*.523364,i*.602803);o.lineTo(i*.476635,i*.602803);o.lineTo(i*.467289,i*.5);o.lineTo(i*.485981,i*.135514);o.lineTo(i*.5,i*.126168);o.closePath();o.fill();break;case"type5":s=o.createLinearGradient(.471962*i,0,.528036*i,0);s.addColorStop(0,f.light.getRgbaColor());s.addColorStop(.5,f.light.getRgbaColor());s.addColorStop(.5,f.medium.getRgbaColor());s.addColorStop(1,f.medium.getRgbaColor());o.fillStyle=s;o.beginPath();o.moveTo(i*.5,i*.495327);o.lineTo(i*.528037,i*.495327);o.lineTo(i*.5,i*.149532);o.lineTo(i*.471962,i*.495327);o.lineTo(i*.5,i*.495327);o.closePath();o.fill();o.lineWidth=1;o.lineCap="square";o.lineJoin="miter";o.strokeStyle=f.dark.getRgbaColor();o.stroke();break;case"type6":o.fillStyle=f.medium.getRgbaColor();o.beginPath();o.moveTo(i*.481308,i*.485981);o.lineTo(i*.481308,i*.392523);o.lineTo(i*.485981,i*.317757);o.lineTo(i*.495327,i*.130841);o.lineTo(i*.504672,i*.130841);o.lineTo(i*.514018,i*.317757);o.lineTo(i*.518691,i*.38785);o.lineTo(i*.518691,i*.485981);o.lineTo(i*.504672,i*.485981);o.lineTo(i*.504672,i*.38785);o.lineTo(i*.5,i*.317757);o.lineTo(i*.495327,i*.392523);o.lineTo(i*.495327,i*.485981);o.lineTo(i*.481308,i*.485981);o.closePath();o.fill();break;case"type7":s=o.createLinearGradient(.481308*i,0,.518691*i,0);s.addColorStop(0,f.dark.getRgbaColor());s.addColorStop(1,f.medium.getRgbaColor());o.fillStyle=s;o.beginPath();o.moveTo(i*.490654,i*.130841);o.lineTo(i*.481308,i*.5);o.lineTo(i*.518691,i*.5);o.lineTo(i*.504672,i*.130841);o.lineTo(i*.490654,i*.130841);o.closePath();o.fill();break;case"type8":s=o.createLinearGradient(.471962*i,0,.528036*i,0);s.addColorStop(0,f.light.getRgbaColor());s.addColorStop(.5,f.light.getRgbaColor());s.addColorStop(.5,f.medium.getRgbaColor());s.addColorStop(1,f.medium.getRgbaColor());o.fillStyle=s;o.strokeStyle=f.dark.getRgbaColor();o.beginPath();o.moveTo(i*.5,i*.53271);o.lineTo(i*.53271,i*.5);o.bezierCurveTo(i*.53271,i*.5,i*.509345,i*.457943,i*.5,i*.149532);o.bezierCurveTo(i*.490654,i*.457943,i*.467289,i*.5,i*.467289,i*.5);o.lineTo(i*.5,i*.53271);o.closePath();o.fill();o.stroke();break;case"type9":s=o.createLinearGradient(.471962*i,0,.528036*i,0);s.addColorStop(0,"rgb(50, 50, 50)");s.addColorStop(.5,"#666666");s.addColorStop(1,"rgb(50, 50, 50)");o.fillStyle=s;o.strokeStyle="#2E2E2E";o.beginPath();o.moveTo(i*.495327,i*.233644);o.lineTo(i*.504672,i*.233644);o.lineTo(i*.514018,i*.439252);o.lineTo(i*.485981,i*.439252);o.lineTo(i*.495327,i*.233644);o.closePath();o.moveTo(i*.490654,i*.130841);o.lineTo(i*.471962,i*.471962);o.lineTo(i*.471962,i*.528037);o.bezierCurveTo(i*.471962,i*.528037,i*.476635,i*.602803,i*.476635,i*.602803);o.bezierCurveTo(i*.476635,i*.607476,i*.481308,i*.607476,i*.5,i*.607476);o.bezierCurveTo(i*.518691,i*.607476,i*.523364,i*.607476,i*.523364,i*.602803);o.bezierCurveTo(i*.523364,i*.602803,i*.528037,i*.528037,i*.528037,i*.528037);o.lineTo(i*.528037,i*.471962);o.lineTo(i*.509345,i*.130841);o.lineTo(i*.490654,i*.130841);o.closePath();o.fill();o.beginPath();o.moveTo(i*.495327,i*.219626);o.lineTo(i*.504672,i*.219626);o.lineTo(i*.504672,i*.135514);o.lineTo(i*.495327,i*.135514);o.lineTo(i*.495327,i*.219626);o.closePath();o.fillStyle=f.medium.getRgbaColor();o.fill();break;case"type10":o.beginPath();o.moveTo(i*.5,i*.149532);o.bezierCurveTo(i*.5,i*.149532,i*.443925,i*.490654,i*.443925,i*.5);o.bezierCurveTo(i*.443925,i*.53271,i*.467289,i*.556074,i*.5,i*.556074);o.bezierCurveTo(i*.53271,i*.556074,i*.556074,i*.53271,i*.556074,i*.5);o.bezierCurveTo(i*.556074,i*.490654,i*.5,i*.149532,i*.5,i*.149532);o.closePath();s=o.createLinearGradient(.471962*i,0,.528036*i,0);s.addColorStop(0,f.light.getRgbaColor());s.addColorStop(.5,f.light.getRgbaColor());s.addColorStop(.5,f.medium.getRgbaColor());s.addColorStop(1,f.medium.getRgbaColor());o.fillStyle=s;o.strokeStyle=f.medium.getRgbaColor();o.lineWidth=1;o.lineCap="square";o.lineJoin="miter";o.fill();o.stroke();break;case"type11":o.beginPath();o.moveTo(.5*i,.168224*i);o.lineTo(.485981*i,.5*i);o.bezierCurveTo(.485981*i,.5*i,.481308*i,.584112*i,.5*i,.584112*i);o.bezierCurveTo(.514018*i,.584112*i,.509345*i,.5*i,.509345*i,.5*i);o.lineTo(.5*i,.168224*i);o.closePath();s=o.createLinearGradient(0,.168224*i,0,.584112*i);s.addColorStop(0,f.medium.getRgbaColor());s.addColorStop(1,f.dark.getRgbaColor());o.fillStyle=s;o.strokeStyle=f.dark.getRgbaColor();o.fill();o.stroke();break;case"type12":o.beginPath();o.moveTo(.5*i,.168224*i);o.lineTo(.485981*i,.5*i);o.lineTo(.5*i,.504672*i);o.lineTo(.509345*i,.5*i);o.lineTo(.5*i,.168224*i);o.closePath();s=o.createLinearGradient(0,.168224*i,0,.504672*i);s.addColorStop(0,f.medium.getRgbaColor());s.addColorStop(1,f.dark.getRgbaColor());o.fillStyle=s;o.strokeStyle=f.dark.getRgbaColor();o.fill();o.stroke();break;case"type13":case"type14":o.beginPath();o.moveTo(.485981*i,.168224*i);o.lineTo(.5*i,.130841*i);o.lineTo(.509345*i,.168224*i);o.lineTo(.509345*i,.509345*i);o.lineTo(.485981*i,.509345*i);o.lineTo(.485981*i,.168224*i);o.closePath();u.type==="type13"?(s=o.createLinearGradient(0,.5*i,0,.130841*i),s.addColorStop(0,e.getRgbaColor()),s.addColorStop(.85,e.getRgbaColor()),s.addColorStop(.85,f.medium.getRgbaColor()),s.addColorStop(1,f.medium.getRgbaColor()),o.fillStyle=s):(s=o.createLinearGradient(.485981*i,0,.509345*i,0),s.addColorStop(0,f.veryDark.getRgbaColor()),s.addColorStop(.5,f.light.getRgbaColor()),s.addColorStop(1,f.veryDark.getRgbaColor()),o.fillStyle=s);o.fill();break;case"type15":case"type16":o.beginPath();o.moveTo(i*.509345,i*.457943);o.lineTo(i*.5015,i*.13);o.lineTo(i*.4985,i*.13);o.lineTo(i*.490654,i*.457943);o.bezierCurveTo(i*.490654,i*.457943,i*.490654,i*.457943,i*.490654,i*.457943);o.bezierCurveTo(i*.471962,i*.462616,i*.457943,i*.481308,i*.457943,i*.5);o.bezierCurveTo(i*.457943,i*.518691,i*.471962,i*.537383,i*.490654,i*.542056);o.bezierCurveTo(i*.490654,i*.542056,i*.490654,i*.542056,i*.490654,i*.542056);u.type==="type15"?(o.lineTo(i*.490654,i*.57),o.bezierCurveTo(i*.46,i*.58,i*.46,i*.62,i*.490654,i*.63),o.bezierCurveTo(i*.47,i*.62,i*.48,i*.59,i*.5,i*.59),o.bezierCurveTo(i*.53,i*.59,i*.52,i*.62,i*.509345,i*.63),o.bezierCurveTo(i*.54,i*.62,i*.54,i*.58,i*.509345,i*.57),o.lineTo(i*.509345,i*.57)):(o.lineTo(i*.490654,i*.621495),o.lineTo(i*.509345,i*.621495));o.lineTo(i*.509345,i*.542056);o.bezierCurveTo(i*.509345,i*.542056,i*.509345,i*.542056,i*.509345,i*.542056);o.bezierCurveTo(i*.528037,i*.537383,i*.542056,i*.518691,i*.542056,i*.5);o.bezierCurveTo(i*.542056,i*.481308,i*.528037,i*.462616,i*.509345,i*.457943);o.bezierCurveTo(i*.509345,i*.457943,i*.509345,i*.457943,i*.509345,i*.457943);o.closePath();s=u.type==="type15"?o.createLinearGradient(0,0,0,i*.63):o.createLinearGradient(0,0,0,i*.621495);s.addColorStop(0,f.medium.getRgbaColor());s.addColorStop(.388888,f.medium.getRgbaColor());s.addColorStop(.5,f.light.getRgbaColor());s.addColorStop(.611111,f.medium.getRgbaColor());s.addColorStop(1,f.medium.getRgbaColor());o.fillStyle=s;o.strokeStyle=f.dark.getRgbaColor();o.fill();o.stroke();o.beginPath();h=i*.06542/2;o.arc(i*.5,i*.5,h,0,t);s=o.createLinearGradient(i*.5-h,i*.5+h,0,i*.5+h);s.addColorStop(0,"#e6b35c");s.addColorStop(.01,"#e6b35c");s.addColorStop(.99,"#c48200");s.addColorStop(1,"#c48200");o.fillStyle=s;o.closePath();o.fill();o.beginPath();h=i*.046728/2;o.arc(i*.5,i*.5,h,0,t);s=o.createRadialGradient(i*.5,i*.5,0,i*.5,i*.5,h);s.addColorStop(0,"#c5c5c5");s.addColorStop(.19,"#c5c5c5");s.addColorStop(.22,"#000000");s.addColorStop(.8,"#000000");s.addColorStop(.99,"#707070");s.addColorStop(1,"#707070");o.fillStyle=s;o.closePath();o.fill();break;case"type1":default:s=o.createLinearGradient(0,i*.471962,0,i*.130841);s.addColorStop(0,f.veryDark.getRgbaColor());s.addColorStop(.3,f.medium.getRgbaColor());s.addColorStop(.59,f.medium.getRgbaColor());s.addColorStop(1,f.veryDark.getRgbaColor());o.fillStyle=s;o.beginPath();o.moveTo(i*.518691,i*.471962);o.bezierCurveTo(i*.514018,i*.457943,i*.509345,i*.415887,i*.509345,i*.401869);o.bezierCurveTo(i*.504672,i*.383177,i*.5,i*.130841,i*.5,i*.130841);o.bezierCurveTo(i*.5,i*.130841,i*.490654,i*.383177,i*.490654,i*.397196);o.bezierCurveTo(i*.490654,i*.415887,i*.485981,i*.457943,i*.481308,i*.471962);o.bezierCurveTo(i*.471962,i*.481308,i*.467289,i*.490654,i*.467289,i*.5);o.bezierCurveTo(i*.467289,i*.518691,i*.481308,i*.53271,i*.5,i*.53271);o.bezierCurveTo(i*.518691,i*.53271,i*.53271,i*.518691,i*.53271,i*.5);o.bezierCurveTo(i*.53271,i*.490654,i*.528037,i*.481308,i*.518691,i*.471962);o.closePath();o.fill()}ft.cache[l]=c}return n.drawImage(ft.cache[l],0,0),this},g,nt,bt,tt,l,a,it,et,w,v,e,f,y,ut,ct,vt,ui,gt,b,h,lt,ni,ti,yt;ft.cache={};g=function(i,u,f,e,o,s){var p,h,c,l,a,v,y,w=o.toString()+s+u.design;if(!g.cache[w]){p=r(o,s);h=p.getContext("2d");h.fillStyle="#848484";h.strokeStyle="rgba(132, 132, 132, 0.5)";h.beginPath();h.arc(f,e,o/2,0,t,!0);h.closePath();h.fill();h.stroke();h.beginPath();h.arc(f,e,o*.990654/2,0,t,!0);h.closePath();switch(u.design){case"metal":c=h.createLinearGradient(0,o*.004672,0,s*.990654);c.addColorStop(0,"#fefefe");c.addColorStop(.07,"rgb(210, 210, 210)");c.addColorStop(.12,"rgb(179, 179, 179)");c.addColorStop(1,"rgb(213, 213, 213)");h.fillStyle=c;h.fill();break;case"brass":c=h.createLinearGradient(0,o*.004672,0,s*.990654);c.addColorStop(0,"rgb(249, 243, 155)");c.addColorStop(.05,"rgb(246, 226, 101)");c.addColorStop(.1,"rgb(240, 225, 132)");c.addColorStop(.5,"rgb(90, 57, 22)");c.addColorStop(.9,"rgb(249, 237, 139)");c.addColorStop(.95,"rgb(243, 226, 108)");c.addColorStop(1,"rgb(202, 182, 113)");h.fillStyle=c;h.fill();break;case"steel":c=h.createLinearGradient(0,o*.004672,0,s*.990654);c.addColorStop(0,"rgb(231, 237, 237)");c.addColorStop(.05,"rgb(189, 199, 198)");c.addColorStop(.1,"rgb(192, 201, 200)");c.addColorStop(.5,"rgb(23, 31, 33)");c.addColorStop(.9,"rgb(196, 205, 204)");c.addColorStop(.95,"rgb(194, 204, 203)");c.addColorStop(1,"rgb(189, 201, 199)");h.fillStyle=c;h.fill();break;case"gold":c=h.createLinearGradient(0,o*.004672,0,s*.990654);c.addColorStop(0,"rgb(255, 255, 207)");c.addColorStop(.15,"rgb(255, 237, 96)");c.addColorStop(.22,"rgb(254, 199, 57)");c.addColorStop(.3,"rgb(255, 249, 203)");c.addColorStop(.38,"rgb(255, 199, 64)");c.addColorStop(.44,"rgb(252, 194, 60)");c.addColorStop(.51,"rgb(255, 204, 59)");c.addColorStop(.6,"rgb(213, 134, 29)");c.addColorStop(.68,"rgb(255, 201, 56)");c.addColorStop(.75,"rgb(212, 135, 29)");c.addColorStop(1,"rgb(247, 238, 101)");h.fillStyle=c;h.fill();break;case"anthracite":c=h.createLinearGradient(0,.004672*s,0,.995326*s);c.addColorStop(0,"rgb(118, 117, 135)");c.addColorStop(.06,"rgb(74, 74, 82)");c.addColorStop(.12,"rgb(50, 50, 54)");c.addColorStop(1,"rgb(79, 79, 87)");h.fillStyle=c;h.fill();break;case"tiltedGray":c=h.createLinearGradient(.233644*o,.084112*s,.81258*o,.910919*s);c.addColorStop(0,"#ffffff");c.addColorStop(.07,"rgb(210, 210, 210)");c.addColorStop(.16,"rgb(179, 179, 179)");c.addColorStop(.33,"#ffffff");c.addColorStop(.55,"#c5c5c5");c.addColorStop(.79,"#ffffff");c.addColorStop(1,"#666666");h.fillStyle=c;h.fill();break;case"tiltedBlack":c=h.createLinearGradient(.228971*o,.079439*s,.802547*o,.898591*s);c.addColorStop(0,"#666666");c.addColorStop(.21,"#000000");c.addColorStop(.47,"#666666");c.addColorStop(.99,"#000000");c.addColorStop(1,"#000000");h.fillStyle=c;h.fill();break;case"glossyMetal":c=h.createRadialGradient(.5*o,.5*s,0,.5*o,.5*o,.5*o);c.addColorStop(0,"rgb(207, 207, 207)");c.addColorStop(.96,"rgb(205, 204, 205)");c.addColorStop(1,"rgb(244, 244, 244)");h.fillStyle=c;h.fill();h.beginPath();h.arc(.5*o,.5*s,.973962*o/2,0,t);h.closePath();c=h.createLinearGradient(0,s-.971962*s,0,.971962*s);c.addColorStop(0,"rgb(249, 249, 249)");c.addColorStop(.23,"rgb(200, 195, 191)");c.addColorStop(.36,"#ffffff");c.addColorStop(.59,"rgb(29, 29, 29)");c.addColorStop(.76,"rgb(200, 194, 192)");c.addColorStop(1,"rgb(209, 209, 209)");h.fillStyle=c;h.fill();h.beginPath();h.arc(.5*o,.5*s,.869158*o/2,0,t);h.closePath();h.fillStyle="#f6f6f6";h.fill();h.beginPath();h.arc(.5*o,.5*s,.85*o/2,0,t);h.closePath();h.fillStyle="#333333";h.fill();break;case"blackMetal":v=[0,.125,.347222,.5,.680555,.875,1];y=[new n(254,254,254,1),new n(0,0,0,1),new n(153,153,153,1),new n(0,0,0,1),new n(153,153,153,1),new n(0,0,0,1),new n(254,254,254,1)];h.save();h.arc(f,e,o*.990654/2,0,t,!0);h.clip();l=o*.495327;a=o*.42056;c=new at(v,y);c.fillCircle(h,f,e,a,l);h.strokeStyle="#848484";h.strokeStyle="rgba(132, 132, 132, 0.8)";h.beginPath();h.lineWidth=o/90;h.arc(f,e,o/2,0,t,!0);h.closePath();h.stroke();h.restore();break;case"shinyMetal":v=[0,.125,.25,.347222,.5,.652777,.75,.875,1];y=[new n(254,254,254,1),new n(210,210,210,1),new n(179,179,179,1),new n(238,238,238,1),new n(160,160,160,1),new n(238,238,238,1),new n(179,179,179,1),new n(210,210,210,1),new n(254,254,254,1)];h.save();h.arc(f,e,o*.990654/2,0,t,!0);h.clip();l=o*.495327;a=o*.42056;c=new at(v,y);c.fillCircle(h,f,e,a,l);h.strokeStyle="#848484";h.strokeStyle="rgba(132, 132, 132, 0.8)";h.beginPath();h.lineWidth=o/90;h.arc(f,e,o/2,0,t,!0);h.closePath();h.stroke();h.restore();break;case"chrome":v=[0,.09,.12,.16,.25,.29,.33,.38,.48,.52,.63,.68,.8,.83,.87,.97,1];y=[new n(255,255,255,1),new n(255,255,255,1),new n(136,136,138,1),new n(164,185,190,1),new n(158,179,182,1),new n(112,112,112,1),new n(221,227,227,1),new n(155,176,179,1),new n(156,176,177,1),new n(254,255,255,1),new n(255,255,255,1),new n(156,180,180,1),new n(198,209,211,1),new n(246,248,247,1),new n(204,216,216,1),new n(164,188,190,1),new n(255,255,255,1)];h.save();h.arc(f,e,o*.990654/2,0,t,!0);h.clip();l=o*.495327;a=o*.42056;c=new at(v,y);c.fillCircle(h,f,e,a,l);h.strokeStyle="#848484";h.strokeStyle="rgba(132, 132, 132, 0.8)";h.beginPath();h.lineWidth=o/90;h.arc(f,e,o/2,0,t,!0);h.closePath();h.stroke();h.restore()}h.fillStyle="rgb(191, 191, 191)";h.beginPath();h.arc(f,e,o*.841121/2,0,t,!0);h.closePath();h.fill();h.globalCompositeOperation="destination-out";h.beginPath();h.arc(f,e,o*.83/2,0,t,!0);h.closePath();h.fill();g.cache[w]=p}return i.drawImage(g.cache[w],0,0),this};g.cache={};nt=function(i,u,f,e,o,s){var w,h,l,d,g,a=o*.831775/2,tt,it,rt,p,y,v,ut,b,k=o.toString()+s+u.name;if(!nt.cache[k]){if(w=r(o,s),h=w.getContext("2d"),h.beginPath(),h.arc(f,e,a,0,t,!0),h.closePath(),u.name==="CARBON"||u.name==="PUNCHED_SHEET"||u.name==="BRUSHED_METAL"||u.name==="BRUSHED_STAINLESS")u.name==="CARBON"&&(h.fillStyle=h.createPattern(wi,"repeat"),h.fill()),u.name==="PUNCHED_SHEET"&&(h.fillStyle=h.createPattern(bi,"repeat"),h.fill()),l=h.createLinearGradient(a,0,o-a,0),l.addColorStop(0,"rgba(0, 0, 0, 0.25)"),l.addColorStop(.5,"rgba(0, 0, 0, 0)"),l.addColorStop(1,"rgba(0, 0, 0, 0.25)"),h.fillStyle=l,h.beginPath(),h.arc(f,e,a,0,t,!0),h.closePath(),h.fill(),(u.name==="BRUSHED_METAL"||u.name==="BRUSHED_STAINLESS")&&(tt=u.name==="BRUSHED_METAL"?!0:!1,it=parseInt(u.gradientStop.getHexColor().substr(-6),16),rt=ki(it,5,.1,tt,.5),h.fillStyle=h.createPattern(rt.fill(0,0,o,s),"no-repeat"),h.fill());else if(u.name==="STAINLESS"||u.name==="TURNED"){if(d=[0,.03,.1,.14,.24,.33,.38,.5,.62,.67,.76,.81,.85,.97,1],g=[new n("#FDFDFD"),new n("#FDFDFD"),new n("#B2B2B4"),new n("#ACACAE"),new n("#FDFDFD"),new n("#8E8E8E"),new n("#8E8E8E"),new n("#FDFDFD"),new n("#8E8E8E"),new n("#8E8E8E"),new n("#FDFDFD"),new n("#ACACAE"),new n("#B2B2B4"),new n("#FDFDFD"),new n("#FDFDFD")],l=new at(d,g),l.fillCircle(h,f,e,0,a),u.name==="TURNED"){for(p=a,y=p*.55,v=c*(500/p),h.save(),h.beginPath(),h.arc(f,e,p,0,t),h.closePath(),h.clip(),h.lineWidth=.5,ut=t-v*.3,b=0;b0&&i.width>0&&(n.save(),n.beginPath(),n.arc(r,u,f*.831775/2,0,t,!0),n.clip(),n.drawImage(i,h,c,o,s),n.restore()),this};tt=function(n,t,i,u,f,e,o,s,h){var b,c,v=Math.ceil(u*.084112),y=i*.5-v/2,p=u*.5-v/2,d=i*.008,a,w,k=t.type+i+u+f+(e!==undefined?e.type:"-")+(o!==undefined?o.style:"-")+(h!==undefined?h.type:"-");if(!tt.cache[k]){b=r(i,u);c=b.getContext("2d");f&&(c.shadowColor="rgba(0, 0, 0, 0.8)",c.shadowOffsetX=c.shadowOffsetY=d,c.shadowBlur=d*2,s===steelseries.GaugeType.TYPE5?steelseries.Orientation.WEST===h?(y=i*.733644-v/2,c.drawImage(l(v,e,o),y,p)):steelseries.Orientation.EAST===h?(y=i*(1-.733644)-v/2,c.drawImage(l(v,e,o),y,p)):(p=u*.733644-v/2,c.drawImage(l(v,e,o),y,u*.6857)):c.drawImage(l(v,e,o),y,p),c.shadowOffsetX=c.shadowOffsetY=0,c.shadowBlur=0);switch(t.type){case"type2":c.beginPath();c.moveTo(i*.135514,u*.696261);c.bezierCurveTo(i*.214953,u*.588785,i*.317757,u*.5,i*.462616,u*.425233);c.bezierCurveTo(i*.612149,u*.345794,i*.733644,u*.317757,i*.873831,u*.322429);c.bezierCurveTo(i*.766355,u*.112149,i*.528037,u*.023364,i*.313084,u*.130841);c.bezierCurveTo(i*.09813,u*.238317,i*.028037,u*.485981,i*.135514,u*.696261);c.closePath();a=c.createLinearGradient(.313084*i,.135514*u,.495528*i,.493582*u);a.addColorStop(0,"rgba(255, 255, 255, 0.275)");a.addColorStop(1,"rgba(255, 255, 255, 0.015)");break;case"type3":c.beginPath();c.moveTo(i*.084112,u*.509345);c.bezierCurveTo(i*.21028,u*.556074,i*.462616,u*.560747,i*.5,u*.560747);c.bezierCurveTo(i*.537383,u*.560747,i*.794392,u*.560747,i*.915887,u*.509345);c.bezierCurveTo(i*.915887,u*.2757,i*.738317,u*.084112,i*.5,u*.084112);c.bezierCurveTo(i*.261682,u*.084112,i*.084112,u*.2757,i*.084112,u*.509345);c.closePath();a=c.createLinearGradient(0,.093457*u,0,.556073*u);a.addColorStop(0,"rgba(255, 255, 255, 0.275)");a.addColorStop(1,"rgba(255, 255, 255, 0.015)");break;case"type4":c.beginPath();c.moveTo(i*.67757,u*.24299);c.bezierCurveTo(i*.771028,u*.308411,i*.822429,u*.411214,i*.813084,u*.528037);c.bezierCurveTo(i*.799065,u*.654205,i*.719626,u*.757009,i*.593457,u*.799065);c.bezierCurveTo(i*.485981,u*.831775,i*.369158,u*.808411,i*.285046,u*.728971);c.bezierCurveTo(i*.2757,u*.719626,i*.252336,u*.714953,i*.233644,u*.728971);c.bezierCurveTo(i*.214953,u*.747663,i*.219626,u*.771028,i*.228971,u*.7757);c.bezierCurveTo(i*.331775,u*.878504,i*.476635,u*.915887,i*.616822,u*.869158);c.bezierCurveTo(i*.771028,u*.822429,i*.873831,u*.691588,i*.88785,u*.53271);c.bezierCurveTo(i*.897196,u*.38785,i*.836448,u*.257009,i*.719626,u*.182242);c.bezierCurveTo(i*.705607,u*.172897,i*.682242,u*.163551,i*.663551,u*.186915);c.bezierCurveTo(i*.654205,u*.205607,i*.668224,u*.238317,i*.67757,u*.24299);c.closePath();a=c.createRadialGradient(.5*i,.5*u,0,.5*i,.5*u,.38785*i);a.addColorStop(0,"rgba(255, 255, 255, 0)");a.addColorStop(.82,"rgba(255, 255, 255, 0)");a.addColorStop(.83,"rgba(255, 255, 255, 0)");a.addColorStop(1,"rgba(255, 255, 255, 0.15)");c.beginPath();c.moveTo(i*.261682,u*.224299);c.bezierCurveTo(i*.285046,u*.238317,i*.252336,u*.285046,i*.24299,u*.317757);c.bezierCurveTo(i*.24299,u*.350467,i*.271028,u*.383177,i*.271028,u*.397196);c.bezierCurveTo(i*.2757,u*.415887,i*.261682,u*.457943,i*.238317,u*.509345);c.bezierCurveTo(i*.224299,u*.542056,i*.17757,u*.612149,i*.158878,u*.612149);c.bezierCurveTo(i*.144859,u*.612149,i*.088785,u*.546728,i*.130841,u*.369158);c.bezierCurveTo(i*.140186,u*.336448,i*.214953,u*.200934,i*.261682,u*.224299);c.closePath();w=c.createLinearGradient(.130841*i,.369158*u,.273839*i,.412877*u);w.addColorStop(0,"rgba(255, 255, 255, 0.275)");w.addColorStop(1,"rgba(255, 255, 255, 0.015)");c.fillStyle=w;c.fill();break;case"type5":c.beginPath();c.moveTo(i*.084112,u*.5);c.bezierCurveTo(i*.084112,u*.271028,i*.271028,u*.084112,i*.5,u*.084112);c.bezierCurveTo(i*.700934,u*.084112,i*.864485,u*.224299,i*.906542,u*.411214);c.bezierCurveTo(i*.911214,u*.439252,i*.911214,u*.518691,i*.845794,u*.537383);c.bezierCurveTo(i*.794392,u*.546728,i*.551401,u*.411214,i*.392523,u*.457943);c.bezierCurveTo(i*.168224,u*.509345,i*.135514,u*.7757,i*.093457,u*.593457);c.bezierCurveTo(i*.088785,u*.560747,i*.084112,u*.53271,i*.084112,u*.5);c.closePath();a=c.createLinearGradient(0,.084112*u,0,.644859*u);a.addColorStop(0,"rgba(255, 255, 255, 0.275)");a.addColorStop(1,"rgba(255, 255, 255, 0.015)");break;case"type1":default:c.beginPath();c.moveTo(i*.084112,u*.509345);c.bezierCurveTo(i*.205607,u*.448598,i*.336448,u*.415887,i*.5,u*.415887);c.bezierCurveTo(i*.672897,u*.415887,i*.789719,u*.443925,i*.915887,u*.509345);c.bezierCurveTo(i*.915887,u*.2757,i*.738317,u*.084112,i*.5,u*.084112);c.bezierCurveTo(i*.261682,u*.084112,i*.084112,u*.2757,i*.084112,u*.509345);c.closePath();a=c.createLinearGradient(0,.088785*u,0,.490654*u);a.addColorStop(0,"rgba(255, 255, 255, 0.275)");a.addColorStop(1,"rgba(255, 255, 255, 0.015)")}c.fillStyle=a;c.fill();tt.cache[k]=b}return n.drawImage(tt.cache[k],0,0),this};tt.cache={};l=function(n,i,u){var h,f,o=n/2,s=n/2,e,c=n.toString()+i.type+u.style;if(!l.cache[c]){h=r(n*1.18889,n*1.18889);f=h.getContext("2d");switch(i.type){case"metalKnob":f.beginPath();f.moveTo(0,n*.5);f.bezierCurveTo(0,n*.222222,n*.222222,0,n*.5,0);f.bezierCurveTo(n*.777777,0,n,n*.222222,n,n*.5);f.bezierCurveTo(n,n*.777777,n*.777777,n,n*.5,n);f.bezierCurveTo(n*.222222,n,0,n*.777777,0,n*.5);f.closePath();e=f.createLinearGradient(0,0,0,n);e.addColorStop(0,"rgb(92, 95, 101)");e.addColorStop(.47,"rgb(46, 49, 53)");e.addColorStop(1,"rgb(22, 23, 26)");f.fillStyle=e;f.fill();f.beginPath();f.moveTo(n*.055555,n*.5);f.bezierCurveTo(n*.055555,n*.277777,n*.277777,n*.055555,n*.5,n*.055555);f.bezierCurveTo(n*.722222,n*.055555,n*.944444,n*.277777,n*.944444,n*.5);f.bezierCurveTo(n*.944444,n*.722222,n*.722222,n*.944444,n*.5,n*.944444);f.bezierCurveTo(n*.277777,n*.944444,n*.055555,n*.722222,n*.055555,n*.5);f.closePath();e=f.createLinearGradient(0,.055555*n,0,.944443*n);switch(u.style){case"black":e.addColorStop(0,"rgb(43, 42, 47)");e.addColorStop(1,"rgb(26, 27, 32)");break;case"brass":e.addColorStop(0,"rgb(150, 110, 54)");e.addColorStop(1,"rgb(124, 95, 61)");break;case"silver":default:e.addColorStop(0,"rgb(204, 204, 204)");e.addColorStop(1,"rgb(87, 92, 98)")}f.fillStyle=e;f.fill();f.beginPath();f.moveTo(n*.777777,n*.833333);f.bezierCurveTo(n*.722222,n*.722222,n*.611111,n*.666666,n*.5,n*.666666);f.bezierCurveTo(n*.388888,n*.666666,n*.277777,n*.722222,n*.222222,n*.833333);f.bezierCurveTo(n*.277777,n*.888888,n*.388888,n*.944444,n*.5,n*.944444);f.bezierCurveTo(n*.611111,n*.944444,n*.722222,n*.888888,n*.777777,n*.833333);f.closePath();e=f.createRadialGradient(.555555*n,.944444*n,0,.555555*n,.944444*n,.388888*n);e.addColorStop(0,"rgba(255, 255, 255, 0.6)");e.addColorStop(1,"rgba(255, 255, 255, 0)");f.fillStyle=e;f.fill();f.beginPath();f.moveTo(n*.944444,n*.277777);f.bezierCurveTo(n*.833333,n*.111111,n*.666666,0,n*.5,0);f.bezierCurveTo(n*.333333,0,n*.166666,n*.111111,n*.055555,n*.277777);f.bezierCurveTo(n*.166666,n*.333333,n*.333333,n*.388888,n*.5,n*.388888);f.bezierCurveTo(n*.666666,n*.388888,n*.833333,n*.333333,n*.944444,n*.277777);f.closePath();e=f.createRadialGradient(.5*n,0,0,.5*n,0,.583333*n);e.addColorStop(0,"rgba(255, 255, 255, 0.749019)");e.addColorStop(1,"rgba(255, 255, 255, 0)");f.fillStyle=e;f.fill();f.beginPath();f.moveTo(n*.277777,n*.555555);f.bezierCurveTo(n*.277777,n*.388888,n*.388888,n*.277777,n*.5,n*.277777);f.bezierCurveTo(n*.611111,n*.277777,n*.777777,n*.388888,n*.777777,n*.555555);f.bezierCurveTo(n*.777777,n*.666666,n*.611111,n*.777777,n*.5,n*.777777);f.bezierCurveTo(n*.388888,n*.777777,n*.277777,n*.666666,n*.277777,n*.555555);f.closePath();e=f.createLinearGradient(0,.277777*n,0,.722221*n);e.addColorStop(0,"#000000");e.addColorStop(1,"rgb(204, 204, 204)");f.fillStyle=e;f.fill();f.beginPath();f.moveTo(n*.333333,n*.555555);f.bezierCurveTo(n*.333333,n*.444444,n*.388888,n*.333333,n*.5,n*.333333);f.bezierCurveTo(n*.611111,n*.333333,n*.722222,n*.444444,n*.722222,n*.555555);f.bezierCurveTo(n*.722222,n*.611111,n*.611111,n*.722222,n*.5,n*.722222);f.bezierCurveTo(n*.388888,n*.722222,n*.333333,n*.611111,n*.333333,n*.555555);f.closePath();e=f.createLinearGradient(0,.333333*n,0,.666666*n);e.addColorStop(0,"rgb(10, 9, 1)");e.addColorStop(1,"rgb(42, 41, 37)");f.fillStyle=e;f.fill();break;case"standardKnob":e=f.createLinearGradient(0,0,0,n);e.addColorStop(0,"rgb(180, 180, 180)");e.addColorStop(.46,"rgb(63, 63, 63)");e.addColorStop(1,"rgb(40, 40, 40)");f.fillStyle=e;f.beginPath();f.arc(o,s,n/2,0,t,!0);f.closePath();f.fill();e=f.createLinearGradient(0,n-n*.77,0,n-n*.77+n*.77);switch(u.style){case"black":e.addColorStop(0,"rgb(191, 191, 191)");e.addColorStop(.5,"rgb(45, 44, 49)");e.addColorStop(1,"rgb(125, 126, 128)");break;case"brass":e.addColorStop(0,"rgb(223, 208, 174)");e.addColorStop(.5,"rgb(123, 95, 63)");e.addColorStop(1,"rgb(207, 190, 157)");break;case"silver":default:e.addColorStop(0,"rgb(215, 215, 215)");e.addColorStop(.5,"rgb(116, 116, 116)");e.addColorStop(1,"rgb(215, 215, 215)")}f.fillStyle=e;f.beginPath();f.arc(o,s,n*.77/2,0,t,!0);f.closePath();f.fill();e=f.createRadialGradient(o,s,0,o,s,n*.77/2);e.addColorStop(0,"rgba(0, 0, 0, 0)");e.addColorStop(.75,"rgba(0, 0, 0, 0)");e.addColorStop(.76,"rgba(0, 0, 0, 0.01)");e.addColorStop(1,"rgba(0, 0, 0, 0.2)");f.fillStyle=e;f.beginPath();f.arc(o,s,n*.77/2,0,t,!0);f.closePath();f.fill()}l.cache[c]=h}return l.cache[c]};l.cache={};a=function(n,i,f){var c,e,s=2*Math.round(n/4),h=2*Math.round(n/4),o,l=n.toString()+i+f.outerColor_ON;if(!a.cache[l]){c=r(n,n);e=c.getContext("2d");switch(i){case 0:o=e.createRadialGradient(s,h,0,s,h,n*.5/2);o.addColorStop(0,f.innerColor1_OFF);o.addColorStop(.2,f.innerColor2_OFF);o.addColorStop(1,f.outerColor_OFF);e.fillStyle=o;e.beginPath();e.arc(s,h,n*.5/2,0,t,!0);e.closePath();e.fill();o=e.createRadialGradient(s,h,0,s,h,n*.5/2);o.addColorStop(0,"rgba(0, 0, 0, 0)");o.addColorStop(.8,"rgba(0, 0, 0, 0)");o.addColorStop(1,"rgba(0, 0, 0, 0.4)");e.fillStyle=o;e.beginPath();e.arc(s,h,n*.5/2,0,t,!0);e.closePath();e.fill();o=e.createLinearGradient(0,.35*n,0,.35*n+.15*n);o.addColorStop(0,"rgba(255, 255, 255, 0.4)");o.addColorStop(1,"rgba(255, 255, 255, 0)");e.fillStyle=o;e.beginPath();e.arc(s,.35*n+.2*n/2,n*.2,0,t,!0);e.closePath();e.fill();break;case 1:o=e.createRadialGradient(s,h,0,s,h,n*.5/2);o.addColorStop(0,f.innerColor1_ON);o.addColorStop(.2,f.innerColor2_ON);o.addColorStop(1,f.outerColor_ON);e.fillStyle=o;e.beginPath();e.arc(s,h,n*.5/2,0,t,!0);e.closePath();e.fill();o=e.createRadialGradient(s,h,0,s,h,n*.5/2);o.addColorStop(0,"rgba(0, 0, 0, 0)");o.addColorStop(.8,"rgba(0, 0, 0, 0)");o.addColorStop(1,"rgba(0, 0, 0, 0.4)");e.fillStyle=o;e.beginPath();e.arc(s,h,n*.5/2,0,t,!0);e.closePath();e.fill();o=e.createLinearGradient(0,.35*n,0,.35*n+.15*n);o.addColorStop(0,"rgba(255, 255, 255, 0.4)");o.addColorStop(1,"rgba(255, 255, 255, 0)");e.fillStyle=o;e.beginPath();e.arc(s,.35*n+.2*n/2,n*.2,0,t,!0);e.closePath();e.fill();o=e.createRadialGradient(s,h,0,s,h,n/2);o.addColorStop(0,u(f.coronaColor,0));o.addColorStop(.6,u(f.coronaColor,.4));o.addColorStop(.7,u(f.coronaColor,.25));o.addColorStop(.8,u(f.coronaColor,.15));o.addColorStop(.85,u(f.coronaColor,.05));o.addColorStop(1,u(f.coronaColor,0));e.fillStyle=o;e.beginPath();e.arc(s,h,n/2,0,t,!0);e.closePath();e.fill()}a.cache[l]=c}return a.cache[l]};a.cache={};it=function(n,t,i){var e,f,o=0,v=n,c=t,l=Math.min(n,t)*.095,u,s=1,y=n-2,a=t-2,p=l-1,h=n.toString()+t+JSON.stringify(i);return it.cache[h]||(e=r(n,t),f=e.getContext("2d"),u=f.createLinearGradient(0,o,0,o+c),u.addColorStop(0,"#4c4c4c"),u.addColorStop(.08,"#666666"),u.addColorStop(.92,"#666666"),u.addColorStop(1,"#e6e6e6"),f.fillStyle=u,dt(f,0,o,v,c,l),f.fill(),u=f.createLinearGradient(0,s,0,s+a),u.addColorStop(0,i.gradientStartColor),u.addColorStop(.03,i.gradientFraction1Color),u.addColorStop(.49,i.gradientFraction2Color),u.addColorStop(.5,i.gradientFraction3Color),u.addColorStop(1,i.gradientStopColor),f.fillStyle=u,dt(f,1,s,y,a,p),f.fill(),it.cache[h]=e),it.cache[h]};it.cache={};et=function(n,t,i,r){var f,u,e=n.toString()+t+i+r;return et.cache[e]||(f=d.createElement("canvas"),u=f.getContext("2d"),f.width=n,f.height=n,u.fillStyle=t,i?(u.beginPath(),u.moveTo(n*.5,n),u.lineTo(0,0),u.lineTo(n,0),u.closePath(),u.fill()):r?(u.beginPath(),u.moveTo(n,n*.5),u.lineTo(0,0),u.lineTo(0,n),u.closePath(),u.fill()):(u.beginPath(),u.moveTo(n*.5,0),u.lineTo(n,n),u.lineTo(0,n),u.closePath(),u.fill()),et.cache[e]=f),et.cache[e]};et.cache={};w=function(n,i,f){var o=n*2,h,e,s,c=i.state+n+JSON.stringify(f),l=function(){var r=f[0];i.state==="up"?(s=e.createRadialGradient(.5*n,.2*o,0,.5*n,.2*o,.5*n),s.addColorStop(0,r.innerColor1_ON),s.addColorStop(.2,r.innerColor2_ON),s.addColorStop(1,r.outerColor_ON)):(s=e.createLinearGradient(0,0,0,.5*o),s.addColorStop(0,"#323232"),s.addColorStop(1,"#5c5c5c"));e.fillStyle=s;e.beginPath();e.moveTo(.5*n,0);e.lineTo(n,.2*o);e.lineTo(.752*n,.2*o);e.lineTo(.752*n,.37*o);e.lineTo(.252*n,.37*o);e.lineTo(.252*n,.2*o);e.lineTo(0,.2*o);e.closePath();e.fill();i.state!=="up"?(e.strokeStyle="rgba(0, 0, 0, 0.4)",e.beginPath(),e.moveTo(0,.2*o),e.lineTo(.5*n,0),e.lineTo(n,.2*o),e.moveTo(.252*n,.2*o),e.lineTo(.252*n,.37*o),e.stroke(),e.strokeStyle="rgba(255, 255, 255, 0.3)",e.beginPath(),e.moveTo(.252*n,.37*o),e.lineTo(.752*n,.37*o),e.lineTo(.752*n,.2*o),e.lineTo(n,.2*o),e.stroke()):(s=e.createRadialGradient(.5*n,.2*o,0,.5*n,.2*o,.7*n),s.addColorStop(0,u(r.coronaColor,0)),s.addColorStop(.5,u(r.coronaColor,.3)),s.addColorStop(.7,u(r.coronaColor,.2)),s.addColorStop(.8,u(r.coronaColor,.1)),s.addColorStop(.85,u(r.coronaColor,.05)),s.addColorStop(1,u(r.coronaColor,0)),e.fillStyle=s,e.beginPath(),e.arc(.5*n,.2*o,.7*n,0,t,!0),e.closePath(),e.fill())},a=function(){var r=f[1];e.beginPath();i.state==="steady"?(s=r.outerColor_ON,e.fillStyle=s,e.rect(.128*n,.41*o,.744*n,.074*o),e.rect(.128*n,.516*o,.744*n,.074*o),e.closePath(),e.fill()):(s=e.createLinearGradient(0,.41*o,0,.41*o+.074*o),s.addColorStop(0,"#323232"),s.addColorStop(1,"#5c5c5c"),e.fillStyle=s,e.rect(.128*n,.41*o,.744*n,.074*o),e.closePath(),e.fill(),s=e.createLinearGradient(0,.516*o,0,.516*o+.074*o),s.addColorStop(0,"#323232"),s.addColorStop(1,"#5c5c5c"),e.fillStyle=s,e.rect(.128*n,.516*o,.744*n,.074*o),e.closePath(),e.fill());i.state!=="steady"?(e.strokeStyle="rgba(0, 0, 0, 0.4)",e.beginPath(),e.moveTo(.128*n,.41*o+.074*o),e.lineTo(.128*n,.41*o),e.lineTo(.128*n+.744*n,.41*o),e.stroke(),e.beginPath(),e.moveTo(.128*n,.516*o+.074*o),e.lineTo(.128*n,.516*o),e.lineTo(.128*n+.744*n,.516*o),e.stroke(),e.strokeStyle="rgba(255, 255, 255, 0.3)",e.beginPath(),e.moveTo(.128*n+.744*n,.41*o),e.lineTo(.128*n+.744*n,.41*o+.074*o),e.lineTo(.128*n,.41*o+.074*o),e.stroke(),e.beginPath(),e.moveTo(.128*n+.744*n,.516*o),e.lineTo(.128*n+.744*n,.516*o+.074*o),e.lineTo(.128*n,.516*o+.074*o),e.stroke()):(s=e.createRadialGradient(.5*n,.5*o,0,.5*n,.5*o,.7*n),s.addColorStop(0,u(r.coronaColor,0)),s.addColorStop(.5,u(r.coronaColor,.3)),s.addColorStop(.7,u(r.coronaColor,.2)),s.addColorStop(.8,u(r.coronaColor,.1)),s.addColorStop(.85,u(r.coronaColor,.05)),s.addColorStop(1,u(r.coronaColor,0)),e.fillStyle=s,e.beginPath(),e.arc(.5*n,.5*o,.7*n,0,t,!0),e.closePath(),e.fill())},v=function(){var r=f[2];i.state==="down"?(s=e.createRadialGradient(.5*n,.8*o,0,.5*n,.8*o,.5*n),s.addColorStop(0,r.innerColor1_ON),s.addColorStop(.2,r.innerColor2_ON),s.addColorStop(1,r.outerColor_ON)):(s=e.createLinearGradient(0,.63*o,0,o),s.addColorStop(0,"#323232"),s.addColorStop(1,"#5c5c5c"));e.beginPath();e.fillStyle=s;e.moveTo(.5*n,o);e.lineTo(n,.8*o);e.lineTo(.725*n,.8*o);e.lineTo(.725*n,.63*o);e.lineTo(.252*n,.63*o);e.lineTo(.252*n,.8*o);e.lineTo(0,.8*o);e.closePath();e.fill();i.state!=="down"?(e.strokeStyle="rgba(0, 0, 0, 0.4)",e.beginPath(),e.moveTo(0,.8*o),e.lineTo(.252*n,.8*o),e.moveTo(.252*n,.63*o),e.lineTo(.752*n,.63*o),e.stroke(),e.beginPath(),e.moveTo(.752*n,.8*o),e.lineTo(n,.8*o),e.stroke(),e.strokeStyle="rgba(255, 255, 255, 0.3)",e.beginPath(),e.moveTo(0,.8*o),e.lineTo(.5*n,o),e.lineTo(n,.8*o),e.stroke(),e.beginPath(),e.moveTo(.752*n,.8*o),e.lineTo(.752*n,.63*o),e.stroke()):(s=e.createRadialGradient(.5*n,.8*o,0,.5*n,.8*o,.7*n),s.addColorStop(0,u(r.coronaColor,0)),s.addColorStop(.5,u(r.coronaColor,.3)),s.addColorStop(.7,u(r.coronaColor,.2)),s.addColorStop(.8,u(r.coronaColor,.1)),s.addColorStop(.85,u(r.coronaColor,.05)),s.addColorStop(1,u(r.coronaColor,0)),e.fillStyle=s,e.beginPath(),e.arc(.5*n,.8*o,.7*n,0,t,!0),e.closePath(),e.fill())};if(!w.cache[c]){h=r(n*2,n*4);e=h.getContext("2d");e.translate(n*.5,n*.5);switch(i.state){case"up":v();a();l();break;case"steady":v();l();a();break;case"down":default:l();a();v()}w.cache[c]=h}return w.cache[c]};w.cache={};var fi=function(n,t,i,r,u,f,e,o,h,c){c=undefined===c?c=steelseries.GaugeType.TYPE1:c;n.save();n.textAlign=o?"center":"left";n.textBaseline="middle";n.strokeStyle=f.labelColor.getRgbaColor();n.fillStyle=f.labelColor.getRgbaColor();o?(n.font=.046728*t+"px "+s,n.fillText(r,t/2,i*.3,t*.3),n.fillText(u,t/2,i*.38,t*.3)):e?(n.font=.1*t+"px "+s,n.save(),n.translate(.671428*t,.1375*i),n.rotate(1.570796),n.fillText(r,0,0),n.translate(-.671428*t,-.1375*i),n.restore(),n.font=.071428*t+"px "+s,h?c.type==="type2"?(n.textAlign="right",n.fillText(u,.36*t,i*.79,t*.25)):n.fillText(u,.63*t,i*.85,t*.2):(n.textAlign="center",c.type==="type2"?n.fillText(u,t/2,i*.92,t*.2):n.fillText(u,t/2,i*.89,t*.2))):(n.font=.035*t+"px "+s,n.fillText(r,t*.15,i*.25,t*.3),n.font=.025*t+"px "+s,n.fillText(u,t*.0625,i*.7,t*.07));n.restore()},wi=ii(12,12,function(n){var u=n.canvas.width,t=n.canvas.height,f=0,r=0,i;n.save();n.save();n.beginPath();n.rect(0,0,u*.5,t*.5);n.closePath();n.restore();i=n.createLinearGradient(0,r*t,0,.5*t+r*t);i.addColorStop(0,"rgb(35, 35, 35)");i.addColorStop(1,"rgb(23, 23, 23)");n.fillStyle=i;n.fill();n.save();n.beginPath();n.rect(u*.083333,0,u*.333333,t*.416666);n.closePath();n.restore();f=.083333;r=0;i=n.createLinearGradient(0,r*t,0,.416666*t+r*t);i.addColorStop(0,"rgb(38, 38, 38)");i.addColorStop(1,"rgb(30, 30, 30)");n.fillStyle=i;n.fill();n.save();n.beginPath();n.rect(u*.5,t*.5,u*.5,t*.5);n.closePath();n.restore();f=.5;r=.5;i=n.createLinearGradient(0,r*t,0,.5*t+r*t);i.addColorStop(0,"rgb(35, 35, 35)");i.addColorStop(1,"rgb(23, 23, 23)");n.fillStyle=i;n.fill();n.save();n.beginPath();n.rect(u*.583333,t*.5,u*.333333,t*.416666);n.closePath();n.restore();f=.583333;r=.5;i=n.createLinearGradient(0,r*t,0,.416666*t+r*t);i.addColorStop(0,"rgb(38, 38, 38)");i.addColorStop(1,"rgb(30, 30, 30)");n.fillStyle=i;n.fill();n.save();n.beginPath();n.rect(u*.5,0,u*.5,t*.5);n.closePath();n.restore();f=.5;r=0;i=n.createLinearGradient(0,r*t,0,.5*t+r*t);i.addColorStop(0,"#303030");i.addColorStop(1,"rgb(40, 40, 40)");n.fillStyle=i;n.fill();n.save();n.beginPath();n.rect(u*.583333,t*.083333,u*.333333,t*.416666);n.closePath();n.restore();f=.583333;r=.083333;i=n.createLinearGradient(0,r*t,0,.416666*t+r*t);i.addColorStop(0,"rgb(53, 53, 53)");i.addColorStop(1,"rgb(45, 45, 45)");n.fillStyle=i;n.fill();n.save();n.beginPath();n.rect(0,t*.5,u*.5,t*.5);n.closePath();n.restore();f=0;r=.5;i=n.createLinearGradient(0,r*t,0,.5*t+r*t);i.addColorStop(0,"#303030");i.addColorStop(1,"#282828");n.fillStyle=i;n.fill();n.save();n.beginPath();n.rect(u*.083333,t*.583333,u*.333333,t*.416666);n.closePath();n.restore();f=.083333;r=.583333;i=n.createLinearGradient(0,r*t,0,.416666*t+r*t);i.addColorStop(0,"#353535");i.addColorStop(1,"#2d2d2d");n.fillStyle=i;n.fill();n.restore()}),bi=ii(15,15,function(n){var i=n.canvas.width,t=n.canvas.height,r;n.save();n.save();n.beginPath();n.rect(0,0,i,t);n.closePath();n.restore();n.fillStyle="#1D2123";n.fill();n.save();n.beginPath();n.moveTo(0,t*.266666);n.bezierCurveTo(0,t*.4,i*.066666,t*.466666,i*.2,t*.466666);n.bezierCurveTo(i*.333333,t*.466666,i*.4,t*.4,i*.4,t*.266666);n.bezierCurveTo(i*.4,t*.133333,i*.333333,t*.066666,i*.2,t*.066666);n.bezierCurveTo(i*.066666,t*.066666,0,t*.133333,0,t*.266666);n.closePath();r=n.createLinearGradient(0,.066666*t,0,.466666*t);r.addColorStop(0,"#000000");r.addColorStop(1,"#444444");n.fillStyle=r;n.fill();n.save();n.beginPath();n.moveTo(0,t*.2);n.bezierCurveTo(0,t*.333333,i*.066666,t*.4,i*.2,t*.4);n.bezierCurveTo(i*.333333,t*.4,i*.4,t*.333333,i*.4,t*.2);n.bezierCurveTo(i*.4,t*.066666,i*.333333,0,i*.2,0);n.bezierCurveTo(i*.066666,0,0,t*.066666,0,t*.2);n.closePath();n.fillStyle="#050506";n.fill();n.save();n.beginPath();n.moveTo(i*.466666,t*.733333);n.bezierCurveTo(i*.466666,t*.866666,i*.533333,t*.933333,i*.666666,t*.933333);n.bezierCurveTo(i*.8,t*.933333,i*.866666,t*.866666,i*.866666,t*.733333);n.bezierCurveTo(i*.866666,t*.6,i*.8,t*.533333,i*.666666,t*.533333);n.bezierCurveTo(i*.533333,t*.533333,i*.466666,t*.6,i*.466666,t*.733333);n.closePath();r=n.createLinearGradient(0,.533333*t,0,.933333*t);r.addColorStop(0,"#000000");r.addColorStop(1,"#444444");n.fillStyle=r;n.fill();n.save();n.beginPath();n.moveTo(i*.466666,t*.666666);n.bezierCurveTo(i*.466666,t*.8,i*.533333,t*.866666,i*.666666,t*.866666);n.bezierCurveTo(i*.8,t*.866666,i*.866666,t*.8,i*.866666,t*.666666);n.bezierCurveTo(i*.866666,t*.533333,i*.8,t*.466666,i*.666666,t*.466666);n.bezierCurveTo(i*.533333,t*.466666,i*.466666,t*.533333,i*.466666,t*.666666);n.closePath();n.fillStyle="#050506";n.fill();n.restore()}),ki=function(n,t,i,u,f){function e(n,t){return n+=(2*Math.random()-1)*t|0,n<0?0:n>255?255:n}function s(n){return n<0?0:n>255?255:n}function h(n,t,i,r,u,f){var o,v,e,a,s,h,c,l;for(u>=i&&(u=i-1),a=1/(u*2+1),s=0,v=0;vu&&(e=(s-u-1)*4,h-=n.data[e],c-=n.data[e+1],l-=n.data[e+2]),o+u>16&255,at=n>>8&255,vt=n&255,tt=0,it=255*i,yt,pt,wt,w,rt,ut,ft,et;if(c=Math.floor(c),l=Math.floor(l),a=Math.ceil(a),v=Math.ceil(v),p=a-c,b=v-l,st=r(p,b),g=st.getContext("2d"),y=g.createImageData(p,b),ht=g.createImageData(p,b),f!==0)for(ot=[],k=0;k0?(h(y,ht,p,b,t,ct),g.putImageData(ht,c,l)):g.putImageData(y,c,l),st},this},n=function(n,t,i,r){function s(){u=p(n,255);f=p(t,255);e=p(i,255);o=p(r,1)}var u,f,e,o;arguments.length===1?(i=parseInt(n.substr(5,2),16),t=parseInt(n.substr(3,2),16),n=parseInt(n.substr(1,2),16),r=1):arguments.length===3&&(r=1);s();this.getRed=function(){return u};this.setRed=function(n){u=p(n,255)};this.getGreen=function(){return f};this.setGreen=function(n){f=p(n,255)};this.getBlue=function(){return e};this.setBlue=function(n){e=p(n,255)};this.getAlpha=function(){return o};this.setAlpha=function(n){o=p(n,1)};this.getRgbaColor=function(){return"rgba("+u+", "+f+", "+e+", "+o+")"};this.getRgbColor=function(){return"rgb("+u+", "+f+", "+e+")"};this.getHexColor=function(){return"#"+u.toString(16)+f.toString(16)+e.toString(16)}},at=function(n,i){for(var f=n.length-1,u=0;u<=f;u++)n[u]=t*n[u]-o;this.fillCircle=function(t,e,o,s,h){var w,l=Math.ceil(h),c=l*2,a,tt,v,y,b,k,it,g,p,d,nt,rt;for(a=t.createImageData(c,c),tt=255,y=0;y=s){for(w=Math.atan2(b,k),u=0;u=n[u]&&wl&&v<=h-l&&a>c&&a=n[u]&&w1?1:n,t=0;tn&&f>=i[t]&&(f=i[t],o=t)}return s=(n-u)/(f-u),kt(r[e],r[o],1,s)};this.getStart=function(){return n};this.getEnd=function(){return t}};Math.log10=function(n){return Math.log(n)/Math.LN10};v=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(n){window.setTimeout(n,1e3/16)}}(),function(){e=function(n,t,i,r,u,f){this.gradientStart=n;this.gradientFraction=t;this.gradientStop=i;this.labelColor=r;this.symbolColor=u;this.name=f}}(),function(){f=function(n,t,i,r,u,f){this.gradientStartColor=n;this.gradientFraction1Color=t;this.gradientFraction2Color=i;this.gradientFraction3Color=r;this.gradientStopColor=u;this.textColor=f}}(),function(){y=function(n,t,i,r,u,f){this.veryDark=n;this.dark=t;this.medium=i;this.light=r;this.lighter=u;this.veryLight=f}}(),function(){ut=function(n,t,i,r,u,f,e){this.innerColor1_ON=n;this.innerColor2_ON=t;this.outerColor_ON=i;this.coronaColor=r;this.innerColor1_OFF=u;this.innerColor2_OFF=f;this.outerColor_OFF=e}}(),function(){ct=function(n){this.type=n}}(),function(){vt=function(n){this.type=n}}(),function(){ui=function(n){this.type=n}}(),function(){gt=function(n){this.style=n}}(),function(){b=function(n){this.design=n}}(),function(){h=function(n){this.type=n}}(),function(){lt=function(n){this.type=n}}(),function(){ni=function(n){this.format=n}}(),function(){ti=function(n){this.type=n}}(),function(){yt=function(n){this.state=n}}();var tr={DARK_GRAY:new e(new n(0,0,0,1),new n(51,51,51,1),new n(153,153,153,1),new n(255,255,255,1),new n(180,180,180,1),"DARK_GRAY"),SATIN_GRAY:new e(new n(45,57,57,1),new n(45,57,57,1),new n(45,57,57,1),new n(167,184,180,1),new n(137,154,150,1),"SATIN_GRAY"),LIGHT_GRAY:new e(new n(130,130,130,1),new n(181,181,181,1),new n(253,253,253,1),new n(0,0,0,1),new n(80,80,80,1),"LIGHT_GRAY"),WHITE:new e(new n(255,255,255,1),new n(255,255,255,1),new n(255,255,255,1),new n(0,0,0,1),new n(80,80,80,1),"WHITE"),BLACK:new e(new n(0,0,0,1),new n(0,0,0,1),new n(0,0,0,1),new n(255,255,255,1),new n(150,150,150,1),"BLACK"),BEIGE:new e(new n(178,172,150,1),new n(204,205,184,1),new n(231,231,214,1),new n(0,0,0,1),new n(80,80,80,1),"BEIGE"),BROWN:new e(new n(245,225,193,1),new n(245,225,193,1),new n(255,250,240,1),new n(109,73,47,1),new n(89,53,27,1),"BROWN"),RED:new e(new n(198,93,95,1),new n(212,132,134,1),new n(242,218,218,1),new n(0,0,0,1),new n(90,0,0,1),"RED"),GREEN:new e(new n(65,120,40,1),new n(129,171,95,1),new n(218,237,202,1),new n(0,0,0,1),new n(0,90,0,1),"GREEN"),BLUE:new e(new n(45,83,122,1),new n(115,144,170,1),new n(227,234,238,1),new n(0,0,0,1),new n(0,0,90,1),"BLUE"),ANTHRACITE:new e(new n(50,50,54,1),new n(47,47,51,1),new n(69,69,74,1),new n(250,250,250,1),new n(180,180,180,1),"ANTHRACITE"),MUD:new e(new n(80,86,82,1),new n(70,76,72,1),new n(57,62,58,1),new n(255,255,240,1),new n(225,225,210,1),"MUD"),PUNCHED_SHEET:new e(new n(50,50,54,1),new n(47,47,51,1),new n(69,69,74,1),new n(255,255,255,1),new n(180,180,180,1),"PUNCHED_SHEET"),CARBON:new e(new n(50,50,54,1),new n(47,47,51,1),new n(69,69,74,1),new n(255,255,255,1),new n(180,180,180,1),"CARBON"),STAINLESS:new e(new n(130,130,130,1),new n(181,181,181,1),new n(253,253,253,1),new n(0,0,0,1),new n(80,80,80,1),"STAINLESS"),BRUSHED_METAL:new e(new n(50,50,54,1),new n(47,47,51,1),new n(69,69,74,1),new n(0,0,0,1),new n(80,80,80,1),"BRUSHED_METAL"),BRUSHED_STAINLESS:new e(new n(50,50,54,1),new n(47,47,51,1),new n(110,110,112,1),new n(0,0,0,1),new n(80,80,80,1),"BRUSHED_STAINLESS"),TURNED:new e(new n(130,130,130,1),new n(181,181,181,1),new n(253,253,253,1),new n(0,0,0,1),new n(80,80,80,1),"TURNED")},ir={BEIGE:new f("#c8c8b1","rgb(241, 237, 207)","rgb(234, 230, 194)","rgb(225, 220, 183)","rgb(237, 232, 191)","#000000"),BLUE:new f("#ffffff","rgb(231, 246, 255)","rgb(170, 224, 255)","rgb(136, 212, 255)","rgb(192, 232, 255)","#124564"),ORANGE:new f("#ffffff","rgb(255, 245, 225)","rgb(255, 217, 147)","rgb(255, 201, 104)","rgb(255, 227, 173)","#503700"),RED:new f("#ffffff","rgb(255, 225, 225)","rgb(253, 152, 152)","rgb(252, 114, 115)","rgb(254, 178, 178)","#4f0c0e"),YELLOW:new f("#ffffff","rgb(245, 255, 186)","rgb(210, 255, 0)","rgb(158, 205, 0)","rgb(210, 255, 0)","#405300"),WHITE:new f("#ffffff","#ffffff","rgb(241, 246, 242)","rgb(229, 239, 244)","#ffffff","#000000"),GRAY:new f("#414141","rgb(117, 117, 117)","rgb(87, 87, 87)","#414141","rgb(81, 81, 81)","#ffffff"),BLACK:new f("#414141","#666666","#333333","#000000","#333333","#cccccc"),GREEN:new f("rgb(33, 67, 67)","rgb(33, 67, 67)","rgb(29, 58, 58)","rgb(28, 57, 57)","rgb(23, 46, 46)","rgba(0, 185, 165, 255)"),BLUE2:new f("rgb(0, 68, 103)","rgb(8, 109, 165)","rgb(0, 72, 117)","rgb(0, 72, 117)","rgb(0, 68, 103)","rgb(111, 182, 228)"),BLUE_BLACK:new f("rgb(22, 125, 212)","rgb(3, 162, 254)","rgb(3, 162, 254)","rgb(3, 162, 254)","rgb(11, 172, 244)","#000000"),BLUE_DARKBLUE:new f("rgb(18, 33, 88)","rgb(18, 33, 88)","rgb(19, 30, 90)","rgb(17, 31, 94)","rgb(21, 25, 90)","rgb(23, 99, 221)"),BLUE_GRAY:new f("rgb(135, 174, 255)","rgb(101, 159, 255)","rgb(44, 93, 255)","rgb(27, 65, 254)","rgb(12, 50, 255)","#b2b4ed"),STANDARD:new f("rgb(131, 133, 119)","rgb(176, 183, 167)","rgb(165, 174, 153)","rgb(166, 175, 156)","rgb(175, 184, 165)","rgb(35, 42, 52)"),STANDARD_GREEN:new f("#ffffff","rgb(219, 230, 220)","rgb(179, 194, 178)","rgb(153, 176, 151)","rgb(114, 138, 109)","#080C06"),BLUE_BLUE:new f("rgb(100, 168, 253)","rgb(100, 168, 253)","rgb(95, 160, 250)","rgb(80, 144, 252)","rgb(74, 134, 255)","#002cbb"),RED_DARKRED:new f("rgb(72, 36, 50)","rgb(185, 111, 110)","rgb(148, 66, 72)","rgb(83, 19, 20)","rgb(7, 6, 14)","#FE8B92"),DARKBLUE:new f("rgb(14, 24, 31)","rgb(46, 105, 144)","rgb(19, 64, 96)","rgb(6, 20, 29)","rgb(8, 9, 10)","#3DB3FF"),LILA:new f("rgb(175, 164, 255)","rgb(188, 168, 253)","rgb(176, 159, 255)","rgb(174, 147, 252)","rgb(168, 136, 233)","#076148"),BLACKRED:new f("rgb(8, 12, 11)","rgb(10, 11, 13)","rgb(11, 10, 15)","rgb(7, 13, 9)","rgb(9, 13, 14)","#B50026"),DARKGREEN:new f("rgb(25, 85, 0)","rgb(47, 154, 0)","rgb(30, 101, 0)","rgb(30, 101, 0)","rgb(25, 85, 0)","#233123"),AMBER:new f("rgb(182, 71, 0)","rgb(236, 155, 25)","rgb(212, 93, 5)","rgb(212, 93, 5)","rgb(182, 71, 0)","#593A0A"),LIGHTBLUE:new f("rgb(125, 146, 184)","rgb(197, 212, 231)","rgb(138, 155, 194)","rgb(138, 155, 194)","rgb(125, 146, 184)","#090051"),SECTIONS:new f("#b2b2b2","#ffffff","#c4c4c4","#c4c4c4","#b2b2b2","#000000")},rr={RED:new y(new n(82,0,0,1),new n(158,0,19,1),new n(213,0,25,1),new n(240,82,88,1),new n(255,171,173,1),new n(255,217,218,1)),GREEN:new y(new n(8,54,4,1),new n(0,107,14,1),new n(15,148,0,1),new n(121,186,37,1),new n(190,231,141,1),new n(234,247,218,1)),BLUE:new y(new n(0,11,68,1),new n(0,73,135,1),new n(0,108,201,1),new n(0,141,242,1),new n(122,200,255,1),new n(204,236,255,1)),ORANGE:new y(new n(118,83,30,1),new n(215,67,0,1),new n(240,117,0,1),new n(255,166,0,1),new n(255,255,128,1),new n(255,247,194,1)),YELLOW:new y(new n(41,41,0,1),new n(102,102,0,1),new n(177,165,0,1),new n(255,242,0,1),new n(255,250,153,1),new n(255,252,204,1)),CYAN:new y(new n(15,109,109,1),new n(0,109,144,1),new n(0,144,191,1),new n(0,174,239,1),new n(153,223,249,1),new n(204,239,252,1)),MAGENTA:new y(new n(98,0,114,1),new n(128,24,72,1),new n(191,36,107,1),new n(255,48,143,1),new n(255,172,210,1),new n(255,214,23,1)),WHITE:new y(new n(210,210,210,1),new n(220,220,220,1),new n(235,235,235,1),new n(255,255,255,1),new n(255,255,255,1),new n(255,255,255,1)),GRAY:new y(new n(25,25,25,1),new n(51,51,51,1),new n(76,76,76,1),new n(128,128,128,1),new n(204,204,204,1),new n(243,243,243,1)),BLACK:new y(new n(0,0,0,1),new n(5,5,5,1),new n(10,10,10,1),new n(15,15,15,1),new n(20,20,20,1),new n(25,25,25,1)),RAITH:new y(new n(0,32,65,1),new n(0,65,125,1),new n(0,106,172,1),new n(130,180,214,1),new n(148,203,242,1),new n(191,229,255,1)),GREEN_LCD:new y(new n(0,55,45,1),new n(15,109,93,1),new n(0,185,165,1),new n(48,255,204,1),new n(153,255,227,1),new n(204,255,241,1)),JUG_GREEN:new y(new n(0,56,0,1),new n(32,69,36,1),new n(50,161,0,1),new n(129,206,0,1),new n(190,231,141,1),new n(234,247,218,1))},ur={RED_LED:new ut("#FF9A89","#FF9A89","#FF3300","#FF8D70","#7E1C00","#7E1C00","#641B00"),GREEN_LED:new ut("#9AFF89","#9AFF89","#59FF2A","#A5FF00","#1C7E00","#1C7E00","#1B6400"),BLUE_LED:new ut("#899AFF","#899AFF","#0033FF","#708DFF","#001C7E","#001C7E","#001B64"),ORANGE_LED:new ut("#FEA23F","#FEA23F","#FD6C00","#FD6C00","#592800","#592800","#421F00"),YELLOW_LED:new ut("#FFFF62","#FFFF62","#FFFF00","#FFFF00","#6B6D00","#6B6D00","#515300"),CYAN_LED:new ut("#00FFFF","#00FFFF","#1BC3C3","#00FFFF","#083B3B","#083B3B","#052727"),MAGENTA_LED:new ut("#D300FF","#D300FF","#8600CB","#C300FF","#38004B","#38004B","#280035")},fr={TYPE1:new ct("type1"),TYPE2:new ct("type2"),TYPE3:new ct("type3"),TYPE4:new ct("type4"),TYPE5:new ct("type5")},er={NORTH:new vt("north"),SOUTH:new vt("south"),EAST:new vt("east"),WEST:new vt("west")},or={STANDARD_KNOB:new ui("standardKnob"),METAL_KNOB:new ui("metalKnob")},sr={BLACK:new gt("black"),BRASS:new gt("brass"),SILVER:new gt("silver")},hr={BLACK_METAL:new b("blackMetal"),METAL:new b("metal"),SHINY_METAL:new b("shinyMetal"),BRASS:new b("brass"),STEEL:new b("steel"),CHROME:new b("chrome"),GOLD:new b("gold"),ANTHRACITE:new b("anthracite"),TILTED_GRAY:new b("tiltedGray"),TILTED_BLACK:new b("tiltedBlack"),GLOSSY_METAL:new b("glossyMetal")},cr={TYPE1:new h("type1"),TYPE2:new h("type2"),TYPE3:new h("type3"),TYPE4:new h("type4"),TYPE5:new h("type5"),TYPE6:new h("type6"),TYPE7:new h("type7"),TYPE8:new h("type8"),TYPE9:new h("type9"),TYPE10:new h("type10"),TYPE11:new h("type11"),TYPE12:new h("type12"),TYPE13:new h("type13"),TYPE14:new h("type14"),TYPE15:new h("type15"),TYPE16:new h("type16")},lr={TYPE1:new lt("type1"),TYPE2:new lt("type2"),TYPE3:new lt("type3"),TYPE4:new lt("type4"),TYPE5:new lt("type5")},ar={STANDARD:new ni("standard"),FRACTIONAL:new ni("fractional"),SCIENTIFIC:new ni("scientific")},vr={NORMAL:new ti("normal"),HORIZONTAL:new ti("horizontal"),TANGENT:new ti("tangent")},yr={UP:new yt("up"),STEADY:new yt("steady"),DOWN:new yt("down"),OFF:new yt("off")};return{Radial:hi,RadialBargraph:ci,DisplaySingle:li,WindDirection:ai,Led:vi,Odometer:yi,drawFrame:g,drawBackground:nt,drawForeground:tt,rgbaColor:n,ConicalGradient:at,setAlpha:u,getColorFromFraction:kt,gradientWrapper:di,BackgroundColor:tr,LcdColor:ir,ColorDef:rr,LedColor:ur,GaugeType:fr,Orientation:er,FrameDesign:hr,PointerType:cr,ForegroundType:lr,KnobType:or,KnobStyle:sr,LabelNumberFormat:ar,TickLabelOrientation:vr,TrendState:yr,Section:gi}}() +/*!********************************************************************* +TERMS OF USE - EASING EQUATIONS +Open source under the BSD License. +Copyright (c) 2001 Robert Penner +JavaScript version copyright (C) 2006 by Philippe Maegerman +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of the author nor the names of contributors may +be used to endorse or promote products derived from this software +without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*****************************************/ +function Delegate(){}Delegate.create=function(n,t){for(var r=[],u=arguments.length,i=2;ithis.getDuration()?this.looping?(this.rewind(n-this._duration),this.update(),this.broadcastMessage("onMotionLooped",{target:this,type:"onMotionLooped"})):(this._time=this._duration,this.update(),this.stop(),this.broadcastMessage("onMotionFinished",{target:this,type:"onMotionFinished"})):n<0?(this.rewind(),this.update()):(this._time=n,this.update())},t.getTime=function(){return this._time},t.setDuration=function(n){this._duration=n===null||n<=0?1e5:n},t.getDuration=function(){return this._duration},t.setPosition=function(n){this.prevPos=this._pos;var t=this.suffixe!==""?this.suffixe:"";this.obj[this.prop]=Math.round(n)+t,this._pos=n,this.broadcastMessage("onMotionChanged",{target:this,type:"onMotionChanged"})},t.getPosition=function(n){return n===undefined&&(n=this._time),this.func(n,this.begin,this.change,this._duration)},t.setFinish=function(n){this.change=n-this.begin},t.getFinish=function(){return this.begin+this.change},t.init=function(n,t,i,r,u,f,e){arguments.length&&(this._listeners=[],this.addListener(this),e&&(this.suffixe=e),this.obj=n,this.prop=t,this.begin=r,this._pos=r,this.setDuration(f),i!==null&&i!==""&&(this.func=i),this.setFinish(u))},t.start=function(){this.rewind(),this.startEnterFrame(),this.broadcastMessage("onMotionStarted",{target:this,type:"onMotionStarted"})},t.rewind=function(n){this.stop(),this._time=n===undefined?0:n,this.fixTime(),this.update()},t.fforward=function(){this._time=this._duration,this.fixTime(),this.update()},t.update=function(){this.setPosition(this.getPosition(this._time))},t.startEnterFrame=function(){this.stopEnterFrame(),this.isPlaying=!0,this.onEnterFrame()},t.onEnterFrame=function(){this.isPlaying&&(this.nextFrame(),setTimeout(Delegate.create(this,this.onEnterFrame),25))},t.nextFrame=function(){this.setTime((this.getTimer()-this._startTime)/1e3)},t.stop=function(){this.stopEnterFrame(),this.broadcastMessage("onMotionStopped",{target:this,type:"onMotionStopped"})},t.stopEnterFrame=function(){this.isPlaying=!1},t.playing=function(){return this.isPlaying},t.continueTo=function(n,t){this.begin=this._pos,this.setFinish(n),this._duration!==undefined&&this.setDuration(t),this.start()},t.resume=function(){this.fixTime(),this.startEnterFrame(),this.broadcastMessage("onMotionResumed",{target:this,type:"onMotionResumed"})},t.yoyo=function(){this.continueTo(this.begin,this._time)},t.addListener=function(n){return this.removeListener(n),this._listeners.push(n)},t.removeListener=function(n){for(var t=this._listeners,i=t.length;i--;)if(t[i]===n)return t.splice(i,1),!0;return!1},t.broadcastMessage=function(){for(var i=[],r,t=this._listeners,u=t.length,n=0;n