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
Initialize panels and reference objects
- adaneau
- Posts:310
- Joined: Tue Feb 21, 2012 9:49 am
Re: Initialize panels and reference objects
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
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
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
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
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
Best regards,
Sanjin
- mkoller
- Posts:741
- Joined: Fri Sep 17, 2010 9:03 am
Re: Initialize panels and reference objects
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.
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
Thank you very much. I'll try with that method, to use $-parameter to each reference.
Best regards,
Sanjin
Best regards,
Sanjin