Pcbnew: delete objects from removed layers.
This fixes potential DRC false positive bugs that occur when inner layers are removed from the board but the actual objects on contained on those layers remain in the board. Since Pcbnew does not handle odd number layers, this is not a perfect fix. When the user chooses the front or back layer only options from the layer setup dialog, objects on the copper layers will not be removed. This will not cause the false positive issue described above. Get rid of dialog OK and cancel button event handlers and use the proper TranferData(To/From)Window for handling control data. Add PCB_LAYER_COLLECTOR for collecting board objects by layer. Factor out redundant [] operators into base PCB_COLLECTOR object. Fixes lp:893950 https://bugs.launchpad.net/kicad/+bug/893950
This commit is contained in:
parent
517921e2e1
commit
ded4ad9b17
|
@ -126,9 +126,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operator []
|
* Overload COLLECTOR::operator[](int) to return a SCH_ITEM instead of an EDA_ITEM.
|
||||||
* overloads COLLECTOR::operator[](int) to return a SCH_ITEM* instead of
|
*
|
||||||
* an EDA_ITEM* type.
|
|
||||||
* @param aIndex The index into the list.
|
* @param aIndex The index into the list.
|
||||||
* @return SCH_ITEM* at \a aIndex or NULL.
|
* @return SCH_ITEM* at \a aIndex or NULL.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2008 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
* Copyright (C) 2007-2008 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
* Copyright (C) 2004-2007 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2017 KiCad Developers, see change_log.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2008 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
* Copyright (C) 2007-2008 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
* Copyright (C) 2004-2007 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2017 KiCad Developers, see change_log.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -31,12 +31,11 @@
|
||||||
#include <class_marker_pcb.h>
|
#include <class_marker_pcb.h>
|
||||||
|
|
||||||
|
|
||||||
/* This module contains out of line member functions for classes given in
|
/* This module contains out of line member functions for classes given in
|
||||||
* collectors.h. Those classes augment the functionality of class PCB_EDIT_FRAME.
|
* collectors.h. Those classes augment the functionality of class PCB_EDIT_FRAME.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// see collectors.h
|
|
||||||
const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
|
const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
|
||||||
// there are some restrictions on the order of items in the general case.
|
// there are some restrictions on the order of items in the general case.
|
||||||
// all items in m_Drawings for instance should be contiguous.
|
// all items in m_Drawings for instance should be contiguous.
|
||||||
|
@ -57,17 +56,19 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
const KICAD_T GENERAL_COLLECTOR::BoardLevelItems[] = {
|
||||||
* const KICAD_T GENERAL_COLLECTOR::PrimaryItems[] = {
|
PCB_MARKER_T,
|
||||||
* PCB_TEXT_T,
|
PCB_TEXT_T,
|
||||||
* PCB_LINE_T,
|
PCB_LINE_T,
|
||||||
* PCB_DIMENSION_T,
|
PCB_DIMENSION_T,
|
||||||
* PCB_VIA_T,
|
PCB_TARGET_T,
|
||||||
* PCB_TRACE_T,
|
PCB_VIA_T,
|
||||||
* PCB_MODULE_T,
|
PCB_TRACE_T,
|
||||||
* EOT
|
PCB_MODULE_T,
|
||||||
* };
|
PCB_ZONE_T,
|
||||||
*/
|
PCB_ZONE_AREA_T,
|
||||||
|
EOT
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
const KICAD_T GENERAL_COLLECTOR::AllButZones[] = {
|
const KICAD_T GENERAL_COLLECTOR::AllButZones[] = {
|
||||||
|
@ -140,18 +141,6 @@ const KICAD_T GENERAL_COLLECTOR::Zones[] = {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function Inspect
|
|
||||||
* is the examining function within the INSPECTOR which is passed to the
|
|
||||||
* Iterate function. Searches and collects all the objects that the old
|
|
||||||
* function PcbGeneralLocateAndDisplay() would find, except that it keeps all
|
|
||||||
* that it finds and does not do any displaying.
|
|
||||||
*
|
|
||||||
* @param testItem An EDA_ITEM to examine.
|
|
||||||
* @param testData not used here.
|
|
||||||
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
|
|
||||||
* else SCAN_CONTINUE;
|
|
||||||
*/
|
|
||||||
SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
||||||
{
|
{
|
||||||
BOARD_ITEM* item = (BOARD_ITEM*) testItem;
|
BOARD_ITEM* item = (BOARD_ITEM*) testItem;
|
||||||
|
@ -443,7 +432,6 @@ exit:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// see collectors.h
|
|
||||||
void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
|
void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
|
||||||
const wxPoint& aRefPos, const COLLECTORS_GUIDE& aGuide )
|
const wxPoint& aRefPos, const COLLECTORS_GUIDE& aGuide )
|
||||||
{
|
{
|
||||||
|
@ -474,10 +462,9 @@ void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// see collectors.h
|
|
||||||
SEARCH_RESULT PCB_TYPE_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
SEARCH_RESULT PCB_TYPE_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
||||||
{
|
{
|
||||||
// The Vist() function only visits the testItem if its type was in the
|
// The Visit() function only visits the testItem if its type was in the
|
||||||
// the scanList, so therefore we can collect anything given to us here.
|
// the scanList, so therefore we can collect anything given to us here.
|
||||||
Append( testItem );
|
Append( testItem );
|
||||||
|
|
||||||
|
@ -491,3 +478,22 @@ void PCB_TYPE_COLLECTOR::Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[]
|
||||||
|
|
||||||
aBoard->Visit( m_inspector, NULL, aScanList );
|
aBoard->Visit( m_inspector, NULL, aScanList );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SEARCH_RESULT PCB_LAYER_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
||||||
|
{
|
||||||
|
BOARD_ITEM* item = (BOARD_ITEM*) testItem;
|
||||||
|
|
||||||
|
if( item->GetLayer() == m_layer_id )
|
||||||
|
Append( testItem );
|
||||||
|
|
||||||
|
return SEARCH_CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PCB_LAYER_COLLECTOR::Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] )
|
||||||
|
{
|
||||||
|
Empty();
|
||||||
|
|
||||||
|
aBoard->Visit( m_inspector, NULL, aScanList );
|
||||||
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2008 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
* Copyright (C) 2007-2008 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
* Copyright (C) 2004-2007 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2017 KiCad Developers, see change_log.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -31,8 +31,8 @@
|
||||||
|
|
||||||
|
|
||||||
/* This module contains a number of COLLECTOR implementations which are used
|
/* This module contains a number of COLLECTOR implementations which are used
|
||||||
to augment the functionality of class PCB_EDIT_FRAME.
|
* to augment the functionality of class PCB_EDIT_FRAME.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <class_collector.h>
|
#include <class_collector.h>
|
||||||
|
@ -43,8 +43,7 @@ class BOARD_ITEM;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class COLLECTORS_GUIDE
|
* An abstract base class whose derivatives may be passed to a GENERAL_COLLECTOR,
|
||||||
* is an abstract base class whose derivatives may be passed to a GENERAL_COLLECTOR,
|
|
||||||
* telling GENERAL_COLLECTOR what should be collected (aside from HitTest()ing
|
* telling GENERAL_COLLECTOR what should be collected (aside from HitTest()ing
|
||||||
* and KICAD_T scanTypes[], information which are provided to the GENERAL_COLLECTOR
|
* and KICAD_T scanTypes[], information which are provided to the GENERAL_COLLECTOR
|
||||||
* through attributes or arguments separately).
|
* through attributes or arguments separately).
|
||||||
|
@ -58,7 +57,7 @@ class BOARD_ITEM;
|
||||||
* GENERAL_COLLECTOR::Inspect() can be kept as simple as possible, and insulated
|
* GENERAL_COLLECTOR::Inspect() can be kept as simple as possible, and insulated
|
||||||
* from changes in global preference storage (and even then it is
|
* from changes in global preference storage (and even then it is
|
||||||
* not simple enough).
|
* not simple enough).
|
||||||
* <p>
|
* </p>
|
||||||
* This class introduces the notion of layer locking.
|
* This class introduces the notion of layer locking.
|
||||||
*/
|
*/
|
||||||
class COLLECTORS_GUIDE
|
class COLLECTORS_GUIDE
|
||||||
|
@ -68,106 +67,85 @@ public:
|
||||||
virtual ~COLLECTORS_GUIDE() {}
|
virtual ~COLLECTORS_GUIDE() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IsLayerLocked
|
|
||||||
* @return bool - true if the given layer is locked, else false.
|
* @return bool - true if the given layer is locked, else false.
|
||||||
*/
|
*/
|
||||||
virtual bool IsLayerLocked( PCB_LAYER_ID layer ) const = 0;
|
virtual bool IsLayerLocked( PCB_LAYER_ID layer ) const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IsLayerVisible
|
|
||||||
* @return bool - true if the given layer is visible, else false.
|
* @return bool - true if the given layer is visible, else false.
|
||||||
*/
|
*/
|
||||||
virtual bool IsLayerVisible( PCB_LAYER_ID layer ) const = 0;
|
virtual bool IsLayerVisible( PCB_LAYER_ID layer ) const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreLockedLayers
|
|
||||||
* @return bool - true if should ignore locked layers, else false.
|
* @return bool - true if should ignore locked layers, else false.
|
||||||
*/
|
*/
|
||||||
virtual bool IgnoreLockedLayers() const = 0;
|
virtual bool IgnoreLockedLayers() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoredNonVisibleLayers
|
|
||||||
* @return bool - true if should ignore non-visible layers, else false.
|
* @return bool - true if should ignore non-visible layers, else false.
|
||||||
*/
|
*/
|
||||||
virtual bool IgnoreNonVisibleLayers() const = 0;
|
virtual bool IgnoreNonVisibleLayers() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetPreferredLayer
|
|
||||||
* @return int - the preferred layer for HitTest()ing.
|
* @return int - the preferred layer for HitTest()ing.
|
||||||
*/
|
*/
|
||||||
virtual PCB_LAYER_ID GetPreferredLayer() const = 0;
|
virtual PCB_LAYER_ID GetPreferredLayer() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnorePreferredLayer
|
* Provide wildcard behavior regarding the preferred layer.
|
||||||
* provides wildcard behavior regarding the preferred layer.
|
*
|
||||||
* @return bool - true if should ignore preferred layer, else false.
|
* @return bool - true if should ignore preferred layer, else false.
|
||||||
*/
|
*/
|
||||||
virtual bool IgnorePreferredLayer() const = 0;
|
virtual bool IgnorePreferredLayer() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreLockedItems
|
|
||||||
* @return bool - true if should ignore locked items, else false.
|
* @return bool - true if should ignore locked items, else false.
|
||||||
*/
|
*/
|
||||||
virtual bool IgnoreLockedItems() const = 0;
|
virtual bool IgnoreLockedItems() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IncludeSecondary
|
* Determine if the secondary criteria or 2nd choice items should be included.
|
||||||
* determines if the secondary criteria, or 2nd choice items should be
|
*
|
||||||
* included.
|
|
||||||
* @return bool - true if should include, else false.
|
* @return bool - true if should include, else false.
|
||||||
*/
|
*/
|
||||||
virtual bool IncludeSecondary() const = 0;
|
virtual bool IncludeSecondary() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreMTextsMarkedNoShow
|
|
||||||
* @return bool - true if MTexts marked as "no show" should be ignored.
|
* @return bool - true if MTexts marked as "no show" should be ignored.
|
||||||
*/
|
*/
|
||||||
virtual bool IgnoreMTextsMarkedNoShow() const = 0;
|
virtual bool IgnoreMTextsMarkedNoShow() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreZones
|
|
||||||
* @return bool - true if should ignore zones.
|
|
||||||
virtual bool IgnoreZones() const = 0;
|
|
||||||
can simply omit from scanTypes[] PCB_ZONE_T */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function IgnoreMTextsOnBack
|
|
||||||
* @return bool - true if should ignore MTexts on back layers
|
* @return bool - true if should ignore MTexts on back layers
|
||||||
*/
|
*/
|
||||||
virtual bool IgnoreMTextsOnBack() const = 0;
|
virtual bool IgnoreMTextsOnBack() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreMTextsOnFront
|
|
||||||
* @return bool - true if should ignore MTexts on front layers.
|
* @return bool - true if should ignore MTexts on front layers.
|
||||||
*/
|
*/
|
||||||
virtual bool IgnoreMTextsOnFront() const = 0;
|
virtual bool IgnoreMTextsOnFront() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreModulesOnBack
|
|
||||||
* @return bool - true if should ignore MODULEs on Back Side.
|
* @return bool - true if should ignore MODULEs on Back Side.
|
||||||
*/
|
*/
|
||||||
virtual bool IgnoreModulesOnBack() const = 0;
|
virtual bool IgnoreModulesOnBack() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreModulesOnFront
|
|
||||||
* @return bool - ture if should ignore MODULEs on Front Side.
|
* @return bool - ture if should ignore MODULEs on Front Side.
|
||||||
*/
|
*/
|
||||||
virtual bool IgnoreModulesOnFront() const = 0;
|
virtual bool IgnoreModulesOnFront() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnorePadsOnBack
|
|
||||||
* @return bool - true if should ignore Pads on Back Side.
|
* @return bool - true if should ignore Pads on Back Side.
|
||||||
*/
|
*/
|
||||||
virtual bool IgnorePadsOnBack() const = 0;
|
virtual bool IgnorePadsOnBack() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnorePadsOnFront
|
|
||||||
* @return bool - ture if should ignore PADSs on Front Side.
|
* @return bool - ture if should ignore PADSs on Front Side.
|
||||||
*/
|
*/
|
||||||
virtual bool IgnorePadsOnFront() const = 0;
|
virtual bool IgnorePadsOnFront() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnorePads
|
|
||||||
* @return bool - true if should ignore PADSs on Front side and Back side.
|
* @return bool - true if should ignore PADSs on Front side and Back side.
|
||||||
*/
|
*/
|
||||||
virtual bool IgnorePads() const
|
virtual bool IgnorePads() const
|
||||||
|
@ -176,19 +154,16 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreModulesVals
|
|
||||||
* @return bool - true if should ignore modules values.
|
* @return bool - true if should ignore modules values.
|
||||||
*/
|
*/
|
||||||
virtual bool IgnoreModulesVals() const = 0;
|
virtual bool IgnoreModulesVals() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreModulesRefs
|
|
||||||
* @return bool - true if should ignore module references.
|
* @return bool - true if should ignore module references.
|
||||||
*/
|
*/
|
||||||
virtual bool IgnoreModulesRefs() const = 0;
|
virtual bool IgnoreModulesRefs() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function UseHitTesting
|
|
||||||
* @return bool - true if Inspect() should use BOARD_ITEM::HitTest()
|
* @return bool - true if Inspect() should use BOARD_ITEM::HitTest()
|
||||||
* or false if Inspect() should use BOARD_ITEM::BoundsTest().
|
* or false if Inspect() should use BOARD_ITEM::BoundsTest().
|
||||||
virtual bool UseHitTesting() const = 0;
|
virtual bool UseHitTesting() const = 0;
|
||||||
|
@ -198,17 +173,43 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class GENERAL_COLLECTOR
|
* Collect #BOARD_ITEM objects.
|
||||||
* is intended for use when the right click button is pressed, or when the
|
*
|
||||||
* plain "arrow" tool is in effect. This class can be used by window classes
|
* All this object really does is override the [] operator and return a #BOARD_ITEM instead
|
||||||
* such as PCB_EDIT_FRAME.
|
* of a #EDA_ITEM. Derive all board collector objects from this class instead of the base
|
||||||
|
* #COLLECTOR object.
|
||||||
|
*
|
||||||
|
* @see class COLLECTOR
|
||||||
|
*/
|
||||||
|
class PCB_COLLECTOR : public COLLECTOR
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Overload the COLLECTOR::operator[](int) to return a #BOARD_ITEM instead of an #EDA_ITEM.
|
||||||
|
*
|
||||||
|
* @param ndx The index into the list.
|
||||||
|
* @return BOARD_ITEM* - or something derived from it, or NULL.
|
||||||
|
*/
|
||||||
|
BOARD_ITEM* operator[]( int ndx ) const
|
||||||
|
{
|
||||||
|
if( (unsigned)ndx < (unsigned)GetCount() )
|
||||||
|
return (BOARD_ITEM*) m_List[ ndx ];
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used when the right click button is pressed, or when the select tool is in effect.
|
||||||
|
* This class can be used by window classes such as PCB_EDIT_FRAME.
|
||||||
*
|
*
|
||||||
* Philosophy: this class knows nothing of the context in which a BOARD is used
|
* Philosophy: this class knows nothing of the context in which a BOARD is used
|
||||||
* and that means it knows nothing about which layers are visible or current,
|
* and that means it knows nothing about which layers are visible or current,
|
||||||
* but can handle those concerns by the SetPreferredLayer() function and the
|
* but can handle those concerns by the SetPreferredLayer() function and the
|
||||||
* SetLayerSet() function.
|
* SetLayerSet() function.
|
||||||
*/
|
*/
|
||||||
class GENERAL_COLLECTOR : public COLLECTOR
|
class GENERAL_COLLECTOR : public PCB_COLLECTOR
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
|
@ -219,20 +220,17 @@ protected:
|
||||||
*/
|
*/
|
||||||
std::vector<BOARD_ITEM*> m_List2nd;
|
std::vector<BOARD_ITEM*> m_List2nd;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines which items are to be collected by Inspect()
|
* Determines which items are to be collected by Inspect()
|
||||||
*/
|
*/
|
||||||
const COLLECTORS_GUIDE* m_Guide;
|
const COLLECTORS_GUIDE* m_Guide;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The number of items that were originally in the primary list before the
|
* The number of items that were originally in the primary list before the
|
||||||
* m_List2nd was concatenated onto the end of it.
|
* m_List2nd was concatenated onto the end of it.
|
||||||
*/
|
*/
|
||||||
int m_PrimaryLength;
|
int m_PrimaryLength;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -240,7 +238,6 @@ public:
|
||||||
*/
|
*/
|
||||||
static const KICAD_T AllBoardItems[];
|
static const KICAD_T AllBoardItems[];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A scan list for all editable board items, except zones
|
* A scan list for all editable board items, except zones
|
||||||
*/
|
*/
|
||||||
|
@ -251,20 +248,17 @@ public:
|
||||||
*/
|
*/
|
||||||
static const KICAD_T Zones[];
|
static const KICAD_T Zones[];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A scan list for all primary board items, omitting items which are subordinate to
|
* A scan list for all primary board items, omitting items which are subordinate to
|
||||||
* a MODULE, such as D_PAD and TEXTEMODULE.
|
* a MODULE, such as D_PAD and TEXTEMODULE.
|
||||||
static const KICAD_T PrimaryItems[];
|
|
||||||
*/
|
*/
|
||||||
|
static const KICAD_T BoardLevelItems[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A scan list for only MODULEs
|
* A scan list for only MODULEs
|
||||||
*/
|
*/
|
||||||
static const KICAD_T Modules[];
|
static const KICAD_T Modules[];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A scan list for PADs or MODULEs
|
* A scan list for PADs or MODULEs
|
||||||
*/
|
*/
|
||||||
|
@ -275,25 +269,21 @@ public:
|
||||||
*/
|
*/
|
||||||
static const KICAD_T PadsTracksOrZones[];
|
static const KICAD_T PadsTracksOrZones[];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A scan list for MODULEs and their items (for Modedit)
|
* A scan list for MODULEs and their items (for Modedit)
|
||||||
*/
|
*/
|
||||||
static const KICAD_T ModulesAndTheirItems[];
|
static const KICAD_T ModulesAndTheirItems[];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A scan list for primary module items.
|
* A scan list for primary module items.
|
||||||
*/
|
*/
|
||||||
static const KICAD_T ModuleItems[];
|
static const KICAD_T ModuleItems[];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A scan list for only TRACKS
|
* A scan list for only TRACKS
|
||||||
*/
|
*/
|
||||||
static const KICAD_T Tracks[];
|
static const KICAD_T Tracks[];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor GENERALCOLLECTOR
|
* Constructor GENERALCOLLECTOR
|
||||||
*/
|
*/
|
||||||
|
@ -314,39 +304,23 @@ public:
|
||||||
m_List2nd.push_back( item );
|
m_List2nd.push_back( item );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function SetGuide
|
* Record which COLLECTORS_GUIDE to use.
|
||||||
* records which COLLECTORS_GUIDE to use.
|
*
|
||||||
* @param aGuide Which guide to use in the collection.
|
* @param aGuide Which guide to use in the collection.
|
||||||
*/
|
*/
|
||||||
void SetGuide( const COLLECTORS_GUIDE* aGuide ) { m_Guide = aGuide; }
|
void SetGuide( const COLLECTORS_GUIDE* aGuide ) { m_Guide = aGuide; }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function operator[int]
|
|
||||||
* overloads COLLECTOR::operator[](int) to return a BOARD_ITEM* instead of
|
|
||||||
* an EDA_ITEM* type.
|
|
||||||
* @param ndx The index into the list.
|
|
||||||
* @return BOARD_ITEM* - or something derived from it, or NULL.
|
|
||||||
*/
|
|
||||||
BOARD_ITEM* operator[]( int ndx ) const
|
|
||||||
{
|
|
||||||
if( (unsigned)ndx < (unsigned)GetCount() )
|
|
||||||
return (BOARD_ITEM*) m_List[ ndx ];
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function GetPrimaryCount
|
|
||||||
* @return int - The number if items which met the primary search criteria
|
* @return int - The number if items which met the primary search criteria
|
||||||
*/
|
*/
|
||||||
int GetPrimaryCount() { return m_PrimaryLength; }
|
int GetPrimaryCount() { return m_PrimaryLength; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Inspect
|
* The examining function within the INSPECTOR which is passed to the Iterate function.
|
||||||
* is the examining function within the INSPECTOR which is passed to the
|
*
|
||||||
* Iterate function.
|
* Searches and collects all the objects that the old function PcbGeneralLocateAndDisplay()
|
||||||
|
* would find, except that it keeps all that it finds and does not do any displaying.
|
||||||
*
|
*
|
||||||
* @param testItem An EDA_ITEM to examine.
|
* @param testItem An EDA_ITEM to examine.
|
||||||
* @param testData is not used in this class.
|
* @param testData is not used in this class.
|
||||||
|
@ -356,8 +330,8 @@ public:
|
||||||
SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
|
SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Collect
|
* Scan a BOARD_ITEM using this class's Inspector method, which does the collection.
|
||||||
* scans a BOARD_ITEM using this class's Inspector method, which does the collection.
|
*
|
||||||
* @param aItem A BOARD_ITEM to scan, may be a BOARD or MODULE, or whatever.
|
* @param aItem A BOARD_ITEM to scan, may be a BOARD or MODULE, or whatever.
|
||||||
* @param aScanList A list of KICAD_Ts with a terminating EOT, that specs
|
* @param aScanList A list of KICAD_Ts with a terminating EOT, that specs
|
||||||
* what is to be collected and the priority order of the resultant
|
* what is to be collected and the priority order of the resultant
|
||||||
|
@ -371,8 +345,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class GENERAL_COLLECTORS_GUIDE
|
* A general implementation of a COLLECTORS_GUIDE. One of its constructors is
|
||||||
* is a general implementation of a COLLECTORS_GUIDE. One of its constructors is
|
|
||||||
* entitled to grab information from the program's global preferences.
|
* entitled to grab information from the program's global preferences.
|
||||||
*/
|
*/
|
||||||
class GENERAL_COLLECTORS_GUIDE : public COLLECTORS_GUIDE
|
class GENERAL_COLLECTORS_GUIDE : public COLLECTORS_GUIDE
|
||||||
|
@ -406,9 +379,10 @@ private:
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor GENERAL_COLLECTORS_GUIDE
|
* Grab stuff from global preferences and uses reasonable defaults.
|
||||||
* grabs stuff from global preferences and uses reasonable defaults.
|
*
|
||||||
* Add more constructors as needed.
|
* Add more constructors as needed.
|
||||||
|
*
|
||||||
* @param aVisibleLayerMask = current visible layers (bit mask)
|
* @param aVisibleLayerMask = current visible layers (bit mask)
|
||||||
* @param aPreferredLayer = the layer to search first
|
* @param aPreferredLayer = the layer to search first
|
||||||
*/
|
*/
|
||||||
|
@ -440,9 +414,7 @@ public:
|
||||||
m_IgnoreModulesRefs = false;
|
m_IgnoreModulesRefs = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IsLayerLocked
|
|
||||||
* @return bool - true if the given layer is locked, else false.
|
* @return bool - true if the given layer is locked, else false.
|
||||||
*/
|
*/
|
||||||
bool IsLayerLocked( PCB_LAYER_ID aLayerId ) const override
|
bool IsLayerLocked( PCB_LAYER_ID aLayerId ) const override
|
||||||
|
@ -456,7 +428,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IsLayerVisible
|
|
||||||
* @return bool - true if the given layer is visible, else false.
|
* @return bool - true if the given layer is visible, else false.
|
||||||
*/
|
*/
|
||||||
bool IsLayerVisible( PCB_LAYER_ID aLayerId ) const override
|
bool IsLayerVisible( PCB_LAYER_ID aLayerId ) const override
|
||||||
|
@ -470,114 +441,94 @@ public:
|
||||||
void SetLayerVisibleBits( LSET aLayerBits ) { m_LayerVisible = aLayerBits; }
|
void SetLayerVisibleBits( LSET aLayerBits ) { m_LayerVisible = aLayerBits; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreLockedLayers
|
|
||||||
* @return bool - true if should ignore locked layers, else false.
|
* @return bool - true if should ignore locked layers, else false.
|
||||||
*/
|
*/
|
||||||
bool IgnoreLockedLayers() const override { return m_IgnoreLockedLayers; }
|
bool IgnoreLockedLayers() const override { return m_IgnoreLockedLayers; }
|
||||||
void SetIgnoreLockedLayers( bool ignore ) { m_IgnoreLockedLayers = ignore; }
|
void SetIgnoreLockedLayers( bool ignore ) { m_IgnoreLockedLayers = ignore; }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoredNonVisibleLayers
|
|
||||||
* @return bool - true if should ignore non-visible layers, else false.
|
* @return bool - true if should ignore non-visible layers, else false.
|
||||||
*/
|
*/
|
||||||
bool IgnoreNonVisibleLayers() const override { return m_IgnoreNonVisibleLayers; }
|
bool IgnoreNonVisibleLayers() const override { return m_IgnoreNonVisibleLayers; }
|
||||||
void SetIgnoreNonVisibleLayers( bool ignore ) { m_IgnoreLockedLayers = ignore; }
|
void SetIgnoreNonVisibleLayers( bool ignore ) { m_IgnoreLockedLayers = ignore; }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetPreferredLayer
|
|
||||||
* @return int - the preferred layer for HitTest()ing.
|
* @return int - the preferred layer for HitTest()ing.
|
||||||
*/
|
*/
|
||||||
PCB_LAYER_ID GetPreferredLayer() const override { return m_PreferredLayer; }
|
PCB_LAYER_ID GetPreferredLayer() const override { return m_PreferredLayer; }
|
||||||
void SetPreferredLayer( PCB_LAYER_ID aLayer ) { m_PreferredLayer = aLayer; }
|
void SetPreferredLayer( PCB_LAYER_ID aLayer ) { m_PreferredLayer = aLayer; }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnorePreferredLayer
|
* Provide wildcard behavior regarding the preferred layer.
|
||||||
* provides wildcard behavior regarding the preferred layer.
|
*
|
||||||
* @return bool - true if should ignore preferred layer, else false.
|
* @return bool - true if should ignore preferred layer, else false.
|
||||||
*/
|
*/
|
||||||
bool IgnorePreferredLayer() const override { return m_IgnorePreferredLayer; }
|
bool IgnorePreferredLayer() const override { return m_IgnorePreferredLayer; }
|
||||||
void SetIgnorePreferredLayer( bool ignore ) { m_IgnorePreferredLayer = ignore; }
|
void SetIgnorePreferredLayer( bool ignore ) { m_IgnorePreferredLayer = ignore; }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreLockedItems
|
|
||||||
* @return bool - true if should ignore locked items, else false.
|
* @return bool - true if should ignore locked items, else false.
|
||||||
*/
|
*/
|
||||||
bool IgnoreLockedItems() const override { return m_IgnoreLockedItems; }
|
bool IgnoreLockedItems() const override { return m_IgnoreLockedItems; }
|
||||||
void SetIgnoreLockedItems( bool ignore ) { m_IgnoreLockedItems = ignore; }
|
void SetIgnoreLockedItems( bool ignore ) { m_IgnoreLockedItems = ignore; }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IncludeSecondary
|
* Determine if the secondary criteria, or 2nd choice items should be included.
|
||||||
* determines if the secondary criteria, or 2nd choice items should be
|
*
|
||||||
* included.
|
|
||||||
* @return bool - true if should include, else false.
|
* @return bool - true if should include, else false.
|
||||||
*/
|
*/
|
||||||
bool IncludeSecondary() const override { return m_IncludeSecondary; }
|
bool IncludeSecondary() const override { return m_IncludeSecondary; }
|
||||||
void SetIncludeSecondary( bool include ) { m_IncludeSecondary = include; }
|
void SetIncludeSecondary( bool include ) { m_IncludeSecondary = include; }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreMTextsMarkedNoShow
|
|
||||||
* @return bool - true if MTexts marked as "no show" should be ignored.
|
* @return bool - true if MTexts marked as "no show" should be ignored.
|
||||||
*/
|
*/
|
||||||
bool IgnoreMTextsMarkedNoShow() const override { return m_IgnoreMTextsMarkedNoShow; }
|
bool IgnoreMTextsMarkedNoShow() const override { return m_IgnoreMTextsMarkedNoShow; }
|
||||||
void SetIgnoreMTextsMarkedNoShow( bool ignore ) { m_IgnoreMTextsMarkedNoShow = ignore; }
|
void SetIgnoreMTextsMarkedNoShow( bool ignore ) { m_IgnoreMTextsMarkedNoShow = ignore; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreMTextsOnCu
|
|
||||||
* @return bool - true if should ignore MTexts on back layers
|
* @return bool - true if should ignore MTexts on back layers
|
||||||
*/
|
*/
|
||||||
bool IgnoreMTextsOnBack() const override { return m_IgnoreMTextsOnBack; }
|
bool IgnoreMTextsOnBack() const override { return m_IgnoreMTextsOnBack; }
|
||||||
void SetIgnoreMTextsOnBack( bool ignore ) { m_IgnoreMTextsOnBack = ignore; }
|
void SetIgnoreMTextsOnBack( bool ignore ) { m_IgnoreMTextsOnBack = ignore; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreMTextsOnFront
|
|
||||||
* @return bool - true if should ignore MTexts on front layers
|
* @return bool - true if should ignore MTexts on front layers
|
||||||
*/
|
*/
|
||||||
bool IgnoreMTextsOnFront() const override { return m_IgnoreMTextsOnFront; }
|
bool IgnoreMTextsOnFront() const override { return m_IgnoreMTextsOnFront; }
|
||||||
void SetIgnoreMTextsOnFront( bool ignore ) { m_IgnoreMTextsOnFront = ignore; }
|
void SetIgnoreMTextsOnFront( bool ignore ) { m_IgnoreMTextsOnFront = ignore; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreModulesOnBack
|
|
||||||
* @return bool - true if should ignore MODULEs on the back side
|
* @return bool - true if should ignore MODULEs on the back side
|
||||||
*/
|
*/
|
||||||
bool IgnoreModulesOnBack() const override { return m_IgnoreModulesOnBack; }
|
bool IgnoreModulesOnBack() const override { return m_IgnoreModulesOnBack; }
|
||||||
void SetIgnoreModulesOnBack( bool ignore ) { m_IgnoreModulesOnBack = ignore; }
|
void SetIgnoreModulesOnBack( bool ignore ) { m_IgnoreModulesOnBack = ignore; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreModulesOnFront
|
|
||||||
* @return bool - true if should ignore MODULEs on component layer.
|
* @return bool - true if should ignore MODULEs on component layer.
|
||||||
*/
|
*/
|
||||||
bool IgnoreModulesOnFront() const override { return m_IgnoreModulesOnFront; }
|
bool IgnoreModulesOnFront() const override { return m_IgnoreModulesOnFront; }
|
||||||
void SetIgnoreModulesOnFront( bool ignore ) { m_IgnoreModulesOnFront = ignore; }
|
void SetIgnoreModulesOnFront( bool ignore ) { m_IgnoreModulesOnFront = ignore; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnorePadsOnBack
|
|
||||||
* @return bool - true if should ignore Pads on Back Side.
|
* @return bool - true if should ignore Pads on Back Side.
|
||||||
*/
|
*/
|
||||||
bool IgnorePadsOnBack() const override { return m_IgnorePadsOnBack; }
|
bool IgnorePadsOnBack() const override { return m_IgnorePadsOnBack; }
|
||||||
void SetIgnorePadsOnBack(bool ignore) { m_IgnorePadsOnBack = ignore; }
|
void SetIgnorePadsOnBack(bool ignore) { m_IgnorePadsOnBack = ignore; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnorePadsOnFront
|
|
||||||
* @return bool - true if should ignore PADSs on Front Side.
|
* @return bool - true if should ignore PADSs on Front Side.
|
||||||
*/
|
*/
|
||||||
bool IgnorePadsOnFront() const override { return m_IgnorePadsOnFront; }
|
bool IgnorePadsOnFront() const override { return m_IgnorePadsOnFront; }
|
||||||
void SetIgnorePadsOnFront(bool ignore) { m_IgnorePadsOnFront = ignore; }
|
void SetIgnorePadsOnFront(bool ignore) { m_IgnorePadsOnFront = ignore; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreModulesVals
|
|
||||||
* @return bool - true if should ignore modules values.
|
* @return bool - true if should ignore modules values.
|
||||||
*/
|
*/
|
||||||
bool IgnoreModulesVals() const override { return m_IgnoreModulesVals; }
|
bool IgnoreModulesVals() const override { return m_IgnoreModulesVals; }
|
||||||
void SetIgnoreModulesVals(bool ignore) { m_IgnoreModulesVals = ignore; }
|
void SetIgnoreModulesVals(bool ignore) { m_IgnoreModulesVals = ignore; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IgnoreModulesRefs
|
|
||||||
* @return bool - true if should ignore modules references.
|
* @return bool - true if should ignore modules references.
|
||||||
*/
|
*/
|
||||||
bool IgnoreModulesRefs() const override { return m_IgnoreModulesRefs; }
|
bool IgnoreModulesRefs() const override { return m_IgnoreModulesRefs; }
|
||||||
|
@ -586,32 +537,16 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PCB_TYPE_COLLECTOR
|
* Collect all #BOARD_ITEM objects of a given set of #KICAD_T type(s).
|
||||||
* merely gathers up all BOARD_ITEMs of a given set of KICAD_T type(s).
|
*
|
||||||
* @see class COLLECTOR
|
* @see class COLLECTOR
|
||||||
*/
|
*/
|
||||||
class PCB_TYPE_COLLECTOR : public COLLECTOR
|
class PCB_TYPE_COLLECTOR : public PCB_COLLECTOR
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function operator[int]
|
* The examining function within the INSPECTOR which is passed to the Iterate function.
|
||||||
* overloads COLLECTOR::operator[](int) to return a BOARD_ITEM* instead of
|
|
||||||
* an EDA_ITEM* type.
|
|
||||||
* @param ndx The index into the list.
|
|
||||||
* @return BOARD_ITEM* - or something derived from it, or NULL.
|
|
||||||
*/
|
|
||||||
BOARD_ITEM* operator[]( int ndx ) const
|
|
||||||
{
|
|
||||||
if( (unsigned)ndx < (unsigned)GetCount() )
|
|
||||||
return (BOARD_ITEM*) m_List[ ndx ];
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function Inspect
|
|
||||||
* is the examining function within the INSPECTOR which is passed to the
|
|
||||||
* Iterate function.
|
|
||||||
*
|
*
|
||||||
* @param testItem An EDA_ITEM to examine.
|
* @param testItem An EDA_ITEM to examine.
|
||||||
* @param testData is not used in this class.
|
* @param testData is not used in this class.
|
||||||
|
@ -621,9 +556,45 @@ public:
|
||||||
SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
|
SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Collect
|
* Collect #BOARD_ITEM objects using this class's Inspector method, which does the collection.
|
||||||
* scans a BOARD_ITEM using this class's Inspector method, which does
|
*
|
||||||
* the collection.
|
* @param aBoard The BOARD_ITEM to scan.
|
||||||
|
* @param aScanList The KICAD_Ts to gather up.
|
||||||
|
*/
|
||||||
|
void Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] );
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Collect all #BOARD_ITEM objects on a given layer.
|
||||||
|
*
|
||||||
|
* This only uses the primary object layer for comparison.
|
||||||
|
*/
|
||||||
|
class PCB_LAYER_COLLECTOR : public PCB_COLLECTOR
|
||||||
|
{
|
||||||
|
PCB_LAYER_ID m_layer_id;
|
||||||
|
|
||||||
|
public:
|
||||||
|
PCB_LAYER_COLLECTOR( PCB_LAYER_ID aLayerId = UNDEFINED_LAYER ) :
|
||||||
|
m_layer_id( aLayerId )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetLayerId( PCB_LAYER_ID aLayerId ) { m_layer_id = aLayerId; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The examining function within the INSPECTOR which is passed to the iterate function.
|
||||||
|
*
|
||||||
|
* @param testItem An EDA_ITEM to examine.
|
||||||
|
* @param testData is not used in this class.
|
||||||
|
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
|
||||||
|
* else SCAN_CONTINUE;
|
||||||
|
*/
|
||||||
|
SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests a BOARD_ITEM using this class's Inspector method, which does the collection.
|
||||||
|
*
|
||||||
* @param aBoard The BOARD_ITEM to scan.
|
* @param aBoard The BOARD_ITEM to scan.
|
||||||
* @param aScanList The KICAD_Ts to gather up.
|
* @param aScanList The KICAD_Ts to gather up.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Isaac Marino Bavaresco, isaacbavaresco@yahoo.com.br
|
* Copyright (C) 2009 Isaac Marino Bavaresco, isaacbavaresco@yahoo.com.br
|
||||||
* Copyright (C) 2009 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
* Copyright (C) 2009 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
* Copyright (C) 2009 - 2015 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2009-2017 KiCad Developers, see change_log.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -32,6 +32,7 @@
|
||||||
#include <invoke_pcb_dialog.h>
|
#include <invoke_pcb_dialog.h>
|
||||||
|
|
||||||
#include <class_board.h>
|
#include <class_board.h>
|
||||||
|
#include <collectors.h>
|
||||||
|
|
||||||
#include <dialog_layers_setup_base.h>
|
#include <dialog_layers_setup_base.h>
|
||||||
|
|
||||||
|
@ -49,12 +50,12 @@
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Struct CTLs
|
* Holds the 3 UI control pointers for a single board layer.
|
||||||
* holds the 3 ui control pointers for a single board layer.
|
|
||||||
*/
|
*/
|
||||||
struct CTLs
|
struct CTLs
|
||||||
{
|
{
|
||||||
CTLs( wxControl* aName, wxCheckBox* aCheckBox, wxControl* aChoiceOrDesc, wxPanel * aPanel = NULL)
|
CTLs( wxControl* aName, wxCheckBox* aCheckBox, wxControl* aChoiceOrDesc,
|
||||||
|
wxPanel* aPanel = NULL )
|
||||||
{
|
{
|
||||||
name = aName;
|
name = aName;
|
||||||
checkbox = aCheckBox;
|
checkbox = aCheckBox;
|
||||||
|
@ -158,24 +159,28 @@ private:
|
||||||
void showLayerTypes();
|
void showLayerTypes();
|
||||||
void showPresets( LSET enabledLayerMask );
|
void showPresets( LSET enabledLayerMask );
|
||||||
|
|
||||||
/** return the selected layer mask within the UI checkboxes */
|
/** Return the selected layer mask within the UI checkboxes */
|
||||||
LSET getUILayerMask();
|
LSET getUILayerMask();
|
||||||
wxString getLayerName( LAYER_NUM layer );
|
wxString getLayerName( LAYER_NUM layer );
|
||||||
int getLayerTypeIndex( LAYER_NUM layer );
|
int getLayerTypeIndex( LAYER_NUM layer );
|
||||||
|
|
||||||
|
void OnInitDialog( wxInitDialogEvent& aEvent ) override;
|
||||||
void OnCancelButtonClick( wxCommandEvent& event ) override;
|
|
||||||
void OnOkButtonClick( wxCommandEvent& event ) override;
|
|
||||||
void OnCheckBox( wxCommandEvent& event ) override;
|
void OnCheckBox( wxCommandEvent& event ) override;
|
||||||
void DenyChangeCheckBox( wxCommandEvent& event ) override;
|
void DenyChangeCheckBox( wxCommandEvent& event ) override;
|
||||||
void OnPresetsChoice( wxCommandEvent& event ) override;
|
void OnPresetsChoice( wxCommandEvent& event ) override;
|
||||||
void OnCopperLayersChoice( wxCommandEvent& event ) override;
|
void OnCopperLayersChoice( wxCommandEvent& event ) override;
|
||||||
|
bool TransferDataToWindow() override;
|
||||||
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
bool testLayerNames();
|
bool testLayerNames();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function getCTLs
|
* Return a list of layers removed from the board that contain items.
|
||||||
* maps \a aLayerNumber to the wx IDs for that layer which are
|
*/
|
||||||
|
LSEQ getRemovedLayersWithItems();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map \a aLayerNumber to the wx IDs for that layer which are
|
||||||
* the layer name control ID, checkbox control ID, and choice control ID
|
* the layer name control ID, checkbox control ID, and choice control ID
|
||||||
*/
|
*/
|
||||||
CTLs getCTLs( LAYER_NUM aLayerNumber );
|
CTLs getCTLs( LAYER_NUM aLayerNumber );
|
||||||
|
@ -236,7 +241,8 @@ static const LSET presets[] =
|
||||||
LSET( 4, F_Cu, B_Cu, In1_Cu, In2_Cu ) | LSET::FrontTechMask() | LSET::UserMask(),
|
LSET( 4, F_Cu, B_Cu, In1_Cu, In2_Cu ) | LSET::FrontTechMask() | LSET::UserMask(),
|
||||||
|
|
||||||
// "Four layers, parts on Front and Back"
|
// "Four layers, parts on Front and Back"
|
||||||
LSET( 4, F_Cu, B_Cu, In1_Cu, In2_Cu ) | LSET::FrontTechMask() | LSET::BackTechMask() | LSET::UserMask(),
|
LSET( 4, F_Cu, B_Cu, In1_Cu, In2_Cu ) | LSET::FrontTechMask() | LSET::BackTechMask() |
|
||||||
|
LSET::UserMask(),
|
||||||
|
|
||||||
// "All layers on",
|
// "All layers on",
|
||||||
LSET().set(),
|
LSET().set(),
|
||||||
|
@ -320,30 +326,27 @@ DIALOG_LAYERS_SETUP::DIALOG_LAYERS_SETUP( wxTopLevelWindow* aParent, BOARD* aBoa
|
||||||
m_pcb = aBoard;
|
m_pcb = aBoard;
|
||||||
|
|
||||||
m_copperLayerCount = m_pcb->GetCopperLayerCount();
|
m_copperLayerCount = m_pcb->GetCopperLayerCount();
|
||||||
showCopperChoice( m_copperLayerCount );
|
|
||||||
setCopperLayerCheckBoxes( m_copperLayerCount );
|
|
||||||
m_staticTextBrdThicknessUnit->SetLabel( GetAbbreviatedUnitsLabel( g_UserUnit ) );
|
|
||||||
PutValueInLocalUnits( *m_textCtrlBrdThickness,
|
|
||||||
m_pcb->GetDesignSettings().GetBoardThickness() );
|
|
||||||
|
|
||||||
showBoardLayerNames();
|
|
||||||
|
|
||||||
m_enabledLayers = m_pcb->GetEnabledLayers();
|
m_enabledLayers = m_pcb->GetEnabledLayers();
|
||||||
showSelectedLayerCheckBoxes( m_enabledLayers );
|
|
||||||
showPresets( m_enabledLayers );
|
|
||||||
|
|
||||||
showLayerTypes();
|
|
||||||
|
|
||||||
SetAutoLayout( true );
|
SetAutoLayout( true );
|
||||||
|
|
||||||
// these 3 controls are handled outside wxformbuilder so that we can add
|
// these 3 controls are handled outside wxformbuilder so that we can add
|
||||||
// them without a sizer. Then we position them manually based on the column
|
// them without a sizer. Then we position them manually based on the column
|
||||||
// widths from m_LayerListFlexGridSizer->GetColWidths()
|
// widths from m_LayerListFlexGridSizer->GetColWidths()
|
||||||
m_nameStaticText = new wxStaticText( m_TitlePanel, wxID_ANY, _("Name"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_nameStaticText = new wxStaticText( m_TitlePanel, wxID_ANY, _( "Name" ),
|
||||||
|
wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
|
||||||
m_enabledStaticText = new wxStaticText( m_TitlePanel, wxID_ANY, _("Enabled"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_enabledStaticText = new wxStaticText( m_TitlePanel, wxID_ANY, _( "Enabled" ),
|
||||||
|
wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
|
||||||
m_typeStaticText = new wxStaticText( m_TitlePanel, wxID_ANY, _("Type"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_typeStaticText = new wxStaticText( m_TitlePanel, wxID_ANY, _( "Type" ),
|
||||||
|
wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DIALOG_LAYERS_SETUP::OnInitDialog( wxInitDialogEvent& aEvent )
|
||||||
|
{
|
||||||
|
wxWindowBase::OnInitDialog( aEvent );
|
||||||
|
|
||||||
// set the height of the title panel to be the size of any wxStaticText object
|
// set the height of the title panel to be the size of any wxStaticText object
|
||||||
// plus 10 so we can have a border of 5 on both top and bottom.
|
// plus 10 so we can have a border of 5 on both top and bottom.
|
||||||
|
@ -353,20 +356,43 @@ DIALOG_LAYERS_SETUP::DIALOG_LAYERS_SETUP( wxTopLevelWindow* aParent, BOARD* aBoa
|
||||||
|
|
||||||
Layout();
|
Layout();
|
||||||
Fit();
|
Fit();
|
||||||
moveTitles();
|
|
||||||
|
|
||||||
Center();
|
Center();
|
||||||
|
|
||||||
m_sdbSizerOK->SetFocus();
|
m_sdbSizerOK->SetFocus();
|
||||||
m_sdbSizerOK->SetDefault();
|
m_sdbSizerOK->SetDefault();
|
||||||
|
|
||||||
|
// OnSize() will fix the title spacing.
|
||||||
|
QueueEvent( new wxSizeEvent( GetSize() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool DIALOG_LAYERS_SETUP::TransferDataToWindow()
|
||||||
|
{
|
||||||
|
if( !wxDialog::TransferDataToWindow() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
showCopperChoice( m_copperLayerCount );
|
||||||
|
setCopperLayerCheckBoxes( m_copperLayerCount );
|
||||||
|
m_staticTextBrdThicknessUnit->SetLabel( GetAbbreviatedUnitsLabel( g_UserUnit ) );
|
||||||
|
PutValueInLocalUnits( *m_textCtrlBrdThickness,
|
||||||
|
m_pcb->GetDesignSettings().GetBoardThickness() );
|
||||||
|
|
||||||
|
showBoardLayerNames();
|
||||||
|
showSelectedLayerCheckBoxes( m_enabledLayers );
|
||||||
|
showPresets( m_enabledLayers );
|
||||||
|
showLayerTypes();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_LAYERS_SETUP::OnSize( wxSizeEvent& event )
|
void DIALOG_LAYERS_SETUP::OnSize( wxSizeEvent& event )
|
||||||
{
|
{
|
||||||
moveTitles();
|
moveTitles();
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_LAYERS_SETUP::showCopperChoice( int copperCount )
|
void DIALOG_LAYERS_SETUP::showCopperChoice( int copperCount )
|
||||||
{
|
{
|
||||||
if( copperCount > MAX_CU_LAYERS )
|
if( copperCount > MAX_CU_LAYERS )
|
||||||
|
@ -405,9 +431,8 @@ void DIALOG_LAYERS_SETUP::showBoardLayerNames()
|
||||||
if( ctl )
|
if( ctl )
|
||||||
{
|
{
|
||||||
wxString lname = m_pcb->GetLayerName( layer );
|
wxString lname = m_pcb->GetLayerName( layer );
|
||||||
//D(printf("layerName[%d]=%s\n", layer, TO_UTF8( lname ) );)
|
|
||||||
|
|
||||||
if( ctl->IsKindOf( CLASSINFO(wxTextCtrl) ) )
|
if( ctl->IsKindOf( CLASSINFO( wxTextCtrl ) ) )
|
||||||
((wxTextCtrl*)ctl)->SetValue( lname ); // wxTextCtrl
|
((wxTextCtrl*)ctl)->SetValue( lname ); // wxTextCtrl
|
||||||
else
|
else
|
||||||
ctl->SetLabel( lname ); // wxStaticText
|
ctl->SetLabel( lname ); // wxStaticText
|
||||||
|
@ -431,7 +456,7 @@ void DIALOG_LAYERS_SETUP::showPresets( LSET enabledLayers )
|
||||||
{
|
{
|
||||||
int presetsNdx = 0; // the "Custom" setting, matches nothing
|
int presetsNdx = 0; // the "Custom" setting, matches nothing
|
||||||
|
|
||||||
for( unsigned i=1; i<DIM(presets); ++i )
|
for( unsigned i=1; i<DIM( presets ); ++i )
|
||||||
{
|
{
|
||||||
if( enabledLayers == presets[i] )
|
if( enabledLayers == presets[i] )
|
||||||
{
|
{
|
||||||
|
@ -584,49 +609,80 @@ void DIALOG_LAYERS_SETUP::OnCopperLayersChoice( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_LAYERS_SETUP::OnCancelButtonClick( wxCommandEvent& event )
|
bool DIALOG_LAYERS_SETUP::TransferDataFromWindow()
|
||||||
{
|
{
|
||||||
EndModal( wxID_CANCEL );
|
if( !wxWindow::TransferDataFromWindow() || !testLayerNames() )
|
||||||
}
|
return false;
|
||||||
|
|
||||||
|
wxString msg;
|
||||||
|
|
||||||
void DIALOG_LAYERS_SETUP::OnOkButtonClick( wxCommandEvent& event )
|
// Make sure the board thickness is sane.
|
||||||
{
|
int thickness = ValueFromTextCtrl( *m_textCtrlBrdThickness );
|
||||||
if( testLayerNames() )
|
|
||||||
|
if( thickness < Millimeter2iu( 0.1 ) || thickness > Millimeter2iu( 10.0 ) )
|
||||||
{
|
{
|
||||||
wxString name;
|
msg.Printf( _( "Board thickness %s is out of range." ),
|
||||||
|
StringFromValue( g_UserUnit, thickness, true ) );
|
||||||
|
DisplayError( this, msg );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
m_enabledLayers = getUILayerMask();
|
// Check for removed layers with items which will get deleted from the board.
|
||||||
m_pcb->SetEnabledLayers( m_enabledLayers );
|
LSEQ removedLayers = getRemovedLayersWithItems();
|
||||||
|
|
||||||
/* Ensure enabled layers are also visible
|
if( !removedLayers.empty()
|
||||||
* This is mainly to avoid mistakes if some enabled
|
&& !IsOK( this, _( "Items have been found on removed layers. This operation will delete "
|
||||||
* layers are not visible when exiting this dialog
|
"all items from removed layers and cannot be undone. Do you wish to "
|
||||||
*/
|
"continue?" ) ) )
|
||||||
m_pcb->SetVisibleLayers( m_enabledLayers );
|
return false;
|
||||||
|
|
||||||
for( LSEQ seq = LSET::AllCuMask().Seq(); seq; ++seq )
|
// Delete all objects on layers that have been removed. Leaving them in copper layers
|
||||||
|
// can (will?) result in DRC errors and it pollutes the board file with cruft.
|
||||||
|
if( !removedLayers.empty() )
|
||||||
|
{
|
||||||
|
PCB_LAYER_COLLECTOR collector;
|
||||||
|
|
||||||
|
for( auto layer_id : removedLayers )
|
||||||
{
|
{
|
||||||
PCB_LAYER_ID layer = *seq;
|
collector.SetLayerId( layer_id );
|
||||||
|
collector.Collect( m_pcb, GENERAL_COLLECTOR::BoardLevelItems );
|
||||||
|
|
||||||
if( m_enabledLayers[layer] )
|
// Bye-bye items on on removed layer.
|
||||||
|
if( collector.GetCount() != 0 )
|
||||||
{
|
{
|
||||||
name = getLayerName( layer );
|
for( int i = 0; i < collector.GetCount(); i++ )
|
||||||
m_pcb->SetLayerName( layer, name );
|
m_pcb->Remove( collector[i] );
|
||||||
LAYER_T t = (LAYER_T) getLayerTypeIndex( layer );
|
|
||||||
m_pcb->SetLayerType( layer, t );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int thickness = ValueFromTextCtrl( *m_textCtrlBrdThickness );
|
|
||||||
|
|
||||||
// Clamp the value between reasonable values
|
|
||||||
|
|
||||||
thickness = Clamp( Millimeter2iu( 0.1 ), thickness, Millimeter2iu( 10.0 ) );
|
|
||||||
m_pcb->GetDesignSettings().SetBoardThickness( thickness );
|
|
||||||
|
|
||||||
EndModal( wxID_OK );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxString name;
|
||||||
|
|
||||||
|
m_enabledLayers = getUILayerMask();
|
||||||
|
m_pcb->SetEnabledLayers( m_enabledLayers );
|
||||||
|
|
||||||
|
/* Ensure enabled layers are also visible
|
||||||
|
* This is mainly to avoid mistakes if some enabled
|
||||||
|
* layers are not visible when exiting this dialog
|
||||||
|
*/
|
||||||
|
m_pcb->SetVisibleLayers( m_enabledLayers );
|
||||||
|
|
||||||
|
for( LSEQ seq = LSET::AllCuMask().Seq(); seq; ++seq )
|
||||||
|
{
|
||||||
|
PCB_LAYER_ID layer = *seq;
|
||||||
|
|
||||||
|
if( m_enabledLayers[layer] )
|
||||||
|
{
|
||||||
|
name = getLayerName( layer );
|
||||||
|
m_pcb->SetLayerName( layer, name );
|
||||||
|
LAYER_T t = (LAYER_T) getLayerTypeIndex( layer );
|
||||||
|
m_pcb->SetLayerType( layer, t );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_pcb->GetDesignSettings().SetBoardThickness( thickness );
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -657,8 +713,11 @@ wxString DIALOG_LAYERS_SETUP::getLayerName( LAYER_NUM aLayer )
|
||||||
static bool hasOneOf( const wxString& str, const wxString& chars )
|
static bool hasOneOf( const wxString& str, const wxString& chars )
|
||||||
{
|
{
|
||||||
for( unsigned i=0; i<chars.Len(); ++i )
|
for( unsigned i=0; i<chars.Len(); ++i )
|
||||||
|
{
|
||||||
if( str.Find( chars[i] ) != wxNOT_FOUND )
|
if( str.Find( chars[i] ) != wxNOT_FOUND )
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -679,8 +738,6 @@ bool DIALOG_LAYERS_SETUP::testLayerNames()
|
||||||
|
|
||||||
wxString name = getLayerName( layer );
|
wxString name = getLayerName( layer );
|
||||||
|
|
||||||
//D(printf("name[%d]=%s\n", layer, TO_UTF8(name) );)
|
|
||||||
|
|
||||||
ctl = (wxTextCtrl*) getName( layer );
|
ctl = (wxTextCtrl*) getName( layer );
|
||||||
|
|
||||||
// check name for legality.
|
// check name for legality.
|
||||||
|
@ -691,27 +748,27 @@ bool DIALOG_LAYERS_SETUP::testLayerNames()
|
||||||
// 5) must be unique.
|
// 5) must be unique.
|
||||||
// 6) cannot have illegal chars in filenames ( some filenames are built from layer names )
|
// 6) cannot have illegal chars in filenames ( some filenames are built from layer names )
|
||||||
// like : % $ \ " / :
|
// like : % $ \ " / :
|
||||||
|
wxString badchars = wxFileName::GetForbiddenChars( wxPATH_DOS );
|
||||||
wxString badchars = wxFileName::GetForbiddenChars(wxPATH_DOS);
|
|
||||||
badchars.Append( '%' );
|
badchars.Append( '%' );
|
||||||
|
|
||||||
if( !name )
|
if( !name )
|
||||||
{
|
{
|
||||||
DisplayError( this, _("Layer name may not be empty" ) );
|
DisplayError( this, _( "Layer name may not be empty." ) );
|
||||||
ctl->SetFocus(); // on the bad name
|
ctl->SetFocus(); // on the bad name
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( hasOneOf( name, badchars ) )
|
if( hasOneOf( name, badchars ) )
|
||||||
{
|
{
|
||||||
DisplayError( this, _("Layer name has an illegal character, one of: '") + badchars + wxT("'") );
|
DisplayError( this, _( "Layer name has an illegal character, one of: '" ) +
|
||||||
|
badchars + wxT( "'" ) );
|
||||||
ctl->SetFocus(); // on the bad name
|
ctl->SetFocus(); // on the bad name
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( name == wxT("signal") )
|
if( name == wxT( "signal" ) )
|
||||||
{
|
{
|
||||||
DisplayError( this, _("'signal' is a reserved layer name") );
|
DisplayError( this, _( "Layer name 'signal' is reserved." ) );
|
||||||
ctl->SetFocus(); // on the bad name
|
ctl->SetFocus(); // on the bad name
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -720,7 +777,7 @@ bool DIALOG_LAYERS_SETUP::testLayerNames()
|
||||||
{
|
{
|
||||||
if( name == *it )
|
if( name == *it )
|
||||||
{
|
{
|
||||||
DisplayError( this, _("Layer name is a duplicate of another") );
|
DisplayError( this, _( "Duplicate layer names are not permitted." ) );
|
||||||
ctl->SetFocus(); // on the bad name
|
ctl->SetFocus(); // on the bad name
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -733,6 +790,35 @@ bool DIALOG_LAYERS_SETUP::testLayerNames()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LSEQ DIALOG_LAYERS_SETUP::getRemovedLayersWithItems()
|
||||||
|
{
|
||||||
|
LSEQ removedLayers;
|
||||||
|
LSET newLayers = getUILayerMask();
|
||||||
|
LSET curLayers = m_pcb->GetEnabledLayers();
|
||||||
|
|
||||||
|
if( newLayers == curLayers )
|
||||||
|
return removedLayers;
|
||||||
|
|
||||||
|
PCB_LAYER_COLLECTOR collector;
|
||||||
|
LSEQ newLayerSeq = newLayers.Seq();
|
||||||
|
std::vector< PCB_LAYER_ID >::iterator it;
|
||||||
|
|
||||||
|
for( auto layer_id : curLayers.Seq() )
|
||||||
|
{
|
||||||
|
if( std::find( newLayerSeq.begin(), newLayerSeq.end(), layer_id ) == newLayerSeq.end() )
|
||||||
|
{
|
||||||
|
collector.SetLayerId( layer_id );
|
||||||
|
collector.Collect( m_pcb, GENERAL_COLLECTOR::BoardLevelItems );
|
||||||
|
|
||||||
|
if( collector.GetCount() != 0 )
|
||||||
|
removedLayers.push_back( layer_id );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return removedLayers;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool InvokeLayerSetup( wxTopLevelWindow* aCaller, BOARD* aBoard )
|
bool InvokeLayerSetup( wxTopLevelWindow* aCaller, BOARD* aBoard )
|
||||||
{
|
{
|
||||||
DIALOG_LAYERS_SETUP dlg( aCaller, aBoard );
|
DIALOG_LAYERS_SETUP dlg( aCaller, aBoard );
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,423 +1,422 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version May 6 2016)
|
// C++ code generated with wxFormBuilder (version Aug 29 2017)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef __DIALOG_LAYERS_SETUP_BASE_H__
|
#ifndef __DIALOG_LAYERS_SETUP_BASE_H__
|
||||||
#define __DIALOG_LAYERS_SETUP_BASE_H__
|
#define __DIALOG_LAYERS_SETUP_BASE_H__
|
||||||
|
|
||||||
#include <wx/artprov.h>
|
#include <wx/artprov.h>
|
||||||
#include <wx/xrc/xmlres.h>
|
#include <wx/xrc/xmlres.h>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
class DIALOG_SHIM;
|
class DIALOG_SHIM;
|
||||||
|
|
||||||
#include "dialog_shim.h"
|
#include "dialog_shim.h"
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/stattext.h>
|
#include <wx/stattext.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
#include <wx/font.h>
|
#include <wx/font.h>
|
||||||
#include <wx/colour.h>
|
#include <wx/colour.h>
|
||||||
#include <wx/settings.h>
|
#include <wx/settings.h>
|
||||||
#include <wx/choice.h>
|
#include <wx/choice.h>
|
||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
#include <wx/textctrl.h>
|
#include <wx/textctrl.h>
|
||||||
#include <wx/panel.h>
|
#include <wx/panel.h>
|
||||||
#include <wx/checkbox.h>
|
#include <wx/checkbox.h>
|
||||||
#include <wx/scrolwin.h>
|
#include <wx/scrolwin.h>
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
#include <wx/dialog.h>
|
#include <wx/dialog.h>
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#define ID_CRTYDFRONTNAME 1000
|
#define ID_CRTYDFRONTNAME 1000
|
||||||
#define ID_CRTYDFRONTCHECKBOX 1001
|
#define ID_CRTYDFRONTCHECKBOX 1001
|
||||||
#define ID_CRTYDFRONTCHOICE 1002
|
#define ID_CRTYDFRONTCHOICE 1002
|
||||||
#define ID_FABFRONTNAME 1003
|
#define ID_FABFRONTNAME 1003
|
||||||
#define ID_FABFRONTCHECKBOX 1004
|
#define ID_FABFRONTCHECKBOX 1004
|
||||||
#define ID_FABFRONTCHOICE 1005
|
#define ID_FABFRONTCHOICE 1005
|
||||||
#define ID_ADHESFRONTNAME 1006
|
#define ID_ADHESFRONTNAME 1006
|
||||||
#define ID_ADHESFRONTCHECKBOX 1007
|
#define ID_ADHESFRONTCHECKBOX 1007
|
||||||
#define ID_ADHESFRONTCHOICE 1008
|
#define ID_ADHESFRONTCHOICE 1008
|
||||||
#define ID_SOLDPFRONTNAME 1009
|
#define ID_SOLDPFRONTNAME 1009
|
||||||
#define ID_SOLDPFRONTCHECKBOX 1010
|
#define ID_SOLDPFRONTCHECKBOX 1010
|
||||||
#define ID_SOLDPFRONTCHOICE 1011
|
#define ID_SOLDPFRONTCHOICE 1011
|
||||||
#define ID_SILKSFRONTNAME 1012
|
#define ID_SILKSFRONTNAME 1012
|
||||||
#define ID_SILKSFRONTCHECKBOX 1013
|
#define ID_SILKSFRONTCHECKBOX 1013
|
||||||
#define ID_SILKSFRONTCHOICE 1014
|
#define ID_SILKSFRONTCHOICE 1014
|
||||||
#define ID_MASKFRONTNAME 1015
|
#define ID_MASKFRONTNAME 1015
|
||||||
#define ID_MASKFRONTCHECKBOX 1016
|
#define ID_MASKFRONTCHECKBOX 1016
|
||||||
#define ID_MASKFRONTCHOICE 1017
|
#define ID_MASKFRONTCHOICE 1017
|
||||||
#define ID_FRONTNAME 1018
|
#define ID_FRONTNAME 1018
|
||||||
#define ID_FRONTCHECKBOX 1019
|
#define ID_FRONTCHECKBOX 1019
|
||||||
#define ID_FRONTCHOICE 1020
|
#define ID_FRONTCHOICE 1020
|
||||||
#define ID_IN1NAME 1021
|
#define ID_IN1NAME 1021
|
||||||
#define ID_IN1CHECKBOX 1022
|
#define ID_IN1CHECKBOX 1022
|
||||||
#define ID_IN1CHOICE 1023
|
#define ID_IN1CHOICE 1023
|
||||||
#define ID_IN2NAME 1024
|
#define ID_IN2NAME 1024
|
||||||
#define ID_IN2CHECKBOX 1025
|
#define ID_IN2CHECKBOX 1025
|
||||||
#define ID_IN2CHOICE 1026
|
#define ID_IN2CHOICE 1026
|
||||||
#define ID_IN3NAME 1027
|
#define ID_IN3NAME 1027
|
||||||
#define ID_IN3CHECKBOX 1028
|
#define ID_IN3CHECKBOX 1028
|
||||||
#define ID_IN3CHOICE 1029
|
#define ID_IN3CHOICE 1029
|
||||||
#define ID_IN4NAME 1030
|
#define ID_IN4NAME 1030
|
||||||
#define ID_IN4CHECKBOX 1031
|
#define ID_IN4CHECKBOX 1031
|
||||||
#define ID_IN4CHOICE 1032
|
#define ID_IN4CHOICE 1032
|
||||||
#define ID_IN5NAME 1033
|
#define ID_IN5NAME 1033
|
||||||
#define ID_IN5CHECKBOX 1034
|
#define ID_IN5CHECKBOX 1034
|
||||||
#define ID_IN5CHOICE 1035
|
#define ID_IN5CHOICE 1035
|
||||||
#define ID_IN6NAME 1036
|
#define ID_IN6NAME 1036
|
||||||
#define ID_IN6CHECKBOX 1037
|
#define ID_IN6CHECKBOX 1037
|
||||||
#define ID_IN6CHOICE 1038
|
#define ID_IN6CHOICE 1038
|
||||||
#define ID_IN7NAME 1039
|
#define ID_IN7NAME 1039
|
||||||
#define ID_IN7CHECKBOX 1040
|
#define ID_IN7CHECKBOX 1040
|
||||||
#define ID_IN7CHOICE 1041
|
#define ID_IN7CHOICE 1041
|
||||||
#define ID_IN8NAME 1042
|
#define ID_IN8NAME 1042
|
||||||
#define ID_IN8CHECKBOX 1043
|
#define ID_IN8CHECKBOX 1043
|
||||||
#define ID_IN8CHOICE 1044
|
#define ID_IN8CHOICE 1044
|
||||||
#define ID_IN9NAME 1045
|
#define ID_IN9NAME 1045
|
||||||
#define ID_IN9CHECKBOX 1046
|
#define ID_IN9CHECKBOX 1046
|
||||||
#define ID_IN9CHOICE 1047
|
#define ID_IN9CHOICE 1047
|
||||||
#define ID_IN10NAME 1048
|
#define ID_IN10NAME 1048
|
||||||
#define ID_IN10CHECKBOX 1049
|
#define ID_IN10CHECKBOX 1049
|
||||||
#define ID_IN10CHOICE 1050
|
#define ID_IN10CHOICE 1050
|
||||||
#define ID_IN11NAME 1051
|
#define ID_IN11NAME 1051
|
||||||
#define ID_IN11CHECKBOX 1052
|
#define ID_IN11CHECKBOX 1052
|
||||||
#define ID_IN11CHOICE 1053
|
#define ID_IN11CHOICE 1053
|
||||||
#define ID_IN12NAME 1054
|
#define ID_IN12NAME 1054
|
||||||
#define ID_IN12CHECKBOX 1055
|
#define ID_IN12CHECKBOX 1055
|
||||||
#define ID_IN12CHOICE 1056
|
#define ID_IN12CHOICE 1056
|
||||||
#define ID_IN13NAME 1057
|
#define ID_IN13NAME 1057
|
||||||
#define ID_IN13CHECKBOX 1058
|
#define ID_IN13CHECKBOX 1058
|
||||||
#define ID_IN13CHOICE 1059
|
#define ID_IN13CHOICE 1059
|
||||||
#define ID_IN14NAME 1060
|
#define ID_IN14NAME 1060
|
||||||
#define ID_IN14CHECKBOX 1061
|
#define ID_IN14CHECKBOX 1061
|
||||||
#define ID_IN14CHOICE 1062
|
#define ID_IN14CHOICE 1062
|
||||||
#define ID_IN15NAME 1063
|
#define ID_IN15NAME 1063
|
||||||
#define ID_IN15CHECKBOX 1064
|
#define ID_IN15CHECKBOX 1064
|
||||||
#define ID_IN15CHOICE 1065
|
#define ID_IN15CHOICE 1065
|
||||||
#define ID_IN16NAME 1066
|
#define ID_IN16NAME 1066
|
||||||
#define ID_IN16CHECKBOX 1067
|
#define ID_IN16CHECKBOX 1067
|
||||||
#define ID_IN16CHOICE 1068
|
#define ID_IN16CHOICE 1068
|
||||||
#define ID_IN17NAME 1069
|
#define ID_IN17NAME 1069
|
||||||
#define ID_IN17CHECKBOX 1070
|
#define ID_IN17CHECKBOX 1070
|
||||||
#define ID_IN17CHOICE 1071
|
#define ID_IN17CHOICE 1071
|
||||||
#define ID_IN18NAME 1072
|
#define ID_IN18NAME 1072
|
||||||
#define ID_IN18CHECKBOX 1073
|
#define ID_IN18CHECKBOX 1073
|
||||||
#define ID_IN18CHOICE 1074
|
#define ID_IN18CHOICE 1074
|
||||||
#define ID_IN19NAME 1075
|
#define ID_IN19NAME 1075
|
||||||
#define ID_IN19CHECKBOX 1076
|
#define ID_IN19CHECKBOX 1076
|
||||||
#define ID_IN19CHOICE 1077
|
#define ID_IN19CHOICE 1077
|
||||||
#define ID_IN20NAME 1078
|
#define ID_IN20NAME 1078
|
||||||
#define ID_IN20CHECKBOX 1079
|
#define ID_IN20CHECKBOX 1079
|
||||||
#define ID_IN20CHOICE 1080
|
#define ID_IN20CHOICE 1080
|
||||||
#define ID_IN21NAME 1081
|
#define ID_IN21NAME 1081
|
||||||
#define ID_IN21CHECKBOX 1082
|
#define ID_IN21CHECKBOX 1082
|
||||||
#define ID_IN21CHOICE 1083
|
#define ID_IN21CHOICE 1083
|
||||||
#define ID_IN22NAME 1084
|
#define ID_IN22NAME 1084
|
||||||
#define ID_IN22CHECKBOX 1085
|
#define ID_IN22CHECKBOX 1085
|
||||||
#define ID_IN22CHOICE 1086
|
#define ID_IN22CHOICE 1086
|
||||||
#define ID_IN23NAME 1087
|
#define ID_IN23NAME 1087
|
||||||
#define ID_IN23CHECKBOX 1088
|
#define ID_IN23CHECKBOX 1088
|
||||||
#define ID_IN24NAME 1089
|
#define ID_IN24NAME 1089
|
||||||
#define ID_IN24CHECKBOX 1090
|
#define ID_IN24CHECKBOX 1090
|
||||||
#define ID_IN24CHOICE 1091
|
#define ID_IN24CHOICE 1091
|
||||||
#define ID_IN25NAME 1092
|
#define ID_IN25NAME 1092
|
||||||
#define ID_IN25CHECKBOX 1093
|
#define ID_IN25CHECKBOX 1093
|
||||||
#define ID_IN25CHOICE 1094
|
#define ID_IN25CHOICE 1094
|
||||||
#define ID_IN26NAME 1095
|
#define ID_IN26NAME 1095
|
||||||
#define ID_IN26CHECKBOX 1096
|
#define ID_IN26CHECKBOX 1096
|
||||||
#define ID_IN26CHOICE 1097
|
#define ID_IN26CHOICE 1097
|
||||||
#define ID_IN27NAME 1098
|
#define ID_IN27NAME 1098
|
||||||
#define ID_IN27CHECKBOX 1099
|
#define ID_IN27CHECKBOX 1099
|
||||||
#define ID_IN27CHOICE 1100
|
#define ID_IN27CHOICE 1100
|
||||||
#define ID_IN28NAME 1101
|
#define ID_IN28NAME 1101
|
||||||
#define ID_IN28CHECKBOX 1102
|
#define ID_IN28CHECKBOX 1102
|
||||||
#define ID_IN28CHOICE 1103
|
#define ID_IN28CHOICE 1103
|
||||||
#define ID_IN29NAME 1104
|
#define ID_IN29NAME 1104
|
||||||
#define ID_IN29CHECKBOX 1105
|
#define ID_IN29CHECKBOX 1105
|
||||||
#define ID_IN29CHOICE 1106
|
#define ID_IN29CHOICE 1106
|
||||||
#define ID_IN30NAME 1107
|
#define ID_IN30NAME 1107
|
||||||
#define ID_IN30CHECKBOX 1108
|
#define ID_IN30CHECKBOX 1108
|
||||||
#define ID_IN30CHOICE 1109
|
#define ID_IN30CHOICE 1109
|
||||||
#define ID_BACKNAME 1110
|
#define ID_BACKNAME 1110
|
||||||
#define ID_BACKCHECKBOX 1111
|
#define ID_BACKCHECKBOX 1111
|
||||||
#define ID_BACKCHOICE 1112
|
#define ID_BACKCHOICE 1112
|
||||||
#define ID_MASKBACKNAME 1113
|
#define ID_MASKBACKNAME 1113
|
||||||
#define ID_MASKBACKCHECKBOX 1114
|
#define ID_MASKBACKCHECKBOX 1114
|
||||||
#define ID_MASKBACKCHOICE 1115
|
#define ID_MASKBACKCHOICE 1115
|
||||||
#define ID_SILKSBACKNAME 1116
|
#define ID_SILKSBACKNAME 1116
|
||||||
#define ID_SILKSBACKCHECKBOX 1117
|
#define ID_SILKSBACKCHECKBOX 1117
|
||||||
#define ID_SILKSBACKCHOICE 1118
|
#define ID_SILKSBACKCHOICE 1118
|
||||||
#define ID_SOLDPBACKNAME 1119
|
#define ID_SOLDPBACKNAME 1119
|
||||||
#define ID_SOLDPBACKCHECKBOX 1120
|
#define ID_SOLDPBACKCHECKBOX 1120
|
||||||
#define ID_SOLDPBACKCHOICE 1121
|
#define ID_SOLDPBACKCHOICE 1121
|
||||||
#define ID_ADHESBACKNAME 1122
|
#define ID_ADHESBACKNAME 1122
|
||||||
#define ID_ADHESBACKCHECKBOX 1123
|
#define ID_ADHESBACKCHECKBOX 1123
|
||||||
#define ID_ADHESBACKCHOICE 1124
|
#define ID_ADHESBACKCHOICE 1124
|
||||||
#define ID_FABBACKNAME 1125
|
#define ID_FABBACKNAME 1125
|
||||||
#define ID_FABBACKCHECKBOX 1126
|
#define ID_FABBACKCHECKBOX 1126
|
||||||
#define ID_FABBACKCHOICE 1127
|
#define ID_FABBACKCHOICE 1127
|
||||||
#define ID_CRTYDBACKNAME 1128
|
#define ID_CRTYDBACKNAME 1128
|
||||||
#define ID_CRTYDBACKCHECKBOX 1129
|
#define ID_CRTYDBACKCHECKBOX 1129
|
||||||
#define ID_CRTYDBACKCHOICE 1130
|
#define ID_CRTYDBACKCHOICE 1130
|
||||||
#define ID_PCBEDGESNAME 1131
|
#define ID_PCBEDGESNAME 1131
|
||||||
#define ID_PCBEDGESCHECKBOX 1132
|
#define ID_PCBEDGESCHECKBOX 1132
|
||||||
#define ID_PCBEDGESCHOICE 1133
|
#define ID_PCBEDGESCHOICE 1133
|
||||||
#define ID_MARGINNAME 1134
|
#define ID_MARGINNAME 1134
|
||||||
#define ID_MARGINCHECKBOX 1135
|
#define ID_MARGINCHECKBOX 1135
|
||||||
#define ID_ECO2CHOICE 1136
|
#define ID_ECO2CHOICE 1136
|
||||||
#define ID_ECO2NAME 1137
|
#define ID_ECO2NAME 1137
|
||||||
#define ID_ECO2CHECKBOX 1138
|
#define ID_ECO2CHECKBOX 1138
|
||||||
#define ID_ECO1NAME 1139
|
#define ID_ECO1NAME 1139
|
||||||
#define ID_ECO1CHECKBOX 1140
|
#define ID_ECO1CHECKBOX 1140
|
||||||
#define ID_ECO1CHOICE 1141
|
#define ID_ECO1CHOICE 1141
|
||||||
#define ID_COMMENTSNAME 1142
|
#define ID_COMMENTSNAME 1142
|
||||||
#define ID_COMMENTSCHECKBOX 1143
|
#define ID_COMMENTSCHECKBOX 1143
|
||||||
#define ID_COMMENTSCHOICE 1144
|
#define ID_COMMENTSCHOICE 1144
|
||||||
#define ID_DRAWINGSNAME 1145
|
#define ID_DRAWINGSNAME 1145
|
||||||
#define ID_DRAWINGSCHECKBOX 1146
|
#define ID_DRAWINGSCHECKBOX 1146
|
||||||
#define ID_DRAWINGSCHOICE 1147
|
#define ID_DRAWINGSCHOICE 1147
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class DIALOG_LAYERS_SETUP_BASE
|
/// Class DIALOG_LAYERS_SETUP_BASE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class DIALOG_LAYERS_SETUP_BASE : public DIALOG_SHIM
|
class DIALOG_LAYERS_SETUP_BASE : public DIALOG_SHIM
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxStaticText* m_staticTextGrouping;
|
wxStaticText* m_staticTextGrouping;
|
||||||
wxChoice* m_PresetsChoice;
|
wxChoice* m_PresetsChoice;
|
||||||
wxStaticText* m_staticTextCopperLayers;
|
wxStaticText* m_staticTextCopperLayers;
|
||||||
wxChoice* m_CopperLayersChoice;
|
wxChoice* m_CopperLayersChoice;
|
||||||
wxStaticText* m_staticTextBrdThickness;
|
wxStaticText* m_staticTextBrdThickness;
|
||||||
wxTextCtrl* m_textCtrlBrdThickness;
|
wxTextCtrl* m_textCtrlBrdThickness;
|
||||||
wxStaticText* m_staticTextBrdThicknessUnit;
|
wxStaticText* m_staticTextBrdThicknessUnit;
|
||||||
wxStaticText* m_staticTextLayers;
|
wxStaticText* m_staticTextLayers;
|
||||||
wxPanel* m_TitlePanel;
|
wxPanel* m_TitlePanel;
|
||||||
wxScrolledWindow* m_LayersListPanel;
|
wxScrolledWindow* m_LayersListPanel;
|
||||||
wxFlexGridSizer* m_LayerListFlexGridSizer;
|
wxFlexGridSizer* m_LayerListFlexGridSizer;
|
||||||
wxStaticText* m_CrtYdFrontName;
|
wxStaticText* m_CrtYdFrontName;
|
||||||
wxPanel* m_CrtYdFrontPanel;
|
wxPanel* m_CrtYdFrontPanel;
|
||||||
wxCheckBox* m_CrtYdFrontCheckBox;
|
wxCheckBox* m_CrtYdFrontCheckBox;
|
||||||
wxStaticText* m_CrtYdFrontStaticText;
|
wxStaticText* m_CrtYdFrontStaticText;
|
||||||
wxStaticText* m_FabFrontName;
|
wxStaticText* m_FabFrontName;
|
||||||
wxPanel* m_FabFrontPanel;
|
wxPanel* m_FabFrontPanel;
|
||||||
wxCheckBox* m_FabFrontCheckBox;
|
wxCheckBox* m_FabFrontCheckBox;
|
||||||
wxStaticText* m_FabFrontStaticText;
|
wxStaticText* m_FabFrontStaticText;
|
||||||
wxStaticText* m_AdhesFrontName;
|
wxStaticText* m_AdhesFrontName;
|
||||||
wxPanel* m_AdhesFrontPanel;
|
wxPanel* m_AdhesFrontPanel;
|
||||||
wxCheckBox* m_AdhesFrontCheckBox;
|
wxCheckBox* m_AdhesFrontCheckBox;
|
||||||
wxStaticText* m_AdhesFrontStaticText;
|
wxStaticText* m_AdhesFrontStaticText;
|
||||||
wxStaticText* m_SoldPFrontName;
|
wxStaticText* m_SoldPFrontName;
|
||||||
wxPanel* m_SoldPFrontPanel;
|
wxPanel* m_SoldPFrontPanel;
|
||||||
wxCheckBox* m_SoldPFrontCheckBox;
|
wxCheckBox* m_SoldPFrontCheckBox;
|
||||||
wxStaticText* m_SoldPFrontStaticText;
|
wxStaticText* m_SoldPFrontStaticText;
|
||||||
wxStaticText* m_SilkSFrontName;
|
wxStaticText* m_SilkSFrontName;
|
||||||
wxPanel* m_SilkSFrontPanel;
|
wxPanel* m_SilkSFrontPanel;
|
||||||
wxCheckBox* m_SilkSFrontCheckBox;
|
wxCheckBox* m_SilkSFrontCheckBox;
|
||||||
wxStaticText* m_SilkSFrontStaticText;
|
wxStaticText* m_SilkSFrontStaticText;
|
||||||
wxStaticText* m_MaskFrontName;
|
wxStaticText* m_MaskFrontName;
|
||||||
wxPanel* m_MaskFrontPanel;
|
wxPanel* m_MaskFrontPanel;
|
||||||
wxCheckBox* m_MaskFrontCheckBox;
|
wxCheckBox* m_MaskFrontCheckBox;
|
||||||
wxStaticText* m_MaskFrontStaticText;
|
wxStaticText* m_MaskFrontStaticText;
|
||||||
wxTextCtrl* m_FrontName;
|
wxTextCtrl* m_FrontName;
|
||||||
wxPanel* m_FrontPanel;
|
wxPanel* m_FrontPanel;
|
||||||
wxCheckBox* m_FrontCheckBox;
|
wxCheckBox* m_FrontCheckBox;
|
||||||
wxChoice* m_FrontChoice;
|
wxChoice* m_FrontChoice;
|
||||||
wxTextCtrl* m_In1Name;
|
wxTextCtrl* m_In1Name;
|
||||||
wxPanel* m_In1Panel;
|
wxPanel* m_In1Panel;
|
||||||
wxCheckBox* m_In1CheckBox;
|
wxCheckBox* m_In1CheckBox;
|
||||||
wxChoice* m_In1Choice;
|
wxChoice* m_In1Choice;
|
||||||
wxTextCtrl* m_In2Name;
|
wxTextCtrl* m_In2Name;
|
||||||
wxPanel* m_In2Panel;
|
wxPanel* m_In2Panel;
|
||||||
wxCheckBox* m_In2CheckBox;
|
wxCheckBox* m_In2CheckBox;
|
||||||
wxChoice* m_In2Choice;
|
wxChoice* m_In2Choice;
|
||||||
wxTextCtrl* m_In3Name;
|
wxTextCtrl* m_In3Name;
|
||||||
wxPanel* m_In3Panel;
|
wxPanel* m_In3Panel;
|
||||||
wxCheckBox* m_In3CheckBox;
|
wxCheckBox* m_In3CheckBox;
|
||||||
wxChoice* m_In3Choice;
|
wxChoice* m_In3Choice;
|
||||||
wxTextCtrl* m_In4Name;
|
wxTextCtrl* m_In4Name;
|
||||||
wxPanel* m_In4Panel;
|
wxPanel* m_In4Panel;
|
||||||
wxCheckBox* m_In4CheckBox;
|
wxCheckBox* m_In4CheckBox;
|
||||||
wxChoice* m_In4Choice;
|
wxChoice* m_In4Choice;
|
||||||
wxTextCtrl* m_In5Name;
|
wxTextCtrl* m_In5Name;
|
||||||
wxPanel* m_In5Panel;
|
wxPanel* m_In5Panel;
|
||||||
wxCheckBox* m_In5CheckBox;
|
wxCheckBox* m_In5CheckBox;
|
||||||
wxChoice* m_In5Choice;
|
wxChoice* m_In5Choice;
|
||||||
wxTextCtrl* m_In6Name;
|
wxTextCtrl* m_In6Name;
|
||||||
wxPanel* m_In6Panel;
|
wxPanel* m_In6Panel;
|
||||||
wxCheckBox* m_In6CheckBox;
|
wxCheckBox* m_In6CheckBox;
|
||||||
wxChoice* m_In6Choice;
|
wxChoice* m_In6Choice;
|
||||||
wxTextCtrl* m_In7Name;
|
wxTextCtrl* m_In7Name;
|
||||||
wxPanel* m_In7Panel;
|
wxPanel* m_In7Panel;
|
||||||
wxCheckBox* m_In7CheckBox;
|
wxCheckBox* m_In7CheckBox;
|
||||||
wxChoice* m_In7Choice;
|
wxChoice* m_In7Choice;
|
||||||
wxTextCtrl* m_In8Name;
|
wxTextCtrl* m_In8Name;
|
||||||
wxPanel* m_In8Panel;
|
wxPanel* m_In8Panel;
|
||||||
wxCheckBox* m_In8CheckBox;
|
wxCheckBox* m_In8CheckBox;
|
||||||
wxChoice* m_In8Choice;
|
wxChoice* m_In8Choice;
|
||||||
wxTextCtrl* m_In9Name;
|
wxTextCtrl* m_In9Name;
|
||||||
wxPanel* m_In9Panel;
|
wxPanel* m_In9Panel;
|
||||||
wxCheckBox* m_In9CheckBox;
|
wxCheckBox* m_In9CheckBox;
|
||||||
wxChoice* m_In9Choice;
|
wxChoice* m_In9Choice;
|
||||||
wxTextCtrl* m_In10Name;
|
wxTextCtrl* m_In10Name;
|
||||||
wxPanel* m_In10Panel;
|
wxPanel* m_In10Panel;
|
||||||
wxCheckBox* m_In10CheckBox;
|
wxCheckBox* m_In10CheckBox;
|
||||||
wxChoice* m_In10Choice;
|
wxChoice* m_In10Choice;
|
||||||
wxTextCtrl* m_In11Name;
|
wxTextCtrl* m_In11Name;
|
||||||
wxPanel* m_In11Panel;
|
wxPanel* m_In11Panel;
|
||||||
wxCheckBox* m_In11CheckBox;
|
wxCheckBox* m_In11CheckBox;
|
||||||
wxChoice* m_In11Choice;
|
wxChoice* m_In11Choice;
|
||||||
wxTextCtrl* m_In12Name;
|
wxTextCtrl* m_In12Name;
|
||||||
wxPanel* m_In12Panel;
|
wxPanel* m_In12Panel;
|
||||||
wxCheckBox* m_In12CheckBox;
|
wxCheckBox* m_In12CheckBox;
|
||||||
wxChoice* m_In12Choice;
|
wxChoice* m_In12Choice;
|
||||||
wxTextCtrl* m_In13Name;
|
wxTextCtrl* m_In13Name;
|
||||||
wxPanel* m_In13Panel;
|
wxPanel* m_In13Panel;
|
||||||
wxCheckBox* m_In13CheckBox;
|
wxCheckBox* m_In13CheckBox;
|
||||||
wxChoice* m_In13Choice;
|
wxChoice* m_In13Choice;
|
||||||
wxTextCtrl* m_In14Name;
|
wxTextCtrl* m_In14Name;
|
||||||
wxPanel* m_In14Panel;
|
wxPanel* m_In14Panel;
|
||||||
wxCheckBox* m_In14CheckBox;
|
wxCheckBox* m_In14CheckBox;
|
||||||
wxChoice* m_In14Choice;
|
wxChoice* m_In14Choice;
|
||||||
wxTextCtrl* m_In15Name;
|
wxTextCtrl* m_In15Name;
|
||||||
wxPanel* m_In15Panel;
|
wxPanel* m_In15Panel;
|
||||||
wxCheckBox* m_In15CheckBox;
|
wxCheckBox* m_In15CheckBox;
|
||||||
wxChoice* m_In15Choice;
|
wxChoice* m_In15Choice;
|
||||||
wxTextCtrl* m_In16Name;
|
wxTextCtrl* m_In16Name;
|
||||||
wxPanel* m_In16Panel;
|
wxPanel* m_In16Panel;
|
||||||
wxCheckBox* m_In16CheckBox;
|
wxCheckBox* m_In16CheckBox;
|
||||||
wxChoice* m_In16Choice;
|
wxChoice* m_In16Choice;
|
||||||
wxTextCtrl* m_In17Name;
|
wxTextCtrl* m_In17Name;
|
||||||
wxPanel* m_In17Panel;
|
wxPanel* m_In17Panel;
|
||||||
wxCheckBox* m_In17CheckBox;
|
wxCheckBox* m_In17CheckBox;
|
||||||
wxChoice* m_In17Choice;
|
wxChoice* m_In17Choice;
|
||||||
wxTextCtrl* m_In18Name;
|
wxTextCtrl* m_In18Name;
|
||||||
wxPanel* m_In18Panel;
|
wxPanel* m_In18Panel;
|
||||||
wxCheckBox* m_In18CheckBox;
|
wxCheckBox* m_In18CheckBox;
|
||||||
wxChoice* m_In18Choice;
|
wxChoice* m_In18Choice;
|
||||||
wxTextCtrl* m_In19Name;
|
wxTextCtrl* m_In19Name;
|
||||||
wxPanel* m_In19Panel;
|
wxPanel* m_In19Panel;
|
||||||
wxCheckBox* m_In19CheckBox;
|
wxCheckBox* m_In19CheckBox;
|
||||||
wxChoice* m_In19Choice;
|
wxChoice* m_In19Choice;
|
||||||
wxTextCtrl* m_In20Name;
|
wxTextCtrl* m_In20Name;
|
||||||
wxPanel* m_In20Panel;
|
wxPanel* m_In20Panel;
|
||||||
wxCheckBox* m_In20CheckBox;
|
wxCheckBox* m_In20CheckBox;
|
||||||
wxChoice* m_In20Choice;
|
wxChoice* m_In20Choice;
|
||||||
wxTextCtrl* m_In21Name;
|
wxTextCtrl* m_In21Name;
|
||||||
wxPanel* m_In21Panel;
|
wxPanel* m_In21Panel;
|
||||||
wxCheckBox* m_In21CheckBox;
|
wxCheckBox* m_In21CheckBox;
|
||||||
wxChoice* m_In21Choice;
|
wxChoice* m_In21Choice;
|
||||||
wxTextCtrl* m_In22Name;
|
wxTextCtrl* m_In22Name;
|
||||||
wxPanel* m_In22Panel;
|
wxPanel* m_In22Panel;
|
||||||
wxCheckBox* m_In22CheckBox;
|
wxCheckBox* m_In22CheckBox;
|
||||||
wxChoice* m_In22Choice;
|
wxChoice* m_In22Choice;
|
||||||
wxTextCtrl* m_In23Name;
|
wxTextCtrl* m_In23Name;
|
||||||
wxPanel* m_In23Panel;
|
wxPanel* m_In23Panel;
|
||||||
wxCheckBox* m_In23CheckBox;
|
wxCheckBox* m_In23CheckBox;
|
||||||
wxChoice* m_In23Choice;
|
wxChoice* m_In23Choice;
|
||||||
wxTextCtrl* m_In24Name;
|
wxTextCtrl* m_In24Name;
|
||||||
wxPanel* m_In24Panel;
|
wxPanel* m_In24Panel;
|
||||||
wxCheckBox* m_In24CheckBox;
|
wxCheckBox* m_In24CheckBox;
|
||||||
wxChoice* m_In24Choice;
|
wxChoice* m_In24Choice;
|
||||||
wxTextCtrl* m_In25Name;
|
wxTextCtrl* m_In25Name;
|
||||||
wxPanel* m_In25Panel;
|
wxPanel* m_In25Panel;
|
||||||
wxCheckBox* m_In25CheckBox;
|
wxCheckBox* m_In25CheckBox;
|
||||||
wxChoice* m_In25Choice;
|
wxChoice* m_In25Choice;
|
||||||
wxTextCtrl* m_In26Name;
|
wxTextCtrl* m_In26Name;
|
||||||
wxPanel* m_In26Panel;
|
wxPanel* m_In26Panel;
|
||||||
wxCheckBox* m_In26CheckBox;
|
wxCheckBox* m_In26CheckBox;
|
||||||
wxChoice* m_In26Choice;
|
wxChoice* m_In26Choice;
|
||||||
wxTextCtrl* m_In27Name;
|
wxTextCtrl* m_In27Name;
|
||||||
wxPanel* m_In27Panel;
|
wxPanel* m_In27Panel;
|
||||||
wxCheckBox* m_In27CheckBox;
|
wxCheckBox* m_In27CheckBox;
|
||||||
wxChoice* m_In27Choice;
|
wxChoice* m_In27Choice;
|
||||||
wxTextCtrl* m_In28Name;
|
wxTextCtrl* m_In28Name;
|
||||||
wxPanel* m_In28Panel;
|
wxPanel* m_In28Panel;
|
||||||
wxCheckBox* m_In28CheckBox;
|
wxCheckBox* m_In28CheckBox;
|
||||||
wxChoice* m_In28Choice;
|
wxChoice* m_In28Choice;
|
||||||
wxTextCtrl* m_In29Name;
|
wxTextCtrl* m_In29Name;
|
||||||
wxPanel* m_In29Panel;
|
wxPanel* m_In29Panel;
|
||||||
wxCheckBox* m_In29CheckBox;
|
wxCheckBox* m_In29CheckBox;
|
||||||
wxChoice* m_In29Choice;
|
wxChoice* m_In29Choice;
|
||||||
wxTextCtrl* m_In30Name;
|
wxTextCtrl* m_In30Name;
|
||||||
wxPanel* m_In30Panel;
|
wxPanel* m_In30Panel;
|
||||||
wxCheckBox* m_In30CheckBox;
|
wxCheckBox* m_In30CheckBox;
|
||||||
wxChoice* m_In30Choice;
|
wxChoice* m_In30Choice;
|
||||||
wxTextCtrl* m_BackName;
|
wxTextCtrl* m_BackName;
|
||||||
wxPanel* m_BackPanel;
|
wxPanel* m_BackPanel;
|
||||||
wxCheckBox* m_BackCheckBox;
|
wxCheckBox* m_BackCheckBox;
|
||||||
wxChoice* m_BackChoice;
|
wxChoice* m_BackChoice;
|
||||||
wxStaticText* m_MaskBackName;
|
wxStaticText* m_MaskBackName;
|
||||||
wxPanel* m_MaskBackPanel;
|
wxPanel* m_MaskBackPanel;
|
||||||
wxCheckBox* m_MaskBackCheckBox;
|
wxCheckBox* m_MaskBackCheckBox;
|
||||||
wxStaticText* m_MaskBackStaticText;
|
wxStaticText* m_MaskBackStaticText;
|
||||||
wxStaticText* m_SilkSBackName;
|
wxStaticText* m_SilkSBackName;
|
||||||
wxPanel* m_SilkSBackPanel;
|
wxPanel* m_SilkSBackPanel;
|
||||||
wxCheckBox* m_SilkSBackCheckBox;
|
wxCheckBox* m_SilkSBackCheckBox;
|
||||||
wxStaticText* m_SilkSBackStaticText;
|
wxStaticText* m_SilkSBackStaticText;
|
||||||
wxStaticText* m_SoldPBackName;
|
wxStaticText* m_SoldPBackName;
|
||||||
wxPanel* m_SoldPBackPanel;
|
wxPanel* m_SoldPBackPanel;
|
||||||
wxCheckBox* m_SoldPBackCheckBox;
|
wxCheckBox* m_SoldPBackCheckBox;
|
||||||
wxStaticText* m_SoldPBackStaticText;
|
wxStaticText* m_SoldPBackStaticText;
|
||||||
wxStaticText* m_AdhesBackName;
|
wxStaticText* m_AdhesBackName;
|
||||||
wxPanel* m_AdhesBackPanel;
|
wxPanel* m_AdhesBackPanel;
|
||||||
wxCheckBox* m_AdhesBackCheckBox;
|
wxCheckBox* m_AdhesBackCheckBox;
|
||||||
wxStaticText* m_AdhesBackStaticText;
|
wxStaticText* m_AdhesBackStaticText;
|
||||||
wxStaticText* m_FabBackName;
|
wxStaticText* m_FabBackName;
|
||||||
wxPanel* m_FabBackPanel;
|
wxPanel* m_FabBackPanel;
|
||||||
wxCheckBox* m_FabBackCheckBox;
|
wxCheckBox* m_FabBackCheckBox;
|
||||||
wxStaticText* m_FabBackStaticText;
|
wxStaticText* m_FabBackStaticText;
|
||||||
wxStaticText* m_CrtYdBackName;
|
wxStaticText* m_CrtYdBackName;
|
||||||
wxPanel* m_CrtYdBackPanel;
|
wxPanel* m_CrtYdBackPanel;
|
||||||
wxCheckBox* m_CrtYdBackCheckBox;
|
wxCheckBox* m_CrtYdBackCheckBox;
|
||||||
wxStaticText* m_CrtYdBackStaticText;
|
wxStaticText* m_CrtYdBackStaticText;
|
||||||
wxStaticText* m_PCBEdgesName;
|
wxStaticText* m_PCBEdgesName;
|
||||||
wxPanel* m_PCBEdgesPanel;
|
wxPanel* m_PCBEdgesPanel;
|
||||||
wxCheckBox* m_PCBEdgesCheckBox;
|
wxCheckBox* m_PCBEdgesCheckBox;
|
||||||
wxStaticText* m_PCBEdgesStaticText;
|
wxStaticText* m_PCBEdgesStaticText;
|
||||||
wxStaticText* m_MarginName;
|
wxStaticText* m_MarginName;
|
||||||
wxPanel* m_MarginPanel;
|
wxPanel* m_MarginPanel;
|
||||||
wxCheckBox* m_MarginCheckBox;
|
wxCheckBox* m_MarginCheckBox;
|
||||||
wxStaticText* m_MarginStaticText;
|
wxStaticText* m_MarginStaticText;
|
||||||
wxStaticText* m_Eco1Name;
|
wxStaticText* m_Eco1Name;
|
||||||
wxPanel* m_Eco1Panel;
|
wxPanel* m_Eco1Panel;
|
||||||
wxCheckBox* m_Eco1CheckBox;
|
wxCheckBox* m_Eco1CheckBox;
|
||||||
wxStaticText* m_Eco1StaticText;
|
wxStaticText* m_Eco1StaticText;
|
||||||
wxStaticText* m_Eco2Name;
|
wxStaticText* m_Eco2Name;
|
||||||
wxPanel* m_Eco2Panel;
|
wxPanel* m_Eco2Panel;
|
||||||
wxCheckBox* m_Eco2CheckBox;
|
wxCheckBox* m_Eco2CheckBox;
|
||||||
wxStaticText* m_Eco2StaticText;
|
wxStaticText* m_Eco2StaticText;
|
||||||
wxStaticText* m_CommentsName;
|
wxStaticText* m_CommentsName;
|
||||||
wxPanel* m_CommentsPanel;
|
wxPanel* m_CommentsPanel;
|
||||||
wxCheckBox* m_CommentsCheckBox;
|
wxCheckBox* m_CommentsCheckBox;
|
||||||
wxStaticText* m_CommentsStaticText;
|
wxStaticText* m_CommentsStaticText;
|
||||||
wxStaticText* m_DrawingsName;
|
wxStaticText* m_DrawingsName;
|
||||||
wxPanel* m_DrawingsPanel;
|
wxPanel* m_DrawingsPanel;
|
||||||
wxCheckBox* m_DrawingsCheckBox;
|
wxCheckBox* m_DrawingsCheckBox;
|
||||||
wxStaticText* m_DrawingsStaticText;
|
wxStaticText* m_DrawingsStaticText;
|
||||||
wxStdDialogButtonSizer* m_sdbSizer;
|
wxStdDialogButtonSizer* m_sdbSizer;
|
||||||
wxButton* m_sdbSizerOK;
|
wxButton* m_sdbSizerOK;
|
||||||
wxButton* m_sdbSizerCancel;
|
wxButton* m_sdbSizerCancel;
|
||||||
|
|
||||||
// Virtual event handlers, overide them in your derived class
|
// Virtual event handlers, overide them in your derived class
|
||||||
virtual void OnSize( wxSizeEvent& event ) { event.Skip(); }
|
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
|
||||||
virtual void OnPresetsChoice( wxCommandEvent& event ) { event.Skip(); }
|
virtual void OnSize( wxSizeEvent& event ) { event.Skip(); }
|
||||||
virtual void OnCopperLayersChoice( wxCommandEvent& event ) { event.Skip(); }
|
virtual void OnPresetsChoice( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void OnCheckBox( wxCommandEvent& event ) { event.Skip(); }
|
virtual void OnCopperLayersChoice( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void DenyChangeCheckBox( wxCommandEvent& event ) { event.Skip(); }
|
virtual void OnCheckBox( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); }
|
virtual void DenyChangeCheckBox( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void OnOkButtonClick( wxCommandEvent& event ) { event.Skip(); }
|
|
||||||
|
|
||||||
|
public:
|
||||||
public:
|
|
||||||
|
DIALOG_LAYERS_SETUP_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Layer Setup"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 550,600 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||||
DIALOG_LAYERS_SETUP_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Layer Setup"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 550,1580 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
~DIALOG_LAYERS_SETUP_BASE();
|
||||||
~DIALOG_LAYERS_SETUP_BASE();
|
|
||||||
|
};
|
||||||
};
|
|
||||||
|
#endif //__DIALOG_LAYERS_SETUP_BASE_H__
|
||||||
#endif //__DIALOG_LAYERS_SETUP_BASE_H__
|
|
||||||
|
|
|
@ -101,13 +101,14 @@ void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
|
||||||
cur_layer = F_Cu;
|
cur_layer = F_Cu;
|
||||||
|
|
||||||
SetActiveLayer( cur_layer );
|
SetActiveLayer( cur_layer );
|
||||||
|
|
||||||
OnModify();
|
OnModify();
|
||||||
ReCreateLayerBox();
|
ReCreateLayerBox();
|
||||||
ReFillLayerWidget();
|
ReFillLayerWidget();
|
||||||
|
|
||||||
if( IsGalCanvasActive() )
|
if( IsGalCanvasActive() )
|
||||||
static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->SyncLayersVisibility( GetBoard() );
|
static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->SyncLayersVisibility( GetBoard() );
|
||||||
|
|
||||||
|
GetCanvas()->Refresh();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue