APSF,0 // Create Telescope vs. Eyepiece tables showing magnifications and FOVs dim c as Canvas, t as Table, itelescope,ieyepiece,iaid,y as integer, s as string dim Aids(-1) as VisualAidResource, Scopes(-1) as TelescopeResource dim mag,minmag,maxmag,minEyePupil,maxEyePupil as double minEyePupil = 0.63 maxEyePupil = 7.5 SetDoubleParameter("Min. eye pupil diameter",minEyePupil,0.4,9.0) SetDoubleParameter("Max. eye pupil diameter",maxEyePupil,0.4,9.0) if not EditParameters then return minEyePupil=GetDoubleParameter("Min. eye pupil diameter") maxEyePupil=GetDoubleParameter("Max. eye pupil diameter") // Get list of visual aids that change magnification for iaid=1 to nVisualAids if VisualAid(iaid).Magnification<>1.0 or VisualAid(iaid).FocalLength<>0.0 then Aids.Append VisualAid(iaid) end if next // Get list of non-binocular telescopes for itelescope=1 to nTelescopes if not Telescope(itelescope).IsBinocular then Scopes.Append Telescope(itelescope) end if next c=new Canvas(800,1000,"Magnification") c.TextFont("Geneva",12) t=new Table(nEyepieces+1,ubound(Scopes)+2) for itelescope=0 to ubound(Scopes) minmag=Scopes(itelescope).Aperture/maxEyePupil maxmag=Scopes(itelescope).Aperture/minEyePupil t.Cell(1,itelescope+2)=Scopes(itelescope).Name+" ("+str(round(minmag))+ _ "X to "+str(round(maxmag))+"X)" t.CellStyle(1,itelescope+2)=style_Inverted+style_Gray next for ieyepiece=1 to nEyepieces t.Cell(ieyepiece+1,1)=Eyepiece(ieyepiece).Name t.CellStyle(ieyepiece+1,1)=style_Inverted+style_Gray t.RowHeight(ieyepiece+1)=100.0*(ubound(Aids)+2) next t.CellStyle(1,1)=style_Bold t.ColumnWidth(1)=15.0 // Magnification table t.Cell(1,1)="Magnification" for itelescope=0 to ubound(Scopes) minmag=Scopes(itelescope).Aperture/maxEyePupil maxmag=Scopes(itelescope).Aperture/minEyePupil for ieyepiece=1 to nEyepieces s="" mag=round(Magnification(Scopes(itelescope), _ Eyepiece(ieyepiece),nil)) if mag>=minmag and mag<=maxmag then s=str(mag)+" X" for iaid=0 to ubound(Aids) mag=round(Magnification(Scopes(itelescope), _ Eyepiece(ieyepiece) ,Aids(iaid))) if mag>=minmag and mag<=maxmag then if s<>"" then s=s+NewLine s=s+str(mag)+" X (with "+Aids(iaid).Name+")" end if next t.Cell(ieyepiece+1,itelescope+2)=s next next y=c.DrawTable(t,0,0,c.Width,c.Height,grid_Thin) // FOV table t.Cell(1,1)="Field of View" for itelescope=0 to ubound(Scopes) minmag=Scopes(itelescope).Aperture/maxEyePupil maxmag=Scopes(itelescope).Aperture/minEyePupil for ieyepiece=1 to nEyepieces s="" mag=round(Magnification(Scopes(itelescope), _ Eyepiece(ieyepiece),nil)) if mag>=minmag and mag<=maxmag then _ s=AngleFormatted(ActualFOV(Scopes(itelescope),Eyepiece(ieyepiece))) for iaid=0 to ubound(Aids) mag=round(Magnification(Scopes(itelescope), _ Eyepiece(ieyepiece) ,Aids(iaid))) if mag>=minmag and mag<=maxmag then if s<>"" then s=s+NewLine s=s+AngleFormatted(ActualFOV(Scopes(itelescope),Eyepiece(ieyepiece),Aids(iaid)))+ _ " (with "+Aids(iaid).Name+")" end if next t.Cell(ieyepiece+1,itelescope+2)=s next next if nEyepieces>5 then c.NewPage y=c.DrawTable(t,0,0,c.Width,c.Height,grid_Thin) else y=c.DrawTable(t,0,y+20,c.Width,c.Height,grid_Thin) end if c.Close