7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 23:13:43 +00:00

CvPcb and Eeschema part 1 housekeeping.

This commit is contained in:
Wayne Stambaugh 2025-01-18 10:32:42 -05:00
parent 975fe32fa7
commit d53ed205f2
68 changed files with 443 additions and 267 deletions
cvpcb
eeschema

View File

@ -109,7 +109,7 @@ int CVPCB_MAINFRAME::buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList,
fn.GetFullName() );
if( ! aErrorMessages->IsEmpty() )
*aErrorMessages << wxT("\n\n");
*aErrorMessages << wxT( "\n\n" );
*aErrorMessages += error_msg;
}
@ -128,7 +128,7 @@ int CVPCB_MAINFRAME::buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList,
error_msg.Printf( _( "Error opening equivalence file '%s'." ), tmp );
if( ! aErrorMessages->IsEmpty() )
*aErrorMessages << wxT("\n\n");
*aErrorMessages << wxT( "\n\n" );
*aErrorMessages += error_msg;
}
@ -214,7 +214,8 @@ void CVPCB_MAINFRAME::AutomaticFootprintMatching()
if( equivItem.m_ComponentValue.CmpNoCase( component->GetValue() ) != 0 )
continue;
const FOOTPRINT_INFO *fp = m_FootprintsList->GetFootprintInfo( equivItem.m_FootprintFPID );
const FOOTPRINT_INFO* fp =
m_FootprintsList->GetFootprintInfo( equivItem.m_FootprintFPID );
bool equ_is_unique = true;
unsigned next = idx+1;

View File

@ -285,10 +285,11 @@ void CVPCB_MAINFRAME::setupUIConditions()
#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
#define CHECK( x ) ACTION_CONDITIONS().Check( x )
mgr->SetConditions( CVPCB_ACTIONS::saveAssociationsToSchematic, ENABLE( cond.ContentModified() ) );
mgr->SetConditions( CVPCB_ACTIONS::saveAssociationsToFile, ENABLE( cond.ContentModified() ) );
mgr->SetConditions( ACTIONS::undo, ENABLE( cond.UndoAvailable() ) );
mgr->SetConditions( ACTIONS::redo, ENABLE( cond.RedoAvailable() ) );
mgr->SetConditions( CVPCB_ACTIONS::saveAssociationsToSchematic,
ENABLE( cond.ContentModified() ) );
mgr->SetConditions( CVPCB_ACTIONS::saveAssociationsToFile, ENABLE( cond.ContentModified() ) );
mgr->SetConditions( ACTIONS::undo, ENABLE( cond.UndoAvailable() ) );
mgr->SetConditions( ACTIONS::redo, ENABLE( cond.RedoAvailable() ) );
auto compFilter =
[this] ( const SELECTION& )
@ -348,6 +349,7 @@ void CVPCB_MAINFRAME::setupEventHandlers()
GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociationsToSchematic );
Close( true );
}, wxID_OK );
Bind( wxEVT_BUTTON,
[this]( wxCommandEvent& )
{
@ -503,7 +505,7 @@ void CVPCB_MAINFRAME::updateFootprintViewerOnIdle( wxIdleEvent& aEvent )
Unbind( wxEVT_IDLE, &CVPCB_MAINFRAME::updateFootprintViewerOnIdle, this );
m_viewerPendingUpdate = false;
// On some plateforms (OSX) the focus is lost when the viewers (fp and 3D viewers)
// On some platforms (OSX) the focus is lost when the viewers (fp and 3D viewers)
// are opened and refreshed when a new footprint is selected.
// If the listbox has the focus before selecting a new footprint, it will be forced
// after selection.
@ -1205,10 +1207,12 @@ void CVPCB_MAINFRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
m_cannotClose = true;
readNetListAndFpFiles( payload );
m_cannotClose = false;
/* @todo
Go into SCH_EDIT_FRAME::OnOpenCvpcb( wxCommandEvent& event ) and trim GNL_ALL down.
*/
break;
case MAIL_RELOAD_LIB:
m_cannotClose = true;
LoadFootprintFiles();
@ -1216,6 +1220,7 @@ void CVPCB_MAINFRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
BuildLibrariesList();
m_cannotClose = false;
break;
default:
; // ignore most
}

View File

@ -248,7 +248,7 @@ void DIALOG_CONFIG_EQUFILES::OnAddFiles( wxCommandEvent& event )
else
{
DisplayErrorMessage( this, wxString::Format( _( "File '%s' already exists in list." ),
filepath.GetData() ) );
filepath.GetData() ) );
}
}
}

