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 

Suggestion %pl[native, scale=****] + CHANGE_PLOT_CHR@
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
Kenneth_Smith



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

PostPosted: Sat Oct 29, 2022 4:33 pm    Post subject: Reply with quote

Paul, I can confirm that this works as expected for X64.

There is still a minor problem with Win32. If you try the example below, compile with Win32, and look at the x-axis labeling at 10**-4, and 10**-3 on the options with a logarithmic x-axis. These are both shown as 0.

Code:
winapp
module surge_arrester_mod
use clrwin
implicit none
integer, parameter :: dp = kind(1.d0)
integer,  parameter :: n_a0 = 12
real(dp), parameter :: a0_ka(n_a0)  = [1.0d-7,1.0d-6,1.0d-5,1.0d-4,1.0d-3,1.0d-2,1.0d-1,1.0d0,&
                                       3.816d0,1.0d1,2.0d1,1.0d2]
real(dp), parameter :: a0_a(n_a0)   = a0_ka*1000.d0
real(dp), parameter :: a0_vpu(n_a0) = [1.10d0,1.28d0,1.33d0,1.37d0,1.39d0,1.42d0,1.52d0,1.65d0,1.75d0,1.90d0, &
                                       2.10d0,3.69d0]
real(dp)  a0_kv(n_a0)
integer :: n_pl = n_a0
character(len=12), parameter :: pl_scale(4) = ['Lin X, Lin Y','Log X, Lin Y','Lin X, Log Y','Log X, Log Y']
integer :: pl_scale_selected = 1

  contains
  integer function gui()
  integer iw
    a0_kv = a0_vpu*500.d0
    iw = winio@('%mn[Exit]&','exit')
    iw = winio@('%bg&',rgb@(220,220,220))
    iw = winio@('%fn[Consolas]&')
    call winop@('%pl[native,n_graphs=1,gridlines,smoothing=5,frame]')
    call winop@('%pl[x_array,independent,colour=red,symbol=1,link=lines,width=2,x_axis=Amps,y_axis=kV]')
    iw = winio@('%pl&',800,500,n_pl,a0_a,a0_kv)
    iw = winio@('%`bg[white]%`^ls',pl_scale,size(pl_scale,kind=3),pl_scale_selected,change_pl_scale_cb)
    gui = 1
  end function gui
 
  integer function change_pl_scale_cb()
    integer :: errstate
    character(10) :: t(4)= ["linear    ","linear_log","log_linear","log_log   "]
    errstate = change_plot_chr@(0,"scale",0,t(pl_scale_selected))
    call plot_redraw@()
    change_pl_scale_cb = 2
  end function change_pl_scale_cb
 
end module surge_arrester_mod

program main
use surge_arrester_mod
i = gui()
end program main
Back to top
View user's profile Send private message Visit poster's website
DanRRight



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

PostPosted: Mon Oct 31, 2022 5:57 am    Post subject: Reply with quote

Quiz: If we will take this code as a prototype - find at least 10 other small defects in /64 bit mode.

They are fixable in Designer's mode and one additionally appears in it. But major why, i think, the Designer's mode did not take yet masses by storm is that adding the line

CALL winop@('%pl[file=PlotParameters.set]')

does not show the icon for Designer's mode. It is there but no one see it.

Among other defects, adding above line before or after

iw = winio@('%pl&',800,500,n_pl,a0_a,a0_kv)

changes LOG scale numbering from SCIENTIFIC (10^x) to mix of SCIENTIFIC + ENGINEERING (10^x, 10, 100, 1000, 1e4 )

Native %PL in Designer's mode literally revolutionized %PL and simplified it to the extreme so that plotting in Fortran becomes doable with just couple lines of Fortran text with professional quality as opposed to draft one (and longer) like in this example. We just published some results plotted with %PL in prestigious Physical Review Letters journal. Take a look at %PL if you are still not using it



Sorry, i can not publish with higher resolution
Back to top
View user's profile Send private message
Kenneth_Smith



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

PostPosted: Mon Oct 31, 2022 12:44 pm    Post subject: Reply with quote

Dan, I tried adding the line you suggested.

CALL winop@('%pl[file=PlotParameters.set]')

I can see now why you like Designer Mode.

You can force the Designer Mode Icon to appear when the graph is first formed by including a minimum pl call back.
Code:
napp
module surge_arrester_mod
use clrwin
implicit none
integer, parameter :: dp = kind(1.d0)
integer,  parameter :: n_a0 = 12
real(dp), parameter :: a0_ka(n_a0)  = [1.0d-7,1.0d-6,1.0d-5,1.0d-4,1.0d-3,1.0d-2,1.0d-1,1.0d0,&
                                       3.816d0,1.0d1,2.0d1,1.0d2]
real(dp), parameter :: a0_a(n_a0)   = a0_ka*1000.d0
real(dp), parameter :: a0_vpu(n_a0) = [1.10d0,1.28d0,1.33d0,1.37d0,1.39d0,1.42d0,1.52d0,1.65d0,1.75d0,1.90d0, &
                                       2.10d0,3.69d0]
real(dp)  a0_kv(n_a0)
integer :: n_pl = n_a0
character(len=12), parameter :: pl_scale(4) = ['Lin X, Lin Y','Log X, Lin Y','Lin X, Log Y','Log X, Log Y']
integer :: pl_scale_selected = 1

  contains
  integer function gui()
  integer iw
    a0_kv = a0_vpu*500.d0
    iw = winio@('%mn[Exit]&','exit')
    iw = winio@('%bg&',rgb@(220,220,220))
    iw = winio@('%fn[Consolas]&')
    call winop@('%pl[native,n_graphs=1,gridlines,smoothing=5,frame]')
    call winop@('%pl[x_array,independent,colour=red,symbol=1,link=lines,width=2,x_axis=Amps,y_axis=kV]')
    CALL winop@('%pl[file=PlotParameters.set]')
    iw = winio@('%^pl&',800,500,n_pl,a0_a,a0_kv, pl_cb)     !### Call back added to make Designer Icon appear
    iw = winio@('%`bg[white]%`^ls',pl_scale,size(pl_scale,kind=3),pl_scale_selected,change_pl_scale_cb)
    gui = 1
  end function gui

 integer function pl_cb()
   pl_cb = 2
 end function pl_cb
 
  integer function change_pl_scale_cb()
    integer :: errstate
    character(10) :: t(4)= ["linear    ","linear_log","log_linear","log_log   "]
    errstate = change_plot_chr@(0,"scale",0,t(pl_scale_selected))
    call plot_redraw@()
    change_pl_scale_cb = 1
  end function change_pl_scale_cb
 
end module surge_arrester_mod

program main
use surge_arrester_mod
i = gui()
end program main


Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Mon Oct 31, 2022 1:28 pm    Post subject: Reply with quote

The icon should now automatically appear in the next release of ClearWin+.
Back to top
View user's profile Send private message AIM Address
DanRRight



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

PostPosted: Tue Nov 01, 2022 7:09 am    Post subject: Reply with quote

Ken, I simply blindly click on the corner where it hides and with more than 50% chance win Smile

Paul, Would be natural to include these LIN/LOG switching choices into Designer's mode
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