Silverfrost Forums

Welcome to our forums

Couple minor Clearwin problems

27 Sep 2023 1:45 (Edited: 28 Sep 2023 6:15) #30614
  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.

    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 real8 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.

  1. 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)

    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

27 Sep 2023 3:25 #30615

I have added these issues to the log of things to investigate.

17 Oct 2023 6:20 #30649

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 😃 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

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)
17 Oct 2023 9:48 #30650

Dan

I have not yet looked at these issues but I have now noted your additional comments.

17 Oct 2023 10:08 #30652

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.

17 Oct 2023 12:45 #30653

Ken, Do you use Designer's mode settings by adding

   call winop@('%pl[file=Settings.set]') 

?? That what i was talking about: the structure of Settings.set file

17 Oct 2023 1:57 #30654

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!

11 Nov 2023 1:55 #30729

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.

12 Nov 2023 6:48 (Edited: 12 Nov 2023 8:42) #30735

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

12 Nov 2023 7:46 #30737

Dan

I think that I now understand your request (1) and I will add this to the wish list.

18 Nov 2023 2:32 #30753

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.

4 Dec 2023 8:57 #30825

Dan

A Restart button has been added to the %pl designer. This will appear in the next release of the DLLs.

8 Dec 2023 7:14 #30834

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

9 Dec 2023 8:29 #30840

It resets everything to their initial values.

9 Dec 2023 6:15 #30846

Clearly i dont feal the English language completely. By have all of them I meant all 5 separately

10 Dec 2023 7:20 #30850

There are many properties that can be changed in the designer, many more than 5. The restart button will reset all of them to their values at the start.

13 Dec 2023 11:15 #30868

Paul,

Will the function associated with the reset button be available from the fortran code i.e. to provide a means of undoing all calls to change_plot_dbl@ etc?

13 Dec 2023 12:22 #30871

Ken

Thanks for your post.

A reset in that way would be an entirely different concept and a separate development.

13 Dec 2023 12:35 #30872

Paul, No problem - it was a 'I wonder if .....' moment.

Please login to reply.