コード例 #1
0
ファイル: RoutingTab.java プロジェクト: imr/Electric8
  /** Method called when the factory reset is requested. */
  public void reset() {
    if (Routing.isFactoryMimicStitchOn() != Routing.isMimicStitchOn())
      Routing.setMimicStitchOn(Routing.isFactoryMimicStitchOn());
    if (Routing.isFactoryAutoStitchOn() != Routing.isAutoStitchOn())
      Routing.setAutoStitchOn(Routing.isFactoryAutoStitchOn());
    if (!Routing.getFactoryPreferredRoutingArc().equals(Routing.getPreferredRoutingArc()))
      Routing.setPreferredRoutingArc(Routing.getFactoryPreferredRoutingArc());

    for (Iterator<Technology> it = Technology.getTechnologies(); it.hasNext(); ) {
      Technology tech = it.next();
      for (Iterator<ArcProto> aIt = tech.getArcs(); aIt.hasNext(); ) {
        ArcProto ap = aIt.next();
        if (Routing.isFactorySeaOfGatesFavor(ap) != Routing.isSeaOfGatesFavor(ap))
          Routing.setSeaOfGatesFavor(ap, Routing.isFactorySeaOfGatesFavor(ap));
        if (Routing.isFactorySeaOfGatesPrevent(ap) != Routing.isSeaOfGatesPrevent(ap))
          Routing.setSeaOfGatesPrevent(ap, Routing.isFactorySeaOfGatesPrevent(ap));
      }
    }
    if (Routing.getFactorySeaOfGatesMaxWidth() != Routing.getSeaOfGatesMaxWidth())
      Routing.setSeaOfGatesMaxWidth(Routing.getFactorySeaOfGatesMaxWidth());
    if (Routing.getFactorySeaOfGatesComplexityLimit() != Routing.getSeaOfGatesComplexityLimit())
      Routing.setSeaOfGatesComplexityLimit(Routing.getFactorySeaOfGatesComplexityLimit());
    if (Routing.isFactorySeaOfGatesUseParallelRoutes() != Routing.isSeaOfGatesUseParallelRoutes())
      Routing.setSeaOfGatesUseParallelRoutes(Routing.isFactorySeaOfGatesUseParallelRoutes());
    if (Routing.isFactorySeaOfGatesUseParallelFromToRoutes()
        != Routing.isSeaOfGatesUseParallelFromToRoutes())
      Routing.setSeaOfGatesUseParallelFromToRoutes(
          Routing.isFactorySeaOfGatesUseParallelFromToRoutes());

    if (Routing.isFactoryMimicStitchInteractive() != Routing.isMimicStitchInteractive())
      Routing.setMimicStitchInteractive(Routing.isFactoryMimicStitchInteractive());
    if (Routing.isFactoryMimicStitchPinsKept() != Routing.isMimicStitchPinsKept())
      Routing.setMimicStitchPinsKept(Routing.isFactoryMimicStitchPinsKept());
    if (Routing.isFactoryMimicStitchMatchPorts() != Routing.isMimicStitchMatchPorts())
      Routing.setMimicStitchMatchPorts(Routing.isFactoryMimicStitchMatchPorts());
    if (Routing.isFactoryMimicStitchMatchPortWidth() != Routing.isMimicStitchMatchPortWidth())
      Routing.setMimicStitchMatchPortWidth(Routing.isFactoryMimicStitchMatchPortWidth());
    if (Routing.isFactoryMimicStitchMatchNumArcs() != Routing.isMimicStitchMatchNumArcs())
      Routing.setMimicStitchMatchNumArcs(Routing.isFactoryMimicStitchMatchNumArcs());
    if (Routing.isFactoryMimicStitchMatchNodeSize() != Routing.isMimicStitchMatchNodeSize())
      Routing.setMimicStitchMatchNodeSize(Routing.isFactoryMimicStitchMatchNodeSize());
    if (Routing.isFactoryMimicStitchMatchNodeType() != Routing.isMimicStitchMatchNodeType())
      Routing.setMimicStitchMatchNodeType(Routing.isFactoryMimicStitchMatchNodeType());
    if (Routing.isFactoryMimicStitchNoOtherArcsSameDir()
        != Routing.isMimicStitchNoOtherArcsSameDir())
      Routing.setMimicStitchNoOtherArcsSameDir(Routing.isFactoryMimicStitchNoOtherArcsSameDir());
    if (Routing.isFactoryMimicStitchOnlyNewTopology() != Routing.isMimicStitchOnlyNewTopology())
      Routing.setMimicStitchOnlyNewTopology(Routing.isFactoryMimicStitchOnlyNewTopology());

    if (Routing.isFactoryAutoStitchCreateExports() != Routing.isAutoStitchCreateExports())
      Routing.setAutoStitchCreateExports(Routing.isFactoryAutoStitchCreateExports());
  }
