Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanhab committed Jan 27, 2020
2 parents 7d9deda + 7363ae3 commit b1f3714
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ v4.1
- Fix issue [#1141](https://github.com/opensim-org/opensim-gui/issues/1141): Handle moving path points properly when they appear first on GeometryPath for visualization purposes
- Fix issue [#1111](https://github.com/opensim-org/opensim-gui/issues/1111): Handle muscle paths that wrap around multiple wrap objects when wrapping disengages.
- Fix issue [#1153](https://github.com/opensim-org/opensim-gui/issues/1153): Handle "Applies Force" checkbox in External Force edit, so that the setting is persistent.
- Fix issue [#1165](https://github.com/opensim-org/opensim-gui/issues/1165): Handle user cancel from save external-loads dialog gracefully.

3 changes: 3 additions & 0 deletions Gui/opensim/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@
<symlink action="single" link="${mac.dist.outer.dir}/bin/opensense"
resource="../${mac.final.app.name}/Contents/Resources/OpenSim/bin/opensense"
overwrite="true"/>
<symlink action="single" link="${mac.dist.outer.dir}/bin/opensim-install-command-line.sh"
resource="../${mac.final.app.name}/Contents/Resources/OpenSim/bin/opensim-install-command-line.sh"
overwrite="true"/>
<symlink action="single" link="${mac.dist.outer.dir}/cmake"
resource="${mac.final.app.name}/Contents/Resources/OpenSim/cmake/"
overwrite="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ private class SaveButtonActionListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
FileFilter ff = FileUtils.getFileFilter(".xml", "File to save External Loads");
String fileName = FileUtils.getInstance().browseForFilenameToSave(ff, true, "", null);
if (fileName == null) return; // user cancelled
String fullFilename = FileUtils.addExtensionIfNeeded(fileName, ".xml");
dLoads.print(fullFilename);
externalLoadsFileName.setFileName(fullFilename);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,11 @@ private void updateForceFromPanel() {
if (initializing) return;
String forceName=ForceNameTextField.getText();
if (forceName != null && forceName.length()!=0)
if (!initializing) externalForce.setName(forceName);
externalForce.setName(forceName);

String forceBodyame = (String) BodiesComboBox.getSelectedItem();
if (forceBodyame != null && forceBodyame.length()!=0)
if (!initializing) externalForce.setAppliedToBodyName(forceBodyame);
externalForce.setAppliedToBodyName(forceBodyame);

// Set either forcefunctions or force and pointFunctions if ForceCheckBox is on
if (jCheckBoxForce.isSelected()){
Expand All @@ -668,35 +668,29 @@ private void updateForceFromPanel() {
(String)jComboBoxPX.getSelectedItem(),
(String)jComboBoxPY.getSelectedItem(),
(String)jComboBoxPZ.getSelectedItem()));
} else
;//if (!initializing) externalForce.clearPointFunctions();
}
} else {
// Clear all
if (!initializing) {
externalForce.setForceIdentifier("");
jComboBoxFX.setSelectedItem("");
jComboBoxFY.setSelectedItem("");
jComboBoxFZ.setSelectedItem("");
externalForce.setPointIdentifier("");
jComboBoxPX.setSelectedItem("");
jComboBoxPY.setSelectedItem("");
jComboBoxPZ.setSelectedItem("");
}
externalForce.setForceIdentifier("");
jComboBoxFX.setSelectedItem("");
jComboBoxFY.setSelectedItem("");
jComboBoxFZ.setSelectedItem("");
externalForce.setPointIdentifier("");
jComboBoxPX.setSelectedItem("");
jComboBoxPY.setSelectedItem("");
jComboBoxPZ.setSelectedItem("");
}
// Set torquefunctions if TorqueCheckBox is on
if (jCheckBoxTorque.isSelected()){
externalForce.setTorqueIdentifier(makeIdentifier(
(String)jComboBoxTX.getSelectedItem(),
(String)jComboBoxTY.getSelectedItem(),
(String)jComboBoxTZ.getSelectedItem()));
//if (!initializing) externalForce.setTorqueFunctionNames(torqueFunctionNames, forceStorage);
} else {
if (!initializing) {
externalForce.setTorqueIdentifier("");
jComboBoxTX.setSelectedItem("");
jComboBoxTY.setSelectedItem("");
jComboBoxTZ.setSelectedItem("");
}
externalForce.setTorqueIdentifier("");
jComboBoxTX.setSelectedItem("");
jComboBoxTY.setSelectedItem("");
jComboBoxTZ.setSelectedItem("");
}
String selected = (String) ForceExpressedBodiesComboBox.getSelectedItem();
if (selected !=null)
Expand Down
12 changes: 7 additions & 5 deletions Gui/opensim/view/src/org/opensim/view/Installer.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.openide.modules.ModuleInstall;
import org.openide.util.Exceptions;
import org.openide.windows.WindowManager;
import org.opensim.logger.OpenSimLogger;
import org.opensim.utils.ApplicationState;
import org.opensim.utils.ErrorDialog;
import org.opensim.utils.TheApp;
Expand Down Expand Up @@ -91,14 +92,14 @@ public void restored() {
} catch (UnsupportedLookAndFeelException ex) {
ex.printStackTrace();
}
// Force creation of Model-database OpenSimDB
// and a View-database ViewDB
// and register View as Observer of Model
OpenSimDB.getInstance().addObserver(ViewDB.getInstance());
/**
* @todo open explorer window, Restore default directory and Bones directories, ..
*/
restorePrefs();
// Force creation of Model-database OpenSimDB
// and a View-database ViewDB
// and register View as Observer of Model
OpenSimDB.getInstance().addObserver(ViewDB.getInstance());

String saved = TheApp.getCurrentVersionPreferences().get("Application: Restore Models on Startup", "Off");
if (saved.equalsIgnoreCase("on")){
Expand Down Expand Up @@ -168,10 +169,11 @@ public void run() {

String defaultGeometryPath = TheApp.getDefaultGeometrySearchPath();
String saved=TheApp.getCurrentVersionPreferences().get("Paths: Geometry Search Path", defaultGeometryPath);
//OpenSimLogger.logMessage("\nGeometrySeach path set to "+saved, OpenSimLogger.INFO);
if (saved.isEmpty()||saved.equalsIgnoreCase("")){
saved = defaultGeometryPath;
TheApp.getCurrentVersionPreferences().put("Paths: Geometry Search Path", saved);
}
TheApp.getCurrentVersionPreferences().put("Paths: Geometry Search Path", saved);
// If saved is not blank we assume user knows what s/he's doing and leave it alone. Fixes issue #1115
// Push changes to API side
GeometryFileLocator.updateGeometrySearchPathsFromPreferences();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static GeometryFileLocator getInstance(){
}

public static void updateGeometrySearchPathsFromPreferences() {
String userGeometryPath=TheApp.getCurrentVersionPreferences().get("Paths: Geometry Search Path", ".");
String userGeometryPath=TheApp.getCurrentVersionPreferences().get("Paths: Geometry Search Path", "");
String dirs[] = userGeometryPath.split(File.pathSeparator);
for (int i=0; i< dirs.length; i++)
ModelVisualizer.addDirToGeometrySearchPaths(dirs[i]);
Expand Down
2 changes: 1 addition & 1 deletion opensim-models
Submodule opensim-models updated 125 files

0 comments on commit b1f3714

Please sign in to comment.