Innovyze-ICM-Libraries icon indicating copy to clipboard operation
Innovyze-ICM-Libraries copied to clipboard

WSOpenNetwork#each_selected bug

Open sancarn opened this issue 7 years ago • 0 comments

We noticed today that WSOpenNetwork#each_selected seems to be asynchronous such that:

net.scenarios do |scenario|
  net.current_scenario = scenario
  net.each_selected |obj|
    puts scenario
  end
end

And your scenarios are ["CAB","KST","PLT"] then you would expect the output:

Base
CAB
KST
PLT

But instead you get the output:

PLT

Ultimately the definition should define this behavior as follows:

Each_Selected schedules an event to loop over all selected objects. The block is called asynchronously to the rest of the code. I.E. It runs last.

sancarn avatar Jul 10 '18 11:07 sancarn