-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added fmi3 support to the template generator aka import
- Loading branch information
Showing
26 changed files
with
542 additions
and
233 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...s/maestro/framework/fmi2/FaultInject.java → ...s/maestro/framework/core/FaultInject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
frameworks/core/src/main/java/org/intocps/maestro/framework/core/FrameworkUnitInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
package org.intocps.maestro.framework.core; | ||
|
||
import java.util.Optional; | ||
|
||
public interface FrameworkUnitInfo { | ||
|
||
String getOwnerIdentifier(); | ||
Optional<FaultInject> getFaultInject(); | ||
void setFaultInject(String constraintId); | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
frameworks/fmi2/src/main/java/org/intocps/maestro/framework/fmi2/FaultInjectWithLexName.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
305 changes: 185 additions & 120 deletions
305
...orks/fmi2/src/main/java/org/intocps/maestro/framework/fmi2/Fmi2SimulationEnvironment.java
Large diffs are not rendered by default.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
frameworks/fmi2/src/main/java/org/intocps/maestro/framework/fmi2/InstanceInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.intocps.maestro.framework.fmi2; | ||
|
||
import org.intocps.maestro.fmi.org.intocps.maestro.fmi.fmi3.Fmi3ModelDescription; | ||
import org.intocps.maestro.framework.core.FaultInject; | ||
import org.intocps.maestro.framework.core.FrameworkUnitInfo; | ||
|
||
import java.util.Optional; | ||
|
||
public class InstanceInfo implements FrameworkUnitInfo { | ||
public final Fmi3ModelDescription modelDescription; | ||
public final String fmuIdentifier; | ||
public Optional<FaultInject> faultInject = Optional.empty(); | ||
|
||
public InstanceInfo(Fmi3ModelDescription modelDescription, String fmuIdentifier) { | ||
this.modelDescription = modelDescription; | ||
this.fmuIdentifier = fmuIdentifier; | ||
} | ||
|
||
public Optional<FaultInject> getFaultInject() { | ||
return this.faultInject; | ||
} | ||
|
||
public void setFaultInject(String constraintId) { | ||
this.faultInject = Optional.of(new FaultInject(constraintId)); | ||
} | ||
|
||
public Fmi3ModelDescription getModelDescription() { | ||
return modelDescription; | ||
} | ||
|
||
public String getFmuIdentifier() { | ||
return fmuIdentifier; | ||
} | ||
|
||
@Override | ||
public String getOwnerIdentifier() { | ||
return getFmuIdentifier(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
frameworks/fmi2/src/main/java/org/intocps/maestro/framework/fmi2/RelationVariable3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package org.intocps.maestro.framework.fmi2; | ||
|
||
import org.intocps.maestro.ast.LexIdentifier; | ||
import org.intocps.maestro.fmi.org.intocps.maestro.fmi.fmi3.Fmi3ModelDescription; | ||
|
||
public class RelationVariable3 implements org.intocps.maestro.framework.core.RelationVariable { | ||
public final Fmi3ModelDescription.Fmi3ScalarVariable scalarVariable; | ||
public final LexIdentifier instance; | ||
|
||
public RelationVariable3(Fmi3ModelDescription.Fmi3ScalarVariable scalarVariable, LexIdentifier instance) { | ||
this.scalarVariable = scalarVariable; | ||
this.instance = instance; | ||
} | ||
|
||
@Override | ||
public LexIdentifier getInstance() { | ||
return this.instance; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return scalarVariable.getVariable().getName(); | ||
} | ||
|
||
@Override | ||
public <T> T getScalarVariable(Class<T> clz) { | ||
if (clz.isAssignableFrom(scalarVariable.getClass())) { | ||
return clz.cast(scalarVariable); | ||
} | ||
return null; | ||
} | ||
|
||
public Fmi3ModelDescription.Fmi3ScalarVariable getScalarVariable() { | ||
return getScalarVariable(this.scalarVariable.getClass()); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return instance + "." + scalarVariable; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (o == this) { | ||
return true; | ||
} | ||
if (!(o instanceof RelationVariable)) { | ||
return false; | ||
} | ||
|
||
RelationVariable rv = (RelationVariable) o; | ||
return rv.toString().equals(this.toString()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.