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 

Couple minor Clearwin problems
Goto page 1, 2  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: 2818
Location: South Pole, Antarctica

PostPosted: Wed Sep 27, 2023 2:45 pm    Post subject: Couple minor Clearwin problems Reply with quote

1) When native %PL plots XY graph it automatically finds X and Y minimum and maximum so you do not have to worry about this. Of course you can set these limits in Designer's mode opening it. The problem is that if you set them you will not be able to play back when program finds them automatically. Here is an example.
Code:
program aaa
use clrwin
integer, external :: cb
real*8 x(2), y(2)
common x, y

x =(/0,10/)
y =(/0,10/)

call winop@('%pl[file=designer1.set]')
i=winio@('%fn[Tahoma]%ts%bf%ff&',1.2d0)
i=winio@('%pl[x_array, n_graphs=1,x_axis="Days",y_axis="Nights"]%ff&',400,300,2, x,y)
i=winio@('%sf%cn%`bc%^bt[Update]%es%lw', rgb@(255,199,255), cb, ilw)
END

integer function cb()
use clrwin
real*8 x(2), y(2)
common x, y
call RANDOM_NUMBER (x(2))
call RANDOM_NUMBER (y(2))
x(2) = x(2) * 10 + 0.1
y(2) = y(2) * 10 + 0.1
print*,' x_max=', x(2), y(2)

call simpleplot_redraw@

cb=2
end function


Click Update few times and see how automatic limits perfectly work. Plotted is simple linear function Y=X with just two points in it and randomly changed maximum value of X or Y and plotted the result

Then click on icon on top left corner which starts Designer's mode and manually set any Maximum Values for X or Y and push Plot and Save.

Click Update button few times again with these numbers and see all works differently but perfectly again.

Now try to return back to automatic mode. I do not see how to do that.

2) If you are coloring some button %bt with some color using %`bc everything works in almost all windows OK besides the windows where %lw is used. Then color is distorted and is unpredictable. Unexplained, with the main program though (when %lw is in main code) %`bc works surprisingly OK (see previous demo example)

Code:
module mod
contains

integer function cb ()

i=winio@('%`bc%^bt[Push me2]%lw', rgb@(255,199,255), cb2,ilw)
cb=2
end function

Integer function cb2 ()
cb2=2
end function

end module
!---------------
program aaa
use mod
i=winio@('%`bc%^bt[Push Me]%es', rgb@(255,199,192), cb)
END


Last edited by DanRRight on Thu Sep 28, 2023 7:15 am; edited 4 times in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Sep 27, 2023 4:25 pm    Post subject: Reply with quote

I have added these issues to the log of things to investigate.
Back to top
View user's profile Send private message AIM Address
DanRRight



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

PostPosted: Tue Oct 17, 2023 7:20 am    Post subject: Reply with quote

I do not know how best way to make limits of x and y automatic but probably adding 4 radiobuttons "Auto" could be one of possible ways. Adding more variables of course may break the compatibility of the settings file. Since this is early moment in the development of %PL so that even Ken is not using it and i may be the only user so far Smile then would be probably right to make one important introduction here. In such cases in all my software and 100s of different settings files for everything in all my codes the first line in the settings files i put the 10 digit file version number like 202310171. Then this allows me to add whatever i want and maintain the compatibility. Each new addition in settings file starts with the new line and when reading it the fortran source will be checking this line version and read it accordingly. May be there exist better way, and i would like to learn here, but here is my real example. Each new version will need more settings variables and will read more and more from the settings file. All previous versions will just stop earlier and go to label 4444

Code:

if(iVersionOfPICsettRead.lt.201510141) goto 4444
   read (675,'(32x,  a   )',err=990,end=991) emptyLine
   read (675,'(32x, i10)',err=990,end=991) LogEnergy_Ee_time

   read (675,'(32x,i10,e10.3,i10,e10.3)',err=990,end=991) kUseMaxObjectLength, aMaxLengthOfWholeStruct,&
              k_escfMethod, cCorrFactEscF
if(iVersionOfPICsettRead.lt.201511151) goto 4444
   read (675,'(32x,  a   )',err=990,end=991) emptyLine
if(iVersionOfPICsettRead.ge.201705021) then
   read (675,'(32x,19i10)',err=990,end=991) k_PrepareShadowgram, k_ShadowgramFromSide, izn, &
                ionSpecieNoShad, k_makePhaseShiftInsteadOfShad, &
                kInclAbsorptionInInterfer, kInclFreeElInIndOfRefr, k_smoothDensity, nTimesSmoothing, k_smoothDensity9
else if(iVersionOfPICsettRead.ge.201703311) then
   read (675,'(32x,9i10)',err=990,end=991) k_PrepareShadowgram, k_ShadowgramFromSide, izn, &
                ionSpeciesNumbShad, k_makePhaseShift_InsteadOfShad
