Method: Roi#wait_for_change?

Defined in:
lib/roi/roi.rb

#wait_for_change?(timeout, args = {}) ⇒ Boolean

Public: Returns true if the given Roi changes before the specified timeout.

timeout - Integer total milliseconds to allow before timing out. key - String key press to trigger evaluation (default: nil).

If default, no key will be pressed.

delay - Integer total milliseconds to delay before starting evaluation (default: 0). scale - Boolean if the larger image should be scaled to the size of the smaller image (default: false).

Applies to image ROIs only.

priority - Symbol evaluation priority used to throttle CPU usage (default: :normal):

:critical   - Sleep 10 ms between intensive tasks (USE SPARINGLY)
:high       - Sleep 100 ms between intensive tasks
:normal     - Sleep 1 second between intensive tasks
:low        - Sleep 10 seconds between intensive tasks
:background - Sleep 1 minute between intensive tasks (USE SPARINGLY)

log_every - Integer total milliseconds between logs (default: 1000).

Returns a Boolean true if the Roi changed before the timeout, otherwise false.

Returns:



478
479
480
481
482
483
484
485
486
# File 'lib/roi/roi.rb', line 478

def wait_for_change?(timeout, args={})
  logger.info("Waiting #{timeout} ms for #{self.class.name} to change")
  args[:timeout] = timeout
  set_roi_options(args)
  first = retrieve
  verify(args) do
    retrieve != first
  end
end