Commit ec684950 authored by jp's avatar jp

Fixed a minor bug in footprint editor dialog when changing module orientation or side

parent 8f90556a
This diff is collapsed.
update=19/11/2006-14:07:12 update=01/05/2010 14:42:54
version=1 version=1
last_client=eeschema last_client=pcbnew
[cvpcb] [cvpcb]
version=1 version=1
NetITyp=0 NetITyp=0
...@@ -15,78 +15,6 @@ EquName1=devcms ...@@ -15,78 +15,6 @@ EquName1=devcms
version=1 version=1
RootSch=video.sch RootSch=video.sch
BoardNm=video.brd BoardNm=video.brd
[pcbnew]
version=1
LibDir=
Sel_Mod=1
NetType=0
PadDril=320
PadDimH=550
PadDimV=550
PadOfDH=0
PadOfDV=0
PadForm=1
PadMask=14745599
PadAttr=0
PadOrie=0
ViaDiam=450
ViaDril=250
Isol=80
Mlayer=536838151
Lpiste=80
RouteTo=15
RouteBo=0
TypeVia=3
Segm45=1
Racc45=1
Unite=0
SegFill=1
SegAffG=0
NewAffG=1
PadFill=1
PadAffG=1
PadSNum=1
ModAffC=0
ModAffT=0
PcbAffT=0
SgPcb45=1
TxtPcbV=600
TxtPcbH=600
GridX=50
GridY=50
TxtModV=500
TxtModH=500
TxtModW=80
HPGLnum=1
Pltmarg=300
HPGdiam=15
HPGLSpd=20
HPGLrec=2
HPGLorg=0
GERBmin=15
GERBfmt=1
VEgarde=100
DrawLar=120
EdgeLar=120
TxtLar=80
MSegLar=120
ForPlot=1
WpenSer=10
UserGrX=500
UserGrY=500
UserGrU=1
DivGrPc=1
TimeOut=600
MaxLnkS=3
ShowRat=0
ShowMRa=0
[pcbnew/libraries]
LibName1=supports
LibName2=connect
LibName3=discret
LibName4=pin_array
LibName5=divers
LibName6=libcms
[eeschema] [eeschema]
version=1 version=1
LibDir= LibDir=
...@@ -135,3 +63,29 @@ LibName11=xilinx ...@@ -135,3 +63,29 @@ LibName11=xilinx
LibName12=special LibName12=special
LibName13=analog_switches LibName13=analog_switches
LibName14=philips LibName14=philips
[pcbnew]
version=1
PadDrlX=1200
PadDimH=1500
PadDimV=2000
BoardThickness=630
SgPcb45=1
TxtPcbV=600
TxtPcbH=600
TxtModV=500
TxtModH=500
TxtModW=80
VEgarde=100
DrawLar=120
EdgeLar=120
TxtLar=80
MSegLar=120
LastNetListRead=
[pcbnew/libraries]
LibDir=
LibName1=supports
LibName2=connect
LibName3=discret
LibName4=pin_array
LibName5=divers
LibName6=libcms
...@@ -183,7 +183,6 @@ void DIALOG_MODULE_BOARD_EDITOR::ModuleOrientEvent( wxCommandEvent& event ) ...@@ -183,7 +183,6 @@ void DIALOG_MODULE_BOARD_EDITOR::ModuleOrientEvent( wxCommandEvent& event )
break; break;
default: default:
m_OrientValue->Enable( FALSE );
m_OrientValue->Enable( TRUE ); m_OrientValue->Enable( TRUE );
break; break;
} }
...@@ -436,7 +435,6 @@ void DIALOG_MODULE_BOARD_EDITOR::Browse3DLib( wxCommandEvent& event ) ...@@ -436,7 +435,6 @@ void DIALOG_MODULE_BOARD_EDITOR::Browse3DLib( wxCommandEvent& event )
void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event ) void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
{ {
bool change_layer = FALSE;
wxPoint modpos; wxPoint modpos;
wxString msg; wxString msg;
...@@ -476,25 +474,6 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event ) ...@@ -476,25 +474,6 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
modpos.y = ReturnValueFromTextCtrl( *m_ModPositionY, PCB_INTERNAL_UNIT ); modpos.y = ReturnValueFromTextCtrl( *m_ModPositionY, PCB_INTERNAL_UNIT );
m_CurrentModule->SetPosition( modpos ); m_CurrentModule->SetPosition( modpos );
// Set orientation
long orient = 0;
msg = m_OrientValue->GetValue();
msg.ToLong( &orient );
if( m_CurrentModule->m_Orient != orient )
m_CurrentModule->Rotate( m_CurrentModule->m_Pos,
orient - m_CurrentModule->m_Orient );
if( m_LayerCtrl->GetSelection() == 0 ) // layer req = COMPONENT
{
if( m_CurrentModule->GetLayer() == LAYER_N_BACK )
change_layer = TRUE;
}
else if( m_CurrentModule->GetLayer() == LAYER_N_FRONT )
change_layer = TRUE;
if( change_layer )
m_CurrentModule->Flip( m_CurrentModule->m_Pos );
if( m_AutoPlaceCtrl->GetSelection() == 1 ) if( m_AutoPlaceCtrl->GetSelection() == 1 )
m_CurrentModule->m_ModuleStatus |= MODULE_is_LOCKED; m_CurrentModule->m_ModuleStatus |= MODULE_is_LOCKED;
else else
...@@ -522,6 +501,30 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event ) ...@@ -522,6 +501,30 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
m_CurrentModule->m_Reference->Copy( m_ReferenceCopy ); m_CurrentModule->m_Reference->Copy( m_ReferenceCopy );
m_CurrentModule->m_Value->Copy( m_ValueCopy ); m_CurrentModule->m_Value->Copy( m_ValueCopy );
/* Now, set orientation. must be made after others changes,
* because rotation changes fields positions on board according to the new orientation
* (relative positions are not modified)
*/
long orient = 0;
msg = m_OrientValue->GetValue();
msg.ToLong( &orient );
if( m_CurrentModule->m_Orient != orient )
m_CurrentModule->Rotate( m_CurrentModule->m_Pos,
orient - m_CurrentModule->m_Orient );
// Set component side, that also have effect on the fields positions on board
bool change_layer = FALSE;
if( m_LayerCtrl->GetSelection() == 0 ) // layer req = COMPONENT
{
if( m_CurrentModule->GetLayer() == LAYER_N_BACK )
change_layer = TRUE;
}
else if( m_CurrentModule->GetLayer() == LAYER_N_FRONT )
change_layer = TRUE;
if( change_layer )
m_CurrentModule->Flip( m_CurrentModule->m_Pos );
/* Update 3D shape list */ /* Update 3D shape list */
int ii = m_3D_ShapeNameListBox->GetSelection(); int ii = m_3D_ShapeNameListBox->GetSelection();
if( ii >= 0 ) if( ii >= 0 )
......
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