7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-02 00:26:45 +00:00

Added IPC2581 support

IPC2581 is a modern production file exchange system.  It provides
single-file data output for an entire board including BOM and netlist
information.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1954
This commit is contained in:
Seth Hillbrand 2023-06-12 11:12:39 -07:00
parent 90a61b8d36
commit 75c6b0ab28
63 changed files with 73369 additions and 117 deletions

View File

@ -219,6 +219,8 @@ static const wxChar EnableGit[] = wxT( "EnableGit" );
static const wxChar EnableEeschemaPrintCairo[] = wxT( "EnableEeschemaPrintCairo" );
static const wxChar Enable2581[] = wxT( "Enable2581" );
/**
* The time in milliseconds to wait before displaying a disambiguation menu.
*/
@ -530,6 +532,11 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableEeschemaPrintCairo,
&m_EnableEeschemaPrintCairo, m_EnableEeschemaPrintCairo ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::Enable2581,
&m_Enable2581, m_Enable2581 ) );
// Special case for trace mask setting...we just grab them and set them immediately
// Because we even use wxLogTrace inside of advanced config
wxString traceMasks;

View File

@ -620,6 +620,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::post_gencad].emplace_back( BITMAPS::post_gencad, wxT( "post_gencad_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::post_gerber].emplace_back( BITMAPS::post_gerber, wxT( "post_gerber_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::post_rpt].emplace_back( BITMAPS::post_rpt, wxT( "post_rpt_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::post_xml].emplace_back( BITMAPS::post_xml, wxT( "post_xml_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_24.png" ), 24, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_24.png" ), 24, wxT( "light" ) );
@ -1013,6 +1014,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::post_gencad].emplace_back( BITMAPS::post_gencad, wxT( "post_gencad_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::post_gerber].emplace_back( BITMAPS::post_gerber, wxT( "post_gerber_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::post_rpt].emplace_back( BITMAPS::post_rpt, wxT( "post_rpt_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::post_xml].emplace_back( BITMAPS::post_xml, wxT( "post_xml_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_dark_24.png" ), 24, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_dark_24.png" ), 24, wxT( "dark" ) );
@ -1405,6 +1407,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::post_gencad].emplace_back( BITMAPS::post_gencad, wxT( "post_gencad_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::post_gerber].emplace_back( BITMAPS::post_gerber, wxT( "post_gerber_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::post_rpt].emplace_back( BITMAPS::post_rpt, wxT( "post_rpt_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::post_xml].emplace_back( BITMAPS::post_xml, wxT( "post_xml_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_16.png" ), 16, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_16.png" ), 16, wxT( "light" ) );
@ -1798,6 +1801,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::post_gencad].emplace_back( BITMAPS::post_gencad, wxT( "post_gencad_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::post_gerber].emplace_back( BITMAPS::post_gerber, wxT( "post_gerber_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::post_rpt].emplace_back( BITMAPS::post_rpt, wxT( "post_rpt_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::post_xml].emplace_back( BITMAPS::post_xml, wxT( "post_xml_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_dark_16.png" ), 16, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_dark_16.png" ), 16, wxT( "dark" ) );
@ -2190,6 +2194,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::post_gencad].emplace_back( BITMAPS::post_gencad, wxT( "post_gencad_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::post_gerber].emplace_back( BITMAPS::post_gerber, wxT( "post_gerber_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::post_rpt].emplace_back( BITMAPS::post_rpt, wxT( "post_rpt_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::post_xml].emplace_back( BITMAPS::post_xml, wxT( "post_xml_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_32.png" ), 32, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_32.png" ), 32, wxT( "light" ) );
@ -2583,6 +2588,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::post_gencad].emplace_back( BITMAPS::post_gencad, wxT( "post_gencad_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::post_gerber].emplace_back( BITMAPS::post_gerber, wxT( "post_gerber_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::post_rpt].emplace_back( BITMAPS::post_rpt, wxT( "post_rpt_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::post_xml].emplace_back( BITMAPS::post_xml, wxT( "post_xml_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_dark_32.png" ), 32, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_dark_32.png" ), 32, wxT( "dark" ) );
@ -2975,6 +2981,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::post_gencad].emplace_back( BITMAPS::post_gencad, wxT( "post_gencad_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::post_gerber].emplace_back( BITMAPS::post_gerber, wxT( "post_gerber_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::post_rpt].emplace_back( BITMAPS::post_rpt, wxT( "post_rpt_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::post_xml].emplace_back( BITMAPS::post_xml, wxT( "post_xml_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_48.png" ), 48, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_48.png" ), 48, wxT( "light" ) );
@ -3368,6 +3375,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::post_gencad].emplace_back( BITMAPS::post_gencad, wxT( "post_gencad_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::post_gerber].emplace_back( BITMAPS::post_gerber, wxT( "post_gerber_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::post_rpt].emplace_back( BITMAPS::post_rpt, wxT( "post_rpt_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::post_xml].emplace_back( BITMAPS::post_xml, wxT( "post_xml_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_dark_48.png" ), 48, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_dark_48.png" ), 48, wxT( "dark" ) );
@ -3760,6 +3768,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::post_gencad].emplace_back( BITMAPS::post_gencad, wxT( "post_gencad_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::post_gerber].emplace_back( BITMAPS::post_gerber, wxT( "post_gerber_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::post_rpt].emplace_back( BITMAPS::post_rpt, wxT( "post_rpt_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::post_xml].emplace_back( BITMAPS::post_xml, wxT( "post_xml_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_64.png" ), 64, wxT( "light" ) );
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_64.png" ), 64, wxT( "light" ) );
@ -4153,6 +4162,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
aBitmapInfoCache[BITMAPS::post_gencad].emplace_back( BITMAPS::post_gencad, wxT( "post_gencad_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::post_gerber].emplace_back( BITMAPS::post_gerber, wxT( "post_gerber_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::post_rpt].emplace_back( BITMAPS::post_rpt, wxT( "post_rpt_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::post_xml].emplace_back( BITMAPS::post_xml, wxT( "post_xml_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::preference].emplace_back( BITMAPS::preference, wxT( "preference_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::print_button].emplace_back( BITMAPS::print_button, wxT( "print_button_dark_64.png" ), 64, wxT( "dark" ) );
aBitmapInfoCache[BITMAPS::project].emplace_back( BITMAPS::project, wxT( "project_dark_64.png" ), 64, wxT( "dark" ) );

View File

@ -94,8 +94,6 @@ wxString EDA_SHAPE::SHAPE_T_asString() const
case SHAPE_T::CIRCLE: return wxS( "S_CIRCLE" );
case SHAPE_T::POLY: return wxS( "S_POLYGON" );
case SHAPE_T::BEZIER: return wxS( "S_CURVE" );
// Synthetic value, but if we come across it then we're going to want to know.
case SHAPE_T::LAST: return wxS( "!S_LAST!" );
}
return wxEmptyString; // Just to quiet GCC.
@ -666,6 +664,23 @@ EDA_ANGLE EDA_SHAPE::GetArcAngle() const
}
bool EDA_SHAPE::IsClockwiseArc() const
{
if( m_shape == SHAPE_T::ARC )
{
VECTOR2D mid = GetArcMid();
double orient = ( mid.x - m_start.x ) * ( m_end.y - m_start.y )
- ( mid.y - m_start.y ) * ( m_end.x - m_start.x );
return orient < 0;
}
UNIMPLEMENTED_FOR( SHAPE_T_asString() );
return false;
}
void EDA_SHAPE::SetArcAngleAndEnd( const EDA_ANGLE& aAngle, bool aCheckNegativeAngle )
{
EDA_ANGLE angle( aAngle );

View File

@ -30,6 +30,7 @@
#include <pcb_textbox.h>
#include <pcb_shape.h>
#include <pad.h>
#include <pcb_track.h>
#include <macros.h>
#include <functional>
@ -74,15 +75,66 @@ size_t hash_fp_item( const EDA_ITEM* aItem, int aFlags )
}
break;
case PCB_VIA_T:
{
const PCB_VIA* via = static_cast<const PCB_VIA*>( aItem );
ret = hash_val( via->GetWidth() );
hash_combine( ret, via->GetDrillValue() );
hash_combine( ret, via->TopLayer() );
hash_combine( ret, via->BottomLayer() );
for( PCB_LAYER_ID layer : via->GetLayerSet().Seq() )
hash_combine( ret, via->FlashLayer( layer ) );
break;
}
case PCB_PAD_T:
{
const PAD* pad = static_cast<const PAD*>( aItem );
ret = hash<int>{}( static_cast<int>( pad->GetShape() ) );
hash_combine( ret, pad->GetDrillShape() );
hash_combine( ret, pad->GetAttribute() );
if( pad->GetAttribute() == PAD_ATTRIB::PTH || pad->GetAttribute() == PAD_ATTRIB::NPTH )
{
hash_combine( ret, pad->GetDrillSizeX(), pad->GetDrillSizeY() );
hash_combine( ret, pad->GetDrillShape() );
for( PCB_LAYER_ID layer : pad->GetLayerSet().Seq() )
hash_combine( ret, pad->FlashLayer( layer ) );
}
hash_combine( ret, pad->GetSize().x, pad->GetSize().y );
hash_combine( ret, pad->GetOffset().x, pad->GetOffset().y );
hash_combine( ret, pad->GetDelta().x, pad->GetDelta().y );
switch( pad->GetShape() )
{
case PAD_SHAPE::CHAMFERED_RECT:
hash_combine( ret, pad->GetChamferPositions() );
hash_combine( ret, pad->GetChamferRectRatio() );
break;
case PAD_SHAPE::ROUNDRECT:
hash_combine( ret, pad->GetRoundRectCornerRadius() );
break;
case PAD_SHAPE::TRAPEZOID:
hash_combine( ret, pad->GetDelta().x, pad->GetDelta().y );
break;
case PAD_SHAPE::CUSTOM:
{
auto poly = pad->GetEffectivePolygon( ERROR_INSIDE );
for( int ii = 0; ii < poly->VertexCount(); ++ii )
{
VECTOR2I point = poly->CVertex( ii ) - pad->GetPosition();
hash_combine( ret, point.x, point.y );
}
break;
}
default:
break;
}
hash_combine( ret, hash_board_item( pad, aFlags ) );
@ -100,7 +152,7 @@ size_t hash_fp_item( const EDA_ITEM* aItem, int aFlags )
if( aFlags & HASH_NET )
hash_combine( ret, pad->GetNetCode() );
}
break;
break;
case PCB_FIELD_T:
if( !( aFlags & HASH_REF ) && static_cast<const PCB_FIELD*>( aItem )->IsReference() )
@ -144,39 +196,57 @@ size_t hash_fp_item( const EDA_ITEM* aItem, int aFlags )
hash_combine( ret, shape->GetShape() );
hash_combine( ret, shape->GetWidth() );
hash_combine( ret, shape->IsFilled() );
hash_combine( ret, shape->GetLineStyle() );
if( shape->GetShape() == SHAPE_T::ARC || shape->GetShape() == SHAPE_T::CIRCLE )
hash_combine( ret, shape->GetRadius() );
if( aFlags & HASH_POS )
{
VECTOR2I start = shape->GetStart();
VECTOR2I end = shape->GetEnd();
VECTOR2I center = shape->GetCenter();
std::vector<VECTOR2I> points;
points.push_back( shape->GetStart() );
points.push_back( shape->GetEnd() );
if( shape->GetShape() == SHAPE_T::CIRCLE )
points.push_back( shape->GetCenter() );
if( shape->GetShape() == SHAPE_T::ARC )
points.push_back( shape->GetArcMid() );
FOOTPRINT* parentFP = shape->GetParentFootprint();
if( shape->GetShape() == SHAPE_T::POLY )
{
const SHAPE_POLY_SET& poly = shape->GetPolyShape();
for( auto it = poly.CIterateWithHoles(); it; it++ )
points.push_back( *it );
}
if( shape->GetShape() == SHAPE_T::BEZIER )
{
points.push_back( shape->GetBezierC1() );
points.push_back( shape->GetBezierC2() );
}
if( parentFP && ( aFlags & REL_COORD ) )
{
start -= parentFP->GetPosition();
end -= parentFP->GetPosition();
center -= parentFP->GetPosition();
RotatePoint( start, -parentFP->GetOrientation() );
RotatePoint( end, -parentFP->GetOrientation() );
RotatePoint( center, -parentFP->GetOrientation() );
for( VECTOR2I& point : points )
{
point -= parentFP->GetPosition();
RotatePoint( point, -parentFP->GetOrientation() );
}
}
hash_combine( ret, start.x );
hash_combine( ret, start.y );
hash_combine( ret, end.x );
hash_combine( ret, end.y );
if( shape->GetShape() == SHAPE_T::ARC )
if( aFlags & REL_POS )
{
hash_combine( ret, center.x );
hash_combine( ret, center.y );
for( VECTOR2I& point : points )
point -= shape->GetPosition();
}
for( VECTOR2I& point : points )
hash_combine( ret, point.x, point.y );
}
}
break;
@ -200,6 +270,7 @@ size_t hash_fp_item( const EDA_ITEM* aItem, int aFlags )
hash_combine( ret, textbox->GetShape() );
hash_combine( ret, textbox->GetWidth() );
hash_combine( ret, textbox->GetLineStyle() );
if( aFlags & HASH_POS )
{

View File

@ -122,6 +122,21 @@ PROJECT_FILE::PROJECT_FILE( const wxString& aFullPath ) :
m_params.emplace_back( new PARAM_VIEWPORT( "board.viewports", &m_Viewports ) );
m_params.emplace_back( new PARAM_VIEWPORT3D( "board.3dviewports", &m_Viewports3D ) );
m_params.emplace_back( new PARAM<wxString>( "board.ipc2581.internal_id",
&m_IP2581Bom.id, wxEmptyString ) );
m_params.emplace_back( new PARAM<wxString>( "board.ipc2581.mpn",
&m_IP2581Bom.MPN, wxEmptyString ) );
m_params.emplace_back( new PARAM<wxString>( "board.ipc2581.mfg",
&m_IP2581Bom.mfg, wxEmptyString ) );
m_params.emplace_back( new PARAM<wxString>( "board.ipc2581.distpn",
&m_IP2581Bom.distPN, wxEmptyString ) );
m_params.emplace_back( new PARAM<wxString>( "board.ipc2581.dist",
&m_IP2581Bom.dist, wxEmptyString ) );
}

View File

@ -101,7 +101,7 @@ void PROGRESS_REPORTER_BASE::AddPhases( int aNumPhases )
}
int PROGRESS_REPORTER_BASE::currentProgress() const
int PROGRESS_REPORTER_BASE::CurrentProgress() const
{
double current = ( 1.0 / (double) m_numPhases ) *
( (double) m_phase + ( (double) m_progress.load() / (double) m_maxProgress ) );

View File

@ -57,7 +57,7 @@ WX_PROGRESS_REPORTER::~WX_PROGRESS_REPORTER()
bool WX_PROGRESS_REPORTER::updateUI()
{
int cur = currentProgress();
int cur = CurrentProgress();
if( cur < 0 || cur > 1000 )
cur = 0;
@ -104,7 +104,7 @@ GAUGE_PROGRESS_REPORTER::GAUGE_PROGRESS_REPORTER( wxWindow* aParent, int aNumPha
bool GAUGE_PROGRESS_REPORTER::updateUI()
{
int cur = currentProgress();
int cur = CurrentProgress();
if( cur < 0 || cur > 1000 )
cur = 0;

View File

@ -181,6 +181,7 @@ const std::string KiCadFootprintFileExtension( "kicad_mod" );
const std::string SpecctraDsnFileExtension( "dsn" );
const std::string SpecctraSessionFileExtension( "ses" );
const std::string IpcD356FileExtension( "d356" );
const std::string Ipc2581FileExtension( "xml" );
const std::string WorkbookFileExtension( "wbk" );
const std::string PngFileExtension( "png" );

View File

@ -461,10 +461,6 @@ int SYMBOL_EDITOR_MOVE_TOOL::AlignElements( const TOOL_EVENT& aEvent )
doMoveItem( shape, newStart - shape->GetStart() );
break;
case SHAPE_T::LAST:
// Not a real shape
break;
}
}
else

View File

@ -288,6 +288,12 @@ public:
* When true, enable Eeschema printing using Cairo
*/
bool m_EnableEeschemaPrintCairo;
/**
* When true, enable output to 2581
*/
bool m_Enable2581;
///@}

View File

@ -454,6 +454,7 @@ enum class BITMAPS : unsigned int
post_gerber,
post_module,
post_rpt,
post_xml,
preference,
primitives_to_custom_pad,
print_button,

View File

@ -45,8 +45,7 @@ enum class SHAPE_T : int
ARC,
CIRCLE,
POLY,
BEZIER,
LAST ///< marker for list end
BEZIER
};
@ -311,6 +310,8 @@ public:
void SetSegmentAngle( const EDA_ANGLE& aAngle );
bool IsClockwiseArc() const;
/**
* @return the length of the segment using the hypotenuse calculation.
*/

View File

@ -44,11 +44,13 @@ enum HASH_FLAGS
///< use coordinates relative to the parent object
REL_COORD = 0x02,
HASH_ROT = 0x04,
HASH_LAYER = 0x08,
HASH_NET = 0x10,
HASH_REF = 0x20,
HASH_VALUE = 0x40,
///< use coordinates relative to the shape position
REL_POS = 0x04,
HASH_ROT = 0x08,
HASH_LAYER = 0x10,
HASH_NET = 0x20,
HASH_REF = 0x40,
HASH_VALUE = 0x80,
HASH_ALL = 0xff
};

View File

@ -124,6 +124,16 @@ enum class RATSNEST_MODE
VISIBLE ///< Ratsnest lines are drawn to items on visible layers only
};
///< BOM Data choices for IPC2581 export
struct IP2581_BOM
{
wxString mfg; ///< Manufacturer name column
wxString MPN; ///< Manufacturer part number column
wxString dist; ///< Distributor name column
wxString distPN; ///< Distributor part number column
wxString id; ///< Internal ID column
};
/**
* A saved set of layers that are visible.
*/

View File

@ -55,6 +55,7 @@ enum LAST_PATH_TYPE : unsigned int
LAST_PATH_POS_FILES,
LAST_PATH_SVG,
LAST_PATH_PLOT,
LAST_PATH_2581,
LAST_PATH_SIZE
};
@ -176,6 +177,8 @@ public:
std::vector<VIEWPORT> m_Viewports; /// List of stored viewports (pos + zoom)
std::vector<VIEWPORT3D> m_Viewports3D; /// List of stored 3D viewports (view matrixes)
struct IP2581_BOM m_IP2581Bom; /// IPC-2581 BOM settings
private:
/// An list of schematic sheets in this project
std::vector<FILE_INFO_PAIR> m_sheets;

View File

@ -107,8 +107,9 @@ public:
bool IsCancelled() const override { return m_cancelled; }
int CurrentProgress() const;
protected:
int currentProgress() const;
virtual bool updateUI() = 0;

View File

@ -166,6 +166,7 @@ extern const std::string DrawingSheetFileExtension;
extern const std::string SpecctraDsnFileExtension;
extern const std::string SpecctraSessionFileExtension;
extern const std::string IpcD356FileExtension;
extern const std::string Ipc2581FileExtension;
extern const std::string WorkbookFileExtension;
extern const std::string PngFileExtension;

View File

@ -0,0 +1,68 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef WX_FSTREAM_PROGRESS_H
#define WX_FSTREAM_PROGRESS_H
#include <wx/wfstream.h>
class wxFileOutputStreamWithProgress : public wxFileOutputStream
{
public:
wxFileOutputStreamWithProgress( const wxString& aFileName )
: wxFileOutputStream( aFileName )
{
}
wxFileOutputStreamWithProgress( wxFile& aFile )
: wxFileOutputStream( aFile )
{
}
wxFileOutputStreamWithProgress( int aFd )
: wxFileOutputStream( aFd )
{
}
virtual ~wxFileOutputStreamWithProgress() = default;
void SetProgressCallback( std::function<void( size_t )> aCallback )
{
m_callback = aCallback;
}
virtual size_t OnSysWrite( const void* aBuffer, size_t aSize ) override
{
size_t written = wxFileOutputStream::OnSysWrite( aBuffer, aSize );
if( m_callback )
m_callback( written );
return written;
}
private:
std::function<void( size_t )> m_callback;
};
#endif // WX_FSTREAM_PROGRESS_H

View File

@ -63,6 +63,8 @@ set( PCBNEW_DIALOGS
dialogs/dialog_enum_pads_base.cpp
dialogs/dialog_exchange_footprints.cpp
dialogs/dialog_exchange_footprints_base.cpp
dialogs/dialog_export_2581.cpp
dialogs/dialog_export_2581_base.cpp
dialogs/dialog_export_idf.cpp
dialogs/dialog_export_idf_base.cpp
dialogs/dialog_export_step.cpp
@ -598,8 +600,9 @@ add_subdirectory( plugins/cadstar )
add_subdirectory( plugins/easyeda )
add_subdirectory( plugins/easyedapro )
add_subdirectory( plugins/fabmaster )
add_subdirectory( plugins/ipc2581 )
set( PCBNEW_IO_LIBRARIES pcad2kicadpcb altium2pcbnew cadstar2pcbnew easyeda easyedapro fabmaster CACHE INTERNAL "")
set( PCBNEW_IO_LIBRARIES pcad2kicadpcb altium2pcbnew cadstar2pcbnew easyeda easyedapro fabmaster ipc2581 CACHE INTERNAL "")
# a very small program launcher for pcbnew_kiface
add_executable( pcbnew WIN32 MACOSX_BUNDLE

View File

@ -205,6 +205,7 @@ bool ConvertOutlineToPolygon( std::vector<PCB_SHAPE*>& aShapeList, SHAPE_POLY_SE
contours.emplace_back();
SHAPE_LINE_CHAIN& currContour = contours.back();
currContour.SetWidth( graphic->GetWidth() );
bool firstPt = true;
// Circles, rects and polygons are closed shapes unto themselves (and do not combine

View File

@ -0,0 +1,305 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <dialogs/dialog_export_2581.h>
#include <board.h>
#include <footprint.h>
#include <kiway_holder.h>
#include <pcb_edit_frame.h>
#include <pcbnew_settings.h>
#include <pgm_base.h>
#include <project.h>
#include <project/board_project_settings.h>
#include <project/project_file.h>
#include <settings/settings_manager.h>
#include <widgets/std_bitmap_button.h>
#include <set>
#include <vector>
#include <wx/filedlg.h>
static wxString s_oemColumn = wxEmptyString;
DIALOG_EXPORT_2581::DIALOG_EXPORT_2581( PCB_EDIT_FRAME* aParent ) :
DIALOG_EXPORT_2581_BASE( aParent ), m_parent( aParent )
{
m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
SetupStandardButtons( { { wxID_OK, _( "Export" ) },
{ wxID_CANCEL, _( "Close" ) } } );
wxString path = m_parent->GetLastPath( LAST_PATH_2581 );
if( path.IsEmpty() )
{
wxFileName brdFile( m_parent->GetBoard()->GetFileName() );
brdFile.SetExt( wxT( "xml" ) );
path = brdFile.GetFullPath();
}
m_outputFileName->SetValue( path );
m_textDistributor->SetSize( m_choiceDistPN->GetSize() );
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
}
void DIALOG_EXPORT_2581::onBrowseClicked( wxCommandEvent& event )
{
// Build the absolute path of current output directory to preselect it in the file browser.
wxString path = ExpandEnvVarSubstitutions( m_outputFileName->GetValue(), &Prj() );
wxFileName fn( Prj().AbsolutePath( path ) );
wxString ipc_files = _( "IPC-2581 Files (*.xml)|*.xml" );
wxString compressed_files = _( "IPC-2581 Compressed Files (*.zip)|*.zip" );
wxFileDialog dlg( this, _( "Export IPC-2581 File" ), fn.GetPath(), fn.GetFullName(),
m_cbCompress->IsChecked() ? compressed_files : ipc_files,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
if( dlg.ShowModal() == wxID_CANCEL )
return;
m_outputFileName->SetValue( dlg.GetPath() );
}
void DIALOG_EXPORT_2581::onOKClick( wxCommandEvent& event )
{
m_parent->SetLastPath( LAST_PATH_2581, m_outputFileName->GetValue() );
event.Skip();
}
void DIALOG_EXPORT_2581::onCompressCheck( wxCommandEvent& event )
{
if( m_cbCompress->GetValue() )
{
wxFileName fn = m_outputFileName->GetValue();
fn.SetExt( "zip" );
m_outputFileName->SetValue( fn.GetFullPath() );
}
else
{
wxFileName fn = m_outputFileName->GetValue();
fn.SetExt( "xml" );
m_outputFileName->SetValue( fn.GetFullPath() );
}
}
void DIALOG_EXPORT_2581::onMfgPNChange( wxCommandEvent& event )
{
if( event.GetSelection() == 0 )
{
m_choiceMfg->Enable( false );
}
else
{
m_choiceMfg->Enable( true );
// Don't try to guess the manufacturer if the user has already selected one
if( m_choiceMfg->GetSelection() > 0 )
return;
int it = 0;
if( it = m_choiceMfg->FindString( wxT( "manufacturer" ) ); it != wxNOT_FOUND )
{
m_choiceMfg->Select( it );
}
else if( it = m_choiceMfg->FindString( _( "manufacturer" ) ); it != wxNOT_FOUND )
{
m_choiceMfg->Select( it );
}
else if( it = m_choiceMfg->FindString( wxT( "mfg" ) ); it != wxNOT_FOUND )
{
m_choiceMfg->Select( it );
}
else if( it = m_choiceMfg->FindString( _( "mfg" ) ); it != wxNOT_FOUND )
{
m_choiceMfg->Select( it );
}
}
}
void DIALOG_EXPORT_2581::onDistPNChange( wxCommandEvent& event )
{
if( event.GetSelection() == 0 )
{
m_textDistributor->Enable( false );
m_textDistributor->SetValue( _( "N/A" ) );
}
else
{
m_textDistributor->Enable( true );
// Don't try to guess the distributor if the user has already selected one
if( m_textDistributor->GetValue() != _( "N/A" ) )
return;
wxString dist = m_choiceDistPN->GetStringSelection();
dist.MakeUpper();
// Try to guess the distributor from the part number column
if( dist.Contains( wxT( "DIGIKEY" ) ) )
{
m_textDistributor->SetValue( wxT( "Digi-Key" ) );
}
else if( dist.Contains( wxT( "DIGI-KEY" ) ) )
{
m_textDistributor->SetValue( wxT( "Digi-Key" ) );
}
else if( dist.Contains( wxT( "MOUSER" ) ) )
{
m_textDistributor->SetValue( wxT( "Mouser" ) );
}
else if( dist.Contains( wxT( "NEWARK" ) ) )
{
m_textDistributor->SetValue( wxT( "Newark" ) );
}
else if( dist.Contains( wxT( "RS COMPONENTS" ) ) )
{
m_textDistributor->SetValue( wxT( "RS Components" ) );
}
else if( dist.Contains( wxT( "FARNELL" ) ) )
{
m_textDistributor->SetValue( wxT( "Farnell" ) );
}
else if( dist.Contains( wxT( "ARROW" ) ) )
{
m_textDistributor->SetValue( wxT( "Arrow" ) );
}
else if( dist.Contains( wxT( "AVNET" ) ) )
{
m_textDistributor->SetValue( wxT( "Avnet" ) );
}
else if( dist.Contains( wxT( "TME" ) ) )
{
m_textDistributor->SetValue( wxT( "TME" ) );
}
else if( dist.Contains( wxT( "LCSC" ) ) )
{
m_textDistributor->SetValue( wxT( "LCSC" ) );
}
}
}
bool DIALOG_EXPORT_2581::TransferDataToWindow()
{
PCBNEW_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
std::set<wxString> options;
BOARD* board = m_parent->GetBoard();
for( FOOTPRINT* fp : board->Footprints() )
{
for( PCB_FIELD* field : fp->GetFields() )
options.insert( field->GetName() );
}
m_choiceUnits->SetSelection( cfg->m_Export2581.units );
m_precision->SetValue( cfg->m_Export2581.precision );
m_versionChoice->SetSelection( cfg->m_Export2581.version );
m_cbCompress->SetValue( cfg->m_Export2581.compress );
wxCommandEvent dummy;
onCompressCheck( dummy );
std::vector<wxString> items( options.begin(), options.end() );
m_oemRef->Append( items );
m_choiceMPN->Append( items );
m_choiceMfg->Append( items );
m_choiceDistPN->Append( items );
m_oemRef->SetStringSelection( s_oemColumn );
PROJECT_FILE& prj = Prj().GetProjectFile();
if( !m_choiceMPN->SetStringSelection( prj.m_IP2581Bom.id ) )
m_choiceMPN->SetSelection( 0 );
if( m_choiceMPN->SetStringSelection( prj.m_IP2581Bom.MPN ) )
{
m_choiceMfg->Enable( true );
if( !m_choiceMfg->SetStringSelection( prj.m_IP2581Bom.mfg ) )
m_choiceMfg->SetSelection( 0 );
}
else
{
m_choiceMPN->SetSelection( 0 );
m_choiceMfg->SetSelection( 0 );
m_choiceMfg->Enable( false );
}
if( m_choiceDistPN->SetStringSelection( prj.m_IP2581Bom.distPN ) )
{
m_textDistributor->Enable( true );
// The combo box selection can be fixed, so any value can be entered
if( !prj.m_IP2581Bom.distPN.empty() )
{
m_textDistributor->SetValue( prj.m_IP2581Bom.dist );
}
else
{
wxCommandEvent evt;
onDistPNChange( evt );
}
}
else
{
m_choiceDistPN->SetSelection( 0 );
m_textDistributor->SetValue( _( "N/A" ) );
m_textDistributor->Enable( false );
}
return true;
}
bool DIALOG_EXPORT_2581::TransferDataFromWindow()
{
PCBNEW_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
cfg->m_Export2581.units = m_choiceUnits->GetSelection();
cfg->m_Export2581.precision = m_precision->GetValue();
cfg->m_Export2581.version = m_versionChoice->GetSelection();
cfg->m_Export2581.compress = m_cbCompress->GetValue();
PROJECT_FILE& prj = Prj().GetProjectFile();
wxString empty;
prj.m_IP2581Bom.id = GetOEM();
prj.m_IP2581Bom.mfg = GetMfg();
prj.m_IP2581Bom.MPN = GetMPN();
prj.m_IP2581Bom.distPN = GetDistPN();
prj.m_IP2581Bom.dist = GetDist();
s_oemColumn = m_oemRef->GetStringSelection();
return true;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,113 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef IPC2581_EXPORT_DIALOG_H
#define IPC2581_EXPORT_DIALOG_H
#include "dialog_export_2581_base.h"
class PCB_EDIT_FRAME;
class DIALOG_EXPORT_2581 : public DIALOG_EXPORT_2581_BASE
{
public:
DIALOG_EXPORT_2581( PCB_EDIT_FRAME* aParent );
wxString GetOutputPath() const
{
return m_outputFileName->GetValue();
}
wxString GetUnitsString() const
{
if( m_choiceUnits->GetSelection() == 0 )
return wxT( "mm" );
else
return wxT( "inch" );
}
wxString GetPrecision() const
{
return wxString::Format( "%d", m_precision->GetValue() );
}
char GetVersion() const
{
return m_versionChoice->GetSelection() == 0 ? 'B' : 'C';
}
wxString GetOEM() const
{
if( m_oemRef->GetSelection() == 0 )
return wxEmptyString;
else
return m_oemRef->GetStringSelection();
}
bool GetCompress() const
{
return m_cbCompress->GetValue();
}
wxString GetMPN() const
{
if( !m_choiceMPN->IsEnabled() || m_choiceMPN->GetSelection() == 0 )
return wxEmptyString;
else
return m_choiceMPN->GetStringSelection();
}
wxString GetMfg() const
{
if( !m_choiceMfg->IsEnabled() || m_choiceMfg->GetSelection() == 0 )
return wxEmptyString;
else
return m_choiceMfg->GetStringSelection();
}
wxString GetDistPN() const
{
if( !m_choiceDistPN->IsEnabled() || m_choiceDistPN->GetSelection() == 0 )
return wxEmptyString;
else
return m_choiceDistPN->GetStringSelection();
}
wxString GetDist() const
{
if( !m_textDistributor->IsEnabled() || m_textDistributor->GetValue() == _( "N/A" ) )
return wxEmptyString;
else
return m_textDistributor->GetValue();
}
private:
void onBrowseClicked( wxCommandEvent& event ) override;
void onOKClick( wxCommandEvent& event ) override;
void onCompressCheck( wxCommandEvent& event ) override;
void onMfgPNChange( wxCommandEvent& event ) override;
void onDistPNChange( wxCommandEvent& event ) override;
bool TransferDataToWindow() override;
bool TransferDataFromWindow() override;
PCB_EDIT_FRAME* m_parent;
};
#endif // IPC2581_EXPORT_DIALOG_H

View File

@ -0,0 +1,202 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf0)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "widgets/std_bitmap_button.h"
#include "dialog_export_2581_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_EXPORT_2581_BASE::DIALOG_EXPORT_2581_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
bSizerTop = new wxBoxSizer( wxHORIZONTAL );
m_lblBrdFile = new wxStaticText( this, wxID_ANY, _("File:"), wxDefaultPosition, wxDefaultSize, 0 );
m_lblBrdFile->Wrap( -1 );
bSizerTop->Add( m_lblBrdFile, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_outputFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_outputFileName->SetToolTip( _("Enter a filename if you do not want to use default file names\nCan be used only when printing the current sheet") );
m_outputFileName->SetMinSize( wxSize( 350,-1 ) );
bSizerTop->Add( m_outputFileName, 1, wxALIGN_CENTER_VERTICAL, 5 );
m_browseButton = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
bSizerTop->Add( m_browseButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
bMainSizer->Add( bSizerTop, 0, wxBOTTOM|wxEXPAND|wxTOP, 15 );
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sbSizer1;
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("File Format") ), wxVERTICAL );
wxFlexGridSizer* fgSizer;
fgSizer = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer->AddGrowableCol( 1 );
fgSizer->SetFlexibleDirection( wxBOTH );
fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_lblUnits = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Units:"), wxDefaultPosition, wxDefaultSize, 0 );
m_lblUnits->Wrap( -1 );
fgSizer->Add( m_lblUnits, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
wxString m_choiceUnitsChoices[] = { _("Millimeters"), _("Inches") };
int m_choiceUnitsNChoices = sizeof( m_choiceUnitsChoices ) / sizeof( wxString );
m_choiceUnits = new wxChoice( sbSizer1->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitsNChoices, m_choiceUnitsChoices, 0 );
m_choiceUnits->SetSelection( 0 );
fgSizer->Add( m_choiceUnits, 0, wxALL|wxEXPAND, 5 );
m_lblPrecision = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Precision:"), wxDefaultPosition, wxDefaultSize, 0 );
m_lblPrecision->Wrap( -1 );
m_lblPrecision->SetToolTip( _("The number of values following the decimal separator") );
fgSizer->Add( m_lblPrecision, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_precision = new wxSpinCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 2, 16, 3 );
m_precision->SetToolTip( _("The number of values following the decimal separator") );
fgSizer->Add( m_precision, 0, wxALL|wxEXPAND, 5 );
m_lblVersion = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Version:"), wxDefaultPosition, wxDefaultSize, 0 );
m_lblVersion->Wrap( -1 );
fgSizer->Add( m_lblVersion, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
wxString m_versionChoiceChoices[] = { _("B"), _("C") };
int m_versionChoiceNChoices = sizeof( m_versionChoiceChoices ) / sizeof( wxString );
m_versionChoice = new wxChoice( sbSizer1->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_versionChoiceNChoices, m_versionChoiceChoices, 0 );
m_versionChoice->SetSelection( 1 );
fgSizer->Add( m_versionChoice, 0, wxALL|wxEXPAND, 5 );
m_cbCompress = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Compress Output"), wxDefaultPosition, wxDefaultSize, 0 );
m_cbCompress->SetToolTip( _("Compress output into 'zip' file") );
fgSizer->Add( m_cbCompress, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
sbSizer1->Add( fgSizer, 3, wxEXPAND|wxALL, 5 );
bSizer3->Add( sbSizer1, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 10 );
wxStaticBoxSizer* sbSizer2;
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("BOM Columns") ), wxVERTICAL );
wxFlexGridSizer* fgSizer4;
fgSizer4 = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer4->SetFlexibleDirection( wxBOTH );
fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_lblOEM = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Internal ID:"), wxDefaultPosition, wxDefaultSize, 0 );
m_lblOEM->Wrap( -1 );
m_lblOEM->SetToolTip( _("Part ID number used internally during design.\nThis number must be unique to each part.") );
fgSizer4->Add( m_lblOEM, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
wxString m_oemRefChoices[] = { _("Generate Unique") };
int m_oemRefNChoices = sizeof( m_oemRefChoices ) / sizeof( wxString );
m_oemRef = new wxChoice( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_oemRefNChoices, m_oemRefChoices, 0 );
m_oemRef->SetSelection( 0 );
m_oemRef->SetToolTip( _("Part ID number used internally during design.\nThis number must be unique to each part.") );
fgSizer4->Add( m_oemRef, 0, wxALL|wxEXPAND, 5 );
m_staticText6 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Manufacturer P/N:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText6->Wrap( -1 );
m_staticText6->SetToolTip( _("Column containing the manufacturer part number") );
fgSizer4->Add( m_staticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
wxString m_choiceMPNChoices[] = { _("Omit") };
int m_choiceMPNNChoices = sizeof( m_choiceMPNChoices ) / sizeof( wxString );
m_choiceMPN = new wxChoice( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceMPNNChoices, m_choiceMPNChoices, 0 );
m_choiceMPN->SetSelection( 0 );
m_choiceMPN->SetToolTip( _("Column containing the manufacturer part number") );
fgSizer4->Add( m_choiceMPN, 0, wxALL|wxEXPAND, 5 );
m_staticText7 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Manufacturer:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText7->Wrap( -1 );
fgSizer4->Add( m_staticText7, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
wxString m_choiceMfgChoices[] = { _("N/A") };
int m_choiceMfgNChoices = sizeof( m_choiceMfgChoices ) / sizeof( wxString );
m_choiceMfg = new wxChoice( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceMfgNChoices, m_choiceMfgChoices, 0 );
m_choiceMfg->SetSelection( 0 );
m_choiceMfg->Enable( false );
fgSizer4->Add( m_choiceMfg, 0, wxALL|wxEXPAND, 5 );
m_staticText8 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Distributor P/N:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText8->Wrap( -1 );
fgSizer4->Add( m_staticText8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
wxString m_choiceDistPNChoices[] = { _("Omit") };
int m_choiceDistPNNChoices = sizeof( m_choiceDistPNChoices ) / sizeof( wxString );
m_choiceDistPN = new wxChoice( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceDistPNNChoices, m_choiceDistPNChoices, 0 );
m_choiceDistPN->SetSelection( 0 );
m_choiceDistPN->SetToolTip( _("Column containing the distributor part number") );
fgSizer4->Add( m_choiceDistPN, 0, wxALL|wxEXPAND, 5 );
m_staticText9 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Distributor:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText9->Wrap( -1 );
fgSizer4->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_textDistributor = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, _("N/A"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer4->Add( m_textDistributor, 0, wxALL|wxEXPAND, 5 );
sbSizer2->Add( fgSizer4, 1, wxEXPAND, 5 );
bSizer3->Add( sbSizer2, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 10 );
bMainSizer->Add( bSizer3, 0, wxEXPAND, 5 );
m_stdButtons = new wxStdDialogButtonSizer();
m_stdButtonsOK = new wxButton( this, wxID_OK );
m_stdButtons->AddButton( m_stdButtonsOK );
m_stdButtonsCancel = new wxButton( this, wxID_CANCEL );
m_stdButtons->AddButton( m_stdButtonsCancel );
m_stdButtons->Realize();
bMainSizer->Add( m_stdButtons, 0, wxEXPAND|wxALL, 5 );
this->SetSizer( bMainSizer );
this->Layout();
bMainSizer->Fit( this );
this->Centre( wxBOTH );
// Connect Events
m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_2581_BASE::onBrowseClicked ), NULL, this );
m_cbCompress->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_2581_BASE::onCompressCheck ), NULL, this );
m_choiceMPN->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_EXPORT_2581_BASE::onMfgPNChange ), NULL, this );
m_choiceDistPN->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_EXPORT_2581_BASE::onDistPNChange ), NULL, this );
m_stdButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_2581_BASE::onOKClick ), NULL, this );
}
DIALOG_EXPORT_2581_BASE::~DIALOG_EXPORT_2581_BASE()
{
// Disconnect Events
m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_2581_BASE::onBrowseClicked ), NULL, this );
m_cbCompress->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_2581_BASE::onCompressCheck ), NULL, this );
m_choiceMPN->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_EXPORT_2581_BASE::onMfgPNChange ), NULL, this );
m_choiceDistPN->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_EXPORT_2581_BASE::onDistPNChange ), NULL, this );
m_stdButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_2581_BASE::onOKClick ), NULL, this );
}

