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 

Native %pl
Goto page Previous  1, 2, 3 ... 17, 18, 19, 20  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
DanRRight



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

PostPosted: Tue Nov 21, 2017 12:11 am    Post subject: Reply with quote

Paul,
I see exactly the same problem in you code. The doubledevilry ... like the two headed ridge nearby called Diablo Smile

All,
Please check that if you increase Xmin > 0.5 the red dot moves instead to stay still at x=1 like it should
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 631

PostPosted: Tue Nov 21, 2017 8:43 am    Post subject: Reply with quote

Paul, your version doesn't fix Dan's problem.
Follow his instructions above.
change Xmin say to -1, then 0 then 0.5 and the red dot is always at (1,1). Then put Xmin as 0.6 and boomf ! the red dot is at (1.6,1) ! , 4,3 etc ....
Try other positive values >0.5 - there's no pattern to it either, try some decimals e.g. 3,2 , 3,9
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 631

PostPosted: Tue Nov 21, 2017 8:48 am    Post subject: Reply with quote

Dan, re your question on p.17 18th Nov 7 am-ish

Quote:
2) Does my code work like that (showing nothing) for all sizes? I ran it and it works OK no matter what size.


Yesm, for all sizes (I only have laptop so can't go to mega sizes.
No plot & eventually the squashed tick labels & titles and the prog bar disappears gradually to left.

Odd if ok for you.
Devilry indeed !
-n-ed more people to check.
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Tue Nov 21, 2017 10:31 am    Post subject: Reply with quote

Thanks, John. Letters jammed are OK. I see last month Paul started with scaling option, hopefully he will complete it in the future so that scaling will work with all elements of the plot (text sizes, borders, line widths). Right now it scales only plotting area, as i remember

This message is to all,
Can you please run my code in the page 17 choosing "PL" option gradually decreasing the size of plotting area to zero ? Do you see that the ring pattern is plotted OK? I see all OK, John gets empty plotting area
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Nov 21, 2017 10:46 am    Post subject: Reply with quote

Things are beginning to make sense...

On a different thread http://forums.silverfrost.com/viewtopic.php?t=3505 you will find a reference to unwanted callback reasons "?". One way that these occur is when an action in a callback function leads to another callback function being called. This malfunction is now blocked in the latest ClearWin+ that I am using and which has not yet been released.

This means that you will be getting a different experience from me. It also means that the root problem is (almost certainly) that of one callback leading immediately to a call to another (or worse still) a call to itself.

You might observe this by tracking the callback reason but I suggest that you put this issue on the back burner until you get the next release of the ClearWin+ library.
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 159
Location: Glasgow, Scotland.

PostPosted: Tue Nov 21, 2017 5:30 pm    Post subject: Reply with quote

Paul,

Another one for you to look at I am afraid. GET_PLOT_POINT@ only works properly if the range between xmin and xmax spans zero, and the range between ymin and ymax also spans zero.

The following code illustrates the issue. With the initial values, the point is drawn at the correct coordinates (0.5,0.50), but if you change xmin to 0.5 for example, the point is incorrectly drawn at (1.0,0.5). Same occurs with the y axis.

Regards

Ken


Code:
module main_mod
implicit none
integer, parameter :: dp = kind(1.d0)
real(kind=dp):: xmin=0.d0, xmax=1.d0, ymin=0.d0, ymax=1.d0, x = 0.5d0, y = 0.5d0

contains

integer function main01()
include<windows.ins>
integer i
i = winio@('%ws&','Range values for plot')
i = winio@('%nl%ws%ta%rf%ta%ws%ta%rf&',   'Xmin', xmin, 'Xmax', xmax)
i = winio@('%nl%ws%ta%rf%ta%ws%ta%rf&' ,'Ymin', ymin, 'Ymax', ymax)
i = winio@('%nl%ws&','Point to be plotted')
i = winio@('%nl%ws%ta%rf&','X',x)
i = winio@('%nl%ws%ta%rf&','Y',y)
i = winio@('%ta%^bb[plot]',plot)
main01= 1
end function main01

integer function plot()
include<windows.ins>
integer i
real(kind=dp) x1(2), y1(2)

if ( (xmax .le. xmin) .or. (ymax .le. ymin) ) then
  write(6,*) 'ERROR in input data'
  plot = 1
  return
end if

x1(1) = xmin  ; x1(2) = xmax ; y1(1) = ymin ; y1(2) = ymax
i = winio@('%^pl[native,x_array,colour=white,gridlines,framed]&',400,400,2,x1,y1, update)
i = winio@('%ff%cn%bb[OK]')
plot = 1
end function plot

integer function update()
include<windows.ins>
real(kind=dp) xpix, ypix
call GET_PLOT_POINT@(x,y,xpix,ypix)
call draw_filled_ellipse@(nint(xpix),nint(ypix),2,2,rgb@(0,0,0))
update = 1
end function update

end module main_mod

program main
use main_mod
implicit none
integer i
i = main01()
end program main


And a picture. Two examples, left is correct, right is not.



====================
A little more:-

Thinking about this, maybe the function is returning the correct coordinates if the axis were placed over the origin at (0,0). Maybe we need another function that takes account of any displacement of the plot origin from (0,0,)? I guess what I saying is that the returned value is not the one I naturally thought the function would return. Hope this make sense.
Back to top
View user's profile Send private message Visit poster's website
Kenneth_Smith



Joined: 18 May 2012
Posts: 159
Location: Glasgow, Scotland.

PostPosted: Wed Nov 22, 2017 7:34 am    Post subject: Reply with quote

Problem solved. get_plot_point2 demonstrates that I thought GET_PLOT_POINT@ would do. Note that you need to explicitly know xmin for this to work.


Code:
module main_mod
implicit none
integer, parameter :: dp = kind(1.d0)
real(kind=dp):: xmin=0.d0, xmax=1.d0, ymin=0.d0, ymax=1.d0, x = 0.5d0, y = 0.5d0

contains

integer function main01()
include<windows.ins>
integer i
i = winio@('%ws&','Range values for plot')
i = winio@('%nl%ws%ta%rf%ta%ws%ta%rf&',   'Xmin', xmin, 'Xmax', xmax)
i = winio@('%nl%ws%ta%rf%ta%ws%ta%rf&' ,'Ymin', ymin, 'Ymax', ymax)
i = winio@('%nl%ws&','Point to be plotted')
i = winio@('%nl%ws%ta%rf&','X',x)
i = winio@('%nl%ws%ta%rf&','Y',y)
i = winio@('%ta%^bb[plot]',plot)
main01= 1
end function main01

integer function plot()
include<windows.ins>
integer i
real(kind=dp) x1(2), y1(2)

if ( (xmax .le. xmin) .or. (ymax .le. ymin) ) then
  write(6,*) 'ERROR in input data'
  plot = 1
  return
end if

x1(1) = xmin  ; x1(2) = xmax ; y1(1) = ymin ; y1(2) = ymax
i = winio@('%^pl[native,x_array,colour=white,gridlines,framed]&',400,400,2,x1,y1, update)
i = winio@('%ff%cn%bb[OK]')
plot = 1
end function plot

integer function update()
include<windows.ins>
real(kind=dp) xpix, ypix
!call GET_PLOT_POINT@(x,y,xpix,ypix)
call get_plot_point2(x, y, xmin, ymin, xpix, ypix)
call draw_filled_ellipse@(nint(xpix),nint(ypix),2,2,rgb@(0,0,0))
update = 1
end function update

subroutine get_plot_point2(x, y, xmin, ymin, xpix, ypix)
include<windows.ins>
real(kind=dp), intent(in) :: xmin, ymin, x, y
real(kind=dp), intent(out) :: xpix, ypix
real(kind=dp) :: xpix0, ypix0, xminpix, yminpix
call GET_PLOT_POINT@(0.d0,0.d0,xpix0,ypix0)
call GET_PLOT_POINT@(xmin,ymin,xminpix,yminpix)
call GET_PLOT_POINT@(x,y,xpix,ypix)
xpix = xpix - (xminpix - xpix0)
ypix = ypix - (yminpix - ypix0)
end subroutine get_plot_point2

end module main_mod

program main
use main_mod
implicit none
integer i
i = main01()
end program main
Back to top
View user's profile Send private message Visit poster's website
DanRRight



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

PostPosted: Wed Nov 22, 2017 7:58 am    Post subject: Reply with quote

Ken, How about
Xmin=Ymin=-2
Xmax=Ymax=3 ?
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 159
Location: Glasgow, Scotland.

PostPosted: Wed Nov 22, 2017 8:40 am    Post subject: Reply with quote

Yes Dan, I was too quick there. Solved a particular case rather than the general. One of the pleasures (?) of this game. Ken

I HAVE DELETED THE CODE I POSTED HERE EARLIER AS IT STILL GENERATED AN ERROR IN SOME TEST CASES


Last edited by Kenneth_Smith on Wed Nov 22, 2017 6:39 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Nov 22, 2017 9:56 am    Post subject: Reply with quote

Thanks for the feedback. Ken's first sample reveals a bug in GET_PLOT_POINT@ that has now been fixed. Hopefully the alternative approaches will no longer be needed with the next release.

Ken's sample also reveals missing tick marks and grid lines and issue is currently outstanding.
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 159
Location: Glasgow, Scotland.

PostPosted: Wed Nov 22, 2017 10:23 am    Post subject: Reply with quote

Paul,
I stumbled upon this yesterday by accident when one of my colleagues put "silly" data into one of my applications.
Do you have a timescale for making an updated DLL available? I am beginning to use %pl in earnest now with my applications. I guess you may have been working on the scale issues we have been collectively grumbling about for 6 months now?
Thanks
Ken
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Nov 22, 2017 12:57 pm    Post subject: Reply with quote

Ken

I am not sure when we will release a new ClearWin+. We may have to wait till the personal edition for v8.2 is released otherwise we could easily get out of step for some users.

I will see if it is possible to make a new ClearWin+ only work with v8.20.
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 159
Location: Glasgow, Scotland.

PostPosted: Wed Nov 22, 2017 1:28 pm    Post subject: Reply with quote

Thanks Paul, No major show stoppers at present- you've seen a few of my work arounds on here. I understand/appreciate the issue with the personal users. I started dabbling with FTN95 there myself a few years ago. Ken
Back to top
View user's profile Send private message Visit poster's website
John-Silver



Joined: 30 Jul 2013
Posts: 631

PostPosted: Wed Nov 22, 2017 9:13 pm    Post subject: Reply with quote

Ken, your problem looka exactly like Dan's a page or 2 back !

you said:
Quote:
... GET_PLOT_POINT@ only works properly if the range between xmin and xmax spans zero,


Dan's had the same 'flip point' at exactly 0.5.
0.3 worked ok in his problem so you statement above wasn't 100% true if it's the same problem.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 631

PostPosted: Wed Nov 22, 2017 9:15 pm    Post subject: Reply with quote

Paul wrote ...
Quote:
Ken's sample also reveals missing tick marks and grid lines and issue is currently outstanding


what missing tick marks & gridlines ? I see nohing odd on the 2 plots Ken posted
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, 3 ... 17, 18, 19, 20  Next
Page 18 of 20

 
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