Skip to content

Commit

Permalink
Added in the changes needed dor the NASA space apps challenge 2018
Browse files Browse the repository at this point in the history
  • Loading branch information
wol101 committed Oct 28, 2018
1 parent 7c7b38d commit 9c62e68
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 34 deletions.
47 changes: 24 additions & 23 deletions GaitSymQt/GaitSym2017.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.6.2, 2018-09-25T20:16:31. -->
<!-- Written by QtCreator 4.7.1, 2018-10-27T21:26:33. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down Expand Up @@ -55,20 +55,24 @@
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey">
<value type="QString">-fno-delayed-template-parsing</value>
</valuelist>
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
<valuelist type="QVariantList" key="ClangStaticAnalyzer.SuppressedDiagnostics"/>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.11.1 MSVC2017 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.11.1 MSVC2017 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5111.win64_msvc2017_64_kit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.11.2 MSVC2017 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.11.2 MSVC2017 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5112.win64_msvc2017_64_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Unix/cvs/GaitSym2017/build-GaitSym2017-Desktop_Qt_5_11_1_MSVC2017_64bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Unix/cvs/GaitSym2017/build-GaitSym2017-Desktop_Qt_5_11_2_MSVC2017_64bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
Expand Down Expand Up @@ -122,7 +126,7 @@
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Unix/cvs/GaitSym2017/build-GaitSym2017-Desktop_Qt_5_11_1_MSVC2017_64bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Unix/cvs/GaitSym2017/build-GaitSym2017-Desktop_Qt_5_11_2_MSVC2017_64bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
Expand Down Expand Up @@ -176,7 +180,7 @@
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Unix/cvs/GaitSym2017/build-GaitSym2017-Desktop_Qt_5_11_1_MSVC2017_64bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Unix/cvs/GaitSym2017/build-GaitSym2017-Desktop_Qt_5_11_2_MSVC2017_64bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
Expand Down Expand Up @@ -292,9 +296,8 @@
<value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">GaitSym2017.pro</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">D:/Unix/cvs/GaitSym2017/build-GaitSym2017-Desktop_Qt_5_11_1_MSVC2017_64bit-Debug</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">D:/Unix/cvs/GaitSym2017/build-GaitSym2017-Desktop_Qt_5_11_2_MSVC2017_64bit-Debug</value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
Expand All @@ -308,14 +311,14 @@
<data>
<variable>ProjectExplorer.Project.Target.1</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.11.1 Static MSVC2017 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.11.1 Static MSVC2017 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{f19f27c3-93c6-4074-bda1-f664c073e274}</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.11.2 MSVC2017 64bit static</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.11.2 MSVC2017 64bit static</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{238f8513-5c10-4e3e-aeb8-c852775f1f42}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Unix/cvs/GaitSym2017/build-GaitSym2017-Desktop_Qt_5_11_1_Static_MSVC2017_64bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Unix/cvs/GaitSym2017/build-GaitSym2017-Desktop_Qt_5_11_2_MSVC2017_64bit_static-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
Expand Down Expand Up @@ -369,7 +372,7 @@
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Unix/cvs/GaitSym2017/build-GaitSym2017-Desktop_Qt_5_11_1_Static_MSVC2017_64bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Unix/cvs/GaitSym2017/build-GaitSym2017-Desktop_Qt_5_11_2_MSVC2017_64bit_static-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
Expand Down Expand Up @@ -423,7 +426,7 @@
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Unix/cvs/GaitSym2017/build-GaitSym2017-Desktop_Qt_5_11_1_Static_MSVC2017_64bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Unix/cvs/GaitSym2017/build-GaitSym2017-Desktop_Qt_5_11_2_MSVC2017_64bit_static-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
Expand Down Expand Up @@ -533,15 +536,13 @@
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">GaitSym2017</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory"></value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory.default"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Executable</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:D:/Unix/cvs/GaitSym2017/GaitSymQt/GaitSym2017.pro</value>
<value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">GaitSym2017.pro</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">D:/Unix/cvs/GaitSym2017/build-GaitSym2017-Desktop_Qt_5_11_1_MSVC2017_64bit-Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
Expand Down
10 changes: 3 additions & 7 deletions GaitSymQt/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,23 +225,19 @@ void MainWindow::newFromGeometry()

