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 

Handling of I/O-Window
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
FK_GER



Joined: 26 Oct 2017
Posts: 17
Location: University of Kassel,Germany

PostPosted: Sat Mar 17, 2018 2:25 pm    Post subject: Reply with quote

Hi,Eddie
many thanks for your efforts to give me an understanding of FTN95. I realised the given example, but I must admit that the diction at FTN95 is very strange for me as an elder Fortran-user, who is grown up mainly with F4 and later on with F77.
For my purposes all file-handling, shown in your example, is too complex.
My programs are so-called "number-cruncher" and need for running only two ascii-files, one for input and one for output. Both can be handled with an editor (generate the input, print the output). The names of these files are read in the main program-window. The used drawing parts only demontrates some intermediate results to show the user, what is done inside the program flow. Graphics are not used for the program flow and are therefore not stored.

Therefore, during the last weeks I've reworked the basic process of my fortran programs, so that they work with FTN95-Compiler. For this purpose I study the manual and some relevant articles in the forum. Now, in principle all runs as usual by the 'old-way':
- depending on the screen-data the data for width,height and position of needed windows are calculated
- control window for program flow is opened
- name of data-input-file is read
- data-files for input and output(results of later calculation) are opened
- data is read
- parts of input-data and of intermediate results are drawed
- results are stored in the output file
In principle this course is demonstrated as follows:

!C program for calculating the ultimate limit state and deformation state
!C of reinforced concrete cross sections
!C loaded with biaxial bending moments and normal forces
WINAPP
INCLUDE <windows.ins>
PARAMETER (...,LDIM=10,NWDM = 50)

INTEGER win,xsiz,ysiz,xpos,ypos,fenb,fenh,deck,lecke,dpx,dpy
INTEGER font_h,WINH,WINB,WINX,WINY,winry,winrx
INTEGER ctrl,winio@
INTEGER plopix,plopiy,plob,ploh,plox,ployo,ployu
REAL*8 XPLOT(NWDM,LDIM),YPLOT(NWDM,LDIM)
COMMON /WINSET/ xpos,ypos,xsiz,ysiz,fenb,fenh,deck,lecke,dpx,dpy,
& winry,winrx
COMMON /QWPLOT/ plopix,plopiy,plob,ploh,plox,ployo,ployu
COMMON /QWINIT/ KWIN,WINH,WINB,WINX,WINY
COMMON /CONTRL/ ctrl
CHARACTER*40 NAMEFS /'QUERWERT Input-Output-Control-Window '/
DATA NDE/1/, NWR/4/, KRW/5/, NTB/9/, KSGR/66/, KWINI/10/
!calculating /WINSET/-data for width,heigth and position of windows
CALL INISET(1)
!C Control-window for input/output of program
win=create_window@(NAMEFS,xpos,ypos,xsiz,ysiz)
CALL set_default_window@(win)
CALL set_max_lines@(win,1000)
CALL open_to_window@(KRW,win)
.
!C Input of data-filename NAMEIN NAMAUS
.
!C File with input-data
OPEN (UNIT=NDE,FILE=NAMEIN,ACTION='READ',STATUS='OLD',ERR=1101)
.
!C File for control-output of input-data and result-output
OPEN (UNIT=NWR,FILE=NAMAUS,ACTION='WRITE',STATUS='REPLACE',FORM='PRINTER')
!C read input-data and write control-data, calculating some needed plot-data
CALL DATEIN (.....,,XPLOT,YPLOT,LDIM,NWDM,PROJ,.....)
.
.
!C Window data for MDI-window %fr
WINH = fenh-winry !height
WINB = fenb-2*winrx !width
WINX = deck !start coordinate x
WINY = lecke !start coordinate y
!C Window data for drawing in subroutines %aw
ploh = winh-5 !full height for %aw
plob = winb !full width for %aw
plopix = plob - 2*dpx ! pixel in y
plopiy = ploh - dpy ! pixel in y
ployo = lecke-1 ! start coordinate y
plox = 0 ! start coordinate x
! Opening MDI-window 07.03.18
i=winio@('%sp&',winx,winy)
i=winio@('%pv%`fr&',winb,winh)
i=winio@('%ca[cross section and concrete behaviour]&')
i=winio@('%lw[owned]',ctrl)
!C drawing the unloaded cross section
CALL BIQWTO (......,XPLOT,YPLOT,LDIM,NWDM,PROJ)
.
!C drawing concrete behaviour in BI_FCM, BI_F
Back to top
View user's profile Send private message
FK_GER



