示例#1
0
  private boolean init(Map<String, AppValue> options) {
    inputFiles = getFiles(options);
    if (inputFiles == null) {
      return false;
    }

    outputFolder = AppUtils.getFolder(options, Options.OutputFolder);
    if (outputFolder == null) {
      LoggingUtils.getLogger().warning("Could not open folder.");
      return false;
    }

    // Get trace unit
    String traceUnitString = AppUtils.getString(options, Options.TraceUnit);
    traceUnitName = EnumUtils.valueOf(TraceUnits.class, traceUnitString);
    if (traceUnitName == null) {
      LoggingUtils.getLogger().warning("Could not get Trace Unit name.");
      return false;
    }

    String systemConfigFilename = AppUtils.getString(options, Options.SystemSetup);
    systemConfigFile = new File(systemConfigFilename);
    if (!systemConfigFile.exists()) {
      LoggingUtils.getLogger()
          .info("MicroBlaze setup file '" + systemConfigFilename + "' not found.");
    }

    return true;
  }
示例#2
0
  /**
   * @param options
   * @return a list with the selected partitioners
   */
  public static List<LoopDetectors> getPartitioners(Map<String, AppValue> options) {
    List<String> partitioners = AppUtils.getStringList(options, Options.LoopDetectors);

    List<LoopDetectors> parts = new ArrayList<LoopDetectors>();
    for (String partitionerName : partitioners) {
      // Decode name into enum
      LoopDetectors partEnum = EnumUtils.valueOf(LoopDetectors.class, partitionerName);
      if (partEnum == null) {
        LoggingUtils.getLogger().warning("Ignoring partitioner '" + partitionerName + "'");
        continue;
      }
      parts.add(partEnum);
    }

    return parts;
  }
示例#3
0
  /**
   * Check if input is is single file or folder
   *
   * @param options
   * @return
   */
  private List<File> getFiles(Map<String, AppValue> options) {
    String inputTypeName = AppUtils.getString(options, Options.InputType);
    InputType inputType = EnumUtils.valueOf(InputType.class, inputTypeName);

    return InputType.getFiles(options, Options.Input, inputType);
  }