各位大哥,小弟我刚学习EM-PLANT不久,我是一直照着eM-Plant+7.0系统模拟(培训教程)这个教程来学的,现在学到最后阶段也就是在Dialog这里出了问题。我按照要求编写了对话框。对话框里设置了四个按钮。他们分别是《启动模拟》、《停止模拟》、《重置》、《初始化》。名称分别是:Start、Stop、Reset、Init。我修改的Callback Method 如下:) I2 P' u% E: z# s
(action : string)
# {2 v3 C2 P# c% ^; x- Lis
0 X" k( l+ |5 ]3 ?( J) Fdo9 }' m" A; P; @" t$ t
inspect action
( H9 F, {0 e# q3 p1 P when "Open" then
, ^ }. ?4 K4 _. D% F$ X, n5 P -- TODO: add code for the "Open" action here5 m5 J# y8 {1 I# O/ }( }1 l
when "Apply" then8 W& Z: Y1 X, R7 X/ @' N1 S* }; E
-- TODO: add code for the "Apply" action here
+ Y5 s% ]& V% p when "Close" then
# T% d4 m# \$ n$ t* X -- TODO: add code for the "Close" action here
; P% E( a* t. Y0 Z* j( e* d; e; s, I when "start" then .Trainning_Model1.plant5.EventController.start;
" r6 P' H! U/ c0 q8 {6 d+ i& j8 I( H when "stop" then .Trainning_Model1.plant5.EventController.stop;. }( o+ {2 \$ @- Q5 g+ }3 |
when "reset" then .Trainning_Model1.plant5.EventController.reset;$ T1 K n/ B0 V4 o! Z( h
when "Init" then .Trainning_Model1.plant5.EventController.init;& P! s% w/ h l0 T. S; A$ |
end;
8 i5 k5 [; ^$ e9 E( k6 l1 }0 r. Oend;8 V5 F# [! y u8 Z; p
当我从对话框点击《启动模拟》,模型确怎么也不会动。我找了好久原因都没有找着。也尝试着在本模型中设置Dialog .结果还是一样,特请各位大哥帮忙。谢谢! |