コード例 #2
0
ファイル: RoutingTab.java プロジェクト: imr/Electric8
  /** Method called when the "OK" panel is hit. Updates any changed fields in the Routing tab. */
  public void term() {
    boolean curMimic = routMimicStitcher.isSelected();
    if (curMimic != Routing.isMimicStitchOn()) {
      Routing.setMimicStitchOn(curMimic);
      MenuCommands.menuBar().updateAllButtons();
    }
    boolean curAuto = routAutoStitcher.isSelected();
    if (curAuto != Routing.isAutoStitchOn()) {
      Routing.setAutoStitchOn(curAuto);
      MenuCommands.menuBar().updateAllButtons();
    }

    // pick up sea-of-gates preferences
    for (Iterator<ArcProto> it = sogFavorChecks.keySet().iterator(); it.hasNext(); ) {
      ArcProto ap = it.next();
      JCheckBox check = sogFavorChecks.get(ap);
      if (check.isSelected() != Routing.isSeaOfGatesFavor(ap))
        Routing.setSeaOfGatesFavor(ap, check.isSelected());
    }
    for (Iterator<ArcProto> it = sogProhibitChecks.keySet().iterator(); it.hasNext(); ) {
      ArcProto ap = it.next();
      JCheckBox check = sogProhibitChecks.get(ap);
      if (check.isSelected() != Routing.isSeaOfGatesPrevent(ap))
        Routing.setSeaOfGatesPrevent(ap, check.isSelected());
    }
    double curSOGMaxWid = TextUtils.atofDistance(sogMaxArcWidth.getText());
    if (curSOGMaxWid != Routing.getSeaOfGatesMaxWidth())
      Routing.setSeaOfGatesMaxWidth(curSOGMaxWid);
    int curSOGComplexity = TextUtils.atoi(sogComplexityLimit.getText());
    if (curSOGComplexity != Routing.getSeaOfGatesComplexityLimit())
      Routing.setSeaOfGatesComplexityLimit(curSOGComplexity);

    boolean curSOGParallel = sogParallel.isSelected();
    if (curSOGParallel != Routing.isSeaOfGatesUseParallelRoutes())
      Routing.setSeaOfGatesUseParallelRoutes(curSOGParallel);
    curSOGParallel = sogParallelDij.isSelected();
    if (curSOGParallel != Routing.isSeaOfGatesUseParallelFromToRoutes())
      Routing.setSeaOfGatesUseParallelFromToRoutes(curSOGParallel);

    ArcProto ap = null;
    if (routOverrideArc.isSelected()) {
      String techName = (String) routTechnology.getSelectedItem();
      Technology tech = Technology.findTechnology(techName);
      if (tech != null) {
        String curArcName = (String) routDefaultArc.getSelectedItem();
        ap = tech.findArcProto(curArcName);
      }
    }
    if (ap != initRoutDefArc) {
      String newArcName = "";
      if (ap != null) newArcName = ap.getTechnology().getTechName() + ":" + ap.getName();
      Routing.setPreferredRoutingArc(newArcName);
    }

    boolean cur = routMimicPortsMustMatch.isSelected();
    if (cur != Routing.isMimicStitchMatchPorts()) Routing.setMimicStitchMatchPorts(cur);

    cur = routMimicPortsWidthMustMatch.isSelected();
    if (cur != Routing.isMimicStitchMatchPortWidth()) Routing.setMimicStitchMatchPortWidth(cur);

    cur = routMimicNumArcsMustMatch.isSelected();
    if (cur != Routing.isMimicStitchMatchNumArcs()) Routing.setMimicStitchMatchNumArcs(cur);

    cur = routMimicNodeSizesMustMatch.isSelected();
    if (cur != Routing.isMimicStitchMatchNodeSize()) Routing.setMimicStitchMatchNodeSize(cur);

    cur = routMimicNodeTypesMustMatch.isSelected();
    if (cur != Routing.isMimicStitchMatchNodeType()) Routing.setMimicStitchMatchNodeType(cur);

    cur = routMimicNoOtherArcs.isSelected();
    if (cur != Routing.isMimicStitchNoOtherArcsSameDir())
      Routing.setMimicStitchNoOtherArcsSameDir(cur);

    cur = routMimicOnlyNewTopology.isSelected();
    if (cur != Routing.isMimicStitchOnlyNewTopology()) Routing.setMimicStitchOnlyNewTopology(cur);

    cur = routMimicInteractive.isSelected();
    if (cur != Routing.isMimicStitchInteractive()) Routing.setMimicStitchInteractive(cur);

    cur = routMimicKeepPins.isSelected();
    if (cur != Routing.isMimicStitchPinsKept()) Routing.setMimicStitchPinsKept(cur);

    cur = routAutoCreateExports.isSelected();
    if (cur != Routing.isAutoStitchCreateExports()) Routing.setAutoStitchCreateExports(cur);
  }