Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
aiekick committed Nov 30, 2024
1 parent 58d9434 commit b1be085
Show file tree
Hide file tree
Showing 27 changed files with 182 additions and 122 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
LogToGraph_Windows_Debug_x64_v0.2.979
LogToGraph_Windows_Debug_x64_v0.2.1026
2 changes: 1 addition & 1 deletion src/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "App.h"

#include <headers/LogToGraphBuild.h>
#include <Backend/MainBackend.h>
#include <backend/MainBackend.h>

#include <ezlibs/ezLog.hpp>

Expand Down
12 changes: 6 additions & 6 deletions src/backend/MainBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@
#include <algorithm> // std::min, std::max
#include <stdexcept> // std::exception

#include <Backend/MainBackend.h>
#include <backend/MainBackend.h>
#include <systems/PluginManager.h>
#include <Project/ProjectFile.h>
#include <project/ProjectFile.h>

#include <LayoutManager.h>

#include <ImGuiPack.h>
#include <iagp/iagp.h>

#include <Frontend/MainFrontend.h>
#include <frontend/MainFrontend.h>

#include <panes/ConsolePane.h>

#include <Systems/SettingsDialog.h>
#include <systems/SettingsDialog.h>

// we include the cpp just for embedded fonts
#include <Res/fontIcons.cpp>
#include <Res/Roboto_Medium.cpp>
#include <res/fontIcons.cpp>
#include <res/Roboto_Medium.cpp>

#include <filesystem>
namespace fs = std::filesystem;
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/ImGuiThemes.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <Frontend/MainFrontend.h>
#include <frontend/MainFrontend.h>

