Commit fe504483 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Pcbnew: remove duplicate definitions of some flags (like EDIT and IN_EDIT)...

Pcbnew: remove duplicate definitions of some flags (like EDIT and IN_EDIT) that have exactly the same meaning, but different values... (very dangerous)
Remove obsolete code.
parent 2ce4f404
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -292,13 +292,13 @@ class DHEAD;

// These define are used for the .m_Flags and .m_UndoRedoStatus member of the
// class EDA_ITEM
#define IS_CHANGED     (1 << 0)
#define IS_LINKED      (1 << 1)
#define IN_EDIT        (1 << 2)
#define IS_MOVED       (1 << 3)
#define IS_NEW         (1 << 4)
#define IS_RESIZED     (1 << 5)
#define IS_DRAGGED     (1 << 6)
#define IS_CHANGED     (1 << 0)   ///< Item was edited, and modified
#define IS_LINKED      (1 << 1)   ///< Used in calculation to mark linked items (temporary use)
#define IN_EDIT        (1 << 2)   ///< Item currently edited
#define IS_MOVED       (1 << 3)   ///< Item being moved
#define IS_NEW         (1 << 4)   ///< New item, just created
#define IS_RESIZED     (1 << 5)   ///< Item being resized
#define IS_DRAGGED     (1 << 6)   ///< Item being dragged
#define IS_DELETED     (1 << 7)
#define IS_WIRE_IMAGE  (1 << 8)
#define STARTPOINT     (1 << 9)
@@ -311,6 +311,14 @@ class DHEAD;
#define DO_NOT_DRAW    (1 << 16)   ///< Used to disable draw function
#define IS_CANCELLED   (1 << 17)   ///< flag set when edit dialogs are canceled when editing a
                                   ///< new object
#define TRACK_LOCKED   (1 << 18)   ///< Pcbnew: track locked: protected from global deletion
#define TRACK_AR       (1 << 19)   ///< Pcbnew: autorouted track
#define FLAG1          (1 << 20)   ///< Pcbnew: flag used in local computations
#define FLAG0          (1 << 21)   ///< Pcbnew: flag used in local computations
#define BEGIN_ONPAD    (1 << 22)   ///< Pcbnew: flag set for track segment starting on a pad
#define END_ONPAD      (1 << 23)   ///< Pcbnew: flag set for track segment ending on a pad
#define BUSY           (1 << 24)   ///< Pcbnew: flag indicating that the structure has
                                   // already been edited, in some functions

class EDA_ITEM
{
+0 −18
Original line number Diff line number Diff line
@@ -16,24 +16,6 @@
#define L_ENTETE_LIB            18
#define EXT_DOC                 wxT( "mdc" )


#define FLAG1                   (1 << 13)   // flag for free local computations
#define FLAG0                   (1 << 12)   // flag for free local computations
#define BEGIN_ONPAD             (1 << 11)   // flag indicating a start of segment pad
#define END_ONPAD               (1 << 10)   // flag indicating an end of segment pad
#define BUSY                    (1 << 9)    // flag indicating that the structure has
                                            // already been edited, in some routines
#define DELETED                 (1 << 8)    // structures erased and set string "DELETED"
#define NO_TRACE                (1 << 7)    // The element must not be displayed

#define SURBRILL                (1 << 5)    // element highlighted
#define DRAG                    (1 << 4)    // segment in drag mode
#define EDIT                    (1 << 3)    // element being edited
#define SEGM_FIXE               (1 << 2)    // segment fixed (not erase global)
#define SEGM_AR                 (1 << 1)    // segment marked for auto routing
#define CHAIN                   (1 << 0)    // mark segment


class NETINFO_ITEM;
class MARKER_PCB;
class RATSNEST_ITEM;
+6 −6
Original line number Diff line number Diff line
@@ -13,8 +13,8 @@

/* Attribute change for 1 track segment.
 *  Attributes are
 *  SEGM_FIXE       protection against global delete
 *  SEGM_AR         AutoRouted segment
 *  TRACK_LOCKED       protection against global delete
 *  TRACK_AR           AutoRouted segment
 */
void WinEDA_PcbFrame::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On )
{
@@ -23,7 +23,7 @@ void WinEDA_PcbFrame::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On )

    OnModify();
    DrawPanel->CrossHairOff( DC );   // Erase cursor shape
    track->SetState( SEGM_FIXE, Flag_On );
    track->SetState( TRACK_LOCKED, Flag_On );
    track->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );
    DrawPanel->CrossHairOn( DC );    // Display cursor shape
    track->DisplayInfo( this );
@@ -45,7 +45,7 @@ void WinEDA_PcbFrame::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On )

    for( ; (Track != NULL) && (nb_segm > 0); nb_segm-- )
    {
        Track->SetState( SEGM_FIXE, Flag_On );
        Track->SetState( TRACK_LOCKED, Flag_On );
        Track->SetState( BUSY, OFF );
        Track = Track->Next();
    }
@@ -56,7 +56,7 @@ void WinEDA_PcbFrame::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On )
}


/* Modify the flag SEGM_FIXE according to Flag_On value,
/* Modify the flag TRACK_LOCKED according to Flag_On value,
 *  for all the segments related to net_code.
 *  if net_code < 0 all the segments are modified.
 */
@@ -81,7 +81,7 @@ void WinEDA_PcbFrame::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
            break;

        OnModify();
        Track->SetState( SEGM_FIXE, Flag_On );
        Track->SetState( TRACK_LOCKED, Flag_On );
        Track->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );
        Track = Track->Next();
    }
+0 −3
Original line number Diff line number Diff line
@@ -348,9 +348,6 @@ void DIMENSION::Mirror(const wxPoint& axis_pos)

bool DIMENSION::Save( FILE* aFile ) const
{
    if( GetState( DELETED ) )
        return true;

    bool rc = false;
    // note: COTATION was the previous name of DIMENSION
    // this old keyword is used here for compatibility
+0 −3
Original line number Diff line number Diff line
@@ -79,9 +79,6 @@ void DRAWSEGMENT::Flip(const wxPoint& aCentre )

bool DRAWSEGMENT::Save( FILE* aFile ) const
{
    if( GetState( DELETED ) )
        return true;

    bool rc = false;

    if( fprintf( aFile, "$DRAWSEGMENT\n" ) != sizeof("$DRAWSEGMENT\n") - 1 )
Loading