public YoVariableExtracter(File logFile) throws IOException { LogPropertiesReader logProperties = new LogPropertiesReader(new File(logFile, YoVariableLoggerListener.propertyFile)); File handshake = new File(logFile, logProperties.getVariables().getHandshakeAsString()); if (!handshake.exists()) { throw new RuntimeException("Cannot find " + logProperties.getVariables().getHandshakeAsString()); } DataInputStream handshakeStream = new DataInputStream(new FileInputStream(handshake)); byte[] handshakeData = new byte[(int) handshake.length()]; handshakeStream.readFully(handshakeData); handshakeStream.close(); YoVariableHandshakeParser parser = YoVariableHandshakeParser.create(logProperties.getVariables().getHandshakeFileType()); parser.parseFrom(handshakeData); YoVariableRegistry registry = parser.getRootRegistry(); File logdata = new File(logFile, logProperties.getVariables().getDataAsString()); if(!logdata.exists()) { throw new RuntimeException("Cannot find " + logProperties.getVariables().getDataAsString()); } @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); }
int bufferSize = (1 + jointStateOffset + numberOfJointStates) * 8; File logdata = new File(selectedFile, logProperties.getVariables().getDataAsString()); if (!logdata.exists()) throw new RuntimeException("Cannot find " + logProperties.getVariables().getDataAsString()); this.compressed = logProperties.getVariables().getCompressed(); if (this.compressed) File indexData = new File(selectedFile, logProperties.getVariables().getIndexAsString()); if (!indexData.exists()) throw new RuntimeException("Cannot find " + logProperties.getVariables().getIndexAsString());
int bufferSize = (1 + jointStateOffset + numberOfJointStates) * 8; File logdata = new File(selectedFile, logProperties.getVariables().getDataAsString()); if (!logdata.exists()) throw new RuntimeException("Cannot find " + logProperties.getVariables().getDataAsString()); this.compressed = logProperties.getVariables().getCompressed(); if (this.compressed) File indexData = new File(selectedFile, logProperties.getVariables().getIndexAsString()); if (!indexData.exists()) throw new RuntimeException("Cannot find " + logProperties.getVariables().getIndexAsString());
logProperties.getCameras().clear(); File handshake = new File(selectedFile, logProperties.getVariables().getHandshakeAsString()); if (!handshake.exists()) throw new RuntimeException("Cannot find " + logProperties.getVariables().getHandshakeAsString()); handshakeStream.close(); YoVariableHandshakeParser parser = YoVariableHandshakeParser.create(logProperties.getVariables().getHandshakeFileType()); parser.parseFrom(handshakeData);
LogFormatUpdater.updateLogs(selectedFile, logProperties); File handshake = new File(selectedFile, logProperties.getVariables().getHandshakeAsString()); if (!handshake.exists() || handshake.isDirectory()) throw new RuntimeException("Cannot find " + logProperties.getVariables().getHandshakeAsString()); handshakeStream.close(); YoVariableHandshakeParser parser = YoVariableHandshakeParser.create(logProperties.getVariables().getHandshakeFileType()); parser.parseFrom(handshakeData);