<%@ LANGUAGE="VBScript" %> <% timedate=Request("timedate") Set Connection = Server.CreateObject("ADODB.Connection") Connection.Mode = adModeRead Connection.Open phdb_rd If Not IsEmpty(request.form("Latest")) Then timedate="" End If If timedate="" Then SQLStmtX = " select to_char(sysdate,'MM/DD/YYYY HH24:MI:SS') timedate from dual " Set RSX = Connection.Execute(SQLStmtX) timedate = CStr(RSX("timedate")) End If ' response.write(SQLStmtX) Dim color(3) color(0)=" <% End If timedate_par=replace(timedate," ","%20") %> FEC Monitoring Status
               

FEC Monitoring : Vfp Summary

<% SQLStmt = " select to_char(ft.logdate,'MM/DD hh24:mi:ss') ddate,ft.fec_number,ft.fec_port,gm.geo_mod, " SQLStmt = SQLStmt & " 24*60*(to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')-ft.logdate) ddif, " SQLStmt = SQLStmt & " to_char(1.95*(ascii(fec_vbc)-127),999.0) Vbc, " SQLStmt = SQLStmt & " to_char(0.195*(ascii(fec_temp)+128),99.0) Temp, " SQLStmt = SQLStmt & " to_char(19.5*(ascii(fec_Outbias)-127),9999.0) Outbias, " SQLStmt = SQLStmt & " to_char(19.5*(ascii(fec_IBC)-127),9999.0) Ibc, " SQLStmt = SQLStmt & " to_char(19.5*(ascii(fec_PREBIAS)-127),9999.0) Prebias, " SQLStmt = SQLStmt & " to_char(19.5*(ascii(fec_SHABIAS)-127),9999.0) Shabias, " SQLStmt = SQLStmt & " to_char(19.5*(ascii(fec_VFP)-127),9999.0) Vfp, " SQLStmt = SQLStmt & " to_char(19.5*(ascii(fec_VFS)-127),9999.0) Vfs " SQLStmt = SQLStmt & " from phoffline.fec_monitoring ft, " SQLStmt = SQLStmt & " (select max(logdate) logdate,max(fec_number) fec_number,max(fec_port) fec_port " SQLStmt = SQLStmt & " from phoffline.fec_monitoring " SQLStmt = SQLStmt & " where logdate between to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')-0.1 and to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')" SQLStmt = SQLStmt & " group by fec_number,fec_port) pt, " SQLStmt = SQLStmt & " (select distinct afp.fec_number,ms.fec_port,afp.geo_mod from assembly.active_fecs_perm afp, " SQLStmt = SQLStmt & " (select max(reqdate) reqdate,max(fec_number) fec_number,max(fec_port) fec_port from assembly.fec_map_log fml, " SQLStmt = SQLStmt & " (select max(logdate) logdate,max(fec_number) fec_number,max(fec_port) fec_port " SQLStmt = SQLStmt & " from phoffline.fec_monitoring where logdate between to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')-0.1 and to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS') " SQLStmt = SQLStmt & " group by fec_number,fec_port) pt " SQLStmt = SQLStmt & " where pt.logdate>fml.reqdate " SQLStmt = SQLStmt & " group by pt.fec_number,pt.fec_port) ms " SQLStmt = SQLStmt & " where afp.reqdate=ms.reqdate and afp.fec_number=ms.fec_number " SQLStmt = SQLStmt & " and round((afp.fec_string-0.01)/2,0)=ms.fec_port) gm " SQLStmt = SQLStmt & " where ft.logdate=pt.logdate " SQLStmt = SQLStmt & " and ft.fec_number=pt.fec_number " SQLStmt = SQLStmt & " and ft.fec_port=pt.fec_port " SQLStmt = SQLStmt & " and gm.fec_number(+)=ft.fec_number " SQLStmt = SQLStmt & " and gm.fec_port(+)=ft.fec_port " SQLStmt = SQLStmt & " order by ft.fec_number,ft.fec_port " Set RS = Connection.Execute(SQLStmt) ' response.write(SQLStmt) %>
<% old_fec_number = 0 count_latchedup_ports = 0 Do While Not RS.EOF If Not IsNull(RS("geo_mod")) Then geo_mod=CStr(RS("geo_mod")) link="" & CStr(geo_mod) & "" Else geo_mod="N/C" link=CStr(geo_mod) End If new_fec_number = CInt(RS("fec_number")) If new_fec_number <> old_fec_number Then 'open a new row for this FEC old_fec_number = new_fec_number %> <% End If 'make 4 buttons for Vfp of the 4 ports Response.write("" & vbCrLf) If CInt(RS("fec_port")) = 3 Then %> <% End If RS.Movenext Loop %>
FEC# Last DB write Vfp Port 0 Vfp Port 1 Vfp Port 2 Vfp Port 3
<%=RS("fec_number")%> <% If CDbl(RS("ddif"))" & CStr(RS("ddate")) & "") Else Response.write("" & CStr(RS("ddate")) & "") End If %> " & vbCrLf) If Not IsNull(RS("Vfp")) Then vfp = CDbl(RS("Vfp")) If vfp < -190 and vfp > -400 Then ' ok Response.write( "" & CStr(RS("Vfp")) & "" & color(0)) End If If (vfp < -20 and vfp > -190) or vfp < -400 Then ' something strange Response.write( "" & CStr(RS("Vfp")) & "" & color(3)) End If If vfp >= -20 Then ' not ok Response.write( " " & CStr(RS("Vfp")) & "" & color(1)) count_latchedup_ports = count_latchedup_ports + 1 End If Else Response.write( "XXXX" & color(2)) End If Response.write("
<% If count_latchedup_ports > 0 Then Response.write( "

Number of Latched Up Ports = " & CStr(count_latchedup_ports) & "

" ) End If %>
<% Connection.Close Set RS=nothing Set Connection=nothing %>