← Back to team overview

kicad-developers team mailing list archive

Re: P-Cad patch

 

Hi. I tested your patch. But found another one warning (see my patch).
What about my previous patches for PCAD import improvement?

В Четверг, 14 дек. 2017 в 6:11 П. П., Maciej Suminski <maciej.suminski@xxxxxxx> написал:
Hi Eldar,

I have an impression that you are one of the main P-Cad importer users. Would you test the attached patch? It fixes a number of warnings in the
P-Cad importer plugin, but I do not have any files to verify the code.

Thank you,
Orson
>From 83efb4941c08d38f6407fcaa7b55a5f2832125fe Mon Sep 17 00:00:00 2001
From: Eldar Khayrullin <eldar.khayrullin@xxxxxxx>
Date: Thu, 14 Dec 2017 20:05:41 +0300
Subject: [PATCH] pcad2kicadpcb_plugin: fix compiling warning `override`

---
 pcbnew/pcad2kicadpcb_plugin/pcb_keepout.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_keepout.h b/pcbnew/pcad2kicadpcb_plugin/pcb_keepout.h
index d6b951312..fbd1c57a4 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcb_keepout.h
+++ b/pcbnew/pcad2kicadpcb_plugin/pcb_keepout.h
@@ -44,7 +44,7 @@ public:
 
     virtual bool Parse( XNODE*          aNode,
                         wxString        aDefaultMeasurementUnit,
-                        wxString        aActualConversion );
+                        wxString        aActualConversion ) override;
 };
 
 } // namespace PCAD2KICAD
-- 
2.14.1

>From c7503a43aa6e427b23984bb760ee61363c78858f Mon Sep 17 00:00:00 2001
From: Maciej Suminski <maciej.suminski@xxxxxxx>
Date: Thu, 14 Dec 2017 16:09:04 +0100
Subject: [PATCH] Fix P-Cad importer plugin warnings

A few methods differed by the number or type of arguments in derived
classes. They were changed to match the base class method signature and
marked as 'override'.
---
 pcbnew/pcad2kicadpcb_plugin/pcad_plugin.cpp     | 2 +-
 pcbnew/pcad2kicadpcb_plugin/pcb.cpp             | 2 +-
 pcbnew/pcad2kicadpcb_plugin/pcb.h               | 4 ++--
 pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.cpp | 9 +--------
 pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.h   | 3 +--
 pcbnew/pcad2kicadpcb_plugin/pcb_cutout.h        | 2 +-
 pcbnew/pcad2kicadpcb_plugin/pcb_module.cpp      | 9 +++------
 pcbnew/pcad2kicadpcb_plugin/pcb_pad.h           | 4 ++++
 pcbnew/pcad2kicadpcb_plugin/pcb_plane.cpp       | 5 +----
 pcbnew/pcad2kicadpcb_plugin/pcb_plane.h         | 3 +--
 pcbnew/pcad2kicadpcb_plugin/pcb_polygon.cpp     | 5 +----
 pcbnew/pcad2kicadpcb_plugin/pcb_polygon.h       | 3 +--
 12 files changed, 18 insertions(+), 33 deletions(-)

diff --git a/pcbnew/pcad2kicadpcb_plugin/pcad_plugin.cpp b/pcbnew/pcad2kicadpcb_plugin/pcad_plugin.cpp
index 0c7c75c97..78338ef9e 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcad_plugin.cpp
+++ b/pcbnew/pcad2kicadpcb_plugin/pcad_plugin.cpp
@@ -84,7 +84,7 @@ BOARD* PCAD_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, const P
     LOCALE_IO toggle;    // toggles on, then off, the C locale.
 
     LoadInputFile( aFileName, &xmlDoc );
-    pcb.Parse( NULL, &xmlDoc, wxT( "PCB" ) );
+    pcb.ParseBoard( NULL, &xmlDoc, wxT( "PCB" ) );
     pcb.AddToBoard();
 
     return m_board;
diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb.cpp
index 67a360899..8b9535b66 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcb.cpp
+++ b/pcbnew/pcad2kicadpcb_plugin/pcb.cpp
@@ -666,7 +666,7 @@ void PCB::GetBoardOutline( wxXmlDocument* aXmlDoc, wxString aActualConversion )
     }
 }
 
