public YoVariableExtracter(File logFile) throws IOException { LogPropertiesReader logProperties = new LogPropertiesReader(new File(logFile, YoVariableLoggerListener.propertyFile)); File handshake = new File(logFile, logProperties.getHandshakeFile()); if (!handshake.exists()) { throw new RuntimeException("Cannot find " + logProperties.getHandshakeFile()); } DataInputStream handshakeStream = new DataInputStream(new FileInputStream(handshake)); byte[] handshakeData = new byte[(int) handshake.length()]; handshakeStream.readFully(handshakeData); handshakeStream.close(); YoVariableHandshakeParser parser = new YoVariableHandshakeParser("logged"); parser.parseFrom(handshakeData); YoVariableRegistry registry = parser.getRootRegistry(); File logdata = new File(logFile, logProperties.getVariableDataFile()); if(!logdata.exists()) { throw new RuntimeException("Cannot find " + logProperties.getVariableDataFile()); } @SuppressWarnings("resource") final FileChannel logChannel = new FileInputStream(logdata).getChannel(); List<YoVariable<?>> variables = parser.getYoVariablesList(); int jointStateOffset = variables.size(); int numberOfJointStates = JointState.getNumberOfJointStates(parser.getJointStates()); int bufferSize = (1 + jointStateOffset + numberOfJointStates) * 8; new YoVariableDialog(bufferSize, logChannel, variables, registry); }
LogFormatUpdater.updateLogs(selectedFile, logProperties); File handshake = new File(selectedFile, logProperties.getHandshakeFile()); if (!handshake.exists()) throw new RuntimeException("Cannot find " + logProperties.getHandshakeFile());
LogFormatUpdater.updateLogs(selectedFile, logProperties); File handshake = new File(selectedFile, logProperties.getHandshakeFile()); if (!handshake.exists()) throw new RuntimeException("Cannot find " + logProperties.getHandshakeFile());