Skip to content

Commit

Permalink
Merge pull request #31 from qualisys/update_to_1.24
Browse files Browse the repository at this point in the history
Update to RTSDK 1.24
  • Loading branch information
Capelliexp committed Dec 1, 2022
2 parents cea1da6 + 81dfe17 commit fa5bd07
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
5 changes: 5 additions & 0 deletions RTClientExample/OutputSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,11 @@ void COutput::Print6DOFSettings(CRTProtocol* poRTProtocol)
}
else
{
if (nMajorVersion > 1 || nMinorVersion > 23)
{
std::string enabledAsStr = bodiesSettings[iBody].enabled ? "True" : "False";
printf(" Enabled: %s\n", enabledAsStr.c_str());
}
printf(" Color: R=%.2X G=%.2X B=%.2X\n", color & 0xff, (color >> 8) & 0xff, (color >> 16) & 0xff);
printf(" Bone length tolerance: %f\n", bodiesSettings[iBody].boneLengthTolerance);
printf(" Max residual: %f\n", bodiesSettings[iBody].maxResidual);
Expand Down
2 changes: 1 addition & 1 deletion RTClientExample/RTClientExample.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "Operations.h"

#define LATEST_SELECTABLE_MAJOR_VERSION 1
#define LATEST_SELECTABLE_MINOR_VERSION 22
#define LATEST_SELECTABLE_MINOR_VERSION 24
#define PROGRAM_VERSION 0

int main(int argc, char **argv)
Expand Down
2 changes: 1 addition & 1 deletion RTPacket.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#endif

#define MAJOR_VERSION 1
#define MINOR_VERSION 23
#define MINOR_VERSION 24

class DLL_EXPORT CRTPacket
{
Expand Down
12 changes: 11 additions & 1 deletion RTProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3211,6 +3211,16 @@ bool CRTProtocol::Read6DOFSettings(bool &bDataAvailable)
}
s6DOFBodySettings.name = oXML.GetChildData();

if (mnMajorVersion > 1 || mnMinorVersion > 23)
{
if (!oXML.FindChildElem("Enabled"))
{
s6DOFBodySettings.enabled = true;
}
s6DOFBodySettings.enabled = oXML.GetChildData() == "true" ? true : false;
}


if (!oXML.FindChildElem("Color"))
{
return false;
Expand Down Expand Up @@ -5826,7 +5836,6 @@ bool CRTProtocol::SetForceSettings(
return false;
} // SetForceSettings


bool CRTProtocol::Set6DOFBodySettings(std::vector<SSettings6DOFBody> settings)
{
if (mnMajorVersion == 1 && mnMinorVersion < 21)
Expand All @@ -5848,6 +5857,7 @@ bool CRTProtocol::Set6DOFBodySettings(std::vector<SSettings6DOFBody> settings)
oXML.AddElem("Body");
oXML.IntoElem();
oXML.AddElem("Name", body.name.c_str());
oXML.AddElem("Enabled", body.enabled ? "true" : "false");
oXML.AddElem("Color");
oXML.AddAttrib("R", std::to_string(body.color & 0xff).c_str());
oXML.AddAttrib("G", std::to_string((body.color >> 8) & 0xff).c_str());
Expand Down
1 change: 1 addition & 0 deletions RTProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ class DLL_EXPORT CRTProtocol
struct SSettings6DOFBody
{
std::string name;
bool enabled;
uint32_t color;
std::string filterPreset;
float maxResidual;
Expand Down

0 comments on commit fa5bd07

Please sign in to comment.