@@ -52,6 +52,10 @@ bool LogPaneSecondView::DrawPanes(const uint32_t& /*vCurrentFrame*/, bool* vOpen
52
52
flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar;
53
53
#endif
54
54
if (ProjectFile::Instance ()->IsProjectLoaded ()) {
55
+ if (ImGui::BeginMenuBar ()) {
56
+ DrawMenuBar ();
57
+ ImGui::EndMenuBar ();
58
+ }
55
59
DrawTable ();
56
60
}
57
61
}
@@ -98,39 +102,48 @@ void LogPaneSecondView::CheckItem(const SignalTickPtr& vSignalTick) {
98
102
}
99
103
}
100
104
101
- void LogPaneSecondView::DrawTable () {
102
- if ( ImGui::BeginMenuBar ()) {
103
- bool need_update = ImGui::Checkbox ( " Collapse Selection " , & ProjectFile::Instance ()-> m_CollapseLogSelection );
104
- need_update |= ImGui::Checkbox ( " Hide some values " , &ProjectFile::Instance ()->m_HideSomeValues );
105
-
106
- if ( ProjectFile::Instance ()-> m_HideSomeValues ) {
107
- ImGui::Text ( " (?) " );
108
- if (ImGui::IsItemHovered ( )) {
109
- ImGui::SetTooltip ( " %s " , " you can define many values, ex : 1,2,3.2,5.8 " ) ;
110
- }
111
-
112
- if ( ImGui::ContrastedButton ( " R##ResetLogPaneSecondViewTable " )) {
113
- ProjectFile::Instance ()-> m_ValuesToHide . clear ();
114
- need_update = true ;
115
- }
105
+ void LogPaneSecondView::DrawMenuBar () {
106
+ bool need_update = false ;
107
+ if ( ImGui::BeginMenu ( " Settings " )) {
108
+ if ( ImGui::MenuItem ( " Show variable signals only " , nullptr , &ProjectFile::Instance ()->m_ShowVariableSignalsInLog2ndView )) {
109
+ LogEngine::Instance ()-> SetHoveredTime ( LogEngine::Instance ()-> GetHoveredTime ());
110
+ need_update = true ;
111
+ }
112
+ if (ImGui::MenuItem ( " Collapse Selection " , nullptr , & ProjectFile::Instance ()-> m_CollapseLog2ndSelection )) {
113
+ need_update = true ;
114
+ }
115
+ if ( ImGui::MenuItem ( " Hide some values " , nullptr , & ProjectFile::Instance ()-> m_HideSomeLog2ndValues )) {
116
+ need_update = true ;
117
+ }
118
+ ImGui::EndMenu () ;
119
+ }
116
120
117
- static char _values_hide_buffer[1024 + 1 ] = " " ;
118
- snprintf (_values_hide_buffer, 1024 , " %s" , ProjectFile::Instance ()->m_ValuesToHide .c_str ());
119
- if (ImGui::InputText (" ##Valuestohide" , _values_hide_buffer, 1024 )) {
120
- need_update = true ;
121
- ProjectFile::Instance ()->m_ValuesToHide = _values_hide_buffer;
122
- }
121
+ if (ProjectFile::Instance ()->m_HideSomeLog2ndValues ) {
122
+ ImGui::Text (" (?)" );
123
+ if (ImGui::IsItemHovered ()) {
124
+ ImGui::SetTooltip (" %s" , " you can define many values, ex : 1,2,3.2,5.8" );
123
125
}
124
126
125
- if (need_update) {
126
- PrepareLog ();
127
+ if (ImGui::ContrastedButton (" R##ResetLogPaneTable" )) {
128
+ ProjectFile::Instance ()->m_Log2ndValuesToHide .clear ();
129
+ need_update = true ;
130
+ }
127
131
128
- ProjectFile::Instance ()->SetProjectChange ();
132
+ static char _values_hide_buffer[1024 + 1 ] = " " ;
133
+ snprintf (_values_hide_buffer, 1024 , " %s" , ProjectFile::Instance ()->m_Log2ndValuesToHide .c_str ());
134
+ if (ImGui::InputText (" ##Valuestohide" , _values_hide_buffer, 1024 )) {
135
+ need_update = true ;
136
+ ProjectFile::Instance ()->m_Log2ndValuesToHide = _values_hide_buffer;
129
137
}
138
+ }
130
139
131
- ImGui::EndMenuBar ();
140
+ if (need_update) {
141
+ PrepareLog ();
142
+ ProjectFile::Instance ()->SetProjectChange ();
132
143
}
144
+ }
133
145
146
+ void LogPaneSecondView::DrawTable () {
134
147
static ImGuiTableFlags flags = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_RowBg | ImGuiTableFlags_Hideable | ImGuiTableFlags_ScrollY |
135
148
ImGuiTableFlags_Resizable |
136
149
ImGuiTableFlags_NoHostExtendY;
@@ -250,25 +263,32 @@ void LogPaneSecondView::PrepareLog() {
250
263
251
264
m_LogDatas.clear ();
252
265
253
- if (ProjectFile::Instance ()->m_HideSomeValues ) {
266
+ if (ProjectFile::Instance ()->m_HideSomeLog2ndValues ) {
254
267
m_ValuesToHide.clear ();
255
- auto arr = ez::str::splitStringToVector (ProjectFile::Instance ()->m_ValuesToHide , " ," );
268
+ auto arr = ez::str::splitStringToVector (ProjectFile::Instance ()->m_Log2ndValuesToHide , " ," );
256
269
for (const auto & a : arr) {
257
270
m_ValuesToHide.push_back (ez::dvariant (a).GetD ());
258
271
}
259
272
}
260
273
261
274
const auto _count_logs = LogEngine::Instance ()->GetSignalTicks ().size ();
262
- const auto _collapseSelection = ProjectFile::Instance ()->m_CollapseLogSelection ;
275
+ const auto _collapseSelection = ProjectFile::Instance ()->m_CollapseLog2ndSelection ;
263
276
264
277
for (size_t idx = 0U ; idx < _count_logs; ++idx) {
265
278
const auto & infos_ptr = LogEngine::Instance ()->GetSignalTicks ().at (idx);
266
279
if (infos_ptr) {
280
+ auto parent_ptr = infos_ptr->parent .lock ();
281
+ if (parent_ptr != nullptr ) {
282
+ if (ProjectFile::Instance ()->m_ShowVariableSignalsInLog2ndView && parent_ptr->isConstant ()) {
283
+ continue ;
284
+ }
285
+ }
286
+
267
287
auto selected = LogEngine::Instance ()->isSignalShown (infos_ptr->category , infos_ptr->name );
268
288
if (_collapseSelection && !selected)
269
289
continue ;
270
290
271
- if (ProjectFile::Instance ()->m_HideSomeValues ) {
291
+ if (ProjectFile::Instance ()->m_HideSomeLog2ndValues ) {
272
292
bool found = false ;
273
293
274
294
for (const auto & a : m_ValuesToHide) {
0 commit comments