Commit 3bb91baf authored by Dick Hollenbeck's avatar Dick Hollenbeck

KICAD_PLUGIN alternate nanometer board loader work

parent b6508af0
......@@ -69,7 +69,7 @@ BOARD::BOARD( PCB_BASE_FRAME* frame ) :
BOARD::~BOARD()
{
if( m_PcbFrame->GetScreen() )
if( m_PcbFrame && m_PcbFrame->GetScreen() )
m_PcbFrame->GetScreen()->ClearUndoRedoList();
while( m_ZoneDescriptorList.size() )
......
......@@ -26,6 +26,17 @@ PCB_TARGET::PCB_TARGET( BOARD_ITEM* aParent ) :
m_Size = 5000;
}
PCB_TARGET::PCB_TARGET( BOARD_ITEM* aParent, int aShape, int aLayer,
const wxPoint& aPos, int aSize, int aWidth ) :
BOARD_ITEM( aParent, PCB_TARGET_T )
{
m_Shape = aShape;
m_Layer = aLayer;
m_Pos = aPos;
m_Size = aSize;
m_Width = aWidth;
}
PCB_TARGET::~PCB_TARGET()
{
......
......@@ -25,6 +25,9 @@ public:
public:
PCB_TARGET( BOARD_ITEM* aParent );
PCB_TARGET( BOARD_ITEM* aParent, int aShape, int aLayer,
const wxPoint& aPos, int aSize, int aWidth );
~PCB_TARGET();
PCB_TARGET* Next() const { return (PCB_TARGET*) Pnext; }
......
......@@ -174,7 +174,6 @@ public:
return (m_ModuleStatus & MODULE_is_LOCKED) != 0;
}
/**
* Function SetLocked
* sets the MODULE_is_LOCKED bit in the m_ModuleStatus
......@@ -188,6 +187,16 @@ public:
m_ModuleStatus &= ~MODULE_is_LOCKED;
}
bool IsPlaced() const { return (m_ModuleStatus & MODULE_is_PLACED); }
void SetIsPlaced( bool isPlaced )
{
if( isPlaced )
m_ModuleStatus |= MODULE_is_PLACED;
else
m_ModuleStatus &= ~MODULE_is_PLACED;
}
void SetLastEditTime( long aTime ) { m_LastEdit_Time = aTime; }
/* Reading and writing data on files */
......
......@@ -110,7 +110,7 @@ public:
wxSize m_DeltaSize; // delta on rectangular shapes
wxPoint m_Pos0; // Initial Pad position (i.e. pas position relative to the
wxPoint m_Pos0; // Initial Pad position (i.e. pad position relative to the
// module anchor, orientation 0
int m_ShapeMaxRadius; // radius of the circle containing the pad shape
......@@ -169,6 +169,7 @@ public:
* @return the shape of this pad.
*/
int GetShape() const { return m_PadShape & 0xFF; }
void SetShape( int aShape ) { m_PadShape = aShape; }
const wxPoint GetPosition() const // overload
{
......@@ -177,6 +178,23 @@ public:
void SetPosition( const wxPoint& aPos ) { m_Pos = aPos; } // overload
void SetPos0( const wxPoint& aPos ) { m_Pos0 = aPos; }
void SetSize( const wxSize& aSize ) { m_Size = aSize; }
void SetDelta( const wxSize& aSize ) { m_DeltaSize = aSize; }
void SetDrillSize( const wxSize& aSize ) { m_Drill = aSize; }
void SetOffset( const wxSize& aOffset ) { m_Offset = aOffset; }
void SetOrientation( int aAngle ) { m_Orient = aAngle; }
void SetDrillShape( int aDrillShape ) { m_DrillShape = aDrillShape; }
void SetLayerMask( int aLayerMask ) { m_layerMask = aLayerMask; }
void SetAttribute( int aAttribute ) { m_Attribut = aAttribute; }
void SetDieLength( int aLength ) { m_LengthDie = aLength; }
void SetSolderMaskMargin( int aLength ) { m_LocalSolderMaskMargin = aLength; }
void SetSolderPasteMargin( int aLength ) { m_LocalSolderPasteMargin = aLength; }
void SetSolderPasteRatio( double aRatio ) { m_LocalSolderPasteMarginRatio = aRatio; }
/// A local override of the Module's clearance
void SetPadClearance( int aLength ) { m_LocalClearance = aLength; }
/**
* Function TransformShapeWithClearanceToPolygon
* Convert the pad shape to a closed polygon
......
This diff is collapsed.
......@@ -39,18 +39,24 @@ class NETCLASS;
class ZONE_CONTAINER;
class DIMENSION;
class NETINFO_ITEM;
class TEXTE_MODULE;
/**
* Class KICAD_PLUGIN
* is a PLUGIN derivation which could possibly be put into a DLL/DSO.
* It is not thread safe, but it is re-entrant multiple times in sequence.
*/
class KICAD_PLUGIN : public PLUGIN
{
public:
//-----<PLUGIN>---------------------------------------------------------------------
//-----<PLUGIN>-------------------------------------------------------------
BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, PROPERTIES* aProperties = NULL );
BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, PROPERTIES* aProperties = NULL ); // overload
void Save( const wxString* aFileName, BOARD* aBoard, PROPERTIES* aProperties = NULL );
void Save( const wxString* aFileName, BOARD* aBoard, PROPERTIES* aProperties = NULL ); // overload
const wxString& PluginName()
{
......@@ -58,7 +64,7 @@ public:
return name;
}
//-----</PLUGIN>--------------------------------------------------------------------
//-----</PLUGIN>------------------------------------------------------------
protected:
......@@ -87,10 +93,10 @@ protected:
* parses an ASCII decimal floating point value and scales it into a BIU
* according to the current value of diskToBui.
*
* @param aValue is the ASCII value in C locale form.
* @param aValue is the ASCII value in C locale form with possible leading whitespace
*
* @param nptrptr may be NULL, but if not, then it tells where to put a
* pointer to the next unconsumed input text. See man strtod() for more information.
* pointer to the next unconsumed input text. See "man strtod" for more information.
*
* @return BIU - the converted Board Internal Unit.
*/
......@@ -105,6 +111,11 @@ protected:
void loadSHEET();
void loadMODULE();
void load3D( MODULE* aModule );
void loadPAD( MODULE* aModule );
void loadTEXTE_MODULE( TEXTE_MODULE* aText );
void loadEDGE_MODULE( MODULE* aModule );
void loadDRAWSEGMENT();
void loadNETINFO_ITEM();
void loadPCB_TEXTE();
......@@ -123,12 +134,11 @@ protected:
void loadTrackList( TRACK* aInsertBeforeMe, int aStructType );
void loadZONE_CONTAINER(); // "$CZONE_OUTLINE"
void loadDIMENSION(); // "$COTATION"
void loadPCB_TARGET(); // "$PCB_TARGET"
/* @todo
void load( PCB_TARGET* me );
void load( NETINFO* me );
void load( TRACK* me );
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment