There're many deployment files for configuration. We need to learn how SAFS read these depolyment files.

Let's use the IBT as the a small example for reading UseMultiThreadSearch parameter which determines if we use multi-thread algorithm for image comparing.

In the DefaultDriver.java, define a variable USE_MULTIPLE_THREADS to store client's choice about using multi-thread:

/**
* Set true if image searches using BitTolerance
* should attempt to use parallel threading.
* The current implementation of multi-threading is poor,
* and may actually be slower than NOT using multi-threading.
* Current default is 'false'.
* @see org.safs.image.SmallPieceComparator
* @see org.safs.image.ScreenXYBTComparator
*/
public static boolean USE_MULTIPLE_THREADS = false;

Then, in the DefaultDriver.java file, the initializeMiscConfigInfo() method will call configInfo's getNamedValue() method to read the configuration files. So in order to get client's choice of whether use multi-thread, we'll do:

String useMultiThread = configInfo.getNamedValue(DriverConstant.SECTION_SAFS_IBT, "UseMultiThreadSearch");
if(useMultiThread!=null) {
ImageUtils.USE_MULTIPLE_THREADS = StringUtilities.convertBool(useMultiThread);
Log.info("SAFS_IBT:UseMultiThreadSearch set to: "+ ImageUtils.USE_MULTIPLE_THREADS);
}

The corresponding test.ini file should be written like this:

[SAFS_IBT]
UseTwoDimensionMatch=true

Obviously the [SAFS_IBT]  is determined by parameter DriverConstant.SECTION_SAFS_IBT in configInfo.getNamedValue() method.

In org.safs.tools.drivers.DriverConstant.java, one constant DEFAULT_PROJECT_DATAPOOL is used to store test tables and app maps. Generally, all inputs except benchmarks are placed here.

Then, in org.safs.tools.drivers.AbstractDriver.java, in AbstractDriver class, the variable datapoolSource will use the DEFAULT_PROJECT_DATAPOOL as default value. In the method validateRootConfigureParameters() of AbstractDriver class, it will call:

datapoolSource = getProjectDirectoryInfo (configInfo.getNamedValue (
DriverConstant.SECTION_SAFS_DIRECTORIES, "DataDir"),
DriverConstant.DEFAULT_PROJECT_DATAPOOL);

for setting.

In jsafs.validateRootConfigureParameters() using datapoolSource = getProjectDirectoryInfo() get the directory of MAP files.

SAFS Init Files的更多相关文章

  1. saltstack之(七)配置管理系统初始化init

    saltstack的配置管理分环境管理:①.base为基础环境,一般会存放一些所有服务器都使用的配置管理信息.②.dev为开发测试环境,一般会存放一些开发测试服务器使用的配置管理信息.③.pro为线上 ...

  2. saltstack简单部署和实践

    #Elaine:master;Dylan:minion#利用salt给minion安装包[root@elaine states]# vim /etc/salt/master default_inclu ...

  3. 使用Githua管理代码

    原创博客:转载请标明出处:http://www.cnblogs.com/zxouxuewei/ 1.安装配置git服务器      a.安装ssh,因为git是基于ssh协议的,所以必须先装ssh: ...

  4. error: src refspec master does not match any. 错误处理办法

    自从上次学了git之后,很少用.今天在使用 本地仓库使用如下命令初始化: $ git init 之后使用如下命令添加远程库: $ git remote add origin git@github.co ...

  5. web工作流

    web工作流之Gulp学习 Gulp.js 是一个自动化构建工具,开发者可以使用它在项目开发过程中自动执行常见任务. Gulp.js 是基于 Node.js 构建的,利用 Node.js 流的威力,你 ...

  6. SaltStack项目实战(六)

    SaltStack项目实战 系统架构图 一.初始化 1.salt环境配置,定义基础环境.生产环境(base.prod) vim /etc/salt/master 修改file_roots file_r ...

  7. gulp进阶构建项目由浅入深

    gulp进阶构建项目由浅入深 阅读目录 gulp基本安装和使用 gulp API介绍 Gulp.src(globs[,options]) gulp.dest(path[,options]) gulp. ...

  8. SaltStack实战

    SaltStack实战 #安装 安装注意几点 python-libs-2.6.6-64.el6.x86_64 conflicts with file from package python-2.6.6 ...

  9. linux hugepage

    The intent of this file is to give a brief summary of hugetlbpage support inthe Linux kernel.  This ...

随机推荐

  1. 友盟分享SDK集成步骤

    1.官方注册appID. 2.menifest添加和声明umeng相关的activity以及appKey. 3. // 首先声明一个controller变量,由友盟服务工厂类直接取得友盟社交服务. m ...

  2. 技术英文单词贴--P

    P pagination 分页,页码 parse 解析,从语法上描述或分析 partial 局部的 pattern 模式 populate 填充,居住于,构成人口 precedence 优先 pref ...

  3. php 图片处理类

    <?php /** * 图片类 * @author <420012223@qq.cn> */ class Image { public $uploadImagePath = './t ...

  4. windows all version - 实现指定路径共享

    调用API函数NetShareAdd()将文件夹设置为共享,调用此函数后如果不做其他设置,网络用户是无法访问共享文件夹的,因为此文件夹在NTFS分区中,同时受到NTFS文件系统的访问控制,因此还需要第 ...

  5. java.lang.OutOfMemoryError: PermGen space及其解决方法(转载)

    java.lang.OutOfMemoryError: PermGen space及其解决方法 分类: java2007-09-11 12:34 162242人阅读 评论(51) 收藏 举报 gene ...

  6. 基本套接字编程(4) -- poll篇

    1. poll技术 poll函数起源于SVR3,最初局限于流设备.SVR4取消了这种限制,允许poll工作在任何描述符上.poll提供的功能与select类似,不过在处理流设备时,它能够提供额外的信息 ...

  7. js脚本放置位置

    若是display:none:则元素height.width为0:但去了display:none后,恢复原来大小,所以操作元素应该在去除display:none后.

  8. Java并发(8):CountDownLatch、CyclicBarrier、Semaphore、Callable、Future

    CountDownLatch.CyclicBarrier.Semaphore.Callable.Future  都位于java.util.concurrent包下,其中CountDownLatch.C ...

  9. 在VLFEAT中mat类型图片转换成constant float* 来进行vl_dsift_process

    How to convert an OpenCV cv::Mat into a float* that can be fed into Vlfeat vl_dsift_process: Mat mat ...

  10. spring常见异常

    1.ClassNotFoundException: org.springframework.dao.support.DaoSupport(解决:导入spring-tx) 2.NoClassDefFou ...