各位大哥,小弟我刚学习EM-PLANT不久,我是一直照着eM-Plant+7.0系统模拟(培训教程)这个教程来学的,现在学到最后阶段也就是在Dialog这里出了问题。我按照要求编写了对话框。对话框里设置了四个按钮。他们分别是《启动模拟》、《停止模拟》、《重置》、《初始化》。名称分别是:Start、Stop、Reset、Init。我修改的Callback Method 如下:
) q. w/ P( l1 T+ j% M9 f+ C(action : string)
( r) x( [. Q; I4 |is) N1 `* E& I, e, Y2 D3 {, o: p0 F
do. p5 X1 z- L2 `& v; K2 K2 G
inspect action
6 T$ y b& ]% B% w when "Open" then4 U0 a2 U5 k* {0 x, d
-- TODO: add code for the "Open" action here
2 m3 J! h: m4 h: Q when "Apply" then
* [! E) D' T$ T, I! m -- TODO: add code for the "Apply" action here
5 N# u2 V! }% e/ F; }/ L1 S# Y2 { when "Close" then# Y/ z* u4 ]2 c. X% Z4 O
-- TODO: add code for the "Close" action here
+ J1 N8 [* j! o9 m! x when "start" then .Trainning_Model1.plant5.EventController.start;
9 b, i+ Z: ~* V% a when "stop" then .Trainning_Model1.plant5.EventController.stop;
2 [2 i9 d& K) W `/ t; w7 ?5 r when "reset" then .Trainning_Model1.plant5.EventController.reset;
4 E5 J$ `& g( i7 N! _+ e: r9 B& W when "Init" then .Trainning_Model1.plant5.EventController.init;+ ]! a8 v6 ?/ D* G
end;) H& H# k3 m! f* Q* B9 g; T
end;
; O" Y& ?5 a4 G! O6 V7 ~$ Z当我从对话框点击《启动模拟》,模型确怎么也不会动。我找了好久原因都没有找着。也尝试着在本模型中设置Dialog .结果还是一样,特请各位大哥帮忙。谢谢! |