Skip to content

Commit

Permalink
Measurement as name of saved file testing
Browse files Browse the repository at this point in the history
  • Loading branch information
AKMaily committed Sep 20, 2024
1 parent 09c7bfb commit e26a5c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
17 changes: 9 additions & 8 deletions src/look_up_saves.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@ inline std::string getSubdirectoriesInFolder(nlohmann::json language,
vins[i] = strdup(subdirectories[i].c_str());

if (isTxtInptFieldsEmpty) {
const std::string newcar = appLanguage[Key::New_Car];
ImGui::InputText(appLanguage[Key::Measurement], scantype, 255);
ImGui::Separator();
ImGui::NewLine();
ImGui::Text(appLanguage[Key::Additional_Information]);
ImGui::NewLine();


const std::string newcar = appLanguage[Key::New_Car];

ImGui::Combo(appLanguage[Key::Known_Car], &selectedOption, vins,
static_cast<int>(subdirectories.size()));

ImGui::InputText(appLanguage[Key::Measurement], scantype, 255);
if (selectedOption == 0) {
ImGui::InputText("Fin/Vin", inputvin, 19,
ImGuiInputTextFlags_CharsUppercase |
Expand All @@ -56,6 +57,10 @@ inline std::string getSubdirectoriesInFolder(nlohmann::json language,

// Using vins (char* array) with ImGui
}else {
ImGui::InputText(appLanguage[Key::Measurement], scantype, 255);
ImGui::Separator();
ImGui::Text(appLanguage[Key::Additional_Information]);
ImGui::NewLine();
ImGui::Combo(appLanguage[Key::Known_Car], &selectedOption, vins,
static_cast<int>(subdirectories.size()));

Expand All @@ -65,11 +70,7 @@ inline std::string getSubdirectoriesInFolder(nlohmann::json language,
}
static char VIN[18];
const std::string newcar = appLanguage[Key::New_Car];

ImGui::Separator();
ImGui::Text(appLanguage[Key::Additional_Information]);
ImGui::NewLine();
ImGui::InputText(appLanguage[Key::Measurement], scantype, 255);

ImGui::InputText(appLanguage[Key::Mileage], mileage, 10);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/saves_popup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ void saves_popup(nlohmann::json const &config, nlohmann::json const &language,
// ############# End popup

// make a .csv file name
auto mkFileName = [&](const std::string &name) {
auto mkFileName = [&](const std::string &name, const std::string &measurement) {
now = std::chrono::system_clock::now();
now_time_t = std::chrono::system_clock::to_time_t(now);
now_tm = *std::gmtime(&now_time_t);
std::string filename{fmt::format("{}-{:%Y-%m-%dT%H-%M}.csv", name, now)};
std::string filename{fmt::format("{}-{}-{:%Y-%m-%dT%H-%M}.csv", name, measurement, now)};
return filename;
};

Expand Down Expand Up @@ -240,7 +240,7 @@ void saves_popup(nlohmann::json const &config, nlohmann::json const &language,
// measurement saving preparation if device is checked
if (dvcCheckedArr[i].b) {
fs::path path;
auto filename = mkFileName(fmt::format("device{}", i + 1));
auto filename = mkFileName(fmt::format("device{}", i + 1), scantype);
if (hasSelectedPathArr[i].b) {
path = mkdir(true, selectedPathArr[i], "", filename);
hasSelectedPathArr[i].b = false;
Expand Down

0 comments on commit e26a5c0

Please sign in to comment.