forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

More Diagnostics for %pl of Simpleplot
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Suggestions
View previous topic :: View next topic  
Author Message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7912
Location: Salford, UK

PostPosted: Tue Mar 19, 2013 3:27 pm    Post subject: Reply with quote

Thank you. I will give it a try and, if successful, add the module to the FTN95 release.
Back to top
View user's profile Send private message AIM Address
aebolzan



Joined: 06 Jul 2007
Posts: 229
Location: La Plata, Argentina

PostPosted: Tue Mar 19, 2013 4:16 pm    Post subject: Reply with quote

Subroutines
CALL DDDATA, CALL DEVNAM, CALL OWNNEW, CALL OUTBUF and CALL WINDOW_UPDATE@ are described in FSimpleplot.chm. I still have a hardcopy of the manuals but I do not find the description of the module. It is quite possible that David Butland sent me that...looong time ago when we used to use a fax for comunications. Apparently the installation guide of Simpleplot for FTN77/90/95 came appart from the manuals.

In the examples that appear in the CHM file you can see that they include a "use spmodule" statement ....as far as I remember the spmodule was automatically created by the instalation disks of the distribution of Simpleplot provided by BUSS. I guess that that module was the same as the one I use today. I have now in front of me, the distribution disks of version 2.15 (not much different that the one coming with FTN95 today) dated...1998....it says...for Win95/NT....I have to find a PC were one can read a 1.44 disk nowadays!.....

Best wishes,

Agustin
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Tue Mar 19, 2013 10:49 pm    Post subject: Reply with quote

Thanks Agustin. Tics versus numbering displacements here are not that bad as in %pl, and on X axis all looks just perfect. Have you tried to find how to use modern fonts instead of default ones? Changing just the fonts would blow outdated look and feel of the plots. I've tried contacting author several times over past decade or so but besides just the first one all emails bounced back or were not answered. If he still alive may be our UK folks can try to find him and ask if he can fix those small but important issues or give out the sources.

