Merge branch 'main' into 315-gui-show-ip-address

This commit is contained in:
Eiren Rain authored and GitHub committed 2023-02-09 17:42:46 +02:00
commit 7301b87a07
66 files changed
+1446 -227

No files matched your search

+1 -1
View File
@@ -49,7 +49,7 @@ fun main(args: Array<String>) {
}
val dir = File("").absoluteFile
try {
LogManager.initialize(File(dir, "logs/"), dir)
LogManager.initialize(dir)
} catch (e1: java.lang.Exception) {
e1.printStackTrace()
}
@@ -131,11 +131,7 @@ public class DataFeedBuilder {
public static int createTrackerRotation(FlatBufferBuilder fbb, Tracker tracker) {
Quaternion quaternion = new Quaternion();
if (tracker instanceof IMUTracker imuTracker) {
imuTracker.getRawRotation(quaternion);
} else {
tracker.getRotation(quaternion);
}
tracker.getRawRotation(quaternion);
return createQuat(fbb, quaternion);
}
@@ -194,6 +190,16 @@ public class DataFeedBuilder {
imuTracker.getIdentityAdjustedRotation(quaternion);
TrackerData.addRotationIdentityAdjusted(fbb, createQuat(fbb, quaternion));
}
} else if (tracker instanceof VRTracker vrTracker) {
Quaternion quaternion = new Quaternion();
if (mask.getRotationReferenceAdjusted() && tracker.hasRotation()) {
vrTracker.getRotation(quaternion);
TrackerData.addRotationReferenceAdjusted(fbb, createQuat(fbb, quaternion));
}
if (mask.getRotationIdentityAdjusted() && tracker.hasRotation()) {
vrTracker.getRawRotation(quaternion);
TrackerData.addRotationIdentityAdjusted(fbb, createQuat(fbb, quaternion));
}
}
return TrackerData.endTrackerData(fbb);
@@ -735,7 +735,8 @@ public class IMUTracker
@Override
public String getDisplayName() {
return "IMU Tracker #" + getTrackerId();
return "IMU Tracker #"
+ (getTrackerId() - vrserver.humanPoseManager.getShareableTracker().size());
}
@Override
@@ -28,6 +28,7 @@ public class WebsocketAPI extends WebSocketServer implements ProtocolAPIServer {
this.protocolAPI = protocolAPI;
this.protocolAPI.registerAPIServer(this);
setReuseAddr(true);
}
@Override
@@ -3,7 +3,6 @@ package io.eiren.util.logging;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.text.SimpleDateFormat;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.ConsoleHandler;
import java.util.logging.FileHandler;
@@ -20,7 +19,7 @@ public class LogManager {
public static final IGLog log = new DefaultGLog(global);
public static ConsoleHandler handler;
public static void initialize(File logsDir, File mainLogDir)
public static void initialize(File mainLogDir)
throws SecurityException, IOException {
if (initialized.getAndSet(true))
return;
@@ -31,30 +30,10 @@ public class LogManager {
File lastLogFile = new File(mainLogDir, "log_last.log");
if (lastLogFile.exists())
lastLogFile.delete();
File mainLog = new File(mainLogDir, "log_main.log");
FileHandler mHandler = new FileHandler(mainLog.getPath(), true);
FileHandler filehandler = new FileHandler(lastLogFile.getPath(), true);
mHandler.setFormatter(loc);
filehandler.setFormatter(loc);
global.addHandler(mHandler);
global.addHandler(filehandler);
}
if (logsDir != null) {
if (!logsDir.exists())
logsDir.mkdir();
if (!logsDir.isDirectory())
System.out.println("*** WARNING *** LOG FOLDER IS NOT A DIRECTORY!");
File currentLog = new File(
logsDir,
"log_"
+ new SimpleDateFormat("yyyy-MM-dd")
.format(System.currentTimeMillis())
+ ".log"
);
FileHandler filehandler2 = new FileHandler(currentLog.getPath(), true);
filehandler2.setFormatter(loc);
global.addHandler(filehandler2);
}
}
public static void replaceMainHandler(ConsoleHandler newHandler) {