Initialize panels and reference objects

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
6 posts • Page 1 of 1
sanjin.djogic
Posts:6
Joined: Fri Nov 02, 2018 11:32 am

Initialize panels and reference objects

Post by sanjin.djogic »

Hi,

Does the panel of the reference object perform an initialization before the main panel on which the reference is located. The global variables that i add to the initialization of the main panel is not visible on the initialization of the reference. If i add code on some object (ellipse, circle etc.), than reference can see global variables that i add on initialize of main panel.

Best regards,
Sanjin

adaneau
Posts:310
Joined: Tue Feb 21, 2012 9:49 am

Re: Initialize panels and reference objects

Post by adaneau »

Hi,

I have no idea what is parsed first when loading a panel...
Maybe you should use public functions to init your references (ex: class constructor?) , so you can control the moment when they will be called, avoiding not controlling script sequence?

BR
Alex

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

Re: Initialize panels and reference objects

Post by leoknipp »

In which scripts have you defined the global variables in the main panel?
Are you using the ScopeLib or another script?
Is the global variable defined as variable declaration or using the CTRL function addGlobal?

Best Regards
Leopold Knipp
Senior Support Specialist

sanjin.djogic
Posts:6
Joined: Fri Nov 02, 2018 11:32 am

Re: Initialize panels and reference objects

Post by sanjin.djogic »

I'm using the CTRL function addGlobal on initialize of main panel. I'm not using ScopeLib. I use a distributed system and I need to initialize the system variable to know which data points from which system I will call. I have a main panel and a large number of references on it. I put on initialize of references code that use system name that i added on main panel. When I first start the panel, the system variable is not visible on the references, but second time I start the panel, system variable is visible. If i add that code on some object on the reference panel(ellipse, circle etc.), than reference can see system name when i first start the panel.

Best regards,
Sanjin

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Initialize panels and reference objects

Post by mkoller »

It seems this is the wrong approach.
When you want that the panel references adjust what they do based on what the main panel is showing (in your case the system name)
then the correct way is to pass a $-parameter to each reference.
Manager global variables are often the wrong solution. Try to avoid them.

sanjin.djogic
Posts:6
Joined: Fri Nov 02, 2018 11:32 am

Re: Initialize panels and reference objects

Post by sanjin.djogic »

Thank you very much. I'll try with that method, to use $-parameter to each reference.

Best regards,
Sanjin

6 posts • Page 1 of 1