@ -41,10 +41,10 @@
# include <limits> // std::numeric_limits
void CADSTAR_PCB_ARCHIVE_LOADER : : Load ( : : BOARD * aBoard , : : PROJECT * aProject )
void CADSTAR_PCB_ARCHIVE_LOADER : : Load ( BOARD * aBoard , PROJECT * aProject )
{
mB oard = aBoard ;
mP roject = aProject ;
m_b oard = aBoard ;
m_p roject = aProject ;
Parse ( ) ;
@ -71,7 +71,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::Load( ::BOARD* aBoard, ::PROJECT* aProject )
( double ) maxDesignSizekicad / PCB_IU_PER_MM ) ) ;
}
mD esignCenter =
m_d esignCenter =
( Assignments . Technology . DesignArea . first + Assignments . Technology . DesignArea . second )
/ 2 ;
@ -133,7 +133,7 @@ std::vector<FOOTPRINT*> CADSTAR_PCB_ARCHIVE_LOADER::GetLoadedLibraryFootpints()
{
std : : vector < FOOTPRINT * > retval ;
for ( std : : pair < SYMDEF_ID , FOOTPRINT * > fpPair : mL ibraryMap )
for ( std : : pair < SYMDEF_ID , FOOTPRINT * > fpPair : m_l ibraryMap )
{
retval . push_back ( static_cast < FOOTPRINT * > ( fpPair . second - > Clone ( ) ) ) ;
}
@ -146,7 +146,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::logBoardStackupWarning(
const wxString & aCadstarLayerName ,
const PCB_LAYER_ID & aKiCadLayer )
{
if ( mL ogLayerWarnings )
if ( m_l ogLayerWarnings )
{
wxLogWarning ( wxString : : Format (
_ ( " The CADSTAR layer '%s' has no KiCad equivalent. All elements on this "
@ -159,7 +159,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::logBoardStackupWarning(
void CADSTAR_PCB_ARCHIVE_LOADER : : logBoardStackupMessage ( const wxString & aCadstarLayerName ,
const PCB_LAYER_ID & aKiCadLayer )
{
if ( mL ogLayerWarnings )
if ( m_l ogLayerWarnings )
{
wxLogMessage ( wxString : : Format (
_ ( " The CADSTAR layer '%s' has been assumed to be a technical layer. All "
@ -170,7 +170,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::logBoardStackupMessage( const wxString& aCadsta
void CADSTAR_PCB_ARCHIVE_LOADER : : initStackupItem ( const LAYER & aCadstarLayer ,
: : BOARD_STACKUP_ITEM * aKiCadItem ,
BOARD_STACKUP_ITEM * aKiCadItem ,
int aDielectricSublayer )
{
if ( ! aCadstarLayer . MaterialId . IsEmpty ( ) )
@ -280,12 +280,12 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup()
// Create a new stackup from default stackup list
BOARD_STACKUP & stackup = mB oard - > GetDesignSettings ( ) . GetStackupDescriptor ( ) ;
BOARD_STACKUP & stackup = m_b oard - > GetDesignSettings ( ) . GetStackupDescriptor ( ) ;
stackup . RemoveAll ( ) ;
mB oard - > SetEnabledLayers ( LSET : : AllLayersMask ( ) ) ;
mB oard - > SetVisibleLayers ( LSET : : AllLayersMask ( ) ) ;
mB oard - > SetCopperLayerCount ( totalCopperLayers ) ;
stackup . BuildDefaultStackupList ( & mB oard - > GetDesignSettings ( ) , totalCopperLayers ) ;
m_b oard - > SetEnabledLayers ( LSET : : AllLayersMask ( ) ) ;
m_b oard - > SetVisibleLayers ( LSET : : AllLayersMask ( ) ) ;
m_b oard - > SetCopperLayerCount ( totalCopperLayers ) ;
stackup . BuildDefaultStackupList ( & m_b oard - > GetDesignSettings ( ) , totalCopperLayers ) ;
size_t stackIndex = 0 ;
@ -318,7 +318,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup()
case LAYER_TYPE : : POWER :
copperType = LAYER_T : : LT_POWER ;
mP owerPlaneLayers . push_back ( copperLayer . ID ) ; //need to add a Copper zone
m_p owerPlaneLayers . push_back ( copperLayer . ID ) ; //need to add a Copper zone
break ;
default :
@ -326,10 +326,9 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup()
break ;
}
mBoard - > SetLayerType ( item - > GetBrdLayerId ( ) , copperType ) ;
mBoard - > SetLayerName ( item - > GetBrdLayerId ( ) , item - > GetLayerName ( ) ) ;
mCopperLayers . insert ( { copperLayer . PhysicalLayer , copperLayer . ID } ) ;
mLayermap . insert ( { copperLayer . ID , item - > GetBrdLayerId ( ) } ) ;
m_board - > SetLayerType ( item - > GetBrdLayerId ( ) , copperType ) ;
m_board - > SetLayerName ( item - > GetBrdLayerId ( ) , item - > GetLayerName ( ) ) ;
m_layermap . insert ( { copperLayer . ID , item - > GetBrdLayerId ( ) } ) ;
}
}
else if ( item - > GetType ( ) = = BOARD_STACKUP_ITEM_TYPE : : BS_ITEM_TYPE_DIELECTRIC )
@ -395,8 +394,8 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup()
item - > AddDielectricPrms ( dielectricSublayer ) ;
initStackupItem ( dielectricLayer , item , dielectricSublayer ) ;
mB oard - > SetLayerName ( item - > GetBrdLayerId ( ) , item - > GetLayerName ( ) ) ;
mL ayermap . insert ( { dielectricLayer . ID , item - > GetBrdLayerId ( ) } ) ;
m_b oard - > SetLayerName ( item - > GetBrdLayerId ( ) , item - > GetLayerName ( ) ) ;
m_l ayermap . insert ( { dielectricLayer . ID , item - > GetBrdLayerId ( ) } ) ;
+ + dielectricSublayer ;
}
@ -538,21 +537,21 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup()
break ;
}
mL ayermap . insert ( { curLayer . ID , kicadLayerID } ) ;
m_l ayermap . insert ( { curLayer . ID , kicadLayerID } ) ;
}
}
void CADSTAR_PCB_ARCHIVE_LOADER : : remapUnsureLayers ( )
{
LSET enabledLayers = mB oard - > GetEnabledLayers ( ) ;
LSET enabledLayers = m_b oard - > GetEnabledLayers ( ) ;
LSET validRemappingLayers = enabledLayers | LSET : : AllBoardTechMask ( ) |
LSET : : UserMask ( ) | LSET : : UserDefinedLayers ( ) ;
std : : vector < INPUT_LAYER_DESC > inputLayers ;
std : : map < wxString , LAYER_ID > cadstarLayerNameMap ;
for ( std : : pair < LAYER_ID , PCB_LAYER_ID > layerPair : mL ayermap )
for ( std : : pair < LAYER_ID , PCB_LAYER_ID > layerPair : m_l ayermap )
{
LAYER * curLayer = & Assignments . Layerdefs . Layers . at ( layerPair . first ) ;
@ -579,7 +578,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::remapUnsureLayers()
return ;
// Callback:
std : : map < wxString , PCB_LAYER_ID > reMappedLayers = mL ayerMappingHandler ( inputLayers ) ;
std : : map < wxString , PCB_LAYER_ID > reMappedLayers = m_l ayerMappingHandler ( inputLayers ) ;
for ( std : : pair < wxString , PCB_LAYER_ID > layerPair : reMappedLayers )
{
@ -590,18 +589,18 @@ void CADSTAR_PCB_ARCHIVE_LOADER::remapUnsureLayers()
}
LAYER_ID cadstarLayerID = cadstarLayerNameMap . at ( layerPair . first ) ;
mL ayermap . at ( cadstarLayerID ) = layerPair . second ;
m_l ayermap . at ( cadstarLayerID ) = layerPair . second ;
enabledLayers | = LSET ( layerPair . second ) ;
}
mB oard - > SetEnabledLayers ( enabledLayers ) ;
mB oard - > SetVisibleLayers ( enabledLayers ) ;
m_b oard - > SetEnabledLayers ( enabledLayers ) ;
m_b oard - > SetVisibleLayers ( enabledLayers ) ;
}
void CADSTAR_PCB_ARCHIVE_LOADER : : loadDesignRules ( )
{
BOARD_DESIGN_SETTINGS & ds = mB oard - > GetDesignSettings ( ) ;
BOARD_DESIGN_SETTINGS & ds = m_b oard - > GetDesignSettings ( ) ;
std : : map < SPACINGCODE_ID , SPACINGCODE > & spacingCodes = Assignments . Codedefs . SpacingCodes ;
auto applyRule =
@ -625,8 +624,8 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDesignRules()
ds . m_MinThroughDrill = 0 ; // CADSTAR does not specify a minimum hole size
ds . m_HoleClearance = ds . m_CopperEdgeClearance ; // Not specified, assumed same as edge
auto applyNetClassRule = [ & ] ( wxString aID , : : NETCLASS * aNetClassPtr ,
void ( : : NETCLASS : : * aFunc ) ( int ) ) {
auto applyNetClassRule = [ & ] ( wxString aID , NETCLASS * aNetClassPtr ,
void ( NETCLASS : : * aFunc ) ( int ) ) {
int value = - 1 ;
applyRule ( aID , & value ) ;
@ -636,7 +635,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDesignRules()
applyNetClassRule ( " T_T " , ds . GetDefault ( ) , & : : NETCLASS : : SetClearance ) ;
mB oard - > m_LegacyNetclassesLoaded = true ;
m_b oard - > m_LegacyNetclassesLoaded = true ;
wxLogWarning ( _ ( " KiCad design rules are different from CADSTAR ones. Only the compatible "
" design rules were imported. It is recommended that you review the design "
@ -653,7 +652,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadComponentLibrary()
wxString fpName = component . ReferenceName + ( ( component . Alternate . size ( ) > 0 ) ?
( wxT ( " ( " ) + component . Alternate + wxT ( " ) " ) ) :
wxT ( " " ) ) ;
FOOTPRINT * footprint = new FOOTPRINT ( mB oard ) ;
FOOTPRINT * footprint = new FOOTPRINT ( m_b oard ) ;
footprint - > SetPosition ( getKiCadPoint ( component . Origin ) ) ;
LIB_ID libID ;
@ -665,7 +664,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadComponentLibrary()
loadLibraryAreas ( component , footprint ) ;
loadLibraryPads ( component , footprint ) ;
mL ibraryMap . insert ( std : : make_pair ( key , footprint ) ) ;
m_l ibraryMap . insert ( std : : make_pair ( key , footprint ) ) ;
}
}
@ -954,7 +953,7 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad,
{
SHAPE_POLY_SET padOutline ;
PCB_LAYER_ID layer = lset . Seq ( ) . at ( 0 ) ;
int maxError = mB oard - > GetDesignSettings ( ) . m_MaxError ;
int maxError = m_b oard - > GetDesignSettings ( ) . m_MaxError ;
pad - > SetPosition ( { 0 , 0 } ) ;
pad - > SetPos0 ( { 0 , 0 } ) ;
@ -987,14 +986,14 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad,
csPadcode . SlotOrientation = 0 ;
drillOffset = { 0 , 0 } ;
if ( mP adcodesTested . find ( csPadcode . ID ) = = mP adcodesTested . end ( ) )
if ( m_p adcodesTested . find ( csPadcode . ID ) = = m_p adcodesTested . end ( ) )
{
wxLogError ( wxString : : Format (
_ ( " The CADSTAR pad definition '%s' has the hole shape outside the "
" pad shape. The hole has been moved to the center of the pad. " ) ,
csPadcode . Name ) ) ;
mP adcodesTested . insert ( csPadcode . ID ) ;
m_p adcodesTested . insert ( csPadcode . ID ) ;
}
}
@ -1032,13 +1031,13 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadGroups()
{
GROUP & csGroup = groupPair . second ;
PCB_GROUP * kiGroup = new PCB_GROUP ( mB oard ) ;
PCB_GROUP * kiGroup = new PCB_GROUP ( m_b oard ) ;
mB oard - > Add ( kiGroup ) ;
m_b oard - > Add ( kiGroup ) ;
kiGroup - > SetName ( csGroup . Name ) ;
kiGroup - > SetLocked ( csGroup . Fixed ) ;
mG roupMap . insert ( { csGroup . ID , kiGroup } ) ;
m_g roupMap . insert ( { csGroup . ID , kiGroup } ) ;
}
//now add any groups to their parent group
@ -1048,14 +1047,14 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadGroups()
if ( ! csGroup . GroupID . IsEmpty ( ) )
{
if ( mG roupMap . find ( csGroup . ID ) = = mG roupMap . end ( ) )
if ( m_g roupMap . find ( csGroup . ID ) = = m_g roupMap . end ( ) )
{
THROW_IO_ERROR ( wxString : : Format (
_ ( " The file appears to be corrupt. Unable to find group ID %s "
" in the group definitions. " ) ,
csGroup . ID ) ) ;
}
else if ( mG roupMap . find ( csGroup . ID ) = = mG roupMap . end ( ) )
else if ( m_g roupMap . find ( csGroup . ID ) = = m_g roupMap . end ( ) )
{
THROW_IO_ERROR ( wxString : : Format (
_ ( " The file appears to be corrupt. Unable to find sub group %s "
@ -1064,8 +1063,8 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadGroups()
}
else
{
PCB_GROUP * kiCadGroup = mG roupMap . at ( csGroup . ID ) ;
PCB_GROUP * parentGroup = mG roupMap . at ( csGroup . GroupID ) ;
PCB_GROUP * kiCadGroup = m_g roupMap . at ( csGroup . ID ) ;
PCB_GROUP * parentGroup = m_g roupMap . at ( csGroup . GroupID ) ;
parentGroup - > AddItem ( kiCadGroup ) ;
}
}
@ -1075,13 +1074,13 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadGroups()
void CADSTAR_PCB_ARCHIVE_LOADER : : loadBoards ( )
{
for ( std : : pair < BOARD_ID , BOARD > boardPair : Layout . Boards )
for ( std : : pair < BOARD_ID , CADSTAR_ BOARD> boardPair : Layout . Boards )
{
BOARD & board = boardPair . second ;
CADSTAR_ BOARD& board = boardPair . second ;
GROUP_ID boardGroup = createUniqueGroupID ( wxT ( " Board " ) ) ;
drawCadstarShape ( board . Shape , PCB_LAYER_ID : : Edge_Cuts ,
getLineThickness ( board . LineCodeID ) , wxString : : Format ( " BOARD %s " , board . ID ) ,
mB oard , boardGroup ) ;
m_b oard , boardGroup ) ;
if ( ! board . GroupID . IsEmpty ( ) )
{
@ -1099,7 +1098,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadFigures()
{
FIGURE & fig = figPair . second ;
drawCadstarShape ( fig . Shape , getKiCadLayer ( fig . LayerID ) ,
getLineThickness ( fig . LineCodeID ) , wxString : : Format ( " FIGURE %s " , fig . ID ) , mB oard ,
getLineThickness ( fig . LineCodeID ) , wxString : : Format ( " FIGURE %s " , fig . ID ) , m_b oard ,
fig . GroupID ) ;
//TODO process "swaprule" (doesn't seem to apply to Layout Figures?)
@ -1114,7 +1113,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadTexts()
for ( std : : pair < TEXT_ID , TEXT > txtPair : Layout . Texts )
{
TEXT & csTxt = txtPair . second ;
drawCadstarText ( csTxt , mB oard ) ;
drawCadstarText ( csTxt , m_b oard ) ;
}
}
@ -1148,11 +1147,11 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions()
csDim . ID ) ) ;
}
: : ALIGNED_DIMENSION * dimension = nullptr ;
ALIGNED_DIMENSION * dimension = nullptr ;
if ( csDim . Subtype = = DIMENSION : : SUBTYPE : : ORTHOGONAL )
{
dimension = new : : ORTHOGONAL_DIMENSION ( mB oard ) ;
dimension = new ORTHOGONAL_DIMENSION ( m_b oard ) ;
ORTHOGONAL_DIMENSION * orDim = static_cast < ORTHOGONAL_DIMENSION * > ( dimension ) ;
if ( csDim . ExtensionLineParams . Start . x = = csDim . Line . Start . x )
@ -1162,10 +1161,10 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions()
}
else
{
dimension = new : : ALIGNED_DIMENSION ( mB oard ) ;
dimension = new ALIGNED_DIMENSION ( m_b oard ) ;
}
mB oard - > Add ( dimension , ADD_MODE : : APPEND ) ;
m_b oard - > Add ( dimension , ADD_MODE : : APPEND ) ;
applyDimensionSettings ( csDim , dimension ) ;
dimension - > SetExtensionHeight (
@ -1211,8 +1210,8 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions()
if ( csDim . Line . Style = = DIMENSION : : LINE : : STYLE : : INTERNAL )
{
// "internal" is a simple double sided arrow from start to end (no extension lines)
: : ALIGNED_DIMENSION * dimension = new : : ALIGNED_DIMENSION ( mB oard ) ;
mB oard - > Add ( dimension , ADD_MODE : : APPEND ) ;
ALIGNED_DIMENSION * dimension = new ALIGNED_DIMENSION ( m_b oard ) ;
m_b oard - > Add ( dimension , ADD_MODE : : APPEND ) ;
applyDimensionSettings ( csDim , dimension ) ;
// Lets set again start/end:
@ -1227,8 +1226,8 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions()
else
{
// "external" is a "leader" style dimension
: : LEADER * leaderDim = new : : LEADER ( mB oard ) ;
mB oard - > Add ( leaderDim , ADD_MODE : : APPEND ) ;
LEADER * leaderDim = new LEADER ( m_b oard ) ;
m_b oard - > Add ( leaderDim , ADD_MODE : : APPEND ) ;
applyDimensionSettings ( csDim , leaderDim ) ;
leaderDim - > SetStart ( getKiCadPoint ( csDim . Line . End ) ) ;
@ -1318,7 +1317,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions()
leaderDim - > SetEnd ( getKiCadPoint ( endPoint ) ) ;
leaderDim - > Text ( ) . SetTextPos ( getKiCadPoint ( txtPoint ) ) ;
leaderDim - > SetText ( ParseTextFields ( csDim . Text . Text , & mC ontext ) ) ;
leaderDim - > SetText ( ParseTextFields ( csDim . Text . Text , & m_c ontext ) ) ;
leaderDim - > SetPrefix ( wxEmptyString ) ;
leaderDim - > SetSuffix ( wxEmptyString ) ;
leaderDim - > SetUnitsFormat ( DIM_UNITS_FORMAT : : NO_SUFFIX ) ;
@ -1353,9 +1352,9 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadAreas()
if ( area . NoVias | | area . NoTracks | | area . Keepout | | area . Routing )
{
ZONE * zone = getZoneFromCadstarShape ( area . Shape , getLineThickness ( area . LineCodeID ) ,
mB oard ) ;
m_b oard ) ;
mB oard - > Add ( zone , ADD_MODE : : APPEND ) ;
m_b oard - > Add ( zone , ADD_MODE : : APPEND ) ;
if ( isLayerSet ( area . LayerID ) )
zone - > SetLayerSet ( getKiCadLayerSet ( area . LayerID ) ) ;
@ -1406,9 +1405,9 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadComponents()
if ( ! comp . VariantID . empty ( ) & & comp . VariantParentComponentID ! = comp . ID )
continue ; // Only load master Variant
auto fpIter = mL ibraryMap . find ( comp . SymdefID ) ;
auto fpIter = m_l ibraryMap . find ( comp . SymdefID ) ;
if ( fpIter = = mL ibraryMap . end ( ) )
if ( fpIter = = m_l ibraryMap . end ( ) )
{
THROW_IO_ERROR ( wxString : : Format ( _ ( " Unable to find component '%s' in the library "
" (Symdef ID: '%s') " ) ,
@ -1420,7 +1419,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadComponents()
// Use Duplicate() to ensure unique KIID for all objects
FOOTPRINT * footprint = static_cast < FOOTPRINT * > ( libFootprint - > Duplicate ( ) ) ;
mB oard - > Add ( footprint , ADD_MODE : : APPEND ) ;
m_b oard - > Add ( footprint , ADD_MODE : : APPEND ) ;
// First lets fix the pad names on the footprint.
// CADSTAR defines the pad name in the PART definition and the SYMDEF (i.e. the PCB
@ -1506,7 +1505,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadComponents()
if ( ! comp . PartID . IsEmpty ( ) & & comp . PartID ! = wxT ( " NO_PART " ) )
footprint - > SetDescription ( getPart ( comp . PartID ) . Definition . Name ) ;
mC omponentMap . insert ( { comp . ID , footprint } ) ;
m_c omponentMap . insert ( { comp . ID , footprint } ) ;
}
}
@ -1557,7 +1556,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDocumentationSymbols()
drawCadstarShape ( fig . Shape , layer , getLineThickness ( fig . LineCodeID ) ,
wxString : : Format ( " DOCUMENTATION SYMBOL %s, FIGURE %s " ,
docSymDefinition . ReferenceName , fig . ID ) ,
mB oard , groupID , moveVector , rotationAngle , scalingFactor ,
m_b oard , groupID , moveVector , rotationAngle , scalingFactor ,
centreOfTransform , mirrorInvert ) ;
}
}
@ -1565,7 +1564,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDocumentationSymbols()
for ( std : : pair < TEXT_ID , TEXT > textPair : docSymDefinition . Texts )
{
TEXT txt = textPair . second ;
drawCadstarText ( txt , mB oard , groupID , docSymInstance . LayerID , moveVector ,
drawCadstarText ( txt , m_b oard , groupID , docSymInstance . LayerID , moveVector ,
rotationAngle , scalingFactor , centreOfTransform , mirrorInvert ) ;
}
}
@ -1580,9 +1579,9 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadTemplates()
int zonelinethickness = 0 ; // The line thickness in CADSTAR is only for display purposes but
// does not affect the end copper result.
ZONE * zone = getZoneFromCadstarShape ( csTemplate . Shape , zonelinethickness , mB oard ) ;
ZONE * zone = getZoneFromCadstarShape ( csTemplate . Shape , zonelinethickness , m_b oard ) ;
mB oard - > Add ( zone , ADD_MODE : : APPEND ) ;
m_b oard - > Add ( zone , ADD_MODE : : APPEND ) ;
zone - > SetZoneName ( csTemplate . Name ) ;
zone - > SetLayer ( getKiCadLayer ( csTemplate . LayerID ) ) ;
@ -1665,7 +1664,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadTemplates()
}
else
{
clearance + = mB oard - > GetDesignSettings ( ) . m_MinClearance ;
clearance + = m_b oard - > GetDesignSettings ( ) . m_MinClearance ;
}
zone - > SetLocalClearance ( clearance ) ;
@ -1724,11 +1723,11 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadTemplates()
zone - > SetPadConnection ( ZONE_CONNECTION : : FULL ) ;
}
mLoadedTemplates . insert ( { csTemplate . ID , zone } ) ;
m_zonesMap . insert ( { csTemplate . ID , zone } ) ;
}
//Now create power plane layers:
for ( LAYER_ID layer : mP owerPlaneLayers )
for ( LAYER_ID layer : m_p owerPlaneLayers )
{
wxASSERT (
Assignments . Layerdefs . Layers . find ( layer ) ! = Assignments . Layerdefs . Layers . end ( ) ) ;
@ -1758,15 +1757,15 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadTemplates()
}
else
{
for ( std : : pair < BOARD_ID , BOARD > boardPair : Layout . Boards )
for ( std : : pair < BOARD_ID , CADSTAR_ BOARD> boardPair : Layout . Boards )
{
//create a zone in each board shape
BOARD_DESIGN_SETTINGS & bds = mB oard - > GetDesignSettings ( ) ;
BOARD & board = boardPair . second ;
BOARD_DESIGN_SETTINGS & bds = m_b oard - > GetDesignSettings ( ) ;
CADSTAR_ BOARD& board = boardPair . second ;
int defaultLineThicknesss = bds . GetLineThickness ( PCB_LAYER_ID : : Edge_Cuts ) ;
ZONE * zone = getZoneFromCadstarShape ( board . Shape , defaultLineThicknesss , mB oard ) ;
ZONE * zone = getZoneFromCadstarShape ( board . Shape , defaultLineThicknesss , m_b oard ) ;
mB oard - > Add ( zone , ADD_MODE : : APPEND ) ;
m_b oard - > Add ( zone , ADD_MODE : : APPEND ) ;
zone - > SetZoneName ( powerPlaneLayerName ) ;
zone - > SetLayer ( getKiCadLayer ( layer ) ) ;
@ -1789,7 +1788,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadCoppers()
if ( ! csCopper . PouredTemplateID . IsEmpty ( ) )
{
ZONE * pouredZone = mLoadedTemplates . at ( csCopper . PouredTemplateID ) ;
ZONE * pouredZone = m_zonesMap . at ( csCopper . PouredTemplateID ) ;
SHAPE_POLY_SET rawPolys ;
int copperWidth = getKiCadLength ( getCopperCode ( csCopper . CopperCodeID ) . CopperWidth ) ;
@ -1850,14 +1849,14 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadCoppers()
// For now we are going to load coppers to a KiCad zone however this isn't perfect
//TODO: Load onto a graphical polygon with a net (when KiCad has this feature)
if ( ! mD oneCopperWarning )
if ( ! m_d oneCopperWarning )
{
wxLogWarning (
_ ( " The CADSTAR design contains COPPER elements, which have no direct KiCad "
" equivalent. These have been imported as a KiCad Zone if solid or hatch "
" filled, or as a KiCad Track if the shape was an unfilled outline (open or "
" closed). " ) ) ;
mD oneCopperWarning = true ;
m_d oneCopperWarning = true ;
}
@ -1867,7 +1866,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadCoppers()
std : : vector < PCB_SHAPE * > outlineSegments =
getDrawSegmentsFromVertices ( csCopper . Shape . Vertices ) ;
std : : vector < TRACK * > outlineTracks = makeTracksFromDrawsegments ( outlineSegments , mB oard ,
std : : vector < TRACK * > outlineTracks = makeTracksFromDrawsegments ( outlineSegments , m_b oard ,
getKiCadNet ( csCopper . NetRef . NetID ) , getKiCadLayer ( csCopper . LayerID ) ,
getKiCadLength ( getCopperCode ( csCopper . CopperCodeID ) . CopperWidth ) ) ;
@ -1880,7 +1879,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadCoppers()
std : : vector < PCB_SHAPE * > cutoutSeg =
getDrawSegmentsFromVertices ( cutout . Vertices ) ;
std : : vector < TRACK * > cutoutTracks = makeTracksFromDrawsegments ( cutoutSeg , mB oard ,
std : : vector < TRACK * > cutoutTracks = makeTracksFromDrawsegments ( cutoutSeg , m_b oard ,
getKiCadNet ( csCopper . NetRef . NetID ) , getKiCadLayer ( csCopper . LayerID ) ,
getKiCadLength ( getCopperCode ( csCopper . CopperCodeID ) . CopperWidth ) ) ;
@ -1893,9 +1892,9 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadCoppers()
{
ZONE * zone = getZoneFromCadstarShape ( csCopper . Shape ,
getKiCadLength ( getCopperCode ( csCopper . CopperCodeID ) . CopperWidth ) ,
mB oard ) ;
m_b oard ) ;
mB oard - > Add ( zone , ADD_MODE : : APPEND ) ;
m_b oard - > Add ( zone , ADD_MODE : : APPEND ) ;
zone - > SetZoneName ( csCopper . ID ) ;
zone - > SetLayer ( getKiCadLayer ( csCopper . LayerID ) ) ;
@ -1916,7 +1915,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadCoppers()
zone - > SetIslandRemovalMode ( ISLAND_REMOVAL_MODE : : NEVER ) ;
zone - > SetPadConnection ( ZONE_CONNECTION : : FULL ) ;
zone - > SetNet ( getKiCadNet ( csCopper . NetRef . NetID ) ) ;
zone - > SetPriority ( mLoadedTemplates . size ( ) + 1 ) ; // Highest priority (always fill first)
zone - > SetPriority ( m_zonesMap . size ( ) + 1 ) ; // Highest priority (always fill first)
zone - > SetRawPolysList ( getKiCadLayer ( csCopper . LayerID ) , * zone - > Outline ( ) ) ;
SHAPE_POLY_SET fillePolys ( * zone - > Outline ( ) ) ;
@ -1989,27 +1988,27 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadTextVariables()
auto findAndReplaceTextField =
[ & ] ( TEXT_FIELD_NAME aField , wxString aValue )
{
if ( mC ontext . TextFieldToValuesMap . find ( aField ) ! =
mC ontext . TextFieldToValuesMap . end ( ) )
if ( m_c ontext . TextFieldToValuesMap . find ( aField ) ! =
m_c ontext . TextFieldToValuesMap . end ( ) )
{
if ( mC ontext . TextFieldToValuesMap . at ( aField ) ! = aValue )
if ( m_c ontext . TextFieldToValuesMap . at ( aField ) ! = aValue )
{
mC ontext . TextFieldToValuesMap . at ( aField ) = aValue ;
mC ontext . InconsistentTextFields . insert ( aField ) ;
m_c ontext . TextFieldToValuesMap . at ( aField ) = aValue ;
m_c ontext . InconsistentTextFields . insert ( aField ) ;
return false ;
}
}
else
{
mC ontext . TextFieldToValuesMap . insert ( { aField , aValue } ) ;
m_c ontext . TextFieldToValuesMap . insert ( { aField , aValue } ) ;
}
return true ;
} ;
if ( mP roject )
if ( m_p roject )
{
std : : map < wxString , wxString > & txtVars = mP roject - > GetTextVars ( ) ;
std : : map < wxString , wxString > & txtVars = m_p roject - > GetTextVars ( ) ;
// Most of the design text fields can be derived from other elements
if ( Layout . VariantHierarchy . Variants . size ( ) > 0 )
@ -2022,15 +2021,15 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadTextVariables()
findAndReplaceTextField ( TEXT_FIELD_NAME : : DESIGN_TITLE , Header . JobTitle ) ;
for ( std : : pair < TEXT_FIELD_NAME , wxString > txtvalue : mC ontext . TextFieldToValuesMap )
for ( std : : pair < TEXT_FIELD_NAME , wxString > txtvalue : m_c ontext . TextFieldToValuesMap )
{
wxString varName = CadstarToKicadFieldsMap . at ( txtvalue . first ) ;
wxString varName = CADSTAR_TO_KICAD_FIELDS . at ( txtvalue . first ) ;
wxString varValue = txtvalue . second ;
txtVars . insert ( { varName , varValue } ) ;
}
for ( std : : pair < wxString , wxString > txtvalue : mC ontext . FilenamesToTextMap )
for ( std : : pair < wxString , wxString > txtvalue : m_c ontext . FilenamesToTextMap )
{
wxString varName = txtvalue . first ;
wxString varValue = txtvalue . second ;
@ -2102,7 +2101,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadNetTracks(
//Todo add real netcode to the tracks
std : : vector < TRACK * > tracks =
makeTracksFromDrawsegments ( shapes , mB oard , getKiCadNet ( aCadstarNetID ) ) ;
makeTracksFromDrawsegments ( shapes , m_b oard , getKiCadNet ( aCadstarNetID ) ) ;
//cleanup
for ( PCB_SHAPE * shape : shapes )
@ -2113,8 +2112,8 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadNetTracks(
void CADSTAR_PCB_ARCHIVE_LOADER : : loadNetVia (
const NET_ID & aCadstarNetID , const NET_PCB : : VIA & aCadstarVia )
{
VIA * via = new VIA ( mB oard ) ;
mB oard - > Add ( via , ADD_MODE : : APPEND ) ;
VIA * via = new VIA ( m_b oard ) ;
m_b oard - > Add ( via , ADD_MODE : : APPEND ) ;
VIACODE csViaCode = getViaCode ( aCadstarVia . ViaCodeID ) ;
LAYERPAIR csLayerPair = getLayerPair ( aCadstarVia . LayerPairID ) ;
@ -2291,13 +2290,13 @@ void CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText( const TEXT& aCadstarText,
{
txt - > SetLayer ( layer ) ;
newtxt = static_cast < PCB_TEXT * > ( txt - > Duplicate ( ) ) ;
mB oard - > Add ( newtxt , ADD_MODE : : APPEND ) ;
m_b oard - > Add ( newtxt , ADD_MODE : : APPEND ) ;
if ( ! aCadstarGroupID . IsEmpty ( ) )
addToGroup ( aCadstarGroupID , newtxt ) ;
}
mB oard - > Remove ( txt ) ;
m_b oard - > Remove ( txt ) ;
delete txt ;
}
else
@ -2904,7 +2903,7 @@ int CADSTAR_PCB_ARCHIVE_LOADER::getLineThickness( const LINECODE_ID& aCadstarLin
{
wxCHECK ( Assignments . Codedefs . LineCodes . find ( aCadstarLineCodeID )
! = Assignments . Codedefs . LineCodes . end ( ) ,
mB oard - > GetDesignSettings ( ) . GetLineThickness ( PCB_LAYER_ID : : Edge_Cuts ) ) ;
m_b oard - > GetDesignSettings ( ) . GetLineThickness ( PCB_LAYER_ID : : Edge_Cuts ) ) ;
return getKiCadLength ( Assignments . Codedefs . LineCodes . at ( aCadstarLineCodeID ) . Width ) ;
}
@ -3023,7 +3022,7 @@ double CADSTAR_PCB_ARCHIVE_LOADER::getHatchCodeAngleDegrees(
HATCHCODE hcode = getHatchCode ( aCadstarHatchcodeID ) ;
if ( hcode . Hatches . size ( ) < 1 )
return mB oard - > GetDesignSettings ( ) . GetDefaultZoneSettings ( ) . m_HatchOrientation ;
return m_b oard - > GetDesignSettings ( ) . GetDefaultZoneSettings ( ) . m_HatchOrientation ;
else
return getAngleDegrees ( hcode . Hatches . at ( 0 ) . OrientAngle ) ;
}
@ -3036,7 +3035,7 @@ int CADSTAR_PCB_ARCHIVE_LOADER::getKiCadHatchCodeThickness(
HATCHCODE hcode = getHatchCode ( aCadstarHatchcodeID ) ;
if ( hcode . Hatches . size ( ) < 1 )
return mB oard - > GetDesignSettings ( ) . GetDefaultZoneSettings ( ) . m_HatchThickness ;
return m_b oard - > GetDesignSettings ( ) . GetDefaultZoneSettings ( ) . m_HatchThickness ;
else
return getKiCadLength ( hcode . Hatches . at ( 0 ) . LineWidth ) ;
}
@ -3048,7 +3047,7 @@ int CADSTAR_PCB_ARCHIVE_LOADER::getKiCadHatchCodeGap( const HATCHCODE_ID& aCadst
HATCHCODE hcode = getHatchCode ( aCadstarHatchcodeID ) ;
if ( hcode . Hatches . size ( ) < 1 )
return mB oard - > GetDesignSettings ( ) . GetDefaultZoneSettings ( ) . m_HatchGap ;
return m_b oard - > GetDesignSettings ( ) . GetDefaultZoneSettings ( ) . m_HatchGap ;
else
return getKiCadLength ( hcode . Hatches . at ( 0 ) . Step ) ;
}
@ -3056,15 +3055,15 @@ int CADSTAR_PCB_ARCHIVE_LOADER::getKiCadHatchCodeGap( const HATCHCODE_ID& aCadst
PCB_GROUP * CADSTAR_PCB_ARCHIVE_LOADER : : getKiCadGroup ( const GROUP_ID & aCadstarGroupID )
{
wxCHECK ( mG roupMap . find ( aCadstarGroupID ) ! = mG roupMap . end ( ) , nullptr ) ;
wxCHECK ( m_g roupMap . find ( aCadstarGroupID ) ! = m_g roupMap . end ( ) , nullptr ) ;
return mG roupMap . at ( aCadstarGroupID ) ;
return m_g roupMap . at ( aCadstarGroupID ) ;
}
void CADSTAR_PCB_ARCHIVE_LOADER : : checkAndLogHatchCode ( const HATCHCODE_ID & aCadstarHatchcodeID )
{
if ( mH atchcodesTested . find ( aCadstarHatchcodeID ) ! = mH atchcodesTested . end ( ) )
if ( m_h atchcodesTested . find ( aCadstarHatchcodeID ) ! = m_h atchcodesTested . end ( ) )
{
return ; //already checked
}
@ -3121,13 +3120,13 @@ void CADSTAR_PCB_ARCHIVE_LOADER::checkAndLogHatchCode( const HATCHCODE_ID& aCads
}
}
mH atchcodesTested . insert ( aCadstarHatchcodeID ) ;
m_h atchcodesTested . insert ( aCadstarHatchcodeID ) ;
}
}
void CADSTAR_PCB_ARCHIVE_LOADER : : applyDimensionSettings ( const DIMENSION & aCadstarDim ,
: : DIMENSION_BASE * aKiCadDim )
DIMENSION_BASE * aKiCadDim )
{
UNITS dimensionUnits = aCadstarDim . LinearUnits ;
TEXTCODE txtCode = getTextCode ( aCadstarDim . Text . TextCodeID ) ;
@ -3151,10 +3150,10 @@ void CADSTAR_PCB_ARCHIVE_LOADER::applyDimensionSettings( const DIMENSION& aCads
if ( startpos ! = wxNOT_FOUND )
{
prefix = ParseTextFields ( aCadstarDim . Text . Text . SubString ( 0 , startpos - 1 ) , & mC ontext ) ;
prefix = ParseTextFields ( aCadstarDim . Text . Text . SubString ( 0 , startpos - 1 ) , & m_c ontext ) ;
wxString remainingStr = aCadstarDim . Text . Text . Mid ( startpos ) ;
size_t endpos = remainingStr . Find ( " @> " ) ;
suffix = ParseTextFields ( remainingStr . Mid ( endpos + 2 ) , & mC ontext ) ;
suffix = ParseTextFields ( remainingStr . Mid ( endpos + 2 ) , & m_c ontext ) ;
}
if ( suffix . StartsWith ( " mm " ) )
@ -3228,15 +3227,15 @@ void CADSTAR_PCB_ARCHIVE_LOADER::calculateZonePriorities()
return winningOverlaps [ b ] . count ( a ) > 0 ;
} ;
for ( std : : map < TEMPLATE_ID , ZONE * > : : iterator it1 = mLoadedTemplates . begin ( ) ;
it1 ! = mLoadedTemplates . end ( ) ; + + it1 )
for ( std : : map < TEMPLATE_ID , ZONE * > : : iterator it1 = m_zonesMap . begin ( ) ;
it1 ! = m_zonesMap . end ( ) ; + + it1 )
{
TEMPLATE thisTemplate = Layout . Templates . at ( it1 - > first ) ;
PCB_LAYER_ID thisLayer = getKiCadLayer ( thisTemplate . LayerID ) ;
ZONE * thisZone = it1 - > second ;
for ( std : : map < TEMPLATE_ID , ZONE * > : : iterator it2 = it1 ;
it2 ! = mLoadedTemplates . end ( ) ; + + it2 )
it2 ! = m_zonesMap . end ( ) ; + + it2 )
{
TEMPLATE otherTemplate = Layout . Templates . at ( it2 - > first ) ;
PCB_LAYER_ID otherLayer = getKiCadLayer ( otherTemplate . LayerID ) ;
@ -3318,13 +3317,13 @@ void CADSTAR_PCB_ARCHIVE_LOADER::calculateZonePriorities()
wxASSERT ( ! isLowerPriority ( id , prevID ) ) ;
int newPriority = mLoadedTemplates . at ( prevID ) - > GetPriority ( ) ;
int newPriority = m_zonesMap . at ( prevID ) - > GetPriority ( ) ;
// Only increase priority of the current zone
if ( isLowerPriority ( prevID , id ) )
newPriority + + ;
mLoadedTemplates . at ( id ) - > SetPriority ( newPriority ) ;
m_zonesMap . at ( id ) - > SetPriority ( newPriority ) ;
prevID = id ;
}
@ -3333,10 +3332,10 @@ void CADSTAR_PCB_ARCHIVE_LOADER::calculateZonePriorities()
FOOTPRINT * CADSTAR_PCB_ARCHIVE_LOADER : : getFootprintFromCadstarID ( const COMPONENT_ID & aCadstarComponentID )
{
if ( mC omponentMap . find ( aCadstarComponentID ) = = mC omponentMap . end ( ) )
if ( m_c omponentMap . find ( aCadstarComponentID ) = = m_c omponentMap . end ( ) )
return nullptr ;
else
return mC omponentMap . at ( aCadstarComponentID ) ;
return m_c omponentMap . at ( aCadstarComponentID ) ;
}
@ -3344,8 +3343,8 @@ wxPoint CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPoint( wxPoint aCadstarPoint )
{
wxPoint retval ;
retval . x = ( aCadstarPoint . x - mD esignCenter . x ) * KiCadUnitMultiplier ;
retval . y = - ( aCadstarPoint . y - mD esignCenter . y ) * KiCadUnitMultiplier ;
retval . x = ( aCadstarPoint . x - m_d esignCenter . x ) * KiCadUnitMultiplier ;
retval . y = - ( aCadstarPoint . y - m_d esignCenter . y ) * KiCadUnitMultiplier ;
return retval ;
}
@ -3362,9 +3361,9 @@ NETINFO_ITEM* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet( const NET_ID& aCadstarNet
{
if ( aCadstarNetID . IsEmpty ( ) )
return nullptr ;
else if ( mN etMap . find ( aCadstarNetID ) ! = mN etMap . end ( ) )
else if ( m_n etMap . find ( aCadstarNetID ) ! = m_n etMap . end ( ) )
{
return mN etMap . at ( aCadstarNetID ) ;
return m_n etMap . at ( aCadstarNetID ) ;
}
else
{
@ -3394,7 +3393,7 @@ NETINFO_ITEM* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet( const NET_ID& aCadstarNet
}
}
if ( ! mD oneNetClassWarning & & ! csNet . NetClassID . IsEmpty ( )
if ( ! m_d oneNetClassWarning & & ! csNet . NetClassID . IsEmpty ( )
& & csNet . NetClassID ! = wxT ( " NONE " ) )
{
wxLogMessage (
@ -3402,37 +3401,37 @@ NETINFO_ITEM* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet( const NET_ID& aCadstarNet
" not have an equivalent to CADSTAR's Net Class so these elements were not "
" imported. Note: KiCad's version of 'Net Class' is closer to CADSTAR's "
" 'Net Route Code' (which has been imported for all nets). " ) ) ;
mD oneNetClassWarning = true ;
m_d oneNetClassWarning = true ;
}
if ( ! mD oneSpacingClassWarning & & ! csNet . SpacingClassID . IsEmpty ( )
if ( ! m_d oneSpacingClassWarning & & ! csNet . SpacingClassID . IsEmpty ( )
& & csNet . SpacingClassID ! = wxT ( " NONE " ) )
{
wxLogWarning ( _ ( " The CADSTAR design contains nets with a 'Spacing Class' assigned. "
" KiCad does not have an equivalent to CADSTAR's Spacing Class so "
" these elements were not imported. Please review the design rules as "
" copper pours will affected by this. " ) ) ;
mD oneSpacingClassWarning = true ;
m_d oneSpacingClassWarning = true ;
}
NETINFO_ITEM * netInfo = new NETINFO_ITEM ( mB oard , newName , + + mN umNets ) ;
mB oard - > Add ( netInfo , ADD_MODE : : APPEND ) ;
NETINFO_ITEM * netInfo = new NETINFO_ITEM ( m_b oard , newName , + + m_n umNets ) ;
m_b oard - > Add ( netInfo , ADD_MODE : : APPEND ) ;
if ( mN etClassMap . find ( csNet . RouteCodeID ) ! = mN etClassMap . end ( ) )
if ( m_n etClassMap . find ( csNet . RouteCodeID ) ! = m_n etClassMap . end ( ) )
{
NETCLASSPTR netclass = mN etClassMap . at ( csNet . RouteCodeID ) ;
NETCLASSPTR netclass = m_n etClassMap . at ( csNet . RouteCodeID ) ;
netInfo - > SetNetClass ( netclass ) ;
}
else
{
ROUTECODE rc = getRouteCode ( csNet . RouteCodeID ) ;
NETCLASSPTR netclass ( new : : NETCLASS ( rc . Name ) ) ;
NETCLASSPTR netclass ( new NETCLASS ( rc . Name ) ) ;
netclass - > SetTrackWidth ( getKiCadLength ( rc . OptimalWidth ) ) ;
netInfo - > SetNetClass ( netclass ) ;
mN etClassMap . insert ( { csNet . RouteCodeID , netclass } ) ;
m_n etClassMap . insert ( { csNet . RouteCodeID , netclass } ) ;
}
mN etMap . insert ( { aCadstarNetID , netInfo } ) ;
m_n etMap . insert ( { aCadstarNetID , netInfo } ) ;
return netInfo ;
}
@ -3517,9 +3516,9 @@ PCB_LAYER_ID CADSTAR_PCB_ARCHIVE_LOADER::getKiCadLayer( const LAYER_ID& aCadstar
return PCB_LAYER_ID : : UNDEFINED_LAYER ;
}
wxCHECK ( mL ayermap . find ( aCadstarLayerID ) ! = mL ayermap . end ( ) , PCB_LAYER_ID : : UNDEFINED_LAYER ) ;
wxCHECK ( m_l ayermap . find ( aCadstarLayerID ) ! = m_l ayermap . end ( ) , PCB_LAYER_ID : : UNDEFINED_LAYER ) ;
return mL ayermap . at ( aCadstarLayerID ) ;
return m_l ayermap . at ( aCadstarLayerID ) ;
}
@ -3548,9 +3547,9 @@ LSET CADSTAR_PCB_ARCHIVE_LOADER::getKiCadLayerSet( const LAYER_ID& aCadstarLayer
void CADSTAR_PCB_ARCHIVE_LOADER : : addToGroup (
const GROUP_ID & aCadstarGroupID , BOARD_ITEM * aKiCadItem )
{
wxCHECK ( mG roupMap . find ( aCadstarGroupID ) ! = mG roupMap . end ( ) , ) ;
wxCHECK ( m_g roupMap . find ( aCadstarGroupID ) ! = m_g roupMap . end ( ) , ) ;
PCB_GROUP * parentGroup = mG roupMap . at ( aCadstarGroupID ) ;
PCB_GROUP * parentGroup = m_g roupMap . at ( aCadstarGroupID ) ;
parentGroup - > AddItem ( aKiCadItem ) ;
}
@ -3561,16 +3560,16 @@ CADSTAR_PCB_ARCHIVE_LOADER::GROUP_ID CADSTAR_PCB_ARCHIVE_LOADER::createUniqueGro
wxString groupName = aName ;
int num = 0 ;
while ( mG roupMap . find ( groupName ) ! = mG roupMap . end ( ) )
while ( m_g roupMap . find ( groupName ) ! = m_g roupMap . end ( ) )
{
groupName = aName + wxT ( " _ " ) + wxString : : Format ( " %i " , + + num ) ;
}
PCB_GROUP * docSymGroup = new PCB_GROUP ( mB oard ) ;
mB oard - > Add ( docSymGroup ) ;
PCB_GROUP * docSymGroup = new PCB_GROUP ( m_b oard ) ;
m_b oard - > Add ( docSymGroup ) ;
docSymGroup - > SetName ( groupName ) ;
GROUP_ID groupID ( groupName ) ;
mG roupMap . insert ( { groupID , docSymGroup } ) ;
m_g roupMap . insert ( { groupID , docSymGroup } ) ;
return groupID ;
}