|
|
发表于 2022-11-1 20:55:31
|
显示全部楼层
[i=s] 本帖最后由 zorsite 于 2022-11-1 20:57 编辑 [/i]
一开始还以为是求助,写了如下代码。
[code]//货物(2号端口输出)使用运输工具,托盘(1号端口输出)不用。[/code]
后来才发现在教学:L
对比了一下软件自带逻辑,发现多了两个命令,通知移出临时实体和移入临时实体完成。
软件自带代码如下:
[code]treenode disp = current.centerObjects[1];
if (port == 1) {
return disp;
} else {
transportoutcomplete(current, item, port);
transportincomplete(current.outObjects[port], item, opipno(current, port));
moveobject(item, current.outObjects[port], port);
}[/code]
[color=rgb(0, 0, 0)][font=Helvetica][size=13.3333px][color=blue][b]transportincomplete[/b][/color][/size][b](obj object, obj item [, num inport, obj transporter])[/b][/font]
Notifies the FixedResource object that item will now be moved into it[/color]
[color=rgb(0, 0, 0)][b]Description[/b]
This command notifies a downstream FixedResource object that the specified item will now be moved into it from an upstream object. This should only be used if the upstream object's Use Transport field is checked, but you are moving the item explicitly, instead of using an FRLOAD task. This allows the downstream FixedResource to manage data on how many items are slated to enter the object, but haven't arrived yet. Execute this command just before you move the item out with the moveobject command. For more information, refer to the FixedResource documentation. If this command returns 0, then the object has been stopped using the stopobject command, and you must wait until it has been resumed before moving the item into it.
[b]Example[/b]
transportincomplete(current.outObjects[port], item, opipno(current, port));
This example should be executed from the Request Transport From field before a moveobject command if you decide that you don't want to use a transport, but rather want to immediately move the flowitem
[/color]
[color=rgb(0, 0, 0)][font=Helvetica][size=13.3333px][color=blue][b]transportoutcomplete[/b][/color][/size] [b](obj object, obj item [, num outport, obj transporter])[/b][/font]
Notifies the FixedResource object that item will now be moved out of it[/color]
[color=rgb(0, 0, 0)][b]Description[/b]
This command notifies the FixedResource object that the specified item will now be moved out of it. This should only be used if the object's Use Transport field is checked, but you are moving the item explicitly, instead of using an FRLOAD task. This allows the FixedResource to manage data on how many items are still in the object but are ready to leave. Execute this command just before you move the item out with the moveobject command. For more information, refer to the FixedResource documentation. If this command returns 0, then the object has been stopped using the stopobject command, and you must wait until it has been resumed before moving the item into it.
[b]Example[/b]
transportoutcomplete(current, item, port);
This example should be executed from the Request Transport From field before a moveobject command if you decide that you don't want to use a transport, but rather want to immediately move the flowitem
[/color]
|
|