Skip to content

Commit

Permalink
Merge pull request #145 from pixxelhq/master
Browse files Browse the repository at this point in the history
v5.10.4-Pixxel-3.2.0
swarup-n authored Oct 17, 2024
2 parents d0325d7 + 05288f2 commit 1316234
Showing 27 changed files with 92 additions and 32 deletions.
2 changes: 1 addition & 1 deletion distribution/pom.xml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>distribution</artifactId>
2 changes: 1 addition & 1 deletion examples/cascading/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>cascading</artifactId>
2 changes: 1 addition & 1 deletion examples/ccsds-frames/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>ccsds-frames</artifactId>
2 changes: 1 addition & 1 deletion examples/cfdp-udp/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>cfdp-udp</artifactId>
2 changes: 1 addition & 1 deletion examples/cfdp/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>cfdp</artifactId>
2 changes: 1 addition & 1 deletion examples/perftest1/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>perftest1</artifactId>
2 changes: 1 addition & 1 deletion examples/perftest2/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>perftest2</artifactId>
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<groupId>org.yamcs.examples</groupId>
2 changes: 1 addition & 1 deletion examples/pus/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>pus</artifactId>
2 changes: 1 addition & 1 deletion examples/replication1/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>replication1</artifactId>
2 changes: 1 addition & 1 deletion examples/replication2/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>replication2</artifactId>
2 changes: 1 addition & 1 deletion examples/replication3/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>replication3</artifactId>
2 changes: 1 addition & 1 deletion examples/simulation/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>simulation</artifactId>
2 changes: 1 addition & 1 deletion examples/snippets/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>snippets</artifactId>
2 changes: 1 addition & 1 deletion examples/templates/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs.examples</groupId>
<artifactId>examples</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>templates</artifactId>
2 changes: 1 addition & 1 deletion packet-viewer/pom.xml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>packet-viewer</artifactId>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
<packaging>pom</packaging>

<name>Yamcs</name>
2 changes: 1 addition & 1 deletion simulator/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>simulator</artifactId>
2 changes: 1 addition & 1 deletion tests/pom.xml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>tests</artifactId>
2 changes: 1 addition & 1 deletion yamcs-api/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>yamcs-api</artifactId>
2 changes: 1 addition & 1 deletion yamcs-client/pom.xml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>yamcs-client</artifactId>
2 changes: 1 addition & 1 deletion yamcs-core/pom.xml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>yamcs-core</artifactId>
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
import java.util.concurrent.atomic.AtomicLong;

import org.yamcs.ConfigurationException;
import org.yamcs.tctm.pus.tuples.Quattro;
import org.yamcs.tctm.pus.tuples.Penta;
import org.yamcs.Spec;
import org.yamcs.Spec.OptionType;
import org.yamcs.StandardTupleDefinitions;
@@ -40,7 +40,7 @@ public abstract class AbstractTmFrameLink extends AbstractLink implements Aggreg
protected RawFrameEnDec rawFrameDecoder;

// Redirection
Map<byte[], Quattro<Integer, Integer, Stream, String>> redirection; // offset, size, stream
Map<byte[], Penta<Integer, Integer, Stream, String, String>> redirection; // offset, size, stream
protected Map<String, AtomicLong> redirectionCounters = new HashMap<>();

// srs3
@@ -133,9 +133,10 @@ public void init(String instance, String name, YConfiguration config) throws Con
int size = yc.getInt("size");
Stream stream = ydb.getStream(yc.getString("stream"));
String rName = yc.getString("name");
String rLink = yc.getString("link", null);

redirectionCounters.put(rName, new AtomicLong(0));
redirection.put(header, new Quattro<>(offset, size, stream, rName));
redirection.put(header, new Penta<>(offset, size, stream, rName, rLink));
}
}

@@ -201,19 +202,23 @@ protected void handleFrame(Instant ert, byte[] data, int offset, int length) {
}

if (redirection != null) {
for(Map.Entry<byte[], Quattro<Integer, Integer, Stream, String>> mc: redirection.entrySet()) {
Quattro<Integer, Integer, Stream, String> value = mc.getValue();
for(Map.Entry<byte[], Penta<Integer, Integer, Stream, String, String>> mc: redirection.entrySet()) {
Penta<Integer, Integer, Stream, String, String> value = mc.getValue();

int roffset = value.getFirst();
int rsize = value.getSecond();
Stream rstream = value.getThird();
String rName = value.getFourth();
String rLink = value.getFifth();

// Set linkName via the config if present
String ll = rLink != null? rLink: linkName;

byte[] contention = Arrays.copyOfRange(data, offset + roffset, offset + roffset + rsize);
if (Arrays.equals(mc.getKey(), contention)) {
data = Arrays.copyOfRange(data, offset + stripHeader, offset + length);
Tuple t = new Tuple(StandardTupleDefinitions.TM, new Object[] { null, null, timeService.getMissionTime(), null,
data, timeService.getHresMissionTime(), null, linkName, null});
Tuple t = new Tuple(StandardTupleDefinitions.TM, new Object[] {timeService.getMissionTime(), 0, timeService.getMissionTime(), 0,
data, timeService.getHresMissionTime(), null, ll, null});
rstream.emitTuple(t);

// Update redirection counter
55 changes: 55 additions & 0 deletions yamcs-core/src/main/java/org/yamcs/tctm/pus/tuples/Penta.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package org.yamcs.tctm.pus.tuples;

import java.util.Objects;

public class Penta<K, V, L, M, N> {
private final K first;
private final V second;
private final L third;
private final M fourth;
private final N fifth;

public Penta(K first, V second, L third, M fourth, N fifth) {
this.first = first;
this.second = second;
this.third = third;
this.fourth = fourth;
this.fifth = fifth;
}

public K getFirst() {
return first;
}

public V getSecond() {
return second;
}

public L getThird() {
return third;
}

public M getFourth() {
return fourth;
}

public N getFifth() {
return fifth;
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Penta<?, ?, ?, ?, ?> penta = (Penta<?, ?, ?, ?, ?>) o;

return Objects.equals(first, penta.first) && Objects.equals(second, penta.second) && Objects.equals(third, penta.third) && Objects.equals(fourth, penta.fourth) && Objects.equals(fifth, penta.fifth);
}

@Override
public int hashCode() {
return Objects.hash(first, second, third, fourth, fifth);
}
}
2 changes: 1 addition & 1 deletion yamcs-tse/pom.xml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>yamcs-tse</artifactId>
2 changes: 1 addition & 1 deletion yamcs-web/pom.xml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>yamcs-web</artifactId>
2 changes: 1 addition & 1 deletion yamcs-xtce/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.yamcs</groupId>
<artifactId>yamcs</artifactId>
<version>5.10.4-Pixxel-3.1.1</version>
<version>5.10.4-Pixxel-3.2.0</version>
</parent>

<artifactId>yamcs-xtce</artifactId>

0 comments on commit 1316234

Please sign in to comment.