simultaneous pauses loop in GUI
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
I create a function for a togglebutton for control system.
if get(togglebutton1,'value')==1
if get(checkbox1,'value')==1
if pumptime1>0
start(pump1.t)
pause(pumptime1)
stop(pump1.t)
else
start(pump1.t)
end
end
if get(checkbox2,'value')==1
if pumptime2>0
start(pump2.t)
pause(pumptime2)
stop(pump2.t)
else
start(pump2.t)
end
end
elseif get(togglebutto,'value')==0
if get(checkbox1,'value')==1
stop(pump1.t)
end
if get(checkbox2,'value')==1
stop(pump2.t)
end
end
how can I made the pause do in the sametime? please help!
3 个评论
Rik
2019-1-3
I create a button that can detect several checkboxes, however I can not find a way to run those checked checkboxes in the same time. I try to use individual if for each checkbox, it can be well run when the checkboxes checked. But when I use pause for each indivdual checkboxes, the loops would not run in the same time count the pause together. they become to go through the pauses one by one in each checked checkbox. Is there any way that can make those pauses start together?
Rik
2019-1-3
Have you tried to first find out the length of every pause, and after that running them all at the same time (by having only 1 call to pause)? You can sort the pause times in ascending order and run them in a loop.
Kuang-Yu WANG
2019-1-4
回答(0 个)
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!