subroutine plot(x,y,ipen) C C subroutine to move pen to a specified location C C X,Y(REAL)=co-ordinate value in mm. C IPEN(integer)=flag C < 0 redefine current pen position as origin C = 0 redefine current pen position as x,y C = 1 move to x,y with no change in pen condition C = 2 drop pen 1st,then move to x,y C = 3 raise pen 1st,then move to x,y C = 4 internal call from where to return pen position C = 999 return current pen to stall and move to home C C Screen resolution is 480v x 800h C The 88.25 factor gives the best ruler agreement. C ie. at a factor of 1 a call plot(0.,0.,3) followed by a C call plot(2.,0.,2) gives a 2 inch horizontal line. C byte isnx(1),isny(1),ip common/init/ilun,factor,imode,ipenst common/origin/xor,yor common/pos/xpos,ypos isnx(1)=' ' isny(1)=' ' ip='P' !default pen up if(ipenst.eq.0)ip='V' !pen down if(x.eq.999.)x=xpos !redfine current location if(y.eq.999.)y=ypos if(ipen.eq.999)goto 180 if(ipen.eq.4)goto 200 if(imode.eq.1)goto 130 !if relative plotting mode branch xpos=x !keep track of the current position ypos=y if(ipen.eq.0)return xu=(xor+x)*factor*88.25 !map X,Y into absolute screen values yu=(yor+y)*factor*88.25 goto 135 130 xu=x*88.25*factor !relative plotting mode yu=y*88.25*factor xpos=xpos+x !current location is relative to last ypos=ypos+y !position 135 if(ipen.ge.0)goto 145 140 xor=x+xor !redefine the current origin yor=y+yor return 145 if(ipen.eq.2)ip='V' !turn the beam on if(ipen.eq.3)ip='P' !turn it off if(imode.eq.1.and.xu.ge.0.)isnx(1)='+' !precede X with + if relative if(imode.eq.1.and.yu.ge.0.)isny(1)='+' write(ilun,155)ip,isnx,xu,isny,yu 155 format(' 'A1'['A1,F','A1,F']') !write the REGIS commands ipenst=1 !set the beam on flag if(ip.eq.'V')ipenst=0 !or beam off RETURN 180 write(ilun,190)27 190 format(' 'A1'\') !exit REGIS mode return 200 x=xpos y=ypos return end