home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 April / VPR0004B.BIN / DRIVER / COMPAQ / SP12255 / sp12255.exe / DMWEBC1.CAB / PcDevice.tpl < prev    next >
Text File  |  1999-07-15  |  7KB  |  323 lines

  1. <html>
  2.  
  3. <head>
  4. <title>PC's Devices</title>
  5.  
  6. <!#sComp.JS>
  7.  
  8. </head>
  9. <BODY BACKGROUND="IMAGES/BACKGRND.GIF">
  10.  
  11. <CENTER><TABLE BORDER="0" ALIGN="center" WIDTH="100%">
  12.  
  13. <SCRIPT LANGUAGE="JavaScript">
  14.  
  15. prevLink = "CFSYSINF.TPL";    // Default
  16.  
  17. function SubFunctionSelect(RefLink)
  18. {
  19.     // Mask the selection symbol
  20.     for (i = 0; i < document.images.length; i ++)
  21.     {
  22.         if (document.images[i].name == prevLink)
  23.         {
  24.             document.images[i].src = "IMAGES/TRIANGLEMASK.GIF";
  25.             break;
  26.         }
  27.     }
  28.  
  29.     // Use selection symbol
  30.     for (i = 0; i < document.images.length; i ++)
  31.     {
  32.         if (document.images[i].name == RefLink)
  33.         {
  34.             document.images[i].src = "IMAGES/TRIANGLE.GIF";
  35.             prevLink = RefLink;
  36.             break;
  37.         }
  38.     }
  39. }
  40.  
  41.  
  42. function WriteLinkRow(PicNum, RefLink, DisplayText)
  43. {
  44.     if (PicNum == 0)
  45.         Pic = "";
  46.     else
  47.         if (PicNum == 1)
  48.             Pic = "IMAGES/blue_ball_small.gif";
  49.         else
  50.             if (PicNum == 2)
  51.                 Pic = "IMAGES/green_check_small.gif";
  52.             else
  53.                 if (PicNum == 3)
  54.                     Pic = "IMAGES/yellow_yield_small.gif";
  55.             else
  56.                 if (PicNum == 4)
  57.                     Pic = "IMAGES/orange_x_small.gif";
  58.                 else
  59.                     Pic = "IMAGES/BACKGRND.GIF";
  60.  
  61.     document.write("<TR>");
  62.     document.write("<TD ALIGN=LEFT VALIGN=TOP WIDTH=5%>");
  63.     document.write("<IMG NAME=" + RefLink + " SRC=./IMAGES/TRIANGLEMASK.GIF></TD>");
  64.  
  65.     document.write("<TD ALIGN=LEFT VALIGN=TOP WIDTH=5%>");
  66.     if (PicNum == 0)
  67.         document.write("</TD>");
  68.     else
  69.         document.write("<IMG SRC=" + Pic + "></TD>");
  70.  
  71.     document.write("<TD ALIGN=LEFT VALIGN=TOP WIDTH=90% ALIGN=TOP HSPACE=0 VSPACE=0 BORDER=0>");
  72.     document.write("<A HREF=" + RefLink + " onclick=SubFunctionSelect(\'" + RefLink + "\'); target=INPUTOUTPUT>");
  73.     document.write("<font color=blue size=2 face=Arial>" + DisplayText + "</font></A>");
  74.     document.write("</TD> </TR>");
  75. }
  76.  
  77. function GetOsStatus(DevOs, OsCurrentErrorStatus, DevStatus, OsIndex)
  78. {
  79.     TempCond = 1;
  80.     TempDevCond = 1;
  81.         for (x = 0; x < DevOs.length; x++)
  82.         {
  83.         if (DevOs[x] > 0)
  84.         {
  85.             ActualOsIndex = -1;
  86.             for (k = 0; k < OsIndex.length; k++)
  87.             {
  88.                 if (DevOs[x] == OsIndex[k])
  89.                 {
  90.                     ActualOsIndex = k;
  91.                     break;
  92.                 }
  93.             }
  94.             if (ActualOsIndex >= 0)
  95.             {
  96.                 for (j = 0; j <= DevStatus.length - 1; j++)
  97.                 {
  98.                     if (OsCurrentErrorStatus[ActualOsIndex] == DevStatus[j])
  99.                     {
  100.                            if (j == 5)
  101.                                       TempCond = 4;
  102.                         else
  103.                                if (j == 3 || j == 4)
  104.                                            TempCond = 3;
  105.                             else
  106.                                    if (j == 2)
  107.                                                TempCond = 2;
  108.                                 else
  109.                                        if (j < 2)
  110.                                                   TempCond = 1;
  111.                             break;
  112.                     }
  113.                 }
  114.             }
  115.         }
  116.         if (TempCond > TempDevCond)
  117.             TempDevCond = TempCond;
  118.     }
  119.  
  120.     return TempDevCond;
  121. }
  122.  
  123. function GetMsStatus(DevOs, OsCurrentErrorStatus, DevStatus, OsIndex, dmiDevIntfType, MsType)
  124. {
  125.  
  126.     TempCond = 0;
  127.     TempDevCond = 0;
  128.         for (i = 0; i < DevOs.length; i++)
  129.         {
  130.         bMatch = 0;
  131.         if (MsType == 0)
  132.         {
  133.             if (dmiDevIntfType[i] == "SCSI")
  134.                 bMatch = 1;
  135.             else
  136.                 bMatch = 0;
  137.         }
  138.         else
  139.         {
  140.             if (MsType == 1)
  141.             {
  142.                 
  143.                 if (dmiDevIntfType[i] == "IDE" || dmiDevIntfType[i] == "Enhanced ATA/IDE")
  144.                     bMatch = 1;
  145.                 else
  146.                     bMatch = 0;
  147.             }
  148.             else
  149.             {
  150.                 if (MsType == 2)
  151.                 {
  152.                     if (dmiDevType[i] == "Hard Disk" && dmiDevIntfType[i] != "SCSI" && dmiDevIntfType[i] != "IDE" && dmiDevIntfType[i] != "Enhanced ATA/IDE")
  153.                         bMatch = 1;
  154.                     else
  155.                         bMatch = 0;
  156.                 }
  157.             }
  158.         }
  159.  
  160.         if (bMatch == 1)
  161.         {
  162.             if (DevOs[i] > 0)
  163.             {
  164.                 ActualOsIndex = -1;
  165.                 for (k = 0; k < OsIndex.length; k++)
  166.                 {
  167.                     if (DevOs[i] == OsIndex[k])
  168.                     {
  169.                         ActualOsIndex = k;
  170.                         break;
  171.                     }
  172.                 }
  173.                 if (ActualOsIndex >= 0)
  174.                 {
  175.                     for (j = 0; j <= DevStatus.length - 1; j++)
  176.                     {
  177.                         if (OsCurrentErrorStatus[ActualOsIndex] == DevStatus[j])
  178.                         {
  179.                                if (j == 5)
  180.                                           TempCond = 4;
  181.                             else
  182.                                    if (j == 3 || j == 4)
  183.                                                TempCond = 3;
  184.                                 else
  185.                                        if (j == 2)
  186.                                                    TempCond = 2;
  187.                                     else
  188.                                            if (j < 2)
  189.                                                       TempCond = 1;
  190.                             break;
  191.                         }
  192.                     }
  193.                 }
  194.                 if (TempCond > TempDevCond)
  195.                     TempDevCond = TempCond;
  196.             }
  197.         }
  198.     }
  199.     return TempDevCond;
  200. }
  201.  
  202.  
  203.     <!*, DMTF|FRU|*, 1, FRUIndex>
  204.     <!*, DMTF|Operational State|*, 1, OsIndex>
  205.     <!*, DMTF|Operational State|*, 10, OsCurrentErrorStatus>
  206.     <!*, DMTF|Physical Container Global Table|*, 1, globalContainer>
  207.  
  208.     DevStatus = new Array();
  209.     DevStatus[0] = "Other";
  210.     DevStatus[1] = "Unknown";
  211.     DevStatus[2] = "OK";
  212.     DevStatus[3] = "Non-critical";
  213.     DevStatus[4] = "Critical";
  214.     DevStatus[5] = "Non-recoverable";
  215.     
  216.     tempCondition = 0;
  217.  
  218.     <!*, DMTF|Processor|*, 9, CpuOs>
  219.     <!*, DMTF|Memory Device|*, 23, MemOsIndex>
  220.     <!*, DMTF|Disks|*, 3, dmiDevIntfType>
  221.     <!*, DMTF|Disks|*, 1, dmiDevType>
  222.     <!*, DMTF|Disks|*, 21, DiskOsIndex>
  223.  
  224.     CpuCond = GetOsStatus(CpuOs, OsCurrentErrorStatus, DevStatus, OsIndex);
  225.     MemCond = GetOsStatus(MemOsIndex, OsCurrentErrorStatus, DevStatus, OsIndex);
  226.  
  227.     IdeDevPresent = 0;
  228.     ScsiDevPresent = 0;
  229.     HdDevPresent = 0;
  230.  
  231.     for(i = 0; i < dmiDevIntfType.length; i++)
  232.     {
  233.         if (dmiDevIntfType[i] == "IDE" || dmiDevIntfType[i] == "Enhanced ATA/IDE")
  234.         {
  235.             IdeDevPresent = 1;
  236.             break;
  237.         }
  238.     }
  239.  
  240.     for(i = 0; i < dmiDevIntfType.length; i++)
  241.     {
  242.         if (dmiDevIntfType[i] == "SCSI")
  243.         {
  244.             ScsiDevPresent = 1;
  245.             break;
  246.         }
  247.     }
  248.  
  249.     for(i = 0; i < dmiDevIntfType.length; i++)
  250.     {
  251.         if (dmiDevType[i] == "Hard Disk" && dmiDevIntfType[i] != "SCSI" && dmiDevIntfType[i] != "IDE" && dmiDevIntfType[i] != "Enhanced ATA/IDE")
  252.         {
  253.             HdDevPresent = 1;
  254.             break;
  255.         }
  256.     }
  257.  
  258.     WriteLinkRow(0, "CFSYSINF.TPL", sSysInfo);
  259.     WriteLinkRow(0, "SB-INFO.TPL", sSystemBoard);
  260.     WriteLinkRow(CpuCond, "CPU.TPL", sCPU);
  261.     WriteLinkRow(0, "PARALLEL.TPL", sParallel);
  262.     WriteLinkRow(0, "SERIAL.TPL", sSerial);
  263.     WriteLinkRow(MemCond, "MEMORY.TPL", sMemory);
  264.     WriteLinkRow(0, "MONITOR.TPL", sMonitor);
  265.     
  266.     IdeCond = 1;
  267.     ScsiCond = 1;
  268.     HdCond = 1;
  269.  
  270.     if (IdeDevPresent == 1)
  271.          IdeCond = GetMsStatus(DiskOsIndex, OsCurrentErrorStatus, DevStatus, OsIndex, dmiDevIntfType, 1);
  272.  
  273.     if (ScsiDevPresent == 1)
  274.          ScsiCond = GetMsStatus(DiskOsIndex, OsCurrentErrorStatus, DevStatus, OsIndex, dmiDevIntfType, 0);
  275.  
  276.     if (HdDevPresent == 1)
  277.          HdCond = GetMsStatus(DiskOsIndex, OsCurrentErrorStatus, DevStatus, OsIndex, dmiDevIntfType, 2);
  278.  
  279.     if (HdCond < ScsiCond)
  280.         HdCond = ScsiCond;
  281.  
  282.     if (HdCond < IdeCond)
  283.         HdCond = IdeCond;
  284.  
  285.     WriteLinkRow(HdCond, "HARDDISK.TPL", sStorage);
  286.  
  287.     for(i = 0; i < dmiDevType.length; i++)
  288.     {
  289.         if (dmiDevType[i] == "Hard Disk")
  290.         {
  291.             WriteLinkRow(0, "FILEUSE.TPL", sStorageUsage);
  292.             break;
  293.         }
  294.     }
  295.  
  296.     
  297.     WriteLinkRow(0, "NICDRV.TPL", sNIC);
  298.  
  299.     PCType = globalContainer[0];
  300.     if (PCType == "Portable" || PCType == "LapTop" || PCType == "Notebook")
  301.     {
  302.         WriteLinkRow(0, "BT-BTTY.TPL", sBattery);
  303.     }
  304.  
  305.     WriteLinkRow(0, "KEYBOARD.TPL", sKeyboard);
  306.     WriteLinkRow(0, "POINTDEV.TPL", sPointingDevice);
  307.     WriteLinkRow(0, "VIDEO.TPL", sGraphics);
  308.  
  309.     document.write("</TABLE>");
  310.  
  311.     // Use selection symbol
  312.     for (i = 0; i < document.images.length; i ++)
  313.     {
  314.         if (document.images[i].name == prevLink)
  315.         {
  316.             document.images[i].src = "IMAGES/TRIANGLE.GIF";
  317.             break;
  318.         }
  319.     }
  320.  
  321. </SCRIPT>
  322. </body>
  323. </html>