merge 1 with tip
This commit is contained in:
commit
30e251bfba
|
@ -21,6 +21,8 @@ common/pcb_plot_params_keywords.cpp
|
||||||
include/pcb_plot_params_lexer.h
|
include/pcb_plot_params_lexer.h
|
||||||
pcbnew/specctra_keywords.cpp
|
pcbnew/specctra_keywords.cpp
|
||||||
pcbnew/specctra_lexer.h
|
pcbnew/specctra_lexer.h
|
||||||
|
pcb_calculator/pcb_calculator_datafile_keywords.cpp
|
||||||
|
pcb_calculator/pcb_calculator_datafile_lexer.h
|
||||||
new/html
|
new/html
|
||||||
new/sch_lib_table_keywords.cpp
|
new/sch_lib_table_keywords.cpp
|
||||||
new/sch_lib_table_lexer.h
|
new/sch_lib_table_lexer.h
|
||||||
|
|
|
@ -35,9 +35,9 @@
|
||||||
|
|
||||||
|
|
||||||
/* 3D modeling units -> PCB units conversion scale:
|
/* 3D modeling units -> PCB units conversion scale:
|
||||||
* 1 "3D model unit" wings3d = 1 unit = 2.54 mm = 0.1 inch
|
* 1 "3D model unit" wings3d = 1 unit = 2.54 mm = 0.1 inch = 100 mils
|
||||||
*/
|
*/
|
||||||
#define UNITS3D_TO_UNITSPCB 1000
|
#define UNITS3D_TO_UNITSPCB (IU_PER_MILS * 100)
|
||||||
|
|
||||||
|
|
||||||
class S3D_MASTER;
|
class S3D_MASTER;
|
||||||
|
|
|
@ -4,6 +4,14 @@ KiCad ChangeLog 2012
|
||||||
Please add newer entries at the top, list the date and your name with
|
Please add newer entries at the top, list the date and your name with
|
||||||
email address.
|
email address.
|
||||||
|
|
||||||
|
2012-May-5 UPDATE Jerry Jacobs <jerry@xor-gate.org>
|
||||||
|
================================================================================
|
||||||
|
++ common
|
||||||
|
* Update about dialog to more native size so the notebook is not squeezed
|
||||||
|
* Increment copyright year to 2012
|
||||||
|
* Fix mousezoom jumping to center for Mac OS X and other platforms
|
||||||
|
* Remove lowercase application name because Mac OS X menubar was inconsitent
|
||||||
|
|
||||||
2012-Mar-11 UPDATE Dick Hollenbeck <dick@softplc.com>
|
2012-Mar-11 UPDATE Dick Hollenbeck <dick@softplc.com>
|
||||||
================================================================================
|
================================================================================
|
||||||
++pcbnew
|
++pcbnew
|
||||||
|
|
|
@ -278,7 +278,7 @@ add_subdirectory(polygon/kbool/src)
|
||||||
add_subdirectory(potrace)
|
add_subdirectory(potrace)
|
||||||
add_subdirectory(bitmap2component)
|
add_subdirectory(bitmap2component)
|
||||||
add_subdirectory(pcb_calculator)
|
add_subdirectory(pcb_calculator)
|
||||||
#add_subdirectory(tools)
|
add_subdirectory(tools)
|
||||||
#add_subdirectory(new)
|
#add_subdirectory(new)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -413,6 +413,7 @@ set( BMAPS_MID
|
||||||
pin_to
|
pin_to
|
||||||
pin
|
pin
|
||||||
plot_hpg
|
plot_hpg
|
||||||
|
plot_pdf
|
||||||
plot_ps
|
plot_ps
|
||||||
plot
|
plot
|
||||||
polar_coord
|
polar_coord
|
||||||
|
|
|
@ -0,0 +1,96 @@
|
||||||
|
|
||||||
|
/* Do not modify this file, it was automatically generated by the
|
||||||
|
* PNG2cpp CMake script, using a *.png file as input.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <bitmaps.h>
|
||||||
|
|
||||||
|
static const unsigned char png[] = {
|
||||||
|
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||||
|
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
|
||||||
|
0xce, 0x00, 0x00, 0x04, 0xf5, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xad, 0x96, 0x6d, 0x4c, 0x53,
|
||||||
|
0x57, 0x18, 0xc7, 0x99, 0x31, 0xc3, 0x39, 0x60, 0xd9, 0x3e, 0xcc, 0x4f, 0xc6, 0xcc, 0x4f, 0xcb,
|
||||||
|
0x0c, 0x7c, 0x11, 0x26, 0x03, 0x17, 0xb6, 0x25, 0x3a, 0xd1, 0x31, 0x62, 0x06, 0x73, 0x46, 0x64,
|
||||||
|
0xb0, 0x4c, 0xe7, 0x46, 0x47, 0x41, 0x29, 0xef, 0xb4, 0xbc, 0x96, 0x81, 0x03, 0x9d, 0x10, 0x44,
|
||||||
|
0x88, 0x56, 0x5e, 0x94, 0xa9, 0x0c, 0x3a, 0x5e, 0x0a, 0x13, 0x10, 0x0b, 0x85, 0x19, 0xc3, 0x5a,
|
||||||
|
0xa5, 0x50, 0x6a, 0xa1, 0xaf, 0x40, 0xa1, 0xa5, 0x16, 0x0a, 0x05, 0x24, 0x0a, 0xff, 0x9d, 0x7b,
|
||||||
|
0xa1, 0x8d, 0x82, 0x46, 0xd6, 0xf9, 0x24, 0xbf, 0xf4, 0xf6, 0x9c, 0xdc, 0xff, 0xff, 0x9c, 0xe7,
|
||||||
|
0x3c, 0xf7, 0xb9, 0xd7, 0x09, 0x80, 0xd3, 0x7a, 0x88, 0x89, 0x8b, 0xd9, 0xd3, 0xf3, 0x4f, 0x8f,
|
||||||
|
0xe0, 0xd7, 0xfc, 0x9c, 0xa8, 0x5f, 0x72, 0xb3, 0x4e, 0x66, 0x9f, 0xe6, 0xc6, 0x92, 0xdf, 0xc4,
|
||||||
|
0xce, 0x4e, 0x61, 0xf5, 0x29, 0xd6, 0x29, 0xd6, 0xcb, 0xee, 0x77, 0x5a, 0xaf, 0x11, 0x2b, 0x81,
|
||||||
|
0x95, 0xd0, 0xd5, 0x2d, 0xba, 0x42, 0xc4, 0xe3, 0x13, 0x53, 0xe2, 0xf3, 0x62, 0x13, 0x62, 0x0b,
|
||||||
|
0xc8, 0x75, 0x66, 0x75, 0xf5, 0xf5, 0x4b, 0x69, 0x19, 0x69, 0xe7, 0x5f, 0x99, 0x11, 0x27, 0x9d,
|
||||||
|
0x53, 0xd0, 0x7c, 0x53, 0x70, 0x89, 0x88, 0xa7, 0x1f, 0x0d, 0x0f, 0xcb, 0xff, 0x26, 0xe4, 0x48,
|
||||||
|
0x7a, 0x26, 0x37, 0xe3, 0x37, 0xde, 0xe5, 0x52, 0x5e, 0x66, 0x36, 0xb7, 0xca, 0x61, 0xa3, 0xd4,
|
||||||
|
0xd4, 0xd4, 0x4d, 0xb5, 0xfc, 0x1b, 0x0d, 0xed, 0xb7, 0xdb, 0xc4, 0xb7, 0xda, 0xdb, 0xc4, 0x8d,
|
||||||
|
0x4d, 0x0d, 0x13, 0xad, 0xb7, 0x5a, 0xcc, 0xcd, 0x7f, 0x09, 0x0c, 0x75, 0x0d, 0x75, 0x63, 0x8d,
|
||||||
|
0x82, 0x7a, 0x0d, 0xc1, 0x44, 0xfe, 0x9b, 0xeb, 0x1b, 0xeb, 0x26, 0x5b, 0xdb, 0x5a, 0xc4, 0x14,
|
||||||
|
0xfc, 0xfa, 0x1a, 0x51, 0x56, 0x56, 0xd6, 0x96, 0x75, 0x1b, 0x5d, 0x28, 0x39, 0x9f, 0x3f, 0x3b,
|
||||||
|
0x37, 0xbb, 0x34, 0x3b, 0x6b, 0x85, 0xd5, 0x3a, 0x83, 0x99, 0x99, 0x69, 0x4c, 0xcf, 0x58, 0x60,
|
||||||
|
0x99, 0x26, 0x58, 0xa6, 0x30, 0x65, 0x99, 0xc4, 0xe4, 0x94, 0x19, 0xe6, 0xc9, 0x87, 0x78, 0x68,
|
||||||
|
0x26, 0x3c, 0x9c, 0x80, 0x89, 0x30, 0x4d, 0xe6, 0xab, 0xae, 0x55, 0xb6, 0xbe, 0xd4, 0x88, 0xa4,
|
||||||
|
0xe6, 0x35, 0xc2, 0xa6, 0x0b, 0xa5, 0xc5, 0xbc, 0xb9, 0xb9, 0x59, 0xfa, 0xe6, 0x89, 0x09, 0x03,
|
||||||
|
0x0c, 0xc6, 0x71, 0x8c, 0x1b, 0xc6, 0x30, 0x36, 0xae, 0x87, 0x7e, 0x6c, 0x04, 0xa3, 0xfa, 0x61,
|
||||||
|
0x0c, 0x8f, 0xea, 0xa0, 0x1b, 0xd1, 0x42, 0xab, 0x53, 0x43, 0xa3, 0x55, 0x41, 0xad, 0x51, 0x62,
|
||||||
|
0xc2, 0x64, 0x44, 0x0d, 0xff, 0x86, 0x88, 0xd2, 0x20, 0x6c, 0x78, 0xae, 0x11, 0x35, 0x71, 0xb5,
|
||||||
|
0xaa, 0xa2, 0x43, 0xa1, 0x90, 0x5b, 0xce, 0x16, 0x9c, 0x7d, 0x62, 0x30, 0x8c, 0x43, 0xa9, 0x1a,
|
||||||
|
0xc2, 0x90, 0x52, 0x01, 0xc5, 0xd0, 0x03, 0x3c, 0x50, 0xc8, 0x21, 0x7f, 0x30, 0x80, 0x01, 0xb9,
|
||||||
|
0x0c, 0xb2, 0x81, 0x7e, 0xc8, 0x64, 0x7d, 0xe8, 0x93, 0x49, 0x21, 0xed, 0xbf, 0x8f, 0x5e, 0xe9,
|
||||||
|
0x3d, 0xdc, 0xef, 0x95, 0x40, 0xa5, 0x56, 0xe2, 0xd2, 0xe5, 0x8b, 0x8b, 0x7d, 0xfd, 0x52, 0x0b,
|
||||||
|
0xff, 0xcf, 0x9a, 0x7e, 0xa2, 0xf9, 0xe6, 0x1a, 0xa3, 0x8b, 0xbc, 0xd2, 0xc2, 0xa9, 0xa9, 0xc9,
|
||||||
|
0x27, 0x46, 0xb2, 0xfa, 0xef, 0x4e, 0x1c, 0x47, 0x54, 0x4c, 0x0c, 0x58, 0x09, 0x09, 0x88, 0xa5,
|
||||||
|
0x48, 0xa4, 0x48, 0x44, 0x9c, 0x8d, 0xa4, 0x24, 0x9a, 0x78, 0x1b, 0xc9, 0xc9, 0x48, 0x48, 0x49,
|
||||||
|
0x26, 0xd7, 0xc9, 0x88, 0x60, 0x46, 0xa2, 0xab, 0xbb, 0x9b, 0x4e, 0x39, 0x59, 0x78, 0xcb, 0x33,
|
||||||
|
0x46, 0xe4, 0xf9, 0x70, 0x1f, 0x1a, 0x52, 0x58, 0x2c, 0x24, 0xf7, 0x54, 0x8a, 0xc2, 0x8f, 0x1d,
|
||||||
|
0x43, 0x4a, 0x1a, 0x7b, 0x5d, 0xb0, 0xd3, 0x38, 0xcb, 0xa4, 0xb3, 0x41, 0xaa, 0x13, 0x27, 0x18,
|
||||||
|
0x0c, 0x88, 0xba, 0x44, 0x98, 0x24, 0xe7, 0x67, 0x30, 0x1a, 0x16, 0xce, 0x15, 0x9e, 0x39, 0x6a,
|
||||||
|
0x37, 0xaa, 0xe5, 0xff, 0x21, 0xa1, 0x56, 0x60, 0x36, 0x9b, 0x68, 0xa3, 0x43, 0x21, 0x21, 0xf8,
|
||||||
|
0xfe, 0xc7, 0x1f, 0x1c, 0xe2, 0xeb, 0x90, 0x23, 0xb4, 0x11, 0xa5, 0x65, 0xb5, 0x4e, 0x43, 0x28,
|
||||||
|
0x6c, 0xd7, 0xd0, 0x26, 0xe9, 0x99, 0x1c, 0x57, 0xb9, 0x5c, 0x66, 0x36, 0x91, 0x83, 0xa4, 0x0e,
|
||||||
|
0x7e, 0x54, 0x3f, 0x82, 0x80, 0xaf, 0x82, 0x70, 0xe0, 0xe0, 0x41, 0x87, 0xf8, 0x3c, 0x20, 0x00,
|
||||||
|
0xc2, 0x8e, 0x0e, 0x5a, 0x8b, 0x62, 0x78, 0x44, 0xf7, 0x68, 0xf9, 0x99, 0x49, 0x4f, 0xf1, 0xd6,
|
||||||
|
0x68, 0xd5, 0x0b, 0xc3, 0xa3, 0x1a, 0x50, 0xa8, 0x34, 0x83, 0xf8, 0x74, 0xef, 0x3e, 0xec, 0xf4,
|
||||||
|
0xf6, 0x71, 0x08, 0xef, 0x8f, 0xfd, 0xd0, 0xda, 0xde, 0x0a, 0x9b, 0xde, 0xb8, 0x41, 0xbf, 0x9c,
|
||||||
|
0xb6, 0x9c, 0xd3, 0xdc, 0x13, 0x54, 0xa9, 0x0e, 0xaa, 0xe4, 0x76, 0xf2, 0xce, 0x9d, 0x41, 0x3c,
|
||||||
|
0x3b, 0xd9, 0x21, 0xd2, 0xb2, 0xb3, 0x30, 0xa0, 0xe8, 0x83, 0xa4, 0xef, 0x6f, 0xdc, 0x95, 0xdc,
|
||||||
|
0x86, 0xd1, 0x64, 0xb0, 0x97, 0x35, 0x53, 0xa5, 0x55, 0x42, 0x3a, 0x20, 0x79, 0xa5, 0x88, 0xfb,
|
||||||
|
0x85, 0xb8, 0x2b, 0x6d, 0xc1, 0xc8, 0x98, 0x6e, 0xd9, 0x28, 0x2b, 0x3b, 0x83, 0xa9, 0x1b, 0xd1,
|
||||||
|
0x40, 0xad, 0x1b, 0xa2, 0x91, 0x29, 0xa4, 0x68, 0x6e, 0x69, 0x44, 0xd3, 0xcd, 0x06, 0x87, 0x91,
|
||||||
|
0xf4, 0xf6, 0x40, 0x33, 0xac, 0x84, 0x76, 0x58, 0x45, 0x76, 0x34, 0x8e, 0x95, 0x62, 0x48, 0xfd,
|
||||||
|
0x8c, 0xc1, 0x8c, 0x98, 0x8a, 0x8c, 0x8e, 0xb4, 0x32, 0x4f, 0x32, 0x67, 0x23, 0xa3, 0x19, 0x8b,
|
||||||
|
0xe5, 0x95, 0x65, 0xb8, 0x76, 0xfd, 0x0a, 0xae, 0xfe, 0x5e, 0xfe, 0x9f, 0xe1, 0xd7, 0xd5, 0xe2,
|
||||||
|
0xa7, 0x9f, 0x8f, 0x2f, 0x45, 0x9f, 0x8a, 0x9a, 0xa3, 0x34, 0x19, 0x91, 0x11, 0x56, 0x7b, 0x79,
|
||||||
|
0xef, 0xf5, 0xdf, 0x77, 0xef, 0x40, 0x60, 0x00, 0xbe, 0x0d, 0x0f, 0xa3, 0x3b, 0x00, 0x79, 0xa0,
|
||||||
|
0xe8, 0xfe, 0xe6, 0x08, 0x56, 0xab, 0x15, 0xd9, 0x39, 0x19, 0x08, 0x3a, 0x14, 0x0c, 0xff, 0x80,
|
||||||
|
0x03, 0x84, 0x2f, 0xd4, 0x76, 0xa3, 0x9d, 0x1f, 0xf9, 0xd4, 0x7b, 0xf9, 0xee, 0x5e, 0xfc, 0xc0,
|
||||||
|
0xdd, 0x1d, 0x4c, 0x26, 0x13, 0x51, 0x51, 0x51, 0x60, 0xb3, 0xd9, 0xe8, 0xed, 0xed, 0x05, 0x15,
|
||||||
|
0x6d, 0x6d, 0x6d, 0xf6, 0xf1, 0x24, 0xd2, 0x09, 0x9a, 0x9a, 0x9a, 0x60, 0x0b, 0xdb, 0xdc, 0xd3,
|
||||||
|
0x94, 0x57, 0xf0, 0xb0, 0x3f, 0xf0, 0x4b, 0x78, 0xf9, 0xec, 0x86, 0xa7, 0x8f, 0xaf, 0xd8, 0x6e,
|
||||||
|
0xb4, 0x63, 0xc7, 0x27, 0x2e, 0xee, 0x9e, 0xbb, 0x22, 0x36, 0x6f, 0xde, 0xfc, 0x48, 0x20, 0x10,
|
||||||
|
0xd0, 0x42, 0x3c, 0x1e, 0x0f, 0x5b, 0xb7, 0x6e, 0x85, 0x56, 0xab, 0x45, 0x6e, 0x6e, 0x2e, 0x8e,
|
||||||
|
0x91, 0x6e, 0x41, 0x8d, 0x57, 0x55, 0x55, 0xc1, 0xd7, 0xd7, 0x97, 0x1e, 0xa3, 0x22, 0x27, 0x27,
|
||||||
|
0x07, 0x61, 0x61, 0x61, 0xf4, 0x9c, 0x8d, 0xdb, 0x1d, 0xb7, 0x10, 0x97, 0x1c, 0xd3, 0xef, 0xe1,
|
||||||
|
0xf9, 0x21, 0xcb, 0xc3, 0xc3, 0xe7, 0xdd, 0x67, 0x7a, 0x5d, 0x74, 0x74, 0xf4, 0x1b, 0x6e, 0x6f,
|
||||||
|
0xb9, 0x3d, 0x5e, 0x5c, 0x5c, 0xb4, 0xaf, 0x36, 0x28, 0x28, 0x08, 0xcd, 0xcd, 0xcd, 0xb4, 0x68,
|
||||||
|
0x5e, 0x5e, 0x9e, 0x7d, 0x9c, 0x4a, 0x8f, 0x9b, 0x9b, 0x1b, 0x16, 0x16, 0x16, 0x68, 0x23, 0x2e,
|
||||||
|
0x97, 0x8b, 0xa7, 0x63, 0x50, 0x29, 0x47, 0x45, 0x65, 0x99, 0x86, 0x11, 0xc3, 0x78, 0x6f, 0x4d,
|
||||||
|
0x53, 0x0d, 0x0e, 0x0e, 0x76, 0x21, 0xf1, 0xb8, 0xab, 0xab, 0x0b, 0xdd, 0xa4, 0x29, 0x96, 0x94,
|
||||||
|
0x94, 0x60, 0xdb, 0xb6, 0x6d, 0x98, 0x9f, 0x9f, 0x5f, 0x63, 0x44, 0x85, 0xa7, 0xa7, 0x27, 0xe9,
|
||||||
|
0xe0, 0x32, 0xda, 0xc8, 0xcf, 0xcf, 0x0f, 0x71, 0x71, 0x71, 0x34, 0x65, 0x65, 0x65, 0x24, 0x9d,
|
||||||
|
0x2d, 0x26, 0x4e, 0x6a, 0x8a, 0xfa, 0x70, 0xd8, 0xe1, 0xf7, 0x9f, 0xfb, 0x3e, 0xda, 0xb8, 0x71,
|
||||||
|
0xa3, 0x21, 0x34, 0x34, 0x14, 0xe1, 0xe1, 0xe1, 0x28, 0x2e, 0x2e, 0x86, 0x5e, 0xaf, 0xa7, 0x45,
|
||||||
|
0x9f, 0x67, 0xe4, 0xe5, 0xe5, 0x05, 0xb9, 0x5c, 0xbe, 0x26, 0x75, 0x62, 0xb1, 0x18, 0x12, 0x49,
|
||||||
|
0x4f, 0xa0, 0xbf, 0xbf, 0xbf, 0xb3, 0xfd, 0x7d, 0x44, 0xc2, 0x99, 0xe0, 0x4a, 0x78, 0x87, 0xb0,
|
||||||
|
0x85, 0x18, 0x4d, 0x3c, 0x9d, 0x3a, 0x5b, 0xac, 0x36, 0x32, 0x1a, 0x8d, 0xf4, 0xf9, 0xbd, 0x28,
|
||||||
|
0x75, 0x42, 0xa1, 0x70, 0xff, 0x8a, 0xa6, 0xeb, 0x8a, 0x87, 0xd3, 0x06, 0xc2, 0xeb, 0x04, 0x17,
|
||||||
|
0xc2, 0xdb, 0xc4, 0xc8, 0xf8, 0x22, 0xa3, 0x10, 0xd2, 0xd1, 0xa9, 0x42, 0x28, 0x2a, 0x2a, 0xa2,
|
||||||
|
0x77, 0x53, 0x58, 0x58, 0x68, 0x2f, 0x86, 0xd5, 0x46, 0x64, 0x57, 0x7b, 0x56, 0x34, 0x9d, 0x69,
|
||||||
|
0x8f, 0xd5, 0xa9, 0xdb, 0xbe, 0x7d, 0x7b, 0xe6, 0xd2, 0xd2, 0xd2, 0x1a, 0x23, 0xea, 0xdc, 0x38,
|
||||||
|
0x1c, 0x0e, 0x0d, 0xb5, 0xb3, 0x3b, 0x77, 0xee, 0xd8, 0xe7, 0x44, 0x22, 0x11, 0x3a, 0x3b, 0x3b,
|
||||||
|
0x57, 0xdf, 0xe2, 0xed, 0xd0, 0xe7, 0xd6, 0xff, 0xe5, 0x5f, 0x87, 0x46, 0x7a, 0x2c, 0x77, 0x09,
|
||||||
|
0x78, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||||
|
};
|
||||||
|
|
||||||
|
const BITMAP_OPAQUE plot_pdf_xpm[1] = {{ png, sizeof( png ), "plot_pdf_xpm" }};
|
||||||
|
|
||||||
|
//EOF
|
|
@ -0,0 +1,633 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
height="48"
|
||||||
|
width="48"
|
||||||
|
version="1.1"
|
||||||
|
id="svg2"
|
||||||
|
inkscape:version="0.48.1 "
|
||||||
|
sodipodi:docname="plot_ps.svg">
|
||||||
|
<metadata
|
||||||
|
id="metadata173">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1280"
|
||||||
|
inkscape:window-height="968"
|
||||||
|
id="namedview171"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="15.4375"
|
||||||
|
inkscape:cx="24"
|
||||||
|
inkscape:cy="24"
|
||||||
|
inkscape:window-x="-4"
|
||||||
|
inkscape:window-y="-4"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="svg2" />
|
||||||
|
<defs
|
||||||
|
id="defs4">
|
||||||
|
<linearGradient
|
||||||
|
id="aa"
|
||||||
|
y2="20"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="20.125"
|
||||||
|
gradientTransform="matrix(1 0 0 .66667 1.9997 -2.3333)"
|
||||||
|
y1="24.438"
|
||||||
|
x1="20.125">
|
||||||
|
<stop
|
||||||
|
offset="0"
|
||||||
|
id="stop7" />
|
||||||
|
<stop
|
||||||
|
stop-opacity="0"
|
||||||
|
offset="1"
|
||||||
|
id="stop9" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="z"
|
||||||
|
y2="33.469"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="41.82"
|
||||||
|
gradientTransform="translate(2.4997,-9)"
|
||||||
|
y1="33.109"
|
||||||
|
x1="41.82">
|
||||||
|
<stop
|
||||||
|
stop-color="#fff"
|
||||||
|
offset="0"
|
||||||
|
id="stop12" />
|
||||||
|
<stop
|
||||||
|
stop-color="#fff"
|
||||||
|
stop-opacity="0"
|
||||||
|
offset="1"
|
||||||
|
id="stop14" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="at"
|
||||||
|
y2="31.168"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="38.743"
|
||||||
|
gradientTransform="matrix(.88533 0 0 1.4995 7.488 -20.734)"
|
||||||
|
y1="29.744"
|
||||||
|
x1="38.743">
|
||||||
|
<stop
|
||||||
|
stop-color="#babdb6"
|
||||||
|
offset="0"
|
||||||
|
id="stop17" />
|
||||||
|
<stop
|
||||||
|
stop-color="#fff"
|
||||||
|
offset="1"
|
||||||
|
id="stop19" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="as"
|
||||||
|
y2="29.085"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="40.791"
|
||||||
|
gradientTransform="matrix(.66667 0 0 1 17 -5)"
|
||||||
|
y1="30.003"
|
||||||
|
x1="40.791">
|
||||||
|
<stop
|
||||||
|
stop-color="#789e2d"
|
||||||
|
offset="0"
|
||||||
|
id="stop22" />
|
||||||
|
<stop
|
||||||
|
stop-color="#a7cc5c"
|
||||||
|
offset="1"
|
||||||
|
id="stop24" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="ae"
|
||||||
|
y2="20.14"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="17.5"
|
||||||
|
gradientTransform="matrix(1.0039 0 0 .98413 2.9558 -8.7031)"
|
||||||
|
y1="30.755"
|
||||||
|
x1="17.5">
|
||||||
|
<stop
|
||||||
|
stop-color="#2e3436"
|
||||||
|
offset="0"
|
||||||
|
id="stop27" />
|
||||||
|
<stop
|
||||||
|
stop-color="#babdb6"
|
||||||
|
offset="1"
|
||||||
|
id="stop29" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="ad"
|
||||||
|
y2="42.336"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="3.6239"
|
||||||
|
gradientTransform="translate(2.9997,-8)"
|
||||||
|
y1="38.1"
|
||||||
|
x1="3.6239">
|
||||||
|
<stop
|
||||||
|
stop-color="#fff"
|
||||||
|
offset="0"
|
||||||
|
id="stop32" />
|
||||||
|
<stop
|
||||||
|
stop-color="#fff"
|
||||||
|
stop-opacity="0"
|
||||||
|
offset="1"
|
||||||
|
id="stop34" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="y"
|
||||||
|
y2="69.14"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="5.1265"
|
||||||
|
gradientTransform="translate(1.9997,-10)"
|
||||||
|
y1="25.373"
|
||||||
|
x1="5.1265">
|
||||||
|
<stop
|
||||||
|
stop-color="#fff"
|
||||||
|
offset="0"
|
||||||
|
id="stop37" />
|
||||||
|
<stop
|
||||||
|
stop-color="#fff"
|
||||||
|
stop-opacity="0"
|
||||||
|
offset="1"
|
||||||
|
id="stop39" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="ac"
|
||||||
|
y2="41.012"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="3.2641"
|
||||||
|
gradientTransform="translate(2.9997,-8)"
|
||||||
|
y1="35.073"
|
||||||
|
x1="3.2641">
|
||||||
|
<stop
|
||||||
|
stop-color="#555753"
|
||||||
|
offset="0"
|
||||||
|
id="stop42" />
|
||||||
|
<stop
|
||||||
|
stop-color="#2e3436"
|
||||||
|
offset="1"
|
||||||
|
id="stop44" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="ab"
|
||||||
|
y2="37.148"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="5.057"
|
||||||
|
gradientTransform="translate(2.9997,-8)"
|
||||||
|
y1="40.415"
|
||||||
|
x1="5.057">
|
||||||
|
<stop
|
||||||
|
stop-color="#2e3436"
|
||||||
|
offset="0"
|
||||||
|
id="stop47" />
|
||||||
|
<stop
|
||||||
|
stop-color="#555753"
|
||||||
|
offset="1"
|
||||||
|
id="stop49" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="x"
|
||||||
|
y2="24.368"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2=".75"
|
||||||
|
gradientTransform="translate(1.9997,-10)"
|
||||||
|
y1="67.989"
|
||||||
|
x1=".75">
|
||||||
|
<stop
|
||||||
|
stop-color="#555753"
|
||||||
|
offset="0"
|
||||||
|
id="stop52" />
|
||||||
|
<stop
|
||||||
|
stop-color="#888a85"
|
||||||
|
offset="1"
|
||||||
|
id="stop54" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="ar"
|
||||||
|
y2="24.249"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="35.5"
|
||||||
|
gradientTransform="matrix(1 0 0 .92157 1.9997 -3.7219)"
|
||||||
|
y1="31.19"
|
||||||
|
x1="35.5">
|
||||||
|
<stop
|
||||||
|
stop-color="#d3d7cf"
|
||||||
|
offset="0"
|
||||||
|
id="stop57" />
|
||||||
|
<stop
|
||||||
|
stop-color="#eeeeec"
|
||||||
|
offset="1"
|
||||||
|
id="stop59" />
|
||||||
|
</linearGradient>
|
||||||
|
<radialGradient
|
||||||
|
id="aq"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
cy="38.763"
|
||||||
|
cx="25.323"
|
||||||
|
gradientTransform="matrix(1 0 0 .1944 0 31.228)"
|
||||||
|
r="25.235">
|
||||||
|
<stop
|
||||||
|
offset="0"
|
||||||
|
id="stop62" />
|
||||||
|
<stop
|
||||||
|
stop-opacity="0"
|
||||||
|
offset="1"
|
||||||
|
id="stop64" />
|
||||||
|
</radialGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="af"
|
||||||
|
y2="43"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="15.186"
|
||||||
|
gradientTransform="matrix(1.129,0,0,1,-2.0968,-9)"
|
||||||
|
y1="36"
|
||||||
|
x1="15.177">
|
||||||
|
<stop
|
||||||
|
stop-color="#888a85"
|
||||||
|
offset="0"
|
||||||
|
id="stop67" />
|
||||||
|
<stop
|
||||||
|
stop-color="#555753"
|
||||||
|
offset="1"
|
||||||
|
id="stop69" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="ag"
|
||||||
|
y2="45.969"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="10"
|
||||||
|
gradientTransform="matrix(1.1212 0 0 1 -.90909 -8)"
|
||||||
|
y1="40.969"
|
||||||
|
x1="9.9688">
|
||||||
|
<stop
|
||||||
|
stop-color="#eeeeec"
|
||||||
|
offset="0"
|
||||||
|
id="stop72" />
|
||||||
|
<stop
|
||||||
|
stop-color="#babdb6"
|
||||||
|
offset=".27381"
|
||||||
|
id="stop74" />
|
||||||
|
<stop
|
||||||
|
stop-color="#fff"
|
||||||
|
offset=".55910"
|
||||||
|
id="stop76" />
|
||||||
|
<stop
|
||||||
|
stop-color="#eeeeec"
|
||||||
|
offset="1"
|
||||||
|
id="stop78" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="ah"
|
||||||
|
y2="40"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="40.375"
|
||||||
|
gradientTransform="matrix(1.1212 0 0 1 -.90909 -8)"
|
||||||
|
y1="45.625"
|
||||||
|
x1="40.375">
|
||||||
|
<stop
|
||||||
|
stop-color="#555753"
|
||||||
|
offset="0"
|
||||||
|
id="stop81" />
|
||||||
|
<stop
|
||||||
|
stop-color="#a1a59b"
|
||||||
|
offset="1"
|
||||||
|
id="stop83" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="ai"
|
||||||
|
y2="32.515"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="34.482"
|
||||||
|
gradientTransform="matrix(1.1454,0,0,1,-1.4536,-5)"
|
||||||
|
y1="42.002"
|
||||||
|
x1="34.482">
|
||||||
|
<stop
|
||||||
|
stop-color="#eeeeec"
|
||||||
|
offset="0"
|
||||||
|
id="stop86" />
|
||||||
|
<stop
|
||||||
|
stop-color="#fff"
|
||||||
|
offset=".10714"
|
||||||
|
id="stop88" />
|
||||||
|
<stop
|
||||||
|
stop-color="#d3d7cf"
|
||||||
|
offset="1"
|
||||||
|
id="stop90" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="aj"
|
||||||
|
y2="35.789"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="41.498"
|
||||||
|
gradientTransform="matrix(1.1454,0,0,1,-1.4536,-5)"
|
||||||
|
y1="40.9"
|
||||||
|
x1="41.498">
|
||||||
|
<stop
|
||||||
|
stop-color="#babdb6"
|
||||||
|
offset="0"
|
||||||
|
id="stop93" />
|
||||||
|
<stop
|
||||||
|
stop-color="#888a85"
|
||||||
|
offset="1"
|
||||||
|
id="stop95" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="ak"
|
||||||
|
y2="40.048"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="15.312"
|
||||||
|
gradientTransform="matrix(1.1333,0,0,1,-2.2,-8)"
|
||||||
|
y1="31.45"
|
||||||
|
x1="15.312">
|
||||||
|
<stop
|
||||||
|
offset="0"
|
||||||
|
id="stop98" />
|
||||||
|
<stop
|
||||||
|
stop-opacity="0"
|
||||||
|
offset="1"
|
||||||
|
id="stop100" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="al"
|
||||||
|
y2="42.403"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="27.907"
|
||||||
|
gradientTransform="matrix(1.08 0 0 1.0039 .080008 -7.022)"
|
||||||
|
y1="6.0832"
|
||||||
|
x1="12.171">
|
||||||
|
<stop
|
||||||
|
stop-color="#fff"
|
||||||
|
offset="0"
|
||||||
|
id="stop103" />
|
||||||
|
<stop
|
||||||
|
stop-color="#babdb6"
|
||||||
|
offset="1"
|
||||||
|
id="stop105" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="am"
|
||||||
|
y2="13.749"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="36.523"
|
||||||
|
gradientTransform="matrix(1.08 0 0 1.0039 .080008 -11.038)"
|
||||||
|
y1="24.545"
|
||||||
|
x1="36.523">
|
||||||
|
<stop
|
||||||
|
stop-color="#888a85"
|
||||||
|
offset="0"
|
||||||
|
id="stop108" />
|
||||||
|
<stop
|
||||||
|
stop-color="#888a85"
|
||||||
|
offset="1"
|
||||||
|
id="stop110" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="an"
|
||||||
|
y2="-11.027"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="15.438"
|
||||||
|
gradientTransform="translate(2,-5.4972)"
|
||||||
|
y1="20.773"
|
||||||
|
x1="27.568">
|
||||||
|
<stop
|
||||||
|
stop-color="#888a85"
|
||||||
|
offset="0"
|
||||||
|
id="stop113" />
|
||||||
|
<stop
|
||||||
|
stop-color="#888a85"
|
||||||
|
stop-opacity="0"
|
||||||
|
offset="1"
|
||||||
|
id="stop115" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="ao"
|
||||||
|
y2="2.5"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="17.625"
|
||||||
|
gradientTransform="translate(2,-5.4972)"
|
||||||
|
y1="17.471"
|
||||||
|
x1="21.875">
|
||||||
|
<stop
|
||||||
|
stop-color="#2e3436"
|
||||||
|
offset="0"
|
||||||
|
id="stop118" />
|
||||||
|
<stop
|
||||||
|
stop-color="#888a85"
|
||||||
|
offset="1"
|
||||||
|
id="stop120" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="ap"
|
||||||
|
y2="28.82"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x2="34.825"
|
||||||
|
gradientTransform="translate(2,-5.4972)"
|
||||||
|
y1="6.1923"
|
||||||
|
x1="21.567">
|
||||||
|
<stop
|
||||||
|
stop-color="#fff"
|
||||||
|
offset="0"
|
||||||
|
id="stop123" />
|
||||||
|
<stop
|
||||||
|
stop-color="#fff"
|
||||||
|
stop-opacity="0"
|
||||||
|
offset="1"
|
||||||
|
id="stop125" />
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<path
|
||||||
|
opacity=".8"
|
||||||
|
d="m26-2.5c-2.7062 0-5.5 2-5.5 2-0.56888 0-1 3.984-1 5v12h13v-12c0-1.016-0.43112-5-1-5 0 0-2.7938-2-5.5-2zm0 6c0.828 0 1.5-0.536 1.5 2.5s-0.6395 7.5028-1.4675 7.5028-1.532-4.467-1.532-7.503 0.672-2.5 1.5-2.5z"
|
||||||
|
fill-rule="evenodd"
|
||||||
|
stroke="url(#ao)"
|
||||||
|
stroke-linecap="square"
|
||||||
|
fill="url(#an)"
|
||||||
|
id="path127" />
|
||||||
|
<path
|
||||||
|
opacity=".7"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
d="m26-1.5c-2.2158 0-4.7813 1.8153-4.7813 1.8153-0.0014 0.00322-0.02974-0.00349-0.03125 0-0.01757 0.040692-0.0085 0.055839-0.03125 0.125-0.095 0.28845-0.192 0.7665-0.281 1.2812-0.177 1.0295-0.375 2.4215-0.375 2.7785l0.09374 11.159h10.875l0.031-11.159c0-0.35697-0.13519-1.749-0.31251-2.7785-0.088-0.5147-0.186-0.99275-0.281-1.2812-0.023-0.06916-0.014-0.08431-0.031-0.125-0.006-0.01279-0.027-0.0222-0.031-0.03125 0 0-2.628-1.784-4.844-1.784z"
|
||||||
|
stroke="url(#ap)"
|
||||||
|
stroke-linecap="square"
|
||||||
|
fill="none"
|
||||||
|
id="path129" />
|
||||||
|
<path
|
||||||
|
opacity=".3"
|
||||||
|
d="m50.558 38.763a25.235 4.9056 0 1 1 -50.47 0 25.235 4.9056 0 1 1 50.47 0z"
|
||||||
|
transform="matrix(1.0693 0 0 .56059 -3.0645 20.52)"
|
||||||
|
fill="url(#aq)"
|
||||||
|
id="path131" />
|
||||||
|
<path
|
||||||
|
stroke-linejoin="round"
|
||||||
|
d="m8.9997 11.5-2.25 2.7488c-2.1506 2.6273-3.25 5.0686-3.25 8.7549v5.496h45v-5.4963c0-3.6863-1.0994-6.1276-3.25-8.7549l-2.25-2.749h-34z"
|
||||||
|
stroke="url(#x)"
|
||||||
|
stroke-linecap="square"
|
||||||
|
fill="url(#ar)"
|
||||||
|
id="path133" />
|
||||||
|
<path
|
||||||
|
stroke-linejoin="round"
|
||||||
|
style="enable-background:new"
|
||||||
|
d="m4.4997 28.5v2.9062c0 1.1517 0.942 2.0938 2.0937 2.0938h38.812c1.1517 0 2.0938-0.942 2.0938-2.0938v-2.906h-43z"
|
||||||
|
stroke="url(#ac)"
|
||||||
|
stroke-linecap="round"
|
||||||
|
fill="url(#ab)"
|
||||||
|
id="path135" />
|
||||||
|
<path
|
||||||
|
d="m9.5116 12.562-1.9122 2.289c-2.0354 2.437-3.0997 4.486-3.0997 7.857v4.792h43v-4.792c0-3.3701-1.0721-5.4135-3.0997-7.8562l-1.9-2.29h-32.988z"
|
||||||
|
stroke="url(#y)"
|
||||||
|
stroke-linecap="square"
|
||||||
|
fill="none"
|
||||||
|
id="path137" />
|
||||||
|
<path
|
||||||
|
opacity="0.08"
|
||||||
|
style="enable-background:new"
|
||||||
|
d="m46.5 29.5v2c0 0.51882-0.48118 1-1 1h-39c-0.51882 0-1-0.48118-1-1v-2h41z"
|
||||||
|
stroke="url(#ad)"
|
||||||
|
stroke-linecap="round"
|
||||||
|
fill="none"
|
||||||
|
id="path139" />
|
||||||
|
<rect
|
||||||
|
stroke-linejoin="round"
|
||||||
|
style="enable-background:new"
|
||||||
|
rx=".50781"
|
||||||
|
ry=".5"
|
||||||
|
height="10"
|
||||||
|
width="29"
|
||||||
|
stroke="#2e3436"
|
||||||
|
stroke-linecap="round"
|
||||||
|
y="12.5"
|
||||||
|
x="11.5"
|
||||||
|
stroke-width=".99978"
|
||||||
|
fill="url(#ae)"
|
||||||
|
id="rect141" />
|
||||||
|
<path
|
||||||
|
stroke-linejoin="round"
|
||||||
|
d="m14.12 6.4995h23.76c0.89748 0 1.62 0.67161 1.62 1.5059v6.5566l-27-1.004v-5.5527c0-0.83425 0.72252-1.5059 1.62-1.5059z"
|
||||||
|
stroke="url(#am)"
|
||||||
|
stroke-linecap="square"
|
||||||
|
fill="url(#al)"
|
||||||
|
id="path143" />
|
||||||
|
<rect
|
||||||
|
stroke-linejoin="round"
|
||||||
|
rx=".62364"
|
||||||
|
ry=".53125"
|
||||||
|
height="5.9983"
|
||||||
|
width="24.999"
|
||||||
|
stroke="#fff"
|
||||||
|
stroke-linecap="square"
|
||||||
|
y="7.4995"
|
||||||
|
x="13.5"
|
||||||
|
fill="none"
|
||||||
|
id="rect145" />
|
||||||
|
<rect
|
||||||
|
rx="1"
|
||||||
|
ry="1"
|
||||||
|
height="2"
|
||||||
|
width="3"
|
||||||
|
stroke="url(#at)"
|
||||||
|
stroke-linecap="square"
|
||||||
|
y="23.5"
|
||||||
|
x="43"
|
||||||
|
fill="url(#as)"
|
||||||
|
id="rect147" />
|
||||||
|
<rect
|
||||||
|
rx=".51562"
|
||||||
|
ry=".17969"
|
||||||
|
height=".35937"
|
||||||
|
width="1.5469"
|
||||||
|
y="24.109"
|
||||||
|
x="43.734"
|
||||||
|
fill="url(#z)"
|
||||||
|
id="rect149" />
|
||||||
|
<rect
|
||||||
|
opacity=".15"
|
||||||
|
fill-rule="evenodd"
|
||||||
|
rx="0"
|
||||||
|
ry="0"
|
||||||
|
height="2"
|
||||||
|
width="28"
|
||||||
|
y="11"
|
||||||
|
x="12"
|
||||||
|
fill="url(#aa)"
|
||||||
|
id="rect151" />
|
||||||
|
<path
|
||||||
|
style="enable-background:new"
|
||||||
|
d="m12.5 13.5h27"
|
||||||
|
fill-opacity=".75"
|
||||||
|
fill-rule="evenodd"
|
||||||
|
stroke="#2e3436"
|
||||||
|
stroke-linecap="square"
|
||||||
|
stroke-width=".99994"
|
||||||
|
fill="#888a85"
|
||||||
|
id="path153" />
|
||||||
|
<path
|
||||||
|
d="m11.194 27.5h29.612c0.96368 0 1.6935 0.63554 1.6935 1.2996v4.7l-33 0.000009v-4.7004c0-0.74044 0.77366-1.2996 1.6935-1.2996z"
|
||||||
|
stroke="url(#af)"
|
||||||
|
stroke-linecap="square"
|
||||||
|
fill="#6a6f64"
|
||||||
|
id="path155" />
|
||||||
|
<path
|
||||||
|
stroke-linejoin="round"
|
||||||
|
d="m10.303 32.5h31.394c1.6468 0 1.1212 2 1.1212 2l1.682 2.5c0 1.385-1.2502 1.5-2.803 1.5h-31.394c-1.5524 0-2.8026-0.115-2.8026-1.5l1.6818-2.5s-0.56061-2 1.1212-2z"
|
||||||
|
stroke="url(#ah)"
|
||||||
|
stroke-linecap="round"
|
||||||
|
fill="url(#ag)"
|
||||||
|
id="path157" />
|
||||||
|
<path
|
||||||
|
stroke-linejoin="round"
|
||||||
|
d="m40.352 28c0 5 1.718 8.5 1.718 8.5h-32.07s1.718-3.5 1.718-8.5"
|
||||||
|
stroke="url(#aj)"
|
||||||
|
fill="url(#ai)"
|
||||||
|
id="path159" />
|
||||||
|
<path
|
||||||
|
fill="none"
|
||||||
|
d="m39.34 28c-0.03625 4 1.16 7.5 1.16 7.5h-29s1.16-3.5 1.16-7.5"
|
||||||
|
stroke="#fff"
|
||||||
|
id="path161" />
|
||||||
|
<path
|
||||||
|
opacity=".50588"
|
||||||
|
fill="url(#ak)"
|
||||||
|
d="m11.133 28h29.733c0.935 0 1.134 0.447 1.134 1v4h-32v-4c0-0.61703 0.24178-1 1.1333-1z"
|
||||||
|
id="path163" />
|
||||||
|
<rect
|
||||||
|
fill-rule="evenodd"
|
||||||
|
height="16.15"
|
||||||
|
width="32"
|
||||||
|
y="30"
|
||||||
|
x="9"
|
||||||
|
fill="#fff"
|
||||||
|
id="rect165" />
|
||||||
|
<text
|
||||||
|
style="font-size:41.50999832px;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;font-family:Sans"
|
||||||
|
xml:space="preserve"
|
||||||
|
transform="scale(0.98833,1.0118)"
|
||||||
|
line-height="125%"
|
||||||
|
font-size="41.51px"
|
||||||
|
y="44.47496"
|
||||||
|
x="24.283327"
|
||||||
|
id="text167"
|
||||||
|
sodipodi:linespacing="125%"><tspan
|
||||||
|
style="font-size:18px;font-weight:bold;text-align:center;text-anchor:middle;font-family:Saab"
|
||||||
|
font-size="18px"
|
||||||
|
y="44.47496"
|
||||||
|
x="24.283327"
|
||||||
|
font-weight="bold"
|
||||||
|
id="tspan169">PDF</tspan></text>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 16 KiB |
|
@ -35,6 +35,7 @@ set(COMMON_SRCS
|
||||||
build_version.cpp
|
build_version.cpp
|
||||||
class_bitmap_base.cpp
|
class_bitmap_base.cpp
|
||||||
class_colors_design_settings.cpp
|
class_colors_design_settings.cpp
|
||||||
|
class_layer_box_selector.cpp
|
||||||
class_marker_base.cpp
|
class_marker_base.cpp
|
||||||
class_plotter.cpp
|
class_plotter.cpp
|
||||||
class_undoredo_container.cpp
|
class_undoredo_container.cpp
|
||||||
|
@ -42,6 +43,7 @@ set(COMMON_SRCS
|
||||||
common_plot_functions.cpp
|
common_plot_functions.cpp
|
||||||
common_plotHPGL_functions.cpp
|
common_plotHPGL_functions.cpp
|
||||||
common_plotPS_functions.cpp
|
common_plotPS_functions.cpp
|
||||||
|
common_plotPDF_functions.cpp
|
||||||
common_plotGERBER_functions.cpp
|
common_plotGERBER_functions.cpp
|
||||||
common_plotDXF_functions.cpp
|
common_plotDXF_functions.cpp
|
||||||
confirm.cpp
|
confirm.cpp
|
||||||
|
@ -87,7 +89,6 @@ set(PCB_COMMON_SRCS
|
||||||
class_page_info.cpp
|
class_page_info.cpp
|
||||||
pcbcommon.cpp
|
pcbcommon.cpp
|
||||||
footprint_info.cpp
|
footprint_info.cpp
|
||||||
class_layer_box_selector.cpp
|
|
||||||
../pcbnew/basepcbframe.cpp
|
../pcbnew/basepcbframe.cpp
|
||||||
../pcbnew/class_board.cpp
|
../pcbnew/class_board.cpp
|
||||||
../pcbnew/class_board_connected_item.cpp
|
../pcbnew/class_board_connected_item.cpp
|
||||||
|
@ -116,6 +117,7 @@ set(PCB_COMMON_SRCS
|
||||||
../pcbnew/sel_layer.cpp
|
../pcbnew/sel_layer.cpp
|
||||||
../pcbnew/pcb_plot_params.cpp
|
../pcbnew/pcb_plot_params.cpp
|
||||||
../pcbnew/io_mgr.cpp
|
../pcbnew/io_mgr.cpp
|
||||||
|
../pcbnew/eagle_plugin.cpp
|
||||||
../pcbnew/legacy_plugin.cpp
|
../pcbnew/legacy_plugin.cpp
|
||||||
../pcbnew/kicad_plugin.cpp
|
../pcbnew/kicad_plugin.cpp
|
||||||
pcb_plot_params_keywords.cpp
|
pcb_plot_params_keywords.cpp
|
||||||
|
|
|
@ -35,17 +35,13 @@
|
||||||
#include <id.h>
|
#include <id.h>
|
||||||
#include <base_units.h>
|
#include <base_units.h>
|
||||||
|
|
||||||
|
|
||||||
#define CURSOR_SIZE 12 /// size of the cross cursor.
|
|
||||||
|
|
||||||
|
|
||||||
BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) :
|
BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) :
|
||||||
EDA_ITEM( aType )
|
EDA_ITEM( aType )
|
||||||
{
|
{
|
||||||
m_UndoRedoCountMax = 10; // undo/Redo command Max depth, 10 is a reasonable value
|
m_UndoRedoCountMax = 10; // undo/Redo command Max depth, 10 is a reasonable value
|
||||||
m_FirstRedraw = true;
|
m_FirstRedraw = true;
|
||||||
m_ScreenNumber = 1;
|
m_ScreenNumber = 1;
|
||||||
m_NumberOfScreen = 1; // Hierarchy: Root: ScreenNumber = 1
|
m_NumberOfScreens = 1; // Hierarchy: Root: ScreenNumber = 1
|
||||||
m_Zoom = 32.0;
|
m_Zoom = 32.0;
|
||||||
m_Grid.m_Size = wxRealPoint( 50, 50 ); // Default grid size
|
m_Grid.m_Size = wxRealPoint( 50, 50 ); // Default grid size
|
||||||
m_Grid.m_Id = ID_POPUP_GRID_LEVEL_50;
|
m_Grid.m_Id = ID_POPUP_GRID_LEVEL_50;
|
||||||
|
@ -98,16 +94,8 @@ double BASE_SCREEN::GetScalingFactor() const
|
||||||
|
|
||||||
void BASE_SCREEN::SetScalingFactor( double aScale )
|
void BASE_SCREEN::SetScalingFactor( double aScale )
|
||||||
{
|
{
|
||||||
double zoom = aScale;
|
|
||||||
|
|
||||||
// Limit zoom to max and min allowed values:
|
// Limit zoom to max and min allowed values:
|
||||||
if( zoom < m_ZoomList[0] )
|
double zoom = Clamp( GetMinAllowedZoom(), aScale, GetMaxAllowedZoom() );
|
||||||
zoom = m_ZoomList[0];
|
|
||||||
|
|
||||||
int idxmax = m_ZoomList.GetCount() - 1;
|
|
||||||
|
|
||||||
if( zoom > m_ZoomList[idxmax] )
|
|
||||||
zoom = m_ZoomList[idxmax];
|
|
||||||
|
|
||||||
SetZoom( zoom );
|
SetZoom( zoom );
|
||||||
}
|
}
|
||||||
|
@ -115,38 +103,30 @@ void BASE_SCREEN::SetScalingFactor( double aScale )
|
||||||
|
|
||||||
bool BASE_SCREEN::SetFirstZoom()
|
bool BASE_SCREEN::SetFirstZoom()
|
||||||
{
|
{
|
||||||
if( m_ZoomList.IsEmpty() )
|
return SetZoom( GetMinAllowedZoom() );
|
||||||
{
|
|
||||||
if( m_Zoom != 1.0 )
|
|
||||||
{
|
|
||||||
SetZoom( 1.0 );
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if( m_Zoom != m_ZoomList[0] )
|
|
||||||
{
|
|
||||||
SetZoom( m_ZoomList[0] );
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
double BASE_SCREEN::GetZoom() const
|
bool BASE_SCREEN::SetLastZoom()
|
||||||
{
|
{
|
||||||
return m_Zoom;
|
return SetZoom( GetMaxAllowedZoom() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool BASE_SCREEN::SetZoom( double coeff )
|
bool BASE_SCREEN::SetZoom( double iu_per_du )
|
||||||
{
|
{
|
||||||
if( coeff == m_Zoom )
|
if( iu_per_du == m_Zoom )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
wxLogDebug( "Zoom:%16g 1/Zoom:%16g", coeff, 1/coeff );
|
wxLogDebug( "Zoom:%.16g 1/Zoom:%.16g", iu_per_du, 1/iu_per_du );
|
||||||
|
|
||||||
m_Zoom = coeff;
|
if( iu_per_du < GetMinAllowedZoom() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( iu_per_du > GetMaxAllowedZoom() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
m_Zoom = iu_per_du;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -154,10 +134,7 @@ bool BASE_SCREEN::SetZoom( double coeff )
|
||||||
|
|
||||||
bool BASE_SCREEN::SetNextZoom()
|
bool BASE_SCREEN::SetNextZoom()
|
||||||
{
|
{
|
||||||
if( m_ZoomList.IsEmpty() || m_Zoom >= m_ZoomList.Last() )
|
for( unsigned i=0; i < m_ZoomList.size(); ++i )
|
||||||
return false;
|
|
||||||
|
|
||||||
for( unsigned i = 0; i < m_ZoomList.GetCount(); i++ )
|
|
||||||
{
|
{
|
||||||
if( m_Zoom < m_ZoomList[i] )
|
if( m_Zoom < m_ZoomList[i] )
|
||||||
{
|
{
|
||||||
|
@ -172,10 +149,7 @@ bool BASE_SCREEN::SetNextZoom()
|
||||||
|
|
||||||
bool BASE_SCREEN::SetPreviousZoom()
|
bool BASE_SCREEN::SetPreviousZoom()
|
||||||
{
|
{
|
||||||
if( m_ZoomList.IsEmpty() || m_Zoom <= m_ZoomList[0] )
|
for( unsigned i = m_ZoomList.size(); i != 0; --i )
|
||||||
return false;
|
|
||||||
|
|
||||||
for( unsigned i = m_ZoomList.GetCount(); i != 0; i-- )
|
|
||||||
{
|
{
|
||||||
if( m_Zoom > m_ZoomList[i - 1] )
|
if( m_Zoom > m_ZoomList[i - 1] )
|
||||||
{
|
{
|
||||||
|
@ -188,15 +162,6 @@ bool BASE_SCREEN::SetPreviousZoom()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool BASE_SCREEN::SetLastZoom()
|
|
||||||
{
|
|
||||||
if( m_ZoomList.IsEmpty() || m_Zoom == m_ZoomList.Last() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return SetZoom( m_ZoomList.Last() );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void BASE_SCREEN::SetGridList( GRIDS& gridlist )
|
void BASE_SCREEN::SetGridList( GRIDS& gridlist )
|
||||||
{
|
{
|
||||||
if( !m_grids.empty() )
|
if( !m_grids.empty() )
|
||||||
|
@ -320,31 +285,8 @@ GRID_TYPE& BASE_SCREEN::GetGrid( size_t aIndex )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GRID_TYPE BASE_SCREEN::GetGrid()
|
wxPoint BASE_SCREEN::GetNearestGridPosition( const wxPoint& aPosition,
|
||||||
{
|
wxRealPoint* aGridSize ) const
|
||||||
return m_Grid;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const wxPoint& BASE_SCREEN::GetGridOrigin()
|
|
||||||
{
|
|
||||||
return m_GridOrigin;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
wxRealPoint BASE_SCREEN::GetGridSize()
|
|
||||||
{
|
|
||||||
return m_Grid.m_Size;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int BASE_SCREEN::GetGridId()
|
|
||||||
{
|
|
||||||
return m_Grid.m_Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
wxPoint BASE_SCREEN::GetNearestGridPosition( const wxPoint& aPosition, wxRealPoint* aGridSize )
|
|
||||||
{
|
{
|
||||||
wxPoint pt;
|
wxPoint pt;
|
||||||
wxRealPoint gridSize;
|
wxRealPoint gridSize;
|
||||||
|
@ -368,7 +310,7 @@ wxPoint BASE_SCREEN::GetNearestGridPosition( const wxPoint& aPosition, wxRealPoi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wxPoint BASE_SCREEN::GetCursorPosition( bool aOnGrid, wxRealPoint* aGridSize )
|
wxPoint BASE_SCREEN::GetCursorPosition( bool aOnGrid, wxRealPoint* aGridSize ) const
|
||||||
{
|
{
|
||||||
if( aOnGrid )
|
if( aOnGrid )
|
||||||
return GetNearestGridPosition( m_crossHairPosition, aGridSize );
|
return GetNearestGridPosition( m_crossHairPosition, aGridSize );
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
#include <base_units.h>
|
#include <base_units.h>
|
||||||
|
|
||||||
|
|
||||||
#if defined( PCBNEW ) || defined( CVPCB ) || defined( EESCHEMA )
|
#if defined( PCBNEW ) || defined( CVPCB ) || defined( EESCHEMA ) || defined( GERBVIEW )
|
||||||
#define IU_TO_MM( x ) ( x / IU_PER_MM )
|
#define IU_TO_MM( x ) ( x / IU_PER_MM )
|
||||||
#define IU_TO_IN( x ) ( x / IU_PER_MILS / 1000 )
|
#define IU_TO_IN( x ) ( x / IU_PER_MILS / 1000 )
|
||||||
#define MM_TO_IU( x ) ( x * IU_PER_MM )
|
#define MM_TO_IU( x ) ( x * IU_PER_MM )
|
||||||
|
|
|
@ -251,18 +251,18 @@ void BITMAP_BASE::Rotate( bool aRotateCCW )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BITMAP_BASE::PlotImage( PLOTTER* aPlotter,
|
void BITMAP_BASE::PlotImage( PLOTTER* aPlotter,
|
||||||
wxPoint aPos,
|
const wxPoint& aPos,
|
||||||
int aDefaultColor,
|
EDA_COLOR_T aDefaultColor,
|
||||||
int aDefaultPensize )
|
int aDefaultPensize )
|
||||||
{
|
{
|
||||||
if( m_image == NULL )
|
if( m_image == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// These 2 lines are useful only fot plotters that cannot plot a bitmap
|
// These 2 lines are useful only fot plotters that cannot plot a bitmap
|
||||||
// and plot arectangle instead of.
|
// and plot arectangle instead of.
|
||||||
aPlotter->set_color( aDefaultColor );
|
aPlotter->SetColor( aDefaultColor );
|
||||||
aPlotter->set_current_line_width( aDefaultPensize );
|
aPlotter->SetCurrentLineWidth( aDefaultPensize );
|
||||||
|
|
||||||
aPlotter->PlotImage( *m_image, aPos, GetScalingFactor() );
|
aPlotter->PlotImage( *m_image, aPos, GetScalingFactor() );
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,13 @@
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <pcbnew.h>
|
|
||||||
#include <wxPcbStruct.h>
|
|
||||||
#include <class_board_design_settings.h>
|
|
||||||
#include <colors_selection.h>
|
#include <colors_selection.h>
|
||||||
#include <layers_id_colors_and_visibility.h>
|
#include <layers_id_colors_and_visibility.h>
|
||||||
#include <bitmaps.h>
|
#include <bitmaps.h>
|
||||||
#include <hotkeys.h>
|
#include <colors.h>
|
||||||
#include <help_common_strings.h>
|
|
||||||
|
|
||||||
#include <class_board.h>
|
|
||||||
|
|
||||||
|
#include <wx/wx.h>
|
||||||
#include <wx/ownerdrw.h>
|
#include <wx/ownerdrw.h>
|
||||||
#include <wx/menuitem.h>
|
#include <wx/menuitem.h>
|
||||||
#include <wx/bmpcbox.h>
|
#include <wx/aui/aui.h>
|
||||||
#include <wx/wx.h>
|
|
||||||
|
|
||||||
#include <class_layer_box_selector.h>
|
#include <class_layer_box_selector.h>
|
||||||
|
|
||||||
|
@ -101,79 +95,30 @@ int LAYER_BOX_SELECTOR::SetLayerSelection( int layer )
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Reload the Layers
|
|
||||||
void LAYER_BOX_SELECTOR::Resync()
|
|
||||||
{
|
|
||||||
PCB_BASE_FRAME* pcbFrame = (PCB_BASE_FRAME*) GetParent()->GetParent();
|
|
||||||
BOARD* board = pcbFrame->GetBoard();
|
|
||||||
|
|
||||||
wxASSERT( board != NULL );
|
|
||||||
|
|
||||||
Clear();
|
|
||||||
|
|
||||||
static DECLARE_LAYERS_ORDER_LIST( layertranscode );
|
|
||||||
static DECLARE_LAYERS_HOTKEY( layerhk );
|
|
||||||
|
|
||||||
for( int i = 0; i < LAYER_COUNT; i++ )
|
|
||||||
{
|
|
||||||
wxBitmap layerbmp( 14, 14 );
|
|
||||||
wxMemoryDC bmpDC;
|
|
||||||
wxBrush brush;
|
|
||||||
wxString layername;
|
|
||||||
int layerid = i;
|
|
||||||
|
|
||||||
if( m_layerorder )
|
|
||||||
layerid = layertranscode[i];
|
|
||||||
|
|
||||||
if( !board->IsLayerEnabled( layerid ) )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// Prepare Bitmap
|
|
||||||
bmpDC.SelectObject( layerbmp );
|
|
||||||
brush.SetColour( MakeColour( board->GetLayerColor( layerid ) ) );
|
|
||||||
brush.SetStyle( wxSOLID );
|
|
||||||
|
|
||||||
bmpDC.SetBrush( brush );
|
|
||||||
bmpDC.DrawRectangle( 0, 0, layerbmp.GetWidth(), layerbmp.GetHeight() );
|
|
||||||
bmpDC.SetBrush( *wxTRANSPARENT_BRUSH );
|
|
||||||
bmpDC.SetPen( *wxBLACK_PEN );
|
|
||||||
bmpDC.DrawRectangle( 0, 0, layerbmp.GetWidth(), layerbmp.GetHeight() );
|
|
||||||
|
|
||||||
layername = board->GetLayerName( layerid );
|
|
||||||
|
|
||||||
if( m_layerhotkeys && m_hotkeys != NULL )
|
|
||||||
layername = AddHotkeyName( layername, m_hotkeys, layerhk[layerid], IS_COMMENT );
|
|
||||||
|
|
||||||
Append( layername, layerbmp, (void*) layerid );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LAYER_BOX_SELECTOR::ResyncBitmapOnly()
|
void LAYER_BOX_SELECTOR::ResyncBitmapOnly()
|
||||||
{
|
{
|
||||||
PCB_BASE_FRAME* pcbFrame = (PCB_BASE_FRAME*) GetParent()->GetParent();
|
|
||||||
BOARD* board = pcbFrame->GetBoard();
|
|
||||||
|
|
||||||
int elements = GetCount();
|
int elements = GetCount();
|
||||||
for( int i = 0; i < elements; i++ )
|
for( int i = 0; i < elements; i++ )
|
||||||
{
|
{
|
||||||
wxBitmap layerbmp( 14, 14 );
|
wxBitmap layerbmp( 14, 14 );
|
||||||
wxMemoryDC bmpDC;
|
SetBitmapLayer( layerbmp, i );
|
||||||
wxBrush brush;
|
|
||||||
wxString layername;
|
|
||||||
int layerid = i;
|
|
||||||
|
|
||||||
// Prepare Bitmap
|
|
||||||
bmpDC.SelectObject( layerbmp );
|
|
||||||
brush.SetColour( MakeColour( board->GetLayerColor( layerid ) ) );
|
|
||||||
brush.SetStyle( wxSOLID );
|
|
||||||
|
|
||||||
bmpDC.SetBrush( brush );
|
|
||||||
bmpDC.DrawRectangle( 0, 0, layerbmp.GetWidth(), layerbmp.GetHeight() );
|
|
||||||
bmpDC.SetBrush( *wxTRANSPARENT_BRUSH );
|
|
||||||
bmpDC.SetPen( *wxBLACK_PEN );
|
|
||||||
bmpDC.DrawRectangle( 0, 0, layerbmp.GetWidth(), layerbmp.GetHeight() );
|
|
||||||
|
|
||||||
SetItemBitmap(i, layerbmp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LAYER_BOX_SELECTOR::SetBitmapLayer( wxBitmap& aLayerbmp, int aLayerIndex )
|
||||||
|
{
|
||||||
|
wxMemoryDC bmpDC;
|
||||||
|
wxBrush brush;
|
||||||
|
|
||||||
|
// Prepare Bitmap
|
||||||
|
bmpDC.SelectObject( aLayerbmp );
|
||||||
|
brush.SetColour( MakeColour( GetLayerColor( aLayerIndex ) ) );
|
||||||
|
brush.SetStyle( wxSOLID );
|
||||||
|
|
||||||
|
bmpDC.SetBrush( brush );
|
||||||
|
bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
|
||||||
|
bmpDC.SetBrush( *wxTRANSPARENT_BRUSH );
|
||||||
|
bmpDC.SetPen( *wxBLACK_PEN );
|
||||||
|
bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
|
||||||
|
}
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
/******************************************
|
/**
|
||||||
* class_plotter.cpp
|
* @file class_plotter.cpp
|
||||||
* the class PLOTTER handle basic functions to plot schematic and boards
|
* @brief KiCad: Base of all the plot routines
|
||||||
* with different plot formats.
|
* the class PLOTTER handle basic functions to plot schematic and boards
|
||||||
* currently formats are:*
|
* with different plot formats.
|
||||||
* HPGL
|
*
|
||||||
* POSTSCRIPT
|
* There are currently engines for:
|
||||||
* GERBER
|
* HPGL
|
||||||
* DXF
|
* POSTSCRIPT
|
||||||
******************************************/
|
* GERBER
|
||||||
|
* DXF
|
||||||
|
* an SVG 'plot' is also provided along with the 'print' function by wx, but
|
||||||
|
* is not handled here.
|
||||||
|
*/
|
||||||
|
|
||||||
#include <fctsys.h>
|
#include <fctsys.h>
|
||||||
|
|
||||||
|
@ -21,112 +25,152 @@
|
||||||
#include <class_base_screen.h>
|
#include <class_base_screen.h>
|
||||||
#include <drawtxt.h>
|
#include <drawtxt.h>
|
||||||
|
|
||||||
PLOTTER::PLOTTER( PlotFormat aPlotType )
|
PLOTTER::PLOTTER( )
|
||||||
{
|
{
|
||||||
m_PlotType = aPlotType;
|
plotScale = 1;
|
||||||
plot_scale = 1;
|
defaultPenWidth = 0;
|
||||||
default_pen_width = 0;
|
currentPenWidth = -1; // To-be-set marker
|
||||||
current_pen_width = -1; /* To-be-set marker */
|
penState = 'Z'; // End-of-path idle
|
||||||
pen_state = 'Z'; /* End-of-path idle */
|
plotMirror = 0; // Mirror flag
|
||||||
plotMirror = 0; /* Mirror flag */
|
outputFile = 0;
|
||||||
output_file = 0;
|
colorMode = false; // Starts as a BW plot
|
||||||
color_mode = false; /* Start as a BW plot */
|
negativeMode = false;
|
||||||
negative_mode = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Modifies coordinates pos.x and pos.y trace according to the orientation,
|
/**
|
||||||
* scale factor, and offsets trace
|
* Modifies coordinates according to the orientation,
|
||||||
|
* scale factor, and offsets trace. Also convert from a wxPoint to DPOINT,
|
||||||
|
* since some output engines needs floating point coordinates.
|
||||||
*/
|
*/
|
||||||
void PLOTTER::user_to_device_coordinates( wxPoint& pos )
|
DPOINT PLOTTER::userToDeviceCoordinates( const wxPoint& pos )
|
||||||
{
|
{
|
||||||
pos.x = (int) ( (pos.x - plot_offset.x) * plot_scale * device_scale );
|
double x = (pos.x - plotOffset.x) * plotScale * iuPerDeviceUnit;
|
||||||
|
double y;
|
||||||
|
|
||||||
if( plotMirror )
|
if( plotMirror )
|
||||||
pos.y = (int) ( ( pos.y - plot_offset.y ) * plot_scale * device_scale );
|
y = ( pos.y - plotOffset.y ) * plotScale * iuPerDeviceUnit ;
|
||||||
else
|
else
|
||||||
pos.y = (int) ( ( paper_size.y - ( pos.y - plot_offset.y )
|
y = ( paperSize.y - ( pos.y - plotOffset.y )
|
||||||
* plot_scale ) * device_scale );
|
* plotScale ) * iuPerDeviceUnit ;
|
||||||
|
return DPOINT( x, y );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modifies size according to the plotter scale factors
|
||||||
|
* (wxSize version, returns a DPOINT)
|
||||||
|
*/
|
||||||
|
DPOINT PLOTTER::userToDeviceSize( const wxSize& size )
|
||||||
|
{
|
||||||
|
return DPOINT( size.x * plotScale * iuPerDeviceUnit,
|
||||||
|
size.y * plotScale * iuPerDeviceUnit );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modifies size according to the plotter scale factors
|
||||||
|
* (simple double version)
|
||||||
|
*/
|
||||||
|
double PLOTTER::userToDeviceSize( double size )
|
||||||
|
{
|
||||||
|
return size * plotScale * iuPerDeviceUnit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Generic arc rendered as a polyline */
|
/**
|
||||||
void PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int radius,
|
* Generic fallback: arc rendered as a polyline
|
||||||
|
*/
|
||||||
|
void PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int radius,
|
||||||
FILL_T fill, int width )
|
FILL_T fill, int width )
|
||||||
{
|
{
|
||||||
wxPoint start, end;
|
wxPoint start, end;
|
||||||
const int delta = 50; /* increment (in 0.1 degrees) to draw circles */
|
const int delta = 50; // increment (in 0.1 degrees) to draw circles
|
||||||
double alpha;
|
double alpha;
|
||||||
|
|
||||||
if( StAngle > EndAngle )
|
if( StAngle > EndAngle )
|
||||||
EXCHG( StAngle, EndAngle );
|
EXCHG( StAngle, EndAngle );
|
||||||
|
|
||||||
set_current_line_width( width );
|
SetCurrentLineWidth( width );
|
||||||
/* Please NOTE the different sign due to Y-axis flip */
|
/* Please NOTE the different sign due to Y-axis flip */
|
||||||
alpha = StAngle / 1800.0 * M_PI;
|
alpha = DEG2RAD( StAngle / 10.0 );
|
||||||
start.x = centre.x + (int) ( radius * cos( -alpha ) );
|
start.x = centre.x + (int) ( radius * cos( -alpha ) );
|
||||||
start.y = centre.y + (int) ( radius * sin( -alpha ) );
|
start.y = centre.y + (int) ( radius * sin( -alpha ) );
|
||||||
move_to( start );
|
MoveTo( start );
|
||||||
for( int ii = StAngle + delta; ii < EndAngle; ii += delta )
|
for( int ii = StAngle + delta; ii < EndAngle; ii += delta )
|
||||||
{
|
{
|
||||||
alpha = ii / 1800.0 * M_PI;
|
alpha = DEG2RAD( ii / 10.0 );
|
||||||
end.x = centre.x + (int) ( radius * cos( -alpha ) );
|
end.x = centre.x + (int) ( radius * cos( -alpha ) );
|
||||||
end.y = centre.y + (int) ( radius * sin( -alpha ) );
|
end.y = centre.y + (int) ( radius * sin( -alpha ) );
|
||||||
line_to( end );
|
LineTo( end );
|
||||||
}
|
}
|
||||||
|
|
||||||
alpha = EndAngle / 1800.0 * M_PI;
|
alpha = DEG2RAD( EndAngle / 10.0 );
|
||||||
end.x = centre.x + (int) ( radius * cos( -alpha ) );
|
end.x = centre.x + (int) ( radius * cos( -alpha ) );
|
||||||
end.y = centre.y + (int) ( radius * sin( -alpha ) );
|
end.y = centre.y + (int) ( radius * sin( -alpha ) );
|
||||||
finish_to( end );
|
FinishTo( end );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fallback: if it doesn't handle bitmaps, we plot a rectangle
|
||||||
|
*/
|
||||||
|
void PLOTTER::PlotImage(const wxImage & aImage, const wxPoint& aPos,
|
||||||
|
double aScaleFactor )
|
||||||
|
{
|
||||||
|
wxSize size( aImage.GetWidth() * aScaleFactor,
|
||||||
|
aImage.GetHeight() * aScaleFactor );
|
||||||
|
|
||||||
|
wxPoint start = aPos;
|
||||||
|
start.x -= size.x / 2;
|
||||||
|
start.y -= size.y / 2;
|
||||||
|
|
||||||
|
wxPoint end = start;
|
||||||
|
end.x += size.x;
|
||||||
|
end.y += size.y;
|
||||||
|
|
||||||
|
Rect( start, end, NO_FILL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Modifies size size.x and size.y trace according to the scale factor. */
|
/**
|
||||||
void PLOTTER::user_to_device_size( wxSize& size )
|
* Plot a square centered on the position. Building block for markers
|
||||||
|
*/
|
||||||
|
void PLOTTER::markerSquare( const wxPoint& position, int radius )
|
||||||
{
|
{
|
||||||
size.x = (int) ( size.x * plot_scale * device_scale );
|
double r = KiROUND( radius / 1.4142 );
|
||||||
size.y = (int) ( size.y * plot_scale * device_scale );
|
std::vector< wxPoint > corner_list;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
double PLOTTER::user_to_device_size( double size )
|
|
||||||
{
|
|
||||||
return size * plot_scale * device_scale;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PLOTTER::center_square( const wxPoint& position, int diametre, FILL_T fill )
|
|
||||||
{
|
|
||||||
int radius = KiROUND( diametre / 2.8284 );
|
|
||||||
static std::vector< wxPoint > corner_list;
|
|
||||||
corner_list.clear();
|
|
||||||
wxPoint corner;
|
wxPoint corner;
|
||||||
corner.x = position.x + radius;
|
corner.x = position.x + r;
|
||||||
corner.y = position.y + radius;
|
corner.y = position.y + r;
|
||||||
corner_list.push_back( corner );
|
corner_list.push_back( corner );
|
||||||
corner.x = position.x + radius;
|
corner.x = position.x + r;
|
||||||
corner.y = position.y - radius;
|
corner.y = position.y - r;
|
||||||
corner_list.push_back( corner );
|
corner_list.push_back( corner );
|
||||||
corner.x = position.x - radius;
|
corner.x = position.x - r;
|
||||||
corner.y = position.y - radius;
|
corner.y = position.y - r;
|
||||||
corner_list.push_back( corner );
|
corner_list.push_back( corner );
|
||||||
corner.x = position.x - radius;
|
corner.x = position.x - r;
|
||||||
corner.y = position.y + radius;
|
corner.y = position.y + r;
|
||||||
corner_list.push_back( corner );
|
corner_list.push_back( corner );
|
||||||
corner.x = position.x + radius;
|
corner.x = position.x + r;
|
||||||
corner.y = position.y + radius;
|
corner.y = position.y + r;
|
||||||
corner_list.push_back( corner );
|
corner_list.push_back( corner );
|
||||||
|
|
||||||
PlotPoly( corner_list, fill );
|
PlotPoly( corner_list, NO_FILL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
void PLOTTER::center_lozenge( const wxPoint& position, int diametre, FILL_T fill )
|
* Plot a circle centered on the position. Building block for markers
|
||||||
|
*/
|
||||||
|
void PLOTTER::markerCircle( const wxPoint& position, int radius )
|
||||||
{
|
{
|
||||||
int radius = diametre / 2;
|
Circle( position, radius * 2, NO_FILL );
|
||||||
static std::vector< wxPoint > corner_list;
|
}
|
||||||
corner_list.clear();
|
|
||||||
|
/**
|
||||||
|
* Plot a lozenge centered on the position. Building block for markers
|
||||||
|
*/
|
||||||
|
void PLOTTER::markerLozenge( const wxPoint& position, int radius )
|
||||||
|
{
|
||||||
|
std::vector< wxPoint > corner_list;
|
||||||
wxPoint corner;
|
wxPoint corner;
|
||||||
corner.x = position.x;
|
corner.x = position.x;
|
||||||
corner.y = position.y + radius;
|
corner.y = position.y + radius;
|
||||||
|
@ -144,115 +188,163 @@ void PLOTTER::center_lozenge( const wxPoint& position, int diametre, FILL_T fill
|
||||||
corner.y = position.y + radius;
|
corner.y = position.y + radius;
|
||||||
corner_list.push_back( corner );
|
corner_list.push_back( corner );
|
||||||
|
|
||||||
PlotPoly( corner_list, fill );
|
PlotPoly( corner_list, NO_FILL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Plot a - bar centered on the position. Building block for markers
|
||||||
|
*/
|
||||||
|
void PLOTTER::markerHBar( const wxPoint& pos, int radius )
|
||||||
|
{
|
||||||
|
MoveTo( wxPoint( pos.x - radius, pos.y ) );
|
||||||
|
FinishTo( wxPoint( pos.x + radius, pos.y ) );
|
||||||
|
}
|
||||||
|
|
||||||
/* Draw a pattern shape number aShapeId, to coord x0, y0.
|
/**
|
||||||
|
* Plot a / bar centered on the position. Building block for markers
|
||||||
|
*/
|
||||||
|
void PLOTTER::markerSlash( const wxPoint& pos, int radius )
|
||||||
|
{
|
||||||
|
MoveTo( wxPoint( pos.x - radius, pos.y - radius ) );
|
||||||
|
FinishTo( wxPoint( pos.x + radius, pos.y + radius ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Plot a \ bar centered on the position. Building block for markers
|
||||||
|
*/
|
||||||
|
void PLOTTER::markerBackSlash( const wxPoint& pos, int radius )
|
||||||
|
{
|
||||||
|
MoveTo( wxPoint( pos.x + radius, pos.y - radius ) );
|
||||||
|
FinishTo( wxPoint( pos.x - radius, pos.y + radius ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Plot a | bar centered on the position. Building block for markers
|
||||||
|
*/
|
||||||
|
void PLOTTER::markerVBar( const wxPoint& pos, int radius )
|
||||||
|
{
|
||||||
|
MoveTo( wxPoint( pos.x, pos.y - radius ) );
|
||||||
|
FinishTo( wxPoint( pos.x, pos.y + radius ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw a pattern shape number aShapeId, to coord x0, y0.
|
||||||
* x0, y0 = coordinates tables
|
* x0, y0 = coordinates tables
|
||||||
* Diameter diameter = (coord table) hole
|
* Diameter diameter = (coord table) hole
|
||||||
* AShapeId = index (used to generate forms characters)
|
* AShapeId = index (used to generate forms characters)
|
||||||
*/
|
*/
|
||||||
void PLOTTER::marker( const wxPoint& position, int diametre, int aShapeId )
|
void PLOTTER::Marker( const wxPoint& position, int diametre, unsigned aShapeId )
|
||||||
{
|
{
|
||||||
int radius = diametre / 2;
|
int radius = diametre / 2;
|
||||||
|
/* Marker are composed by a series of 'parts' superimposed; not every
|
||||||
int x0, y0;
|
combination make sense, obviously. Since they are used in order I
|
||||||
|
tried to keep the uglier/more complex constructions at the end.
|
||||||
x0 = position.x; y0 = position.y;
|
Also I avoided the |/ |\ -/ -\ construction because they're *very*
|
||||||
|
ugly... if needed they could be added anyway... I'd like to see
|
||||||
switch( aShapeId )
|
a board with more than 58 drilling/slotting tools!
|
||||||
|
If Visual C++ supported the 0b literals they would be optimally
|
||||||
|
and easily encoded as an integer array. We have to do with octal */
|
||||||
|
static const unsigned char marker_patterns[MARKER_COUNT] = {
|
||||||
|
// Bit order: O Square Lozenge - | \ /
|
||||||
|
// First choice: simple shapes
|
||||||
|
0003, // X
|
||||||
|
0100, // O
|
||||||
|
0014, // +
|
||||||
|
0040, // Sq
|
||||||
|
0020, // Lz
|
||||||
|
// Two simple shapes
|
||||||
|
0103, // X O
|
||||||
|
0017, // X +
|
||||||
|
0043, // X Sq
|
||||||
|
0023, // X Lz
|
||||||
|
0114, // O +
|
||||||
|
0140, // O Sq
|
||||||
|
0120, // O Lz
|
||||||
|
0054, // + Sq
|
||||||
|
0034, // + Lz
|
||||||
|
0060, // Sq Lz
|
||||||
|
// Three simple shapes
|
||||||
|
0117, // X O +
|
||||||
|
0143, // X O Sq
|
||||||
|
0123, // X O Lz
|
||||||
|
0057, // X + Sq
|
||||||
|
0037, // X + Lz
|
||||||
|
0063, // X Sq Lz
|
||||||
|
0154, // O + Sq
|
||||||
|
0134, // O + Lz
|
||||||
|
0074, // + Sq Lz
|
||||||
|
// Four simple shapes
|
||||||
|
0174, // O Sq Lz +
|
||||||
|
0163, // X O Sq Lz
|
||||||
|
0157, // X O Sq +
|
||||||
|
0137, // X O Lz +
|
||||||
|
0077, // X Sq Lz +
|
||||||
|
// This draws *everything *
|
||||||
|
0177, // X O Sq Lz +
|
||||||
|
// Here we use the single bars... so the cross is forbidden
|
||||||
|
0110, // O -
|
||||||
|
0104, // O |
|
||||||
|
0101, // O /
|
||||||
|
0050, // Sq -
|
||||||
|
0044, // Sq |
|
||||||
|
0041, // Sq /
|
||||||
|
0030, // Lz -
|
||||||
|
0024, // Lz |
|
||||||
|
0021, // Lz /
|
||||||
|
0150, // O Sq -
|
||||||
|
0144, // O Sq |
|
||||||
|
0141, // O Sq /
|
||||||
|
0130, // O Lz -
|
||||||
|
0124, // O Lz |
|
||||||
|
0121, // O Lz /
|
||||||
|
0070, // Sq Lz -
|
||||||
|
0064, // Sq Lz |
|
||||||
|
0061, // Sq Lz /
|
||||||
|
0170, // O Sq Lz -
|
||||||
|
0164, // O Sq Lz |
|
||||||
|
0161, // O Sq Lz /
|
||||||
|
// Last resort: the backlash component (easy to confound)
|
||||||
|
0102, // \ O
|
||||||
|
0042, // \ Sq
|
||||||
|
0022, // \ Lz
|
||||||
|
0142, // \ O Sq
|
||||||
|
0122, // \ O Lz
|
||||||
|
0062, // \ Sq Lz
|
||||||
|
0162 // \ O Sq Lz
|
||||||
|
};
|
||||||
|
if( aShapeId >= MARKER_COUNT )
|
||||||
{
|
{
|
||||||
case 0: /* vias : X shape */
|
// Fallback shape
|
||||||
move_to( wxPoint( x0 - radius, y0 - radius ) );
|
markerCircle( position, radius );
|
||||||
line_to( wxPoint( x0 + radius, y0 + radius ) );
|
}
|
||||||
move_to( wxPoint( x0 + radius, y0 - radius ) );
|
else
|
||||||
finish_to( wxPoint( x0 - radius, y0 + radius ) );
|
{
|
||||||
break;
|
// Decode the pattern and draw the corresponding parts
|
||||||
|
unsigned char pat = marker_patterns[aShapeId];
|
||||||
case 1: /* Circle */
|
if( pat & 0001 )
|
||||||
circle( position, diametre, NO_FILL );
|
markerSlash( position, radius );
|
||||||
break;
|
if( pat & 0002 )
|
||||||
|
markerBackSlash( position, radius );
|
||||||
case 2: /* + shape */
|
if( pat & 0004 )
|
||||||
move_to( wxPoint( x0, y0 - radius ) );
|
markerVBar( position, radius );
|
||||||
line_to( wxPoint( x0, y0 + radius ) );
|
if( pat & 0010 )
|
||||||
move_to( wxPoint( x0 + radius, y0 ) );
|
markerHBar( position, radius );
|
||||||
finish_to( wxPoint( x0 - radius, y0 ) );
|
if( pat & 0020 )
|
||||||
break;
|
markerLozenge( position, radius );
|
||||||
|
if( pat & 0040 )
|
||||||
case 3: /* X shape in circle */
|
markerSquare( position, radius );
|
||||||
circle( position, diametre, NO_FILL );
|
if( pat & 0100 )
|
||||||
move_to( wxPoint( x0 - radius, y0 - radius ) );
|
markerCircle( position, radius );
|
||||||
line_to( wxPoint( x0 + radius, y0 + radius ) );
|
|
||||||
move_to( wxPoint( x0 + radius, y0 - radius ) );
|
|
||||||
finish_to( wxPoint( x0 - radius, y0 + radius ) );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 4: /* circle with bar - shape */
|
|
||||||
circle( position, diametre, NO_FILL );
|
|
||||||
move_to( wxPoint( x0 - radius, y0 ) );
|
|
||||||
finish_to( wxPoint( x0 + radius, y0 ) );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 5: /* circle with bar | shape */
|
|
||||||
circle( position, diametre, NO_FILL );
|
|
||||||
move_to( wxPoint( x0, y0 - radius ) );
|
|
||||||
finish_to( wxPoint( x0, y0 + radius ) );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 6: /* square */
|
|
||||||
center_square( position, diametre, NO_FILL );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 7: /* diamond */
|
|
||||||
center_lozenge( position, diametre, NO_FILL );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 8: /* square with an X*/
|
|
||||||
center_square( position, diametre, NO_FILL );
|
|
||||||
move_to( wxPoint( x0 - radius, y0 - radius ) );
|
|
||||||
line_to( wxPoint( x0 + radius, y0 + radius ) );
|
|
||||||
move_to( wxPoint( x0 + radius, y0 - radius ) );
|
|
||||||
finish_to( wxPoint( x0 - radius, y0 + radius ) );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 9: /* diamond with a +*/
|
|
||||||
center_lozenge( position, diametre, NO_FILL );
|
|
||||||
move_to( wxPoint( x0, y0 - radius ) );
|
|
||||||
line_to( wxPoint( x0, y0 + radius ) );
|
|
||||||
move_to( wxPoint( x0 + radius, y0 ) );
|
|
||||||
finish_to( wxPoint( x0 - radius, y0 ) );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 10: /* square with a '/' */
|
|
||||||
center_square( position, diametre, NO_FILL );
|
|
||||||
move_to( wxPoint( x0 - radius, y0 - radius ) );
|
|
||||||
finish_to( wxPoint( x0 + radius, y0 + radius ) );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 11: /* square with a |*/
|
|
||||||
center_lozenge( position, diametre, NO_FILL );
|
|
||||||
move_to( wxPoint( x0, y0 - radius ) );
|
|
||||||
finish_to( wxPoint( x0, y0 + radius ) );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 12: /* square with a -*/
|
|
||||||
center_lozenge( position, diametre, NO_FILL );
|
|
||||||
move_to( wxPoint( x0 - radius, y0 ) );
|
|
||||||
finish_to( wxPoint( x0 + radius, y0 ) );
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
circle( position, diametre, NO_FILL );
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Convert a thick segment and plot it as an oval */
|
/**
|
||||||
void PLOTTER::segment_as_oval( wxPoint start, wxPoint end, int width,
|
* Convert a thick segment and plot it as an oval
|
||||||
EDA_DRAW_MODE_T tracemode )
|
*/
|
||||||
|
void PLOTTER::segmentAsOval( const wxPoint& start, const wxPoint& end, int width,
|
||||||
|
EDA_DRAW_MODE_T tracemode )
|
||||||
{
|
{
|
||||||
wxPoint center( (start.x + end.x) / 2, (start.y + end.y) / 2 );
|
wxPoint center( (start.x + end.x) / 2, (start.y + end.y) / 2 );
|
||||||
wxSize size( end.x - start.x, end.y - start.y );
|
wxSize size( end.x - start.x, end.y - start.y );
|
||||||
|
@ -263,22 +355,22 @@ void PLOTTER::segment_as_oval( wxPoint start, wxPoint end, int width,
|
||||||
else if( size.x == 0 )
|
else if( size.x == 0 )
|
||||||
orient = 900;
|
orient = 900;
|
||||||
else
|
else
|
||||||
orient = -(int) ( atan2( (double) size.y,
|
orient = -(int) ( RAD2DEG( atan2( size.y, size.x ) ) * 10.0 );
|
||||||
(double) size.x ) * 1800.0 / M_PI );
|
|
||||||
size.x = (int) sqrt( ( (double) size.x * size.x )
|
size.x = (int) sqrt( ( (double) size.x * size.x )
|
||||||
+ ( (double) size.y * size.y ) ) + width;
|
+ ( (double) size.y * size.y ) ) + width;
|
||||||
size.y = width;
|
size.y = width;
|
||||||
|
|
||||||
flash_pad_oval( center, size, orient, tracemode );
|
FlashPadOval( center, size, orient, tracemode );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PLOTTER::sketch_oval( wxPoint pos, wxSize size, int orient,
|
void PLOTTER::sketchOval( const wxPoint& pos, const wxSize& aSize, int orient,
|
||||||
int width )
|
int width )
|
||||||
{
|
{
|
||||||
set_current_line_width( width );
|
SetCurrentLineWidth( width );
|
||||||
width = current_pen_width;
|
width = currentPenWidth;
|
||||||
int radius, deltaxy, cx, cy;
|
int radius, deltaxy, cx, cy;
|
||||||
|
wxSize size( aSize );
|
||||||
|
|
||||||
if( size.x > size.y )
|
if( size.x > size.y )
|
||||||
{
|
{
|
||||||
|
@ -293,31 +385,31 @@ void PLOTTER::sketch_oval( wxPoint pos, wxSize size, int orient,
|
||||||
cx = -radius;
|
cx = -radius;
|
||||||
cy = -deltaxy / 2;
|
cy = -deltaxy / 2;
|
||||||
RotatePoint( &cx, &cy, orient );
|
RotatePoint( &cx, &cy, orient );
|
||||||
move_to( wxPoint( cx + pos.x, cy + pos.y ) );
|
MoveTo( wxPoint( cx + pos.x, cy + pos.y ) );
|
||||||
cx = -radius;
|
cx = -radius;
|
||||||
cy = deltaxy / 2;
|
cy = deltaxy / 2;
|
||||||
RotatePoint( &cx, &cy, orient );
|
RotatePoint( &cx, &cy, orient );
|
||||||
finish_to( wxPoint( cx + pos.x, cy + pos.y ) );
|
FinishTo( wxPoint( cx + pos.x, cy + pos.y ) );
|
||||||
|
|
||||||
cx = radius;
|
cx = radius;
|
||||||
cy = -deltaxy / 2;
|
cy = -deltaxy / 2;
|
||||||
RotatePoint( &cx, &cy, orient );
|
RotatePoint( &cx, &cy, orient );
|
||||||
move_to( wxPoint( cx + pos.x, cy + pos.y ) );
|
MoveTo( wxPoint( cx + pos.x, cy + pos.y ) );
|
||||||
cx = radius;
|
cx = radius;
|
||||||
cy = deltaxy / 2;
|
cy = deltaxy / 2;
|
||||||
RotatePoint( &cx, &cy, orient );
|
RotatePoint( &cx, &cy, orient );
|
||||||
finish_to( wxPoint( cx + pos.x, cy + pos.y ) );
|
FinishTo( wxPoint( cx + pos.x, cy + pos.y ) );
|
||||||
|
|
||||||
cx = 0;
|
cx = 0;
|
||||||
cy = deltaxy / 2;
|
cy = deltaxy / 2;
|
||||||
RotatePoint( &cx, &cy, orient );
|
RotatePoint( &cx, &cy, orient );
|
||||||
arc( wxPoint( cx + pos.x, cy + pos.y ),
|
Arc( wxPoint( cx + pos.x, cy + pos.y ),
|
||||||
orient + 1800, orient + 3600,
|
orient + 1800, orient + 3600,
|
||||||
radius, NO_FILL );
|
radius, NO_FILL );
|
||||||
cx = 0;
|
cx = 0;
|
||||||
cy = -deltaxy / 2;
|
cy = -deltaxy / 2;
|
||||||
RotatePoint( &cx, &cy, orient );
|
RotatePoint( &cx, &cy, orient );
|
||||||
arc( wxPoint( cx + pos.x, cy + pos.y ),
|
Arc( wxPoint( cx + pos.x, cy + pos.y ),
|
||||||
orient, orient + 1800,
|
orient, orient + 1800,
|
||||||
radius, NO_FILL );
|
radius, NO_FILL );
|
||||||
}
|
}
|
||||||
|
@ -325,98 +417,98 @@ void PLOTTER::sketch_oval( wxPoint pos, wxSize size, int orient,
|
||||||
|
|
||||||
/* Plot 1 segment like a track segment
|
/* Plot 1 segment like a track segment
|
||||||
*/
|
*/
|
||||||
void PLOTTER::thick_segment( wxPoint start, wxPoint end, int width,
|
void PLOTTER::ThickSegment( const wxPoint& start, const wxPoint& end, int width,
|
||||||
EDA_DRAW_MODE_T tracemode )
|
|
||||||
{
|
|
||||||
switch( tracemode )
|
|
||||||
{
|
|
||||||
case FILLED:
|
|
||||||
case LINE:
|
|
||||||
set_current_line_width( tracemode==FILLED ? width : -1 );
|
|
||||||
move_to( start );
|
|
||||||
finish_to( end );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SKETCH:
|
|
||||||
set_current_line_width( -1 );
|
|
||||||
segment_as_oval( start, end, width, tracemode );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PLOTTER::thick_arc( wxPoint centre, int StAngle, int EndAngle, int radius,
|
|
||||||
int width, EDA_DRAW_MODE_T tracemode )
|
|
||||||
{
|
|
||||||
switch( tracemode )
|
|
||||||
{
|
|
||||||
case LINE:
|
|
||||||
set_current_line_width( -1 );
|
|
||||||
arc( centre, StAngle, EndAngle, radius, NO_FILL, -1 );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case FILLED:
|
|
||||||
arc( centre, StAngle, EndAngle, radius, NO_FILL, width );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SKETCH:
|
|
||||||
set_current_line_width( -1 );
|
|
||||||
arc( centre, StAngle, EndAngle,
|
|
||||||
radius - ( width - current_pen_width ) / 2, NO_FILL, -1 );
|
|
||||||
arc( centre, StAngle, EndAngle,
|
|
||||||
radius + ( width - current_pen_width ) / 2, NO_FILL, -1 );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PLOTTER::thick_rect( wxPoint p1, wxPoint p2, int width,
|
|
||||||
EDA_DRAW_MODE_T tracemode )
|
|
||||||
{
|
|
||||||
switch( tracemode )
|
|
||||||
{
|
|
||||||
case LINE:
|
|
||||||
rect( p1, p2, NO_FILL, -1 );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case FILLED:
|
|
||||||
rect( p1, p2, NO_FILL, width );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SKETCH:
|
|
||||||
set_current_line_width( -1 );
|
|
||||||
p1.x -= (width - current_pen_width) / 2;
|
|
||||||
p1.y -= (width - current_pen_width) / 2;
|
|
||||||
p2.x += (width - current_pen_width) / 2;
|
|
||||||
p2.y += (width - current_pen_width) / 2;
|
|
||||||
rect( p1, p2, NO_FILL, -1 );
|
|
||||||
p1.x += (width - current_pen_width);
|
|
||||||
p1.y += (width - current_pen_width);
|
|
||||||
p2.x -= (width - current_pen_width);
|
|
||||||
p2.y -= (width - current_pen_width);
|
|
||||||
rect( p1, p2, NO_FILL, -1 );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PLOTTER::thick_circle( wxPoint pos, int diametre, int width,
|
|
||||||
EDA_DRAW_MODE_T tracemode )
|
EDA_DRAW_MODE_T tracemode )
|
||||||
{
|
{
|
||||||
switch( tracemode )
|
switch( tracemode )
|
||||||
{
|
{
|
||||||
case LINE:
|
|
||||||
circle( pos, diametre, NO_FILL, -1 );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case FILLED:
|
case FILLED:
|
||||||
circle( pos, diametre, NO_FILL, width );
|
case LINE:
|
||||||
|
SetCurrentLineWidth( tracemode==FILLED ? width : -1 );
|
||||||
|
MoveTo( start );
|
||||||
|
FinishTo( end );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SKETCH:
|
case SKETCH:
|
||||||
set_current_line_width( -1 );
|
SetCurrentLineWidth( -1 );
|
||||||
circle( pos, diametre - width + current_pen_width, NO_FILL, -1 );
|
segmentAsOval( start, end, width, tracemode );
|
||||||
circle( pos, diametre + width - current_pen_width, NO_FILL, -1 );
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PLOTTER::ThickArc( const wxPoint& centre, int StAngle, int EndAngle, int radius,
|
||||||
|
int width, EDA_DRAW_MODE_T tracemode )
|
||||||
|
{
|
||||||
|
switch( tracemode )
|
||||||
|
{
|
||||||
|
case LINE:
|
||||||
|
SetCurrentLineWidth( -1 );
|
||||||
|
Arc( centre, StAngle, EndAngle, radius, NO_FILL, -1 );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case FILLED:
|
||||||
|
Arc( centre, StAngle, EndAngle, radius, NO_FILL, width );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SKETCH:
|
||||||
|
SetCurrentLineWidth( -1 );
|
||||||
|
Arc( centre, StAngle, EndAngle,
|
||||||
|
radius - ( width - currentPenWidth ) / 2, NO_FILL, -1 );
|
||||||
|
Arc( centre, StAngle, EndAngle,
|
||||||
|
radius + ( width - currentPenWidth ) / 2, NO_FILL, -1 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PLOTTER::ThickRect( const wxPoint& p1, const wxPoint& p2, int width,
|
||||||
|
EDA_DRAW_MODE_T tracemode )
|
||||||
|
{
|
||||||
|
switch( tracemode )
|
||||||
|
{
|
||||||
|
case LINE:
|
||||||
|
Rect( p1, p2, NO_FILL, -1 );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case FILLED:
|
||||||
|
Rect( p1, p2, NO_FILL, width );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SKETCH:
|
||||||
|
SetCurrentLineWidth( -1 );
|
||||||
|
wxPoint offsetp1( p1.x - (width - currentPenWidth) / 2,
|
||||||
|
p1.y - (width - currentPenWidth) / 2 );
|
||||||
|
wxPoint offsetp2( p2.x + (width - currentPenWidth) / 2,
|
||||||
|
p2.y + (width - currentPenWidth) / 2 );
|
||||||
|
Rect( offsetp1, offsetp2, NO_FILL, -1 );
|
||||||
|
offsetp1.x += (width - currentPenWidth);
|
||||||
|
offsetp1.y += (width - currentPenWidth);
|
||||||
|
offsetp2.x -= (width - currentPenWidth);
|
||||||
|
offsetp2.y -= (width - currentPenWidth);
|
||||||
|
Rect( offsetp1, offsetp2, NO_FILL, -1 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PLOTTER::ThickCircle( const wxPoint& pos, int diametre, int width,
|
||||||
|
EDA_DRAW_MODE_T tracemode )
|
||||||
|
{
|
||||||
|
switch( tracemode )
|
||||||
|
{
|
||||||
|
case LINE:
|
||||||
|
Circle( pos, diametre, NO_FILL, -1 );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case FILLED:
|
||||||
|
Circle( pos, diametre, NO_FILL, width );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SKETCH:
|
||||||
|
SetCurrentLineWidth( -1 );
|
||||||
|
Circle( pos, diametre - width + currentPenWidth, NO_FILL, -1 );
|
||||||
|
Circle( pos, diametre + width - currentPenWidth, NO_FILL, -1 );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -424,10 +516,7 @@ void PLOTTER::thick_circle( wxPoint pos, int diametre, int width,
|
||||||
|
|
||||||
void PLOTTER::SetPageSettings( const PAGE_INFO& aPageSettings )
|
void PLOTTER::SetPageSettings( const PAGE_INFO& aPageSettings )
|
||||||
{
|
{
|
||||||
wxASSERT( !output_file );
|
wxASSERT( !outputFile );
|
||||||
pageInfo = aPageSettings;
|
pageInfo = aPageSettings;
|
||||||
|
|
||||||
// PAGE_INFO is in mils, plotter works with deci-mils
|
|
||||||
paper_size = pageInfo.GetSizeMils() * 10;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -135,6 +135,21 @@ void SetLocaleTo_Default()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wxSize GetTextSize( const wxString& aSingleLine, wxWindow* aWindow )
|
||||||
|
{
|
||||||
|
wxCoord width;
|
||||||
|
wxCoord height;
|
||||||
|
|
||||||
|
{
|
||||||
|
wxClientDC dc( aWindow );
|
||||||
|
dc.SetFont( aWindow->GetFont() );
|
||||||
|
dc.GetTextExtent( aSingleLine, &width, &height );
|
||||||
|
}
|
||||||
|
|
||||||
|
return wxSize( width, height );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl, const wxString* aString )
|
bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl, const wxString* aString )
|
||||||
{
|
{
|
||||||
wxWindow* window = aCtrl->GetParent();
|
wxWindow* window = aCtrl->GetParent();
|
||||||
|
@ -150,21 +165,13 @@ bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl, const wxString* aString )
|
||||||
aString = &ctrlText;
|
aString = &ctrlText;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCoord width;
|
wxSize textz = GetTextSize( *aString, window );
|
||||||
wxCoord height;
|
wxSize ctrlz = aCtrl->GetSize();
|
||||||
|
|
||||||
|
if( ctrlz.GetWidth() < textz.GetWidth() + 10 )
|
||||||
{
|
{
|
||||||
wxClientDC dc( window );
|
ctrlz.SetWidth( textz.GetWidth() + 10 );
|
||||||
dc.SetFont( aCtrl->GetFont() );
|
aCtrl->SetSizeHints( ctrlz );
|
||||||
dc.GetTextExtent( *aString, &width, &height );
|
|
||||||
}
|
|
||||||
|
|
||||||
wxSize size = aCtrl->GetSize();
|
|
||||||
|
|
||||||
if( size.GetWidth() < width + 10 )
|
|
||||||
{
|
|
||||||
size.SetWidth( width + 10 );
|
|
||||||
aCtrl->SetSizeHints( size );
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,10 +325,10 @@ bool ProcessExecute( const wxString& aCommandLine, int aFlags )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned long GetNewTimeStamp()
|
time_t GetNewTimeStamp()
|
||||||
{
|
{
|
||||||
static unsigned long oldTimeStamp;
|
static time_t oldTimeStamp;
|
||||||
unsigned long newTimeStamp;
|
time_t newTimeStamp;
|
||||||
|
|
||||||
newTimeStamp = time( NULL );
|
newTimeStamp = time( NULL );
|
||||||
|
|
||||||
|
|
|
@ -12,252 +12,394 @@
|
||||||
#include <macros.h>
|
#include <macros.h>
|
||||||
#include <kicad_string.h>
|
#include <kicad_string.h>
|
||||||
|
|
||||||
|
/**
|
||||||
/* Set the plot offset for the current plotting
|
* Oblique angle for DXF native text
|
||||||
|
* (I don't remember if 15 degrees is the ISO value... it looks nice anyway)
|
||||||
*/
|
*/
|
||||||
void DXF_PLOTTER::set_viewport( wxPoint aOffset, double aScale, bool aMirror )
|
static const double DXF_OBLIQUE_ANGLE = 15;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the scale/position for the DXF plot
|
||||||
|
* The DXF engine doesn't support line widths and mirroring. The output
|
||||||
|
* coordinate system is in the first quadrant (in mm)
|
||||||
|
*/
|
||||||
|
void DXF_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
|
||||||
|
double aScale, bool aMirror )
|
||||||
{
|
{
|
||||||
wxASSERT( !output_file );
|
wxASSERT( !outputFile );
|
||||||
plot_offset = aOffset;
|
plotOffset = aOffset;
|
||||||
plot_scale = aScale;
|
plotScale = aScale;
|
||||||
device_scale = 1;
|
// XXX Need to think about this: what is the 'native' unit used for DXF?
|
||||||
set_default_line_width( 0 ); /* No line width on DXF */
|
iuPerDeviceUnit = 1.0 / aIusPerDecimil; // Gives a DXF in decimils
|
||||||
plotMirror = false; /* No mirroring on DXF */
|
iuPerDeviceUnit *= 0.00254; // DXF in mm (I like it best)
|
||||||
current_color = BLACK;
|
// Compute the paper size in IUs
|
||||||
|
paperSize = pageInfo.GetSizeMils();
|
||||||
|
paperSize.x *= 10.0 * aIusPerDecimil;
|
||||||
|
paperSize.y *= 10.0 * aIusPerDecimil;
|
||||||
|
SetDefaultLineWidth( 0 ); // No line width on DXF
|
||||||
|
plotMirror = false; // No mirroring on DXF
|
||||||
|
currentColor = BLACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
bool DXF_PLOTTER::start_plot( FILE* fout )
|
* Opens the DXF plot with a skeleton header
|
||||||
|
*/
|
||||||
|
bool DXF_PLOTTER::StartPlot( FILE* fout )
|
||||||
{
|
{
|
||||||
wxASSERT( !output_file );
|
wxASSERT( !outputFile );
|
||||||
output_file = fout;
|
outputFile = fout;
|
||||||
/* DXF HEADER - Boilerplate */
|
|
||||||
fputs( "0\nSECTION\n2\nHEADER\n9\n$ANGBASE\n50\n0.0\n9\n$ANGDIR\n70\n0\n0\nENDSEC\n0\nSECTION\n2\nTABLES\n0\nTABLE\n2\nLTYPE\n70\n1\n0\nLTYPE\n2\nCONTINUOUS\n70\n0\n3\nSolid line\n72\n65\n73\n0\n40\n0.0\n0\nENDTAB\n",
|
// DXF HEADER - Boilerplate
|
||||||
output_file );
|
// Defines the minimum for drawing i.e. the angle system and the
|
||||||
/* Layer table - one layer per color */
|
// continuous linetype
|
||||||
fprintf( output_file, "0\nTABLE\n2\nLAYER\n70\n%d\n", NBCOLOR );
|
fputs( " 0\n"
|
||||||
for( int i = 0; i<NBCOLOR; i++ )
|
"SECTION\n"
|
||||||
|
" 2\n"
|
||||||
|
"HEADER\n"
|
||||||
|
" 9\n"
|
||||||
|
"$ANGBASE\n"
|
||||||
|
" 50\n"
|
||||||
|
"0.0\n"
|
||||||
|
" 9\n"
|
||||||
|
"$ANGDIR\n"
|
||||||
|
" 70\n"
|
||||||
|
"0\n"
|
||||||
|
" 0\n"
|
||||||
|
"ENDSEC\n"
|
||||||
|
" 0\n"
|
||||||
|
"SECTION\n"
|
||||||
|
" 2\n"
|
||||||
|
"TABLES\n"
|
||||||
|
" 0\n"
|
||||||
|
"TABLE\n"
|
||||||
|
" 2\n"
|
||||||
|
"LTYPE\n"
|
||||||
|
" 70\n"
|
||||||
|
"1\n"
|
||||||
|
" 0\n"
|
||||||
|
"LTYPE\n"
|
||||||
|
" 2\n"
|
||||||
|
"CONTINUOUS\n"
|
||||||
|
" 70\n"
|
||||||
|
"0\n"
|
||||||
|
" 3\n"
|
||||||
|
"Solid line\n"
|
||||||
|
" 72\n"
|
||||||
|
"65\n"
|
||||||
|
" 73\n"
|
||||||
|
"0\n"
|
||||||
|
" 40\n"
|
||||||
|
"0.0\n"
|
||||||
|
" 0\n"
|
||||||
|
"ENDTAB\n",
|
||||||
|
outputFile );
|
||||||
|
|
||||||
|
// Text styles table
|
||||||
|
// Defines 4 text styles, one for each bold/italic combination
|
||||||
|
fputs( " 0\n"
|
||||||
|
"TABLE\n"
|
||||||
|
" 2\n"
|
||||||
|
"STYLE\n"
|
||||||
|
" 70\n"
|
||||||
|
"4\n", outputFile );
|
||||||
|
|
||||||
|
static const char *style_name[4] = {"KICAD", "KICADB", "KICADI", "KICADBI"};
|
||||||
|
for(int i = 0; i < 4; i++ )
|
||||||
|
{
|
||||||
|
fprintf( outputFile,
|
||||||
|
" 0\n"
|
||||||
|
"STYLE\n"
|
||||||
|
" 2\n"
|
||||||
|
"%s\n" // Style name
|
||||||
|
" 70\n"
|
||||||
|
"0\n" // Standard flags
|
||||||
|
" 40\n"
|
||||||
|
"0\n" // Non-fixed height text
|
||||||
|
" 41\n"
|
||||||
|
"1\n" // Width factor (base)
|
||||||
|
" 42\n"
|
||||||
|
"1\n" // Last height (mandatory)
|
||||||
|
" 50\n"
|
||||||
|
"%g\n" // Oblique angle
|
||||||
|
" 71\n"
|
||||||
|
"0\n" // Generation flags (default)
|
||||||
|
" 3\n"
|
||||||
|
// The standard ISO font (when kicad is build with it
|
||||||
|
// the dxf text in acad matches *perfectly*)
|
||||||
|
"isocp.shx\n", // Font name (when not bigfont)
|
||||||
|
// Apply a 15 degree angle to italic text
|
||||||
|
style_name[i], i < 2 ? 0 : DXF_OBLIQUE_ANGLE );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Layer table - one layer per color
|
||||||
|
fprintf( outputFile,
|
||||||
|
" 0\n"
|
||||||
|
"ENDTAB\n"
|
||||||
|
" 0\n"
|
||||||
|
"TABLE\n"
|
||||||
|
" 2\n"
|
||||||
|
"LAYER\n"
|
||||||
|
" 70\n"
|
||||||
|
"%d\n", NBCOLOR );
|
||||||
|
|
||||||
|
/* The layer/colors palette. The acad/DXF palette is divided in 3 zones:
|
||||||
|
|
||||||
|
- The primary colors (1 - 9)
|
||||||
|
- An HSV zone (10-250, 5 values x 2 saturations x 10 hues
|
||||||
|
- Greys (251 - 255)
|
||||||
|
|
||||||
|
The is *no* black... the white does it on paper, usually, and
|
||||||
|
anyway it depends on the plotter configuration, since DXF colors
|
||||||
|
are meant to be logical only (they represent *both* line color and
|
||||||
|
width); later version with plot styles only complicate the matter!
|
||||||
|
|
||||||
|
As usual, brown and magenta/purple are difficult to place since
|
||||||
|
they are actually variations of other colors.
|
||||||
|
*/
|
||||||
|
static const struct {
|
||||||
|
const char *name;
|
||||||
|
int color;
|
||||||
|
} dxf_layer[NBCOLOR] = {
|
||||||
|
{ "Black", 250 },
|
||||||
|
{ "Blue", 5 },
|
||||||
|
{ "Green", 3 },
|
||||||
|
{ "Cyan", 4 },
|
||||||
|
{ "Red", 1 },
|
||||||
|
{ "Magenta", 6 },
|
||||||
|
{ "Brown", 54 },
|
||||||
|
{ "LightGray", 9 },
|
||||||
|
{ "DarkGray", 8 },
|
||||||
|
{ "LightBlue", 171 },
|
||||||
|
{ "LightGreen", 91 },
|
||||||
|
{ "LightCyan", 131 },
|
||||||
|
{ "LightRed", 11 },
|
||||||
|
{ "LightMagenta", 221 },
|
||||||
|
{ "Yellow", 2 },
|
||||||
|
{ "White", 7 },
|
||||||
|
{ "DarkDarkGray", 251 },
|
||||||
|
{ "DarkBlue", 178 },
|
||||||
|
{ "DarkGreen", 98 },
|
||||||
|
{ "DarkCyan", 138 },
|
||||||
|
{ "DarkRed", 18 },
|
||||||
|
{ "DarkMagenta", 228 },
|
||||||
|
{ "DarkBrown", 58 },
|
||||||
|
{ "LightYellow", 51 },
|
||||||
|
};
|
||||||
|
|
||||||
|
for( int i = 0; i < NBCOLOR; i++ )
|
||||||
{
|
{
|
||||||
wxString cname = ColorRefs[i].m_Name;
|
wxString cname = ColorRefs[i].m_Name;
|
||||||
fprintf( output_file, "0\nLAYER\n2\n%s\n70\n0\n62\n%d\n6\nCONTINUOUS\n",
|
fprintf( outputFile,
|
||||||
TO_UTF8( cname ), i + 1 );
|
" 0\n"
|
||||||
|
"LAYER\n"
|
||||||
|
" 2\n"
|
||||||
|
"%s\n" // Layer name
|
||||||
|
" 70\n"
|
||||||
|
"0\n" // Standard flags
|
||||||
|
" 62\n"
|
||||||
|
"%d\n" // Color number
|
||||||
|
" 6\n"
|
||||||
|
"CONTINUOUS\n",// Linetype name
|
||||||
|
dxf_layer[i].name, dxf_layer[i].color );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* End of layer table, begin entities */
|
// End of layer table, begin entities
|
||||||
fputs( "0\nENDTAB\n0\nENDSEC\n0\nSECTION\n2\nENTITIES\n", output_file );
|
fputs( " 0\n"
|
||||||
|
"ENDTAB\n"
|
||||||
|
" 0\n"
|
||||||
|
"ENDSEC\n"
|
||||||
|
" 0\n"
|
||||||
|
"SECTION\n"
|
||||||
|
" 2\n"
|
||||||
|
"ENTITIES\n", outputFile );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool DXF_PLOTTER::end_plot()
|
bool DXF_PLOTTER::EndPlot()
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
/* DXF FOOTER */
|
|
||||||
fputs( "0\nENDSEC\n0\nEOF\n", output_file );
|
// DXF FOOTER
|
||||||
fclose( output_file );
|
fputs( " 0\n"
|
||||||
output_file = NULL;
|
"ENDSEC\n"
|
||||||
|
" 0\n"
|
||||||
|
"EOF\n", outputFile );
|
||||||
|
fclose( outputFile );
|
||||||
|
outputFile = NULL;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* color = color index in ColorRefs[]
|
|
||||||
*/
|
|
||||||
void DXF_PLOTTER::set_color( int color )
|
|
||||||
{
|
|
||||||
wxASSERT( output_file );
|
|
||||||
if( ( color >= 0 && color_mode )
|
|
||||||
|| ( color == BLACK )
|
|
||||||
|| ( color == WHITE ) )
|
|
||||||
{
|
|
||||||
current_color = color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void DXF_PLOTTER::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width )
|
|
||||||
{
|
|
||||||
wxASSERT( output_file );
|
|
||||||
move_to( p1 );
|
|
||||||
line_to( wxPoint( p1.x, p2.y ) );
|
|
||||||
line_to( wxPoint( p2.x, p2.y ) );
|
|
||||||
line_to( wxPoint( p2.x, p1.y ) );
|
|
||||||
finish_to( wxPoint( p1.x, p1.y ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void DXF_PLOTTER::circle( wxPoint centre, int diameter, FILL_T fill, int width )
|
|
||||||
{
|
|
||||||
wxASSERT( output_file );
|
|
||||||
double radius = user_to_device_size( diameter / 2 );
|
|
||||||
user_to_device_coordinates( centre );
|
|
||||||
if( radius > 0 )
|
|
||||||
{
|
|
||||||
wxString cname = ColorRefs[current_color].m_Name;
|
|
||||||
if (!fill) {
|
|
||||||
fprintf( output_file, "0\nCIRCLE\n8\n%s\n10\n%d.0\n20\n%d.0\n40\n%g\n",
|
|
||||||
TO_UTF8( cname ),
|
|
||||||
centre.x, centre.y, radius );
|
|
||||||
}
|
|
||||||
if (fill == FILLED_SHAPE) {
|
|
||||||
int r = (int)(radius*0.5);
|
|
||||||
fprintf( output_file, "0\nPOLYLINE\n");
|
|
||||||
fprintf( output_file, "8\n%s\n66\n1\n70\n1\n", TO_UTF8( cname ));
|
|
||||||
fprintf( output_file, "40\n%g\n41\n%g\n", radius,radius);
|
|
||||||
fprintf( output_file, "0\nVERTEX\n8\n%s\n", TO_UTF8( cname ));
|
|
||||||
fprintf( output_file, "10\n%d.0\n 20\n%d.0\n42\n1.0\n", centre.x-r,centre.y);
|
|
||||||
fprintf( output_file, "0\nVERTEX\n8\n%s\n", TO_UTF8( cname ));
|
|
||||||
fprintf( output_file, "10\n%d.0\n 20\n%d.0\n42\n1.0\n", centre.x+r,centre.y);
|
|
||||||
fprintf( output_file, "0\nSEQEND\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Draw a polygon (closed if filled) in DXF format
|
|
||||||
* nb = number of coord (coord 1 = 2 elements: X and Y table)
|
|
||||||
* aFill: if != 0 filled polygon
|
|
||||||
*/
|
|
||||||
void DXF_PLOTTER::PlotPoly( std::vector< wxPoint >& aCornerList, FILL_T aFill, int aWidth)
|
|
||||||
{
|
|
||||||
if( aCornerList.size() <= 1 )
|
|
||||||
return;
|
|
||||||
|
|
||||||
move_to( aCornerList[0] );
|
|
||||||
for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
|
|
||||||
line_to( aCornerList[ii] );
|
|
||||||
|
|
||||||
/* Close polygon. */
|
|
||||||
if( aFill )
|
|
||||||
{
|
|
||||||
unsigned ii = aCornerList.size() - 1;
|
|
||||||
if( aCornerList[ii] != aCornerList[0] )
|
|
||||||
line_to( aCornerList[0] );
|
|
||||||
}
|
|
||||||
pen_finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Function PlotImage
|
|
||||||
* Only Postscript plotters can plot bitmaps
|
|
||||||
* for plotters that cannot plot a bitmap, a rectangle is plotted
|
|
||||||
* For DXF_PLOTTER, currently: draws a rectangle
|
|
||||||
* param aImage = the bitmap
|
|
||||||
* param aPos = position of the center of the bitmap
|
|
||||||
* param aScaleFactor = the scale factor to apply to the bitmap size
|
|
||||||
* (this is not the plot scale factor)
|
|
||||||
*/
|
|
||||||
void DXF_PLOTTER::PlotImage( wxImage & aImage, wxPoint aPos, double aScaleFactor )
|
|
||||||
{
|
|
||||||
wxSize size;
|
|
||||||
size.x = aImage.GetWidth();
|
|
||||||
size.y = aImage.GetHeight();
|
|
||||||
|
|
||||||
size.x = KiROUND( size.x * aScaleFactor );
|
|
||||||
size.y = KiROUND( size.y * aScaleFactor );
|
|
||||||
|
|
||||||
wxPoint start = aPos;
|
|
||||||
start.x -= size.x / 2;
|
|
||||||
start.y -= size.y / 2;
|
|
||||||
|
|
||||||
wxPoint end = start;
|
|
||||||
end.x += size.x;
|
|
||||||
end.y += size.y;
|
|
||||||
|
|
||||||
rect( start, end, NO_FILL );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Move the pen up (pen = 'U') or down (feather = 'D') at position x, y
|
|
||||||
* Unit to unit DRAWING
|
|
||||||
* If pen = 'Z' without lifting pen displacement
|
|
||||||
*/
|
|
||||||
void DXF_PLOTTER::pen_to( wxPoint pos, char plume )
|
|
||||||
{
|
|
||||||
wxASSERT( output_file );
|
|
||||||
if( plume == 'Z' )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
user_to_device_coordinates( pos );
|
|
||||||
|
|
||||||
if( pen_lastpos != pos && plume == 'D' )
|
|
||||||
{
|
|
||||||
/* DXF LINE */
|
|
||||||
wxString cname = ColorRefs[current_color].m_Name;
|
|
||||||
fprintf( output_file, "0\nLINE\n8\n%s\n10\n%d.0\n20\n%d.0\n11\n%d.0\n21\n%d.0\n",
|
|
||||||
TO_UTF8( cname ),
|
|
||||||
pen_lastpos.x, pen_lastpos.y, pos.x, pos.y );
|
|
||||||
}
|
|
||||||
pen_lastpos = pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void DXF_PLOTTER::set_dash( bool dashed )
|
|
||||||
{
|
|
||||||
/* NOP for now */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function thick_segment
|
* The DXF exporter handles 'colors' as layers...
|
||||||
* Plot a filled segment (track)
|
|
||||||
* @param aStart = starting point
|
|
||||||
* @param aEnd = ending point
|
|
||||||
* @param aWidth = segment width (thickness)
|
|
||||||
* @param aPlotMode = FILLED, SKETCH ..
|
|
||||||
*/
|
*/
|
||||||
void DXF_PLOTTER::thick_segment( wxPoint aStart, wxPoint aEnd, int aWidth,
|
void DXF_PLOTTER::SetColor( EDA_COLOR_T color )
|
||||||
EDA_DRAW_MODE_T aPlotMode )
|
|
||||||
{
|
{
|
||||||
if( aPlotMode == LINE ) /* just a line is Ok */
|
wxASSERT( outputFile );
|
||||||
|
if( ( color >= 0 && colorMode )
|
||||||
|
|| ( color == BLACK )
|
||||||
|
|| ( color == WHITE ) )
|
||||||
{
|
{
|
||||||
move_to( aStart );
|
currentColor = color;
|
||||||
finish_to( aEnd );
|
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DXF rectangle: fill not supported
|
||||||
|
*/
|
||||||
|
void DXF_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int width )
|
||||||
|
{
|
||||||
|
wxASSERT( outputFile );
|
||||||
|
MoveTo( p1 );
|
||||||
|
LineTo( wxPoint( p1.x, p2.y ) );
|
||||||
|
LineTo( wxPoint( p2.x, p2.y ) );
|
||||||
|
LineTo( wxPoint( p2.x, p1.y ) );
|
||||||
|
FinishTo( wxPoint( p1.x, p1.y ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DXF circle: full functionality; it even does 'fills' drawing a
|
||||||
|
* circle with a dual-arc polyline wide as the radius.
|
||||||
|
*
|
||||||
|
* I could use this trick to do other filled primitives
|
||||||
|
*/
|
||||||
|
void DXF_PLOTTER::Circle( const wxPoint& centre, int diameter, FILL_T fill, int width )
|
||||||
|
{
|
||||||
|
wxASSERT( outputFile );
|
||||||
|
double radius = userToDeviceSize( diameter / 2 );
|
||||||
|
DPOINT centre_dev = userToDeviceCoordinates( centre );
|
||||||
|
if( radius > 0 )
|
||||||
{
|
{
|
||||||
segment_as_oval( aStart, aEnd, aWidth, aPlotMode );
|
wxString cname = ColorRefs[currentColor].m_Name;
|
||||||
|
if (!fill)
|
||||||
|
{
|
||||||
|
fprintf( outputFile, "0\nCIRCLE\n8\n%s\n10\n%g\n20\n%g\n40\n%g\n",
|
||||||
|
TO_UTF8( cname ),
|
||||||
|
centre_dev.x, centre_dev.y, radius );
|
||||||
|
}
|
||||||
|
if (fill == FILLED_SHAPE)
|
||||||
|
{
|
||||||
|
double r = radius*0.5;
|
||||||
|
fprintf( outputFile, "0\nPOLYLINE\n");
|
||||||
|
fprintf( outputFile, "8\n%s\n66\n1\n70\n1\n", TO_UTF8( cname ));
|
||||||
|
fprintf( outputFile, "40\n%g\n41\n%g\n", radius, radius);
|
||||||
|
fprintf( outputFile, "0\nVERTEX\n8\n%s\n", TO_UTF8( cname ));
|
||||||
|
fprintf( outputFile, "10\n%g\n 20\n%g\n42\n1.0\n",
|
||||||
|
centre_dev.x-r, centre_dev.y );
|
||||||
|
fprintf( outputFile, "0\nVERTEX\n8\n%s\n", TO_UTF8( cname ));
|
||||||
|
fprintf( outputFile, "10\n%g\n 20\n%g\n42\n1.0\n",
|
||||||
|
centre_dev.x+r, centre_dev.y );
|
||||||
|
fprintf( outputFile, "0\nSEQEND\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Plot an arc in DXF format.
|
/**
|
||||||
* center = center coord
|
* DXF polygon: doesn't fill it but at least it close the filled ones
|
||||||
* StAngle, EndAngle = angle of beginning and end
|
|
||||||
* Radius = radius of the arc
|
|
||||||
*/
|
*/
|
||||||
void DXF_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int radius,
|
void DXF_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList,
|
||||||
|
FILL_T aFill, int aWidth)
|
||||||
|
{
|
||||||
|
if( aCornerList.size() <= 1 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
MoveTo( aCornerList[0] );
|
||||||
|
for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
|
||||||
|
LineTo( aCornerList[ii] );
|
||||||
|
|
||||||
|
// Close polygon if 'fill' requested
|
||||||
|
if( aFill )
|
||||||
|
{
|
||||||
|
unsigned ii = aCornerList.size() - 1;
|
||||||
|
if( aCornerList[ii] != aCornerList[0] )
|
||||||
|
LineTo( aCornerList[0] );
|
||||||
|
}
|
||||||
|
PenFinish();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DXF_PLOTTER::PenTo( const wxPoint& pos, char plume )
|
||||||
|
{
|
||||||
|
wxASSERT( outputFile );
|
||||||
|
if( plume == 'Z' )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
DPOINT pos_dev = userToDeviceCoordinates( pos );
|
||||||
|
DPOINT pen_lastpos_dev = userToDeviceCoordinates( penLastpos );
|
||||||
|
|
||||||
|
if( penLastpos != pos && plume == 'D' )
|
||||||
|
{
|
||||||
|
// DXF LINE
|
||||||
|
wxString cname = ColorRefs[currentColor].m_Name;
|
||||||
|
fprintf( outputFile, "0\nLINE\n8\n%s\n10\n%g\n20\n%g\n11\n%g\n21\n%g\n",
|
||||||
|
TO_UTF8( cname ),
|
||||||
|
pen_lastpos_dev.x, pen_lastpos_dev.y, pos_dev.x, pos_dev.y );
|
||||||
|
}
|
||||||
|
penLastpos = pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dashed lines are not (yet) supported by DXF_PLOTTER
|
||||||
|
*/
|
||||||
|
void DXF_PLOTTER::SetDash( bool dashed )
|
||||||
|
{
|
||||||
|
// NOP for now
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DXF_PLOTTER::ThickSegment( const wxPoint& aStart, const wxPoint& aEnd, int aWidth,
|
||||||
|
EDA_DRAW_MODE_T aPlotMode )
|
||||||
|
{
|
||||||
|
if( aPlotMode == LINE ) // In line mode, just a line is OK
|
||||||
|
{
|
||||||
|
MoveTo( aStart );
|
||||||
|
FinishTo( aEnd );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
segmentAsOval( aStart, aEnd, aWidth, aPlotMode );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Plot an arc in DXF format
|
||||||
|
* Filling is not supported
|
||||||
|
*/
|
||||||
|
void DXF_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int radius,
|
||||||
FILL_T fill, int width )
|
FILL_T fill, int width )
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
|
|
||||||
if( radius <= 0 )
|
if( radius <= 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
user_to_device_coordinates( centre );
|
DPOINT centre_dev = userToDeviceCoordinates( centre );
|
||||||
radius = KiROUND( user_to_device_size( radius ) );
|
double radius_dev = userToDeviceSize( radius );
|
||||||
|
|
||||||
/* DXF ARC */
|
// Emit a DXF ARC entity
|
||||||
wxString cname = ColorRefs[current_color].m_Name;
|
wxString cname = ColorRefs[currentColor].m_Name;
|
||||||
fprintf( output_file,
|
fprintf( outputFile,
|
||||||
"0\nARC\n8\n%s\n10\n%d.0\n20\n%d.0\n40\n%d.0\n50\n%d.0\n51\n%d.0\n",
|
"0\nARC\n8\n%s\n10\n%g\n20\n%g\n40\n%g\n50\n%g\n51\n%g\n",
|
||||||
TO_UTF8( cname ),
|
TO_UTF8( cname ),
|
||||||
centre.x, centre.y, radius,
|
centre_dev.x, centre_dev.y, radius_dev,
|
||||||
StAngle / 10, EndAngle / 10 );
|
StAngle / 10.0, EndAngle / 10.0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/* Plot oval pad at position. */
|
* DXF oval pad: always done in sketch mode
|
||||||
void DXF_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
|
*/
|
||||||
EDA_DRAW_MODE_T trace_mode )
|
void DXF_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int orient,
|
||||||
|
EDA_DRAW_MODE_T trace_mode )
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
|
wxSize size( aSize );
|
||||||
|
|
||||||
/* The chip is reduced to an oval tablet with size.y > size.x
|
/* The chip is reduced to an oval tablet with size.y > size.x
|
||||||
* (Oval vertical orientation 0) */
|
* (Oval vertical orientation 0) */
|
||||||
|
@ -268,37 +410,41 @@ void DXF_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
|
||||||
if( orient >= 3600 )
|
if( orient >= 3600 )
|
||||||
orient -= 3600;
|
orient -= 3600;
|
||||||
}
|
}
|
||||||
sketch_oval( pos, size, orient, -1 );
|
sketchOval( pos, size, orient, -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Plot round pad or via. */
|
/**
|
||||||
void DXF_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
|
* DXF round pad: always done in sketch mode; it could be filled but it isn't
|
||||||
|
* pretty if other kinds of pad aren't...
|
||||||
|
*/
|
||||||
|
void DXF_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre,
|
||||||
EDA_DRAW_MODE_T trace_mode )
|
EDA_DRAW_MODE_T trace_mode )
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
circle( pos, diametre, NO_FILL );
|
Circle( pos, diametre, NO_FILL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Plot rectangular pad vertical or horizontal (rectangular Pad)
|
* DXF rectangular pad: alwayd done in sketch mode
|
||||||
*/
|
*/
|
||||||
void DXF_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
|
void DXF_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& padsize,
|
||||||
int orient, EDA_DRAW_MODE_T trace_mode )
|
int orient, EDA_DRAW_MODE_T trace_mode )
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
wxSize size;
|
wxSize size;
|
||||||
int ox, oy, fx, fy;
|
int ox, oy, fx, fy;
|
||||||
|
|
||||||
size.x = padsize.x / 2; size.y = padsize.y / 2;
|
size.x = padsize.x / 2;
|
||||||
|
size.y = padsize.y / 2;
|
||||||
|
|
||||||
if( size.x < 0 )
|
if( size.x < 0 )
|
||||||
size.x = 0;
|
size.x = 0;
|
||||||
if( size.y < 0 )
|
if( size.y < 0 )
|
||||||
size.y = 0;
|
size.y = 0;
|
||||||
|
|
||||||
/* If a dimension is zero, the trace is reduced to 1 line. */
|
// If a dimension is zero, the trace is reduced to 1 line
|
||||||
if( size.x == 0 )
|
if( size.x == 0 )
|
||||||
{
|
{
|
||||||
ox = pos.x;
|
ox = pos.x;
|
||||||
|
@ -307,8 +453,8 @@ void DXF_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
|
||||||
fx = pos.x;
|
fx = pos.x;
|
||||||
fy = pos.y + size.y;
|
fy = pos.y + size.y;
|
||||||
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
move_to( wxPoint( ox, oy ) );
|
MoveTo( wxPoint( ox, oy ) );
|
||||||
finish_to( wxPoint( fx, fy ) );
|
FinishTo( wxPoint( fx, fy ) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if( size.y == 0 )
|
if( size.y == 0 )
|
||||||
|
@ -319,45 +465,42 @@ void DXF_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
|
||||||
fx = pos.x + size.x;
|
fx = pos.x + size.x;
|
||||||
fy = pos.y;
|
fy = pos.y;
|
||||||
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
move_to( wxPoint( ox, oy ) );
|
MoveTo( wxPoint( ox, oy ) );
|
||||||
finish_to( wxPoint( fx, fy ) );
|
FinishTo( wxPoint( fx, fy ) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ox = pos.x - size.x;
|
ox = pos.x - size.x;
|
||||||
oy = pos.y - size.y;
|
oy = pos.y - size.y;
|
||||||
RotatePoint( &ox, &oy, pos.x, pos.y, orient );
|
RotatePoint( &ox, &oy, pos.x, pos.y, orient );
|
||||||
move_to( wxPoint( ox, oy ) );
|
MoveTo( wxPoint( ox, oy ) );
|
||||||
|
|
||||||
fx = pos.x - size.x;
|
fx = pos.x - size.x;
|
||||||
fy = pos.y + size.y;
|
fy = pos.y + size.y;
|
||||||
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
line_to( wxPoint( fx, fy ) );
|
LineTo( wxPoint( fx, fy ) );
|
||||||
|
|
||||||
fx = pos.x + size.x;
|
fx = pos.x + size.x;
|
||||||
fy = pos.y + size.y;
|
fy = pos.y + size.y;
|
||||||
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
line_to( wxPoint( fx, fy ) );
|
LineTo( wxPoint( fx, fy ) );
|
||||||
|
|
||||||
fx = pos.x + size.x;
|
fx = pos.x + size.x;
|
||||||
fy = pos.y - size.y;
|
fy = pos.y - size.y;
|
||||||
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
line_to( wxPoint( fx, fy ) );
|
LineTo( wxPoint( fx, fy ) );
|
||||||
|
|
||||||
finish_to( wxPoint( ox, oy ) );
|
FinishTo( wxPoint( ox, oy ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Plot trapezoidal pad.
|
* DXF trapezoidal pad: only sketch mode is supported
|
||||||
* aPadPos is pad position, aCorners the corners position of the basic shape
|
|
||||||
* Orientation aPadOrient in 0.1 degrees
|
|
||||||
* Plot mode = FILLED, SKETCH (unused)
|
|
||||||
*/
|
*/
|
||||||
void DXF_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
|
void DXF_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
|
||||||
int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
|
int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
wxPoint coord[4]; /* coord actual corners of a trapezoidal trace */
|
wxPoint coord[4]; /* coord actual corners of a trapezoidal trace */
|
||||||
|
|
||||||
for( int ii = 0; ii < 4; ii++ )
|
for( int ii = 0; ii < 4; ii++ )
|
||||||
|
@ -368,9 +511,158 @@ void DXF_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
|
||||||
}
|
}
|
||||||
|
|
||||||
// Plot edge:
|
// Plot edge:
|
||||||
move_to( coord[0] );
|
MoveTo( coord[0] );
|
||||||
line_to( coord[1] );
|
LineTo( coord[1] );
|
||||||
line_to( coord[2] );
|
LineTo( coord[2] );
|
||||||
line_to( coord[3] );
|
LineTo( coord[3] );
|
||||||
finish_to( coord[0] );
|
FinishTo( coord[0] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DXF_PLOTTER::Text( const wxPoint& aPos,
|
||||||
|
enum EDA_COLOR_T aColor,
|
||||||
|
const wxString& aText,
|
||||||
|
int aOrient,
|
||||||
|
const wxSize& aSize,
|
||||||
|
enum EDA_TEXT_HJUSTIFY_T aH_justify,
|
||||||
|
enum EDA_TEXT_VJUSTIFY_T aV_justify,
|
||||||
|
int aWidth,
|
||||||
|
bool aItalic,
|
||||||
|
bool aBold )
|
||||||
|
{
|
||||||
|
if( textAsLines )
|
||||||
|
PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify,
|
||||||
|
aWidth, aItalic, aBold );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Emit text as a text entity. This loses formatting and shape but it's
|
||||||
|
more useful as a CAD object */
|
||||||
|
DPOINT origin_dev = userToDeviceCoordinates( aPos );
|
||||||
|
if( aColor >= 0 )
|
||||||
|
currentColor = aColor;
|
||||||
|
wxString cname = ColorRefs[currentColor].m_Name;
|
||||||
|
DPOINT size_dev = userToDeviceSize( aSize );
|
||||||
|
int h_code = 0, v_code = 0;
|
||||||
|
switch( aH_justify )
|
||||||
|
{
|
||||||
|
case GR_TEXT_HJUSTIFY_LEFT:
|
||||||
|
h_code = 0;
|
||||||
|
break;
|
||||||
|
case GR_TEXT_HJUSTIFY_CENTER:
|
||||||
|
h_code = 1;
|
||||||
|
break;
|
||||||
|
case GR_TEXT_HJUSTIFY_RIGHT:
|
||||||
|
h_code = 2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch( aV_justify )
|
||||||
|
{
|
||||||
|
case GR_TEXT_VJUSTIFY_TOP:
|
||||||
|
v_code = 3;
|
||||||
|
break;
|
||||||
|
case GR_TEXT_VJUSTIFY_CENTER:
|
||||||
|
v_code = 2;
|
||||||
|
break;
|
||||||
|
case GR_TEXT_VJUSTIFY_BOTTOM:
|
||||||
|
v_code = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Position, size, rotation and alignment
|
||||||
|
// The two alignment point usages is somewhat idiot (see the DXF ref)
|
||||||
|
// Anyway since we don't use the fit/aligned options, they're the same
|
||||||
|
fprintf( outputFile,
|
||||||
|
" 0\n"
|
||||||
|
"TEXT\n"
|
||||||
|
" 7\n"
|
||||||
|
"%s\n" // Text style
|
||||||
|
" 8\n"
|
||||||
|
"%s\n" // Layer name
|
||||||
|
" 10\n"
|
||||||
|
"%g\n" // First point X
|
||||||
|
" 11\n"
|
||||||
|
"%g\n" // Second point X
|
||||||
|
" 20\n"
|
||||||
|
"%g\n" // First point Y
|
||||||
|
" 21\n"
|
||||||
|
"%g\n" // Second point Y
|
||||||
|
" 40\n"
|
||||||
|
"%g\n" // Text height
|
||||||
|
" 41\n"
|
||||||
|
"%g\n" // Width factor
|
||||||
|
" 50\n"
|
||||||
|
"%g\n" // Rotation
|
||||||
|
" 51\n"
|
||||||
|
"%g\n" // Oblique angle
|
||||||
|
" 71\n"
|
||||||
|
"%d\n" // Mirror flags
|
||||||
|
" 72\n"
|
||||||
|
"%d\n" // H alignment
|
||||||
|
" 73\n"
|
||||||
|
"%d\n", // V alignment
|
||||||
|
aBold ? (aItalic ? "KICADBI" : "KICADB")
|
||||||
|
: (aItalic ? "KICADI" : "KICAD"),
|
||||||
|
TO_UTF8( cname ),
|
||||||
|
origin_dev.x, origin_dev.x,
|
||||||
|
origin_dev.y, origin_dev.y,
|
||||||
|
size_dev.y, fabs( size_dev.y / size_dev.x ),
|
||||||
|
aOrient / 10.0,
|
||||||
|
aItalic ? DXF_OBLIQUE_ANGLE : 0,
|
||||||
|
size_dev.x < 0 ? 2 : 0, // X mirror flag
|
||||||
|
h_code, v_code );
|
||||||
|
|
||||||
|
/* There are two issue in emitting the text:
|
||||||
|
- Our overline character (~) must be converted to the appropriate
|
||||||
|
control sequence %%O or %%o
|
||||||
|
- Text encoding in DXF is more or less unspecified since depends on
|
||||||
|
the DXF declared version, the acad version reading it *and* some
|
||||||
|
system variables to be put in the header handled only by newer acads
|
||||||
|
Also before R15 unicode simply is not supported (you need to use
|
||||||
|
bigfonts which are a massive PITA). Common denominator solution:
|
||||||
|
use Latin1 (and however someone could choke on it, anyway). Sorry
|
||||||
|
for the extended latin people. If somewant want to try fixing this
|
||||||
|
recent version seems to use UTF-8 (and not UCS2 like the rest of
|
||||||
|
Windows)
|
||||||
|
|
||||||
|
XXX Actually there is a *third* issue: older DXF formats are limited
|
||||||
|
to 255 bytes records (it was later raised to 2048); since I'm lazy
|
||||||
|
and text so long is not probable I just don't implement this rule.
|
||||||
|
If someone is interested in fixing this, you have to emit the first
|
||||||
|
partial lines with group code 3 (max 250 bytes each) and then finish
|
||||||
|
with a group code 1 (less than 250 bytes). The DXF refs explains it
|
||||||
|
in no more details...
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool overlining = false;
|
||||||
|
fputs( " 1\n", outputFile );
|
||||||
|
for( unsigned i = 0; i < aText.length(); i++ )
|
||||||
|
{
|
||||||
|
/* Here I do a bad thing: writing the output one byte at a time!
|
||||||
|
but today I'm lazy and I have no idea on how to coerce a Unicode
|
||||||
|
wxString to spit out latin1 encoded text ...
|
||||||
|
|
||||||
|
Atleast stdio is *supposed* to do output buffering, so there is
|
||||||
|
hope is not too slow */
|
||||||
|
wchar_t ch = aText[i];
|
||||||
|
if( ch > 255 )
|
||||||
|
{
|
||||||
|
// I can't encode this...
|
||||||
|
putc( '?', outputFile );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( ch == '~' )
|
||||||
|
{
|
||||||
|
// Handle the overline toggle
|
||||||
|
fputs( overlining ? "%%o" : "%%O", outputFile );
|
||||||
|
overlining = !overlining;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
putc( ch, outputFile );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
putc( '\n', outputFile );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,25 +16,34 @@
|
||||||
#include <build_version.h>
|
#include <build_version.h>
|
||||||
|
|
||||||
|
|
||||||
/**
|
void GERBER_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
|
||||||
* Function set_viewport
|
double aScale, bool aMirror )
|
||||||
* Set the plot offset for the current plotting
|
|
||||||
* @param aOffset = plot offset
|
|
||||||
* @param aScale = coordinate scale (scale coefficient for coordinates)
|
|
||||||
* @param aMirror - Mirror plot if true.
|
|
||||||
*/
|
|
||||||
void GERBER_PLOTTER::set_viewport( wxPoint aOffset, double aScale, bool aMirror )
|
|
||||||
{
|
{
|
||||||
wxASSERT( !output_file );
|
wxASSERT( !outputFile );
|
||||||
wxASSERT( aMirror == false );
|
wxASSERT( aMirror == false );
|
||||||
plotMirror = false;
|
plotMirror = false;
|
||||||
plot_offset = aOffset;
|
plotOffset = aOffset;
|
||||||
wxASSERT( aScale == 1 );
|
wxASSERT( aScale == 1 );
|
||||||
plot_scale = 1;
|
plotScale = 1;
|
||||||
device_scale = 1;
|
iuPerDeviceUnit = 1.0 / aIusPerDecimil;
|
||||||
set_default_line_width( 100 ); /* line thickness in 1 / 1000 inch */
|
/* We don't handle the filmbox, and it's more useful to keep the
|
||||||
|
* origin at the origin */
|
||||||
|
paperSize.x = 0;
|
||||||
|
paperSize.y = 0;
|
||||||
|
SetDefaultLineWidth( 100 * aIusPerDecimil ); // Arbitrary default
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emit a D-Code record, using proper conversions
|
||||||
|
* to format a leading zero omitted gerber coordinate
|
||||||
|
* (for 4 decimal positions, see header generation in start_plot
|
||||||
|
*/
|
||||||
|
void GERBER_PLOTTER::emitDcode( const DPOINT& pt, int dcode )
|
||||||
|
{
|
||||||
|
|
||||||
|
fprintf( outputFile, "X%dY%dD%02d*\n",
|
||||||
|
int( pt.x ), int( pt.y ), dcode );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function start_plot
|
* Function start_plot
|
||||||
|
@ -42,106 +51,102 @@ void GERBER_PLOTTER::set_viewport( wxPoint aOffset, double aScale, bool aMirror
|
||||||
* initialize global variable g_Plot_PlotOutputFile
|
* initialize global variable g_Plot_PlotOutputFile
|
||||||
* @param aFile: an opened file to write to
|
* @param aFile: an opened file to write to
|
||||||
*/
|
*/
|
||||||
bool GERBER_PLOTTER::start_plot( FILE* aFile )
|
bool GERBER_PLOTTER::StartPlot( FILE* aFile )
|
||||||
{
|
{
|
||||||
wxASSERT( !output_file );
|
wxASSERT( !outputFile );
|
||||||
final_file = aFile;
|
finalFile = aFile;
|
||||||
|
|
||||||
// Create a temporary filename to store gerber file
|
// Create a temporary filename to store gerber file
|
||||||
// note tmpfile() does not work under Vista and W7 in user mode
|
// note tmpfile() does not work under Vista and W7 in user mode
|
||||||
m_workFilename = filename + wxT(".tmp");
|
m_workFilename = filename + wxT(".tmp");
|
||||||
work_file = wxFopen( m_workFilename, wxT( "wt" ));
|
workFile = wxFopen( m_workFilename, wxT( "wt" ));
|
||||||
output_file = work_file;
|
outputFile = workFile;
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
|
|
||||||
if( output_file == NULL )
|
if( outputFile == NULL )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
wxString Title = creator + wxT( " " ) + GetBuildVersion();
|
wxString Title = creator + wxT( " " ) + GetBuildVersion();
|
||||||
fprintf( output_file, "G04 (created by %s) date %s*\n",
|
fprintf( outputFile, "G04 (created by %s) date %s*\n",
|
||||||
TO_UTF8( Title ), TO_UTF8( DateAndTime() ) );
|
TO_UTF8( Title ), TO_UTF8( DateAndTime() ) );
|
||||||
|
|
||||||
// Specify linear interpol (G01), unit = INCH (G70), abs format (G90):
|
/* Mass parameter: unit = INCHES */
|
||||||
fputs( "G01*\nG70*\nG90*\n", output_file );
|
fputs( "%MOIN*%\n", outputFile );
|
||||||
fputs( "%MOIN*%\n", output_file ); // set unites = INCHES
|
|
||||||
|
|
||||||
/* Set gerber format to 3.4 */
|
/* Set coordinate format to 3.4 absolute, leading zero omitted */
|
||||||
fputs( "G04 Gerber Fmt 3.4, Leading zero omitted, Abs format*\n%FSLAX34Y34*%\n",
|
fputs( "G04 Gerber Fmt 3.4, Leading zero omitted, Abs format*\n%FSLAX34Y34*%\n",
|
||||||
output_file );
|
outputFile );
|
||||||
|
|
||||||
fputs( "G04 APERTURE LIST*\n", output_file );
|
/* Specify linear interpol (G01), unit = INCH (G70), abs format (G90) */
|
||||||
|
fputs( "G01*\nG70*\nG90*\n", outputFile );
|
||||||
|
fputs( "G04 APERTURE LIST*\n", outputFile );
|
||||||
/* Select the default aperture */
|
/* Select the default aperture */
|
||||||
set_current_line_width( -1 );
|
SetCurrentLineWidth( -1 );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GERBER_PLOTTER::end_plot()
|
bool GERBER_PLOTTER::EndPlot()
|
||||||
{
|
{
|
||||||
char line[1024];
|
char line[1024];
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
|
|
||||||
/* Outfile is actually a temporary file! */
|
/* Outfile is actually a temporary file i.e. workFile */
|
||||||
fputs( "M02*\n", output_file );
|
fputs( "M02*\n", outputFile );
|
||||||
fflush( output_file );
|
fflush( outputFile );
|
||||||
|
|
||||||
// rewind( work_file ); // work_file == output_file !!!
|
fclose( workFile );
|
||||||
fclose( work_file );
|
workFile = wxFopen( m_workFilename, wxT( "rt" ));
|
||||||
work_file = wxFopen( m_workFilename, wxT( "rt" ));
|
wxASSERT( workFile );
|
||||||
wxASSERT( work_file );
|
outputFile = finalFile;
|
||||||
output_file = final_file;
|
|
||||||
|
|
||||||
// Placement of apertures in RS274X
|
// Placement of apertures in RS274X
|
||||||
while( fgets( line, 1024, work_file ) )
|
while( fgets( line, 1024, workFile ) )
|
||||||
{
|
{
|
||||||
fputs( line, output_file );
|
fputs( line, outputFile );
|
||||||
|
|
||||||
if( strcmp( strtok( line, "\n\r" ), "G04 APERTURE LIST*" ) == 0 )
|
if( strcmp( strtok( line, "\n\r" ), "G04 APERTURE LIST*" ) == 0 )
|
||||||
{
|
{
|
||||||
write_aperture_list();
|
writeApertureList();
|
||||||
fputs( "G04 APERTURE END LIST*\n", output_file );
|
fputs( "G04 APERTURE END LIST*\n", outputFile );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose( work_file );
|
fclose( workFile );
|
||||||
fclose( final_file );
|
fclose( finalFile );
|
||||||
::wxRemoveFile( m_workFilename );
|
::wxRemoveFile( m_workFilename );
|
||||||
output_file = 0;
|
outputFile = 0;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Set the default line width (in 1/1000 inch) for the current plotting
|
void GERBER_PLOTTER::SetDefaultLineWidth( int width )
|
||||||
*/
|
|
||||||
void GERBER_PLOTTER::set_default_line_width( int width )
|
|
||||||
{
|
{
|
||||||
default_pen_width = width;
|
defaultPenWidth = width;
|
||||||
current_aperture = apertures.end();
|
currentAperture = apertures.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Set the Current line width (in 1/1000 inch) for the next plot
|
void GERBER_PLOTTER::SetCurrentLineWidth( int width )
|
||||||
*/
|
|
||||||
void GERBER_PLOTTER::set_current_line_width( int width )
|
|
||||||
{
|
{
|
||||||
int pen_width;
|
int pen_width;
|
||||||
|
|
||||||
if( width > 0 )
|
if( width > 0 )
|
||||||
pen_width = width;
|
pen_width = width;
|
||||||
else
|
else
|
||||||
pen_width = default_pen_width;
|
pen_width = defaultPenWidth;
|
||||||
|
|
||||||
select_aperture( wxSize( pen_width, pen_width ), APERTURE::Plotting );
|
selectAperture( wxSize( pen_width, pen_width ), APERTURE::Plotting );
|
||||||
current_pen_width = pen_width;
|
currentPenWidth = pen_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::vector<APERTURE>::iterator GERBER_PLOTTER::get_aperture( const wxSize& size,
|
std::vector<APERTURE>::iterator GERBER_PLOTTER::getAperture( const wxSize& size,
|
||||||
APERTURE::Aperture_Type type )
|
APERTURE::APERTURE_TYPE type )
|
||||||
{
|
{
|
||||||
int last_D_code = 9;
|
int last_D_code = 9;
|
||||||
|
|
||||||
|
@ -150,9 +155,9 @@ std::vector<APERTURE>::iterator GERBER_PLOTTER::get_aperture( const wxSize&
|
||||||
|
|
||||||
while( tool != apertures.end() )
|
while( tool != apertures.end() )
|
||||||
{
|
{
|
||||||
last_D_code = tool->D_code;
|
last_D_code = tool->DCode;
|
||||||
|
|
||||||
if( (tool->type == type) && (tool->size == size) )
|
if( (tool->Type == type) && (tool->Size == size) )
|
||||||
return tool;
|
return tool;
|
||||||
|
|
||||||
tool++;
|
tool++;
|
||||||
|
@ -160,76 +165,78 @@ std::vector<APERTURE>::iterator GERBER_PLOTTER::get_aperture( const wxSize&
|
||||||
|
|
||||||
// Allocate a new aperture
|
// Allocate a new aperture
|
||||||
APERTURE new_tool;
|
APERTURE new_tool;
|
||||||
new_tool.size = size;
|
new_tool.Size = size;
|
||||||
new_tool.type = type;
|
new_tool.Type = type;
|
||||||
new_tool.D_code = last_D_code + 1;
|
new_tool.DCode = last_D_code + 1;
|
||||||
apertures.push_back( new_tool );
|
apertures.push_back( new_tool );
|
||||||
return apertures.end() - 1;
|
return apertures.end() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GERBER_PLOTTER::select_aperture( const wxSize& size,
|
void GERBER_PLOTTER::selectAperture( const wxSize& size,
|
||||||
APERTURE::Aperture_Type type )
|
APERTURE::APERTURE_TYPE type )
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
|
|
||||||
if( ( current_aperture == apertures.end() )
|
if( ( currentAperture == apertures.end() )
|
||||||
|| ( current_aperture->type != type )
|
|| ( currentAperture->Type != type )
|
||||||
|| ( current_aperture->size != size ) )
|
|| ( currentAperture->Size != size ) )
|
||||||
{
|
{
|
||||||
/* Pick an existing aperture or create a new one */
|
/* Pick an existing aperture or create a new one */
|
||||||
current_aperture = get_aperture( size, type );
|
currentAperture = getAperture( size, type );
|
||||||
fprintf( output_file, "G54D%d*\n", current_aperture->D_code );
|
fprintf( outputFile, "G54D%d*\n", currentAperture->DCode );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*Generate list of D_CODES.
|
/**
|
||||||
* Returns the number of D_Codes generated in RS274X format.
|
* Generate the table of D codes
|
||||||
*/
|
*/
|
||||||
void GERBER_PLOTTER::write_aperture_list()
|
void GERBER_PLOTTER::writeApertureList()
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
char cbuf[1024];
|
char cbuf[1024];
|
||||||
|
|
||||||
/* Init : */
|
/* Init : */
|
||||||
for( std::vector<APERTURE>::iterator tool = apertures.begin();
|
for( std::vector<APERTURE>::iterator tool = apertures.begin();
|
||||||
tool != apertures.end(); tool++ )
|
tool != apertures.end(); tool++ )
|
||||||
{
|
{
|
||||||
const float fscale = 0.0001f * plot_scale; // For 3.4 format
|
const double fscale = 0.0001f * plotScale
|
||||||
char* text;
|
* iuPerDeviceUnit ; // For 3.4 format
|
||||||
|
char* text = cbuf + sprintf( cbuf, "%%ADD%d", tool->DCode );
|
||||||
|
|
||||||
text = cbuf + sprintf( cbuf, "%%ADD%d", tool->D_code );
|
switch( tool->Type )
|
||||||
|
|
||||||
switch( tool->type )
|
|
||||||
{
|
{
|
||||||
case APERTURE::Circle:
|
case APERTURE::Circle:
|
||||||
sprintf( text, "C,%f*%%\n", tool->size.x * fscale );
|
sprintf( text, "C,%g*%%\n", tool->Size.x * fscale );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case APERTURE::Rect:
|
case APERTURE::Rect:
|
||||||
sprintf( text, "R,%fX%f*%%\n", tool->size.x * fscale,
|
sprintf( text, "R,%gX%g*%%\n",
|
||||||
tool->size.y * fscale );
|
tool->Size.x * fscale,
|
||||||
|
tool->Size.y * fscale );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case APERTURE::Plotting:
|
case APERTURE::Plotting:
|
||||||
sprintf( text, "C,%f*%%\n", tool->size.x * fscale );
|
sprintf( text, "C,%g*%%\n", tool->Size.x * fscale );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case APERTURE::Oval:
|
case APERTURE::Oval:
|
||||||
sprintf( text, "O,%fX%f*%%\n", tool->size.x * fscale, tool->size.y * fscale );
|
sprintf( text, "O,%gX%g*%%\n",
|
||||||
|
tool->Size.x * fscale,
|
||||||
|
tool->Size.y * fscale );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fputs( cbuf, output_file );
|
fputs( cbuf, outputFile );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GERBER_PLOTTER::pen_to( wxPoint aPos, char plume )
|
void GERBER_PLOTTER::PenTo( const wxPoint& aPos, char plume )
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
user_to_device_coordinates( aPos );
|
DPOINT pos_dev = userToDeviceCoordinates( aPos );
|
||||||
|
|
||||||
switch( plume )
|
switch( plume )
|
||||||
{
|
{
|
||||||
|
@ -237,21 +244,21 @@ void GERBER_PLOTTER::pen_to( wxPoint aPos, char plume )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'U':
|
case 'U':
|
||||||
fprintf( output_file, "X%5.5dY%5.5dD02*\n", aPos.x, aPos.y );
|
emitDcode( pos_dev, 2 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'D':
|
case 'D':
|
||||||
fprintf( output_file, "X%5.5dY%5.5dD01*\n", aPos.x, aPos.y );
|
emitDcode( pos_dev, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
pen_state = plume;
|
penState = plume;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GERBER_PLOTTER::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width )
|
void GERBER_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill,
|
||||||
|
int width )
|
||||||
{
|
{
|
||||||
static std::vector< wxPoint > cornerList;
|
std::vector< wxPoint > cornerList;
|
||||||
cornerList.clear();
|
|
||||||
|
|
||||||
// Build corners list
|
// Build corners list
|
||||||
cornerList.push_back( p1 );
|
cornerList.push_back( p1 );
|
||||||
|
@ -267,141 +274,98 @@ void GERBER_PLOTTER::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
void GERBER_PLOTTER::Circle( const wxPoint& aCentre, int aDiameter, FILL_T aFill,
|
||||||
* Function circle
|
int aWidth )
|
||||||
* writes a non filled circle to output file
|
|
||||||
* Plot one circle as segments (6 to 16 depending on its radius
|
|
||||||
* @param aCentre = center coordinates
|
|
||||||
* @param aDiameter = diameter of the circle
|
|
||||||
* @param aFill = plot option (NO_FILL, FILLED_SHAPE, FILLED_WITH_BG_BODYCOLOR)
|
|
||||||
* not used here: circles are always not filled the gerber. Filled circles are flashed
|
|
||||||
* @param aWidth = line width
|
|
||||||
*/
|
|
||||||
void GERBER_PLOTTER::circle( wxPoint aCentre, int aDiameter, FILL_T aFill, int aWidth )
|
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
wxPoint start, end;
|
wxPoint start, end;
|
||||||
double radius = aDiameter / 2;
|
double radius = aDiameter / 2;
|
||||||
const int delta = 3600 / 32; /* increment (in 0.1 degrees) to draw circles */
|
const int delta = 3600 / 32; /* increment (in 0.1 degrees) to draw circles */
|
||||||
|
|
||||||
start.x = aCentre.x + KiROUND( radius );
|
start.x = aCentre.x + KiROUND( radius );
|
||||||
start.y = aCentre.y;
|
start.y = aCentre.y;
|
||||||
set_current_line_width( aWidth );
|
SetCurrentLineWidth( aWidth );
|
||||||
move_to( start );
|
MoveTo( start );
|
||||||
|
|
||||||
for( int ii = delta; ii < 3600; ii += delta )
|
for( int ii = delta; ii < 3600; ii += delta )
|
||||||
{
|
{
|
||||||
end.x = aCentre.x + (int) ( radius * cos( DEG2RAD( (double)ii / 10.0 ) ) );
|
end.x = aCentre.x + (int) ( radius * cos( DEG2RAD( ii / 10.0 ) ) );
|
||||||
end.y = aCentre.y + (int) ( radius * sin( DEG2RAD( (double)ii / 10.0 ) ) );
|
end.y = aCentre.y + (int) ( radius * sin( DEG2RAD( ii / 10.0 ) ) );
|
||||||
line_to( end );
|
LineTo( end );
|
||||||
}
|
}
|
||||||
|
|
||||||
finish_to( start );
|
FinishTo( start );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Function PlotPoly
|
* Gerber polygon: they can (and *should*) be filled with the
|
||||||
* writes a filled or not filled polyline to output file
|
* appropriate G36/G37 sequence (raster fills are deprecated)
|
||||||
* @param aCornerList = buffer of corners coordinates
|
|
||||||
* @param aFill = plot option (NO_FILL, FILLED_SHAPE, FILLED_WITH_BG_BODYCOLOR)
|
|
||||||
* @param aWidth = Width of the line to plot.
|
|
||||||
*/
|
*/
|
||||||
void GERBER_PLOTTER::PlotPoly( std::vector< wxPoint >& aCornerList, FILL_T aFill, int aWidth )
|
void GERBER_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList,
|
||||||
|
FILL_T aFill, int aWidth )
|
||||||
{
|
{
|
||||||
if( aCornerList.size() <= 1 )
|
if( aCornerList.size() <= 1 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
set_current_line_width( aWidth );
|
SetCurrentLineWidth( aWidth );
|
||||||
|
|
||||||
if( aFill )
|
if( aFill )
|
||||||
fputs( "G36*\n", output_file );
|
fputs( "G36*\n", outputFile );
|
||||||
|
|
||||||
move_to( aCornerList[0] );
|
MoveTo( aCornerList[0] );
|
||||||
|
|
||||||
for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
|
for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
|
||||||
{
|
{
|
||||||
line_to( aCornerList[ii] );
|
LineTo( aCornerList[ii] );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( aFill )
|
if( aFill )
|
||||||
{
|
{
|
||||||
finish_to( aCornerList[0] );
|
FinishTo( aCornerList[0] );
|
||||||
fputs( "G37*\n", output_file );
|
fputs( "G37*\n", outputFile );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pen_finish();
|
PenFinish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Function PlotImage
|
* Filled circular flashes are stored as apertures
|
||||||
* Only Postscript plotters can plot bitmaps
|
|
||||||
* for plotters that cannot plot a bitmap, a rectangle is plotted
|
|
||||||
* For GERBER_PLOTTER, draws a rectangle
|
|
||||||
* param aImage = the bitmap
|
|
||||||
* param aPos = position of the center of the bitmap
|
|
||||||
* param aScaleFactor = the scale factor to apply to the bitmap size
|
|
||||||
* (this is not the plot scale factor)
|
|
||||||
*/
|
*/
|
||||||
void GERBER_PLOTTER::PlotImage( wxImage & aImage, wxPoint aPos, double aScaleFactor )
|
void GERBER_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre,
|
||||||
|
EDA_DRAW_MODE_T trace_mode )
|
||||||
{
|
{
|
||||||
wxSize size;
|
wxASSERT( outputFile );
|
||||||
size.x = aImage.GetWidth();
|
|
||||||
size.y = aImage.GetHeight();
|
|
||||||
|
|
||||||
size.x = KiROUND( size.x * aScaleFactor );
|
|
||||||
size.y = KiROUND( size.y * aScaleFactor );
|
|
||||||
|
|
||||||
wxPoint start = aPos;
|
|
||||||
start.x -= size.x / 2;
|
|
||||||
start.y -= size.y / 2;
|
|
||||||
|
|
||||||
wxPoint end = start;
|
|
||||||
end.x += size.x;
|
|
||||||
end.y += size.y;
|
|
||||||
|
|
||||||
rect( start, end, NO_FILL );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Function flash_pad_circle
|
|
||||||
* Plot a circular pad or via at the user position pos
|
|
||||||
*/
|
|
||||||
void GERBER_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, EDA_DRAW_MODE_T trace_mode )
|
|
||||||
{
|
|
||||||
wxASSERT( output_file );
|
|
||||||
wxSize size( diametre, diametre );
|
wxSize size( diametre, diametre );
|
||||||
|
|
||||||
switch( trace_mode )
|
switch( trace_mode )
|
||||||
{
|
{
|
||||||
case LINE:
|
case LINE:
|
||||||
case SKETCH:
|
case SKETCH:
|
||||||
set_current_line_width( -1 );
|
SetCurrentLineWidth( -1 );
|
||||||
circle( pos, diametre - current_pen_width, NO_FILL );
|
Circle( pos, diametre - currentPenWidth, NO_FILL );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FILLED:
|
case FILLED:
|
||||||
user_to_device_coordinates( pos );
|
DPOINT pos_dev = userToDeviceCoordinates( pos );
|
||||||
select_aperture( size, APERTURE::Circle );
|
selectAperture( size, APERTURE::Circle );
|
||||||
fprintf( output_file, "X%5.5dY%5.5dD03*\n", pos.x, pos.y );
|
emitDcode( pos_dev, 3 );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Plot oval pad at position pos:
|
/**
|
||||||
* Dimensions dx, dy,
|
* Filled oval flashes are handled as aperture in the 90 degree positions only
|
||||||
* Orient Orient
|
|
||||||
* For a vertical or horizontal orientation, the shape is flashed
|
|
||||||
* For any orientation the shape is drawn as a segment
|
|
||||||
*/
|
*/
|
||||||
void GERBER_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
|
void GERBER_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int orient,
|
||||||
EDA_DRAW_MODE_T trace_mode )
|
EDA_DRAW_MODE_T trace_mode )
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
int x0, y0, x1, y1, delta;
|
int x0, y0, x1, y1, delta;
|
||||||
|
wxSize size( aSize );
|
||||||
|
|
||||||
/* Plot a flashed shape. */
|
/* Plot a flashed shape. */
|
||||||
if( ( orient == 0 || orient == 900 || orient == 1800 || orient == 2700 )
|
if( ( orient == 0 || orient == 900 || orient == 1800 || orient == 2700 )
|
||||||
|
@ -409,10 +373,10 @@ void GERBER_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
|
||||||
{
|
{
|
||||||
if( orient == 900 || orient == 2700 ) /* orientation turned 90 deg. */
|
if( orient == 900 || orient == 2700 ) /* orientation turned 90 deg. */
|
||||||
EXCHG( size.x, size.y );
|
EXCHG( size.x, size.y );
|
||||||
|
|
||||||
user_to_device_coordinates( pos );
|
DPOINT pos_dev = userToDeviceCoordinates( pos );
|
||||||
select_aperture( size, APERTURE::Oval );
|
selectAperture( size, APERTURE::Oval );
|
||||||
fprintf( output_file, "X%5.5dY%5.5dD03*\n", pos.x, pos.y );
|
emitDcode( pos_dev, 3 );
|
||||||
}
|
}
|
||||||
else /* Plot pad as a segment. */
|
else /* Plot pad as a segment. */
|
||||||
{
|
{
|
||||||
|
@ -428,6 +392,7 @@ void GERBER_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
|
||||||
|
|
||||||
if( trace_mode == FILLED )
|
if( trace_mode == FILLED )
|
||||||
{
|
{
|
||||||
|
/* XXX to do: use an aperture macro to declare the rotated pad */
|
||||||
/* The pad is reduced to an oval with dy > dx */
|
/* The pad is reduced to an oval with dy > dx */
|
||||||
delta = size.y - size.x;
|
delta = size.y - size.x;
|
||||||
x0 = 0;
|
x0 = 0;
|
||||||
|
@ -436,104 +401,100 @@ void GERBER_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
|
||||||
y1 = delta / 2;
|
y1 = delta / 2;
|
||||||
RotatePoint( &x0, &y0, orient );
|
RotatePoint( &x0, &y0, orient );
|
||||||
RotatePoint( &x1, &y1, orient );
|
RotatePoint( &x1, &y1, orient );
|
||||||
thick_segment( wxPoint( pos.x + x0, pos.y + y0 ),
|
ThickSegment( wxPoint( pos.x + x0, pos.y + y0 ),
|
||||||
wxPoint( pos.x + x1, pos.y + y1 ),
|
wxPoint( pos.x + x1, pos.y + y1 ),
|
||||||
size.x, trace_mode );
|
size.x, trace_mode );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sketch_oval( pos, size, orient, -1 );
|
sketchOval( pos, size, orient, -1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Plot rectangular pad.
|
/**
|
||||||
* Gives its center, size, and orientation
|
* Filled rect flashes are handled as aperture in the 90 degree positions only
|
||||||
* For a vertical or horizontal shape, the shape is an aperture (Dcode) and
|
|
||||||
* it is flashed.
|
|
||||||
* For others shape the direction is plotted as a polygon.
|
|
||||||
*/
|
*/
|
||||||
void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size,
|
void GERBER_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& aSize,
|
||||||
int orient, EDA_DRAW_MODE_T trace_mode )
|
int orient, EDA_DRAW_MODE_T trace_mode )
|
||||||
|
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
|
wxSize size( aSize );
|
||||||
|
|
||||||
/* Plot as flashed. */
|
/* Plot as flashed. */
|
||||||
switch( orient )
|
switch( orient )
|
||||||
{
|
{
|
||||||
case 900:
|
case 900:
|
||||||
case 2700: /* rotation of 90 degrees or 270 returns dimensions */
|
case 2700: /* rotation of 90 degrees or 270 swaps dimensions */
|
||||||
EXCHG( size.x, size.y );
|
EXCHG( size.x, size.y );
|
||||||
|
|
||||||
// Pass through
|
// Pass through
|
||||||
case 0:
|
case 0:
|
||||||
case 1800:
|
case 1800:
|
||||||
switch( trace_mode )
|
switch( trace_mode )
|
||||||
{
|
{
|
||||||
case LINE:
|
case LINE:
|
||||||
case SKETCH:
|
case SKETCH:
|
||||||
set_current_line_width( -1 );
|
SetCurrentLineWidth( -1 );
|
||||||
rect( wxPoint( pos.x - (size.x - current_pen_width) / 2,
|
Rect( wxPoint( pos.x - (size.x - currentPenWidth) / 2,
|
||||||
pos.y - (size.y - current_pen_width) / 2 ),
|
pos.y - (size.y - currentPenWidth) / 2 ),
|
||||||
wxPoint( pos.x + (size.x - current_pen_width) / 2,
|
wxPoint( pos.x + (size.x - currentPenWidth) / 2,
|
||||||
pos.y + (size.y - current_pen_width) / 2 ),
|
pos.y + (size.y - currentPenWidth) / 2 ),
|
||||||
NO_FILL );
|
NO_FILL );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FILLED:
|
case FILLED:
|
||||||
user_to_device_coordinates( pos );
|
DPOINT pos_dev = userToDeviceCoordinates( pos );
|
||||||
select_aperture( size, APERTURE::Rect );
|
selectAperture( size, APERTURE::Rect );
|
||||||
fprintf( output_file, "X%5.5dY%5.5dD03*\n", pos.x, pos.y );
|
emitDcode( pos_dev, 3 );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
break;
|
default: // plot pad shape as polygon
|
||||||
|
{
|
||||||
|
// XXX to do: use an aperture macro to declare the rotated pad
|
||||||
|
wxPoint coord[4];
|
||||||
|
// coord[0] is assumed the lower left
|
||||||
|
// coord[1] is assumed the upper left
|
||||||
|
// coord[2] is assumed the upper right
|
||||||
|
// coord[3] is assumed the lower right
|
||||||
|
|
||||||
default: /* plot pad shape as polygon */
|
/* Trace the outline. */
|
||||||
{
|
coord[0].x = -size.x/2; // lower left
|
||||||
wxPoint coord[4];
|
coord[0].y = size.y/2;
|
||||||
// coord[0] is assumed the lower left
|
coord[1].x = -size.x/2; // upper left
|
||||||
// coord[1] is assumed the upper left
|
coord[1].y = -size.y/2;
|
||||||
// coord[2] is assumed the upper right
|
coord[2].x = size.x/2; // upper right
|
||||||
// coord[3] is assumed the lower right
|
coord[2].y = -size.y/2;
|
||||||
|
coord[3].x = size.x/2; // lower right
|
||||||
|
coord[3].y = size.y/2;
|
||||||
|
|
||||||
/* Trace the outline. */
|
FlashPadTrapez( pos, coord, orient, trace_mode );
|
||||||
coord[0].x = -size.x/2; // lower left
|
}
|
||||||
coord[0].y = size.y/2;
|
break;
|
||||||
coord[1].x = -size.x/2; // upper left
|
|
||||||
coord[1].y = -size.y/2;
|
|
||||||
coord[2].x = size.x/2; // upper right
|
|
||||||
coord[2].y = -size.y/2;
|
|
||||||
coord[3].x = size.x/2; //lower right
|
|
||||||
coord[3].y = size.y/2;
|
|
||||||
|
|
||||||
flash_pad_trapez( pos, coord, orient, trace_mode );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Plot trapezoidal pad.
|
/**
|
||||||
* aPadPos is pad position, aCorners the corners positions of the basic shape
|
* Trapezoidal pad at the moment are *never* handled as aperture, since
|
||||||
* Orientation aPadOrient in 0.1 degrees
|
* they require aperture macros
|
||||||
* Plot mode = FILLED or SKETCH
|
|
||||||
*/
|
*/
|
||||||
void GERBER_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
|
void GERBER_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint* aCorners,
|
||||||
int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
|
int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
|
||||||
|
|
||||||
{
|
{
|
||||||
|
// XXX to do: use an aperture macro to declare the pad
|
||||||
// polygon corners list
|
// polygon corners list
|
||||||
static std::vector< wxPoint > cornerList;
|
std::vector< wxPoint > cornerList;
|
||||||
cornerList.clear();
|
|
||||||
|
|
||||||
|
|
||||||
for( int ii = 0; ii < 4; ii++ )
|
for( int ii = 0; ii < 4; ii++ )
|
||||||
cornerList.push_back( aCorners[ii] );
|
cornerList.push_back( aCorners[ii] );
|
||||||
|
|
||||||
/* Draw the polygon and fill the interior as required. */
|
// Draw the polygon and fill the interior as required
|
||||||
for( unsigned ii = 0; ii < 4; ii++ )
|
for( unsigned ii = 0; ii < 4; ii++ )
|
||||||
{
|
{
|
||||||
RotatePoint( &cornerList[ii], aPadOrient );
|
RotatePoint( &cornerList[ii], aPadOrient );
|
||||||
|
@ -543,15 +504,19 @@ void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size,
|
||||||
// Close the polygon
|
// Close the polygon
|
||||||
cornerList.push_back( cornerList[0] );
|
cornerList.push_back( cornerList[0] );
|
||||||
|
|
||||||
set_current_line_width( -1 );
|
SetCurrentLineWidth( -1 );
|
||||||
PlotPoly( cornerList, aTrace_Mode==FILLED ? FILLED_SHAPE : NO_FILL );
|
PlotPoly( cornerList, aTrace_Mode==FILLED ? FILLED_SHAPE : NO_FILL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change the plot polarity and begin a new layer
|
||||||
|
* Used to 'scratch off' silk screen away from solder mask
|
||||||
|
*/
|
||||||
void GERBER_PLOTTER::SetLayerPolarity( bool aPositive )
|
void GERBER_PLOTTER::SetLayerPolarity( bool aPositive )
|
||||||
{
|
{
|
||||||
if( aPositive )
|
if( aPositive )
|
||||||
fprintf( output_file, "%%LPD*%%\n" );
|
fprintf( outputFile, "%%LPD*%%\n" );
|
||||||
else
|
else
|
||||||
fprintf( output_file, "%%LPC*%%\n" );
|
fprintf( outputFile, "%%LPC*%%\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
/**
|
/**
|
||||||
* @file common_plotHPGL_functions.cpp
|
* @file common_plotHPGL_functions.cpp
|
||||||
* @brief KiCad: Common plot HPGL Routines
|
* @brief KiCad: Common plot HPGL Routines
|
||||||
|
* Filled primitive are not supported, but some could be using HPGL/2
|
||||||
|
* Since this plot engine is mostly intended for import in external programs,
|
||||||
|
* sadly HPGL/2 isn't supported a lot... some of the primitives use overlapped
|
||||||
|
* strokes to fill the shape
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <fctsys.h>
|
#include <fctsys.h>
|
||||||
|
@ -12,184 +16,163 @@
|
||||||
#include <macros.h>
|
#include <macros.h>
|
||||||
#include <kicad_string.h>
|
#include <kicad_string.h>
|
||||||
|
|
||||||
// HPGL scale factor.
|
// HPGL scale factor (1 PLU = 1/40mm IIRC)
|
||||||
const double SCALE_HPGL = 0.102041;
|
static const double PLUsPERDECIMIL = 0.102041;
|
||||||
|
|
||||||
|
|
||||||
void HPGL_PLOTTER::set_viewport( wxPoint aOffset, double aScale, bool aMirror )
|
void HPGL_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
|
||||||
|
double aScale, bool aMirror )
|
||||||
{
|
{
|
||||||
wxASSERT( !output_file );
|
wxASSERT( !outputFile );
|
||||||
plot_offset = aOffset;
|
plotOffset = aOffset;
|
||||||
plot_scale = aScale;
|
plotScale = aScale;
|
||||||
device_scale = SCALE_HPGL;
|
iuPerDeviceUnit = PLUsPERDECIMIL / aIusPerDecimil;
|
||||||
set_default_line_width( 100 ); // default line width in 1 / 1000 inch
|
/* Compute the paper size in IUs */
|
||||||
|
paperSize = pageInfo.GetSizeMils();
|
||||||
|
paperSize.x *= 10.0 * aIusPerDecimil;
|
||||||
|
paperSize.y *= 10.0 * aIusPerDecimil;
|
||||||
|
SetDefaultLineWidth( 0 ); // HPGL has pen sizes instead
|
||||||
plotMirror = aMirror;
|
plotMirror = aMirror;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
bool HPGL_PLOTTER::start_plot( FILE* fout )
|
* At the start of the HPGL plot pen speed and number are requested
|
||||||
|
*/
|
||||||
|
bool HPGL_PLOTTER::StartPlot( FILE* fout )
|
||||||
{
|
{
|
||||||
wxASSERT( !output_file );
|
wxASSERT( !outputFile );
|
||||||
output_file = fout;
|
outputFile = fout;
|
||||||
fprintf( output_file, "IN;VS%d;PU;PA;SP%d;\n", pen_speed, pen_number );
|
fprintf( outputFile, "IN;VS%d;PU;PA;SP%d;\n", penSpeed, penNumber );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
bool HPGL_PLOTTER::end_plot()
|
* HPGL end of plot: pen return and release
|
||||||
|
*/
|
||||||
|
bool HPGL_PLOTTER::EndPlot()
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
fputs( "PU;PA;SP0;\n", output_file );
|
fputs( "PU;PA;SP0;\n", outputFile );
|
||||||
fclose( output_file );
|
fclose( outputFile );
|
||||||
output_file = NULL;
|
outputFile = NULL;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
void HPGL_PLOTTER::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width )
|
* HPGL rectangle: fill not supported
|
||||||
|
*/
|
||||||
|
void HPGL_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int width )
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
user_to_device_coordinates( p2 );
|
DPOINT p2dev = userToDeviceCoordinates( p2 );
|
||||||
move_to( p1 );
|
MoveTo( p1 );
|
||||||
fprintf( output_file, "EA %d,%d;\n", p2.x, p2.y );
|
fprintf( outputFile, "EA %.0f,%.0f;\n", p2dev.x, p2dev.y );
|
||||||
pen_finish();
|
PenFinish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void HPGL_PLOTTER::circle( wxPoint centre,
|
/**
|
||||||
int diameter,
|
* HPGL circle: fill not supported
|
||||||
FILL_T fill,
|
*/
|
||||||
int width )
|
void HPGL_PLOTTER::Circle( const wxPoint& centre, int diameter, FILL_T fill,
|
||||||
|
int width )
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
double rayon = user_to_device_size( diameter / 2 );
|
double radius = userToDeviceSize( diameter / 2 );
|
||||||
|
|
||||||
if( rayon > 0 )
|
if( radius > 0 )
|
||||||
{
|
{
|
||||||
move_to( centre );
|
MoveTo( centre );
|
||||||
fprintf( output_file, "CI %g;\n", rayon );
|
fprintf( outputFile, "CI %g;\n", radius );
|
||||||
pen_finish();
|
PenFinish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Plot a polygon (closed if completed) in HPGL
|
/**
|
||||||
* aCornerList = a wxPoint list of corner
|
* HPGL polygon: fill not supported (but closed, at least)
|
||||||
* aFill: if != 0 filled polygon
|
|
||||||
*/
|
*/
|
||||||
void HPGL_PLOTTER::PlotPoly( std::vector< wxPoint >& aCornerList, FILL_T aFill, int aWidth)
|
void HPGL_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList,
|
||||||
|
FILL_T aFill, int aWidth)
|
||||||
{
|
{
|
||||||
if( aCornerList.size() <= 1 )
|
if( aCornerList.size() <= 1 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
move_to( aCornerList[0] );
|
MoveTo( aCornerList[0] );
|
||||||
for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
|
for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
|
||||||
line_to( aCornerList[ii] );
|
LineTo( aCornerList[ii] );
|
||||||
|
|
||||||
// Close polygon if filled.
|
// Close polygon if filled.
|
||||||
if( aFill )
|
if( aFill )
|
||||||
{
|
{
|
||||||
int ii = aCornerList.size() - 1;
|
int ii = aCornerList.size() - 1;
|
||||||
if( aCornerList[ii] != aCornerList[0] )
|
if( aCornerList[ii] != aCornerList[0] )
|
||||||
line_to( aCornerList[0] );
|
LineTo( aCornerList[0] );
|
||||||
}
|
}
|
||||||
pen_finish();
|
PenFinish();
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Function PlotImage
|
|
||||||
* Only Postscript plotters can plot bitmaps
|
|
||||||
* for plotters that cannot plot a bitmap, a rectangle is plotted
|
|
||||||
* For HPGL_PLOTTER, draws a rectangle
|
|
||||||
* param aImage = the bitmap
|
|
||||||
* param aPos = position of the center of the bitmap
|
|
||||||
* param aScaleFactor = the scale factor to apply to the bitmap size
|
|
||||||
* (this is not the plot scale factor)
|
|
||||||
*/
|
|
||||||
void HPGL_PLOTTER::PlotImage( wxImage & aImage, wxPoint aPos, double aScaleFactor )
|
|
||||||
{
|
|
||||||
wxSize size;
|
|
||||||
size.x = aImage.GetWidth();
|
|
||||||
size.y = aImage.GetHeight();
|
|
||||||
|
|
||||||
size.x = KiROUND( size.x * aScaleFactor );
|
|
||||||
size.y = KiROUND( size.y * aScaleFactor );
|
|
||||||
|
|
||||||
wxPoint start = aPos;
|
|
||||||
start.x -= size.x / 2;
|
|
||||||
start.y -= size.y / 2;
|
|
||||||
|
|
||||||
wxPoint end = start;
|
|
||||||
end.x += size.x;
|
|
||||||
end.y += size.y;
|
|
||||||
|
|
||||||
rect( start, end, NO_FILL );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Set pen up ('U') or down ('D').
|
/**
|
||||||
|
* Pen control logic (remove redundant pen activations)
|
||||||
*/
|
*/
|
||||||
void HPGL_PLOTTER::pen_control( int plume )
|
void HPGL_PLOTTER::penControl( char plume )
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
switch( plume )
|
switch( plume )
|
||||||
{
|
{
|
||||||
case 'U':
|
case 'U':
|
||||||
if( pen_state != 'U' )
|
if( penState != 'U' )
|
||||||
{
|
{
|
||||||
fputs( "PU;", output_file );
|
fputs( "PU;", outputFile );
|
||||||
pen_state = 'U';
|
penState = 'U';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'D':
|
case 'D':
|
||||||
if( pen_state != 'D' )
|
if( penState != 'D' )
|
||||||
{
|
{
|
||||||
fputs( "PD;", output_file );
|
fputs( "PD;", outputFile );
|
||||||
pen_state = 'D';
|
penState = 'D';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Z':
|
case 'Z':
|
||||||
fputs( "PU;", output_file );
|
fputs( "PU;", outputFile );
|
||||||
pen_state = 'U';
|
penState = 'U';
|
||||||
pen_lastpos.x = -1;
|
penLastpos.x = -1;
|
||||||
pen_lastpos.y = -1;
|
penLastpos.y = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
void HPGL_PLOTTER::PenTo( const wxPoint& pos, char plume )
|
||||||
* Move the pen to position with pen up or down.
|
|
||||||
* At position x, y
|
|
||||||
* Unit to unit DRAWING
|
|
||||||
* If pen = 'Z' without changing pen during move.
|
|
||||||
*/
|
|
||||||
void HPGL_PLOTTER::pen_to( wxPoint pos, char plume )
|
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
|
|
||||||
if( plume == 'Z' )
|
if( plume == 'Z' )
|
||||||
{
|
{
|
||||||
pen_control( 'Z' );
|
penControl( 'Z' );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pen_control( plume );
|
penControl( plume );
|
||||||
user_to_device_coordinates( pos );
|
DPOINT pos_dev = userToDeviceCoordinates( pos );
|
||||||
|
|
||||||
if( pen_lastpos != pos )
|
if( penLastpos != pos )
|
||||||
fprintf( output_file, "PA %d,%d;\n", pos.x, pos.y );
|
fprintf( outputFile, "PA %.0f,%.0fd;\n", pos_dev.x, pos_dev.y );
|
||||||
|
|
||||||
pen_lastpos = pos;
|
penLastpos = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void HPGL_PLOTTER::set_dash( bool dashed )
|
/**
|
||||||
|
* HPGL supports dashed lines
|
||||||
|
*/
|
||||||
|
void HPGL_PLOTTER::SetDash( bool dashed )
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
if( dashed )
|
if( dashed )
|
||||||
fputs( "LI 2;\n", stderr );
|
fputs( "LI 2;\n", stderr );
|
||||||
else
|
else
|
||||||
|
@ -197,27 +180,21 @@ void HPGL_PLOTTER::set_dash( bool dashed )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
void HPGL_PLOTTER::ThickSegment( const wxPoint& start, const wxPoint& end,
|
||||||
* Function Plot a filled segment (track)
|
int width, EDA_DRAW_MODE_T tracemode )
|
||||||
* @param start = starting point
|
|
||||||
* @param end = ending point
|
|
||||||
* @param width = segment width (thickness)
|
|
||||||
* @param tracemode = FILLED, SKETCH ..
|
|
||||||
*/
|
|
||||||
void HPGL_PLOTTER::thick_segment( wxPoint start, wxPoint end, int width, EDA_DRAW_MODE_T tracemode )
|
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
wxPoint center;
|
wxPoint center;
|
||||||
wxSize size;
|
wxSize size;
|
||||||
|
|
||||||
if( (pen_diameter >= width) || (tracemode == LINE) ) /* just a line is
|
// Suppress overlap if pen is too big or in line mode
|
||||||
* Ok */
|
if( (penDiameter >= width) || (tracemode == LINE) )
|
||||||
{
|
{
|
||||||
move_to( start );
|
MoveTo( start );
|
||||||
finish_to( end );
|
FinishTo( end );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
segment_as_oval( start, end, width, tracemode );
|
segmentAsOval( start, end, width, tracemode );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -229,48 +206,48 @@ void HPGL_PLOTTER::thick_segment( wxPoint start, wxPoint end, int width, EDA_DRA
|
||||||
* PU PY x, y; PD start_arc_X AA, start_arc_Y, angle, NbSegm; PU;
|
* PU PY x, y; PD start_arc_X AA, start_arc_Y, angle, NbSegm; PU;
|
||||||
* Or PU PY x, y; PD start_arc_X AA, start_arc_Y, angle, PU;
|
* Or PU PY x, y; PD start_arc_X AA, start_arc_Y, angle, PU;
|
||||||
*/
|
*/
|
||||||
void HPGL_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
|
void HPGL_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int radius,
|
||||||
FILL_T fill, int width )
|
FILL_T fill, int width )
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
wxPoint cmap;
|
double angle;
|
||||||
wxPoint cpos;
|
|
||||||
float angle;
|
|
||||||
|
|
||||||
if( rayon <= 0 )
|
if( radius <= 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cpos = centre;
|
DPOINT centre_dev = userToDeviceCoordinates( centre );
|
||||||
user_to_device_coordinates( cpos );
|
|
||||||
|
|
||||||
if( plotMirror )
|
if( plotMirror )
|
||||||
angle = (StAngle - EndAngle) / 10.0;
|
angle = (StAngle - EndAngle) / 10.0;
|
||||||
else
|
else
|
||||||
angle = (EndAngle - StAngle) / 10.0;
|
angle = (EndAngle - StAngle) / 10.0;
|
||||||
// Calculate start point,
|
|
||||||
cmap.x = (int) ( centre.x + ( rayon * cos( StAngle * M_PI / 1800 ) ) );
|
|
||||||
cmap.y = (int) ( centre.y - ( rayon * sin( StAngle * M_PI / 1800 ) ) );
|
|
||||||
user_to_device_coordinates( cmap );
|
|
||||||
|
|
||||||
fprintf( output_file,
|
// Calculate start point,
|
||||||
"PU;PA %d,%d;PD;AA %d,%d, ",
|
wxPoint cmap;
|
||||||
cmap.x,
|
cmap.x = (int) ( centre.x + ( radius * cos( RAD2DEG( StAngle / 10.0 ) ) ) );
|
||||||
cmap.y,
|
cmap.y = (int) ( centre.y - ( radius * sin( RAD2DEG( StAngle / 10.0 ) ) ) );
|
||||||
cpos.x,
|
DPOINT cmap_dev = userToDeviceCoordinates( cmap );
|
||||||
cpos.y );
|
|
||||||
fprintf( output_file, "%f", angle );
|
fprintf( outputFile,
|
||||||
fprintf( output_file, ";PU;\n" );
|
"PU;PA %.0f,%.0f;PD;AA %.0f,%.0f,",
|
||||||
pen_finish();
|
cmap_dev.x,
|
||||||
|
cmap_dev.y,
|
||||||
|
centre_dev.x,
|
||||||
|
centre_dev.y );
|
||||||
|
fprintf( outputFile, "%.0f", angle );
|
||||||
|
fprintf( outputFile, ";PU;\n" );
|
||||||
|
PenFinish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Plot oval pad.
|
/* Plot oval pad.
|
||||||
*/
|
*/
|
||||||
void HPGL_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
|
void HPGL_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int orient,
|
||||||
EDA_DRAW_MODE_T trace_mode )
|
EDA_DRAW_MODE_T trace_mode )
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
int deltaxy, cx, cy;
|
int deltaxy, cx, cy;
|
||||||
|
wxSize size( aSize );
|
||||||
|
|
||||||
/* The pad is reduced to an oval with size.y > size.x
|
/* The pad is reduced to an oval with size.y > size.x
|
||||||
* (Oval vertical orientation 0)
|
* (Oval vertical orientation 0)
|
||||||
|
@ -285,82 +262,68 @@ void HPGL_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
|
||||||
|
|
||||||
if( trace_mode == FILLED )
|
if( trace_mode == FILLED )
|
||||||
{
|
{
|
||||||
flash_pad_rect( pos, wxSize( size.x, deltaxy + KiROUND( pen_diameter ) ),
|
FlashPadRect( pos, wxSize( size.x, deltaxy + KiROUND( penDiameter ) ),
|
||||||
orient, trace_mode );
|
orient, trace_mode );
|
||||||
cx = 0; cy = deltaxy / 2;
|
cx = 0; cy = deltaxy / 2;
|
||||||
RotatePoint( &cx, &cy, orient );
|
RotatePoint( &cx, &cy, orient );
|
||||||
flash_pad_circle( wxPoint( cx + pos.x,
|
FlashPadCircle( wxPoint( cx + pos.x, cy + pos.y ), size.x, trace_mode );
|
||||||
cy + pos.y ), size.x, trace_mode );
|
|
||||||
cx = 0; cy = -deltaxy / 2;
|
cx = 0; cy = -deltaxy / 2;
|
||||||
RotatePoint( &cx, &cy, orient );
|
RotatePoint( &cx, &cy, orient );
|
||||||
flash_pad_circle( wxPoint( cx + pos.x,
|
FlashPadCircle( wxPoint( cx + pos.x, cy + pos.y ), size.x, trace_mode );
|
||||||
cy + pos.y ), size.x, trace_mode );
|
|
||||||
}
|
}
|
||||||
else // Plot in SKETCH mode.
|
else // Plot in SKETCH mode.
|
||||||
{
|
{
|
||||||
sketch_oval( pos, size, orient, KiROUND( pen_diameter ) );
|
sketchOval( pos, size, orient, KiROUND( penDiameter ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Plot round pad or via.
|
/* Plot round pad or via.
|
||||||
*/
|
*/
|
||||||
void HPGL_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
|
void HPGL_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre,
|
||||||
EDA_DRAW_MODE_T trace_mode )
|
EDA_DRAW_MODE_T trace_mode )
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
int rayon, delta;
|
DPOINT pos_dev = userToDeviceCoordinates( pos );
|
||||||
|
|
||||||
user_to_device_coordinates( pos );
|
int delta = KiROUND( penDiameter - penOverlap );
|
||||||
|
int radius = diametre / 2;
|
||||||
delta = KiROUND( pen_diameter - pen_overlap );
|
|
||||||
rayon = diametre / 2;
|
|
||||||
|
|
||||||
if( trace_mode != LINE )
|
if( trace_mode != LINE )
|
||||||
{
|
{
|
||||||
rayon = ( diametre - KiROUND( pen_diameter ) ) / 2;
|
radius = ( diametre - KiROUND( penDiameter ) ) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( rayon < 0 )
|
if( radius < 0 )
|
||||||
{
|
{
|
||||||
rayon = 0;
|
radius = 0;
|
||||||
}
|
}
|
||||||
wxSize rsize( rayon, rayon );
|
|
||||||
|
|
||||||
user_to_device_size( rsize );
|
double rsize = userToDeviceSize( radius );
|
||||||
|
|
||||||
fprintf( output_file, "PA %d,%d;CI %d;\n", pos.x, pos.y, rsize.x );
|
fprintf( outputFile, "PA %.0f,%.0fd;CI %.0f;\n",
|
||||||
|
pos_dev.x, pos_dev.y, rsize );
|
||||||
|
|
||||||
if( trace_mode == FILLED ) // Plot in filled mode.
|
if( trace_mode == FILLED ) // Plot in filled mode.
|
||||||
{
|
{
|
||||||
if( delta > 0 )
|
if( delta > 0 )
|
||||||
{
|
{
|
||||||
while( (rayon -= delta ) >= 0 )
|
while( (radius -= delta ) >= 0 )
|
||||||
{
|
{
|
||||||
rsize.x = rsize.y = rayon;
|
rsize = userToDeviceSize( radius );
|
||||||
user_to_device_size( rsize );
|
fprintf( outputFile, "PA %.0f,%.0f;CI %.0f;\n",
|
||||||
fprintf( output_file,
|
pos_dev.x, pos_dev.y, rsize );
|
||||||
"PA %d,%d; CI %d;\n",
|
|
||||||
pos.x,
|
|
||||||
pos.y,
|
|
||||||
rsize.x );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pen_finish();
|
PenFinish();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
void HPGL_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& padsize,
|
||||||
* Plot rectangular pad vertical or horizontal.
|
int orient, EDA_DRAW_MODE_T trace_mode )
|
||||||
* Gives its center and its dimensions X and Y
|
|
||||||
* Units are user units
|
|
||||||
*/
|
|
||||||
void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
|
|
||||||
int orient, EDA_DRAW_MODE_T trace_mode )
|
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
wxSize size;
|
wxSize size;
|
||||||
int delta;
|
int delta;
|
||||||
int ox, oy, fx, fy;
|
int ox, oy, fx, fy;
|
||||||
|
@ -370,8 +333,8 @@ void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
|
||||||
|
|
||||||
if( trace_mode != LINE )
|
if( trace_mode != LINE )
|
||||||
{
|
{
|
||||||
size.x = (padsize.x - (int) pen_diameter) / 2;
|
size.x = (padsize.x - (int) penDiameter) / 2;
|
||||||
size.y = (padsize.y - (int) pen_diameter) / 2;
|
size.y = (padsize.y - (int) penDiameter) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( size.x < 0 )
|
if( size.x < 0 )
|
||||||
|
@ -388,8 +351,8 @@ void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
|
||||||
fx = pos.x;
|
fx = pos.x;
|
||||||
fy = pos.y + size.y;
|
fy = pos.y + size.y;
|
||||||
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
move_to( wxPoint( ox, oy ) );
|
MoveTo( wxPoint( ox, oy ) );
|
||||||
finish_to( wxPoint( fx, fy ) );
|
FinishTo( wxPoint( fx, fy ) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if( size.y == 0 )
|
if( size.y == 0 )
|
||||||
|
@ -400,37 +363,37 @@ void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
|
||||||
fx = pos.x + size.x;
|
fx = pos.x + size.x;
|
||||||
fy = pos.y;
|
fy = pos.y;
|
||||||
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
move_to( wxPoint( ox, oy ) );
|
MoveTo( wxPoint( ox, oy ) );
|
||||||
finish_to( wxPoint( fx, fy ) );
|
FinishTo( wxPoint( fx, fy ) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ox = pos.x - size.x;
|
ox = pos.x - size.x;
|
||||||
oy = pos.y - size.y;
|
oy = pos.y - size.y;
|
||||||
RotatePoint( &ox, &oy, pos.x, pos.y, orient );
|
RotatePoint( &ox, &oy, pos.x, pos.y, orient );
|
||||||
move_to( wxPoint( ox, oy ) );
|
MoveTo( wxPoint( ox, oy ) );
|
||||||
|
|
||||||
fx = pos.x - size.x;
|
fx = pos.x - size.x;
|
||||||
fy = pos.y + size.y;
|
fy = pos.y + size.y;
|
||||||
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
line_to( wxPoint( fx, fy ) );
|
LineTo( wxPoint( fx, fy ) );
|
||||||
|
|
||||||
fx = pos.x + size.x;
|
fx = pos.x + size.x;
|
||||||
fy = pos.y + size.y;
|
fy = pos.y + size.y;
|
||||||
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
line_to( wxPoint( fx, fy ) );
|
LineTo( wxPoint( fx, fy ) );
|
||||||
|
|
||||||
fx = pos.x + size.x;
|
fx = pos.x + size.x;
|
||||||
fy = pos.y - size.y;
|
fy = pos.y - size.y;
|
||||||
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
line_to( wxPoint( fx, fy ) );
|
LineTo( wxPoint( fx, fy ) );
|
||||||
|
|
||||||
finish_to( wxPoint( ox, oy ) );
|
FinishTo( wxPoint( ox, oy ) );
|
||||||
|
|
||||||
if( trace_mode == FILLED )
|
if( trace_mode == FILLED )
|
||||||
{
|
{
|
||||||
// Plot in filled mode.
|
// Plot in filled mode.
|
||||||
delta = (int) (pen_diameter - pen_overlap);
|
delta = (int) (penDiameter - penOverlap);
|
||||||
|
|
||||||
if( delta > 0 )
|
if( delta > 0 )
|
||||||
while( (size.x > 0) && (size.y > 0) )
|
while( (size.x > 0) && (size.y > 0) )
|
||||||
|
@ -446,44 +409,39 @@ void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
|
||||||
ox = pos.x - size.x;
|
ox = pos.x - size.x;
|
||||||
oy = pos.y - size.y;
|
oy = pos.y - size.y;
|
||||||
RotatePoint( &ox, &oy, pos.x, pos.y, orient );
|
RotatePoint( &ox, &oy, pos.x, pos.y, orient );
|
||||||
move_to( wxPoint( ox, oy ) );
|
MoveTo( wxPoint( ox, oy ) );
|
||||||
|
|
||||||
fx = pos.x - size.x;
|
fx = pos.x - size.x;
|
||||||
fy = pos.y + size.y;
|
fy = pos.y + size.y;
|
||||||
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
line_to( wxPoint( fx, fy ) );
|
LineTo( wxPoint( fx, fy ) );
|
||||||
|
|
||||||
fx = pos.x + size.x;
|
fx = pos.x + size.x;
|
||||||
fy = pos.y + size.y;
|
fy = pos.y + size.y;
|
||||||
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
line_to( wxPoint( fx, fy ) );
|
LineTo( wxPoint( fx, fy ) );
|
||||||
|
|
||||||
fx = pos.x + size.x;
|
fx = pos.x + size.x;
|
||||||
fy = pos.y - size.y;
|
fy = pos.y - size.y;
|
||||||
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
line_to( wxPoint( fx, fy ) );
|
LineTo( wxPoint( fx, fy ) );
|
||||||
|
|
||||||
finish_to( wxPoint( ox, oy ) );
|
FinishTo( wxPoint( ox, oy ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Plot trapezoidal pad.
|
void HPGL_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
|
||||||
* aPadPos is pad position, aCorners the corners position of the basic shape
|
int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
|
||||||
* Orientation aPadOrient in 0.1 degrees
|
|
||||||
* Plot mode FILLED or SKETCH
|
|
||||||
*/
|
|
||||||
void HPGL_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
|
|
||||||
int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
|
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( outputFile );
|
||||||
wxPoint polygone[4]; // coordinates of corners relatives to the pad
|
wxPoint polygone[4]; // coordinates of corners relatives to the pad
|
||||||
wxPoint coord[4]; // absolute coordinates of corners (coordinates in plotter space)
|
wxPoint coord[4]; // absolute coordinates of corners (coordinates in plotter space)
|
||||||
int move;
|
int move;
|
||||||
|
|
||||||
move = KiROUND( pen_diameter );
|
move = KiROUND( penDiameter );
|
||||||
|
|
||||||
for( int ii = 0; ii < 4; ii++ )
|
for( int ii = 0; ii < 4; ii++ )
|
||||||
polygone[ii] = aCorners[ii];
|
polygone[ii] = aCorners[ii];
|
||||||
|
@ -500,11 +458,11 @@ void HPGL_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
|
||||||
RotatePoint( &coord[ii], aPadOrient );
|
RotatePoint( &coord[ii], aPadOrient );
|
||||||
coord[ii] += aPadPos;
|
coord[ii] += aPadPos;
|
||||||
}
|
}
|
||||||
move_to( coord[0] );
|
MoveTo( coord[0] );
|
||||||
line_to( coord[1] );
|
LineTo( coord[1] );
|
||||||
line_to( coord[2] );
|
LineTo( coord[2] );
|
||||||
line_to( coord[3] );
|
LineTo( coord[3] );
|
||||||
finish_to( coord[0] );
|
FinishTo( coord[0] );
|
||||||
|
|
||||||
// Fill shape:
|
// Fill shape:
|
||||||
if( aTrace_Mode == FILLED )
|
if( aTrace_Mode == FILLED )
|
||||||
|
@ -512,20 +470,20 @@ void HPGL_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
|
||||||
// TODO: replace this par the HPGL plot polygon.
|
// TODO: replace this par the HPGL plot polygon.
|
||||||
int jj;
|
int jj;
|
||||||
// Fill the shape
|
// Fill the shape
|
||||||
move = KiROUND( pen_diameter - pen_overlap );
|
move = KiROUND( penDiameter - penOverlap );
|
||||||
// Calculate fill height.
|
// Calculate fill height.
|
||||||
|
|
||||||
if( polygone[0].y == polygone[3].y ) // Horizontal
|
if( polygone[0].y == polygone[3].y ) // Horizontal
|
||||||
{
|
{
|
||||||
jj = polygone[3].y - (int) ( pen_diameter + ( 2 * pen_overlap ) );
|
jj = polygone[3].y - (int) ( penDiameter + ( 2 * penOverlap ) );
|
||||||
}
|
}
|
||||||
else // vertical
|
else // vertical
|
||||||
{
|
{
|
||||||
jj = polygone[3].x - (int) ( pen_diameter + ( 2 * pen_overlap ) );
|
jj = polygone[3].x - (int) ( penDiameter + ( 2 * penOverlap ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculation of dd = number of segments was traced to fill.
|
// Calculation of dd = number of segments was traced to fill.
|
||||||
jj = jj / (int) ( pen_diameter - pen_overlap );
|
jj = jj / (int) ( penDiameter - penOverlap );
|
||||||
|
|
||||||
// Trace the outline.
|
// Trace the outline.
|
||||||
for( ; jj > 0; jj-- )
|
for( ; jj > 0; jj-- )
|
||||||
|
@ -568,11 +526,12 @@ void HPGL_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
|
||||||
coord[ii] += aPadPos;
|
coord[ii] += aPadPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
move_to( coord[0] );
|
MoveTo( coord[0] );
|
||||||
line_to( coord[1] );
|
LineTo( coord[1] );
|
||||||
line_to( coord[2] );
|
LineTo( coord[2] );
|
||||||
line_to( coord[3] );
|
LineTo( coord[3] );
|
||||||
finish_to( coord[0] );
|
FinishTo( coord[0] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,771 @@
|
||||||
|
/**
|
||||||
|
* @file common_plotPDF_functions.cpp
|
||||||
|
* @brief Kicad: Common plot PDF Routines
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <fctsys.h>
|
||||||
|
#include <appl_wxstruct.h>
|
||||||
|
#include <trigo.h>
|
||||||
|
#include <wxstruct.h>
|
||||||
|
#include <base_struct.h>
|
||||||
|
#include <common.h>
|
||||||
|
#include <plot_common.h>
|
||||||
|
#include <macros.h>
|
||||||
|
#include <kicad_string.h>
|
||||||
|
#include <wx/zstream.h>
|
||||||
|
#include <wx/mstream.h>
|
||||||
|
|
||||||
|
void PDF_PLOTTER::SetPageSettings( const PAGE_INFO& aPageSettings )
|
||||||
|
{
|
||||||
|
wxASSERT( !workFile );
|
||||||
|
pageInfo = aPageSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PDF_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
|
||||||
|
double aScale, bool aMirror )
|
||||||
|
{
|
||||||
|
wxASSERT( !workFile );
|
||||||
|
plotMirror = aMirror;
|
||||||
|
plotOffset = aOffset;
|
||||||
|
plotScale = aScale;
|
||||||
|
|
||||||
|
// The CTM is set to 1 user unit per decimil
|
||||||
|
iuPerDeviceUnit = 1.0 / aIusPerDecimil;
|
||||||
|
|
||||||
|
/* The paper size in this engined is handled page by page
|
||||||
|
Look in the StartPage function */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pen width setting for PDF. Since the specs *explicitly* says that a 0
|
||||||
|
* width is a bad thing to use (since it results in 1 pixel traces), we
|
||||||
|
* convert such requests to the default width (like -1)
|
||||||
|
*/
|
||||||
|
void PDF_PLOTTER::SetCurrentLineWidth( int width )
|
||||||
|
{
|
||||||
|
wxASSERT( workFile );
|
||||||
|
int pen_width;
|
||||||
|
|
||||||
|
if( width > 0 )
|
||||||
|
pen_width = width;
|
||||||
|
else
|
||||||
|
pen_width = defaultPenWidth;
|
||||||
|
|
||||||
|
if( pen_width != currentPenWidth )
|
||||||
|
fprintf( workFile, "%g w\n",
|
||||||
|
userToDeviceSize( pen_width ) );
|
||||||
|
|
||||||
|
currentPenWidth = pen_width;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PDF supports colors fully. It actually has distinct fill and pen colors,
|
||||||
|
* but we set both at the same time.
|
||||||
|
*
|
||||||
|
* XXX Keeping them divided could result in a minor optimization in
|
||||||
|
* eeschema filled shapes, but would propagate to all the other plot
|
||||||
|
* engines. Also arcs are filled as pies but only the arc is stroked so
|
||||||
|
* it would be difficult to handle anyway.
|
||||||
|
*/
|
||||||
|
void PDF_PLOTTER::emitSetRGBColor( double r, double g, double b )
|
||||||
|
{
|
||||||
|
wxASSERT( workFile );
|
||||||
|
fprintf( workFile, "%g %g %g rg %g %g %g RG\n",
|
||||||
|
r, g, b, r, g, b );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PDF supports dashed lines
|
||||||
|
*/
|
||||||
|
void PDF_PLOTTER::SetDash( bool dashed )
|
||||||
|
{
|
||||||
|
wxASSERT( workFile );
|
||||||
|
if( dashed )
|
||||||
|
fputs( "[200] 100 d\n", workFile );
|
||||||
|
else
|
||||||
|
fputs( "[] 0 d\n", workFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rectangles in PDF. Supported by the native operator
|
||||||
|
*/
|
||||||
|
void PDF_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int width )
|
||||||
|
{
|
||||||
|
wxASSERT( workFile );
|
||||||
|
DPOINT p1_dev = userToDeviceCoordinates( p1 );
|
||||||
|
DPOINT p2_dev = userToDeviceCoordinates( p2 );
|
||||||
|
|
||||||
|
SetCurrentLineWidth( width );
|
||||||
|
fprintf( workFile, "%g %g %g %g re %c\n", p1_dev.x, p1_dev.y,
|
||||||
|
p2_dev.x - p1_dev.x, p2_dev.y - p1_dev.y,
|
||||||
|
fill == NO_FILL ? 'S' : 'B' );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Circle drawing for PDF. They're approximated by curves, but fill is supported
|
||||||
|
*/
|
||||||
|
void PDF_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T aFill, int width )
|
||||||
|
{
|
||||||
|
wxASSERT( workFile );
|
||||||
|
DPOINT pos_dev = userToDeviceCoordinates( pos );
|
||||||
|
double radius = userToDeviceSize( diametre / 2.0 );
|
||||||
|
|
||||||
|
/* OK. Here's a trick. PDF doesn't support circles or circular angles, that's
|
||||||
|
a fact. You'll have to do with cubic beziers. These *can't* represent
|
||||||
|
circular arcs (NURBS can, beziers don't). But there is a widely known
|
||||||
|
approximation which is really good */
|
||||||
|
|
||||||
|
SetCurrentLineWidth( width );
|
||||||
|
double magic = radius * 0.551784; // You don't want to know where this come from
|
||||||
|
|
||||||
|
// This is the convex hull for the bezier approximated circle
|
||||||
|
fprintf( workFile, "%g %g m "
|
||||||
|
"%g %g %g %g %g %g c "
|
||||||
|
"%g %g %g %g %g %g c "
|
||||||
|
"%g %g %g %g %g %g c "
|
||||||
|
"%g %g %g %g %g %g c %c\n",
|
||||||
|
pos_dev.x - radius, pos_dev.y,
|
||||||
|
|
||||||
|
pos_dev.x - radius, pos_dev.y + magic,
|
||||||
|
pos_dev.x - magic, pos_dev.y + radius,
|
||||||
|
pos_dev.x, pos_dev.y + radius,
|
||||||
|
|
||||||
|
pos_dev.x + magic, pos_dev.y + radius,
|
||||||
|
pos_dev.x + radius, pos_dev.y + magic,
|
||||||
|
pos_dev.x + radius, pos_dev.y,
|
||||||
|
|
||||||
|
pos_dev.x + radius, pos_dev.y - magic,
|
||||||
|
pos_dev.x + magic, pos_dev.y - radius,
|
||||||
|
pos_dev.x, pos_dev.y - radius,
|
||||||
|
|
||||||
|
pos_dev.x - magic, pos_dev.y - radius,
|
||||||
|
pos_dev.x - radius, pos_dev.y - magic,
|
||||||
|
pos_dev.x - radius, pos_dev.y,
|
||||||
|
|
||||||
|
aFill == NO_FILL ? 's' : 'b' );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The PDF engine can't directly plot arcs, it uses the base emulation.
|
||||||
|
* So no filled arcs (not a great loss... )
|
||||||
|
*/
|
||||||
|
void PDF_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int radius,
|
||||||
|
FILL_T fill, int width )
|
||||||
|
{
|
||||||
|
wxASSERT( workFile );
|
||||||
|
if( radius <= 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Arcs are not so easily approximated by beziers (in the general case),
|
||||||
|
so we approximate them in the old way */
|
||||||
|
wxPoint start, end;
|
||||||
|
const int delta = 50; // increment (in 0.1 degrees) to draw circles
|
||||||
|
|
||||||
|
if( StAngle > EndAngle )
|
||||||
|
EXCHG( StAngle, EndAngle );
|
||||||
|
|
||||||
|
SetCurrentLineWidth( width );
|
||||||
|
|
||||||
|
// Usual trig arc plotting routine...
|
||||||
|
double alpha = DEG2RAD( StAngle / 10.0 );
|
||||||
|
start.x = centre.x + (int) ( radius * cos( -alpha ) );
|
||||||
|
start.y = centre.y + (int) ( radius * sin( -alpha ) );
|
||||||
|
DPOINT pos_dev = userToDeviceCoordinates( start );
|
||||||
|
fprintf( workFile, "%g %g m ", pos_dev.x, pos_dev.y );
|
||||||
|
for( int ii = StAngle + delta; ii < EndAngle; ii += delta )
|
||||||
|
{
|
||||||
|
alpha = DEG2RAD( ii / 10.0 );
|
||||||
|
end.x = centre.x + (int) ( radius * cos( -alpha ) );
|
||||||
|
end.y = centre.y + (int) ( radius * sin( -alpha ) );
|
||||||
|
pos_dev = userToDeviceCoordinates( end );
|
||||||
|
fprintf( workFile, "%g %g l ", pos_dev.x, pos_dev.y );
|
||||||
|
}
|
||||||
|
|
||||||
|
alpha = DEG2RAD( EndAngle / 10.0 );
|
||||||
|
end.x = centre.x + (int) ( radius * cos( -alpha ) );
|
||||||
|
end.y = centre.y + (int) ( radius * sin( -alpha ) );
|
||||||
|
pos_dev = userToDeviceCoordinates( end );
|
||||||
|
fprintf( workFile, "%g %g l ", pos_dev.x, pos_dev.y );
|
||||||
|
|
||||||
|
// The arc is drawn... if not filled we stroke it, otherwise we finish
|
||||||
|
// closing the pie at the center
|
||||||
|
if( fill == NO_FILL )
|
||||||
|
{
|
||||||
|
fputs( "S\n", workFile );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pos_dev = userToDeviceCoordinates( centre );
|
||||||
|
fprintf( workFile, "%g %g l b\n", pos_dev.x, pos_dev.y );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Polygon plotting for PDF. Everything is supported
|
||||||
|
*/
|
||||||
|
void PDF_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList,
|
||||||
|
FILL_T aFill, int aWidth )
|
||||||
|
{
|
||||||
|
wxASSERT( workFile );
|
||||||
|
if( aCornerList.size() <= 1 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
SetCurrentLineWidth( aWidth );
|
||||||
|
|
||||||
|
DPOINT pos = userToDeviceCoordinates( aCornerList[0] );
|
||||||
|
fprintf( workFile, "%g %g m\n", pos.x, pos.y );
|
||||||
|
|
||||||
|
for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
|
||||||
|
{
|
||||||
|
pos = userToDeviceCoordinates( aCornerList[ii] );
|
||||||
|
fprintf( workFile, "%g %g l\n", pos.x, pos.y );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close path and stroke(/fill)
|
||||||
|
fprintf( workFile, "%c\n", aFill == NO_FILL ? 'S' : 'b' );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PDF_PLOTTER::PenTo( const wxPoint& pos, char plume )
|
||||||
|
{
|
||||||
|
wxASSERT( workFile );
|
||||||
|
if( plume == 'Z' )
|
||||||
|
{
|
||||||
|
if( penState != 'Z' )
|
||||||
|
{
|
||||||
|
fputs( "S\n", workFile );
|
||||||
|
penState = 'Z';
|
||||||
|
penLastpos.x = -1;
|
||||||
|
penLastpos.y = -1;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( penState != plume || pos != penLastpos )
|
||||||
|
{
|
||||||
|
DPOINT pos_dev = userToDeviceCoordinates( pos );
|
||||||
|
fprintf( workFile, "%g %g %c\n",
|
||||||
|
pos_dev.x, pos_dev.y,
|
||||||
|
( plume=='D' ) ? 'l' : 'm' );
|
||||||
|
}
|
||||||
|
penState = plume;
|
||||||
|
penLastpos = pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PDF images are handles as inline, not XObject streams...
|
||||||
|
*/
|
||||||
|
void PDF_PLOTTER::PlotImage( const wxImage & aImage, const wxPoint& aPos,
|
||||||
|
double aScaleFactor )
|
||||||
|
{
|
||||||
|
wxASSERT( workFile );
|
||||||
|
wxSize pix_size( aImage.GetWidth(), aImage.GetHeight() );
|
||||||
|
|
||||||
|
// Requested size (in IUs)
|
||||||
|
DPOINT drawsize( aScaleFactor * pix_size.x,
|
||||||
|
aScaleFactor * pix_size.y );
|
||||||
|
|
||||||
|
// calculate the bitmap start position
|
||||||
|
wxPoint start( aPos.x - drawsize.x / 2,
|
||||||
|
aPos.y + drawsize.y / 2);
|
||||||
|
|
||||||
|
DPOINT dev_start = userToDeviceCoordinates( start );
|
||||||
|
|
||||||
|
/* PDF has an uhm... simplified coordinate system handling. There is
|
||||||
|
*one* operator to do everything (the PS concat equivalent). At least
|
||||||
|
they kept the matrix stack to save restore environments. Also images
|
||||||
|
are always emitted at the origin with a size of 1x1 user units.
|
||||||
|
What we need to do is:
|
||||||
|
1) save the CTM end estabilish the new one
|
||||||
|
2) plot the image
|
||||||
|
3) restore the CTM
|
||||||
|
4) profit
|
||||||
|
*/
|
||||||
|
fprintf( workFile, "q %g 0 0 %g %g %g cm\n", // Step 1
|
||||||
|
userToDeviceSize( drawsize.x ),
|
||||||
|
userToDeviceSize( drawsize.y ),
|
||||||
|
dev_start.x, dev_start.y );
|
||||||
|
|
||||||
|
/* An inline image is a cross between a dictionary and a stream.
|
||||||
|
A real ugly construct (compared with the elegance of the PDF
|
||||||
|
format). Also it accepts some 'abbreviations', which is stupid
|
||||||
|
since the content stream is usually compressed anyway... */
|
||||||
|
fprintf( workFile,
|
||||||
|
"BI\n"
|
||||||
|
" /BPC 8\n"
|
||||||
|
" /CS %s\n"
|
||||||
|
" /W %d\n"
|
||||||
|
" /H %d\n"
|
||||||
|
"ID\n", colorMode ? "/RGB" : "/G", pix_size.x, pix_size.y );
|
||||||
|
|
||||||
|
/* Here comes the stream (in binary!). I *could* have hex or ascii84
|
||||||
|
encoded it, but who cares? I'll go through zlib anyway */
|
||||||
|
for( int y = 0; y < pix_size.y; y++ )
|
||||||
|
{
|
||||||
|
for( int x = 0; x < pix_size.x; x++ )
|
||||||
|
{
|
||||||
|
unsigned char r = aImage.GetRed( x, y ) & 0xFF;
|
||||||
|
unsigned char g = aImage.GetGreen( x, y ) & 0xFF;
|
||||||
|
unsigned char b = aImage.GetBlue( x, y ) & 0xFF;
|
||||||
|
// As usual these days, stdio buffering has to suffeeeeerrrr
|
||||||
|
if( colorMode )
|
||||||
|
{
|
||||||
|
putc( r, workFile );
|
||||||
|
putc( g, workFile );
|
||||||
|
putc( b, workFile );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Grayscale conversion
|
||||||
|
putc( (r + g + b) / 3, workFile );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fputs( "EI Q\n", workFile ); // Finish step 2 and do step 3
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allocate a new handle in the table of the PDF object. The
|
||||||
|
* handle must be completed using startPdfObject. It's an in-RAM operation
|
||||||
|
* only, no output is done.
|
||||||
|
*/
|
||||||
|
int PDF_PLOTTER::allocPdfObject()
|
||||||
|
{
|
||||||
|
xrefTable.push_back( 0 );
|
||||||
|
return xrefTable.size() - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open a new PDF object and returns the handle if the parameter is -1.
|
||||||
|
* Otherwise fill in the xref entry for the passed object
|
||||||
|
*/
|
||||||
|
int PDF_PLOTTER::startPdfObject(int handle)
|
||||||
|
{
|
||||||
|
wxASSERT( outputFile );
|
||||||
|
wxASSERT( !workFile );
|
||||||
|
if( handle < 0)
|
||||||
|
handle = allocPdfObject();
|
||||||
|
|
||||||
|
xrefTable[handle] = ftell( outputFile );
|
||||||
|
fprintf( outputFile, "%d 0 obj\n", handle );
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close the current PDF object
|
||||||
|
*/
|
||||||
|
void PDF_PLOTTER::closePdfObject()
|
||||||
|
{
|
||||||
|
wxASSERT( outputFile );
|
||||||
|
wxASSERT( !workFile );
|
||||||
|
fputs( "endobj\n", outputFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts a PDF stream (for the page). Returns the object handle opened
|
||||||
|
* Pass -1 (default) for a fresh object. Especially from PDF 1.5 streams
|
||||||
|
* can contain a lot of things, but for the moment we only handle page
|
||||||
|
* content.
|
||||||
|
*/
|
||||||
|
int PDF_PLOTTER::startPdfStream(int handle)
|
||||||
|
{
|
||||||
|
wxASSERT( outputFile );
|
||||||
|
wxASSERT( !workFile );
|
||||||
|
handle = startPdfObject( handle );
|
||||||
|
|
||||||
|
// This is guaranteed to be handle+1 but needs to be allocated since
|
||||||
|
// you could allocate more object during stream preparation
|
||||||
|
streamLengthHandle = allocPdfObject();
|
||||||
|
fprintf( outputFile,
|
||||||
|
"<< /Length %d 0 R /Filter /FlateDecode >>\n" // Length is deferred
|
||||||
|
"stream\n", handle + 1 );
|
||||||
|
|
||||||
|
// Open a temporary file to accumulate the stream
|
||||||
|
workFilename = filename + wxT(".tmp");
|
||||||
|
workFile = wxFopen( workFilename, wxT( "w+b" ));
|
||||||
|
wxASSERT( workFile );
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finish the current PDF stream (writes the deferred length, too)
|
||||||
|
* XXX the compression code is not very elegant... is slurps the
|
||||||
|
* whole stream in RAM, allocates an output buffer of the same size
|
||||||
|
* and try to FLATE it. Asserts if it couldn't... enhancements are
|
||||||
|
* welcome but for now it simply works
|
||||||
|
*/
|
||||||
|
void PDF_PLOTTER::closePdfStream()
|
||||||
|
{
|
||||||
|
wxASSERT( workFile );
|
||||||
|
|
||||||
|
int stream_len = ftell( workFile );
|
||||||
|
|
||||||
|
// Rewind the file, read in the page stream and DEFLATE it
|
||||||
|
fseek( workFile, 0, SEEK_SET );
|
||||||
|
unsigned char *inbuf = new unsigned char[stream_len];
|
||||||
|
|
||||||
|
int rc = fread( inbuf, 1, stream_len, workFile );
|
||||||
|
wxASSERT( rc == stream_len );
|
||||||
|
(void) rc;
|
||||||
|
|
||||||
|
// We are done with the temporary file, junk it
|
||||||
|
fclose( workFile );
|
||||||
|
workFile = 0;
|
||||||
|
::wxRemoveFile( workFilename );
|
||||||
|
|
||||||
|
// NULL means memos owns the memory, but provide a hint on optimum size needed.
|
||||||
|
wxMemoryOutputStream memos( NULL, std::max( 2000, stream_len ) ) ;
|
||||||
|
|
||||||
|
{
|
||||||
|
/* Somewhat standard parameters to compress in DEFLATE. The PDF spec is
|
||||||
|
misleading, it says it wants a DEFLATE stream but it really want a ZLIB
|
||||||
|
stream! (a DEFLATE stream would be generated with -15 instead of 15)
|
||||||
|
rc = deflateInit2( &zstrm, Z_BEST_COMPRESSION, Z_DEFLATED, 15,
|
||||||
|
8, Z_DEFAULT_STRATEGY );
|
||||||
|
*/
|
||||||
|
|
||||||
|
wxZlibOutputStream zos( memos, wxZ_BEST_COMPRESSION, wxZLIB_ZLIB );
|
||||||
|
|
||||||
|
zos.Write( inbuf, stream_len );
|
||||||
|
|
||||||
|
delete[] inbuf;
|
||||||
|
|
||||||
|
} // flush the zip stream using zos destructor
|
||||||
|
|
||||||
|
wxStreamBuffer* sb = memos.GetOutputStreamBuffer();
|
||||||
|
|
||||||
|
unsigned out_count = sb->Tell();
|
||||||
|
|
||||||
|
fwrite( sb->GetBufferStart(), 1, out_count, outputFile );
|
||||||
|
|
||||||
|
fputs( "endstream\n", outputFile );
|
||||||
|
closePdfObject();
|
||||||
|
|
||||||
|
// Writing the deferred length as an indirect object
|
||||||
|
startPdfObject( streamLengthHandle );
|
||||||
|
fprintf( outputFile, "%u\n", out_count );
|
||||||
|
closePdfObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts a new page in the PDF document
|
||||||
|
*/
|
||||||
|
void PDF_PLOTTER::StartPage()
|
||||||
|
{
|
||||||
|
wxASSERT( outputFile );
|
||||||
|
wxASSERT( !workFile );
|
||||||
|
|
||||||
|
// Compute the paper size in IUs
|
||||||
|
paperSize = pageInfo.GetSizeMils();
|
||||||
|
paperSize.x *= 10.0 / iuPerDeviceUnit;
|
||||||
|
paperSize.y *= 10.0 / iuPerDeviceUnit;
|
||||||
|
SetDefaultLineWidth( 100 / iuPerDeviceUnit ); // arbitrary default
|
||||||
|
|
||||||
|
// Open the content stream; the page object will go later
|
||||||
|
pageStreamHandle = startPdfStream();
|
||||||
|
|
||||||
|
/* Now, until ClosePage *everything* must be wrote in workFile, to be
|
||||||
|
compressed later in closePdfStream */
|
||||||
|
|
||||||
|
// Default graphic settings (coordinate system, default color and line style)
|
||||||
|
fprintf( workFile,
|
||||||
|
"%g 0 0 %g 0 0 cm 1 J 1 j 0 0 0 rg 0 0 0 RG %g w\n",
|
||||||
|
0.0072 * plotScaleAdjX, 0.0072 * plotScaleAdjY,
|
||||||
|
userToDeviceSize( defaultPenWidth ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close the current page in the PDF document (and emit its compressed stream)
|
||||||
|
*/
|
||||||
|
void PDF_PLOTTER::ClosePage()
|
||||||
|
{
|
||||||
|
wxASSERT( workFile );
|
||||||
|
|
||||||
|
// Close the page stream (and compress it)
|
||||||
|
closePdfStream();
|
||||||
|
|
||||||
|
// Emit the page object and put it in the page list for later
|
||||||
|
pageHandles.push_back( startPdfObject() );
|
||||||
|
|
||||||
|
/* Page size is in 1/72 of inch (default user space units)
|
||||||
|
Works like the bbox in postscript but there is no need for
|
||||||
|
swapping the sizes, since PDF doesn't require a portrait page.
|
||||||
|
We use the MediaBox but PDF has lots of other less used boxes
|
||||||
|
to use */
|
||||||
|
|
||||||
|
const double BIGPTsPERMIL = 0.072;
|
||||||
|
wxSize psPaperSize = pageInfo.GetSizeMils();
|
||||||
|
|
||||||
|
fprintf( outputFile,
|
||||||
|
"<<\n"
|
||||||
|
"/Type /Page\n"
|
||||||
|
"/Parent %d 0 R\n"
|
||||||
|
"/Resources <<\n"
|
||||||
|
" /ProcSet [/PDF /Text /ImageC /ImageB]\n"
|
||||||
|
" /Font %d 0 R >>\n"
|
||||||
|
"/MediaBox [0 0 %d %d]\n"
|
||||||
|
"/Contents %d 0 R\n"
|
||||||
|
">>\n",
|
||||||
|
pageTreeHandle,
|
||||||
|
fontResDictHandle,
|
||||||
|
int( ceil( psPaperSize.x * BIGPTsPERMIL ) ),
|
||||||
|
int( ceil( psPaperSize.y * BIGPTsPERMIL ) ),
|
||||||
|
pageStreamHandle );
|
||||||
|
closePdfObject();
|
||||||
|
|
||||||
|
// Mark the page stream as idle
|
||||||
|
pageStreamHandle = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The PDF engine supports multiple pages; the first one is opened
|
||||||
|
* 'for free' the following are to be closed and reopened. Between
|
||||||
|
* each page parameters can be set
|
||||||
|
*/
|
||||||
|
bool PDF_PLOTTER::StartPlot( FILE* fout )
|
||||||
|
{
|
||||||
|
wxASSERT( !outputFile );
|
||||||
|
|
||||||
|
outputFile = fout;
|
||||||
|
|
||||||
|
// First things first: the customary null object
|
||||||
|
xrefTable.clear();
|
||||||
|
xrefTable.push_back( 0 );
|
||||||
|
|
||||||
|
/* The header (that's easy!). The second line is binary junk required
|
||||||
|
to make the file binary from the beginning (the important thing is
|
||||||
|
that they must have the bit 7 set) */
|
||||||
|
fputs( "%PDF-1.5\n%\200\201\202\203\n", outputFile );
|
||||||
|
|
||||||
|
/* Allocate an entry for the page tree root, it will go in every page
|
||||||
|
parent entry */
|
||||||
|
pageTreeHandle = allocPdfObject();
|
||||||
|
|
||||||
|
/* In the same way, the font resource dictionary is used by every page
|
||||||
|
(it *could* be inherited via the Pages tree */
|
||||||
|
fontResDictHandle = allocPdfObject();
|
||||||
|
|
||||||
|
/* Now, the PDF is read from the end, (more or less)... so we start
|
||||||
|
with the page stream for page 1. Other more important stuff is written
|
||||||
|
at the end */
|
||||||
|
StartPage();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool PDF_PLOTTER::EndPlot()
|
||||||
|
{
|
||||||
|
wxASSERT( outputFile );
|
||||||
|
|
||||||
|
// Close the current page (often the only one)
|
||||||
|
ClosePage();
|
||||||
|
|
||||||
|
/* We need to declare the resources we're using (fonts in particular)
|
||||||
|
The useful standard one is the Helvetica family. Adding external fonts
|
||||||
|
is *very* involved! */
|
||||||
|
struct {
|
||||||
|
const char *psname;
|
||||||
|
const char *rsname;
|
||||||
|
int font_handle;
|
||||||
|
} fontdefs[4] = {
|
||||||
|
{ "/Helvetica", "/KicadFont", 0 },
|
||||||
|
{ "/Helvetica-Oblique", "/KicadFontI", 0 },
|
||||||
|
{ "/Helvetica-Bold", "/KicadFontB", 0 },
|
||||||
|
{ "/Helvetica-BoldOblique", "/KicadFontBI", 0 }
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Declare the font resources. Since they're builtin fonts, no descriptors (yay!)
|
||||||
|
We'll need metrics anyway to do any aligment (these are in the shared with
|
||||||
|
the postscript engine) */
|
||||||
|
for( int i = 0; i < 4; i++ )
|
||||||
|
{
|
||||||
|
fontdefs[i].font_handle = startPdfObject();
|
||||||
|
fprintf( outputFile,
|
||||||
|
"<< /BaseFont %s\n"
|
||||||
|
" /Type /Font\n"
|
||||||
|
" /Subtype /Type1\n"
|
||||||
|
|
||||||
|
/* Adobe is so Mac-based that the nearest thing to Latin1 is
|
||||||
|
the Windows ANSI encoding! */
|
||||||
|
" /Encoding /WinAnsiEncoding\n"
|
||||||
|
">>\n",
|
||||||
|
fontdefs[i].psname );
|
||||||
|
closePdfObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Named font dictionary (was allocated, now we emit it)
|
||||||
|
startPdfObject( fontResDictHandle );
|
||||||
|
fputs( "<<\n", outputFile );
|
||||||
|
for( int i = 0; i < 4; i++ )
|
||||||
|
{
|
||||||
|
fprintf( outputFile, " %s %d 0 R\n",
|
||||||
|
fontdefs[i].rsname, fontdefs[i].font_handle );
|
||||||
|
}
|
||||||
|
fputs( ">>\n", outputFile );
|
||||||
|
closePdfObject();
|
||||||
|
|
||||||
|
/* The page tree: it's a B-tree but luckily we only have few pages!
|
||||||
|
So we use just an array... The handle was allocated at the beginning,
|
||||||
|
now we instantiate the corresponding object */
|
||||||
|
startPdfObject( pageTreeHandle );
|
||||||
|
fputs( "<<\n"
|
||||||
|
"/Type /Pages\n"
|
||||||
|
"/Kids [\n", outputFile );
|
||||||
|
|
||||||
|
for( unsigned i = 0; i < pageHandles.size(); i++ )
|
||||||
|
fprintf( outputFile, "%d 0 R\n", pageHandles[i] );
|
||||||
|
|
||||||
|
fprintf( outputFile,
|
||||||
|
"]\n"
|
||||||
|
"/Count %ld\n"
|
||||||
|
">>\n", (long) pageHandles.size() );
|
||||||
|
closePdfObject();
|
||||||
|
|
||||||
|
|
||||||
|
// The info dictionary
|
||||||
|
int infoDictHandle = startPdfObject();
|
||||||
|
char date_buf[250];
|
||||||
|
time_t ltime = time( NULL );
|
||||||
|
strftime( date_buf, 250, "D:%Y%m%d%H%M%S",
|
||||||
|
localtime( <ime ) );
|
||||||
|
fprintf( outputFile,
|
||||||
|
"<<\n"
|
||||||
|
"/Producer (KiCAD PDF)\n"
|
||||||
|
"/CreationDate (%s)\n"
|
||||||
|
"/Creator (%s)\n"
|
||||||
|
"/Title (%s)\n"
|
||||||
|
"/Trapped false\n",
|
||||||
|
date_buf,
|
||||||
|
TO_UTF8( creator ),
|
||||||
|
TO_UTF8( filename ) );
|
||||||
|
|
||||||
|
fputs( ">>\n", outputFile );
|
||||||
|
closePdfObject();
|
||||||
|
|
||||||
|
// The catalog, at last
|
||||||
|
int catalogHandle = startPdfObject();
|
||||||
|
fprintf( outputFile,
|
||||||
|
"<<\n"
|
||||||
|
"/Type /Catalog\n"
|
||||||
|
"/Pages %d 0 R\n"
|
||||||
|
"/Version /1.5\n"
|
||||||
|
"/PageMode /UseNone\n"
|
||||||
|
"/PageLayout /SinglePage\n"
|
||||||
|
">>\n", pageTreeHandle );
|
||||||
|
closePdfObject();
|
||||||
|
|
||||||
|
/* Emit the xref table (format is crucial to the byte, each entry must
|
||||||
|
be 20 bytes long, and object zero must be done in that way). Also
|
||||||
|
the offset must be kept along for the trailer */
|
||||||
|
long xref_start = ftell( outputFile );
|
||||||
|
fprintf( outputFile,
|
||||||
|
"xref\n"
|
||||||
|
"0 %ld\n"
|
||||||
|
"0000000000 65535 f \n", (long) xrefTable.size() );
|
||||||
|
for( unsigned i = 1; i < xrefTable.size(); i++ )
|
||||||
|
{
|
||||||
|
fprintf( outputFile, "%010ld 00000 n \n", xrefTable[i] );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Done the xref, go for the trailer
|
||||||
|
fprintf( outputFile,
|
||||||
|
"trailer\n"
|
||||||
|
"<< /Size %lu /Root %d 0 R /Info %d 0 R >>\n"
|
||||||
|
"startxref\n"
|
||||||
|
"%ld\n" // The offset we saved before
|
||||||
|
"%%EOF\n",
|
||||||
|
(unsigned long) xrefTable.size(), catalogHandle, infoDictHandle, xref_start );
|
||||||
|
|
||||||
|
fclose( outputFile );
|
||||||
|
outputFile = NULL;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PDF_PLOTTER::Text( const wxPoint& aPos,
|
||||||
|
enum EDA_COLOR_T aColor,
|
||||||
|
const wxString& aText,
|
||||||
|
int aOrient,
|
||||||
|
const wxSize& aSize,
|
||||||
|
enum EDA_TEXT_HJUSTIFY_T aH_justify,
|
||||||
|
enum EDA_TEXT_VJUSTIFY_T aV_justify,
|
||||||
|
int aWidth,
|
||||||
|
bool aItalic,
|
||||||
|
bool aBold )
|
||||||
|
{
|
||||||
|
// Emit native PDF text (if requested)
|
||||||
|
if( psTextMode != PSTEXTMODE_STROKE )
|
||||||
|
{
|
||||||
|
const char *fontname = aItalic ? (aBold ? "/KicadFontBI" : "/KicadFontI")
|
||||||
|
: (aBold ? "/KicadFontB" : "/KicadFont");
|
||||||
|
|
||||||
|
// Compute the copious tranformation parameters
|
||||||
|
double ctm_a, ctm_b, ctm_c, ctm_d, ctm_e, ctm_f;
|
||||||
|
double wideningFactor, heightFactor;
|
||||||
|
computeTextParameters( aPos, aText, aOrient, aSize, aH_justify,
|
||||||
|
aV_justify, aWidth, aItalic, aBold,
|
||||||
|
&wideningFactor, &ctm_a, &ctm_b, &ctm_c,
|
||||||
|
&ctm_d, &ctm_e, &ctm_f, &heightFactor );
|
||||||
|
|
||||||
|
SetColor( aColor );
|
||||||
|
SetCurrentLineWidth( aWidth );
|
||||||
|
|
||||||
|
/* We use the full CTM instead of the text matrix because the same
|
||||||
|
coordinate system will be used for the overlining. Also the %f
|
||||||
|
for the trig part of the matrix to avoid %g going in exponential
|
||||||
|
format (which is not supported)
|
||||||
|
Rendermode 0 shows the text, rendermode 3 is invisible */
|
||||||
|
fprintf( workFile, "q %f %f %f %f %g %g cm BT %s %g Tf %d Tr %g Tz ",
|
||||||
|
ctm_a, ctm_b, ctm_c, ctm_d, ctm_e, ctm_f,
|
||||||
|
fontname, heightFactor,
|
||||||
|
(psTextMode == PSTEXTMODE_NATIVE) ? 0 : 3,
|
||||||
|
wideningFactor * 100 );
|
||||||
|
|
||||||
|
// The text must be escaped correctly
|
||||||
|
fputsPostscriptString( workFile, aText );
|
||||||
|
fputs( " Tj ET\n", workFile );
|
||||||
|
|
||||||
|
/* We are still in text coordinates, plot the overbars (if we're
|
||||||
|
* not doing phantom text) */
|
||||||
|
if( psTextMode == PSTEXTMODE_NATIVE )
|
||||||
|
{
|
||||||
|
std::vector<int> pos_pairs;
|
||||||
|
postscriptOverlinePositions( aText, aSize.x, aItalic, aBold, &pos_pairs );
|
||||||
|
int overbar_y = KiROUND( aSize.y * 1.1 );
|
||||||
|
for( unsigned i = 0; i < pos_pairs.size(); i += 2)
|
||||||
|
{
|
||||||
|
/* This is a nontrivial situation: we are *not* in the user
|
||||||
|
coordinate system, so the userToDeviceCoordinates function
|
||||||
|
can't be used! Strange as it may seem, the userToDeviceSize
|
||||||
|
is the right function to use here... */
|
||||||
|
DPOINT dev_from = userToDeviceSize( wxSize( pos_pairs[i], overbar_y ) );
|
||||||
|
DPOINT dev_to = userToDeviceSize( wxSize( pos_pairs[i + 1], overbar_y ) );
|
||||||
|
fprintf( workFile, "%g %g m %g %g l ",
|
||||||
|
dev_from.x, dev_from.y, dev_to.x, dev_to.y );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stroke and restore the CTM
|
||||||
|
fputs( "S Q\n", workFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Plot the stroked text (if requested)
|
||||||
|
if( psTextMode != PSTEXTMODE_NATIVE )
|
||||||
|
{
|
||||||
|
PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify,
|
||||||
|
aWidth, aItalic, aBold );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
* @file common_plot_functions.cpp
|
* @file common_plot_functions.cpp
|
||||||
* @brief Kicad: Common plot Postscript Routines
|
* @brief Kicad: Common plotting Routines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <fctsys.h>
|
#include <fctsys.h>
|
||||||
|
@ -31,7 +31,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
EDA_COLOR_T color;
|
EDA_COLOR_T color;
|
||||||
|
|
||||||
// Paper is sized in mils. Here is a conversion factor to scale mils to internal units.
|
// Paper is sized in mils. Here is a conversion factor to scale mils to internal units.
|
||||||
int conv_unit = screen->MilsToIuScalar();
|
int iusPerMil = screen->MilsToIuScalar();
|
||||||
|
|
||||||
wxString msg;
|
wxString msg;
|
||||||
wxSize text_size;
|
wxSize text_size;
|
||||||
|
@ -49,59 +49,59 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
bool thickness = 0; //@todo : use current pen
|
bool thickness = 0; //@todo : use current pen
|
||||||
|
|
||||||
color = BLACK;
|
color = BLACK;
|
||||||
plotter->set_color( color );
|
plotter->SetColor( color );
|
||||||
|
|
||||||
// Plot edge.
|
// Plot edge.
|
||||||
ref.x = pageInfo.GetLeftMarginMils() * conv_unit;
|
ref.x = pageInfo.GetLeftMarginMils() * iusPerMil;
|
||||||
ref.y = pageInfo.GetTopMarginMils() * conv_unit;
|
ref.y = pageInfo.GetTopMarginMils() * iusPerMil;
|
||||||
|
|
||||||
xg = ( pageSize.x - pageInfo.GetRightMarginMils() ) * conv_unit;
|
xg = ( pageSize.x - pageInfo.GetRightMarginMils() ) * iusPerMil;
|
||||||
yg = ( pageSize.y - pageInfo.GetBottomMarginMils() ) * conv_unit;
|
yg = ( pageSize.y - pageInfo.GetBottomMarginMils() ) * iusPerMil;
|
||||||
|
|
||||||
#if defined(KICAD_GOST)
|
#if defined(KICAD_GOST)
|
||||||
plotter->move_to( ref );
|
plotter->MoveTo( ref );
|
||||||
pos.x = xg;
|
pos.x = xg;
|
||||||
pos.y = ref.y;
|
pos.y = ref.y;
|
||||||
plotter->line_to( pos );
|
plotter->LineTo( pos );
|
||||||
pos.x = xg;
|
pos.x = xg;
|
||||||
pos.y = yg;
|
pos.y = yg;
|
||||||
plotter->line_to( pos );
|
plotter->LineTo( pos );
|
||||||
pos.x = ref.x;
|
pos.x = ref.x;
|
||||||
pos.y = yg;
|
pos.y = yg;
|
||||||
plotter->line_to( pos );
|
plotter->LineTo( pos );
|
||||||
plotter->finish_to( ref );
|
plotter->FinishTo( ref );
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
for( unsigned ii = 0; ii < 2; ii++ )
|
for( unsigned ii = 0; ii < 2; ii++ )
|
||||||
{
|
{
|
||||||
plotter->move_to( ref );
|
plotter->MoveTo( ref );
|
||||||
|
|
||||||
pos.x = xg;
|
pos.x = xg;
|
||||||
pos.y = ref.y;
|
pos.y = ref.y;
|
||||||
plotter->line_to( pos );
|
plotter->LineTo( pos );
|
||||||
|
|
||||||
pos.x = xg;
|
pos.x = xg;
|
||||||
pos.y = yg;
|
pos.y = yg;
|
||||||
plotter->line_to( pos );
|
plotter->LineTo( pos );
|
||||||
|
|
||||||
pos.x = ref.x;
|
pos.x = ref.x;
|
||||||
pos.y = yg;
|
pos.y = yg;
|
||||||
plotter->line_to( pos );
|
plotter->LineTo( pos );
|
||||||
|
|
||||||
plotter->finish_to( ref );
|
plotter->FinishTo( ref );
|
||||||
|
|
||||||
ref.x += GRID_REF_W * conv_unit;
|
ref.x += GRID_REF_W * iusPerMil;
|
||||||
ref.y += GRID_REF_W * conv_unit;
|
ref.y += GRID_REF_W * iusPerMil;
|
||||||
|
|
||||||
xg -= GRID_REF_W * conv_unit;
|
xg -= GRID_REF_W * iusPerMil;
|
||||||
yg -= GRID_REF_W * conv_unit;
|
yg -= GRID_REF_W * iusPerMil;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
text_size.x = WSTEXTSIZE * conv_unit;
|
text_size.x = WSTEXTSIZE * iusPerMil;
|
||||||
text_size.y = WSTEXTSIZE * conv_unit;
|
text_size.y = WSTEXTSIZE * iusPerMil;
|
||||||
|
|
||||||
// upper left corner in mils
|
// upper left corner in mils
|
||||||
ref.x = pageInfo.GetLeftMarginMils();
|
ref.x = pageInfo.GetLeftMarginMils();
|
||||||
|
@ -116,8 +116,8 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
WsItem != NULL;
|
WsItem != NULL;
|
||||||
WsItem = WsItem->Pnext )
|
WsItem = WsItem->Pnext )
|
||||||
{
|
{
|
||||||
pos.x = ( ref.x - WsItem->m_Posx ) * conv_unit;
|
pos.x = ( ref.x - WsItem->m_Posx ) * iusPerMil;
|
||||||
pos.y = ( yg - WsItem->m_Posy ) * conv_unit;
|
pos.y = ( yg - WsItem->m_Posy ) * iusPerMil;
|
||||||
msg.Empty();
|
msg.Empty();
|
||||||
switch( WsItem->m_Type )
|
switch( WsItem->m_Type )
|
||||||
{
|
{
|
||||||
|
@ -127,17 +127,17 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
case WS_PODPIS_LU:
|
case WS_PODPIS_LU:
|
||||||
if( WsItem->m_Legende )
|
if( WsItem->m_Legende )
|
||||||
msg = WsItem->m_Legende;
|
msg = WsItem->m_Legende;
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg, TEXT_ORIENT_VERT, text_size,
|
msg, TEXT_ORIENT_VERT, text_size,
|
||||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM,
|
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WS_SEGMENT_LU:
|
case WS_SEGMENT_LU:
|
||||||
plotter->move_to( pos );
|
plotter->MoveTo( pos );
|
||||||
pos.x = ( ref.x - WsItem->m_Endx ) * conv_unit;
|
pos.x = ( ref.x - WsItem->m_Endx ) * iusPerMil;
|
||||||
pos.y = ( yg - WsItem->m_Endy ) * conv_unit;
|
pos.y = ( yg - WsItem->m_Endy ) * iusPerMil;
|
||||||
plotter->finish_to( pos );
|
plotter->FinishTo( pos );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,16 +146,16 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
WsItem != NULL;
|
WsItem != NULL;
|
||||||
WsItem = WsItem->Pnext )
|
WsItem = WsItem->Pnext )
|
||||||
{
|
{
|
||||||
pos.x = ( ref.x + WsItem->m_Posx ) * conv_unit;
|
pos.x = ( ref.x + WsItem->m_Posx ) * iusPerMil;
|
||||||
pos.y = ( ref.y + WsItem->m_Posy ) * conv_unit;
|
pos.y = ( ref.y + WsItem->m_Posy ) * iusPerMil;
|
||||||
msg.Empty();
|
msg.Empty();
|
||||||
switch( WsItem->m_Type )
|
switch( WsItem->m_Type )
|
||||||
{
|
{
|
||||||
case WS_SEGMENT_LT:
|
case WS_SEGMENT_LT:
|
||||||
plotter->move_to( pos );
|
plotter->MoveTo( pos );
|
||||||
pos.x = ( ref.x + WsItem->m_Endx ) * conv_unit;
|
pos.x = ( ref.x + WsItem->m_Endx ) * iusPerMil;
|
||||||
pos.y = ( ref.y + WsItem->m_Endy ) * conv_unit;
|
pos.y = ( ref.y + WsItem->m_Endy ) * iusPerMil;
|
||||||
plotter->finish_to( pos );
|
plotter->FinishTo( pos );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -172,33 +172,33 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
|
|
||||||
if( ii < xg - PAS_REF / 2 )
|
if( ii < xg - PAS_REF / 2 )
|
||||||
{
|
{
|
||||||
pos.x = ii * conv_unit;
|
pos.x = ii * iusPerMil;
|
||||||
pos.y = ref.y * conv_unit;
|
pos.y = ref.y * iusPerMil;
|
||||||
plotter->move_to( pos );
|
plotter->MoveTo( pos );
|
||||||
pos.x = ii * conv_unit;
|
pos.x = ii * iusPerMil;
|
||||||
pos.y = ( ref.y + GRID_REF_W ) * conv_unit;
|
pos.y = ( ref.y + GRID_REF_W ) * iusPerMil;
|
||||||
plotter->finish_to( pos );
|
plotter->FinishTo( pos );
|
||||||
}
|
}
|
||||||
|
|
||||||
pos.x = ( ii - gxpas / 2 ) * conv_unit;
|
pos.x = ( ii - gxpas / 2 ) * iusPerMil;
|
||||||
pos.y = ( ref.y + GRID_REF_W / 2 ) * conv_unit;
|
pos.y = ( ref.y + GRID_REF_W / 2 ) * iusPerMil;
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg, TEXT_ORIENT_HORIZ, text_size,
|
msg, TEXT_ORIENT_HORIZ, text_size,
|
||||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
|
|
||||||
if( ii < xg - PAS_REF / 2 )
|
if( ii < xg - PAS_REF / 2 )
|
||||||
{
|
{
|
||||||
pos.x = ii * conv_unit;
|
pos.x = ii * iusPerMil;
|
||||||
pos.y = yg * conv_unit;
|
pos.y = yg * iusPerMil;
|
||||||
plotter->move_to( pos );
|
plotter->MoveTo( pos );
|
||||||
pos.x = ii * conv_unit;
|
pos.x = ii * iusPerMil;
|
||||||
pos.y = (yg - GRID_REF_W) * conv_unit;
|
pos.y = (yg - GRID_REF_W) * iusPerMil;
|
||||||
plotter->finish_to( pos );
|
plotter->FinishTo( pos );
|
||||||
}
|
}
|
||||||
pos.x = ( ii - gxpas / 2 ) * conv_unit;
|
pos.x = ( ii - gxpas / 2 ) * iusPerMil;
|
||||||
pos.y = ( yg - GRID_REF_W / 2 ) * conv_unit;
|
pos.y = ( yg - GRID_REF_W / 2 ) * iusPerMil;
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg, TEXT_ORIENT_HORIZ, text_size,
|
msg, TEXT_ORIENT_HORIZ, text_size,
|
||||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
|
@ -215,33 +215,33 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
msg.Printf( wxT( "%c" ), 'a' + jj - 26 );
|
msg.Printf( wxT( "%c" ), 'a' + jj - 26 );
|
||||||
if( ii < yg - PAS_REF / 2 )
|
if( ii < yg - PAS_REF / 2 )
|
||||||
{
|
{
|
||||||
pos.x = ref.x * conv_unit;
|
pos.x = ref.x * iusPerMil;
|
||||||
pos.y = ii * conv_unit;
|
pos.y = ii * iusPerMil;
|
||||||
plotter->move_to( pos );
|
plotter->MoveTo( pos );
|
||||||
pos.x = ( ref.x + GRID_REF_W ) * conv_unit;
|
pos.x = ( ref.x + GRID_REF_W ) * iusPerMil;
|
||||||
pos.y = ii * conv_unit;
|
pos.y = ii * iusPerMil;
|
||||||
plotter->finish_to( pos );
|
plotter->FinishTo( pos );
|
||||||
}
|
}
|
||||||
pos.x = ( ref.x + GRID_REF_W / 2 ) * conv_unit;
|
pos.x = ( ref.x + GRID_REF_W / 2 ) * iusPerMil;
|
||||||
pos.y = ( ii - gypas / 2 ) * conv_unit;
|
pos.y = ( ii - gypas / 2 ) * iusPerMil;
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg, TEXT_ORIENT_HORIZ, text_size,
|
msg, TEXT_ORIENT_HORIZ, text_size,
|
||||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
|
|
||||||
if( ii < yg - PAS_REF / 2 )
|
if( ii < yg - PAS_REF / 2 )
|
||||||
{
|
{
|
||||||
pos.x = xg * conv_unit;
|
pos.x = xg * iusPerMil;
|
||||||
pos.y = ii * conv_unit;
|
pos.y = ii * iusPerMil;
|
||||||
plotter->move_to( pos );
|
plotter->MoveTo( pos );
|
||||||
pos.x = ( xg - GRID_REF_W ) * conv_unit;
|
pos.x = ( xg - GRID_REF_W ) * iusPerMil;
|
||||||
pos.y = ii * conv_unit;
|
pos.y = ii * iusPerMil;
|
||||||
plotter->finish_to( pos );
|
plotter->FinishTo( pos );
|
||||||
}
|
}
|
||||||
|
|
||||||
pos.x = ( xg - GRID_REF_W / 2 ) * conv_unit;
|
pos.x = ( xg - GRID_REF_W / 2 ) * iusPerMil;
|
||||||
pos.y = ( ii - gypas / 2 ) * conv_unit;
|
pos.y = ( ii - gypas / 2 ) * iusPerMil;
|
||||||
plotter->text( pos, color, msg, TEXT_ORIENT_HORIZ, text_size,
|
plotter->Text( pos, color, msg, TEXT_ORIENT_HORIZ, text_size,
|
||||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
}
|
}
|
||||||
|
@ -249,16 +249,16 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Plot the worksheet.
|
// Plot the worksheet.
|
||||||
text_size.x = SIZETEXT * conv_unit;
|
text_size.x = SIZETEXT * iusPerMil;
|
||||||
text_size.y = SIZETEXT * conv_unit;
|
text_size.y = SIZETEXT * iusPerMil;
|
||||||
|
|
||||||
#if defined(KICAD_GOST)
|
#if defined(KICAD_GOST)
|
||||||
text_size2.x = SIZETEXT * conv_unit * 2;
|
text_size2.x = SIZETEXT * iusPerMil * 2;
|
||||||
text_size2.y = SIZETEXT * conv_unit * 2;
|
text_size2.y = SIZETEXT * iusPerMil * 2;
|
||||||
text_size3.x = SIZETEXT * conv_unit * 3;
|
text_size3.x = SIZETEXT * iusPerMil * 3;
|
||||||
text_size3.y = SIZETEXT * conv_unit * 3;
|
text_size3.y = SIZETEXT * iusPerMil * 3;
|
||||||
text_size1_5.x = SIZETEXT * conv_unit * 1.5;
|
text_size1_5.x = SIZETEXT * iusPerMil * 1.5;
|
||||||
text_size1_5.y = SIZETEXT * conv_unit * 1.5;
|
text_size1_5.y = SIZETEXT * iusPerMil * 1.5;
|
||||||
|
|
||||||
ref.x = pageSize.x - pageInfo.GetRightMarginMils();
|
ref.x = pageSize.x - pageInfo.GetRightMarginMils();
|
||||||
ref.y = pageSize.y - pageInfo.GetBottomMarginMils();
|
ref.y = pageSize.y - pageInfo.GetBottomMarginMils();
|
||||||
|
@ -269,8 +269,8 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
WsItem != NULL;
|
WsItem != NULL;
|
||||||
WsItem = WsItem->Pnext )
|
WsItem = WsItem->Pnext )
|
||||||
{
|
{
|
||||||
pos.x = ( ref.x - WsItem->m_Posx ) * conv_unit;
|
pos.x = ( ref.x - WsItem->m_Posx ) * iusPerMil;
|
||||||
pos.y = ( ref.y - WsItem->m_Posy ) * conv_unit;
|
pos.y = ( ref.y - WsItem->m_Posy ) * iusPerMil;
|
||||||
msg.Empty();
|
msg.Empty();
|
||||||
|
|
||||||
switch( WsItem->m_Type )
|
switch( WsItem->m_Type )
|
||||||
|
@ -287,7 +287,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
case WS_PODPIS:
|
case WS_PODPIS:
|
||||||
if( WsItem->m_Legende )
|
if( WsItem->m_Legende )
|
||||||
msg = WsItem->m_Legende;
|
msg = WsItem->m_Legende;
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg, TEXT_ORIENT_HORIZ, text_size,
|
msg, TEXT_ORIENT_HORIZ, text_size,
|
||||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
|
@ -299,9 +299,9 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
case WS_IDENTSHEET:
|
case WS_IDENTSHEET:
|
||||||
if( WsItem->m_Legende )
|
if( WsItem->m_Legende )
|
||||||
msg = WsItem->m_Legende;
|
msg = WsItem->m_Legende;
|
||||||
if( screen->m_NumberOfScreen > 1 )
|
if( screen->m_NumberOfScreens > 1 )
|
||||||
msg << screen->m_ScreenNumber;
|
msg << screen->m_ScreenNumber;
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg, TEXT_ORIENT_HORIZ, text_size,
|
msg, TEXT_ORIENT_HORIZ, text_size,
|
||||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
|
@ -310,8 +310,8 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
case WS_SHEETS:
|
case WS_SHEETS:
|
||||||
if( WsItem->m_Legende )
|
if( WsItem->m_Legende )
|
||||||
msg = WsItem->m_Legende;
|
msg = WsItem->m_Legende;
|
||||||
msg << screen->m_NumberOfScreen;
|
msg << screen->m_NumberOfScreens;
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg, TEXT_ORIENT_HORIZ, text_size,
|
msg, TEXT_ORIENT_HORIZ, text_size,
|
||||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
|
@ -321,7 +321,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
msg = GetTitleBlock().GetCompany();
|
msg = GetTitleBlock().GetCompany();
|
||||||
if( !msg.IsEmpty() )
|
if( !msg.IsEmpty() )
|
||||||
{
|
{
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg, TEXT_ORIENT_HORIZ, text_size1_5,
|
msg, TEXT_ORIENT_HORIZ, text_size1_5,
|
||||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
|
@ -332,7 +332,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
msg = GetTitleBlock().GetTitle();
|
msg = GetTitleBlock().GetTitle();
|
||||||
if( !msg.IsEmpty() )
|
if( !msg.IsEmpty() )
|
||||||
{
|
{
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg, TEXT_ORIENT_HORIZ, text_size1_5,
|
msg, TEXT_ORIENT_HORIZ, text_size1_5,
|
||||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
|
@ -343,13 +343,13 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
msg = GetTitleBlock().GetComment1();
|
msg = GetTitleBlock().GetComment1();
|
||||||
if( !msg.IsEmpty() )
|
if( !msg.IsEmpty() )
|
||||||
{
|
{
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg, TEXT_ORIENT_HORIZ, text_size3,
|
msg, TEXT_ORIENT_HORIZ, text_size3,
|
||||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
pos.x = (pageInfo.GetLeftMarginMils() + 1260) * conv_unit;
|
pos.x = (pageInfo.GetLeftMarginMils() + 1260) * iusPerMil;
|
||||||
pos.y = (pageInfo.GetTopMarginMils() + 270) * conv_unit;
|
pos.y = (pageInfo.GetTopMarginMils() + 270) * iusPerMil;
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg.GetData(), 1800, text_size2,
|
msg.GetData(), 1800, text_size2,
|
||||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
|
@ -360,7 +360,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
msg = GetTitleBlock().GetComment2();
|
msg = GetTitleBlock().GetComment2();
|
||||||
if( !msg.IsEmpty() )
|
if( !msg.IsEmpty() )
|
||||||
{
|
{
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg, TEXT_ORIENT_HORIZ, text_size,
|
msg, TEXT_ORIENT_HORIZ, text_size,
|
||||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
|
@ -371,7 +371,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
msg = GetTitleBlock().GetComment3();
|
msg = GetTitleBlock().GetComment3();
|
||||||
if( !msg.IsEmpty() )
|
if( !msg.IsEmpty() )
|
||||||
{
|
{
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg, TEXT_ORIENT_HORIZ, text_size,
|
msg, TEXT_ORIENT_HORIZ, text_size,
|
||||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
|
@ -382,7 +382,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
msg = GetTitleBlock().GetComment4();
|
msg = GetTitleBlock().GetComment4();
|
||||||
if( !msg.IsEmpty() )
|
if( !msg.IsEmpty() )
|
||||||
{
|
{
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg, TEXT_ORIENT_HORIZ, text_size,
|
msg, TEXT_ORIENT_HORIZ, text_size,
|
||||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
|
@ -392,10 +392,10 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
case WS_UPPER_SEGMENT:
|
case WS_UPPER_SEGMENT:
|
||||||
case WS_LEFT_SEGMENT:
|
case WS_LEFT_SEGMENT:
|
||||||
case WS_SEGMENT:
|
case WS_SEGMENT:
|
||||||
plotter->move_to( pos );
|
plotter->MoveTo( pos );
|
||||||
pos.x = ( ref.x - WsItem->m_Endx ) * conv_unit;
|
pos.x = ( ref.x - WsItem->m_Endx ) * iusPerMil;
|
||||||
pos.y = ( ref.y - WsItem->m_Endy ) * conv_unit;
|
pos.y = ( ref.y - WsItem->m_Endy ) * iusPerMil;
|
||||||
plotter->finish_to( pos );
|
plotter->FinishTo( pos );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -406,8 +406,8 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
WsItem != NULL;
|
WsItem != NULL;
|
||||||
WsItem = WsItem->Pnext )
|
WsItem = WsItem->Pnext )
|
||||||
{
|
{
|
||||||
pos.x = ( ref.x - WsItem->m_Posx ) * conv_unit;
|
pos.x = ( ref.x - WsItem->m_Posx ) * iusPerMil;
|
||||||
pos.y = ( ref.y - WsItem->m_Posy ) * conv_unit;
|
pos.y = ( ref.y - WsItem->m_Posy ) * iusPerMil;
|
||||||
msg.Empty();
|
msg.Empty();
|
||||||
|
|
||||||
switch( WsItem->m_Type )
|
switch( WsItem->m_Type )
|
||||||
|
@ -417,13 +417,13 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
msg = GetTitleBlock().GetComment1();
|
msg = GetTitleBlock().GetComment1();
|
||||||
if( !msg.IsEmpty() )
|
if( !msg.IsEmpty() )
|
||||||
{
|
{
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg, TEXT_ORIENT_HORIZ, text_size3,
|
msg, TEXT_ORIENT_HORIZ, text_size3,
|
||||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
pos.x = (pageInfo.GetLeftMarginMils() + 1260) * conv_unit;
|
pos.x = (pageInfo.GetLeftMarginMils() + 1260) * iusPerMil;
|
||||||
pos.y = (pageInfo.GetTopMarginMils() + 270) * conv_unit;
|
pos.y = (pageInfo.GetTopMarginMils() + 270) * iusPerMil;
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg, 1800, text_size2,
|
msg, 1800, text_size2,
|
||||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
|
@ -433,7 +433,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
case WS_PODPIS_D:
|
case WS_PODPIS_D:
|
||||||
if( WsItem->m_Legende )
|
if( WsItem->m_Legende )
|
||||||
msg = WsItem->m_Legende;
|
msg = WsItem->m_Legende;
|
||||||
plotter->text( pos, color, msg, TEXT_ORIENT_HORIZ, text_size,
|
plotter->Text( pos, color, msg, TEXT_ORIENT_HORIZ, text_size,
|
||||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
break;
|
break;
|
||||||
|
@ -442,17 +442,17 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
if( WsItem->m_Legende )
|
if( WsItem->m_Legende )
|
||||||
msg = WsItem->m_Legende;
|
msg = WsItem->m_Legende;
|
||||||
msg << screen->m_ScreenNumber;
|
msg << screen->m_ScreenNumber;
|
||||||
plotter->text( pos, color, msg, TEXT_ORIENT_HORIZ, text_size,
|
plotter->Text( pos, color, msg, TEXT_ORIENT_HORIZ, text_size,
|
||||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WS_LEFT_SEGMENT_D:
|
case WS_LEFT_SEGMENT_D:
|
||||||
case WS_SEGMENT_D:
|
case WS_SEGMENT_D:
|
||||||
plotter->move_to( pos );
|
plotter->MoveTo( pos );
|
||||||
pos.x = ( ref.x - WsItem->m_Endx ) * conv_unit;
|
pos.x = ( ref.x - WsItem->m_Endx ) * iusPerMil;
|
||||||
pos.y = ( ref.y - WsItem->m_Endy ) * conv_unit;
|
pos.y = ( ref.y - WsItem->m_Endy ) * iusPerMil;
|
||||||
plotter->finish_to( pos );
|
plotter->FinishTo( pos );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -467,8 +467,8 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
WsItem != NULL;
|
WsItem != NULL;
|
||||||
WsItem = WsItem->Pnext )
|
WsItem = WsItem->Pnext )
|
||||||
{
|
{
|
||||||
pos.x = ( ref.x - WsItem->m_Posx ) * conv_unit;
|
pos.x = ( ref.x - WsItem->m_Posx ) * iusPerMil;
|
||||||
pos.y = ( ref.y - WsItem->m_Posy ) * conv_unit;
|
pos.y = ( ref.y - WsItem->m_Posy ) * iusPerMil;
|
||||||
bold = false;
|
bold = false;
|
||||||
if( WsItem->m_Legende )
|
if( WsItem->m_Legende )
|
||||||
msg = WsItem->m_Legende;
|
msg = WsItem->m_Legende;
|
||||||
|
@ -497,7 +497,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
|
|
||||||
case WS_IDENTSHEET:
|
case WS_IDENTSHEET:
|
||||||
msg << screen->m_ScreenNumber << wxT( "/" ) <<
|
msg << screen->m_ScreenNumber << wxT( "/" ) <<
|
||||||
screen->m_NumberOfScreen;
|
screen->m_NumberOfScreens;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WS_FILENAME:
|
case WS_FILENAME:
|
||||||
|
@ -558,22 +558,22 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
|
||||||
case WS_LEFT_SEGMENT:
|
case WS_LEFT_SEGMENT:
|
||||||
WS_MostUpperLine.m_Posy = WS_MostUpperLine.m_Endy
|
WS_MostUpperLine.m_Posy = WS_MostUpperLine.m_Endy
|
||||||
= WS_MostLeftLine.m_Posy = UpperLimit;
|
= WS_MostLeftLine.m_Posy = UpperLimit;
|
||||||
pos.y = (ref.y - WsItem->m_Posy) * conv_unit;
|
pos.y = (ref.y - WsItem->m_Posy) * iusPerMil;
|
||||||
|
|
||||||
case WS_SEGMENT:
|
case WS_SEGMENT:
|
||||||
{
|
{
|
||||||
wxPoint auxpos;
|
wxPoint auxpos;
|
||||||
auxpos.x = ( ref.x - WsItem->m_Endx ) * conv_unit;
|
auxpos.x = ( ref.x - WsItem->m_Endx ) * iusPerMil;
|
||||||
auxpos.y = ( ref.y - WsItem->m_Endy ) * conv_unit;
|
auxpos.y = ( ref.y - WsItem->m_Endy ) * iusPerMil;
|
||||||
plotter->move_to( pos );
|
plotter->MoveTo( pos );
|
||||||
plotter->finish_to( auxpos );
|
plotter->FinishTo( auxpos );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !msg.IsEmpty() )
|
if( !msg.IsEmpty() )
|
||||||
{
|
{
|
||||||
plotter->text( pos, color,
|
plotter->Text( pos, color,
|
||||||
msg, TEXT_ORIENT_HORIZ, text_size,
|
msg, TEXT_ORIENT_HORIZ, text_size,
|
||||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
thickness, italic, bold );
|
thickness, italic, bold );
|
||||||
|
|
|
@ -59,7 +59,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
|
||||||
info.SetAppName( wxT( ".: " ) + wxGetApp().GetTitle() + wxT( " :." ) );
|
info.SetAppName( wxT( ".: " ) + wxGetApp().GetTitle() + wxT( " :." ) );
|
||||||
|
|
||||||
/* Copyright information */
|
/* Copyright information */
|
||||||
info.SetCopyright( wxT( "(C) 1992-2011 KiCad Developers Team" ) );
|
info.SetCopyright( wxT( "(C) 1992-2012 KiCad Developers Team" ) );
|
||||||
|
|
||||||
/* KiCad build version */
|
/* KiCad build version */
|
||||||
wxString version;
|
wxString version;
|
||||||
|
@ -147,8 +147,8 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
|
||||||
HtmlHyperlink( wxT( "https://launchpad.net/kicad" ), _( "Project on Launchpad" ) ) << wxT(
|
HtmlHyperlink( wxT( "https://launchpad.net/kicad" ), _( "Project on Launchpad" ) ) << wxT(
|
||||||
"</li>" );
|
"</li>" );
|
||||||
description << wxT( "<li>" ) <<
|
description << wxT( "<li>" ) <<
|
||||||
HtmlHyperlink( wxT( "http://kicad.sourceforge.net" ),
|
HtmlHyperlink( wxT( "http://www.kicad-pcb.org" ),
|
||||||
_( "Wiki on Sourceforge with many information" ) ) << wxT( "</li>" );
|
_( "The new KiCad site" ) ) << wxT( "</li>" );
|
||||||
description << wxT( "<li>" ) <<
|
description << wxT( "<li>" ) <<
|
||||||
HtmlHyperlink( wxT( "http://www.kicadlib.org" ),
|
HtmlHyperlink( wxT( "http://www.kicadlib.org" ),
|
||||||
_( "Repository with additional component libraries" ) ) << wxT( "</li>" );
|
_( "Repository with additional component libraries" ) ) << wxT( "</li>" );
|
||||||
|
|
|
@ -58,7 +58,7 @@ dialog_about_base::dialog_about_base( wxWindow* parent, wxWindowID id, const wxS
|
||||||
bSizer1->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
bSizer1->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
||||||
|
|
||||||
m_auiNotebook = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_SCROLL_BUTTONS|wxAUI_NB_TAB_FIXED_WIDTH );
|
m_auiNotebook = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_SCROLL_BUTTONS|wxAUI_NB_TAB_FIXED_WIDTH );
|
||||||
m_auiNotebook->SetMinSize( wxSize( 550,300 ) );
|
m_auiNotebook->SetMinSize( wxSize( 750,350 ) );
|
||||||
|
|
||||||
|
|
||||||
bSizer1->Add( m_auiNotebook, 2, wxEXPAND | wxALL, 5 );
|
bSizer1->Add( m_auiNotebook, 2, wxEXPAND | wxALL, 5 );
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<property name="minimum_size">-1,-1</property>
|
<property name="minimum_size">-1,-1</property>
|
||||||
<property name="name">dialog_about_base</property>
|
<property name="name">dialog_about_base</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">510,434</property>
|
<property name="size">750,450</property>
|
||||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSTAY_ON_TOP</property>
|
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSTAY_ON_TOP</property>
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="title">About...</property>
|
<property name="title">About...</property>
|
||||||
|
@ -472,7 +472,7 @@
|
||||||
<property name="hidden">0</property>
|
<property name="hidden">0</property>
|
||||||
<property name="id">wxID_ANY</property>
|
<property name="id">wxID_ANY</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="minimum_size">550,300</property>
|
<property name="minimum_size">750,350</property>
|
||||||
<property name="name">m_auiNotebook</property>
|
<property name="name">m_auiNotebook</property>
|
||||||
<property name="permission">protected</property>
|
<property name="permission">protected</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
|
|
|
@ -53,7 +53,7 @@ class dialog_about_base : public wxDialog
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
dialog_about_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About..."), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 510,434 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSTAY_ON_TOP );
|
dialog_about_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About..."), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 750,350 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSTAY_ON_TOP );
|
||||||
~dialog_about_base();
|
~dialog_about_base();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -40,10 +40,6 @@ DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& titl
|
||||||
#include <base_struct.h> // EDA_RECT
|
#include <base_struct.h> // EDA_RECT
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
|
||||||
|
|
||||||
/// hashtable with key: C string and value: EDA_RECT.
|
|
||||||
/// The key is the classname of the derived wxformbuilder dialog
|
|
||||||
WX_DECLARE_HASH_MAP( char*, EDA_RECT, wxStringHash, wxStringEqual, RECT_MAP );
|
|
||||||
static RECT_MAP class_map;
|
static RECT_MAP class_map;
|
||||||
|
|
||||||
bool DIALOG_SHIM::Show( bool show )
|
bool DIALOG_SHIM::Show( bool show )
|
||||||
|
|
|
@ -132,7 +132,7 @@ void DIALOG_PAGES_SETTINGS::initDialog()
|
||||||
#ifdef EESCHEMA
|
#ifdef EESCHEMA
|
||||||
// Init display value for sheet User size
|
// Init display value for sheet User size
|
||||||
wxString format = m_TextSheetCount->GetLabel();
|
wxString format = m_TextSheetCount->GetLabel();
|
||||||
msg.Printf( format, m_Screen->m_NumberOfScreen );
|
msg.Printf( format, m_Screen->m_NumberOfScreens );
|
||||||
m_TextSheetCount->SetLabel( msg );
|
m_TextSheetCount->SetLabel( msg );
|
||||||
|
|
||||||
format = m_TextSheetNumber->GetLabel();
|
format = m_TextSheetNumber->GetLabel();
|
||||||
|
@ -644,7 +644,7 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
|
||||||
GRResetPenAndBrush( ( wxDC* ) &memDC );
|
GRResetPenAndBrush( ( wxDC* ) &memDC );
|
||||||
|
|
||||||
m_Parent->TraceWorkSheet( (wxDC*) &memDC, dummySize, pointLeftTop, pointRightBottom,
|
m_Parent->TraceWorkSheet( (wxDC*) &memDC, dummySize, pointLeftTop, pointRightBottom,
|
||||||
emptyString, emptyString, m_tb, m_Screen->m_NumberOfScreen,
|
emptyString, emptyString, m_tb, m_Screen->m_NumberOfScreens,
|
||||||
m_Screen->m_ScreenNumber, 1, appScale, LIGHTGRAY, RED );
|
m_Screen->m_ScreenNumber, 1, appScale, LIGHTGRAY, RED );
|
||||||
|
|
||||||
memDC.SelectObject( wxNullBitmap );
|
memDC.SelectObject( wxNullBitmap );
|
||||||
|
|
|
@ -44,7 +44,7 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitl
|
||||||
wxSize( 300, 200 ), 0, NULL,
|
wxSize( 300, 200 ), 0, NULL,
|
||||||
wxLB_NEEDED_SB | wxLB_SINGLE | wxLB_HSCROLL );
|
wxLB_NEEDED_SB | wxLB_SINGLE | wxLB_HSCROLL );
|
||||||
|
|
||||||
GeneralBoxSizer->Add( m_listBox, 0, wxGROW | wxALL, 5 );
|
GeneralBoxSizer->Add( m_listBox, 2, wxGROW | wxALL, 5 );
|
||||||
|
|
||||||
InsertItems( aItemList, 0 );
|
InsertItems( aItemList, 0 );
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitl
|
||||||
wxDefaultPosition, wxSize( -1, 60 ),
|
wxDefaultPosition, wxSize( -1, 60 ),
|
||||||
wxTE_READONLY | wxTE_MULTILINE );
|
wxTE_READONLY | wxTE_MULTILINE );
|
||||||
|
|
||||||
GeneralBoxSizer->Add( m_messages, 0, wxGROW | wxALL, 5 );
|
GeneralBoxSizer->Add( m_messages, 1, wxGROW | wxALL, 5 );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSizer* buttonSizer = CreateButtonSizer( wxOK | wxCANCEL );
|
wxSizer* buttonSizer = CreateButtonSizer( wxOK | wxCANCEL );
|
||||||
|
|
|
@ -88,8 +88,6 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti
|
||||||
const wxPoint& pos, const wxSize& size, long style ) :
|
const wxPoint& pos, const wxSize& size, long style ) :
|
||||||
EDA_BASE_FRAME( father, idtype, title, pos, size, style )
|
EDA_BASE_FRAME( father, idtype, title, pos, size, style )
|
||||||
{
|
{
|
||||||
wxSize minsize;
|
|
||||||
|
|
||||||
m_drawToolBar = NULL;
|
m_drawToolBar = NULL;
|
||||||
m_optionsToolBar = NULL;
|
m_optionsToolBar = NULL;
|
||||||
m_gridSelectBox = NULL;
|
m_gridSelectBox = NULL;
|
||||||
|
@ -110,27 +108,43 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti
|
||||||
m_GridColor = DARKGRAY; // Grid color
|
m_GridColor = DARKGRAY; // Grid color
|
||||||
m_snapToGrid = true;
|
m_snapToGrid = true;
|
||||||
|
|
||||||
// Internal units per inch: = 1000 for schema, = 10000 for PCB
|
//#define ZOOM_DISPLAY_SIZE 60
|
||||||
minsize.x = 470;
|
//#define COORD_DISPLAY_SIZE 165
|
||||||
minsize.y = 350 + m_MsgFrameHeight;
|
//#define DELTA_DISPLAY_SIZE 245
|
||||||
|
//#define UNITS_DISPLAY_SIZE 65
|
||||||
// Pane sizes for status bar.
|
|
||||||
// @todo these should be sized based on typical text content, like
|
|
||||||
// "dx -10.123 -10.123 dy -10.123 -10.123" using the system font which is
|
|
||||||
// in play on a particular platform, and should not be constants.
|
|
||||||
// Please do not reduce these constant values, and please use dynamic
|
|
||||||
// system font specific sizing in the future.
|
|
||||||
#define ZOOM_DISPLAY_SIZE 60
|
|
||||||
#define COORD_DISPLAY_SIZE 165
|
|
||||||
#define DELTA_DISPLAY_SIZE 245
|
|
||||||
#define UNITS_DISPLAY_SIZE 65
|
|
||||||
#define FUNCTION_DISPLAY_SIZE 110
|
#define FUNCTION_DISPLAY_SIZE 110
|
||||||
static const int dims[6] = { -1, ZOOM_DISPLAY_SIZE,
|
|
||||||
COORD_DISPLAY_SIZE, DELTA_DISPLAY_SIZE,
|
|
||||||
UNITS_DISPLAY_SIZE, FUNCTION_DISPLAY_SIZE };
|
|
||||||
|
|
||||||
CreateStatusBar( 6 );
|
CreateStatusBar( 6 );
|
||||||
SetStatusWidths( 6, dims );
|
|
||||||
|
// set the size of the status bar subwindows:
|
||||||
|
|
||||||
|
wxWindow* stsbar = GetStatusBar();
|
||||||
|
|
||||||
|
|
||||||
|
int dims[] = {
|
||||||
|
|
||||||
|
// balance of status bar on far left is set to a default or whatever is left over.
|
||||||
|
-1,
|
||||||
|
|
||||||
|
// When using GetTextSize() remember the width of '1' is not the same
|
||||||
|
// as the width of '0' unless the font is fixed width, and it usually won't be.
|
||||||
|
|
||||||
|
// zoom:
|
||||||
|
GetTextSize( wxT( "Z 762000" ), stsbar ).x + 10,
|
||||||
|
|
||||||
|
// cursor coords
|
||||||
|
GetTextSize( wxT( "X 0234.567890 Y 0234.567890" ), stsbar ).x + 10,
|
||||||
|
|
||||||
|
// delta distances
|
||||||
|
GetTextSize( wxT( "dx 0234.567890 dx 0234.567890 d 0234.567890" ), stsbar ).x + 10,
|
||||||
|
|
||||||
|
// units display, Inches is bigger than mm
|
||||||
|
GetTextSize( _( "Inches" ), stsbar ).x + 10,
|
||||||
|
|
||||||
|
FUNCTION_DISPLAY_SIZE,
|
||||||
|
};
|
||||||
|
|
||||||
|
SetStatusWidths( DIM( dims ), dims );
|
||||||
|
|
||||||
// Create child subwindows.
|
// Create child subwindows.
|
||||||
GetClientSize( &m_FrameSize.x, &m_FrameSize.y );
|
GetClientSize( &m_FrameSize.x, &m_FrameSize.y );
|
||||||
|
@ -380,7 +394,7 @@ void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
double EDA_DRAW_FRAME::GetZoom( void )
|
double EDA_DRAW_FRAME::GetZoom()
|
||||||
{
|
{
|
||||||
return GetScreen()->GetZoom();
|
return GetScreen()->GetZoom();
|
||||||
}
|
}
|
||||||
|
@ -414,11 +428,11 @@ void EDA_DRAW_FRAME::DisplayUnitsMsg()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MILLIMETRES:
|
case MILLIMETRES:
|
||||||
msg += _( "mm" );
|
msg = _( "mm" );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
msg += _( "Units" );
|
msg = _( "Units" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -661,6 +675,16 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* aDC, int aKey, const wxPoint& aPosi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// See comment in classpcb.cpp near line 66
|
||||||
|
//static const double MAX_AXIS = 1518500251;
|
||||||
|
|
||||||
|
// However I am not seeing a problem with this size yet:
|
||||||
|
static const double MAX_AXIS = INT_MAX - 100;
|
||||||
|
|
||||||
|
#define VIRT_MIN (-MAX_AXIS/2.0) ///< min X or Y coordinate in virtual space
|
||||||
|
#define VIRT_MAX (MAX_AXIS/2.0) ///< max X or Y coordinate in virtual space
|
||||||
|
|
||||||
|
|
||||||
void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
|
void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
|
||||||
{
|
{
|
||||||
BASE_SCREEN* screen = GetScreen();
|
BASE_SCREEN* screen = GetScreen();
|
||||||
|
@ -673,7 +697,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
|
||||||
|
|
||||||
double scale = screen->GetScalingFactor();
|
double scale = screen->GetScalingFactor();
|
||||||
|
|
||||||
wxLogTrace( traceScrollSettings, wxT( "Center Position = ( %d, %d ), scale = %.16g" ),
|
wxLogTrace( traceScrollSettings, wxT( "Center Position = ( %d, %d ), scale = %.10g" ),
|
||||||
aCenterPositionIU.x, aCenterPositionIU.y, scale );
|
aCenterPositionIU.x, aCenterPositionIU.y, scale );
|
||||||
|
|
||||||
// Calculate the portion of the drawing that can be displayed in the
|
// Calculate the portion of the drawing that can be displayed in the
|
||||||
|
@ -701,6 +725,29 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
|
||||||
}
|
}
|
||||||
|
|
||||||
DBOX clientRectIU( xIU, yIU, clientSizeIU.x, clientSizeIU.y );
|
DBOX clientRectIU( xIU, yIU, clientSizeIU.x, clientSizeIU.y );
|
||||||
|
wxPoint centerPositionIU;
|
||||||
|
|
||||||
|
#if 1 || defined( USE_PCBNEW_NANOMETRES )
|
||||||
|
// put "int" limits on the clientRect
|
||||||
|
if( clientRectIU.GetLeft() < VIRT_MIN )
|
||||||
|
clientRectIU.MoveLeftTo( VIRT_MIN );
|
||||||
|
if( clientRectIU.GetTop() < VIRT_MIN )
|
||||||
|
clientRectIU.MoveTopTo( VIRT_MIN );
|
||||||
|
if( clientRectIU.GetRight() > VIRT_MAX )
|
||||||
|
clientRectIU.MoveRightTo( VIRT_MAX );
|
||||||
|
if( clientRectIU.GetBottom() > VIRT_MAX )
|
||||||
|
clientRectIU.MoveBottomTo( VIRT_MAX );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
centerPositionIU.x = KiROUND( clientRectIU.x + clientRectIU.width/2 );
|
||||||
|
centerPositionIU.y = KiROUND( clientRectIU.y + clientRectIU.height/2 );
|
||||||
|
|
||||||
|
if( screen->m_Center )
|
||||||
|
{
|
||||||
|
centerPositionIU.x -= KiROUND( pageRectIU.width / 2.0 );
|
||||||
|
centerPositionIU.y -= KiROUND( pageRectIU.height / 2.0 );
|
||||||
|
}
|
||||||
|
|
||||||
DSIZE virtualSizeIU;
|
DSIZE virtualSizeIU;
|
||||||
|
|
||||||
if( pageRectIU.GetLeft() < clientRectIU.GetLeft() && pageRectIU.GetRight() > clientRectIU.GetRight() )
|
if( pageRectIU.GetLeft() < clientRectIU.GetLeft() && pageRectIU.GetRight() > clientRectIU.GetRight() )
|
||||||
|
@ -709,26 +756,24 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double drawingCenterX = pageRectIU.x + ( pageRectIU.width / 2 );
|
double pageCenterX = pageRectIU.x + ( pageRectIU.width / 2 );
|
||||||
double clientCenterX = clientRectIU.x + ( clientRectIU.width / 2 );
|
double clientCenterX = clientRectIU.x + ( clientRectIU.width / 2 );
|
||||||
|
|
||||||
if( clientRectIU.width > pageRectIU.width )
|
if( clientRectIU.width > pageRectIU.width )
|
||||||
{
|
{
|
||||||
if( drawingCenterX > clientCenterX )
|
if( pageCenterX > clientCenterX )
|
||||||
virtualSizeIU.x = ( drawingCenterX - clientRectIU.GetLeft() ) * 2;
|
virtualSizeIU.x = ( pageCenterX - clientRectIU.GetLeft() ) * 2;
|
||||||
else if( drawingCenterX < clientCenterX )
|
else if( pageCenterX < clientCenterX )
|
||||||
virtualSizeIU.x = ( clientRectIU.GetRight() - drawingCenterX ) * 2;
|
virtualSizeIU.x = ( clientRectIU.GetRight() - pageCenterX ) * 2;
|
||||||
else
|
else
|
||||||
virtualSizeIU.x = clientRectIU.width;
|
virtualSizeIU.x = clientRectIU.width;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( drawingCenterX > clientCenterX )
|
if( pageCenterX > clientCenterX )
|
||||||
virtualSizeIU.x = pageRectIU.width +
|
virtualSizeIU.x = pageRectIU.width + ( (pageRectIU.GetLeft() - clientRectIU.GetLeft() ) * 2 );
|
||||||
( (pageRectIU.GetLeft() - clientRectIU.GetLeft() ) * 2 );
|
else if( pageCenterX < clientCenterX )
|
||||||
else if( drawingCenterX < clientCenterX )
|
virtualSizeIU.x = pageRectIU.width + ( (clientRectIU.GetRight() - pageRectIU.GetRight() ) * 2 );
|
||||||
virtualSizeIU.x = pageRectIU.width +
|
|
||||||
( (clientRectIU.GetRight() - pageRectIU.GetRight() ) * 2 );
|
|
||||||
else
|
else
|
||||||
virtualSizeIU.x = pageRectIU.width;
|
virtualSizeIU.x = pageRectIU.width;
|
||||||
}
|
}
|
||||||
|
@ -740,24 +785,24 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int drawingCenterY = pageRectIU.y + ( pageRectIU.height / 2 );
|
double pageCenterY = pageRectIU.y + ( pageRectIU.height / 2 );
|
||||||
int clientCenterY = clientRectIU.y + ( clientRectIU.height / 2 );
|
double clientCenterY = clientRectIU.y + ( clientRectIU.height / 2 );
|
||||||
|
|
||||||
if( clientRectIU.height > pageRectIU.height )
|
if( clientRectIU.height > pageRectIU.height )
|
||||||
{
|
{
|
||||||
if( drawingCenterY > clientCenterY )
|
if( pageCenterY > clientCenterY )
|
||||||
virtualSizeIU.y = ( drawingCenterY - clientRectIU.GetTop() ) * 2;
|
virtualSizeIU.y = ( pageCenterY - clientRectIU.GetTop() ) * 2;
|
||||||
else if( drawingCenterY < clientCenterY )
|
else if( pageCenterY < clientCenterY )
|
||||||
virtualSizeIU.y = ( clientRectIU.GetBottom() - drawingCenterY ) * 2;
|
virtualSizeIU.y = ( clientRectIU.GetBottom() - pageCenterY ) * 2;
|
||||||
else
|
else
|
||||||
virtualSizeIU.y = clientRectIU.height;
|
virtualSizeIU.y = clientRectIU.height;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( drawingCenterY > clientCenterY )
|
if( pageCenterY > clientCenterY )
|
||||||
virtualSizeIU.y = pageRectIU.height +
|
virtualSizeIU.y = pageRectIU.height +
|
||||||
( ( pageRectIU.GetTop() - clientRectIU.GetTop() ) * 2 );
|
( ( pageRectIU.GetTop() - clientRectIU.GetTop() ) * 2 );
|
||||||
else if( drawingCenterY < clientCenterY )
|
else if( pageCenterY < clientCenterY )
|
||||||
virtualSizeIU.y = pageRectIU.height +
|
virtualSizeIU.y = pageRectIU.height +
|
||||||
( ( clientRectIU.GetBottom() - pageRectIU.GetBottom() ) * 2 );
|
( ( clientRectIU.GetBottom() - pageRectIU.GetBottom() ) * 2 );
|
||||||
else
|
else
|
||||||
|
@ -765,6 +810,12 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 1 || defined( USE_PCBNEW_NANOMETRES )
|
||||||
|
// put "int" limits on the virtualSizeIU
|
||||||
|
virtualSizeIU.x = std::min( virtualSizeIU.x, MAX_AXIS );
|
||||||
|
virtualSizeIU.y = std::min( virtualSizeIU.y, MAX_AXIS );
|
||||||
|
#endif
|
||||||
|
|
||||||
if( screen->m_Center )
|
if( screen->m_Center )
|
||||||
{
|
{
|
||||||
screen->m_DrawOrg.x = -KiROUND( virtualSizeIU.x / 2.0 );
|
screen->m_DrawOrg.x = -KiROUND( virtualSizeIU.x / 2.0 );
|
||||||
|
@ -790,10 +841,10 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
|
||||||
|
|
||||||
// Calculate the scroll bar position in internal units to place the
|
// Calculate the scroll bar position in internal units to place the
|
||||||
// center position at the center of client rectangle.
|
// center position at the center of client rectangle.
|
||||||
screen->SetScrollCenterPosition( aCenterPositionIU );
|
screen->SetScrollCenterPosition( centerPositionIU );
|
||||||
|
|
||||||
double posX = aCenterPositionIU.x - clientRectIU.width /2.0 - screen->m_DrawOrg.x;
|
double posX = centerPositionIU.x - clientRectIU.width /2.0 - screen->m_DrawOrg.x;
|
||||||
double posY = aCenterPositionIU.y - clientRectIU.height/2.0 - screen->m_DrawOrg.y;
|
double posY = centerPositionIU.y - clientRectIU.height/2.0 - screen->m_DrawOrg.y;
|
||||||
|
|
||||||
// Convert scroll bar position to device units.
|
// Convert scroll bar position to device units.
|
||||||
posX = KiROUND( posX * scale );
|
posX = KiROUND( posX * scale );
|
||||||
|
@ -801,25 +852,25 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
|
||||||
|
|
||||||
if( posX < 0 )
|
if( posX < 0 )
|
||||||
{
|
{
|
||||||
wxLogTrace( traceScrollSettings, wxT( "Required scroll bar X position %d" ), posX );
|
wxLogTrace( traceScrollSettings, wxT( "Required scroll bar X position %.10g" ), posX );
|
||||||
posX = 0;
|
posX = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( posX > unitsX )
|
if( posX > unitsX )
|
||||||
{
|
{
|
||||||
wxLogTrace( traceScrollSettings, wxT( "Required scroll bar X position %d" ), posX );
|
wxLogTrace( traceScrollSettings, wxT( "Required scroll bar X position %.10g" ), posX );
|
||||||
posX = unitsX;
|
posX = unitsX;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( posY < 0 )
|
if( posY < 0 )
|
||||||
{
|
{
|
||||||
wxLogTrace( traceScrollSettings, wxT( "Required scroll bar Y position %d" ), posY );
|
wxLogTrace( traceScrollSettings, wxT( "Required scroll bar Y position %.10g" ), posY );
|
||||||
posY = 0;
|
posY = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( posY > unitsY )
|
if( posY > unitsY )
|
||||||
{
|
{
|
||||||
wxLogTrace( traceScrollSettings, wxT( "Required scroll bar Y position %d" ), posY );
|
wxLogTrace( traceScrollSettings, wxT( "Required scroll bar Y position %.10g" ), posY );
|
||||||
posY = unitsY;
|
posY = unitsY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -827,7 +878,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
|
||||||
screen->m_ScrollbarNumber = wxSize( KiROUND( unitsX ), KiROUND( unitsY ) );
|
screen->m_ScrollbarNumber = wxSize( KiROUND( unitsX ), KiROUND( unitsY ) );
|
||||||
|
|
||||||
wxLogTrace( traceScrollSettings,
|
wxLogTrace( traceScrollSettings,
|
||||||
wxT( "Drawing = (%.16g, %.16g), Client = (%.16g, %.16g), Offset = (%d, %d), SetScrollbars(%d, %d, %d, %d, %d, %d)" ),
|
wxT( "Drawing = (%.10g, %.10g), Client = (%.10g, %.10g), Offset = (%d, %d), SetScrollbars(%d, %d, %d, %d, %d, %d)" ),
|
||||||
virtualSizeIU.x, virtualSizeIU.y, clientSizeIU.x, clientSizeIU.y,
|
virtualSizeIU.x, virtualSizeIU.y, clientSizeIU.x, clientSizeIU.y,
|
||||||
screen->m_DrawOrg.x, screen->m_DrawOrg.y,
|
screen->m_DrawOrg.x, screen->m_DrawOrg.y,
|
||||||
screen->m_ScrollPixelsPerUnitX, screen->m_ScrollPixelsPerUnitY,
|
screen->m_ScrollPixelsPerUnitX, screen->m_ScrollPixelsPerUnitY,
|
||||||
|
@ -843,4 +894,3 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
|
||||||
screen->m_ScrollbarPos.x,
|
screen->m_ScrollbarPos.x,
|
||||||
screen->m_ScrollbarPos.y, noRefresh );
|
screen->m_ScrollbarPos.y, noRefresh );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
#include <kicad_device_context.h>
|
#include <kicad_device_context.h>
|
||||||
|
|
||||||
#define CURSOR_SIZE 12 // Cursor size in pixels
|
static const int CURSOR_SIZE = 12; ///< Cursor size in pixels
|
||||||
|
|
||||||
#define CLIP_BOX_PADDING 2
|
#define CLIP_BOX_PADDING 2
|
||||||
|
|
||||||
|
@ -207,13 +207,13 @@ void EDA_DRAW_PANEL::CrossHairOn( wxDC* DC )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int EDA_DRAW_PANEL::GetZoom()
|
double EDA_DRAW_PANEL::GetZoom()
|
||||||
{
|
{
|
||||||
return GetScreen()->GetZoom();
|
return GetScreen()->GetZoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EDA_DRAW_PANEL::SetZoom( int zoom )
|
void EDA_DRAW_PANEL::SetZoom( double zoom )
|
||||||
{
|
{
|
||||||
GetScreen()->SetZoom( zoom );
|
GetScreen()->SetZoom( zoom );
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,13 +164,13 @@ static void DrawGraphicTextPline(
|
||||||
{
|
{
|
||||||
if( aPlotter )
|
if( aPlotter )
|
||||||
{
|
{
|
||||||
aPlotter->move_to( coord[0] );
|
aPlotter->MoveTo( coord[0] );
|
||||||
for( int ik = 1; ik < point_count; ik++ )
|
for( int ik = 1; ik < point_count; ik++ )
|
||||||
{
|
{
|
||||||
aPlotter->line_to( coord[ik] );
|
aPlotter->LineTo( coord[ik] );
|
||||||
}
|
}
|
||||||
|
|
||||||
aPlotter->pen_finish();
|
aPlotter->PenFinish();
|
||||||
}
|
}
|
||||||
else if( aCallback )
|
else if( aCallback )
|
||||||
{
|
{
|
||||||
|
@ -357,8 +357,8 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
|
||||||
|
|
||||||
if( aPlotter )
|
if( aPlotter )
|
||||||
{
|
{
|
||||||
aPlotter->move_to( current_char_pos );
|
aPlotter->MoveTo( current_char_pos );
|
||||||
aPlotter->finish_to( end );
|
aPlotter->FinishTo( end );
|
||||||
}
|
}
|
||||||
else if( aCallback )
|
else if( aCallback )
|
||||||
{
|
{
|
||||||
|
@ -515,7 +515,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
|
||||||
* @param aItalic = true to simulate an italic font
|
* @param aItalic = true to simulate an italic font
|
||||||
* @param aBold = true to use a bold font Useful only with default width value (aWidth = 0)
|
* @param aBold = true to use a bold font Useful only with default width value (aWidth = 0)
|
||||||
*/
|
*/
|
||||||
void PLOTTER::text( const wxPoint& aPos,
|
void PLOTTER::Text( const wxPoint& aPos,
|
||||||
enum EDA_COLOR_T aColor,
|
enum EDA_COLOR_T aColor,
|
||||||
const wxString& aText,
|
const wxString& aText,
|
||||||
int aOrient,
|
int aOrient,
|
||||||
|
@ -534,11 +534,11 @@ void PLOTTER::text( const wxPoint& aPos,
|
||||||
else
|
else
|
||||||
aWidth = -Clamp_Text_PenSize( -aWidth, aSize, aBold );
|
aWidth = -Clamp_Text_PenSize( -aWidth, aSize, aBold );
|
||||||
|
|
||||||
set_current_line_width( aWidth );
|
SetCurrentLineWidth( aWidth );
|
||||||
|
|
||||||
|
|
||||||
if( aColor >= 0 )
|
if( aColor >= 0 )
|
||||||
set_color( aColor );
|
SetColor( aColor );
|
||||||
|
|
||||||
DrawGraphicText( NULL, NULL, aPos, aColor, aText,
|
DrawGraphicText( NULL, NULL, aPos, aColor, aText,
|
||||||
aOrient, aSize,
|
aOrient, aSize,
|
||||||
|
|
|
@ -51,7 +51,9 @@ static int compare( const void* a1, const void* a2 )
|
||||||
|
|
||||||
void DSNLEXER::init()
|
void DSNLEXER::init()
|
||||||
{
|
{
|
||||||
curTok = DSN_NONE;
|
curTok = DSN_NONE;
|
||||||
|
prevTok = DSN_NONE;
|
||||||
|
|
||||||
stringDelimiter = '"';
|
stringDelimiter = '"';
|
||||||
|
|
||||||
specctraMode = false;
|
specctraMode = false;
|
||||||
|
@ -433,6 +435,22 @@ L_read:
|
||||||
if( cur >= limit )
|
if( cur >= limit )
|
||||||
goto L_read;
|
goto L_read;
|
||||||
|
|
||||||
|
if( *cur == '(' )
|
||||||
|
{
|
||||||
|
curText = *cur;
|
||||||
|
curTok = DSN_LEFT;
|
||||||
|
head = cur+1;
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( *cur == ')' )
|
||||||
|
{
|
||||||
|
curText = *cur;
|
||||||
|
curTok = DSN_RIGHT;
|
||||||
|
head = cur+1;
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
// switching the string_quote character
|
// switching the string_quote character
|
||||||
if( prevTok == DSN_STRING_QUOTE )
|
if( prevTok == DSN_STRING_QUOTE )
|
||||||
{
|
{
|
||||||
|
@ -462,22 +480,6 @@ L_read:
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( *cur == '(' )
|
|
||||||
{
|
|
||||||
curText = *cur;
|
|
||||||
curTok = DSN_LEFT;
|
|
||||||
head = cur+1;
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( *cur == ')' )
|
|
||||||
{
|
|
||||||
curText = *cur;
|
|
||||||
curTok = DSN_RIGHT;
|
|
||||||
head = cur+1;
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* get the dash out of a <pin_reference> which is embedded for example
|
/* get the dash out of a <pin_reference> which is embedded for example
|
||||||
like: U2-14 or "U2"-"14"
|
like: U2-14 or "U2"-"14"
|
||||||
This is detectable by a non-space immediately preceeding the dash.
|
This is detectable by a non-space immediately preceeding the dash.
|
||||||
|
|
|
@ -1026,7 +1026,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineW
|
||||||
wxString paper = pageInfo.GetType();
|
wxString paper = pageInfo.GetType();
|
||||||
wxString file = aScreen->GetFileName();
|
wxString file = aScreen->GetFileName();
|
||||||
TITLE_BLOCK t_block = GetTitleBlock();
|
TITLE_BLOCK t_block = GetTitleBlock();
|
||||||
int number_of_screens = aScreen->m_NumberOfScreen;
|
int number_of_screens = aScreen->m_NumberOfScreens;
|
||||||
int screen_to_draw = aScreen->m_ScreenNumber;
|
int screen_to_draw = aScreen->m_ScreenNumber;
|
||||||
|
|
||||||
TraceWorkSheet( aDC, pageSize, margin_left_top, margin_right_bottom,
|
TraceWorkSheet( aDC, pageSize, margin_left_top, margin_right_bottom,
|
||||||
|
@ -1657,7 +1657,7 @@ wxString EDA_DRAW_FRAME::GetScreenDesc()
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
||||||
msg << GetScreen()->m_ScreenNumber << wxT( "/" )
|
msg << GetScreen()->m_ScreenNumber << wxT( "/" )
|
||||||
<< GetScreen()->m_NumberOfScreen;
|
<< GetScreen()->m_NumberOfScreens;
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,13 @@ void EDA_DRAW_FRAME::Zoom_Automatique( bool aWarpPointer )
|
||||||
{
|
{
|
||||||
BASE_SCREEN* screen = GetScreen();
|
BASE_SCREEN* screen = GetScreen();
|
||||||
|
|
||||||
screen->SetZoom( BestZoom() ); // Set the best zoom and get center point.
|
// Set the best zoom and get center point.
|
||||||
|
|
||||||
|
// BestZoom() can compute an illegal zoom if the client window size
|
||||||
|
// is small, say because frame is not maximized. So use the clamping form
|
||||||
|
// of SetZoom():
|
||||||
|
double bestzoom = BestZoom();
|
||||||
|
screen->SetScalingFactor( bestzoom );
|
||||||
|
|
||||||
if( screen->m_FirstRedraw )
|
if( screen->m_FirstRedraw )
|
||||||
screen->SetCrossHairPosition( screen->GetScrollCenterPosition() );
|
screen->SetCrossHairPosition( screen->GetScrollCenterPosition() );
|
||||||
|
@ -151,7 +157,7 @@ void EDA_DRAW_FRAME::OnZoom( wxCommandEvent& event )
|
||||||
|
|
||||||
i = id - ID_POPUP_ZOOM_LEVEL_START;
|
i = id - ID_POPUP_ZOOM_LEVEL_START;
|
||||||
|
|
||||||
if( i >= screen->m_ZoomList.GetCount() )
|
if( i >= screen->m_ZoomList.size() )
|
||||||
{
|
{
|
||||||
wxLogDebug( wxT( "%s %d: index %d is outside the bounds of the zoom list." ),
|
wxLogDebug( wxT( "%s %d: index %d is outside the bounds of the zoom list." ),
|
||||||
__TFILE__, __LINE__, i );
|
__TFILE__, __LINE__, i );
|
||||||
|
@ -194,8 +200,8 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu )
|
||||||
|
|
||||||
zoom = screen->GetZoom();
|
zoom = screen->GetZoom();
|
||||||
maxZoomIds = ID_POPUP_ZOOM_LEVEL_END - ID_POPUP_ZOOM_LEVEL_START;
|
maxZoomIds = ID_POPUP_ZOOM_LEVEL_END - ID_POPUP_ZOOM_LEVEL_START;
|
||||||
maxZoomIds = ( (size_t) maxZoomIds < screen->m_ZoomList.GetCount() ) ?
|
maxZoomIds = ( (size_t) maxZoomIds < screen->m_ZoomList.size() ) ?
|
||||||
maxZoomIds : screen->m_ZoomList.GetCount();
|
maxZoomIds : screen->m_ZoomList.size();
|
||||||
|
|
||||||
// Populate zoom submenu.
|
// Populate zoom submenu.
|
||||||
for( int i = 0; i < maxZoomIds; i++ )
|
for( int i = 0; i < maxZoomIds; i++ )
|
||||||
|
|
|
@ -66,7 +66,8 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
fn = m_AliasLibNames[ii];
|
fn = m_AliasLibNames[ii];
|
||||||
|
|
||||||
if( !fn.HasExt() ) {
|
if( !fn.HasExt() )
|
||||||
|
{
|
||||||
fn.SetExt( FootprintAliasFileExtension );
|
fn.SetExt( FootprintAliasFileExtension );
|
||||||
// above fails if filename have more than one point
|
// above fails if filename have more than one point
|
||||||
}
|
}
|
||||||
|
@ -124,8 +125,8 @@ found in the default search paths." ),
|
||||||
msg.Printf( _( "%d footprint aliases found." ), aliases.size() );
|
msg.Printf( _( "%d footprint aliases found." ), aliases.size() );
|
||||||
SetStatusText( msg, 0 );
|
SetStatusText( msg, 0 );
|
||||||
|
|
||||||
|
m_skipComponentSelect = true;
|
||||||
ii = 0;
|
ii = 0;
|
||||||
|
|
||||||
BOOST_FOREACH( COMPONENT_INFO& component, m_components )
|
BOOST_FOREACH( COMPONENT_INFO& component, m_components )
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
@ -180,4 +181,5 @@ any of the project footprint libraries." ),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_skipComponentSelect = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -280,7 +280,8 @@ void FOOTPRINTS_LISTBOX::OnLeftClick( wxListEvent& event )
|
||||||
wxASSERT(Module);
|
wxASSERT(Module);
|
||||||
if( GetParent()->m_DisplayFootprintFrame )
|
if( GetParent()->m_DisplayFootprintFrame )
|
||||||
{
|
{
|
||||||
GetParent()->CreateScreenCmp(); /* refresh general */
|
// Refresh current selected footprint view:
|
||||||
|
GetParent()->CreateScreenCmp();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( Module )
|
if( Module )
|
||||||
|
|
|
@ -116,6 +116,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( const wxString& title, long style ) :
|
||||||
m_isEESchemaNetlist = false;
|
m_isEESchemaNetlist = false;
|
||||||
m_KeepCvpcbOpen = false;
|
m_KeepCvpcbOpen = false;
|
||||||
m_undefinedComponentCnt = 0;
|
m_undefinedComponentCnt = 0;
|
||||||
|
m_skipComponentSelect = false;
|
||||||
|
|
||||||
/* Name of the document footprint list
|
/* Name of the document footprint list
|
||||||
* usually located in share/modules/footprints_doc
|
* usually located in share/modules/footprints_doc
|
||||||
|
@ -406,6 +407,7 @@ void CVPCB_MAINFRAME::DelAssociations( wxCommandEvent& event )
|
||||||
|
|
||||||
if( IsOK( this, _( "Delete selections" ) ) )
|
if( IsOK( this, _( "Delete selections" ) ) )
|
||||||
{
|
{
|
||||||
|
m_skipComponentSelect = true;
|
||||||
m_ListCmp->SetSelection( 0 );
|
m_ListCmp->SetSelection( 0 );
|
||||||
|
|
||||||
BOOST_FOREACH( COMPONENT_INFO & component, m_components )
|
BOOST_FOREACH( COMPONENT_INFO & component, m_components )
|
||||||
|
@ -414,6 +416,7 @@ void CVPCB_MAINFRAME::DelAssociations( wxCommandEvent& event )
|
||||||
SetNewPkg( wxEmptyString );
|
SetNewPkg( wxEmptyString );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_skipComponentSelect = false;
|
||||||
m_ListCmp->SetSelection( 0 );
|
m_ListCmp->SetSelection( 0 );
|
||||||
m_undefinedComponentCnt = m_components.size();
|
m_undefinedComponentCnt = m_components.size();
|
||||||
}
|
}
|
||||||
|
@ -506,18 +509,22 @@ void CVPCB_MAINFRAME::OnLeftDClick( wxListEvent& event )
|
||||||
|
|
||||||
|
|
||||||
/* Called when clicking on a component in component list window
|
/* Called when clicking on a component in component list window
|
||||||
* * Updates the filtered foorprint list, if the filtered list option is selected
|
* * Updates the filtered footprint list, if the filtered list option is selected
|
||||||
* * Updates the current selected footprint in footprint list
|
* * Updates the current selected footprint in footprint list
|
||||||
* * Updates the footprint shown in footprint display window (if opened)
|
* * Updates the footprint shown in footprint display window (if opened)
|
||||||
*/
|
*/
|
||||||
void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
|
void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
|
||||||
{
|
{
|
||||||
|
if( m_skipComponentSelect )
|
||||||
|
return;
|
||||||
|
|
||||||
#define REDRAW_LIST true
|
#define REDRAW_LIST true
|
||||||
#define SELECT_FULL_LIST true
|
#define SELECT_FULL_LIST true
|
||||||
int selection = -1;
|
int selection = -1;
|
||||||
|
|
||||||
if( !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST )
|
if( !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST )
|
||||||
&& !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST ))
|
&& !m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST )
|
||||||
|
)
|
||||||
m_FootprintList->SetActiveFootprintList( SELECT_FULL_LIST, REDRAW_LIST );
|
m_FootprintList->SetActiveFootprintList( SELECT_FULL_LIST, REDRAW_LIST );
|
||||||
|
|
||||||
else
|
else
|
||||||
|
@ -553,36 +560,41 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Preview of the already assigned footprint.
|
// Preview of the already assigned footprint.
|
||||||
// Find the footprint that was already choosen for this component and select it.
|
// Find the footprint that was already choosen for this component and select it,
|
||||||
wxString module = *(&m_components[ selection ].m_Footprint);
|
// but only if the selection is made from the component list.
|
||||||
|
// If the selection is made from the footprint list, do not change the current selected footprint.
|
||||||
|
|
||||||
bool found = false;
|
if( FindFocus() == m_ListCmp )
|
||||||
for( int ii = 0; ii < m_FootprintList->GetCount(); ii++ )
|
|
||||||
{
|
{
|
||||||
wxString footprintName;
|
wxString module = *(&m_components[ selection ].m_Footprint);
|
||||||
wxString msg = (*m_FootprintList->m_ActiveFootprintList)[ii];
|
|
||||||
msg.Trim( true );
|
|
||||||
msg.Trim( false );
|
|
||||||
footprintName = msg.AfterFirst( wxChar( ' ' ) );
|
|
||||||
|
|
||||||
if( module.Cmp( footprintName ) == 0 )
|
bool found = false;
|
||||||
|
for( int ii = 0; ii < m_FootprintList->GetCount(); ii++ )
|
||||||
{
|
{
|
||||||
m_FootprintList->SetSelection( ii, true );
|
wxString footprintName;
|
||||||
found = true;
|
wxString msg = (*m_FootprintList->m_ActiveFootprintList)[ii];
|
||||||
break;
|
msg.Trim( true );
|
||||||
|
msg.Trim( false );
|
||||||
|
footprintName = msg.AfterFirst( wxChar( ' ' ) );
|
||||||
|
|
||||||
|
if( module.Cmp( footprintName ) == 0 )
|
||||||
|
{
|
||||||
|
m_FootprintList->SetSelection( ii, true );
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( ! found )
|
||||||
|
{
|
||||||
|
int ii = m_FootprintList->GetSelection();
|
||||||
|
if ( ii >= 0 )
|
||||||
|
m_FootprintList->SetSelection( ii, false );
|
||||||
|
if( m_DisplayFootprintFrame )
|
||||||
|
{
|
||||||
|
CreateScreenCmp();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( ! found )
|
|
||||||
{
|
|
||||||
int ii = m_FootprintList->GetSelection();
|
|
||||||
if ( ii >= 0 )
|
|
||||||
m_FootprintList->SetSelection( ii, false );
|
|
||||||
if( m_DisplayFootprintFrame )
|
|
||||||
{
|
|
||||||
CreateScreenCmp();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SendMessageToEESCHEMA();
|
SendMessageToEESCHEMA();
|
||||||
DisplayStatus();
|
DisplayStatus();
|
||||||
|
|
|
@ -46,6 +46,8 @@ protected:
|
||||||
int m_undefinedComponentCnt;
|
int m_undefinedComponentCnt;
|
||||||
bool m_modified;
|
bool m_modified;
|
||||||
bool m_isEESchemaNetlist;
|
bool m_isEESchemaNetlist;
|
||||||
|
bool m_skipComponentSelect; // true to skip OnSelectComponent event
|
||||||
|
// (in automatic selection/deletion of associations)
|
||||||
PARAM_CFG_ARRAY m_projectFileParams;
|
PARAM_CFG_ARRAY m_projectFileParams;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -59,6 +59,7 @@ MODULE* DISPLAY_FOOTPRINTS_FRAME::Get_Module( const wxString& aFootprintName )
|
||||||
|
|
||||||
if( footprint )
|
if( footprint )
|
||||||
{
|
{
|
||||||
|
footprint->SetParent( GetBoard() );
|
||||||
footprint->SetPosition( wxPoint( 0, 0 ) );
|
footprint->SetPosition( wxPoint( 0, 0 ) );
|
||||||
return footprint;
|
return footprint;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ int CVPCB_MAINFRAME::ReadSchematicNetlist()
|
||||||
netList_Reader.m_UseCmpFile = false;
|
netList_Reader.m_UseCmpFile = false;
|
||||||
netList_Reader.SetFilesnames( m_NetlistFileName.GetFullPath(), wxEmptyString );
|
netList_Reader.SetFilesnames( m_NetlistFileName.GetFullPath(), wxEmptyString );
|
||||||
|
|
||||||
// True to read footprint filters section: true for CvPcb, false pro Pcbnew
|
// True to read footprint filters section: true for CvPcb, false for Pcbnew
|
||||||
netList_Reader.ReadLibpartSectionSetOpt( true );
|
netList_Reader.ReadLibpartSectionSetOpt( true );
|
||||||
|
|
||||||
bool success = netList_Reader.ReadNetList( netfile );
|
bool success = netList_Reader.ReadNetList( netfile );
|
||||||
|
@ -79,9 +79,15 @@ int CVPCB_MAINFRAME::ReadSchematicNetlist()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now copy footprints info into Cvpcb list:
|
// Now copy footprints info into Cvpcb list:
|
||||||
|
// We also remove footprint name if it is "$noname"
|
||||||
|
// because this is a dummy name,, not an actual name
|
||||||
COMPONENT_INFO_LIST& cmpInfo = netList_Reader.GetComponentInfoList();
|
COMPONENT_INFO_LIST& cmpInfo = netList_Reader.GetComponentInfoList();
|
||||||
for( unsigned ii = 0; ii < cmpInfo.size(); ii++ )
|
for( unsigned ii = 0; ii < cmpInfo.size(); ii++ )
|
||||||
|
{
|
||||||
m_components.push_back( cmpInfo[ii] );
|
m_components.push_back( cmpInfo[ii] );
|
||||||
|
if( cmpInfo[ii]->m_Footprint == wxT( "$noname" ) )
|
||||||
|
cmpInfo[ii]->m_Footprint.Empty();
|
||||||
|
}
|
||||||
cmpInfo.clear(); // cmpInfo is no more owner of the list.
|
cmpInfo.clear(); // cmpInfo is no more owner of the list.
|
||||||
|
|
||||||
// Sort components by reference:
|
// Sort components by reference:
|
||||||
|
|
|
@ -36,6 +36,8 @@ set(EESCHEMA_SRCS
|
||||||
dialogs/dialog_plot_schematic_HPGL_base.cpp
|
dialogs/dialog_plot_schematic_HPGL_base.cpp
|
||||||
dialogs/dialog_plot_schematic_PS.cpp
|
dialogs/dialog_plot_schematic_PS.cpp
|
||||||
dialogs/dialog_plot_schematic_PS_base.cpp
|
dialogs/dialog_plot_schematic_PS_base.cpp
|
||||||
|
dialogs/dialog_plot_schematic_PDF.cpp
|
||||||
|
dialogs/dialog_plot_schematic_PDF_base.cpp
|
||||||
dialogs/annotate_dialog.cpp
|
dialogs/annotate_dialog.cpp
|
||||||
dialogs/dialog_annotate_base.cpp
|
dialogs/dialog_annotate_base.cpp
|
||||||
dialogs/dialog_lib_edit_text.cpp
|
dialogs/dialog_lib_edit_text.cpp
|
||||||
|
|
|
@ -66,7 +66,7 @@ static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
||||||
|
|
||||||
int SCH_EDIT_FRAME::ReturnBlockCommand( int key )
|
int SCH_EDIT_FRAME::ReturnBlockCommand( int key )
|
||||||
{
|
{
|
||||||
int cmd;
|
int cmd = BLOCK_IDLE;
|
||||||
|
|
||||||
switch( key )
|
switch( key )
|
||||||
{
|
{
|
||||||
|
@ -78,11 +78,14 @@ int SCH_EDIT_FRAME::ReturnBlockCommand( int key )
|
||||||
cmd = BLOCK_MOVE;
|
cmd = BLOCK_MOVE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GR_KB_ALT:
|
|
||||||
case GR_KB_SHIFT:
|
case GR_KB_SHIFT:
|
||||||
cmd = BLOCK_COPY;
|
cmd = BLOCK_COPY;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GR_KB_ALT:
|
||||||
|
cmd = BLOCK_ROTATE;
|
||||||
|
break;
|
||||||
|
|
||||||
case GR_KB_CTRL:
|
case GR_KB_CTRL:
|
||||||
cmd = BLOCK_DRAG;
|
cmd = BLOCK_DRAG;
|
||||||
break;
|
break;
|
||||||
|
@ -130,12 +133,6 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
|
|
||||||
switch( block->GetCommand() )
|
switch( block->GetCommand() )
|
||||||
{
|
{
|
||||||
case BLOCK_IDLE:
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BLOCK_ROTATE:
|
|
||||||
case BLOCK_MIRROR_X:
|
|
||||||
case BLOCK_MIRROR_Y:
|
|
||||||
case BLOCK_DRAG: /* Drag */
|
case BLOCK_DRAG: /* Drag */
|
||||||
case BLOCK_MOVE: /* Move */
|
case BLOCK_MOVE: /* Move */
|
||||||
if( m_canvas->IsMouseCaptured() )
|
if( m_canvas->IsMouseCaptured() )
|
||||||
|
@ -167,13 +164,8 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
block->ClearItemsList();
|
block->ClearItemsList();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BLOCK_ZOOM: // Handled by HandleBlockEnd()
|
default: // others are handled by HandleBlockEnd()
|
||||||
case BLOCK_DELETE:
|
break;
|
||||||
case BLOCK_SAVE:
|
|
||||||
case BLOCK_FLIP:
|
|
||||||
case BLOCK_ABORT:
|
|
||||||
case BLOCK_SELECT_ITEMS_ONLY:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OnModify();
|
OnModify();
|
||||||
|
@ -225,15 +217,31 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
||||||
DisplayError( this, wxT( "Error in HandleBlockPLace()" ) );
|
DisplayError( this, wxT( "Error in HandleBlockPLace()" ) );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case BLOCK_ROTATE:
|
||||||
|
GetScreen()->UpdatePickList();
|
||||||
|
DrawAndSizingBlockOutlines( m_canvas, DC, wxDefaultPosition, false );
|
||||||
|
|
||||||
|
if( block->GetCount() )
|
||||||
|
{
|
||||||
|
// Compute the rotation center and put it on grid:
|
||||||
|
wxPoint rotationPoint = block->Centre();
|
||||||
|
rotationPoint = GetScreen()->GetNearestGridPosition( rotationPoint );
|
||||||
|
GetScreen()->SetCrossHairPosition( rotationPoint );
|
||||||
|
SaveCopyInUndoList( block->GetItems(), UR_ROTATED, rotationPoint );
|
||||||
|
RotateListOfItems( block->GetItems(), rotationPoint );
|
||||||
|
OnModify();
|
||||||
|
}
|
||||||
|
block->ClearItemsList();
|
||||||
|
GetScreen()->TestDanglingEnds( m_canvas, DC );
|
||||||
|
m_canvas->Refresh();
|
||||||
|
break;
|
||||||
|
|
||||||
case BLOCK_DRAG: /* Drag */
|
case BLOCK_DRAG: /* Drag */
|
||||||
GetScreen()->BreakSegmentsOnJunctions();
|
GetScreen()->BreakSegmentsOnJunctions();
|
||||||
// fall through
|
// fall through
|
||||||
|
|
||||||
case BLOCK_ROTATE:
|
case BLOCK_MOVE:
|
||||||
case BLOCK_MIRROR_X:
|
case BLOCK_COPY:
|
||||||
case BLOCK_MIRROR_Y:
|
|
||||||
case BLOCK_MOVE: /* Move */
|
|
||||||
case BLOCK_COPY: /* Copy */
|
|
||||||
GetScreen()->UpdatePickList();
|
GetScreen()->UpdatePickList();
|
||||||
// fall through
|
// fall through
|
||||||
|
|
||||||
|
@ -263,7 +271,6 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
||||||
DeleteItemsInList( m_canvas, block->GetItems() );
|
DeleteItemsInList( m_canvas, block->GetItems() );
|
||||||
OnModify();
|
OnModify();
|
||||||
}
|
}
|
||||||
|
|
||||||
block->ClearItemsList();
|
block->ClearItemsList();
|
||||||
GetScreen()->TestDanglingEnds( m_canvas, DC );
|
GetScreen()->TestDanglingEnds( m_canvas, DC );
|
||||||
m_canvas->Refresh();
|
m_canvas->Refresh();
|
||||||
|
@ -291,9 +298,7 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
||||||
zoom_command = true;
|
zoom_command = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BLOCK_FLIP: /* Pcbnew only! */
|
default:
|
||||||
case BLOCK_SELECT_ITEMS_ONLY: /* Not used */
|
|
||||||
case BLOCK_ABORT: /* not executed here */
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
|
||||||
|
|
||||||
int LIB_EDIT_FRAME::ReturnBlockCommand( int key )
|
int LIB_EDIT_FRAME::ReturnBlockCommand( int key )
|
||||||
{
|
{
|
||||||
int cmd;
|
int cmd = BLOCK_IDLE;
|
||||||
|
|
||||||
switch( key )
|
switch( key )
|
||||||
{
|
{
|
||||||
|
@ -60,11 +60,14 @@ int LIB_EDIT_FRAME::ReturnBlockCommand( int key )
|
||||||
cmd = BLOCK_MOVE;
|
cmd = BLOCK_MOVE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GR_KB_ALT:
|
|
||||||
case GR_KB_SHIFT:
|
case GR_KB_SHIFT:
|
||||||
cmd = BLOCK_COPY;
|
cmd = BLOCK_COPY;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GR_KB_ALT:
|
||||||
|
cmd = BLOCK_ROTATE;
|
||||||
|
break;
|
||||||
|
|
||||||
case GR_KB_SHIFTCTRL:
|
case GR_KB_SHIFTCTRL:
|
||||||
cmd = BLOCK_DELETE;
|
cmd = BLOCK_DELETE;
|
||||||
break;
|
break;
|
||||||
|
@ -168,7 +171,8 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
||||||
SaveCopyInUndoList( m_component );
|
SaveCopyInUndoList( m_component );
|
||||||
|
|
||||||
pt = GetScreen()->m_BlockLocate.Centre();
|
pt = GetScreen()->m_BlockLocate.Centre();
|
||||||
pt.y *= -1;
|
pt = GetScreen()->GetNearestGridPosition( pt );
|
||||||
|
NEGATE( pt.y );
|
||||||
|
|
||||||
if ( m_component )
|
if ( m_component )
|
||||||
{
|
{
|
||||||
|
@ -253,7 +257,7 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
SaveCopyInUndoList( m_component );
|
SaveCopyInUndoList( m_component );
|
||||||
|
|
||||||
pt = GetScreen()->m_BlockLocate.GetMoveVector();
|
pt = GetScreen()->m_BlockLocate.GetMoveVector();
|
||||||
pt.y *= -1;
|
NEGATE( pt.y );
|
||||||
|
|
||||||
if ( m_component )
|
if ( m_component )
|
||||||
m_component->CopySelectedItems( pt );
|
m_component->CopySelectedItems( pt );
|
||||||
|
@ -271,7 +275,8 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
SaveCopyInUndoList( m_component );
|
SaveCopyInUndoList( m_component );
|
||||||
|
|
||||||
pt = GetScreen()->m_BlockLocate.Centre();
|
pt = GetScreen()->m_BlockLocate.Centre();
|
||||||
pt.y *= -1;
|
pt = GetScreen()->GetNearestGridPosition( pt );
|
||||||
|
NEGATE( pt.y );
|
||||||
|
|
||||||
if ( m_component )
|
if ( m_component )
|
||||||
{
|
{
|
||||||
|
|
|
@ -391,8 +391,8 @@ void LIB_COMPONENT::Plot( PLOTTER* aPlotter, int aUnit, int aConvert,
|
||||||
if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
|
if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE ) );
|
aPlotter->SetColor( ReturnLayerColor( LAYER_DEVICE ) );
|
||||||
bool fill = aPlotter->get_color_mode();
|
bool fill = aPlotter->GetColorMode();
|
||||||
|
|
||||||
item.Plot( aPlotter, aOffset, fill, aTransform );
|
item.Plot( aPlotter, aOffset, fill, aTransform );
|
||||||
}
|
}
|
||||||
|
@ -968,8 +968,10 @@ EDA_RECT LIB_COMPONENT::GetBoundingBox( int aUnit, int aConvert ) const
|
||||||
{
|
{
|
||||||
EDA_RECT bBox( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
|
EDA_RECT bBox( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
|
||||||
|
|
||||||
BOOST_FOREACH( const LIB_ITEM& item, drawings )
|
for( unsigned ii = 0; ii < drawings.size(); ii++ )
|
||||||
{
|
{
|
||||||
|
const LIB_ITEM& item = drawings[ii];
|
||||||
|
|
||||||
if( ( item.m_Unit > 0 ) && ( ( m_unitCount > 1 ) && ( aUnit > 0 )
|
if( ( item.m_Unit > 0 ) && ( ( m_unitCount > 1 ) && ( aUnit > 0 )
|
||||||
&& ( aUnit != item.m_Unit ) ) )
|
&& ( aUnit != item.m_Unit ) ) )
|
||||||
continue;
|
continue;
|
||||||
|
@ -991,8 +993,10 @@ EDA_RECT LIB_COMPONENT::GetBodyBoundingBox( int aUnit, int aConvert ) const
|
||||||
{
|
{
|
||||||
EDA_RECT bBox( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
|
EDA_RECT bBox( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
|
||||||
|
|
||||||
BOOST_FOREACH( const LIB_ITEM& item, drawings )
|
for( unsigned ii = 0; ii < drawings.size(); ii++ )
|
||||||
{
|
{
|
||||||
|
const LIB_ITEM& item = drawings[ii];
|
||||||
|
|
||||||
if( ( item.m_Unit > 0 ) && ( ( m_unitCount > 1 ) && ( aUnit > 0 )
|
if( ( item.m_Unit > 0 ) && ( ( m_unitCount > 1 ) && ( aUnit > 0 )
|
||||||
&& ( aUnit != item.m_Unit ) ) )
|
&& ( aUnit != item.m_Unit ) ) )
|
||||||
continue;
|
continue;
|
||||||
|
@ -1187,8 +1191,9 @@ void LIB_COMPONENT::RemoveDuplicateDrawItems()
|
||||||
|
|
||||||
bool LIB_COMPONENT::HasConversion() const
|
bool LIB_COMPONENT::HasConversion() const
|
||||||
{
|
{
|
||||||
BOOST_FOREACH( const LIB_ITEM& item, drawings )
|
for( unsigned ii = 0; ii < drawings.size(); ii++ )
|
||||||
{
|
{
|
||||||
|
const LIB_ITEM& item = drawings[ii];
|
||||||
if( item.m_Convert > 1 )
|
if( item.m_Convert > 1 )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,6 +91,7 @@ class CMP_LIBRARY
|
||||||
{
|
{
|
||||||
int type; ///< Library type indicator.
|
int type; ///< Library type indicator.
|
||||||
wxFileName fileName; ///< Library file name.
|
wxFileName fileName; ///< Library file name.
|
||||||
|
// ZZZ why this a wxDateTime where others are time_t?
|
||||||
wxDateTime timeStamp; ///< Library save time and date.
|
wxDateTime timeStamp; ///< Library save time and date.
|
||||||
int versionMajor; ///< Library major version number.
|
int versionMajor; ///< Library major version number.
|
||||||
int versionMinor; ///< Library minor version number.
|
int versionMinor; ///< Library minor version number.
|
||||||
|
|
|
@ -236,25 +236,27 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnOkClick( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::CopyDocToAlias( wxCommandEvent& event )
|
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::CopyDocFromRootToAlias( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
if( m_Parent == NULL )
|
if( m_Parent == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LIB_ALIAS* alias;
|
LIB_ALIAS* parent_alias;
|
||||||
LIB_COMPONENT* component = m_Parent->GetComponent();
|
LIB_COMPONENT* component = m_Parent->GetComponent();
|
||||||
|
|
||||||
if( component == NULL )
|
if( component == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
alias = component->GetAlias( m_Parent->GetAliasName() );
|
// search for the main alias: this is the first alias in alias list
|
||||||
|
// something like the main component
|
||||||
|
parent_alias = component->GetAlias( 0 );
|
||||||
|
|
||||||
if( alias == NULL )
|
if( parent_alias == NULL ) // Should never occur (bug)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_DocCtrl->SetValue( alias->GetDescription() );
|
m_DocCtrl->SetValue( parent_alias->GetDescription() );
|
||||||
m_DocfileCtrl->SetValue( alias->GetDocFileName() );
|
m_DocfileCtrl->SetValue( parent_alias->GetDocFileName() );
|
||||||
m_KeywordsCtrl->SetValue( alias->GetKeyWords() );
|
m_KeywordsCtrl->SetValue( parent_alias->GetKeyWords() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ private:
|
||||||
void AddAliasOfPart(wxCommandEvent& event);
|
void AddAliasOfPart(wxCommandEvent& event);
|
||||||
bool ChangeNbUnitsPerPackage(int newUnit);
|
bool ChangeNbUnitsPerPackage(int newUnit);
|
||||||
bool SetUnsetConvert();
|
bool SetUnsetConvert();
|
||||||
void CopyDocToAlias(wxCommandEvent& event);
|
void CopyDocFromRootToAlias(wxCommandEvent& event);
|
||||||
void BrowseAndSelectDocFile(wxCommandEvent& event);
|
void BrowseAndSelectDocFile(wxCommandEvent& event);
|
||||||
|
|
||||||
void DeleteAllFootprintFilter(wxCommandEvent& event);
|
void DeleteAllFootprintFilter(wxCommandEvent& event);
|
||||||
|
|
|
@ -1,286 +1,286 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Apr 11 2012)
|
// C++ code generated with wxFormBuilder (version Apr 10 2012)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "dialog_edit_component_in_lib_base.h"
|
#include "dialog_edit_component_in_lib_base.h"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
||||||
{
|
{
|
||||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||||
|
|
||||||
wxBoxSizer* bMainSizer;
|
wxBoxSizer* bMainSizer;
|
||||||
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
wxBoxSizer* bUpperSizer;
|
wxBoxSizer* bUpperSizer;
|
||||||
bUpperSizer = new wxBoxSizer( wxVERTICAL );
|
bUpperSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
m_NoteBook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
m_NoteBook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_PanelBasic = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
|
m_PanelBasic = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
|
||||||
wxBoxSizer* bSizerBasicPanel;
|
wxBoxSizer* bSizerBasicPanel;
|
||||||
bSizerBasicPanel = new wxBoxSizer( wxVERTICAL );
|
bSizerBasicPanel = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
wxStaticBoxSizer* m_OptionsBoxSizer;
|
wxStaticBoxSizer* m_OptionsBoxSizer;
|
||||||
m_OptionsBoxSizer = new wxStaticBoxSizer( new wxStaticBox( m_PanelBasic, wxID_ANY, _("General :") ), wxVERTICAL );
|
m_OptionsBoxSizer = new wxStaticBoxSizer( new wxStaticBox( m_PanelBasic, wxID_ANY, _("General :") ), wxVERTICAL );
|
||||||
|
|
||||||
m_AsConvertButt = new wxCheckBox( m_PanelBasic, wxID_ANY, _("As Convert"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_AsConvertButt = new wxCheckBox( m_PanelBasic, wxID_ANY, _("As Convert"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_AsConvertButt->SetToolTip( _("Check this option for components that have a De Morgan representation.\nThis is usual for gates.") );
|
m_AsConvertButt->SetToolTip( _("Check this option for components that have a De Morgan representation.\nThis is usual for gates.") );
|
||||||
|
|
||||||
m_OptionsBoxSizer->Add( m_AsConvertButt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
m_OptionsBoxSizer->Add( m_AsConvertButt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_ShowPinNumButt = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Show Pin Num"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_ShowPinNumButt = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Show Pin Num"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_ShowPinNumButt->SetValue(true);
|
m_ShowPinNumButt->SetValue(true);
|
||||||
m_ShowPinNumButt->SetToolTip( _("Show or hide pin numbers") );
|
m_ShowPinNumButt->SetToolTip( _("Show or hide pin numbers") );
|
||||||
|
|
||||||
m_OptionsBoxSizer->Add( m_ShowPinNumButt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
m_OptionsBoxSizer->Add( m_ShowPinNumButt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_ShowPinNameButt = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Show Pin Name"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_ShowPinNameButt = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Show Pin Name"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_ShowPinNameButt->SetValue(true);
|
m_ShowPinNameButt->SetValue(true);
|
||||||
m_ShowPinNameButt->SetToolTip( _("Show or hide pin names") );
|
m_ShowPinNameButt->SetToolTip( _("Show or hide pin names") );
|
||||||
|
|
||||||
m_OptionsBoxSizer->Add( m_ShowPinNameButt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
m_OptionsBoxSizer->Add( m_ShowPinNameButt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_PinsNameInsideButt = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Pin Name Inside"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_PinsNameInsideButt = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Pin Name Inside"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_PinsNameInsideButt->SetValue(true);
|
m_PinsNameInsideButt->SetValue(true);
|
||||||
m_PinsNameInsideButt->SetToolTip( _("Check this option to have pin names inside the body and pin number outside.\nIf not checked pins names and pins numbers are outside.") );
|
m_PinsNameInsideButt->SetToolTip( _("Check this option to have pin names inside the body and pin number outside.\nIf not checked pins names and pins numbers are outside.") );
|
||||||
|
|
||||||
m_OptionsBoxSizer->Add( m_PinsNameInsideButt, 0, wxALL, 5 );
|
m_OptionsBoxSizer->Add( m_PinsNameInsideButt, 0, wxALL, 5 );
|
||||||
|
|
||||||
|
|
||||||
bSizerBasicPanel->Add( m_OptionsBoxSizer, 0, 0, 5 );
|
bSizerBasicPanel->Add( m_OptionsBoxSizer, 0, 0, 5 );
|
||||||
|
|
||||||
m_staticline3 = new wxStaticLine( m_PanelBasic, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
m_staticline3 = new wxStaticLine( m_PanelBasic, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||||
bSizerBasicPanel->Add( m_staticline3, 0, wxEXPAND | wxALL, 5 );
|
bSizerBasicPanel->Add( m_staticline3, 0, wxEXPAND | wxALL, 5 );
|
||||||
|
|
||||||
wxBoxSizer* bSizerMidBasicPanel;
|
wxBoxSizer* bSizerMidBasicPanel;
|
||||||
bSizerMidBasicPanel = new wxBoxSizer( wxHORIZONTAL );
|
bSizerMidBasicPanel = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
wxBoxSizer* bSizernbunits;
|
wxBoxSizer* bSizernbunits;
|
||||||
bSizernbunits = new wxBoxSizer( wxVERTICAL );
|
bSizernbunits = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
m_staticTextNbUnits = new wxStaticText( m_PanelBasic, wxID_ANY, _("Number of Units:"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticTextNbUnits = new wxStaticText( m_PanelBasic, wxID_ANY, _("Number of Units:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticTextNbUnits->Wrap( -1 );
|
m_staticTextNbUnits->Wrap( -1 );
|
||||||
m_staticTextNbUnits->SetToolTip( _("This is the number of parts in this component package.\nA 74LS00 gate has 4 parts per packages.") );
|
m_staticTextNbUnits->SetToolTip( _("This is the number of parts in this component package.\nA 74LS00 gate has 4 parts per packages.") );
|
||||||
|
|
||||||
bSizernbunits->Add( m_staticTextNbUnits, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
bSizernbunits->Add( m_staticTextNbUnits, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_SelNumberOfUnits = new wxSpinCtrl( m_PanelBasic, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 26, 1 );
|
m_SelNumberOfUnits = new wxSpinCtrl( m_PanelBasic, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 26, 1 );
|
||||||
bSizernbunits->Add( m_SelNumberOfUnits, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
bSizernbunits->Add( m_SelNumberOfUnits, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
bSizerMidBasicPanel->Add( bSizernbunits, 1, wxEXPAND, 5 );
|
bSizerMidBasicPanel->Add( bSizernbunits, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
wxBoxSizer* bSizer17;
|
wxBoxSizer* bSizer17;
|
||||||
bSizer17 = new wxBoxSizer( wxVERTICAL );
|
bSizer17 = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
m_staticTextskew = new wxStaticText( m_PanelBasic, wxID_ANY, _("Skew:"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticTextskew = new wxStaticText( m_PanelBasic, wxID_ANY, _("Skew:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticTextskew->Wrap( -1 );
|
m_staticTextskew->Wrap( -1 );
|
||||||
m_staticTextskew->SetToolTip( _("Margin (in 0.001 inches) between a pin name position and the component body.\nA value from 10 to 40 is usually good.") );
|
m_staticTextskew->SetToolTip( _("Margin (in 0.001 inches) between a pin name position and the component body.\nA value from 10 to 40 is usually good.") );
|
||||||
|
|
||||||
bSizer17->Add( m_staticTextskew, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
bSizer17->Add( m_staticTextskew, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_SetSkew = new wxSpinCtrl( m_PanelBasic, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 100, 0 );
|
m_SetSkew = new wxSpinCtrl( m_PanelBasic, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 100, 0 );
|
||||||
bSizer17->Add( m_SetSkew, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
bSizer17->Add( m_SetSkew, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
|
|
||||||
bSizerMidBasicPanel->Add( bSizer17, 1, wxEXPAND, 5 );
|
bSizerMidBasicPanel->Add( bSizer17, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
bSizerBasicPanel->Add( bSizerMidBasicPanel, 0, wxEXPAND, 5 );
|
bSizerBasicPanel->Add( bSizerMidBasicPanel, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
m_staticline1 = new wxStaticLine( m_PanelBasic, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
m_staticline1 = new wxStaticLine( m_PanelBasic, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||||
bSizerBasicPanel->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
bSizerBasicPanel->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
||||||
|
|
||||||
m_OptionPower = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Power Symbol"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_OptionPower = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Power Symbol"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_OptionPower->SetToolTip( _("Check this option for power symbols.\nPower symbols have specific properties for Eeschema:\n- Value cannot be edited (to avoid mistakes) because this is the pin name that is important for a power symbol\n- Reference is updated automatically when a netlist is created (no need to run Annotate)") );
|
m_OptionPower->SetToolTip( _("Check this option for power symbols.\nPower symbols have specific properties for Eeschema:\n- Value cannot be edited (to avoid mistakes) because this is the pin name that is important for a power symbol\n- Reference is updated automatically when a netlist is created (no need to run Annotate)") );
|
||||||
|
|
||||||
bSizerBasicPanel->Add( m_OptionPower, 0, wxALL, 5 );
|
bSizerBasicPanel->Add( m_OptionPower, 0, wxALL, 5 );
|
||||||
|
|
||||||
m_OptionPartsLocked = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Parts are locked"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_OptionPartsLocked = new wxCheckBox( m_PanelBasic, wxID_ANY, _("Parts are locked"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_OptionPartsLocked->SetToolTip( _("Check this option if Eeschema cannot change parts selections inside a given package\nThis happens when parts are different in this package.\nWhen this option is not checked, Eeschema automatically choose the parts in packages to minimize packages count") );
|
m_OptionPartsLocked->SetToolTip( _("Check this option if Eeschema cannot change parts selections inside a given package\nThis happens when parts are different in this package.\nWhen this option is not checked, Eeschema automatically choose the parts in packages to minimize packages count") );
|
||||||
|
|
||||||
bSizerBasicPanel->Add( m_OptionPartsLocked, 0, wxALL, 5 );
|
bSizerBasicPanel->Add( m_OptionPartsLocked, 0, wxALL, 5 );
|
||||||
|
|
||||||
|
|
||||||
m_PanelBasic->SetSizer( bSizerBasicPanel );
|
m_PanelBasic->SetSizer( bSizerBasicPanel );
|
||||||
m_PanelBasic->Layout();
|
m_PanelBasic->Layout();
|
||||||
bSizerBasicPanel->Fit( m_PanelBasic );
|
bSizerBasicPanel->Fit( m_PanelBasic );
|
||||||
m_NoteBook->AddPage( m_PanelBasic, _("Options"), true );
|
m_NoteBook->AddPage( m_PanelBasic, _("Options"), false );
|
||||||
m_PanelDoc = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
|
m_PanelDoc = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
|
||||||
wxBoxSizer* m_PanelDocBoxSizer;
|
wxBoxSizer* m_PanelDocBoxSizer;
|
||||||
m_PanelDocBoxSizer = new wxBoxSizer( wxVERTICAL );
|
m_PanelDocBoxSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
m_staticTextDescription = new wxStaticText( m_PanelDoc, wxID_ANY, _("Description:"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticTextDescription = new wxStaticText( m_PanelDoc, wxID_ANY, _("Description:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticTextDescription->Wrap( -1 );
|
m_staticTextDescription->Wrap( -1 );
|
||||||
m_staticTextDescription->SetToolTip( _("A short description that is displayed in Eeschema.\nCan be a very good help when selecting components in libraries components lists.") );
|
m_staticTextDescription->SetToolTip( _("A short description that is displayed in Eeschema.\nCan be a very good help when selecting components in libraries components lists.") );
|
||||||
|
|
||||||
m_PanelDocBoxSizer->Add( m_staticTextDescription, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
m_PanelDocBoxSizer->Add( m_staticTextDescription, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_DocCtrl = new wxTextCtrl( m_PanelDoc, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_DocCtrl = new wxTextCtrl( m_PanelDoc, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_PanelDocBoxSizer->Add( m_DocCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
m_PanelDocBoxSizer->Add( m_DocCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_staticTextKeywords = new wxStaticText( m_PanelDoc, wxID_ANY, _("Keywords:"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticTextKeywords = new wxStaticText( m_PanelDoc, wxID_ANY, _("Keywords:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticTextKeywords->Wrap( -1 );
|
m_staticTextKeywords->Wrap( -1 );
|
||||||
m_staticTextKeywords->SetToolTip( _("Enter key words that can be used to select this component.\nKey words cannot have spaces and are separated by a space.") );
|
m_staticTextKeywords->SetToolTip( _("Enter key words that can be used to select this component.\nKey words cannot have spaces and are separated by a space.") );
|
||||||
|
|
||||||
m_PanelDocBoxSizer->Add( m_staticTextKeywords, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
m_PanelDocBoxSizer->Add( m_staticTextKeywords, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_KeywordsCtrl = new wxTextCtrl( m_PanelDoc, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_KeywordsCtrl = new wxTextCtrl( m_PanelDoc, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_PanelDocBoxSizer->Add( m_KeywordsCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
m_PanelDocBoxSizer->Add( m_KeywordsCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_staticTextDocFileName = new wxStaticText( m_PanelDoc, wxID_ANY, _("DocFileName:"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticTextDocFileName = new wxStaticText( m_PanelDoc, wxID_ANY, _("DocFileName:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticTextDocFileName->Wrap( -1 );
|
m_staticTextDocFileName->Wrap( -1 );
|
||||||
m_staticTextDocFileName->SetToolTip( _("Enter the documentation file (a .pdf document) associated to the component.") );
|
m_staticTextDocFileName->SetToolTip( _("Enter the documentation file (a .pdf document) associated to the component.") );
|
||||||
|
|
||||||
m_PanelDocBoxSizer->Add( m_staticTextDocFileName, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
m_PanelDocBoxSizer->Add( m_staticTextDocFileName, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_DocfileCtrl = new wxTextCtrl( m_PanelDoc, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 400,-1 ), 0 );
|
m_DocfileCtrl = new wxTextCtrl( m_PanelDoc, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 400,-1 ), 0 );
|
||||||
m_PanelDocBoxSizer->Add( m_DocfileCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
m_PanelDocBoxSizer->Add( m_DocfileCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
wxBoxSizer* bSizerPaneldocbutts;
|
wxBoxSizer* bSizerPaneldocbutts;
|
||||||
bSizerPaneldocbutts = new wxBoxSizer( wxHORIZONTAL );
|
bSizerPaneldocbutts = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
m_ButtonCopyDoc = new wxButton( m_PanelDoc, ID_COPY_DOC_TO_ALIAS, _("Copy Doc"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_ButtonCopyDoc = new wxButton( m_PanelDoc, ID_COPY_DOC_TO_ALIAS, _("Copy Doc from Parent"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bSizerPaneldocbutts->Add( m_ButtonCopyDoc, 0, wxALL, 5 );
|
bSizerPaneldocbutts->Add( m_ButtonCopyDoc, 0, wxALL, 5 );
|
||||||
|
|
||||||
m_buttonBrowseDocFiles = new wxButton( m_PanelDoc, ID_BROWSE_DOC_FILES, _("Browse DocFiles"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_buttonBrowseDocFiles = new wxButton( m_PanelDoc, ID_BROWSE_DOC_FILES, _("Browse DocFiles"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bSizerPaneldocbutts->Add( m_buttonBrowseDocFiles, 0, wxALL, 5 );
|
bSizerPaneldocbutts->Add( m_buttonBrowseDocFiles, 0, wxALL, 5 );
|
||||||
|
|
||||||
|
|
||||||
m_PanelDocBoxSizer->Add( bSizerPaneldocbutts, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
|
m_PanelDocBoxSizer->Add( bSizerPaneldocbutts, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
|
||||||
|
|
||||||
|
|
||||||
m_PanelDoc->SetSizer( m_PanelDocBoxSizer );
|
m_PanelDoc->SetSizer( m_PanelDocBoxSizer );
|
||||||
m_PanelDoc->Layout();
|
m_PanelDoc->Layout();
|
||||||
m_PanelDocBoxSizer->Fit( m_PanelDoc );
|
m_PanelDocBoxSizer->Fit( m_PanelDoc );
|
||||||
m_NoteBook->AddPage( m_PanelDoc, _("Description"), false );
|
m_NoteBook->AddPage( m_PanelDoc, _("Description"), true );
|
||||||
m_PanelAlias = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
|
m_PanelAlias = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
|
||||||
wxBoxSizer* bSizerMainPanelAlias;
|
wxBoxSizer* bSizerMainPanelAlias;
|
||||||
bSizerMainPanelAlias = new wxBoxSizer( wxHORIZONTAL );
|
bSizerMainPanelAlias = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
wxBoxSizer* bLeftBoxSizerPanelAlias;
|
wxBoxSizer* bLeftBoxSizerPanelAlias;
|
||||||
bLeftBoxSizerPanelAlias = new wxBoxSizer( wxVERTICAL );
|
bLeftBoxSizerPanelAlias = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
m_staticTextAlias = new wxStaticText( m_PanelAlias, wxID_ANY, _("Alias List:"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticTextAlias = new wxStaticText( m_PanelAlias, wxID_ANY, _("Alias List:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticTextAlias->Wrap( -1 );
|
m_staticTextAlias->Wrap( -1 );
|
||||||
m_staticTextAlias->SetToolTip( _("An alias is a component that uses the body of its root component.\nIt has its own documentation and keywords.\nA fast way to extend a library with similar components") );
|
m_staticTextAlias->SetToolTip( _("An alias is a component that uses the body of its root component.\nIt has its own documentation and keywords.\nA fast way to extend a library with similar components") );
|
||||||
|
|
||||||
bLeftBoxSizerPanelAlias->Add( m_staticTextAlias, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
bLeftBoxSizerPanelAlias->Add( m_staticTextAlias, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_PartAliasListCtrl = new wxListBox( m_PanelAlias, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
|
m_PartAliasListCtrl = new wxListBox( m_PanelAlias, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
|
||||||
bLeftBoxSizerPanelAlias->Add( m_PartAliasListCtrl, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
bLeftBoxSizerPanelAlias->Add( m_PartAliasListCtrl, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
|
|
||||||
bSizerMainPanelAlias->Add( bLeftBoxSizerPanelAlias, 1, wxEXPAND, 5 );
|
bSizerMainPanelAlias->Add( bLeftBoxSizerPanelAlias, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
wxBoxSizer* bRightBoxSizerPanelAlias;
|
wxBoxSizer* bRightBoxSizerPanelAlias;
|
||||||
bRightBoxSizerPanelAlias = new wxBoxSizer( wxVERTICAL );
|
bRightBoxSizerPanelAlias = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
m_ButtonAddeAlias = new wxButton( m_PanelAlias, ID_ADD_ALIAS, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_ButtonAddeAlias = new wxButton( m_PanelAlias, ID_ADD_ALIAS, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bRightBoxSizerPanelAlias->Add( m_ButtonAddeAlias, 0, wxALL|wxEXPAND, 5 );
|
bRightBoxSizerPanelAlias->Add( m_ButtonAddeAlias, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_ButtonDeleteOneAlias = new wxButton( m_PanelAlias, ID_DELETE_ONE_ALIAS, _("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_ButtonDeleteOneAlias = new wxButton( m_PanelAlias, ID_DELETE_ONE_ALIAS, _("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bRightBoxSizerPanelAlias->Add( m_ButtonDeleteOneAlias, 0, wxALL|wxEXPAND, 5 );
|
bRightBoxSizerPanelAlias->Add( m_ButtonDeleteOneAlias, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_ButtonDeleteAllAlias = new wxButton( m_PanelAlias, ID_DELETE_ALL_ALIAS, _("Delete All"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_ButtonDeleteAllAlias = new wxButton( m_PanelAlias, ID_DELETE_ALL_ALIAS, _("Delete All"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bRightBoxSizerPanelAlias->Add( m_ButtonDeleteAllAlias, 0, wxALL, 5 );
|
bRightBoxSizerPanelAlias->Add( m_ButtonDeleteAllAlias, 0, wxALL, 5 );
|
||||||
|
|
||||||
|
|
||||||
bSizerMainPanelAlias->Add( bRightBoxSizerPanelAlias, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
bSizerMainPanelAlias->Add( bRightBoxSizerPanelAlias, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||||
|
|
||||||
|
|
||||||
m_PanelAlias->SetSizer( bSizerMainPanelAlias );
|
m_PanelAlias->SetSizer( bSizerMainPanelAlias );
|
||||||
m_PanelAlias->Layout();
|
m_PanelAlias->Layout();
|
||||||
bSizerMainPanelAlias->Fit( m_PanelAlias );
|
bSizerMainPanelAlias->Fit( m_PanelAlias );
|
||||||
m_NoteBook->AddPage( m_PanelAlias, _("Alias"), false );
|
m_NoteBook->AddPage( m_PanelAlias, _("Alias"), false );
|
||||||
m_PanelFootprintFilter = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
|
m_PanelFootprintFilter = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
|
||||||
wxBoxSizer* bPanelFpFilterBoxSizer;
|
wxBoxSizer* bPanelFpFilterBoxSizer;
|
||||||
bPanelFpFilterBoxSizer = new wxBoxSizer( wxHORIZONTAL );
|
bPanelFpFilterBoxSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
wxBoxSizer* bFpFilterLeftBoxSizer;
|
wxBoxSizer* bFpFilterLeftBoxSizer;
|
||||||
bFpFilterLeftBoxSizer = new wxBoxSizer( wxVERTICAL );
|
bFpFilterLeftBoxSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
m_staticTextFootprints = new wxStaticText( m_PanelFootprintFilter, wxID_ANY, _("Footprints"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticTextFootprints = new wxStaticText( m_PanelFootprintFilter, wxID_ANY, _("Footprints"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticTextFootprints->Wrap( -1 );
|
m_staticTextFootprints->Wrap( -1 );
|
||||||
m_staticTextFootprints->SetToolTip( _("A list of footprints names that can be used for this component.\nFootprints names can used jockers.\n(like sm* to allow all footprints names starting by sm).") );
|
m_staticTextFootprints->SetToolTip( _("A list of footprints names that can be used for this component.\nFootprints names can used jockers.\n(like sm* to allow all footprints names starting by sm).") );
|
||||||
|
|
||||||
bFpFilterLeftBoxSizer->Add( m_staticTextFootprints, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
bFpFilterLeftBoxSizer->Add( m_staticTextFootprints, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_FootprintFilterListBox = new wxListBox( m_PanelFootprintFilter, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
|
m_FootprintFilterListBox = new wxListBox( m_PanelFootprintFilter, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
|
||||||
bFpFilterLeftBoxSizer->Add( m_FootprintFilterListBox, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
bFpFilterLeftBoxSizer->Add( m_FootprintFilterListBox, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
|
|
||||||
bPanelFpFilterBoxSizer->Add( bFpFilterLeftBoxSizer, 1, wxEXPAND, 5 );
|
bPanelFpFilterBoxSizer->Add( bFpFilterLeftBoxSizer, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
wxBoxSizer* bFpFilterRightBoxSizer;
|
wxBoxSizer* bFpFilterRightBoxSizer;
|
||||||
bFpFilterRightBoxSizer = new wxBoxSizer( wxVERTICAL );
|
bFpFilterRightBoxSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
m_buttonAddFpF = new wxButton( m_PanelFootprintFilter, ID_ADD_FOOTPRINT_FILTER, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_buttonAddFpF = new wxButton( m_PanelFootprintFilter, ID_ADD_FOOTPRINT_FILTER, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bFpFilterRightBoxSizer->Add( m_buttonAddFpF, 0, wxALL|wxEXPAND, 5 );
|
bFpFilterRightBoxSizer->Add( m_buttonAddFpF, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_ButtonDeleteOneFootprintFilter = new wxButton( m_PanelFootprintFilter, ID_DELETE_ONE_FOOTPRINT_FILTER, _("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_ButtonDeleteOneFootprintFilter = new wxButton( m_PanelFootprintFilter, ID_DELETE_ONE_FOOTPRINT_FILTER, _("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bFpFilterRightBoxSizer->Add( m_ButtonDeleteOneFootprintFilter, 0, wxALL|wxEXPAND, 5 );
|
bFpFilterRightBoxSizer->Add( m_ButtonDeleteOneFootprintFilter, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_ButtonDeleteAllFootprintFilter = new wxButton( m_PanelFootprintFilter, ID_DELETE_ALL_FOOTPRINT_FILTER, _("Delete All"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_ButtonDeleteAllFootprintFilter = new wxButton( m_PanelFootprintFilter, ID_DELETE_ALL_FOOTPRINT_FILTER, _("Delete All"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bFpFilterRightBoxSizer->Add( m_ButtonDeleteAllFootprintFilter, 0, wxALL|wxEXPAND, 5 );
|
bFpFilterRightBoxSizer->Add( m_ButtonDeleteAllFootprintFilter, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
bPanelFpFilterBoxSizer->Add( bFpFilterRightBoxSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
bPanelFpFilterBoxSizer->Add( bFpFilterRightBoxSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||||
|
|
||||||
|
|
||||||
m_PanelFootprintFilter->SetSizer( bPanelFpFilterBoxSizer );
|
m_PanelFootprintFilter->SetSizer( bPanelFpFilterBoxSizer );
|
||||||
m_PanelFootprintFilter->Layout();
|
m_PanelFootprintFilter->Layout();
|
||||||
bPanelFpFilterBoxSizer->Fit( m_PanelFootprintFilter );
|
bPanelFpFilterBoxSizer->Fit( m_PanelFootprintFilter );
|
||||||
m_NoteBook->AddPage( m_PanelFootprintFilter, _("Footprint Filter"), false );
|
m_NoteBook->AddPage( m_PanelFootprintFilter, _("Footprint Filter"), false );
|
||||||
|
|
||||||
bUpperSizer->Add( m_NoteBook, 1, wxEXPAND, 5 );
|
bUpperSizer->Add( m_NoteBook, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
bMainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 );
|
bMainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
m_stdSizerButton = new wxStdDialogButtonSizer();
|
m_stdSizerButton = new wxStdDialogButtonSizer();
|
||||||
m_stdSizerButtonOK = new wxButton( this, wxID_OK );
|
m_stdSizerButtonOK = new wxButton( this, wxID_OK );
|
||||||
m_stdSizerButton->AddButton( m_stdSizerButtonOK );
|
m_stdSizerButton->AddButton( m_stdSizerButtonOK );
|
||||||
m_stdSizerButtonCancel = new wxButton( this, wxID_CANCEL );
|
m_stdSizerButtonCancel = new wxButton( this, wxID_CANCEL );
|
||||||
m_stdSizerButton->AddButton( m_stdSizerButtonCancel );
|
m_stdSizerButton->AddButton( m_stdSizerButtonCancel );
|
||||||
m_stdSizerButton->Realize();
|
m_stdSizerButton->Realize();
|
||||||
|
|
||||||
bMainSizer->Add( m_stdSizerButton, 0, wxEXPAND|wxALL, 5 );
|
bMainSizer->Add( m_stdSizerButton, 0, wxEXPAND|wxALL, 5 );
|
||||||
|
|
||||||
|
|
||||||
this->SetSizer( bMainSizer );
|
this->SetSizer( bMainSizer );
|
||||||
this->Layout();
|
this->Layout();
|
||||||
bMainSizer->Fit( this );
|
bMainSizer->Fit( this );
|
||||||
|
|
||||||
// Connect Events
|
// Connect Events
|
||||||
m_ButtonCopyDoc->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::CopyDocToAlias ), NULL, this );
|
m_ButtonCopyDoc->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::CopyDocFromRootToAlias ), NULL, this );
|
||||||
m_buttonBrowseDocFiles->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::BrowseAndSelectDocFile ), NULL, this );
|
m_buttonBrowseDocFiles->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::BrowseAndSelectDocFile ), NULL, this );
|
||||||
m_ButtonAddeAlias->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::AddAliasOfPart ), NULL, this );
|
m_ButtonAddeAlias->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::AddAliasOfPart ), NULL, this );
|
||||||
m_ButtonDeleteOneAlias->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAliasOfPart ), NULL, this );
|
m_ButtonDeleteOneAlias->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAliasOfPart ), NULL, this );
|
||||||
m_ButtonDeleteAllAlias->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAllAliasOfPart ), NULL, this );
|
m_ButtonDeleteAllAlias->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAllAliasOfPart ), NULL, this );
|
||||||
m_buttonAddFpF->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::AddFootprintFilter ), NULL, this );
|
m_buttonAddFpF->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::AddFootprintFilter ), NULL, this );
|
||||||
m_ButtonDeleteOneFootprintFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteOneFootprintFilter ), NULL, this );
|
m_ButtonDeleteOneFootprintFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteOneFootprintFilter ), NULL, this );
|
||||||
m_ButtonDeleteAllFootprintFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAllFootprintFilter ), NULL, this );
|
m_ButtonDeleteAllFootprintFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAllFootprintFilter ), NULL, this );
|
||||||
m_stdSizerButtonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnCancelClick ), NULL, this );
|
m_stdSizerButtonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnCancelClick ), NULL, this );
|
||||||
m_stdSizerButtonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnOkClick ), NULL, this );
|
m_stdSizerButtonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnOkClick ), NULL, this );
|
||||||
}
|
}
|
||||||
|
|
||||||
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE()
|
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE()
|
||||||
{
|
{
|
||||||
// Disconnect Events
|
// Disconnect Events
|
||||||
m_ButtonCopyDoc->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::CopyDocToAlias ), NULL, this );
|
m_ButtonCopyDoc->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::CopyDocFromRootToAlias ), NULL, this );
|
||||||
m_buttonBrowseDocFiles->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::BrowseAndSelectDocFile ), NULL, this );
|
m_buttonBrowseDocFiles->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::BrowseAndSelectDocFile ), NULL, this );
|
||||||
m_ButtonAddeAlias->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::AddAliasOfPart ), NULL, this );
|
m_ButtonAddeAlias->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::AddAliasOfPart ), NULL, this );
|
||||||
m_ButtonDeleteOneAlias->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAliasOfPart ), NULL, this );
|
m_ButtonDeleteOneAlias->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAliasOfPart ), NULL, this );
|
||||||
m_ButtonDeleteAllAlias->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAllAliasOfPart ), NULL, this );
|
m_ButtonDeleteAllAlias->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAllAliasOfPart ), NULL, this );
|
||||||
m_buttonAddFpF->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::AddFootprintFilter ), NULL, this );
|
m_buttonAddFpF->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::AddFootprintFilter ), NULL, this );
|
||||||
m_ButtonDeleteOneFootprintFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteOneFootprintFilter ), NULL, this );
|
m_ButtonDeleteOneFootprintFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteOneFootprintFilter ), NULL, this );
|
||||||
m_ButtonDeleteAllFootprintFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAllFootprintFilter ), NULL, this );
|
m_ButtonDeleteAllFootprintFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAllFootprintFilter ), NULL, this );
|
||||||
m_stdSizerButtonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnCancelClick ), NULL, this );
|
m_stdSizerButtonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnCancelClick ), NULL, this );
|
||||||
m_stdSizerButtonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnOkClick ), NULL, this );
|
m_stdSizerButtonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnOkClick ), NULL, this );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,115 +1,115 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Apr 11 2012)
|
// C++ code generated with wxFormBuilder (version Apr 10 2012)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef __DIALOG_EDIT_COMPONENT_IN_LIB_BASE_H__
|
#ifndef __DIALOG_EDIT_COMPONENT_IN_LIB_BASE_H__
|
||||||
#define __DIALOG_EDIT_COMPONENT_IN_LIB_BASE_H__
|
#define __DIALOG_EDIT_COMPONENT_IN_LIB_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>
|
||||||
#include "dialog_shim.h"
|
#include "dialog_shim.h"
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/checkbox.h>
|
#include <wx/checkbox.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/sizer.h>
|
#include <wx/sizer.h>
|
||||||
#include <wx/statbox.h>
|
#include <wx/statbox.h>
|
||||||
#include <wx/statline.h>
|
#include <wx/statline.h>
|
||||||
#include <wx/stattext.h>
|
#include <wx/stattext.h>
|
||||||
#include <wx/spinctrl.h>
|
#include <wx/spinctrl.h>
|
||||||
#include <wx/panel.h>
|
#include <wx/panel.h>
|
||||||
#include <wx/bitmap.h>
|
#include <wx/bitmap.h>
|
||||||
#include <wx/image.h>
|
#include <wx/image.h>
|
||||||
#include <wx/icon.h>
|
#include <wx/icon.h>
|
||||||
#include <wx/textctrl.h>
|
#include <wx/textctrl.h>
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
#include <wx/listbox.h>
|
#include <wx/listbox.h>
|
||||||
#include <wx/notebook.h>
|
#include <wx/notebook.h>
|
||||||
#include <wx/dialog.h>
|
#include <wx/dialog.h>
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#define ID_LIBEDIT_NOTEBOOK 1000
|
#define ID_LIBEDIT_NOTEBOOK 1000
|
||||||
#define ID_COPY_DOC_TO_ALIAS 1001
|
#define ID_COPY_DOC_TO_ALIAS 1001
|
||||||
#define ID_BROWSE_DOC_FILES 1002
|
#define ID_BROWSE_DOC_FILES 1002
|
||||||
#define ID_ADD_ALIAS 1003
|
#define ID_ADD_ALIAS 1003
|
||||||
#define ID_DELETE_ONE_ALIAS 1004
|
#define ID_DELETE_ONE_ALIAS 1004
|
||||||
#define ID_DELETE_ALL_ALIAS 1005
|
#define ID_DELETE_ALL_ALIAS 1005
|
||||||
#define ID_ADD_FOOTPRINT_FILTER 1006
|
#define ID_ADD_FOOTPRINT_FILTER 1006
|
||||||
#define ID_DELETE_ONE_FOOTPRINT_FILTER 1007
|
#define ID_DELETE_ONE_FOOTPRINT_FILTER 1007
|
||||||
#define ID_DELETE_ALL_FOOTPRINT_FILTER 1008
|
#define ID_DELETE_ALL_FOOTPRINT_FILTER 1008
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE
|
/// Class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE : public DIALOG_SHIM
|
class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE : public DIALOG_SHIM
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxNotebook* m_NoteBook;
|
wxNotebook* m_NoteBook;
|
||||||
wxPanel* m_PanelBasic;
|
wxPanel* m_PanelBasic;
|
||||||
wxCheckBox* m_AsConvertButt;
|
wxCheckBox* m_AsConvertButt;
|
||||||
wxCheckBox* m_ShowPinNumButt;
|
wxCheckBox* m_ShowPinNumButt;
|
||||||
wxCheckBox* m_ShowPinNameButt;
|
wxCheckBox* m_ShowPinNameButt;
|
||||||
wxCheckBox* m_PinsNameInsideButt;
|
wxCheckBox* m_PinsNameInsideButt;
|
||||||
wxStaticLine* m_staticline3;
|
wxStaticLine* m_staticline3;
|
||||||
wxStaticText* m_staticTextNbUnits;
|
wxStaticText* m_staticTextNbUnits;
|
||||||
wxSpinCtrl* m_SelNumberOfUnits;
|
wxSpinCtrl* m_SelNumberOfUnits;
|
||||||
wxStaticText* m_staticTextskew;
|
wxStaticText* m_staticTextskew;
|
||||||
wxSpinCtrl* m_SetSkew;
|
wxSpinCtrl* m_SetSkew;
|
||||||
wxStaticLine* m_staticline1;
|
wxStaticLine* m_staticline1;
|
||||||
wxCheckBox* m_OptionPower;
|
wxCheckBox* m_OptionPower;
|
||||||
wxCheckBox* m_OptionPartsLocked;
|
wxCheckBox* m_OptionPartsLocked;
|
||||||
wxPanel* m_PanelDoc;
|
wxPanel* m_PanelDoc;
|
||||||
wxStaticText* m_staticTextDescription;
|
wxStaticText* m_staticTextDescription;
|
||||||
wxTextCtrl* m_DocCtrl;
|
wxTextCtrl* m_DocCtrl;
|
||||||
wxStaticText* m_staticTextKeywords;
|
wxStaticText* m_staticTextKeywords;
|
||||||
wxTextCtrl* m_KeywordsCtrl;
|
wxTextCtrl* m_KeywordsCtrl;
|
||||||
wxStaticText* m_staticTextDocFileName;
|
wxStaticText* m_staticTextDocFileName;
|
||||||
wxTextCtrl* m_DocfileCtrl;
|
wxTextCtrl* m_DocfileCtrl;
|
||||||
wxButton* m_ButtonCopyDoc;
|
wxButton* m_ButtonCopyDoc;
|
||||||
wxButton* m_buttonBrowseDocFiles;
|
wxButton* m_buttonBrowseDocFiles;
|
||||||
wxPanel* m_PanelAlias;
|
wxPanel* m_PanelAlias;
|
||||||
wxStaticText* m_staticTextAlias;
|
wxStaticText* m_staticTextAlias;
|
||||||
wxListBox* m_PartAliasListCtrl;
|
wxListBox* m_PartAliasListCtrl;
|
||||||
wxButton* m_ButtonAddeAlias;
|
wxButton* m_ButtonAddeAlias;
|
||||||
wxButton* m_ButtonDeleteOneAlias;
|
wxButton* m_ButtonDeleteOneAlias;
|
||||||
wxButton* m_ButtonDeleteAllAlias;
|
wxButton* m_ButtonDeleteAllAlias;
|
||||||
wxPanel* m_PanelFootprintFilter;
|
wxPanel* m_PanelFootprintFilter;
|
||||||
wxStaticText* m_staticTextFootprints;
|
wxStaticText* m_staticTextFootprints;
|
||||||
wxListBox* m_FootprintFilterListBox;
|
wxListBox* m_FootprintFilterListBox;
|
||||||
wxButton* m_buttonAddFpF;
|
wxButton* m_buttonAddFpF;
|
||||||
wxButton* m_ButtonDeleteOneFootprintFilter;
|
wxButton* m_ButtonDeleteOneFootprintFilter;
|
||||||
wxButton* m_ButtonDeleteAllFootprintFilter;
|
wxButton* m_ButtonDeleteAllFootprintFilter;
|
||||||
wxStdDialogButtonSizer* m_stdSizerButton;
|
wxStdDialogButtonSizer* m_stdSizerButton;
|
||||||
wxButton* m_stdSizerButtonOK;
|
wxButton* m_stdSizerButtonOK;
|
||||||
wxButton* m_stdSizerButtonCancel;
|
wxButton* m_stdSizerButtonCancel;
|
||||||
|
|
||||||
// Virtual event handlers, overide them in your derived class
|
// Virtual event handlers, overide them in your derived class
|
||||||
virtual void CopyDocToAlias( wxCommandEvent& event ) { event.Skip(); }
|
virtual void CopyDocFromRootToAlias( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void BrowseAndSelectDocFile( wxCommandEvent& event ) { event.Skip(); }
|
virtual void BrowseAndSelectDocFile( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void AddAliasOfPart( wxCommandEvent& event ) { event.Skip(); }
|
virtual void AddAliasOfPart( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void DeleteAliasOfPart( wxCommandEvent& event ) { event.Skip(); }
|
virtual void DeleteAliasOfPart( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void DeleteAllAliasOfPart( wxCommandEvent& event ) { event.Skip(); }
|
virtual void DeleteAllAliasOfPart( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void AddFootprintFilter( wxCommandEvent& event ) { event.Skip(); }
|
virtual void AddFootprintFilter( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void DeleteOneFootprintFilter( wxCommandEvent& event ) { event.Skip(); }
|
virtual void DeleteOneFootprintFilter( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void DeleteAllFootprintFilter( wxCommandEvent& event ) { event.Skip(); }
|
virtual void DeleteAllFootprintFilter( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
|
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
|
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wxWindow* parent, wxWindowID id = ID_LIBEDIT_NOTEBOOK, const wxString& title = _("Lib Component Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wxWindow* parent, wxWindowID id = ID_LIBEDIT_NOTEBOOK, const wxString& title = _("Lib Component Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||||
~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE();
|
~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //__DIALOG_EDIT_COMPONENT_IN_LIB_BASE_H__
|
#endif //__DIALOG_EDIT_COMPONENT_IN_LIB_BASE_H__
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -41,44 +41,35 @@ public:
|
||||||
void SetUnits( const wxArrayString& units, int select = 0 );
|
void SetUnits( const wxArrayString& units, int select = 0 );
|
||||||
int GetUnitsSelection( void ) { return m_choiceUnits->GetSelection(); }
|
int GetUnitsSelection( void ) { return m_choiceUnits->GetSelection(); }
|
||||||
|
|
||||||
void SetGridSelection( int select )
|
void SetGridSelection( int select ) { m_choiceGridSize->SetSelection( select ); }
|
||||||
{
|
|
||||||
m_choiceGridSize->SetSelection( select );
|
|
||||||
}
|
|
||||||
int GetGridSelection( void ) { return m_choiceGridSize->GetSelection(); }
|
int GetGridSelection( void ) { return m_choiceGridSize->GetSelection(); }
|
||||||
void SetGridSizes( const GRIDS& grid_sizes, int grid_id );
|
void SetGridSizes( const GRIDS& grid_sizes, int grid_id );
|
||||||
|
|
||||||
void SetLineWidth( int line_width )
|
void SetBusWidth( int aWidth )
|
||||||
{
|
{
|
||||||
m_spinLineWidth->SetValue( line_width );
|
m_spinBusWidth->SetValue( aWidth );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int GetBusWidth( void )
|
||||||
|
{
|
||||||
|
return m_spinBusWidth->GetValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetLineWidth( int aWidth ) { m_spinLineWidth->SetValue( aWidth ); }
|
||||||
int GetLineWidth( void ) { return m_spinLineWidth->GetValue(); }
|
int GetLineWidth( void ) { return m_spinLineWidth->GetValue(); }
|
||||||
|
|
||||||
void SetTextSize( int text_size )
|
void SetTextSize( int text_size ) { m_spinTextSize->SetValue( text_size ); }
|
||||||
{
|
|
||||||
m_spinTextSize->SetValue( text_size );
|
|
||||||
}
|
|
||||||
int GetTextSize( void ) { return m_spinTextSize->GetValue(); }
|
int GetTextSize( void ) { return m_spinTextSize->GetValue(); }
|
||||||
|
|
||||||
void SetRepeatHorizontal( int displacement )
|
void SetRepeatHorizontal( int displacement )
|
||||||
{
|
{
|
||||||
m_spinRepeatHorizontal->SetValue( displacement );
|
m_spinRepeatHorizontal->SetValue( displacement );
|
||||||
}
|
}
|
||||||
int GetRepeatHorizontal( void )
|
int GetRepeatHorizontal( void ) { return m_spinRepeatHorizontal->GetValue(); }
|
||||||
{
|
void SetRepeatVertical( int displacement ) { m_spinRepeatVertical->SetValue( displacement ); }
|
||||||
return m_spinRepeatHorizontal->GetValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetRepeatVertical( int displacement )
|
|
||||||
{
|
|
||||||
m_spinRepeatVertical->SetValue( displacement );
|
|
||||||
}
|
|
||||||
int GetRepeatVertical( void ) { return m_spinRepeatVertical->GetValue(); }
|
int GetRepeatVertical( void ) { return m_spinRepeatVertical->GetValue(); }
|
||||||
|
void SetRepeatLabel( int increment ) { m_spinRepeatLabel->SetValue( increment ); }
|
||||||
void SetRepeatLabel( int increment )
|
|
||||||
{
|
|
||||||
m_spinRepeatLabel->SetValue( increment );
|
|
||||||
}
|
|
||||||
int GetRepeatLabel( void ) { return m_spinRepeatLabel->GetValue(); }
|
int GetRepeatLabel( void ) { return m_spinRepeatLabel->GetValue(); }
|
||||||
|
|
||||||
void SetAutoSaveInterval( int aInterval ) { m_spinAutoSaveInterval->SetValue( aInterval ); }
|
void SetAutoSaveInterval( int aInterval ) { m_spinAutoSaveInterval->SetValue( aInterval ); }
|
||||||
|
@ -87,14 +78,8 @@ public:
|
||||||
void SetShowGrid( bool show ) { m_checkShowGrid->SetValue( show ); }
|
void SetShowGrid( bool show ) { m_checkShowGrid->SetValue( show ); }
|
||||||
bool GetShowGrid( void ) { return m_checkShowGrid->GetValue(); }
|
bool GetShowGrid( void ) { return m_checkShowGrid->GetValue(); }
|
||||||
|
|
||||||
void SetShowHiddenPins( bool show )
|
void SetShowHiddenPins( bool show ) { m_checkShowHiddenPins->SetValue( show ); }
|
||||||
{
|
bool GetShowHiddenPins( void ) { return m_checkShowHiddenPins->GetValue(); }
|
||||||
m_checkShowHiddenPins->SetValue( show );
|
|
||||||
}
|
|
||||||
bool GetShowHiddenPins( void )
|
|
||||||
{
|
|
||||||
return m_checkShowHiddenPins->GetValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetEnableMiddleButtonPan( bool enable )
|
void SetEnableMiddleButtonPan( bool enable )
|
||||||
{
|
{
|
||||||
|
@ -106,7 +91,6 @@ public:
|
||||||
{
|
{
|
||||||
return m_checkEnableMiddleButtonPan->GetValue();
|
return m_checkEnableMiddleButtonPan->GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetMiddleButtonPanLimited( bool enable )
|
void SetMiddleButtonPanLimited( bool enable )
|
||||||
{
|
{
|
||||||
m_checkMiddleButtonPanLimited->SetValue( enable );
|
m_checkMiddleButtonPanLimited->SetValue( enable );
|
||||||
|
@ -116,30 +100,14 @@ public:
|
||||||
return m_checkMiddleButtonPanLimited->GetValue();
|
return m_checkMiddleButtonPanLimited->GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetEnableAutoPan( bool enable )
|
void SetEnableAutoPan( bool enable ) { m_checkAutoPan->SetValue( enable ); }
|
||||||
{
|
|
||||||
m_checkAutoPan->SetValue( enable );
|
|
||||||
}
|
|
||||||
bool GetEnableAutoPan( void ) { return m_checkAutoPan->GetValue(); }
|
bool GetEnableAutoPan( void ) { return m_checkAutoPan->GetValue(); }
|
||||||
|
|
||||||
void SetEnableHVBusOrientation( bool enable )
|
void SetEnableHVBusOrientation( bool enable ) { m_checkHVOrientation->SetValue( enable ); }
|
||||||
{
|
bool GetEnableHVBusOrientation( void ) { return m_checkHVOrientation->GetValue(); }
|
||||||
m_checkHVOrientation->SetValue( enable );
|
|
||||||
}
|
|
||||||
bool GetEnableHVBusOrientation( void )
|
|
||||||
{
|
|
||||||
return m_checkHVOrientation->GetValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetShowPageLimits( bool show )
|
|
||||||
{
|
|
||||||
m_checkPageLimits->SetValue( show );
|
|
||||||
}
|
|
||||||
bool GetShowPageLimits( void )
|
|
||||||
{
|
|
||||||
return m_checkPageLimits->GetValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
void SetShowPageLimits( bool show ) { m_checkPageLimits->SetValue( show ); }
|
||||||
|
bool GetShowPageLimits( void ) { return m_checkPageLimits->GetValue(); }
|
||||||
|
|
||||||
/** Set the field \a aNdx textctrl to \a aName */
|
/** Set the field \a aNdx textctrl to \a aName */
|
||||||
void SetFieldName( int aNdx, wxString aName );
|
void SetFieldName( int aNdx, wxString aName );
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Mar 17 2012)
|
// C++ code generated with wxFormBuilder (version Apr 10 2012)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
|
@ -67,11 +67,22 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
|
||||||
m_staticGridUnits->Wrap( -1 );
|
m_staticGridUnits->Wrap( -1 );
|
||||||
fgSizer1->Add( m_staticGridUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
fgSizer1->Add( m_staticGridUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
||||||
|
|
||||||
|
m_staticText51 = new wxStaticText( m_panel1, wxID_ANY, _("Default &bus width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
m_staticText51->Wrap( -1 );
|
||||||
|
fgSizer1->Add( m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
||||||
|
|
||||||
|
m_spinBusWidth = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 1, 100, 1 );
|
||||||
|
fgSizer1->Add( m_spinBusWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 );
|
||||||
|
|
||||||
|
m_staticBusWidthUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
m_staticBusWidthUnits->Wrap( -1 );
|
||||||
|
fgSizer1->Add( m_staticBusWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
||||||
|
|
||||||
m_staticText5 = new wxStaticText( m_panel1, wxID_ANY, _("Default &line width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticText5 = new wxStaticText( m_panel1, wxID_ANY, _("Default &line width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticText5->Wrap( -1 );
|
m_staticText5->Wrap( -1 );
|
||||||
fgSizer1->Add( m_staticText5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
fgSizer1->Add( m_staticText5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
||||||
|
|
||||||
m_spinLineWidth = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 0, 100, 0 );
|
m_spinLineWidth = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 1, 100, 1 );
|
||||||
fgSizer1->Add( m_spinLineWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 );
|
fgSizer1->Add( m_spinLineWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 );
|
||||||
|
|
||||||
m_staticLineWidthUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticLineWidthUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
@ -93,7 +104,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
|
||||||
m_staticText9->Wrap( -1 );
|
m_staticText9->Wrap( -1 );
|
||||||
fgSizer1->Add( m_staticText9, 1, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
fgSizer1->Add( m_staticText9, 1, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
||||||
|
|
||||||
m_spinRepeatHorizontal = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -500, 500, 0 );
|
m_spinRepeatHorizontal = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -5000, 5000, 0 );
|
||||||
fgSizer1->Add( m_spinRepeatHorizontal, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 );
|
fgSizer1->Add( m_spinRepeatHorizontal, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 );
|
||||||
|
|
||||||
m_staticRepeatXUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticRepeatXUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
@ -104,7 +115,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
|
||||||
m_staticText12->Wrap( -1 );
|
m_staticText12->Wrap( -1 );
|
||||||
fgSizer1->Add( m_staticText12, 1, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
fgSizer1->Add( m_staticText12, 1, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
||||||
|
|
||||||
m_spinRepeatVertical = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -500, 500, 100 );
|
m_spinRepeatVertical = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -5000, 5000, 100 );
|
||||||
fgSizer1->Add( m_spinRepeatVertical, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 );
|
fgSizer1->Add( m_spinRepeatVertical, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 );
|
||||||
|
|
||||||
m_staticRepeatYUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticRepeatYUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
|
|
@ -25,62 +25,28 @@
|
||||||
<property name="use_enum">1</property>
|
<property name="use_enum">1</property>
|
||||||
<property name="use_microsoft_bom">0</property>
|
<property name="use_microsoft_bom">0</property>
|
||||||
<object class="Dialog" expanded="1">
|
<object class="Dialog" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
|
||||||
<property name="LeftDockable">1</property>
|
|
||||||
<property name="RightDockable">1</property>
|
|
||||||
<property name="TopDockable">1</property>
|
|
||||||
<property name="aui_layer"></property>
|
|
||||||
<property name="aui_managed">0</property>
|
<property name="aui_managed">0</property>
|
||||||
<property name="aui_name"></property>
|
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||||
<property name="aui_position"></property>
|
|
||||||
<property name="aui_row"></property>
|
|
||||||
<property name="best_size"></property>
|
|
||||||
<property name="bg"></property>
|
<property name="bg"></property>
|
||||||
<property name="caption"></property>
|
|
||||||
<property name="caption_visible">1</property>
|
|
||||||
<property name="center">wxBOTH</property>
|
<property name="center">wxBOTH</property>
|
||||||
<property name="center_pane">0</property>
|
|
||||||
<property name="close_button">1</property>
|
|
||||||
<property name="context_help"></property>
|
<property name="context_help"></property>
|
||||||
<property name="context_menu">1</property>
|
<property name="context_menu">1</property>
|
||||||
<property name="default_pane">0</property>
|
|
||||||
<property name="dock">Dock</property>
|
|
||||||
<property name="dock_fixed">0</property>
|
|
||||||
<property name="docking">Left</property>
|
|
||||||
<property name="enabled">1</property>
|
<property name="enabled">1</property>
|
||||||
<property name="event_handler">impl_virtual</property>
|
<property name="event_handler">impl_virtual</property>
|
||||||
<property name="extra_style"></property>
|
<property name="extra_style"></property>
|
||||||
<property name="fg"></property>
|
<property name="fg"></property>
|
||||||
<property name="floatable">1</property>
|
|
||||||
<property name="font"></property>
|
<property name="font"></property>
|
||||||
<property name="gripper">0</property>
|
|
||||||
<property name="hidden">0</property>
|
<property name="hidden">0</property>
|
||||||
<property name="id">wxID_ANY</property>
|
<property name="id">wxID_ANY</property>
|
||||||
<property name="max_size"></property>
|
|
||||||
<property name="maximize_button">0</property>
|
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="min_size"></property>
|
|
||||||
<property name="minimize_button">0</property>
|
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="moveable">1</property>
|
|
||||||
<property name="name">DIALOG_EESCHEMA_OPTIONS_BASE</property>
|
<property name="name">DIALOG_EESCHEMA_OPTIONS_BASE</property>
|
||||||
<property name="pane_border">1</property>
|
|
||||||
<property name="pane_position"></property>
|
|
||||||
<property name="pane_size"></property>
|
|
||||||
<property name="pin_button">1</property>
|
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="resize">Resizable</property>
|
|
||||||
<property name="show">1</property>
|
|
||||||
<property name="size"></property>
|
<property name="size"></property>
|
||||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="title">Schematic Editor Options</property>
|
<property name="title">Schematic Editor Options</property>
|
||||||
<property name="toolbar_pane">0</property>
|
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -125,20 +91,20 @@
|
||||||
<property name="name">mainSizer</property>
|
<property name="name">mainSizer</property>
|
||||||
<property name="orient">wxVERTICAL</property>
|
<property name="orient">wxVERTICAL</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
<object class="sizeritem" expanded="0">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">12</property>
|
<property name="border">12</property>
|
||||||
<property name="flag"></property>
|
<property name="flag"></property>
|
||||||
<property name="proportion">1</property>
|
<property name="proportion">1</property>
|
||||||
<object class="wxBoxSizer" expanded="0">
|
<object class="wxBoxSizer" expanded="1">
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="name">bOptionsSizer</property>
|
<property name="name">bOptionsSizer</property>
|
||||||
<property name="orient">wxVERTICAL</property>
|
<property name="orient">wxVERTICAL</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
<object class="sizeritem" expanded="0">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">0</property>
|
<property name="border">0</property>
|
||||||
<property name="flag">wxEXPAND</property>
|
<property name="flag">wxEXPAND</property>
|
||||||
<property name="proportion">1</property>
|
<property name="proportion">1</property>
|
||||||
<object class="wxNotebook" expanded="0">
|
<object class="wxNotebook" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
<property name="LeftDockable">1</property>
|
<property name="LeftDockable">1</property>
|
||||||
<property name="RightDockable">1</property>
|
<property name="RightDockable">1</property>
|
||||||
|
@ -188,10 +154,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -220,11 +182,11 @@
|
||||||
<event name="OnSetFocus"></event>
|
<event name="OnSetFocus"></event>
|
||||||
<event name="OnSize"></event>
|
<event name="OnSize"></event>
|
||||||
<event name="OnUpdateUI"></event>
|
<event name="OnUpdateUI"></event>
|
||||||
<object class="notebookpage" expanded="0">
|
<object class="notebookpage" expanded="1">
|
||||||
<property name="bitmap"></property>
|
<property name="bitmap"></property>
|
||||||
<property name="label">General Options</property>
|
<property name="label">General Options</property>
|
||||||
<property name="select">1</property>
|
<property name="select">1</property>
|
||||||
<object class="wxPanel" expanded="0">
|
<object class="wxPanel" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
<property name="LeftDockable">1</property>
|
<property name="LeftDockable">1</property>
|
||||||
<property name="RightDockable">1</property>
|
<property name="RightDockable">1</property>
|
||||||
|
@ -272,10 +234,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||||
|
@ -302,25 +260,25 @@
|
||||||
<event name="OnSetFocus"></event>
|
<event name="OnSetFocus"></event>
|
||||||
<event name="OnSize"></event>
|
<event name="OnSize"></event>
|
||||||
<event name="OnUpdateUI"></event>
|
<event name="OnUpdateUI"></event>
|
||||||
<object class="wxBoxSizer" expanded="0">
|
<object class="wxBoxSizer" expanded="1">
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="name">p1mainSizer</property>
|
<property name="name">p1mainSizer</property>
|
||||||
<property name="orient">wxHORIZONTAL</property>
|
<property name="orient">wxHORIZONTAL</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
<object class="sizeritem" expanded="0">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">12</property>
|
<property name="border">12</property>
|
||||||
<property name="flag">wxALL|wxEXPAND</property>
|
<property name="flag">wxALL|wxEXPAND</property>
|
||||||
<property name="proportion">1</property>
|
<property name="proportion">1</property>
|
||||||
<object class="wxBoxSizer" expanded="0">
|
<object class="wxBoxSizer" expanded="1">
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="name">bSizer3</property>
|
<property name="name">bSizer3</property>
|
||||||
<property name="orient">wxVERTICAL</property>
|
<property name="orient">wxVERTICAL</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
<object class="sizeritem" expanded="0">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">0</property>
|
<property name="border">0</property>
|
||||||
<property name="flag">wxALIGN_CENTER|wxEXPAND</property>
|
<property name="flag">wxALIGN_CENTER|wxEXPAND</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxFlexGridSizer" expanded="0">
|
<object class="wxFlexGridSizer" expanded="1">
|
||||||
<property name="cols">3</property>
|
<property name="cols">3</property>
|
||||||
<property name="flexible_direction">wxHORIZONTAL</property>
|
<property name="flexible_direction">wxHORIZONTAL</property>
|
||||||
<property name="growablecols">0,1,2</property>
|
<property name="growablecols">0,1,2</property>
|
||||||
|
@ -386,10 +344,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -571,10 +525,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -746,10 +696,259 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
<property name="window_name"></property>
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
<property name="window_style"></property>
|
||||||
<property name="validator_variable"></property>
|
<property name="wrap">-1</property>
|
||||||
|
<event name="OnChar"></event>
|
||||||
|
<event name="OnEnterWindow"></event>
|
||||||
|
<event name="OnEraseBackground"></event>
|
||||||
|
<event name="OnKeyDown"></event>
|
||||||
|
<event name="OnKeyUp"></event>
|
||||||
|
<event name="OnKillFocus"></event>
|
||||||
|
<event name="OnLeaveWindow"></event>
|
||||||
|
<event name="OnLeftDClick"></event>
|
||||||
|
<event name="OnLeftDown"></event>
|
||||||
|
<event name="OnLeftUp"></event>
|
||||||
|
<event name="OnMiddleDClick"></event>
|
||||||
|
<event name="OnMiddleDown"></event>
|
||||||
|
<event name="OnMiddleUp"></event>
|
||||||
|
<event name="OnMotion"></event>
|
||||||
|
<event name="OnMouseEvents"></event>
|
||||||
|
<event name="OnMouseWheel"></event>
|
||||||
|
<event name="OnPaint"></event>
|
||||||
|
<event name="OnRightDClick"></event>
|
||||||
|
<event name="OnRightDown"></event>
|
||||||
|
<event name="OnRightUp"></event>
|
||||||
|
<event name="OnSetFocus"></event>
|
||||||
|
<event name="OnSize"></event>
|
||||||
|
<event name="OnUpdateUI"></event>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">3</property>
|
||||||
|
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="wxStaticText" expanded="1">
|
||||||
|
<property name="BottomDockable">1</property>
|
||||||
|
<property name="LeftDockable">1</property>
|
||||||
|
<property name="RightDockable">1</property>
|
||||||
|
<property name="TopDockable">1</property>
|
||||||
|
<property name="aui_layer"></property>
|
||||||
|
<property name="aui_name"></property>
|
||||||
|
<property name="aui_position"></property>
|
||||||
|
<property name="aui_row"></property>
|
||||||
|
<property name="best_size"></property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="caption"></property>
|
||||||
|
<property name="caption_visible">1</property>
|
||||||
|
<property name="center_pane">0</property>
|
||||||
|
<property name="close_button">1</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="default_pane">0</property>
|
||||||
|
<property name="dock">Dock</property>
|
||||||
|
<property name="dock_fixed">0</property>
|
||||||
|
<property name="docking">Left</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="floatable">1</property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="gripper">0</property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="label">Default &bus width:</property>
|
||||||
|
<property name="max_size"></property>
|
||||||
|
<property name="maximize_button">0</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="min_size"></property>
|
||||||
|
<property name="minimize_button">0</property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="moveable">1</property>
|
||||||
|
<property name="name">m_staticText51</property>
|
||||||
|
<property name="pane_border">1</property>
|
||||||
|
<property name="pane_position"></property>
|
||||||
|
<property name="pane_size"></property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="pin_button">1</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="show">1</property>
|
||||||
|
<property name="size"></property>
|
||||||
|
<property name="style"></property>
|
||||||
|
<property name="subclass"></property>
|
||||||
|
<property name="toolbar_pane">0</property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style"></property>
|
||||||
|
<property name="wrap">-1</property>
|
||||||
|
<event name="OnChar"></event>
|
||||||
|
<event name="OnEnterWindow"></event>
|
||||||
|
<event name="OnEraseBackground"></event>
|
||||||
|
<event name="OnKeyDown"></event>
|
||||||
|
<event name="OnKeyUp"></event>
|
||||||
|
<event name="OnKillFocus"></event>
|
||||||
|
<event name="OnLeaveWindow"></event>
|
||||||
|
<event name="OnLeftDClick"></event>
|
||||||
|
<event name="OnLeftDown"></event>
|
||||||
|
<event name="OnLeftUp"></event>
|
||||||
|
<event name="OnMiddleDClick"></event>
|
||||||
|
<event name="OnMiddleDown"></event>
|
||||||
|
<event name="OnMiddleUp"></event>
|
||||||
|
<event name="OnMotion"></event>
|
||||||
|
<event name="OnMouseEvents"></event>
|
||||||
|
<event name="OnMouseWheel"></event>
|
||||||
|
<event name="OnPaint"></event>
|
||||||
|
<event name="OnRightDClick"></event>
|
||||||
|
<event name="OnRightDown"></event>
|
||||||
|
<event name="OnRightUp"></event>
|
||||||
|
<event name="OnSetFocus"></event>
|
||||||
|
<event name="OnSize"></event>
|
||||||
|
<event name="OnUpdateUI"></event>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">3</property>
|
||||||
|
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="wxSpinCtrl" expanded="1">
|
||||||
|
<property name="BottomDockable">1</property>
|
||||||
|
<property name="LeftDockable">1</property>
|
||||||
|
<property name="RightDockable">1</property>
|
||||||
|
<property name="TopDockable">1</property>
|
||||||
|
<property name="aui_layer"></property>
|
||||||
|
<property name="aui_name"></property>
|
||||||
|
<property name="aui_position"></property>
|
||||||
|
<property name="aui_row"></property>
|
||||||
|
<property name="best_size"></property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="caption"></property>
|
||||||
|
<property name="caption_visible">1</property>
|
||||||
|
<property name="center_pane">0</property>
|
||||||
|
<property name="close_button">1</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="default_pane">0</property>
|
||||||
|
<property name="dock">Dock</property>
|
||||||
|
<property name="dock_fixed">0</property>
|
||||||
|
<property name="docking">Left</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="floatable">1</property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="gripper">0</property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="initial">1</property>
|
||||||
|
<property name="max">100</property>
|
||||||
|
<property name="max_size"></property>
|
||||||
|
<property name="maximize_button">0</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="min">1</property>
|
||||||
|
<property name="min_size"></property>
|
||||||
|
<property name="minimize_button">0</property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="moveable">1</property>
|
||||||
|
<property name="name">m_spinBusWidth</property>
|
||||||
|
<property name="pane_border">1</property>
|
||||||
|
<property name="pane_position"></property>
|
||||||
|
<property name="pane_size"></property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="pin_button">1</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="show">1</property>
|
||||||
|
<property name="size"></property>
|
||||||
|
<property name="style">wxSP_ARROW_KEYS|wxSP_WRAP</property>
|
||||||
|
<property name="subclass"></property>
|
||||||
|
<property name="toolbar_pane">0</property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="value"></property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style"></property>
|
||||||
|
<event name="OnChar"></event>
|
||||||
|
<event name="OnEnterWindow"></event>
|
||||||
|
<event name="OnEraseBackground"></event>
|
||||||
|
<event name="OnKeyDown"></event>
|
||||||
|
<event name="OnKeyUp"></event>
|
||||||
|
<event name="OnKillFocus"></event>
|
||||||
|
<event name="OnLeaveWindow"></event>
|
||||||
|
<event name="OnLeftDClick"></event>
|
||||||
|
<event name="OnLeftDown"></event>
|
||||||
|
<event name="OnLeftUp"></event>
|
||||||
|
<event name="OnMiddleDClick"></event>
|
||||||
|
<event name="OnMiddleDown"></event>
|
||||||
|
<event name="OnMiddleUp"></event>
|
||||||
|
<event name="OnMotion"></event>
|
||||||
|
<event name="OnMouseEvents"></event>
|
||||||
|
<event name="OnMouseWheel"></event>
|
||||||
|
<event name="OnPaint"></event>
|
||||||
|
<event name="OnRightDClick"></event>
|
||||||
|
<event name="OnRightDown"></event>
|
||||||
|
<event name="OnRightUp"></event>
|
||||||
|
<event name="OnSetFocus"></event>
|
||||||
|
<event name="OnSize"></event>
|
||||||
|
<event name="OnSpinCtrl"></event>
|
||||||
|
<event name="OnSpinCtrlText"></event>
|
||||||
|
<event name="OnUpdateUI"></event>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">3</property>
|
||||||
|
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="wxStaticText" expanded="1">
|
||||||
|
<property name="BottomDockable">1</property>
|
||||||
|
<property name="LeftDockable">1</property>
|
||||||
|
<property name="RightDockable">1</property>
|
||||||
|
<property name="TopDockable">1</property>
|
||||||
|
<property name="aui_layer"></property>
|
||||||
|
<property name="aui_name"></property>
|
||||||
|
<property name="aui_position"></property>
|
||||||
|
<property name="aui_row"></property>
|
||||||
|
<property name="best_size"></property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="caption"></property>
|
||||||
|
<property name="caption_visible">1</property>
|
||||||
|
<property name="center_pane">0</property>
|
||||||
|
<property name="close_button">1</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="default_pane">0</property>
|
||||||
|
<property name="dock">Dock</property>
|
||||||
|
<property name="dock_fixed">0</property>
|
||||||
|
<property name="docking">Left</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="floatable">1</property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="gripper">0</property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="label">mils</property>
|
||||||
|
<property name="max_size"></property>
|
||||||
|
<property name="maximize_button">0</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="min_size"></property>
|
||||||
|
<property name="minimize_button">0</property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="moveable">1</property>
|
||||||
|
<property name="name">m_staticBusWidthUnits</property>
|
||||||
|
<property name="pane_border">1</property>
|
||||||
|
<property name="pane_position"></property>
|
||||||
|
<property name="pane_size"></property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="pin_button">1</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="show">1</property>
|
||||||
|
<property name="size"></property>
|
||||||
|
<property name="style"></property>
|
||||||
|
<property name="subclass"></property>
|
||||||
|
<property name="toolbar_pane">0</property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -833,10 +1032,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -898,12 +1093,12 @@
|
||||||
<property name="gripper">0</property>
|
<property name="gripper">0</property>
|
||||||
<property name="hidden">0</property>
|
<property name="hidden">0</property>
|
||||||
<property name="id">wxID_ANY</property>
|
<property name="id">wxID_ANY</property>
|
||||||
<property name="initial">0</property>
|
<property name="initial">1</property>
|
||||||
<property name="max">100</property>
|
<property name="max">100</property>
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="min">0</property>
|
<property name="min">1</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
@ -922,10 +1117,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="value"></property>
|
<property name="value"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
|
@ -1011,10 +1202,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -1098,10 +1285,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -1187,10 +1370,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="value"></property>
|
<property name="value"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
|
@ -1276,10 +1455,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -1363,10 +1538,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -1429,11 +1600,11 @@
|
||||||
<property name="hidden">0</property>
|
<property name="hidden">0</property>
|
||||||
<property name="id">wxID_ANY</property>
|
<property name="id">wxID_ANY</property>
|
||||||
<property name="initial">0</property>
|
<property name="initial">0</property>
|
||||||
<property name="max">500</property>
|
<property name="max">5000</property>
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="min">-500</property>
|
<property name="min">-5000</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
@ -1452,10 +1623,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="value"></property>
|
<property name="value"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
|
@ -1541,10 +1708,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -1628,10 +1791,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -1694,11 +1853,11 @@
|
||||||
<property name="hidden">0</property>
|
<property name="hidden">0</property>
|
||||||
<property name="id">wxID_ANY</property>
|
<property name="id">wxID_ANY</property>
|
||||||
<property name="initial">100</property>
|
<property name="initial">100</property>
|
||||||
<property name="max">500</property>
|
<property name="max">5000</property>
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="min">-500</property>
|
<property name="min">-5000</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
@ -1717,10 +1876,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="value"></property>
|
<property name="value"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
|
@ -1806,10 +1961,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -1893,10 +2044,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -1982,10 +2129,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="value">1</property>
|
<property name="value">1</property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
|
@ -2081,10 +2224,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -2170,10 +2309,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="value"></property>
|
<property name="value"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
|
@ -2259,10 +2394,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -2988,10 +3119,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip">User defined field names for schematic components. </property>
|
<property name="tooltip">User defined field names for schematic components. </property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||||
|
@ -3086,10 +3213,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -3200,10 +3323,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -3378,10 +3497,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -3556,10 +3671,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -3734,10 +3845,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -3912,10 +4019,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -4090,10 +4193,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -4268,10 +4367,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
@ -4446,10 +4541,6 @@
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Mar 17 2012)
|
// C++ code generated with wxFormBuilder (version Apr 10 2012)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
|
@ -59,6 +59,9 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public wxDialog
|
||||||
wxStaticText* m_staticText3;
|
wxStaticText* m_staticText3;
|
||||||
wxChoice* m_choiceGridSize;
|
wxChoice* m_choiceGridSize;
|
||||||
wxStaticText* m_staticGridUnits;
|
wxStaticText* m_staticGridUnits;
|
||||||
|
wxStaticText* m_staticText51;
|
||||||
|
wxSpinCtrl* m_spinBusWidth;
|
||||||
|
wxStaticText* m_staticBusWidthUnits;
|
||||||
wxStaticText* m_staticText5;
|
wxStaticText* m_staticText5;
|
||||||
wxSpinCtrl* m_spinLineWidth;
|
wxSpinCtrl* m_spinLineWidth;
|
||||||
wxStaticText* m_staticLineWidthUnits;
|
wxStaticText* m_staticLineWidthUnits;
|
||||||
|
|
|
@ -185,14 +185,12 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( )
|
||||||
sheetpath = SheetList.GetNext();
|
sheetpath = SheetList.GetNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
double scale = 10;
|
|
||||||
|
|
||||||
plot_offset.x = 0;
|
plot_offset.x = 0;
|
||||||
plot_offset.y = 0;
|
plot_offset.y = 0;
|
||||||
|
|
||||||
plotFileName = schframe->GetUniqueFilenameForCurrentSheet() + wxT( ".dxf" );
|
plotFileName = schframe->GetUniqueFilenameForCurrentSheet() + wxT( ".dxf" );
|
||||||
|
|
||||||
PlotOneSheetDXF( plotFileName, screen, plot_offset, scale );
|
PlotOneSheetDXF( plotFileName, screen, plot_offset, 1 );
|
||||||
|
|
||||||
if( !m_select_PlotAll )
|
if( !m_select_PlotAll )
|
||||||
break;
|
break;
|
||||||
|
@ -232,24 +230,24 @@ void DIALOG_PLOT_SCHEMATIC_DXF::PlotOneSheetDXF( const wxString& FileName,
|
||||||
const PAGE_INFO& pageInfo = screen->GetPageSettings();
|
const PAGE_INFO& pageInfo = screen->GetPageSettings();
|
||||||
plotter->SetPageSettings( pageInfo );
|
plotter->SetPageSettings( pageInfo );
|
||||||
|
|
||||||
plotter->set_viewport( plot_offset, scale, 0 );
|
plotter->SetViewport( plot_offset, IU_PER_DECIMILS, scale, 0 );
|
||||||
plotter->set_color_mode( m_plotColorOpt );
|
plotter->SetColorMode( m_plotColorOpt );
|
||||||
|
|
||||||
// Init :
|
// Init :
|
||||||
plotter->set_creator( wxT( "Eeschema-DXF" ) );
|
plotter->SetCreator( wxT( "Eeschema-DXF" ) );
|
||||||
plotter->set_filename( FileName );
|
plotter->SetFilename( FileName );
|
||||||
plotter->start_plot( output_file );
|
plotter->StartPlot( output_file );
|
||||||
|
|
||||||
if( m_plot_Sheet_Ref )
|
if( m_plot_Sheet_Ref )
|
||||||
{
|
{
|
||||||
plotter->set_color( BLACK );
|
plotter->SetColor( BLACK );
|
||||||
m_Parent->PlotWorkSheet( plotter, screen );
|
m_Parent->PlotWorkSheet( plotter, screen );
|
||||||
}
|
}
|
||||||
|
|
||||||
screen->Plot( plotter );
|
screen->Plot( plotter );
|
||||||
|
|
||||||
// finish
|
// finish
|
||||||
plotter->end_plot();
|
plotter->EndPlot();
|
||||||
delete plotter;
|
delete plotter;
|
||||||
|
|
||||||
m_MsgBox->AppendText( wxT( "Ok\n" ) );
|
m_MsgBox->AppendText( wxT( "Ok\n" ) );
|
||||||
|
|
|
@ -330,7 +330,7 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_Schematic_HPGL( bool aPlotAll )
|
||||||
// Calculation of conversion scales.
|
// Calculation of conversion scales.
|
||||||
|
|
||||||
// 10x because Eeschema works in mils, not deci-mils
|
// 10x because Eeschema works in mils, not deci-mils
|
||||||
double plot_scale = 10 * (double) plotPage.GetWidthMils() / curPage.GetWidthMils();
|
double plot_scale = (double) plotPage.GetWidthMils() / curPage.GetWidthMils();
|
||||||
|
|
||||||
// Calculate offsets
|
// Calculate offsets
|
||||||
plotOffset.x = -s_Offset.x;
|
plotOffset.x = -s_Offset.x;
|
||||||
|
@ -380,26 +380,26 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_1_Page_HPGL( const wxString& FileName,
|
||||||
|
|
||||||
plotter->SetPageSettings( pageInfo );
|
plotter->SetPageSettings( pageInfo );
|
||||||
|
|
||||||
plotter->set_viewport( offset, plot_scale, 0 );
|
plotter->SetViewport( offset, IU_PER_DECIMILS, plot_scale, 0 );
|
||||||
plotter->set_default_line_width( g_DrawDefaultLineThickness );
|
plotter->SetDefaultLineWidth( g_DrawDefaultLineThickness );
|
||||||
|
|
||||||
// Init :
|
// Init :
|
||||||
plotter->set_creator( wxT( "Eeschema-HPGL" ) );
|
plotter->SetCreator( wxT( "Eeschema-HPGL" ) );
|
||||||
plotter->set_filename( FileName );
|
plotter->SetFilename( FileName );
|
||||||
plotter->set_pen_speed( g_HPGL_Pen_Descr.m_Pen_Speed );
|
plotter->SetPenSpeed( g_HPGL_Pen_Descr.m_Pen_Speed );
|
||||||
plotter->set_pen_number( g_HPGL_Pen_Descr.m_Pen_Num );
|
plotter->SetPenNumber( g_HPGL_Pen_Descr.m_Pen_Num );
|
||||||
plotter->set_pen_diameter( g_HPGL_Pen_Descr.m_Pen_Diam );
|
plotter->SetPenDiameter( g_HPGL_Pen_Descr.m_Pen_Diam );
|
||||||
plotter->set_pen_overlap( g_HPGL_Pen_Descr.m_Pen_Diam / 2 );
|
plotter->SetPenOverlap( g_HPGL_Pen_Descr.m_Pen_Diam / 2 );
|
||||||
plotter->start_plot( output_file );
|
plotter->StartPlot( output_file );
|
||||||
|
|
||||||
plotter->set_color( BLACK );
|
plotter->SetColor( BLACK );
|
||||||
|
|
||||||
if( s_plot_Sheet_Ref )
|
if( s_plot_Sheet_Ref )
|
||||||
m_Parent->PlotWorkSheet( plotter, screen );
|
m_Parent->PlotWorkSheet( plotter, screen );
|
||||||
|
|
||||||
screen->Plot( plotter );
|
screen->Plot( plotter );
|
||||||
|
|
||||||
plotter->end_plot();
|
plotter->EndPlot();
|
||||||
delete plotter;
|
delete plotter;
|
||||||
|
|
||||||
m_MsgBox->AppendText( wxT( "Ok\n" ) );
|
m_MsgBox->AppendText( wxT( "Ok\n" ) );
|
||||||
|
|
|
@ -0,0 +1,309 @@
|
||||||
|
/** @file dialog_plot_schematic_PDF.cpp
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
|
*
|
||||||
|
* Copyright (C) 1992-2010 Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr
|
||||||
|
* Copyright (C) 1992-2010 KiCad Developers, see change_log.txt for contributors.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, you may find one here:
|
||||||
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||||
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||||
|
* or you may write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <fctsys.h>
|
||||||
|
#include <gr_basic.h>
|
||||||
|
#include <confirm.h>
|
||||||
|
#include <worksheet.h>
|
||||||
|
#include <plot_common.h>
|
||||||
|
#include <class_sch_screen.h>
|
||||||
|
#include <wxEeschemaStruct.h>
|
||||||
|
#include <base_units.h>
|
||||||
|
|
||||||
|
#include <general.h>
|
||||||
|
#include <protos.h>
|
||||||
|
#include <sch_sheet_path.h>
|
||||||
|
|
||||||
|
|
||||||
|
enum PageFormatReq {
|
||||||
|
PAGE_SIZE_AUTO,
|
||||||
|
PAGE_SIZE_A4,
|
||||||
|
PAGE_SIZE_A
|
||||||
|
};
|
||||||
|
|
||||||
|
#include <dialog_plot_schematic_PDF_base.h>
|
||||||
|
|
||||||
|
class DIALOG_PLOT_SCHEMATIC_PDF : public DIALOG_PLOT_SCHEMATIC_PDF_BASE
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
SCH_EDIT_FRAME* m_Parent;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
/// Constructors
|
||||||
|
DIALOG_PLOT_SCHEMATIC_PDF( SCH_EDIT_FRAME* parent );
|
||||||
|
|
||||||
|
private:
|
||||||
|
static bool m_plotColorOpt;
|
||||||
|
static int m_pageSizeSelect;
|
||||||
|
static bool m_plot_Sheet_Ref;
|
||||||
|
bool m_select_PlotAll;
|
||||||
|
private:
|
||||||
|
void OnPlotCurrent( wxCommandEvent& event );
|
||||||
|
void OnPlotAll( wxCommandEvent& event );
|
||||||
|
void OnCancelClick( wxCommandEvent& event );
|
||||||
|
|
||||||
|
void initDlg();
|
||||||
|
void initOptVars();
|
||||||
|
void createPDFFile();
|
||||||
|
void plotOneSheet( PDF_PLOTTER *plotter, SCH_SCREEN* screen );
|
||||||
|
void plotSetupPage( PDF_PLOTTER *plotter, SCH_SCREEN* screen );
|
||||||
|
};
|
||||||
|
|
||||||
|
// static members (static to remember last state):
|
||||||
|
bool DIALOG_PLOT_SCHEMATIC_PDF::m_plotColorOpt = false;
|
||||||
|
int DIALOG_PLOT_SCHEMATIC_PDF::m_pageSizeSelect = PAGE_SIZE_AUTO;
|
||||||
|
bool DIALOG_PLOT_SCHEMATIC_PDF::m_plot_Sheet_Ref = true;
|
||||||
|
|
||||||
|
|
||||||
|
void SCH_EDIT_FRAME::ToPlot_PDF( wxCommandEvent& event )
|
||||||
|
{
|
||||||
|
DIALOG_PLOT_SCHEMATIC_PDF dlg( this );
|
||||||
|
|
||||||
|
dlg.ShowModal();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DIALOG_PLOT_SCHEMATIC_PDF::DIALOG_PLOT_SCHEMATIC_PDF( SCH_EDIT_FRAME* parent ) :
|
||||||
|
DIALOG_PLOT_SCHEMATIC_PDF_BASE( parent )
|
||||||
|
{
|
||||||
|
m_Parent = parent;
|
||||||
|
m_select_PlotAll = false;
|
||||||
|
initDlg();
|
||||||
|
|
||||||
|
GetSizer()->SetSizeHints( this );
|
||||||
|
Centre();
|
||||||
|
m_buttonPlotAll->SetDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Control creation for DIALOG_PLOT_SCHEMATIC_PDF
|
||||||
|
*/
|
||||||
|
|
||||||
|
void DIALOG_PLOT_SCHEMATIC_PDF::initDlg()
|
||||||
|
{
|
||||||
|
SetFocus(); // make the ESC work
|
||||||
|
|
||||||
|
// Set options
|
||||||
|
m_SizeOption->SetSelection( m_pageSizeSelect );
|
||||||
|
m_PlotPDFColorOption->SetSelection( m_plotColorOpt ? 1 : 0 );
|
||||||
|
m_Plot_Sheet_Ref_Ctrl->SetValue( m_plot_Sheet_Ref );
|
||||||
|
|
||||||
|
AddUnitSymbol( *m_defaultLineWidthTitle, g_UserUnit );
|
||||||
|
PutValueInLocalUnits( *m_DefaultLineSizeCtrl, g_DrawDefaultLineThickness );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON
|
||||||
|
*/
|
||||||
|
|
||||||
|
void DIALOG_PLOT_SCHEMATIC_PDF::OnPlotCurrent( wxCommandEvent& event )
|
||||||
|
{
|
||||||
|
m_select_PlotAll = false;
|
||||||
|
|
||||||
|
initOptVars();
|
||||||
|
createPDFFile();
|
||||||
|
m_MsgBox->AppendText( wxT( "*****\n" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON1
|
||||||
|
*/
|
||||||
|
|
||||||
|
void DIALOG_PLOT_SCHEMATIC_PDF::OnPlotAll( wxCommandEvent& event )
|
||||||
|
{
|
||||||
|
m_select_PlotAll = true;
|
||||||
|
|
||||||
|
initOptVars();
|
||||||
|
createPDFFile();
|
||||||
|
m_MsgBox->AppendText( wxT( "*****\n" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
|
||||||
|
*/
|
||||||
|
|
||||||
|
void DIALOG_PLOT_SCHEMATIC_PDF::OnCancelClick( wxCommandEvent& event )
|
||||||
|
{
|
||||||
|
initOptVars();
|
||||||
|
EndModal( 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DIALOG_PLOT_SCHEMATIC_PDF::initOptVars()
|
||||||
|
{
|
||||||
|
m_plot_Sheet_Ref = m_Plot_Sheet_Ref_Ctrl->GetValue();
|
||||||
|
m_plotColorOpt = m_PlotPDFColorOption->GetSelection();
|
||||||
|
m_pageSizeSelect = m_SizeOption->GetSelection();
|
||||||
|
g_DrawDefaultLineThickness = ReturnValueFromTextCtrl( *m_DefaultLineSizeCtrl );
|
||||||
|
|
||||||
|
if( g_DrawDefaultLineThickness < 1 )
|
||||||
|
g_DrawDefaultLineThickness = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DIALOG_PLOT_SCHEMATIC_PDF::createPDFFile()
|
||||||
|
{
|
||||||
|
SCH_SCREEN* screen = m_Parent->GetScreen();
|
||||||
|
SCH_SHEET_PATH* sheetpath;
|
||||||
|
SCH_SHEET_PATH oldsheetpath = m_Parent->GetCurrentSheet(); // sheetpath is saved here
|
||||||
|
wxPoint plot_offset;
|
||||||
|
|
||||||
|
/* When printing all pages, the printed page is not the current page. In
|
||||||
|
* complex hierarchies, we must update component references and others
|
||||||
|
* parameters in the given printed SCH_SCREEN, accordint to the sheet path
|
||||||
|
* because in complex hierarchies a SCH_SCREEN (a drawing ) is shared
|
||||||
|
* between many sheets and component references depend on the actual sheet
|
||||||
|
* path used
|
||||||
|
*/
|
||||||
|
SCH_SHEET_LIST SheetList( NULL );
|
||||||
|
|
||||||
|
sheetpath = SheetList.GetFirst();
|
||||||
|
|
||||||
|
// Allocate the plotter and set the job level parameter
|
||||||
|
PDF_PLOTTER* plotter = new PDF_PLOTTER();
|
||||||
|
plotter->SetDefaultLineWidth( g_DrawDefaultLineThickness );
|
||||||
|
plotter->SetColorMode( m_plotColorOpt );
|
||||||
|
plotter->SetCreator( wxT( "Eeschema-PDF" ) );
|
||||||
|
plotter->SetPsTextMode( PSTEXTMODE_PHANTOM );
|
||||||
|
|
||||||
|
|
||||||
|
// First page handling is different
|
||||||
|
bool first_page = true;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// Step over the schematic hierarchy
|
||||||
|
if( m_select_PlotAll )
|
||||||
|
{
|
||||||
|
SCH_SHEET_PATH list;
|
||||||
|
if( list.BuildSheetPathInfoFromSheetPathValue( sheetpath->Path() ) )
|
||||||
|
{
|
||||||
|
m_Parent->SetCurrentSheet( list );
|
||||||
|
m_Parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||||
|
m_Parent->SetSheetNumberAndCount();
|
||||||
|
screen = m_Parent->GetCurrentSheet().LastScreen();
|
||||||
|
}
|
||||||
|
else // Should not happen
|
||||||
|
wxASSERT( 0 );
|
||||||
|
|
||||||
|
sheetpath = SheetList.GetNext();
|
||||||
|
}
|
||||||
|
|
||||||
|
if( first_page ) {
|
||||||
|
wxString msg;
|
||||||
|
wxString plotFileName = m_Parent->GetUniqueFilenameForCurrentSheet()
|
||||||
|
+ wxT( ".pdf" );
|
||||||
|
msg.Printf( _( "Plot: %s " ), GetChars( plotFileName ) );
|
||||||
|
m_MsgBox->AppendText( msg );
|
||||||
|
|
||||||
|
FILE* output_file = wxFopen( plotFileName, wxT( "wb" ) );
|
||||||
|
|
||||||
|
if( output_file == NULL )
|
||||||
|
{
|
||||||
|
msg = wxT( "\n** " );
|
||||||
|
msg += _( "Unable to create " ) + plotFileName + wxT( " **\n" );
|
||||||
|
m_MsgBox->AppendText( msg );
|
||||||
|
wxBell();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Open the plotter and do the first page
|
||||||
|
SetLocaleTo_C_standard();
|
||||||
|
plotter->SetFilename( plotFileName );
|
||||||
|
plotSetupPage( plotter, screen );
|
||||||
|
plotter->StartPlot( output_file );
|
||||||
|
first_page = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* For the following pages you need to close the (finished) page,
|
||||||
|
reconfigure, and then start a new one */
|
||||||
|
plotter->ClosePage();
|
||||||
|
plotSetupPage( plotter, screen );
|
||||||
|
plotter->StartPage();
|
||||||
|
}
|
||||||
|
plotOneSheet( plotter, screen );
|
||||||
|
} while (m_select_PlotAll && sheetpath );
|
||||||
|
|
||||||
|
// Everything done, close the plot and restore the environment
|
||||||
|
plotter->EndPlot();
|
||||||
|
delete plotter;
|
||||||
|
SetLocaleTo_Default();
|
||||||
|
|
||||||
|
// Restore the previous sheet
|
||||||
|
m_Parent->SetCurrentSheet( oldsheetpath );
|
||||||
|
m_Parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||||
|
m_Parent->SetSheetNumberAndCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DIALOG_PLOT_SCHEMATIC_PDF::plotSetupPage( PDF_PLOTTER* plotter,
|
||||||
|
SCH_SCREEN* screen)
|
||||||
|
{
|
||||||
|
PAGE_INFO plotPage; // page size selected to plot
|
||||||
|
// Considerations on page size and scaling requests
|
||||||
|
PAGE_INFO actualPage = screen->GetPageSettings(); // page size selected in schematic
|
||||||
|
switch( m_pageSizeSelect )
|
||||||
|
{
|
||||||
|
case PAGE_SIZE_A:
|
||||||
|
plotPage.SetType( wxT( "A" ) );
|
||||||
|
plotPage.SetPortrait( actualPage.IsPortrait() );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PAGE_SIZE_A4:
|
||||||
|
plotPage.SetType( wxT( "A4" ) );
|
||||||
|
plotPage.SetPortrait( actualPage.IsPortrait() );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PAGE_SIZE_AUTO:
|
||||||
|
default:
|
||||||
|
plotPage = actualPage;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
double scalex = (double) plotPage.GetWidthMils() / actualPage.GetWidthMils();
|
||||||
|
double scaley = (double) plotPage.GetHeightMils() / actualPage.GetHeightMils();
|
||||||
|
double scale = MIN( scalex, scaley );
|
||||||
|
plotter->SetViewport( wxPoint( 0, 0 ), IU_PER_DECIMILS, scale, 0 );
|
||||||
|
plotter->SetPageSettings( plotPage );
|
||||||
|
}
|
||||||
|
|
||||||
|
void DIALOG_PLOT_SCHEMATIC_PDF::plotOneSheet( PDF_PLOTTER* plotter,
|
||||||
|
SCH_SCREEN* screen )
|
||||||
|
{
|
||||||
|
if( m_plot_Sheet_Ref )
|
||||||
|
{
|
||||||
|
plotter->SetColor( BLACK );
|
||||||
|
m_Parent->PlotWorkSheet( plotter, screen );
|
||||||
|
}
|
||||||
|
|
||||||
|
screen->Plot( plotter );
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,104 @@
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// C++ code generated with wxFormBuilder (version Nov 17 2010)
|
||||||
|
// http://www.wxformbuilder.org/
|
||||||
|
//
|
||||||
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "dialog_plot_schematic_PDF_base.h"
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
DIALOG_PLOT_SCHEMATIC_PDF_BASE::DIALOG_PLOT_SCHEMATIC_PDF_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
|
||||||
|
{
|
||||||
|
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||||
|
|
||||||
|
wxBoxSizer* bmainSizer;
|
||||||
|
bmainSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
|
wxBoxSizer* bupperSizer;
|
||||||
|
bupperSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
|
wxString m_SizeOptionChoices[] = { _("Schematic size"), _("Force size A4"), _("Force size A") };
|
||||||
|
int m_SizeOptionNChoices = sizeof( m_SizeOptionChoices ) / sizeof( wxString );
|
||||||
|
m_SizeOption = new wxRadioBox( this, wxID_ANY, _("Plot Page Size:"), wxDefaultPosition, wxDefaultSize, m_SizeOptionNChoices, m_SizeOptionChoices, 1, wxRA_SPECIFY_COLS );
|
||||||
|
m_SizeOption->SetSelection( 0 );
|
||||||
|
bupperSizer->Add( m_SizeOption, 1, wxALL, 5 );
|
||||||
|
|
||||||
|
|
||||||
|
bupperSizer->Add( 10, 10, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
wxBoxSizer* sbSizerMiddle;
|
||||||
|
sbSizerMiddle = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
|
wxString m_PlotPDFColorOptionChoices[] = { _("B/W"), _("Color") };
|
||||||
|
int m_PlotPDFColorOptionNChoices = sizeof( m_PlotPDFColorOptionChoices ) / sizeof( wxString );
|
||||||
|
m_PlotPDFColorOption = new wxRadioBox( this, wxID_ANY, _("Plot Mode:"), wxDefaultPosition, wxDefaultSize, m_PlotPDFColorOptionNChoices, m_PlotPDFColorOptionChoices, 1, wxRA_SPECIFY_COLS );
|
||||||
|
m_PlotPDFColorOption->SetSelection( 0 );
|
||||||
|
sbSizerMiddle->Add( m_PlotPDFColorOption, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
m_Plot_Sheet_Ref_Ctrl = new wxCheckBox( this, wxID_ANY, _("Print page references"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
m_Plot_Sheet_Ref_Ctrl->SetValue(true);
|
||||||
|
sbSizerMiddle->Add( m_Plot_Sheet_Ref_Ctrl, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
bupperSizer->Add( sbSizerMiddle, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
|
bupperSizer->Add( 10, 10, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
wxBoxSizer* bbuttonsSizer;
|
||||||
|
bbuttonsSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
|
m_buttonPlotPage = new wxButton( this, wxID_ANY, _("&Plot Page"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
bbuttonsSizer->Add( m_buttonPlotPage, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
m_buttonPlotAll = new wxButton( this, wxID_ANY, _("Plot A&LL"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
bbuttonsSizer->Add( m_buttonPlotAll, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
m_buttonClose = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
bbuttonsSizer->Add( m_buttonClose, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
bupperSizer->Add( bbuttonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||||
|
|
||||||
|
bmainSizer->Add( bupperSizer, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
wxBoxSizer* bSizerLineWidth;
|
||||||
|
bSizerLineWidth = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
|
m_defaultLineWidthTitle = new wxStaticText( this, wxID_ANY, _("Default line width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
m_defaultLineWidthTitle->Wrap( -1 );
|
||||||
|
bSizerLineWidth->Add( m_defaultLineWidthTitle, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||||
|
|
||||||
|
m_DefaultLineSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
bSizerLineWidth->Add( m_DefaultLineSizeCtrl, 1, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||||
|
|
||||||
|
bmainSizer->Add( bSizerLineWidth, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Messages :"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
m_staticText1->Wrap( -1 );
|
||||||
|
bmainSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
|
m_MsgBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
|
||||||
|
m_MsgBox->SetMinSize( wxSize( -1,150 ) );
|
||||||
|
|
||||||
|
bmainSizer->Add( m_MsgBox, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
|
this->SetSizer( bmainSizer );
|
||||||
|
this->Layout();
|
||||||
|
|
||||||
|
this->Centre( wxBOTH );
|
||||||
|
|
||||||
|
// Connect Events
|
||||||
|
m_buttonPlotPage->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_PDF_BASE::OnPlotCurrent ), NULL, this );
|
||||||
|
m_buttonPlotAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_PDF_BASE::OnPlotAll ), NULL, this );
|
||||||
|
m_buttonClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_PDF_BASE::OnCancelClick ), NULL, this );
|
||||||
|
}
|
||||||
|
|
||||||
|
DIALOG_PLOT_SCHEMATIC_PDF_BASE::~DIALOG_PLOT_SCHEMATIC_PDF_BASE()
|
||||||
|
{
|
||||||
|
// Disconnect Events
|
||||||
|
m_buttonPlotPage->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_PDF_BASE::OnPlotCurrent ), NULL, this );
|
||||||
|
m_buttonPlotAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_PDF_BASE::OnPlotAll ), NULL, this );
|
||||||
|
m_buttonClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_PDF_BASE::OnCancelClick ), NULL, this );
|
||||||
|
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,63 @@
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// C++ code generated with wxFormBuilder (version Nov 17 2010)
|
||||||
|
// http://www.wxformbuilder.org/
|
||||||
|
//
|
||||||
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef __dialog_plot_schematic_PDF_base__
|
||||||
|
#define __dialog_plot_schematic_PDF_base__
|
||||||
|
|
||||||
|
#include <wx/intl.h>
|
||||||
|
|
||||||
|
#include <wx/string.h>
|
||||||
|
#include <wx/radiobox.h>
|
||||||
|
#include <wx/gdicmn.h>
|
||||||
|
#include <wx/font.h>
|
||||||
|
#include <wx/colour.h>
|
||||||
|
#include <wx/settings.h>
|
||||||
|
#include <wx/checkbox.h>
|
||||||
|
#include <wx/sizer.h>
|
||||||
|
#include <wx/button.h>
|
||||||
|
#include <wx/stattext.h>
|
||||||
|
#include <wx/textctrl.h>
|
||||||
|
#include <wx/dialog.h>
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// Class DIALOG_PLOT_SCHEMATIC_PDF_BASE
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
class DIALOG_PLOT_SCHEMATIC_PDF_BASE : public wxDialog
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxRadioBox* m_SizeOption;
|
||||||
|
|
||||||
|
wxRadioBox* m_PlotPDFColorOption;
|
||||||
|
wxCheckBox* m_Plot_Sheet_Ref_Ctrl;
|
||||||
|
|
||||||
|
wxButton* m_buttonPlotPage;
|
||||||
|
wxButton* m_buttonPlotAll;
|
||||||
|
wxButton* m_buttonClose;
|
||||||
|
wxStaticText* m_defaultLineWidthTitle;
|
||||||
|
wxTextCtrl* m_DefaultLineSizeCtrl;
|
||||||
|
wxStaticText* m_staticText1;
|
||||||
|
wxTextCtrl* m_MsgBox;
|
||||||
|
|
||||||
|
// Virtual event handlers, overide them in your derived class
|
||||||
|
virtual void OnPlotCurrent( wxCommandEvent& event ) { event.Skip(); }
|
||||||
|
virtual void OnPlotAll( wxCommandEvent& event ) { event.Skip(); }
|
||||||
|
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
DIALOG_PLOT_SCHEMATIC_PDF_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot PDF"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 387,365 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||||
|
~DIALOG_PLOT_SCHEMATIC_PDF_BASE();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //__dialog_plot_schematic_PDF_base__
|
|
@ -237,7 +237,7 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile()
|
||||||
double scalex = (double) plotPage.GetWidthMils() / actualPage.GetWidthMils();
|
double scalex = (double) plotPage.GetWidthMils() / actualPage.GetWidthMils();
|
||||||
double scaley = (double) plotPage.GetHeightMils() / actualPage.GetHeightMils();
|
double scaley = (double) plotPage.GetHeightMils() / actualPage.GetHeightMils();
|
||||||
|
|
||||||
double scale = 10 * MIN( scalex, scaley );
|
double scale = MIN( scalex, scaley );
|
||||||
|
|
||||||
plot_offset.x = 0;
|
plot_offset.x = 0;
|
||||||
plot_offset.y = 0;
|
plot_offset.y = 0;
|
||||||
|
@ -281,24 +281,25 @@ void DIALOG_PLOT_SCHEMATIC_PS::plotOneSheetPS( const wxString& FileName,
|
||||||
|
|
||||||
PS_PLOTTER* plotter = new PS_PLOTTER();
|
PS_PLOTTER* plotter = new PS_PLOTTER();
|
||||||
plotter->SetPageSettings( pageInfo );
|
plotter->SetPageSettings( pageInfo );
|
||||||
plotter->set_viewport( plot_offset, scale, 0 );
|
plotter->SetViewport( plot_offset, IU_PER_DECIMILS, scale, 0 );
|
||||||
plotter->set_default_line_width( g_DrawDefaultLineThickness );
|
plotter->SetDefaultLineWidth( g_DrawDefaultLineThickness );
|
||||||
plotter->set_color_mode( m_plotColorOpt );
|
plotter->SetColorMode( m_plotColorOpt );
|
||||||
|
plotter->SetPsTextMode( PSTEXTMODE_STROKE );
|
||||||
|
|
||||||
// Init :
|
// Init :
|
||||||
plotter->set_creator( wxT( "Eeschema-PS" ) );
|
plotter->SetCreator( wxT( "Eeschema-PS" ) );
|
||||||
plotter->set_filename( FileName );
|
plotter->SetFilename( FileName );
|
||||||
plotter->start_plot( output_file );
|
plotter->StartPlot( output_file );
|
||||||
|
|
||||||
if( m_plot_Sheet_Ref )
|
if( m_plot_Sheet_Ref )
|
||||||
{
|
{
|
||||||
plotter->set_color( BLACK );
|
plotter->SetColor( BLACK );
|
||||||
m_Parent->PlotWorkSheet( plotter, screen );
|
m_Parent->PlotWorkSheet( plotter, screen );
|
||||||
}
|
}
|
||||||
|
|
||||||
screen->Plot( plotter );
|
screen->Plot( plotter );
|
||||||
|
|
||||||
plotter->end_plot();
|
plotter->EndPlot();
|
||||||
delete plotter;
|
delete plotter;
|
||||||
SetLocaleTo_Default();
|
SetLocaleTo_Default();
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
|
|
||||||
#define FR_HISTORY_LIST_CNT 10 ///< Maximum number of find and replace strings.
|
#define FR_HISTORY_LIST_CNT 10 ///< Maximum number of find and replace strings.
|
||||||
|
|
||||||
|
int g_DefaultBusWidth = 9;
|
||||||
|
|
||||||
void LIB_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event )
|
void LIB_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
|
@ -207,6 +208,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
|
||||||
|
|
||||||
dlg.SetUnits( units, g_UserUnit );
|
dlg.SetUnits( units, g_UserUnit );
|
||||||
dlg.SetGridSizes( grid_list, GetScreen()->GetGridId() );
|
dlg.SetGridSizes( grid_list, GetScreen()->GetGridId() );
|
||||||
|
dlg.SetBusWidth( g_DefaultBusWidth );
|
||||||
dlg.SetLineWidth( g_DrawDefaultLineThickness );
|
dlg.SetLineWidth( g_DrawDefaultLineThickness );
|
||||||
dlg.SetTextSize( g_DefaultTextLabelSize );
|
dlg.SetTextSize( g_DefaultTextLabelSize );
|
||||||
dlg.SetRepeatHorizontal( g_RepeatStep.x );
|
dlg.SetRepeatHorizontal( g_RepeatStep.x );
|
||||||
|
@ -240,6 +242,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
|
||||||
|
|
||||||
GetScreen()->SetGrid( grid_list[ (size_t) dlg.GetGridSelection() ].m_Size );
|
GetScreen()->SetGrid( grid_list[ (size_t) dlg.GetGridSelection() ].m_Size );
|
||||||
|
|
||||||
|
g_DefaultBusWidth = dlg.GetBusWidth();
|
||||||
g_DrawDefaultLineThickness = dlg.GetLineWidth();
|
g_DrawDefaultLineThickness = dlg.GetLineWidth();
|
||||||
g_DefaultTextLabelSize = dlg.GetTextSize();
|
g_DefaultTextLabelSize = dlg.GetTextSize();
|
||||||
g_RepeatStep.x = dlg.GetRepeatHorizontal();
|
g_RepeatStep.x = dlg.GetRepeatHorizontal();
|
||||||
|
@ -420,7 +423,7 @@ void SCH_EDIT_FRAME::SaveProjectFile()
|
||||||
wxGetApp().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParameters() );
|
wxGetApp().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParameters() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const wxString DefaultBusWidthEntry( wxT( "DefaultBusWidth" ) );
|
||||||
static const wxString DefaultDrawLineWidthEntry( wxT( "DefaultDrawLineWidth" ) );
|
static const wxString DefaultDrawLineWidthEntry( wxT( "DefaultDrawLineWidth" ) );
|
||||||
static const wxString ShowHiddenPinsEntry( wxT( "ShowHiddenPins" ) );
|
static const wxString ShowHiddenPinsEntry( wxT( "ShowHiddenPins" ) );
|
||||||
static const wxString HorzVertLinesOnlyEntry( wxT( "HorizVertLinesOnly" ) );
|
static const wxString HorzVertLinesOnlyEntry( wxT( "HorizVertLinesOnly" ) );
|
||||||
|
@ -553,6 +556,7 @@ void SCH_EDIT_FRAME::LoadSettings()
|
||||||
// This is required until someone gets rid of the global variable g_LayerDescription().
|
// This is required until someone gets rid of the global variable g_LayerDescription().
|
||||||
m_GridColor = g_LayerDescr.LayerColor[LAYER_GRID];
|
m_GridColor = g_LayerDescr.LayerColor[LAYER_GRID];
|
||||||
|
|
||||||
|
g_DefaultBusWidth = cfg->Read( DefaultBusWidthEntry, (long) 8 );
|
||||||
g_DrawDefaultLineThickness = cfg->Read( DefaultDrawLineWidthEntry,(long) 6 );
|
g_DrawDefaultLineThickness = cfg->Read( DefaultDrawLineWidthEntry,(long) 6 );
|
||||||
cfg->Read( ShowHiddenPinsEntry, &m_showAllPins, false );
|
cfg->Read( ShowHiddenPinsEntry, &m_showAllPins, false );
|
||||||
cfg->Read( HorzVertLinesOnlyEntry, &g_HVLines, true );
|
cfg->Read( HorzVertLinesOnlyEntry, &g_HVLines, true );
|
||||||
|
@ -644,6 +648,7 @@ void SCH_EDIT_FRAME::SaveSettings()
|
||||||
|
|
||||||
wxGetApp().SaveCurrentSetupValues( GetConfigurationSettings() );
|
wxGetApp().SaveCurrentSetupValues( GetConfigurationSettings() );
|
||||||
|
|
||||||
|
cfg->Write( DefaultBusWidthEntry, (long) g_DefaultBusWidth );
|
||||||
cfg->Write( DefaultDrawLineWidthEntry, (long) g_DrawDefaultLineThickness );
|
cfg->Write( DefaultDrawLineWidthEntry, (long) g_DrawDefaultLineThickness );
|
||||||
cfg->Write( ShowHiddenPinsEntry, m_showAllPins );
|
cfg->Write( ShowHiddenPinsEntry, m_showAllPins );
|
||||||
cfg->Write( HorzVertLinesOnlyEntry, g_HVLines );
|
cfg->Write( HorzVertLinesOnlyEntry, g_HVLines );
|
||||||
|
|
|
@ -8,7 +8,10 @@
|
||||||
#define GROUPCOMMON wxT( "/common" )
|
#define GROUPCOMMON wxT( "/common" )
|
||||||
#define GROUPLIB wxT( "libraries" )
|
#define GROUPLIB wxT( "libraries" )
|
||||||
|
|
||||||
extern int g_PenMinWidth;
|
/**
|
||||||
|
* The width given to bus drawings that do not have a specific width
|
||||||
|
*/
|
||||||
|
extern int g_DefaultBusWidth;
|
||||||
|
|
||||||
/* saving parameters option : */
|
/* saving parameters option : */
|
||||||
#define INSETUP true /* used when the parameter is saved in general config
|
#define INSETUP true /* used when the parameter is saved in general config
|
||||||
|
|
1550
eeschema/lib_arc.cpp
1550
eeschema/lib_arc.cpp
File diff suppressed because it is too large
Load Diff
|
@ -270,12 +270,12 @@ void LIB_BEZIER::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
||||||
|
|
||||||
if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR )
|
if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR )
|
||||||
{
|
{
|
||||||
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
aPlotter->SetColor( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
||||||
aPlotter->PlotPoly( cornerList, FILLED_WITH_BG_BODYCOLOR, 0 );
|
aPlotter->PlotPoly( cornerList, FILLED_WITH_BG_BODYCOLOR, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
|
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
|
||||||
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE ) );
|
aPlotter->SetColor( ReturnLayerColor( LAYER_DEVICE ) );
|
||||||
aPlotter->PlotPoly( cornerList, already_filled ? NO_FILL : m_Fill, GetPenSize() );
|
aPlotter->PlotPoly( cornerList, already_filled ? NO_FILL : m_Fill, GetPenSize() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,355 +1,355 @@
|
||||||
/*
|
/*
|
||||||
* 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) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||||
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2011 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
|
||||||
* as published by the Free Software Foundation; either version 2
|
* as published by the Free Software Foundation; either version 2
|
||||||
* of the License, or (at your option) any later version.
|
* of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, you may find one here:
|
* along with this program; if not, you may find one here:
|
||||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||||
* or you may write to the Free Software Foundation, Inc.,
|
* or you may write to the Free Software Foundation, Inc.,
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file lib_circle.cpp
|
* @file lib_circle.cpp
|
||||||
* @brief LIB_CIRCLE class implementation.
|
* @brief LIB_CIRCLE class implementation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <fctsys.h>
|
#include <fctsys.h>
|
||||||
#include <gr_basic.h>
|
#include <gr_basic.h>
|
||||||
#include <macros.h>
|
#include <macros.h>
|
||||||
#include <class_drawpanel.h>
|
#include <class_drawpanel.h>
|
||||||
#include <plot_common.h>
|
#include <plot_common.h>
|
||||||
#include <trigo.h>
|
#include <trigo.h>
|
||||||
#include <wxstruct.h>
|
#include <wxstruct.h>
|
||||||
#include <richio.h>
|
#include <richio.h>
|
||||||
#include <base_units.h>
|
#include <base_units.h>
|
||||||
|
|
||||||
#include <general.h>
|
#include <general.h>
|
||||||
#include <protos.h>
|
#include <protos.h>
|
||||||
#include <lib_circle.h>
|
#include <lib_circle.h>
|
||||||
#include <transform.h>
|
#include <transform.h>
|
||||||
|
|
||||||
|
|
||||||
LIB_CIRCLE::LIB_CIRCLE( LIB_COMPONENT* aParent ) :
|
LIB_CIRCLE::LIB_CIRCLE( LIB_COMPONENT* aParent ) :
|
||||||
LIB_ITEM( LIB_CIRCLE_T, aParent )
|
LIB_ITEM( LIB_CIRCLE_T, aParent )
|
||||||
{
|
{
|
||||||
m_Radius = 0;
|
m_Radius = 0;
|
||||||
m_Width = 0;
|
m_Width = 0;
|
||||||
m_Fill = NO_FILL;
|
m_Fill = NO_FILL;
|
||||||
m_isFillable = true;
|
m_isFillable = true;
|
||||||
m_typeName = _( "Circle" );
|
m_typeName = _( "Circle" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_CIRCLE::Save( OUTPUTFORMATTER& aFormatter )
|
bool LIB_CIRCLE::Save( OUTPUTFORMATTER& aFormatter )
|
||||||
{
|
{
|
||||||
aFormatter.Print( 0, "C %d %d %d %d %d %d %c\n", m_Pos.x, m_Pos.y,
|
aFormatter.Print( 0, "C %d %d %d %d %d %d %c\n", m_Pos.x, m_Pos.y,
|
||||||
m_Radius, m_Unit, m_Convert, m_Width, fill_tab[m_Fill] );
|
m_Radius, m_Unit, m_Convert, m_Width, fill_tab[m_Fill] );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_CIRCLE::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
|
bool LIB_CIRCLE::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
|
||||||
{
|
{
|
||||||
char tmp[256];
|
char tmp[256];
|
||||||
char* line = (char*) aLineReader;
|
char* line = (char*) aLineReader;
|
||||||
|
|
||||||
int cnt = sscanf( line + 2, "%d %d %d %d %d %d %s", &m_Pos.x, &m_Pos.y,
|
int cnt = sscanf( line + 2, "%d %d %d %d %d %d %s", &m_Pos.x, &m_Pos.y,
|
||||||
&m_Radius, &m_Unit, &m_Convert, &m_Width, tmp );
|
&m_Radius, &m_Unit, &m_Convert, &m_Width, tmp );
|
||||||
|
|
||||||
if( cnt < 6 )
|
if( cnt < 6 )
|
||||||
{
|
{
|
||||||
aErrorMsg.Printf( _( "circle only had %d parameters of the required 6" ), cnt );
|
aErrorMsg.Printf( _( "circle only had %d parameters of the required 6" ), cnt );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( tmp[0] == 'F' )
|
if( tmp[0] == 'F' )
|
||||||
m_Fill = FILLED_SHAPE;
|
m_Fill = FILLED_SHAPE;
|
||||||
|
|
||||||
if( tmp[0] == 'f' )
|
if( tmp[0] == 'f' )
|
||||||
m_Fill = FILLED_WITH_BG_BODYCOLOR;
|
m_Fill = FILLED_WITH_BG_BODYCOLOR;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_CIRCLE::HitTest( const wxPoint& aPosRef )
|
bool LIB_CIRCLE::HitTest( const wxPoint& aPosRef )
|
||||||
{
|
{
|
||||||
int mindist = GetPenSize() / 2;
|
int mindist = GetPenSize() / 2;
|
||||||
|
|
||||||
// Have a minimal tolerance for hit test
|
// Have a minimal tolerance for hit test
|
||||||
if( mindist < MINIMUM_SELECTION_DISTANCE )
|
if( mindist < MINIMUM_SELECTION_DISTANCE )
|
||||||
mindist = MINIMUM_SELECTION_DISTANCE;
|
mindist = MINIMUM_SELECTION_DISTANCE;
|
||||||
|
|
||||||
return HitTest( aPosRef, mindist, DefaultTransform );
|
return HitTest( aPosRef, mindist, DefaultTransform );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_CIRCLE::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform )
|
bool LIB_CIRCLE::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform )
|
||||||
{
|
{
|
||||||
if( aThreshold < 0 )
|
if( aThreshold < 0 )
|
||||||
aThreshold = GetPenSize() / 2;
|
aThreshold = GetPenSize() / 2;
|
||||||
|
|
||||||
wxPoint relpos = aPosRef - aTransform.TransformCoordinate( m_Pos );
|
wxPoint relpos = aPosRef - aTransform.TransformCoordinate( m_Pos );
|
||||||
|
|
||||||
int dist = KiROUND( sqrt( ( (double) relpos.x * relpos.x ) +
|
int dist = KiROUND( sqrt( ( (double) relpos.x * relpos.x ) +
|
||||||
( (double) relpos.y * relpos.y ) ) );
|
( (double) relpos.y * relpos.y ) ) );
|
||||||
|
|
||||||
if( abs( dist - m_Radius ) <= aThreshold )
|
if( abs( dist - m_Radius ) <= aThreshold )
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EDA_ITEM* LIB_CIRCLE::Clone() const
|
EDA_ITEM* LIB_CIRCLE::Clone() const
|
||||||
{
|
{
|
||||||
return new LIB_CIRCLE( *this );
|
return new LIB_CIRCLE( *this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int LIB_CIRCLE::compare( const LIB_ITEM& aOther ) const
|
int LIB_CIRCLE::compare( const LIB_ITEM& aOther ) const
|
||||||
{
|
{
|
||||||
wxASSERT( aOther.Type() == LIB_CIRCLE_T );
|
wxASSERT( aOther.Type() == LIB_CIRCLE_T );
|
||||||
|
|
||||||
const LIB_CIRCLE* tmp = ( LIB_CIRCLE* ) &aOther;
|
const LIB_CIRCLE* tmp = ( LIB_CIRCLE* ) &aOther;
|
||||||
|
|
||||||
if( m_Pos.x != tmp->m_Pos.x )
|
if( m_Pos.x != tmp->m_Pos.x )
|
||||||
return m_Pos.x - tmp->m_Pos.x;
|
return m_Pos.x - tmp->m_Pos.x;
|
||||||
|
|
||||||
if( m_Pos.y != tmp->m_Pos.y )
|
if( m_Pos.y != tmp->m_Pos.y )
|
||||||
return m_Pos.y - tmp->m_Pos.y;
|
return m_Pos.y - tmp->m_Pos.y;
|
||||||
|
|
||||||
if( m_Radius != tmp->m_Radius )
|
if( m_Radius != tmp->m_Radius )
|
||||||
return m_Radius - tmp->m_Radius;
|
return m_Radius - tmp->m_Radius;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_CIRCLE::SetOffset( const wxPoint& aOffset )
|
void LIB_CIRCLE::SetOffset( const wxPoint& aOffset )
|
||||||
{
|
{
|
||||||
m_Pos += aOffset;
|
m_Pos += aOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_CIRCLE::Inside( EDA_RECT& aRect ) const
|
bool LIB_CIRCLE::Inside( EDA_RECT& aRect ) const
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* FIXME: This fails to take into account the radius around the center
|
* FIXME: This fails to take into account the radius around the center
|
||||||
* point.
|
* point.
|
||||||
*/
|
*/
|
||||||
return aRect.Contains( m_Pos.x, -m_Pos.y );
|
return aRect.Contains( m_Pos.x, -m_Pos.y );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_CIRCLE::Move( const wxPoint& aPosition )
|
void LIB_CIRCLE::Move( const wxPoint& aPosition )
|
||||||
{
|
{
|
||||||
m_Pos = aPosition;
|
m_Pos = aPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_CIRCLE::MirrorHorizontal( const wxPoint& aCenter )
|
void LIB_CIRCLE::MirrorHorizontal( const wxPoint& aCenter )
|
||||||
{
|
{
|
||||||
m_Pos.x -= aCenter.x;
|
m_Pos.x -= aCenter.x;
|
||||||
m_Pos.x *= -1;
|
m_Pos.x *= -1;
|
||||||
m_Pos.x += aCenter.x;
|
m_Pos.x += aCenter.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_CIRCLE::MirrorVertical( const wxPoint& aCenter )
|
void LIB_CIRCLE::MirrorVertical( const wxPoint& aCenter )
|
||||||
{
|
{
|
||||||
m_Pos.y -= aCenter.y;
|
m_Pos.y -= aCenter.y;
|
||||||
m_Pos.y *= -1;
|
m_Pos.y *= -1;
|
||||||
m_Pos.y += aCenter.y;
|
m_Pos.y += aCenter.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_CIRCLE::Rotate( const wxPoint& aCenter, bool aRotateCCW )
|
void LIB_CIRCLE::Rotate( const wxPoint& aCenter, bool aRotateCCW )
|
||||||
{
|
{
|
||||||
int rot_angle = aRotateCCW ? -900 : 900;
|
int rot_angle = aRotateCCW ? -900 : 900;
|
||||||
|
|
||||||
RotatePoint( &m_Pos, aCenter, rot_angle );
|
RotatePoint( &m_Pos, aCenter, rot_angle );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_CIRCLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
void LIB_CIRCLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
||||||
const TRANSFORM& aTransform )
|
const TRANSFORM& aTransform )
|
||||||
{
|
{
|
||||||
wxPoint pos = aTransform.TransformCoordinate( m_Pos ) + aOffset;
|
wxPoint pos = aTransform.TransformCoordinate( m_Pos ) + aOffset;
|
||||||
|
|
||||||
if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR )
|
if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR )
|
||||||
{
|
{
|
||||||
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
aPlotter->SetColor( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
||||||
aPlotter->circle( pos, m_Radius * 2, FILLED_SHAPE, 0 );
|
aPlotter->Circle( pos, m_Radius * 2, FILLED_SHAPE, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
|
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
|
||||||
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE ) );
|
aPlotter->SetColor( ReturnLayerColor( LAYER_DEVICE ) );
|
||||||
aPlotter->circle( pos, m_Radius * 2, already_filled ? NO_FILL : m_Fill, GetPenSize() );
|
aPlotter->Circle( pos, m_Radius * 2, already_filled ? NO_FILL : m_Fill, GetPenSize() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int LIB_CIRCLE::GetPenSize() const
|
int LIB_CIRCLE::GetPenSize() const
|
||||||
{
|
{
|
||||||
return ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width;
|
return ( m_Width == 0 ) ? g_DrawDefaultLineThickness : m_Width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_CIRCLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
void LIB_CIRCLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
||||||
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform )
|
int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform )
|
||||||
{
|
{
|
||||||
wxPoint pos1;
|
wxPoint pos1;
|
||||||
|
|
||||||
int color = ReturnLayerColor( LAYER_DEVICE );
|
int color = ReturnLayerColor( LAYER_DEVICE );
|
||||||
|
|
||||||
if( aColor < 0 ) // Used normal color or selected color
|
if( aColor < 0 ) // Used normal color or selected color
|
||||||
{
|
{
|
||||||
if( IsSelected() )
|
if( IsSelected() )
|
||||||
color = g_ItemSelectetColor;
|
color = g_ItemSelectetColor;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
color = aColor;
|
color = aColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
pos1 = aTransform.TransformCoordinate( m_Pos ) + aOffset;
|
pos1 = aTransform.TransformCoordinate( m_Pos ) + aOffset;
|
||||||
GRSetDrawMode( aDC, aDrawMode );
|
GRSetDrawMode( aDC, aDrawMode );
|
||||||
|
|
||||||
FILL_T fill = aData ? NO_FILL : m_Fill;
|
FILL_T fill = aData ? NO_FILL : m_Fill;
|
||||||
if( aColor >= 0 )
|
if( aColor >= 0 )
|
||||||
fill = NO_FILL;
|
fill = NO_FILL;
|
||||||
|
|
||||||
if( fill == FILLED_WITH_BG_BODYCOLOR )
|
if( fill == FILLED_WITH_BG_BODYCOLOR )
|
||||||
GRFilledCircle( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, m_Radius, GetPenSize(),
|
GRFilledCircle( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, m_Radius, GetPenSize(),
|
||||||
(m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ),
|
(m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ),
|
||||||
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
||||||
else if( fill == FILLED_SHAPE )
|
else if( fill == FILLED_SHAPE )
|
||||||
GRFilledCircle( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, m_Radius, 0, color, color );
|
GRFilledCircle( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, m_Radius, 0, color, color );
|
||||||
else
|
else
|
||||||
GRCircle( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, m_Radius, GetPenSize(), color );
|
GRCircle( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, m_Radius, GetPenSize(), color );
|
||||||
|
|
||||||
/* Set to one (1) to draw bounding box around circle to validate bounding
|
/* Set to one (1) to draw bounding box around circle to validate bounding
|
||||||
* box calculation. */
|
* box calculation. */
|
||||||
#if 0
|
#if 0
|
||||||
EDA_RECT bBox = GetBoundingBox();
|
EDA_RECT bBox = GetBoundingBox();
|
||||||
GRRect( aPanel->GetClipBox(), aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
|
GRRect( aPanel->GetClipBox(), aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
|
||||||
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
|
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EDA_RECT LIB_CIRCLE::GetBoundingBox() const
|
EDA_RECT LIB_CIRCLE::GetBoundingBox() const
|
||||||
{
|
{
|
||||||
EDA_RECT rect;
|
EDA_RECT rect;
|
||||||
|
|
||||||
rect.SetOrigin( m_Pos.x - m_Radius, ( m_Pos.y - m_Radius ) * -1 );
|
rect.SetOrigin( m_Pos.x - m_Radius, ( m_Pos.y - m_Radius ) * -1 );
|
||||||
rect.SetEnd( m_Pos.x + m_Radius, ( m_Pos.y + m_Radius ) * -1 );
|
rect.SetEnd( m_Pos.x + m_Radius, ( m_Pos.y + m_Radius ) * -1 );
|
||||||
rect.Inflate( m_Width / 2, m_Width / 2 );
|
rect.Inflate( m_Width / 2, m_Width / 2 );
|
||||||
|
|
||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_CIRCLE::DisplayInfo( EDA_DRAW_FRAME* aFrame )
|
void LIB_CIRCLE::DisplayInfo( EDA_DRAW_FRAME* aFrame )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
EDA_RECT bBox = GetBoundingBox();
|
EDA_RECT bBox = GetBoundingBox();
|
||||||
|
|
||||||
LIB_ITEM::DisplayInfo( aFrame );
|
LIB_ITEM::DisplayInfo( aFrame );
|
||||||
|
|
||||||
msg = ReturnStringFromValue( g_UserUnit, m_Width, true );
|
msg = ReturnStringFromValue( g_UserUnit, m_Width, true );
|
||||||
|
|
||||||
aFrame->AppendMsgPanel( _( "Line width" ), msg, BLUE );
|
aFrame->AppendMsgPanel( _( "Line width" ), msg, BLUE );
|
||||||
|
|
||||||
msg = ReturnStringFromValue( g_UserUnit, m_Radius, true );
|
msg = ReturnStringFromValue( g_UserUnit, m_Radius, true );
|
||||||
aFrame->AppendMsgPanel( _( "Radius" ), msg, RED );
|
aFrame->AppendMsgPanel( _( "Radius" ), msg, RED );
|
||||||
|
|
||||||
msg.Printf( wxT( "(%d, %d, %d, %d)" ), bBox.GetOrigin().x,
|
msg.Printf( wxT( "(%d, %d, %d, %d)" ), bBox.GetOrigin().x,
|
||||||
bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y );
|
bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y );
|
||||||
|
|
||||||
aFrame->AppendMsgPanel( _( "Bounding box" ), msg, BROWN );
|
aFrame->AppendMsgPanel( _( "Bounding box" ), msg, BROWN );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wxString LIB_CIRCLE::GetSelectMenuText() const
|
wxString LIB_CIRCLE::GetSelectMenuText() const
|
||||||
{
|
{
|
||||||
return wxString::Format( _( "Circle center (%s, %s), radius %s" ),
|
return wxString::Format( _( "Circle center (%s, %s), radius %s" ),
|
||||||
GetChars( CoordinateToString( m_Pos.x ) ),
|
GetChars( CoordinateToString( m_Pos.x ) ),
|
||||||
GetChars( CoordinateToString( m_Pos.y ) ),
|
GetChars( CoordinateToString( m_Pos.y ) ),
|
||||||
GetChars( CoordinateToString( m_Radius ) ) );
|
GetChars( CoordinateToString( m_Radius ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_CIRCLE::BeginEdit( int aEditMode, const wxPoint aPosition )
|
void LIB_CIRCLE::BeginEdit( int aEditMode, const wxPoint aPosition )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( ( aEditMode & ( IS_NEW | IS_MOVED | IS_RESIZED ) ) != 0,
|
wxCHECK_RET( ( aEditMode & ( IS_NEW | IS_MOVED | IS_RESIZED ) ) != 0,
|
||||||
wxT( "Invalid edit mode for LIB_CIRCLE object." ) );
|
wxT( "Invalid edit mode for LIB_CIRCLE object." ) );
|
||||||
|
|
||||||
if( aEditMode == IS_NEW )
|
if( aEditMode == IS_NEW )
|
||||||
{
|
{
|
||||||
m_Pos = m_initialPos = aPosition;
|
m_Pos = m_initialPos = aPosition;
|
||||||
}
|
}
|
||||||
else if( aEditMode == IS_MOVED )
|
else if( aEditMode == IS_MOVED )
|
||||||
{
|
{
|
||||||
m_initialPos = m_Pos;
|
m_initialPos = m_Pos;
|
||||||
m_initialCursorPos = aPosition;
|
m_initialCursorPos = aPosition;
|
||||||
SetEraseLastDrawItem();
|
SetEraseLastDrawItem();
|
||||||
}
|
}
|
||||||
else if( aEditMode == IS_RESIZED )
|
else if( aEditMode == IS_RESIZED )
|
||||||
{
|
{
|
||||||
SetEraseLastDrawItem();
|
SetEraseLastDrawItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Flags = aEditMode;
|
m_Flags = aEditMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_CIRCLE::ContinueEdit( const wxPoint aPosition )
|
bool LIB_CIRCLE::ContinueEdit( const wxPoint aPosition )
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( ( m_Flags & ( IS_NEW | IS_MOVED | IS_RESIZED ) ) != 0, false,
|
wxCHECK_MSG( ( m_Flags & ( IS_NEW | IS_MOVED | IS_RESIZED ) ) != 0, false,
|
||||||
wxT( "Bad call to ContinueEdit(). LIB_CIRCLE is not being edited." ) );
|
wxT( "Bad call to ContinueEdit(). LIB_CIRCLE is not being edited." ) );
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_CIRCLE::EndEdit( const wxPoint& aPosition, bool aAbort )
|
void LIB_CIRCLE::EndEdit( const wxPoint& aPosition, bool aAbort )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( ( m_Flags & ( IS_NEW | IS_MOVED | IS_RESIZED ) ) != 0,
|
wxCHECK_RET( ( m_Flags & ( IS_NEW | IS_MOVED | IS_RESIZED ) ) != 0,
|
||||||
wxT( "Bad call to EndEdit(). LIB_CIRCLE is not being edited." ) );
|
wxT( "Bad call to EndEdit(). LIB_CIRCLE is not being edited." ) );
|
||||||
|
|
||||||
SetEraseLastDrawItem( false );
|
SetEraseLastDrawItem( false );
|
||||||
m_Flags = 0;
|
m_Flags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_CIRCLE::calcEdit( const wxPoint& aPosition )
|
void LIB_CIRCLE::calcEdit( const wxPoint& aPosition )
|
||||||
{
|
{
|
||||||
if( m_Flags == IS_NEW || m_Flags == IS_RESIZED )
|
if( m_Flags == IS_NEW || m_Flags == IS_RESIZED )
|
||||||
{
|
{
|
||||||
if( m_Flags == IS_NEW )
|
if( m_Flags == IS_NEW )
|
||||||
SetEraseLastDrawItem();
|
SetEraseLastDrawItem();
|
||||||
|
|
||||||
int dx = m_Pos.x - aPosition.x;
|
int dx = m_Pos.x - aPosition.x;
|
||||||
int dy = m_Pos.y - aPosition.y;
|
int dy = m_Pos.y - aPosition.y;
|
||||||
m_Radius = KiROUND( sqrt( ( (double) dx * dx ) + ( (double) dy * dy ) ) );
|
m_Radius = KiROUND( sqrt( ( (double) dx * dx ) + ( (double) dy * dy ) ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Move( m_initialPos + aPosition - m_initialCursorPos );
|
Move( m_initialPos + aPosition - m_initialCursorPos );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1275,7 +1275,7 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie
|
||||||
|
|
||||||
color = ReturnLayerColor( LAYER_PIN );
|
color = ReturnLayerColor( LAYER_PIN );
|
||||||
|
|
||||||
aPlotter->set_color( color );
|
aPlotter->SetColor( color );
|
||||||
|
|
||||||
MapX1 = MapY1 = 0;
|
MapX1 = MapY1 = 0;
|
||||||
x1 = aPosition.x; y1 = aPosition.y;
|
x1 = aPosition.x; y1 = aPosition.y;
|
||||||
|
@ -1305,35 +1305,35 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie
|
||||||
|
|
||||||
if( m_shape & INVERT )
|
if( m_shape & INVERT )
|
||||||
{
|
{
|
||||||
aPlotter->circle( wxPoint( MapX1 * INVERT_PIN_RADIUS + x1,
|
aPlotter->Circle( wxPoint( MapX1 * INVERT_PIN_RADIUS + x1,
|
||||||
MapY1 * INVERT_PIN_RADIUS + y1 ),
|
MapY1 * INVERT_PIN_RADIUS + y1 ),
|
||||||
INVERT_PIN_RADIUS * 2, // diameter
|
INVERT_PIN_RADIUS * 2, // diameter
|
||||||
NO_FILL, // fill
|
NO_FILL, // fill
|
||||||
-1 ); // width
|
-1 ); // width
|
||||||
|
|
||||||
aPlotter->move_to( wxPoint( MapX1 * INVERT_PIN_RADIUS * 2 + x1,
|
aPlotter->MoveTo( wxPoint( MapX1 * INVERT_PIN_RADIUS * 2 + x1,
|
||||||
MapY1 * INVERT_PIN_RADIUS * 2 + y1 ) );
|
MapY1 * INVERT_PIN_RADIUS * 2 + y1 ) );
|
||||||
aPlotter->finish_to( aPosition );
|
aPlotter->FinishTo( aPosition );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aPlotter->move_to( wxPoint( x1, y1 ) );
|
aPlotter->MoveTo( wxPoint( x1, y1 ) );
|
||||||
aPlotter->finish_to( aPosition );
|
aPlotter->FinishTo( aPosition );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_shape & CLOCK )
|
if( m_shape & CLOCK )
|
||||||
{
|
{
|
||||||
if( MapY1 == 0 ) /* MapX1 = +- 1 */
|
if( MapY1 == 0 ) /* MapX1 = +- 1 */
|
||||||
{
|
{
|
||||||
aPlotter->move_to( wxPoint( x1, y1 + CLOCK_PIN_DIM ) );
|
aPlotter->MoveTo( wxPoint( x1, y1 + CLOCK_PIN_DIM ) );
|
||||||
aPlotter->line_to( wxPoint( x1 - MapX1 * CLOCK_PIN_DIM, y1 ) );
|
aPlotter->LineTo( wxPoint( x1 - MapX1 * CLOCK_PIN_DIM, y1 ) );
|
||||||
aPlotter->finish_to( wxPoint( x1, y1 - CLOCK_PIN_DIM ) );
|
aPlotter->FinishTo( wxPoint( x1, y1 - CLOCK_PIN_DIM ) );
|
||||||
}
|
}
|
||||||
else /* MapX1 = 0 */
|
else /* MapX1 = 0 */
|
||||||
{
|
{
|
||||||
aPlotter->move_to( wxPoint( x1 + CLOCK_PIN_DIM, y1 ) );
|
aPlotter->MoveTo( wxPoint( x1 + CLOCK_PIN_DIM, y1 ) );
|
||||||
aPlotter->line_to( wxPoint( x1, y1 - MapY1 * CLOCK_PIN_DIM ) );
|
aPlotter->LineTo( wxPoint( x1, y1 - MapY1 * CLOCK_PIN_DIM ) );
|
||||||
aPlotter->finish_to( wxPoint( x1 - CLOCK_PIN_DIM, y1 ) );
|
aPlotter->FinishTo( wxPoint( x1 - CLOCK_PIN_DIM, y1 ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1341,17 +1341,17 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie
|
||||||
{
|
{
|
||||||
if( MapY1 == 0 ) /* MapX1 = +- 1 */
|
if( MapY1 == 0 ) /* MapX1 = +- 1 */
|
||||||
{
|
{
|
||||||
aPlotter->move_to( wxPoint( x1 + MapX1 * IEEE_SYMBOL_PIN_DIM * 2, y1 ) );
|
aPlotter->MoveTo( wxPoint( x1 + MapX1 * IEEE_SYMBOL_PIN_DIM * 2, y1 ) );
|
||||||
aPlotter->line_to( wxPoint( x1 + MapX1 * IEEE_SYMBOL_PIN_DIM * 2,
|
aPlotter->LineTo( wxPoint( x1 + MapX1 * IEEE_SYMBOL_PIN_DIM * 2,
|
||||||
y1 - IEEE_SYMBOL_PIN_DIM ) );
|
y1 - IEEE_SYMBOL_PIN_DIM ) );
|
||||||
aPlotter->finish_to( wxPoint( x1, y1 ) );
|
aPlotter->FinishTo( wxPoint( x1, y1 ) );
|
||||||
}
|
}
|
||||||
else /* MapX1 = 0 */
|
else /* MapX1 = 0 */
|
||||||
{
|
{
|
||||||
aPlotter->move_to( wxPoint( x1, y1 + MapY1 * IEEE_SYMBOL_PIN_DIM * 2 ) );
|
aPlotter->MoveTo( wxPoint( x1, y1 + MapY1 * IEEE_SYMBOL_PIN_DIM * 2 ) );
|
||||||
aPlotter->line_to( wxPoint( x1 - IEEE_SYMBOL_PIN_DIM,
|
aPlotter->LineTo( wxPoint( x1 - IEEE_SYMBOL_PIN_DIM,
|
||||||
y1 + MapY1 * IEEE_SYMBOL_PIN_DIM * 2 ) );
|
y1 + MapY1 * IEEE_SYMBOL_PIN_DIM * 2 ) );
|
||||||
aPlotter->finish_to( wxPoint( x1, y1 ) );
|
aPlotter->FinishTo( wxPoint( x1, y1 ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1360,13 +1360,13 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie
|
||||||
{
|
{
|
||||||
if( MapY1 == 0 ) /* MapX1 = +- 1 */
|
if( MapY1 == 0 ) /* MapX1 = +- 1 */
|
||||||
{
|
{
|
||||||
aPlotter->move_to( wxPoint( x1, y1 - IEEE_SYMBOL_PIN_DIM ) );
|
aPlotter->MoveTo( wxPoint( x1, y1 - IEEE_SYMBOL_PIN_DIM ) );
|
||||||
aPlotter->finish_to( wxPoint( x1 + MapX1 * IEEE_SYMBOL_PIN_DIM * 2, y1 ) );
|
aPlotter->FinishTo( wxPoint( x1 + MapX1 * IEEE_SYMBOL_PIN_DIM * 2, y1 ) );
|
||||||
}
|
}
|
||||||
else /* MapX1 = 0 */
|
else /* MapX1 = 0 */
|
||||||
{
|
{
|
||||||
aPlotter->move_to( wxPoint( x1 - IEEE_SYMBOL_PIN_DIM, y1 ) );
|
aPlotter->MoveTo( wxPoint( x1 - IEEE_SYMBOL_PIN_DIM, y1 ) );
|
||||||
aPlotter->finish_to( wxPoint( x1, y1 + MapY1 * IEEE_SYMBOL_PIN_DIM * 2 ) );
|
aPlotter->FinishTo( wxPoint( x1, y1 + MapY1 * IEEE_SYMBOL_PIN_DIM * 2 ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1427,7 +1427,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter,
|
||||||
if( orient == PIN_RIGHT )
|
if( orient == PIN_RIGHT )
|
||||||
{
|
{
|
||||||
x = x1 + TextInside;
|
x = x1 + TextInside;
|
||||||
plotter->text( wxPoint( x, y1 ), NameColor,
|
plotter->Text( wxPoint( x, y1 ), NameColor,
|
||||||
m_name,
|
m_name,
|
||||||
TEXT_ORIENT_HORIZ,
|
TEXT_ORIENT_HORIZ,
|
||||||
PinNameSize,
|
PinNameSize,
|
||||||
|
@ -1440,7 +1440,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter,
|
||||||
x = x1 - TextInside;
|
x = x1 - TextInside;
|
||||||
|
|
||||||
if( DrawPinName )
|
if( DrawPinName )
|
||||||
plotter->text( wxPoint( x, y1 ),
|
plotter->Text( wxPoint( x, y1 ),
|
||||||
NameColor, m_name, TEXT_ORIENT_HORIZ,
|
NameColor, m_name, TEXT_ORIENT_HORIZ,
|
||||||
PinNameSize,
|
PinNameSize,
|
||||||
GR_TEXT_HJUSTIFY_RIGHT,
|
GR_TEXT_HJUSTIFY_RIGHT,
|
||||||
|
@ -1450,7 +1450,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter,
|
||||||
}
|
}
|
||||||
if( DrawPinNum )
|
if( DrawPinNum )
|
||||||
{
|
{
|
||||||
plotter->text( wxPoint( (x1 + pin_pos.x) / 2, y1 - TXTMARGE ),
|
plotter->Text( wxPoint( (x1 + pin_pos.x) / 2, y1 - TXTMARGE ),
|
||||||
NumColor, StringPinNum,
|
NumColor, StringPinNum,
|
||||||
TEXT_ORIENT_HORIZ, PinNumSize,
|
TEXT_ORIENT_HORIZ, PinNumSize,
|
||||||
GR_TEXT_HJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER,
|
||||||
|
@ -1465,7 +1465,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter,
|
||||||
y = y1 + TextInside;
|
y = y1 + TextInside;
|
||||||
|
|
||||||
if( DrawPinName )
|
if( DrawPinName )
|
||||||
plotter->text( wxPoint( x1, y ), NameColor,
|
plotter->Text( wxPoint( x1, y ), NameColor,
|
||||||
m_name,
|
m_name,
|
||||||
TEXT_ORIENT_VERT, PinNameSize,
|
TEXT_ORIENT_VERT, PinNameSize,
|
||||||
GR_TEXT_HJUSTIFY_RIGHT,
|
GR_TEXT_HJUSTIFY_RIGHT,
|
||||||
|
@ -1474,7 +1474,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter,
|
||||||
|
|
||||||
if( DrawPinNum )
|
if( DrawPinNum )
|
||||||
{
|
{
|
||||||
plotter->text( wxPoint( x1 - TXTMARGE, (y1 + pin_pos.y) / 2 ),
|
plotter->Text( wxPoint( x1 - TXTMARGE, (y1 + pin_pos.y) / 2 ),
|
||||||
NumColor, StringPinNum,
|
NumColor, StringPinNum,
|
||||||
TEXT_ORIENT_VERT, PinNumSize,
|
TEXT_ORIENT_VERT, PinNumSize,
|
||||||
GR_TEXT_HJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER,
|
||||||
|
@ -1487,7 +1487,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter,
|
||||||
y = y1 - TextInside;
|
y = y1 - TextInside;
|
||||||
|
|
||||||
if( DrawPinName )
|
if( DrawPinName )
|
||||||
plotter->text( wxPoint( x1, y ), NameColor,
|
plotter->Text( wxPoint( x1, y ), NameColor,
|
||||||
m_name,
|
m_name,
|
||||||
TEXT_ORIENT_VERT, PinNameSize,
|
TEXT_ORIENT_VERT, PinNameSize,
|
||||||
GR_TEXT_HJUSTIFY_LEFT,
|
GR_TEXT_HJUSTIFY_LEFT,
|
||||||
|
@ -1496,7 +1496,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter,
|
||||||
|
|
||||||
if( DrawPinNum )
|
if( DrawPinNum )
|
||||||
{
|
{
|
||||||
plotter->text( wxPoint( x1 - TXTMARGE, (y1 + pin_pos.y) / 2 ),
|
plotter->Text( wxPoint( x1 - TXTMARGE, (y1 + pin_pos.y) / 2 ),
|
||||||
NumColor, StringPinNum,
|
NumColor, StringPinNum,
|
||||||
TEXT_ORIENT_VERT, PinNumSize,
|
TEXT_ORIENT_VERT, PinNumSize,
|
||||||
GR_TEXT_HJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER,
|
||||||
|
@ -1514,7 +1514,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter,
|
||||||
if( DrawPinName )
|
if( DrawPinName )
|
||||||
{
|
{
|
||||||
x = (x1 + pin_pos.x) / 2;
|
x = (x1 + pin_pos.x) / 2;
|
||||||
plotter->text( wxPoint( x, y1 - TXTMARGE ),
|
plotter->Text( wxPoint( x, y1 - TXTMARGE ),
|
||||||
NameColor, m_name,
|
NameColor, m_name,
|
||||||
TEXT_ORIENT_HORIZ, PinNameSize,
|
TEXT_ORIENT_HORIZ, PinNameSize,
|
||||||
GR_TEXT_HJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER,
|
||||||
|
@ -1525,7 +1525,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter,
|
||||||
if( DrawPinNum )
|
if( DrawPinNum )
|
||||||
{
|
{
|
||||||
x = ( x1 + pin_pos.x ) / 2;
|
x = ( x1 + pin_pos.x ) / 2;
|
||||||
plotter->text( wxPoint( x, y1 + TXTMARGE ),
|
plotter->Text( wxPoint( x, y1 + TXTMARGE ),
|
||||||
NumColor, StringPinNum,
|
NumColor, StringPinNum,
|
||||||
TEXT_ORIENT_HORIZ, PinNumSize,
|
TEXT_ORIENT_HORIZ, PinNumSize,
|
||||||
GR_TEXT_HJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER,
|
||||||
|
@ -1538,7 +1538,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter,
|
||||||
if( DrawPinName )
|
if( DrawPinName )
|
||||||
{
|
{
|
||||||
y = ( y1 + pin_pos.y ) / 2;
|
y = ( y1 + pin_pos.y ) / 2;
|
||||||
plotter->text( wxPoint( x1 - TXTMARGE, y ),
|
plotter->Text( wxPoint( x1 - TXTMARGE, y ),
|
||||||
NameColor, m_name,
|
NameColor, m_name,
|
||||||
TEXT_ORIENT_VERT, PinNameSize,
|
TEXT_ORIENT_VERT, PinNameSize,
|
||||||
GR_TEXT_HJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER,
|
||||||
|
@ -1548,7 +1548,7 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter,
|
||||||
|
|
||||||
if( DrawPinNum )
|
if( DrawPinNum )
|
||||||
{
|
{
|
||||||
plotter->text( wxPoint( x1 + TXTMARGE, ( y1 + pin_pos.y ) / 2 ),
|
plotter->Text( wxPoint( x1 + TXTMARGE, ( y1 + pin_pos.y ) / 2 ),
|
||||||
NumColor, StringPinNum,
|
NumColor, StringPinNum,
|
||||||
TEXT_ORIENT_VERT, PinNumSize,
|
TEXT_ORIENT_VERT, PinNumSize,
|
||||||
GR_TEXT_HJUSTIFY_CENTER,
|
GR_TEXT_HJUSTIFY_CENTER,
|
||||||
|
@ -1808,7 +1808,7 @@ void LIB_PIN::Plot( PLOTTER* plotter, const wxPoint& offset, bool fill,
|
||||||
|
|
||||||
wxPoint pos = aTransform.TransformCoordinate( m_position ) + offset;
|
wxPoint pos = aTransform.TransformCoordinate( m_position ) + offset;
|
||||||
|
|
||||||
plotter->set_current_line_width( GetPenSize() );
|
plotter->SetCurrentLineWidth( GetPenSize() );
|
||||||
PlotSymbol( plotter, pos, orient );
|
PlotSymbol( plotter, pos, orient );
|
||||||
PlotPinTexts( plotter, pos, orient, GetParent()->GetPinNameOffset(),
|
PlotPinTexts( plotter, pos, orient, GetParent()->GetPinNameOffset(),
|
||||||
GetParent()->ShowPinNumbers(), GetParent()->ShowPinNames(),
|
GetParent()->ShowPinNumbers(), GetParent()->ShowPinNames(),
|
||||||
|
|
|
@ -241,13 +241,13 @@ void LIB_POLYLINE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
||||||
|
|
||||||
if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR )
|
if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR )
|
||||||
{
|
{
|
||||||
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
aPlotter->SetColor( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
||||||
aPlotter->PlotPoly( cornerList, FILLED_WITH_BG_BODYCOLOR, 0 );
|
aPlotter->PlotPoly( cornerList, FILLED_WITH_BG_BODYCOLOR, 0 );
|
||||||
aFill = false; // body is now filled, do not fill it later.
|
aFill = false; // body is now filled, do not fill it later.
|
||||||
}
|
}
|
||||||
|
|
||||||
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
|
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
|
||||||
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE ) );
|
aPlotter->SetColor( ReturnLayerColor( LAYER_DEVICE ) );
|
||||||
aPlotter->PlotPoly( cornerList, already_filled ? NO_FILL : m_Fill, GetPenSize() );
|
aPlotter->PlotPoly( cornerList, already_filled ? NO_FILL : m_Fill, GetPenSize() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -178,13 +178,13 @@ void LIB_RECTANGLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
||||||
|
|
||||||
if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR )
|
if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR )
|
||||||
{
|
{
|
||||||
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
aPlotter->SetColor( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
||||||
aPlotter->rect( pos, end, FILLED_WITH_BG_BODYCOLOR, 0 );
|
aPlotter->Rect( pos, end, FILLED_WITH_BG_BODYCOLOR, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
|
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
|
||||||
aPlotter->set_color( ReturnLayerColor( LAYER_DEVICE ) );
|
aPlotter->SetColor( ReturnLayerColor( LAYER_DEVICE ) );
|
||||||
aPlotter->rect( pos, end, already_filled ? NO_FILL : m_Fill, GetPenSize() );
|
aPlotter->Rect( pos, end, already_filled ? NO_FILL : m_Fill, GetPenSize() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -318,7 +318,7 @@ void LIB_TEXT::Plot( PLOTTER* plotter, const wxPoint& offset, bool fill,
|
||||||
int t1 = ( aTransform.x1 != 0 ) ^ ( m_Orient != 0 );
|
int t1 = ( aTransform.x1 != 0 ) ^ ( m_Orient != 0 );
|
||||||
wxPoint pos = aTransform.TransformCoordinate( m_Pos ) + offset;
|
wxPoint pos = aTransform.TransformCoordinate( m_Pos ) + offset;
|
||||||
|
|
||||||
plotter->text( pos, UNSPECIFIED, m_Text,
|
plotter->Text( pos, UNSPECIFIED, m_Text,
|
||||||
t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
|
t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
|
||||||
m_Size, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
m_Size, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
|
||||||
GetPenSize(), m_Italic, m_Bold );
|
GetPenSize(), m_Italic, m_Bold );
|
||||||
|
|
|
@ -204,6 +204,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
|
||||||
m_tempCopyComponent = NULL;
|
m_tempCopyComponent = NULL;
|
||||||
m_HotkeysZoomAndGridList = s_Libedit_Hokeys_Descr;
|
m_HotkeysZoomAndGridList = s_Libedit_Hokeys_Descr;
|
||||||
m_editPinsPerPartOrConvert = false;
|
m_editPinsPerPartOrConvert = false;
|
||||||
|
m_LastGridSizeId = ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000;
|
||||||
|
|
||||||
wxIcon icon;
|
wxIcon icon;
|
||||||
|
|
||||||
|
@ -219,12 +220,10 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
|
||||||
|
|
||||||
LoadSettings();
|
LoadSettings();
|
||||||
|
|
||||||
// Initialize grid id to a default value if not found in config or bad:
|
|
||||||
if( (m_LastGridSizeId <= 0)
|
|
||||||
|| ( m_LastGridSizeId < (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000) ) )
|
|
||||||
m_LastGridSizeId = ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000;
|
|
||||||
|
|
||||||
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
||||||
|
|
||||||
|
// Initialize grid id to the default value 50 mils:
|
||||||
|
m_LastGridSizeId = ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000;
|
||||||
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
|
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
|
||||||
|
|
||||||
if( m_canvas )
|
if( m_canvas )
|
||||||
|
|
|
@ -347,7 +347,7 @@ line %d,\nAbort reading file.\n" ),
|
||||||
|
|
||||||
if( strnicmp( line, "Sheet", 2 ) == 0 )
|
if( strnicmp( line, "Sheet", 2 ) == 0 )
|
||||||
sscanf( line + 5, " %d %d",
|
sscanf( line + 5, " %d %d",
|
||||||
&aScreen->m_ScreenNumber, &aScreen->m_NumberOfScreen );
|
&aScreen->m_ScreenNumber, &aScreen->m_NumberOfScreens );
|
||||||
|
|
||||||
if( strnicmp( line, "Title", 2 ) == 0 )
|
if( strnicmp( line, "Title", 2 ) == 0 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -147,6 +147,12 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
||||||
_( "Plot schematic sheet in PostScript format" ),
|
_( "Plot schematic sheet in PostScript format" ),
|
||||||
KiBitmap( plot_ps_xpm ) );
|
KiBitmap( plot_ps_xpm ) );
|
||||||
|
|
||||||
|
// Plot PDF
|
||||||
|
AddMenuItem( choice_plot_fmt, ID_GEN_PLOT_PDF,
|
||||||
|
_( "Plot PDF" ),
|
||||||
|
_( "Plot schematic sheet in PDF format" ),
|
||||||
|
KiBitmap( plot_pdf_xpm ) );
|
||||||
|
|
||||||
// Plot HPGL
|
// Plot HPGL
|
||||||
AddMenuItem( choice_plot_fmt,
|
AddMenuItem( choice_plot_fmt,
|
||||||
ID_GEN_PLOT_HPGL,
|
ID_GEN_PLOT_HPGL,
|
||||||
|
|
|
@ -73,7 +73,7 @@ private:
|
||||||
SCH_SHEET_PATH m_SheetPath; ///< The sheet path for this reference.
|
SCH_SHEET_PATH m_SheetPath; ///< The sheet path for this reference.
|
||||||
bool m_IsNew; ///< True if not yet annotated.
|
bool m_IsNew; ///< True if not yet annotated.
|
||||||
int m_SheetNum; ///< The sheet number for the reference.
|
int m_SheetNum; ///< The sheet number for the reference.
|
||||||
unsigned long m_TimeStamp; ///< The time stamp for the reference.
|
time_t m_TimeStamp; ///< The time stamp for the reference.
|
||||||
wxString* m_Value; ///< The component value of the refernce. It is the
|
wxString* m_Value; ///< The component value of the refernce. It is the
|
||||||
///< same for all instances.
|
///< same for all instances.
|
||||||
int m_NumRef; ///< The numeric part of the reference designator.
|
int m_NumRef; ///< The numeric part of the reference designator.
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#include <richio.h>
|
#include <richio.h>
|
||||||
#include <plot_common.h>
|
#include <plot_common.h>
|
||||||
|
|
||||||
|
#include <eeschema_config.h>
|
||||||
#include <general.h>
|
#include <general.h>
|
||||||
#include <protos.h>
|
#include <protos.h>
|
||||||
#include <sch_bus_entry.h>
|
#include <sch_bus_entry.h>
|
||||||
|
@ -167,10 +168,9 @@ int SCH_BUS_ENTRY::GetPenSize() const
|
||||||
{
|
{
|
||||||
int pensize = ( m_width == 0 ) ? g_DrawDefaultLineThickness : m_width;
|
int pensize = ( m_width == 0 ) ? g_DrawDefaultLineThickness : m_width;
|
||||||
|
|
||||||
if( m_Layer == LAYER_BUS && m_width == 0 )
|
if( m_Layer == LAYER_BUS )
|
||||||
{
|
{
|
||||||
pensize = KiROUND( g_DrawDefaultLineThickness * BUS_WIDTH_EXPAND );
|
pensize = ( m_width == 0 ) ? g_DefaultBusWidth : m_width;
|
||||||
pensize = MAX( pensize, 3 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return pensize;
|
return pensize;
|
||||||
|
@ -281,10 +281,10 @@ bool SCH_BUS_ENTRY::HitTest( const EDA_RECT& aRect, bool aContained, int aAccura
|
||||||
|
|
||||||
void SCH_BUS_ENTRY::Plot( PLOTTER* aPlotter )
|
void SCH_BUS_ENTRY::Plot( PLOTTER* aPlotter )
|
||||||
{
|
{
|
||||||
aPlotter->set_current_line_width( GetPenSize() );
|
aPlotter->SetCurrentLineWidth( GetPenSize() );
|
||||||
aPlotter->set_color( ReturnLayerColor( GetLayer() ) );
|
aPlotter->SetColor( ReturnLayerColor( GetLayer() ) );
|
||||||
aPlotter->move_to( m_pos );
|
aPlotter->MoveTo( m_pos );
|
||||||
aPlotter->finish_to( m_End() );
|
aPlotter->FinishTo( m_End() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SetBusEntryShape:
|
/* SetBusEntryShape:
|
||||||
|
|
|
@ -195,7 +195,7 @@ public:
|
||||||
* @see m_PathsAndReferences
|
* @see m_PathsAndReferences
|
||||||
* @param aNewTimeStamp = new time stamp
|
* @param aNewTimeStamp = new time stamp
|
||||||
*/
|
*/
|
||||||
void SetTimeStamp( long aNewTimeStamp );
|
void SetTimeStamp( time_t aNewTimeStamp );
|
||||||
|
|
||||||
EDA_RECT GetBoundingBox() const;
|
EDA_RECT GetBoundingBox() const;
|
||||||
|
|
||||||
|
|
|
@ -579,7 +579,7 @@ void SCH_FIELD::Plot( PLOTTER* aPlotter )
|
||||||
|
|
||||||
if( (parent->GetPartCount() <= 1) || (m_id != REFERENCE) )
|
if( (parent->GetPartCount() <= 1) || (m_id != REFERENCE) )
|
||||||
{
|
{
|
||||||
aPlotter->text( textpos, color, m_Text, orient, m_Size, hjustify, vjustify,
|
aPlotter->Text( textpos, color, m_Text, orient, m_Size, hjustify, vjustify,
|
||||||
thickness, m_Italic, m_Bold );
|
thickness, m_Italic, m_Bold );
|
||||||
}
|
}
|
||||||
else /* We plot the reference, for a multiple parts per package */
|
else /* We plot the reference, for a multiple parts per package */
|
||||||
|
@ -587,7 +587,7 @@ void SCH_FIELD::Plot( PLOTTER* aPlotter )
|
||||||
/* Adding A, B ... to the reference */
|
/* Adding A, B ... to the reference */
|
||||||
wxString Text = m_Text + LIB_COMPONENT::ReturnSubReference( parent->GetUnit() );
|
wxString Text = m_Text + LIB_COMPONENT::ReturnSubReference( parent->GetUnit() );
|
||||||
|
|
||||||
aPlotter->text( textpos, color, Text, orient, m_Size, hjustify, vjustify,
|
aPlotter->Text( textpos, color, Text, orient, m_Size, hjustify, vjustify,
|
||||||
thickness, m_Italic, m_Bold );
|
thickness, m_Italic, m_Bold );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -238,6 +238,6 @@ bool SCH_JUNCTION::doIsConnected( const wxPoint& aPosition ) const
|
||||||
|
|
||||||
void SCH_JUNCTION::Plot( PLOTTER* aPlotter )
|
void SCH_JUNCTION::Plot( PLOTTER* aPlotter )
|
||||||
{
|
{
|
||||||
aPlotter->set_color( ReturnLayerColor( GetLayer() ) );
|
aPlotter->SetColor( ReturnLayerColor( GetLayer() ) );
|
||||||
aPlotter->circle( m_pos, m_size.x, FILLED_SHAPE );
|
aPlotter->Circle( m_pos, m_size.x, FILLED_SHAPE );
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include <richio.h>
|
#include <richio.h>
|
||||||
#include <plot_common.h>
|
#include <plot_common.h>
|
||||||
#include <base_units.h>
|
#include <base_units.h>
|
||||||
|
#include <eeschema_config.h>
|
||||||
#include <general.h>
|
#include <general.h>
|
||||||
#include <protos.h>
|
#include <protos.h>
|
||||||
#include <sch_line.h>
|
#include <sch_line.h>
|
||||||
|
@ -212,10 +212,9 @@ int SCH_LINE::GetPenSize() const
|
||||||
{
|
{
|
||||||
int pensize = ( m_width == 0 ) ? g_DrawDefaultLineThickness : m_width;
|
int pensize = ( m_width == 0 ) ? g_DrawDefaultLineThickness : m_width;
|
||||||
|
|
||||||
if( m_Layer == LAYER_BUS && m_width == 0 )
|
if( m_Layer == LAYER_BUS )
|
||||||
{
|
{
|
||||||
pensize = KiROUND( g_DrawDefaultLineThickness * BUS_WIDTH_EXPAND );
|
pensize = ( m_width == 0 ) ? g_DefaultBusWidth : m_width;
|
||||||
pensize = MAX( pensize, 3 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return pensize;
|
return pensize;
|
||||||
|
@ -603,17 +602,17 @@ bool SCH_LINE::doIsConnected( const wxPoint& aPosition ) const
|
||||||
|
|
||||||
void SCH_LINE::Plot( PLOTTER* aPlotter )
|
void SCH_LINE::Plot( PLOTTER* aPlotter )
|
||||||
{
|
{
|
||||||
aPlotter->set_color( ReturnLayerColor( GetLayer() ) );
|
aPlotter->SetColor( ReturnLayerColor( GetLayer() ) );
|
||||||
aPlotter->set_current_line_width( GetPenSize() );
|
aPlotter->SetCurrentLineWidth( GetPenSize() );
|
||||||
|
|
||||||
if( m_Layer == LAYER_NOTES )
|
if( m_Layer == LAYER_NOTES )
|
||||||
aPlotter->set_dash( true );
|
aPlotter->SetDash( true );
|
||||||
|
|
||||||
aPlotter->move_to( m_start );
|
aPlotter->MoveTo( m_start );
|
||||||
aPlotter->finish_to( m_end );
|
aPlotter->FinishTo( m_end );
|
||||||
|
|
||||||
if( m_Layer == LAYER_NOTES )
|
if( m_Layer == LAYER_NOTES )
|
||||||
aPlotter->set_dash( false );
|
aPlotter->SetDash( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -241,10 +241,11 @@ void SCH_NO_CONNECT::Plot( PLOTTER* aPlotter )
|
||||||
pX = m_pos.x;
|
pX = m_pos.x;
|
||||||
pY = m_pos.y;
|
pY = m_pos.y;
|
||||||
|
|
||||||
aPlotter->set_current_line_width( GetPenSize() );
|
aPlotter->SetCurrentLineWidth( GetPenSize() );
|
||||||
aPlotter->set_color( ReturnLayerColor( GetLayer() ) );
|
aPlotter->SetColor( ReturnLayerColor( GetLayer() ) );
|
||||||
aPlotter->move_to( wxPoint( pX - delta, pY - delta ) );
|
aPlotter->MoveTo( wxPoint( pX - delta, pY - delta ) );
|
||||||
aPlotter->finish_to( wxPoint( pX + delta, pY + delta ) );
|
aPlotter->FinishTo( wxPoint( pX + delta, pY + delta ) );
|
||||||
aPlotter->move_to( wxPoint( pX + delta, pY - delta ) );
|
aPlotter->MoveTo( wxPoint( pX + delta, pY - delta ) );
|
||||||
aPlotter->finish_to( wxPoint( pX - delta, pY + delta ) );
|
aPlotter->FinishTo( wxPoint( pX - delta, pY + delta ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ SCH_SCREEN::SCH_SCREEN() :
|
||||||
SetZoom( 32 );
|
SetZoom( 32 );
|
||||||
|
|
||||||
for( i = 0; i < SCHEMATIC_ZOOM_LIST_CNT; i++ )
|
for( i = 0; i < SCHEMATIC_ZOOM_LIST_CNT; i++ )
|
||||||
m_ZoomList.Add( SchematicZoomList[i] );
|
m_ZoomList.push_back( SchematicZoomList[i] );
|
||||||
|
|
||||||
for( i = 0; i < SCHEMATIC_GRID_LIST_CNT; i++ )
|
for( i = 0; i < SCHEMATIC_GRID_LIST_CNT; i++ )
|
||||||
AddGrid( SchematicGridList[i] );
|
AddGrid( SchematicGridList[i] );
|
||||||
|
@ -146,8 +146,8 @@ void SCH_SCREEN::Clear()
|
||||||
{
|
{
|
||||||
FreeDrawList();
|
FreeDrawList();
|
||||||
|
|
||||||
/* Clear the project settings. */
|
// Clear the project settings
|
||||||
m_ScreenNumber = m_NumberOfScreen = 1;
|
m_ScreenNumber = m_NumberOfScreens = 1;
|
||||||
|
|
||||||
m_titles.Clear();
|
m_titles.Clear();
|
||||||
m_titles.SetDate();
|
m_titles.SetDate();
|
||||||
|
@ -507,7 +507,7 @@ bool SCH_SCREEN::Save( FILE* aFile ) const
|
||||||
" portrait" : ""
|
" portrait" : ""
|
||||||
) < 0
|
) < 0
|
||||||
|| fprintf( aFile, "encoding utf-8\n") < 0
|
|| fprintf( aFile, "encoding utf-8\n") < 0
|
||||||
|| fprintf( aFile, "Sheet %d %d\n", m_ScreenNumber, m_NumberOfScreen ) < 0
|
|| fprintf( aFile, "Sheet %d %d\n", m_ScreenNumber, m_NumberOfScreens ) < 0
|
||||||
|| fprintf( aFile, "Title %s\n", EscapedUTF8( tb.GetTitle() ).c_str() ) < 0
|
|| fprintf( aFile, "Title %s\n", EscapedUTF8( tb.GetTitle() ).c_str() ) < 0
|
||||||
|| fprintf( aFile, "Date %s\n", EscapedUTF8( tb.GetDate() ).c_str() ) < 0
|
|| fprintf( aFile, "Date %s\n", EscapedUTF8( tb.GetDate() ).c_str() ) < 0
|
||||||
|| fprintf( aFile, "Rev %s\n", EscapedUTF8( tb.GetRevision() ).c_str() ) < 0
|
|| fprintf( aFile, "Rev %s\n", EscapedUTF8( tb.GetRevision() ).c_str() ) < 0
|
||||||
|
@ -554,7 +554,7 @@ void SCH_SCREEN::Plot( PLOTTER* aPlotter )
|
||||||
{
|
{
|
||||||
for( SCH_ITEM* item = m_drawList.begin(); item; item = item->Next() )
|
for( SCH_ITEM* item = m_drawList.begin(); item; item = item->Next() )
|
||||||
{
|
{
|
||||||
aPlotter->set_current_line_width( item->GetPenSize() );
|
aPlotter->SetCurrentLineWidth( item->GetPenSize() );
|
||||||
item->Plot( aPlotter );
|
item->Plot( aPlotter );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1111,24 +1111,24 @@ void SCH_SHEET::Plot( PLOTTER* aPlotter )
|
||||||
wxPoint pos_sheetname, pos_filename;
|
wxPoint pos_sheetname, pos_filename;
|
||||||
wxPoint pos;
|
wxPoint pos;
|
||||||
|
|
||||||
aPlotter->set_color( ReturnLayerColor( GetLayer() ) );
|
aPlotter->SetColor( ReturnLayerColor( GetLayer() ) );
|
||||||
|
|
||||||
int thickness = GetPenSize();
|
int thickness = GetPenSize();
|
||||||
aPlotter->set_current_line_width( thickness );
|
aPlotter->SetCurrentLineWidth( thickness );
|
||||||
|
|
||||||
aPlotter->move_to( m_pos );
|
aPlotter->MoveTo( m_pos );
|
||||||
pos = m_pos;
|
pos = m_pos;
|
||||||
pos.x += m_size.x;
|
pos.x += m_size.x;
|
||||||
|
|
||||||
aPlotter->line_to( pos );
|
aPlotter->LineTo( pos );
|
||||||
pos.y += m_size.y;
|
pos.y += m_size.y;
|
||||||
|
|
||||||
aPlotter->line_to( pos );
|
aPlotter->LineTo( pos );
|
||||||
pos = m_pos;
|
pos = m_pos;
|
||||||
pos.y += m_size.y;
|
pos.y += m_size.y;
|
||||||
|
|
||||||
aPlotter->line_to( pos );
|
aPlotter->LineTo( pos );
|
||||||
aPlotter->finish_to( m_pos );
|
aPlotter->FinishTo( m_pos );
|
||||||
|
|
||||||
if( IsVerticalOrientation() )
|
if( IsVerticalOrientation() )
|
||||||
{
|
{
|
||||||
|
@ -1151,10 +1151,10 @@ void SCH_SHEET::Plot( PLOTTER* aPlotter )
|
||||||
thickness = g_DrawDefaultLineThickness;
|
thickness = g_DrawDefaultLineThickness;
|
||||||
thickness = Clamp_Text_PenSize( thickness, size, false );
|
thickness = Clamp_Text_PenSize( thickness, size, false );
|
||||||
|
|
||||||
aPlotter->set_color( ReturnLayerColor( LAYER_SHEETNAME ) );
|
aPlotter->SetColor( ReturnLayerColor( LAYER_SHEETNAME ) );
|
||||||
|
|
||||||
bool italic = false;
|
bool italic = false;
|
||||||
aPlotter->text( pos_sheetname, txtcolor, Text, name_orientation, size,
|
aPlotter->Text( pos_sheetname, txtcolor, Text, name_orientation, size,
|
||||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM,
|
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
|
|
||||||
|
@ -1164,13 +1164,13 @@ void SCH_SHEET::Plot( PLOTTER* aPlotter )
|
||||||
thickness = g_DrawDefaultLineThickness;
|
thickness = g_DrawDefaultLineThickness;
|
||||||
thickness = Clamp_Text_PenSize( thickness, size, false );
|
thickness = Clamp_Text_PenSize( thickness, size, false );
|
||||||
|
|
||||||
aPlotter->set_color( ReturnLayerColor( LAYER_SHEETFILENAME ) );
|
aPlotter->SetColor( ReturnLayerColor( LAYER_SHEETFILENAME ) );
|
||||||
|
|
||||||
aPlotter->text( pos_filename, txtcolor, Text, name_orientation, size,
|
aPlotter->Text( pos_filename, txtcolor, Text, name_orientation, size,
|
||||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP,
|
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP,
|
||||||
thickness, italic, false );
|
thickness, italic, false );
|
||||||
|
|
||||||
aPlotter->set_color( ReturnLayerColor( GetLayer() ) );
|
aPlotter->SetColor( ReturnLayerColor( GetLayer() ) );
|
||||||
|
|
||||||
/* Draw texts : SheetLabel */
|
/* Draw texts : SheetLabel */
|
||||||
for( size_t i = 0; i < m_pins.size(); i++ )
|
for( size_t i = 0; i < m_pins.size(); i++ )
|
||||||
|
|
|
@ -691,7 +691,7 @@ void SCH_TEXT::Plot( PLOTTER* aPlotter )
|
||||||
wxPoint textpos = m_Pos + GetSchematicTextOffset();
|
wxPoint textpos = m_Pos + GetSchematicTextOffset();
|
||||||
int thickness = GetPenSize();
|
int thickness = GetPenSize();
|
||||||
|
|
||||||
aPlotter->set_current_line_width( thickness );
|
aPlotter->SetCurrentLineWidth( thickness );
|
||||||
|
|
||||||
if( m_MultilineAllowed )
|
if( m_MultilineAllowed )
|
||||||
{
|
{
|
||||||
|
@ -706,7 +706,7 @@ void SCH_TEXT::Plot( PLOTTER* aPlotter )
|
||||||
for( unsigned i = 0; i<list->Count(); i++ )
|
for( unsigned i = 0; i<list->Count(); i++ )
|
||||||
{
|
{
|
||||||
wxString txt = list->Item( i );
|
wxString txt = list->Item( i );
|
||||||
aPlotter->text( pos, color, txt, m_Orient, m_Size, m_HJustify,
|
aPlotter->Text( pos, color, txt, m_Orient, m_Size, m_HJustify,
|
||||||
m_VJustify, thickness, m_Italic, m_Bold );
|
m_VJustify, thickness, m_Italic, m_Bold );
|
||||||
pos += offset;
|
pos += offset;
|
||||||
}
|
}
|
||||||
|
@ -715,14 +715,14 @@ void SCH_TEXT::Plot( PLOTTER* aPlotter )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aPlotter->text( textpos, color, m_Text, m_Orient, m_Size, m_HJustify,
|
aPlotter->Text( textpos, color, m_Text, m_Orient, m_Size, m_HJustify,
|
||||||
m_VJustify, thickness, m_Italic, m_Bold );
|
m_VJustify, thickness, m_Italic, m_Bold );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Draw graphic symbol for global or hierarchical labels */
|
/* Draw graphic symbol for global or hierarchical labels */
|
||||||
CreateGraphicShape( Poly, m_Pos );
|
CreateGraphicShape( Poly, m_Pos );
|
||||||
|
|
||||||
aPlotter->set_current_line_width( GetPenSize() );
|
aPlotter->SetCurrentLineWidth( GetPenSize() );
|
||||||
|
|
||||||
if( Poly.size() )
|
if( Poly.size() )
|
||||||
aPlotter->PlotPoly( Poly, NO_FILL );
|
aPlotter->PlotPoly( Poly, NO_FILL );
|
||||||
|
|
|
@ -86,6 +86,7 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
|
||||||
EVT_MENU( ID_GEN_PLOT_HPGL, SCH_EDIT_FRAME::ToPlot_HPGL )
|
EVT_MENU( ID_GEN_PLOT_HPGL, SCH_EDIT_FRAME::ToPlot_HPGL )
|
||||||
EVT_MENU( ID_GEN_PLOT_SVG, SCH_EDIT_FRAME::SVG_Print )
|
EVT_MENU( ID_GEN_PLOT_SVG, SCH_EDIT_FRAME::SVG_Print )
|
||||||
EVT_MENU( ID_GEN_PLOT_DXF, SCH_EDIT_FRAME::ToPlot_DXF )
|
EVT_MENU( ID_GEN_PLOT_DXF, SCH_EDIT_FRAME::ToPlot_DXF )
|
||||||
|
EVT_MENU( ID_GEN_PLOT_PDF, SCH_EDIT_FRAME::ToPlot_PDF )
|
||||||
EVT_MENU( ID_GEN_COPY_SHEET_TO_CLIPBOARD, EDA_DRAW_FRAME::CopyToClipboard )
|
EVT_MENU( ID_GEN_COPY_SHEET_TO_CLIPBOARD, EDA_DRAW_FRAME::CopyToClipboard )
|
||||||
EVT_MENU( wxID_EXIT, SCH_EDIT_FRAME::OnExit )
|
EVT_MENU( wxID_EXIT, SCH_EDIT_FRAME::OnExit )
|
||||||
|
|
||||||
|
@ -215,11 +216,8 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father,
|
||||||
/* Get config */
|
/* Get config */
|
||||||
LoadSettings();
|
LoadSettings();
|
||||||
|
|
||||||
// Initialize grid id to a default value if not found in config or bad:
|
// Initialize grid id to the default value (50 mils):
|
||||||
if( (m_LastGridSizeId <= 0)
|
m_LastGridSizeId = ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000;
|
||||||
|| ( m_LastGridSizeId < (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000) ) )
|
|
||||||
m_LastGridSizeId = ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000;
|
|
||||||
|
|
||||||
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
||||||
|
|
||||||
if( m_canvas )
|
if( m_canvas )
|
||||||
|
@ -315,7 +313,7 @@ void SCH_EDIT_FRAME::SetSheetNumberAndCount()
|
||||||
|
|
||||||
for( screen = s_list.GetFirst(); screen != NULL; screen = s_list.GetNext() )
|
for( screen = s_list.GetFirst(); screen != NULL; screen = s_list.GetNext() )
|
||||||
{
|
{
|
||||||
screen->m_NumberOfScreen = sheet_count;
|
screen->m_NumberOfScreens = sheet_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
GetScreen()->m_ScreenNumber = SheetNumber;
|
GetScreen()->m_ScreenNumber = SheetNumber;
|
||||||
|
@ -979,9 +977,8 @@ void SCH_EDIT_FRAME::UpdateTitle()
|
||||||
|
|
||||||
if( GetScreen()->GetFileName() == m_DefaultSchematicFileName )
|
if( GetScreen()->GetFileName() == m_DefaultSchematicFileName )
|
||||||
{
|
{
|
||||||
wxString msg = wxGetApp().GetAppName() + wxT( " " ) + GetBuildVersion();
|
title.Printf( wxT( "Eeschema %s [%s]" ), GetChars( GetBuildVersion() ),
|
||||||
title.Printf( wxT( "%s [%s]" ), GetChars( msg), GetChars( GetScreen()->GetFileName() ) );
|
GetChars( GetScreen()->GetFileName() ) );
|
||||||
SetTitle( title );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -991,12 +988,10 @@ void SCH_EDIT_FRAME::UpdateTitle()
|
||||||
// passed to LoadOneEEFile() which omits the path on non-root schematics.
|
// passed to LoadOneEEFile() which omits the path on non-root schematics.
|
||||||
// Making the path absolute solves this problem.
|
// Making the path absolute solves this problem.
|
||||||
fn.MakeAbsolute();
|
fn.MakeAbsolute();
|
||||||
title = wxChar( '[' );
|
title.Printf( wxT( "[ %s %s] (%s)" ),
|
||||||
title << fn.GetName() << wxChar( ' ' );
|
GetChars( fn.GetName() ),
|
||||||
title << m_CurrentSheet->PathHumanReadable() << wxChar( ']' );
|
GetChars( m_CurrentSheet->PathHumanReadable() ),
|
||||||
|
GetChars( fn.GetPath() ) );
|
||||||
title << wxChar( ' ' );
|
|
||||||
title << wxChar( '(' ) << fn.GetPath() << wxChar( ')' );
|
|
||||||
|
|
||||||
if( fn.FileExists() )
|
if( fn.FileExists() )
|
||||||
{
|
{
|
||||||
|
@ -1006,6 +1001,7 @@ void SCH_EDIT_FRAME::UpdateTitle()
|
||||||
else
|
else
|
||||||
title << _( " [no file]" );
|
title << _( " [no file]" );
|
||||||
|
|
||||||
SetTitle( title );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetTitle( title );
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,6 +130,9 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
|
||||||
LoadSettings();
|
LoadSettings();
|
||||||
|
|
||||||
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
||||||
|
|
||||||
|
// Initialize grid id to the default value (50 mils):
|
||||||
|
m_LastGridSizeId = ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000;
|
||||||
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
|
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
|
||||||
|
|
||||||
ReCreateHToolbar();
|
ReCreateHToolbar();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
add_definitions(-DGERBVIEW -DPCBNEW)
|
add_definitions(-DGERBVIEW)
|
||||||
|
|
||||||
###
|
###
|
||||||
# Includes
|
# Includes
|
||||||
|
@ -22,10 +22,11 @@ set(DIALOGS_SRCS
|
||||||
dialogs/gerbview_dialog_display_options_frame_base.cpp
|
dialogs/gerbview_dialog_display_options_frame_base.cpp
|
||||||
dialogs/gerbview_dialog_display_options_frame.cpp
|
dialogs/gerbview_dialog_display_options_frame.cpp
|
||||||
dialogs/dialog_layers_select_to_pcb_base.cpp
|
dialogs/dialog_layers_select_to_pcb_base.cpp
|
||||||
dialogs/dialog_show_page_borders.cpp
|
|
||||||
dialogs/dialog_show_page_borders_base.cpp
|
|
||||||
dialogs/dialog_print_using_printer.cpp
|
dialogs/dialog_print_using_printer.cpp
|
||||||
dialogs/dialog_print_using_printer_base.cpp
|
dialogs/dialog_print_using_printer_base.cpp
|
||||||
|
dialogs/dialog_select_one_pcb_layer.cpp
|
||||||
|
dialogs/dialog_show_page_borders.cpp
|
||||||
|
dialogs/dialog_show_page_borders_base.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(GERBVIEW_SRCS
|
set(GERBVIEW_SRCS
|
||||||
|
@ -34,9 +35,11 @@ set(GERBVIEW_SRCS
|
||||||
class_aperture_macro.cpp
|
class_aperture_macro.cpp
|
||||||
class_DCodeSelectionbox.cpp
|
class_DCodeSelectionbox.cpp
|
||||||
class_gbr_screen.cpp
|
class_gbr_screen.cpp
|
||||||
|
class_gbr_layout.cpp
|
||||||
class_GERBER.cpp
|
class_GERBER.cpp
|
||||||
class_gerber_draw_item.cpp
|
class_gerber_draw_item.cpp
|
||||||
class_gerbview_layer_widget.cpp
|
class_gerbview_layer_widget.cpp
|
||||||
|
class_gbr_layer_box_selector.cpp
|
||||||
controle.cpp
|
controle.cpp
|
||||||
dcode.cpp
|
dcode.cpp
|
||||||
draw_gerber_screen.cpp
|
draw_gerber_screen.cpp
|
||||||
|
@ -53,7 +56,6 @@ set(GERBVIEW_SRCS
|
||||||
menubar.cpp
|
menubar.cpp
|
||||||
onleftclick.cpp
|
onleftclick.cpp
|
||||||
onrightclick.cpp
|
onrightclick.cpp
|
||||||
options.cpp
|
|
||||||
pcbplot.cpp
|
pcbplot.cpp
|
||||||
readgerb.cpp
|
readgerb.cpp
|
||||||
rs274_read_XY_and_IJ_coordinates.cpp
|
rs274_read_XY_and_IJ_coordinates.cpp
|
||||||
|
@ -67,10 +69,12 @@ set(GERBVIEW_SRCS
|
||||||
# We need some extra sources from common and pcbnew
|
# We need some extra sources from common and pcbnew
|
||||||
###
|
###
|
||||||
set(GERBVIEW_EXTRA_SRCS
|
set(GERBVIEW_EXTRA_SRCS
|
||||||
|
../common/base_screen.cpp
|
||||||
../common/base_units.cpp
|
../common/base_units.cpp
|
||||||
|
../common/class_layer_box_selector.cpp
|
||||||
|
../common/class_page_info.cpp
|
||||||
../pcbnew/layer_widget.cpp
|
../pcbnew/layer_widget.cpp
|
||||||
../pcbnew/printout_controler.cpp
|
../pcbnew/printout_controler.cpp
|
||||||
../pcbnew/class_drc_item.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
###
|
###
|
||||||
|
@ -117,7 +121,7 @@ endif(APPLE)
|
||||||
###
|
###
|
||||||
# Link executable target gerbview with correct libraries
|
# Link executable target gerbview with correct libraries
|
||||||
###
|
###
|
||||||
target_link_libraries(gerbview pcbcommon common 3d-viewer polygon bitmaps kbool
|
target_link_libraries(gerbview common polygon bitmaps kbool
|
||||||
${OPENGL_LIBRARIES}
|
${OPENGL_LIBRARIES}
|
||||||
${wxWidgets_LIBRARIES}
|
${wxWidgets_LIBRARIES}
|
||||||
${GDI_PLUS_LIBRARIES})
|
${GDI_PLUS_LIBRARIES})
|
||||||
|
|
|
@ -91,27 +91,7 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
GetScreen()->m_BlockLocate.ClearItemsList();
|
GetScreen()->m_BlockLocate.ClearItemsList();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BLOCK_COPY: /* Copy */
|
default:
|
||||||
if( m_canvas->IsMouseCaptured() )
|
|
||||||
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
|
|
||||||
|
|
||||||
Block_Duplicate( DC );
|
|
||||||
GetScreen()->m_BlockLocate.ClearItemsList();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BLOCK_PASTE:
|
|
||||||
case BLOCK_DRAG:
|
|
||||||
case BLOCK_PRESELECT_MOVE:
|
|
||||||
case BLOCK_ZOOM:
|
|
||||||
case BLOCK_ROTATE:
|
|
||||||
case BLOCK_FLIP:
|
|
||||||
case BLOCK_DELETE:
|
|
||||||
case BLOCK_SAVE:
|
|
||||||
case BLOCK_ABORT:
|
|
||||||
case BLOCK_SELECT_ITEMS_ONLY:
|
|
||||||
case BLOCK_MIRROR_X:
|
|
||||||
case BLOCK_MIRROR_Y:
|
|
||||||
case BLOCK_IDLE:
|
|
||||||
wxFAIL_MSG( wxT("HandleBlockPlace: Unexpected block command") );
|
wxFAIL_MSG( wxT("HandleBlockPlace: Unexpected block command") );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -136,7 +116,6 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
|
||||||
switch( GetScreen()->m_BlockLocate.GetCommand() )
|
switch( GetScreen()->m_BlockLocate.GetCommand() )
|
||||||
{
|
{
|
||||||
case BLOCK_MOVE: /* Move */
|
case BLOCK_MOVE: /* Move */
|
||||||
case BLOCK_COPY: /* Copy */
|
|
||||||
GetScreen()->m_BlockLocate.SetState( STATE_BLOCK_MOVE );
|
GetScreen()->m_BlockLocate.SetState( STATE_BLOCK_MOVE );
|
||||||
nextcmd = true;
|
nextcmd = true;
|
||||||
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
|
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
|
||||||
|
@ -144,27 +123,11 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
|
||||||
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
|
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BLOCK_DELETE: /* Delete */
|
|
||||||
GetScreen()->m_BlockLocate.SetState( STATE_BLOCK_STOP );
|
|
||||||
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
|
|
||||||
Block_Delete( DC );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BLOCK_ZOOM: /* Window Zoom */
|
case BLOCK_ZOOM: /* Window Zoom */
|
||||||
zoom_command = true;
|
zoom_command = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BLOCK_PRESELECT_MOVE: /* Move with preselection list */
|
default:
|
||||||
case BLOCK_DRAG:
|
|
||||||
case BLOCK_IDLE:
|
|
||||||
case BLOCK_MIRROR_X: /* Mirror, unused*/
|
|
||||||
case BLOCK_ROTATE: /* Unused */
|
|
||||||
case BLOCK_FLIP: /* Flip, unused */
|
|
||||||
case BLOCK_SAVE: /* Save (not used)*/
|
|
||||||
case BLOCK_PASTE:
|
|
||||||
case BLOCK_ABORT:
|
|
||||||
case BLOCK_SELECT_ITEMS_ONLY:
|
|
||||||
case BLOCK_MIRROR_Y:
|
|
||||||
wxFAIL_MSG( wxT("HandleBlockEnd: Unexpected block command") );
|
wxFAIL_MSG( wxT("HandleBlockEnd: Unexpected block command") );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -228,31 +191,6 @@ static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GERBVIEW_FRAME::Block_Delete( wxDC* DC )
|
|
||||||
{
|
|
||||||
if( !IsOK( this, _( "Ok to delete block ?" ) ) )
|
|
||||||
return;
|
|
||||||
|
|
||||||
GetScreen()->SetModify();
|
|
||||||
GetScreen()->m_BlockLocate.Normalize();
|
|
||||||
GetScreen()->SetCurItem( NULL );
|
|
||||||
|
|
||||||
BOARD_ITEM* item = GetBoard()->m_Drawings;
|
|
||||||
BOARD_ITEM* nextitem;
|
|
||||||
|
|
||||||
for( ; item; item = nextitem )
|
|
||||||
{
|
|
||||||
nextitem = item->Next();
|
|
||||||
GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item;
|
|
||||||
|
|
||||||
if( gerb_item->HitTest( GetScreen()->m_BlockLocate ) )
|
|
||||||
gerb_item->DeleteStructure();
|
|
||||||
}
|
|
||||||
|
|
||||||
Refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GERBVIEW_FRAME::Block_Move( wxDC* DC )
|
void GERBVIEW_FRAME::Block_Move( wxDC* DC )
|
||||||
{
|
{
|
||||||
wxPoint delta;
|
wxPoint delta;
|
||||||
|
@ -270,9 +208,7 @@ void GERBVIEW_FRAME::Block_Move( wxDC* DC )
|
||||||
delta = GetScreen()->m_BlockLocate.GetMoveVector();
|
delta = GetScreen()->m_BlockLocate.GetMoveVector();
|
||||||
|
|
||||||
/* Move items in block */
|
/* Move items in block */
|
||||||
BOARD_ITEM* item = GetBoard()->m_Drawings;
|
for( GERBER_DRAW_ITEM* item = GetItemsList(); item; item = item->Next() )
|
||||||
|
|
||||||
for( ; item; item = item->Next() )
|
|
||||||
{
|
{
|
||||||
GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item;
|
GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item;
|
||||||
|
|
||||||
|
@ -282,38 +218,3 @@ void GERBVIEW_FRAME::Block_Move( wxDC* DC )
|
||||||
|
|
||||||
m_canvas->Refresh( true );
|
m_canvas->Refresh( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GERBVIEW_FRAME::Block_Duplicate( wxDC* DC )
|
|
||||||
{
|
|
||||||
wxPoint delta;
|
|
||||||
wxPoint oldpos;
|
|
||||||
|
|
||||||
oldpos = GetScreen()->GetCrossHairPosition();
|
|
||||||
m_canvas->SetMouseCaptureCallback( NULL );
|
|
||||||
|
|
||||||
GetScreen()->SetCrossHairPosition( oldpos );
|
|
||||||
m_canvas->MoveCursorToCrossHair();
|
|
||||||
GetScreen()->SetModify();
|
|
||||||
GetScreen()->m_BlockLocate.Normalize();
|
|
||||||
|
|
||||||
delta = GetScreen()->m_BlockLocate.GetMoveVector();
|
|
||||||
|
|
||||||
/* Copy items in block */
|
|
||||||
BOARD_ITEM* item = GetBoard()->m_Drawings;
|
|
||||||
|
|
||||||
for( ; item; item = item->Next() )
|
|
||||||
{
|
|
||||||
GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item;
|
|
||||||
|
|
||||||
if( gerb_item->HitTest( GetScreen()->m_BlockLocate ) )
|
|
||||||
{
|
|
||||||
/* this item must be duplicated */
|
|
||||||
GERBER_DRAW_ITEM* new_item = gerb_item->Copy();
|
|
||||||
new_item->MoveAB( delta );
|
|
||||||
GetBoard()->m_Drawings.PushFront( new_item );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_canvas->Refresh();
|
|
||||||
}
|
|
||||||
|
|
|
@ -95,8 +95,6 @@ GERBER_IMAGE::GERBER_IMAGE( GERBVIEW_FRAME* aParent, int aLayer )
|
||||||
|
|
||||||
for( unsigned ii = 0; ii < DIM( m_Aperture_List ); ii++ )
|
for( unsigned ii = 0; ii < DIM( m_Aperture_List ); ii++ )
|
||||||
m_Aperture_List[ii] = 0;
|
m_Aperture_List[ii] = 0;
|
||||||
|
|
||||||
m_Pcb = aParent->GetBoard();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,10 +106,16 @@ GERBER_IMAGE::~GERBER_IMAGE()
|
||||||
|
|
||||||
// m_Aperture_List[ii] = NULL;
|
// m_Aperture_List[ii] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete m_Pcb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function GetItemsList
|
||||||
|
* returns the first GERBER_DRAW_ITEM * item of the items list
|
||||||
|
*/
|
||||||
|
GERBER_DRAW_ITEM * GERBER_IMAGE::GetItemsList()
|
||||||
|
{
|
||||||
|
return m_Parent->GetItemsList();
|
||||||
|
}
|
||||||
|
|
||||||
D_CODE* GERBER_IMAGE::GetDCODE( int aDCODE, bool create )
|
D_CODE* GERBER_IMAGE::GetDCODE( int aDCODE, bool create )
|
||||||
{
|
{
|
||||||
|
@ -206,18 +210,16 @@ bool GERBER_IMAGE::HasNegativeItems()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_hasNegativeItems = 0;
|
m_hasNegativeItems = 0;
|
||||||
for( BOARD_ITEM* item = m_Pcb->m_Drawings; item; item = item->Next() )
|
for( GERBER_DRAW_ITEM* item = GetItemsList(); item; item = item->Next() )
|
||||||
{
|
{
|
||||||
GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item;
|
if( item->GetLayer() != m_GraphicLayer )
|
||||||
if( gerb_item->GetLayer() != m_GraphicLayer )
|
|
||||||
continue;
|
continue;
|
||||||
if( gerb_item->HasNegativeItems() )
|
if( item->HasNegativeItems() )
|
||||||
{
|
{
|
||||||
m_hasNegativeItems = 1;
|
m_hasNegativeItems = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO search for items in list
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return m_hasNegativeItems == 1;
|
return m_hasNegativeItems == 1;
|
||||||
|
@ -306,7 +308,7 @@ void GERBER_IMAGE::StepAndRepeatItem( const GERBER_DRAW_ITEM& aItem )
|
||||||
move_vector.y = scaletoIU( jj * GetLayerParams().m_StepForRepeat.y,
|
move_vector.y = scaletoIU( jj * GetLayerParams().m_StepForRepeat.y,
|
||||||
GetLayerParams().m_StepForRepeatMetric );
|
GetLayerParams().m_StepForRepeatMetric );
|
||||||
dupItem->MoveXY( move_vector );
|
dupItem->MoveXY( move_vector );
|
||||||
m_Parent->GetBoard()->m_Drawings.Append( dupItem );
|
m_Parent->GetLayout()->m_Drawings.Append( dupItem );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
|| ( (x) == '-' ) || ( (x) == '+' ) || ( (x) == '.' ) )
|
|| ( (x) == '-' ) || ( (x) == '+' ) || ( (x) == '.' ) )
|
||||||
|
|
||||||
class GERBVIEW_FRAME;
|
class GERBVIEW_FRAME;
|
||||||
class BOARD;
|
|
||||||
class D_CODE;
|
class D_CODE;
|
||||||
|
|
||||||
/* gerber files have different parameters to define units and how items must be plotted.
|
/* gerber files have different parameters to define units and how items must be plotted.
|
||||||
|
@ -74,10 +73,9 @@ private:
|
||||||
*/
|
*/
|
||||||
class GERBER_IMAGE
|
class GERBER_IMAGE
|
||||||
{
|
{
|
||||||
GERBVIEW_FRAME* m_Parent; // the parent GERBVIEW_FRAME (used to display messages...)
|
GERBVIEW_FRAME* m_Parent; // the parent GERBVIEW_FRAME (used to display messages...)
|
||||||
D_CODE* m_Aperture_List[TOOLS_MAX_COUNT]; ///< Dcode (Aperture) List for this layer (max 999)
|
D_CODE* m_Aperture_List[TOOLS_MAX_COUNT]; ///< Dcode (Aperture) List for this layer (max 999)
|
||||||
bool m_Exposure; ///< whether an aperture macro tool is flashed on or off
|
bool m_Exposure; ///< whether an aperture macro tool is flashed on or off
|
||||||
BOARD* m_Pcb;
|
|
||||||
|
|
||||||
GERBER_LAYER m_GBRLayerParams; // hold params for the current gerber layer
|
GERBER_LAYER m_GBRLayerParams; // hold params for the current gerber layer
|
||||||
|
|
||||||
|
@ -155,6 +153,12 @@ public:
|
||||||
return m_Parent;
|
return m_Parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function GetItemsList
|
||||||
|
* @return the first GERBER_DRAW_ITEM * item of the items list
|
||||||
|
*/
|
||||||
|
GERBER_DRAW_ITEM * GetItemsList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetLayerParams
|
* Function GetLayerParams
|
||||||
* @return the current layers params
|
* @return the current layers params
|
||||||
|
|
|
@ -53,7 +53,7 @@ enum drill_G_code_t {
|
||||||
// Helper struct to analyse Excellon commands
|
// Helper struct to analyse Excellon commands
|
||||||
struct EXCELLON_CMD
|
struct EXCELLON_CMD
|
||||||
{
|
{
|
||||||
string m_Name; // key string
|
std::string m_Name; // key string
|
||||||
int m_Code; // internal code, used as id in functions
|
int m_Code; // internal code, used as id in functions
|
||||||
int m_asParams; // 0 = no param, -1 = skip params, 1 = read params
|
int m_asParams; // 0 = no param, -1 = skip params, 1 = read params
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
/**
|
||||||
|
* @file class_gbr_layer_box_selector.cpp
|
||||||
|
* @brief a derived class of LAYER_BOX_SELECTOR to handle the layer box selector
|
||||||
|
* in GerbView
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
|
*
|
||||||
|
* Copyright (C) 1992-2012 Jean-Pierre Charras <jean-pierre.charras@ujf-grenoble.fr>
|
||||||
|
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
|
* Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, you may find one here:
|
||||||
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||||
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||||
|
* or you may write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <colors_selection.h>
|
||||||
|
#include <layers_id_colors_and_visibility.h>
|
||||||
|
|
||||||
|
#include <gerbview_frame.h>
|
||||||
|
|
||||||
|
#include <wx/ownerdrw.h>
|
||||||
|
#include <wx/menuitem.h>
|
||||||
|
#include <wx/bmpcbox.h>
|
||||||
|
#include <wx/wx.h>
|
||||||
|
|
||||||
|
#include <class_gbr_layer_box_selector.h>
|
||||||
|
|
||||||
|
void GBR_LAYER_BOX_SELECTOR::Resync()
|
||||||
|
{
|
||||||
|
Clear();
|
||||||
|
|
||||||
|
for( int layerid = 0; layerid < LAYER_COUNT; layerid++ )
|
||||||
|
{
|
||||||
|
wxBitmap layerbmp( 14, 14 );
|
||||||
|
wxString layername;
|
||||||
|
|
||||||
|
if( !IsLayerEnabled( layerid ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Prepare Bitmap
|
||||||
|
SetBitmapLayer( layerbmp, layerid );
|
||||||
|
|
||||||
|
layername = GetLayerName( layerid );
|
||||||
|
|
||||||
|
Append( layername, layerbmp, (void*) layerid );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns a color index from the layer id
|
||||||
|
int GBR_LAYER_BOX_SELECTOR::GetLayerColor( int aLayerIndex )
|
||||||
|
{
|
||||||
|
GERBVIEW_FRAME* frame = (GERBVIEW_FRAME*) GetParent()->GetParent();
|
||||||
|
|
||||||
|
return frame->GetLayerColor( aLayerIndex );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns the name of the layer id
|
||||||
|
const wxString GBR_LAYER_BOX_SELECTOR::GetLayerName( int aLayerIndex )
|
||||||
|
{
|
||||||
|
wxString name;
|
||||||
|
name.Printf( _( "Layer %d" ), aLayerIndex + 1 );
|
||||||
|
return name;
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
#ifndef CLASS_GBR_LAYER_BOX_SELECTOR_H
|
||||||
|
#define CLASS_GBR_LAYER_BOX_SELECTOR_H 1
|
||||||
|
|
||||||
|
#include <class_layer_box_selector.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* class to display a layer list in GerbView.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
class GBR_LAYER_BOX_SELECTOR : public LAYER_BOX_SELECTOR
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GBR_LAYER_BOX_SELECTOR( wxAuiToolBar* parent, wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
int n = 0, const wxString choices[] = NULL )
|
||||||
|
:LAYER_BOX_SELECTOR( parent, id, pos, size, n, choices )
|
||||||
|
{
|
||||||
|
m_layerhotkeys = false;
|
||||||
|
m_layerorder = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
GBR_LAYER_BOX_SELECTOR( wxAuiToolBar* parent, wxWindowID id,
|
||||||
|
const wxPoint& pos, const wxSize& size,
|
||||||
|
const wxArrayString& choices )
|
||||||
|
:LAYER_BOX_SELECTOR( parent, id, pos, size, choices )
|
||||||
|
{
|
||||||
|
m_layerhotkeys = false;
|
||||||
|
m_layerorder = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Reload the Layers names and bitmaps
|
||||||
|
// Virtual function
|
||||||
|
void Resync();
|
||||||
|
|
||||||
|
// Returns a color index from the layer id
|
||||||
|
// Virtual function
|
||||||
|
int GetLayerColor( int aLayerIndex );
|
||||||
|
|
||||||
|
// Returns true if the layer id is enabled (i.e. is it should be displayed)
|
||||||
|
// Virtual function
|
||||||
|
bool IsLayerEnabled( int aLayerIndex ) { return true; };
|
||||||
|
|
||||||
|
// Returns the name of the layer id
|
||||||
|
// Virtual function
|
||||||
|
const wxString GetLayerName( int aLayerIndex );
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //CLASS_GBR_LAYER_BOX_SELECTOR_H
|
|
@ -0,0 +1,45 @@
|
||||||
|
/**
|
||||||
|
* @file class_gbr_layout.cpp
|
||||||
|
* @brief GBR_LAYOUT class functions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include <fctsys.h>
|
||||||
|
#include <common.h>
|
||||||
|
#include <class_gbr_layout.h>
|
||||||
|
|
||||||
|
GBR_LAYOUT::GBR_LAYOUT()
|
||||||
|
{
|
||||||
|
PAGE_INFO pageInfo( wxT( "GERBER" ) );
|
||||||
|
SetPageSettings( pageInfo );
|
||||||
|
m_printLayersMask = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
GBR_LAYOUT::~GBR_LAYOUT()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Function IsLayerVisible
|
||||||
|
* tests whether a given layer is visible
|
||||||
|
* param aLayerIndex = The index of the layer to be tested
|
||||||
|
* return bool - true if the layer is visible.
|
||||||
|
*/
|
||||||
|
bool GBR_LAYOUT::IsLayerVisible( int aLayerIndex ) const
|
||||||
|
{
|
||||||
|
return m_printLayersMask & (1 << aLayerIndex );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
EDA_RECT GBR_LAYOUT::ComputeBoundingBox()
|
||||||
|
{
|
||||||
|
EDA_RECT bbox;
|
||||||
|
|
||||||
|
for( GERBER_DRAW_ITEM* gerb_item = m_Drawings; gerb_item; gerb_item = gerb_item->Next() )
|
||||||
|
bbox.Merge( gerb_item->GetBoundingBox() );
|
||||||
|
|
||||||
|
SetBoundingBox( bbox );
|
||||||
|
return bbox;
|
||||||
|
}
|
|
@ -0,0 +1,112 @@
|
||||||
|
/**
|
||||||
|
* @file class_gbr_layout.h
|
||||||
|
* @brief Class CLASS_GBR_LAYOUT to handle a board.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CLASS_GBR_LAYOUT_H
|
||||||
|
#define CLASS_GBR_LAYOUT_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <dlist.h>
|
||||||
|
|
||||||
|
// #include <layers_id_colors_and_visibility.h>
|
||||||
|
#include <class_colors_design_settings.h>
|
||||||
|
#include <common.h> // PAGE_INFO
|
||||||
|
#include <class_title_block.h>
|
||||||
|
#include <class_gerber_draw_item.h>
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class GBR_LAYOUT
|
||||||
|
* holds list of GERBER_DRAW_ITEM currently loaded.
|
||||||
|
*/
|
||||||
|
class GBR_LAYOUT
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
EDA_RECT m_BoundingBox;
|
||||||
|
PAGE_INFO m_paper;
|
||||||
|
TITLE_BLOCK m_titles;
|
||||||
|
wxPoint m_originAxisPosition;
|
||||||
|
int m_printLayersMask; // When printing: the list of layers to print
|
||||||
|
public:
|
||||||
|
|
||||||
|
DLIST<GERBER_DRAW_ITEM> m_Drawings; // linked list of Gerber Items
|
||||||
|
|
||||||
|
GBR_LAYOUT();
|
||||||
|
~GBR_LAYOUT();
|
||||||
|
|
||||||
|
const PAGE_INFO& GetPageSettings() const { return m_paper; }
|
||||||
|
void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; }
|
||||||
|
|
||||||
|
const wxPoint& GetOriginAxisPosition() const
|
||||||
|
{
|
||||||
|
return m_originAxisPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetOriginAxisPosition( const wxPoint& aPosition )
|
||||||
|
{
|
||||||
|
m_originAxisPosition = aPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
TITLE_BLOCK& GetTitleBlock()
|
||||||
|
{
|
||||||
|
return m_titles;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetTitleBlock( const TITLE_BLOCK& aTitleBlock )
|
||||||
|
{
|
||||||
|
m_titles = aTitleBlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function ComputeBoundingBox
|
||||||
|
* calculates the bounding box containing all Gerber items.
|
||||||
|
* @return EDA_RECT - the full item list bounding box
|
||||||
|
*/
|
||||||
|
EDA_RECT ComputeBoundingBox();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function GetBoundingBox
|
||||||
|
* may be called soon after ComputeBoundingBox() to return the same EDA_RECT,
|
||||||
|
* as long as the CLASS_GBR_LAYOUT has not changed.
|
||||||
|
*/
|
||||||
|
EDA_RECT GetBoundingBox() const { return m_BoundingBox; } // override
|
||||||
|
|
||||||
|
void SetBoundingBox( const EDA_RECT& aBox ) { m_BoundingBox = aBox; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function Draw.
|
||||||
|
* Redraw the CLASS_GBR_LAYOUT items but not cursors, axis or grid.
|
||||||
|
* @param aPanel = the panel relative to the board
|
||||||
|
* @param aDC = the current device context
|
||||||
|
* @param aDrawMode = GR_COPY, GR_OR ... (not always used)
|
||||||
|
* @param aOffset = an draw offset value
|
||||||
|
*/
|
||||||
|
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
||||||
|
int aDrawMode, const wxPoint& aOffset );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function SetVisibleLayers
|
||||||
|
* changes the bit-mask of visible layers
|
||||||
|
* @param aLayerMask = The new bit-mask of visible layers
|
||||||
|
*/
|
||||||
|
void SetVisibleLayers( int aLayerMask )
|
||||||
|
{
|
||||||
|
m_printLayersMask = aLayerMask;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function IsLayerVisible
|
||||||
|
* tests whether a given layer is visible
|
||||||
|
* @param aLayerIndex = The index of the layer to be tested
|
||||||
|
* @return bool - true if the layer is visible.
|
||||||
|
*/
|
||||||
|
bool IsLayerVisible( int aLayerIndex ) const;
|
||||||
|
|
||||||
|
#if defined(DEBUG)
|
||||||
|
void Show( int nestLevel, std::ostream& os ) const; // overload
|
||||||
|
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // #ifndef CLASS_GBR_LAYOUT_H
|
|
@ -1,7 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* @file classpcb.cpp
|
* @file class_gbr_screen.cpp
|
||||||
* @brief Member functions of classes used in Pcbnew (see pcbstruct.h)
|
|
||||||
* except for tracks (see class_track.cpp).
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <fctsys.h>
|
#include <fctsys.h>
|
||||||
|
@ -24,14 +22,9 @@
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Default Pcbnew zoom values.
|
Default GerbView zoom values.
|
||||||
Limited to 19 values to keep a decent size to menus.
|
Limited to 19 values to keep a decent size to menus.
|
||||||
Roughly a 1.5 progression.
|
Roughly a 1.5 progression.
|
||||||
The last 2 values are handy when somebody uses a library import of a module
|
|
||||||
(or foreign data) which has a bad coordinate.
|
|
||||||
Also useful in GerbView for this reason.
|
|
||||||
Zoom 5 and 10 can create artefacts when drawing (integer overflow in low level graphic
|
|
||||||
functions )
|
|
||||||
*/
|
*/
|
||||||
static const double gbrZoomList[] =
|
static const double gbrZoomList[] =
|
||||||
{
|
{
|
||||||
|
@ -89,29 +82,28 @@ static GRID_TYPE gbrGridList[] =
|
||||||
|
|
||||||
|
|
||||||
GBR_SCREEN::GBR_SCREEN( const wxSize& aPageSizeIU ) :
|
GBR_SCREEN::GBR_SCREEN( const wxSize& aPageSizeIU ) :
|
||||||
PCB_SCREEN( aPageSizeIU )
|
BASE_SCREEN( SCREEN_T )
|
||||||
{
|
{
|
||||||
// Replace zoom and grid lists already set by PCB_SCREEN ctor
|
|
||||||
m_ZoomList.Clear();
|
|
||||||
for( unsigned i = 0; i < DIM( gbrZoomList ); ++i )
|
for( unsigned i = 0; i < DIM( gbrZoomList ); ++i )
|
||||||
m_ZoomList.Add( gbrZoomList[i] );
|
m_ZoomList.push_back( gbrZoomList[i] );
|
||||||
|
|
||||||
GRIDS gridlist;
|
|
||||||
for( unsigned i = 0; i < DIM( gbrGridList ); ++i )
|
for( unsigned i = 0; i < DIM( gbrGridList ); ++i )
|
||||||
gridlist.push_back( gbrGridList[i] );
|
AddGrid( gbrGridList[i] );
|
||||||
SetGridList( gridlist );
|
|
||||||
|
|
||||||
// Set the working grid size to a reasonnable value (in 1/10000 inch)
|
// Set the working grid size to a reasonable value (in 1/10000 inch)
|
||||||
SetGrid( DMIL_GRID( 500 ) );
|
SetGrid( DMIL_GRID( 500 ) );
|
||||||
|
|
||||||
m_Active_Layer = LAYER_N_BACK; // default active layer = bottom layer
|
m_Active_Layer = LAYER_N_BACK; // default active layer = bottom layer
|
||||||
|
|
||||||
SetZoom( ZOOM_FACTOR( 350 ) ); // a default value for zoom
|
SetZoom( ZOOM_FACTOR( 350 ) ); // a default value for zoom
|
||||||
|
|
||||||
|
InitDataPoints( aPageSizeIU );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GBR_SCREEN::~GBR_SCREEN()
|
GBR_SCREEN::~GBR_SCREEN()
|
||||||
{
|
{
|
||||||
|
ClearUndoRedoList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -120,3 +112,13 @@ int GBR_SCREEN::MilsToIuScalar()
|
||||||
{
|
{
|
||||||
return (int)IU_PER_MILS;
|
return (int)IU_PER_MILS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Virtual function needed by classes derived from BASE_SCREEN
|
||||||
|
* this is a virtual pure function in BASE_SCREEN
|
||||||
|
* do nothing in GerbView
|
||||||
|
* could be removed later
|
||||||
|
*/
|
||||||
|
void GBR_SCREEN::ClearUndoORRedoList( UNDO_REDO_CONTAINER&, int )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -7,16 +7,16 @@
|
||||||
|
|
||||||
|
|
||||||
#include <base_units.h>
|
#include <base_units.h>
|
||||||
#include <class_pcb_screen.h>
|
#include <class_base_screen.h>
|
||||||
|
|
||||||
#define ZOOM_FACTOR( x ) ( x * IU_PER_DECIMILS )
|
#define ZOOM_FACTOR( x ) ( x * IU_PER_DECIMILS )
|
||||||
|
|
||||||
|
|
||||||
/* Handle info to display a board */
|
/* Handle info to display a board */
|
||||||
class GBR_SCREEN : public PCB_SCREEN
|
class GBR_SCREEN : public BASE_SCREEN
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
int m_Active_Layer;
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param aPageSizeIU is the size of the initial paper page in internal units.
|
* @param aPageSizeIU is the size of the initial paper page in internal units.
|
||||||
|
@ -27,7 +27,18 @@ public:
|
||||||
|
|
||||||
GBR_SCREEN* Next() { return (GBR_SCREEN*) Pnext; }
|
GBR_SCREEN* Next() { return (GBR_SCREEN*) Pnext; }
|
||||||
|
|
||||||
|
// void SetNextZoom();
|
||||||
|
// void SetPreviousZoom();
|
||||||
|
// void SetLastZoom();
|
||||||
|
|
||||||
virtual int MilsToIuScalar();
|
virtual int MilsToIuScalar();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function ClearUndoORRedoList
|
||||||
|
* virtual pure in BASE_SCREEN, so it must be defined here
|
||||||
|
*/
|
||||||
|
void ClearUndoORRedoList( UNDO_REDO_CONTAINER& aList, int aItemCount = -1 );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // CLASS_GBR_SCREEN_H_
|
#endif // CLASS_GBR_SCREEN_H_
|
||||||
|
|
|
@ -32,18 +32,15 @@
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <trigo.h>
|
#include <trigo.h>
|
||||||
#include <class_drawpanel.h>
|
#include <class_drawpanel.h>
|
||||||
#include <drawtxt.h>
|
|
||||||
#include <macros.h>
|
#include <macros.h>
|
||||||
|
|
||||||
#include <gerbview.h>
|
#include <gerbview.h>
|
||||||
#include <class_board_design_settings.h>
|
|
||||||
#include <colors_selection.h>
|
|
||||||
#include <class_gerber_draw_item.h>
|
#include <class_gerber_draw_item.h>
|
||||||
#include <class_GERBER.h>
|
#include <class_GERBER.h>
|
||||||
|
|
||||||
|
|
||||||
GERBER_DRAW_ITEM::GERBER_DRAW_ITEM( BOARD_ITEM* aParent, GERBER_IMAGE* aGerberparams ) :
|
GERBER_DRAW_ITEM::GERBER_DRAW_ITEM( GBR_LAYOUT* aParent, GERBER_IMAGE* aGerberparams ) :
|
||||||
BOARD_ITEM( aParent, TYPE_GERBER_DRAW_ITEM )
|
EDA_ITEM( (EDA_ITEM*)aParent, TYPE_GERBER_DRAW_ITEM )
|
||||||
{
|
{
|
||||||
m_imageParams = aGerberparams;
|
m_imageParams = aGerberparams;
|
||||||
m_Layer = 0;
|
m_Layer = 0;
|
||||||
|
@ -64,7 +61,7 @@ GERBER_DRAW_ITEM::GERBER_DRAW_ITEM( BOARD_ITEM* aParent, GERBER_IMAGE* aGerberpa
|
||||||
|
|
||||||
// Copy constructor
|
// Copy constructor
|
||||||
GERBER_DRAW_ITEM::GERBER_DRAW_ITEM( const GERBER_DRAW_ITEM& aSource ) :
|
GERBER_DRAW_ITEM::GERBER_DRAW_ITEM( const GERBER_DRAW_ITEM& aSource ) :
|
||||||
BOARD_ITEM( aSource )
|
EDA_ITEM( aSource )
|
||||||
{
|
{
|
||||||
m_imageParams = aSource.m_imageParams;
|
m_imageParams = aSource.m_imageParams;
|
||||||
m_Shape = aSource.m_Shape;
|
m_Shape = aSource.m_Shape;
|
||||||
|
@ -316,16 +313,16 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode,
|
||||||
int radius;
|
int radius;
|
||||||
int halfPenWidth;
|
int halfPenWidth;
|
||||||
static bool show_err;
|
static bool show_err;
|
||||||
BOARD* brd = GetBoard();
|
|
||||||
D_CODE* d_codeDescr = GetDcodeDescr();
|
D_CODE* d_codeDescr = GetDcodeDescr();
|
||||||
|
GERBVIEW_FRAME* gerbFrame = (GERBVIEW_FRAME*) aPanel->GetParent();
|
||||||
|
|
||||||
if( d_codeDescr == NULL )
|
if( d_codeDescr == NULL )
|
||||||
d_codeDescr = &dummyD_CODE;
|
d_codeDescr = &dummyD_CODE;
|
||||||
|
|
||||||
if( brd->IsLayerVisible( GetLayer() ) == false )
|
if( gerbFrame->IsLayerVisible( GetLayer() ) == false )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
color = brd->GetLayerColor( GetLayer() );
|
color = gerbFrame->GetLayerColor( GetLayer() );
|
||||||
|
|
||||||
if( aDrawMode & GR_HIGHLIGHT )
|
if( aDrawMode & GR_HIGHLIGHT )
|
||||||
{
|
{
|
||||||
|
@ -354,12 +351,12 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode,
|
||||||
|
|
||||||
GRSetDrawMode( aDC, aDrawMode );
|
GRSetDrawMode( aDC, aDrawMode );
|
||||||
|
|
||||||
isFilled = DisplayOpt.DisplayPcbTrackFill ? true : false;
|
isFilled = gerbFrame->m_DisplayOptions.m_DisplayLinesFill;
|
||||||
|
|
||||||
switch( m_Shape )
|
switch( m_Shape )
|
||||||
{
|
{
|
||||||
case GBR_POLYGON:
|
case GBR_POLYGON:
|
||||||
isFilled = (g_DisplayPolygonsModeSketch == false);
|
isFilled = gerbFrame->m_DisplayOptions.m_DisplayPolygonsFill;
|
||||||
|
|
||||||
if( !isDark )
|
if( !isDark )
|
||||||
isFilled = true;
|
isFilled = true;
|
||||||
|
@ -419,7 +416,7 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode,
|
||||||
case GBR_SPOT_OVAL:
|
case GBR_SPOT_OVAL:
|
||||||
case GBR_SPOT_POLY:
|
case GBR_SPOT_POLY:
|
||||||
case GBR_SPOT_MACRO:
|
case GBR_SPOT_MACRO:
|
||||||
isFilled = DisplayOpt.DisplayPadFill ? true : false;
|
isFilled = gerbFrame->m_DisplayOptions.m_DisplayFlashedItemsFill;
|
||||||
d_codeDescr->DrawFlashedShape( this, aPanel->GetClipBox(), aDC, color, alt_color,
|
d_codeDescr->DrawFlashedShape( this, aPanel->GetClipBox(), aDC, color, alt_color,
|
||||||
m_Start, isFilled );
|
m_Start, isFilled );
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -30,10 +30,12 @@
|
||||||
#define CLASS_GERBER_DRAW_ITEM_H
|
#define CLASS_GERBER_DRAW_ITEM_H
|
||||||
|
|
||||||
#include <base_struct.h>
|
#include <base_struct.h>
|
||||||
#include <class_board_item.h>
|
#include <dlist.h>
|
||||||
|
|
||||||
|
|
||||||
class GERBER_IMAGE;
|
class GERBER_IMAGE;
|
||||||
|
class GBR_LAYOUT;
|
||||||
|
class D_CODE;
|
||||||
|
|
||||||
|
|
||||||
/* Shapes id for basic shapes ( .m_Shape member ) */
|
/* Shapes id for basic shapes ( .m_Shape member ) */
|
||||||
|
@ -52,7 +54,7 @@ enum Gbr_Basic_Shapes {
|
||||||
|
|
||||||
/***/
|
/***/
|
||||||
|
|
||||||
class GERBER_DRAW_ITEM : public BOARD_ITEM
|
class GERBER_DRAW_ITEM : public EDA_ITEM
|
||||||
{
|
{
|
||||||
// make SetNext() and SetBack() private so that they may not be called from anywhere.
|
// make SetNext() and SetBack() private so that they may not be called from anywhere.
|
||||||
// list management is done on GERBER_DRAW_ITEMs using DLIST<GERBER_DRAW_ITEM> only.
|
// list management is done on GERBER_DRAW_ITEMs using DLIST<GERBER_DRAW_ITEM> only.
|
||||||
|
@ -86,6 +88,8 @@ public:
|
||||||
* redundancy for these parameters
|
* redundancy for these parameters
|
||||||
*/
|
*/
|
||||||
private:
|
private:
|
||||||
|
int m_Layer;
|
||||||
|
|
||||||
// These values are used to draw this item, according to gerber layers parameters
|
// These values are used to draw this item, according to gerber layers parameters
|
||||||
// Because they can change inside a gerber image, they are stored here
|
// Because they can change inside a gerber image, they are stored here
|
||||||
// for each item
|
// for each item
|
||||||
|
@ -98,7 +102,7 @@ private:
|
||||||
double m_lyrRotation; // Fine rotation, from OR parameter, in degrees
|
double m_lyrRotation; // Fine rotation, from OR parameter, in degrees
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GERBER_DRAW_ITEM( BOARD_ITEM* aParent, GERBER_IMAGE* aGerberparams );
|
GERBER_DRAW_ITEM( GBR_LAYOUT* aParent, GERBER_IMAGE* aGerberparams );
|
||||||
GERBER_DRAW_ITEM( const GERBER_DRAW_ITEM& aSource );
|
GERBER_DRAW_ITEM( const GERBER_DRAW_ITEM& aSource );
|
||||||
~GERBER_DRAW_ITEM();
|
~GERBER_DRAW_ITEM();
|
||||||
|
|
||||||
|
@ -113,6 +117,21 @@ public:
|
||||||
GERBER_DRAW_ITEM* Next() const { return (GERBER_DRAW_ITEM*) Pnext; }
|
GERBER_DRAW_ITEM* Next() const { return (GERBER_DRAW_ITEM*) Pnext; }
|
||||||
GERBER_DRAW_ITEM* Back() const { return (GERBER_DRAW_ITEM*) Pback; }
|
GERBER_DRAW_ITEM* Back() const { return (GERBER_DRAW_ITEM*) Pback; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function GetLayer
|
||||||
|
* returns the layer this item is on.
|
||||||
|
*/
|
||||||
|
int GetLayer() const { return m_Layer; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function SetLayer
|
||||||
|
* sets the layer this item is on.
|
||||||
|
* @param aLayer The layer number.
|
||||||
|
* is virtual because some items (in fact: class DIMENSION)
|
||||||
|
* have a slightly different initialization
|
||||||
|
*/
|
||||||
|
void SetLayer( int aLayer ) { m_Layer = aLayer; }
|
||||||
|
|
||||||
int ReturnMaskLayer()
|
int ReturnMaskLayer()
|
||||||
{
|
{
|
||||||
return 1 << m_Layer;
|
return 1 << m_Layer;
|
||||||
|
@ -203,7 +222,7 @@ public:
|
||||||
void Draw( EDA_DRAW_PANEL* aPanel,
|
void Draw( EDA_DRAW_PANEL* aPanel,
|
||||||
wxDC* aDC,
|
wxDC* aDC,
|
||||||
int aDrawMode,
|
int aDrawMode,
|
||||||
const wxPoint&aOffset = ZeroOffset );
|
const wxPoint&aOffset );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function ConvertSegmentToPolygon
|
* Function ConvertSegmentToPolygon
|
||||||
|
@ -270,6 +289,28 @@ public:
|
||||||
*/
|
*/
|
||||||
bool Save( FILE* aFile ) const;
|
bool Save( FILE* aFile ) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function UnLink
|
||||||
|
* detaches this object from its owner.
|
||||||
|
*/
|
||||||
|
void UnLink()
|
||||||
|
{
|
||||||
|
DLIST<GERBER_DRAW_ITEM>* list = (DLIST<GERBER_DRAW_ITEM>*) GetList();
|
||||||
|
wxASSERT( list );
|
||||||
|
|
||||||
|
if( list )
|
||||||
|
list->Remove( this );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function DeleteStructure
|
||||||
|
* deletes this object after UnLink()ing it from its owner.
|
||||||
|
*/
|
||||||
|
void DeleteStructure()
|
||||||
|
{
|
||||||
|
UnLink();
|
||||||
|
delete this;
|
||||||
|
}
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
void Show( int nestLevel, std::ostream& os ) const; // override
|
void Show( int nestLevel, std::ostream& os ) const; // override
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include <class_drawpanel.h>
|
#include <class_drawpanel.h>
|
||||||
#include <pcbstruct.h>
|
#include <pcbstruct.h>
|
||||||
#include <macros.h>
|
#include <macros.h>
|
||||||
#include <class_layer_box_selector.h>
|
#include <class_gbr_layer_box_selector.h>
|
||||||
|
|
||||||
#include <gerbview.h>
|
#include <gerbview.h>
|
||||||
#include <class_GERBER.h>
|
#include <class_GERBER.h>
|
||||||
|
@ -91,7 +91,6 @@ void GERBER_LAYER_WIDGET::SetLayersManagerTabsText( )
|
||||||
*/
|
*/
|
||||||
void GERBER_LAYER_WIDGET::ReFillRender()
|
void GERBER_LAYER_WIDGET::ReFillRender()
|
||||||
{
|
{
|
||||||
BOARD* board = myframe->GetBoard();
|
|
||||||
ClearRenderRows();
|
ClearRenderRows();
|
||||||
|
|
||||||
// Fixed "Rendering" tab rows within the LAYER_WIDGET, only the initial color
|
// Fixed "Rendering" tab rows within the LAYER_WIDGET, only the initial color
|
||||||
|
@ -111,10 +110,9 @@ void GERBER_LAYER_WIDGET::ReFillRender()
|
||||||
{
|
{
|
||||||
if( renderRows[row].color != -1 ) // does this row show a color?
|
if( renderRows[row].color != -1 ) // does this row show a color?
|
||||||
{
|
{
|
||||||
// this window frame must have an established BOARD, i.e. after SetBoard()
|
renderRows[row].color = myframe->GetVisibleElementColor( renderRows[row].id );
|
||||||
renderRows[row].color = board->GetVisibleElementColor( renderRows[row].id );
|
|
||||||
}
|
}
|
||||||
renderRows[row].state = board->IsElementVisible( renderRows[row].id );
|
renderRows[row].state = myframe->IsElementVisible( renderRows[row].id );
|
||||||
}
|
}
|
||||||
|
|
||||||
AppendRenderRows( renderRows, DIM(renderRows) );
|
AppendRenderRows( renderRows, DIM(renderRows) );
|
||||||
|
@ -184,7 +182,7 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
|
||||||
visibleLayers &= ~(1 << row);
|
visibleLayers &= ~(1 << row);
|
||||||
}
|
}
|
||||||
|
|
||||||
myframe->GetBoard()->SetVisibleLayers( visibleLayers );
|
myframe->SetVisibleLayers( visibleLayers );
|
||||||
myframe->GetCanvas()->Refresh();
|
myframe->GetCanvas()->Refresh();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -194,16 +192,15 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
|
||||||
|
|
||||||
void GERBER_LAYER_WIDGET::ReFill()
|
void GERBER_LAYER_WIDGET::ReFill()
|
||||||
{
|
{
|
||||||
BOARD* brd = myframe->GetBoard();
|
|
||||||
int layer;
|
int layer;
|
||||||
ClearLayerRows();
|
ClearLayerRows();
|
||||||
|
|
||||||
for( layer = 0; layer < LAYER_COUNT; layer++ )
|
for( layer = 0; layer < GERBVIEW_LAYER_COUNT; layer++ )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
msg.Printf( _("Layer %d"), layer+1 );
|
msg.Printf( _("Layer %d"), layer+1 );
|
||||||
AppendLayerRow( LAYER_WIDGET::ROW( msg, layer,
|
AppendLayerRow( LAYER_WIDGET::ROW( msg, layer,
|
||||||
brd->GetLayerColor( layer ), wxEmptyString, true ) );
|
myframe->GetLayerColor( layer ), wxEmptyString, true ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
installRightLayerClickHandler();
|
installRightLayerClickHandler();
|
||||||
|
@ -213,7 +210,7 @@ void GERBER_LAYER_WIDGET::ReFill()
|
||||||
|
|
||||||
void GERBER_LAYER_WIDGET::OnLayerColorChange( int aLayer, int aColor )
|
void GERBER_LAYER_WIDGET::OnLayerColorChange( int aLayer, int aColor )
|
||||||
{
|
{
|
||||||
myframe->GetBoard()->SetLayerColor( aLayer, aColor );
|
myframe->SetLayerColor( aLayer, aColor );
|
||||||
myframe->m_SelLayerBox->ResyncBitmapOnly();
|
myframe->m_SelLayerBox->ResyncBitmapOnly();
|
||||||
myframe->GetCanvas()->Refresh();
|
myframe->GetCanvas()->Refresh();
|
||||||
}
|
}
|
||||||
|
@ -234,15 +231,14 @@ bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer )
|
||||||
|
|
||||||
void GERBER_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFinal )
|
void GERBER_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFinal )
|
||||||
{
|
{
|
||||||
BOARD* brd = myframe->GetBoard();
|
int visibleLayers = myframe->GetVisibleLayers();
|
||||||
int visibleLayers = brd->GetVisibleLayers();
|
|
||||||
|
|
||||||
if( isVisible )
|
if( isVisible )
|
||||||
visibleLayers |= (1 << aLayer);
|
visibleLayers |= (1 << aLayer);
|
||||||
else
|
else
|
||||||
visibleLayers &= ~(1 << aLayer);
|
visibleLayers &= ~(1 << aLayer);
|
||||||
|
|
||||||
brd->SetVisibleLayers( visibleLayers );
|
myframe->SetVisibleLayers( visibleLayers );
|
||||||
|
|
||||||
if( isFinal )
|
if( isFinal )
|
||||||
myframe->GetCanvas()->Refresh();
|
myframe->GetCanvas()->Refresh();
|
||||||
|
@ -250,15 +246,13 @@ void GERBER_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFin
|
||||||
|
|
||||||
void GERBER_LAYER_WIDGET::OnRenderColorChange( int aId, int aColor )
|
void GERBER_LAYER_WIDGET::OnRenderColorChange( int aId, int aColor )
|
||||||
{
|
{
|
||||||
myframe->GetBoard()->SetVisibleElementColor( aId, aColor );
|
myframe->SetVisibleElementColor( aId, aColor );
|
||||||
myframe->GetCanvas()->Refresh();
|
myframe->GetCanvas()->Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
|
void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
|
||||||
{
|
{
|
||||||
BOARD* brd = myframe->GetBoard();
|
myframe->SetElementVisibility( aId, isEnabled );
|
||||||
brd->SetElementVisibility( aId, isEnabled );
|
|
||||||
|
|
||||||
myframe->GetCanvas()->Refresh();
|
myframe->GetCanvas()->Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ void GERBVIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
|
||||||
|
|
||||||
if( aHotKey )
|
if( aHotKey )
|
||||||
{
|
{
|
||||||
OnHotKey( aDC, aHotKey, NULL );
|
OnHotKey( aDC, aHotKey, aPosition );
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatusBar();
|
UpdateStatusBar();
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue