<%@ LANGUAGE="VBScript" %> <% start_time = Time Server.ScriptTimeOut=600 Set Connection = Server.CreateObject("ADODB.Connection") Connection.Mode = adModeRead Connection.Open phdb_rd Typequery="select sensor_type,MAX(mask_revision) mask_revision from sitester.batch_info where sensor_type="+Request("type")+" and status>0 group by sensor_type" Set Type_mask = Connection.Execute(Typequery) 'Sensorsubquery2="(select batch,sensor from assembly.asm_sensor_bond_id)" 'Sensorsubquery1="(select batch,sensor,MAX(logdate) from sitester.sensor_log where action='Logging' and (measurement_type like 'Accepted%' or measurement_type like 'Reject%') and (batch,sensor) not in "+Sensorsubquery2+" group by batch,sensor)" 'SensorQuery = "select sl.batch batch,sensor from sitester.sensor_log sl,sitester.batch_info bi where (sl.batch,sensor,logdate) in "+Sensorsubquery1+" and sl.batch=bi.batch and bi.status>0 and measurement_type like 'Accepted%' and measurement_type <> 'Accepted50' and sensor_type="+Request("type")+" order by sl.batch,sensor" Sensorsubquery1_2="(select batch,sensor,MAX(logdate) from sitester.sensor_log where measurement_type='Sensor_data' group by batch,sensor)" Sensorsubquery3="(select batch,sensor from assembly.asm_sensor_bond_id)" Sensorsubquery2="(select batch,sensor,MAX(logdate) from sitester.sensor_log where action='Logging' and (measurement_type like 'Accepted%' or measurement_type like 'Reject%') and (batch,sensor) not in "+Sensorsubquery3+" group by batch,sensor)" Sensorsubquery1 = "(select sl.batch batch,sensor from sitester.sensor_log sl,sitester.batch_info bi where (sl.batch,sensor,logdate) in "+Sensorsubquery2+" and sl.batch=bi.batch and bi.status>0 and measurement_type like 'Accepted%' and measurement_type <> 'Accepted50' and sensor_type="+Request("type")+")" Sensorquery="select * from sitester.sensor_log,sitester.sensor_properties where (batch,sensor) in "+Sensorsubquery1+" and (batch,sensor,logdate) in "+Sensorsubquery1_2+" and logdate=entrydate order by batch,sensor" Set Avail_sensor_d = Connection.Execute(Sensorquery) Sensorsubquery1_2="(select distinct batch,sensor from sitester.sensor_log where measurement_type='Sensor_data')" Sensorsubquery3="(select batch,sensor from assembly.asm_sensor_bond_id)" Sensorsubquery2="(select batch,sensor,MAX(logdate) from sitester.sensor_log where action='Logging' and (measurement_type like 'Accepted%' or measurement_type like 'Reject%') and (batch,sensor) not in "+Sensorsubquery3+" group by batch,sensor)" Sensorsubquery1 = "(select sl.batch batch,sensor,logdate from sitester.sensor_log sl,sitester.batch_info bi where (sl.batch,sensor,logdate) in "+Sensorsubquery2+" and sl.batch=bi.batch and bi.status>0 and measurement_type like 'Accepted%' and measurement_type <> 'Accepted50' and sensor_type="+Request("type")+")" Sensorquery="select * from sitester.sensor_log sl,sitester.sensor_measurement_list sml where (batch,sensor,logdate) in "+Sensorsubquery1+" and (batch,sensor) in "+Sensorsubquery1_2+" and sl.measurement_type=sml.measurement_type order by batch,sensor" Set Avail_sensor_d_accept = Connection.Execute(Sensorquery) Sensorsubquery1_2="(select distinct batch,sensor from sitester.sensor_log where measurement_type='Sensor_data')" Sensorsubquery3="(select batch,sensor from assembly.asm_sensor_bond_id)" Sensorsubquery2="(select batch,sensor,MAX(logdate) from sitester.sensor_log where action='Logging' and (measurement_type like 'Accepted%' or measurement_type like 'Reject%') and (batch,sensor) not in "+Sensorsubquery3+" group by batch,sensor)" Sensorsubquery1 = "(select sl.batch batch,sensor,logdate from sitester.sensor_log sl,sitester.batch_info bi where (sl.batch,sensor,logdate) in "+Sensorsubquery2+" and sl.batch=bi.batch and bi.status>0 and measurement_type like 'Accepted%' and measurement_type <> 'Accepted50' and sensor_type="+Request("type")+")" Sensorquery="select batch,sensor,logdate,description from sitester.sensor_log sl,sitester.sensor_measurement_list sml where (batch,sensor,logdate) in "+Sensorsubquery1+" and (batch,sensor) not in "+Sensorsubquery1_2+" and sl.measurement_type=sml.measurement_type order by batch,sensor" Set Avail_sensor_nd = Connection.Execute(Sensorquery) %> <% Dim index() Dim batch() Dim sensor() Dim Ib_voper() Dim Ig_voper() Dim PlateauLV() Dim PlateauUV() Dim Vfd() Dim Voper() Dim LT_current() Dim LT_time() Dim PolyRes() Dim PolyResErr() Dim SOGC() Dim ONOC() Dim Cbreak() Dim Shorts() Dim CV_pads_tested() Dim Pinholes() Dim Pinholes_pads_tested() Dim Percentage() Dim Acceptance() sensor_type=CInt(Type_mask("sensor_type")) num_sensors=-1 current_batch="" current_sensor=0 Do While Not Avail_sensor_d.EOF If (current_sensor<>CInt(Avail_sensor_d("sensor"))) or (current_batch<>CStr(Avail_sensor_d("batch"))) Then num_sensors=num_sensors+1 ReDim Preserve batch(num_sensors) ReDim Preserve sensor(num_sensors) ReDim Preserve Ib_voper(num_sensors) ReDim Preserve Ig_voper(num_sensors) ReDim Preserve PlateauLV(num_sensors) ReDim Preserve PlateauUV(num_sensors) ReDim Preserve Vfd(num_sensors) ReDim Preserve Voper(num_sensors) ReDim Preserve LT_current(num_sensors) ReDim Preserve LT_time(num_sensors) ReDim Preserve PolyRes(num_sensors) ReDim Preserve PolyResErr(num_sensors) ReDim Preserve SOGC(num_sensors) ReDim Preserve ONOC(num_sensors) ReDim Preserve Cbreak(num_sensors) ReDim Preserve Shorts(num_sensors) ReDim Preserve CV_pads_tested(num_sensors) ReDim Preserve Pinholes(num_sensors) ReDim Preserve Pinholes_pads_tested(num_sensors) ReDim Preserve Percentage(num_sensors) ReDim Preserve Acceptance(num_sensors) batch(num_sensors)=CStr(Avail_sensor_d("batch")) sensor(num_sensors)=CInt(Avail_sensor_d("sensor")) current_batch=CStr(Avail_sensor_d("batch")) current_sensor=CInt(Avail_sensor_d("sensor")) If (current_batch = CStr(Avail_sensor_d_accept("batch"))) and (current_sensor = CInt(Avail_sensor_d_accept("sensor"))) Then Acceptance(num_sensors)=CStr(Avail_sensor_d_accept("description")) Avail_sensor_d_accept.MoveNext End If End If Select Case CStr(Avail_sensor_d("measurement_id")) Case "CV_pads_tested" CV_pads_tested(num_sensors)=CInt(Avail_sensor_d("measurement_value")) Case "Cbreak" Cbreak(num_sensors)=CInt(Avail_sensor_d("measurement_value")) Case "Ib_voper" Ib_voper(num_sensors)=CDbl(Avail_sensor_d("measurement_value")) Case "Ig_voper" Ig_voper(num_sensors)=CDbl(Avail_sensor_d("measurement_value")) Case "LT_current" LT_current(num_sensors)=CDbl(Avail_sensor_d("measurement_value")) Case "LT_time" LT_time(num_sensors)=CDbl(Avail_sensor_d("measurement_value")) Case "ONOC" ONOC(num_sensors)=CDbl(Avail_sensor_d("measurement_value")) Case "Percentage" Percentage(num_sensors)=CDbl(Avail_sensor_d("measurement_value")) Case "Pinholes" Pinholes(num_sensors)=CInt(Avail_sensor_d("measurement_value")) Case "Pinholes_pads_tested" Pinholes_pads_tested(num_sensors)=CInt(Avail_sensor_d("measurement_value")) Case "PlateauLV" PlateauLV(num_sensors)=CInt(Avail_sensor_d("measurement_value")) Case "PlateauUV" PlateauUV(num_sensors)=CInt(Avail_sensor_d("measurement_value")) Case "PolyRes" PolyRes(num_sensors)=CDbl(Avail_sensor_d("measurement_value")) Case "PolyResErr" PolyResErr(num_sensors)=CDbl(Avail_sensor_d("measurement_value")) Case "Shorts" Shorts(num_sensors)=CInt(Avail_sensor_d("measurement_value")) Case "SOGC" SOGC(num_sensors)=CDbl(Avail_sensor_d("measurement_value")) Case "Vfd" Vfd(num_sensors)=CDbl(Avail_sensor_d("measurement_value")) Case "Voper" Voper(num_sensors)=CInt(Avail_sensor_d("measurement_value")) End Select Avail_sensor_d.MoveNext Loop %> <% If num_sensors>-1 Then ReDim index(num_sensors) nblank=0 index(0)=0 If IsEmpty(Vfd(0)) Then nblank=1 End If If num_sensors>0 Then For i=1 To num_sensors If IsEmpty(Vfd(i)) Then index(i)=i nblank=nblank+1 Else j=0 Do While j1) index_temp=index(current_index) index(current_index)=index(current_index-1) index(current_index-1)=index_temp current_index=current_index-1 Loop If current_index=1 Then If Vfd(index(current_index)) <%= Sensor_Name_Title(CInt(Type_mask("sensor_type")),CInt(Type_mask("mask_revision"))) %> Available Sensors

