Plant Simulation MultiPortalCrane 移库

if Store4.numMU > 0
	wait 2:00
	var portal := MultiPortalCrane7.portal1
	waituntil portal.state ="waiting" or portal.state="idle"
	var o: object := Store4.findPart("PalletMachine") // 查找存储Store4中某个部件
	portal.moveToObject(o)

	waituntil portal.state ="waiting" or portal.state="idle"
	portal.moveHook(2)

	waituntil portal.state ="waiting" or portal.state="idle"
	Store4.cont.move(portal)

	waituntil portal.state ="waiting" or portal.state="idle"
	portal.moveHook(2)

	waituntil portal.state ="waiting" or portal.state="idle"
	portal.moveToObject(Store21)

	waituntil portal.state ="waiting" or portal.state="idle"
	portal.moveHook(4.8)

	waituntil portal.state ="waiting" or portal.state="idle"
	if portal.cont /= VOID
		portal.cont.move(Store21)
	end
	waituntil portal.state ="waiting" or portal.state="idle"
	portal.moveHook(2)

	waituntil portal.state ="waiting" or portal.state="idle"
	portal.endSequence
end
startsysDate:=sysDate

portal1.moveToPosition(targetSP1.x, targetSP1.y)

waituntil portal1.state="waiting"
// 天车移动吊具
portal1.moveHook(5)
waituntil portal1.state="waiting"
// 物品移动到天车上
@.move(portal1)
waituntil portal1.state="waiting"
portal1.moveHook(1)
var endMU:object
/*for var y := 1 to AreaTable.yDim
	if (AreaTable[4,y] = VOID or AreaTable[4,y].dim <65) and AreaTable[1,y] /= 库位22
		//TargetPosition := .ApplicationObjects.CranesAndMore.Internal.Methods.getTargetPosition(MultiPortalCrane,AreaTable[1,y])
		// 将世界坐标转换为天车坐标
		//CranePosition := MultiPortalCrane.calculateTargetPosition(portal1, TargetPosition)
		//print AreaTable[4,y],"--",AreaTable[1,y],TargetPosition,CranePosition
		//portal1.movePortalTo(CranePosition)
		targetSP1 := portal1.~._3D.getPositionOfObject(AreaTable[1,y])
		endMU:=AreaTable[1,y]
		portal1.moveToPosition(targetSP1.x, targetSP1.y)
		waituntil portal1.state="waiting"
		portal1.moveHook(5)
		waituntil portal1.state="waiting"
		portal1.cont.move(AreaTable[1,y])
		waituntil portal1.state="waiting"
		portal1.moveHook(1)
		if AreaTable[4,y] = VOID
		 	var l: list[object]
			l.create
			l.insert(1, @)
			AreaTable[4,y]:= l
			AreaTable[4,y].insert(1, @)
		else
			AreaTable[4,y].insert(1, @)
		end
		exitloop
	end
	next*/

targetSP1 := portal1.~._3D.getPositionOfObject(存储11)

		portal1.moveToPosition(targetSP1.x, targetSP1.y)
		waituntil portal1.state="waiting"
		portal1.moveHook(5)
		waituntil portal1.state="waiting"
		portal1.cont.move(存储11)
		waituntil portal1.state="waiting"
		portal1.moveHook(1)
portal1.endSequence
endsysDate:=sysDate
// 存入任务表
var spendTime:integer:=endsysDate - startsysDate
// 天车,起点库位,终点库位,时间,耗时
TaskTable.appendRow(portal1, @,存储11,startsysDate,endsysDate,spendTime)

更新:


var portal = MultiPortalCrane.portal1
print portal
var startTime = sysDate
waituntil portal.state ="waiting" or portal.state="idle"
var o: object := 存储.findPart("零件")
portal.moveToObject(o)

waituntil portal.state ="waiting" or portal.state="idle"
portal.moveHook(3)

waituntil portal.state ="waiting" or portal.state="idle"
存储.cont.move(portal)

waituntil portal.state ="waiting" or portal.state="idle"
portal.moveHook(2)

waituntil portal.state ="waiting" or portal.state="idle"
portal.moveToObject(上料口)

waituntil portal.state ="waiting" or portal.state="idle"
portal.moveHook(3)

waituntil portal.state ="waiting" or portal.state="idle"
wait 20
if portal.cont /= VOID
	portal.cont.move(上料口)
end
waituntil portal.state ="waiting" or portal.state="idle"
portal.moveHook(2)

waituntil portal.state ="waiting" or portal.state="idle"
portal.endSequence
var endTime:=sysDate

var spendTime=endTime - startTime
// 天车,起点库位,终点库位,时间,耗时
调度表.appendRow(portal, startTime,endTime,o,上料口,spendTime)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值