Cancel
Showing results for 
Search instead for 
Did you mean: 

Dialog worker interface

Experimenter
Experimenter

Hello all!..

 

I want simulate a line production which I can change the number of worker via dialog created. The dialog contains kinds of products which I want to be produced and the number of workers.

How can I create a method inside this dialog to command the Text Box?

 

I was thinking to create a TableFile using a method .getWorkerCreationTable(TableFile); run the simulation to obtain the values of the workpool and after change the to .setWorkerCreationTable(TableFile); to manipulate the number Amount by a Table. This cell {2,1; e.g} will be controlled by the dialog.

 

Does anybody have another idea how can I do this?

5 REPLIES

Re: Dialog worker interface

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

the steps are:

- get the ceation table of the workerpool

- change the number of worker

- set the creation table

 

You can access the values of a TextField with dialog.getValue("TextFieldName"), so it looks like this:

 

local rt:table;
 rt.create;
 --read the creation table
 workerpool.getCreationTable(rt);
 -- set the new number
 rt[2,1]:=str_to_num(dialog.getValue("TextFieldName"));
 --re-assign the creation table to the WorkerPool
 workerpool.setCreationTable(rt); 

 

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Dialog worker interface

Experimenter
Experimenter
Sorry for my late reply... I did the steps but I think that I'm doing something wrong or my concept is not correct. I was thinking like this inside the callback:

(action: string)
is
do
inspect action
when "Open" then
dialog.getValue("HDs");

when "Apply" then
.Models.Frame.Workers[2,1]:= dialog.getvalue("HDs");

when "Close" then

when "CallbackChart" then mychart.active:=True
when "Callbackreport" then myreport.show;

end;
end;

Re: Dialog worker interface

Experimenter
Experimenter
My TableFile is a mirror of my WorkerPool in the current Frame and when I change the number of workers inside the TableFile, the numbers of workers inside the WorkerPool chage too and this is what I need but via dialog. Some way to change the number in my TableFile through a window. Smiley Happy

Re: Dialog worker interface

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

getValue returns a string. If your table column has the data type integer, you get an error. So you need to convert the value:

 

Models.Frame.Workers[2,1]:= str_to_num(dialog.getvalue("HDs"));

And "HDs" should be the name of the  TextField.

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Dialog worker interface

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Hi Guilherme_Br,

 

Maybe you should try the openDialogBox command of the table and open a view on the worker table with a button.

 

Note that you cannot edit the table directly, you first need to copy it (WorkerPool.getCreationTable(MyTable)), then edit it (MyTable.openDialogBox), and finally write it back (WorkerPool.setCreationtable(MyTable).

 

The advantage of openDialogBox is that the user gets a limited functionality, but can still edit the table in a window.

 

Regards,
Gert Nomden


Gert Nomden
Senior Consultant | Tecnomatix Product Manager
cardsplmsolutions.com