View File

@ -0,0 +1,86 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf0)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class STD_BITMAP_BUTTON;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/bmpbuttn.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/choice.h>
#include <wx/spinctrl.h>
#include <wx/checkbox.h>
#include <wx/statbox.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_EXPORT_2581_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_EXPORT_2581_BASE : public DIALOG_SHIM
{
private:
protected:
wxBoxSizer* bSizerTop;
wxStaticText* m_lblBrdFile;
wxTextCtrl* m_outputFileName;
STD_BITMAP_BUTTON* m_browseButton;
wxStaticText* m_lblUnits;
wxChoice* m_choiceUnits;
wxStaticText* m_lblPrecision;
wxSpinCtrl* m_precision;
wxStaticText* m_lblVersion;
wxChoice* m_versionChoice;
wxCheckBox* m_cbCompress;
wxStaticText* m_lblOEM;
wxChoice* m_oemRef;
wxStaticText* m_staticText6;
wxChoice* m_choiceMPN;
wxStaticText* m_staticText7;
wxChoice* m_choiceMfg;
wxStaticText* m_staticText8;
wxChoice* m_choiceDistPN;
wxStaticText* m_staticText9;
wxTextCtrl* m_textDistributor;
wxStdDialogButtonSizer* m_stdButtons;
wxButton* m_stdButtonsOK;
wxButton* m_stdButtonsCancel;
// Virtual event handlers, override them in your derived class
virtual void onBrowseClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void onCompressCheck( wxCommandEvent& event ) { event.Skip(); }
virtual void onMfgPNChange( wxCommandEvent& event ) { event.Skip(); }
virtual void onDistPNChange( wxCommandEvent& event ) { event.Skip(); }
virtual void onOKClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_EXPORT_2581_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Export IPC-2581"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE );
~DIALOG_EXPORT_2581_BASE();
};

Some files were not shown because too many files have changed in this diff Show More