<%@ LANGUAGE="VBScript" %> <% If Not IsEmpty(request.form("Close")) Then %> <% End If timedate=Request("timedate") Set Connection = Server.CreateObject("ADODB.Connection") Connection.Mode = adModeRead Connection.Open phdb_rd If timedate="" Or IsEmpty(request.form("Selected_Time")) Then SQLStmt = " select to_char(sysdate,'MM/DD/YYYY HH24:MI:SS') timedate from dual " Set RS = Connection.Execute(SQLStmt) timedate = CStr(RS("timedate")) Set RS=nothing End If If Not IsDate(timedate) Then message="Wrong Time/Date format " & timedate %> <% End If timedate_par=replace(timedate," ","%20") %> BLM and Chipmunk Monitoring Status

               

<% Set Cmd = Server.CreateObject("ADODB.Command") Cmd.ActiveConnection = Connection SQLStmt = " select bc.blm_position,bm.blm_name,to_char(bm.startdate,'MM/DD/YYYY HH24:MI:SS') startdate, " SQLStmt = SQLStmt & " nvl(blm_sp.nspikes,0) nspikes, " SQLStmt = SQLStmt & " to_char(bm.stopdate,'MM/DD/YYYY HH24:MI:SS') stopdate,bm.stopdate-bm.startdate dt,round((bm.stopdate-bm.startdate)*24*60,0) dtm,dose,blm_status, " SQLStmt = SQLStmt & " 24*60*(to_date( ? ,'MM/DD/YYYY HH24:MI:SS') -bm.stopdate)+(1-nvl(bm.missed_data,0))/60 ddif " SQLStmt = SQLStmt & " from phoffline.blm_monitoring bm,phoffline.blm_config bc, " SQLStmt = SQLStmt & " (select max(startdate) startdate,max(blm_name) blm_name from phoffline.blm_monitoring " SQLStmt = SQLStmt & " where startdate between to_date( ? ,'MM/DD/YYYY HH24:MI:SS')-2 and to_date( ? ,'MM/DD/YYYY HH24:MI:SS') " SQLStmt = SQLStmt & " group by blm_name ) blm_date " SQLStmt = SQLStmt & " , (select blm_name,sum(n_over_th) nspikes from phoffline.blm_spikes " SQLStmt = SQLStmt & " where startdate between to_date( ? ,'MM/DD/YYYY HH24:MI:SS')-2 and to_date( ? ,'MM/DD/YYYY HH24:MI:SS') " SQLStmt = SQLStmt & " group by blm_name ) blm_sp " SQLStmt = SQLStmt & " where bm.startdate=blm_date.startdate " SQLStmt = SQLStmt & " and bm.blm_name=blm_date.blm_name and bc.blm_name=bm.blm_name " SQLStmt = SQLStmt & " and bm.blm_name=blm_sp.blm_name(+) " SQLStmt = SQLStmt & " and bm.startdate between bc.startdate and bc.stopdate " SQLStmt = SQLStmt & " order by bc.blm_position " Cmd.CommandText = SQLStmt Cmd.CommandType = 1 for i=0 To 4 Set prm = cmd.CreateParameter("Input" & CStr(i),adBSTR,adParamInput,20,timedate) Cmd.Parameters.Append prm Set prm=nothing Next Set RS = Cmd.Execute() ' response.write(SQLStmt & "
") Set Cmd1 = Server.CreateObject("ADODB.Command") Cmd1.ActiveConnection = Connection ' ' Add chipmunks to this web page ' SQLStmt = " select cd.id position,'Chipmunk' || cd.id id,to_char(cd.starttime,'MM/DD/YYYY HH24:MI:SS') starttime, " SQLStmt = SQLStmt & " to_char(cd.stoptime,'MM/DD/YYYY HH24:MI:SS') stoptime, " SQLStmt = SQLStmt & " cd.stoptime-cd.starttime dt,round((cd.stoptime-cd.starttime)*24*60,0) dtm,pulses*cca.microrads_per_pulse dose,livetime, " SQLStmt = SQLStmt & " nvl(sum_pulses,0)*cca.microrads_per_pulse*0.001 total_dose, " SQLStmt = SQLStmt & " 24*60*(to_date( ? ,'MM/DD/YYYY HH24:MI:SS')-cd.stoptime) ddif " SQLStmt = SQLStmt & " from phoffline.chipmunk_data cd,phoffline.chipmunk_calibration cca, " SQLStmt = SQLStmt & " (select max(starttime) starttime,max(id) id " SQLStmt = SQLStmt & " from phoffline.chipmunk_data " SQLStmt = SQLStmt & " where starttime between to_date( ? ,'MM/DD/YYYY HH24:MI:SS')-7 " SQLStmt = SQLStmt & " and to_date( ? ,'MM/DD/YYYY HH24:MI:SS') group by id ) cdd, " SQLStmt = SQLStmt & " (select id,sum(pulses) sum_pulses " SQLStmt = SQLStmt & " from phoffline.chipmunk_data " SQLStmt = SQLStmt & " where pulses>6 and starttime between to_date( ? ,'MM/DD/YYYY HH24:MI:SS')-7 " SQLStmt = SQLStmt & " and to_date( ? ,'MM/DD/YYYY HH24:MI:SS') group by id ) intd " SQLStmt = SQLStmt & " where cd.starttime=cdd.starttime and intd.id(+)=cd.id " SQLStmt = SQLStmt & " and cd.id=cdd.id and cca.id=cd.id and cd.starttime between cca.startdate and cca.stopdate " SQLStmt = SQLStmt & " order by cd.id " ' response.write(SQLStmt & "
") Cmd1.CommandText = SQLStmt Cmd1.CommandType = 1 for i=0 To 4 Set prm = Cmd1.CreateParameter("Input" & CStr(i),adBSTR,adParamInput,20,timedate) Cmd1.Parameters.Append prm Set prm=nothing Next Set RSC = Cmd1.Execute() %>
<% Do While Not RS.EOF ' ' calculate instantenous dose in Rad/hour for display purposes ' dose=CDbl(RS("dose")) ' in mrad dt=24*CDbl(RS("dt")) 'in minutes If RS("blm_status")="0" Then status="OK" Elseif CStr(CHex(RS("blm_status")))="7FFFFFFF" Then status="Overflow" Else status="Error" End If ' ' dose_norm is in Rad/hour ' If dt<>0 and status="OK" Then dose_norm=dose*0.001/dt Else dose_norm=-10 End If wshift=(CInt(RS("blm_position"))-1)*20 %> <% RS.Movenext Loop Set RS=nothing Set Cmd=nothing ' ' Chipmunks ' %>
Position Monitor Last Startdate Duration Dose Status Spikes
      [min] [Rad/h]   last 48 h
