| |
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)%> |
<%
old_test="XXXXXX"
Do While Not RS2.Eof
If old_test<>CStr(RS2("MEASUREMENT_ID")) Then
If old_test<>"XXXXXX" Then 'finish previous row
%>
<%
End If
old_test=CStr(RS2("MEASUREMENT_ID"))
%>
| <%=RS2("DESCRIPTION")%> |
<% If CInt(RS2("WURST_ID"))=0 Then
%>
<%=RS2("VALUE")%> |
<% Else %>
|
<%=RS2("VALUE")%> |
<% End If
Else
If CInt(RS2("WURST_ID"))=1 Then %>
<%=RS2("VALUE")%> |
<% Else %>
Error: Table logic messed up |
<% End If
End If %>
<%
RS2.MoveNext
Loop %>
|
<%
'
' Do heavy duty database extraction here
'
Set RS1 = Connection.Execute(SQLStmt1)
npoints=0
Do While Not RS1.EoF
'
' Calculate calibration slope
'
Channel(npoints)=CInt(RS1("CH"))
'
nn=CDbl(RS1("NN"))
aa=CDbl(RS1("AA"))
bb=CDbl(RS1("BB"))
cc=CDbl(RS1("CC"))
dd=CDbl(RS1("DD"))
'
If (aa*aa-nn*bb <>0) Then
Slope(npoints)=10*(aa*cc-nn*dd)/(aa*aa-nn*bb)
Else
Slope(npoints)=0.
End If
npoints=npoints+1
RS1.MoveNext
Loop
npoints=npoints-1
%>
<% start_time = Time %>
<%
'
' Prepare plot
'
seed=-(second(now())+60*minute(now())+3600*hour(now())+3600*24*day(now()))
filename="sigcal" & 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 = "Channel Gain"
Chart.LineWidth = 1
Chart.Stairs = True
Chart.SeriesInLegend = true
For ipoints=0 To npoints
Chart.AddXY Channel(ipoints),Slope(ipoints),"",Color(1)
Next
rem **********************************************************************
rem * Add and format the title
rem **********************************************************************
Chart.ChartTitleFont.Size = 16
Chart.ChartTitleFont.Name = "Arial"
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 = onechip
rem Chart.LeftAxisIncrement = 0.1
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 = 400
Chart.Width = 600
Chart.HorizAxisMax = kstring*nstring+1+8
Chart.HorizAxisMin = -8.
Chart.VertAxisMax = 10.0
Chart.VertAxisMin = 0.
Chart.AddAxisLabel 1 , "Gain [mV/fC]"
Chart.AddAxisLabel 2 , CStr(nstring) & "*String+Channel"
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
%>
<% Else %>
| Both
ROWID's are empty ! <%End If%> |