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 ) : ...@@ -69,7 +69,7 @@ BOARD::BOARD( PCB_BASE_FRAME* frame ) :
BOARD::~BOARD() BOARD::~BOARD()
{ {
if( m_PcbFrame->GetScreen() ) if( m_PcbFrame && m_PcbFrame->GetScreen() )
m_PcbFrame->GetScreen()->ClearUndoRedoList(); m_PcbFrame->GetScreen()->ClearUndoRedoList();
while( m_ZoneDescriptorList.size() ) while( m_ZoneDescriptorList.size() )
......
...@@ -26,6 +26,17 @@ PCB_TARGET::PCB_TARGET( BOARD_ITEM* aParent ) : ...@@ -26,6 +26,17 @@ PCB_TARGET::PCB_TARGET( BOARD_ITEM* aParent ) :
m_Size = 5000; 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() PCB_TARGET::~PCB_TARGET()
{ {
......
...@@ -25,6 +25,9 @@ public: ...@@ -25,6 +25,9 @@ public:
public: public:
PCB_TARGET( BOARD_ITEM* aParent ); 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();
PCB_TARGET* Next() const { return (PCB_TARGET*) Pnext; } PCB_TARGET* Next() const { return (PCB_TARGET*) Pnext; }
......
...@@ -43,7 +43,7 @@ class MODULE : public BOARD_ITEM ...@@ -43,7 +43,7 @@ class MODULE : public BOARD_ITEM
{ {
public: public:
int m_Orient; // orientation in 0.1 degrees int m_Orient; // orientation in 0.1 degrees
wxPoint m_Pos; // Real coord on board wxPoint m_Pos; // Real coord on board
DLIST<D_PAD> m_Pads; /* Pad list (linked list) */ DLIST<D_PAD> m_Pads; /* Pad list (linked list) */
DLIST<BOARD_ITEM> m_Drawings; /* Graphic items list (linked list) */ DLIST<BOARD_ITEM> m_Drawings; /* Graphic items list (linked list) */
...@@ -174,7 +174,6 @@ public: ...@@ -174,7 +174,6 @@ public:
return (m_ModuleStatus & MODULE_is_LOCKED) != 0; return (m_ModuleStatus & MODULE_is_LOCKED) != 0;
} }
/** /**
* Function SetLocked * Function SetLocked
* sets the MODULE_is_LOCKED bit in the m_ModuleStatus * sets the MODULE_is_LOCKED bit in the m_ModuleStatus
...@@ -188,6 +187,16 @@ public: ...@@ -188,6 +187,16 @@ public:
m_ModuleStatus &= ~MODULE_is_LOCKED; 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 */ /* Reading and writing data on files */
......
...@@ -110,7 +110,7 @@ public: ...@@ -110,7 +110,7 @@ public:
wxSize m_DeltaSize; // delta on rectangular shapes 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 // module anchor, orientation 0
int m_ShapeMaxRadius; // radius of the circle containing the pad shape int m_ShapeMaxRadius; // radius of the circle containing the pad shape
...@@ -169,13 +169,31 @@ public: ...@@ -169,13 +169,31 @@ public:
* @return the shape of this pad. * @return the shape of this pad.
*/ */
int GetShape() const { return m_PadShape & 0xFF; } int GetShape() const { return m_PadShape & 0xFF; }
void SetShape( int aShape ) { m_PadShape = aShape; }
const wxPoint GetPosition() const // overload const wxPoint GetPosition() const // overload
{ {
return m_Pos; return m_Pos;
} }
void SetPosition( const wxPoint& aPos ) { m_Pos = aPos; } // overload 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 * Function TransformShapeWithClearanceToPolygon
......
This diff is collapsed.
...@@ -39,18 +39,24 @@ class NETCLASS; ...@@ -39,18 +39,24 @@ class NETCLASS;
class ZONE_CONTAINER; class ZONE_CONTAINER;
class DIMENSION; class DIMENSION;
class NETINFO_ITEM; 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 class KICAD_PLUGIN : public PLUGIN
{ {
public: 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() const wxString& PluginName()
{ {
...@@ -58,7 +64,7 @@ public: ...@@ -58,7 +64,7 @@ public:
return name; return name;
} }
//-----</PLUGIN>-------------------------------------------------------------------- //-----</PLUGIN>------------------------------------------------------------
protected: protected:
...@@ -87,10 +93,10 @@ protected: ...@@ -87,10 +93,10 @@ protected:
* parses an ASCII decimal floating point value and scales it into a BIU * parses an ASCII decimal floating point value and scales it into a BIU
* according to the current value of diskToBui. * 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 * @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. * @return BIU - the converted Board Internal Unit.
*/ */
...@@ -105,6 +111,11 @@ protected: ...@@ -105,6 +111,11 @@ protected:
void loadSHEET(); void loadSHEET();
void loadMODULE(); void loadMODULE();
void load3D( MODULE* aModule );
void loadPAD( MODULE* aModule );
void loadTEXTE_MODULE( TEXTE_MODULE* aText );
void loadEDGE_MODULE( MODULE* aModule );
void loadDRAWSEGMENT(); void loadDRAWSEGMENT();
void loadNETINFO_ITEM(); void loadNETINFO_ITEM();
void loadPCB_TEXTE(); void loadPCB_TEXTE();
...@@ -123,12 +134,11 @@ protected: ...@@ -123,12 +134,11 @@ protected:
void loadTrackList( TRACK* aInsertBeforeMe, int aStructType ); void loadTrackList( TRACK* aInsertBeforeMe, int aStructType );
void loadZONE_CONTAINER(); // "$CZONE_OUTLINE" void loadZONE_CONTAINER(); // "$CZONE_OUTLINE"
void loadDIMENSION(); // "$COTATION" void loadDIMENSION(); // "$COTATION"
void loadPCB_TARGET(); // "$PCB_TARGET"
/* @todo /* @todo
void load( PCB_TARGET* me );
void load( NETINFO* me ); void load( NETINFO* me );
void load( TRACK* 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