<%= Sensor_Name_Title(CInt(Type_mask("sensor_type")),CInt(Type_mask("mask_revision"))) %> Sensors Available for Mounting

<% If num_sensors>-1 Then %>

Sensors with properties recorded (sorted by Vfd)

<% If (sensor_type>0) and (sensor_type<6) Then %> <% End If %> <% If (sensor_type>0) and (sensor_type<6) Then %> <% End If %> <% For i=0 To num_sensors %> <% If (sensor_type>0) and (sensor_type<6) Then %> <% End If %> <% If (sensor_type>0) and (sensor_type<6) Then %> <% End If %> <% Next %>
Batch Sensor Vfd Voper Ib @ Voper Ig @ VoperPlateauPoly SOG ONO Breaks Shorts Pinholes % BrokenLongtermAcceptance
<%= batch(index(i)) %> <%= sensor(index(i)) %> <% If Not IsEmpty(Vfd(index(i))) Then Response.Write(CStr(Vfd(index(i)))) Else Response.Write(" ") End If %> <% If Not IsEmpty(Voper(index(i))) Then Response.Write(CStr(Voper(index(i)))) Else Response.Write(" ") End If %> <% If Not IsEmpty(Ib_voper(index(i))) Then Response.Write(CStr(Ib_voper(index(i)))) Else Response.Write(" ") End If %> <% If Not IsEmpty(Ig_voper(index(i))) Then Response.Write(CStr(Ig_voper(index(i)))) Else Response.Write(" ") End If %> <% If (Not IsEmpty(PlateauLV(index(i)))) and (Not IsEmpty(PlateauUV(index(i)))) Then Response.Write(CStr(PlateauLV(index(i)))+" - "+CStr(PlateauUV(index(i)))) Else Response.Write(" ") End If %> <% If Not IsEmpty(PolyRes(index(i))) Then Response.Write(CStr(PolyRes(index(i)))) Else Response.Write(" ") End If %> <% If Not IsEmpty(SOGC(index(i))) Then Response.Write(CStr(SOGC(index(i)))) Else Response.Write(" ") End If %> <% If Not IsEmpty(ONOC(index(i))) Then Response.Write(CStr(ONOC(index(i)))) Else Response.Write(" ") End If %> <% If Not IsEmpty(Cbreak(index(i))) Then Response.Write(CStr(Cbreak(index(i)))) Else Response.Write(" ") End If %> <% If Not IsEmpty(Shorts(index(i))) Then Response.Write(CStr(Shorts(index(i)))) Else Response.Write(" ") End If %> <% If Not IsEmpty(Pinholes(index(i))) Then Response.Write(CStr(Pinholes(index(i)))) Else Response.Write(" ") End If %> <% If Not IsEmpty(Percentage(index(i))) Then Response.Write(CStr(100*Percentage(index(i)))) Else Response.Write(" ") End If %> <% If (Not IsEmpty(LT_current(index(i)))) and (Not IsEmpty(LT_time(index(i)))) Then Response.Write(CStr(LT_current(index(i)))+" ľA after "+CStr(LT_time(index(i)))+" days") Else Response.Write(" ") End If %> <% If Not IsEmpty(Acceptance(index(i))) Then Response.Write(CStr(Acceptance(index(i)))) Else Response.Write(" ") End If %>
<% End If %>

Sensors with no properties recorded (must be done with batch report)

<% Do While Not Avail_sensor_nd.EOF %> <% Avail_sensor_nd.MoveNext Loop %>
Batch Sensor Acceptance
<%= Avail_sensor_nd("batch") %> <%= Avail_sensor_nd("sensor") %> <%= Avail_sensor_nd("description") %>
<% Connection.Close %>