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 

Location a value in one dimensional vector and its display
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
PaulLaidler
Site Admin


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

PostPosted: Tue Feb 23, 2021 5:01 pm    Post subject: Reply with quote

Ken

Thanks for the feedback.

I have tested your program and I can see the unwanted tooltip when using the scrollbar.

Before trying to find a fix, I would like to be sure that I have it working correctly. Initially I can click on the graph and the point is marked and a tooltip appears but another click does not move the marker and the tooltip does not reappear (except when hovering over the scrollbar). Does it behave in the same way for you?
Back to top
View user's profile Send private message AIM Address
Martin_K



Joined: 09 Apr 2020
Posts: 219

PostPosted: Tue Feb 23, 2021 7:42 pm    Post subject: Reply with quote

Many thanks Ken!

I am going to implement it. My approach
with the DO loop (as it seems ) is not the right way,
since it always produce the run-time when I try to display the Point ID
in the showing box.
Back to top
View user's profile Send private message
Martin_K



Joined: 09 Apr 2020
Posts: 219

PostPosted: Tue Feb 23, 2021 8:18 pm    Post subject: Reply with quote

Paul,

I just tried Ken´s program and it works. First, I selected a point with left click
on a point the data are displayed. The I deselected the selection by right clicking
and selected another point with left click and it displayed again the required values and so on.
Back to top
View user's profile Send private message
Martin_K



Joined: 09 Apr 2020
Posts: 219

PostPosted: Tue Feb 23, 2021 9:02 pm    Post subject: Reply with quote

Ken,

I just became aware that I have an essential problem
with displaying Point ID (Point name) in the showing rectangle
(not with the height value - although I had to use strict limitations for displaying of Height values, but - basically it works as can be seen
in the picture below):



The input file has the following format (an example):

Point Id Y coordinate X coordinate Height
A-12 -485032.33 -1232457.87 234.26
135 -485043.25 -1232465.57 233.99
...
and so on.

When I read in the whole input file, I have in the program memory
the four vectors: PointID(n), Y(n), X(n), H(n).

Can I also display the POINT ID with your approach?

I mean - in the showing box should appear the following values (for example):

A-12
-485032.33
-1232457.87
234.26

I believe so, please confirm - thanks.
Back to top
View user's profile Send private message
Kenneth_Smith



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

PostPosted: Tue Feb 23, 2021 10:44 pm    Post subject: Reply with quote

Paul,
Quote:
Before trying to find a fix, I would like to be sure that I have it working correctly. Initially I can click on the graph and the point is marked and a tooltip appears but another click does not move the marker and the tooltip does not reappear (except when hovering over the scrollbar). Does it behave in the same way for you?

Yes, a second left click does not move the marker as a right click is required to cancel the current selection. Having repeated your list of “moves” a few times, I realise there is a flaw in the logic in the call back function which causes the current tooltip help information to be lost (following a second left click) when a point is currently selected. I’ve now corrected that.
Code:
!    Display height at point
    if ( clearwin_string@('callback_reason') .eq. 'MOUSE_LEFT_CLICK') then     
      call SET_TOOLTIP_TEXT@(pl_handle,'')
      if (show_height_flag .eq. 1 ) then

should be:
Code:
!    Display height at point
    if ( clearwin_string@('callback_reason') .eq. 'MOUSE_LEFT_CLICK') then     
      if (.not. point_selected) call SET_TOOLTIP_TEXT@(pl_handle,'')
      if (show_height_flag .eq. 1 ) then

You may have noticed that a blank tooptips help appears when hovering over the %pl region before any data points are selected. This is due to the initial declaration of the help_string containing char(10). I fixed this by adding the following to the timer call back function, so the char(10) is removed within 0.5 s of the window being created.
Code:
  logical, save :: first = .true.
 
    if (first) then
      call SET_TOOLTIP_TEXT@(pl_handle,'')
      first = .false.
    end if

With these changes, when the user selects a point the coordinate data is displayed next to the point where the click occurred (if there is a data point in the vicinity).

After the tooltips vanishes, the only way to recover the information is to move completely off the %pl region and back into it, the tooltips reappears where the mouse stops. This is not a problem and is consistent with the documentation.

Also, after the tooltips vanishes, if the user moves the mouse from the graphics region to the slider no tooltips appear. However if the user moves beyond the slider (away from the %pl) and then back onto the slider – then the tooltip appears on the slider – which is a little misleading, but not really a major issue. As you said an “unwanted tooltip”.

Modified code can be found here:-
https://www.dropbox.com/s/lqxafs188nlic4d/pl_scroll_zoom_th_2.f95?dl=0

Can you see the small coloured square that appears external to the bottom right corner of the %pl region ?
https://www.dropbox.com/s/v2l5g8oc06byicb/pl.jpg?dl=0

