home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 2000 April
/
VPR0004B.BIN
/
DRIVER
/
COMPAQ
/
SP12255
/
sp12255.exe
/
DMWEBC1.CAB
/
BT-BTTY.TPL
< prev
next >
Wrap
Text File
|
1999-06-11
|
4KB
|
161 lines
<HTML>
<!-- $Id: BT-BTTY.TPL 1.1 1998/03/18 20:36:32 cboeker Q/A $ -->
<!-- Copyright (C) 1998 Compaq Computer Corporation -->
<HEAD>
<!#PAGETAGS.TPL>
<SCRIPT LANGUAGE="JavaScript">
<!--
<!#TABLES.JS>
<!#COND.JS>
<!#STDITEMS.JS>
</SCRIPT>
</HEAD>
<!#BT-BTTY.JS>
<SCRIPT LANGUAGE="JavaScript">
writeTableLabel(sBattery);
writeTableHead();
// Condition
bluedot = 1;
greendot = 2;
yellowdot = 3;
reddot = 4;
// get Batteries info
<!*, DMTF|Portable Battery|*, Portable Battery Manufacturer, batteryMfg>;
<!*, DMTF|Portable Battery|*, Portable Battery Device Name, batteryModel>;
<!*, DMTF|Portable Battery|*, Portable Battery Serial Number, batterySerNum>;
<!*, DMTF|Portable Battery|*, Smart Battery Version, batteryVersion>;
<!*, DMTF|Portable Battery|*, Portable Battery Manufacture Date, batteryMfgDate>;
<!*, DMTF|Portable Battery|*, Portable Battery Charging Status, batteryStatus>;
<!*, DMTF|Portable Battery|*, Portable Battery Design Capacity, batteryDesignCapacity>;
<!*, DMTF|Portable Battery|*, Full Charge Capacity, batteryFullCharge>;
<!*, DMTF|Portable Battery|*, Remaining Capacity, batteryRemaining>;
<!*, DMTF|Portable Battery|*, Operational Group Index, batteryOpStateIndex>;
<!*, DMTF|Operational State|*, Current Error Status, errorStatus>;
for(i = 0; i < batteryMfg.length; i++)
{
batteryNumber = i + 1
tableCap = sBattery + " # " + batteryNumber + ": " + sDetails;
batteryStatus = errorStatus[batteryOpStateIndex[i] - 1];
if (batteryStatus == "Other" || batteryStatus == "Unknown")
deviceCond = bluedot;
else if (batteryStatus == "OK")
deviceCond = greendot;
else if ((batteryStatus == "Critical") || (batteryStatus == "Non-recoverable"))
deviceCond = reddot;
else if (batteryStatus == "Non-critical")
deviceCond = yellowdot;
else
deviceCond = bluedot;
deviceCondImage = new cpqCondition(deviceCond);
tableCap = deviceCondImage.image() + tableCap;
writeTableLabel( tableCap );
writeTableHead();
writeSingleTableRow(sMfg, batteryMfg[i]);
writeSingleTableRow(sModel, batteryModel[i]);
writeSingleTableRow(sSerialNumber, batterySerNum[i]);
writeSingleTableRow(sSmartVer, batteryVersion[i]);
year = batteryMfgDate[i].substring(0, 4);
month = batteryMfgDate[i].substring(4, 6);
day = batteryMfgDate[i].substring(6, 8);
hour = batteryMfgDate[i].substring(8, 10);
minute = batteryMfgDate[i].substring(10, 12);
second = batteryMfgDate[i].substring(12, 14);
writeSingleTableRow(sMfgDate, year + "/" + month + "/" + day + " " + hour + ":" + minute + ":" + second);
writeTableTail();
document.write("<BR>");
tableCap = sBattery + " # " + batteryNumber + ": " + sStatus;
writeSmallTableLabel( tableCap );
writeTableHead();
writeSingleTableRow(sStatus + ":", getBatteryStatus(deviceCond));
writeTableTail();
document.write("<BR>");
if (batteryFullCharge[i] >= 0 && batteryDesignCapacity[i] >= 0)
{
tableCap = sBattery + " # " + batteryNumber + ": " + sCapacityStatus;
writeSmallTableLabel( tableCap );
document.write("<TABLE BORDER=0 WIDTH=60%>");
document.write("<SMALL><FONT FACE=Arial><B><BR>" + sChargeLevel + "</B>");
document.write("<TR ><TD>");
percentBarGraph(Math.round(batteryRemaining[i]/batteryFullCharge[i]*100));
document.write("<BR>");
writeTableTail();
document.write("</SMALL></FONT><BR<BR><BR>");
}
tableCap = sBattery + " # " + batteryNumber + ": " + sAction;
writeSmallTableLabel( tableCap );
writeTableHead();
writeOneItemTableRowAllignedLeftInSingleTable(getBatteryAction(deviceCond));
writeTableTail();
document.write("<BR<BR><BR>");
}
function getBatteryAction (action)
{
if (1 == action)
{
return sOther;
}
else if (2 == action)
{
return sOK;
}
else if (3 == action)
{
return sNotFunction;
}
else if (4 == action)
{
return sFailed;
}
}
function getBatteryStatus (action)
{
if (1 == action)
{
return sOther;
}
else if (2 == action)
{
return sWorking;
}
else if (3 == action)
{
return sChargeFault;
}
else if (4 == action)
{
return sBatteryFailure;
}
}
</SCRIPT>
</HTML>