Joined: 26 Oct 2017
Posts: 17
Location: University of Kassel,Germany

PostPosted: Sat Mar 17, 2018 2:31 pm    Post subject: Reply with quote

Here the continuation:

!C drawing the unloaded cross section
CALL BIQWTO (......,XPLOT,YPLOT,LDIM,NWDM,PROJ)
.
!C drawing concrete behaviour in BI_FCM, BI_FCD
CALL BI_FCM (......,XPLOT,YPLOT,LDIM,NWDM,PROJ)
CALL BI_FCD (......,XPLOT,YPLOT,LDIM,NWDM,PROJ)
.
!C calculating the loaded cross section
CALL LAUF ( ........ )
!C drawing the results for loaded cross section
CALL BIQWTO (......,XPLOT,YPLOT,LDIM,NWDM,PROJ)
.
ctrl = 0 !!closing fr-window
call window_update@(ctrl)
END


Example for a drawing subroutine

SUBROUTINE BI_FCD (.....,xData,ydata,LDIM,IPLD,PROJ)
!C**********************************************************************
!C Drawing the concrete behaviour
INCLUDE <windows.ins>

! LDIM data sets each with IPLD values (x,y)
REAL*8 xData(IPLD,LDIM),yData(IPLD,LDIM)
CHARACTER*32 NAMEFS /'cross section and reinforcements'/
INTEGER winio@,ctrl,plopix,plopiy,plob,ploh,plox,ployo,ployu
COMMON /QWPLOT/ plopix,plopiy,plob,ploh,plox,ployo,ployu
COMMON /CONTRL/ ctrl
! Drawing the XY Graph
iw0=winio@('%sp&',plox,ployo)
iw0=winio@('%pv%aw&',ctrl)
iw0=winio@('%ww[no_border]&')
iw0=winio@('%`bg[white]&')
iw0=winio@('%ca[concrete behaviour acc. to DIN EN 1992]%pv&')
CALL winop@("%pl[title='for ULS: parabola-rectangle with f_cd']")
CALL winop@("%pl[y_min=0.,y_max=1.]")
CALL winop@("%pl[x_min=0.,x_max=3.5]")
CALL winop@("%pl[x_axis=strain]")
CALL winop@("%pl[y_axis=stress]")
CALL winop@("%pl[dx=0.5,dy=0.1]")
CALL winop@("%pl[n_graphs=2]")
CALL winop@("%pl[width=2,width=2]")
CALL winop@("%pl[pen_style=0,pen_style=2]")
CALL winop@("%pl[link=curves,link=curves]")
CALL winop@("%pl[colour=red,colour=blue]")
CALL winop@("%pl[symbol_size=2,symbol_size=2]")
CALL winop@("%pl[symbol=0,symbol=6]")
CALL winop@("%pl[x_array]")
iw0=winio@('%pl',plopix,plopiy, &
ipld,xData(1:ipld,1),yData(1:ipld,1),yData(1:ipld,2))
Return
END


I'm contented with this result of window-handling. The further issues arising at the use of the drawing routines (%pl etc.) will be discussed at a new post in the relevant forum-chapter.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 858

PostPosted: Mon Mar 19, 2018 4:41 am    Post subject: Reply with quote

FK_GER ... as Dan said earlier in the thread, try https://postimg.org (it's FREE) if you don't have a favourite storage site.
It has a very useful facility when you select an image you've uploaded and then clicking the 'Share' button it brings up a whole series of 'ready made' links for posting to different web entities.
Works in a similar way to Dropbox.
Just select the 'Forums' one and then paste it to your post on here and presto, your image(s) appear after you submit the post.
_________________
"This is the triumph of folly.
The machine, which knows no rest, ought to remain a tool,
... but instead becomes our master and will swallow up our life and soul"
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 -> ClearWin+ 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