else 
   read (675,'(32x,8i10)',err=990,end=991) k_PrepareShadowgram, k_ShadowgramFromSide, izn, &
                ionSpecieNoShad
endif

if(iVersionOfPICsettRead.lt.201511151) goto 4444
   read (675,'(32x,9e10.3)',err=990,end=991) &
              CVsigmaN, FocalSpotDiameter2, aStructDiameter, RelDensityOfstructure, &
         SimBoxLength, DepthSubstr, TargetDiam
if(iVersionOfPICsettRead.ge.201704021) then
   read (675,'(32x,a,9i10)',err=990,end=991) chReacType, kCurrChoiceNumber, iAtomicElemNumber, niYs, niZs
else
    .....
    .....   
4444   close(675)
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Oct 17, 2023 10:48 am    Post subject: Reply with quote

Dan

I have not yet looked at these issues but I have now noted your additional comments.
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



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

PostPosted: Tue Oct 17, 2023 11:08 am    Post subject: Reply with quote

Quote:
so that even Ken is not using it


No %pl is Ken's no 1 graphing tool! By far the best method I have access to.
Back to top
View user's profile Send private message Visit poster's website
DanRRight



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

PostPosted: Tue Oct 17, 2023 1:45 pm    Post subject: Reply with quote

Ken, Do you use Designer's mode settings by adding
Code:
   call winop@('%pl[file=Settings.set]')
??
That what i was talking about: the structure of Settings.set file
Back to top
View user's profile Send private message
Kenneth_Smith



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

PostPosted: Tue Oct 17, 2023 2:57 pm    Post subject: Reply with quote

Dan, I misunderstood what you were saying. No I don't use design mode as much as perhaps I should. Changes to the appearance of the graphic are made via call to change_plot_dbl etc.

PS I added a %pv to the contour routine the other day. That was fun! The %pl callback is now a bit longer!
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Sat Nov 11, 2023 2:55 pm    Post subject: Reply with quote

Dan

I have had a brief look at this but you will need to make your request a lot shorter and simpler for me to make any progress.
Back to top
View user's profile Send private message AIM Address
DanRRight



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

PostPosted: Sun Nov 12, 2023 7:48 am    Post subject: Reply with quote

Paul,
Two demos demonstrate these issues:
1) first one shows that if you change x or y limits in Designers Settings you have no way back to automatic plotting where code itself takes care about minimum and maximum. That means user has to shutdown and restart the code to plot something else or permanently open same settings and fix the limits for each new plot. This is annoying and sometimes even unacceptable to close the code which is always running. Adding option "Auto" for x and y limits, or set limits to some rarely used huge number which will reset limits to Auto, say negative -3.e33 or more can solve this problem

2)second could be my compiler version problem, I expected users could comment too : the button color hiccups if GUI is just one level more complex than the standard Salford Clearwin examples. With simple code where all buttons are on main page and there are no child or next level windows all works ok


Last edited by DanRRight on Sun Nov 12, 2023 9:42 am; edited 1 time in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sun Nov 12, 2023 8:46 am    Post subject: Reply with quote

Dan

I think that I now understand your request (1) and I will add this to the wish list.
Back to top
View user's profile Send private message AIM Address
DanRRight



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

PostPosted: Sat Nov 18, 2023 3:32 am    Post subject: Reply with quote

Will clarify more why this change of limits in %PL is important on this example.

When you look at some dynamically changing data you can plot the either the entire range of data or chose some specific range of x or y in Settings to this plot (so called Designer's mode) . The %PL starts with automatically plotting the entire range of data, you just write simple i-2 lines program mention there X,Y and that's it, the rest will be done automatically,

If data changes next moment, you click on plot icon and it will adjust its limits automatically.
It can be also done that you do not to click on anything, it will plot next plot automatically.

But if you decided to look at some specific range and set the x,y limits on it (for example you want to resolve some tiny feature on the graph) you click on Settings icon and chose the needed range. When after that you want to return back to automatic limits and continue observing the whole data with automatic ranges you have no way to do that besides restarting entire GUI and also deleting Settings file! That means all other settings you made besides changing limits will be also lost.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Dec 04, 2023 9:57 am    Post subject: Reply with quote

Dan

A Restart button has been added to the %pl designer. This will appear in the next release of the DLLs.
Back to top
View user's profile Send private message AIM Address
DanRRight



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

PostPosted: Fri Dec 08, 2023 8:14 pm    Post subject: Reply with quote

Thanks Paul, Does it reset x min, x max, y min, y max separately? Or all of them at ones? Would be great to have all of them
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Dec 09, 2023 9:29 am    Post subject: Reply with quote

It resets everything to their initial values.
Back to top
View user's profile Send private message AIM Address
DanRRight



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

PostPosted: Sat Dec 09, 2023 7:15 pm    Post subject: Reply with quote

Clearly i dont feal the English language completely. By have all of them I meant all 5 separately
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 1, 2  Next
Page 1 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