Ejemplo n.º 1
0
  /**
   * Set commands that do not require a circuit.
   *
   * <p>This is for setting global options that do not require an active circuit.
   */
  public static boolean doSetCmd_NoCircuit() {
    boolean success = true;

    Parser parser = Parser.getInstance();

    // Continue parsing command line
    int paramPointer = -1;
    String paramName = parser.getNextParam();
    String param = parser.stringValue();

    while (param.length() > 0) {
      if (paramName.length() == 0) {
        paramPointer += 1;
      } else {
        paramPointer = optionList.getCommand(paramName);
      }

      switch (paramPointer) {
        case -1:
          DSS.doSimpleMsg("Unknown parameter \"" + paramName + "\" for set command ", 130);
          break;
        case 14:
          DSS.defaultEditor = param; // 'editor='
          break;
        case 56:
          DSS.setDataPath(param); // set a legal data path
          break;
        case 66:
          Executive.getInstance().setRecorderOn(Util.interpretYesNo(param));
          break;
        case 72:
          DSS.defaultBaseFreq = parser.doubleValue();
          break;
        default:
          DSS.doSimpleMsg(
              "You must create a circuit to execute this \"set\" command: " + parser.getCommand(),
              301);
          success = false; // indicate that we could not process all set command
          break;
      }

      paramName = parser.getNextParam();
      param = parser.stringValue();
    }

    return success;
  }