 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8217 Location: Salford, UK
|
Posted: Thu Apr 13, 2017 7:21 pm Post subject: |
|
|
That is what was intended and I thought that I had tested it but you are right it doesn't work. |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2927 Location: South Pole, Antarctica
|
Posted: Thu Apr 13, 2017 7:32 pm Post subject: |
|
|
Not very stable DLLs, or some other conflicts there. My codes freeze immediately with access violation like that (if this tells you anything):
Within file CLEARWIN64.DLL
In _fdebug_printf at address 17C
In _send_text_message at address 3B3
In _yield_program_control at address 234
In _sleep_at at address 5A
Within file PPP.exe
in ANGULARBREMMS at address 590b
Can not start the code in the debug mode to see what's wrong. Also crashes at start with /optimize mode.
With /nocheck code may start OK but is now sensitive and crashes often, seems it does not like something. For example the code freezes when i use %ac and works ok if the same callback is called via clicking on a button %bt.
Ones code worked with such tricks and i succeeded to run the new %pl i found that it still does not like something in the data and switches to linear scale from LOG. Is there a way to push it not do that ? As we discussed before it should not switch to linear scale when zero or negative data is present if condition y_min=val is used -- there is no reason to switch (and i do not see any zero/negative data and it still switches to linear). I see the work on that is almost done, %pl plots minimum of axis at y_min if you set it like this %pl[y_min=100.] but it still plots curves below this minimum threshold line and switches to linear if data has zeroes (or it suspects that)
New feature - the axis thickness works fine and looks good
CALL winop@("%pl[axes_pen=3]")
The new way of axis numbering when it switches the styles is probably not good idea. Example of some my real axis numbering: 0, 20, 40, 60, 80, 1e2, 1.2e2, 1.4e2 does not look good.
For reasonably small numbers it should be 0, 20, 40, 60, 80, 100, 120, 140.
The numbers as large as 1.2e5, 1e12 are probably OK represented like that but when axis is plotted they all should be in the same style
Last edited by DanRRight on Fri Apr 14, 2017 8:20 am; edited 7 times in total |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8217 Location: Salford, UK
|
Posted: Thu Apr 13, 2017 10:06 pm Post subject: |
|
|
Dan
I suggest that you just go back to a stable set of DLLs.
I am not able to do any more work on this for the time being. |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2927 Location: South Pole, Antarctica
|
Posted: Fri Apr 14, 2017 6:58 am Post subject: |
|
|
Paul,
Of course i will go to older dlls, but i'm curious if this is only my compiler state/settings issue. One simple case which crashes i already found. This demo code works in usual 32 bit mode
ftn95 name.f95 /link
and if you switch to 64
ftn95 name.f95 /64 /link
it crashes if you push DRAW or hit Ctrl+Z set in %ac
Code: |
use clrwin
integer, external :: callb
i=winio@('%ww%gr%ff&', 600,400)
i=winio@('%ac[Ctrl+Z]&',callb)
i=winio@('%cn%^bt[DRAW]%es',callb)
end
integer function callb()
use clrwin
ipos = random()*555
call draw_line@(1,1,ipos,111,rgb@(255,1,1))
callb =2
end function |
|
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8217 Location: Salford, UK
|
Posted: Fri Apr 14, 2017 8:22 am Post subject: |
|
|
Code: | use clrwin
integer, external :: callb
i=winio@('%ww%gr%ff&', 600,400)
i=winio@('%ac[Ctrl+Z]&',callb)
i=winio@('%cn%^bt[DRAW]%es',callb)
end
integer function callb()
use clrwin
real(2) random
ipos = random()*555
call draw_line_between@(1,1,ipos,111,rgb@(255,1,1))
callb =2
end function |
|
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2927 Location: South Pole, Antarctica
|
Posted: Fri Apr 14, 2017 10:19 am Post subject: |
|
|
This is not an answer, Paul. This implies that compiler is fine and the program is wrong. But if program is wrong and it is wrong 100 times per day when you develop the code then it is the debugger which must tell me where the error is or at least give a hint. I'd like to but probably will never afford to hire you guys to substitute SDBG . How I have to proceed to find the error of immediately crashing code with "Access violation writing address 0x00007ff..........."? Just inspecting by hand each of a quarter of million lines of code will take me the same quarter of million years. The debugger crashes at the start of debugging. How come such error can crash both the EXE and the debugger? The 32bit code works by the way fine hence we can not use 32bit debugger to find this bug --> we are screwed.
I see few nice new features, i'd like to use it, the LINEAR scale %pl for example already approaching ideal beating for XY plots in quality MATLAB being equally simple,
https://www.mathworks.com/products/matlab/plot-gallery.html
the LOG one is almost done and just needs final fixes (still plots outside the allowed area etc), but this was very unstable build, totally unusable because of crashing on everything. Could it be that the new dlls are conflicting with the rest of the older 8.10 compiler ?
So before you interrupt with further development of native %pl (I thought you enjoyed this work and understand how important is to have top quality and simplicity graphics utilities natively in Fortran but in reality it appears that things were going exactly opposite) can you please fix these issues with LOG scale which are demonstrated with this code below so that %pl will not plot outside the allowed area and will not switch to linear scale automatically if y_min=val exists (the data plotted often fluctuates and zeros/negatives are inevitable). That could be hopefully easy fixes. Also, though this could be not related to %pl problem: by some reason the new %pl does not react on Redraw like the older %pl was doing (to see that action remove the line CALL winop@("%pl[native]" and compile under regular 32bit). This will make %pl finally at least usable in 64bits.
Code: | Module Modd
use clrwin
integer, parameter:: N=10
real*8 X(N), Y(N), Z(N), T(N)
Contains
integer function callb()
real(2) random
do i=1,N
X(i)=i
Y(i)=exp(1.*i) * random()
Z(i)=exp(2.*i) * random()
T(i)=exp(3.*i) * random()
enddo
call simpleplot_redraw@
callb =2
end function
End module
!.....................................
program hhh
use clrwin
use Modd
j=callb()
i=winio@('%ww&')
CALL winop@("%pl[native]")
i=winio@('%pl[x_array,scale=log_linear,N_GRAPHS=3,y_min=100.]%ff&', 600,400, N, X,Y,Z,T)
i=winio@('%ac[Ctrl+Z]&',callb)
i=winio@('%cn%^bt[Redraw]%es',callb)
end |
Last edited by DanRRight on Mon Apr 17, 2017 4:52 pm; edited 6 times in total |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8217 Location: Salford, UK
|
Posted: Sat Apr 15, 2017 7:38 am Post subject: |
|
|
Thanks John. I only meant development work on the native %PL. Yes I aim to fix any native %PL "bugs" but the tick mark values on the axes may not always be tidy and the behaviour for log scales and negative data values will not change (for me these are not "bugs").
I am not sure what comes next. Maybe some of the requested missing Fortran standard features. Anyway I hope that I have learned my lesson. No more ventures like the native %PL. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8217 Location: Salford, UK
|
Posted: Sun Apr 16, 2017 8:27 am Post subject: |
|
|
John
The question about using negative data values and logarithmic transformations has gone on for so long now that I am beginning to doubt myself. If the user supplies a negative value of y then ClearWin+ can't calculate log(y) as a real value. I know that what is taught in physics can change but not mathematics surely. The issue about what happens with negative values of log(y) (e.g. log10(1e-3)) has been fixed.
As to the values shown at ticks marks, you can usually get good results particularly if you set (for example) the y_max and maybe the dy values. |
|
Back to top |
|
 |
Kenneth_Smith
Joined: 18 May 2012 Posts: 818 Location: Lanarkshire, Scotland.
|
Posted: Sun Apr 16, 2017 1:37 pm Post subject: |
|
|
John,
Apart from the issue with setting the margins independently the V6 DLLs are running fine for myself.
Ken |
|
Back to top |
|
 |
Kenneth_Smith
Joined: 18 May 2012 Posts: 818 Location: Lanarkshire, Scotland.
|
Posted: Tue Apr 18, 2017 7:20 am Post subject: |
|
|
John, You are correct I've not tried the log scales - must try harder! However I have not had to go back one set of dlls. Ken |
|
Back to top |
|
 |
Kenneth_Smith
Joined: 18 May 2012 Posts: 818 Location: Lanarkshire, Scotland.
|
Posted: Wed Apr 19, 2017 10:19 am Post subject: |
|
|
Paul,
Can you point me in the right direction and confirm the syntax for using the independent option. I am struggling to make the third %pl call in the code below work, where the two graphs with different x axis values are plotted together. Code below fails to draw anything in the third %pl region. I re-read the help file many times and tried various combinations with no success.
Thanks
Ken
Code: | program test
implicit none
include<windows.ins>
real(kind=2) x_array_1(10), x_array_2(10), y_array_1(10), y_array_2(10)
integer i
do i = 1, 10
x_array_1(i) = i
x_array_2(i) = i + 5
y_array_1(i) = x_array_1(i)**0.75d0
y_array_2(i) = x_array_2(i)**0.5d0
end do
i = winio@('%ww&')
i = winio@('%pl[native,x_array,n_graphs=1]&',300,300,10,x_array_1,y_array_1)
i = winio@('%pl[native,x_array,n_graphs=1]&',300,300,10,x_array_2,y_array_2)
i = winio@('%pl[native,x_array,n_graphs=2,independent]&',300,300,10,x_array_1,y_array_1,x_array_2,y_array_2)
i = winio@('%ff')
end program test |
|
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8217 Location: Salford, UK
|
Posted: Wed Apr 19, 2017 12:02 pm Post subject: |
|
|
Ken
For two independent graphs together the number of points must be passed as an array. So in the third %pl, 10 becomes np with
integer np(2)
np = 10 |
|
Back to top |
|
 |
Kenneth_Smith
Joined: 18 May 2012 Posts: 818 Location: Lanarkshire, Scotland.
|
Posted: Wed Apr 19, 2017 12:25 pm Post subject: |
|
|
Thanks Paul.
Might be worthwhile changing the text in the help file
from:
In this case the number of data points and the optional x-start and x-increment data must be presented as variables (for one graph) or as arrays (for one or more graphs) where the array index corresponds to the order in which the graphs are coded.
to:-
In this case the number of data points and the optional x-start and x-increment data must be presented as variables (for one graph) or as an array (for one or more graphs) where the array index corresponds to the order in which the graphs are coded.
It was the plural "arrays" which confused me.
Thanks
Ken |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8217 Location: Salford, UK
|
Posted: Thu Apr 20, 2017 4:02 pm Post subject: |
|
|
Thanks Ken. I have changed the text. |
|
Back to top |
|
 |
|
|
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
|