Commit 0f09c15f authored by jean-pierre charras's avatar jean-pierre charras

Pad editor dialog: Better tests and error messages about issues in pad...

Pad editor dialog: Better tests and error messages about issues in pad settings. Fis also an other hard to translate error messge.
parent 152c97a3
...@@ -95,8 +95,8 @@ public: ...@@ -95,8 +95,8 @@ public:
private: private:
PCB_BASE_FRAME* m_parent; PCB_BASE_FRAME* m_parent;
D_PAD* m_currentPad; // pad currently being edited D_PAD* m_currentPad; // pad currently being edited
D_PAD* m_dummyPad; // a working copy used to show changes D_PAD* m_dummyPad; // a working copy used to show changes
BOARD* m_board; BOARD* m_board;
D_PAD& m_padMaster; D_PAD& m_padMaster;
bool m_isFlipped; // true if the parent footprint (therefore pads) is flipped (mirrored) bool m_isFlipped; // true if the parent footprint (therefore pads) is flipped (mirrored)
...@@ -673,11 +673,11 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK() ...@@ -673,11 +673,11 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
} }
LAYER_MSK padlayers_mask = m_dummyPad->GetLayerMask(); LAYER_MSK padlayers_mask = m_dummyPad->GetLayerMask();
if( ( padlayers_mask == 0 ) && ( m_dummyPad->GetAttribute() != PAD_HOLE_NOT_PLATED ) )
error_msgs.Add( _( "Error: pad has no layer and is not a mechanical pad" ) );
padlayers_mask &= (LAYER_BACK | LAYER_FRONT);
if( padlayers_mask == 0 ) if( padlayers_mask == 0 )
error_msgs.Add( _( "Error: pad has no layer" ) );
if( ( padlayers_mask & (LAYER_BACK | LAYER_FRONT) ) == 0 )
{ {
if( m_dummyPad->GetDrillSize().x || m_dummyPad->GetDrillSize().y ) if( m_dummyPad->GetDrillSize().x || m_dummyPad->GetDrillSize().y )
{ {
...@@ -715,20 +715,21 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK() ...@@ -715,20 +715,21 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
switch( m_dummyPad->GetAttribute() ) switch( m_dummyPad->GetAttribute() )
{ {
case PAD_STANDARD : // Pad through hole, a hole is expected case PAD_HOLE_NOT_PLATED: // Not plated, but through hole, a hole is expected
case PAD_STANDARD : // Pad through hole, a hole is also expected
if( m_dummyPad->GetDrillSize().x <= 0 ) if( m_dummyPad->GetDrillSize().x <= 0 )
error_msgs.Add( _( "Incorrect value for pad drill (too small value)" ) ); error_msgs.Add( _( "Error: Through hole pad: drill diameter set to 0" ) );
break; break;
case PAD_SMD: // SMD and Connector pads (One external copper layer only) case PAD_CONN: // Connector pads are smd pads, just they do not have solder paste.
if( (padlayers_mask & SOLDERPASTE_LAYER_BACK) ||
(padlayers_mask & SOLDERPASTE_LAYER_FRONT) )
error_msgs.Add( _( "Error: Connector pads are not on the solder paste layer\n"
"Use SMD pads instead" ) );
// Fall trough
case PAD_SMD: // SMD and Connector pads (One external copper layer only)
if( (padlayers_mask & LAYER_BACK) && (padlayers_mask & LAYER_FRONT) ) if( (padlayers_mask & LAYER_BACK) && (padlayers_mask & LAYER_FRONT) )
error_msgs.Add( _( "Error: only one copper layer allowed for this pad" ) ); error_msgs.Add( _( "Error: only one copper layer allowed for SMD or Connector pads" ) );
break;
case PAD_CONN: // connectors can have pads on "All" Cu layers.
break;
case PAD_HOLE_NOT_PLATED: // Not plated
break; break;
} }
...@@ -738,6 +739,7 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK() ...@@ -738,6 +739,7 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
dlg.ListSet( error_msgs ); dlg.ListSet( error_msgs );
dlg.ShowModal(); dlg.ShowModal();
} }
return error_msgs.GetCount() == 0; return error_msgs.GetCount() == 0;
} }
......
...@@ -2426,8 +2426,9 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER() throw( IO_ERROR, PARSE_ERROR ) ...@@ -2426,8 +2426,9 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER() throw( IO_ERROR, PARSE_ERROR )
NeedSYMBOLorNUMBER(); NeedSYMBOLorNUMBER();
if( zone->GetNet()->GetNetname() != FromUTF8() ) if( zone->GetNet()->GetNetname() != FromUTF8() )
{ {
wxString msg = _( "There is a zone that belongs to a not " wxString msg;
"existing net (" ) + FromUTF8() + _("), you should verify it." ); msg.Printf( _( "There is a zone that belongs to a not existing net"
"(%s), you should verify it." ), GetChars( FromUTF8() ) );
DisplayError( NULL, msg ); DisplayError( NULL, msg );
zone->SetNetCode( NETINFO_LIST::UNCONNECTED ); zone->SetNetCode( NETINFO_LIST::UNCONNECTED );
} }
......
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