KiCad PCB EDA Suite
Loading...
Searching...
No Matches
constraint_list_view.cpp File Reference
#include <widgets/constraint_list_view.h>
#include <set>
#include <wx/listctrl.h>
#include <board.h>
#include <footprint.h>
#include <constraints/pcb_constraint.h>
#include <constraints/board_constraint_adapter.h>

Go to the source code of this file.

Functions

void AddConstraintListColumns (wxListCtrl *aList)
 Add the four constraint columns (Item 1 / Item 2 / Constraint / State) to a report-mode list.
 
void PopulateConstraintList (wxListCtrl *aList, BOARD *aBoard, UNITS_PROVIDER *aUnits, const BOARD_CONSTRAINT_DIAGNOSTICS &aDiag, const std::function< void(long, PCB_CONSTRAINT *)> &aOnRow)
 Fill aList with one row per constraint on aBoard (board-owned then footprint-owned), each row showing up to two member cells, the type with its value in aUnits, and the diagnostic state taken from the caller-supplied aDiag (so the board is solved once and shared, not re-solved here).
 

Function Documentation

◆ AddConstraintListColumns()

void AddConstraintListColumns ( wxListCtrl * aList)

Add the four constraint columns (Item 1 / Item 2 / Constraint / State) to a report-mode list.

Definition at line 33 of file constraint_list_view.cpp.

References _, CONSTRAINT_COL_ITEM_1, CONSTRAINT_COL_ITEM_2, CONSTRAINT_COL_STATE, and CONSTRAINT_COL_TYPE.

Referenced by DIALOG_CONSTRAINT_LIST::DIALOG_CONSTRAINT_LIST(), and PANEL_CONSTRAINTS::PANEL_CONSTRAINTS().

◆ PopulateConstraintList()

void PopulateConstraintList ( wxListCtrl * aList,
BOARD * aBoard,
UNITS_PROVIDER * aUnits,
const BOARD_CONSTRAINT_DIAGNOSTICS & aDiag,
const std::function< void(long, PCB_CONSTRAINT *)> & aOnRow )

Fill aList with one row per constraint on aBoard (board-owned then footprint-owned), each row showing up to two member cells, the type with its value in aUnits, and the diagnostic state taken from the caller-supplied aDiag (so the board is solved once and shared, not re-solved here).

aOnRow is invoked with the inserted row index and constraint so the caller can record its own row->constraint mapping (a KIID or a raw pointer). The list is cleared first.

Definition at line 42 of file constraint_list_view.cpp.

References _, BOARD_CONSTRAINT_DIAGNOSTICS::conflicting, CONSTRAINT_COL_ITEM_2, CONSTRAINT_COL_STATE, CONSTRAINT_COL_TYPE, ConstraintDisplayLabel(), ConstraintMemberLabel(), BOARD::Constraints(), BOARD_CONSTRAINT_DIAGNOSTICS::errored, BOARD::Footprints(), UNITS_PROVIDER::GetUserUnits(), BOARD_CONSTRAINT_DIAGNOSTICS::redundant, and BOARD::ResolveItem().

Referenced by DIALOG_CONSTRAINT_LIST::Populate(), and PANEL_CONSTRAINTS::RefreshList().