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 source diff could not be displayed because it is too large. You can view the blob instead.
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
NetIExt=.net NetIExt=.net
PkgIExt=.pkg PkgIExt=.pkg
NetDir= NetDir=
LibDir= LibDir=
NetType=0 NetType=0
[cvpcb/libraries] [cvpcb/libraries]
EquName1=devcms EquName1=devcms
[general] [general]
version=1 version=1
RootSch=video.sch RootSch=video.sch
BoardNm=video.brd BoardNm=video.brd
[pcbnew] [eeschema]
version=1 version=1
LibDir= LibDir=
Sel_Mod=1 NetFmt=1
NetType=0 HPGLSpd=20
PadDril=320 HPGLDm=15
PadDimH=550 HPGLNum=1
PadDimV=550 offX_A4=0
PadOfDH=0 offY_A4=0
PadOfDV=0 offX_A3=0
PadForm=1 offY_A3=0
PadMask=14745599 offX_A2=0
PadAttr=0 offY_A2=0
PadOrie=0 offX_A1=0
ViaDiam=450 offY_A1=0
ViaDril=250 offX_A0=0
Isol=80 offY_A0=0
Mlayer=536838151 offX_A=0
Lpiste=80 offY_A=0
RouteTo=15 offX_B=0
RouteBo=0 offY_B=0
TypeVia=3 offX_C=0
Segm45=1 offY_C=0
Racc45=1 offX_D=0
Unite=0 offY_D=0
SegFill=1 offX_E=0
SegAffG=0 offY_E=0
NewAffG=1 RptD_X=0
PadFill=1 RptD_Y=100
PadAffG=1 RptLab=1
PadSNum=1 PenMin=20
ModAffC=0 SimCmd=
ModAffT=0 UseNetN=0
PcbAffT=0 [eeschema/libraries]
SgPcb45=1 LibName1=power
TxtPcbV=600 LibName2=device
TxtPcbH=600 LibName3=conn
GridX=50 LibName4=brooktre
GridY=50 LibName5=linear
TxtModV=500 LibName6=regul
TxtModH=500 LibName7=74xx
TxtModW=80 LibName8=cmos4000
HPGLnum=1 LibName9=adc-dac
Pltmarg=300 LibName10=memory
HPGdiam=15 LibName11=xilinx
HPGLSpd=20 LibName12=special
HPGLrec=2 LibName13=analog_switches
HPGLorg=0 LibName14=philips
GERBmin=15 [pcbnew]
GERBfmt=1 version=1
VEgarde=100 PadDrlX=1200
DrawLar=120 PadDimH=1500
EdgeLar=120 PadDimV=2000
TxtLar=80 BoardThickness=630
MSegLar=120 SgPcb45=1
ForPlot=1 TxtPcbV=600
WpenSer=10 TxtPcbH=600
UserGrX=500 TxtModV=500
UserGrY=500 TxtModH=500
UserGrU=1 TxtModW=80
DivGrPc=1 VEgarde=100
TimeOut=600 DrawLar=120
MaxLnkS=3 EdgeLar=120
ShowRat=0 TxtLar=80
ShowMRa=0 MSegLar=120
[pcbnew/libraries] LastNetListRead=
LibName1=supports [pcbnew/libraries]
LibName2=connect LibDir=
LibName3=discret LibName1=supports
LibName4=pin_array LibName2=connect
LibName5=divers LibName3=discret
LibName6=libcms LibName4=pin_array
[eeschema] LibName5=divers
version=1 LibName6=libcms
LibDir=
NetFmt=1
HPGLSpd=20
HPGLDm=15
HPGLNum=1
offX_A4=0
offY_A4=0
offX_A3=0
offY_A3=0
offX_A2=0
offY_A2=0
offX_A1=0
offY_A1=0
offX_A0=0
offY_A0=0
offX_A=0
offY_A=0
offX_B=0
offY_B=0
offX_C=0
offY_C=0
offX_D=0
offY_D=0
offX_E=0
offY_E=0
RptD_X=0
RptD_Y=100
RptLab=1
PenMin=20
SimCmd=
UseNetN=0
[eeschema/libraries]
LibName1=power
LibName2=device
LibName3=conn
LibName4=brooktre
LibName5=linear
LibName6=regul
LibName7=74xx
LibName8=cmos4000
LibName9=adc-dac
LibName10=memory
LibName11=xilinx
LibName12=special
LibName13=analog_switches
LibName14=philips
...@@ -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