各位大哥,小弟我刚学习EM-PLANT不久,我是一直照着eM-Plant+7.0系统模拟(培训教程)这个教程来学的,现在学到最后阶段也就是在Dialog这里出了问题。我按照要求编写了对话框。对话框里设置了四个按钮。他们分别是《启动模拟》、《停止模拟》、《重置》、《初始化》。名称分别是:Start、Stop、Reset、Init。我修改的Callback Method 如下:
3 }& S+ r2 P7 a3 i, Q(action : string)- T, @6 d) ?" ~; s0 T- x
is" Q! y" M5 J4 k4 s7 E
do/ Z" m, j3 e* ^# x0 [! [0 d6 d2 i
inspect action3 f% A5 L) F( n5 I2 P4 U
when "Open" then
X, K9 b& h! d0 i: n) U* _4 a3 \ -- TODO: add code for the "Open" action here
3 V- z' U' k$ }! I2 u when "Apply" then
, `& T1 j' ~6 m( [ P. z5 u5 y -- TODO: add code for the "Apply" action here
0 k5 d$ s: l' S H8 d# X when "Close" then
& S' \+ k- F6 l* Z% G2 {. G) }4 k -- TODO: add code for the "Close" action here/ F; n/ G6 R" |1 [8 B" c1 X; h
when "start" then .Trainning_Model1.plant5.EventController.start;
d% U4 q% r1 ]% `% | when "stop" then .Trainning_Model1.plant5.EventController.stop;
: `7 x" e# _4 S2 k1 l0 U when "reset" then .Trainning_Model1.plant5.EventController.reset;; Z# h) O6 ?# d4 Y
when "Init" then .Trainning_Model1.plant5.EventController.init;6 a, G" ]% z! C8 @3 c- z$ j
end;
# }$ e7 q3 t" jend;; K& e% z: v" B f- X; f
当我从对话框点击《启动模拟》,模型确怎么也不会动。我找了好久原因都没有找着。也尝试着在本模型中设置Dialog .结果还是一样,特请各位大哥帮忙。谢谢! |