Skip to content

Commit 1a660c0

Browse files
committed
Finishing checkboxes
1 parent 5c7a69c commit 1a660c0

File tree

2 files changed

+78
-30
lines changed

2 files changed

+78
-30
lines changed

UI/src/livedoc_info.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
notes
1+
notes
2+

UI/src/ui.cpp

Lines changed: 76 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -259,21 +259,80 @@ void livedoc_panel() {
259259
ImGui::EndDisabled();
260260
}
261261

262-
bool thrusterBool = false;
262+
bool valveBool[] = [ false, false, false, false, false, false, false, false, true, false, false, false, false, true, false, false, false, false ];
263+
void copv_panel() {
264+
if (ImGui::BeginTable("copv_table", 1, ImGuiTableFlags_Resizable)) {
265+
ImGui::TableNextColumn();
266+
ImGui::Checkbox("BV-N2-01", &(valveBool[0]));
267+
ImGui::Checkbox("BV-N2-02", &(valveBool[1]));
268+
ImGui::EndTable();
269+
}
270+
}
271+
272+
void tank_rcs_panel() {
273+
if (ImGui::BeginTable("tank_rcs_table", 1, ImGuiTableFlags_Resizable)) {
274+
ImGui::TableNextColumn();
275+
ImGui::Checkbox("SV-N2-01", &(valveBool[2]));
276+
ImGui::Checkbox("SV-N2-02", &(valveBool[3]));
277+
ImGui::Checkbox("BV-N2-03", &(valveBool[4]));
278+
ImGui::EndTable();
279+
}
280+
}
281+
282+
void purge_circuit_panel() {
283+
if (ImGui::BeginTable("purge_table", 1, ImGuiTableFlags_Resizable)) {
284+
ImGui::TableNextColumn();
285+
ImGui::Checkbox("SV-N2-03", &(valveBool[5]));
286+
ImGui::Checkbox("SV-N2-04", &(valveBool[6]));
287+
ImGui::Checkbox("SV-N2-05", &(valveBool[7]));
288+
ImGui::EndTable();
289+
}
290+
}
291+
292+
void lox_tank_panel() {
293+
if (ImGui::BeginTable("lox_tank_table", 1, ImGuiTableFlags_Resizable)) {
294+
ImGui::TableNextColumn();
295+
ImGui::Checkbox("BV-O2-01", &(valveBool[8]));
296+
ImGui::Checkbox("BV-O2-02", &(valveBool[9]));
297+
ImGui::EndTable();
298+
}
299+
}
300+
301+
void lox_piping_panel() {
302+
if (ImGui::BeginTable("lox_piping_table", 1, ImGuiTableFlags_Resizable)) {
303+
ImGui::TableNextColumn();
304+
ImGui::Checkbox("BV-O2-03", &(valveBool[10]));
305+
ImGui::Checkbox("BV-O2-04", &(valveBool[11]));
306+
ImGui::Checkbox("SV-O2-01", &(valveBool[12]));
307+
ImGui::EndTable();
308+
}
309+
}
310+
311+
void ipa_tank_panel() {
312+
if (ImGui::BeginTable("ipa_tank_table", 1, ImGuiTableFlags_Resizable)) {
313+
ImGui::TableNextColumn();
314+
ImGui::Checkbox("BV-FU-01", &(valveBool[13]));
315+
ImGui::Checkbox("BV-FU-02", &(valveBool[14]));
316+
ImGui::EndTable();
317+
}
318+
}
319+
320+
void ipa_piping_panel() {
321+
if (ImGui::BeginTable("ipa_piping_table", 1, ImGuiTableFlags_Resizable)) {
322+
ImGui::TableNextColumn();
323+
ImGui::Checkbox("BV-FU-03", &(valveBool[15]));
324+
ImGui::Checkbox("BV-FU-04", &(valveBool[16]));
325+
ImGui::Checkbox("SV-FU-01", &(valveBool[17]));
326+
ImGui::EndTable();
327+
}
328+
}
263329

264330
void ground_control_panel() {
265331
if (ImGui::BeginTable("controls_table", 4, ImGuiTableFlags_Resizable)) {
266332
ImU32 activeCol = ImGui::ColorConvertFloat4ToU32(ImVec4(8.0 / 255.0, 255.0 / 255.0, 156.0 / 255.0, 1.0f));
267333
ImU32 deactiveCol = ImGui::ColorConvertFloat4ToU32(ImVec4(204.0 / 255.0, 0.0f, 0.0f, 1.0f));
268334

269-
ImGui::TableNextColumn();
270-
ImGui::BeginChild("COPV_Manifold_subpanel", ImVec2(0, 0), true);
271-
ImGui::PushFont(panel_header_font);
272-
ImGui::SeparatorText("COPV Manifold");
273-
ImGui::Checkbox("Open Valve 1 ", &thrusterBool);
274-
ImGui::PopFont();
275-
276-
ImGui::EndChild();
335+
panel("COPV Panel", ImVec2(0, 0), copv_panel);
277336

278337
ImGui::BeginChild("low_pressure_subpanel", ImVec2(0, 300), true);
279338
ImGui::PushFont(panel_header_font);
@@ -283,31 +342,19 @@ void ground_control_panel() {
283342

284343
ImGui::TableNextColumn();
285344

286-
ImGui::BeginChild("tank_rcs_subpanel", ImVec2(0, 300), true);
287-
ImGui::PushFont(panel_header_font);
288-
ImGui::SeparatorText("Tank set & RCS Circuit");
289-
ImGui::PopFont();
290-
ImGui::EndChild();
345+
panel("Tank set & RCS circuit", ImVec2(0, 300), tank_rcs_panel);
291346

292-
ImGui::BeginChild("purge_circuit_subpanel", ImVec2(0, 300), true);
293-
ImGui::PushFont(panel_header_font);
294-
ImGui::SeparatorText("Purge Circuit");
295-
ImGui::PopFont();
296-
ImGui::EndChild();
347+
panel("Purge Circuit", ImVec2(0, 300), purge_circuit_panel);
297348

298349
ImGui::TableNextColumn();
299-
ImGui::BeginChild("liquid_oxygen_subpanel", ImVec2(0, 0), true);
300-
ImGui::PushFont(panel_header_font);
301-
ImGui::SeparatorText("Liquid Oxygen Tank");
302-
ImGui::PopFont();
303-
ImGui::EndChild();
350+
panel("Liquid Oxygen Tank", ImVec2(0, 300), lox_tank_panel);
351+
352+
panel("Liquid Oxygen Piping", ImVec2(0, 300), lox_piping_panel);
304353

305354
ImGui::TableNextColumn();
306-
ImGui::BeginChild("Isopropyl Alcohol Tank", ImVec2(0, 0), true);
307-
ImGui::PushFont(panel_header_font);
308-
ImGui::SeparatorText("Isopropyl Alcohol Tank");
309-
ImGui::PopFont();
310-
ImGui::EndChild();
355+
panel("Isopropyl Alcohol Tank", ImVec2(0, 300), ipa_tank_panel);
356+
357+
panel("Isopropyl Alcohol Piping", ImVec2(0, 300), ipa_piping_panel);
311358

312359
ImGui::EndTable();
313360
}

0 commit comments

Comments
 (0)