-void PCB::Parse( wxStatusBar* aStatusBar, wxXmlDocument* aXmlDoc, wxString aActualConversion )
+void PCB::ParseBoard( wxStatusBar* aStatusBar, wxXmlDocument* aXmlDoc, wxString aActualConversion )
 {
     XNODE*          aNode;//, *aaNode;
     PCB_NET*        net;
diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb.h b/pcbnew/pcad2kicadpcb_plugin/pcb.h
index 97f6f98ad..a8cfdf302 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcb.h
+++ b/pcbnew/pcad2kicadpcb_plugin/pcb.h
@@ -59,9 +59,9 @@ public:
     int             GetNewTimestamp() override;
     int             GetNetCode( wxString aNetName ) override;
 
-    void            Parse( wxStatusBar* aStatusBar,
+    void            ParseBoard( wxStatusBar* aStatusBar,
                            wxXmlDocument* aXmlDoc,
-                           wxString     aActualConversion );
+                           wxString aActualConversion );
 
     void            AddToBoard() override;
 
diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.cpp
index 16c7c220f..3d60888b0 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.cpp
+++ b/pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.cpp
@@ -52,19 +52,12 @@ PCB_COPPER_POUR::~PCB_COPPER_POUR()
 
 bool PCB_COPPER_POUR::Parse( XNODE*         aNode,
                              wxString       aDefaultMeasurementUnit,
-                             wxString       aActualConversion,
-                             wxStatusBar*   aStatusBar )
+                             wxString       aActualConversion )
 {
     XNODE*          lNode;
     wxString        pourType, str, propValue;
     int             pourSpacing, thermalWidth;
 
-    // aStatusBar->SetStatusText( aStatusBar->GetStatusText() + wxT( " CooperPour..." ) );
-
-    //str = FindNode( aNode, wxT( "pourType" ) )->GetNodeContent();
-    //str.Trim( false );
-    //pourType = str.MakeUpper();
-
     lNode = FindNode( aNode, wxT( "netNameRef" ) );
 
     if( lNode )
diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.h b/pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.h
index 5de462efc..b556fa8b4 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.h
+++ b/pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.h
@@ -45,8 +45,7 @@ public:
 
     virtual bool Parse( XNODE*          aNode,
                         wxString        aDefaultMeasurementUnit,
-                        wxString        aActualConversion,
-                        wxStatusBar*    aStatusBar ) override;
+                        wxString        aActualConversion ) override;
 };
 
 } // namespace PCAD2KICAD
diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_cutout.h b/pcbnew/pcad2kicadpcb_plugin/pcb_cutout.h
index 9f8fa6be9..1265df2ed 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcb_cutout.h
+++ b/pcbnew/pcad2kicadpcb_plugin/pcb_cutout.h
@@ -45,7 +45,7 @@ public:
 
     virtual bool    Parse( XNODE*       aNode,
                            wxString     aDefaultMeasurementUnit,
-                           wxString     actualConversion );
+                           wxString     aActualConversion ) override;
 };
 
 } // namespace PCAD2KICAD
diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_module.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_module.cpp
index be3304ac0..849bcb048 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcb_module.cpp
+++ b/pcbnew/pcad2kicadpcb_plugin/pcb_module.cpp
@@ -327,8 +327,7 @@ void PCB_MODULE::DoLayerContentsObjects( XNODE*                 aNode,
                 polygon = new PCB_POLYGON( m_callbacks, m_board, PCadLayer );
                 if( polygon->Parse( lNode,
                                     aDefaultMeasurementUnit,
-                                    aActualConversion,
-                                    aStatusBar ) )
+                                    aActualConversion ) )
                     aList->Add( polygon );
                 else
                     delete polygon;
