Beispiel #1
0
  public static void refreshGateAttributes(Gate g, GateLibrary gate_library) {

    if (g.Type == GateType.OUTPUT || g.Type == GateType.OUTPUT_OR) {

      g.set_params(null);

      ArrayList<String> variable_names = new ArrayList<>();
      variable_names.add("x");
      g.set_variable_names(variable_names);

      HashMap<String, Double[]> variable_thresholds = new HashMap<>();
      variable_thresholds.put("x", new Double[] {null, null});
      g.set_variable_thresholds(variable_thresholds);

      String equation = String.valueOf("x");
      g.set_equation(equation);
    } else if (gate_library.get_GATES_BY_NAME().containsKey(g.Name)) {
      g.set_params(gate_library.get_GATES_BY_NAME().get(g.Name).get_params());

      if (g.get_variable_names().isEmpty()) {
        g.set_variable_names(gate_library.get_GATES_BY_NAME().get(g.Name).get_variable_names());
      }

      g.set_variable_thresholds(
          gate_library.get_GATES_BY_NAME().get(g.Name).get_variable_thresholds());
      g.set_equation(gate_library.get_GATES_BY_NAME().get(g.Name).get_equation());

      g.System = gate_library.get_GATES_BY_NAME().get(g.Name).System;
      g.ColorHex = gate_library.get_GATES_BY_NAME().get(g.Name).ColorHex;
      g.Group = gate_library.get_GATES_BY_NAME().get(g.Name).Group;
      g.Regulator = gate_library.get_GATES_BY_NAME().get(g.Name).Regulator;
      g.Inducer = gate_library.get_GATES_BY_NAME().get(g.Name).Inducer;

      // if(Args.histogram) {
      if (gate_library.get_GATES_BY_NAME().get(g.Name).get_xfer_hist() != null) {
        g.set_xfer_hist(gate_library.get_GATES_BY_NAME().get(g.Name).get_xfer_hist());
      }
    } else {
      g.System = "null";
      g.ColorHex = "null";
      g.Group = "null";
      g.Regulator = "null";
      g.Inducer = "";
    }
  }