replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Native %pl
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 ... 19, 20, 21 ... 26, 27, 28  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: 2925
Location: South Pole, Antarctica

PostPosted: Sun Jul 01, 2018 10:12 am    Post subject: Reply with quote

Paul,
As a hint, besides this my demo, other my codes fail to start with this new beta. One is complaining at stack overflow at second line (could be first actually as 64bit version was wrongly identified first executable line )

iSysYRES= GetSystemMetrics(SM_CYSCREEN),

and another immediately exits with not yet clear reason.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sun Jul 01, 2018 2:00 pm    Post subject: Reply with quote

Thanks Dan. I will await your code that demonstrates the fault.
Back to top
View user's profile Send private message AIM Address
DanRRight



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

PostPosted: Mon Sep 03, 2018 1:33 pm    Post subject: Reply with quote

Paul,

I tried to simplify the demo by removing the necessity of reading big data files and processing it before plotting. Since plotted data is much smaller of course, I preliminary saved it on harddrive and when run the new demo I just loaded it right before plotting. The result was that this new demo also failed to plot the data dynamically on the simpleplot_update@ when I click on different radiobuttons but did not crash. This means that it's still better to use my older demo as it clearly has more useful "bugged" information.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Sep 03, 2018 2:52 pm    Post subject: Reply with quote

Dan

As far as I recall, I don't have anything useful from you to work on at the moment.
Back to top
View user's profile Send private message AIM Address
DanRRight



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

PostPosted: Tue Sep 04, 2018 7:30 am    Post subject: Reply with quote

Paul, see my email on May 28.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Sep 04, 2018 8:18 am    Post subject: Reply with quote

Dan

I think that I must have looked at that sample before.

The first two run time failures are due to undefined values at lines 2770 and
2940 in the file called crashPL.for. These may not relate to the problem that you are experiencing with %PL but I need bug free code to work on.
Back to top
View user's profile Send private message AIM Address
DanRRight



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

PostPosted: Tue Sep 04, 2018 10:05 am    Post subject: Reply with quote

Paul,

There probably still exist a lot of undefined variables, the original code was large. This part with undefined variables is doing reading of data and processing it for 1000 different purposes which are not needed for us, so i removed a lot of code but definitely not all. Removing it and scaling down took me more then a month. All still existing undefined variables have no relationship to the code which crashes, again, it just reads the data. Line 2770 for example is not used anywhere. The crashing part is very small, all is in the couple of small functions and is free of undefined things.
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Tue Sep 04, 2018 1:13 pm    Post subject: Reply with quote

Yes, John. I try to do elementary all we do many times per day: I displayed several curves on the same plotting area (like here below with just two curves shown),



and when I click appropriate radiobutton they have to appear or disappear. Fun is that I made two versions in the demo - one works OK and another uses a bit different initial data crashes when I click radiobuttons (crash happening on the line with "call simpleplot_update@" statement ). Also it does not allow to resize.

Older %PL by the way worked OK.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Sep 04, 2018 1:52 pm    Post subject: Reply with quote

Dan

If you can send me code that is free from Fortran bugs then I may be able to find time to work out why %pl is not doing what you expect.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



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

PostPosted: Sun Sep 09, 2018 4:53 pm    Post subject: Reply with quote

John,

