1
0
Fork 0
mirror of https://github.com/gwm17/Specter.git synced 2024-11-26 12:18:51 -05:00

Fixed some string concat cases in panels and EditorLayer

This commit is contained in:
Gordon McCann 2022-01-27 21:50:11 -05:00
parent 695c647d71
commit 3049ee7025
5 changed files with 18 additions and 15 deletions

View File

@ -163,23 +163,23 @@ namespace Navigator {
auto& params = gram.second->GetParameters(); auto& params = gram.second->GetParameters();
if (ImGui::TreeNode(params.name.c_str())) if (ImGui::TreeNode(params.name.c_str()))
{ {
ImGui::BulletText("X Parameter: %s", params.x_par.c_str()); ImGui::BulletText(("X Parameter: "+params.x_par).c_str());
ImGui::BulletText("X Bins: %d X Min: %f X Max: %f", params.nbins_x, params.min_x, params.max_x); ImGui::BulletText("X Bins: %d X Min: %f X Max: %f", params.nbins_x, params.min_x, params.max_x);
if (params.y_par != "None") if (params.y_par != "None")
{ {
ImGui::BulletText("Y Parameter: %s", params.y_par.c_str()); ImGui::BulletText(("Y Parameter: "+params.y_par).c_str());
ImGui::BulletText("Y Bins: %d Y Min: %f Y Max: %f", params.nbins_y, params.min_y, params.max_y); ImGui::BulletText("Y Bins: %d Y Min: %f Y Max: %f", params.nbins_y, params.min_y, params.max_y);
} }
if(params.cutsDrawnUpon.size() != 0 && ImGui::TreeNode("Cuts Drawn")) if(params.cutsDrawnUpon.size() != 0 && ImGui::TreeNode("Cuts Drawn"))
{ {
for(auto& cut : params.cutsDrawnUpon) for(auto& cut : params.cutsDrawnUpon)
ImGui::BulletText("%s", cut.c_str()); ImGui::BulletText(cut.c_str());
ImGui::TreePop(); ImGui::TreePop();
} }
if(params.cutsAppliedTo.size() != 0 && ImGui::TreeNode("Cuts Applied")) if(params.cutsAppliedTo.size() != 0 && ImGui::TreeNode("Cuts Applied"))
{ {
for(auto& cut : params.cutsAppliedTo) for(auto& cut : params.cutsAppliedTo)
ImGui::BulletText("%s", cut.c_str()); ImGui::BulletText(cut.c_str());
ImGui::TreePop(); ImGui::TreePop();
} }
ImGui::TreePop(); ImGui::TreePop();
@ -195,9 +195,9 @@ namespace Navigator {
auto& params = cut.second->GetCutParams(); auto& params = cut.second->GetCutParams();
if(ImGui::TreeNode(params.name.c_str())) if(ImGui::TreeNode(params.name.c_str()))
{ {
ImGui::BulletText("X Parameter: %s", params.x_par.c_str()); ImGui::BulletText(("X Parameter: "+params.x_par).c_str());
if(params.y_par != "None") if(params.y_par != "None")
ImGui::BulletText("Y Parameter: %s", params.y_par.c_str()); ImGui::BulletText(("Y Parameter: "+params.y_par).c_str());
ImGui::TreePop(); ImGui::TreePop();
} }
} }

View File

@ -36,9 +36,9 @@ namespace Navigator {
std::string text = ""; std::string text = "";
if (ImGui::BeginPopupModal(m_openFileName.c_str())) if (ImGui::BeginPopupModal(m_openFileName.c_str()))
{ {
ImGui::Text("Current Directory: %s", m_currentPath.lexically_normal().string().c_str()); ImGui::Text(("Current Directory: " + m_currentPath.lexically_normal().string()).c_str());
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text("Extension Filter: %s", ext.c_str()); ImGui::Text(("Extension Filter: "+ext).c_str());
ImGui::InputText("Selected", &m_selectedItem); ImGui::InputText("Selected", &m_selectedItem);
if (ImGui::Button("Ok")) if (ImGui::Button("Ok"))
{ {
@ -111,9 +111,9 @@ namespace Navigator {
std::string text = ""; std::string text = "";
if (ImGui::BeginPopupModal(m_saveFileName.c_str())) if (ImGui::BeginPopupModal(m_saveFileName.c_str()))
{ {
ImGui::Text("Current Directory: %s", m_currentPath.lexically_normal().string().c_str()); ImGui::Text(("Current Directory: "+m_currentPath.lexically_normal().string()).c_str());
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text("Extension Filter: %s", ext.c_str()); ImGui::Text(("Extension Filter: "+ext).c_str());
ImGui::InputText("Selected", &m_selectedItem); ImGui::InputText("Selected", &m_selectedItem);
if (ImGui::Button("Ok")) if (ImGui::Button("Ok"))
{ {
@ -184,7 +184,7 @@ namespace Navigator {
std::string text = ""; std::string text = "";
if (ImGui::BeginPopupModal(m_openDirName.c_str())) if (ImGui::BeginPopupModal(m_openDirName.c_str()))
{ {
ImGui::Text("Current Directory: %s", m_currentPath.lexically_normal().string().c_str()); ImGui::Text(("Current Directory: "+m_currentPath.lexically_normal().string()).c_str());
ImGui::InputText("Selected", &m_selectedItem); ImGui::InputText("Selected", &m_selectedItem);
if (ImGui::Button("Ok")) if (ImGui::Button("Ok"))
{ {

View File

@ -9,7 +9,7 @@
namespace Navigator { namespace Navigator {
SourceDialog::SourceDialog() : SourceDialog::SourceDialog() :
m_openFlag(false), m_chosenWindow(2000000) m_openFlag(false), m_chosenPort("51489"), m_chosenWindow(2000000)
{ {
} }
@ -30,6 +30,7 @@ namespace Navigator {
m_openFlag = false; m_openFlag = false;
m_chosenType = DataSource::SourceType::None; m_chosenType = DataSource::SourceType::None;
m_chosenLocation = ""; m_chosenLocation = "";
m_chosenPort = "51489";
m_chosenWindow = 2000000; m_chosenWindow = 2000000;
ImGui::OpenPopup("Attach Source"); ImGui::OpenPopup("Attach Source");
} }
@ -50,6 +51,7 @@ namespace Navigator {
if (m_chosenType == DataSource::SourceType::CompassOnline) if (m_chosenType == DataSource::SourceType::CompassOnline)
{ {
ImGui::InputText("Hostname", &m_chosenLocation); ImGui::InputText("Hostname", &m_chosenLocation);
ImGui::InputText("Port", &m_chosenPort);
} }
else if (m_chosenType == DataSource::SourceType::CompassOffline) else if (m_chosenType == DataSource::SourceType::CompassOffline)
{ {
@ -67,7 +69,7 @@ namespace Navigator {
if (ImGui::Button("Ok")) if (ImGui::Button("Ok"))
{ {
PhysicsStartEvent event(m_chosenLocation, m_chosenType, m_chosenWindow); PhysicsStartEvent event(m_chosenLocation, m_chosenType, m_chosenWindow, m_chosenPort);
Application::Get().OnEvent(event); Application::Get().OnEvent(event);
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }

View File

@ -19,6 +19,7 @@ namespace Navigator {
bool m_openFlag; bool m_openFlag;
DataSource::SourceType m_chosenType; DataSource::SourceType m_chosenType;
std::string m_chosenLocation; std::string m_chosenLocation;
std::string m_chosenPort;
FileDialog m_fileDialog; FileDialog m_fileDialog;
int m_chosenWindow; int m_chosenWindow;
}; };

View File

@ -37,8 +37,8 @@ namespace Navigator {
m_newCutParams.x_par = zoomed_params.x_par; m_newCutParams.x_par = zoomed_params.x_par;
m_newCutParams.y_par = zoomed_params.y_par; m_newCutParams.y_par = zoomed_params.y_par;
ImGui::InputText("Cut Name", &m_newCutParams.name); ImGui::InputText("Cut Name", &m_newCutParams.name);
ImGui::BulletText("X Parameter: %s", m_newCutParams.x_par.c_str()); ImGui::BulletText(("X Parameter: "+m_newCutParams.x_par).c_str());
ImGui::BulletText("Y Parameter: %s", m_newCutParams.y_par.c_str()); ImGui::BulletText(("Y Parameter: "+m_newCutParams.y_par).c_str());
if(ImGui::Button("Accept & Draw")) if(ImGui::Button("Accept & Draw"))
{ {
m_cutModeFlag = true; m_cutModeFlag = true;