各位大哥,小弟我刚学习EM-PLANT不久,我是一直照着eM-Plant+7.0系统模拟(培训教程)这个教程来学的,现在学到最后阶段也就是在Dialog这里出了问题。我按照要求编写了对话框。对话框里设置了四个按钮。他们分别是《启动模拟》、《停止模拟》、《重置》、《初始化》。名称分别是:Start、Stop、Reset、Init。我修改的Callback Method 如下:
! q/ u b9 j( g& C# N6 P( A, D(action : string)
8 b# C" v; j* z; Zis
5 g1 ?* j7 D7 Z' r3 x+ e, g% r8 q8 Mdo
2 M) ?. V6 {6 }( h6 C inspect action
; g8 x; ]8 ^6 {$ k( e0 Q0 n: m when "Open" then
/ o$ H: A: C4 o -- TODO: add code for the "Open" action here7 t- o/ x, d4 w j' n4 q7 c8 f% V( x
when "Apply" then
! i Y3 l8 G3 u* }2 j0 r -- TODO: add code for the "Apply" action here8 l( O$ k! v0 l% C3 h
when "Close" then* G* }* I& C; ^+ n; F
-- TODO: add code for the "Close" action here
; ~6 n t# q+ u( |: t when "start" then .Trainning_Model1.plant5.EventController.start;2 B" v# U& x, H* T& E9 e; a0 }- X% \1 [
when "stop" then .Trainning_Model1.plant5.EventController.stop;
& j$ | L& t0 l! h: I( s, `" R when "reset" then .Trainning_Model1.plant5.EventController.reset;$ z k8 v- l4 ?: H* G3 c
when "Init" then .Trainning_Model1.plant5.EventController.init;
7 b1 M/ s# a r- `% r4 o( u end;
1 Y: w4 ?7 G4 ^# I! n5 Aend;' V3 v l0 f. M9 G5 p9 W( A
当我从对话框点击《启动模拟》,模型确怎么也不会动。我找了好久原因都没有找着。也尝试着在本模型中设置Dialog .结果还是一样,特请各位大哥帮忙。谢谢! |