ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
|
Downloads |
Q&A Using Flexsim and building models |
#1
|
|||
|
|||
something wrong in pick list about" Pick Operator with Animation"
in the attach simple model , use setup operator for both setup and process,because not the case PICK_OPERATOR_PROCESS ,so operator will be utilize.so i think the pick list " Pick Operator with Animation" have something wrong.
|
#3
|
|||
|
|||
If you have "Use Setup Operator for Both Setup and Process" checked then you don't get a call back to the processdispatcher at the end of setup, even though you returned -1.
Looks like this is a pick option that shouldn't be available with the same operator option checked, or checksopfree shouldn't consider the usesameop variable, which could allow the same operator to have the two animation tasks that the picklist creates. |
#4
|
|||
|
|||
I think this is bug. because the code use the varible ("usesameop") several times.
if(getvarnum(current,"usesameop")) { freeoperators(operator, item); return -1; } theAnim = processAnim; } treenode ts = createemptytasksequence(operator,0,0); stopobject(current, STATE_WAITING_FOR_OPERATOR); inserttask(ts,TASKTYPE_TRAVEL,current,NULL); inserttask(ts,TASKTYPE_STOPREQUESTFINISH, current); inserttask(ts,TASKTYPE_STARTANIMATION, NULL, NULL, theAnim); inserttask(ts,TASKTYPE_UTILIZE,item, current); inserttask(ts,TASKTYPE_STOPANIMATION, NULL, NULL, theAnim); if(getvarnum(current,"usesameop")) { inserttask(ts,TASKTYPE_STARTANIMATION, NULL, NULL, processAnim); inserttask(ts,TASKTYPE_UTILIZE,item, current); inserttask(ts,TASKTYPE_STOPANIMATION, NULL, NULL, processAnim); } |
#5
|
|||
|
|||
Certainly the way the picklist is configured won't work with the way checksopfree is coded. Which one is the 'bug' is for the development team to decide.
|
#6
|
|||
|
|||
Sorry this is long overdue. The Processor is functioning properly, the issue was in the picklist code. The picklist has been updated to the following code. There is one note when using the same operator(s) for Setup and Processing, in order to get both animations to start, you need to call freeoperators in the OnSetupFinish trigger of the processor, otherwise only the initial animation will play. Attached is a working model.
Code:
/***popup:OperWithAnimation*/ /**Pick Operator with Animation*/ treenode operator = /** \nDispatcher: *//***tag:oper*//**/centerobject(current, 1)/**/; int useSameOp = getvarnum(current, "usesameop") && getvarnum(current, "usesetupoperators"); switch (trigger) { case PICK_OPERATOR_SETUP: case PICK_OPERATOR_PROCESS: { int theAnim = /**\nSetup Animation Rank: *//***tag:animrank*//**/4/**/; int processAnim = /**\nProcess Animation Rank: *//***tag:processanimrank*//**/5/**/; double priority = getvarnum(current, "processoperatorpriority"); // read the Priority value on the GUI int preempting = getvarnum(current, "preemptprocessoperators"); // read the Preemption mode on the GUI double numSetupOperators = getvarnum(current, "nrofsetupoperators"); double numProcessOperators = getvarnum(current, "nrofprocessoperators"); double numOperators = numSetupOperators; if (trigger == PICK_OPERATOR_PROCESS) { if (!useSameOp) numOperators = numProcessOperators; theAnim = processAnim; } for (int i = 1; i <= numOperators; i++) { stopobject(current, STATE_WAITING_FOR_OPERATOR); treenode ts = createemptytasksequence(operator,priority,preempting); inserttask(ts,TASKTYPE_TRAVEL, current, NULL); inserttask(ts,TASKTYPE_STOPREQUESTFINISH, current); inserttask(ts,TASKTYPE_STARTANIMATION, NULL, NULL, theAnim); inserttask(ts,TASKTYPE_UTILIZE, item, current); inserttask(ts,TASKTYPE_STOPANIMATION, NULL, NULL, theAnim); if (useSameOp) { inserttask(ts,TASKTYPE_STARTANIMATION, NULL, NULL, processAnim); inserttask(ts,TASKTYPE_UTILIZE, item, current); inserttask(ts,TASKTYPE_STOPANIMATION, NULL, NULL, processAnim); } dispatchtasksequence(ts); } return -1; // -1 means tell the processor that I am creating my own task sequence // and will free the operators myself, causing this code to be fired again } case PICK_OPERATOR_PROCESS_RELEASE: case PICK_OPERATOR_SETUP_RELEASE: { if (useSameOp) freeoperators(operator, item); freeoperators(operator, item); } } /**\nNote: If "Use Setup Operator(s) for both Setup and Process" is checked, freeoperators() will need to be called on the operator(s) in this Processor's OnSetupFinish trigger in order for both animations to run. */ return 0; Last edited by Phil BoBo; 10-16-2013 at 01:37 PM. |
The Following User Says Thank You to Matt Long For This Useful Post: | ||
Jörg Vogel (10-16-2013) |
Thread | Thread Starter | Forum | Replies | Last Post |
How can you have a visual tool that has a mixture of "protected" and "no select"? | thill | Q&A | 1 | 03-13-2012 12:44 AM |
Shape of an "operator with a Manuel-Pallet-Truck" | Simon Farsah | Q&A | 1 | 02-28-2009 02:05 PM |
State "Waiting for Operator" (2) | Donatus Minio | Q&A | 1 | 02-24-2009 05:19 AM |
Flexsim beginners are sometimes just amazing (Rack - Pick Operator) | Tom David | Q&A | 1 | 12-05-2008 10:35 AM |
Is it possible one object comprised of the function of "combiner" and "separetor"? | Vic Li | Q&A | 1 | 08-19-2008 04:41 AM |