Sikuli can't find a match on a second screen/monitor when calling a function in an included module
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
In Progress
|
Medium
|
RaiMan |
Bug Description
Sikuli-X 1.0rc2
Windows 7 Ultimate 64 bit.
Sikuli can't find a match on a second screen/monitor when calling a function in an included module.
I have a couple functions:
from sikuli.Sikuli import *
myScriptPath = "D:\\ICProjects
if not myScriptPath in sys.path:
sys.path.
scr1 = Screen(0)
def initScreen(
global scr1
scr1 = Screen(nScreen)
return scr1
def showSelectedScr
global scr1
scr1.highlight()
def ShowInfo():
global scr1
scr1.click(IMG)
They all work and find the IMG on the second monitor when they are called in the local script.
However when I try to call them from a master script that includes them it won't find the image. It will still show the same highlight on the second screen though. (On my system screen 0 highlights the second monitor, but I did try 1 as well)
from sikuli.Sikuli import *
#import os
myScriptPath = "D:\\ICProjects
if not myScriptPath in sys.path:
sys.path.
import testPOS
reload(
scrML = testPOS.
testPOS.
testPOS.ShowInfo()
Changed in sikuli: | |
status: | New → In Progress |
assignee: | nobody → RaiMan (raimund-hocke) |
milestone: | none → x1.0 |
tags: | added: multimonitor |
Changed in sikuli: | |
importance: | Undecided → Medium |
tags: |
added: fkt-region removed: multimonitor |
Changed in sikuli: | |
milestone: | x1.0 → x1.1 |
Hello RaiMan,
I want to highlight specific region from the image , I have written below code.
Its highlighting somewhere else and not the expected region from the image.
Please guide me in case of I have missed anything in below code.
public static Boolean isImageRegionPr esent(String imageRegion) {
String bigfilePath = Constants. configFolder + "Runtime.png"; bigfilePath) ;
Finder f;
Boolean result = false;
try {
f = new Finder(
f.find(new Pattern( imageRegion) );
if (f.hasNext()) {
Match m = f.next(); info("Expected Image region is NOT present.");
m.highlight(1);
result = true;
} else {
Log.
result = false;
}
} catch (IOException e) {
// TODO Auto-generated catch block
result = false; Trace() ;
e.printStack
}
return result;
}