mirror of
https://github.com/wolfpld/tracy.git
synced 2024-09-20 05:42:18 +00:00
Display trace parameters only when the connection is active.
This commit is contained in:
parent
7963617f86
commit
cc87cebee3
@ -1070,46 +1070,49 @@ bool View::DrawConnection()
|
|||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& params = m_worker.GetParameters();
|
if( m_worker.IsConnected() )
|
||||||
if( !params.empty() )
|
|
||||||
{
|
{
|
||||||
ImGui::Separator();
|
const auto& params = m_worker.GetParameters();
|
||||||
if( ImGui::TreeNode( "Trace parameters" ) )
|
if( !params.empty() )
|
||||||
{
|
{
|
||||||
ImGui::Columns( 2 );
|
|
||||||
ImGui::TextUnformatted( "Name" );
|
|
||||||
ImGui::NextColumn();
|
|
||||||
ImGui::TextUnformatted( "Value" );
|
|
||||||
ImGui::NextColumn();
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
size_t idx = 0;
|
if( ImGui::TreeNode( "Trace parameters" ) )
|
||||||
for( auto& p : params )
|
|
||||||
{
|
{
|
||||||
ImGui::TextUnformatted( m_worker.GetString( p.name ) );
|
ImGui::Columns( 2 );
|
||||||
|
ImGui::TextUnformatted( "Name" );
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::PushID( idx );
|
ImGui::TextUnformatted( "Value" );
|
||||||
if( p.isBool )
|
|
||||||
{
|
|
||||||
bool val = p.val;
|
|
||||||
if( ImGui::Checkbox( "", &val ) )
|
|
||||||
{
|
|
||||||
m_worker.SetParameter( idx, int32_t( val ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
auto val = int( p.val );
|
|
||||||
if( ImGui::InputInt( "", &val, 1, 100, ImGuiInputTextFlags_EnterReturnsTrue ) )
|
|
||||||
{
|
|
||||||
m_worker.SetParameter( idx, int32_t( val ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ImGui::PopID();
|
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
idx++;
|
ImGui::Separator();
|
||||||
|
size_t idx = 0;
|
||||||
|
for( auto& p : params )
|
||||||
|
{
|
||||||
|
ImGui::TextUnformatted( m_worker.GetString( p.name ) );
|
||||||
|
ImGui::NextColumn();
|
||||||
|
ImGui::PushID( idx );
|
||||||
|
if( p.isBool )
|
||||||
|
{
|
||||||
|
bool val = p.val;
|
||||||
|
if( ImGui::Checkbox( "", &val ) )
|
||||||
|
{
|
||||||
|
m_worker.SetParameter( idx, int32_t( val ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto val = int( p.val );
|
||||||
|
if( ImGui::InputInt( "", &val, 1, 100, ImGuiInputTextFlags_EnterReturnsTrue ) )
|
||||||
|
{
|
||||||
|
m_worker.SetParameter( idx, int32_t( val ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::PopID();
|
||||||
|
ImGui::NextColumn();
|
||||||
|
idx++;
|
||||||
|
}
|
||||||
|
ImGui::EndColumns();
|
||||||
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
ImGui::EndColumns();
|
|
||||||
ImGui::TreePop();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user