[AQT-dev] AquaTerm/FORTRAN
Brought to you by:
persquare
From: Per P. <per...@ma...> - 2002-03-19 21:50:29
|
On m=E5ndag, mars 18, 2002, at 08:51 , Craig Hunter wrote: > Per, > > I am writing a FORTRAN code to call Aquaterm for plotting some data. =20= > When > we run CFD simulations, there are about 5-6 quantities we like to=20 > monitor, > and it usually involves using a special plotting package. With=20 > Aquaterm, I > can create quick simple plots in seconds, and it's perfect. > > I have a few questions for you: > > 1) is there a direct way to display numerical data in the plot window? No, not really, but remember that you are free to do whatever suits you=20= on the adapter side:-) > I read in several variables, and want to list some of them on the=20 > screen. I > have tried reading them as text, and they look fine when listed in the > terminal, but I get all sorts of hieroglyphics (what may be line break > characters or something) when I try to display them in Aquaterm. Sounds like encoding problems... > > Regular text displays fine: > > CALL f2aqt_put_text(mrgn, y_size-mrgn, '2.06') > > But using the command: > > CALL f2aqt_put_text(mrgn, y_size-mrgn, txt) > > Where txt=3D'2.06' was read in from a data file, gives problems. > > If there is a direct way to print numbers without having to > read/format/write them as text, it would bypass the whole issue. Just add a another function to the f2aqt file: We already have: int f2aqt_put_text__(int *x, int *y, const char *str) { if (!strlen(str)) return; [gnuTermAccess putText:str at:NSMakePoint(*x, *y)]; } so I'd suggest something like: int f2aqt_put_float__(int *x, int *y, float *number) { /* This is a bit awkward, since we do number --> string object -->=20 char * and then back to string object in the gnuTermAccess object... If anything, this tells us that the f2aqt was a quick hack, that=20= needs improvement! NB. replace %f with whatever format you require */ [gnuTermAccess putText:[[NSString stringWithFormat:@"%f", *number]=20 lossyCString] at:NSMakePoint(*x, *y)]; } (written from the top of my head, never tested;-) > 2) How do I set up multiple plot windows, each containing a different=20= > plot? > Now that's easy! Use the method - setFigure: Add a function like this to f2aqt: int f2aqt_set_figure__(int *fig) { [gnuTermAccess setFigure:*fig];=09 } and just calling it with any number n >=3D 0 will open Figure n for=20 drawing (but not shown until you call render...). Don't forget to add their prototypes at the beginning of the file, just=20= follow the general structure of f2aqt and you'll be OK! There are some new documentation on http://aquaterm.sourceforge.net/ on=20= how to write adapters. FYI, I'll be releasing a 0.3.0 version of AquaTerm within a couple of=20 weeks (months?) and after that I'll turn to looking at adding/improving=20= adapters. If there are features that you'd like to see in a fortran=20 adapter, pleas let me know. The preferred way would be via the feature=20= request link on http://aquaterm.sourceforge.net/ or the aquaterm=20 developer mail list (that way everything gets logged, and more likely to=20= be considered;-) HTH, Per |