Skip to content

Commit

Permalink
Merge pull request #2019 from lf-lang/diagrams-remove-level
Browse files Browse the repository at this point in the history
Removed "Reaction level" diagram synthesis option
  • Loading branch information
lhstrh authored Sep 22, 2023
2 parents 0d89589 + b7ee795 commit ceea7f9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,6 @@ public class LinguaFrancaSynthesis extends AbstractDiagramSynthesis<Model> {
SynthesisOption.createCheckOption("Multiport Widths", false).setCategory(APPEARANCE);
public static final SynthesisOption SHOW_REACTION_CODE =
SynthesisOption.createCheckOption("Reaction Code", false).setCategory(APPEARANCE);
public static final SynthesisOption SHOW_REACTION_LEVEL =
SynthesisOption.createCheckOption("Reaction Level", false).setCategory(APPEARANCE);
public static final SynthesisOption SHOW_REACTION_ORDER_EDGES =
SynthesisOption.createCheckOption("Reaction Order Edges", false).setCategory(APPEARANCE);
public static final SynthesisOption SHOW_REACTOR_HOST =
Expand Down Expand Up @@ -291,7 +289,6 @@ public List<SynthesisOption> getDisplayedSynthesisOptions() {
SHOW_PORT_NAMES,
SHOW_MULTIPORT_WIDTH,
SHOW_REACTION_CODE,
SHOW_REACTION_LEVEL,
SHOW_REACTION_ORDER_EDGES,
SHOW_REACTOR_HOST,
SHOW_INSTANCE_NAMES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
import org.eclipse.elk.graph.properties.Property;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.eclipse.xtext.xbase.lib.Pair;
import org.eclipse.xtext.xbase.lib.StringExtensions;
import org.lflang.ast.ASTUtils;
Expand Down Expand Up @@ -424,23 +423,6 @@ public KPolygon addReactionFigure(KNode node, ReactionInstance reaction) {
DiagramSyntheses.suppressSelectability(textToAdd);
}

// optional reaction level
if (getBooleanValue(LinguaFrancaSynthesis.SHOW_REACTION_LEVEL)) {
// Force calculation of levels for reactions. This calculation
// will only be done once. Note that if this fails due to a causality loop,
// then some reactions will have level -1.
try {
String levels = IterableExtensions.join(reaction.getLevels(), ", ");
KText levelsText =
_kContainerRenderingExtensions.addText(contentContainer, ("level: " + levels));
_kRenderingExtensions.setFontBold(levelsText, false);
_linguaFrancaStyleExtensions.noSelectionStyle(levelsText);
DiagramSyntheses.suppressSelectability(levelsText);
} catch (Exception ex) {
// If the graph has cycles, the above fails. Continue without showing levels.
}
}

// optional code content
boolean hasCode =
getBooleanValue(LinguaFrancaSynthesis.SHOW_REACTION_CODE)
Expand Down

0 comments on commit ceea7f9

Please sign in to comment.