I am not super-interested with this package because over decades of using this compiler i developed my own graphics programs (written purely in this Fortran) but i know that to make them perfect takes a lot of time and i am not yet finished (see some in User's Examples below), so others may look at just improving existing resources.

Just will comment if others will want to try: compilation is with the SIMPLE.DLL not simpleplot.dll (you probably still keep original DLL from the developer!) and by some reason compiler does not find this DLL in default FTN95 own dir so it should be in the same dir as your code.

Are there other Fortran examples of , say, 2D surface plots, 3D plots? Editing existing texts is much easier then writing from zero based on the description
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7912
Location: Salford, UK

PostPosted: Wed Mar 20, 2013 9:01 am    Post subject: Reply with quote

A word of caution to those who are thinking of investing time in %pl or SIMPLEPLOT, if you may need to port to 64 bit in the future then direct access to simple.dll will no longer be possible.
Back to top
View user's profile Send private message AIM Address
aebolzan



Joined: 06 Jul 2007
Posts: 229
Location: La Plata, Argentina

PostPosted: Wed Mar 20, 2013 7:39 pm    Post subject: Reply with quote

Caution words of Paul: are quite right!. Simpleplot is good as it is, no more no less. In fact, it uses only real*4 and integer*4 variables, which can bother quite a lot when one uses real*8 variables along the program and they need every time to be converted to real*4.

Modern fonts: fonts were always a problem with Simpleplot. I remeber that in the old good days people of Salford and BUSS used to have one (or two?) days workshops for discussing with customers the use and development of the set Salford compilers + Simpleplot. As far as I remember they thought once about using TeX fonts with Simpleplot (very nice idea for me) but for some problems that idea was abandoned very fast. There is a subroutine called CHSET(INT) that should allow to use different set of fonts (Hershey fonts among others), but I am not sure if it works fine nowadays.

Contact authors: as one day I woke up and found that "Salford Compilers" disappeared, so did BUSS suddenly. I do not believe that it is possible to contact those people that were involved in Simpleplot (even my old e-mails with them disappeared during a change of e-mail client in my PC, so I hardly remember their names, just one or two). But I might be wrong...who knows....

Simple.dll: yes, I made a mistake in my program saying "simpleplot.dll" instead of "simple.dll"...sorry...

3D plots: here is a short example of a 3D plot (it needs the previous spwin module) that comes from the Simpleplot help file:

Code:

program Simpleplot_plots_3
!requires simple.dll
use mswin
use spwin
integer*4 ans
INTEGER*4, PARAMETER :: NX = 10, NY = 10
REAL*4, DIMENSION(NX, NY) :: Z2ARR
DATA Z2ARR/0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,     &
             0.0, -2.6, -3.8, -1.4, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,  &
             0.0, -3.8, -5.9, -2.3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,  &
             0.0, -1.4, -2.3, -0.4, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,  &
             0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,     &
             0.0, 1.5, 1.7, 1.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,     &
             1.8, 1.4, 2.3, 0.4, 1.1, 0.0, 0.0, 8.0, 8.0, 0.0,     &
             2.2, 3.8, 5.9, 2.3, 1.7, 0.0, 0.0, 8.0, 8.0, 0.0,     &
             2.1, 2.6, 3.8, 1.4, 1.5, 0.0, 0.0, 0.0, 0.0, 0.0,     &
             1.0, 2.1, 2.2, 1.8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0/
HDC_DIM%iWidth = 800
HDC_DIM%iHeight = 600
HDC_DIM%iBitmapDC = GET_Bitmap_DC@(HDC_DIM%iWidth, HDC_DIM%iHeight)
CALL SP_SupplyBitmap     ! Pass Bitmap to SIMPLEPLOT
call chset(17)
CALL RGSURF(Z2ARR, NX, NY)            ! draw surface picture
CALL TITLE7('Top', 'Centre', 'A simple surface outline')
call UpdateWin
ans=winio@('%ca[A Simple Plot with Simpleplot]%bg[white]&')
ans=winio@('%dw&',HDC_DIM%iBitmapDC) ! Pass bitmapDC to ClearWin
ans=winio@('%ff%nl%cn%6bt[Close]')
end program simpleplot_plots_3
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Thu Mar 21, 2013 1:02 pm    Post subject: Reply with quote

Choosing fonts with this compiler is just one line of Fortran text.

Code:

   call SELECT_FONT@( Fontname)


Same one line is making it bold/regular/italic or change its size. I do that with my regular 2D graphics for years choosing any of 300 available fonts in the computer. I have difficulty only with 3D fonts of OpenGL, because i never learned OpenGL seriously, just by tries and faults inspired by this compiler examples and there were no font usage example Very Happy

So if try to find the owner and ask him to release the code sources changing fonts would be super easy. As well as turning all into real*8 and fixing its damn tic marks misplacement in %pl because finding font length and hight to center it correctly is also just one line of text.

Code:
call get_text_size@ ('YourText', ifontLength, ifontHight)


Then, if all will be successful, i hope that Paul would find how to recompile it for 64-bit. I'm trying to stress again that it is at least much easier then to write the new graphics package from scratch - that is YEARS of work
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Sat Mar 23, 2013 12:26 pm    Post subject: Reply with quote

Dan,

The date on the DLL is the giveaway. 3rd party software developers couldn't implement TrueType fonts as quickly as Microsoft, and it is only in Windows 98 that they became reasonably accessible. Before that, the problem of fonts was almost insurmountable. I was using pen plotters at the time, and I remember spending ages digitising plotter fonts with pen_up, pen_down and move_pen commands. They looked unrecognisable at small sizes and horrible at large sizes. FTN77/DBOS graphics used similar stick fonts digitised as the 'Hershey fonts', with equivalent problems. The simpleplot developers must have faced the same problems.
I agree that it is a shame that BUSS withdrew, and agree that it would be excellent if Simpleplot could be brought up to date, but I don't think it can happen.

Eddie
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2551
Location: Sydney

PostPosted: Mon Mar 25, 2013 1:00 am    Post subject: Reply with quote

Does David Butland or any others from BUSS still exist ?
Would it be possible to contact someone who developed the software and see if they would now allow some maintenance of these problems ?
Or did they withdraw their association with Salford/Silverfrost ?

We are now getting to the stage where old Fortran packages are now being lost!

John
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7912
Location: Salford, UK

PostPosted: Fri Mar 29, 2013 10:37 am    Post subject: Reply with quote

I have added the sample code above to the ClearWin+ documentation in the standard help file ftn95.chm.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Wed May 01, 2013 3:55 pm    Post subject: Reply with quote

Agustin,
I just right now noticed from your 2D x-y plot example when tried to play with it a bit more that it does not allow mouse resize using %pv. Can it be done? Or if it can which means using %pl, then all axis ticks always misalign (and that is exactly the case in similar direct call to SIMPLE.DLL example from FTN95 Help)?
Back to top
View user's profile Send private message
aebolzan



Joined: 06 Jul 2007
Posts: 229
Location: La Plata, Argentina

PostPosted: Mon May 06, 2013 9:59 pm    Post subject: Reply with quote

%dw can be resized as stated in the Help file, but it needs a call-back function....here is the new code for my old plot....remember that you need the spwin module that I did not put here this time...

Code:

module funciones
contains
integer function bitmap()
use spwin
use mswin
integer x,y,resize,bitmapdc
real*4,dimension(100) ::xarr,yarr
integer*4 :: narr,ltype,xscale,yscale,ctype,i,ans
character(8) :: xlabel="x",ylabel="y",ptype
real*4 :: minx,maxx,miny,maxy
resize=clearwin_info@('GRAPHICS_RESIZING')
IF(resize.EQ.1)THEN
x=clearwin_info@('GRAPHICS_WIDTH')
y=clearwin_info@('GRAPHICS_DEPTH')
HDC_DIM%iWidth = x
HDC_DIM%iHeight = y
HDC_DIM%iBitmapDC=clearwin_info@('GRAPHICS_DC')
CALL SP_SupplyBitmap     ! Pass Bitmap to SIMPLEPLOT
narr=0
do i=1,100
  xarr(i)=2*i
  yarr(i)=i*i
  narr=narr+1
end do
minx=minval(xarr)
maxx=maxval(xarr)
miny=minval(yarr)
maxy=maxval(yarr)
xscale=1;yscale=1
call initsp
call pgfull(.true.)
!scale factor for text in graph
call textmg(1.5)
!characters set
call chset(0)
!direction of ticks: in, out
call axsbtk('XC','I')
call axsbtk('YC','O')
!line thickness
call thckmg('L',2.0)
!location of labels in the axes
CALL AXLBJS('**', 'Centre')
minx=minval(xarr)
maxx=maxval(xarr)
miny=minval(yarr)
maxy=maxval(yarr)
!define the graph scales: max and min values of x and y and the type of scales: 1-linear, 2-log
xscale=1;yscale=1
CALL SCALES(minx,maxx,xscale,miny,maxy,yscale)
!pen color 1...for axes
call pen(4)
!cross point of x and y
call axcrss('YC',minx)
! labels of axes
CALL AXES7(xlabel, ylabel)   
!pen color for data 
call pen(2)
!full line or dashed?
!ltype=0, full line,ltype=1, dashed
ltype=0
ptype="scatter"
ptype="curve"
if(ptype=='curve') then
!cvtype=1 -> smooth
!cvtype=3 -> straight lines 
ctype=3
call cvtype(ctype)
CALL BRKNCV(real(xarr,1),real(yarr,1),narr,ltype)
else !scatter
CALL MKSET(1) !set of markers 1,2,3......
CALL MARKCV(real(xarr,1),real(yarr,1),narr,mtype,nstep)
endif
endif
bitmap=2
end function bitmap
end module funciones

program Resized_Simpleplot_plots
!requires simpleplot.dll
use mswin
use spwin
use funciones
implicit none
integer*4 ans
external bitmap
ans=winio@('%ca[A Simple Plot with Simpleplot]%bg[grey]&')
ans=winio@('%ww%pv%^dw[user_resize]&',800,600,bitmap) ! Pass bitmapDC to ClearWin
ans=winio@('%ff%nl%cn%6bt[Close]')
end program resized_simpleplot_plots


Hope this helps....

best regards,

Agustin
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Tue May 07, 2013 6:29 am    Post subject: Reply with quote

Thanks, Agustin
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Suggestions All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group