一个使用CurrIconNo的简单动画
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)