CADSTAR PCB Archive Importer: Add import warnings for CADSTAR layers with no KiCad equivalent
This commit is contained in:
parent
3b3af5327f
commit
08a77e0af8
|
@ -83,6 +83,16 @@ void CADSTAR_PCB::Load( ::BOARD* aBoard )
|
|||
}
|
||||
|
||||
|
||||
void CADSTAR_PCB::logBoardStackupWarning(
|
||||
const wxString& aCadstarLayerName, const PCB_LAYER_ID& aKiCadLayer )
|
||||
{
|
||||
wxLogWarning( wxString::Format(
|
||||
_( "The CADSTAR layer '%s' has no KiCad equivalent. All elements on this "
|
||||
"layer have been mapped to KiCad layer '%s' instead." ),
|
||||
aCadstarLayerName, LSET::Name( aKiCadLayer ) ) );
|
||||
}
|
||||
|
||||
|
||||
void CADSTAR_PCB::loadBoardStackup()
|
||||
{
|
||||
std::map<LAYER_ID, LAYER>& cpaLayers = Assignments.Layerdefs.Layers;
|
||||
|
@ -176,6 +186,8 @@ void CADSTAR_PCB::loadBoardStackup()
|
|||
else
|
||||
kicadLayerID = PCB_LAYER_ID::Cmts_User;
|
||||
|
||||
logBoardStackupWarning( curLayer.Name, kicadLayerID );
|
||||
//TODO: allow user to decide which layer this should be mapped onto.
|
||||
break;
|
||||
|
||||
case LAYER_TYPE::NONELEC:
|
||||
|
@ -208,6 +220,12 @@ void CADSTAR_PCB::loadBoardStackup()
|
|||
kicadLayerID = PCB_LAYER_ID::B_Adhes;
|
||||
else
|
||||
kicadLayerID = PCB_LAYER_ID::F_Adhes;
|
||||
|
||||
wxLogMessage( wxString::Format(
|
||||
_( "The CADSTAR layer '%s' has been assumed to be an adhesive layer. "
|
||||
"All elements on this layer have been mapped to KiCad layer '%s'." ),
|
||||
curLayer.Name, LSET::Name( kicadLayerID ) ) );
|
||||
//TODO: allow user to decide if this is actually an adhesive layer or not.
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -215,6 +233,9 @@ void CADSTAR_PCB::loadBoardStackup()
|
|||
kicadLayerID = PCB_LAYER_ID::Eco2_User;
|
||||
else
|
||||
kicadLayerID = PCB_LAYER_ID::Eco1_User;
|
||||
|
||||
logBoardStackupWarning( curLayer.Name, kicadLayerID );
|
||||
//TODO: allow user to decide which layer this should be mapped onto.
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -536,7 +557,6 @@ void CADSTAR_PCB::loadLibraryPads( const SYMDEF& aComponent, MODULE* aModule )
|
|||
getKiCadLength( csPadcode.DrillDiameter ) } );
|
||||
}
|
||||
//TODO handle csPadcode.Reassigns when KiCad supports full padstacks
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1140,8 +1160,7 @@ wxString CADSTAR_PCB::getAttributeValue( const ATTRIBUTE_ID& aCadstarAttributeID
|
|||
|
||||
CADSTAR_PCB::PART CADSTAR_PCB::getPart( const PART_ID& aCadstarPartID )
|
||||
{
|
||||
wxCHECK( Parts.PartDefinitions.find( aCadstarPartID ) != Parts.PartDefinitions.end(),
|
||||
PART() );
|
||||
wxCHECK( Parts.PartDefinitions.find( aCadstarPartID ) != Parts.PartDefinitions.end(), PART() );
|
||||
|
||||
return Parts.PartDefinitions.at( aCadstarPartID );
|
||||
}
|
||||
|
|
|
@ -64,19 +64,17 @@ private:
|
|||
// Functions for loading individual elements:
|
||||
void loadBoardStackup();
|
||||
void loadComponentLibrary();
|
||||
// clang-format off
|
||||
// Helper functions for Component Library loading:
|
||||
void loadLibraryFigures(const SYMDEF& aComponent, MODULE* aModule);
|
||||
void loadLibraryPads(const SYMDEF& aComponent, MODULE* aModule);
|
||||
// clang-format on
|
||||
void loadBoards();
|
||||
void loadFigures();
|
||||
void loadAreas();
|
||||
void loadComponents();
|
||||
// clang-format off
|
||||
// Helper functions for Component loading:
|
||||
|
||||
// Helper functions for loading:
|
||||
void logBoardStackupWarning(
|
||||
const wxString& aCadstarLayerName, const PCB_LAYER_ID& aKiCadLayer );
|
||||
void loadLibraryFigures( const SYMDEF& aComponent, MODULE* aModule );
|
||||
void loadLibraryPads( const SYMDEF& aComponent, MODULE* aModule );
|
||||
void loadComponentAttributes( const COMPONENT& aComponent, MODULE* aModule );
|
||||
// clang-format on
|
||||
|
||||
/**
|
||||
* @brief
|
||||
|
@ -121,7 +119,8 @@ private:
|
|||
* @return
|
||||
*/
|
||||
std::vector<DRAWSEGMENT*> getDrawSegmentsFromVertices(
|
||||
const std::vector<VERTEX>& aCadstarVertices, BOARD_ITEM_CONTAINER* aContainer = nullptr );
|
||||
const std::vector<VERTEX>& aCadstarVertices,
|
||||
BOARD_ITEM_CONTAINER* aContainer = nullptr );
|
||||
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue