Hello,
I would like to change the outlet variable of a ValueDisplay Item from another page.
Let me explain:
- the project has several pages (Page1, Page2, etc.) used to set cycle parameters, and you can navigate between them. There is a "common" page that displays a work cycle;
- on one page (Page1), there is a ValueDisplay object, and on the same page, a slot method called UpdateSlot with the following code:
if (Application::Device.ControlVar == 1)
ValueDisplay.Outlet = ^Property1;
if (Application::Device.ControlVar == 2)
ValueDisplay.Outlet = ^Property2;
if (Application::Device.ControlVar == 3)
ValueDisplay.Outlet = ^Property3;
...
- Using different buttons on various pages or external commands, a slot method in the Application::Device class is executed. This slot method assigns a specific value to the ControlVar variable and displays the "common" work cycle page with the PresentDialog command:
rootthis.PresentDialog( new Application::CyclePage, null, null, null, null, null, null, null, null, false ).
The slot method executed depends on the external button/command, meaning that there are various buttons/commands that execute different slot methods in the Application::Device class, which set the command variable to different values and display different pages. The slot method is called StartCycleX with X being the number of the ControlVar variable.
- Within these Slot Methods, I would like to execute the UpdateSlot slot method of Page1 to update the Outlet of the ValueDisplay object of the same page.
- The new page (CyclePage) is deleted after a while using the DismissDialog command.
I tried inserting the following code into the StartCycleX slots in the Application::Device class, but it didn't work.
var Application::Page1 dialog = new Application::FirstPage;
signal dialog.UpdateSlot;
or writing:
signal Page1.UpdateSlot;
In the first case nothing happens, while in the second I get an error directly in the prototyper.