Commit 44c01057 authored by CHARRAS's avatar CHARRAS

some enhancements. See changelog

parent 2f1b4cd1
/* XPM */
static const char * add_tracks_xpm[] = {
"16 16 16 1",
" c None",
". c #007D00",
"+ c #006100",
"@ c #004400",
"# c #007800",
"$ c #007B00",
"% c #004000",
"& c #007C00",
"* c #006500",
"= c #007A00",
"- c #004600",
"; c #D72E2E",
"> c #A32222",
", c #C22929",
"' c #D22D2D",
") c #6D1717",
" ",
"........ ",
"........+ ",
" @.# ",
" $.% ",
" &.* ",
" .= ",
" $.- ",
" ;;; ........",
" ;;;;; .......",
";;> >;, ",
";; ;' ",
";;> ;;, ",
" ;;;;;) ",
" ,',) ",
" "};
/* XPM */
#ifndef XPMMAIN
extern const char *add_tracks_xpm[];
#else
const char * add_tracks_xpm[] = {
"16 16 16 1",
" c None",
". c #007D00",
"+ c #006100",
"@ c #004400",
"# c #007800",
"$ c #007B00",
"% c #004000",
"& c #007C00",
"* c #006500",
"= c #007A00",
"- c #004600",
"; c #D72E2E",
"> c #A32222",
", c #C22929",
"' c #D22D2D",
") c #6D1717",
" ",
"........ ",
"........+ ",
" @.# ",
" $.% ",
" &.* ",
" .= ",
" $.- ",
" ;;; ........",
" ;;;;; .......",
";;> >;, ",
";; ;' ",
";;> ;;, ",
" ;;;;;) ",
" ,',) ",
" "};
#endif
/* XPM */
#ifndef XPMMAIN
extern const char *auto_track_width_xpm[];
#else
const char * auto_track_width_xpm[] = {
"16 16 14 1",
" c None",
", c #008080",
". c #00E000",
"+ c #006100",
"@ c #004400",
"# c #007800",
"$ c #007B00",
"% c #004000",
"& c #007C00",
"* c #006500",
"= c #007A00",
"- c #004600",
"x c #FF2D2D",
"o c #0000FF",
" ",
"........+ ",
".........+ ",
" @..# ",
" $.% o o ",
" &..* o ",
" xxxx..= o ",
" x xxx..- o ",
" x x ........",
" x x .......",
"x x , o ",
"x x ,, o ",
"x x,,,,,,,,,,o ",
"x x ,, o ",
"x x , o o ",
"x x "};
#endif
/* XPM */
static const char * width_segment_xpm[] = {
#ifndef XPMMAIN
extern const char *width_segment_xpm[];
#else
const char * width_segment_xpm[] = {
"16 16 3 1",
" c None",
"! c black",
......@@ -20,3 +24,4 @@ static const char * width_segment_xpm[] = {
" ! ",
" ! ",
" "};
#endif
Can somebody please come to my rescue on this one:
This was posted to the developer's list. It would be nice to get an
apology or at least a link to the posting from which he launches such an attack:
Dick, enough of this whining. The article on gnu.org is more than an opinion
piece - unless
you really don't know what/who gnu.org is. While I and others here do appreciate
contributions made by all involved, your contributions do not entitle you to the
rest of the
code base. The GPL license is not revocable. You can take your lines of the
code (and only
just what you wrote) and do what you want, but you can't take Jean Pierre's
code, even if
you have modified it, without violating the GPL.
I'm hereby asking Jean Pierre if he could please make it clear to this list if
he has ANY
intent of turning this package away from GPL for Dick or anyone else. I think
all involved
should know here and now if this is going to remain an open GPL project or not.
I don't
think anyone else here is interested in seeing kicad become a proprietary
package.
If Dick thinks he can just take the entire code base as his, I'm sure that FSF
would help
with the legal costs of stopping him. (To donate to FSF see
http://www.fsf.org/associate/support_freedom/donate )
FSF has stepped up to the plate before and stopped people from appropriating GPL
software
for their own ends. The cost of IP litigation is not cheap, so I would recommend
Dick to
talk to an IP attorney before doing something stupid.
----------------------------------------------------------------
Karl Schmidt EMail Karl@...
Transtronics, Inc. WEB http://xtronics.com
3209 West 9th Street Ph (785) 841-3089
Lawrence, KS 66049 FAX (785) 841-0434
A clear conscience is usually the sign of a bad memory.
----------------------------------------------------------------
Change Log for Kicad
......@@ -63,6 +6,16 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2008-Jan-28 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+pcbnew:
- Better criteria to find starting poind in zone filling: the filling alg. uses
pads, vias and track ends to find where start the filling.
- Added a tool + option in popup menu in track mode (select track width):
when creating a track, if activated: if we starts on an existing track,
the new track takes the width of the existing track
2008-Jan-27 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
......
libs.dynamic
CC = `wx-config --cc`
# Note: at least on Debian using gcc gives a smaller binary than using:
# `wx-config --ld`
LD = gcc
SRCSUFF = .cpp
OBJSUFF = .o
FINAL = 1
WXPATH = `wx-config --prefix`/lib
PREFIX_WX_LIBS = `wx-config --basename`
SUFFIX_WX_LIBGL = _gl-$(LIBVERSION)
LIBSTDC = -lstdc++
LIBVERSION=`wx-config --release`
WXSYSLIB= `wx-config --libs`
# attention l'ordre des libairies
LIBS = -L/usr/local/lib -L/usr/X11R6/lib\
$(EXTRALIBS) $(WXSYSLIB)\
$(LIBSTDC)
LIBS3D = -l$(PREFIX_WX_LIBS)$(SUFFIX_WX_LIBGL) -lGL -lGLU
# Sub-projects
KICAD_SUBDIRS = common 3d-viewer eeschema pcbnew cvpcb kicad gerbview wxhtml
# How to invoke make
MAKE := $(MAKE) -f makefile.gtk
# File with the libraries definitions
LIBSDEF = libs.dynamic
# Prefix, can be from command line
ifneq ($(strip $(prefix)),)
IPREFIX=$(prefix)
else
IPREFIX=/usr/local/kicad/linux
endif
# Install tool, can be from command line
ifeq ($(INSTALL),)
INSTALL=install
endif
# C Flags, can be from command line
ifeq ($(CFLAGS),)
CFLAGS=-Wall -O2
#CFLAGS=-Wall -Werror -g3
endif
CFLAGS:=$(CFLAGS) `wx-config --cxxflags`
# Linker flags (strip)
LDFLAGS = -s
export
.PHONY: $(KICAD_SUBDIRS)
all: $(KICAD_SUBDIRS)
common:
cd $@ ; $(MAKE)
3d-viewer:
cd $@ ; $(MAKE)
eeschema:
cd $@ ; $(MAKE)
pcbnew:
cd $@ ; $(MAKE)
cvpcb:
cd $@ ; $(MAKE)
kicad:
cd $@ ; $(MAKE)
gerbview:
cd $@ ; $(MAKE)
wxhtml:
cd $@ ; $(MAKE)
install:
@for d in $(KICAD_SUBDIRS); do (cd $$d && $(MAKE) install); done
clean:
@for d in $(KICAD_SUBDIRS); do (cd $$d && $(MAKE) clean); done
3d-viewer/makefile.gtk
## Makefile for 3d-viewer.a ( wxGTK - LINUX )
# Compiler flags.
CPPFLAGS = $(CFLAGS) -DPCBNEW -I../pcbnew -I ../include -I../common
include ../$(LIBSDEF)
TARGET = 3d-viewer
all: $(TARGET).a
include makefile.include
$(TARGET).a: $(OBJECTS3D) makefile.gtk makefile.include
rm -f $@
ar -rv $@ $(OBJECTS3D)
ranlib $@
clean:
-rm *.o *.a *~ .*~ core *.bak *.exe *.obj 2> /dev/null
# No install target
## Makefile for common.a
# Compiler flags.
CPPFLAGS = $(CFLAGS) -I./ -I../include
EDACPPFLAGS = $(CPPFLAGS)
all: common.a
include makefile.include
CPPFLAGS += $(EXTRACPPFLAGS)
EDACPPFLAGS = $(CPPFLAGS)
common.a: $(OBJECTS) makefile.gtk makefile.include
rm -f $@
ar -rv $@ $(OBJECTS)
ranlib $@
clean:
-rm *.o *.a *~ .*~ core *.bak *.exe *.obj 2> /dev/null
# No install target
# File: makefile
# Compiler flags.
CPPFLAGS = $(CFLAGS)
EDACPPFLAGS = $(CPPFLAGS)
include ../$(LIBSDEF)
TARGET = cvpcb
all: $(TARGET)
include makefile.include
CPPFLAGS += $(EXTRACPPFLAGS)
EDACPPFLAGS = $(CPPFLAGS)
$(TARGET): $(OBJECTS) makefile.gtk makefile.include $(EXTRALIBS) ../$(LIBSDEF) $(LIBVIEWER3D)
$(LD) $(OBJECTS) $(LDFLAGS) $(LIBS) $(LIBVIEWER3D) $(LIBS3D) -o $(TARGET)
install:
$(INSTALL) -d -m 0755 $(IPREFIX)
$(INSTALL) -m 0755 $(TARGET) $(IPREFIX)
clean:
-rm *.o *.a *~ .*~ core *.bak *.exe *.obj $(TARGET) 2> /dev/null
## Makefile for eeschema
include ../$(LIBSDEF)
TARGET = eeschema
CPPFLAGS = $(CFLAGS)
all: $(TARGET)
include makefile.include
CPPFLAGS += $(EXTRACPPFLAGS)
EDACPPFLAGS = $(CPPFLAGS)
$(TARGET): $(OBJECTS) makefile.gtk makefile.include $(EXTRALIBS) ../$(LIBSDEF)
$(LD) $(OBJECTS) $(LDFLAGS) $(LIBS) -o $(TARGET)
install:
$(INSTALL) -d -m 0755 $(IPREFIX)
$(INSTALL) -m 0755 $(TARGET) $(IPREFIX)
clean:
-rm *.o *.a *~ .*~ core *.bak *.exe *.obj $(TARGET) 2> /dev/null
## Makefile for GERBVIEW et wxGTK
# Compiler flags.
CPPFLAGS = $(CFLAGS)
EXTRALIBS = ../common/common.a
include ../$(LIBSDEF)
TARGET = gerbview
all: $(TARGET)
include makefile.include
CPPFLAGS += $(EXTRACPPFLAGS)
EDACPPFLAGS = $(CPPFLAGS)
$(TARGET): $(OBJECTS) makefile.gtk makefile.include $(EXTRALIBS) ../$(LIBSDEF)
$(LD) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $(TARGET)
install:
$(INSTALL) -d -m 0755 $(IPREFIX)
$(INSTALL) -m 0755 $(TARGET) $(IPREFIX)
clean:
-rm *.o *.a *~ .*~ core *.bak *.exe *.obj $(TARGET) 2> /dev/null
# File: makefile for kicad, wxGTK
# Compiler flags.
CPPFLAGS = $(CFLAGS)
include ../$(LIBSDEF)
TARGET = kicad
all: $(TARGET)
include makefile.include
CPPFLAGS += $(EXTRACPPFLAGS)
EDACPPFLAGS = $(CPPFLAGS)
$(TARGET): $(OBJECTS) makefile.gtk $(EXTRALIBS) ../$(LIBSDEF)
$(LD) $(OBJECTS) $(LDFLAGS) $(LIBS) -o $(TARGET)
install:
$(INSTALL) -d -m 0755 $(IPREFIX)
$(INSTALL) -m 0755 $(TARGET) $(IPREFIX)
clean:
-rm *.o *.a *~ .*~ core *.bak *.exe *.obj $(TARGET) 2> /dev/null
## Makefile for PCBNEW et wxGTK
# Compiler flags.
CPPFLAGS = $(CFLAGS)
include ../$(LIBSDEF)
TARGET = pcbnew
all: $(TARGET)
include makefile.include
CPPFLAGS += $(EXTRACPPFLAGS)
EDACPPFLAGS = $(CPPFLAGS)
$(TARGET): $(OBJECTS) makefile.gtk makefile.include $(LIBVIEWER3D) $(EXTRALIBS) ../$(LIBSDEF)
$(LD) $(LDFLAGS) $(OBJECTS) $(LIBS) $(LIBVIEWER3D) $(LIBS3D)\
-o $(TARGET)
install:
$(INSTALL) -d -m 0755 $(IPREFIX)
$(INSTALL) -m 0755 $(TARGET) $(IPREFIX)
clean:
-rm *.o *.a *~ .*~ core *.bak *.exe *.obj $(TARGET) 2> /dev/null
########################################################################
########################################################################
# Compiler flags.
CPPFLAGS = $(CFLAGS) -I./ -I../include -I../common
EXTRALIBS =
include ../$(LIBSDEF)
TARGET = wxhtml
OBJDIR =
OBJSUFF = o
.SUFFIXES: .cpp .h .o .cc
.cpp.o :
$(CC) -c $< -o $(<:.cpp=.o) $(CPPFLAGS)
DEPEND =
OBJECTS = $(TARGET).o helpfrm.o
$(TARGET): $(OBJECTS) makefile.gtk ../common/common.a ../$(LIBSDEF)
$(LD) $(OBJECTS) $(LDFLAGS) $(LIBS) -o $(TARGET)
install:
$(INSTALL) -d -m 0755 $(IPREFIX)
$(INSTALL) -m 0755 $(TARGET) $(IPREFIX)
clean:
-rm *.o *.a *~ .*~ core *.bak *.exe *.obj $(TARGET) 2> /dev/null
......@@ -60,7 +60,7 @@ IF(WIN32)
IF(MINGW)
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cvpcb_rc.o
COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR}} -I ${wxWidgets_ROOT_DIR}/include
-i ${CMAKE_CURRENT_SOURCE_DIR}/cvpcb.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/cvpcb_rc.o)
SET(CVPCB_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/cvpcb_rc.o)
......
......@@ -106,7 +106,7 @@ IF(WIN32)
IF(MINGW)
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/eeschema_rc.o
COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR}} -I ${wxWidgets_ROOT_DIR}/include
-i ${CMAKE_CURRENT_SOURCE_DIR}/eeschema.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/eeschema_rc.o)
SET(EESCHEMA_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/eeschema_rc.o)
......
......@@ -62,7 +62,7 @@ IF(WIN32)
IF(MINGW)
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/gerbview_rc.o
COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${wxWidgets_ROOT_DIR}/include
-i ${CMAKE_CURRENT_SOURCE_DIR}/gerbview.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/gerbview_rc.o)
SET(GERBVIEW_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/gerbview_rc.o)
......
......@@ -186,7 +186,10 @@
#include "../bitmaps/transistor.xpm"
#include "../bitmaps/kicad_icon_small.xpm"
#include "../bitmaps/general_ratsnet.xpm"
#include "../bitmaps/Add_Tracks.xpm"
#include "../bitmaps/Auto_track_width.xpm"
#include "../bitmaps/fill_zone.xpm"
#include "../bitmaps/Width_Segment.xpm"
// Largeur du toolbar vertical
#define VTOOLBAR_WIDTH 26
......
......@@ -548,17 +548,17 @@ enum main_id {
ID_POPUP_PCB_DELETE_TRACKNET,
ID_POPUP_PCB_DELETE_TRACK_MNU,
ID_POPUP_PCB_EDIT_ZONE_PARAMS,
ID_POPUP_PCB_DELETE_ZONE,
ID_POPUP_PCB_MOVE_ZONE_CORNER,
ID_POPUP_PCB_ADD_ZONE_CORNER,
ID_POPUP_PCB_DELETE_ZONE_CORNER,
ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE,
ID_POPUP_PCB_PLACE_ZONE_CORNER,
ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER,
ID_POPUP_PCB_EDIT_ZONE_PARAMS,
ID_POPUP_PCB_DELETE_ZONE,
ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE,
ID_POPUP_PCB_FILL_ALL_ZONES,
ID_POPUP_PCB_FILL_ZONE,
ID_POPUP_PCB_DELETE_ZONE_CONTAINER,
ID_POPUP_PCB_PLACE_ZONE_CORNER,
ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE,
ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE,
ID_POPUP_PCB_DELETE_ZONE_CUTOUT,
......@@ -587,6 +587,7 @@ enum main_id {
ID_POPUP_PCB_EXPORT_PAD_SETTINGS,
ID_POPUP_PCB_SELECT_WIDTH,
ID_POPUP_PCB_SELECT_AUTO_WIDTH,
ID_POPUP_PCB_SELECT_WIDTH1,
ID_POPUP_PCB_SELECT_WIDTH2,
ID_POPUP_PCB_SELECT_WIDTH3,
......@@ -731,7 +732,7 @@ enum main_id {
ID_AUX_TOOLBAR_PCB_VIA_SIZE,
ID_AUX_TOOLBAR_PCB_TRACK_WIDTH,
ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR,
ID_AUX_TOOLBAR_PCB_UNUSED2,
ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH,
ID_AUX_TOOLBAR_PCB_UNUSED3,
ID_AUX_TOOLBAR_PCB_UNUSED4,
ID_AUX_TOOLBAR_PCB_UNUSED5,
......
......@@ -79,35 +79,36 @@
/*************************************/
/* constantes de gestion des couches */
/*************************************/
#define CUIVRE_LAYER (1<<COPPER_LAYER_N) ///< bit mask for copper layer
#define LAYER_2 (1<<LAYER_N_2) ///< bit mask for layer 2
#define LAYER_3 (1<<LAYER_N_3) ///< bit mask for layer 3
#define LAYER_4 (1<<LAYER_N_4) ///< bit mask for layer 4
#define LAYER_5 (1<<LAYER_N_5) ///< bit mask for layer 5
#define LAYER_6 (1<<LAYER_N_6) ///< bit mask for layer 6
#define LAYER_7 (1<<LAYER_N_7) ///< bit mask for layer 7
#define LAYER_8 (1<<LAYER_N_8) ///< bit mask for layer 8
#define LAYER_9 (1<<LAYER_N_9) ///< bit mask for layer 9
#define LAYER_10 (1<<LAYER_N_10) ///< bit mask for layer 10
#define LAYER_11 (1<<LAYER_N_11) ///< bit mask for layer 11
#define LAYER_12 (1<<LAYER_N_12) ///< bit mask for layer 12
#define LAYER_13 (1<<LAYER_N_13) ///< bit mask for layer 13
#define LAYER_14 (1<<LAYER_N_14) ///< bit mask for layer 14
#define LAYER_15 (1<<LAYER_N_15) ///< bit mask for layer 15
#define CMP_LAYER (1<<LAYER_CMP_N) ///< bit mask for component layer
#define ADHESIVE_LAYER_CU (1<<ADHESIVE_N_CU)
#define ADHESIVE_LAYER_CMP (1<<ADHESIVE_N_CMP)
#define SOLDERPASTE_LAYER_CU (1<<SOLDERPASTE_N_CU)
#define SOLDERPASTE_LAYER_CMP (1<<SOLDERPASTE_N_CMP)
#define SILKSCREEN_LAYER_CU (1<<SILKSCREEN_N_CU)
#define SILKSCREEN_LAYER_CMP (1<<SILKSCREEN_N_CMP)
#define SOLDERMASK_LAYER_CU (1<<SOLDERMASK_N_CU)
#define SOLDERMASK_LAYER_CMP (1<<SOLDERMASK_N_CMP)
#define DRAW_LAYER (1<<DRAW_N)
#define COMMENT_LAYER (1<<COMMENT_N)
#define ECO1_LAYER (1<<ECO1_N)
#define ECO2_LAYER (1<<ECO2_N)
#define EDGE_LAYER (1<<EDGE_N)
#define CUIVRE_LAYER (1 << COPPER_LAYER_N) ///< bit mask for copper layer
#define LAYER_2 (1 << LAYER_N_2) ///< bit mask for layer 2
#define LAYER_3 (1 << LAYER_N_3) ///< bit mask for layer 3
#define LAYER_4 (1 << LAYER_N_4) ///< bit mask for layer 4
#define LAYER_5 (1 << LAYER_N_5) ///< bit mask for layer 5
#define LAYER_6 (1 << LAYER_N_6) ///< bit mask for layer 6
#define LAYER_7 (1 << LAYER_N_7) ///< bit mask for layer 7
#define LAYER_8 (1 << LAYER_N_8) ///< bit mask for layer 8
#define LAYER_9 (1 << LAYER_N_9) ///< bit mask for layer 9
#define LAYER_10 (1 << LAYER_N_10) ///< bit mask for layer 10
#define LAYER_11 (1 << LAYER_N_11) ///< bit mask for layer 11
#define LAYER_12 (1 << LAYER_N_12) ///< bit mask for layer 12
#define LAYER_13 (1 << LAYER_N_13) ///< bit mask for layer 13
#define LAYER_14 (1 << LAYER_N_14) ///< bit mask for layer 14
#define LAYER_15 (1 << LAYER_N_15) ///< bit mask for layer 15
#define CMP_LAYER (1 << LAYER_CMP_N) ///< bit mask for component layer
#define ADHESIVE_LAYER_CU (1 << ADHESIVE_N_CU)
#define ADHESIVE_LAYER_CMP (1 << ADHESIVE_N_CMP)
#define SOLDERPASTE_LAYER_CU (1 << SOLDERPASTE_N_CU)
#define SOLDERPASTE_LAYER_CMP (1 << SOLDERPASTE_N_CMP)
#define SILKSCREEN_LAYER_CU (1 << SILKSCREEN_N_CU)
#define SILKSCREEN_LAYER_CMP (1 << SILKSCREEN_N_CMP)
#define SOLDERMASK_LAYER_CU (1 << SOLDERMASK_N_CU)
#define SOLDERMASK_LAYER_CMP (1 << SOLDERMASK_N_CMP)
#define DRAW_LAYER (1 << DRAW_N)
#define COMMENT_LAYER (1 << COMMENT_N)
#define ECO1_LAYER (1 << ECO1_N)
#define ECO2_LAYER (1 << ECO2_N)
#define EDGE_LAYER (1 << EDGE_N)
// extra bits 0xE0000000
/* masques generaux : */
#define ALL_LAYERS 0x1FFFFFFF
......@@ -133,6 +134,7 @@ enum Track_Shapes {
class EQUIPOT;
class MARKER;
struct CHEVELU;
//class Ki_PageDescr;
//class DrawBlockStruct;
......@@ -150,13 +152,15 @@ class EDA_BoardDesignSettings
public:
int m_CopperLayerCount; // Number of copper layers for this design
int m_ViaDrill; // via drill (for the entire board)
int m_ViaDrillCustomValue; // via drill for vias which must have a defined drill value
int m_MicroViaDrill; // micro via drill (for the entire board)
int m_CurrentViaSize; // Current via size
int m_CurrentMicroViaSize; // Current micro via size
bool m_MicroViasAllowed; // true to allow micro vias
int m_ViaSizeHistory[HISTORY_NUMBER]; // Last HISTORY_NUMBER used via sizes
int m_CurrentViaType; // via type (BLIND, TROUGHT ...), bits 1 and 2 (not 0 and 1)
int m_CurrentViaType; // via type (VIA_BLIND_BURIED, VIA_TROUGHT VIA_MICROVIA)
int m_CurrentTrackWidth; // current track width
bool m_UseConnectedTrackWidth; // if true, when creating a new track starting on an existing track, use this track width
int m_TrackWidthHistory[HISTORY_NUMBER]; // Last HISTORY_NUMBER used track widths
int m_DrawSegmentWidth; // current graphic line width (not EDGE layer)
int m_EdgeSegmentWidth; // current graphic line width (EDGE layer only)
......@@ -165,7 +169,7 @@ public:
int m_TrackClearence; // track to track and track to pads clearance
int m_ZoneClearence; // zone to track and zone to pads clearance
int m_MaskMargin; // Solder mask margin
// Color options for screen display of the Printed Board:
int m_PcbGridColor; // Grid color
int m_LayerColor[32]; // Layer colors (tracks and graphic items)
......@@ -174,16 +178,16 @@ public:
int m_ModuleTextCUColor; // Text module color for modules on the COPPER layer
int m_ModuleTextNOVColor; // Text module color for "invisible" texts (must be BLACK if really not displayed)
int m_AnchorColor; // Anchor color for modules and texts
int m_PadCUColor; // Pad color for the COPPER side of the pad
int m_PadCMPColor; // Pad color for the COMPONENT side of the pad
// Pad color for the pads of both sides is m_PadCUColor OR m_PadCMPColor (in terms of colors)
int m_RatsnestColor; // Ratsnest color
public:
EDA_BoardDesignSettings();
/**
* Function GetVisibleLayers
* returns a bit-map of all the layers that are visible.
......@@ -212,13 +216,13 @@ public:
public:
PCB_SCREEN( int idscreen );
~PCB_SCREEN();
PCB_SCREEN* Next() { return (PCB_SCREEN*) Pnext; }
void Init();
void SetNextZoom();
void SetPreviousZoom();
void SetLastZoom();
/**
* Function GetCurItem
* returns the currently selected BOARD_ITEM, overriding BASE_SCREEN::GetCurItem().
......@@ -232,17 +236,17 @@ public:
* It is mainly used to connect BGA to the first inner layer
* And it is allowed from an external layer to the first inner layer
*/
bool IsMicroViaAcceptable(void);
bool IsMicroViaAcceptable( void );
};
/**********************************/
/* Module (Footprint) description */
/**********************************/
#include "class_pad.h" // class for pads
#include "class_edge_mod.h" // Class for footprint graphic elements
#include "class_text_mod.h" // Class for footprint fields
#include "class_module.h" // Class for the footprint
#include "class_pad.h" // class for pads
#include "class_edge_mod.h" // Class for footprint graphic elements
#include "class_text_mod.h" // Class for footprint fields
#include "class_module.h" // Class for the footprint
#include "class_equipot.h"
......@@ -271,7 +275,7 @@ public:
int DisplayModText;
bool DisplayPcbTrackFill; /* FALSE = sketch , TRUE = filled */
bool DisplayTrackIsol;
int m_DisplayViaMode; /* 0 do not show via hole,
* 1 show via hole for non default value
* 2 show all via hole */
......
No preview for this file type
This diff is collapsed.
......@@ -17,7 +17,7 @@ IF(WIN32)
IF(MINGW)
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/kicad_rc.o
COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR}} -I ${wxWidgets_ROOT_DIR}/include
-i ${CMAKE_CURRENT_SOURCE_DIR}/kicad.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/kicad_rc.o)
SET(KICAD_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/kicad_rc.o)
......
......@@ -17,8 +17,8 @@
; General Product Description Definitions
!define PRODUCT_NAME "KiCad"
!define PRODUCT_VERSION "2007.07.09"
!define PRODUCT_WEB_SITE "http://www.lis.inpg.fr/realise_au_lis/kicad/"
!define PRODUCT_VERSION "2008.01.25"
!define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/"
!define COMPANY_NAME ""
!define TRADE_MARKS ""
!define COPYRIGHT "Jean-Pierre Charras"
......@@ -272,4 +272,4 @@ Function CheckAlreadyInstalled
StrCmp $R0 "" +3
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION $(ALREADY_INSTALLED) /SD IDOK IDOK +2
Abort
FunctionEnd
\ No newline at end of file
FunctionEnd
......@@ -153,7 +153,7 @@ IF(WIN32)
IF(MINGW)
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_rc.o
COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR}} -I ${wxWidgets_ROOT_DIR}/include
-i ${CMAKE_CURRENT_SOURCE_DIR}/pcbnew.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_rc.o)
SET(PCBNEW_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_rc.o)
......
......@@ -11,9 +11,9 @@ class Pcb3D_GLCanvas;
class D_PAD : public BOARD_ITEM
{
private:
int m_NetCode; // Net number for fast comparisons
int m_NetCode; // Net number for fast comparisons
public:
wxPoint m_Pos; // pad Position on board
......@@ -27,7 +27,7 @@ public:
wxString m_Netname; /* Net Name */
int m_Masque_Layer; // Bitwise layer :1= copper layer, 15= cmp,
int m_Masque_Layer; // Bitwise layer :1= copper layer, 15= cmp,
// 2..14 = internal layers
// 16 .. 31 = technical layers
......@@ -37,7 +37,19 @@ public:
wxSize m_Drill; // Drill diam (drill shape = PAD_CIRCLE) or drill size(shape = OVAL)
// for drill shape = PAD_CIRCLE, drill diam = m_Drill.x
wxSize m_Offset; // Offset de la forme (pastilles excentrees)
wxSize m_Offset; /*This parameter is usefull only for oblong pads (it can be used for other
* shapes, but without any interest).
* this is the offset between the pad hole and the pad shape (you must
* understand here pad shape = copper area around the hole)
* Most of cases, the hole is the centre of the shape (m_Offset = 0).
* But some board designers use oblong pads with a hole moved to one of the
* oblong pad shape ends.
* In all cases the pad position is the pad hole.
* The physical shape position (used to draw it for instance) is pad
* position (m_Pos) + m_Offset.
* D_PAD::ReturnShapePos() returns the physical shape position according to
* the offset and the pad rotation.*/
wxSize m_Size; // X and Y size ( relative to orient 0)
wxSize m_DeltaSize; // delta sur formes rectangle -> trapezes
......@@ -54,6 +66,9 @@ public:
int m_physical_connexion; // variable used in rastnest computations
// handle block number in track connection
int m_zone_connexion; // variable used in rastnest computations
// handle block number in zone connection
public:
D_PAD( MODULE* parent );
D_PAD( D_PAD* pad );
......@@ -72,58 +87,59 @@ public:
{
return m_Pos;
}
void SetPosition( const wxPoint& aPos )
{
m_Pos = aPos;
}
/* remove from linked list */
void UnLink();
/* Reading and writing data on files */
int ReadDescr( FILE* File, int* LineNum = NULL );
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool Save( FILE* aFile ) const;
*/
bool Save( FILE* aFile ) const;
/* drawing functions */
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode );
void Draw3D( Pcb3D_GLCanvas* glcanvas );
// others
void SetPadName( const wxString& name ); // Change pad name
wxString ReturnStringPadName(); // Return pad name as string in a wxString
wxString ReturnStringPadName(); // Return pad name as string in a wxString
void ReturnStringPadName( wxString& text ); // Return pad name as string in a buffer
void ComputeRayon(); // compute m_Rayon, rayon du cercle exinscrit
const wxPoint ReturnShapePos(); // retourne la position
void ComputeRayon(); // compute m_Rayon, rayon du cercle exinscrit
const wxPoint ReturnShapePos(); // retourne la position
/**
* Function GetNet
* @return int - the netcode
*/
int GetNet() const { return m_NetCode; }
void SetNet( int aNetCode ) { m_NetCode = aNetCode; }
/**
* Function Display_Infos
* has knowledge about the frame and how and where to put status information
* about this object into the frame's message panel.
* Is virtual from EDA_BaseStruct.
* @param frame A WinEDA_DrawFrame in which to print status information.
*/
*/
void Display_Infos( WinEDA_DrawFrame* frame );
/**
* Function IsOnLayer
* tests to see if this object is on the given layer. Is virtual so
......@@ -132,9 +148,9 @@ public:
* @param aLayer The layer to test for.
* @return bool - true if on given layer, else false.
*/
bool IsOnLayer( int aLayer ) const;
bool IsOnLayer( int aLayer ) const;
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
......@@ -152,17 +168,18 @@ public:
{
return wxT( "PAD" );
}
/**
* Function Compare
* compares two pads and return 0 if they are equal.
* @return int - <0 if left less than right, 0 if equal, >0 if left greater than right.
*/
static int Compare( const D_PAD* padref, const D_PAD* padcmp );
static int Compare( const D_PAD* padref, const D_PAD* padcmp );
#if defined (DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
......
......@@ -127,7 +127,7 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
// Default values for designing boards
{
int ii;
static const int default_layer_color[32] = {
GREEN, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY,
LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY,
......@@ -146,11 +146,16 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
LIGHTGRAY
};
m_CopperLayerCount = 2; // Default design is a double sided board
m_ViaDrill = 250; // via drill (for the entire board)
m_CurrentViaSize = 450; // Current via size
m_CurrentViaType = VIA_THROUGH; /* via type (BLIND, TROUGHT ...), bits 1 and 2 (not 0 and 1)*/
m_CurrentTrackWidth = 170; // current track width
m_CopperLayerCount = 2; // Default design is a double sided board
m_ViaDrill = 250; // defualt via drill (for the entire board)
m_ViaDrillCustomValue = 250; // via drill for vias which must have a defined drill value
m_CurrentViaSize = 450; // Current via size
m_CurrentViaType = VIA_THROUGH; // via type (VIA_BLIND_BURIED, VIA_TROUGHT VIA_MICROVIA)
m_CurrentTrackWidth = 170; // current track width
m_UseConnectedTrackWidth = false; // if true, when creating a new track starting on an existing track, use this track width
m_MicroViaDrill = 50; // micro via drill (for the entire board)
m_CurrentMicroViaSize = 150; // Current micro via size
m_MicroViasAllowed = false; // true to allow micro vias
for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{
m_TrackWidthHistory[ii] = 0; // Last HISTORY_NUMBER used track widths
......
......@@ -399,7 +399,7 @@ void WinEDA_PcbTracksDialog::SetDisplayValue()
Internal_Unit );
PutValueInLocalUnits( *m_OptViaDrill, g_DesignSettings.m_ViaDrill, Internal_Unit );
PutValueInLocalUnits( *m_MicroViaDrillCtrl, g_DesignSettings.m_MicroViaDrill, Internal_Unit );
PutValueInLocalUnits( *m_OptCustomViaDrill, g_ViaHoleLastValue, Internal_Unit );
PutValueInLocalUnits( *m_OptCustomViaDrill, g_DesignSettings.m_ViaDrillCustomValue, Internal_Unit );
PutValueInLocalUnits( *m_OptTrackWidth, g_DesignSettings.m_CurrentTrackWidth, Internal_Unit );
PutValueInLocalUnits( *m_OptTrackClearance, g_DesignSettings.m_TrackClearence, Internal_Unit );
PutValueInLocalUnits( *m_OptMaskMargin, g_DesignSettings.m_MaskMargin, Internal_Unit );
......@@ -431,7 +431,7 @@ void WinEDA_PcbTracksDialog::AcceptPcbOptions( wxCommandEvent& event )
ReturnValueFromTextCtrl( *m_MicroViaDrillCtrl, m_Parent->m_InternalUnits );
g_DesignSettings.m_ViaDrill =
ReturnValueFromTextCtrl( *m_OptViaDrill, m_Parent->m_InternalUnits );
g_ViaHoleLastValue =
g_DesignSettings.m_ViaDrillCustomValue =
ReturnValueFromTextCtrl( *m_OptCustomViaDrill, m_Parent->m_InternalUnits );
g_DesignSettings.m_MicroViasAllowed = m_AllowMicroViaCtrl->IsChecked();
......
......@@ -84,6 +84,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_SELECT_LAYER_PAIR:
case ID_POPUP_PCB_SELECT_NO_CU_LAYER:
case ID_POPUP_PCB_SELECT_WIDTH:
case ID_POPUP_PCB_SELECT_AUTO_WIDTH:
case ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH:
case ID_POPUP_PCB_SELECT_WIDTH1:
case ID_POPUP_PCB_SELECT_WIDTH2:
case ID_POPUP_PCB_SELECT_WIDTH3:
......@@ -339,7 +341,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
GetScreen()->SetModify();
break;
case ID_POPUP_PCB_EDIT_NET:
case ID_POPUP_PCB_EDIT_NET:
if( GetCurItem() == NULL )
break;
Edit_Net_Width( &dc, ( (TRACK*) GetCurItem() )->GetNet() );
......@@ -833,7 +835,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
DisplayTrackSettings();
m_SelTrackWidthBox_Changed = FALSE;
m_SelViaSizeBox_Changed = FALSE;
}
g_DesignSettings.m_UseConnectedTrackWidth = false;
}
break;
case ID_POPUP_PCB_SELECT_WIDTH1:
......@@ -845,6 +848,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_SELECT_WIDTH7:
case ID_POPUP_PCB_SELECT_WIDTH8:
DrawPanel->MouseToCursorSchema();
g_DesignSettings.m_UseConnectedTrackWidth = false;
{
int ii = id - ID_POPUP_PCB_SELECT_WIDTH1;
g_DesignSettings.m_CurrentTrackWidth = g_DesignSettings.m_TrackWidthHistory[ii];
......@@ -852,6 +856,15 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
}
break;
case ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH:
g_DesignSettings.m_UseConnectedTrackWidth = not g_DesignSettings.m_UseConnectedTrackWidth;
break;
case ID_POPUP_PCB_SELECT_AUTO_WIDTH:
DrawPanel->MouseToCursorSchema();
g_DesignSettings.m_UseConnectedTrackWidth = true;
break;
case ID_POPUP_PCB_SELECT_VIASIZE:
break;
......
......@@ -44,7 +44,7 @@ static void Exit_Editrack( WinEDA_DrawPanel* Panel, wxDC* DC )
ShowNewTrackWhenMovingCursor( Panel, DC, FALSE );
if( g_HightLigt_Status )
frame->Hight_Light( DC );
g_HightLigth_NetCode = OldNetCodeSurbrillance;
if( OldEtatSurbrillance )
frame->Hight_Light( DC );
......@@ -59,7 +59,7 @@ static void Exit_Editrack( WinEDA_DrawPanel* Panel, wxDC* DC )
delete track;
}
}
Panel->ManageCurseur = NULL;
Panel->ForceCloseManageCurseur = NULL;
frame->SetCurItem( NULL );
......@@ -73,7 +73,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* track, wxDC* DC )
/*
* Routine d'initialisation d'un trace de piste et/ou de mise en place d'un
* nouveau point piste
*
*
* Si pas de piste en cours de trace:
* - Recherche de netname de la nouvelle piste ( pad de depart out netname
* de la piste si depart sur une ancienne piste
......@@ -84,58 +84,69 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* track, wxDC* DC )
* - si DRC OK : addition d'un nouveau point piste
*/
{
D_PAD* pt_pad = NULL;
TRACK* adr_buf = NULL, * Track;
D_PAD* pt_pad = NULL;
TRACK* TrackOnStartPoint = NULL, * Track;
int masquelayer = g_TabOneLayerMask[GetScreen()->m_Active_Layer];
EDA_BaseStruct* LockPoint;
wxPoint pos = GetScreen()->m_Curseur;
static int InitialTrackWidthValue; /* first track segment width.
* used when we are in the auto tack width mode */
DrawPanel->ManageCurseur = ShowNewTrackWhenMovingCursor;
DrawPanel->ForceCloseManageCurseur = Exit_Editrack;
if( track == NULL ) /* debut reel du trace */
if( track == NULL ) /* Starting a new track */
{
/* effacement surbrillance ancienne */
/* undrw old hightlight */
OldNetCodeSurbrillance = g_HightLigth_NetCode;
OldEtatSurbrillance = g_HightLigt_Status;
if( g_HightLigt_Status )
Hight_Light( DC );
g_FirstTrackSegment = g_CurrentTrackSegment = new TRACK( m_Pcb );
InitialTrackWidthValue = -1; // Set to "no value"
g_FirstTrackSegment = g_CurrentTrackSegment = new TRACK( m_Pcb );
g_CurrentTrackSegment->m_Flags = IS_NEW;
g_TrackSegmentCount = 1;
g_HightLigth_NetCode = 0;
/* Localisation de la pastille de reference de la piste: */
/* Search for a pad at starting point of the new track: */
LockPoint = LocateLockPoint( m_Pcb, pos, masquelayer );
if( LockPoint )
if( LockPoint ) // An item (pad or track) is found
{
if( LockPoint->Type() == TYPEPAD )
{
pt_pad = (D_PAD*) LockPoint;
/* le debut de la piste est remis sur le centre du pad */
/* A pad is found: put the starting point on pad centre */
pos = pt_pad->m_Pos;
g_HightLigth_NetCode = pt_pad->GetNet();
}
else /* le point d'accrochage est un segment */
else /* A track segment is found */
{
adr_buf = (TRACK*) LockPoint;
g_HightLigth_NetCode = adr_buf->GetNet();
CreateLockPoint( &pos.x, &pos.y, adr_buf, NULL );
TrackOnStartPoint = (TRACK*) LockPoint;
g_HightLigth_NetCode = TrackOnStartPoint->GetNet();
CreateLockPoint( &pos.x, &pos.y, TrackOnStartPoint, NULL );
}
}
build_ratsnest_pad( LockPoint, wxPoint( 0, 0 ), TRUE );
Hight_Light( DC );
g_CurrentTrackSegment->m_Flags = IS_NEW;
g_CurrentTrackSegment->m_Flags = IS_NEW;
g_CurrentTrackSegment->SetLayer( GetScreen()->m_Active_Layer );
g_CurrentTrackSegment->m_Width = g_DesignSettings.m_CurrentTrackWidth;
g_CurrentTrackSegment->m_Start = pos;
g_CurrentTrackSegment->m_End = g_CurrentTrackSegment->m_Start;
g_CurrentTrackSegment->m_Width = g_DesignSettings.m_CurrentTrackWidth;
if( g_DesignSettings.m_UseConnectedTrackWidth )
{
if( TrackOnStartPoint && TrackOnStartPoint->Type() == TYPETRACK )
{
InitialTrackWidthValue = TrackOnStartPoint->m_Width;
g_CurrentTrackSegment->m_Width = InitialTrackWidthValue;
}
}
g_CurrentTrackSegment->m_Start = pos;
g_CurrentTrackSegment->m_End = g_CurrentTrackSegment->m_Start;
g_CurrentTrackSegment->SetNet( g_HightLigth_NetCode );
if( pt_pad )
{
......@@ -143,10 +154,10 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* track, wxDC* DC )
g_CurrentTrackSegment->SetState( BEGIN_ONPAD, ON );
}
else
g_CurrentTrackSegment->start = adr_buf;
g_CurrentTrackSegment->start = TrackOnStartPoint;
if( g_TwoSegmentTrackBuild )
{
{
// Create 2 segments
g_CurrentTrackSegment = g_CurrentTrackSegment->Copy();
g_TrackSegmentCount++;
......@@ -159,7 +170,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* track, wxDC* DC )
g_CurrentTrackSegment->Display_Infos( this );
SetCurItem( g_CurrentTrackSegment );
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
if( Drc_On )
{
if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment, m_Pcb->m_Track ) )
......@@ -175,7 +186,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* track, wxDC* DC )
{
if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment, m_Pcb->m_Track ) )
return NULL;
if( g_TwoSegmentTrackBuild // We must handle 2 segments
&& g_CurrentTrackSegment->Back() )
{
......@@ -220,7 +231,10 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* track, wxDC* DC )
g_TrackSegmentCount++;
g_CurrentTrackSegment->m_Start = g_CurrentTrackSegment->m_End;
g_CurrentTrackSegment->SetLayer( GetScreen()->m_Active_Layer );
g_CurrentTrackSegment->m_Width = g_DesignSettings.m_CurrentTrackWidth;
if( !g_DesignSettings.m_UseConnectedTrackWidth )
{
g_CurrentTrackSegment->m_Width = g_DesignSettings.m_CurrentTrackWidth;
}
/* Show the new position */
ShowNewTrackWhenMovingCursor( DrawPanel, DC, FALSE );
}
......@@ -238,7 +252,7 @@ int WinEDA_PcbFrame::Add_45_degrees_Segment( wxDC* DC, TRACK* pt_segm )
/* rectifie un virage a 90 et le modifie par 2 coudes a 45
* n'opere que sur des segments horizontaux ou verticaux.
*
*
* entree : pointeur sur le segment qui vient d'etre trace
* On suppose que le segment precedent est celui qui a ete
* precedement trace
......@@ -279,7 +293,7 @@ int WinEDA_PcbFrame::Add_45_degrees_Segment( wxDC* DC, TRACK* pt_segm )
// les segments doivent etre de longueur suffisante:
if( MAX( abs( dx0 ), abs( dy0 ) ) < (pas_45 * 2) )
return 0;
if( MAX( abs( dx1 ), abs( dy1 ) ) < (pas_45 * 2) )
return 0;
......@@ -382,7 +396,7 @@ void WinEDA_PcbFrame::End_Route( TRACK* track, wxDC* DC )
if( track == NULL )
return;
if( Drc_On && BAD_DRC==m_drc->Drc( g_CurrentTrackSegment, m_Pcb->m_Track) )
if( Drc_On && BAD_DRC==m_drc->Drc( g_CurrentTrackSegment, m_Pcb->m_Track ) )
return;
/* Sauvegarde des coord du point terminal de la piste */
......@@ -512,15 +526,17 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase
/* dessin de la nouvelle piste : mise a jour du point d'arrivee */
g_CurrentTrackSegment->SetLayer( screen->m_Active_Layer );
g_CurrentTrackSegment->m_Width = g_DesignSettings.m_CurrentTrackWidth;
if( ! g_DesignSettings.m_UseConnectedTrackWidth )
g_CurrentTrackSegment->m_Width = g_DesignSettings.m_CurrentTrackWidth;
if( g_TwoSegmentTrackBuild )
{
TRACK* previous_track = (TRACK*) g_CurrentTrackSegment->Pback;
if( previous_track && (previous_track->Type() == TYPETRACK) )
{
previous_track->SetLayer( screen->m_Active_Layer );
previous_track->m_Width = g_DesignSettings.m_CurrentTrackWidth;
}
if( ! g_DesignSettings.m_UseConnectedTrackWidth )
previous_track->m_Width = g_DesignSettings.m_CurrentTrackWidth;
}
}
if( Track_45_Only )
......@@ -713,10 +729,10 @@ TRACK* DeleteNullTrackSegments( BOARD* pcb, TRACK* track, int* segmcount )
* return a pointer on the first segment (start of track list)
*/
{
TRACK* firsttrack = track;
TRACK* oldtrack;
int nn = 0;
BOARD_ITEM* LockPoint;
TRACK* firsttrack = track;
TRACK* oldtrack;
int nn = 0;
BOARD_ITEM* LockPoint;
if( track == 0 )
return NULL;
......@@ -742,7 +758,7 @@ TRACK* DeleteNullTrackSegments( BOARD* pcb, TRACK* track, int* segmcount )
*segmcount = nn;
if( nn == 0 )
return NULL; // all the new track segments have been deleted
return NULL; // all the new track segments have been deleted
// we must set the pointers on connected items and the connection status
......@@ -802,7 +818,7 @@ void EnsureEndTrackOnPad( D_PAD* Pad )
TRACK* lasttrack = g_CurrentTrackSegment;
if( !g_CurrentTrackSegment->IsNull() )
{
{
/* Must create a new segment, from track end to pad center */
g_CurrentTrackSegment = lasttrack->Copy();
g_TrackSegmentCount++;
......@@ -810,7 +826,7 @@ void EnsureEndTrackOnPad( D_PAD* Pad )
g_CurrentTrackSegment->Pback = lasttrack;
lasttrack->end = g_CurrentTrackSegment;
}
g_CurrentTrackSegment->m_End = Pad->m_Pos;
g_CurrentTrackSegment->SetState( END_ONPAD, OFF );
......
......@@ -23,7 +23,6 @@
#include "Global_Options_Pad.xpm"
#include "Delete_Pad.xpm"
#include "Export_Options_Pad.xpm"
#include "Width_Segment.xpm"
#include "Select_Layer_Pair.xpm"
/*************************************************************************/
......
......@@ -47,7 +47,6 @@
#include "Select_W_Layer.xpm"
#include "Width_Track.xpm"
#include "Width_Vias.xpm"
#include "Width_Segment.xpm"
#include "Width_Net.xpm"
#include "Width_Track_Via.xpm"
#include "Select_Layer_Pair.xpm"
......@@ -71,6 +70,16 @@ static wxMenu* Append_Track_Width_List()
double value;
trackwidth_menu = new wxMenu;
trackwidth_menu->Append( ID_POPUP_PCB_SELECT_AUTO_WIDTH,
_( "Auto Width" ),
_(
"Use the track width when starting on a track, otherwise the current track width" ),
TRUE );
if( g_DesignSettings.m_UseConnectedTrackWidth )
trackwidth_menu->Check( ID_POPUP_PCB_SELECT_AUTO_WIDTH, TRUE );
for( ii = 0; (ii < HISTORY_NUMBER) && (ii < TRACK_HISTORY_NUMBER_MAX); ii++ )
{
if( g_DesignSettings.m_TrackWidthHistory[ii] == 0 )
......@@ -84,7 +93,9 @@ static wxMenu* Append_Track_Width_List()
msg.Printf( _( "Track %.3f" ), value );
trackwidth_menu->Append( ID_POPUP_PCB_SELECT_WIDTH1 + ii, msg, wxEmptyString, TRUE );
if( g_DesignSettings.m_TrackWidthHistory[ii] == g_DesignSettings.m_CurrentTrackWidth )
if( (g_DesignSettings.m_TrackWidthHistory[ii] == g_DesignSettings.m_CurrentTrackWidth)
&& ! g_DesignSettings.m_UseConnectedTrackWidth )
trackwidth_menu->Check( ID_POPUP_PCB_SELECT_WIDTH1 + ii, TRUE );
}
......@@ -172,12 +183,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
// printf( "cursor=(%d, %d) select=(%d,%d)\n", cursorPos.x, cursorPos.y, selectPos.x, selectPos.y );
/* We can reselect another item only if there are no item being edited
* because ALL moving functions use GetCurItem(), therefore GetCurItem()
* must return the same item during moving. We know an item is moving
* if( item && (item->m_Flags != 0)) is true and after calling
* PcbGeneralLocateAndDisplay(), GetCurItem() is any arbitrary BOARD_ITEM,
* not the current item being edited. In such case we cannot call
* PcbGeneralLocateAndDisplay().
* because ALL moving functions use GetCurItem(), therefore GetCurItem()
* must return the same item during moving. We know an item is moving
* if( item && (item->m_Flags != 0)) is true and after calling
* PcbGeneralLocateAndDisplay(), GetCurItem() is any arbitrary BOARD_ITEM,
* not the current item being edited. In such case we cannot call
* PcbGeneralLocateAndDisplay().
*/
if( !item || (item->m_Flags == 0) )
{
......@@ -329,7 +340,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
wxT( "WinEDA_PcbFrame::OnRightClick() Error: illegal DrawType %d" ),
item->Type() );
DisplayError( this, msg );
SetCurItem(NULL);
SetCurItem( NULL );
break;
default:
......@@ -337,9 +348,10 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
wxT( "WinEDA_PcbFrame::OnRightClick() Error: unknown DrawType %d" ),
item->Type() );
DisplayError( this, msg );
// Attempt to clear error (but should no occurs )
if ( item->Type() >= MAX_STRUCT_TYPE_ID )
SetCurItem(NULL);
// Attempt to clear error (but should no occurs )
if( item->Type() >= MAX_STRUCT_TYPE_ID )
SetCurItem( NULL );
break;
}
......@@ -509,21 +521,26 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
ID_POPUP_PCB_VIA_EDITING, _( "Edit Via" ), edit_xpm );
ADD_MENUITEM( via_mnu, ID_POPUP_PCB_VIA_HOLE_TO_DEFAULT,
_( "Set via hole to Default" ), apply_xpm );
ADD_MENUITEM( via_mnu, ID_POPUP_PCB_VIA_HOLE_TO_VALUE, _(
"Set via hole to alt value" ), options_new_pad_xpm );
ADD_MENUITEM( via_mnu, ID_POPUP_PCB_VIA_HOLE_ENTER_VALUE,
_( "Set the via hole alt value" ), edit_xpm );
msg = _( "Set via hole to a specific value. This specfic value is currently" );
msg << wxT(" ") << ReturnStringFromValue( g_UnitMetric, g_DesignSettings.m_ViaDrillCustomValue, m_InternalUnits );
ADD_MENUITEM_WITH_HELP( via_mnu, ID_POPUP_PCB_VIA_HOLE_TO_VALUE,
_( "Set via hole to alt value" ), msg,
options_new_pad_xpm );
msg = _( "Set alt via hole value. This value is currently" );
msg << wxT(" ") << ReturnStringFromValue( g_UnitMetric, g_DesignSettings.m_ViaDrillCustomValue, m_InternalUnits );
ADD_MENUITEM_WITH_HELP( via_mnu, ID_POPUP_PCB_VIA_HOLE_ENTER_VALUE,
_( "Set the via hole alt value" ), msg, edit_xpm );
ADD_MENUITEM( via_mnu, ID_POPUP_PCB_VIA_HOLE_EXPORT, _(
"Export Via hole to alt value" ), Export_Options_Pad_xpm );
ADD_MENUITEM( via_mnu, ID_POPUP_PCB_VIA_HOLE_EXPORT_TO_OTHERS,
_( "Export via hole to others id vias" ), global_options_pad_xpm );
ADD_MENUITEM( via_mnu, ID_POPUP_PCB_VIA_HOLE_RESET_TO_DEFAULT,
_( "Set ALL via holes to default" ), apply_xpm );
if( ! Track->IsDrillDefault() )
if( !Track->IsDrillDefault() )
{
via_mnu->Enable( ID_POPUP_PCB_VIA_HOLE_EXPORT, FALSE );
}
if( g_ViaHoleLastValue <= 0 )
if( g_DesignSettings.m_ViaDrillCustomValue <= 0 )
via_mnu->Enable( ID_POPUP_PCB_VIA_HOLE_TO_VALUE, FALSE );
}
else
......@@ -563,24 +580,27 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
}
msg = AddHotkeyName( _( "Place Via" ), s_Board_Editor_Hokeys_Descr, HK_ADD_VIA );
PopMenu->Append( ID_POPUP_PCB_PLACE_VIA, msg );
// See if we can place a Micro Via (4 or more layers, and start from an external layer):
if ( GetScreen()->IsMicroViaAcceptable() )
{
msg = AddHotkeyName( _( "Place Micro Via" ), s_Board_Editor_Hokeys_Descr, HK_ADD_MICROVIA );
PopMenu->Append( ID_POPUP_PCB_PLACE_MICROVIA, msg );
}
// See if we can place a Micro Via (4 or more layers, and start from an external layer):
if( GetScreen()->IsMicroViaAcceptable() )
{
msg = AddHotkeyName( _(
"Place Micro Via" ), s_Board_Editor_Hokeys_Descr,
HK_ADD_MICROVIA );
PopMenu->Append( ID_POPUP_PCB_PLACE_MICROVIA, msg );
}
}
// track Width control :
wxMenu* track_mnu = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu,
ID_POPUP_PCB_EDIT_TRACK_MNU, _( "Change Width" ), width_track_xpm );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_EDIT_TRACKSEG,
Track->Type()==TYPEVIA ? _( "Edit Via" ) : _(
"Edit Segment" ), width_segment_xpm );
if( !flags )
wxMenu* track_mnu;
if( !flags ) // track Width control :
{
track_mnu = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu,
ID_POPUP_PCB_EDIT_TRACK_MNU, _( "Change Width" ), width_track_xpm );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_EDIT_TRACKSEG,
Track->Type()==TYPEVIA ? _( "Edit Via" ) : _( "Edit Segment" ), width_segment_xpm );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_EDIT_TRACK,
_( "Edit Track" ), width_track_xpm );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_EDIT_NET,
......@@ -644,19 +664,19 @@ void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu
{
if( edge_zone->m_Flags )
{
if( (edge_zone->m_Flags & IN_EDIT ) )
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_CORNER,
_( "Place Corner" ), apply_xpm );
else
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_OUTLINES,
_( "Place Zone" ), apply_xpm );
if( (edge_zone->m_Flags & IN_EDIT ) )
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_CORNER,
_( "Place Corner" ), apply_xpm );
else
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_OUTLINES,
_( "Place Zone" ), apply_xpm );
}
else
{
wxMenu * zones_menu = new wxMenu();
ADD_MENUITEM_WITH_SUBMENU( aPopMenu, zones_menu,
-1, _( "Zones" ), add_zone_xpm );
int index;
wxMenu* zones_menu = new wxMenu();
ADD_MENUITEM_WITH_SUBMENU( aPopMenu, zones_menu,
-1, _( "Zones" ), add_zone_xpm );
int index;
if( ( index = edge_zone->HitTestForCorner( GetScreen()->RefPos( true ) ) ) >= 0 )
{
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_MOVE_ZONE_CORNER,
......@@ -688,10 +708,10 @@ void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu
_( "Edit Zone Params" ), edit_xpm );
zones_menu->AppendSeparator();
if ( index >= 0 && edge_zone->m_Poly->IsCutoutContour( edge_zone->m_CornerSelection ) )
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CUTOUT,
_( "Delete Cutout" ), delete_xpm );
if( index >= 0 && edge_zone->m_Poly->IsCutoutContour( edge_zone->m_CornerSelection ) )
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CUTOUT,
_( "Delete Cutout" ), delete_xpm );
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CONTAINER,
_( "Delete Zone Outline" ), delete_xpm );
}
......
......@@ -114,6 +114,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_TOOL( ID_GET_NETLIST, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_DRC_CONTROL, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH, WinEDA_PcbFrame::Process_Special_Functions )
EVT_KICAD_CHOICEBOX( ID_TOOLBARH_PCB_SELECT_LAYER,
WinEDA_PcbFrame::Process_Special_Functions )
EVT_KICAD_CHOICEBOX( ID_AUX_TOOLBAR_PCB_TRACK_WIDTH,
......@@ -442,6 +443,8 @@ void WinEDA_PcbFrame::SetToolbars()
if( m_AuxiliaryToolBar )
{
wxString msg;
m_AuxiliaryToolBar->ToggleTool( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH,
g_DesignSettings.m_UseConnectedTrackWidth );
if( m_SelTrackWidthBox && m_SelTrackWidthBox_Changed )
{
m_SelTrackWidthBox_Changed = FALSE;
......
......@@ -294,8 +294,6 @@ eda_global wxString g_ViaType_Name[4]
#endif
;
eda_global int g_ViaHoleLastValue; // Last value for non default value via hole
/* couleurs des autres items des empreintes */
#if defined MAIN
int g_PadCMPColor = RED;
......
......@@ -35,7 +35,6 @@
#include "mw_Add_Line.xpm"
#include "mw_Add_Gap.xpm"
#include "mw_toolbar.xpm"
#include "Add_Tracks.xpm"
#include "Show_Zone.xpm"
#include "net_hightlight.xpm"
#include "PcbOffset.xpm"
......@@ -282,7 +281,9 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
_( "auto zoom" ) );
m_HToolBar->AddSeparator();
msg = AddHotkeyName( _( "Find components and texts" ), s_Board_Editor_Hokeys_Descr, HK_FIND_ITEM );
msg = AddHotkeyName( _(
"Find components and texts" ), s_Board_Editor_Hokeys_Descr,
HK_FIND_ITEM );
m_HToolBar->AddTool( ID_FIND_ITEMS, wxEmptyString, BITMAP( find_xpm ),
msg );
......@@ -526,6 +527,12 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar()
/****************************************************/
/* Create auxiliary horizontal toolbar
* displays:
* existing track width choice
* selection for auto track width
* existing via size choice
* grid size choice
* zoom level choice
*/
{
int ii;
......@@ -544,6 +551,13 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar()
m_AuxiliaryToolBar->AddControl( m_SelTrackWidthBox );
m_SelTrackWidthBox_Changed = TRUE;
m_AuxiliaryToolBar->AddTool( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH,
wxEmptyString,
BITMAP( auto_track_width_xpm ),
_(
"Auto track width: when starting on an existing track use its width\notherwise, use current width setting" ),
wxITEM_CHECK );
m_AuxiliaryToolBar->AddSeparator();
m_SelViaSizeBox = new WinEDAChoiceBox( m_AuxiliaryToolBar,
ID_AUX_TOOLBAR_PCB_VIA_SIZE,
......@@ -610,28 +624,29 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar()
WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
/**************************************************************************/
{
int ii, jj, ll;
unsigned lenght = 0;
bool rebuild = FALSE;
long current_mask_layer;
int ii, jj, ll;
unsigned lenght = 0;
bool rebuild = FALSE;
long current_mask_layer;
if( m_SelLayerBox == NULL )
{
if( parent == NULL )
return NULL;
m_SelLayerBox = new WinEDAChoiceBox( parent, ID_TOOLBARH_PCB_SELECT_LAYER,
wxPoint( -1, -1 ),
#if defined(__UNIX__)
// Width enough for the longest string: "Component (Page Down)"
// Maybe that string is too long?
wxSize( 230, -1 )
wxPoint( -1, -1 ),
#if defined (__UNIX__)
// Width enough for the longest string: "Component (Page Down)"
// Maybe that string is too long?
wxSize( 230, -1 )
#else
wxSize( LISTBOX_WIDTH+40, -1 )
wxSize( LISTBOX_WIDTH + 40, -1 )
#endif
);
);
parent->AddControl( m_SelLayerBox );
}
......@@ -654,8 +669,8 @@ WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
m_SelLayerBox->Clear();
for( ii = 0, jj = 0; ii <= EDGE_N; ii++ )
{
// List to append hotkeys in layer box selection
static int HK_SwitchLayer[EDGE_N+1] = {
// List to append hotkeys in layer box selection
static int HK_SwitchLayer[EDGE_N + 1] = {
HK_SWITCH_LAYER_TO_COPPER,
HK_SWITCH_LAYER_TO_INNER1,
HK_SWITCH_LAYER_TO_INNER2,
......@@ -672,7 +687,7 @@ WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
HK_SWITCH_LAYER_TO_INNER13,
HK_SWITCH_LAYER_TO_INNER14,
HK_SWITCH_LAYER_TO_COMPONENT
};
};
if( (g_TabOneLayerMask[ii] & Masque_Layer) )
{
......@@ -680,10 +695,11 @@ WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
msg = AddHotkeyName( msg, s_Board_Editor_Hokeys_Descr, HK_SwitchLayer[ii] );
m_SelLayerBox->Append( msg );
m_SelLayerBox->SetClientData( jj, (void*) ii );
lenght = max(lenght, msg.Len() );
lenght = max( lenght, msg.Len() );
jj++;
}
}
// Test me:
// int lchar = m_SelLayerBox->GetFont().GetPointSize();
// m_SelLayerBox->SetSize(wxSize(lenght * lchar,-1));
......
......@@ -43,10 +43,10 @@ void WinEDA_PcbFrame::Via_Edit_Control( wxDC* DC, int command_type, SEGVIA* via
DrawPanel->MouseToCursorSchema();
case ID_POPUP_PCB_VIA_HOLE_TO_VALUE: // Set the drill via to custom
if( (g_ViaHoleLastValue > 0) && (g_ViaHoleLastValue < via->m_Width) )
if( (g_DesignSettings.m_ViaDrillCustomValue > 0) && (g_DesignSettings.m_ViaDrillCustomValue < via->m_Width) )
{
via->Draw( DrawPanel, DC, GR_XOR );
via->SetDrillValue( g_ViaHoleLastValue );
via->SetDrillValue( g_DesignSettings.m_ViaDrillCustomValue );
via->Draw( DrawPanel, DC, GR_OR );
GetScreen()->SetModify();
}
......@@ -57,12 +57,12 @@ void WinEDA_PcbFrame::Via_Edit_Control( wxDC* DC, int command_type, SEGVIA* via
case ID_POPUP_PCB_VIA_HOLE_EXPORT: // Export the current drill value as the new custom value
if( via->GetDrillValue() > 0 )
g_ViaHoleLastValue = via->GetDrillValue();
g_DesignSettings.m_ViaDrillCustomValue = via->GetDrillValue();
break;
case ID_POPUP_PCB_VIA_HOLE_EXPORT_TO_OTHERS: // Export the current drill value to via which have the same size
if( via->GetDrillValue() > 0 )
g_ViaHoleLastValue = via->GetDrillValue();
g_DesignSettings.m_ViaDrillCustomValue = via->GetDrillValue();
via_struct = m_Pcb->m_Track;
for( ; via_struct != NULL; via_struct = (TRACK*) via_struct->Pnext )
{
......
......@@ -134,7 +134,7 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
TraceLignePcb( xi, yi, xf, yf, -1, HOLE | CELL_is_EDGE, WRITE_CELL );
}
/* Create a starting point to create the zone filling */
/* Create a starting point to create the zone filling, from pads */
LISTE_PAD* pad;
int cells_count = 0;
for( ii = 0, pad = frame->m_Pcb->m_Pads; ii < frame->m_Pcb->m_NbPads; ii++, pad++ )
......@@ -157,6 +157,42 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
}
}
/* Create a starting point to create the zone filling, from vias and tracks */
TRACK* track;
for( track = frame->m_Pcb->m_Track; track != NULL; track = track->Next() )
{
if ( ! track->IsOnLayer( GetLayer() ) ) continue;
if ( track->GetNet() != GetNet() ) continue;
wxPoint pos = track->m_Start;
if( m_Poly->TestPointInside( pos.x, pos.y ) )
{
pos -= Pcb->m_BoundaryBox.m_Pos;
ZoneStartFill.x = ( pos.x + (g_GridRoutingSize / 2) ) / g_GridRoutingSize;
ZoneStartFill.y = ( pos.y + (g_GridRoutingSize / 2) ) / g_GridRoutingSize;
BoardCell cell = GetCell( ZoneStartFill.y, ZoneStartFill.x, BOTTOM );
if ( (cell & CELL_is_EDGE) == 0 )
{
OrCell( ZoneStartFill.y, ZoneStartFill.x, BOTTOM, CELL_is_ZONE );
cells_count++;
}
}
pos = track->m_End;
if( m_Poly->TestPointInside( pos.x, pos.y ) )
{
pos -= Pcb->m_BoundaryBox.m_Pos;
ZoneStartFill.x = ( pos.x + (g_GridRoutingSize / 2) ) / g_GridRoutingSize;
ZoneStartFill.y = ( pos.y + (g_GridRoutingSize / 2) ) / g_GridRoutingSize;
BoardCell cell = GetCell( ZoneStartFill.y, ZoneStartFill.x, BOTTOM );
if ( (cell & CELL_is_EDGE) == 0 )
{
OrCell( ZoneStartFill.y, ZoneStartFill.x, BOTTOM, CELL_is_ZONE );
cells_count++;
}
}
}
if( cells_count == 0 )
{
if( verbose )
......
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////////
// Name: zones.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 25/01/2006 11:35:19
// RCS-ID:
// Copyright: GNU License
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 25/01/2006 11:35:19
#ifndef _ZONES_H_
#define _ZONES_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "zones.h"
#endif
/*!
* Includes
*/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "pcbnew.h"
#include "autorout.h"
#include "cell.h"
#include "trigo.h"
#include "protos.h"
////@begin includes
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10000
#define ID_RADIOBOX 10001
#define ID_TEXTCTRL 10006
#define ID_RADIOBOX1 10004
#define ID_RADIOBOX2 10005
#define ID_FILL_ZONE 10002
#define ID_SET_OPTIONS_ZONE 10003
#define SYMBOL_WINEDA_ZONEFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER
#define SYMBOL_WINEDA_ZONEFRAME_TITLE _("Fill Zones Options")
#define SYMBOL_WINEDA_ZONEFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_ZONEFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_ZONEFRAME_POSITION wxDefaultPosition
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* WinEDA_ZoneFrame class declaration
*/
class WinEDA_ZoneFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( WinEDA_ZoneFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
WinEDA_ZoneFrame( );
WinEDA_ZoneFrame( WinEDA_PcbFrame* parent, wxWindowID id = SYMBOL_WINEDA_ZONEFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_ZONEFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_ZONEFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_ZONEFRAME_SIZE, long style = SYMBOL_WINEDA_ZONEFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_ZONEFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_ZONEFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_ZONEFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_ZONEFRAME_SIZE, long style = SYMBOL_WINEDA_ZONEFRAME_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_ZoneFrame event handler declarations
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FILL_ZONE
void ExecFillZone( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event );
////@end WinEDA_ZoneFrame event handler declarations
////@begin WinEDA_ZoneFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_ZoneFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@begin WinEDA_ZoneFrame member variables
wxRadioBox* m_GridCtrl;
wxStaticText* m_ClearanceValueTitle;
wxTextCtrl* m_ZoneClearanceCtrl;
wxRadioBox* m_FillOpt;
wxRadioBox* m_OrientEdgesOpt;
////@end WinEDA_ZoneFrame member variables
WinEDA_PcbFrame * m_Parent;
};
#endif // _ZONES_H_
This diff is collapsed.
#include "wx/msw/wx.rc"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment