<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Translating CFV source to SF]]></title>
		<link>http://forums.approximatrix.com/viewtopic.php?id=565</link>
		<atom:link href="http://forums.approximatrix.com/extern.php?action=feed&amp;tid=565&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Translating CFV source to SF.]]></description>
		<lastBuildDate>Tue, 12 Jul 2016 21:09:27 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Translating CFV source to SF]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=2597#p2597</link>
			<description><![CDATA[<p>Hello Jeff, </p><p>Sorry about the struggle with the nasty crashes....<br />Your question about my windows version: I have upgraded windows from 7 to 10 a half year ago.</p><p>To explain how my program works the following. There are several user levels. This is the so called &quot;cross section level&quot;. Starting this levels also a view menu is defined with 5 sub menus :</p><p> menu_control = Addmenuitem (menutxt2(1),2, CrossMen2_1) ! Zoom<br /> menu_control = Addmenuitem (menutxt2(2),2, CrossMen2_2) ! Reset view<br /> menu_control = Addmenuitem (menutxt2(3),2, CrossMen2_3) ! Show-options<br /> menu_control = Addmenuitem (menutxt2(4),2, CrossMen2_4) ! Rotate 3-D<br /> menu_control = Addmenuitem (menutxt2(5),2, CrossMen2_5) ! Move Window<br /> menu_control = Addmenuitem (menutxt2(6),2, CrossMen2_6) ! Select single frame </p><p> All these external menu routines only defines a menu id and item as follows:&nbsp; <br />! _________________&nbsp; &nbsp; Menu id 2 -- view_______________________________<br />subroutine&nbsp; &nbsp; CrossMen2_1<br />USE CASTORglobals<br /> menuid=2; menuitem =1<br /> Call Navi_CrossSec<br />end subroutine<br />…..<br />…...</p><p>subroutine&nbsp; &nbsp; CrossMen2_5<br /> USE CASTORglobals;<br />&nbsp; &nbsp; &nbsp; &nbsp; menuid=2; menuitem =5<br /> Call Navi_CrossSec<br />end subroutine<br />…......<br />….......<br />All menu routines are calling “Navi_CrossSec” where selection is made&nbsp; (after a initialization, only the first time of call) as follows:<br />…......&nbsp; <br />CrossMenu: Select CASE (menuid) <br />!&nbsp; &nbsp; ______________________&nbsp; &nbsp; menuid 1: files - menu______________________________<br />&nbsp; &nbsp; &nbsp; &nbsp; CASE (1)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; Select CASE (menuitem)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CASE (5); CALL Save_section&nbsp; &nbsp; ! Save all parts and current active ordinates<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CASE (8); CALL Export_sec(N_SPT)!&nbsp; Export to DXF-file start here here (Make options )<br />&nbsp; &nbsp; &nbsp; &nbsp; END SELECT</p><p>!&nbsp; &nbsp; ______________________&nbsp; &nbsp; menuid 2: View - menu_______________________________<br />&nbsp; &nbsp; &nbsp; &nbsp; CASE (2)&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; SELECT CASE (menuitem)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; CASE (1)&nbsp; &nbsp; ;&nbsp; &nbsp; CALL ZOOM(x_left,y_up,x_rght,y_bot)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; CASE (2)&nbsp; &nbsp; ;&nbsp; &nbsp; N_SPT = 0&nbsp; &nbsp; ! Reset to original view<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;INCLUDE &#039;WIN_Reset.fd&#039;&nbsp; &nbsp; &nbsp; &nbsp; ! Real window-size related to the ship&#039;s dimension same as above-----<br />&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;dummy&nbsp; &nbsp; = setwindow(.TRUE., x_left,y_up,x_rght,y_bot)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CASE (3);&nbsp; &nbsp; CALL Show_Options_dlg(V_OPT) ! define view options<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CASE (4);&nbsp; &nbsp; CALL rotate_3_D(rx,ry,rz,V_OPT)! Rotate the 3-d view<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CASE (5);&nbsp; &nbsp;Call PICK_MOVE_Window(x_left,y_up,x_rght,y_bot)! Move window by mouse pick&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<br />…....<br />…....<br />at the end always follows the drawing procedure: </p><p>…..<br /> End Select CrossMenu<br />&nbsp; &nbsp;13&nbsp; &nbsp;&nbsp; Menuitem = 0 !Reset item after finishing each selected procedure<br />!&nbsp; &nbsp; _____________________START visual resentations________________________________________<br />!&nbsp; &nbsp; Set graphic window related to the extension of the cross section<br />&nbsp; &nbsp; dummy= setwindow&nbsp; &nbsp;(.TRUE., x_left, y_up, x_rght, y_bot)<br />&nbsp; &nbsp; if(dummy == 0) call dlgmessage(DIALOG_Warn,&#039;Bad window settings for visual presentations&#039;)&nbsp; &nbsp; <br />&nbsp; &nbsp; call clearviewport<br /> …....<br />….....<br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;Graphic presentation of structural parts on cross section<br />&nbsp; &nbsp; IF(V_OPT(8) .and. N_SPT &lt;=0)Then<br />&nbsp; &nbsp; &nbsp; &nbsp; Call&nbsp; View3_D(Framesetlist,V_OPT,ry,rz) ! calling view_section in a loop for all defiend active frames<br />&nbsp; &nbsp; Else<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL&nbsp; view_section(N_SPT,.False.)&nbsp; &nbsp; &nbsp; &nbsp; ! part of file SectionDrawing.f90 - param dxf here false<br />&nbsp; &nbsp; end if<br />!&nbsp; &nbsp; ____________________end&nbsp; of visual presentations <br />….....<br />…....<br />Please take into account that the way how the whole program is build, has a history from the middle of the 90ties until now.<br />About the crashes: They are not inside the view routines but in the routines of menu id 2 item 1 or&nbsp; 5!<br />Its crazy that I can repeat zoom or move window separate from each other endless but the next call of&nbsp; the other one causes the crash just starting the mouse handler. Why?????</p><p>Further more the variables x_left, y_up, x_rght, y_bot are global and defined in module “StrPartGlobals” for “Navi_CrossSec” but not in zoom and move window. <br />Zoom and move window are contained in a separate library and they use the module “W_ords_to_pixels” also where scale_x and _y are defined.<br />I hope to give an overview how the program is built.</p><p>Meanwhile I am working on a next program level with the same structure using also the view options. Looking forward I will see if the problems are the same.<br />For the user version I can switch off move window preliminary until the problem is solves.<br />Tanks very much for all your effort you spent in this problem.<br />Regards Klaus</p>]]></description>
			<author><![CDATA[null@example.com (Klaus Asmus)]]></author>
			<pubDate>Tue, 12 Jul 2016 21:09:27 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=2597#p2597</guid>
		</item>
		<item>
			<title><![CDATA[Re: Translating CFV source to SF]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=2592#p2592</link>
			<description><![CDATA[<p>Klaus,</p><p>I&#039;m still investigating your problem, but I still haven&#039;t replicated the crash.&nbsp; On what version of Windows are you experiencing the crash?</p><p>I think I&#039;m going to have to use your snippets exactly as you&#039;ve provided and create a wrapper around them.&nbsp; I can&#039;t seem to build a simplified case where the crash occurs based on your descriptions and code.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Mon, 11 Jul 2016 11:33:31 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=2592#p2592</guid>
		</item>
		<item>
			<title><![CDATA[Re: Translating CFV source to SF]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=2581#p2581</link>
			<description><![CDATA[<p>Jeff,<br />Thanks for your effort looking to my problem.<br />The function of parameter finish was to stop the procedure after a right button mouse click. I did remove it while testing. Parameter “finish” has now no function, it is not in use changed elsewhere in the program. I&#039;ll remover it completely.<br />The parameters x_left, y_up, x_rght, y_bot are global variables in the calling procedure and defined in a module but this module is not used in this mouse routines. Module&nbsp; W_ords_to_pixels is used in MOVE_CROSS (see below). The scale variables are used in “handle_click” but not changed.<br />The scale parameters are defined in function setwindow which is also contained in W_ords_to_pixels&nbsp; but will never be changed elsewhere.<br />Should it help to use different names internal the mouse handler for the scale as well as for the corner points in m?<br />Thanks so far.<br />Regards, Klaus</p><br /><p>Module W_ords_to_pixels<br /> Use AppGraphics<br /> Real*8 xw,xwtot, scale_x<br /> Real*8 yw,ywtot, scale_y<br /> Integer dx,dy, x_offset, y_offset<br /> TYPE wxycoord<br />&nbsp; &nbsp; &nbsp; Real*8 x<br />&nbsp; &nbsp; &nbsp; Real*8 y<br /> end type wxycoord<br /> TYPE (wxycoord)wxy<br /> contains </p><p>!!!!! ===================== warning ==============================!!!!! a <br />! The pixel window to show graphics has to be opened prior to apply this function !!!!!</p><p>Function setwindow (origin , x_left, y_up, x_rght, y_bot)&nbsp; &nbsp; ! same as CVF but little changed functionallity!!<br />! i2&nbsp; &nbsp;= setwindow (.TRUE.&nbsp; &nbsp;, x_left, y_up, x_rght, y_bot)&nbsp; ! make this work in module<br />&nbsp; &nbsp; &nbsp; &nbsp; ! make returnvalue =1 if OK, otherwise 0<br />! In this this function a world coordinate system y from top down is not defined and has to return zero (diff from CVF)<br /> integer setwindow<br /> logical origin&nbsp; &nbsp; &nbsp;! to be true for lower left corner and y up warts<br /> Real*8 x_left, y_up, x_rght, y_bot !virtual world corners of the viewport<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ! If negative lower left corner there is an offset to the origin xw,yw = 0.,0.<br /> Real*8 dxw, dyw&nbsp; &nbsp; ! absolute &quot;world&quot;dimensions in xy direction<br /> integer dx, dy<br /> setwindow = 0</p><p>! the window size in world ordinates is defined by the arguments of this routine!!!!!!!!!!!!!!!!!!<br />dxw = x_rght - x_left<br />dyw = y_up - y_bot<br />If(dxw == 0.)setwindow = -1<br />If(dyw == 0.)setwindow = -2<br />If(.not. origin)setwindow = -3<br />If(setwindow &lt;0) return</p><p>! get the pre-defiened window size of the CURRENT window in pixels x,y may be the max screen or lower defined <br /> dx = getmaxx()<br /> dy = getmaxy()</p><p>! ****************************************<br />! WARNING: the scale of the screen between real world orinates and screen resolution has to be the same for x and y<br />! because the appgraphics functions only knows one scale for instance circles and elipses.<br />! It is NOT possible to stretch a figure more in one direction unless unrealible figures will be shown!!! <br />!&nbsp; If scale_x is not scale_y, scale_x should be recalculated with or without warnimg dlg<br />!&nbsp; &nbsp;*************************************</p><p>IF(dx &gt; 0 .and. dy &gt; 0 )then<br />&nbsp; &nbsp; ! only works in a predefined actual window!<br />&nbsp; &nbsp; &nbsp;xwtot = dxw&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;!&nbsp; May ..tot should be replaced by&nbsp; ..w !!!<br />&nbsp; &nbsp; &nbsp;scale_x = dble(dx)/dxw<br />&nbsp; &nbsp; &nbsp;x_offset= -int(x_left*scale_x)<br />&nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp;ywtot = dyw<br />&nbsp; &nbsp; &nbsp;scale_y = dble(dy)/dyw<br />&nbsp; &nbsp; &nbsp;y_offset= -int(y_bot*scale_y)&nbsp; &nbsp; &nbsp; &nbsp;! test pos or neg<br />!&nbsp; End subroutine init_world_window<br />setwindow =1 ! does not work with origin in top left</p><p>End if<br />If(scale_x/scale_y &lt; dble(0.95) .or. scale_x/scale_y&gt;dble(1.05))then<br />print*,&#039;scale x and y&#039;,scale_x,scale_y<br />dxw=dble(dx)/scale_y; scale_x=scale_y<br />x_left =dxw - x_rght<br />call dlgmessage(dialog_warn,&#039;scale in x and y direction whers not the same. Scale x is corrected&#039;) <br />end if<br />End function setwindow<br />…..<br />….</p>]]></description>
			<author><![CDATA[null@example.com (Klaus Asmus)]]></author>
			<pubDate>Wed, 06 Jul 2016 08:26:05 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=2581#p2581</guid>
		</item>
		<item>
			<title><![CDATA[Re: Translating CFV source to SF]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=2580#p2580</link>
			<description><![CDATA[<p>Klaus,</p><p>I haven&#039;t reproduced the crash yet, but I have a few more questions. Notably, in the <em>MOVE_CROSS</em> subroutine, you&#039;re returning a value <em>finished</em> as a parameter.&nbsp; Do any of your mouse handling routines actually change this value?&nbsp; </p><p>Are you accessing any &quot;global&quot; variables at all in your mouse handling routines?&nbsp; For example, are they reading or modifying a parent subroutine&#039;s variables internally at all?&nbsp; The mouse handling routines are handled on a separate thread, and it can be problematic if you&#039;re reading and writing values from different handlers (or the main loop) simultaneously.</p><p>Again, I haven&#039;t seen anything technically wrong with the code you&#039;ve provided thus far.&nbsp; I&#039;m just trying to determine where the issue lies.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Tue, 05 Jul 2016 14:27:27 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=2580#p2580</guid>
		</item>
		<item>
			<title><![CDATA[Re: Translating CFV source to SF]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=2579#p2579</link>
			<description><![CDATA[<p>Klaus,</p><p>Let me try to replicate your issue.&nbsp; I&#039;ll have to write a small example program that effectively does the same thing as your code.&nbsp; Clearly my examining your code snippets haven&#039;t led to a solution.&nbsp; I&#039;m sure it is an internal AppGraphics problem, though.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Tue, 05 Jul 2016 12:32:29 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=2579#p2579</guid>
		</item>
		<item>
			<title><![CDATA[Re: Translating CFV source to SF]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=2576#p2576</link>
			<description><![CDATA[<p>May be an explanation is necessary<br />The routines move_cross is called by the zoom procedure (see below)<br />Both, Zoom as well move window are called from the user menu and are starting drawing in a loop. <br />Repeating only one of them: no crash<br />but the one after the other will cause a crash</p><br /><p> SUBROUTINE ZOOM (x_left, y_up, x_rght, y_bot)<br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Zoom in in a part of the window defined by two points using<br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;the window-ordinates x_left, y_up, x_rght, y_bot with will be<br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;redefined to new points, using the same aspect ratio of picture<br /> USE AppGraphics<br /> Use W_ords_to_pixels<br /> INTEGER&nbsp; dummy<br /> DOUBLE PRECISION&nbsp; &nbsp; &nbsp;x_left, y_up, x_rght, y_bot, lsize, ALFA<br /> logical finish<br />&nbsp; &nbsp; PRINT*,&#039;Zoom procedure starting&#039;<br />&nbsp; &nbsp; ZoomDX = SNGL(x_rght-x_left)<br />&nbsp; &nbsp; ZoomDY = SNGL(y_up&nbsp; - y_bot)<br />&nbsp; &nbsp; &nbsp; IF(ABS(ZoomDY)&lt;.1)ZoomDY = 1.<br />&nbsp; &nbsp; &nbsp; ALFA&nbsp; &nbsp; &nbsp; &nbsp; =&nbsp; ZoomDX/ZoomDY<br />&nbsp; &nbsp; &nbsp; IF(ALFA &lt; .01 .OR. ALFA &gt; 10.)THEN<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;call dlgmessage(DIALOG_INFO,&#039;ASPECT-RATIO of graphic window out of range/ &amp;<br />&nbsp; &nbsp; &nbsp;Zoom function error&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; Return<br />&nbsp; &nbsp; &nbsp; END IF<br />&nbsp; &nbsp; &nbsp; lsize&nbsp; &nbsp; &nbsp; &nbsp; = ZoomDX/10.&nbsp; &nbsp;;&nbsp; &nbsp;Call setcolor(red)<br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Use routines _cross twice to define first point 1 than point 2 !<br />&nbsp; &nbsp; &nbsp; &nbsp;CALL OUTTEXTxy&nbsp; &nbsp;(5,5,&#039;Click left uppercorner&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp;CALL MOVE_CROSS(x_left, y_up, finish); if(finish)return<br />!&nbsp; &nbsp; &nbsp; &nbsp;CALL DRAW_CROSS( x_left,y_up, LSIZE )!&nbsp; &nbsp; &nbsp; Draw a cross in move mouse by pixels<br />&nbsp; &nbsp; &nbsp; &nbsp;CALL OUTTEXTxy&nbsp; &nbsp;(100,5,&#039;Click right lowercorner&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp;CALL MOVE_CROSS( x_rght, y_bot, finish); if(finish)return<br />!&nbsp; &nbsp; &nbsp; &nbsp;CALL DRAW_CROSS ( x_rght, y_bot, LSIZE )!&nbsp; &nbsp; &nbsp; Draw a cross in move mouse by pixels<br />&nbsp; &nbsp; &nbsp; &nbsp;ZoomDX =&nbsp; SNGL(x_rght - x_left)<br />&nbsp; &nbsp; &nbsp; &nbsp;ZoomDY =&nbsp; SNGL(y_up&nbsp; &nbsp;- y_bot)</p><p>&nbsp; &nbsp; &nbsp; &nbsp;IF(ZoomDY * ALFA &gt; ZoomDX )THEN<br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;redefine x-length<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x_left&nbsp; &nbsp;=&nbsp; x_left - (ZoomDY * ALFA-ZoomDX)/2.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x_rght&nbsp; &nbsp;=&nbsp; x_rght + (ZoomDY * ALFA-ZoomDX)/2.<br />&nbsp; &nbsp; &nbsp; &nbsp;ELSE<br />!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;redefine y-lenght<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; y_up&nbsp; &nbsp; &nbsp;=&nbsp; y_up&nbsp; &nbsp;+ (ZoomDX / ALFA - ZoomDY)/2.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; y_bot&nbsp; &nbsp; =&nbsp; y_bot&nbsp; - (ZoomDX / ALFA - ZoomDY)/2.<br />&nbsp; &nbsp; &nbsp; &nbsp;END IF<br />&nbsp; Call setcolor(DARKGRAY)<br />&nbsp; &nbsp; &nbsp; &nbsp; dummy&nbsp; &nbsp;= rectangle_w (.true., x_left, y_up, x_rght, y_bot) ! this might be differ from the drawn crosses<br />&nbsp; &nbsp; &nbsp; &nbsp; !&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;! because the ratio must be the same as the viewport<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;call dlgmessage(DIALOG_INFO,&#039;Zoom function finished check the zoom area within the rectangle&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; ! window redefiend directly after use of ZOOM<br />&nbsp; &nbsp; &nbsp;RETURN<br /> END SUBROUTINE ZOOM</p><p>Regards , Klaus</p>]]></description>
			<author><![CDATA[null@example.com (Klaus Asmus)]]></author>
			<pubDate>Mon, 04 Jul 2016 13:26:12 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=2576#p2576</guid>
		</item>
		<item>
			<title><![CDATA[Re: Translating CFV source to SF]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=2575#p2575</link>
			<description><![CDATA[<p>hello Jeff,<br />The getmouseclick is removed but the crash is still the same following on pressing the left mouse button. I tested it with the debugger as well as a temporary print just after the register command and as first statement in the handle subroutines.<br />The debugger stops with &quot;SEGV Segmentation fault&quot; and i cannot find a guilty statement where it crashes after registermousehandler. The print on the console gives response after registermousehandler and not at the first line of the handle routine.</p>]]></description>
			<author><![CDATA[null@example.com (Klaus Asmus)]]></author>
			<pubDate>Mon, 04 Jul 2016 13:15:33 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=2575#p2575</guid>
		</item>
		<item>
			<title><![CDATA[Re: Translating CFV source to SF]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=2566#p2566</link>
			<description><![CDATA[<p>The only thing I notice by looking at it initially is that <em>handle_click</em> in <em>MOVE_CROSS</em> is actually retrieving x and y coordinates again via <em>getmouseclick</em>, unlike the equivalent call in <em>PICK_MOVE_Window</em>.&nbsp; This shouldn&#039;t be problem, but it does possibly change the values of x and&nbsp; y in the library internally (possibly). If you don&#039;t call <em>getmouseclick</em>, does it behave better?</p><p>Can you tell which line it is crashing on when it claims to crash in the subroutine?</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Wed, 29 Jun 2016 16:14:36 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=2566#p2566</guid>
		</item>
		<item>
			<title><![CDATA[Re: Translating CFV source to SF]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=2564#p2564</link>
			<description><![CDATA[<p>Hello Jeff,<br />I have created an odd conflict between two routines using a mouse click<br />There function is : <br />a)&nbsp; move a figure given in meters by mouse a certain distance <br />b) zoom in the figure using ordinates in meters. This routine uses&nbsp; a mouse click for both opposite corners</p><p>I can repeat both functions from the menu without crash, but if I use first one and than the other a crash follows. The message is that the program is not longer working.<br />A debugger error says twice SEGV Segmentation fault.<br />The crash occurs&nbsp; inside or while starting the handle subroutine.<br />What happens? Could you give me a hint how to solve this problem<br />regards, Klaus</p><p>Here the two routines :</p><br /><p>Routine moves world window:<br />SUBROUTINE PICK_MOVE_Window(x_left, y_up, x_rght, y_bot) <br />USE AppGraphics<br />integer Oldx,Oldy,MouseXpos, MouseYpos,dx, dy<br />DOUBLE PRECISION x_left, y_up, x_rght, y_bot, dwx, dwy, xw,yw<br />dwx=abs(x_left - x_rght) ; dwy= abs(y_up - y_bot)&nbsp; &nbsp; &nbsp; &nbsp;! window size in world window<br />xw = (x_left + x_rght)/2. ;&nbsp; yw = (y_up + y_bot)/2.&nbsp; &nbsp; &nbsp; &nbsp;! current centre of world window <br /> CALL OUTTEXTxy(10,10, &#039;move center by left mousebutton&#039;) !instruction text<br /> Call DRAW_CROSS(xw, yw, dble(5.))<br /> dx= getmaxx() ; dy=getmaxy()&nbsp; <br /> CALL MOVETO((dx/2),(dy/2))<br />oldx= getx()&nbsp; &nbsp;; oldy=gety()<br />!&nbsp; &nbsp; __________________________________________________________________<br /> Call registermousehandler(MOUSE_LB_UP, handle_click_pos)<br /> Call loop<br /> move_x = oldx-MouseXpos ; move_y = oldy-MouseYpos&nbsp; &nbsp; <br />!New world window:<br />&nbsp; &nbsp; xw = dble(move_x)/dble(dx)*dwx&nbsp; ;&nbsp; &nbsp; yw = dble(move_y)/dble(dy)*dwy<br />&nbsp; &nbsp; x_left = x_left + xw ; y_up&nbsp; = y_up&nbsp; - yw ! new upper left corner<br />&nbsp; &nbsp; X_rght = x_rght + xw ; y_bot = y_bot - yw ! new lower right corner<br /> return<br />contains</p><p>subroutine handle_click_pos(x, y)<br />&nbsp; &nbsp; integer::x, y <br />&nbsp; &nbsp; logical Clicked<br />Clicked = ismouseclick (MOUSE_LB_UP)<br />If(clicked)then<br />&nbsp; &nbsp; MouseXpos = x<br />&nbsp; &nbsp; MouseYpos = y<br />&nbsp; &nbsp; Clicked =.false.<br />end if&nbsp; &nbsp; <br />Call clearmouseclick(MOUSE_LB_UP)<br />&nbsp; &nbsp; call stopidle&nbsp; &nbsp; <br />end subroutine handle_click_pos<br />END SUBROUTINE PICK_MOVE_Window</p><p>….....is in conflict with next routine used twice to zoom in a figure......<br />SUBROUTINE MOVE_CROSS (x_cross, y_cross, finish) <br />USE AppGraphics<br />Use W_ords_to_pixels<br />&nbsp; &nbsp; Logical finish<br />&nbsp; &nbsp; DOUBLE PRECISION&nbsp; &nbsp;x_cross, y_cross<br />&nbsp; &nbsp;finish=.false. <br />!&nbsp; &nbsp; __________________________________________________________________<br />&nbsp; &nbsp; Call registermousehandler (MOUSE_LB_DOWN, handle_click)<br />!&nbsp; &nbsp; Call registermousehandler (MOUSE_RB_DOWN, handle_click)<br />Call loop<br /> contains</p><p>subroutine handle_click(x, y)<br />&nbsp; &nbsp; integer::x, y&nbsp; &nbsp;<br />&nbsp; &nbsp; logical Clicked<br />&nbsp; &nbsp;Clicked = ismouseclick (MOUSE_LB_DOWN)<br />&nbsp; &nbsp;If(clicked)then<br />&nbsp; &nbsp; &nbsp; CAll getmouseclick (MOUSE_LB_DOWN, x, y)<br />&nbsp; &nbsp; &nbsp; call line (x-20,y,x+20,y)<br />&nbsp; &nbsp; &nbsp; Call line (x,y-20,x,y+20)<br />&nbsp; &nbsp; &nbsp; x_cross = dble(real(x -x_offset))/scale_x ;&nbsp; y_cross&nbsp; = ywtot- dble(real(y+y_offset))/scale_y! Else<br />&nbsp; end if&nbsp; &nbsp; <br />call clearmouseclick(MOUSE_LB_DOWN)<br /> Call stopidle ( ) <br />end subroutine handle_click<br />End SUBROUTINE MOVE_CROSS</p>]]></description>
			<author><![CDATA[null@example.com (Klaus Asmus)]]></author>
			<pubDate>Wed, 29 Jun 2016 13:41:27 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=2564#p2564</guid>
		</item>
		<item>
			<title><![CDATA[Re: Translating CFV source to SF]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=2560#p2560</link>
			<description><![CDATA[<p>Thanks Jeff,<br />I&#039;ll change my CVF based source so that the indentifiers will no more conflict with Fortran units.<br />If you &quot;translate&quot; from CVF history one will meet problems like this.</p>]]></description>
			<author><![CDATA[null@example.com (Klaus Asmus)]]></author>
			<pubDate>Tue, 28 Jun 2016 09:55:39 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=2560#p2560</guid>
		</item>
		<item>
			<title><![CDATA[Re: Translating CFV source to SF]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=2548#p2548</link>
			<description><![CDATA[<p>Klaus,</p><p>The indentifiers generated by <em>initwindow</em> are not Fortran units at all.&nbsp; They are simply integers used internally in the AppGraphics library for managing windows.&nbsp; They are actually (but not guaranteed to be) sequential as you create windows.&nbsp; You shouldn&#039;t think of them as Fortran IO units at all.&nbsp; In fact, no Fortran IO calls will work with them.</p><p>That&#039;s good news that your coordinate translation routines are working well!</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Mon, 27 Jun 2016 15:59:18 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=2548#p2548</guid>
		</item>
		<item>
			<title><![CDATA[Translating CFV source to SF]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=2545#p2545</link>
			<description><![CDATA[<p>To use real dimensions of figures (i.e. in meters) I had&nbsp; to make an interface between this dimensions and pixels. This is done by a module containing&nbsp; graphic routines which can be used&nbsp; like CVF calls which translates dimensions to screen pixels<br />There was a nasty problem with the scale to solve: In CVF the x and y scale of real dimensions may be different but in SF Appgraphics the scale in both directions has to be the same other wise it results in odd figures using pixels. In my CVF programs the screen resolution had influence on the x and y scale. I solved it by a control&nbsp; making only one scale for both directions in the new SF versions!</p><p>An other conflict for IO-units I found between screen and printed output : in my CVF source I used predefined variable named units, three for printing and normally in CVF normally IO unit zero and 5 are reserved for the screen output. In my new SF programs&nbsp; Appgraphics using several screens and dialogues, the identifier some times conflicts with my predefined IO-units</p><p> INTEGER&nbsp; &nbsp; dlg_screen, initW<br /> Integer&nbsp; &nbsp; r_but(max_fr)<br /> integer :: Ignore, contin<br />…...... <br />!&nbsp; &nbsp; __________________________________________________________________<br /> initW = getcurrentwindow()&nbsp; ! keep the main window in memory for later use<br /> dlg_screen = initwindow(450, 300, title = &quot;Select a frame&quot;, closeflag = .false.)<br /> …........<br />….........<br />after doing the job I finish with........</p><p>&nbsp; &nbsp; call loop()<br />&nbsp; &nbsp; Call closewindow(CURRENT_WINDOW) <br />&nbsp; &nbsp; Call setcurrentwindow (initW)<br />Contains<br />…....</p><p>I suppose that the two identifiers dlg_screen,&nbsp; initW are output determined by the functions which I better should not define myself. Is that true?<br />Regards Klaus</p>]]></description>
			<author><![CDATA[null@example.com (Klaus Asmus)]]></author>
			<pubDate>Sat, 25 Jun 2016 10:41:10 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=2545#p2545</guid>
		</item>
	</channel>
</rss>
