<%@ LANGUAGE="VBScript" %> <% start_time = Time %> Results of Signal Calibration Tests <% Set Connection = Server.CreateObject("ADODB.Connection") Connection.Mode = adModeRead Connection.Open phdb_rd SQLStmt0 = "select CHANNELNUM, MEASUREMENT_INP, MEASUREMENT_OUT from ASSEMBLY.STRING_CHANNEL_MEASUREMENT SCM, ASSEMBLY.ASM_HYBRID_LOG SL where SCM.STARTDATE=SL.LOGDATE and MEASUREMENT_ID = 'SIGCAL' and SL.ROWID = '"+Request("REQ_ROWID")+"' AND CHANNELNUM=42" Set RS0 = Connection.Execute(SQLStmt0) %> <% 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 6 Chart.SeriesTitle = "Signal Calibration" Chart.LineWidth = 1 Chart.Stairs = False Chart.SeriesInLegend = true Do While Not RS0.Eof rem Chart.AddXY CDbl(RS0("CHANNELNUM")), (CDbl(RS0("MEASUREMENT_OUT"))/CDbl(RS0("MEASUREMENT_INP")) *1000.0), "",Color(1) Chart.AddXY CDbl(RS0("MEASUREMENT_INP"))/1000.00, CDbl(RS0("MEASUREMENT_OUT")), "",Color(1) RS0.MoveNext Loop rem ********************************************************************** rem * Add and format the title rem ********************************************************************** Chart.ChartTitleAdd ("Signal Calibration for Channel # 42 (Test Page)") Chart.ChartTitleFont.Size = 18 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 = 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 = 1200 Chart.HorizAxisMax = 1.1 Chart.HorizAxisMin = 0. Chart.VertAxisMax = 0.5 Chart.VertAxisMin = 0. Chart.AddAxisLabel 1 , "Output" Chart.AddAxisLabel 2 , "Input" 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 %>