ATTENTION

This 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

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 10-31-2012
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default 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.
Attached Files
File Type: zip pick_list_wrong.zip (47.2 KB, 105 views)
  #2  
Old 11-05-2012
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

why flexsim develop do not answer me this question?do i have some thing wrong?
  #3  
Old 11-05-2012
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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  
Old 11-05-2012
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

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  
Old 11-06-2012
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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  
Old 10-16-2013
Matt Long Matt Long is offline
FlexSim Development
 
Join Date: Apr 2012
Posts: 66
Downloads: 37
Uploads: 29
Thanks: 2
Thanked 150 Times in 40 Posts
Rep Power: 192
Matt Long is a glorious beacon of lightMatt Long is a glorious beacon of lightMatt Long is a glorious beacon of lightMatt Long is a glorious beacon of lightMatt Long is a glorious beacon of light
Default

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;
Attached Files
File Type: fsm pick_list_right.fsm (31.4 KB, 60 views)

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


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.