<%@ LANGUAGE="VBScript" %> <% Dim avg_cap(100) %> Capacitance Dist <% start_time = Time %> <% Set Connection = Server.CreateObject("ADODB.Connection") Connection.Mode = adModeRead Connection.Open phdb_rd Subq_sel_s="(select max(logdate) from sensor_log where batch='" & Request("batch") & "' and measurement_type='CV Regular' group by sensor)" Subq_sel_b="(select max(logdate) from sensor_log where batch='" & Request("batch") & "' and measurement_type='CV Regular' group by batch)" %> <% Type_Query="select (max(pad)+1) nchip, (max(bonding_pattern)+1) maxbp, max(bi.sensor_type) type,max(bi.mask_revision) mask " Type_Query=Type_Query & "from type_con tc,batch_info bi " Type_Query=Type_Query & "where bi.batch='" & Request("batch") & "' " Type_Query = Type_Query & "and tc.sensor_type=bi.sensor_type" Set Stype = Connection.Execute(Type_Query) If Not IsNull(Stype("nchip")) Then nchip=CInt(Stype("nchip")) maxbp=CInt(Stype("maxbp")) ntot=nchip*maxbp ctype=Sensor_Name(Stype("type"),Stype("mask")) Else nchip=128 maxbp=12 ntot=9999 ctype="unknown type" End If %> <% 'select max bias just for one sensor, with latest measurement in the batch ! Bias_Query = "select max(bias) maxb,Avg(Temperature) atemp,Avg(Humidity) ahum from sensor " Bias_Query = Bias_Query & "where startdate=" & subq_sel_b Bias_Query = Bias_Query & "group by batch" Set Sbias = Connection.Execute(Bias_Query) If Not Sbias.EOF Then maxba=CDbl(Sbias("maxb")) atempa=CDbl(Sbias("atemp")) ahuma=CDbl(Sbias("ahum")) Else maxba=0 atempa=0 ahuma=0 End If %> <% CVA_Query = "select sensor,Avg(capacitance) acap " CVA_Query = CVA_Query & "from sensor where bias between " & Cstr(CDbl(maxba)-2) & " and " & Cstr(CDbl(maxba)+2) & " " CVA_Query = CVA_Query & "and startdate in " & Subq_sel_s CVA_Query = CVA_Query & "group by sensor" Set ScvA = Connection.Execute(CVA_Query) do while not ScvA.EOF ise=Cint(ScvA("sensor")) avg_cap(ise)=Cdbl(ScvA("acap")) ScvA.MoveNext loop %> <% CV_Query = "select sensor," & Cstr(nchip) & "*bonding_pattern+pad col,capacitance " CV_Query = CV_Query & "from sensor where bias between " & Cstr(CDbl(maxba)-2) & " and " & Cstr(CDbl(maxba)+2) & " " CV_Query = CV_Query & "and startdate in " & Subq_sel_s CV_Query = CV_Query & "order by sensor,col" Set Scv = Connection.Execute(CV_Query) %> <% ' Prepare plot seed=-(second(now())+60*minute(now())+3600*hour(now())+3600*24*day(now())) filename="cvcv" & cstr(int(100000.*rnd(seed))) & ".jpg" filename_full=ph_image_directory & filename %>

Batch <%=Request("batch")%> Capacitance Distributions

<% 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 ********************************************************************** ise=-1 icol=-1 cmax =-10000 do while not Scv.EOF If Cint(Scv("Sensor"))=ise Then dcol=CDbl(Scv("col")) dcap=CDbl(Scv("Capacitance"))-avg_cap(ise) ' dcap=CDbl(Scv("Capacitance")) If cmaxise Then If ise>0 Then ' finish work for previous sensor End If If itest<>10000 Then Chart.AddSeries 5 Chart.LineWidth = 1 Chart.Stairs = true icol=icol+1 If icol>7 Then icol=0 End If End If ise=itest End If loop rem ********************************************************************** rem * Add and format the title rem ********************************************************************** Chart.ChartTitleAdd ("Vb=" & Cstr(precision(maxba,1)) & " [V]") Chart.ChartTitleFont.Size = 18 Chart.ChartTitleFont.Name = "Times New Roman" Chart.ChartTitleFont.Italic = true Chart.ChartTitleFont.Bold = true Chart.View3D = false Chart.LegendVisible = false Chart.LegendStyle = cSeries Chart.AxisGridLines = true Chart.Frame = false Chart.BottomAxisIncrement = nchip rem ********************************************************************** rem * Remove the OuterBevel, add a gradient fill to chart panel rem ********************************************************************** Chart.BevelOuter = 0 rem Chart.GradientVisible = true rem Chart.GradientStartColor = vbWhite rem Chart.GradientEndColor = vbYellow Chart.PanelColor = Color(6) rem ********************************************************************** rem * Set the Width and Height of the image rem ********************************************************************** Chart.Height = 800 Chart.Width = 600 Chart.HorizAxisMax = nchip*maxbp Chart.HorizAxisMin = 0. Chart.VertAxisMax = +10 Chart.VertAxisMin = -10 Chart.AddAxisLabel 1 , "Capacitance [pF]" Chart.AddAxisLabel 2 , Cstr(nchip) & "*bonding_pattern+pad" rem ********************************************************************** rem * Set the filename, save the image and write the image tag rem ********************************************************************** Chart.FileName = filename_full Chart.SaveChart line="
" Response.Write (line) rem ********************************************************************** rem * Destroy the object rem ********************************************************************** Set Chart = nothing ' Database is not needed anymore ! Connection.Close %>