Method: Roi#wait_for_transition?
- Defined in:
- lib/roi/roi.rb
#wait_for_transition?(timeout, args = {}) ⇒ Boolean
Public: Returns true if the given Roi transitions before the specified timeout from false to true to false.
Corresponds to: api_wait_for_<ROI TYPE>_transition?
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). expected - Array of expected transition values (default: [true, false]). 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 transitioned before the timeout, otherwise false.
392 393 394 395 396 397 |
# File 'lib/roi/roi.rb', line 392 def wait_for_transition?(timeout, args={}) logger.info("Waiting #{timeout} ms for #{self.class.name} transition") args[:timeout] = timeout args[:expected] ||= [true, false] displayed?(args) end |