|
@@ -3,6 +3,7 @@
|
|
|
#include <cstddef>
|
|
#include <cstddef>
|
|
|
#include <cstring>
|
|
#include <cstring>
|
|
|
#include <fmt/format.h>
|
|
#include <fmt/format.h>
|
|
|
|
|
+#include <iterator>
|
|
|
#include <memory>
|
|
#include <memory>
|
|
|
#include <span>
|
|
#include <span>
|
|
|
#include <sstream>
|
|
#include <sstream>
|
|
@@ -43,9 +44,133 @@ struct SandboxApp : AppBase {
|
|
|
ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove |
|
|
ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove |
|
|
|
ImGuiWindowFlags_NoFocusOnAppearing |
|
|
ImGuiWindowFlags_NoFocusOnAppearing |
|
|
|
ImGuiWindowFlags_NoSavedSettings);
|
|
ImGuiWindowFlags_NoSavedSettings);
|
|
|
|
|
+ ImGuiTableFlags flags =
|
|
|
|
|
+ ImGuiTableFlags_Resizable | ImGuiTableFlags_Borders |
|
|
|
|
|
+ ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_ScrollY;
|
|
|
|
|
+
|
|
|
|
|
+ ImGui::Text("Маркировка товаров");
|
|
|
|
|
+
|
|
|
|
|
+ // ===== Layout =====
|
|
|
|
|
+ struct FormLayout {
|
|
|
|
|
+ float label_w;
|
|
|
|
|
+ float field_w;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ FormLayout layout{
|
|
|
|
|
+ .label_w = 130.0f,
|
|
|
|
|
+ .field_w = 260.0f,
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // ===== Helpers =====
|
|
|
|
|
+ auto form_row = [&](const char *label, auto draw_field) {
|
|
|
|
|
+ ImGui::TextUnformatted(label);
|
|
|
|
|
+ ImGui::SameLine();
|
|
|
|
|
+ ImGui::SetCursorPosX(layout.label_w);
|
|
|
|
|
+ ImGui::SetNextItemWidth(layout.field_w);
|
|
|
|
|
+ draw_field();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // ===== Sizes =====
|
|
|
|
|
+ float row_h = ImGui::GetFrameHeightWithSpacing();
|
|
|
|
|
+ float top_height = row_h * 6.0f;
|
|
|
|
|
+
|
|
|
|
|
+ // ===== Top Left =====
|
|
|
|
|
+ ImGui::BeginChild("TopLeft", ImVec2(400, top_height), true);
|
|
|
|
|
+ {
|
|
|
|
|
+ form_row("Организация:", [&] {
|
|
|
|
|
+ if (ImGui::BeginCombo("##org", "Фламинго ООО"))
|
|
|
|
|
+ ImGui::EndCombo();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ form_row("Продукция:", [&] {
|
|
|
|
|
+ if (ImGui::BeginCombo("##prod", "Basic Premium - M 30 шт/уп"))
|
|
|
|
|
+ ImGui::EndCombo();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ form_row("Серия:", [&] {
|
|
|
|
|
+ if (ImGui::BeginCombo("##series", "53698677 до 11.01.31"))
|
|
|
|
|
+ ImGui::EndCombo();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ static char series_num[128] = "A-08";
|
|
|
|
|
+ form_row("Номер серии:", [&] {
|
|
|
|
|
+ ImGui::InputText("##series_num", series_num, sizeof(series_num));
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ static char batch_num[128] = "A-08";
|
|
|
|
|
+ form_row("Номер партии:", [&] {
|
|
|
|
|
+ ImGui::InputText("##batch_num", batch_num, sizeof(batch_num));
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ ImGui::EndChild();
|
|
|
|
|
+
|
|
|
|
|
+ // ===== Top Right =====
|
|
|
|
|
+ ImGui::SameLine();
|
|
|
|
|
+ ImGui::BeginChild("TopRight", ImVec2(0, top_height), true);
|
|
|
|
|
+ {
|
|
|
|
|
+ static int box_count = 4;
|
|
|
|
|
+ form_row("Кол-во в коробке:",
|
|
|
|
|
+ [&] { ImGui::InputInt("##box", &box_count); });
|
|
|
|
|
+
|
|
|
|
|
+ static int pallet_count = 18;
|
|
|
|
|
+ form_row("Кол-во в паллете:",
|
|
|
|
|
+ [&] { ImGui::InputInt("##pallet", &pallet_count); });
|
|
|
|
|
+
|
|
|
|
|
+ static char prod_date[64] = "11.01.2026";
|
|
|
|
|
+ form_row("Дата произв.:", [&] {
|
|
|
|
|
+ ImGui::InputText("##prod_date", prod_date, sizeof(prod_date));
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ static char exp_date[64] = "11.01.2031";
|
|
|
|
|
+ form_row("Срок годн.:", [&] {
|
|
|
|
|
+ ImGui::InputText("##exp_date", exp_date, sizeof(exp_date));
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ ImGui::EndChild();
|
|
|
|
|
+
|
|
|
|
|
+ if (ImGui::BeginTabBar("Tabs")) {
|
|
|
|
|
+ if (ImGui::BeginTabItem("Сканирование")) {
|
|
|
|
|
+ if (ImGui::BeginTable("DataTable", 2, flags)) {
|
|
|
|
|
+ ImGui::TableSetupColumn("#");
|
|
|
|
|
+ ImGui::TableSetupColumn("Упаковка");
|
|
|
|
|
+ ImGui::TableHeadersRow();
|
|
|
|
|
+
|
|
|
|
|
+ int32_t selected_row_idx = -1;
|
|
|
|
|
+ for (size_t idx = 0; idx < 3; idx++) {
|
|
|
|
|
+ ImGui::TableNextRow();
|
|
|
|
|
+
|
|
|
|
|
+ ImGui::TableNextColumn();
|
|
|
|
|
+ ImGui::Text("%03d", (int)idx + 1);
|
|
|
|
|
+
|
|
|
|
|
+ ImGui::TableNextColumn();
|
|
|
|
|
+ ImGui::Text(
|
|
|
|
|
+ "0104650098830926215Roc(yep49_q291EE1192NB7hBGPH9j2lRWm57z2+"
|
|
|
|
|
+ "YygvLInYURU8/6I/luU1Xj0=");
|
|
|
|
|
+ }
|
|
|
|
|
+ ImGui::EndTable();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ImGui::EndTabItem();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (ImGui::BeginTabItem("Упаковки")) {
|
|
|
|
|
+ ImGui::EndTabItem();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (ImGui::BeginTabItem("Коробки")) {
|
|
|
|
|
+ ImGui::EndTabItem();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (ImGui::BeginTabItem("Паллеты")) {
|
|
|
|
|
+ ImGui::EndTabItem();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ImGui::EndTabBar();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
ImGui::End();
|
|
ImGui::End();
|
|
|
|
|
|
|
|
- ImGui::ShowDemoWindow();
|
|
|
|
|
|
|
+ // ImGui::ShowDemoWindow();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void stop() override { spdlog::info("Sandbox stop!"); }
|
|
void stop() override { spdlog::info("Sandbox stop!"); }
|