Fixes in elog

This commit is contained in:
2026-03-17 15:59:22 +01:00
parent c065a902bd
commit 2bce8bee75

View File

@@ -13,6 +13,7 @@ import ch.psi.pshell.utils.Chrono;
import ch.psi.pshell.swing.SwingUtils;
import ch.psi.pshell.swing.SwingUtils.OptionResult;
import ch.psi.pshell.swing.SwingUtils.OptionType;
import ch.psi.pshell.utils.Sys;
import java.awt.Component;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
@@ -223,8 +224,8 @@ public class Correlation extends Panel {
StringBuffer cmd = new StringBuffer();
cmd.append("G_CS_ELOG_add -l \"").append(logbook).append("\" ");
cmd.append("-a \"Author=ScreenPanel\" ");
cmd.append("-a \"Type=pshell\" ");
cmd.append("-a \"Author=").append(Sys.getUserName()).append("\" ");
cmd.append("-a \"Application=pshell\" ");
cmd.append("-a \"Entry=").append(entry).append("\" ");
cmd.append("-a \"Title=").append(title).append("\" ");
cmd.append("-a \"Category=").append(category).append("\" ");
@@ -241,17 +242,21 @@ public class Correlation extends Panel {
try {
process.waitFor();
int bytes = process.getInputStream().available();
byte[] arr = new byte[bytes];
process.getInputStream().read(arr, 0, bytes);
System.out.println(new String(arr));
if (bytes>0){
byte[] arr = new byte[bytes];
process.getInputStream().read(arr, 0, bytes);
System.out.println(new String(arr));
}
bytes = process.getErrorStream().available();
arr = new byte[bytes];
process.getErrorStream().read(arr, 0, bytes);
System.err.println(new String(arr));
if (bytes>0){
byte[] arr = new byte[bytes];
process.getErrorStream().read(arr, 0, bytes);
System.err.println(new String(arr));
}
} catch (Exception ex) {
System.err.println(ex);
}
}).start();
}).start();
}