各位大哥,小弟我刚学习EM-PLANT不久,我是一直照着eM-Plant+7.0系统模拟(培训教程)这个教程来学的,现在学到最后阶段也就是在Dialog这里出了问题。我按照要求编写了对话框。对话框里设置了四个按钮。他们分别是《启动模拟》、《停止模拟》、《重置》、《初始化》。名称分别是:Start、Stop、Reset、Init。我修改的Callback Method 如下:
1 p4 R! A1 E! ~ W# F& Z7 v(action : string)
! V3 k' K) i$ ^is
7 R Z: R# f' p) E4 sdo* f5 \6 k! J. d$ d& g9 e
inspect action( j8 F& C i# ]
when "Open" then z% j9 ~0 Y( _$ [
-- TODO: add code for the "Open" action here
& T' i4 i- O) g when "Apply" then! L$ }1 ?7 o5 D3 Q3 ?( J, ^) `2 d
-- TODO: add code for the "Apply" action here
: y2 s/ `& Z% @% b! L$ W& K when "Close" then
* u1 p% \: d% [4 U -- TODO: add code for the "Close" action here4 I, Q$ f( z' h. \7 n# p: k
when "start" then .Trainning_Model1.plant5.EventController.start;
Z5 L6 M4 [, k when "stop" then .Trainning_Model1.plant5.EventController.stop;) E, k! G( C& U# ~: q. x% x1 m8 f, j
when "reset" then .Trainning_Model1.plant5.EventController.reset;+ y2 J$ _6 m' w/ z- x# T
when "Init" then .Trainning_Model1.plant5.EventController.init;9 d; u6 I8 Q4 X$ z' ?/ @5 [6 i
end;
l, d4 z) h# F! f" s7 ]& Mend;& V! ^2 Q! l% A ~ b
当我从对话框点击《启动模拟》,模型确怎么也不会动。我找了好久原因都没有找着。也尝试着在本模型中设置Dialog .结果还是一样,特请各位大哥帮忙。谢谢! |