Remove cover type; capitalize class name; make filename equal classname.

This commit is contained in:
Jeff Young 2021-07-28 19:50:17 +01:00
parent befd30a1a1
commit 87e4a1c672
5 changed files with 18 additions and 21 deletions

View File

@ -190,7 +190,7 @@ set( EESCHEMA_SRCS
symbol_viewer_frame.cpp
libarch.cpp
menubar.cpp
pin_number.cpp
pin_numbers.cpp
pin_type.cpp
sch_draw_panel.cpp
project_rescue.cpp

View File

@ -24,7 +24,7 @@
#include "dialog_lib_edit_pin_table.h"
#include "grid_tricks.h"
#include "lib_pin.h"
#include "pin_number.h"
#include "pin_numbers.h"
#include <bitmaps.h>
#include <confirm.h>
#include <symbol_edit_frame.h>
@ -254,12 +254,11 @@ public:
{
case COL_NUMBER:
case COL_NAME:
res = cmp( PinNumbers::Compare( lhStr, rhStr ), 0 );
res = cmp( PIN_NUMBERS::Compare( lhStr, rhStr ), 0 );
break;
case COL_NUMBER_SIZE:
case COL_NAME_SIZE:
res = cmp( ValueFromString( units, lhStr ),
ValueFromString( units, rhStr ) );
res = cmp( ValueFromString( units, lhStr ), ValueFromString( units, rhStr ) );
break;
case COL_LENGTH:
case COL_POSX:
@ -341,7 +340,7 @@ public:
std::sort( aRow.begin(), aRow.end(),
[]( LIB_PIN* lhs, LIB_PIN* rhs ) -> bool
{
return PinNumbers::Compare( lhs->GetNumber(), rhs->GetNumber() ) < 0;
return PIN_NUMBERS::Compare( lhs->GetNumber(), rhs->GetNumber() ) < 0;
} );
}
@ -789,7 +788,7 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnClose( wxCloseEvent& event )
void DIALOG_LIB_EDIT_PIN_TABLE::updateSummary()
{
PinNumbers pinNumbers;
PIN_NUMBERS pinNumbers;
for( LIB_PIN* pin : m_pins )
{

View File

@ -28,7 +28,7 @@
#include <grid_tricks.h>
#include <confirm.h>
#include <kiface_i.h>
#include <pin_number.h>
#include <pin_numbers.h>
#include <kicad_string.h>
#include <menus_helpers.h>
#include <widgets/grid_icon_text_helpers.h>
@ -248,7 +248,7 @@ public:
case COL_NUMBER:
case COL_BASE_NAME:
case COL_ALT_NAME:
res = cmp( PinNumbers::Compare( lhStr, rhStr ), 0 );
res = cmp( PIN_NUMBERS::Compare( lhStr, rhStr ), 0 );
break;
case COL_TYPE:
case COL_SHAPE:

View File

@ -22,7 +22,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "pin_number.h"
#include "pin_numbers.h"
#include <wx/crt.h>
namespace {
@ -68,7 +68,7 @@ wxString GetNextSymbol( const wxString& str, wxString::size_type& cursor )
}
wxString PinNumbers::GetSummary() const
wxString PIN_NUMBERS::GetSummary() const
{
wxString ret;
@ -108,7 +108,7 @@ wxString PinNumbers::GetSummary() const
}
int PinNumbers::Compare( const PinNumber& lhs, const PinNumber& rhs )
int PIN_NUMBERS::Compare( const PinNumber& lhs, const PinNumber& rhs )
{
wxString::size_type cursor1 = 0;
wxString::size_type cursor2 = 0;

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Simon Richter
* Copyright (C) 2015 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 2021 KiCad Developers, see CHANGELOG.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
@ -22,32 +22,30 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef PIN_NUMBER_H_
#define PIN_NUMBER_H_ 1
#ifndef PIN_NUMBERS_H
#define PIN_NUMBERS_H
#include <wx/string.h>
#include <set>
typedef wxString PinNumber;
class PinNumbers
class PIN_NUMBERS
{
public:
wxString GetSummary() const;
static int Compare( PinNumber const &lhs, PinNumber const &rhs );
static int Compare( const wxString& lhs, const wxString& rhs );
private:
struct less
{
bool operator()( PinNumber const &lhs, PinNumber const &rhs ) const
bool operator()( const wxString& lhs, const wxString& rhs ) const
{
return Compare( lhs, rhs ) < 0;
}
};
typedef std::set< PinNumber, less > container_type;
typedef std::set<wxString, less> container_type;
public:
typedef container_type::value_type value_type;