ImGuiTheme GetOrangeBlueTheme() {
ImGuiTheme res;
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/MainFrontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ limitations under the License.

#include "MainFrontend.h"

#include <Backend/MainBackend.h>
#include <backend/MainBackend.h>

#include <Project/ProjectFile.h>
#include <project/ProjectFile.h>

#include <systems/PluginManager.h>

Expand Down
4 changes: 2 additions & 2 deletions src/frontend/MainFrontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ limitations under the License.
#include <ImGuiPack.h>
#include <ezlibs/ezXmlConfig.hpp>

#include <Systems/FrameActionSystem.h>
#include <systems/FrameActionSystem.h>

#include <Backend/MainBackend.h>
#include <backend/MainBackend.h>

#include <functional>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion src/models/graphs/GraphAnnotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License.
#include "GraphAnnotation.h"

#include <models/log/SignalSerie.h>
#include <Project/ProjectFile.h>
#include <project/ProjectFile.h>
#include <chrono>

//////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/models/graphs/GraphView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ limitations under the License.
#include <models/log/SignalTick.h>
#include <models/log/SignalTag.h>

#include <Project/ProjectFile.h>
#include <project/ProjectFile.h>

#include <models/graphs/GraphGroup.h>

Expand Down
2 changes: 1 addition & 1 deletion src/models/log/LogEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ limitations under the License.
#include <panes/GraphListPane.h>
#include <panes/ToolPane.h>

#include <Project/ProjectFile.h>
#include <project/ProjectFile.h>

///////////////////////////////////////////////////
/// STATIC'S //////////////////////////////////////
Expand Down
107 changes: 107 additions & 0 deletions src/models/log/SignalTree.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#include <models/log/SignalTree.h>
#include <models/log/LogEngine.h>
#include <models/log/SignalSerie.h>
#include <ezlibs/ezStr.hpp>
#include <project/ProjectFile.h>
#include <panes/LogPane.h>

void SignalTree::clear() {
m_SignalSeries.clear();
m_SignalSeriesOld.clear();
}

void SignalTree::prepare(const std::string& vSearchString) {
searchPattern = vSearchString;
m_SignalSeries.clear();
m_SignalSeriesOld.clear();

for (auto& item_cat : LogEngine::Instance()->GetSignalSeries()) {
for (auto& item_name : item_cat.second) {
if (item_name.second) {
if (item_name.second->low_case_name_for_search.find(searchPattern) == std::string::npos) {
continue;
}
m_SignalSeriesOld[item_name.first] = item_name.second;
// const auto& arr = ez::str::splitStringToVector(item_name.first, "/");
// m_SignalSeries[item_name.first] = item_name.second;
}
}
}
}

void SignalTree::prepareRecurs(const std::string& vSearchString, const std::string& vName, const SignalSeriePtr& vSignalSeriePtr) {
if (!vName.empty() && vSignalSeriePtr != nullptr) {
/*if (vSignalSeriePtr->low_case_name_for_search.find(vSearchString) == std::string::npos) {
return
}*/
std::string base_name = vName;
size_t p = base_name.find('/');
if (p != std::string::npos) {
std::string name = base_name.substr(0, p);
std::string rest = base_name.substr(p + 1);
} else {

}
//const auto& arr = ez::str::splitStringToVector(vName, "/");
//m_SignalSeries[item_name.first] = item_name.second;
}
}

void SignalTree::displayTree(bool vCollapseAll, bool vExpandAll) {
if (!searchPattern.empty()) {
// if first frame is not built
if (m_SignalSeries.empty()) {
prepare(searchPattern);
}

ImGui::Indent();

// affichage ordonne sans les categorie
for (auto& item_name : m_SignalSeriesOld) {
displayItemRecurs(item_name.second);
}

ImGui::Unindent();
} else {
// affichage arborescent ordonne par categorie
for (auto& item_cat : LogEngine::Instance()->GetSignalSeries()) {
if (vCollapseAll) {
ImGui::SetNextItemOpen(false);
}

if (vExpandAll) {
ImGui::SetNextItemOpen(true);
}

auto cat_str = ez::str::toStr("%s (%u)", item_cat.first.c_str(), (uint32_t)item_cat.second.size());
if (ImGui::TreeNode(cat_str.c_str())) {
ImGui::Indent();

for (auto& item_name : item_cat.second) {
displayItemRecurs(item_name.second);
}

ImGui::Unindent();

ImGui::TreePop();
}
}
}
}

void SignalTree::displayItemRecurs(const SignalSerieWeak& vDatasSerie) {
if (!vDatasSerie.expired()) {
auto ptr = vDatasSerie.lock();
if (ptr) {
auto name_str = ez::str::toStr("%s (%u)", ptr->name.c_str(), (uint32_t)ptr->count_base_records);
if (ImGui::Selectable(name_str.c_str(), ptr->show)) {
ptr->show = !ptr->show;
LogEngine::Instance()->ShowHideSignal(ptr->category, ptr->name, ptr->show);
if (ProjectFile::Instance()->m_CollapseLogSelection) {
LogPane::Instance()->PrepareLog();
}
ProjectFile::Instance()->SetProjectChange();
}
}
}
}
27 changes: 27 additions & 0 deletions src/models/log/SignalTree.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#pragma once

#include <headers/DatasDef.h>
#include <string>
#include <map>

struct SignalItem {
SignalName name;
SignalSerieWeak signal;
std::map<SignalName, SignalItem> items;
};

class SignalTree {
private:
std::string searchPattern;
std::map<SignalName, SignalItem> m_SignalSeries;
std::map<SignalName, SignalSerieWeak> m_SignalSeriesOld;

public:
void clear();
void prepare(const std::string& vSearchString);
void displayTree(bool vCollapseAll, bool vExpandAll);

private:
void prepareRecurs(const std::string& vSearchString, const std::string& vName, const SignalSeriePtr& vSignalSeriePtr);
void displayItemRecurs(const SignalSerieWeak& vDatasSerie);
};
14 changes: 8 additions & 6 deletions src/models/script/ScriptingEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ limitations under the License.
#include <panes/LogPaneSecondView.h>

#include <models/database/DataBase.h>
#include <Project/ProjectFile.h>
#include <project/ProjectFile.h>

#include <panes/ToolPane.h>
#include <panes/LogPane.h>
Expand Down Expand Up @@ -328,7 +328,7 @@ void ScriptingEngine::addSignalStatus(const std::string& vCategory, const std::s
LogVarLightError("%s", "Lua code error : the category passed to addSignalStatus is empty");
}
if (vName.empty()) {
LogVarLightError("%s", "Lua code error : the category passed to addSignalStatus is empty");
LogVarLightError("%s", "Lua code error : the name passed to addSignalStatus is empty");
}
return;
}
Expand All @@ -338,10 +338,12 @@ void ScriptingEngine::addSignalStatus(const std::string& vCategory, const std::s
void ScriptingEngine::addSignalValue(const std::string& vCategory, const std::string& vName, double vEpoch, double vValue, const std::string& vDesc) {
if (vCategory.empty() || vName.empty()) {
if (vCategory.empty()) {
LogVarLightError("%s", "Lua code error : the category passed to AddSignalValue is empty");
LogVarLightError("Lua code error : the category passed to addSignalValue(%s,%s,%f,%f,%s) is empty", //
vCategory.c_str(), vName.c_str(), vEpoch, vValue, vDesc.c_str());
}
if (vName.empty()) {
LogVarLightError("%s", "Lua code error : the category passed to AddSignalValue is empty");
LogVarLightError("Lua code error : the name passed to addSignalValue(%s,%s,%f,%f,%s) is empty", //
vCategory.c_str(), vName.c_str(), vEpoch, vValue, vDesc.c_str());
}
return;
}
Expand All @@ -354,7 +356,7 @@ void ScriptingEngine::addSignalStartZone(const std::string& vCategory, const std
LogVarLightError("%s", "Lua code error : the category passed to addSignalStartZone is empty");
}
if (vName.empty()) {
LogVarLightError("%s", "Lua code error : the category passed to addSignalStartZone is empty");
LogVarLightError("%s", "Lua code error : the name passed to addSignalStartZone is empty");
}
return;
}
Expand All @@ -367,7 +369,7 @@ void ScriptingEngine::addSignalEndZone(const std::string& vCategory, const std::
LogVarLightError("%s", "Lua code error : the category passed to addSignalEndZone is empty");
}
if (vName.empty()) {
LogVarLightError("%s", "Lua code error : the category passed to addSignalEndZone is empty");
LogVarLightError("%s", "Lua code error : the name passed to addSignalEndZone is empty");
}
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/panes/AnnotationPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License.
#include "AnnotationPane.h"
#include <ezlibs/ezLog.hpp>

#include <Project/ProjectFile.h>
#include <project/ProjectFile.h>
#include <cinttypes> // printf zu
#include <models/graphs/GraphAnnotationModel.h>
#include <models/graphs/GraphAnnotation.h>
Expand Down
2 changes: 1 addition & 1 deletion src/panes/GraphGroupPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

#include "GraphGroupPane.h"
#include <Project/ProjectFile.h>
#include <project/ProjectFile.h>

#include <cinttypes> // printf zu
#include <panes/LogPane.h>
Expand Down
2 changes: 1 addition & 1 deletion src/panes/GraphListPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

#include "GraphListPane.h"
#include <Project/ProjectFile.h>
#include <project/ProjectFile.h>
#include <cinttypes> // printf zu
#include <panes/LogPane.h>
#include <panes/CodePane.h>
Expand Down
2 changes: 1 addition & 1 deletion src/panes/GraphPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

#include "GraphPane.h"
#include <Project/ProjectFile.h>
#include <project/ProjectFile.h>
#include <cinttypes> // printf zu
#include <models/graphs/GraphView.h>
#include <models/graphs/GraphGroup.h>
Expand Down
2 changes: 1 addition & 1 deletion src/panes/LogPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ limitations under the License.
#include <panes/ToolPane.h>
#include <panes/SignalsHoveredMap.h>
#include <panes/GraphGroupPane.h>
#include <Project/ProjectFile.h>
#include <project/ProjectFile.h>
#include <cinttypes> // printf zu

#include <models/log/LogEngine.h>
Expand Down
2 changes: 1 addition & 1 deletion src/panes/LogPaneSecondView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License.
#include "LogPaneSecondView.h"
#include <panes/ToolPane.h>
#include <panes/GraphListPane.h>
#include <Project/ProjectFile.h>
#include <project/ProjectFile.h>
#include <cinttypes> // printf zu

#include <models/log/LogEngine.h>
Expand Down
2 changes: 1 addition & 1 deletion src/panes/SignalsHoveredDiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

#include "SignalsHoveredDiff.h"
#include <Project/ProjectFile.h>
#include <project/ProjectFile.h>
#include <cinttypes> // printf zu
#include <panes/CodePane.h>

Expand Down
2 changes: 1 addition & 1 deletion src/panes/SignalsHoveredList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

#include "SignalsHoveredList.h"
#include <Project/ProjectFile.h>
#include <project/ProjectFile.h>
#include <cinttypes> // printf zu
#include <panes/CodePane.h>

Expand Down
2 changes: 1 addition & 1 deletion src/panes/SignalsHoveredMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

#include "SignalsHoveredMap.h"
#include <Project/ProjectFile.h>
#include <project/ProjectFile.h>
#include <cinttypes> // printf zu
#include <panes/CodePane.h>

Expand Down
4 changes: 2 additions & 2 deletions src/panes/SignalsPreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ limitations under the License.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

#include "SignalsPreview.h"
#include <Project/ProjectFile.h>
#include <Project/ProjectFile.h>
#include <project/ProjectFile.h>
#include <project/ProjectFile.h>
#include <cinttypes> // printf zu
#include <panes/LogPane.h>
#include <panes/CodePane.h>
Expand Down
Loading

0 comments on commit b1be085

Please sign in to comment.