View File

@ -44,19 +44,21 @@ DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR(
m_lineCount = 0;
}
void DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::Add( const wxString& aRef, const wxString& aFpSchName,
const wxString& aFpCmpName )
const wxString& aFpCmpName )
{
long idx = m_listFp->InsertItem(m_lineCount, aRef );
m_listFp->SetItem(idx, COL_FPSCH, aFpSchName );
m_listFp->SetItem(idx, COL_SELSCH, wxT("") );
m_listFp->SetItem(idx, COL_SELCMP, wxT("X") );
m_listFp->SetItem(idx, COL_FPCMP, aFpCmpName );
m_listFp->SetItem( idx, COL_FPSCH, aFpSchName );
m_listFp->SetItem( idx, COL_SELSCH, wxT( "" ) );
m_listFp->SetItem( idx, COL_SELCMP, wxT( "X" ) );
m_listFp->SetItem( idx, COL_FPCMP, aFpCmpName );
m_lineCount ++;
}
int DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::GetSelection( const wxString& aReference )
{
// Find Reference
@ -64,7 +66,7 @@ int DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::GetSelection( const wxString& aRefer
{
if( m_listFp->GetItemText( ii, COL_REF ) == aReference )
{
if( m_listFp->GetItemText( ii, COL_SELSCH ) != wxT("X") )
if( m_listFp->GetItemText( ii, COL_SELSCH ) != wxT( "X" ) )
return 1;
return 0;
@ -74,6 +76,7 @@ int DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::GetSelection( const wxString& aRefer
return -1;
}
void DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::OnColumnClick( wxListEvent& event )
{
// When clicking on the column title:
@ -101,11 +104,12 @@ void DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::OnColumnClick( wxListEvent& event )
for( int i = 0; i < m_listFp->GetItemCount(); i++ )
{
m_listFp->SetItem( i, colclr, wxT("") );
m_listFp->SetItem( i, colset, wxT("X") );
m_listFp->SetItem( i, colclr, wxT( "" ) );
m_listFp->SetItem( i, colset, wxT( "X" ) );
}
}
void DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::OnItemClicked( wxMouseEvent& event )
{
wxPoint pos = event.GetPosition();
@ -140,8 +144,8 @@ void DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::OnItemClicked( wxMouseEvent& event
// Move selection to schematic or cmp file choice
// according to the column position (COL_SELCMP or COL_SELSCH)
m_listFp->SetItem( idx, colclr, wxT("") );
m_listFp->SetItem( idx, colset, wxT("X") );
m_listFp->SetItem( idx, colclr, wxT( "" ) );
m_listFp->SetItem( idx, colset, wxT( "X" ) );
event.Skip();
}
@ -180,7 +184,7 @@ void DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::recalculateColumns()
maxRefLength += margin;
totalLength = maxRefLength + sel_length + sel_length;
int cwidth = (GetClientSize().x - totalLength) / 2;
int cwidth = ( GetClientSize().x - totalLength ) / 2;
m_listFp->SetColumnWidth( COL_REF, maxRefLength );
m_listFp->SetColumnWidth( COL_FPSCH, cwidth - 2 );

View File

@ -45,10 +45,9 @@ public:
/**
* @param aReference is the component schematic reference.
* @return the selection option:
* 0 for fpid text from the netlist
* 1 for fpid text from the cmp file
* -1 on error
* @retval 0 for fpid text from the netlist.
* @retval 1 for fpid text from the cmp file.
* @retval -1 on error.
*/
int GetSelection( const wxString& aReference );

View File

@ -312,7 +312,7 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateHToolbar()
UpdateZoomSelectBox();
m_mainToolBar->AddControl( m_zoomSelectBox );
// Option to run Zoom automatique on footprint selection changge
// Option to run Zoom automatique on footprint selection change
m_mainToolBar->AddTool( ID_CVPCB_FPVIEWER_AUTOZOOM_TOOL, wxEmptyString,
KiScaledBitmap( BITMAPS::zoom_auto_fit_in_page, this ),
_( "Automatic Zoom on footprint change" ),
@ -418,7 +418,8 @@ FOOTPRINT* DISPLAY_FOOTPRINTS_FRAME::GetFootprint( const wxString& aFootprintNam
// See if the library requested is in the library table
if( !fpTable->HasLibrary( libNickname ) )
{
aReporter.Report( wxString::Format( _( "Library '%s' is not in the footprint library table." ),
aReporter.Report( wxString::Format( _( "Library '%s' is not in the footprint library "
"table." ),
libNickname ),
RPT_SEVERITY_ERROR );
return nullptr;

View File

@ -53,9 +53,10 @@ public:
void UpdateToolbarControlSizes() override;
/**
* Refresh the full display for this frame:
* Set the title, the status line and redraw the canvas
* Must be called after the footprint to display is modified
* Refresh the full display for this frame.
*
* Set the title, the status line and redraw the canvas.
* Must be called after the footprint to display is modified.
*/
void InitDisplay();
@ -76,7 +77,7 @@ public:
MAGNETIC_SETTINGS* GetMagneticItemsSettings() override;
///< @copydoc EDA_DRAW_FRAME::UpdateMsgPanel()
/// @copydoc EDA_DRAW_FRAME::UpdateMsgPanel()
void UpdateMsgPanel() override;
COLOR_SETTINGS* GetColorSettings( bool aForceRefresh = false ) const override;

View File

@ -172,7 +172,7 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a
{
SetItemCount( m_footprintList.GetCount() );
SetSelection( selection, true );
RefreshItems( 0L, m_footprintList.GetCount()-1 );
RefreshItems( 0L, m_footprintList.GetCount() - 1 );
UpdateWidth();
}
}

View File

@ -114,7 +114,7 @@ void LIBRARY_LISTBOX::Finish()
{
if( m_libraryList.Count() )
{
RefreshItems( 0L, m_libraryList.Count()-1 );
RefreshItems( 0L, m_libraryList.Count() - 1 );
UpdateWidth();
}
}

View File

@ -55,12 +55,12 @@ void ITEMS_LISTBOX_BASE::UpdateWidth( int aLine )
if( aLine < 0 )
{
columnWidth = 0;
for( int ii = 0; ii < itemCount; ii++ )
{
UpdateLineWidth( (unsigned)ii, dc );
}
}
// Zero or above: update from a single line.
else
{
@ -103,7 +103,7 @@ int ITEMS_LISTBOX_BASE::GetSelection()
void ITEMS_LISTBOX_BASE::DeselectAll()
{
for( int i = GetFirstSelected(); i >= 0; i = GetNextSelected(i))
for( int i = GetFirstSelected(); i >= 0; i = GetNextSelected( i ) )
{
Select( i, false );
}

View File

@ -36,6 +36,7 @@
void CVPCB_MAINFRAME::doReCreateMenuBar()
{
COMMON_CONTROL* tool = m_toolManager->GetTool<COMMON_CONTROL>();
// wxWidgets handles the Mac Application menu behind the scenes, but that means
// we always have to start from scratch with a new wxMenuBar.
wxMenuBar* oldMenuBar = GetMenuBar();

View File

@ -54,13 +54,13 @@ static int guessNickname( FP_LIB_TABLE* aTbl, LIB_ID* aFootprintId )
std::vector<wxString> nicks = aTbl->GetLogicalLibs();
// Search each library going through libraries alphabetically.
for( unsigned libNdx = 0; libNdx<nicks.size(); ++libNdx )
for( unsigned libNdx = 0; libNdx < nicks.size(); ++libNdx )
{
wxArrayString fpnames;
aTbl->FootprintEnumerate( fpnames, nicks[libNdx], true );
for( unsigned nameNdx = 0; nameNdx<fpnames.size(); ++nameNdx )
for( unsigned nameNdx = 0; nameNdx < fpnames.size(); ++nameNdx )
{
if( fpname == fpnames[nameNdx] )
{
@ -103,7 +103,7 @@ bool CVPCB_MAINFRAME::readNetListAndFpFiles( const std::string& aNetlist )
if( m_netlist.AnyFootprintsLinked() )
{
for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
{
COMPONENT* component = m_netlist.GetComponent( i );
@ -129,7 +129,7 @@ bool CVPCB_MAINFRAME::readNetListAndFpFiles( const std::string& aNetlist )
try
{
for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
{
COMPONENT* component = m_netlist.GetComponent( i );
@ -263,7 +263,7 @@ bool CVPCB_MAINFRAME::readNetListAndFpFiles( const std::string& aNetlist )
int firstUnassigned = wxNOT_FOUND;
// Populates the component list box:
for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
{
COMPONENT* component = m_netlist.GetComponent( i );

View File

@ -70,9 +70,11 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
wxString msg_bold = _( "Footprint Filters:" );
wxStaticText* text = new wxStaticText( m_mainToolBar, wxID_ANY, msg_bold );
text->SetFont( m_mainToolBar->GetFont().Bold() );
#ifdef __WXGTK3__
text->SetLabelMarkup( "<b>" + msg_bold + "</b>" );
#endif
m_mainToolBar->AddControl( text );
m_mainToolBar->Add( CVPCB_ACTIONS::FilterFPbyFPFilters, ACTION_TOOLBAR::TOGGLE );

View File

@ -79,7 +79,8 @@ TOOL_ACTION CVPCB_ACTIONS::saveAssociationsToFile( TOOL_ACTION_ARGS()
.DefaultHotkey( MD_CTRL + 'S' )
.LegacyHotkeyName( "Save" )
.FriendlyName( _( "Save to Schematic and File" ) )
.Tooltip( _( "Save footprint assignments in 'footprint' fields of schematic symbols and then save schematic files" ) )
.Tooltip( _( "Save footprint assignments in 'footprint' fields of schematic symbols and "
"then save schematic files" ) )
.Icon( BITMAPS::save ) );
// Actions to navigate the display
@ -145,7 +146,6 @@ TOOL_ACTION CVPCB_ACTIONS::deleteAll( TOOL_ACTION_ARGS()
.FriendlyName( _( "Delete All Footprint Assignments" ) )
.Icon( BITMAPS::delete_association ) );
// Actions to filter the footprint list
TOOL_ACTION CVPCB_ACTIONS::FilterFPbyFPFilters( TOOL_ACTION_ARGS()
.Name( "cvpcb.Control.FilterFPbyFPFilters" )

View File

@ -27,9 +27,7 @@
/**
* CVPCB_CONTROL
*
* Handles actions in main cvpcb window.
* Handles action in main CvPcb window.
*/
class CVPCB_ASSOCIATION_TOOL : public TOOL_INTERACTIVE
@ -44,68 +42,68 @@ public:
/**
* Undo the footprint associations most recently done.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int Undo( const TOOL_EVENT& aEvent );
/**
* Redo the footprint associations most recently done.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int Redo( const TOOL_EVENT& aEvent );
/**
* Associate the selected footprint with the currently selected components.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int Associate( const TOOL_EVENT& aEvent );
/**
* Perform automatic footprint association.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int AutoAssociate( const TOOL_EVENT& aEvent );
/**
* Delete all associations.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int DeleteAll( const TOOL_EVENT& aEvent );
/**
* Delete the selected associations.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int DeleteAssoc( const TOOL_EVENT& aEvent );
/**
* Copy the selected associations to the clipboard.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int CopyAssoc( const TOOL_EVENT& aEvent );
/**
* Cut the selected associations to the clipboard.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int CutAssoc( const TOOL_EVENT& aEvent );
/**
* Paste the clipboard onto the current selection.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int PasteAssoc( const TOOL_EVENT& aEvent );
/*
* Sets up handlers for various events.
/**
* Set up handlers for various events.
*/
void setTransitions() override;

View File

@ -178,7 +178,7 @@ int CVPCB_CONTROL::ShowFootprintViewer( const TOOL_EVENT& aEvent )
fpframe = (DISPLAY_FOOTPRINTS_FRAME*) m_frame->Kiway().Player( FRAME_CVPCB_DISPLAY, true,
m_frame );
// If Kiway() cannot create the eeschema frame, it shows a error message, and
// If Kiway() cannot create the Eeschema frame, it shows a error message, and
// frame is null
if( !fpframe )
return 0;
@ -249,8 +249,10 @@ int CVPCB_CONTROL::ToNA( const TOOL_EVENT& aEvent )
{
CVPCB_MAINFRAME::ITEM_DIR dir = aEvent.Parameter<CVPCB_MAINFRAME::ITEM_DIR>();
std::vector<unsigned int> naComp = m_frame->GetComponentIndices( CVPCB_MAINFRAME::NA_COMPONENTS );
std::vector<unsigned int> tempSel = m_frame->GetComponentIndices( CVPCB_MAINFRAME::SEL_COMPONENTS );
std::vector<unsigned int> naComp =
m_frame->GetComponentIndices( CVPCB_MAINFRAME::NA_COMPONENTS );
std::vector<unsigned int> tempSel =
m_frame->GetComponentIndices( CVPCB_MAINFRAME::SEL_COMPONENTS );
// No unassociated components
if( naComp.empty() )
@ -341,7 +343,8 @@ void CVPCB_CONTROL::setTransitions()
// Management actions
Go( &CVPCB_CONTROL::ShowEquFileTable, CVPCB_ACTIONS::showEquFileTable.MakeEvent() );
Go( &CVPCB_CONTROL::SaveAssociationsToSchematic, CVPCB_ACTIONS::saveAssociationsToSchematic.MakeEvent() );
Go( &CVPCB_CONTROL::SaveAssociationsToSchematic,
CVPCB_ACTIONS::saveAssociationsToSchematic.MakeEvent() );
Go( &CVPCB_CONTROL::SaveAssociationsToFile,CVPCB_ACTIONS::saveAssociationsToFile.MakeEvent() );
// Navigation actions

View File

@ -27,9 +27,7 @@
/**
* CVPCB_CONTROL
*
* Handles actions in main cvpcb window.
* Handles actions in main CvPcb window.
*/
class CVPCB_CONTROL : public TOOL_INTERACTIVE
@ -42,45 +40,45 @@ public:
void Reset( RESET_REASON aReason ) override;
/**
* Main processing loop for the CVPCB window. This function will constantly loop and
* Main processing loop for the CvPcb window. This function will constantly loop and
* to process various actions taken in the window.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int Main( const TOOL_EVENT& aEvent );
/**
* Rotate focus in the CVPCB window
* Rotate focus in the CVPCB window.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int ChangeFocus( const TOOL_EVENT& aEvent );
/**
* Move the selected component to the not associated one in the specified direction.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int ToNA( const TOOL_EVENT& aEvent );
/**
* Show the dialog to modify the included footprint association files (.equ)
* Show the dialog to modify the included footprint association files (.equ).
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int ShowEquFileTable( const TOOL_EVENT& aEvent );
/**
* Save the associations to the schematic.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int SaveAssociationsToSchematic( const TOOL_EVENT& aEvent );
/**
* Save the associations to the schematic and save schematic to file.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int SaveAssociationsToFile( const TOOL_EVENT& aEvent );
@ -88,28 +86,29 @@ public:
* Create or Update the frame showing the current highlighted footprint
* and (if showed) the 3D display frame.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int ShowFootprintViewer( const TOOL_EVENT& aEvent );
/**
* Filter the footprint list by toggling the given filter type.
*
* The event parameter corresponds to the filter type (using the FP_FILTER_T from the
* FOOTPRINTS_LISTBOX class)
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int ToggleFootprintFilter( const TOOL_EVENT& aEvent );
/**
* Update the menu to reflect the current tool states.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int UpdateMenu( const TOOL_EVENT& aEvent );
/*
* Sets up handlers for various events.
/**
* Set up handlers for various events.
*/
void setTransitions() override;

View File

@ -99,5 +99,5 @@ void CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::setTransitions()
{
Go( &CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::UpdateMenu, ACTIONS::updateMenu.MakeEvent() );
Go( &CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main,
CVPCB_ACTIONS::selectionActivate.MakeEvent() );
CVPCB_ACTIONS::selectionActivate.MakeEvent() );
}

View File

@ -29,7 +29,7 @@
/**
* Selection tool for the footprint viewer in cvpcb.
* Selection tool for the footprint viewer in CvPcb.
*/
class CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL : public TOOL_INTERACTIVE
{
@ -61,11 +61,11 @@ public:
/**
* Update the menu to reflect the current tool states.
*
* @param aEvent is the event generated by the tool framework
* @param aEvent is the event generated by the tool framework.
*/
int UpdateMenu( const TOOL_EVENT& aEvent );
///< Sets up handlers for various events.
/// Set up handlers for various events.
void setTransitions() override;
private:

View File

@ -56,6 +56,7 @@ bool API_HANDLER_SCH::validateDocumentInternal( const DocumentSpecifier& aDocume
// TODO(JE) need serdes for SCH_SHEET_PATH <> SheetPath
return true;
//wxString currentPath = m_frame->GetCurrentSheet().PathAsString();
//return 0 == aDocument.sheet_path().compare( currentPath.ToStdString() );
}
@ -67,6 +68,7 @@ HANDLER_RESULT<GetOpenDocumentsResponse> API_HANDLER_SCH::handleGetOpenDocuments
if( aCtx.Request.type() != DocumentType::DOCTYPE_SCHEMATIC )
{
ApiResponseStatus e;
// No message needed for AS_UNHANDLED; this is an internal flag for the API server
e.set_status( ApiStatusCode::AS_UNHANDLED );
return tl::unexpected( e );
@ -108,7 +110,8 @@ HANDLER_RESULT<std::unique_ptr<EDA_ITEM>> API_HANDLER_SCH::createItemForType( KI
{
ApiResponseStatus e;
e.set_status( ApiStatusCode::AS_BAD_REQUEST );
e.set_error_message( fmt::format( "Tried to create a symbol in {}, which is not a schematic",
e.set_error_message( fmt::format( "Tried to create a symbol in {}, which is not a "
"schematic",
aContainer->GetFriendlyName().ToStdString() ) );
return tl::unexpected( e );
}

View File

@ -296,7 +296,8 @@ int DIALOG_ANNOTATE::GetStartNumber()
void SCH_EDIT_FRAME::OnAnnotate()
{
DIALOG_ANNOTATE* dlg = static_cast<DIALOG_ANNOTATE*>( wxWindow::FindWindowByName( DLG_WINDOW_NAME ) );
DIALOG_ANNOTATE* dlg =
static_cast<DIALOG_ANNOTATE*>( wxWindow::FindWindowByName( DLG_WINDOW_NAME ) );
if( !dlg )
{

View File

@ -294,7 +294,8 @@ void DIALOG_BOM::OnRunGenerator( wxCommandEvent& event )
bool status = false;
if( m_parent->ReadyToNetlist( _( "Generating BOM requires a fully annotated schematic." ) ) )
status = m_parent->WriteNetListFile( NET_TYPE_BOM, fullfilename, GNL_OPT_BOM|GNL_ALL, &reporter );
status = m_parent->WriteNetListFile( NET_TYPE_BOM, fullfilename,
GNL_OPT_BOM | GNL_ALL, &reporter );
if( !status )
DisplayErrorMessage( this, _( "Failed to create file." ) );
@ -489,4 +490,4 @@ BOM_GENERATOR_HANDLER* DIALOG_BOM::selectedGenerator()
return nullptr;
return m_generators[idx].get();
}
}

View File

@ -79,7 +79,8 @@ DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS( SCH_EDIT_FRAME* aParent, SCH_SYMBO
m_newId->ChangeValue( UnescapeString( m_symbol->GetLibId().Format() ) );
m_specifiedReference->ChangeValue( m_symbol->GetRef( currentSheet ) );
m_specifiedValue->ChangeValue( UnescapeString( m_symbol->GetField( VALUE_FIELD )->GetText() ) );
m_specifiedValue->ChangeValue(
UnescapeString( m_symbol->GetField( VALUE_FIELD )->GetText() ) );
m_specifiedId->ChangeValue( UnescapeString( m_symbol->GetLibId().Format() ) );
}
else
@ -568,7 +569,7 @@ int DIALOG_CHANGE_SYMBOLS::processSymbols( SCH_COMMIT* aCommit,
std::map<SCH_SYMBOL*, SYMBOL_CHANGE_INFO>::iterator it = symbols.begin();
// Remove all symbols that don't have a valid library symbol link or enough units to
// satify the library symbol update.
// satisfy the library symbol update.
while( it != symbols.end() )
{
SCH_SYMBOL* symbol = it->first;
@ -619,8 +620,8 @@ int DIALOG_CHANGE_SYMBOLS::processSymbols( SCH_COMMIT* aCommit,
// When we replace the lib symbol below, we free the associated pins if the new symbol has
// fewer than the original. This will cause the connection graph to be out of date unless
// we replace references in the graph to the old symbol/pins with references to the ones stored
// in the undo stack.
// we replace references in the graph to the old symbol/pins with references to the ones
// stored in the undo stack.
if( connectionGraph )
connectionGraph->ExchangeItem( symbol, symbol_copy );
}

View File

@ -77,7 +77,7 @@ protected:
checkAll( false );
}
///< Select or deselect all fields in the listbox widget
/// Select or deselect all fields in the listbox widget.
void checkAll( bool aCheck );
private:
@ -93,7 +93,7 @@ private:
SCH_SYMBOL* m_symbol;
MODE m_mode;
///< Set of field names that should have values updated
/// Set of field names that should have values updated.
std::set<wxString> m_updateFields;
};

View File

@ -74,6 +74,7 @@ bool DIALOG_DESIGN_BLOCK_PROPERTIES::TransferDataToWindow()
// Typical assignment operator does not work here because of the ordered_map
auto source = m_designBlock->GetFields();
m_fields.clear();
for( const auto& field : source )
{
m_fields[field.first] = field.second;

Some files were not shown because too many files have changed in this diff Show More