示例#1
0
  static {
    try {
      solenoidValvesOfInterest.add(Double.valueOf(0.0));
      solenoidValvesOfInterest.add(Double.valueOf(1.0));
      solenoidValvesOfInterest.add(Double.valueOf(2.0));
      solenoidValvesOfInterest.add(Double.valueOf(4.0));
      solenoidValvesOfInterest.add(Double.valueOf(8.0));
      solenoidValvesOfInterest.add(Double.valueOf(16.0));

      allSolenoidValves.add(Double.valueOf(0.0));
      allSolenoidValves.add(Double.valueOf(1.0));
      allSolenoidValves.add(Double.valueOf(2.0));
      allSolenoidValves.add(Double.valueOf(4.0));
      allSolenoidValves.add(Double.valueOf(8.0));
      allSolenoidValves.add(Double.valueOf(16.0));

      configuration = new PropertiesConfiguration(FileConfiguration.getConfigurationFile());
      configuration.setAutoSave(true);

      if (!JarUtil.isRunningOnWindows7()) {
        inputFolder = new File(configuration.getString(FileConfiguration.INPUT_FOLDER, "input"));
        outputFolder = new File(configuration.getString(FileConfiguration.OUTPUT_FOLDER, "output"));
        temperatureInputFolder =
            new File(configuration.getString(FileConfiguration.TEMPERATURE_FOLDER, "input/temp"));
      } else {
        File userDir = JarUtil.getPlantEvaluationUserHomeDir();
        inputFolder =
            new File(
                configuration.getString(
                    FileConfiguration.INPUT_FOLDER, userDir.getAbsolutePath() + "/input"));
        outputFolder =
            new File(
                configuration.getString(
                    FileConfiguration.OUTPUT_FOLDER, userDir.getAbsolutePath() + "/output"));
        temperatureInputFolder =
            new File(
                configuration.getString(
                    FileConfiguration.TEMPERATURE_FOLDER,
                    userDir.getAbsolutePath() + "/input/temp"));
      }

      if (!inputFolder.exists()) inputFolder.mkdir();
      if (!outputFolder.exists()) outputFolder.mkdir();
      if (!temperatureInputFolder.exists()) temperatureInputFolder.mkdir();

      TypeAEvaluationOptions.shiftByOneHour =
          configuration.getBoolean(TypeAEvaluationOptions.OPTION_SHIFT_BY_ONE_HOUR, false);
      TypeAEvaluationOptions.recordReferenceValve =
          configuration.getBoolean(TypeAEvaluationOptions.OPTIONS_RECORD_REFERENCE_VALVE, false);
      TypeAEvaluationOptions.sampleRate =
          configuration.getDouble(TypeAEvaluationOptions.OPTIONS_SAMPLE_RATE, 10.0);

      solenoidValvesOfInterest =
          configuration.getList(
              Options.OPTIONS_SOLENOID_VALVES_OF_INTEREST, solenoidValvesOfInterest);

      checkSolenoidValves();

      // options for co2 absolute only evaluation
      CO2AbsoluteOnlyEvaluationOptions.isAutoScaleCO2Absolute =
          configuration.getBoolean(
              CO2AbsoluteOnlyEvaluationOptions.OPTIONS_CO2_ABSOLUTE_IS_CO2_ABSOLUTE_AUTOSCALE,
              true);
      CO2AbsoluteOnlyEvaluationOptions.isAutoScaleDeltaFiveMinutes =
          configuration.getBoolean(
              CO2AbsoluteOnlyEvaluationOptions.OPTIONS_CO2_ABSOLUTE_IS_DELTA_FIVE_MINUTES_AUTOSCALE,
              true);
      CO2AbsoluteOnlyEvaluationOptions.co2AbsoluteDatasetMinimum =
          configuration.getDouble(
              CO2AbsoluteOnlyEvaluationOptions.OPTIONS_CO2_ABSOLUTE_SCALE_MINIMUM_CO2_ABSOLUTE,
              Integer.MIN_VALUE);
      CO2AbsoluteOnlyEvaluationOptions.co2AbsoluteDatasetMaximum =
          configuration.getDouble(
              CO2AbsoluteOnlyEvaluationOptions.OPTIONS_CO2_ABSOLUTE_SCALE_MAXIMUM_CO2_ABSOLUTE,
              Integer.MAX_VALUE);
      CO2AbsoluteOnlyEvaluationOptions.deltaFiveMinutesMinimum =
          configuration.getDouble(
              CO2AbsoluteOnlyEvaluationOptions
                  .OPTIONS_CO2_ABSOLUTE_SCALE_MINIMUM_DELTA_FIVE_MINUTES,
              Integer.MIN_VALUE);
      CO2AbsoluteOnlyEvaluationOptions.deltaFiveMinutesMaximum =
          configuration.getDouble(
              CO2AbsoluteOnlyEvaluationOptions
                  .OPTIONS_CO2_ABSOLUTE_SCALE_MAXIMUM_DELTA_FIVE_MINUTES,
              Integer.MAX_VALUE);

      // options for type B (= Ingo's evaluation)
      TypeBEvaluationOptions.density =
          configuration.getInt(TypeBEvaluationOptions.OPTIONS_TYPE_B_DENSITY, 60);
      TypeBEvaluationOptions.isCo2AbsoluteAutoscale =
          configuration.getBoolean(
              TypeBEvaluationOptions.OPTIONS_TYPE_B_IS_CO2_ABSOLUTE_AUTOSCALE, true);
      TypeBEvaluationOptions.isDeltaRawAutoscale =
          configuration.getBoolean(
              TypeBEvaluationOptions.OPTIONS_TYPE_B_IS_DELTA_RAW_AUTOSCALE, true);
      TypeBEvaluationOptions.co2AbsoluteDatasetMinimum =
          configuration.getDouble(
              TypeBEvaluationOptions.OPTIONS_TYPE_B_CO2_ABSOLUTE_SCALE_MINIMUM, Integer.MIN_VALUE);
      TypeBEvaluationOptions.co2AbsoluteDatasetMaximum =
          configuration.getDouble(
              TypeBEvaluationOptions.OPTIONS_TYPE_B_CO2_ABSOLUTE_SCALE_MAXIMUM, Integer.MAX_VALUE);
      TypeBEvaluationOptions.deltaRawDatasetMinimum =
          configuration.getDouble(
              TypeBEvaluationOptions.OPTIONS_TYPE_B_DELTA_RAW_SCALE_MINIMUM, Integer.MIN_VALUE);
      TypeBEvaluationOptions.deltaRawDatasetMaximum =
          configuration.getDouble(
              TypeBEvaluationOptions.OPTIONS_TYPE_B_DELTA_RAW_SCALE_MAXIMUM, Integer.MAX_VALUE);
    } catch (ConfigurationException ce) {
      log.error("Could not update configuration.", ce);
    }
  }
示例#2
0
 /**
  * XMLConfiguration:geiList
  *
  * @param keyString
  * @return
  */
 public static List getList(String keyString) {
   return applicationConfiguration.getList(keyString);
 }