Commit b34df533 authored by charras's avatar charras

more about Netclasses work

parent 24ce9409
No preview for this file type
This diff is collapsed.
......@@ -39,6 +39,7 @@ void WinEDA_PcbFrame::Tracks_and_Vias_Size_Event( wxCommandEvent& event )
break;
case ID_POPUP_PCB_SELECT_USE_NETCLASS_VALUES:
g_DesignSettings.m_UseConnectedTrackWidth = false;
GetBoard()->m_TrackWidthSelector = 0;
g_DesignSettings.m_CurrentTrackWidth = GetBoard()->m_TrackWidthHistory[0];
GetBoard()->m_ViaSizeSelector = 0;
......
......@@ -853,7 +853,9 @@ static wxMenu* Append_Track_Width_List( BOARD * aBoard )
if( g_DesignSettings.m_UseConnectedTrackWidth )
trackwidth_menu->Check( ID_POPUP_PCB_SELECT_AUTO_WIDTH, true );
if( aBoard->m_ViaSizeSelector != 0 || aBoard->m_TrackWidthSelector != 0 )
if( aBoard->m_ViaSizeSelector != 0 ||
aBoard->m_TrackWidthSelector != 0 ||
g_DesignSettings.m_UseConnectedTrackWidth )
trackwidth_menu->Append( ID_POPUP_PCB_SELECT_USE_NETCLASS_VALUES,
_( "Use Netclass Values" ),
_( "Use track and via sizes from their Netclass values" ),
......@@ -870,7 +872,7 @@ static wxMenu* Append_Track_Width_List( BOARD * aBoard )
msg.Printf( _( "Track %.3f" ), value );
if ( ii == 0 )
msg << _(" (Use NetClass)" );
msg << _(" (from NetClass)" );
trackwidth_menu->Append( ID_POPUP_PCB_SELECT_WIDTH1 + ii, msg, wxEmptyString, true );
......@@ -894,7 +896,7 @@ static wxMenu* Append_Track_Width_List( BOARD * aBoard )
else
msg.Printf( _( "Via %.3f" ), value );
if ( ii == 0 )
msg << _(" (Use NetClass)" );
msg << _(" (from NetClass)" );
trackwidth_menu->Append( ID_POPUP_PCB_SELECT_VIASIZE1 + ii, msg, wxEmptyString, true );
}
if( aBoard->m_ViaSizeSelector < (int)aBoard->m_ViaSizeHistory.size() )
......
/****************************************************************
toolbars_update_user_interface.cpp
* toolbars_update_user_interface.cpp
****************************************************************/
/*
function to update toolbars UI after changing parameters
*/
* function to update toolbars UI after changing parameters
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
......@@ -19,11 +20,12 @@ function to update toolbars UI after changing parameters
/* helper to convert an integer value to a string, using mils or mm
* according to g_UnitMetric value
*/
static wxString ReturnStringValue(int aValue)
static wxString ReturnStringValue( int aValue )
{
wxString text;
const wxChar * format;
const wxChar* format;
double value = To_User_Unit( g_UnitMetric, aValue, PCB_INTERNAL_UNIT );
if( g_UnitMetric == INCHES )
{
format = wxT( " %.1f" );
......@@ -33,21 +35,23 @@ static wxString ReturnStringValue(int aValue)
format = wxT( " %.3f" );
text.Printf( format, value );
if( g_UnitMetric == INCHES )
text += _(" mils");
text += _( " mils" );
else
text += _(" mm");
text += _( " mm" );
return text;
}
/**
* Function AuxiliaryToolBar_DesignRules_Update_UI
* update the displayed values: track widths, via sizes, clearance, Netclass name
* used when a netclass is selected
*/
void WinEDA_PcbFrame::AuxiliaryToolBar_DesignRules_Update_UI( )
void WinEDA_PcbFrame::AuxiliaryToolBar_DesignRules_Update_UI()
{
wxString nclname = GetBoard()->m_CurrentNetClassName;
wxString msg = _("NetClass: ") + nclname;
wxString msg = _( "NetClass: " ) + nclname;
m_NetClassSelectedBox->Clear();
m_NetClassSelectedBox->AppendText( msg );
......@@ -55,13 +59,13 @@ void WinEDA_PcbFrame::AuxiliaryToolBar_DesignRules_Update_UI( )
if( m_ClearanceBox )
{
wxString msg = _( "Clearance" ) + ReturnStringValue(netclass->GetClearance());
wxString msg = _( "Clearance" ) + ReturnStringValue( netclass->GetClearance() );
m_ClearanceBox->Clear();
m_ClearanceBox->AppendText( msg );
}
}
/**
* Function AuxiliaryToolBar_Update_UI
* update the displayed values on auxiliary horizontal toolbar
......@@ -71,20 +75,23 @@ void WinEDA_PcbFrame::AuxiliaryToolBar_DesignRules_Update_UI( )
* next items (if any) = ordered list of sizes (extra sizes).
* So the current selected class value can be same as an other extra value
*/
void WinEDA_PcbFrame::AuxiliaryToolBar_Update_UI( )
void WinEDA_PcbFrame::AuxiliaryToolBar_Update_UI()
{
wxString msg;
AuxiliaryToolBar_DesignRules_Update_UI( );
AuxiliaryToolBar_DesignRules_Update_UI();
m_AuxiliaryToolBar->ToggleTool( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH,
g_DesignSettings.m_UseConnectedTrackWidth );
if( m_SelTrackWidthBox && m_TrackAndViasSizesList_Changed )
{
m_SelTrackWidthBox->Clear();
for( unsigned ii = 0; ii < GetBoard()->m_TrackWidthHistory.size(); ii++ )
{
msg = _( "Track" ) + ReturnStringValue(GetBoard()->m_TrackWidthHistory[ii]);
if (ii == 0 )
msg << _(" *");
msg = _( "Track" ) + ReturnStringValue( GetBoard()->m_TrackWidthHistory[ii] );
if( ii == 0 )
msg << _( " *" );
m_SelTrackWidthBox->Append( msg );
}
}
......@@ -97,9 +104,9 @@ void WinEDA_PcbFrame::AuxiliaryToolBar_Update_UI( )
m_SelViaSizeBox->Clear();
for( unsigned ii = 0; ii < GetBoard()->m_ViaSizeHistory.size(); ii++ )
{
msg = _( "Via" ) + ReturnStringValue(GetBoard()->m_ViaSizeHistory[ii]);
if (ii == 0 )
msg << _(" *");
msg = _( "Via" ) + ReturnStringValue( GetBoard()->m_ViaSizeHistory[ii] );
if( ii == 0 )
msg << _( " *" );
m_SelViaSizeBox->Append( msg );
}
}
......@@ -119,7 +126,8 @@ void WinEDA_PcbFrame::AuxiliaryToolBar_Update_UI( )
break;
}
}
if ( not_found )
if( not_found )
m_SelZoomBox->SetSelection( -1 );
}
......@@ -186,7 +194,9 @@ void WinEDA_PcbFrame::SetToolbars()
!Drc_On );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_DRC_OFF,
Drc_On ?
_( "DRC Off (Disable !!!), Currently: DRC is active" ) :
_(
"DRC Off (Disable !!!), Currently: DRC is active" )
:
_( "DRC On (Currently: DRC is inactive !!!)" ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_MM,
......@@ -267,11 +277,12 @@ void WinEDA_PcbFrame::SetToolbars()
g_ModuleTextNOVColor & (ITEM_NOT_SHOW) ?
_( "Show invisible text" ) :
_( "Hide invisible text" ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1, m_AuxVToolBar ? true : false );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1,
m_AuxVToolBar ? true : false );
}
if( m_AuxiliaryToolBar )
AuxiliaryToolBar_Update_UI( );
AuxiliaryToolBar_Update_UI();
UpdateToolbarLayerInfo();
PrepareLayerIndicator();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment