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 

Problems with %pl
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
DanRRight



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

PostPosted: Tue Dec 24, 2019 10:10 am    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Dec 24, 2019 11:25 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Kenneth_Smith



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

PostPosted: Tue Dec 24, 2019 11:55 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Tue Dec 24, 2019 3:00 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Tue Dec 24, 2019 4:38 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
DanRRight



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

PostPosted: Sun Dec 29, 2019 5:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Dec 30, 2019 9:23 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
DanRRight



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

PostPosted: Tue Dec 31, 2019 12:07 am    Post subject: Reply with quote

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
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Fri Jan 03, 2020 12:13 pm    Post subject: Reply with quote

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 ... Smile "
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Fri Jan 03, 2020 1:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Fri Jan 03, 2020 3:22 pm    Post subject: Reply with quote

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 ... Smile "
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Jan 20, 2020 4:51 pm    Post subject: Reply with quote

Ken

I have added symbol 12 and 13.
Back to top
View user's profile Send private message AIM Address
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Wed Jan 22, 2020 11:14 pm    Post subject: Reply with quote

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 ... Smile "
Back to top
View user's profile Send private message
Kenneth_Smith



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

PostPosted: Thu Jan 23, 2020 12:00 am    Post subject: Reply with quote

Thanks Paul, that's very much appreciated. Ken
Back to top
View user's profile Send private message Visit poster's website
Kenneth_Smith



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

PostPosted: Mon Feb 17, 2020 12:46 pm    Post subject: Reply with quote

Paul, symbols 12 and 13 working as expected in release V8.61. Thank you.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
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