@@ -339,8 +338,7 @@ void PCB_MODULE::DoLayerContentsObjects( XNODE*                 aNode,
         {
             copperPour = new PCB_COPPER_POUR( m_callbacks, m_board, PCadLayer );
 
-            if( copperPour->Parse( lNode, aDefaultMeasurementUnit, aActualConversion,
-                                   aStatusBar ) )
+            if( copperPour->Parse( lNode, aDefaultMeasurementUnit, aActualConversion ) )
                 aList->Add( copperPour );
             else
                 delete copperPour;
@@ -360,8 +358,7 @@ void PCB_MODULE::DoLayerContentsObjects( XNODE*                 aNode,
         {
             plane = new PCB_PLANE( m_callbacks, m_board, PCadLayer );
 
-            if( plane->Parse( lNode, aDefaultMeasurementUnit, aActualConversion,
-                              aStatusBar ) )
+            if( plane->Parse( lNode, aDefaultMeasurementUnit, aActualConversion ) )
                 aList->Add( plane );
             else
                 delete plane;
diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_pad.h b/pcbnew/pcad2kicadpcb_plugin/pcb_pad.h
index 87e9fccf8..3bf76ddc8 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcb_pad.h
+++ b/pcbnew/pcad2kicadpcb_plugin/pcb_pad.h
@@ -52,6 +52,10 @@ public:
                            wxString     aDefaultMeasurementUnit,
                            wxString     aActualConversion );
     virtual void    Flip() override;
+    void            AddToModule( MODULE* aModule ) override
+    {
+        AddToModule( aModule, 0, true );
+    }
     void            AddToModule( MODULE* aModule, int aRotation, bool aEncapsulatedPad );
     void            AddToBoard() override;
 
diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_plane.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_plane.cpp
index be89e50e0..29e8b2bba 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcb_plane.cpp
+++ b/pcbnew/pcad2kicadpcb_plugin/pcb_plane.cpp
@@ -51,14 +51,11 @@ PCB_PLANE::~PCB_PLANE()
 
 bool PCB_PLANE::Parse( XNODE*         aNode,
                        wxString       aDefaultMeasurementUnit,
-                       wxString       aActualConversion,
-                       wxStatusBar*   aStatusBar )
+                       wxString       aActualConversion )
 {
     XNODE*          lNode;
     wxString        pourType, str, propValue;
 
-    // aStatusBar->SetStatusText( aStatusBar->GetStatusText() + wxT( " Plane..." ) );
-
     lNode = FindNode( aNode, wxT( "netNameRef" ) );
 
     if( lNode )
diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_plane.h b/pcbnew/pcad2kicadpcb_plugin/pcb_plane.h
index 95fbab4f3..93a8524fc 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcb_plane.h
+++ b/pcbnew/pcad2kicadpcb_plugin/pcb_plane.h
@@ -44,8 +44,7 @@ public:
 
     virtual bool Parse( XNODE*          aNode,
                         wxString        aDefaultMeasurementUnit,
-                        wxString        aActualConversion,
-                        wxStatusBar*    aStatusBar ) override;
+                        wxString        aActualConversion ) override;
 };
 
 } // namespace PCAD2KICAD
diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_polygon.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_polygon.cpp
index 9a5f2530b..d3fb6bd9b 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcb_polygon.cpp
+++ b/pcbnew/pcad2kicadpcb_plugin/pcb_polygon.cpp
@@ -125,14 +125,11 @@ void PCB_POLYGON::FormPolygon( XNODE*   aNode, VERTICES_ARRAY* aPolygon,
 
 bool PCB_POLYGON::Parse( XNODE*         aNode,
                          wxString       aDefaultMeasurementUnit,
-                         wxString       aActualConversion,
-                         wxStatusBar*   aStatusBar )
+                         wxString       aActualConversion )
 {
     XNODE*      lNode;
     wxString    propValue;
 
-    // aStatusBar->SetStatusText( aStatusBar->GetStatusText() + wxT( " Polygon..." ) );
-
     lNode = FindNode( aNode, wxT( "netNameRef" ) );
 
     if( lNode )
diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_polygon.h b/pcbnew/pcad2kicadpcb_plugin/pcb_polygon.h
index a37be8fc5..fe3583289 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcb_polygon.h
+++ b/pcbnew/pcad2kicadpcb_plugin/pcb_polygon.h
@@ -53,8 +53,7 @@ public:
 
     virtual bool Parse( XNODE*          aNode,
                         wxString        aDefaultMeasurementUnit,
-                        wxString        aActualConversion,
-                        wxStatusBar*    aStatusBar );
+                        wxString        aActualConversion );
 
     virtual void    SetPosOffset( int aX_offs, int aY_offs ) override;
     void            AddToModule( MODULE* aModule ) override;
-- 
2.14.2


Follow ups