A long post. I hope this description is clear - I can resort to a video if necessary.

I am using the DLLs you provided on the 4th January (that fixed an issue with %`fl with [height] and [vertical_fill] option)

Thanks

Ken
Back to top
View user's profile Send private message Visit poster's website
Kenneth_Smith



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

PostPosted: Tue Feb 23, 2021 11:25 pm    Post subject: Reply with quote

Martin,
I don’t see any reason why you could not add to the output another line that contains the Point ID (Point name), if it is just a string of characters in a character array, identified by the same index as the double precision X, Y, and Z data.

Try running the example code with 10000 data points + Checkmate - it's fast, and that's due to Mecej4's suggested binary search. Much larger data set than I ever use - there's only about 800 transmission nodes in the whole of Scotland (and that's the whole transmission network from 400 kV down to 33 kV).
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Feb 24, 2021 9:32 am    Post subject: Reply with quote

Ken

Your modified program works well for me. I think the problem with the tooltip appearing over the scrollbar has gone or at least it is so rare as not to be significant.

I changed the tooltip delay from 0 to 500 and, for personal preference, I remove [topmost] from %ww. You might consider using the %th on/off control to advantage. At the moment you use the constant 1 so it is always on.

I will send you a link to a new set of DLLs so you won't need the initial char(10) or time delay fix.

The small unwanted square is a puzzle. It is not a control, just a filled rectangle in the background.
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



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

PostPosted: Wed Feb 24, 2021 10:55 am    Post subject: Reply with quote

Thanks Paul, I shall download the new DLL later.

Restoring the %pl[full_mouse_input], and adding the following to the callback causes the tooltip to follow the mouse, and there is no delay in the re-appearance of the tooltip after moving beyond the %pl region, i.e. it's the continuous update to the tooltip text which causes it to follow the mouse.

Code:
    if ( clearwin_string@('callback_reason') .eq. 'MOUSE_MOVE' ) then
      if (point_selected) call SET_TOOLTIP_TEXT@(pl_handle,height_string)
    end if

Example:-
https://www.dropbox.com/s/mq48eq43s1wf1o3/pl_scroll_zoom_th_3.f95?dl=0

PS With my "personalisation" settings the small square appears to be the same colour as the named system colours "menu" or "btnface", so in my case I can hide the square by setting the background colour to one these named colours.
Back to top
View user's profile Send private message Visit poster's website
Martin_K



Joined: 09 Apr 2020
Posts: 219

PostPosted: Thu Feb 25, 2021 7:10 pm    Post subject: Reply with quote

Ken,

this is the answer to your post of February 23, 10.44pm.

Yes, you are right. I made a formal error in the FMT statement, which is used to write the character string into an output string which displays it. Now, it works fine - see my last post of February 24, 1.17am in the topic
FMT problem or wrong code with FMT?

Now, one question to your last version (ver.3) of the code showing the 3D point data. I started to look at it, ran it and the question is:

When I deselect the option SHOW HEIGHT AT CURSOR and then I click
on a point in the graph, no data are displayed at all (I expected that after deselecting the option only height info will be omitted and the horizontal 2D values will still be showed). Is it so or deselecting means no data for display?

Martin
Back to top
View user's profile Send private message
Kenneth_Smith



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

PostPosted: Thu Feb 25, 2021 11:07 pm    Post subject: Reply with quote

Martin, that’s correct as the earlier version was only displaying the height value and then I added X and Y into the output tooltip string, but did not change the label in the %rb.
If you want to display a smaller subset of values, say just X and Y, then you need to set appropriate control flags, and use these flags to construct the output tooltip string with just the required output
Back to top
View user's profile Send private message Visit poster's website
Kenneth_Smith



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

PostPosted: Fri Feb 26, 2021 8:54 am    Post subject: Reply with quote

Allows the user to select any combination of X, Y, and Z, but not when a point is currently selected.

https://www.dropbox.com/s/brwjhhqkmz66yvv/pl_ideas.f95?dl=0
Back to top
View user's profile Send private message Visit poster's website
Martin_K



Joined: 09 Apr 2020
Posts: 219

PostPosted: Fri Feb 26, 2021 10:36 am    Post subject: Reply with quote

Excellent Ken - thanks!

I will try to implement it, plus I will add to show also the Point ID, since
it is important to identify on which point could be a possible problem (from geodetical point of view - for example, its horizontal and vertical accuracy
could be problematic, will exceed the defined threshold, so - its re-surveying would be needed, etc.).

Moreover, when I create an input file containing also 3D precision
information (horizontal + vertical) for each point, it will also be useful to display them (sigma_X, sigma_Y, sigma_H), so final box (when all checked) would display 7 different values.
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 -> Support All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 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