Skip to content

Commit

Permalink
Updated README. Also added a missing bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
fynndemmler committed Dec 6, 2023
1 parent 5a15138 commit 30f2163
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ Install [**JDK 16**](https://www.oracle.com/java/technologies/javase/jdk16-archi
- `de.tu_bs.cs.isf.commands.toolbar`
- `de.tu_bs.cs.isf.lattice`

4. `Right click -> Generate Model/Edit/Editor Code` in **all** of the following files:
4. Open:
- `*.cbc.model -> model -> genmodel.genmodel`
- `*.cbc.statistics -> model -> cbcstatistics.genmodel`

Right click and `Generate Model/Edit/Editor Code` for all files listed.

5. Select any package and run project as `Eclipse Application`.

Expand Down Expand Up @@ -74,6 +76,12 @@ The IntegerList implements a list of integers with add and sort operations.

# Common Issues

**Problem:** EMT gets stuck while trying to generate a model.

**Solution:** Terminate EMT using any process manager and generate the model again.

---

**Problem:** Multiple resolving errors after generating model files.

**Solution:** Uninstall JaMoPP Plugins via `Window -> Preferences -> Install/Update -> Uninstall or update`. Afterwards reinstall as described above.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import javax.swing.JOptionPane;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
Expand Down Expand Up @@ -345,8 +347,10 @@ protected IReason updateNeeded(IdUpdateContext context, String id) {
List<Condition> inheritedInvs = new ArrayList<Condition>();
List<Field> inheritedFields = new ArrayList<Field>();
if (mc.getInheritsFrom() != null) {
inheritedInvs = mc.getInheritsFrom().getClassInvariants();
inheritedFields = mc.getInheritsFrom().getFields();
var inheritee = (ModelClass)ClassUtil.getClassModelResource(FileUtil.getProjectLocation(mc.getInheritsFrom().eResource().getURI()), mc.getInheritsFrom().getName()).getContents().get(0);
//mc.setInheritsFrom(mc);
inheritedInvs = inheritee.getClassInvariants();
inheritedFields = inheritee.getFields();
}
int size = invs.size() + fields.size() + inheritedInvs.size() + inheritedFields.size();
if (containerShape.getChildren().size() - numShapesOfEmptyClass != size) {
Expand Down Expand Up @@ -432,14 +436,15 @@ protected boolean update(IdUpdateContext context, String id) {
List<Condition> inheritedInvs = new ArrayList<Condition>();
List<Field> inheritedFields = new ArrayList<Field>();
if (modelClass.getInheritsFrom() != null) {
for (int i = 0; i < modelClass.getInheritsFrom().getFields().size(); i++) {
if (modelClass.getInheritsFrom().getFields().get(i).getName() == null) {
modelClass.getInheritsFrom().getFields().remove(i);
var inheritee = (ModelClass)ClassUtil.getClassModelResource(FileUtil.getProjectLocation(modelClass.getInheritsFrom().eResource().getURI()), modelClass.getInheritsFrom().getName()).getContents().get(0);
for (int i = 0; i < inheritee.getFields().size(); i++) {
if (inheritee.getFields().get(i).getName() == null) {
inheritee.getFields().remove(i);
i--;
}
}
inheritedInvs = modelClass.getInheritsFrom().getClassInvariants();
inheritedFields = modelClass.getInheritsFrom().getFields();
inheritedInvs = inheritee.getClassInvariants();
inheritedFields = inheritee.getFields();
}

List<Integer> checkedShapes = new ArrayList<>();
Expand Down

0 comments on commit 30f2163

Please sign in to comment.