Dan likes radio buttons of the round sort %rb instead of the square check boxes (%`rb) in defiance of convention, so therefore not ganged, and also (vide posts passim) likes them to be action buttons instead of a bunch of selections actioned together by a button of the %bt sort.

So yes, in Dan's universe, two radio buttons in the same group can be selected simultaneously.

Each to his own, even though perhaps I have met too many users whose Tourrette's Syndome is worsened by departure from Windows norms to plough such a convention-discarding furrow of my own!

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



Joined: 18 May 2012
Posts: 816
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Sun Oct 14, 2018 12:00 pm    Post subject: Reply with quote

One to be aware of if using multiple %pl regions and get_plot_data@.

In the example below there are two %pl regions, both with full mouse input.

Data in each plot is different and the plots have different sizes.

Moving the mouse across any of the regions and keeping an eye on the output window, it is apparent that the call back function correctly returns the pixel coordinates for each graph, however get_plot_data@ always returns the data corresponding to the last drawn plot.

Ken

Code:
module data_mod
implicit none
integer, parameter :: dp = kind(1.d0)
integer, parameter :: npts = 100
real(kind=dp) :: time(1:npts) = 0.d0, decay(1:npts) = 0.d0, rocof(1:npts) = 0.d0, time2(1:npts) = 0.d0

contains

  integer function create_data()
  real(kind=dp) :: t = 0.d0, dt = 0.10d0
  integer i
    do i = 1, npts
      time(i) = t ; decay(i) = 50.d0*(exp(-t/4.d0) ) ; t = t + dt
      if (i .gt. 1) then
        rocof(i) = ( decay(i) - decay(i-1) ) / dt
      end if
    end do
    time2 = 2.d0*time
    create_data = 1
  end function create_data

  integer function plot()
  include<windows.ins>
  integer i
    i= winio@('%bg[blue]&')
    i=winio@('%`bg[white]&')
    call winop@('%pl[native]')
    call winop@("%pl[title='Frequency (Hz)']")
    call winop@("%pl[width=2]")
    call winop@("%pl[gridlines,x_array,frame,etched]")
    call winop@("%pl[link=lines, symbol=0, colour=blue, pen_style=0]")
    call winop@("%pl[x_axis= 'Time (s)', y-axis=@]")
    call winop@("%pl[full_mouse_input]")
    i = winio@('%^pl&',600,250,npts,time,decay,plot1_cb)

    i=winio@('%ff%2nl%`bg[white]&')
    call winop@('%pl[native]')
    call winop@("%pl[title='Rate of change of frequency (Hz/s)']")
    call winop@("%pl[width=2]")
    call winop@("%pl[gridlines,x_array,frame,etched]")
    call winop@("%pl[link=lines, symbol=0, colour=blue, pen_style=0]")
    call winop@("%pl[x_axis= 'Time (s)', y-axis=@]")
    call winop@("%pl[full_mouse_input]")
    i = winio@('%^pl&',300,125,npts,time2,rocof,plot2_cb)
    i = winio@(' ')
    plot = 1
  end function plot

  integer function plot1_cb()
  include<windows.ins>
  CHARACTER(80) reason
  integer i, ix, iy
  real(kind=dp) x, y
    reason = clearwin_string@("CALLBACK_REASON")
    if (reason .eq. "MOUSE_MOVE") then
      ix = clearwin_info@("GRAPHICS_MOUSE_X")
      iy = clearwin_info@("GRAPHICS_MOUSE_Y")
      i = get_plot_data@(ix,iy,x,y)
      write(6,*) ix, iy, x, y
    end if
    plot1_cb = 1
  end function plot1_cb

  integer function plot2_cb()
  include<windows.ins>
  CHARACTER(80) reason
  integer i, ix, iy
  real(kind=dp) x, y
    reason = clearwin_string@("CALLBACK_REASON")
    if (reason .eq. "MOUSE_MOVE") then
      ix = clearwin_info@("GRAPHICS_MOUSE_X")
      iy = clearwin_info@("GRAPHICS_MOUSE_Y")
      i = get_plot_data@(ix,iy,x,y)
      write(6,*) ix, iy, x, y
    end if
    plot2_cb = 1
  end function plot2_cb

end module data_mod

program main
use data_mod
implicit none
integer i
i = create_data()
i = plot()
end program main
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Oct 15, 2018 7:31 am    Post subject: Reply with quote

Yes, the native %pl accesses the functionality of %gr and get_plot_data@ uses the associated "current drawing surface". %pl can take a grave accent together with the constant integer*4 value of an identifier provided by the programmer. This value (that you have chosen) can then be used in calls to select_graphics_object@ in order to set the "current drawing surface" before calling get_plot_data@.
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



Joined: 18 May 2012
Posts: 816
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Tue Oct 16, 2018 6:15 am    Post subject: Reply with quote

Thanks Paul. Here's the code with Paul's suggestions. Runs OK in 32 bit, but there is a problem with 64 bit which I have yet to identify. 7th argument of the %pl should be 32 bit integer ??
Code:
module data_mod
implicit none
integer, parameter :: dp = kind(1.d0)  ;  integer, parameter :: npts = 100
real(kind=dp) :: time(1:npts) = 0.d0, decay(1:npts) = 0.d0, rocof(1:npts) = 0.d0
integer(kind=7) :: plot1_handle = 1001, plot2_handle = 1002
contains
  integer function create_data()
  real(kind=dp) :: t = 0.d0, dt = 0.10d0   ; integer i
    do i = 1, npts
      time(i) = t ; decay(i) = 50.d0*(exp(-t/4.d0) ) ; t = t + dt
      if (i .gt. 1) rocof(i) = ( decay(i) - decay(i-1) ) / dt
    end do
    create_data = 1
  end function create_data
  integer function plot()
  include<windows.ins>
  integer i
    i= winio@('%bg&',rgb@(250,250,250) )
    i=winio@('%`bg[white]&')
    call winop@("%pl[native,title='Frequency (Hz)']")
    call winop@("%pl[width=2,gridlines,x_array,frame,etched,link=lines, symbol=0, colour=blue, pen_style=0]")
    call winop@("%pl[x_axis= 'Time (s)', y-axis=@]")
    call winop@("%pl[full_mouse_input]")
    i = winio@('%`^pl&',600,250,npts,time,decay,plot1_handle,plot1_cb)
    i=winio@('%ff%`bg[white]&')
    call winop@("%pl[native,title='Rate of change of frequency (Hz/s)']")
    call winop@("%pl[width=2,gridlines,x_array,frame,etched,link=lines, symbol=0, colour=blue, pen_style=0]")
    call winop@("%pl[x_axis= 'Time (s)', y-axis=@]")
    call winop@("%pl[full_mouse_input]")
    i = winio@('%`^pl&',600,250,npts,time,rocof,plot2_handle,plot2_cb)
    i = winio@(' ')
    plot = 1
  end function plot
  integer(kind=3) function plot1_cb()
  include<windows.ins>
  CHARACTER(80):: reason  ; integer i, ix, iy  ;  real(kind=dp) x, y
    reason = clearwin_string@("CALLBACK_REASON")
    if (reason .eq. "MOUSE_MOVE") then
      ix = clearwin_info@("GRAPHICS_MOUSE_X")  ;  iy = clearwin_info@("GRAPHICS_MOUSE_Y")
      i = select_graphics_object@(plot1_handle) ;  i = get_plot_data@(ix,iy,x,y)
      if ( (x.ge.minval(time)) .and. (x.le.maxval(time)) .and. (y.ge.minval(decay)) .and. (y.lt.maxval(decay)) ) write(6,*)ix,iy,x,y
    end if
    plot1_cb = 1
  end function plot1_cb
  integer(kind=3) function plot2_cb()
  include<windows.ins>
  CHARACTER(80) reason  ;  integer i, ix, iy  ;  real(kind=dp) x, y
    reason = clearwin_string@("CALLBACK_REASON")
    if (reason .eq. "MOUSE_MOVE") then
      ix = clearwin_info@("GRAPHICS_MOUSE_X")  ;  iy = clearwin_info@("GRAPHICS_MOUSE_Y")
      i = select_graphics_object@(plot2_handle) ;  i = get_plot_data@(ix,iy,x,y)
      if ( (x.ge.minval(time)) .and. (x.le.maxval(time)) .and. (y.ge.minval(rocof)) .and. (y.lt.maxval(rocof)) ) write(6,*)ix,iy,x,y
    end if
    plot2_cb = 1
  end function plot2_cb
end module data_mod
program main
use data_mod
implicit none ; integer i
i = create_data()  ; i = plot()
end program main
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Oct 16, 2018 7:16 am    Post subject: Reply with quote

plot1_handle and plot2_handle should be 32 bit integers even for 64 bits. So they should be declared as something like INTEGER(3) or INTEGER*4 or just INTEGER for the default INTEGER type.
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



Joined: 18 May 2012
Posts: 816
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Tue Oct 16, 2018 7:54 am    Post subject: Reply with quote

Thanks Paul, Problem fixed Smile I was sure I had read some where that these were to be kind=7. Corrected code below for those who wish to experiment.
Code:
module data_mod
 implicit none
 integer, parameter :: dp = kind(1.d0)  ;  integer, parameter :: npts = 100
 real(kind=dp) :: time(1:npts) = 0.d0, decay(1:npts) = 0.d0, rocof(1:npts) = 0.d0
 integer :: plot1_handle = 1001, plot2_handle = 1002           ! DEFAULT INTEGER TYPE NOT KIND = 7
 contains
   integer function create_data()
   real(kind=dp) :: t = 0.d0, dt = 0.10d0   ; integer i
     do i = 1, npts
       time(i) = t ; decay(i) = 50.d0*(exp(-t/4.d0) ) ; t = t + dt
       if (i .gt. 1) rocof(i) = ( decay(i) - decay(i-1) ) / dt
     end do
     create_data = 1
   end function create_data
   integer function plot()
   include<windows.ins>
   integer i
     i= winio@('%bg&',rgb@(250,250,250) )
     i=winio@('%`bg[white]&')
     call winop@("%pl[native,title='Frequency (Hz)']")
     call winop@("%pl[width=2,gridlines,x_array,frame,etched,link=lines, symbol=0, colour=blue, pen_style=0]")
     call winop@("%pl[x_axis= 'Time (s)', y-axis=@]")
     call winop@("%pl[full_mouse_input]")
     i = winio@('%`^pl&',600,250,npts,time,decay,plot1_handle,plot1_cb)
     i=winio@('%ff%`bg[white]&')
     call winop@("%pl[native,title='Rate of change of frequency (Hz/s)']")
     call winop@("%pl[width=2,gridlines,x_array,frame,etched,link=lines, symbol=0, colour=blue, pen_style=0]")
     call winop@("%pl[x_axis= 'Time (s)', y-axis=@]")
     call winop@("%pl[full_mouse_input]")
     i = winio@('%`^pl&',600,250,npts,time,rocof,plot2_handle,plot2_cb)
     i = winio@(' ')
     plot = 1
   end function plot
   integer function plot1_cb()
   include<windows.ins>
   CHARACTER(80):: reason  ; integer i, ix, iy  ;  real(kind=dp) x, y
     reason = clearwin_string@("CALLBACK_REASON")
     if (reason .eq. "MOUSE_MOVE") then
       ix = clearwin_info@("GRAPHICS_MOUSE_X")  ;  iy = clearwin_info@("GRAPHICS_MOUSE_Y")
       i = select_graphics_object@(plot1_handle) ;  i = get_plot_data@(ix,iy,x,y)
       if((x.ge.minval(time)).and.(x.le.maxval(time)).and.(y.ge.minval(decay)).and.(y.lt.maxval(decay)))write(6,*)ix,iy,x,y
     end if
     plot1_cb = 1
   end function plot1_cb
   integer function plot2_cb()
   include<windows.ins>
   CHARACTER(80) reason  ;  integer i, ix, iy  ;  real(kind=dp) x, y
     reason = clearwin_string@("CALLBACK_REASON")
     if (reason .eq. "MOUSE_MOVE") then
       ix = clearwin_info@("GRAPHICS_MOUSE_X")  ;  iy = clearwin_info@("GRAPHICS_MOUSE_Y")
       i = select_graphics_object@(plot2_handle) ;  i = get_plot_data@(ix,iy,x,y)
       if ((x.ge.minval(time)).and.(x.le.maxval(time)).and.(y.ge.minval(rocof)).and.(y.lt.maxval(rocof)))write(6,*)ix,iy,x,y
     end if
     plot2_cb = 1
   end function plot2_cb
 end module data_mod
 program main
 use data_mod
 implicit none ; integer i
 i = create_data()  ; i = plot()
 end program main
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 ... 19, 20, 21 ... 26, 27, 28  Next
Page 20 of 28

 
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