Skip to content

Commit 6cbe3bb

Browse files
committed
add rect over updated text in hovered list view
add settings for that in hovered list view
1 parent 2ac3c83 commit 6cbe3bb

23 files changed

+136
-81
lines changed

.clang-format

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ BasedOnStyle: Google
22
Language: Cpp
33
Standard: Latest
44
AccessModifierOffset: -4
5-
AlignAfterOpenBracket: Align
5+
AlignAfterOpenBracket: AlwaysBreak
66
AlignConsecutiveAssignments: false
77
AlignConsecutiveDeclarations: false
88
AlignEscapedNewlines: Left
99
AlignOperands: false
10-
AlignTrailingComments: true
10+
AlignTrailingComments: false
1111
AllowAllParametersOfDeclarationOnNextLine: false
1212
AllowShortBlocksOnASingleLine: false
1313
AllowShortCaseLabelsOnASingleLine: true
@@ -16,7 +16,7 @@ AllowShortIfStatementsOnASingleLine: false
1616
AllowShortLoopsOnASingleLine: false
1717
AlwaysBreakAfterDefinitionReturnType: None
1818
AlwaysBreakAfterReturnType: None
19-
AlwaysBreakBeforeMultilineStrings: true
19+
AlwaysBreakBeforeMultilineStrings: false
2020
AlwaysBreakTemplateDeclarations: Yes
2121
BinPackArguments: false
2222
BinPackParameters: false
@@ -96,10 +96,10 @@ ObjCBlockIndentWidth: 2
9696
ObjCSpaceAfterProperty: false
9797
ObjCSpaceBeforeProtocolList: true
9898
PenaltyBreakAssignment: 2
99-
PenaltyBreakBeforeFirstCallParameter: 1
99+
PenaltyBreakBeforeFirstCallParameter: 100
100100
PenaltyBreakComment: 200
101101
PenaltyBreakFirstLessLess: 120
102-
PenaltyBreakString: 200
102+
PenaltyBreakString: 1000
103103
PenaltyBreakTemplateDeclaration: 10
104104
PenaltyExcessCharacter: 1000000
105105
PenaltyReturnTypeOnItsOwnLine: 200

3rdparty/iagp

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
LogToGraph_Windows_Debug_x64_v0.3.3583
1+
LogToGraph_Windows_Release_x64_v0.3.3583
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#define LuaScripting_Prefix "LuaScripting"
4-
#define LuaScripting_BuildNumber 327
4+
#define LuaScripting_BuildNumber 331
55
#define LuaScripting_MinorNumber 1
66
#define LuaScripting_MajorNumber 0
7-
#define LuaScripting_BuildId "0.1.327"
7+
#define LuaScripting_BuildId "0.1.331"

src/backend/MainBackend.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ bool MainBackend::IsNeedToCloseApp() {
164164
return m_NeedToCloseApp;
165165
}
166166

