Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
245e25e
WIP: Allowing the user to specify new backends functionality
Nielswps Nov 7, 2021
32e7aba
WIP: Initial backend instances design
Nielswps Nov 9, 2021
4c30d39
WIP: Major design update
Nielswps Nov 9, 2021
c9a1527
WIP: Border on backendinstance changed to SOLID
Nielswps Nov 10, 2021
564be1e
WIP: Default backend toggles working
Nielswps Nov 10, 2021
329bd10
WIP: Design update (not doen)
Nielswps Nov 10, 2021
d669bed
Design update
Nielswps Nov 14, 2021
48cb1e0
WIP: Backend instance logic
Nielswps Nov 14, 2021
f5d4250
WIP: Using custom backends for the queries (initial setup started)
Nielswps Nov 15, 2021
7aab046
WIP: Logic being implemented...
Nielswps Nov 17, 2021
3c01c71
WIP: Refactoring and input validation on backend options preparations
Nielswps Nov 21, 2021
6dfb868
WIP: ComboBox added for backend instances and refactoring (not execut…
Nielswps Nov 21, 2021
792c4ba
WIP: Preferences update and validation label added to backend name
Nielswps Nov 22, 2021
c0fce06
WIP: More validation on backend instance creation
Nielswps Nov 23, 2021
5648823
WIP: Backend options validation
Nielswps Nov 23, 2021
8a7cfb8
WIP: Reveaal and jEcdar backends saved in file for future 'restore to…
Nielswps Nov 23, 2021
95bc676
WIP: Validations strings extracted to enum and comboBox reflecting ch…
Nielswps Nov 28, 2021
76fff31
Minor design update
Nielswps Dec 3, 2021
9f323cf
Merged with grpc_communication
Nielswps Dec 27, 2021
b2421a8
Queries executable using Reveaal and default backend issue fixed
Nielswps Dec 28, 2021
bbef195
Merged with main
Nielswps Jan 16, 2022
fb9da28
WIP: Implementing remote backend communication
Nielswps Jan 16, 2022
a81161b
Nullpointer exception fixed and local consistency updated to correspo…
Nielswps Feb 1, 2022
ed51912
WIP: j-Ecdar communication
Nielswps Feb 5, 2022
a80056d
WIP: Remote backend instance testing and minor clean-up
Nielswps Feb 6, 2022
6080806
Merged with remote main
Nielswps Feb 6, 2022
32d8537
Clean-up, queries set to deleted backend is set to default, move back…
Nielswps Feb 6, 2022
f001f23
Reset backends to default button added
Nielswps Feb 6, 2022
dacce06
Minor clean-up
Nielswps Feb 6, 2022
5075c11
Weird error when running all queries multiple times, connections bein…
Nielswps Feb 12, 2022
eade871
Clean-up and null-pointer when closing remote connections FIXED
Nielswps Feb 13, 2022
7543e72
Merged with main
Nielswps Feb 13, 2022
88a22cc
WIP: BackendOptions updated to automatically search for default engines
Nielswps Feb 16, 2022
9390916
WIP: Everything is working, but only first port in port range is used…
Nielswps Feb 16, 2022
c7c2fac
Remote engine connectivity added
Nielswps Feb 18, 2022
6db060d
Minor clean-up
Nielswps Feb 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions src/main/java/ecdar/Ecdar.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class Ecdar extends Application {
public static SimpleStringProperty projectDirectory = new SimpleStringProperty();
private static BooleanProperty isUICached = new SimpleBooleanProperty();
private static final BooleanProperty isSplit = new SimpleBooleanProperty(true); //Set to true to ensure correct behaviour at first toggle.
private static BackendDriver backendDriver;
private static final BackendDriver backendDriver = new BackendDriver();
private Stage debugStage;

/**
Expand Down Expand Up @@ -190,7 +190,6 @@ public void start(final Stage stage) {
// Load the fonts required for the project
IconFontFX.register(GoogleMaterialDesignIcons.getIconFont());
loadFonts();
loadPreferences();

// Remove the classic decoration
// kyrke - 2020-04-17: Disabled due to bug https://bugs.openjdk.java.net/browse/JDK-8154847
Expand All @@ -212,6 +211,8 @@ public void start(final Stage stage) {
scene.getStylesheets().add("ecdar/main.css");
scene.getStylesheets().add("ecdar/colors.css");
scene.getStylesheets().add("ecdar/model_canvas.css");
scene.getStylesheets().add("ecdar/query_pane.css");
scene.getStylesheets().add("ecdar/scroll_pane.css");

// Handle a mouse click as a deselection of all elements
scene.setOnMousePressed(event -> {
Expand Down Expand Up @@ -289,16 +290,6 @@ public void start(final Stage stage) {
});
}

private void loadPreferences() {
BackendHelper.defaultBackend = preferences.getInt("default_backend", BackendHelper.BackendNames.jEcdar.ordinal())
== BackendHelper.BackendNames.jEcdar.ordinal()
? BackendHelper.BackendNames.jEcdar
: BackendHelper.BackendNames.Reveaal;

backendDriver = new BackendDriver(preferences.get("backend_host_address", "127.0.0.1"));
getBackendDriver().setMaxNumberOfConnections(preferences.getInt("number_of_backend_sockets", 5));
}

/**
* Initializes and resets the project.
* This can be used as a test setup.
Expand Down Expand Up @@ -381,6 +372,5 @@ private void loadFonts() {
Font.loadFont(getClass().getResourceAsStream("fonts/roboto_mono/RobotoMono-Regular.ttf"), 14);
Font.loadFont(getClass().getResourceAsStream("fonts/roboto_mono/RobotoMono-Thin.ttf"), 14);
Font.loadFont(getClass().getResourceAsStream("fonts/roboto_mono/RobotoMono-ThinItalic.ttf"), 14);

}
}
119 changes: 119 additions & 0 deletions src/main/java/ecdar/abstractions/BackendInstance.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
package ecdar.abstractions;

import com.google.gson.JsonObject;
import ecdar.utility.serialize.Serializable;
import javafx.beans.property.SimpleBooleanProperty;

public class BackendInstance implements Serializable {
private static final String NAME = "name";
private static final String IS_LOCAL = "isLocal";
private static final String IS_DEFAULT = "isDefault";
private static final String LOCATION = "location";
private static final String PORT_RANGE_START = "portRangeStart";
private static final String PORT_RANGE_END = "portRangeEnd";
private static final String LOCKED = "locked";

private String name;
private boolean isLocal;
private boolean isDefault;
private String backendLocation;
private int portStart;
private int portEnd;
private SimpleBooleanProperty locked = new SimpleBooleanProperty(false);

public BackendInstance() {};

public BackendInstance(final JsonObject jsonObject) {
deserialize(jsonObject);
};

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public boolean isLocal() {
return isLocal;
}

public void setLocal(boolean local) {
isLocal = local;
}

public boolean isDefault() {
return isDefault;
}

public void setDefault(boolean aDefault) {
isDefault = aDefault;
}

public String getBackendLocation() {
return backendLocation;
}

public void setBackendLocation(String backendLocation) {
this.backendLocation = backendLocation;
}

public int getPortStart() {
return portStart;
}

public void setPortStart(int portStart) {
this.portStart = portStart;
}

public int getPortEnd() {
return portEnd;
}

public void setPortEnd(int portEnd) {
this.portEnd = portEnd;
}

public int getNumberOfInstances() {
return this.portEnd - this.portStart;
}

public void lockInstance() {
locked.set(true);
}

public SimpleBooleanProperty getLockedProperty() {
return locked;
}

@Override
public JsonObject serialize() {
final JsonObject result = new JsonObject();
result.addProperty(NAME, getName());
result.addProperty(IS_LOCAL, isLocal());
result.addProperty(IS_DEFAULT, isDefault());
result.addProperty(LOCATION, getBackendLocation());
result.addProperty(PORT_RANGE_START, getPortStart());
result.addProperty(PORT_RANGE_END, getPortEnd());
result.addProperty(LOCKED, getLockedProperty().get());

return result;
}

@Override
public void deserialize(final JsonObject json) {
setName(json.getAsJsonPrimitive(NAME).getAsString());
setLocal(json.getAsJsonPrimitive(IS_LOCAL).getAsBoolean());
setDefault(json.getAsJsonPrimitive(IS_DEFAULT).getAsBoolean());
setBackendLocation(json.getAsJsonPrimitive(LOCATION).getAsString());
setPortStart(json.getAsJsonPrimitive(PORT_RANGE_START).getAsInt());
setPortEnd(json.getAsJsonPrimitive(PORT_RANGE_END).getAsInt());
if (json.getAsJsonPrimitive(LOCKED).getAsBoolean()) lockInstance();
}

@Override
public String toString() {
return name;
}
}
2 changes: 1 addition & 1 deletion src/main/java/ecdar/abstractions/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public void deserialize(final File projectFolder) throws IOException {
deserializeFileHelper(file);
}
}
// Now we have gone though all the files in the directory we can now deserialize folders
// Now we have gone through all the files in the directory we can now deserialize folders
if(componentFolder != null || systemFolder != null) {
deserializeComponents(componentFolder);
deserializeSystems(systemFolder);
Expand Down
16 changes: 7 additions & 9 deletions src/main/java/ecdar/abstractions/Query.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public class Query implements Serializable {
private final SimpleBooleanProperty isPeriodic = new SimpleBooleanProperty(false);
private final StringProperty errors = new SimpleStringProperty("");
private final ObjectProperty<QueryType> type = new SimpleObjectProperty<>();
private BackendHelper.BackendNames backend;
private BackendInstance backend;
private Consumer<Boolean> runQuery;

public Query(final String query, final String comment, final QueryState queryState) {
this.query.set(query);
this.comment.set(comment);
this.queryState.set(queryState);
setBackend(BackendHelper.defaultBackend);
setBackend(BackendHelper.getDefaultBackendInstance());

initializeRunQuery();
}
Expand Down Expand Up @@ -98,11 +98,11 @@ public void setIsPeriodic(final boolean isPeriodic) {
this.isPeriodic.set(isPeriodic);
}

public BackendHelper.BackendNames getBackend() {
public BackendInstance getBackend() {
return backend;
}

public void setBackend(BackendHelper.BackendNames backend) {
public void setBackend(BackendInstance backend) {
this.backend = backend;
}

Expand Down Expand Up @@ -179,7 +179,7 @@ public JsonObject serialize() {
result.add(IGNORED_INPUTS, getHashMapAsJsonObject(ignoredInputs));
result.add(IGNORED_OUTPUTS, getHashMapAsJsonObject(ignoredOutputs));

result.addProperty(BACKEND, backend.ordinal());
result.addProperty(BACKEND, backend.getName());

return result;
}
Expand Down Expand Up @@ -219,11 +219,9 @@ public void deserialize(final JsonObject json) {
}

if(json.has(BACKEND)) {
setBackend(json.getAsJsonPrimitive(BACKEND).getAsInt() == BackendHelper.BackendNames.jEcdar.ordinal()
? BackendHelper.BackendNames.jEcdar
: BackendHelper.BackendNames.Reveaal);
setBackend(BackendHelper.getBackendInstanceByName(json.getAsJsonPrimitive(BACKEND).getAsString()));
} else {
setBackend(BackendHelper.defaultBackend);
setBackend(BackendHelper.getDefaultBackendInstance());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ecdar/abstractions/QueryType.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public enum QueryType {
QUOTIENT("quotient", "\\"),
SPECIFICATION("specification", "Spec"),
IMPLEMENTATION("implementation", "Imp"),
LOCAL_CONSISTENCY("local-consistency", "lCon"),
LOCAL_CONSISTENCY("consistency", "lCon"), // ToDo NIELS: Will become local-consistency
GLOBAL_CONSISTENCY("global-consistency", "gCon"),
BISIM_MIN("bisim", "bsim"),
GET_COMPONENT("get-component", "get"),
Expand Down
Loading