各位大哥,小弟我刚学习EM-PLANT不久,我是一直照着eM-Plant+7.0系统模拟(培训教程)这个教程来学的,现在学到最后阶段也就是在Dialog这里出了问题。我按照要求编写了对话框。对话框里设置了四个按钮。他们分别是《启动模拟》、《停止模拟》、《重置》、《初始化》。名称分别是:Start、Stop、Reset、Init。我修改的Callback Method 如下:
3 r& Q0 ^- q! P& @4 }5 w" U(action : string)
$ h0 W# O4 ~2 iis1 t* _- b( Y5 R4 H( n: h* n
do2 a) [, `3 q* x. r
inspect action
4 ]5 m) L# \+ ]& `4 E) i when "Open" then
0 A' N, ?. P f% Z -- TODO: add code for the "Open" action here
0 V w( I! w5 x: z' b when "Apply" then) Y; L7 y; K3 f
-- TODO: add code for the "Apply" action here8 a: s3 l+ d! d R9 m7 k; g3 |
when "Close" then( Z: N" V7 y9 S, m# b2 g" k
-- TODO: add code for the "Close" action here/ U4 _/ b% r% U9 n4 ~7 Y8 K
when "start" then .Trainning_Model1.plant5.EventController.start;
1 f, I U; \/ V3 O+ C4 q when "stop" then .Trainning_Model1.plant5.EventController.stop;0 L; ^- i3 y$ B! f: J& Y/ U5 m6 ^
when "reset" then .Trainning_Model1.plant5.EventController.reset;# T) U7 b x3 b# v0 w i6 n1 J" m
when "Init" then .Trainning_Model1.plant5.EventController.init;
% \& n L; L2 ]. L/ `: N end;6 s$ \# l: w) i# A" g) v- F$ g
end;( y% `- C6 f; y* F/ T& Q) q, t! q
当我从对话框点击《启动模拟》,模型确怎么也不会动。我找了好久原因都没有找着。也尝试着在本模型中设置Dialog .结果还是一样,特请各位大哥帮忙。谢谢! |