Skip to content
Snippets Groups Projects
Commit 5f6e0f07 authored by Elouan Rigomont's avatar Elouan Rigomont
Browse files

Dominant hand option added to the launcher

Add dominant hand preference to VAirDrawLauncher and update SlaveProcess config
parent 3a18dec9
No related branches found
No related tags found
No related merge requests found
......@@ -38,9 +38,14 @@ VAirDrawLauncher::VAirDrawLauncher(wxWindow* parent, wxWindowID winid) : ILaunch
setupRadioBox = new wxRadioBox(this, wxID_ANY, "Hardware Setup", wxDefaultPosition, wxDefaultSize, choicesNb,
choices, 0, wxRA_SPECIFY_COLS);
wxString hands[] = { "Left hand", "Right hand" };
dominantHandBox = new wxRadioBox(this, wxID_ANY, "Dominant hand", wxDefaultPosition, wxDefaultSize, 2,
hands, 0, wxRA_SPECIFY_COLS);
saveCaptureButton->Hide();
launchExternalButton->Hide();
setupRadioBox->Hide();
dominantHandBox->Hide();
// Local assets dir options
......@@ -106,6 +111,8 @@ VAirDrawLauncher::VAirDrawLauncher(wxWindow* parent, wxWindowID winid) : ILaunch
ipb->AddSpacer(10);
ipb->Add(slaveIP, wxSizerFlags(0).Align(wxALIGN_CENTER_VERTICAL).Border(wxLEFT, 10));
optionsSizer->Add(ipb, wxSizerFlags(0).Border(wxLEFT | wxBOTTOM, 5));
dominantHandBox->Show();
optionsSizer->Add(dominantHandBox, wxSizerFlags(0).Expand().Border(wxLEFT | wxBOTTOM, 5));
} else if (runMode == LauncherConfig::SLAVE) {
hideRemoteHead->Show();
optionsSizer->Add(hideRemoteHead, wxSizerFlags(0).Border(wxLEFT, 5));
......@@ -116,9 +123,13 @@ VAirDrawLauncher::VAirDrawLauncher(wxWindow* parent, wxWindowID winid) : ILaunch
ipb->AddSpacer(10);
ipb->Add(masterIP, wxSizerFlags(0).Align(wxALIGN_CENTER_VERTICAL).Border(wxLEFT, 10));
optionsSizer->Add(ipb, wxSizerFlags(0).Border(wxLEFT | wxBOTTOM, 5));
dominantHandBox->Show();
optionsSizer->Add(dominantHandBox, wxSizerFlags(0).Expand().Border(wxLEFT | wxBOTTOM, 5));
} else if (runMode == LauncherConfig::SOLO) {
setupRadioBox->Show();
optionsSizer->Add(setupRadioBox, wxSizerFlags(0).Expand().Border(wxLEFT | wxBOTTOM, 5));
dominantHandBox->Show();
optionsSizer->Add(dominantHandBox, wxSizerFlags(0).Expand().Border(wxLEFT | wxBOTTOM, 5));
}
// Layout the setting of the local assets dir
......@@ -190,6 +201,12 @@ VAirDrawLauncher::VAirDrawLauncher(wxWindow* parent, wxWindowID winid) : ILaunch
[&](wxVariant &val){ setupRadioBox->SetSelection(val.GetLong()); }
}
},
{ "dominant-hand",
{
[&]()->wxVariant{ return wxVariant(dominantHandBox->GetSelection()); },
[&](wxVariant &val){ dominantHandBox->SetSelection(val.GetLong()); }
}
},
{ "hide-remote-head",
{
[&]()->wxVariant{ return wxVariant(hideRemoteHead->GetValue()); },
......@@ -233,6 +250,9 @@ void VAirDrawLauncher::onWriteAppConfig(DispatchAppConfigData* appConfig)
{
ItemsMap options = getItems();
int dominantHand = options["dominant-hand"].GetLong();
appConfig->jsonRoot["interaction-set"]["dominant-hand"] = dominantHand;
if (appConfig->runMode == LauncherConfig::MASTER) {
Json::Value& collabConfig = appConfig->jsonRoot["core"]["collaboration"]["collab-master"];
collabConfig = Json::nullValue;
......
......@@ -74,6 +74,7 @@ private:
wxCheckBox* launchExternalButton {};
wxCheckBox* enhancedNavButton {};
wxRadioBox* setupRadioBox {};
wxRadioBox* dominantHandBox {};
wxDirPickerCtrl* localAssetDirPicker {};
wxCheckBox* localAssetDirOnly {};
wxCheckBox* hideRemoteHead {};
......
......@@ -161,10 +161,16 @@ bool SlaveProcess::setSlaveConfig(const std::string& data)
}
// Need to add the local-asset-dir in the config
Json::Value jsContent {};
OptionsMap options = processCtrl->getProcessOptions();
parseJson(data, jsContent);
jsContent["core"]["local-asset-dir"] = Setup::getInstance()->ReadString("default-local-asset").ToStdString();
jsContent["interaction-set"]["dominant-hand"] = static_cast<int>(options["dominant-hand"].GetLong());
configFile.Write(jsContent.toStyledString());
configFile.Close();
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment