各位大哥,小弟我刚学习EM-PLANT不久,我是一直照着eM-Plant+7.0系统模拟(培训教程)这个教程来学的,现在学到最后阶段也就是在Dialog这里出了问题。我按照要求编写了对话框。对话框里设置了四个按钮。他们分别是《启动模拟》、《停止模拟》、《重置》、《初始化》。名称分别是:Start、Stop、Reset、Init。我修改的Callback Method 如下:
! f1 Y3 |& K$ y" D& k(action : string)
; f) A- o. P. R+ G" n# cis
5 O% U: { S5 |$ |! Qdo
/ x- u; P7 U' E: ] inspect action2 U5 G2 @, e, P1 N3 q" F" P
when "Open" then
R1 }9 Z$ }: Z& S -- TODO: add code for the "Open" action here
9 |) m! _' P* F* I when "Apply" then8 t6 D: \6 E3 F; H& d
-- TODO: add code for the "Apply" action here
# T/ k2 W& ^% s9 `( v( \3 _ when "Close" then
& M6 k8 \( z. [7 i: ]0 X3 O+ \ -- TODO: add code for the "Close" action here6 N) c! F+ |4 }- g) \( j
when "start" then .Trainning_Model1.plant5.EventController.start;
! }8 j3 J2 Z3 q& Z' ` when "stop" then .Trainning_Model1.plant5.EventController.stop;3 Z! Y: M: A3 F
when "reset" then .Trainning_Model1.plant5.EventController.reset;9 A7 Z3 S2 w* t
when "Init" then .Trainning_Model1.plant5.EventController.init;
' n, l f& T% E5 ~3 `! A end;2 N# B; ?$ w, _8 ], M+ G4 N
end;
8 G( V0 C; `8 Y当我从对话框点击《启动模拟》,模型确怎么也不会动。我找了好久原因都没有找着。也尝试着在本模型中设置Dialog .结果还是一样,特请各位大哥帮忙。谢谢! |