[Plant Simulation]一个使用CurrIconNo的简单动画(CurrIconNo使用及executeIn函数)

CurrIconNo使用及executeIn函数

在这里插入图片描述

工作站用户属性

在这里插入图片描述

初始化

Station.CurrIconNo:=Station.animation_start

工作站入口函数

var timePerSec:time

timePerSec:=self.~.ProcTime/(self.~.animation_end-self.~.animation_start+1)
if self.~.occupied
	wait timePerSec
end

if self.~.CurrIconNo<self.~.animation_end
	self.~.CurrIconNo:=self.~.CurrIconNo+1
	self.executeIn(0)
else
	self.~.CurrIconNo:=1
end

工作站Icon

在这里插入图片描述

CurrIconNo函数

<Path>.CurrIconNo:integer

CurrIconNo属性设置对象显示的图像编号

if MyStation.type = "drill" 
   MyStation.CurrIconNo := 3
else
   MyStation.CurrIconNo := 7
end

executeIn函数

&MyMethod.executeIn(CallAt:time[,Argument1:any, ...]) → boolean
&MyMethod.executeIn(CallAt:dateTime[,Argument1:any, ...]) → boolean

CallAt秒后调用方法,Argument同时向该方法传递参数

&MyMethod1.executeIn(23.5)
-- throttle the engine in 5 seconds to 85 percent
&ThrottleEngine.executeIn(5, 0.85)
-- New years day 2000 midnight
&MyMethod2.executeIn(str_to_date("1.1.00"))
-- call the method which a local variable references
var obj: object := &MyMethod3
obj.executeIn(4, "my string", true)

deleteMethCall函数

&Method.deleteMethCall

deleteMethCall函数在EventController中删除该方法的所有预定调用,可以用来删除不再需要的调用

execute函数

&Method.execute([Argument1:any, ... [,@:object=@, ?:object=self]])

execute将被引用的方法作为子例程执行,调用方法的执行将被中断,直到被调用的方法完成

Variable := &MyMethod1      -- variable is of data type object
Variable.execute            -- executes method1 
&MyMethod2.execute("abc")   -- executes myMethod2 
                            -- that expects 1 parameter
                            -- of data type string
self.execute(n+1)           -- calls a method recursively 

工作站出口函数

@.move(Conveyor) 

下载链接

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值