<%=RS("blm_position")%> <%=RS("blm_name")%> <% If CDbl(RS("ddif"))" & CStr(RS("startdate")) & "") Else Response.write("" & CStr(RS("startdate")) & "") End If %> <% If CDbl(RS("ddif"))" & CStr(RS("dtm")) & "") Else Response.write("" & CStr(RS("dtm")) & "") End If %> &days=2" onClick="openWindow(this,'BLM<%=CStr(RS("blm_position"))%>',350,350,'no',<%=wshift%>,0)"><%=Round(dose_norm,2)%> <%=status %> <%=RS("nspikes")%>

<% Do While Not RSC.EOF ' ' dose=CDbl(RSC("dose")) ' in microrad total_dose=CDbl(RSC("total_dose")) ' in milirad dt=CDbl(RSC("livetime")) 'in seconds status="OK" ' ' dose_norm is in microrad/second ' If dt<>0 and status="OK" Then dose_norm=dose/dt Else dose_norm=-100 End If wshift=(CInt(RSC("position"))-1)*20 %> <% RSC.Movenext Loop %>
Position Monitor Last Startdate Duration Pulses Last Week's Dose Spikes
      [min] [microRad/s] [mRad]  
<% If RSC("position") = "1" Then Response.write("(+Z)") ElseIf RSC("position") = "2" Then Response.write("(-Z)") Else Response.write(RSC("position")) End If %> <% If RSC("id") = "Chipmunk1" Then Response.write("Chipmunk (+Z)") ElseIf RSC("id") = "Chipmunk2" Then Response.write("Chipmunk (-Z)") Else Response.write(RSC("id")) End If %> <% If CDbl(RSC("ddif"))" & CStr(RSC("starttime")) & "") Else Response.write("" & CStr(RSC("starttime")) & "") End If %> <% If CDbl(RSC("ddif"))" & CStr(RSC("dtm")) & "") Else Response.write("" & CStr(RSC("dtm")) & "") End If %> &days=2" onClick="openWindow(this,'Chipmunk<%=CStr(RSC("position"))%>',350,350,'no',<%=wshift%>,0)"><%=Round(dose_norm,2)%> <%=Round(total_dose,0)%>

Daily Integrated Dose

Note: The integrated dose includes all radiation detected during last 7 days. To select data above pedestal only readings with pulses>6 are used in the integration.<% Connection.Close Set RSC=nothing Set CMDl=nothing Set Connection=nothing %>