KiCad PCB EDA Suite
ee_inspection_tool.cpp File Reference
#include <sch_component.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 <search_stack.h>
#include <sim/sim_plot_frame.h>
#include <sch_edit_frame.h>
#include <lib_edit_frame.h>
#include <lib_view_frame.h>
#include <eda_doc.h>
#include <invoke_sch_dialog.h>
#include <project.h>
#include <dialogs/dialog_display_info_HTML_base.h>
#include <math/util.h>

Go to the source code of this file.

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 96 of file ee_inspection_tool.cpp.

97 {
98  // Use number as primary key
99  int test = ref->GetNumber().Cmp( tst->GetNumber() );
100 
101  // Use DeMorgan variant as secondary key
102  if( test == 0 )
103  test = ref->GetConvert() - tst->GetConvert();
104 
105  // Use unit as tertiary key
106  if( test == 0 )
107  test = ref->GetUnit() - tst->GetUnit();
108 
109  return test < 0;
110 }
int GetUnit() const
Definition: lib_item.h:295
int GetConvert() const
Definition: lib_item.h:298
const wxString & GetNumber() const
Definition: lib_pin.h:192

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

Referenced by EE_INSPECTION_TOOL::checkPart().