diff --git a/Gui/opensim/tracking/src/org/opensim/tracking/InverseDynamicsToolModel.java b/Gui/opensim/tracking/src/org/opensim/tracking/InverseDynamicsToolModel.java index 093f4800b..311ad26fa 100644 --- a/Gui/opensim/tracking/src/org/opensim/tracking/InverseDynamicsToolModel.java +++ b/Gui/opensim/tracking/src/org/opensim/tracking/InverseDynamicsToolModel.java @@ -522,5 +522,12 @@ public ExternalLoads getExternalLoads() { return idTool.getExternalLoads(); } + public String getOutputGenForceFileName() { return idTool.getOutputGenForceFileName(); } + public void setOutputGenSetForceFileName(String name) { + if (!getOutputGenForceFileName().equals(name)) { + idTool.setOutputGenForceFileName(name); + setModified(Operation.OutputDataChanged); + } + } } diff --git a/Gui/opensim/tracking/src/org/opensim/tracking/InverseDynamicsToolPanel.form b/Gui/opensim/tracking/src/org/opensim/tracking/InverseDynamicsToolPanel.form index b3383cc97..3510acd6a 100644 --- a/Gui/opensim/tracking/src/org/opensim/tracking/InverseDynamicsToolPanel.form +++ b/Gui/opensim/tracking/src/org/opensim/tracking/InverseDynamicsToolPanel.form @@ -1,4 +1,4 @@ - +
@@ -154,7 +154,7 @@ - + @@ -163,7 +163,7 @@ - + @@ -231,7 +231,7 @@ - + @@ -252,7 +252,7 @@ - + diff --git a/Gui/opensim/tracking/src/org/opensim/tracking/InverseDynamicsToolPanel.java b/Gui/opensim/tracking/src/org/opensim/tracking/InverseDynamicsToolPanel.java index 726ba71b2..d06c7eae2 100644 --- a/Gui/opensim/tracking/src/org/opensim/tracking/InverseDynamicsToolPanel.java +++ b/Gui/opensim/tracking/src/org/opensim/tracking/InverseDynamicsToolPanel.java @@ -58,6 +58,9 @@ import org.opensim.view.excitationEditor.ExcitationEditorJFrame; import org.opensim.view.pub.OpenSimDB; +import java.nio.file.Path; +import java.nio.file.Paths; + /** * * @author erang @@ -93,9 +96,11 @@ public void actionPerformed(ActionEvent ae) { //rraPanel.setBorder(new ComponentTitledBorder(rraPanelCheckBox, rraPanel, BorderFactory.createEtchedBorder())); // File chooser settings - outputDirectory.setIncludeOpenButton(true); - outputDirectory.setDirectoriesOnly(true); + outputDirectory.setIncludeOpenButton(false); + outputDirectory.setExtensionsAndDescription(".sto", "Storage file for inverse dynamics analysis"); + outputDirectory.setDirectoriesOnly(false); outputDirectory.setCheckIfFileExists(false); + outputDirectory.setSaveMode(true); setSettingsFileDescription("Settings file for "+modeName); @@ -182,7 +187,8 @@ public void updateFromModel() { // Output outputName.setText(toolModel.getOutputPrefix()); - outputDirectory.setFileName(toolModel.getResultsDirectory(),false); + Path p = Paths.get(toolModel.getResultsDirectory(), toolModel.getOutputGenForceFileName()); + outputDirectory.setFileName(p.toString(),false); //outputPrecision.setText(numFormat.format(toolModel.getOutputPrecision())); // Actuators & external loads @@ -389,7 +395,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { outputPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Output")); - jLabel11.setText("Directory"); + jLabel11.setText("Generalized forces file"); outputDirectory.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { @@ -405,7 +411,7 @@ public void stateChanged(javax.swing.event.ChangeEvent evt) { .addContainerGap() .add(jLabel11) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(outputDirectory, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 354, Short.MAX_VALUE) + .add(outputDirectory, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE) .addContainerGap()) ); outputPanelLayout.setVerticalGroup( @@ -608,14 +614,14 @@ public void focusLost(java.awt.event.FocusEvent evt) { layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() - .add(jTabbedPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 459, Short.MAX_VALUE) + .add(jTabbedPane1) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() - .add(jTabbedPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 267, Short.MAX_VALUE) + .add(jTabbedPane1) .addContainerGap()) ); }// //GEN-END:initComponents @@ -752,7 +758,9 @@ private void finalTimeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR //------------------------------------------------------------------------ private void outputDirectoryStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_outputDirectoryStateChanged - toolModel.setResultsDirectory(outputDirectory.getFileName()); + Path p = Paths.get(outputDirectory.getFileName()); + toolModel.setResultsDirectory(p.getParent().toString()); + toolModel.setOutputGenSetForceFileName(p.getFileName().toString()); }//GEN-LAST:event_outputDirectoryStateChanged private void outputNameFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_outputNameFocusLost