mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-19 00:21:36 +00:00
pcbnew Rewrite the GUI relative to the tracks widths and vias diameters and drills selection and edition, for compatibility with new netclass approach.
This commit is contained in:
parent
e027e65971
commit
29e217d310
CHANGELOG.txtcopyright.h
gerbview
include
pcbnew
CMakeLists.txtclass_board.cppclass_board.hclass_board_design_settings.cppclass_netinfo.hdialog_design_rules.cppdialog_design_rules.hdialog_general_options.cppdialog_general_options.hdialog_global_edit_tracks_and_vias.cppdialog_global_edit_tracks_and_vias.hdialog_global_edit_tracks_and_vias_base.cppdialog_global_edit_tracks_and_vias_base.fbpdialog_global_edit_tracks_and_vias_base.hdialog_mask_clearance.cppdialog_mask_clearance.hdialog_mask_clearance_base.cppdialog_mask_clearance_base.fbpdialog_mask_clearance_base.hdialog_track_options.cppdialog_track_options.hdialog_track_options_base.cppdialog_track_options_base.fbpdialog_track_options_base.hedit.cppedit_track_width.cppeditrack-part2.cppeditrack.cppevent_handlers_tracks_vias_sizes.cppioascii.cppmenubarpcb.cppmuonde.cpponrightclick.cpppcbframe.cpppcbnew_config.cpppcbnew_config.hpcbnew_id.hsolve.cppspecctra_export.cpptool_onrightclick.cpptool_pcb.cpptoolbars_update_user_interface.cppvia_edit.cpp.unused
@ -4,6 +4,22 @@ KiCad ChangeLog 2009
|
||||
Please add newer entries at the top, list the date and your name with
|
||||
email address.
|
||||
|
||||
2009-oct-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
|
||||
================================================================================
|
||||
++pcbnew
|
||||
Rewrite the GUI relative to the tracks widths and vias diameters and drills selection
|
||||
and edition, for compatibility with new netclass approach.
|
||||
Now vias dimensions are defined by their diameter and drill values
|
||||
(This is also a simpler an better way than the old one that considers
|
||||
via diameters and drill values as independant parmeters)
|
||||
When set a via to a "custom" value, the diameter and the drill values are set.
|
||||
(of course one can use the drill defualt value of the netclass)
|
||||
So the via hole edit options (in popup menu) does not exist no more.
|
||||
The global tracks widths and vias diameters and drills changes are now
|
||||
accessible by a specific dialog frame.
|
||||
|
||||
|
||||
|
||||
|
||||
2009-oct-27 UPDATE Jerry Jacobs <xor.gate.engineering@gmail.com>
|
||||
================================================================================
|
||||
|
@ -12,8 +12,8 @@ may choose to document this corresponding work in the CHANGELOG.txt file.
|
||||
/*
|
||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2008 Jean-Pierre Charras, jean-pierre.charras@gipsa-lab.inpg.fr
|
||||
* Copyright (C) 1992-2008 Kicad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 1992-2009 Jean-Pierre Charras, jean-pierre.charras@gipsa-lab.inpg.fr
|
||||
* Copyright (C) 1992-2009 Kicad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -51,10 +51,9 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event )
|
||||
break;
|
||||
}
|
||||
|
||||
case ID_PCB_TRACK_SIZE_SETUP:
|
||||
case ID_PCB_DISPLAY_OPTIONS_SETUP:
|
||||
case ID_OPTIONS_SETUP:
|
||||
InstallPcbOptionsFrame( pos, id );
|
||||
InstallGerberOptionsFrame( pos, id );
|
||||
break;
|
||||
|
||||
case ID_CONFIG_SAVE:
|
||||
|
@ -413,7 +413,7 @@ void WinEDA_LookFrame::OnOkClick( wxCommandEvent& event )
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
void WinEDA_GerberFrame::InstallPcbOptionsFrame( const wxPoint& pos, int id )
|
||||
void WinEDA_GerberFrame::InstallGerberOptionsFrame( const wxPoint& pos, int id )
|
||||
/***************************************************************************/
|
||||
{
|
||||
switch( id )
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
void Process_Settings( wxCommandEvent& event );
|
||||
void Process_Config( wxCommandEvent& event );
|
||||
void InstallConfigFrame( const wxPoint& pos );
|
||||
void InstallPcbOptionsFrame( const wxPoint& pos, int id );
|
||||
void InstallGerberOptionsFrame( const wxPoint& pos, int id );
|
||||
void InstallPcbGlobalDeleteFrame( const wxPoint& pos );
|
||||
|
||||
/* handlers for block commands */
|
||||
|
@ -11,12 +11,8 @@ class EDA_BoardDesignSettings
|
||||
protected:
|
||||
int m_CopperLayerCount; // Number of copper layers for this design
|
||||
public:
|
||||
int m_ViaDrillCustomValue; // via drill for vias that have a specific drill value
|
||||
int m_CurrentViaSize; // Current via size
|
||||
int m_CurrentMicroViaSize; // Current micro via size
|
||||
bool m_MicroViasAllowed; // true to allow micro vias
|
||||
int m_CurrentViaType; // via type (VIA_BLIND_BURIED, VIA_TROUGHT VIA_MICROVIA)
|
||||
int m_CurrentTrackWidth; // current track width
|
||||
bool m_UseConnectedTrackWidth; // if true, when creating a new track starting on an existing track, use this track width
|
||||
int m_DrawSegmentWidth; // current graphic line width (not EDGE layer)
|
||||
int m_EdgeSegmentWidth; // current graphic line width (EDGE layer only)
|
||||
|
@ -253,7 +253,6 @@ enum main_id
|
||||
ID_POPUP_PCB_DELETE_TRACKSEG,
|
||||
ID_TOOLBARH_PCB_SELECT_LAYER,
|
||||
ID_PCB_DISPLAY_OPTIONS_SETUP,
|
||||
ID_PCB_TRACK_SIZE_SETUP,
|
||||
|
||||
ID_END_LIST
|
||||
};
|
||||
|
@ -420,8 +420,22 @@ public:
|
||||
void Delete_Track( wxDC* DC, TRACK* Track );
|
||||
void Delete_net( wxDC* DC, TRACK* Track );
|
||||
void Remove_One_Track( wxDC* DC, TRACK* pt_segm );
|
||||
bool Resize_Pistes_Vias( wxDC* DC, bool Track, bool Via );
|
||||
void Edit_Net_Width( wxDC* DC, int Netcode );
|
||||
|
||||
/** function Reset_All_Tracks_And_Vias_To_Netclass_Values
|
||||
* Reset all tracks width and/or vias diameters and drill
|
||||
* to their default Netclass value
|
||||
* @param aTrack : bool true to modify tracks
|
||||
* @param aVia : bool true to modify vias
|
||||
*/
|
||||
bool Reset_All_Tracks_And_Vias_To_Netclass_Values( bool aTrack, bool aVia );
|
||||
|
||||
/** function Change_Net_Tracks_And_Vias_Sizes
|
||||
* Reset all tracks width and vias diameters and drill
|
||||
* to their default Netclass value ou current values
|
||||
* @param aNetcode : the netcode of the net to edit
|
||||
* @param aUseNetclassValue : bool. True to use netclass values, false to use current values
|
||||
*/
|
||||
bool Change_Net_Tracks_And_Vias_Sizes( int aNetcode, bool aUseNetclassValue );
|
||||
|
||||
/** Function Edit_Track_Width
|
||||
* Modify a full track width (using DRC control).
|
||||
@ -433,7 +447,7 @@ public:
|
||||
|
||||
/** Function Edit_TrackSegm_Width
|
||||
* Modify one track segment width or one via diameter (using DRC control).
|
||||
* @param DC = the curred device context (can be NULL)
|
||||
* @param DC = the current device context (can be NULL)
|
||||
* @param aTrackItem = the track segment or via to modify
|
||||
*/
|
||||
void Edit_TrackSegm_Width( wxDC* DC, TRACK* segm );
|
||||
|
@ -20,13 +20,10 @@ set(PCBNEW_SRCS
|
||||
# cleaningoptions_dialog.cpp
|
||||
connect.cpp
|
||||
controle.cpp
|
||||
# copy_track.cpp <-- not used
|
||||
cotation.cpp
|
||||
cross-probing.cpp
|
||||
debug_kbool_key_file_fct.cpp
|
||||
deltrack.cpp
|
||||
# dialog_copper_layers_setup_base.cpp
|
||||
# dialog_copper_layers_setup.cpp
|
||||
dialog_copper_zones.cpp
|
||||
dialog_copper_zones_base.cpp
|
||||
dialog_design_rules.cpp
|
||||
@ -46,6 +43,8 @@ set(PCBNEW_SRCS
|
||||
# dialog_gendrill.cpp
|
||||
dialog_general_options.cpp
|
||||
dialog_general_options_BoardEditor_base.cpp
|
||||
dialog_global_edit_tracks_and_vias.cpp
|
||||
dialog_global_edit_tracks_and_vias_base.cpp
|
||||
# dialog_graphic_items_options.cpp
|
||||
dialog_graphic_item_properties.cpp
|
||||
dialog_graphic_item_properties_base.cpp
|
||||
@ -64,15 +63,14 @@ set(PCBNEW_SRCS
|
||||
dialog_print_for_modedit_base.cpp
|
||||
dialog_print_using_printer.cpp
|
||||
dialog_orient_footprints.cpp
|
||||
dialog_track_options.cpp
|
||||
dialog_track_options_base.cpp
|
||||
dialog_mask_clearance.cpp
|
||||
dialog_mask_clearance_base.cpp
|
||||
dialog_SVG_print.cpp
|
||||
dialog_SVG_print_base.cpp
|
||||
dist.cpp
|
||||
dragsegm.cpp
|
||||
drc.cpp
|
||||
dsn.cpp
|
||||
# dupltrac.cpp <-- not used
|
||||
edgemod.cpp
|
||||
edit.cpp
|
||||
editedge.cpp
|
||||
@ -111,7 +109,6 @@ set(PCBNEW_SRCS
|
||||
modedit_undo_redo.cpp
|
||||
moduleframe.cpp
|
||||
modules.cpp
|
||||
# move_copy_track.cpp <-- not used
|
||||
move-drag_pads.cpp
|
||||
move_or_drag_track.cpp
|
||||
muonde.cpp
|
||||
@ -146,7 +143,6 @@ set(PCBNEW_SRCS
|
||||
track.cpp
|
||||
tr_modif.cpp
|
||||
trpiste.cpp
|
||||
via_edit.cpp
|
||||
work.cpp
|
||||
xchgmod.cpp
|
||||
zones_by_polygon.cpp
|
||||
|
@ -97,10 +97,11 @@ BOARD::~BOARD()
|
||||
m_CurrentNetClassName = netClass->GetName();
|
||||
|
||||
// Initialize others values:
|
||||
if( m_ViaSizeList.size() == 0 )
|
||||
if( m_ViasDimensionsList.size() == 0 )
|
||||
{
|
||||
VIA_DIMENSION viadim;
|
||||
lists_sizes_modified = true;
|
||||
m_ViaSizeList.push_back(0);
|
||||
m_ViasDimensionsList.push_back(viadim);
|
||||
}
|
||||
if( m_TrackWidthList.size() == 0 )
|
||||
{
|
||||
@ -108,23 +109,22 @@ BOARD::~BOARD()
|
||||
m_TrackWidthList.push_back(0);
|
||||
}
|
||||
|
||||
if( m_ViaSizeList[0] != netClass->GetViaDiameter() )
|
||||
/* note the m_ViasDimensionsList[0] and m_TrackWidthList[0] values
|
||||
* are always the Netclass values
|
||||
*/
|
||||
if( m_ViasDimensionsList[0].m_Diameter != netClass->GetViaDiameter() )
|
||||
lists_sizes_modified = true;
|
||||
m_ViaSizeList[0] = netClass->GetViaDiameter();
|
||||
m_ViasDimensionsList[0].m_Diameter = netClass->GetViaDiameter();
|
||||
|
||||
if( m_TrackWidthList[0] != netClass->GetTrackWidth() )
|
||||
lists_sizes_modified = true;
|
||||
m_TrackWidthList[0] = netClass->GetTrackWidth();
|
||||
|
||||
if( m_ViaSizeSelector >= m_ViaSizeList.size() )
|
||||
m_ViaSizeSelector = m_ViaSizeList.size();
|
||||
if( m_ViaSizeSelector >= m_ViasDimensionsList.size() )
|
||||
m_ViaSizeSelector = m_ViasDimensionsList.size();
|
||||
if( m_TrackWidthSelector >= m_TrackWidthList.size() )
|
||||
m_TrackWidthSelector = m_TrackWidthList.size();
|
||||
|
||||
//Initialize track and via current size:
|
||||
g_DesignSettings.m_CurrentViaSize = m_ViaSizeList[m_ViaSizeSelector];
|
||||
g_DesignSettings.m_CurrentTrackWidth = m_TrackWidthList[m_TrackWidthSelector];
|
||||
|
||||
return lists_sizes_modified;
|
||||
}
|
||||
|
||||
@ -143,6 +143,25 @@ int BOARD::GetBiggestClearanceValue()
|
||||
return clearance;
|
||||
}
|
||||
|
||||
/** function GetCurrentMicroViaSize
|
||||
* @return the current micro via size,
|
||||
* that is the current netclass value
|
||||
*/
|
||||
int BOARD::GetCurrentMicroViaSize()
|
||||
{
|
||||
NETCLASS* netclass = m_NetClasses.Find( m_CurrentNetClassName );
|
||||
return netclass->GetuViaDiameter();
|
||||
}
|
||||
|
||||
/** function GetCurrentMicroViaDrill
|
||||
* @return the current micro via drill,
|
||||
* that is the current netclass value
|
||||
*/
|
||||
int BOARD::GetCurrentMicroViaDrill()
|
||||
{
|
||||
NETCLASS* netclass = m_NetClasses.Find( m_CurrentNetClassName );
|
||||
return netclass->GetuViaDrill();
|
||||
}
|
||||
|
||||
wxString BOARD::GetLayerName( int aLayerIndex ) const
|
||||
{
|
||||
|
@ -60,6 +60,33 @@ struct LAYER
|
||||
};
|
||||
|
||||
|
||||
/** a small helper class to handle a stock of specific vias diameter and drill pair
|
||||
* in the BOARD class
|
||||
*/
|
||||
class VIA_DIMENSION
|
||||
{
|
||||
public:
|
||||
int m_Diameter; // <= 0 means use Netclass via diameter
|
||||
int m_Drill; // <= 0 means use Netclass via drill
|
||||
|
||||
VIA_DIMENSION()
|
||||
{
|
||||
m_Diameter = 0; m_Drill = 0;
|
||||
}
|
||||
|
||||
bool operator == (const VIA_DIMENSION& other) const
|
||||
{
|
||||
return (m_Diameter == other.m_Diameter) &&
|
||||
(m_Drill == other.m_Drill);
|
||||
}
|
||||
bool operator < (const VIA_DIMENSION& other) const
|
||||
{
|
||||
if (m_Diameter != other.m_Diameter)
|
||||
return (m_Diameter < other.m_Diameter);
|
||||
return m_Drill < other.m_Drill;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Class BOARD
|
||||
* holds information pertinent to a PCBNEW printed circuit board.
|
||||
@ -108,7 +135,7 @@ public:
|
||||
// handling of vias and tracks size:
|
||||
// the first value is always the value of the current NetClass
|
||||
// The others values are extra values
|
||||
std::vector <int> m_ViaSizeList; // vias sizes list(max count = HISTORY_MAX_COUNT)
|
||||
std::vector <VIA_DIMENSION> m_ViasDimensionsList; // vias size and drill list(max count = HISTORY_MAX_COUNT)
|
||||
// The first value is the current netclass via size
|
||||
std::vector <int> m_TrackWidthList; // tracks widths (max count = HISTORY_MAX_COUNT)
|
||||
// The first value is the current netclass track width
|
||||
@ -404,7 +431,9 @@ public:
|
||||
*/
|
||||
int ReturnSortedNetnamesList( wxArrayString& aNames, bool aSortbyPadsCount );
|
||||
|
||||
/****** function relative to NetClasses: */
|
||||
/**************************************/
|
||||
/** function relative to NetClasses: **/
|
||||
/**************************************/
|
||||
/**
|
||||
* Function SynchronizeNetsAndNetClasses
|
||||
* copies NETCLASS info to each NET, based on NET membership in a NETCLASS.
|
||||
@ -427,10 +456,52 @@ public:
|
||||
bool SetCurrentNetClass( const wxString& aNetClassName );
|
||||
|
||||
/** function GetBiggestClearanceValue
|
||||
* @return the biggest clerance value found in NetClasses list
|
||||
* @return the biggest clearance value found in NetClasses list
|
||||
*/
|
||||
int GetBiggestClearanceValue();
|
||||
|
||||
/** function GetCurrentTrackWidth
|
||||
* @return the current track width, accordint to the selected options
|
||||
* ( using the default netclass value or a preset value )
|
||||
* the default netclass is always in m_TrackWidthList[0]
|
||||
*/
|
||||
int GetCurrentTrackWidth()
|
||||
{
|
||||
return m_TrackWidthList[m_TrackWidthSelector];
|
||||
}
|
||||
|
||||
/** function GetCurrentViaSize
|
||||
* @return the current via size, accordint to the selected options
|
||||
* ( using the default netclass value or a preset value )
|
||||
* the default netclass is always in m_TrackWidthList[0]
|
||||
*/
|
||||
int GetCurrentViaSize()
|
||||
{
|
||||
return m_ViasDimensionsList[m_ViaSizeSelector].m_Diameter;
|
||||
}
|
||||
|
||||
/** function GetCurrentViaDrill
|
||||
* @return the current via size, accordint to the selected options
|
||||
* ( using the default netclass value or a preset value )
|
||||
* the default netclass is always in m_TrackWidthList[0]
|
||||
*/
|
||||
int GetCurrentViaDrill()
|
||||
{
|
||||
return m_ViasDimensionsList[m_ViaSizeSelector].m_Drill > 0 ?
|
||||
m_ViasDimensionsList[m_ViaSizeSelector].m_Drill : -1;
|
||||
}
|
||||
|
||||
/** function GetCurrentMicroViaSize
|
||||
* @return the current micro via size,
|
||||
* that is the current netclass value
|
||||
*/
|
||||
int GetCurrentMicroViaSize();
|
||||
|
||||
/** function GetCurrentMicroViaDrill
|
||||
* @return the current micro via drill,
|
||||
* that is the current netclass value
|
||||
*/
|
||||
int GetCurrentMicroViaDrill();
|
||||
|
||||
/***************************************************************************/
|
||||
/**
|
||||
|
@ -41,12 +41,8 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
|
||||
m_VisibleElements = 0x00000fff; // IMB: All elements visible at first. TODO: Use a macro for the initial value.
|
||||
|
||||
SetCopperLayerCount( 2 ); // Default design is a double sided board
|
||||
m_ViaDrillCustomValue = 250; // via drill for vias which must have a defined drill value
|
||||
m_CurrentViaSize = 450; // Current via size
|
||||
m_CurrentViaType = VIA_THROUGH; // via type (VIA_BLIND_BURIED, VIA_THROUGH VIA_MICROVIA)
|
||||
m_CurrentTrackWidth = 170; // current track width
|
||||
m_UseConnectedTrackWidth = false; // if true, when creating a new track starting on an existing track, use this track width
|
||||
m_CurrentMicroViaSize = 150; // Current micro via size
|
||||
m_MicroViasAllowed = false; // true to allow micro vias
|
||||
m_DrawSegmentWidth = 100; // current graphic line width (not EDGE layer)
|
||||
m_EdgeSegmentWidth = 100; // current graphic line width (EDGE layer only)
|
||||
|
@ -227,8 +227,6 @@ public:
|
||||
*/
|
||||
int GetTrackMinWidth()
|
||||
{
|
||||
// wxASSERT( m_NetClass );
|
||||
// return m_NetClass->GetTrackMinWidth();
|
||||
return g_DesignSettings.m_TrackMinWidth;
|
||||
}
|
||||
#endif
|
||||
|
@ -197,8 +197,8 @@ void DIALOG_DESIGN_RULES::InitGlobalRules()
|
||||
// (the first value in histories list)
|
||||
m_TracksWidthList = m_Parent->GetBoard()->m_TrackWidthList;
|
||||
m_TracksWidthList.erase( m_TracksWidthList.begin() ); // remove the netclass value
|
||||
m_ViasDiameterList = m_Parent->GetBoard()->m_ViaSizeList;
|
||||
m_ViasDiameterList.erase( m_ViasDiameterList.begin() ); // remove the netclass value
|
||||
m_ViasDimensionsList = m_Parent->GetBoard()->m_ViasDimensionsList;
|
||||
m_ViasDimensionsList.erase( m_ViasDimensionsList.begin() ); // remove the netclass value
|
||||
InitDimensionsLists();
|
||||
|
||||
}
|
||||
@ -219,10 +219,17 @@ void DIALOG_DESIGN_RULES::InitDimensionsLists()
|
||||
m_gridTrackWidthList->SetCellValue( ii, 0, msg );
|
||||
}
|
||||
|
||||
for( unsigned ii = 0; ii < m_ViasDiameterList.size(); ii++ )
|
||||
for( unsigned ii = 0; ii < m_ViasDimensionsList.size(); ii++ )
|
||||
{
|
||||
msg = ReturnStringFromValue( g_UnitMetric, m_ViasDiameterList[ii], Internal_Unit, false );
|
||||
msg = ReturnStringFromValue( g_UnitMetric, m_ViasDimensionsList[ii].m_Diameter,
|
||||
Internal_Unit, false );
|
||||
m_gridViaSizeList->SetCellValue( ii, 0, msg );
|
||||
if( m_ViasDimensionsList[ii].m_Drill > 0 )
|
||||
{
|
||||
msg = ReturnStringFromValue( g_UnitMetric, m_ViasDimensionsList[ii].m_Drill,
|
||||
Internal_Unit, false );
|
||||
m_gridViaSizeList->SetCellValue( ii, 1, msg );
|
||||
}
|
||||
}
|
||||
|
||||
// recompute the column widths here, after setting texts
|
||||
@ -516,26 +523,34 @@ void DIALOG_DESIGN_RULES::CopyDimensionsListsToBoard( )
|
||||
sort( m_TracksWidthList.begin(), m_TracksWidthList.end() );
|
||||
|
||||
// Reinitialize m_TrackWidthList
|
||||
m_ViasDiameterList.clear();
|
||||
m_ViasDimensionsList.clear();
|
||||
for( int row = 0; row < m_gridViaSizeList->GetNumberRows(); ++row )
|
||||
{
|
||||
msg = m_gridViaSizeList->GetCellValue( row, 0 );
|
||||
if( msg.IsEmpty() )
|
||||
continue;
|
||||
int value = ReturnValueFromString( g_UnitMetric, msg, m_Parent->m_InternalUnits );
|
||||
m_ViasDiameterList.push_back( value);
|
||||
VIA_DIMENSION via_dim;
|
||||
via_dim.m_Diameter = value;
|
||||
msg = m_gridViaSizeList->GetCellValue( row, 1 );
|
||||
if( ! msg.IsEmpty() )
|
||||
{
|
||||
value = ReturnValueFromString( g_UnitMetric, msg, m_Parent->m_InternalUnits );
|
||||
via_dim.m_Drill = value;
|
||||
}
|
||||
m_ViasDimensionsList.push_back( via_dim);
|
||||
}
|
||||
// Sort new list by by increasing value
|
||||
sort( m_ViasDiameterList.begin(), m_ViasDiameterList.end() );
|
||||
sort( m_ViasDimensionsList.begin(), m_ViasDimensionsList.end() );
|
||||
|
||||
std::vector <int>* list = &m_Parent->GetBoard()->m_TrackWidthList;
|
||||
list->erase( list->begin() + 1, list->end() ); // Remove old "custom" sizes
|
||||
list->insert( list->end(), m_TracksWidthList.begin(), m_TracksWidthList.end() ); //Add new "custom" sizes
|
||||
std::vector <int>* tlist = &m_Parent->GetBoard()->m_TrackWidthList;
|
||||
tlist->erase( tlist->begin() + 1, tlist->end() ); // Remove old "custom" sizes
|
||||
tlist->insert( tlist->end(), m_TracksWidthList.begin(), m_TracksWidthList.end() ); //Add new "custom" sizes
|
||||
|
||||
// Reinitialize m_ViaSizeList
|
||||
list = &m_Parent->GetBoard()->m_ViaSizeList;
|
||||
list->erase( list->begin() + 1, list->end() );
|
||||
list->insert( list->end(), m_ViasDiameterList.begin(), m_ViasDiameterList.end() );
|
||||
std::vector <VIA_DIMENSION>* vialist = &m_Parent->GetBoard()->m_ViasDimensionsList;
|
||||
vialist->erase( vialist->begin() + 1, vialist->end() );
|
||||
vialist->insert( vialist->end(), m_ViasDimensionsList.begin(), m_ViasDimensionsList.end() );
|
||||
|
||||
m_Parent->m_TrackAndViasSizesList_Changed = true;
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ private:
|
||||
NETCUPS m_AllNets;
|
||||
|
||||
// List of values to "customize" some tracks and vias
|
||||
std::vector <int> m_ViasDiameterList;
|
||||
std::vector <VIA_DIMENSION> m_ViasDimensionsList;
|
||||
std::vector <int> m_TracksWidthList;
|
||||
|
||||
private:
|
||||
|
@ -13,13 +13,10 @@
|
||||
#include "pcbnew.h"
|
||||
#include "wxPcbStruct.h"
|
||||
#include "class_board_design_settings.h"
|
||||
#include "dialog_general_options.h"
|
||||
|
||||
#include "pcbnew_id.h"
|
||||
|
||||
#include "dialog_general_options_BoardEditor_base.h"
|
||||
#include "dialog_general_options.h"
|
||||
#include "dialog_track_options.h"
|
||||
|
||||
|
||||
/***********************************************************************************/
|
||||
Dialog_GeneralOptions::Dialog_GeneralOptions( WinEDA_PcbFrame* parent, wxDC* DC ) :
|
||||
@ -105,11 +102,6 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event )
|
||||
g_TimeOut = 60 * m_SaveTime->GetValue();
|
||||
|
||||
/* Mise a jour de la combobox d'affichage de la couche active */
|
||||
/*
|
||||
int layer_count[] = {1,2,4,6,8,10,12,14,16};
|
||||
g_DesignSettings.m_CopperLayerCount = layer_count[m_LayerNumber->GetSelection()];
|
||||
m_Parent->ReCreateLayerBox( NULL );
|
||||
*/
|
||||
g_MaxLinksShowed = m_MaxShowLinks->GetValue();
|
||||
Drc_On = m_DrcOn->GetValue();
|
||||
if( g_Show_Ratsnest != m_ShowGlobalRatsnest->GetValue() )
|
||||
@ -141,35 +133,18 @@ void WinEDA_PcbFrame::InstallPcbOptionsFrame( const wxPoint& pos,
|
||||
{
|
||||
switch( id )
|
||||
{
|
||||
case ID_PCB_TRACK_SIZE_SETUP:
|
||||
{
|
||||
DIALOG_TRACKS_OPTIONS* OptionsFrame =
|
||||
new DIALOG_TRACKS_OPTIONS( this );
|
||||
|
||||
OptionsFrame->ShowModal();
|
||||
OptionsFrame->Destroy();
|
||||
}
|
||||
break;
|
||||
|
||||
case ID_PCB_DRAWINGS_WIDTHS_SETUP:
|
||||
{
|
||||
WinEDA_GraphicItemsOptionsDialog* OptionsFrame =
|
||||
new WinEDA_GraphicItemsOptionsDialog( this );
|
||||
|
||||
OptionsFrame->ShowModal();
|
||||
OptionsFrame->Destroy();
|
||||
WinEDA_GraphicItemsOptionsDialog dlg( this );
|
||||
dlg.ShowModal();
|
||||
}
|
||||
break;
|
||||
|
||||
case ID_OPTIONS_SETUP:
|
||||
{
|
||||
Dialog_GeneralOptions* OptionsFrame =
|
||||
new Dialog_GeneralOptions( this, DC );
|
||||
|
||||
OptionsFrame->ShowModal();
|
||||
OptionsFrame->Destroy();
|
||||
}
|
||||
default:
|
||||
wxMessageBox(wxT("InstallPcbOptionsFrame() id error"));
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -178,9 +153,8 @@ void WinEDA_PcbFrame::InstallPcbOptionsFrame( const wxPoint& pos,
|
||||
void WinEDA_ModuleEditFrame::InstallOptionsFrame( const wxPoint& pos )
|
||||
/*******************************************************************/
|
||||
{
|
||||
WinEDA_GraphicItemsOptionsDialog OptionsFrame( this );
|
||||
|
||||
OptionsFrame.ShowModal();
|
||||
WinEDA_GraphicItemsOptionsDialog dlg( this );
|
||||
dlg.ShowModal();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef __dialog_general_options_h
|
||||
#define __dialog_general_options_h
|
||||
|
||||
#include "dialog_general_options_BoardEditor_base.h"
|
||||
|
||||
/***********************************************************************/
|
||||
class Dialog_GeneralOptions : public DialogGeneralOptionsBoardEditor_base
|
||||
/***********************************************************************/
|
||||
|
170
pcbnew/dialog_global_edit_tracks_and_vias.cpp
Normal file
170
pcbnew/dialog_global_edit_tracks_and_vias.cpp
Normal file
@ -0,0 +1,170 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Name: dialog_global_edit_tracks_and_vias.cpp
|
||||
// Author: jean-pierre Charras
|
||||
// Created: 30 oct 2009
|
||||
// Licence: GPL
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
#include "pcbnew.h"
|
||||
#include "wxPcbStruct.h"
|
||||
#include "class_drawpanel.h"
|
||||
|
||||
#include "dialog_global_edit_tracks_and_vias.h"
|
||||
|
||||
/**
|
||||
* DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE, derived from DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE_BASE
|
||||
* @see dialog_global_edit_tracks_and_vias_base.h and dialog_global_edit_tracks_and_vias_base.cpp,
|
||||
* automatically created by wxFormBuilder
|
||||
*/
|
||||
|
||||
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS(
|
||||
WinEDA_PcbFrame* aParent, int aNetcode ) :
|
||||
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE( aParent )
|
||||
{
|
||||
m_Parent = aParent;
|
||||
m_Netcode = aNetcode;
|
||||
MyInit();
|
||||
Layout();
|
||||
GetSizer()->Fit( this );
|
||||
GetSizer()->SetSizeHints( this );
|
||||
}
|
||||
|
||||
|
||||
/*************************************************/
|
||||
void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
|
||||
/*************************************************/
|
||||
{
|
||||
SetFocus();
|
||||
|
||||
wxString msg;
|
||||
|
||||
// Display current setup for tracks and vias
|
||||
int Internal_Unit = m_Parent->m_InternalUnits;
|
||||
BOARD* board = m_Parent->GetBoard();
|
||||
NETCLASSES& netclasses = board->m_NetClasses;
|
||||
NETINFO_ITEM* net = board->FindNet( m_Netcode );
|
||||
NETCLASS* netclass = netclasses.GetDefault();
|
||||
if( net )
|
||||
{
|
||||
m_CurrentNetName->SetLabel( net->GetNetname() );
|
||||
m_CurrentNetclassName->SetLabel( board->m_CurrentNetClassName );
|
||||
netclass = netclasses.Find( board->m_CurrentNetClassName );
|
||||
}
|
||||
|
||||
// Enable/disable the option "copy current to net" if we ause only default netclass values
|
||||
if( ! board->m_TrackWidthSelector && !board->m_ViaSizeSelector )
|
||||
{
|
||||
m_Net2CurrValueButton->Enable(false);
|
||||
m_Net2CurrValueText->Enable(false);
|
||||
}
|
||||
|
||||
// Display current values, and current netclass values:
|
||||
int value = netclass->GetTrackWidth();
|
||||
msg = ReturnStringFromValue( g_UnitMetric, value, Internal_Unit, true );
|
||||
m_gridDisplayCurrentSettings->SetCellValue( 0, 0, msg );
|
||||
if( board->m_TrackWidthSelector )
|
||||
{
|
||||
value = board->GetCurrentTrackWidth();
|
||||
msg = ReturnStringFromValue( g_UnitMetric, value, Internal_Unit, true );
|
||||
}
|
||||
else
|
||||
msg = _( "Default" );
|
||||
m_gridDisplayCurrentSettings->SetCellValue( 1, 0, msg );
|
||||
// recompute the column widths here, after setting texts
|
||||
|
||||
value = netclass->GetViaDiameter();
|
||||
msg = ReturnStringFromValue( g_UnitMetric, value, Internal_Unit, true );
|
||||
m_gridDisplayCurrentSettings->SetCellValue( 0, 1, msg );
|
||||
if( board->m_ViaSizeSelector )
|
||||
{
|
||||
value = board->GetCurrentViaSize();
|
||||
msg = ReturnStringFromValue( g_UnitMetric, value, Internal_Unit, true );
|
||||
}
|
||||
else
|
||||
msg = _( "Default" );
|
||||
m_gridDisplayCurrentSettings->SetCellValue( 1, 1, msg );
|
||||
|
||||
value = netclass->GetViaDrill();
|
||||
msg = ReturnStringFromValue( g_UnitMetric, value, Internal_Unit, true );
|
||||
m_gridDisplayCurrentSettings->SetCellValue( 0, 2, msg );
|
||||
value = board->GetCurrentViaDrill();
|
||||
if( value >= 0 )
|
||||
msg = ReturnStringFromValue( g_UnitMetric, value, Internal_Unit, true );
|
||||
else
|
||||
msg = _( "Default" );
|
||||
m_gridDisplayCurrentSettings->SetCellValue( 1, 2, msg );
|
||||
|
||||
value = netclass->GetuViaDiameter();
|
||||
msg = ReturnStringFromValue( g_UnitMetric, value, Internal_Unit, true );
|
||||
m_gridDisplayCurrentSettings->SetCellValue( 0, 3, msg );
|
||||
#if 0 // Currently we use always the default netclass value
|
||||
value = board->GetCurrentMicroViaSize();
|
||||
msg = ReturnStringFromValue( g_UnitMetric, value, Internal_Unit, true );
|
||||
#endif
|
||||
msg = _( "Default" );
|
||||
m_gridDisplayCurrentSettings->SetCellValue( 1, 3, msg );
|
||||
|
||||
value = netclass->GetuViaDrill();
|
||||
msg = ReturnStringFromValue( g_UnitMetric, value, Internal_Unit, true );
|
||||
m_gridDisplayCurrentSettings->SetCellValue( 0, 4, msg );
|
||||
#if 0 // Currently we use always the default netclass value
|
||||
value = board->GetCurrentMicroViaDrill();
|
||||
if( value >= 0 )
|
||||
msg = ReturnStringFromValue( g_UnitMetric, value, Internal_Unit, true );
|
||||
else
|
||||
#endif
|
||||
msg = _( "Default" );
|
||||
m_gridDisplayCurrentSettings->SetCellValue( 1, 4, msg );
|
||||
|
||||
// Set all cells Roead Only
|
||||
for( int ii = 0; ii < m_gridDisplayCurrentSettings->GetNumberRows(); ii++ )
|
||||
{
|
||||
for( int jj = 0; jj < m_gridDisplayCurrentSettings->GetNumberCols(); jj++ )
|
||||
m_gridDisplayCurrentSettings->SetReadOnly( ii, jj, true );
|
||||
}
|
||||
|
||||
m_gridDisplayCurrentSettings->Fit( );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick( wxCommandEvent& event )
|
||||
/*******************************************************************/
|
||||
{
|
||||
bool change = false;
|
||||
switch( event.GetId() )
|
||||
{
|
||||
case ID_CURRENT_VALUES_TO_CURRENT_NET:
|
||||
change = m_Parent->Change_Net_Tracks_And_Vias_Sizes( m_Netcode, false );
|
||||
break;
|
||||
case ID_NETCLASS_VALUES_TO_CURRENT_NET:
|
||||
change = m_Parent->Change_Net_Tracks_And_Vias_Sizes( m_Netcode, true );
|
||||
break;
|
||||
case ID_ALL_TRACKS_VIAS:
|
||||
change = m_Parent->Reset_All_Tracks_And_Vias_To_Netclass_Values( true, true );
|
||||
break;
|
||||
case ID_ALL_VIAS:
|
||||
change = m_Parent->Reset_All_Tracks_And_Vias_To_Netclass_Values( false, true );
|
||||
break;
|
||||
case ID_ALL_TRACKS:
|
||||
change = m_Parent->Reset_All_Tracks_And_Vias_To_Netclass_Values( true, false );
|
||||
break;
|
||||
}
|
||||
|
||||
EndModal( 1 );
|
||||
if( change )
|
||||
m_Parent->DrawPanel->Refresh();
|
||||
}
|
||||
|
||||
|
||||
/*******************************
|
||||
*event handler for wxID_CANCEL
|
||||
******************************/
|
||||
void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnCancelClick( wxCommandEvent& event )
|
||||
{
|
||||
EndModal( 0 );
|
||||
}
|
50
pcbnew/dialog_global_edit_tracks_and_vias.h
Normal file
50
pcbnew/dialog_global_edit_tracks_and_vias.h
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2009 Jean-Pierre Charras, jean-pierre.charras@gipsa-lab.inpg.fr
|
||||
* Copyright (C) 1992-2009 Kicad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __dialog_global_edit_tracks_and_vias__
|
||||
#define __dialog_global_edit_tracks_and_vias__
|
||||
|
||||
#include "dialog_global_edit_tracks_and_vias_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS :
|
||||
public DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE
|
||||
{
|
||||
private:
|
||||
WinEDA_PcbFrame* m_Parent;
|
||||
int m_Netcode;
|
||||
|
||||
public:
|
||||
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS( WinEDA_PcbFrame* aParent, int aNetcode );
|
||||
~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS() {};
|
||||
|
||||
// Virtual event handlers, overided here
|
||||
void OnOkClick( wxCommandEvent& event );
|
||||
void OnCancelClick( wxCommandEvent& event );
|
||||
void MyInit();
|
||||
};
|
||||
|
||||
#endif //__dialog_global_edit_tracks_and_vias__
|
171
pcbnew/dialog_global_edit_tracks_and_vias_base.cpp
Normal file
171
pcbnew/dialog_global_edit_tracks_and_vias_base.cpp
Normal file
@ -0,0 +1,171 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 16 2008)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "dialog_global_edit_tracks_and_vias_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
wxBoxSizer* bMainSizer;
|
||||
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxStaticBoxSizer* sbCurrSettingsSizer;
|
||||
sbCurrSettingsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Current Settings") ), wxVERTICAL );
|
||||
|
||||
wxFlexGridSizer* fgSizeNetInfo;
|
||||
fgSizeNetInfo = new wxFlexGridSizer( 2, 2, 0, 0 );
|
||||
fgSizeNetInfo->SetFlexibleDirection( wxBOTH );
|
||||
fgSizeNetInfo->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_CurrentNetText = new wxStaticText( this, wxID_ANY, _("Current Net:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_CurrentNetText->Wrap( -1 );
|
||||
fgSizeNetInfo->Add( m_CurrentNetText, 0, wxALL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_CurrentNetName = new wxStaticText( this, wxID_ANY, _("NetName"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_CurrentNetName->Wrap( -1 );
|
||||
m_CurrentNetName->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
|
||||
|
||||
fgSizeNetInfo->Add( m_CurrentNetName, 0, wxALL, 5 );
|
||||
|
||||
m_CurrentNetclassText = new wxStaticText( this, wxID_ANY, _("Current NetClass:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_CurrentNetclassText->Wrap( -1 );
|
||||
fgSizeNetInfo->Add( m_CurrentNetclassText, 0, wxALL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_CurrentNetclassName = new wxStaticText( this, wxID_ANY, _("NetClassName"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_CurrentNetclassName->Wrap( -1 );
|
||||
m_CurrentNetclassName->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
|
||||
|
||||
fgSizeNetInfo->Add( m_CurrentNetclassName, 0, wxALL, 5 );
|
||||
|
||||
sbCurrSettingsSizer->Add( fgSizeNetInfo, 1, wxEXPAND, 5 );
|
||||
|
||||
m_gridDisplayCurrentSettings = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
// Grid
|
||||
m_gridDisplayCurrentSettings->CreateGrid( 2, 5 );
|
||||
m_gridDisplayCurrentSettings->EnableEditing( true );
|
||||
m_gridDisplayCurrentSettings->EnableGridLines( true );
|
||||
m_gridDisplayCurrentSettings->EnableDragGridSize( false );
|
||||
m_gridDisplayCurrentSettings->SetMargins( 0, 0 );
|
||||
|
||||
// Columns
|
||||
m_gridDisplayCurrentSettings->AutoSizeColumns();
|
||||
m_gridDisplayCurrentSettings->EnableDragColMove( false );
|
||||
m_gridDisplayCurrentSettings->EnableDragColSize( true );
|
||||
m_gridDisplayCurrentSettings->SetColLabelSize( 30 );
|
||||
m_gridDisplayCurrentSettings->SetColLabelValue( 0, _("Track size") );
|
||||
m_gridDisplayCurrentSettings->SetColLabelValue( 1, _("Via size") );
|
||||
m_gridDisplayCurrentSettings->SetColLabelValue( 2, _("Via Diameter") );
|
||||
m_gridDisplayCurrentSettings->SetColLabelValue( 3, _("Via drill") );
|
||||
m_gridDisplayCurrentSettings->SetColLabelValue( 4, _("uVia size") );
|
||||
m_gridDisplayCurrentSettings->SetColLabelValue( 5, _("uVia Drill") );
|
||||
m_gridDisplayCurrentSettings->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
|
||||
|
||||
// Rows
|
||||
m_gridDisplayCurrentSettings->AutoSizeRows();
|
||||
m_gridDisplayCurrentSettings->EnableDragRowSize( true );
|
||||
m_gridDisplayCurrentSettings->SetRowLabelSize( 100 );
|
||||
m_gridDisplayCurrentSettings->SetRowLabelValue( 0, _("Netclass value") );
|
||||
m_gridDisplayCurrentSettings->SetRowLabelValue( 1, _("Current value") );
|
||||
m_gridDisplayCurrentSettings->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
|
||||
|
||||
// Label Appearance
|
||||
|
||||
// Cell Defaults
|
||||
m_gridDisplayCurrentSettings->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
|
||||
sbCurrSettingsSizer->Add( m_gridDisplayCurrentSettings, 0, wxTOP|wxBOTTOM, 5 );
|
||||
|
||||
bMainSizer->Add( sbCurrSettingsSizer, 0, wxEXPAND, 5 );
|
||||
|
||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
||||
|
||||
wxBoxSizer* bLowerSizer;
|
||||
bLowerSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxStaticBoxSizer* sbSizerCommands;
|
||||
sbSizerCommands = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL );
|
||||
|
||||
wxFlexGridSizer* fgSizer2;
|
||||
fgSizer2 = new wxFlexGridSizer( 5, 2, 0, 0 );
|
||||
fgSizer2->SetFlexibleDirection( wxBOTH );
|
||||
fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_Net2CurrValueText = new wxStaticText( this, wxID_ANY, _("Set tracks and vias of the current Net to the current value"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_Net2CurrValueText->Wrap( -1 );
|
||||
fgSizer2->Add( m_Net2CurrValueText, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_Net2CurrValueButton = new wxButton( this, ID_CURRENT_VALUES_TO_CURRENT_NET, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer2->Add( m_Net2CurrValueButton, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_staticText5 = new wxStaticText( this, wxID_ANY, _("Set tracks and vias of the current Net to the Netclass value"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText5->Wrap( -1 );
|
||||
fgSizer2->Add( m_staticText5, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_button3 = new wxButton( this, ID_NETCLASS_VALUES_TO_CURRENT_NET, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer2->Add( m_button3, 0, wxALL, 5 );
|
||||
|
||||
m_staticText6 = new wxStaticText( this, wxID_ANY, _("Set ALL tracks and vias to their Netclass value"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText6->Wrap( -1 );
|
||||
fgSizer2->Add( m_staticText6, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_button4 = new wxButton( this, ID_ALL_TRACKS_VIAS, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer2->Add( m_button4, 0, wxALL, 5 );
|
||||
|
||||
m_staticText7 = new wxStaticText( this, wxID_ANY, _("Set ALL vias (no track) to their Netclass value"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText7->Wrap( -1 );
|
||||
fgSizer2->Add( m_staticText7, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_button5 = new wxButton( this, ID_ALL_VIAS, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer2->Add( m_button5, 0, wxALL, 5 );
|
||||
|
||||
m_staticText8 = new wxStaticText( this, wxID_ANY, _("Set ALL tracks (no via) to their Netclass value"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText8->Wrap( -1 );
|
||||
fgSizer2->Add( m_staticText8, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_button6 = new wxButton( this, ID_ALL_TRACKS, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer2->Add( m_button6, 0, wxALL, 5 );
|
||||
|
||||
sbSizerCommands->Add( fgSizer2, 1, wxEXPAND, 5 );
|
||||
|
||||
bLowerSizer->Add( sbSizerCommands, 1, 0, 5 );
|
||||
|
||||
wxBoxSizer* bbuttonsSizer;
|
||||
bbuttonsSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bbuttonsSizer->Add( m_buttonCancel, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
bLowerSizer->Add( bbuttonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
bMainSizer->Add( bLowerSizer, 1, wxEXPAND, 5 );
|
||||
|
||||
this->SetSizer( bMainSizer );
|
||||
this->Layout();
|
||||
|
||||
// Connect Events
|
||||
m_Net2CurrValueButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnOkClick ), NULL, this );
|
||||
m_button3->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnOkClick ), NULL, this );
|
||||
m_button4->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnOkClick ), NULL, this );
|
||||
m_button5->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnOkClick ), NULL, this );
|
||||
m_button6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnOkClick ), NULL, this );
|
||||
m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnCancelClick ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_Net2CurrValueButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnOkClick ), NULL, this );
|
||||
m_button3->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnOkClick ), NULL, this );
|
||||
m_button4->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnOkClick ), NULL, this );
|
||||
m_button5->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnOkClick ), NULL, this );
|
||||
m_button6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnOkClick ), NULL, this );
|
||||
m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::OnCancelClick ), NULL, this );
|
||||
}
|
1098
pcbnew/dialog_global_edit_tracks_and_vias_base.fbp
Normal file
1098
pcbnew/dialog_global_edit_tracks_and_vias_base.fbp
Normal file
File diff suppressed because it is too large
Load Diff
71
pcbnew/dialog_global_edit_tracks_and_vias_base.h
Normal file
71
pcbnew/dialog_global_edit_tracks_and_vias_base.h
Normal file
@ -0,0 +1,71 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 16 2008)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __dialog_global_edit_tracks_and_vias_base__
|
||||
#define __dialog_global_edit_tracks_and_vias_base__
|
||||
|
||||
#include <wx/intl.h>
|
||||
|
||||
#include <wx/string.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/grid.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define ID_CURRENT_VALUES_TO_CURRENT_NET 1000
|
||||
#define ID_NETCLASS_VALUES_TO_CURRENT_NET 1001
|
||||
#define ID_ALL_TRACKS_VIAS 1002
|
||||
#define ID_ALL_VIAS 1003
|
||||
#define ID_ALL_TRACKS 1004
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE : public wxDialog
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxStaticText* m_CurrentNetText;
|
||||
wxStaticText* m_CurrentNetName;
|
||||
wxStaticText* m_CurrentNetclassText;
|
||||
wxStaticText* m_CurrentNetclassName;
|
||||
wxGrid* m_gridDisplayCurrentSettings;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxStaticText* m_Net2CurrValueText;
|
||||
wxButton* m_Net2CurrValueButton;
|
||||
wxStaticText* m_staticText5;
|
||||
wxButton* m_button3;
|
||||
wxStaticText* m_staticText6;
|
||||
wxButton* m_button4;
|
||||
wxStaticText* m_staticText7;
|
||||
wxButton* m_button5;
|
||||
wxStaticText* m_staticText8;
|
||||
wxButton* m_button6;
|
||||
wxButton* m_buttonCancel;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
|
||||
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 647,380 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE();
|
||||
|
||||
};
|
||||
|
||||
#endif //__dialog_global_edit_tracks_and_vias_base__
|
63
pcbnew/dialog_mask_clearance.cpp
Normal file
63
pcbnew/dialog_mask_clearance.cpp
Normal file
@ -0,0 +1,63 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dialog_mask_clearance.cpp
|
||||
// Author: jean-pierre Charras
|
||||
// Modified by:
|
||||
// Created: 17 feb 2009
|
||||
// Licence: GPL
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
#include "pcbnew.h"
|
||||
#include "wxPcbStruct.h"
|
||||
#include "class_board_design_settings.h"
|
||||
|
||||
#include "dialog_mask_clearance.h"
|
||||
|
||||
/**
|
||||
* DIALOG_PADS_MASK_CLEARANCE_BASE, derived from DIALOG_PADS_MASK_CLEARANCE_BASE_BASE
|
||||
* @see dialog_dialog_mask_clearance_base.h and dialog_mask_clearance.cpp,
|
||||
* automatically created by wxFormBuilder
|
||||
*/
|
||||
|
||||
DIALOG_PADS_MASK_CLEARANCE::DIALOG_PADS_MASK_CLEARANCE( WinEDA_PcbFrame* parent ) :
|
||||
DIALOG_PADS_MASK_CLEARANCE_BASE( parent )
|
||||
{
|
||||
m_Parent = parent;
|
||||
MyInit();
|
||||
GetSizer()->SetSizeHints( this );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_PADS_MASK_CLEARANCE::MyInit()
|
||||
{
|
||||
SetFocus();
|
||||
|
||||
AddUnitSymbol( *m_MaskClearanceTitle );
|
||||
|
||||
int Internal_Unit = m_Parent->m_InternalUnits;
|
||||
PutValueInLocalUnits( *m_OptMaskMargin, g_DesignSettings.m_MaskMargin, Internal_Unit );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
void DIALOG_PADS_MASK_CLEARANCE::OnButtonOkClick( wxCommandEvent& event )
|
||||
/*******************************************************************/
|
||||
{
|
||||
g_DesignSettings.m_MaskMargin =
|
||||
ReturnValueFromTextCtrl( *m_OptMaskMargin, m_Parent->m_InternalUnits );
|
||||
|
||||
EndModal( 1 );
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
|
||||
*/
|
||||
|
||||
void DIALOG_PADS_MASK_CLEARANCE::OnButtonCancelClick( wxCommandEvent& event )
|
||||
{
|
||||
EndModal( 0 );
|
||||
}
|
||||
|
33
pcbnew/dialog_mask_clearance.h
Normal file
33
pcbnew/dialog_mask_clearance.h
Normal file
@ -0,0 +1,33 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Name: dialog_track_options.h
|
||||
// Author: jean-pierre Charras
|
||||
// Created: 17 feb 2009
|
||||
// Licence: GPL
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _DIALOG_MASK_CLEARANCE_H_
|
||||
#define _DIALOG_MASK_CLEARANCE_H_
|
||||
|
||||
#include "dialog_mask_clearance_base.h"
|
||||
|
||||
/**
|
||||
* DIALOG_PADS_MASK_CLEARANCE, derived from DIALOG_PADS_MASK_CLEARANCE_BASE
|
||||
* @see dialog_mask_clearance.h and dialog_mask_clearance.cpp,
|
||||
* automatically created by wxFormBuilder
|
||||
*/
|
||||
class DIALOG_PADS_MASK_CLEARANCE : public DIALOG_PADS_MASK_CLEARANCE_BASE
|
||||
{
|
||||
private:
|
||||
WinEDA_PcbFrame* m_Parent;
|
||||
|
||||
public:
|
||||
DIALOG_PADS_MASK_CLEARANCE( WinEDA_PcbFrame* parent );
|
||||
~DIALOG_PADS_MASK_CLEARANCE() {};
|
||||
private:
|
||||
void MyInit();
|
||||
virtual void OnButtonOkClick( wxCommandEvent& event );
|
||||
virtual void OnButtonCancelClick( wxCommandEvent& event );
|
||||
};
|
||||
|
||||
#endif // _DIALOG_MASK_CLEARANCE_H_
|
57
pcbnew/dialog_mask_clearance_base.cpp
Normal file
57
pcbnew/dialog_mask_clearance_base.cpp
Normal file
@ -0,0 +1,57 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 16 2008)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "dialog_mask_clearance_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
BEGIN_EVENT_TABLE( DIALOG_PADS_MASK_CLEARANCE_BASE, wxDialog )
|
||||
EVT_BUTTON( wxID_CANCEL, DIALOG_PADS_MASK_CLEARANCE_BASE::_wxFB_OnButtonCancelClick )
|
||||
EVT_BUTTON( wxID_OK, DIALOG_PADS_MASK_CLEARANCE_BASE::_wxFB_OnButtonOkClick )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
DIALOG_PADS_MASK_CLEARANCE_BASE::DIALOG_PADS_MASK_CLEARANCE_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
wxBoxSizer* bMainSizer;
|
||||
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxBoxSizer* bMainUpperSizer;
|
||||
bMainUpperSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxStaticBoxSizer* sbMiddleRightSizer;
|
||||
sbMiddleRightSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Dimensions:") ), wxVERTICAL );
|
||||
|
||||
m_MaskClearanceTitle = new wxStaticText( this, wxID_ANY, _("Pads Mask Clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_MaskClearanceTitle->Wrap( -1 );
|
||||
sbMiddleRightSizer->Add( m_MaskClearanceTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_OptMaskMargin = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_OptMaskMargin->SetToolTip( _("This is the clearance between pads and the mask") );
|
||||
|
||||
sbMiddleRightSizer->Add( m_OptMaskMargin, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||
|
||||
bMainUpperSizer->Add( sbMiddleRightSizer, 1, wxEXPAND, 5 );
|
||||
|
||||
bMainSizer->Add( bMainUpperSizer, 1, wxEXPAND, 5 );
|
||||
|
||||
m_sdbButtonsSizer = new wxStdDialogButtonSizer();
|
||||
m_sdbButtonsSizerOK = new wxButton( this, wxID_OK );
|
||||
m_sdbButtonsSizer->AddButton( m_sdbButtonsSizerOK );
|
||||
m_sdbButtonsSizerCancel = new wxButton( this, wxID_CANCEL );
|
||||
m_sdbButtonsSizer->AddButton( m_sdbButtonsSizerCancel );
|
||||
m_sdbButtonsSizer->Realize();
|
||||
bMainSizer->Add( m_sdbButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
|
||||
|
||||
this->SetSizer( bMainSizer );
|
||||
this->Layout();
|
||||
}
|
||||
|
||||
DIALOG_PADS_MASK_CLEARANCE_BASE::~DIALOG_PADS_MASK_CLEARANCE_BASE()
|
||||
{
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user