本文整理汇总了Java中org.sikuli.basics.Settings类的典型用法代码示例。如果您正苦于以下问题:Java Settings类的具体用法?Java Settings怎么用?Java Settings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Settings类属于org.sikuli.basics包,在下文中一共展示了Settings类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: init
import org.sikuli.basics.Settings; //导入依赖的package包/类
public static void init() {
Settings.ActionLogs = true;
Settings.InfoLogs = true;
Settings.MoveMouseDelay = 0.1f;
Settings.SlowMotionDelay = 0.1f;
Settings.DebugLogs = true;
Settings.OcrTextRead = true;
Settings.OcrTextSearch = true;
}
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:11,代码来源:SikuliSettings.java
示例2: SikuliXAutomation
import org.sikuli.basics.Settings; //导入依赖的package包/类
/**
*
* @param screen
* The Sikuli screen
*/
public SikuliXAutomation(Screen screen) {
SikuliXAutomation.SCREEN = screen;
Settings.MoveMouseDelay = MOVE_MOUSE_DELAY;
Settings.CheckLastSeen = CHECK_LAST_SEEN;
setMinSimilarity(DEFAULT_SIMILARITY);
if (System.getProperty("os.name").equals("Mac OS X")) {
screenshotpath = "screenshots/mac/";
}
if (System.getProperty("os.name").contains("Windows")) {
screenshotpath = "screenshots/windows/";
}
setSearchRegion(screen);
}
开发者ID:aguelle,项目名称:MIDI-Automator,代码行数:23,代码来源:SikuliXAutomation.java
示例3: getCoords
import org.sikuli.basics.Settings; //导入依赖的package包/类
public Point2D getCoords(BufferedImage baseImg, String targetImgPath, double minSimilarityValue) {
//set new minimum similarity
Settings.MinSimilarity = minSimilarityValue;
Match m;
Finder f = new Finder(baseImg);
Point2D coords = new Point2D.Double(-1, -1);
f.find(targetImgPath);
if (f.hasNext()) {
m = f.next();
coords.setLocation(m.getTarget().getX(), m.getTarget().getY());
}
//revert to default similarity
Settings.MinSimilarity = DEFAULT_MIN_SIMILARITY;
return coords;
}
开发者ID:Simon-Kaz,项目名称:AppiumFindByImage,代码行数:17,代码来源:OCR.java
示例4: ImageCommand
import org.sikuli.basics.Settings; //导入依赖的package包/类
public ImageCommand(CommandControl cc) {
super(cc);
try {
robot = new Robot();
} catch (AWTException ex) {
Logger.getLogger(ImageCommand.class.getName()).log(Level.SEVERE, null, ex);
}
Settings.ActionLogs = true;
Settings.InfoLogs = true;
Settings.MoveMouseDelay = 0.1f;
Settings.SlowMotionDelay = 0.1f;
Settings.DebugLogs = true;
Settings.OcrTextRead = true;
Settings.OcrTextSearch = true;
}
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:16,代码来源:ImageCommand.java
示例5: testGetCoordsWithSetMinSimilarity_revertsToDefaultMinSimilarity
import org.sikuli.basics.Settings; //导入依赖的package包/类
@Test
public void testGetCoordsWithSetMinSimilarity_revertsToDefaultMinSimilarity() throws Exception {
String imageName = "acceptAll.png";
String imageLocation = imgDir + imageName;
BufferedImage testImg = convertImgFileToBufferedImage(imageLocation);
assertThat("default minSimilarity should be used", Settings.MinSimilarity, is(DEFAULT_MIN_SIMILARITY));
ocr.getCoords(testImg, imageLocation, 0.9);
assertThat("minSimilarity should revert back to default", Settings.MinSimilarity, is(DEFAULT_MIN_SIMILARITY));
}
开发者ID:Simon-Kaz,项目名称:AppiumFindByImage,代码行数:11,代码来源:OCRTest.java
示例6: init
import org.sikuli.basics.Settings; //导入依赖的package包/类
/**
* Initializes the automator
*
* @param minSimilarity
* The minimum similarity for the automation
*/
public void init(float minSimilarity) {
Settings.MinSimilarity = minSimilarity;
Settings.CheckLastSeenSimilar = minSimilarity;
Settings.MoveMouseDelay = MOVE_MOUSE_DELAY;
Settings.CheckLastSeen = CHECK_LAST_SEEN;
}
开发者ID:aguelle,项目名称:MIDI-Automator,代码行数:13,代码来源:GUIAutomator.java
示例7: searchForScreenshot
import org.sikuli.basics.Settings; //导入依赖的package包/类
/**
* Search for the given screenshot
*
* @return <TRUE> if it was found, <FALSE> if it was not found within the
* time period.
*/
private boolean searchForScreenshot() {
Region lastFound = guiAutomation.getLastFoundRegion();
// reduce search region
if (lastFound != null && !guiAutomation.isMovable()
&& !fixedSearchRegion) {
searchRegion.x = lastFound.x;
searchRegion.y = lastFound.y;
searchRegion.w = lastFound.w;
searchRegion.h = lastFound.h;
fixedSearchRegion = true;
}
log.debug("("
+ getName()
+ "): Search for match of \""
+ SystemUtils.replaceSystemVariables(guiAutomation
.getImagePath()) + "\" " + ", minimum smimilarity: "
+ String.format("%.2g%n", Settings.MinSimilarity)
+ ", scan rate: " + searchRegion.getObserveScanRate());
return searchRegion.observe(SIKULIX_TIMEOUT);
}
开发者ID:aguelle,项目名称:MIDI-Automator,代码行数:33,代码来源:GUIAutomator.java
示例8: minSimilarity
import org.sikuli.basics.Settings; //导入依赖的package包/类
@RobotKeyword("Set Sikuli minSimilarity(0-1)")
@ArgumentNames({"minSimilarity"})
public String setMinSimilarity(String minSimilarity) {
double prevMinSimilarity = Settings.MinSimilarity;
Settings.MinSimilarity = Double.parseDouble(minSimilarity);
return Double.toString(prevMinSimilarity);
}
开发者ID:rainmanwy,项目名称:robotframework-SikuliLibrary,代码行数:8,代码来源:SettingsKeywords.java
示例9: killAppName
import org.sikuli.basics.Settings; //导入依赖的package包/类
private Application killAppName(String name) throws SakuliException {
try {
String cmd = String.format(
Settings.isWindows() ? "Taskkill /IM \"%s\" /F" : "pkill \"%s\""
, name);
CommandExecutorHelper.execute(cmd, 0);
} catch (Exception e) {
throw new SakuliException(e, String.format("could not kill application with name '%s'.", name));
}
return this;
}
开发者ID:ConSol,项目名称:sakuli,代码行数:12,代码来源:Application.java
示例10: killAppPID
import org.sikuli.basics.Settings; //导入依赖的package包/类
private Application killAppPID(Integer pid) throws SakuliException {
try {
String cmd = String.format(
Settings.isWindows() ? "Taskkill /PID %d /F" : "kill -9 %d"
, pid);
CommandExecutorHelper.execute(cmd, 0);
} catch (Exception e) {
throw new SakuliException(e, String.format("could not kill application with PID '%d'.", pid));
}
return this;
}
开发者ID:ConSol,项目名称:sakuli,代码行数:12,代码来源:Application.java
示例11: testResolveTakeScreenshotFolderAbsolutPath
import org.sikuli.basics.Settings; //导入依赖的package包/类
@Test
public void testResolveTakeScreenshotFolderAbsolutPath() throws Exception {
String filename = Settings.isWindows() ? "C:\\test" : "/home/test";
Path result = testling.resolveTakeScreenshotPath(filename);
assertEquals(result.toString(), filename);
verify(loader, never()).getTestSuite();
verify(loader, never()).getCurrentTestCase();
}
开发者ID:ConSol,项目名称:sakuli,代码行数:9,代码来源:ScreenshotActionsTest.java
示例12: Sikuli
import org.sikuli.basics.Settings; //导入依赖的package包/类
public Sikuli() {
mPreviousScriptFailed = false;
init();
// These settings are required to enable OCR but not setted by default by sikuli
Settings.OcrTextSearch = true;
Settings.OcrTextRead = true;
}
开发者ID:qspin,项目名称:qtaste,代码行数:8,代码来源:Sikuli.java
示例13: setSimilarity
import org.sikuli.basics.Settings; //导入依赖的package包/类
@Override
public void setSimilarity(double level) throws QTasteException {
if (level < 0.0 || level > 1.0) {
throw new QTasteTestFailException("Invalid similarity level provided (" + level + "). Expected value between 0 and 1!");
}
Settings.MinSimilarity = level;
}
开发者ID:qspin,项目名称:qtaste,代码行数:8,代码来源:Sikuli.java
示例14: setSettings
import org.sikuli.basics.Settings; //导入依赖的package包/类
void setSettings(ImageORObject obj) {
SCREEN.setROI(obj.getRoi());
org.sikuli.basics.Settings.MinSimilarity = obj.getPrecision();
index = obj.getIndex();
}
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:6,代码来源:ImageCommand.java
示例15: OCR
import org.sikuli.basics.Settings; //导入依赖的package包/类
public OCR(AppiumDriver driver) {
this.driver = driver;
Settings.MinSimilarity = DEFAULT_MIN_SIMILARITY;
System.out.println(Settings.MinSimilarity);
}
开发者ID:Simon-Kaz,项目名称:AppiumFindByImage,代码行数:6,代码来源:OCR.java
示例16: read
import org.sikuli.basics.Settings; //导入依赖的package包/类
@RobotKeyword("Set Sikuli OCR text read(true/false)")
@ArgumentNames({"ocrTextRead"})
public void setOcrTextRead(boolean ocrTextRead) {
Settings.OcrTextRead = ocrTextRead;
}
开发者ID:rainmanwy,项目名称:robotframework-SikuliLibrary,代码行数:6,代码来源:SettingsKeywords.java
示例17: setMinSimilarity
import org.sikuli.basics.Settings; //导入依赖的package包/类
/**
* Sets the minimum similarity
*
* @param minSimilarity
* the minimum similarity
*/
protected static void setMinSimilarity(float minSimilarity) {
Settings.MinSimilarity = minSimilarity;
Settings.CheckLastSeenSimilar = minSimilarity;
System.out.println("Set MinSimilarity to: " + minSimilarity);
}
开发者ID:aguelle,项目名称:MIDI-Automator,代码行数:12,代码来源:SikuliXAutomation.java
注:本文中的org.sikuli.basics.Settings类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论