can't get captions to work using FORTRAN calls

can't get captions to work using FORTRAN calls

There is a subroutine avcreatecaption but I can't get it to work. It throughs a protection exception when called. I can create captions in the viewer, but that is not sufficient for my needs. Has anyone been able to get this to work with FORTRAN calls? If so, please provide an example.

2 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Even with no example provided and in spite of the weak help files I have been able to get array visualizer captions to work using FORTRAN calls. I tried toupload a modified vrsion of xyzgraphics that illustrates how it is done, but the website won't process the upload. A very tedious process to accomplish. Here is the code:

program xyzgraphics

use AvFRT

use avObjMod

IMPLICIT NONE

integer, parameter ::numcols=40, numrows=40

real(16), parameter :: pi=3.14159265

real :: x, y

real(4) :: M(numcols, numrows), N(numcols, numrows)

integer :: dim2d(2) = 0

integer status, viewerId, i, j, k

integer(int_ptr_kind()) :: data_root,sig_types,datasets,dataset,hcaptions,hcaption,hborder,hposition

integer isig_type,n_graphs

real*8 porigin1(3),porigin2(3),torigin(3)

real*4 textstart(2),psize1(3),psize2(3),tsize(3),rotation1,rotation2,tsize2(3)

character*34 axis1_name, axis2_name

character*2 sel_svar1,sel_svar2

data porigin2,porigin1,torigin/.9,-1.25,0.,-.9,1.25,0.,-1.,0.,0./

data psize2,psize1,tsize/.3,2.,0.,2.,.3,0.,1.,1.,0./

data rotation2,rotation1/90.,180./

data textstart/0.,0./

!call avLoadTemplate("master.xml", "", status)

do j=1, numrows

y = (j-1.0)/(numrows-1.0)

do i=1, numcols

x = (i-1.0)/(numcols-1.0)

m(i, j) = 1.0/(sin(y*pi)+cos(x*pi))

end do

end do

dim2d = shape(M)

call avStartWatch(LOC(M), 2, dim2d, AV_REAL4, "M", status)

call avCreateGraph3D("graph1", "plot:HEIGHTPLOT, xysource:M, colorsource:M", status)

data_root = avgetobject ("/")

sig_types = avgraphs (data_root)

n_graphs = avcount (sig_types)

isig_type = avitem (sig_types,n_graphs)

hcaptions = avcaptions (isig_type)

sel_svar1 = 'TC'

sel_svar2 = 'TF'

call avcreatecaption (hcaptions,"axis1",hcaption)

call avsetautosize (hcaption,1,status)

call avsetfontface (hcaption,"Lucinda Console",status)

call avsethjustify (hcaption,1,status)

call avsetvjustify (hcaption,1,status)

write(axis1_name,"(6x,'min ',a2,' min')") sel_svar1

call avsettext (hcaption,axis1_name,status)

call avsettextstart (hcaption,textstart,status)

hborder=avborder (hcaption)

call avsetvisible (hborder,0,status)

hposition=avposition (hcaption)

call avsetorigin (hposition,porigin1,status)

call avsetsize (hposition,psize1,status)

hposition=avtransform (hcaption)

call avsetorigin (hposition,torigin,status)

call avsetsize (hposition,tsize,status)

call avsetrotation (hposition,1,rotation1,status)

call avcreatecaption (hcaptions,"axis2",hcaption)

call avsetautosize (hcaption,1,status)

call avsetfontface (hcaption,"Lucinda Console",status)

call avsethjustify (hcaption,1,status)

call avsetvjustify (hcaption,1,status)

write(axis2_name,"(6x,'min ',a2,' min')") sel_svar2

call avsettext (hcaption,axis2_name,status)

call avsettextstart (hcaption,textstart,status)

hborder=avborder (hcaption)

call avsetvisible (hborder,0,status)

hposition=avposition (hcaption)

call avsetorigin (hposition,porigin2,status)

call avsetsize (hposition,psize2,status)

hposition=avtransform (hcaption)

call avsetorigin (hposition,torigin,status)

call avsetsize (hposition,tsize,status)

call avsetrotation (hposition,1,rotation2,status)

call avNewViewer(viewerId)

call avSetViewerPath(viewerId, "graph:/graph1", status)

call avVisible(viewerId, AV_TRUE, status)

print *, "press enter to continue"

read *

call avCloseViewer(viewerId, status)

call avendwatch(loc(M),status)

end program xyzgraphics

Accedere per lasciare un commento.