timeOut

Asked by Natanael Morais

 Pattern a = new Pattern("D:\\Automação Sikuli\\trunk\\Imagens Config\\Drivers\\DriversIR\\17_LN40A550P.png");
        Screen s = new Screen();
       Region b = s.selectRegion();
        b.setAutoWaitTimeout(3);
        System.out.println(b.getAutoWaitTimeout());
        System.out.println(Settings.AutoWaitTimeout);
        try
        {
            if(b.exists(a.similar((float) 0.98),3) != null)
            {
                System.out.println("oi");
            }
            System.out.println("xau");
        }

        catch(Exception e)
        {
             System.out.println(e);
        }

Is there anything wrong with this code?

Because when the Sikuli didn't find the image my application is not finished, it's still running even I set time out up.

Tks.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

the global or region specific autowaittimout value is only taken, if no timeout is given with the function.

since you use
b.exists(a.similar((float) 0.98),3)

BTW: float shortcut:
b.exists(a.similar(0.98f),3)

the autowaittimeout value is not taken.

But anyway: both values are the same (3 secs) so what should be the difference?

Revision history for this message
Natanael Morais (natanael) said :
#2

Thanks RaiMan, that solved my question.