zoukankan      html  css  js  c++  java
  • SAFS Init Files

    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. 

  • 相关阅读:
    Waiting Processed Cancelable ShowDialog
    Microshaoft Cross-Domain + ASP.NET MVC 5 WebAPI 2 + Self-Host + JsonpMediaTypeFormatter + WCF + JsonP + PerformaceCounterFilter + Knockout.js + MVVM
    Microshaoft WinDbg cmdtree
    csc.rsp Invent by Microshaoft
    ASP.NET MVC 4 WebAPI Simple Sample
    并发异步处理队列 .NET 4.5+
    最近IOS10.2.1 iphone6 无法通过appStore 来更新 下载任何APP。好烦啊。
    vs2013修改书签(vs书签文件位置)
    MFC如何使用静态MFC库
    关于商业贷款的一些经验
  • 原文地址:https://www.cnblogs.com/kid551/p/4428921.html
Copyright © 2011-2022 走看看