<%@ LANGUAGE="VBScript" %> <% if request("run")<>"" then run=cint(Request("run")) else run=6300 end if ' ' Open Database ' Set Connection = Server.CreateObject("ADODB.Connection") Connection.Mode = adModeRead Connection.Open phdb_rd statement="select to_char(sysdate,'YYYY/MM/DD HH24:MI') repdate, to_char(run_date,'YYYY/MM/DD HH24:MI') time from phoffline.runs where run between "& run&" and "& run+1 'response.write(statement) set RS1=connection.Execute(statement) dim j, logdate1(2) j=0 logdate1(1)=null do while not RS1.EOF logdate1(j)=cstr(RS1("time")) repdate=cstr(RS1("repdate")) j=j+1 RS1.movenext Loop 'if run is current then take the end time to be the current time If isnull(logdate1(1)) then logdate1(1)=repdate end if set RS1=nothing 'response.write(logdate1(0)&","& logdate1(1)) SQLt="select to_char(logdate,'MM/DD/YY HH24:MI') logtime, " SQLt=SQLt &"nvl(to_char(BEAM_ENERGY_BL,'999.00'),'N/A') energyblue, " SQLt=SQLt &"nvl(to_char(BUNCH_LENGTH_BL,'990.0'),'N/A') lengthblue," SQLt=SQLt &"to_char(CURRENT_BL,'9990.0') currentblue," SQLt=SQLt &" nvl(to_char(FILL_START_BL,'HH24:MI'),'N/A') startblue," SQLt=SQLt &"nvl(to_char(GAMMA_BL,'999.00'),'N/A') gammablue," SQLt=SQLt &"LIFETIME_BL lifetimeblue," SQLt=SQLt &"nvl(to_char(LUMI_START_BL,'HH24:MI'),'N/A') lumiblue," SQLt=SQLt &"nvl(to_char( MOM_SPREAD_BL),'N/A') momblue, " SQLt=SQLt &"nvl(RING_STATE_BL,'N/A') stateblue," SQLt=SQLt &"nvl(to_char(BEAM_ENERGY_YL,'999.00'),'N/A') energyyellow, " SQLt=SQLt &"nvl(to_char(BUNCH_LENGTH_YL,'990.0'),'N/A') lengthyellow," SQLt=SQLt &"to_char(CURRENT_YL,'9990.0') currentyellow, " SQLt=SQLt &"nvl(to_char(FILL_START_YL,'HH24:MI'),'N/A') startyellow," SQLt=SQLt &"nvl(to_char(GAMMA_YL,'999.00'),'N/A') gammayellow, " SQLt=SQLt &"LIFETIME_YL lifetimeyellow," SQLt=SQLt &"nvl(to_char(LUMI_START_YL,'HH24:MI'),'N/A') lumiyellow," SQLt=SQLt &"nvl(to_char(MOM_SPREAD_YL),'N/A') momyellow, " SQLt=SQLt &"nvl(RING_STATE_YL,'N/A') stateyellow " SQLt=SQLt &"from phoffline.rhic_parameters " SQLt=SQLt &"where logdate> to_date('"&logdate1(0)&"', 'YYYY-MM-DD HH24:MI') and logdate <" SQLt=SQLt &"to_date('"&logdate1(1)&"', 'YYYY-MM-DD HH24:MI')" 'response.write(SQLt) set RS=connection.Execute(SQLt) %> RHIC Parameters

RHIC Parameters

Legend

1.Beam Energy 2.Lifetime 3.Ring State 4.Bunch Length 5.RHIC Current (10^9 ions/sec)
6.Fill Start 7.Gamma 8.Luminosity@start 9.MOM Spread

Run <%=run%>

<% Dim my1array, my2array, resultsbl(12) ,resultsyl(12),cell_width my1array= array("energyblue","lifetimeblue","stateblue","lengthblue","currentblue","startblue","gammablue","lumiblue","momblue") my2array= array("energyyellow","lifetimeyellow","stateyellow","lengthyellow","currentyellow","startyellow","gammayellow","lumiyellow","momyellow") cell_width= array("70","25","100","70","70","55","55","55","25") log_width=120 tot_width=0 part_width=0 for i=0 to 8 part_width=part_width+cell_width(i) next tot_width=2*part_width+log_width %> <% response.write("" & Vbcrlf) for i=0 to 8 response.write("" & Vbcrlf) next for i=0 to 8 response.write("" & Vbcrlf) next response.write("" & Vbcrlf) Do While Not RS.EOF response.write("" & Vbcrlf) logtime=Cstr(RS("logtime")) response.write("" & Vbcrlf) for i=0 to 8 resultsbl(i)=cstr(RS(my1array(i))) response.write("" & Vbcrlf) next for i=0 to 8 resultsyl(i)=cstr(RS(my2array(i))) response.write("" & Vbcrlf) next response.write("") RS.Movenext Loop %>
Time BLUE Ring YELLOW Ring
 " &i+1&"" &i+1&"
"& logtime &""& resultsbl(i)&""& resultsyl(i)&"

 

 

<% Connection.Close Set RS=nothing Set Connection=nothing %>