<%@ LANGUAGE="VBScript" %> <% start_time = Time %> Signal Distribution <% ' ' Get the two ROWID's for the measurement, the outside routine will determine which ones ! ' Dim Rowid(1) Dim Wurst(1) Dim Signal() Dim Num_at_sig() Dim Logdate(1) Dim Description(1) Dim Comments(1) Dim Nchans(1) For i=0 To 1 Rowid(i)="-" Wurst(i)=-1 Logdate(i)=" " Description(i)=" " Comments(i)=" " Nchans(i)=" " Next nrows=0 If Request("REQ_ROWID_0")<>"" And Request("REQ_ROWID_0")<>"-" Then Rowid(nrows)=Request("REQ_ROWID_0") nrows=nrows+1 End If If Request("REQ_ROWID_1")<>"" And Request("REQ_ROWID_1")<>"-" Then Rowid(nrows)=Request("REQ_ROWID_1") nrows=nrows+1 End If nrows=nrows-1 If nrows>-1 Then Set Connection = Server.CreateObject("ADODB.Connection") Connection.Mode = adModeRead Connection.Open phdb_rd ' ' Get number of channels in a string ' ' SQLStmtx = "select max(ahc.wurst_id) istring,max(chip_type) onechip,max(chip_type)*count(wurst_read_pos) nstring" SQLStmtx = SQLStmtx & " from assembly.asm_hybrid_chip ahc,assembly.asm_hybrid_id ahi,assembly.asm_hybrid_log ahl " SQLStmtx = SQLStmtx & " where ahl.ROWID = '" & CStr(Rowid(0)) & "'" SQLStmtx = SQLStmtx & " and ahl.HYBRID_ID=ahi.HYBRID_ID" SQLStmtx = SQLStmtx & " and ahc.hybrid_type=ahi.hybrid_type" SQLStmtx = SQLStmtx & " group by ahc.hybrid_type,ahc.wurst_id" Set RSx = Connection.Execute(SQLStmtx) kstring=0 Do While Not RSx.EOF nstring=Cint(RSx("nstring")) onechip=Cint(RSx("onechip")) kstring=kstring+1 RSx.MoveNext Loop SQLStmt0 = "select ahl.HYBRID_ID,LOGDATE,ahl.WURST_ID,CONFIG,ahl.COMMENTS,aha.DESCRIPTION from ASSEMBLY.ASM_HYBRID_LOG ahl,ASSEMBLY.ASM_HYBRID_ACTION aha " ' ' Do SQL line fit preparation ' SQLStmt1 = "SELECT max(sd.X) signal_value," SQLStmt1 = SQLStmt1 & "sum(sd.Y) number_at_signal " SQLStmt1 = SQLStmt1 & " from ASSEMBLY.STRING_DIST sd,ASSEMBLY.ASM_HYBRID_LOG ahl " If nrows=0 Then ' ' Just one string ' SQLStmt0 = SQLStmt0 & " where ahl.ROWID = '" & CStr(Rowid(0)) & "'" SQLStmt1 = SQLStmt1 & " where ahl.ROWID = '" & CStr(Rowid(0)) & "'" Else ' ' Two strings ' SQLStmt0 = SQLStmt0 & " where (ahl.ROWID = '" & CStr(Rowid(0)) & "' or ahl.ROWID = '" & CStr(Rowid(1)) & "') " SQLStmt1 = SQLStmt1 & " where (ahl.ROWID = '" & CStr(Rowid(0)) & "' or ahl.ROWID = '" & CStr(Rowid(1)) & "') " End If SQLStmt0 = SQLStmt0 & " and ahl.ACTION=aha.ACTION order by ahl.WURST_ID" SQLStmt1 = SQLStmt1 & " and ahl.LOGDATE=sd.STARTDATE and sd.MEASUREMENT_ID='SRCSIG' group by sd.X order by sd.X" Set RS0 = Connection.Execute(SQLStmt0) %> <% If Not RS0.EoF Then %>

Signal Distribution, HYBRID ID : <%= RS0("HYBRID_ID")%>

<% End If Do While Not RS0.EoF wurst_id=CInt(RS0("WURST_ID")) logdate(wurst_id)=RS0("LOGDATE") description(wurst_id)=RS0("DESCRIPTION") comments(wurst_id)=RS0("COMMENTS") nchans(wurst_id)=nstring RS0.MoveNext Loop %>
 

String_0

String_1

Test Date <%=logdate(0)%> <%=logdate(1)%>
Test Type <%=Description(0)%> <%=Description(1)%>
Channels <%=Nchans(0)%> <%=Nchans(1)%>
Comments <%=comments(0)%> <%=comments(1)%>

 <% ' ' Do heavy duty database extraction here ' 'response.write(SQLStmt1) Set RS1 = Connection.Execute(SQLStmt1) npoints=0 Do While Not RS1.EoF ' ReDim Preserve Signal(npoints) ReDim Preserve Num_at_sig(npoints) Signal(npoints)=CDbl(RS1("SIGNAL_VALUE")) Num_at_sig(npoints)=CDbl(RS1("NUMBER_AT_SIGNAL")) npoints=npoints+1 RS1.MoveNext Loop npoints=npoints-1 If npoints>0 Then %> <% start_time = Time %> <% ' ' Prepare plot ' seed=-(second(now())+60*minute(now())+3600*hour(now())+3600*24*day(now())) filename="srcsig" & cstr(int(100000.*rnd(seed))) & ".jpg" filename_full=ph_image_directory & filename %> <% Dim Chart Dim Color(8) Color(0) = vbRed Color(1) = vbBlue Color(2) = vbYellow Color(3) = vbGreen Color(4)= vbMagenta Color(5)= vbCyan Color(6)= vbWhite Color(7)= vbBlack rem ********************************************************************** rem * Instantiate the Chart component rem ********************************************************************** Set Chart = Server.CreateObject ("ASPChart.Chart") rem ********************************************************************** rem * Create x Array rem ********************************************************************** Chart.AddSeries 5 Chart.SeriesTitle = "Signal Distribution" Chart.LineWidth = 1 Chart.Stairs = True Chart.SeriesInLegend = true min_x=-1 max_x=-1 max_y=-1 For ipoints=0 To npoints Chart.AddXY Signal(ipoints),Num_at_sig(ipoints),"",Color(1) If min_x>Signal(ipoints) or min_x=-1 Then min_x=Signal(ipoints) End If If max_x" Response.Write (line) rem ********************************************************************** rem * Destroy the object rem ********************************************************************** Set Chart = nothing Else ' no data to plot, show dummy picture ! %>

no_data.gif (5205 bytes) <% End If ' Database is not needed anymore ! Connection.Close %> <% Else %> Both ROWID's are empty ! <%End If%>