KiCad PCB EDA Suite
ee_inspection_tool.cpp File Reference
#include <sch_symbol.h>
#include <id.h>
#include <kiway.h>
#include <confirm.h>
#include <tool/conditional_menu.h>
#include <tool/selection_conditions.h>
#include <tools/ee_actions.h>
#include <tools/ee_inspection_tool.h>
#include <tools/ee_selection_tool.h>
#include <tools/ee_selection.h>
#include <sim/sim_plot_frame.h>
#include <sch_edit_frame.h>
#include <symbol_edit_frame.h>
#include <symbol_viewer_frame.h>
#include <eda_doc.h>
#include <sch_marker.h>
#include <project.h>
#include <dialogs/dialog_display_html_text_base.h>
#include <dialogs/dialog_erc.h>
#include <math/util.h>

Go to the source code of this file.

Classes

class  DIALOG_DISPLAY_HTML_TEXT
 

Functions

bool sort_by_pin_number (const LIB_PIN *ref, const LIB_PIN *tst)
 

Function Documentation

◆ sort_by_pin_number()

bool sort_by_pin_number ( const LIB_PIN ref,
const LIB_PIN tst 
)

Definition at line 200 of file ee_inspection_tool.cpp.

201 {
202  // Use number as primary key
203  int test = ref->GetNumber().Cmp( tst->GetNumber() );
204 
205  // Use DeMorgan variant as secondary key
206  if( test == 0 )
207  test = ref->GetConvert() - tst->GetConvert();
208 
209  // Use unit as tertiary key
210  if( test == 0 )
211  test = ref->GetUnit() - tst->GetUnit();
212 
213  return test < 0;
214 }
int GetUnit() const
Definition: lib_item.h:258
int GetConvert() const
Definition: lib_item.h:261
const wxString & GetNumber() const
Definition: lib_pin.h:116

References LIB_ITEM::GetConvert(), LIB_PIN::GetNumber(), and LIB_ITEM::GetUnit().

Referenced by EE_INSPECTION_TOOL::CheckSymbol().