%@ Language=VBScript %><% option explicit %>
<% Response.Buffer = FALSE %>
<% Response.ContentType = "image/svg+xml" %>
<%
DIM ScreenWidth, ScreenHeight
DIM timeout
DIM actorname
DIM legend 'legend assigned by choice table
DIM Tx 'TO joint, x dimension
DIM Ty 'TO joint, y dimension
DIM Tz 'TO joint, z dimension
DIM Fx 'FROM joint, x dimension
DIM Fy 'FROM joint, y dimension
DIM Fz 'FROM joint, z dimension
DIM Min_fx, Min_tx, Min_X
DIM Min_fy, Min_ty, Min_Y
DIM Min_fz, Min_tz, Min_Z
DIM Max_fx, Max_tx, Max_X
DIM Max_fy, Max_ty, Max_Y
DIM Max_fz, Max_tz, Max_Z
DIM msg '-- for errors
DIM CS_1, CS_2 'Connection String
DIM RS_0, Q_0, SID 'RecordSet, Query - for sessionID
DIM RS_1, RS_2, RS_3, RS_4, RS_5 'RecordSet
DIM Q_1, Q_2, Q_3, Q_4, Q_5 'SQL query against the db
DIM regExD 'regular expression for fixing the date & time
DIM distance, direction, level
DIM diam, colour
'' extend the timeout to allow for long files
timeout = Server.ScriptTimeout
'' Response.Write "Initial timeout=" & timeout & " "
Server.ScriptTimeout = 1200
CS_1 = "DSN=f_humble"
' SID = Request.Cookies("Humble")("SID")
SID = 1
Q_0 = "SELECT * FROM Audience WHERE SID=" & SID
' Response.Write Q_0 & " "
SET RS_0 = Server.CreateObject("ADODB.Recordset")
RS_0.Open Q_0, CS_1, adOpenKeySet, adLockPessimistic, adCmdText
IF RS_0.EOF THEN
Response.Redirect("http:../help/session.htm")
END IF
ScreenWidth = RS_0.Fields("ScreenWidth")
ScreenHeight = RS_0.Fields("ScreenHeight")
direction = RS_0.Fields("direction")
level = RS_0.Fields("level")
distance = RS_0.Fields("distance")
actorname = "pose_3"
'-- Skelly_body table with position data --
CS_2 = "DSN=p_humble"
Q_2 = "SELECT MIN( Sp_fx) AS Min_fx, MIN( Sp_tx) AS Min_tx, MIN( Sp_fy) AS Min_fy, MIN( Sp_ty) AS Min_ty, MIN( Sp_fz) AS Min_fz, MIN( Sp_tz) AS Min_tz, " _
& "MAX( Sp_fx) AS Max_fx, MAX( Sp_tx) AS Max_tx, MAX( Sp_fy) AS Max_fy, MAX( Sp_ty) AS Max_ty, MAX( Sp_fz) AS Max_fz, MAX( Sp_tz) AS Max_tz FROM " & actorname
SET RS_2 = Server.CreateObject("ADODB.Recordset")
RS_2.Open Q_2, CS_2, adOpenStatic, adLockOptimistic, adCmdText
Min_fx = RS_2.Fields("Min_fx")
Min_tx = RS_2.Fields("Min_tx")
Min_fy = RS_2.Fields("Min_fy")
Min_ty = RS_2.Fields("Min_ty")
Min_fz = RS_2.Fields("Min_fz")
Min_tz = RS_2.Fields("Min_tz")
Max_fx = RS_2.Fields("Max_fx")
Max_tx = RS_2.Fields("Max_tx")
Max_fy = RS_2.Fields("Max_fy")
Max_ty = RS_2.Fields("Max_ty")
Max_fz = RS_2.Fields("Max_fz")
Max_tz = RS_2.Fields("Max_tz")
RS_2.Close
IF Min_fx < Min_tx THEN
Min_X = Min_fx
ELSE
Min_X = Min_tx
END IF
IF Min_fy < Min_ty THEN
Min_Y = Min_fy
ELSE
Min_Y = Min_ty
END IF
IF Min_fz < Min_tz THEN
Min_Z = Min_fz
ELSE
Min_Z = Min_tz
END IF
IF Max_fx < Max_tx THEN
Max_X = Max_fx
ELSE
Max_X = Max_tx
END IF
IF Max_fy < Max_ty THEN
Max_Y = Max_fy
ELSE
Max_Y = Max_ty
END IF
IF Max_fz < Max_tz THEN
Max_Z = Max_fz
ELSE
Max_Z = Max_tz
END IF
Q_1 = "SELECT Sp_fx, Sp_fy, Sp_fz, Sp_tx, Sp_ty, Sp_tz, diam, colour FROM " _
& actorname & " ORDER BY o_bf"
' Response.Write Q_1 & " " '--causes SVG error, see with copy SVG
SET RS_1 = Server.CreateObject("ADODB.Recordset")
RS_1.Open Q_1, CS_2, adOpenStatic, adLockOptimistic, adCmdText
' set it up for a graph bounding box of 2000 horizontal by 1000 vertical
%>
<%
'' reset the timeout
Server.ScriptTimeout = timeout
Response.End '-----------------------------------------------------------%>