From ba0fbd19242de0ccf12f87166a34469a8000965b Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 9 Dec 2010 18:34:08 +0100 Subject: [PATCH] Pcbnew: remove not used old files. Minor enhancements --- pcbnew/copy_track.cpp.notused | 306 ------------------- pcbnew/dupltrac.cpp.notused | 549 ---------------------------------- pcbnew/modedit.cpp | 1 + pcbnew/pcbnew_config.cpp | 10 + pcbnew/pcbplot.cpp | 17 +- pcbnew/pcbplot.h | 6 +- 6 files changed, 16 insertions(+), 873 deletions(-) delete mode 100644 pcbnew/copy_track.cpp.notused delete mode 100644 pcbnew/dupltrac.cpp.notused diff --git a/pcbnew/copy_track.cpp.notused b/pcbnew/copy_track.cpp.notused deleted file mode 100644 index b2d00722ee..0000000000 --- a/pcbnew/copy_track.cpp.notused +++ /dev/null @@ -1,306 +0,0 @@ -/*******************************************/ -/* Track editing: routines to copy tracks */ -/*******************************************/ - -#include "fctsys.h" -#include "gr_basic.h" - -#include "common.h" -#include "pcbnew.h" -#include "autorout.h" - -#include "drag.h" - -#include "protos.h" - - -/* local functions */ - - -/* variables locales */ - - -#if 0 - -/***************************************************************/ -void WinEDA_PcbFrame::Place_Dupl_Track( Track* Track, wxDC* DC ) -/***************************************************************/ - -/* - * Routine de placement d'une piste (succession de segments) - */ -{ - D_PAD* pt_pad; - TRACK* pt_track, * Track, * pt_classe, * NextS; - int masquelayer; - EDA_BaseStruct* LockPoint; - int ii, old_net_code, new_net_code, DRC_error = 0; - wxDC* DC = Cmd->DC; - - ActiveDrawPanel->ManageCurseur = NULL; - - if( NewTrack == NULL ) - return; - - old_net_code = NewTrack->net_code; - - /* Placement du flag BUSY de la piste originelle, qui ne doit - * pas etre vue dans les recherches de raccordement suivantes */ - ii = NbPtNewTrack; pt_track = NewTrack; - for( ; ii > 0; ii--, pt_track = (TRACK*) pt_track->Pnext ) - { - pt_track->SetState( BUSY, ON ); - } - - /* Detection du nouveau net_code */ - ii = NbPtNewTrack; pt_track = NewTrack; - for( ; ii > 0; ii--, pt_track = (TRACK*) pt_track->Pnext ) - { - pt_track->net_code = 0; - } - - new_net_code = 0; - ii = 0; pt_track = NewTrack; - for( ; ii < NbPtNewTrack; ii++, pt_track = (TRACK*) pt_track->Pnext ) - { - /* Localisation de la pastille ou segment en debut de segment: */ - masquelayer = tab_layer[pt_track->Layer]; - LockPoint = LocateLockPoint( pt_track->m_Start.x, pt_track->m_Start.y, masquelayer ); - if( LockPoint ) - { - if( LockPoint->Type() == TYPEPAD ) - { - pt_pad = (D_PAD*) LockPoint; - new_net_code = pt_pad->net_code; - if( new_net_code > 0 ) - break; - } - else /* debut de piste sur un segment de piste */ - { - Track = (TRACK*) LockPoint; - new_net_code = Track->net_code; - if( new_net_code > 0 ) - break; - } - } - LockPoint = LocateLockPoint( pt_track->m_End.x, pt_track->m_End.y, masquelayer ); - if( LockPoint ) - { - if( LockPoint->Type() == TYPEPAD ) - { - pt_pad = (D_PAD*) LockPoint; - new_net_code = pt_pad->net_code; - if( new_net_code > 0 ) - break; - } - else /* debut de piste sur un segment de piste */ - { - Track = (TRACK*) LockPoint; - new_net_code = Track->net_code; - if( new_net_code > 0 ) - break; - } - } - } - - /* Mise a jour du nouveau net code de la piste */ - ii = 0; pt_track = NewTrack; - for( ; ii < NbPtNewTrack; ii++, pt_track = (TRACK*) pt_track->Pnext ) - { - pt_track->net_code = new_net_code; - } - - /* Controle DRC de la nouvelle piste */ - ii = 0; pt_track = NewTrack; - for( ; ii < NbPtNewTrack; ii++, pt_track = pt_track->Next() ) - { - if( Drc_On == RUN ) - if( drc( DC, pt_track, pt_pcb->Track, 1 ) == BAD_DRC ) - { - if( confirmation( " Erreur DRC, Place piste:" ) == YES ) - continue; - else - { - DRC_error = 1; break; - } - } - } - - if( DRC_error == 0 ) - { - if( FlagState == MOVE_ROUTE ) - { - /* copie nouvelle piste */ - pt_track = NewTrack; - NewTrack = pt_track->Copy( NbPtNewTrack ); - /* effacement ancienne ( chainage et liens mauvais */ - ii = NbPtNewTrack; - for( ; ii > 0; ii--, pt_track = NextS ) - { - NextS = (TRACK*) pt_track->Pnext; - pt_track->DeleteStructure(); - } - - test_1_net_connexion( DC, old_net_code ); - } - - pt_classe = NewTrack->GetBestInsertPoint(); - NewTrack->Insert( pt_classe ); - - Trace_Une_Piste( DC, NewTrack, NbPtNewTrack, GR_OR ); - - /* Mise a jour des connexions sur pads et sur pistes */ - ii = 0; pt_track = NewTrack; - for( ; ii < NbPtNewTrack; ii++, pt_track = NextS ) - { - NextS = (TRACK*) pt_track->Pnext; - pt_track->SetState( BEGIN_ONPAD | END_ONPAD, OFF ); - masquelayer = tab_layer[pt_track->Layer]; - - /* Localisation de la pastille ou segment sur debut segment: */ - LockPoint = LocateLockPoint( pt_track->m_Start.x, pt_track->m_Start.y, masquelayer ); - if( LockPoint ) - { - pt_track->start = LockPoint; - if( LockPoint->Type() == TYPEPAD ) - { /* fin de piste sur un pad */ - pt_pad = (D_PAD*) LockPoint; - pt_track->SetState( BEGIN_ONPAD, ON ); - } - else /* debut de piste sur un segment de piste */ - { - Track = (TRACK*) LockPoint; - CreateLockPoint( &pt_track->m_Start.x, &pt_track->m_Start.y, Track, pt_track ); - } - } - - /* Localisation de la pastille ou segment sur fin de segment: */ - LockPoint = LocateLockPoint( pt_track->m_End.x, pt_track->m_End.y, masquelayer ); - if( LockPoint ) - { - pt_track->end = LockPoint; - if( LockPoint->Type() == TYPEPAD ) - { /* fin de piste sur un pad */ - pt_pad = (D_PAD*) LockPoint; - pt_track->SetState( END_ONPAD, ON ); - } - else /* debut de piste sur un segment de piste */ - { - Track = (TRACK*) LockPoint; - CreateLockPoint( &pt_track->m_Start.x, &pt_track->m_Start.y, Track, pt_track ); - } - } - } - - /* Clear the BUSY flag */ - ii = NbPtNewTrack; pt_track = NewTrack; - for( ; ii > 0; ii--, pt_track = (TRACK*) pt_track->Pnext ) - { - pt_track->SetState( BUSY, OFF ); - } - - test_1_net_connexion( DC, new_net_code ); - ActiveScreen->SetModify(); - } - else /* DRC error: Annulation commande */ - { - DisplayOpt.DisplayPcbTrackFill = FALSE; - Trace_Une_Piste( DC, NewTrack, NbPtNewTrack, GR_XOR ); - DisplayOpt.DisplayPcbTrackFill = Track_fill_copy; - - if( FlagState == MOVE_ROUTE ) - { /* Remise en position de la piste deplacee */ - Track = NewTrack; - PosInitX -= Track->m_Start.x; PosInitY -= Track->m_Start.y; - for( ii = 0; ii < NbPtNewTrack; ii++, Track = (TRACK*) Track->Pnext ) - { - if( Track == NULL ) - break; - Track->m_Start.x += PosInitX; Track->m_Start.y += PosInitY; - Track->m_End.x += PosInitX; Track->m_End.y += PosInitY; - Track->SetState( BUSY, OFF ); - } - - Trace_Une_Piste( DC, NewTrack, NbPtNewTrack, GR_OR ); - } - - if( FlagState == COPY_ROUTE ) - { /* Suppression copie */ - for( ii = 0; ii < NbPtNewTrack; NewTrack = NextS ) - { - if( NewTrack == NULL ) - break; - NextS = (TRACK*) NewTrack->Pnext; - delete NewTrack; - } - } - } - NewTrack = NULL; - Affiche_Infos_Status_Pcb( Cmd ); - if( Etat_Surbrillance ) - Hight_Light( DC ); -} - - -/*******************************************************************************/ -void WinEDA_PcbFrame::Start_CopyOrMove_Route( TRACK* track, wxDC* DC, bool Drag ) -/*******************************************************************************/ - -/* Routine permettant la recopie d'une piste (suite de segments) deja tracee - */ -{ - int ii; - TRACK* pt_segm, * pt_track; - int masquelayer = tab_layer[ActiveScreen->Active_Layer]; - - if( NewTrack ) - return; - - FlagState = (int) Cmd->Menu->param_inf; - - /* Recherche de la piste sur la couche active (non zone) */ - for( pt_segm = pt_pcb->Track; pt_segm != NULL; pt_segm = (TRACK*) pt_segm->Pnext ) - { - pt_segm = Locate_Pistes( pt_segm, masquelayer, CURSEUR_OFF_GRILLE ); - if( pt_segm == NULL ) - break; - break; - } - - if( pt_segm != NULL ) - { - if( FlagState == COPY_ROUTE ) - pt_track = Marque_Une_Piste( DC, pt_segm, &NbPtNewTrack, 0 ); - else - pt_track = Marque_Une_Piste( DC, pt_segm, &NbPtNewTrack, GR_XOR ); - - if( NbPtNewTrack ) /* Il y a NbPtNewTrack segments de piste a traiter */ - { - /* effacement du flag BUSY de la piste originelle */ - ii = NbPtNewTrack; pt_segm = pt_track; - for( ; ii > 0; ii--, pt_segm = (TRACK*) pt_segm->Pnext ) - { - pt_segm->SetState( BUSY, OFF ); - } - - if( FlagState == COPY_ROUTE ) - NewTrack = pt_track->Copy( NbPtNewTrack ); - else - NewTrack = pt_track; - - Affiche_Infos_Piste( Cmd, pt_track ); - - startX = ActiveScreen->Curseur_X; - startY = ActiveScreen->Curseur_Y; - Place_Dupl_Route_Item.State = WAIT; - ActiveDrawPanel->ManageCurseur = Show_Move_Piste; - DisplayOpt.DisplayPcbTrackFill = FALSE; - Trace_Une_Piste( DC, NewTrack, NbPtNewTrack, GR_XOR ); - DisplayOpt.DisplayPcbTrackFill = Track_fill_copy; - PosInitX = NewTrack->m_Start.x; PosInitY = NewTrack->m_Start.y; - } - } -} - - -#endif diff --git a/pcbnew/dupltrac.cpp.notused b/pcbnew/dupltrac.cpp.notused deleted file mode 100644 index fa7e60bcf7..0000000000 --- a/pcbnew/dupltrac.cpp.notused +++ /dev/null @@ -1,549 +0,0 @@ -/****************************************************/ -/* Edition des pistes */ -/* Routines de duplication et deplacement de pistes */ -/****************************************************/ - -#include "fctsys.h" -#include "gr_basic.h" - -#include "common.h" -#include "pcbnew.h" -#include "autorout.h" - -#include "protos.h" - - -#define COPY_ROUTE 1 -#define MOVE_ROUTE 2 - -extern char marq_bitmap[]; // dans TRACEPCB : bitmap du marqueur "DRC" - -/* Routines externes */ - -#if 0 -/* Routines Locales */ -static void Exit_DuplicTrack( COMMAND* Cmd ); -static void Start_CopieMove_Route( COMMAND* Cmd ); -static void Duplic_Track( COMMAND* Cmd ); -static void Place_Dupl_Route( COMMAND* Cmd ); -static void Show_Move_Piste( wxDC* DC, int flag ); - -/* variables locales */ -static int startX, startY; -static int PosInitX, PosInitY; -static TRACK* NewTrack; /* Nouvelle piste creee ou piste deplacee */ -static int NbPtNewTrack; -static int FlagState; /* memoire de la commande (COPY_ROUTE ou MOVE_ROUTE) */ -/* variables externes */ - - -/**************************************************************/ -static void Exit_DuplicTrack( WinEDA_DrawFrame* frame, wxDC* DC ) -/***************************************************************/ - -/* routine d'annulation de la Commande Begin_Route si une piste est en cours - * de tracage, ou de sortie de l'application EDITRACK. - * Appel par la touche ESC - */ -{ - TRACK* NextS; - int ii; - wxDC* DC = Cmd->DC; - - frame->DrawPanel->ManageCurseur = NULL; - - if( NewTrack ) - { - /* Effacement du trace en cours */ - DisplayOpt.DisplayPcbTrackFill = FALSE; - Trace_Une_Piste( DC, NewTrack, NbPtNewTrack, GR_XOR ); - DisplayOpt.DisplayPcbTrackFill = Track_fill_copy; - - if( FlagState == COPY_ROUTE ) - { - for( ii = 0; ii < NbPtNewTrack; ii++, NewTrack = NextS ) - { - if( NewTrack == NULL ) - break; - NextS = (TRACK*) NewTrack->Pnext; - delete NewTrack; - } - } - else /* Move : remise en ancienne position */ - { - TRACK* Track = NewTrack; - PosInitX -= Track->m_Start.x; - PosInitY -= Track->m_Start.y; - for( ii = 0; ii < NbPtNewTrack; ii++, Track = (TRACK*) Track->Pnext ) - { - if( Track == NULL ) - break; - Track->m_Start.x += PosInitX; - Track->m_Start.y += PosInitY; - Track->m_End.x += PosInitX; - Track->m_End.y += PosInitY; - } - - Trace_Une_Piste( DC, NewTrack, NbPtNewTrack, GR_OR ); - } - - if( Etat_Surbrillance ) - Hight_Light( DC ); - EraseMsgBox(); - NewTrack = NULL; - } - else - { - EraseMsgBox(); - } -} - - -/******************************************/ -static void Place_Dupl_Route( COMMAND* Cmd ) -/******************************************/ - -/* - * Routine de placement d'une piste (succession de segments) - */ -{ - D_PAD* pt_pad; - TRACK* pt_track, * Track, * pt_classe, * NextS; - int masquelayer; - EDA_BaseStruct* LockPoint; - int ii, old_net_code, new_net_code, DRC_error = 0; - wxDC* DC = Cmd->DC; - - ActiveDrawPanel->ManageCurseur = NULL; - - if( NewTrack == NULL ) - return; - - old_net_code = NewTrack->net_code; - - /* Placement du flag BUSY de la piste originelle, qui ne doit - * pas etre vue dans les recherches de raccordement suivantes */ - ii = NbPtNewTrack; pt_track = NewTrack; - for( ; ii > 0; ii--, pt_track = (TRACK*) pt_track->Pnext ) - { - pt_track->SetState( BUSY, ON ); - } - - /* Detection du nouveau net_code */ - ii = NbPtNewTrack; pt_track = NewTrack; - for( ; ii > 0; ii--, pt_track = (TRACK*) pt_track->Pnext ) - { - pt_track->net_code = 0; - } - - new_net_code = 0; - ii = 0; pt_track = NewTrack; - for( ; ii < NbPtNewTrack; ii++, pt_track = (TRACK*) pt_track->Pnext ) - { - /* Localisation de la pastille ou segment en debut de segment: */ - masquelayer = tab_layer[pt_track->Layer]; - LockPoint = LocateLockPoint( pt_track->m_Start.x, pt_track->m_Start.y, masquelayer ); - if( LockPoint ) - { - if( LockPoint->m_StructType == TYPEPAD ) - { - pt_pad = (D_PAD*) LockPoint; - new_net_code = pt_pad->net_code; - if( new_net_code > 0 ) - break; - } - else /* debut de piste sur un segment de piste */ - { - Track = (TRACK*) LockPoint; - new_net_code = Track->net_code; - if( new_net_code > 0 ) - break; - } - } - LockPoint = LocateLockPoint( pt_track->m_End.x, pt_track->m_End.y, masquelayer ); - if( LockPoint ) - { - if( LockPoint->m_StructType == TYPEPAD ) - { - pt_pad = (D_PAD*) LockPoint; - new_net_code = pt_pad->net_code; - if( new_net_code > 0 ) - break; - } - else /* debut de piste sur un segment de piste */ - { - Track = (TRACK*) LockPoint; - new_net_code = Track->net_code; - if( new_net_code > 0 ) - break; - } - } - } - - /* Mise a jour du nouveau net code de la piste */ - ii = 0; pt_track = NewTrack; - for( ; ii < NbPtNewTrack; ii++, pt_track = (TRACK*) pt_track->Pnext ) - { - pt_track->net_code = new_net_code; - } - - /* Controle DRC de la nouvelle piste */ - ii = 0; pt_track = NewTrack; - for( ; ii < NbPtNewTrack; ii++, pt_track = pt_track->Next() ) - { - if( Drc_On == RUN ) - if( drc( DC, pt_track, pt_pcb->Track, 1 ) == BAD_DRC ) - { - if( confirmation( " Erreur DRC, Place piste:" ) == YES ) - continue; - else - { - DRC_error = 1; break; - } - } - } - - if( DRC_error == 0 ) - { - if( FlagState == MOVE_ROUTE ) - { - /* copie nouvelle piste */ - pt_track = NewTrack; - NewTrack = pt_track->Copy( NbPtNewTrack ); - /* effacement ancienne ( chainage et liens mauvais */ - ii = NbPtNewTrack; - for( ; ii > 0; ii--, pt_track = NextS ) - { - NextS = (TRACK*) pt_track->Pnext; - DeleteStructure( pt_track ); - } - - test_1_net_connexion( DC, old_net_code ); - } - - pt_classe = NewTrack->GetBestInsertPoint(); - NewTrack->Insert( pt_classe ); - - Trace_Une_Piste( DC, NewTrack, NbPtNewTrack, GR_OR ); - - /* Mise a jour des connexions sur pads et sur pistes */ - ii = 0; pt_track = NewTrack; - for( ; ii < NbPtNewTrack; ii++, pt_track = NextS ) - { - NextS = (TRACK*) pt_track->Pnext; - pt_track->SetState( BEGIN_ONPAD | END_ONPAD, OFF ); - masquelayer = tab_layer[pt_track->Layer]; - - /* Localisation de la pastille ou segment sur debut segment: */ - LockPoint = LocateLockPoint( pt_track->m_Start.x, pt_track->m_Start.y, masquelayer ); - if( LockPoint ) - { - pt_track->start = LockPoint; - if( LockPoint->m_StructType == TYPEPAD ) - { /* fin de piste sur un pad */ - pt_pad = (D_PAD*) LockPoint; - pt_track->SetState( BEGIN_ONPAD, ON ); - } - else /* debut de piste sur un segment de piste */ - { - Track = (TRACK*) LockPoint; - CreateLockPoint( &pt_track->m_Start.x, &pt_track->m_Start.y, Track, pt_track ); - } - } - - /* Localisation de la pastille ou segment sur fin de segment: */ - LockPoint = LocateLockPoint( pt_track->m_End.x, pt_track->m_End.y, masquelayer ); - if( LockPoint ) - { - pt_track->end = LockPoint; - if( LockPoint->m_StructType == TYPEPAD ) - { /* fin de piste sur un pad */ - pt_pad = (D_PAD*) LockPoint; - pt_track->SetState( END_ONPAD, ON ); - } - else /* debut de piste sur un segment de piste */ - { - Track = (TRACK*) LockPoint; - CreateLockPoint( &pt_track->m_Start.x, &pt_track->m_Start.y, Track, pt_track ); - } - } - } - - /* Suppression du flag BUSY */ - ii = NbPtNewTrack; pt_track = NewTrack; - for( ; ii > 0; ii--, pt_track = (TRACK*) pt_track->Pnext ) - { - pt_track->SetState( BUSY, OFF ); - } - - test_1_net_connexion( DC, new_net_code ); - ActiveScreen->SetModify(); - } - else /* Erreur DRC: Annulation commande */ - { - DisplayOpt.DisplayPcbTrackFill = FALSE; - Trace_Une_Piste( DC, NewTrack, NbPtNewTrack, GR_XOR ); - DisplayOpt.DisplayPcbTrackFill = Track_fill_copy; - - if( FlagState == MOVE_ROUTE ) - { /* Remise en position de la piste deplacee */ - Track = NewTrack; - PosInitX -= Track->m_Start.x; PosInitY -= Track->m_Start.y; - for( ii = 0; ii < NbPtNewTrack; ii++, Track = (TRACK*) Track->Pnext ) - { - if( Track == NULL ) - break; - Track->m_Start.x += PosInitX; Track->m_Start.y += PosInitY; - Track->m_End.x += PosInitX; Track->m_End.y += PosInitY; - Track->SetState( BUSY, OFF ); - } - - Trace_Une_Piste( DC, NewTrack, NbPtNewTrack, GR_OR ); - } - - if( FlagState == COPY_ROUTE ) - { /* Suppression copie */ - for( ii = 0; ii < NbPtNewTrack; NewTrack = NextS ) - { - if( NewTrack == NULL ) - break; - NextS = (TRACK*) NewTrack->Pnext; - delete NewTrack; - } - } - } - NewTrack = NULL; - Affiche_Infos_Status_Pcb( Cmd ); - if( Etat_Surbrillance ) - Hight_Light( DC ); -} - - -/***********************************************/ -static void Show_Move_Piste( wxDC* DC, int flag ) -/***********************************************/ -/* redessin du contour de la piste lors des deplacements de la souris */ -{ - int ii, dx, dy; - TRACK* ptsegm; - - if( NewTrack == NULL ) - return; /* Pas de piste en cours (Erreur ) */ - - /* efface ancienne position si elle a ete deja dessinee */ - if( (flag == CURSEUR_MOVED ) && (FlagState == COPY_ROUTE ) ) - { - DisplayOpt.DisplayPcbTrackFill = FALSE; - Trace_Une_Piste( DC, NewTrack, NbPtNewTrack, GR_XOR ); - } - - if( FlagState == MOVE_ROUTE ) - { - if( flag == CURSEUR_MOVED ) - DisplayOpt.DisplayPcbTrackFill = FALSE; - Trace_Une_Piste( DC, NewTrack, NbPtNewTrack, GR_XOR ); - } - - /* mise a jour des coordonnees des segments de la piste */ - dx = ActiveScreen->Curseur_X - startX; - dy = ActiveScreen->Curseur_Y - startY; - startX = ActiveScreen->Curseur_X; - startY = ActiveScreen->Curseur_Y; - ii = NbPtNewTrack, ptsegm = NewTrack; - for( ; ii > 0; ii--, ptsegm = (TRACK*) ptsegm->Pnext ) - { - ptsegm->m_Start.x += dx; ptsegm->m_Start.y += dy; - ptsegm->m_End.x += dx; ptsegm->m_End.y += dy; - } - - /* dessin de la nouvelle piste */ - DisplayOpt.DisplayPcbTrackFill = FALSE; - Trace_Une_Piste( DC, NewTrack, NbPtNewTrack, GR_XOR ); - DisplayOpt.DisplayPcbTrackFill = Track_fill_copy; -} - - -/************************************************/ -/* void Start_CopieMove_Route(COMMAND * Cmd) */ -/************************************************/ - -/* Routine permettant la recopie d'une piste deja tracee - */ -static void Start_CopieMove_Route( COMMAND* Cmd ) -{ - int ii; - TRACK* pt_segm, * pt_track; - int masquelayer = tab_layer[ActiveScreen->Active_Layer]; - wxDC* DC = Cmd->DC; - - if( NewTrack ) - return; - - FlagState = (int) Cmd->Menu->param_inf; - - /* Recherche de la piste sur la couche active (non zone) */ - for( pt_segm = pt_pcb->Track; pt_segm != NULL; pt_segm = (TRACK*) pt_segm->Pnext ) - { - pt_segm = Locate_Pistes( pt_segm, masquelayer, CURSEUR_OFF_GRILLE ); - if( pt_segm == NULL ) - break; - break; - } - - if( pt_segm != NULL ) - { - if( FlagState == COPY_ROUTE ) - pt_track = Marque_Une_Piste( DC, pt_segm, &NbPtNewTrack, 0 ); - else - pt_track = Marque_Une_Piste( DC, pt_segm, &NbPtNewTrack, GR_XOR ); - - if( NbPtNewTrack ) /* Il y a NbPtNewTrack segments de piste a traiter */ - { - /* effacement du flag BUSY de la piste originelle */ - ii = NbPtNewTrack; pt_segm = pt_track; - for( ; ii > 0; ii--, pt_segm = (TRACK*) pt_segm->Pnext ) - { - pt_segm->SetState( BUSY, OFF ); - } - - if( FlagState == COPY_ROUTE ) - NewTrack = pt_track->Copy( NbPtNewTrack ); - else - NewTrack = pt_track; - - Affiche_Infos_Piste( Cmd, pt_track ); - - startX = ActiveScreen->Curseur_X; - startY = ActiveScreen->Curseur_Y; - Place_Dupl_Route_Item.State = WAIT; - ActiveDrawPanel->ManageCurseur = Show_Move_Piste; - DisplayOpt.DisplayPcbTrackFill = FALSE; - Trace_Une_Piste( DC, NewTrack, NbPtNewTrack, GR_XOR ); - DisplayOpt.DisplayPcbTrackFill = Track_fill_copy; - PosInitX = NewTrack->m_Start.x; PosInitY = NewTrack->m_Start.y; - } - } -} - - -#endif - -/************************************************************************/ -EDA_BaseStruct* LocateLockPoint( BOARD* Pcb, wxPoint pos, int LayerMask ) -/************************************************************************/ - -/* Routine trouvant le point " d'accrochage " d'une extremite de piste. - * Ce point peut etre un PAD ou un autre segment de piste - * Retourne: - * - pointeur sur ce PAD ou: - * - pointeur sur le segment ou: - * - NULL - * Parametres d'appel: - * coord pX, pY du point tst - * masque des couches a tester - */ -{ - D_PAD* pt_pad; - TRACK* ptsegm; - MODULE* Module; - - /* detection du point type PAD */ - pt_pad = NULL; - Module = Pcb->m_Modules; - for( ; Module != NULL; Module = (MODULE*) Module->Pnext ) - { - pt_pad = Locate_Pads( Module, pos.x, pos.y, LayerMask ); - if( pt_pad ) - return pt_pad; - } - - /* ici aucun pad n'a ete localise: detection d'un segment de piste */ - - ptsegm = Fast_Locate_Piste( Pcb->m_Track, NULL, pos.x, pos.y, LayerMask ); - if( ptsegm == NULL ) - ptsegm = Locate_Pistes( Pcb->m_Track, pos.x, pos.y, LayerMask ); - return ptsegm; -} - - -/******************************************************************************/ -TRACK* CreateLockPoint( int* pX, int* pY, TRACK* ptsegm, TRACK* refsegm ) -/******************************************************************************/ - -/* Routine de creation d'un point intermediaire sur un segment - * le segment ptsegm est casse en 2 segments se raccordant au point pX, pY - * retourne: - * NULL si pas de nouveau point ( c.a.d si pX, pY correspondait deja - * a une extremite ou: - * pointeur sur le segment cree - * si refsegm != NULL refsegm est pointeur sur le segment incident, - * et le point cree est l'intersection des 2 axes des segments ptsegm et - * refsegm - * retourne la valeur exacte de pX et pY - * Si ptsegm pointe sur une via: - * retourne la valeur exacte de pX et pY et ptsegm, - * mais ne cree pas de point supplementaire - * - */ -{ - int cX, cY; - int dx, dy; /* Coord de l'extremite du segm ptsegm / origine */ - int ox, oy, fx, fy; /* coord de refsegm / origine de prsegm */ - TRACK* NewTrack; - - if( (ptsegm->m_Start.x == *pX) && (ptsegm->m_Start.y == *pY) ) - return NULL; - if( (ptsegm->m_End.x == *pX) && (ptsegm->m_End.y == *pY) ) - return NULL; - - /* le point n'est pas sur une extremite de piste */ - if( ptsegm->m_StructType == TYPEVIA ) - { - *pX = ptsegm->m_Start.x; *pY = ptsegm->m_Start.y; - return ptsegm; - } - - /* calcul des coord vraies du point intermediaire dans le repere d'origine - * = origine de ptsegm */ - cX = *pX - ptsegm->m_Start.x; - cY = *pY - ptsegm->m_Start.y; - dx = ptsegm->m_End.x - ptsegm->m_Start.x; - dy = ptsegm->m_End.y - ptsegm->m_Start.y; - -// ***** A COMPLETER : non utilise - if( refsegm ) - { - ox = refsegm->m_Start.x - ptsegm->m_Start.x; - oy = refsegm->m_Start.y - ptsegm->m_Start.y; - fx = refsegm->m_End.x - ptsegm->m_Start.x; - fy = refsegm->m_End.y - ptsegm->m_Start.y; - } - - /* pour que le point soit sur le segment ptsegm: cY/cX = dy/dx */ - if( dx == 0 ) - cX = 0; /* segm horizontal */ - else - cY = (cX * dy) / dx; - - /* creation du point intermediaire ( c'est a dire creation d'un nouveau - * segment, debutant au point intermediaire */ - - cX += ptsegm->m_Start.x; cY += ptsegm->m_Start.y; - NewTrack = ptsegm->Copy(); - - NewTrack->Insert( NULL, ptsegm ); - /* correction du pointeur de fin du nouveau segment */ - NewTrack->end = ptsegm->end; - - /* le segment primitif finit au nouveau point : */ - ptsegm->m_End.x = cX; ptsegm->m_End.y = cY; - ptsegm->SetState( END_ONPAD, OFF ); - - /* le nouveau segment debute au nouveau point : */ - ptsegm = NewTrack;; - ptsegm->m_Start.x = cX; ptsegm->m_Start.y = cY; - ptsegm->SetState( BEGIN_ONPAD, OFF ); - *pX = cX; *pY = cY; - - return ptsegm; -} diff --git a/pcbnew/modedit.cpp b/pcbnew/modedit.cpp index 4c18143282..a52584e9e3 100644 --- a/pcbnew/modedit.cpp +++ b/pcbnew/modedit.cpp @@ -804,6 +804,7 @@ void WinEDA_ModuleEditFrame::Transform( MODULE* module, int transform ) /* Invert local coordinates */ NEGATE( edgemod->m_Start0.y ); NEGATE( edgemod->m_End0.y ); + NEGATE( edgemod->m_Angle ); break; case TYPE_TEXTE_MODULE: diff --git a/pcbnew/pcbnew_config.cpp b/pcbnew/pcbnew_config.cpp index 289711beac..51afb9c5c9 100644 --- a/pcbnew/pcbnew_config.cpp +++ b/pcbnew/pcbnew_config.cpp @@ -12,6 +12,7 @@ #include "wxPcbStruct.h" #include "class_board_design_settings.h" #include "pcbplot.h" +#include "plot_common.h" #include "worksheet.h" #include "pcbnew_id.h" #include "hotkeys.h" @@ -409,6 +410,15 @@ PARAM_CFG_ARRAY& WinEDA_PcbFrame::GetConfigurationSettings() &g_Show_Module_Ratsnest, TRUE ) ); m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "TwoSegT" ), &g_TwoSegmentTrackBuild, TRUE ) ); + // Plot options: + m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "PlotOutputFormat" ), + &g_pcb_plot_options.PlotFormat, PLOT_FORMAT_GERBER ) ); + m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "EdgeLayerGerberOpt" ), + &g_pcb_plot_options.Exclude_Edges_Pcb, true ) ); + m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "SubstractMasktoSilk" ), + &g_pcb_plot_options.m_SubtractMaskFromSilk, false ) ); + m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "PlotPadsOnSilkscreen" ), + &g_pcb_plot_options.PlotPadsOnSilkLayer, false ) ); return m_configSettings; } diff --git a/pcbnew/pcbplot.cpp b/pcbnew/pcbplot.cpp index e507d5a13f..1846a1f720 100644 --- a/pcbnew/pcbplot.cpp +++ b/pcbnew/pcbplot.cpp @@ -21,12 +21,9 @@ #define PLOT_DEFAULT_MARGE 300 // mils /* Keywords to r/w options in m_Config */ -#define OPTKEY_EDGELAYER_GERBER wxT( "EdgeLayerGerberOpt" ) #define OPTKEY_GERBER_EXTENSIONS wxT( "GerberOptUseLayersExt" ) #define OPTKEY_XFINESCALE_ADJ wxT( "PlotXFineScaleAdj" ) #define OPTKEY_YFINESCALE_ADJ wxT( "PlotYFineScaleAdj" ) -#define OPTKEY_PADS_ON_SILKSCREEN wxT( "PlotPadsOnSilkscreen" ) -#define OPTKEY_OUTPUT_FORMAT wxT( "PlotOutputFormat" ) // Define min and max reasonable values for print scale #define MIN_SCALE 0.01 @@ -35,7 +32,7 @@ // PCB_Plot_Options constructor: set the default values for plot options: PCB_Plot_Options::PCB_Plot_Options() { - subtractMaskFromSilk = true; + m_SubtractMaskFromSilk = false; Sel_Texte_Reference = true; Sel_Texte_Valeur = true; Sel_Texte_Divers = true; @@ -145,8 +142,6 @@ void DIALOG_PLOT::Init_Dialog() BOARD* board = m_Parent->GetBoard(); - m_Config->Read( OPTKEY_OUTPUT_FORMAT, &g_pcb_plot_options.PlotFormat ); - m_Config->Read( OPTKEY_EDGELAYER_GERBER, &g_pcb_plot_options.Exclude_Edges_Pcb ); m_Config->Read( OPTKEY_XFINESCALE_ADJ, &m_XScaleAdjust ); m_Config->Read( OPTKEY_YFINESCALE_ADJ, &m_YScaleAdjust ); @@ -263,9 +258,6 @@ void DIALOG_PLOT::Init_Dialog() } // Option to plot pads on silkscreen layers or all layers - m_Config->Read( OPTKEY_PADS_ON_SILKSCREEN, - &g_pcb_plot_options.PlotPadsOnSilkLayer ); - m_Plot_Pads_on_Silkscreen->SetValue( g_pcb_plot_options.PlotPadsOnSilkLayer ); // Options to plot texts on footprints @@ -497,17 +489,12 @@ void DIALOG_PLOT::SaveOptPlot( wxCommandEvent& event ) msg = m_FineAdjustYscaleOpt->GetValue(); msg.ToDouble( &m_YScaleAdjust ); - m_Config->Write( OPTKEY_EDGELAYER_GERBER, - g_pcb_plot_options.Exclude_Edges_Pcb ); m_Config->Write( OPTKEY_GERBER_EXTENSIONS, m_Use_Gerber_Extensions->GetValue() ); m_Config->Write( OPTKEY_XFINESCALE_ADJ, m_XScaleAdjust ); m_Config->Write( OPTKEY_YFINESCALE_ADJ, m_YScaleAdjust ); - m_Config->Write( OPTKEY_PADS_ON_SILKSCREEN, - g_pcb_plot_options.PlotPadsOnSilkLayer ); - int formatNdx = m_PlotFormatOpt->GetSelection(); - m_Config->Write( OPTKEY_OUTPUT_FORMAT, formatNdx ); + g_pcb_plot_options.PlotFormat = m_PlotFormatOpt->GetSelection(); wxString layerKey; for( int layer = 0; layer