3.15 / P003: save panels dynamically

Discussion about recent product features & solutions!
12 posts • Page 1 of 2
amichon
Posts:93
Joined: Sat May 17, 2014 3:49 pm

3.15 / P003: save panels dynamically

Post by amichon »

As annonced at User Days, patch 3 would coming with a CTRL function to save panels dynamically. I didn't find it in README or the HELP of P003. Please, could you help me to find it, may be it was not documented ?

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: 3.15 / P003: save panels dynamically

Post by leoknipp »

We are currently developing a solution where a panel loaded in a Vision modul can be saved into a panel file, e.g. if a panel has loaded references during runtime using addSymbol.
When the function will be available is not defined right now. It was not planned to make it officially available in P003.

What is the use case in your project?
Are you creating your panels only dynamically during runtime?

Best Regards
Leopold Knipp
Senior Support Specialist

amichon
Posts:93
Joined: Sat May 17, 2014 3:49 pm

Re: 3.15 / P003: save panels dynamically

Post by amichon »

Hello,

Thank you for your quick response.

I'm sorry, i made a mistake. I read again the "What's new in WinCC OA" presentation and "save panels as file" was a part of UI Enhancements but there was no planning for this feature in patch 3.

The use case is :
1. Create symbols from a definition in CSV file (with addSymbol or createSymbol)
2. Preset the position of many shapes over a background image and set properties
3. Run and save panel with a CTRL Script function
4. Edit with GEDI and make little changes if objects are one over the other
5. Panel is now saved as XML format and versionable with GIT/SVN

The main goals are:
1. increase the speed of panel loading and allow panel to be cachable
2. mix dynamic generation and edition with gedi
3. make panel versionable

amichon
Posts:93
Joined: Sat May 17, 2014 3:49 pm

Re: 3.15 / P003: save panels dynamically

Post by amichon »

Is there a solution to keep in memory all symbols that are created by CTRL script functions ?

Because i add symbols with addSymbol() or createSymbol() during Initialize event, they are created again at each new opening of panel.

The best solution that i found is to load all dynamic panels in separate embedded modules (they are in horizontal layout) and i play with the visibilities of embedded modules. :silly:

Another idea please ?

Thanks

kilianvp
Posts:443
Joined: Fri Jan 16, 2015 10:29 am

Re: 3.15 / P003: save panels dynamically

Post by kilianvp »

Damn i needed that feature sooo often in the past.. you have no idea

//Edit

Im ready for beta testing

amichon
Posts:93
Joined: Sat May 17, 2014 3:49 pm

Re: 3.15 / P003: save panels dynamically

Post by amichon »

Me too, i'm ready for beta testing !

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: 3.15 / P003: save panels dynamically

Post by leoknipp »

If you have already a function which reads a csv file you can also use this function to write a XML file with the basic settings.
After generating the panel for the first time the panel is opened in the graphical editor and the small changes are made to get the final layout.

How a reference and its information is saved in an XML file you can see by opening such a file in a text editor.

During the tests we have made we could not see a big difference for the loading times if a panel and its references are defined in the panel file or if they are loaded dynamically using addSymbol().
Reading the panel file does not take much time compared to executing the scripts defined in the panel and the references.

If a panel/reference is loaded from disk (once in a module) the next time the information is read from the UI memory. There is no access again to the disk to read the file.

When using several embedded modules and changing their visibility you have to take into account that also for an invisible module all scripts are executed, e.g. if a dpConnect() is used the work function is started even if the module is invisible.
This will create additional load for the UI for information which is not visible at the moment.

Why aren't you switching the panels to show only the panel which is needed at the moment?
How long does it take to load a panel?


Technical information: At the moment the functionality to save panels dynamically is not available (even as beta version) for our customers.
It is still a development task and we are currently working on it.
When it will be officially available is not defined right now.

Best Regards
Leopold Knipp
Senior Support Specialist

kilianvp
Posts:443
Joined: Fri Jan 16, 2015 10:29 am

Re: 3.15 / P003: save panels dynamically

Post by kilianvp »

the problem with XML panel generation is that you can't calculate the rotations of panels refs because there is some offset or something else that you add to the internal calculation (translation matrix) process.

here my code to try to calculate the rotation which worked but the postion (x/y) changed too

Code: Select all

// our Matrix
float aa = 1.0; // scale x
float bb = 0.0; // skew y
float cc = 0.0; // skew x
float dd = 1.0; // scale y
float ee = 1.0; // translate x
float ff = 1.0; // translate y
float rotate(float a)
{
  float b = cos(a);
  float c = sin(a);
  transform(b, c, -c, b, 0, 0);
}
//we have to invert our angle
void rotateDeg(float angle) 
{
  rotate(deg2rad(-angle));
}
float transform (float b, float d, float f, float h, float j, float l) 
{
  float a = aa;
  float c = bb;
  float e = cc;
  float g = dd;
  float i = ee;
  float k = ff;
  aa = a * b + e * d;
  bb = c * b + g * d;
  cc = a * f + e * h;
  dd = c * f + g * h;
  ee = a * j + e * l + i;
  ff = c * j + g * l + k;
}
// affects the RefPoint
void _translate(float tx, float ty)
{
  transform(1, 0, 0, 1, translateX, translateY);
}
void skew (float sy, float sx)
{
  transform(1, sy, sx, 1, 0, 0);
}

void outputMatrix()
{
  DebugTN(aa +" "+ bb +" "+ cc + " " + dd + " "+ ee + " " + ff );
}

rotateDeg(10);
outputMatrix();


amichon
Posts:93
Joined: Sat May 17, 2014 3:49 pm

Re: 3.15 / P003: save panels dynamically

Post by amichon »

Hello

I fully understand all your explanation. It's not easy to save symbols in xml format (position/rotation). I think it should be a CTRL script function of WinCC OA to warranty the compatibility with the product version.

I really have a performance issue on three panels they are loaded many thousands of dp connections. The initialization of all shapes takes between 2 and 5 seconds depending on computer performance and the method to make connections (per panel ref or per main panel).

It must be acceptable for me to maintain all dp connections in background to have a smooth switch between main views.

I'm stay interested if you have a beta version to test on my app.

thank you again for your response

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: 3.15 / P003: save panels dynamically

Post by leoknipp »

If loading panels takes some time maybe the time can be increased by modifiying the panels and the scripts processed when the panel is loaded.
There are different possibilites to speed up the loading time, here are some examples:
-- improving the script accessing the object, e.g. using getShape() to get a unique identifier for an object
-- initialize only visible objects

The function to save a dynamically created panel will not solve the problem when loading a predefined panel.

If you have very complex panels with a lot of objects and connect functions you should think about the solution that all panels are opened at the same time.
In this case the event manager has to send all the messages to the user interfaces and also the interfaces have to process all the changes, even if the module is not visiible at the moment.

Best Regards
Leopold Knipp
Senior Support Specialist

12 posts • Page 1 of 2