Skip to content

Commit

Permalink
Merge pull request #179 from pixxelhq/master
Browse files Browse the repository at this point in the history
v5.10.9-Pixxel-5.7.2
  • Loading branch information
swarup-n authored Dec 2, 2024
2 parents 48d7a2c + e377818 commit 0437a08
Show file tree
Hide file tree
Showing 147 changed files with 3,010 additions and 1,035 deletions.
4 changes: 4 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 5.10.9 released 1-Dec-2024
- Add stack step to insert arbitrary text
- Add stack step to insert telemetry verifications

Version 5.10.8 released 21-Nov-2024
- Bug fix in the parameter archive: when rebuilding intervals with gaps, the gaps would not be properly encoded, causing errors in retrieval.
Implemented a consistency check which will inform if the parameter archive is corrupted and will suggest a rebuild of the specific interval.
Expand Down
2 changes: 1 addition & 1 deletion distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>distribution</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/cascading/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>cascading</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/ccsds-frames/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>ccsds-frames</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/cfdp-udp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>cfdp-udp</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/cfdp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>cfdp</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/perftest1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>perftest1</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/perftest2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>perftest2</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<groupId>org.yamcs.examples</groupId>
Expand Down
2 changes: 1 addition & 1 deletion examples/pus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>pus</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/replication1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>replication1</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/replication2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>replication2</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/replication3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>replication3</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/simulation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>simulation</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/snippets/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>snippets</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>templates</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion packet-viewer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>packet-viewer</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>

<packaging>pom</packaging>

Expand Down
2 changes: 1 addition & 1 deletion simulator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>simulator</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>tests</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion yamcs-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>yamcs-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion yamcs-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>yamcs-client</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ public Future<?> shutdown() {
return group.shutdownGracefully(0, 5, TimeUnit.SECONDS);
}

/**
* Returns true if the TCP connection is opened (even before the websocket handshake has been established FIXME)
*/
public boolean isConnected() {
return nettyChannel != null && nettyChannel.isOpen();
}
Expand Down
2 changes: 1 addition & 1 deletion yamcs-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.8-Pixxel-5.7.1</version>
<version>5.10.9-Pixxel-5.7.2</version>
</parent>

<artifactId>yamcs-core</artifactId>
Expand Down
63 changes: 55 additions & 8 deletions yamcs-core/src/main/java/org/yamcs/activities/CommandStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class CommandStack {

private List<StackedCommand> commands = new ArrayList<>();
private List<Step> steps = new ArrayList<>();
private String acknowledgment = CommandHistoryPublisher.AcknowledgeQueued_KEY;
private int waitTime = 0;

Expand All @@ -32,12 +32,12 @@ public void setWaitTime(int waitTime) {
this.waitTime = waitTime;
}

public void addCommand(StackedCommand command) {
commands.add(command);
public void addStep(Step step) {
steps.add(step);
}

public List<StackedCommand> getCommands() {
return commands;
public List<Step> getSteps() {
return steps;
}

public static CommandStack fromJson(String json, Mdb mdb) throws CommandStackParseException {
Expand All @@ -63,21 +63,68 @@ public static CommandStack fromJson(String json, Mdb mdb) throws CommandStackPar
if (stackObject.has("steps")) { // v2
for (var stepEl : stackObject.getAsJsonArray("steps")) {
var stepObject = stepEl.getAsJsonObject();
if (stepObject.get("type").getAsString().equals("command")) {
var stepType = stepObject.get("type").getAsString();
if (stepType.equals("command")) {
var command = parseCommand(mdb, stepObject);
stack.addCommand(command);
stack.addStep(command);
} else if (stepType.equals("verify")) {
var verify = parseVerify(mdb, stepObject);
stack.addStep(verify);
}
}
} else if (stackObject.has("commands")) { // v1
for (var commandEl : stackObject.getAsJsonArray("commands")) {
var command = parseCommand(mdb, commandEl.getAsJsonObject());
stack.addCommand(command);
stack.addStep(command);
}
}

return stack;
}

private static StackedVerify parseVerify(Mdb mdb, JsonObject verifyObject) throws CommandStackParseException {
var stackedVerify = new StackedVerify();

if (verifyObject.has("condition")) {
var comparisonsArray = verifyObject.get("condition").getAsJsonArray();
for (var comparisonEl : comparisonsArray) {
var comparisonObject = comparisonEl.getAsJsonObject();

var parameterName = comparisonObject.get("parameter").getAsString();
var parameter = mdb.getParameter(parameterName);
if (parameter == null) {
throw new CommandStackParseException(
"Parameter " + parameterName + " does not exist in MDB");
}

var operator = comparisonObject.get("operator").getAsString();

Object value;
var jsonValue = comparisonObject.get("value").getAsJsonPrimitive();
if (jsonValue.isBoolean()) {
value = jsonValue.getAsBoolean();
} else if (jsonValue.isNumber()) {
value = jsonValue.getAsNumber();
} else if (jsonValue.isString()) {
value = jsonValue.getAsString();
} else {
throw new CommandStackParseException("Unexpected comparand of class " + jsonValue.getClass());
}

stackedVerify.addComparison(parameter, operator, value);
}
}

if (verifyObject.has("delay")) {
stackedVerify.setDelay(verifyObject.get("delay").getAsLong());
}
if (verifyObject.has("timeout")) {
stackedVerify.setTimeout(verifyObject.get("timeout").getAsLong());
}

return stackedVerify;
}

private static StackedCommand parseCommand(Mdb mdb, JsonObject commandObject) throws CommandStackParseException {
var name = commandObject.get("name").getAsString();

Expand Down
Loading

0 comments on commit 0437a08

Please sign in to comment.