@@ -52,6 +52,10 @@ bool LogPaneSecondView::DrawPanes(const uint32_t& /*vCurrentFrame*/, bool* vOpen
5252 flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar;
5353#endif
5454 if (ProjectFile::Instance ()->IsProjectLoaded ()) {
55+ if (ImGui::BeginMenuBar ()) {
56+ DrawMenuBar ();
57+ ImGui::EndMenuBar ();
58+ }
5559 DrawTable ();
5660 }
5761 }
@@ -98,39 +102,48 @@ void LogPaneSecondView::CheckItem(const SignalTickPtr& vSignalTick) {
98102 }
99103}
100104
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+ }
116120
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" );
123125 }
124126
125- if (need_update) {
126- PrepareLog ();
127+ if (ImGui::ContrastedButton (" R##ResetLogPaneTable" )) {
128+ ProjectFile::Instance ()->m_Log2ndValuesToHide .clear ();
129+ need_update = true ;
130+ }
127131
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;
129137 }
138+ }
130139
131- ImGui::EndMenuBar ();
140+ if (need_update) {
141+ PrepareLog ();
142+ ProjectFile::Instance ()->SetProjectChange ();
132143 }
144+ }
133145
146+ void LogPaneSecondView::DrawTable () {
134147 static ImGuiTableFlags flags = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_RowBg | ImGuiTableFlags_Hideable | ImGuiTableFlags_ScrollY |
135148 ImGuiTableFlags_Resizable |
136149 ImGuiTableFlags_NoHostExtendY;
@@ -250,25 +263,32 @@ void LogPaneSecondView::PrepareLog() {
250263
251264 m_LogDatas.clear ();
252265
253- if (ProjectFile::Instance ()->m_HideSomeValues ) {
266+ if (ProjectFile::Instance ()->m_HideSomeLog2ndValues ) {
254267 m_ValuesToHide.clear ();
255- auto arr = ez::str::splitStringToVector (ProjectFile::Instance ()->m_ValuesToHide , " ," );
268+ auto arr = ez::str::splitStringToVector (ProjectFile::Instance ()->m_Log2ndValuesToHide , " ," );
256269 for (const auto & a : arr) {
257270 m_ValuesToHide.push_back (ez::dvariant (a).GetD ());
258271 }
259272 }
260273
261274 const auto _count_logs = LogEngine::Instance ()->GetSignalTicks ().size ();
262- const auto _collapseSelection = ProjectFile::Instance ()->m_CollapseLogSelection ;
275+ const auto _collapseSelection = ProjectFile::Instance ()->m_CollapseLog2ndSelection ;
263276
264277 for (size_t idx = 0U ; idx < _count_logs; ++idx) {
265278 const auto & infos_ptr = LogEngine::Instance ()->GetSignalTicks ().at (idx);
266279 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+
267287 auto selected = LogEngine::Instance ()->isSignalShown (infos_ptr->category , infos_ptr->name );
268288 if (_collapseSelection && !selected)
269289 continue ;
270290
271- if (ProjectFile::Instance ()->m_HideSomeValues ) {
291+ if (ProjectFile::Instance ()->m_HideSomeLog2ndValues ) {
272292 bool found = false ;
273293
274294 for (const auto & a : m_ValuesToHide) {
0 commit comments