void MainWindow::open()
{
QFileInfo info = m_preferences->valueQString("LastFileOpened");
while (info.exists() == false)
{
info = QFileInfo(info.dir().absolutePath());
}
QString lastFileOpened = m_preferences->valueQString("LastFileOpened");

QString fileName;
QStringList geometryFileNames;
QTemporaryFile *tempFile = 0;

if (m_newFromGeometryFlag)
{
geometryFileNames = QFileDialog::getOpenFileNames(this, tr("Select the geometry files required"), info.absoluteFilePath(), tr("Geometry Files (*.obj)"), 0);
geometryFileNames = QFileDialog::getOpenFileNames(this, tr("Select the geometry files required"), lastFileOpened, tr("Geometry Files (*.obj)"), 0);
}
else
{
fileName = QFileDialog::getOpenFileName(this, tr("Open Config File"), info.absoluteFilePath(), tr("Config Files (*.xml)"), 0);
fileName = QFileDialog::getOpenFileName(this, tr("Open Config File"), lastFileOpened, tr("Config Files (*.xml)"), 0);
}

if (fileName.isNull() == false || geometryFileNames.size() > 0)
Expand Down
1 change: 1 addition & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ gaitsym_distribution_extras:
cp -rf libgwavi distribution/
cp -rf ode-0.15 distribution/
cp -rf rapidxml-1.13 distribution/
cp -rf GaitSymGaul distribution/
cp makefile distribution/
find distribution -depth -type d -name CVS -print -exec rm -rf {} \;
rm -rf distribution/GaitSymQt/GaitSymQt.pro.*
Expand Down
2 changes: 1 addition & 1 deletion src/PlaneGeom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void PlaneGeom::Draw(SimulationWindow *window)
floorTexture->unlock();
#endif

irr::u32 xRange = 100, yRange = 100;
irr::u32 xRange = 250, yRange = 250;
irr::core::dimension2d<irr::f32> tileSize(2.f, 2.f); // for a 2x2 checkerboard
irr::core::dimension2d<irr::u32> tileCount(xRange, yRange);
irr::video::SMaterial material;
Expand Down
12 changes: 9 additions & 3 deletions src/Simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,12 +600,18 @@ void Simulation::UpdateSimulation()
#ifdef DEBUG_CHECK_FORCES
pgd::Vector force(0, 0, 0);
#endif
for (unsigned int i = 0; i < pointForceList->size(); i++)
// this check is for the special case of a 2 point strap with both points attached to the same muscle
// we use this hack to generate uncoupled point forces e.g. when simulating a jet
// this is a hack for NASA SpaceApps 2018
size_t numPointForces = pointForceList->size();
if (pointForceList->size() == 2 && pointForceList->at(0)->body->GetBodyID() == pointForceList->at(1)->body->GetBodyID())
numPointForces = 1;
for (size_t i = 0; i < numPointForces; i++)
{
pointForce = (*pointForceList)[i];
dBodyAddForceAtPos(pointForce->body->GetBodyID(),
pointForce->vector[0] * tension, pointForce->vector[1] * tension, pointForce->vector[2] * tension,
pointForce->point[0], pointForce->point[1], pointForce->point[2]);
pointForce->point[0], pointForce->point[1], pointForce->point[2]);
#ifdef DEBUG_CHECK_FORCES
force += pgd::Vector(pointForce->vector[0] * tension, pointForce->vector[1] * tension, pointForce->vector[2] * tension);
#endif
Expand Down Expand Up @@ -3225,7 +3231,7 @@ void Simulation::ParseDataTarget(rapidxml::xml_node<char> * cur)
THROWIFZERO(buf = DoXmlGetProp(cur, "TargetValues"));
count = DataFile::CountTokens((char *)buf);
Util::Double(buf, count, m_DoubleList);
dataTargetVector->SetTargetValues(count, m_DoubleList);
dataTargetVector->SetTargetValues(count / 3, m_DoubleList); // HACK - FIX ME

// check presence of AbortThreshold
buf = DoXmlGetProp(cur, "AbortThreshold");
Expand Down

0 comments on commit 9c62e68

Please sign in to comment.