167-
void MainBackend::NeedToCloseApp(const bool& vFlag) {
167+
void MainBackend::NeedToCloseApp(const bool vFlag) {
168168
m_NeedToCloseApp = vFlag;
169169
}
170170

@@ -200,7 +200,7 @@ int MainBackend::GetMouseButton(int vButton) {
200200
//// CONSOLE ///////////////////////////////////////////////////////////////////////////////////////////////
201201
////////////////////////////////////////////////////////////////////////////////////////////////////////////
202202

203-
void MainBackend::SetConsoleVisibility(const bool& vFlag) {
203+
void MainBackend::SetConsoleVisibility(const bool vFlag) {
204204
m_ConsoleVisiblity = vFlag;
205205

206206
if (m_ConsoleVisiblity) {

src/backend/MainBackend.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class MainBackend : public ez::xml::Config {
6464
void PostRenderingActions();
6565

6666
bool IsNeedToCloseApp();
67-
void NeedToCloseApp(const bool& vFlag = true);
67+
void NeedToCloseApp(const bool vFlag = true);
6868
void CloseApp();
6969

7070
void setAppTitle(const std::string& vFilePathName = {});
@@ -78,7 +78,7 @@ class MainBackend : public ez::xml::Config {
7878
ez::xml::Nodes getXmlNodes(const std::string& vUserDatas = "") final;
7979
bool setFromXmlNodes(const ez::xml::Node& vNode, const ez::xml::Node& vParent, const std::string& vUserDatas) final;
8080

81-
void SetConsoleVisibility(const bool& vFlag);
81+
void SetConsoleVisibility(const bool vFlag);
8282
void SwitchConsoleVisibility();
8383
bool GetConsoleVisibility();
8484

src/headers/DatasDef.h

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <ImGuiPack.h>
1414
#include <ezlibs/ezTools.hpp>
1515
#include <ezlibs/ezXmlConfig.hpp>
16+
#include <ezlibs/ezCnt.hpp>
1617

1718
#define declareMember(type, var, def) \
1819
private: \
@@ -82,6 +83,9 @@ typedef std::vector<SignalTickPtr>& SignalTicksContainerRef;
8283
typedef std::vector<SignalTickWeak> SignalTicksWeakContainer;
8384
typedef std::vector<SignalTickWeak>& SignalTicksWeakContainerRef;
8485

86+
typedef ez::cnt::DicoVector<SignalName, SignalTickWeak> SignalTicksWeakPreviewContainer;
87+
typedef ez::cnt::DicoVector<SignalName, SignalTickWeak>& SignalTicksWeakPreviewContainerRef;
88+
8589
typedef std::vector<std::pair<SignalTickWeak, SignalTickWeak>> SignalDiffWeakContainer;
8690
typedef std::vector<std::pair<SignalTickWeak, SignalTickWeak>>& SignalDiffWeakContainerRef;
8791

src/headers/LogToGraphBuild.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#define LogToGraph_Prefix "LogToGraph"
4-
#define LogToGraph_BuildNumber 3583
4+
#define LogToGraph_BuildNumber 3595
55
#define LogToGraph_MinorNumber 3
66
#define LogToGraph_MajorNumber 0
7-
#define LogToGraph_BuildId "0.3.3583"
7+
#define LogToGraph_BuildId "0.3.3595"

src/models/graphs/GraphView.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ void GraphView::prEraseGroupAt(const size_t& vIdx) {
377377
}
378378
}
379379

380-
bool GraphView::prBeginPlot(const std::string& vLabel, ez::dvec2 vRangeValue, const ImVec2& vSize, const bool& vFirstGraph) const {
380+
bool GraphView::prBeginPlot(const std::string& vLabel, ez::dvec2 vRangeValue, const ImVec2& vSize, const bool vFirstGraph) const {
381381
const auto& time_range = LogEngine::Instance()->GetTicksTimeSerieRange();
382382
if (ImPlot::BeginPlot(vLabel.c_str(), vSize, ImPlotFlags_NoChild | ImPlotFlags_NoTitle)) {
383383
if (m_need_show_hide_x_axis) {
@@ -487,7 +487,7 @@ static bool ImPLotHoveredLineX(int n_id, double* value, const ImVec4& col, float
487487
return hovered;
488488
}
489489

490-
void GraphView::prEndPlot(const bool& vFirstGraph) {
490+
void GraphView::prEndPlot(const bool vFirstGraph) {
491491
// draw diff first marks
492492
auto first_mark = ProjectFile::Instance()->m_DiffFirstMark;
493493
if (first_mark > 0.0) {
@@ -533,7 +533,7 @@ void GraphView::prEndPlot(const bool& vFirstGraph) {
533533
ImPlot::EndPlot();
534534
}
535535

536-
void GraphView::prDrawSignalGraph_ImPlot(const SignalSerieWeak& vSignalSerie, const ImVec2& vSize, const bool& vFirstGraph) {
536+
void GraphView::prDrawSignalGraph_ImPlot(const SignalSerieWeak& vSignalSerie, const ImVec2& vSize, const bool vFirstGraph) {
537537
auto datas_ptr = vSignalSerie.lock();
538538
if (datas_ptr && datas_ptr->show_hide_temporary) {
539539
ImDrawList* draw_list = ImPlot::GetPlotDrawList();
@@ -600,7 +600,7 @@ void GraphView::prDrawSignalGraph_ImPlot(const SignalSerieWeak& vSignalSerie, co
600600

601601
value_pos = ImPlot::PlotToPixels(current_point);
602602

603-
const bool& _is_hovered = (ImPlot::IsPlotHovered() && hovered_time >= last_time && hovered_time <= current_time);
603+
const bool _is_hovered = (ImPlot::IsPlotHovered() && hovered_time >= last_time && hovered_time <= current_time);
604604
const ImU32& _color = _is_hovered ? _GraphMouseHoveredTimeColor : datas_ptr->color_u32;
605605

606606
if (last_string.empty()) {
@@ -832,7 +832,7 @@ void GraphView::DrawGroupedGraphs(const GraphGroupPtr& vGraphGroupPtr, const ImV
832832

833833
ImPlot::FitPoint(ImPlotPoint(current_time, current_value));
834834

835-
const bool& _is_v_hovered = (ImPlot::IsPlotHovered() && hovered_time >= last_time && hovered_time <= current_time);
835+
const bool _is_v_hovered = (ImPlot::IsPlotHovered() && hovered_time >= last_time && hovered_time <= current_time);
836836
ImU32 _color = datas_ptr->color_u32;
837837

838838
if (last_string.empty()) {

src/models/graphs/GraphView.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ class GraphView {
6262
void RemoveEmptyGroups();
6363

6464
void prEraseGroupAt(const size_t& vIdx);
65-
void prDrawSignalGraph_ImPlot(const SignalSerieWeak& vSignalSerie, const ImVec2& vSize, const bool& vFirstGraph);
65+
void prDrawSignalGraph_ImPlot(const SignalSerieWeak& vSignalSerie, const ImVec2& vSize, const bool vFirstGraph);
6666

67-
bool prBeginPlot(const std::string& vLabel, ez::dvec2 vRangeValue, const ImVec2& vSize, const bool& vFirstGraph) const;
68-
static void prEndPlot(const bool& vFirstGraph);
67+
bool prBeginPlot(const std::string& vLabel, ez::dvec2 vRangeValue, const ImVec2& vSize, const bool vFirstGraph) const;
68+
static void prEndPlot(const bool vFirstGraph);
6969

7070
public: // singleton
7171
static std::shared_ptr<GraphView> Instance() {

src/models/log/LogEngine.cpp

+38-28
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ void LogEngine::ShowHideSignal(const SignalCategory& vCategory, const SignalName
324324
}
325325
}
326326

327-
void LogEngine::ShowHideSignal(const SignalCategory& vCategory, const SignalName& vName, const bool& vFlag) {
327+
void LogEngine::ShowHideSignal(const SignalCategory& vCategory, const SignalName& vName, const bool vFlag) {
328328
if (m_SignalSeries.find(vCategory) != m_SignalSeries.end()) {
329329
auto& cat = m_SignalSeries.at(vCategory);
330330
if (cat.find(vName) != cat.end()) {
@@ -387,35 +387,45 @@ SignalSeriesContainerRef LogEngine::GetSignalSeries() {
387387
return m_SignalSeries;
388388
}
389389

390-
void LogEngine::SetHoveredTime(const SignalEpochTime& vHoveredTime) {
391-
m_HoveredTime = vHoveredTime;
392-
ProjectFile::Instance()->SetProjectChange();
393-
m_PreviewTicks.clear();
394-
m_PreviewTicks.reserve(m_SignalsCount);
395-
size_t visible_idx = 0U;
396-
for (auto& item_cat : m_SignalSeries) {
397-
for (auto& item_name : item_cat.second) {
398-
if (item_name.second) {
399-
if (ProjectFile::Instance()->m_ShowVariableSignalsInHoveredListView && item_name.second->isConstant()) {
400-
continue;
401-
}
402-
SignalTickPtr last_ptr = nullptr;
403-
for (const auto& tick_weak : item_name.second->datas_values) {
404-
auto ptr = tick_weak.lock();
405-
if (last_ptr && vHoveredTime >= last_ptr->time_epoch && ptr && vHoveredTime <= ptr->time_epoch) {
406-
m_PreviewTicks.push_back(last_ptr);
407-
if (ProjectFile::Instance()->m_AutoColorize) {
408-
auto parent_ptr = last_ptr->parent.lock();
409-
if (parent_ptr && parent_ptr->show) {
410-
parent_ptr->color_u32 = ImGui::GetColorU32(GraphView::GetRainBow((int32_t)visible_idx, m_VisibleCount));
411-
parent_ptr->color_v4 = ImGui::ColorConvertU32ToFloat4(parent_ptr->color_u32);
412-
413-
++visible_idx;
390+
void LogEngine::SetHoveredTime(const SignalEpochTime& vHoveredTime, const bool vForce) {
391+
if (vForce || m_HoveredTime != vHoveredTime) {
392+
m_HoveredTime = vHoveredTime;
393+
ProjectFile::Instance()->SetProjectChange();
394+
auto last_previewed_ticks = m_PreviewTicks;
395+
m_PreviewTicks.clear();
396+
m_PreviewTicks.reserve(m_SignalsCount);
397+
size_t visible_idx = 0U;
398+
for (auto& item_cat : m_SignalSeries) {
399+
for (auto& item_name : item_cat.second) {
400+
if (item_name.second) {
401+
if (ProjectFile::Instance()->m_ShowVariableSignalsInHoveredListView && item_name.second->isConstant()) {
402+
continue;
403+
}
404+
SignalTickPtr last_ptr = nullptr;
405+
for (const auto& tick_weak : item_name.second->datas_values) {
406+
auto ptr = tick_weak.lock();
407+
if (last_ptr && vHoveredTime >= last_ptr->time_epoch && ptr != nullptr && vHoveredTime <= ptr->time_epoch) {
408+
if (m_PreviewTicks.tryAdd(item_name.second->name, last_ptr)) {
409+
if (ProjectFile::Instance()->m_AutoColorize) {
410+
auto parent_ptr = last_ptr->parent.lock();
411+
if (parent_ptr && parent_ptr->show) {
412+
parent_ptr->color_u32 = ImGui::GetColorU32(GraphView::GetRainBow((int32_t)visible_idx, m_VisibleCount));
413+
parent_ptr->color_v4 = ImGui::ColorConvertU32ToFloat4(parent_ptr->color_u32);
414+
415+
++visible_idx;
416+
}
417+
}
418+
if (last_previewed_ticks.exist(item_name.second->name)) {
419+
auto last_previewed_tick_ptr = last_previewed_ticks.value(item_name.second->name).lock();
420+
if (last_previewed_tick_ptr != nullptr) {
421+
last_ptr->just_changed = ez::isDifferent(last_previewed_tick_ptr->value, last_ptr->value);
422+
}
423+
}
414424
}
425+
break;
415426
}
416-
break;
427+
last_ptr = ptr;
417428
}
418-
last_ptr = ptr;
419429
}
420430
}
421431
}
@@ -452,7 +462,7 @@ void LogEngine::UpdateVisibleSignalsColoring() {
452462
}
453463
}
454464

455-
SignalTicksWeakContainerRef LogEngine::GetPreviewTicks() {
465+
SignalTicksWeakPreviewContainerRef LogEngine::GetPreviewTicks() {
456466
return m_PreviewTicks;
457467
}
458468

src/models/log/LogEngine.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class LogEngine : public ez::xml::Config {
6767
std::unordered_map<SignalName, std::unordered_map<SignalCategory, SignalSetting>> m_SignalSettings;
6868

6969
// hovered preview ticks
70-
SignalTicksWeakContainer m_PreviewTicks;
70+
SignalTicksWeakPreviewContainer m_PreviewTicks;
7171

7272
// diff check
7373
SignalTicksWeakContainer m_DiffFirstTicks; // first mark container
@@ -97,7 +97,7 @@ class LogEngine : public ez::xml::Config {
9797

9898
// iter SignalDatasContainer
9999
void ShowHideSignal(const SignalCategory& vCategory, const SignalName& vName);
100-
void ShowHideSignal(const SignalCategory& vCategory, const SignalName& vName, const bool& vFlag);
100+
void ShowHideSignal(const SignalCategory& vCategory, const SignalName& vName, const bool vFlag);
101101
bool isSignalShown(const SignalCategory& vCategory, const SignalName& vName, SignalColor* vOutColorPtr = nullptr);
102102

103103
SourceFilesContainerRef GetSourceFiles();
@@ -106,12 +106,12 @@ class LogEngine : public ez::xml::Config {
106106
SignalTagsContainerRef GetSignalTags();
107107
SignalSeriesContainerRef GetSignalSeries();
108108

109-
void SetHoveredTime(const SignalEpochTime& vSignalEpochTime);
109+
void SetHoveredTime(const SignalEpochTime& vSignalEpochTime, const bool vForce = false);
110110
double GetHoveredTime() const;
111111

112112
void UpdateVisibleSignalsColoring();
113113

114-
SignalTicksWeakContainerRef GetPreviewTicks();
114+
SignalTicksWeakPreviewContainerRef GetPreviewTicks();
115115

116116
void PrepareForSave();
117117
void PrepareAfterLoad();

src/models/log/SignalSerie.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ SignalSeriePtr SignalSerie::Create() {
2828
return res;
2929
}
3030

31-
void SignalSerie::insertTick(const SignalTickWeak& vTick, const size_t& vIdx, const bool& vIncBaseRecordsCount) {
31+
void SignalSerie::insertTick(const SignalTickWeak& vTick, const size_t& vIdx, const bool vIncBaseRecordsCount) {
3232
if (vIdx < datas_values.size()) {
3333
auto ptr = vTick.lock();
3434
if (ptr) {
@@ -45,7 +45,7 @@ void SignalSerie::insertTick(const SignalTickWeak& vTick, const size_t& vIdx, co
4545
}
4646
}
4747

48-
void SignalSerie::addTick(const SignalTickWeak& vTick, const bool& vIncBaseRecordsCount) {
48+
void SignalSerie::addTick(const SignalTickWeak& vTick, const bool vIncBaseRecordsCount) {
4949
auto ptr = vTick.lock();
5050
if (ptr) {
5151
ptr->parent = m_This;

src/models/log/SignalSerie.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ class SignalSerie {
5252
bool show = false; // signal must be shown on graph screen
5353

5454
public:
55-
void insertTick(const SignalTickWeak& vTick, const size_t& vIdx, const bool& vIncBaseRecordsCount = false);
56-
void addTick(const SignalTickWeak& vTick, const bool& vIncBaseRecordsCount = false);
55+
void insertTick(const SignalTickWeak& vTick, const size_t& vIdx, const bool vIncBaseRecordsCount = false);
56+
void addTick(const SignalTickWeak& vTick, const bool vIncBaseRecordsCount = false);
5757

5858
void addGraphAnnotation(GraphAnnotationWeak vGraphAnnotation);
5959

src/models/log/SignalTick.h

+1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ class SignalTick {
4040
SignalStatus status;
4141
SignalDesc desc;
4242
SignalSerieWeak parent;
43+
bool just_changed = false; // for hovered list view
4344
};

src/models/script/ScriptingEngine.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ void ScriptingEngine::AddSignalStatus(const SignalCategory& vCategory,
241241
//// THREAD ///////////////////////////////////////////
242242
///////////////////////////////////////////////////////
243243

244-
void ScriptingEngine::StartWorkerThread(const bool& vFirstLoad) {
244+
void ScriptingEngine::StartWorkerThread(const bool vFirstLoad) {
245245
if (!StopWorkerThread()) {
246246
if (!vFirstLoad) {
247247
LogEngine::Instance()->PrepareForSave();

src/models/script/ScriptingEngine.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class ScriptingEngine : public Ltg::IDatasModel, public ez::xml::Config {
9292
const SignalString& vString,
9393
const SignalStatus& vStatus);
9494

95-
void StartWorkerThread(const bool& vFirstLoad);
95+
void StartWorkerThread(const bool vFirstLoad);
9696
bool StopWorkerThread();
9797
bool IsJoinable();
9898
void Join();

src/panes/GraphListPane.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ void GraphListPane::DrawTree() {
244244
}
245245

246246
void GraphListPane::PrepareLog(const std::string& vSearchString) {
247-
const bool& is_their_some_search = !vSearchString.empty();
247+
const bool is_their_some_search = !vSearchString.empty();
248248

249249
m_FilteredSignalSeries.clear();
250250

0 commit comments

Comments
 (0)