Please review any and all PUBLIC repositories, groups and associate files. These allow anyone on the Internet to access without authentication. Repository and group owners are responsible for their content and permission settings. Go to your project(s), click on Settings > General and expand the "Visibility, project features, permissions" to change this setting.

Roundtrip Test Commit

parent 884f5d1d
/Brennenstuhl/nbproject/private/
/BrennenstuhlTobias/build/
\ No newline at end of file
/BrennenstuhlTobias/build/
/BrennenstuhlTobias/nbproject/private/
/BrennenstuhlTobias/dist/
\ No newline at end of file
libs.CopyLibs.classpath=\
${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
libs.CopyLibs.displayName=CopyLibs Task
libs.CopyLibs.prop-version=3.0
......@@ -42,14 +42,39 @@ is divided into following sections:
<property file="nbproject/private/configs/${config}.properties"/>
<property file="nbproject/private/private.properties"/>
</target>
<target depends="-pre-init,-init-private" name="-init-user">
<target name="-pre-init-libraries">
<property location=".\lib\nblibraries.properties" name="libraries.path"/>
<dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
<pathconvert dirsep="/" property="libraries.dir">
<path path="${libraries.dir.nativedirsep}"/>
</pathconvert>
<basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
<available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
</target>
<target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
<loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
<filterchain>
<replacestring from="$${base}" to="${libraries.dir}"/>
<escapeunicode/>
</filterchain>
</loadproperties>
</target>
<target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
<loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
<filterchain>
<replacestring from="$${base}" to="${libraries.dir}"/>
<escapeunicode/>
</filterchain>
</loadproperties>
</target>
<target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
<property file="${user.properties.file}"/>
<!-- The two properties below are usually overridden -->
<!-- by the active platform. Just a fallback. -->
<property name="default.javac.source" value="1.6"/>
<property name="default.javac.target" value="1.6"/>
</target>
<target depends="-pre-init,-init-private,-init-user" name="-init-project">
<target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
<property file="nbproject/configs/${config}.properties"/>
<property file="nbproject/project.properties"/>
</target>
......@@ -118,7 +143,7 @@ is divided into following sections:
<property name="dist.jlink.output" value="${dist.jlink.dir}/${application.title}"/>
<property name="module.name" value=""/>
</target>
<target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property,-init-modules-supported" name="-do-init">
<target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property,-init-modules-supported" name="-do-init">
<property name="platform.java" value="${java.home}/bin/java"/>
<available file="${manifest.file}" property="manifest.available"/>
<condition property="splashscreen.available">
......@@ -287,7 +312,7 @@ is divided into following sections:
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
<target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
<fail unless="src.dir">Must set src.dir</fail>
<fail unless="test.src.dir">Must set test.src.dir</fail>
<fail unless="build.dir">Must set build.dir</fail>
......@@ -1046,7 +1071,7 @@ is divided into following sections:
<target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
<property name="ap.cmd.line.internal" value=""/>
</target>
<target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
<target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
<!--
===================
COMPILATION SECTION
......
build.xml.data.CRC32=1325f395
build.xml.data.CRC32=b0ff226d
build.xml.script.CRC32=e1e614b9
build.xml.stylesheet.CRC32=f85dc8f2@1.93.0.48
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=1325f395
nbproject/build-impl.xml.script.CRC32=2a0f0eb3
nbproject/build-impl.xml.data.CRC32=b0ff226d
nbproject/build-impl.xml.script.CRC32=90573349
nbproject/build-impl.xml.stylesheet.CRC32=f89f7d21@1.93.0.48
......@@ -65,8 +65,8 @@ javac.modulepath=
javac.processormodulepath=
javac.processorpath=\
${javac.classpath}
javac.source=13
javac.target=13
javac.source=14
javac.target=14
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}
......
......@@ -11,5 +11,8 @@
<root id="test.src.dir"/>
</test-roots>
</data>
<libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
<definitions>.\lib\nblibraries.properties</definitions>
</libraries>
</configuration>
</project>
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
!End!End of DIS capture file, Pdusave1.dislog.
!End!End of DIS capture file, Pdusave2.dislog.
!Begin!Beginning of DIS capture file, Pdusave3.dislog.
AAAAAAAAAAA=,BwABAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAbVXeQ=,BwACAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
AAAAAcTqV0g=,BwBFAgAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAcuS3Xw=,BwBGDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAAAAdIkMcw=,BwBHDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
AAAAAdmFxXA=,BwBIAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD6QAAAAA=
!End!End of DIS capture file, Pdusave3.dislog.
!End!End of DIS capture file, Pdusave5.dislog.
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package PduStreamTools;
import edu.nps.moves.dis7.EntityStatePdu;
import edu.nps.moves.dis7.Pdu;
import edu.nps.moves.dis7.enumerations.DISPDUType;
import edu.nps.moves.dis7.util.PduFactory;
import java.nio.ByteBuffer;
import java.text.NumberFormat;
import java.util.LinkedHashMap;
import java.util.Locale;
import java.util.Set;
import java.util.TreeMap;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Tobias Brennenstuhl @ NPS
*/
public class CreateX3dLineSet {
private byte[] bufferShort;
// -------------------- Begin Variables for Position Interpolator
private Boolean firstTimeStamp = true;
private int firstLocalTimeStamp = 0;
private double firstLocalX = 0;
private double firstLocalY = 0;
private double firstLocalZ = 0;
private LinkedHashMap<Double, Coordinates> testMap = new LinkedHashMap<>();
//Setting up a NumberFormatter for limitting the decimal count to 3
private NumberFormat coordinateNumberFormat = NumberFormat.getInstance(new Locale("en", "US"));
// -------------------- End Variables for Position Interpolator
public CreateX3dLineSet() {
//3 significant digits equals milimeter position accuracy and 0.001 radians = 0.0572963266634555‬ degrees
coordinateNumberFormat.setMaximumFractionDigits(3);
}
public void addPointsToMap(byte[] localBufferShort) {
this.bufferShort = localBufferShort.clone();
if (bufferShort[2] == 1) {
//PDU Factory
PduFactory pduFactory = new PduFactory();
Pdu localPdu = null;
localPdu = pduFactory.createPdu(bufferShort);
// ToDO figure out how to do this! makeEntityStatePDU
EntityStatePdu localEspdu = pduFactory.makeEntityStatePdu();
//Put all the data we need into the localEspdu
ByteBuffer espduBuffer = ByteBuffer.wrap(bufferShort);
try {
localEspdu.unmarshal(espduBuffer);
} catch (Exception ex) {
Logger.getLogger(CreateX3dLineSet.class.getName()).log(Level.SEVERE, null, ex);
}
double localTimeStamp = 0;
double localX = 0;
double localY = 0;
double localZ = 0;
//TimeStamps for a lineSet is not needed but copied from X3DInterpolators to use them as key for the hashmap
// and the standard compression class can be used
//Store the first timestamp to subtract it from all others
//Same with X,Y,Z to create a local coordiante system
if (firstTimeStamp) {
firstLocalTimeStamp = localPdu.getTimestamp();
localTimeStamp = localPdu.getTimestamp();
firstLocalX = localEspdu.getEntityLocation().getX();
firstLocalY = localEspdu.getEntityLocation().getZ();
firstLocalZ = -1*localEspdu.getEntityLocation().getY();
firstTimeStamp = false;
}
localTimeStamp = localPdu.getTimestamp();
localX = localEspdu.getEntityLocation().getX();
localY = localEspdu.getEntityLocation().getZ();
localZ = -1*localEspdu.getEntityLocation().getY();
//Debug for printing X,Y,Z
//System.out.println(localX + " " + localY + " " + localZ);
localTimeStamp = localTimeStamp - firstLocalTimeStamp;
localX = localX - firstLocalX;
localY = localY - firstLocalY;
localZ = localZ - firstLocalZ;
//Divide TimeStamp by 1,300,000 to get something close to a second per Unit.
//According to the DIS standard one tick is 3600/(2^31) seconds ~ 1.6764 µs
//1,300,000 was derived from a stream that is 61 seconds long. The number was adjusted to get a timesensor with 61 seconds
//ToDo find the real conversion between TimeStampDelta and seconds
localTimeStamp = localTimeStamp / 1300000;
//Only add to stream if it is an ESPDU
//ToDo: Add support for multiple Entities
if ((localPdu.getPduType() != null) && (localPdu.getPduType() == DISPDUType.ENTITY_STATE)) {
testMap.put((double) localTimeStamp, new Coordinates(localX, localY, localZ, 0.0, 0.0, 0.0));
}
}
}
public void makeX3dLineSet() {
//Compression of the testMap.
//Remove all collinear points.
SlidingWindowCompression regression = new SlidingWindowCompression(testMap);
TreeMap<Double, Coordinates> returnMap = new TreeMap<>();
//To turn of the compression just comment the next line out and the very next in.
returnMap = regression.doSlidingWindow();
//returnMap.putAll(testMap);
//Writing all values from the KeyMap to a proper Position Interpolator String
System.out.println("Writing X3D LineSet");
Set<Double> keys = returnMap.keySet();
String lineSetPoints = "";
String lineSet = "<LineSet vertexCount='" + returnMap.size() + "'> \n <Coordinate point='";
//Find highest time to do the normalization
double lastTimeStamp = 0;
for (Double k : keys) {
if (k > lastTimeStamp) {
lastTimeStamp = k;
}
}
//Normalize all times in the set
var keyKeyValueSetPositionInterpolator = new LinkedHashMap<Double, String>();
for (Double k : keys) {
String localCoordinateString;
double tempX = returnMap.get(k).getX();
double tempY = returnMap.get(k).getY();
double tempZ = returnMap.get(k).getZ();
localCoordinateString = " " + coordinateNumberFormat.format(tempX) + " " + coordinateNumberFormat.format(tempY) + " " + coordinateNumberFormat.format(tempZ);
keyKeyValueSetPositionInterpolator.put(k / lastTimeStamp, localCoordinateString);
}
keys = keyKeyValueSetPositionInterpolator.keySet();
//Setting up PositionInterpolator and OrientationInterpolator
for (Double k : keys) {
lineSetPoints += keyKeyValueSetPositionInterpolator.get(k) + " ";
}
lineSetPoints += "' ";
//PositionInterpolator
lineSet += lineSetPoints;
lineSet += "/> \n </LineSet> \n";
//Printing PositionInterpolator to the console
System.out.println(lineSet);
}
}
......@@ -50,9 +50,9 @@ public class PduListenerSaver {
System.out.println("Beginning pdu save to directory " + outDir);
//RecorderPlainText stores an unencoded PduLog
//RecorderPlainText recorder = new RecorderPlainText(outDir, mcast, port);
RecorderPlainText recorder = new RecorderPlainText(outDir, mcast, port);
//RecorderBase64 stores a BASE64 encoded PduLog
RecorderBase64 recorder = new RecorderBase64(outDir, mcast, port);
//RecorderBase64 recorder = new RecorderBase64(outDir, mcast, port);
//RecorderBinary stores a Binary PduLog
//RecorderBinary recorder = new RecorderBinary(outDir, mcast, port);
......
......@@ -53,9 +53,9 @@ public class PduReaderPlayer {
try {
//Use Tobis Code without decryption
//Does only work with unecrypted PduLogs
//PlayerPlainText player = new PlayerPlainText(mcast, port, new File(outDir).toPath());
PlayerPlainText player = new PlayerPlainText(mcast, port, new File(outDir).toPath());
//Use Mike Baileys Code to store a file in BASE64 format
PlayerBase64 player = new PlayerBase64(mcast, port, new File(outDir).toPath());
//PlayerBase64 player = new PlayerBase64(mcast, port, new File(outDir).toPath());
player.startResume();
......
......@@ -17,11 +17,11 @@ import java.util.TreeMap;
*
* @author tobia
*/
public class Compressor {
public class SlidingWindowCompression {
private LinkedHashMap<Double, Coordinates> localMap;
public Compressor(LinkedHashMap<Double, Coordinates> localHashMap) {
public SlidingWindowCompression(LinkedHashMap<Double, Coordinates> localHashMap) {
//copy the given HashMap to a localMap
this.localMap = new LinkedHashMap<>();
......@@ -34,11 +34,11 @@ public class Compressor {
}
System.out.println("DISTools.Regression.<init>()");
//System.out.println("DISTools.Regression.<init>()");
}
public TreeMap<Double, Coordinates> doCompression() {
public TreeMap<Double, Coordinates> doSlidingWindow() {
System.out.println("DISTools.Regression.doRegression()");
......@@ -71,9 +71,11 @@ public class Compressor {
List<Double> xList = new ArrayList<>();
List<Double> yList = new ArrayList<>();
List<Double> zList = new ArrayList<>();
List<Double> phiList = new ArrayList<>();
List<Double> psiList = new ArrayList<>();
List<Double> thetaList = new ArrayList<>();
Double[] k = new Double[slidingWindowKeys.size()];
slidingWindowKeys.toArray(k);
......@@ -82,21 +84,25 @@ public class Compressor {
//Fix Loop to fill Arrays
tList.add(i, k[i]);
phiList.add(i, slidingWindow.get(k[i]).getPhi());
psiList.add(i, slidingWindow.get(k[i]).getPsi());
thetaList.add(i, slidingWindow.get(k[i]).getTheta());
xList.add(i, slidingWindow.get(k[i]).getX());
yList.add(i, slidingWindow.get(k[i]).getY());
zList.add(i, slidingWindow.get(k[i]).getZ());
}
//calculate triangle according to the homepage
for (int i = 0; i < slidingWindow.size(); i++) {
//Calculate Area of Triangle
//http://www.ambrsoft.com/TrigoCalc/Line3D/LineColinear.htm
double a = sqrt(pow(xList.get(1) - xList.get(0), 2) + pow(yList.get(1) - yList.get(0), 2) + pow(zList.get(1) - zList.get(0), 2));
......@@ -109,16 +115,20 @@ public class Compressor {
if ((areaA >= 0.1) || (tList.get(i) - tList.get(0) >= 4.0)) {
System.out.println("Threshold met. Break");
//@Debug
//System.out.println("Threshold met. Break");
//grab the first and the last point from the regression test and push it to the returnMap
//grab the first and the last point from the sliding window and push it to the returnMap
Coordinates firstPoint = new Coordinates();
firstPoint.setX(xList.get(0));
firstPoint.setY(yList.get(0));
firstPoint.setZ(zList.get(0));
firstPoint.setPhi(phiList.get(0));
firstPoint.setPsi(psiList.get(0));
firstPoint.setTheta(thetaList.get(0));
//ToDo add the angles to the Coordinates
Coordinates lastPoint = new Coordinates(xList.get(i), yList.get(i), zList.get(i), 0.0, 0.0, 0.0);
Coordinates lastPoint = new Coordinates(xList.get(i), yList.get(i), zList.get(i), phiList.get(i), psiList.get(i), thetaList.get(i));
returnMap.put(tList.get(0), firstPoint);
returnMap.put(tList.get(i), lastPoint);
......@@ -129,38 +139,38 @@ public class Compressor {
xList.clear();
yList.clear();
zList.clear();
phiList.clear();
psiList.clear();
thetaList.clear();
break;
}
if ((areaA <= 0.1) && (tList.get(i) - tList.get(0) <= 4.0) && streamMap.size() == 0) {
System.out.println("StreamMap empty. All points left will be added. Break");
//System.out.println("StreamMap empty. All points left will be added. Break");
//grab the first and the last point from the regression test and push it to the returnMap
for (int j = 0; j < slidingWindow.size(); j++) {
//ToDo: Add the angles to the coordinates
Coordinates leftPoints = new Coordinates(xList.get(j), yList.get(j), zList.get(j), 0.0, 0.0, 0.0);
Coordinates leftPoints = new Coordinates(xList.get(j), yList.get(j), zList.get(j), phiList.get(j), psiList.get(j), thetaList.get(j));
returnMap.put(tList.get(j), leftPoints);
}
break;
}
System.out.println("Area of Triangle: " + areaA);
//System.out.println("Area of Triangle: " + areaA);
}
}
};
}
return returnMap;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment