Drag and Drop Datapoint as a $DP

Find and share HowTos to various installations / configurations!
4 posts • Page 1 of 1
leightm
Posts:1
Joined: Tue Jan 17, 2017 4:08 pm

Drag and Drop Datapoint as a $DP

Post by leightm »

I have been experimenting for the last few hours with associating symbols to datapoints in para (pretty nifty feature btw!)

I have run into a bit of a roadblock implementing a feature I'd like for the system, I figured it'd be best to show via video my problem (it's a quick 1 minute video):
https://youtu.be/Yk3TW4Rq4aQ

What I would like to do is this: when dragging and dropping a datapoint in para, a dollar parameter ($dpe in this case) would be auto populated with the address of the datapoint in question (so in the example I show in the video from 0:40-0:55), the $dpe value would autopopulate as testSolenoidValve

I know this must be technically possible, but I have yet to work it out and am starting to be digging around where I shouldn't be. Does anyone have a solution or somewhere to point me?

fmulder
Posts:330
Joined: Wed Feb 03, 2010 9:46 am

Re: Drag and Drop Datapoint as a $DP

Post by fmulder »

The beauty of OA is that everything is possible. Quite often I look in the standard panels of WinCC Oa to figure out how ETM has done it. When ETM has done it, then you can also do it (or better).
This actually means that you can quite easily implement your own drag-and-drop panel (or modify the panels of ETM). The trick that I've used is:

1. Implement with a panel with some buttons or some icons (or a bitmap of your icon) and give them a 'Drag' event
2. Implement your own drag and drop. When you start dragging then you store all the information that you need in global variables. The source code would be something like:

Code: Select all

  g_strDatapointId = strDatapoint;
  dragStart( strDragPanelFile, "", DRAG_COPY, "text/x-panel" );
3. When your icon (or panel) is dropped, then a refdef panel appears. This reference panel can then use the global variables to know what you intended to do. There is an X-File number 3 in the Lab section that explains how to do this

Playing with drag-and-drop and reference panel is not too difficult and the reward can be big ! This can really change an engineering proces

RudiKreiner
Posts:198
Joined: Mon May 16, 2011 2:10 pm

Re: Drag and Drop Datapoint as a $DP

Post by RudiKreiner »

I was just playing with this possibility in the para tool.
The V3.14 para supports the dragging of datapoint names from the datapoint selector tree.
You can try this by just dragging any entry from the tree into the" DP filter:" box.
You will see that the dragged name gets dropped there.
So just open panels/para.pnl and have a look at the DragDrop script there to see how to get at the information that is being dragged.
In your own panel you can then adapt this code as required.

Looking at the comment in the DragDrop script, this appears to be a fairly new feature:
//19.01.2015 rheiss IM116881: make dp_filter dropable and setFocus after drop on the textfield

nmnogueira
Posts:125
Joined: Thu May 05, 2011 12:59 pm

Re: Drag and Drop Datapoint as a $DP

Post by nmnogueira »

Check the Drag'N'Draw feature. It fills the $DP parameter automatically.

4 posts • Page 1 of 1