View previous topic :: View next topic |
Author |
Message |
DanRRight
Joined: 10 Mar 2008 Posts: 2818 Location: South Pole, Antarctica
|
Posted: Tue Dec 24, 2019 10:10 am Post subject: |
|
|
I forgot if another suggestion was mentioned to change not convenient
CALL winop@("%pl[symbol=8]")
CALL winop@("%pl[symbol_size=4]")
to convenient
CALL winop@("%pl[symbol]", 7)
CALL winop@("%pl[symbol_size]", 4)
Otherwise if you need to dynamically change width and type of symbols you will need to add a lot of source text for each of multiple curves plotted simultaneously
character chLineWid*16, chSymbolType*16, chSymbolSize*18
chSymbolType = '%pl[symbol= ]'
write(chSymbolType(12:13),'(i2)',err=301) iSymbolType_f_x(6)
goto 1301
301 chSymbolType = '%pl[symbol= 7]'
1301 CALL winop@(chSymbolType)
chSymbolSize = '%pl[symbol_size= ]'
write(chSymbolSize(17:17),'(i1)',err=2301) iSymbolSize_f_x(6)
goro 3301
2301 chSymbolSize = '%pl[symbol_size= 4]'
3301 CALL winop@(chSymbolSize) |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Tue Dec 24, 2019 11:25 am Post subject: |
|
|
I have made a note to add a new function.
In the meantime, is it not possible to write the new function in Fortran? |
|
Back to top |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 697 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Tue Dec 24, 2019 11:55 am Post subject: |
|
|
Paul,
If you are going to be looking at %pl again, can I suggest that two additional symbols would be a valuable addition (to myself anyway):
[symbol=12] Draw +
[symbol=13] Draw X
Merry Christmas everybody!
Ken |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Tue Dec 24, 2019 3:00 pm Post subject: |
|
|
Ken
I can add this to the list but it is quite independent of the previous request which simply requires a little function to covert the arguments.
Paul |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Tue Dec 24, 2019 4:38 pm Post subject: |
|
|
Dan
A set of routines is already available as described in item 406 of cwplus.enh....
SUBROUTINE WINOP_INT@(fmt, dval)
SUBROUTINE WINOP_FLT@(fmt, fval)
SUBROUTINE WINOP_CLR@(fmt, cval) !for colours
SUBROUTINE WINOP_STR@(fmt, sval)
SUBROUTINE WINOP_HDL@(fmt, hval)
SUBROUTINE WINOP_FUN@(fmt, fun)
CHARACTER(*) fmt,sval
INTEGER dval,cval
DOUBLE PRECISION fval
INTEGER(7) hval
DOUBLE PRECISION FUNCTION fun(x)
DOUBLE PRECISION x |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2818 Location: South Pole, Antarctica
|
Posted: Sun Dec 29, 2019 5:42 pm Post subject: |
|
|
Thanks Paul. Is this any better and faster cure then the way I provided ? Was there any particular reason to implement this such cumbersome way? This solution halted my brain to understand why, say, changing number 8 to 7 will require to fly through Australia. In the Help no reasoning or examples showing advantages of using was provided. Why not implement
CALL winop@("%pl[symbol=7]")
by obvious way
CALL winop@("%pl[symbol]", 7)
or at least kind of semi-standard Clearwin way
CALL winop@("%pl[symbol=@]", 7) ??? Will this allow to change plot parameters (widths, symbol sizes etc) dynamically after the plot was already made while my way will not? The minimal size but nicest looking working examples always help to understand these features. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Mon Dec 30, 2019 9:23 am Post subject: |
|
|
Dan
This is what you asked for and is already available (maybe because you asked for it previously).
Where you asked for:
CALL winop@("%pl[symbol]", 7)
you must write:
CALL winop_int@("%pl[symbol]", 7)
The new functions were provided in the simplest and most natural way available when writing DLL functions in C for a Fortran or C++ source. The new functions could have overloaded the name winop@ but (for me) that would not be the natural way to do it. There will be no noticeable difference in speed. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2818 Location: South Pole, Antarctica
|
Posted: Tue Dec 31, 2019 12:07 am Post subject: |
|
|
This does not look as bad as I thought. It's a bit puzzling without an example. But now I understand. Thanks |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Fri Jan 03, 2020 12:13 pm Post subject: |
|
|
Happy New Year everyone !
Paul wrote:
Quote: | The new functions could have overloaded the name winop@ ... |
what does that mean ? _________________ ''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... " |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Fri Jan 03, 2020 1:01 pm Post subject: |
|
|
This loaded meaning of the common word "overload" made me confused, too, when I first came across it in the 1990-s.
An overloaded word has to bear the burden of having multiple meanings. For example, the verb "put" is given 57 different definitions in the Oxford English Dictionary.
Please see https://en.wikibooks.org/wiki/Computer_Programming/Function_overloading . |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Fri Jan 03, 2020 3:22 pm Post subject: |
|
|
thanks for the link and the astute comment mecej4.
I take it then that it was referring to IF winop@ had been modified to accept a variable instead of a constant value for the parameter.
Paul's additional comment that:
that would not be the natural way to do it. Quote: |
to a user would appear to be counter-intuitive !
The possibility to directly specify a variable, rather than call 2 functions, would appear to be the more logical 'natural' way to go.
But no doubt there are good programming reasons behnd the way adopted via winop_XXX@ functions.
But then again I'm not a programmer (in the developer sense). |
_________________ ''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... " |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Mon Jan 20, 2020 4:51 pm Post subject: |
|
|
Ken
I have added symbol 12 and 13. |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Wed Jan 22, 2020 11:14 pm Post subject: |
|
|
PAul,
does this enhancement mean %pl is back on the work list ?
(to fix the numerous othr previous niggly problems) _________________ ''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... " |
|
Back to top |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 697 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Thu Jan 23, 2020 12:00 am Post subject: |
|
|
Thanks Paul, that's very much appreciated. Ken |
|
Back to top |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 697 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Mon Feb 17, 2020 12:46 pm Post subject: |
|
|
Paul, symbols 12 and 13 working as expected in release V8.61. Thank you. |
|
Back to top |
|
|
|