Skip to content

Commit

Permalink
Return update status for component interface
Browse files Browse the repository at this point in the history
  • Loading branch information
danilovesky committed Oct 11, 2024
1 parent 3a066be commit 85b118f
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ public static boolean isInconsistentModelTitle(String aTitle, String bTitle) {
return (aTitle == null) || !aTitle.equals(bTitle);
}

public static void updateInterfacesAndNewOutputInitialStates(VisualCircuit circuit, Set<File> changedRefinementFiles) {
public static boolean updateInterfacesAndNewOutputInitialStates(VisualCircuit circuit, Set<File> changedRefinementFiles) {
boolean result = false;
for (VisualFunctionComponent component : circuit.getVisualFunctionComponents()) {
File refinementCircuitFile = getRefinementCircuitFile(component.getReferencedComponent());
if ((refinementCircuitFile != null) && changedRefinementFiles.contains(refinementCircuitFile)) {
Expand All @@ -360,15 +361,17 @@ public static void updateInterfacesAndNewOutputInitialStates(VisualCircuit circu

Set<String> newOutputSignals = CircuitUtils.getOutputPinNames(component.getReferencedComponent());
newOutputSignals.removeAll(outputSignals);
Map<String, Boolean> refinementOutputInitialState = RefinementUtils.getSignalsInitialState(
refinementCircuit, newOutputSignals);

RefinementUtils.updateInitialState(component.getReferencedComponent(), refinementOutputInitialState);
result = !newOutputSignals.isEmpty();
if (result) {
RefinementUtils.updateInitialState(component.getReferencedComponent(),
RefinementUtils.getSignalsInitialState(refinementCircuit, newOutputSignals));
}
} catch (DeserialisationException e) {
throw new RuntimeException(e);
}
}
}
return result;
}

public static void updateInterface(VisualCircuit circuit, VisualFunctionComponent component,
Expand Down

0 comments on commit 85b118f

Please sign in to comment.