Skip to content

Commit 2a3ce18

Browse files
committed
update layout of gui
1 parent 65119f8 commit 2a3ce18

File tree

1 file changed

+31
-30
lines changed

1 file changed

+31
-30
lines changed

src/ui/GUI.cpp

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ int tsunami_lab::ui::GUI::launch()
208208
bool showClientLog = false;
209209
bool showSimulationParameterWindow = false;
210210
bool showSystemInfoWindow = false;
211-
bool showSimulationControlsWindow = false;
212211
bool showStationDataVisualizer = false;
213212
bool showDataVisualizer = false;
214213

@@ -285,12 +284,15 @@ int tsunami_lab::ui::GUI::launch()
285284
//--------------------------------------------//
286285
if (ImGui::BeginTabItem("Connectivity"))
287286
{
287+
ImGui::SeparatorText("Connect your client to the server.");
288+
288289
int width = 32;
289290
ImGui::SetNextItemWidth(ImGui::GetFontSize() * width);
290291
ImGui::InputText("IP address", &IPADDRESS[0], IM_ARRAYSIZE(IPADDRESS));
291292
ImGui::SetNextItemWidth(ImGui::GetFontSize() * width);
292293
ImGui::InputInt("Port", &PORT, 0);
293294
PORT = abs(PORT);
295+
294296

295297
ImGui::BeginDisabled(m_connected);
296298
if (ImGui::Button("Connect"))
@@ -419,16 +421,17 @@ int tsunami_lab::ui::GUI::launch()
419421

420422
ImGui::EndTabItem();
421423
}
422-
//----------------------------------------------//
423-
//------------Simulation Controls---------------//
424-
//----------------------------------------------//
425-
if (showSimulationControlsWindow)
424+
//-------------------------------------------//
425+
//------------Simulation Controls------------//
426+
//-------------------------------------------//
427+
if (ImGui::BeginTabItem("Simulation Controls"))
426428
{
427-
ImGui::Begin("Simulation controls", &showSimulationControlsWindow);
428-
429429
ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(2 / 7.0f, 0.6f, 0.6f));
430430
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(2 / 7.0f, 0.8f, 0.7f));
431431
ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(2 / 7.0f, 1.0f, 0.8f));
432+
433+
ImGui::SeparatorText("Change the state of the simulation.");
434+
432435
if (ImGui::Button("Run simulation"))
433436
{
434437
xlpmg::Message startSimMsg = xlpmg::START_SIMULATION;
@@ -534,28 +537,38 @@ int tsunami_lab::ui::GUI::launch()
534537
m_communicator.sendToServer(messageToJsonString(deleteStationsMsg));
535538
}
536539

537-
ImGui::End();
540+
ImGui::EndTabItem();
538541
}
539542
//-------------------------------------------//
540-
//------------------WINDOWS------------------//
543+
//------------Simulation Options-------------//
541544
//-------------------------------------------//
542545
if (ImGui::BeginTabItem("Windows"))
543546
{
544-
ImGui::Checkbox("Show Demo Window", &show_demo_window);
545-
ImGui::Checkbox("Show simulation controls", &showSimulationControlsWindow);
546-
ImGui::Checkbox("Edit compiler/runtime options", &showCompilerOptionsWindow);
547-
ImGui::Checkbox("Edit simulation parameters", &showSimulationParameterWindow);
548-
ImGui::Checkbox("Show station data visualizer", &showStationDataVisualizer);
549-
ImGui::Checkbox("Show data visualizer", &showDataVisualizer);
550-
ImGui::Checkbox("Show client log", &showClientLog);
551-
ImGui::Checkbox("Show system info", &showSystemInfoWindow);
547+
ImGui::SeparatorText("Windows for modification and observation of the simulation.");
548+
if (ImGui::BeginTabBar("Options"))
549+
{
550+
if (ImGui::BeginTabItem("Configuration")){
551+
ImGui::Checkbox("Edit simulation parameters", &showSimulationParameterWindow);
552+
ImGui::Checkbox("Edit compiler/runtime options", &showCompilerOptionsWindow);
553+
ImGui::EndTabItem();
554+
}
555+
if (ImGui::BeginTabItem("Observation tools")){
556+
ImGui::Checkbox("Show station data visualizer", &showStationDataVisualizer);
557+
ImGui::Checkbox("Show data visualizer", &showDataVisualizer);
558+
ImGui::Checkbox("Show client log", &showClientLog);
559+
ImGui::Checkbox("Show system info", &showSystemInfoWindow);
560+
ImGui::EndTabItem();
561+
}
562+
ImGui::EndTabBar();
563+
}
552564
ImGui::EndTabItem();
553565
}
554566
//---------------------------------------------//
555567
//----------------FILE TRANSFER----------------//
556568
//---------------------------------------------//
557569
if (ImGui::BeginTabItem("File transfer"))
558570
{
571+
ImGui::SeparatorText("Send and receive files from the server.");
559572
if (ImGui::CollapsingHeader("Send to server"))
560573
{
561574
ImGui::Indent();
@@ -628,19 +641,7 @@ int tsunami_lab::ui::GUI::launch()
628641
ImGui::TextWrapped("Our file transfer implementaion uses byte transfer over standard tcp sockets without additional security or performance. For large or confident files we recommend using other services such as sftp.");
629642
ImGui::EndTabItem();
630643
}
631-
//------------------------------------------//
632-
//--------------UNSROTED ITEMS--------------//
633-
//------------------------------------------//
634-
if (ImGui::BeginTabItem("Experimental"))
635-
{
636-
if (ImGui::Button("Get simulation sizes"))
637-
{
638-
m_communicator.sendToServer(messageToJsonString(xlpmg::GET_SIMULATION_SIZES));
639-
std::cout << m_communicator.receiveFromServer() << std::endl;
640-
}
641-
642-
ImGui::EndTabItem();
643-
}
644+
644645
ImGui::EndTabBar();
645646
}
646647

0 commit comments

Comments
 (0)