{** General graphics routines **} {** ====================================================================== **} {** **} {** Draw axis for all channels at the bottom of the display grid **} {** **} {** ====================================================================== **} Procedure DrawAxis; Var i,dw,val : integer; Begin dw:=Round((stop-start-1)/5.0); for i:=1 to 5 do begin val:=Round((start+(i-1)*dw)/2.0); GoToXY((i-1)*10+3,24); Write(val:3); draw((i-1)*80+1,168,(i-1)*80+1,172,0); end; End; {** ====================================================================== **} {** **} {** Draw display grid for all channels **} {** **} {** ====================================================================== **} Procedure DrawGrid; Var deltay,linno : integer; i,j : integer; w,h : integer; Begin; FillScreen(1); w:=400; h:=170; {** Draw box **} draw(1,1,w,1,0); draw(1,h,w,h,0); draw(1,h,1,1,0); draw(w,h,w,1,0); {** Draw zero lines for all channels and mark channel number **} deltay:=Round(h/((gchan+hchan)*2)); for i:=1 to gchan do begin linno:=Round(22*((2*i-1)/((gchan+hchan)*2)))+1; GoToXY(2,linno); Write(i:1); for j:=1 to 20 do begin zero[i]:=deltay*(2*i-1); draw((j-1)*20+1,zero[i],j*20-5,zero[i],0); end; end; if (hchan>0) then begin linno:=Round(22*((2*(gchan+1)-1)/((gchan+hchan)*2)))+1; GoToXY(2,linno); Write(5:1); if zoomt then begin GoToXY(47,linno-1); Write('+',hoffset:2); end; for j:=1 to 20 do begin zero[5]:=deltay*(2*(gchan+1)-1); draw((j-1)*20+1,zero[5],j*20-5,zero[5],0); end; end; {** Draw border lines between channels **} top[1]:=1; for i:=1 to gchan-1 do begin top[i+1]:=deltay*2*i; draw(1,deltay*2*i,w,deltay*2*i,0); end; if (hchan>0) then begin for i:=gchan+1 to 5 do top[i]:=deltay*2*(i-1); draw(1,deltay*2*gchan,w,deltay*2*gchan,0); top[6]:=170; end else top[gchan+1]:=170; DrawAxis; End; {** ====================================================================== **} {** **} {** Display signals from a fired shot **} {** **} {** ====================================================================== **} Procedure DrawSignals; Var i,j,is,il,p1,p2 : integer; loffset : integer; step,aa,dh : real; Begin step := (stop-start)/200.0; dh := 170.0/(2*(gchan+hchan)); if zoomt then loffset:=hoffset else loffset:=0; if typscale=1 then begin for j:=1 to gchan do if enabl[j] then scaler[j]:=1.0 else scaler[j]:=0.0; if enabl[5] then scaler[5]:=1.0 else scaler[5]:=0.0; end; if typscale=2 then begin for j:=1 to gchan do if enabl[j] then if amp[j]>1.0 then scaler[j]:=dh/amp[j] else scaler[j]:=dh/1.0 else scaler[j]:=0.0; if enabl[5] then if amp[5]>1.0 then scaler[5]:=dh/amp[5] else scaler[5]:=dh/1.0 else scaler[5]:=0.0; end; if typscale=3 then begin aa:=-9999.9; for j:=1 to gchan do if enabl[j] then if aa200) then p1:=200; if (p2<0) then p2:=0; if (p2>200) then p2:=200; draw(i*2+1,p1,i*2+3,p2,0); end; if (hchan>0) then begin p1:=-Round(scaler[5]*ss[5,is+loffset])+zero[5]; p2:=-Round(scaler[5]*ss[5,il+loffset])+zero[5]; if (p1<0) then p1:=0; if (p1>200) then p1:=200; if (p2<0) then p2:=0; if (p2>200) then p2:=200; draw(i*2+1,p1,i*2+3,p2,0); end; end; End; {** ====================================================================== **} {** **} {** Draw FTB markers **} {** **} {** ====================================================================== **} Procedure DrawFTB; Var ndell,i : integer; loffset : integer; step : real; Begin step:=200.0/(stop-start); if zoomt then loffset:=hoffset else loffset:=0; for i:=1 to gchan do if enabl[i] then begin ndell:=2*Round((ndel[i]-start)*step)+1; draw(ndell,top[i],ndell,top[i+1],0); end; if (hchan>0) then if enabl[5] then begin ndell:=2*Round((ndel[5]-start-loffset)*step)+1; draw(ndell,top[5],ndell,top[5+1],0); end; End; {** ====================================================================== **} {** **} {** Draw Trigger windows **} {** **} {** ====================================================================== **} Procedure DrawTrgWind; Var ndell,i : integer; loffset : integer; step : real; Begin step:=200.0/(stop-start); if zoomt then loffset:=hoffset else loffset:=0; for i:=1 to gchan do if enabl[i] then begin ndell:=2*Round((twgl-start)*step)+1; draw(ndell,top[i],ndell,top[i+1],0); ndell:=2*Round((twgh-start)*step)+1; draw(ndell,top[i],ndell,top[i+1],0); end; if (hchan>0) then if enabl[5] then begin ndell:=2*Round((twhl-start-loffset)*step)+1; draw(ndell,top[5],ndell,top[5+1],0); ndell:=2*Round((twhh-start-loffset)*step)+1; draw(ndell,top[5],ndell,top[5+1],0); end; End; {** ====================================================================== **} {** **} {** Erase Trigger windows **} {** **} {** ====================================================================== **} Procedure ErasTrgWind; Var ndell,i : integer; loffset : integer; step : real; Begin step:=200.0/(stop-start); if zoomt then loffset:=hoffset else loffset:=0; for i:=1 to gchan do if enabl[i] then begin ndell:=2*Round((twgl-start)*step)+1; draw(ndell,top[i],ndell,top[i+1],1); ndell:=2*Round((twgh-start)*step)+1; draw(ndell,top[i],ndell,top[i+1],1); end; if (hchan>0) then if enabl[5] then begin ndell:=2*Round((twhl-start-loffset)*step)+1; draw(ndell,top[5],ndell,top[5+1],1); ndell:=2*Round((twhh-start-loffset)*step)+1; draw(ndell,top[5],ndell,top[5+1],1); end; End; {** ====================================================================== **} {** **} {** End of graphics routines for GTCS **} {** **} {** ====================================================================== **}