(function(e){var f=new function(){this.Equipment=function(){this.category="Hardware";this.name="Equipment";this.subnavigationicon="sec-nav-equipment.png";var c=void 0;this.Init=function(){c=this;if(void 0==c||null==c)return!1;c.setCycleTime(2E3);c.setCommunicationObj(e.DevMan.getCommunicationModule(e.DevMan.CommunicationType.mdp));c.addParameter("CPU_Property_CPU_Frequency",!1);c.addParameter("CPU_Property_Current_CPU_Usage",!0);c.addParameter("CPU_Property_Current_CPU_Temperature",!0);winxp?(c.addParameter("Memory_Property_Program_Memory_Allocated_64",
!0),c.addParameter("Memory_Property_Program_Memory_Available_64",!0)):(c.addParameter("Memory_Property_Program_Memory_Allocated",!0),c.addParameter("Memory_Property_Program_Memory_Available",!0));c.addParameter("Memory_Property_Storage_Memory_Allocated_CE",!0);c.addParameter("Memory_Property_Storage_Memory_Available_CE",!0);c.addParameter("Memory_Property_Memory_Division",!0);c.addParameter("DisplayDevice_Property_DeviceName",!1);c.addParameter("DisplayDevice_Settings_Property_IDxActiveDisplayMode",
!0);c.addParameter("DisplayDevice_Modes_Property_Len",!1);c.addParameter("Fan_Property_AdapterName",!1);c.addParameter("Fan_Properties_Property_Speed",!0);c.addParameter("UPS_Information_Property_UPSModel",!1);c.addParameter("UPS_Information_Property_VendorName",!1);c.addParameter("UPS_Information_Property_Version",!1);c.addParameter("UPS_Information_Property_Revision",!1);c.addParameter("UPS_Information_Property_Build",!1);c.addParameter("UPS_Information_Property_SerialNumber",!1);c.addParameter("UPS_Information_Property_PowerStatus",
!0);c.addParameter("UPS_Information_Property_CommunicationStatus",!0);c.addParameter("UPS_Information_Property_BatteryStatus",!0);c.addParameter("UPS_Information_Property_BatteryCapacity",!0);c.addParameter("UPS_Information_Property_BatteryRuntime",!1);c.addParameter("UPS_Information_Property_PersistentPowerFailCount",!0);c.addParameter("UPS_Information_Property_PowerFailCounter",!0);c.addParameter("UPS_Information_Property_FanError",!0);c.addParameter("UPS_Information_Property_NoBattery",!0);c.addParameter("UPS_Information_Property_BatteryReplaceDate",
!1);c.addParameter("UPS_Information_Property_IntervalServiceStatus",!0);c.addParameter("UPS_GPIOPinInformation_Property_Address",!1);c.addParameter("UPS_GPIOPinInformation_Property_Offset",!1);c.addParameter("UPS_GPIOPinInformation_Property_Params",!1);c.setOnInitStaticPage(f);c.setOnDisplayValues(g);c.setOnWriteFailed(h);c.setOnWriteResult(k);return!0};var f=function(a){var b="";a[0].getHasValues()&&(b+="<h3>CPU</h3><table>",a[0].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Frequency (MHz)</td><td><div id="'+
a[0].parameterName+'"></div></td></tr> '),b+="</table>",b+="<br>");if(a[1].getHasValues()||a[2].getHasValues())b+='<div id="graphs_cpu_container" style="overflow:auto;min-width:250px;">',a[1].getHasValues()&&(b+='<div id="'+a[1].parameterName+'" style="float:left"></div>'),a[2].getHasValues()&&(b+='<div id="'+a[2].parameterName+'" style="float:left"></div>'),b+="</div>";if(winxp)a[3].getHasValues()&&a[4].getHasValues()&&-1!=a[3].values[0].data&&-1!=a[4].values[0].data&&(b+="<h3>Memory</h3>",b+='<div id="'+
a[3].parameterName+'"></div>');else if(a[3].getHasValues()&&a[4].getHasValues()||a[5].getHasValues()&&a[6].getHasValues())b+="<h3>Memory</h3>",b+='<div id="graphs_cpu_container" style="overflow:auto;min-width:250px;">',a[3].getHasValues()&&a[4].getHasValues()&&(b+='<div id="'+a[3].parameterName+'" style="float:left"></div>'),a[5].getHasValues()&&a[6].getHasValues()&&(b+='<div id="'+a[5].parameterName+'" style="float:left"></div>'),b+="</div>";a[7].getHasValues()&&(b+='<table style="margin-bottom: 5px"><tr>',
b+='<td class="td_trans"><h3>Memory Division</h3></td>',b+='<td class="td_Action_trans">'+(new ControlLib.SmallButton).Create("btnWriteMemoryDivisionSettings","save","Save Memory division")+(new ControlLib.SmallButton).Create("btnWriteMemoryDivisionSettings_Cancel","delete")+"</td>",b+="</tr></table>",b+="<table>",b+='<tr><td class="td_FirstColumn">Memory Division (%)</td><td>'+(new ControlLib.Textbox).Create(a[7].parameterName)+"</td></tr> ",b+="</table>",b+="<br>");if(a[8].getHasValues()&&a[9].getHasValues()&&
a[10].getHasValues()){for(var b=b+'<table style="margin-bottom: 5px"><tr>',b=b+'<td class="td_trans"><h3>Display Device</h3></td>',b=b+('<td class="td_Action_trans">'+(new ControlLib.SmallButton).Create("btnEditDispalyResolution","configure","Configure Display Resolutions")+"</td>"),b=b+"</tr></table>",b=b+"<table>",b=b+"<tr><th>Name</th><th>Resolution</th></tr>",d=0;d<a[8].moduleCount;d++)b+="<tr>",b+='<td class="td_FirstColumn"><div id="'+a[8].parameterName+d+'"></div></td>',b+='<td><div id="'+
a[9].parameterName+d+'"></div></td>',b+="</tr>";b+="</table>";b+="<br>"}if(a[11].getHasValues()||a[12].getHasValues()){for(var b=b+"<h3>FAN</h3>",b=b+"<table>",e=Math.max(a[11].moduleCount,a[12].moduleCount),d=0;d<e;d++)b+="<tr>",b+='<td class="td_FirstColumn"><div id="'+a[11].parameterName+d+'"></div></td>',b+='<td><div id="'+a[12].parameterName+d+'"></div></td>',b+="</tr>";b+="</table><br>"}if(a[13].getHasValues()||a[14].getHasValues()||a[15].getHasValues()||a[16].getHasValues()||a[17].getHasValues()||
a[18].getHasValues()||a[19].getHasValues()||a[20].getHasValues()||a[21].getHasValues()||a[22].getHasValues()||a[23].getHasValues()||a[24].getHasValues()||a[25].getHasValues()||a[26].getHasValues()||a[27].getHasValues()||a[28].getHasValues()||a[29].getHasValues()||a[30].getHasValues()||a[31].getHasValues())b+='<table style="margin-bottom: 5px"><tr>',b+='<td class="td_trans"><h3>UPS</h3></td>',b+='<td class="td_Action_trans">'+(new ControlLib.SmallButton).Create("btnTestCapacity","power","Test Capacity")+
"</td>",b+="</tr></table>",b+="<table>",a[13].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Model</td><td><div id="'+a[13].parameterName+'"></div></td></tr> '),a[14].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Vendor name</td><td><div id="'+a[14].parameterName+'"></div></td></tr> '),a[15].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Version</td><td><div id="'+a[15].parameterName+'"></div></td></tr> '),a[16].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Revision</td><td><div id="'+
a[16].parameterName+'"></div></td></tr> '),a[17].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Build</td><td><div id="'+a[17].parameterName+'"></div></td></tr> '),a[18].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Serialnumber</td><td><div id="'+a[18].parameterName+'"></div></td></tr> '),a[19].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Power status</td><td><div id="'+a[19].parameterName+'"></div></td></tr> '),a[20].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Communication status</td><td><div id="'+
a[20].parameterName+'"></div></td></tr> '),a[21].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Battery status</td><td><div id="'+a[21].parameterName+'"></div></td></tr> '),a[22].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Battery capacity (%)</td><td><div id="'+a[22].parameterName+'"></div></td></tr> '),a[23].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Battery runtime (s)</td><td><div id="'+a[23].parameterName+'"></div></td></tr> '),a[24].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Persistant power fail count</td><td><div id="'+
a[24].parameterName+'"></div></td></tr> '),a[25].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Power fail counter</td><td><div id="'+a[25].parameterName+'"></div></td></tr> '),a[26].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Fan Error</td><td><div id="'+a[26].parameterName+'"></div></td></tr> '),a[27].getHasValues()&&(b+='<tr><td class="td_FirstColumn">No battery</td><td><div id="'+a[27].parameterName+'"></div></td></tr> '),a[28].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Battery Replace Date</td><td><div id="'+
a[28].parameterName+'"></div></td></tr> '),a[29].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Interval Service Status</td><td><div id="'+a[29].parameterName+'"></div></td></tr> '),a[30].getHasValues()&&(b+='<tr><td class="td_FirstColumn">GPIO Pin address</td><td><div id="'+a[30].parameterName+'"></div></td></tr> '),a[31].getHasValues()&&(b+='<tr><td class="td_FirstColumn">GPIO Pin offset</td><td><div id="'+a[31].parameterName+'"></div></td></tr> '),a[32].getHasValues()&&(b+='<tr><td class="td_FirstColumn">GPIO Pin parameters</td><td><div id="'+
a[32].parameterName+'"></div></td></tr> '),b+="</table>",b+="<br>";b+='<div id="status"></div>';c.writeActivePage(b);a[7].getHasValues()&&(c.addLockListener(a[7].parameterName),c.setElementOnClick("btnWriteMemoryDivisionSettings",function(a){return function(){var b=[],d=[],e=[],f=c.getRequestParamIDs();c.isLocked(f[7].parameterName)&&(b.push("Memory_Property_Memory_Division"),d.push(a),e.push(c.getElementValue("Memory_Property_Memory_Division")));0<b.length&&(c.Write(b,d,e),Helper.ShowLoading())}}(0)),
c.setElementOnClick("btnWriteMemoryDivisionSettings_Cancel",function(a){return function(){c.removeLock("Memory_Property_Memory_Division")}}(0)));a[8].getHasValues()&&a[9].getHasValues()&&a[10].getHasValues()&&c.setElementOnClick("btnEditDispalyResolution",function(a){return function(){c.ChangePage("Software","Sys.Settings")}}(0));(a[13].getHasValues()||a[14].getHasValues()||a[15].getHasValues()||a[16].getHasValues()||a[17].getHasValues()||a[18].getHasValues()||a[19].getHasValues()||a[20].getHasValues()||
a[21].getHasValues()||a[22].getHasValues()||a[23].getHasValues()||a[24].getHasValues()||a[25].getHasValues()||a[26].getHasValues()||a[27].getHasValues()||a[28].getHasValues()||a[29].getHasValues()||a[30].getHasValues()||a[31].getHasValues())&&c.setElementOnClick("btnTestCapacity",function(a){return function(){var a=[],b=[],d=[];a.push("UPS_Information_Property_TestCapacity");b.push(0);d.push(1);c.Write(a,b,d);Helper.ShowLoading()}}(0));return!0},g=function(a){a[0].getHasValues()&&c.writeElement(a[0].parameterName,
a[0].values[0].data);a[1].getHasValues()&&c.writeElement(a[1].parameterName,(new ControlLib.Bargraph).CreateDefaultBar("res/modules/cpu/kachelicons-sw-groesse-1-cpu_32.png","Load","%",100,a[1].values[0].data));a[2].getHasValues()&&c.writeElement(a[2].parameterName,(new ControlLib.Bargraph).CreateDefaultBar("res/modules/cpu/kachelicons-sw-groesse-1-cpu_32.png","Temperature","\u00b0C",100,a[2].values[0].data));if(a[3].getHasValues()&&a[4].getHasValues())if(winxp){if(-1!=a[3].values[0].data&&-1!=a[4].values[0].data){var b=
a[3].values[0].data,d=a[4].values[0].data,d=b-d;c.writeElement(a[3].parameterName,(new ControlLib.Bargraph).CreateMemoryBar("res/modules/ram/kachelicons-sw-groesse-1-ram_32.png","RAM",b,d))}}else b=a[3].values[0].data,d=a[4].values[0].data,d=b-d,c.writeElement(a[3].parameterName,(new ControlLib.Bargraph).CreateMemoryBar("res/modules/ram/kachelicons-sw-groesse-1-ram_32.png","RAM",b,d));a[5].getHasValues()&&a[6].getHasValues()&&(b=a[5].values[0].data,d=a[6].values[0].data,d=b-d,c.writeElement(a[5].parameterName,
(new ControlLib.Bargraph).CreateMemoryBar("res/modules/ram/kachelicons-sw-groesse-1-ram_32.png","Storage",b,d)));a[7].getHasValues()&&c.setElementValue(a[7].parameterName,a[7].values[0].data);if(a[8].getHasValues()&&a[9].getHasValues()&&a[10].getHasValues())for(b=0;b<a[9].moduleCount;b++)c.writeElement(a[8].parameterName+b,a[8].values[b].data),d=a[9].values[b].data,d--,0<=d&&0<a[10].values[b].length&&a[10].values[b].length>d?c.writeElement(a[9].parameterName+b,a[10].values[b][d].data):c.writeElement(a[9].parameterName+
b,"None");if(a[11].getHasValues()||a[12].getHasValues())for(d=Math.max(a[11].moduleCount,a[12].moduleCount),b=0;b<d;b++)a[11].values.length>b&&c.writeElement(a[11].parameterName+b,a[11].values[b].getOutput()+" (rpm)"),a[12].values.length>b&&c.writeElement(a[12].parameterName+b,a[12].values[b].getOutput());a[13].getHasValues()&&c.writeElement(a[13].parameterName,a[13].values[0].getOutput());a[14].getHasValues()&&c.writeElement(a[14].parameterName,a[14].values[0].getOutput());a[15].getHasValues()&&
c.writeElement(a[15].parameterName,a[15].values[0].getOutput());a[16].getHasValues()&&c.writeElement(a[16].parameterName,a[16].values[0].getOutput());a[17].getHasValues()&&c.writeElement(a[17].parameterName,a[17].values[0].getOutput());a[18].getHasValues()&&c.writeElement(a[18].parameterName,a[18].values[0].getOutput());a[19].getHasValues()&&c.writeElement(a[19].parameterName,Helper.getUPSPowerStatusInfo(a[19].values[0].data));a[20].getHasValues()&&c.writeElement(a[20].parameterName,Helper.getUPSCommunicationStatusInfo(a[20].values[0].data));
a[21].getHasValues()&&c.writeElement(a[21].parameterName,Helper.getUPSBatteryStatusInfo(a[21].values[0].data));a[22].getHasValues()&&c.writeElement(a[22].parameterName,a[22].values[0].getOutput());a[23].getHasValues()&&c.writeElement(a[23].parameterName,a[23].values[0].getOutput());a[24].getHasValues()&&c.writeElement(a[24].parameterName,Helper.getBooleanToString(a[24].values[0].data));a[25].getHasValues()&&c.writeElement(a[25].parameterName,a[25].values[0].getOutput());a[26].getHasValues()&&c.writeElement(a[26].parameterName,
Helper.getBooleanToString(a[26].values[0].data));a[27].getHasValues()&&c.writeElement(a[27].parameterName,Helper.getBooleanToString(a[27].values[0].data));a[28].getHasValues()&&c.writeElement(a[28].parameterName,a[28].values[0].getOutput());a[29].getHasValues()&&c.writeElement(a[29].parameterName,Helper.getBooleanToString(a[29].values[0].data));a[30].getHasValues()&&c.writeElement(a[30].parameterName,a[30].values[0].getOutput());a[31].getHasValues()&&c.writeElement(a[31].parameterName,a[31].values[0].getOutput());
a[32].getHasValues()&&c.writeElement(a[32].parameterName,a[32].values[0].getOutput())},h=function(a){Helper.HideLoading();e.DevMan.getErrorQueue().AddError(a.requestStatus,a.requestStatusText);c.clearLocks()},k=function(a,b){Helper.HideLoading();for(var d=0;d<a.length;d++)if(0<b[d])e.DevMan.getErrorQueue().AddError(b[d]);else switch(a[d].name){case "UPS_Information_Property_TestCapacity":alert('Capacity-test successfully initialized.\nThe test will begin when you remove the power supply of the device!\n\nThe runtime of the Battery will be stored in the property "Battery runtime (s)"')}for(d=
0;d<a.length;d++)c.removeLock(a[d].name)}};this.Equipment.prototype=new e.Page_Template.Template};e.DevMan.RegisterModule(new f.Equipment,e.DevMan.ModuleType.Website)})(window);
