CODESYS - the IEC 61131-3 automation software
https://forum.codesys.com/

Cursor coordinates for web-visu client
https://forum.codesys.com/viewtopic.php?f=25&t=10000
Page 1 of 1

Author:  e.kislov [ Tue Sep 17, 2019 9:52 am ]
Post subject:  Cursor coordinates for web-visu client

Hi.
I need to get cursor coordinates for specific web-visu client in variables.
I have client context (POINTER TO VisuElems.VisuStructClientData), can I extract cursor info from this struct?

Author:  m.prestel [ Tue Sep 17, 2019 10:51 am ]
Post subject:  Re: Cursor coordinates for web-visu client

Hello,

check out the example on the store https://store.codesys.com/visu-event-handler.html, especially the MouseHandler.project

Best regards,
Marcel

Author:  e.kislov [ Tue Sep 17, 2019 11:32 am ]
Post subject:  Re: Cursor coordinates for web-visu client

Hi, m.prestel.
In this example cursor "global" for all web-clients.
In my case I have independent clients with independent cursors.
Can you give a tip how I need to edit example in my case?

Author:  m.prestel [ Tue Sep 17, 2019 12:03 pm ]
Post subject:  Re: Cursor coordinates for web-visu client

Hello,

HandleMouseMoveEvent will be called with the client where the move occurred.
IF you use CURRENTCLIENTID in your visualization, you can use pClient^.GlobalData.GlobalClientID to store the values in a array (otherwise GlobalClientID will always be -1).

For the size of the array you can use VISU_MIN_NUMBER_OF_CLIENTS & VISU_MAX_NUMBER_OF_CLIENTS
e.g.
ARRAY [VISU_MIN_NUMBER_OF_CLIENTS..VISU_MAX_NUMBER_OF_CLIENTS] OF VisuStructPoint;

Best regards,
Marcel

Page 1 of 1 All times are UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/