diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 578067882b..b9763985bc 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,27 @@ KiCad ChangeLog 2010 Please add newer entries at the top, list the date and your name with email address. +2010-dec-15, UPDATE Jean-Pierre Charras +================================================================================ +Gerbview: + Added: in file dialog, multiple file selection. + Added: Draw mode selector (in left toolbar): + Raw mode: + a Gerber image is drawn on screen without buffering. + Artifacts happen if there are negative items drawn, if more than one + Gerber file is shown. + Stacked mode: + each Geber image is drawn in a buffer and after drawn on screen + No artifact with negative items. + Each Gerber image covers previous images. + OR mode (transparency mode): + each Geber image is drawn in a buffer and after drawn on screen + No artifact with negative items. + Each Gerber image is "ORed" with previous images, like in Pcbnew. + Try to optimize Draw function in buffered modes. + (Useful for PC that have problems with "blit" graphic function) + Fix minor issues. + 2010-dec-13 UPDATE Wayne Stambaugh ================================================================================ * Remove deprecated options and quoted project name option in Doxygen file. diff --git a/bitmaps/CMakeLists.txt b/bitmaps/CMakeLists.txt index 933ca0a295..a13637497c 100644 --- a/bitmaps/CMakeLists.txt +++ b/bitmaps/CMakeLists.txt @@ -135,6 +135,9 @@ set(BITMAP_SRCS Flag.xpm Fonts.xpm Footprint_Text.xpm + gbr_select_mode0.xpm + gbr_select_mode1.xpm + gbr_select_mode2.xpm general_deletions.xpm general_ratsnet.xpm GLabel2Label.xpm diff --git a/bitmaps/gbr_select_mode0.xpm b/bitmaps/gbr_select_mode0.xpm new file mode 100644 index 0000000000..69dca9e0b1 --- /dev/null +++ b/bitmaps/gbr_select_mode0.xpm @@ -0,0 +1,38 @@ +/* XPM */ +const char *gbr_select_mode0_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 16 1", +": c #BC9694", +"% c #B43B3C", +"& c #B46A6C", +"* c #643E3C", +"O c #8C8D8C", +"$ c #8C1A1C", +"- c #7C2A2C", +"X c #717071", +"o c None", +". c #4C4E4C", +"= c #BC9A9C", +"+ c #ACAAAC", +"# c #AC0204", +" c #585858", +"@ c #AC1614", +"; c #AC0A0C", +/* pixels */ +" ............Xoo", +"X............ oo", +"O.............+o", +"+.............Oo", +"o ............Xo", +"oX............ o", +"@############$.+", +"%#############.O", +"&#############*X", +"=#############- ", +"o;############%o", +"o%############;o", +"o&#############=", +"o:#############&", +"oo;############%", +"oo%############@" +}; diff --git a/bitmaps/gbr_select_mode1.xpm b/bitmaps/gbr_select_mode1.xpm new file mode 100644 index 0000000000..bceb927874 --- /dev/null +++ b/bitmaps/gbr_select_mode1.xpm @@ -0,0 +1,38 @@ +/* XPM */ +const char *gbr_select_mode1_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 16 1", +": c #BC9694", +"; c #4C4604", +"% c #B43B3C", +"= c #246604", +"* c #B46A6C", +"+ c #9CB29C", +"X c None", +"$ c #742A04", +"O c #94B294", +"- c #BC9A9C", +"# c #AC0204", +"& c #047E04", +"@ c #AC1614", +" c #058205", +". c #3C943C", +"o c #6CA56C", +/* pixels */ +" .XX", +". XX", +"o OX", +"+ oX", +"X .X", +"X. X", +"@############$ +", +"%#############&o", +"*#############=.", +"-#############; ", +"X#############%X", +"X%#############X", +"X*#############-", +"X:#############*", +"XX#############%", +"XX%############@" +}; diff --git a/bitmaps/gbr_select_mode2.xpm b/bitmaps/gbr_select_mode2.xpm new file mode 100644 index 0000000000..d74262d12e --- /dev/null +++ b/bitmaps/gbr_select_mode2.xpm @@ -0,0 +1,38 @@ +/* XPM */ +const char *gbr_select_mode2_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 16 1", +"$ c #213C2F", +"X c #3C3C94", +"O c #6C6AA4", +"* c #8D3616", +" c #0E1F72", +"; c #B28D96", +"o c None", +". c #040284", +"+ c #A2A89F", +"# c #04562C", +"@ c #38783C", +"- c #BC6B6C", +"% c #599A5F", +"= c #751F14", +"& c #BC4745", +": c #745224", +/* pixels */ +" ............Xoo", +"X.............oo", +"O.............+o", +"@############$Oo", +"%#############Xo", +"+@############ o", +"&*===========$ +", +"-*============$O", +";*============$X", +"+&============$ ", +"o&************:+", +"o-*************%", +"o;*************@", +"o+&&&&&&&&&&&&&;", +"oo&&&&&&&&&&&&&-", +"oo-&&&&&&&&&&&&&" +}; diff --git a/bitmaps/sources/gbr_select_mode0.svg b/bitmaps/sources/gbr_select_mode0.svg new file mode 100644 index 0000000000..933d112b2d --- /dev/null +++ b/bitmaps/sources/gbr_select_mode0.svg @@ -0,0 +1,325 @@ + + + + + fabrication.svg + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + + + fabrication.svg + + + + + + + + + + + + + + + + diff --git a/bitmaps/sources/gbr_select_mode1.svg b/bitmaps/sources/gbr_select_mode1.svg new file mode 100644 index 0000000000..55c507ac38 --- /dev/null +++ b/bitmaps/sources/gbr_select_mode1.svg @@ -0,0 +1,325 @@ + + + + + fabrication.svg + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + + + fabrication.svg + + + + + + + + + + + + + + + + diff --git a/bitmaps/sources/gbr_select_mode2.svg b/bitmaps/sources/gbr_select_mode2.svg new file mode 100644 index 0000000000..9d3624309f --- /dev/null +++ b/bitmaps/sources/gbr_select_mode2.svg @@ -0,0 +1,252 @@ + + + + + fabrication.svg + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + + + fabrication.svg + + + + + + + + + + + + + + + + + diff --git a/demos/electric/electric.cache.lib b/demos/electric/electric-cache.lib similarity index 82% rename from demos/electric/electric.cache.lib rename to demos/electric/electric-cache.lib index fb843e3767..96015f0052 100644 --- a/demos/electric/electric.cache.lib +++ b/demos/electric/electric-cache.lib @@ -1,484 +1,483 @@ -EESchema-LIBRARY Version 4/1/2006-10:40:00 -# -# -# A_1KVA -# -DEF A_1KVA EA 0 10 N Y 1 F N -F0 "EA" -90 200 40 H V C C -F1 "A_1KVA" 0 130 40 H V C C -DRAW -P 5 0 1 0 0 -30 -20 -50 20 -50 0 -30 0 -30 F -C 20 10 31 0 1 0 N -P 4 0 1 0 50 10 80 10 100 0 100 0 N -P 2 0 0 0 200 -200 200 -200 N -C -20 10 31 0 1 0 N -S -120 60 120 -60 0 1 0 N -P 4 0 1 0 -100 0 -80 10 -50 10 -50 10 N -X ~ 1 200 0 100 L 10 40 1 1 w -X ~ 2 -200 0 100 R 10 40 1 1 w -X ~ 3 0 -100 50 U 10 50 1 1 I -ENDDRAW -ENDDEF -# -# C_3x1.5mm2 -# -DEF C_3x1.5mm2 EC 0 10 N Y 1 F N -F0 "EC" -170 130 40 H V C C -F1 "C_3x1.5mm2" 0 -100 40 H V C C -DRAW -C -30 50 10 0 1 0 F -P 3 0 1 0 -110 50 -30 -50 -30 -50 N -P 3 0 1 0 -30 50 50 -50 50 -50 N -P 3 0 1 0 -130 50 -90 50 -90 50 N -P 3 0 1 0 10 50 90 -50 90 -50 N -P 4 0 1 0 -100 0 100 0 100 0 100 0 N -P 2 0 0 0 200 -200 200 -200 N -X ~ 1 200 0 100 L 10 40 1 1 W -X ~ 2 -200 0 100 R 10 40 1 1 w -ENDDRAW -ENDDEF -# -# C_3x2.5mm2 -# -DEF C_3x2.5mm2 EC 0 10 N Y 1 F N -F0 "EC" -170 130 40 H V C C -F1 "C_3x2.5mm2" 0 -100 40 H V C C -DRAW -C -30 50 10 0 1 0 F -P 3 0 1 0 -110 50 -30 -50 -30 -50 N -P 3 0 1 0 -30 50 50 -50 50 -50 N -P 3 0 1 0 -130 50 -90 50 -90 50 N -P 3 0 1 0 10 50 90 -50 90 -50 N -P 4 0 1 0 -100 0 100 0 100 0 100 0 N -P 2 0 0 0 200 -200 200 -200 N -X ~ 1 200 0 100 L 10 40 1 1 W -X ~ 2 -200 0 100 R 10 40 1 1 w -ENDDRAW -ENDDEF -# -# C_3x6mm2 -# -DEF C_3x6mm2 EC 0 10 N Y 1 F N -F0 "EC" -170 130 40 H V C C -F1 "C_3x6mm2" 0 -100 40 H V C C -DRAW -C -30 50 10 0 1 0 F -P 3 0 1 0 -110 50 -30 -50 -30 -50 N -P 3 0 1 0 -30 50 50 -50 50 -50 N -P 3 0 1 0 -130 50 -90 50 -90 50 N -P 3 0 1 0 10 50 90 -50 90 -50 N -P 4 0 1 0 -100 0 100 0 100 0 100 0 N -P 2 0 0 0 200 -200 200 -200 N -X ~ 1 200 0 100 L 10 40 1 1 W -X ~ 2 -200 0 100 R 10 40 1 1 w -ENDDRAW -ENDDEF -# -# D_06A -# -DEF D_06A ED 0 10 N Y 1 F N -F0 "ED" -160 120 40 H V C C -F1 "D_06A" -100 -80 40 H V C C -DRAW -P 3 0 1 0 60 20 100 -20 100 -20 N -P 3 0 1 0 100 20 60 -20 60 -20 N -P 3 0 1 0 -100 0 60 100 60 100 N -P 2 0 0 0 200 -200 200 -200 N -X ~ 1 200 0 120 L 10 40 1 1 W -X ~ 2 -200 0 100 R 10 40 1 1 w -ENDDRAW -ENDDEF -# -# D_10A -# -DEF D_10A ED 0 10 N Y 1 F N -F0 "ED" -160 120 40 H V C C -F1 "D_10A" -100 -80 40 H V C C -DRAW -P 3 0 1 0 60 20 100 -20 100 -20 N -P 3 0 1 0 100 20 60 -20 60 -20 N -P 3 0 1 0 -100 0 60 100 60 100 N -P 2 0 0 0 200 -200 200 -200 N -X ~ 1 200 0 120 L 10 40 1 1 W -X ~ 2 -200 0 100 R 10 40 1 1 w -ENDDRAW -ENDDEF -# -# D_16A -# -DEF D_16A ED 0 10 N Y 1 F N -F0 "ED" -160 120 40 H V C C -F1 "D_16A" -100 -80 40 H V C C -DRAW -P 3 0 1 0 60 20 100 -20 100 -20 N -P 3 0 1 0 100 20 60 -20 60 -20 N -P 3 0 1 0 -100 0 60 100 60 100 N -P 2 0 0 0 200 -200 200 -200 N -X ~ 1 200 0 120 L 10 40 1 1 W -X ~ 2 -200 0 100 R 10 40 1 1 w -ENDDRAW -ENDDEF -# -# D_32A -# -DEF D_32A ED 0 10 N Y 1 F N -F0 "ED" -160 120 40 H V C C -F1 "D_32A" -100 -80 40 H V C C -DRAW -P 3 0 1 0 60 20 100 -20 100 -20 N -P 3 0 1 0 100 20 60 -20 60 -20 N -P 3 0 1 0 -100 0 60 100 60 100 N -P 2 0 0 0 200 -200 200 -200 N -X ~ 1 200 0 120 L 10 40 1 1 W -X ~ 2 -200 0 100 R 10 40 1 1 w -ENDDRAW -ENDDEF -# -# G_Th_3KVA -# -DEF G_Th_3KVA EG 0 10 N Y 1 F N -F0 "EG" -160 120 40 H V C C -F1 "G_Th_3KVA" 0 -120 40 H V C C -DRAW -P 2 0 0 0 200 -200 200 -200 N -C 0 0 84 0 1 0 N -T 0 0 0 70 0 0 0 G -X ~ 1 200 0 118 L 10 40 1 1 w -ENDDRAW -ENDDEF -# -# I_25A_LUM -# -DEF I_25A_LUM EI 0 10 N Y 1 F N -F0 "EI" -160 120 40 H V C C -F1 "I_25A_LUM" 0 -100 40 H V C C -DRAW -P 3 0 1 0 30 20 -30 -20 -30 -20 N -P 4 0 1 0 -20 30 20 -30 20 -30 20 -30 N -C 0 0 36 0 1 0 N -P 3 0 1 0 -100 0 60 100 60 100 N -P 2 0 0 0 200 -200 200 -200 N -X ~ 1 200 0 120 L 10 40 1 1 W -X ~ 2 -200 0 100 R 10 40 1 1 w -ENDDRAW -ENDDEF -# -# J_40A_30mA -# -DEF J_40A_30mA EJ 0 10 N Y 1 F N -F0 "EJ" -210 180 40 H V C C -F1 "J_40A_30mA" -20 -120 40 H V C C -DRAW -P 5 0 0 0 120 20 120 -20 120 -20 120 -20 120 -20 N -P 10 0 1 0 60 80 60 200 80 200 80 220 160 220 180 200 160 180 80 180 80 200 80 200 N -P 5 0 1 0 -140 -60 -100 -60 -100 -60 -100 -60 -100 -60 N -P 3 0 1 0 -140 60 -140 -60 -140 -60 N -P 3 0 1 0 -60 0 100 100 100 100 N -P 2 0 0 0 200 -200 200 -200 N -A -120 60 20 1799 1 0 1 0 N -140 60 -100 60 -P 3 0 1 0 -140 0 -60 0 -60 0 N -P 5 0 1 0 -100 60 -100 -60 -100 -40 -100 -40 -100 -40 N -P 6 0 1 0 -120 80 -120 120 40 120 40 60 40 60 40 60 N -T 0 120 200 20 0 0 0 OFS -X ~ 1 250 0 130 L 10 40 1 1 W -X ~ 3 250 200 70 L 10 10 1 1 O -X ~ 2 -250 0 110 R 10 40 1 1 w -ENDDRAW -ENDDEF -# -# O_600VA -# -DEF O_600VA EO 0 10 N Y 1 F N -F0 "EO" -70 120 40 H V C C -F1 "O_600VA" -40 -150 40 H V C C -DRAW -P 3 0 1 0 -20 -40 -20 -80 -20 -80 N -P 3 0 1 0 -70 -50 -70 -70 -70 -70 N -S -110 40 120 -90 0 1 0 N -P 3 0 1 0 -40 -40 -40 -80 -40 -80 N -P 3 0 1 0 -60 -40 -60 -80 -60 -80 N -P 3 0 1 0 -90 -50 -90 -70 -90 -70 N -P 3 0 1 0 -30 -50 -30 -70 -30 -70 N -P 4 0 1 0 90 -50 90 -70 90 -70 90 -70 N -P 3 0 1 0 40 -40 40 -80 40 -80 N -P 3 0 1 0 -100 0 -50 0 -50 0 N -P 3 0 1 0 80 -40 80 -80 80 -80 N -P 3 0 1 0 -80 -40 -80 -80 -80 -80 N -P 3 0 1 0 -10 -50 -10 -70 -10 -70 N -P 3 0 1 0 60 -40 60 -80 60 -80 N -C -20 0 31 0 1 0 N -P 3 0 1 0 10 -50 10 -70 10 -70 N -P 3 0 1 0 20 -40 20 -80 20 -80 N -P 2 0 0 0 200 -200 200 -200 N -P 5 0 1 0 -100 -60 100 -60 100 -60 100 -60 100 -60 N -P 3 0 1 0 50 -50 50 -70 50 -70 N -P 3 0 1 0 70 -50 70 -70 70 -70 N -C 20 0 31 0 1 0 N -P 3 0 1 0 100 -40 100 -80 100 -80 N -P 3 0 1 0 -50 -50 -50 -70 -50 -70 N -P 3 0 1 0 50 0 100 0 100 0 N -P 3 0 1 0 30 -50 30 -70 30 -70 N -P 3 0 1 0 0 -40 0 -80 0 -80 N -X ~ 1 200 0 100 L 10 40 1 1 W -X ~ 2 -200 0 100 R 10 40 1 1 w -ENDDRAW -ENDDEF -# -# O_900VA -# -DEF O_900VA EO 0 10 N Y 1 F N -F0 "EO" -70 120 40 H V C C -F1 "O_900VA" -40 -150 40 H V C C -DRAW -P 3 0 1 0 -20 -40 -20 -80 -20 -80 N -P 3 0 1 0 -70 -50 -70 -70 -70 -70 N -S -110 40 120 -90 0 1 0 N -P 3 0 1 0 -40 -40 -40 -80 -40 -80 N -P 3 0 1 0 -60 -40 -60 -80 -60 -80 N -P 3 0 1 0 -90 -50 -90 -70 -90 -70 N -P 3 0 1 0 -30 -50 -30 -70 -30 -70 N -P 4 0 1 0 90 -50 90 -70 90 -70 90 -70 N -P 3 0 1 0 40 -40 40 -80 40 -80 N -P 3 0 1 0 -100 0 -50 0 -50 0 N -P 3 0 1 0 80 -40 80 -80 80 -80 N -P 3 0 1 0 -80 -40 -80 -80 -80 -80 N -P 3 0 1 0 -10 -50 -10 -70 -10 -70 N -P 3 0 1 0 60 -40 60 -80 60 -80 N -C -20 0 31 0 1 0 N -P 3 0 1 0 10 -50 10 -70 10 -70 N -P 3 0 1 0 20 -40 20 -80 20 -80 N -P 2 0 0 0 200 -200 200 -200 N -P 5 0 1 0 -100 -60 100 -60 100 -60 100 -60 100 -60 N -P 3 0 1 0 50 -50 50 -70 50 -70 N -P 3 0 1 0 70 -50 70 -70 70 -70 N -C 20 0 31 0 1 0 N -P 3 0 1 0 100 -40 100 -80 100 -80 N -P 3 0 1 0 -50 -50 -50 -70 -50 -70 N -P 3 0 1 0 50 0 100 0 100 0 N -P 3 0 1 0 30 -50 30 -70 30 -70 N -P 3 0 1 0 0 -40 0 -80 0 -80 N -X ~ 1 200 0 100 L 10 40 1 1 W -X ~ 2 -200 0 100 R 10 40 1 1 w -ENDDRAW -ENDDEF -# -# P_10A -# -DEF P_10A EP 0 10 N Y 1 F N -F0 "EP" -160 120 40 H V C C -F1 "P_10A" -80 -140 40 H V C C -DRAW -A 0 0 80 891 -891 0 0 0 N 1 80 1 -80 -P 2 0 0 0 200 -200 200 -200 N -X ~ 1 200 0 120 L 10 40 1 1 W -ENDDRAW -ENDDEF -# -# Q_25A_2F2O -# -DEF Q_25A_2F2O EQ 0 10 N Y 1 F N -F0 "EQ" -160 120 40 H V C C -F1 "Q_25A_2F2O" 0 -140 40 H V C C -DRAW -P 3 0 0 0 20 100 20 60 20 60 N -P 3 0 1 0 -100 0 60 100 60 100 N -S -100 -30 100 -70 0 0 0 N -P 4 0 0 0 -100 -30 -100 -30 100 -70 100 -70 N -P 3 0 0 0 0 60 0 -60 0 -60 N -P 5 0 1 0 20 60 20 50 100 50 100 50 100 50 N -P 2 0 0 0 200 -200 200 -200 N -P 3 0 0 0 40 100 40 90 40 90 N -P 12 0 1 0 40 100 40 150 50 150 50 160 50 170 120 170 140 150 120 130 60 130 50 130 50 150 50 150 N -T 0 90 150 20 0 0 0 O+F -X ~ 4 200 -50 100 L 10 40 1 1 I -X ~ 3 200 0 120 L 10 40 1 1 U -X ~ 2 200 50 100 L 10 40 1 1 U -X ~ 5 200 150 60 L 10 40 1 1 U -X ~ 1 -200 0 100 R 10 40 1 1 U -ENDDRAW -ENDDEF -# -# Q_2A_12O_40KV -# -DEF Q_2A_12O_40KV EQ 0 10 N Y 1 F N -F0 "EQ" -160 120 40 H V C C -F1 "Q_2A_12O_40KV" 0 -730 40 H V C C -DRAW -P 3 0 1 0 0 -580 0 20 0 20 N -P 3 0 1 0 -100 -200 80 -170 80 -170 N -P 3 0 1 0 -100 -500 80 -470 80 -470 N -P 3 0 1 0 -100 -300 80 -270 80 -270 N -P 3 0 1 0 -100 -350 80 -320 80 -320 N -P 3 0 1 0 -100 -400 80 -370 80 -370 N -P 5 0 1 0 -100 0 80 30 80 30 80 30 80 30 N -P 3 0 1 0 -100 -150 80 -120 80 -120 N -P 3 0 1 0 -100 -450 80 -420 80 -420 N -P 3 0 1 0 -100 -100 80 -70 80 -70 N -P 6 0 1 0 -100 -50 80 -20 80 -20 80 -20 80 -20 80 -20 N -P 3 0 1 0 -100 -550 80 -520 80 -520 N -P 4 0 0 0 -100 -580 -100 -580 100 -620 100 -620 N -P 2 0 0 0 200 -200 200 -200 N -S -100 -580 100 -620 0 0 0 N -P 3 0 1 0 -100 -250 80 -220 80 -220 N -X ~ 25 200 -600 100 L 10 40 1 1 I -X ~ 24 200 -550 120 L 10 40 1 1 U -X ~ 22 200 -500 120 L 10 40 1 1 U -X ~ 20 200 -450 120 L 10 40 1 1 U -X ~ 18 200 -400 120 L 10 40 1 1 U -X ~ 16 200 -350 120 L 10 40 1 1 U -X ~ 14 200 -300 120 L 10 40 1 1 U -X ~ 12 200 -250 120 L 10 40 1 1 U -X ~ 10 200 -200 120 L 10 40 1 1 U -X ~ 8 200 -150 120 L 10 40 1 1 U -X ~ 6 200 -100 120 L 10 40 1 1 U -X ~ 4 200 -50 120 L 10 50 1 1 U -X ~ 2 200 0 120 L 10 40 1 1 U -X ~ 23 -200 -550 100 R 10 50 1 1 U -X ~ 21 -200 -500 100 R 10 50 1 1 U -X ~ 19 -200 -450 100 R 10 50 1 1 U -X ~ 17 -200 -400 100 R 10 50 1 1 U -X ~ 15 -200 -350 100 R 10 50 1 1 U -X ~ 13 -200 -300 100 R 10 50 1 1 U -X ~ 11 -200 -250 100 R 10 50 1 1 U -X ~ 9 -200 -200 100 R 10 50 1 1 U -X ~ 7 -200 -150 100 R 10 50 1 1 U -X ~ 5 -200 -100 100 R 10 50 1 1 U -X ~ 3 -200 -50 100 R 10 50 1 1 U -X ~ 3 -200 -50 100 R 10 50 1 1 U -X ~ 1 -200 0 100 R 10 40 1 1 U -ENDDRAW -ENDDEF -# -# R_16A_30mA -# -DEF R_16A_30mA ER 0 10 N Y 1 F N -F0 "ER" -210 180 40 H V C C -F1 "R_16A_30mA" 0 -200 40 H V C C -DRAW -P 3 0 0 0 20 -50 20 50 20 50 N -P 2 0 0 0 400 -200 400 -200 N -P 3 0 1 0 -60 0 100 100 100 100 N -P 5 0 1 0 -100 60 -100 -60 -100 -40 -100 -40 -100 -40 N -C 20 -100 50 0 1 0 N -P 2 0 0 0 200 -200 200 -200 N -P 3 0 1 0 140 20 100 -20 100 -20 N -P 4 0 1 0 100 20 140 -20 140 -20 140 -20 N -P 5 0 1 0 -140 -60 -100 -60 -100 -60 -100 -60 -100 -60 N -P 3 0 1 0 -140 60 -140 -60 -140 -60 N -A -120 60 20 1799 1 0 1 0 N -140 60 -100 60 -P 10 0 1 0 60 80 60 200 80 200 80 220 160 220 180 200 160 180 80 180 80 200 80 200 N -P 6 0 1 0 -120 80 -120 120 40 120 40 60 40 60 40 60 N -P 3 0 1 0 -140 0 -60 0 -60 0 N -T 0 20 -100 50 0 0 0 M -T 0 120 200 20 0 0 0 OF -X ~ 4 250 -100 180 L 10 50 1 1 I -X ~ 1 250 0 130 L 10 40 1 1 W -X ~ 3 250 200 70 L 10 10 1 1 O -X ~ 2 -250 0 110 R 10 40 1 1 w -ENDDRAW -ENDDEF -# -# S_63A -# -DEF S_63A ES 0 10 N Y 1 F N -F0 "ES" -210 180 40 H V C C -F1 "S_63A" 0 -110 40 H V C C -DRAW -P 5 0 1 0 -140 -60 -100 -60 -100 -60 -100 -60 -100 -60 N -P 3 0 1 0 -140 60 -140 -60 -140 -60 N -P 3 0 0 0 120 20 120 -20 120 -20 N -P 3 0 1 0 -140 60 -100 60 -100 60 N -P 2 0 0 0 200 -200 200 -200 N -P 2 0 0 0 400 -200 400 -200 N -P 3 0 1 0 -120 60 -120 80 -120 80 N -P 5 0 1 0 -100 60 -100 -60 -100 -40 -100 -40 -100 -40 N -P 3 0 1 0 -60 0 100 100 100 100 N -P 3 0 1 0 -140 0 -60 0 -60 0 N -P 10 0 1 0 60 80 60 200 80 200 80 220 160 220 180 200 160 180 80 180 80 200 80 200 N -P 6 0 1 0 -120 80 -120 120 40 120 40 60 40 60 40 60 N -P 3 0 0 0 -150 0 -100 0 -100 0 N -T 0 120 200 20 0 0 0 OFS -X ~ 1 250 0 130 L 10 40 1 1 W -X ~ 3 250 200 70 L 10 10 1 1 O -X ~ 2 -250 0 100 R 10 40 1 1 w -ENDDRAW -ENDDEF -# -# V_A10A -# -DEF V_A10A EV 0 10 N Y 1 F N -F0 "EV" -160 120 40 H V C C -F1 "V_A10A" -60 -140 40 H V C C -DRAW -P 3 0 1 0 -100 0 -80 0 -80 0 N -C 0 0 84 0 1 0 N -P 2 0 0 0 200 -200 200 -200 N -T 0 0 0 70 0 0 0 A -X ~ 2 200 0 118 L 10 40 1 1 w -X ~ 1 -200 0 100 R 10 40 1 1 W -ENDDRAW -ENDDEF -# -# V_F50Hz -# -DEF V_F50Hz EV 0 10 N Y 1 F N -F0 "EV" -160 120 40 H V C C -F1 "V_F50Hz" -40 -140 40 H V C C -DRAW -P 2 0 0 0 200 -200 200 -200 N -C 0 0 84 0 1 0 N -T 0 0 0 50 0 0 0 Hz -X ~ 1 200 0 118 L 10 40 1 1 W -ENDDRAW -ENDDEF -# -# V_U400V -# -DEF V_U400V EV 0 10 N Y 1 F N -F0 "EV" -160 120 40 H V C C -F1 "V_U400V" -60 -140 40 H V C C -DRAW -C 0 0 84 0 1 0 N -P 2 0 0 0 200 -200 200 -200 N -T 0 0 0 70 0 0 0 V -X ~ 1 200 0 118 L 10 40 1 1 W -ENDDRAW -ENDDEF -# -# W_15KA -# -DEF W_15KA EW 0 10 N Y 1 F N -F0 "EW" -160 120 40 H V C C -F1 "W_15KA" -50 -210 40 H V C C -DRAW -P 7 0 1 0 -80 0 -40 0 -80 40 -80 0 -80 -40 -40 0 -40 0 F -P 8 0 1 0 80 0 40 0 80 40 80 -40 80 0 80 -40 40 0 40 0 F -P 2 0 0 0 200 -200 200 -200 N -S -10 -40 10 -60 0 1 0 N -S -120 60 120 -60 0 1 0 N -P 3 0 1 0 -100 0 -80 0 -80 0 N -X ~ 1 200 0 100 L 10 40 1 1 W -X ~ 2 -200 0 100 R 10 40 1 1 w -X ~ 3 0 -100 50 U 10 50 1 1 O -ENDDRAW -ENDDEF -# -# Y_ELC -# -DEF Y_ELC EY 0 10 N Y 1 F N -F0 "EY" -10 120 40 H V C C -F1 "Y_ELC" 60 -120 40 H V C C -DRAW -P 3 0 0 0 -50 10 -50 -10 -50 -10 N -P 3 0 0 0 -30 30 -30 -30 -30 -30 N -P 3 0 0 0 -40 20 -40 -20 -40 -20 N -P 3 0 0 0 -10 50 -10 -50 -10 -50 N -P 4 0 0 0 -60 0 70 0 80 0 70 0 N -P 4 0 0 0 -20 40 -20 -40 -20 -40 -20 -40 N -P 4 0 0 0 0 60 0 60 0 -60 0 -60 N -P 2 0 0 0 200 -200 200 -200 N -X ~ 1 200 0 118 L 10 40 1 1 W -ENDDRAW -ENDDEF -# -#EndLibrary +EESchema-LIBRARY Version 2.3 Date: 09/02/2010 21:35:02 +# +# A_1KVA +# +DEF A_1KVA EA 0 10 N Y 1 F N +F0 "EA" -90 200 40 H V C CNN +F1 "A_1KVA" 0 130 40 H V C CNN +DRAW +P 2 0 0 0 200 -200 200 -200 N +C -20 10 31 0 1 0 N +C 20 10 31 0 1 0 N +S -120 60 120 -60 0 1 0 N +P 4 0 1 0 -100 0 -80 10 -50 10 -50 10 N +P 4 0 1 0 50 10 80 10 100 0 100 0 N +P 5 0 1 0 0 -30 -20 -50 20 -50 0 -30 0 -30 F +X ~ 1 200 0 100 L 10 40 1 1 w +X ~ 2 -200 0 100 R 10 40 1 1 w +X ~ 3 0 -100 50 U 10 50 1 1 I +ENDDRAW +ENDDEF +# +# C_3x1.5mm2 +# +DEF C_3x1.5mm2 EC 0 10 N Y 1 F N +F0 "EC" -170 130 40 H V C CNN +F1 "C_3x1.5mm2" 0 -100 40 H V C CNN +DRAW +P 2 0 0 0 200 -200 200 -200 N +C -30 50 10 0 1 0 F +P 3 0 1 0 -130 50 -90 50 -90 50 N +P 3 0 1 0 -110 50 -30 -50 -30 -50 N +P 3 0 1 0 -30 50 50 -50 50 -50 N +P 3 0 1 0 10 50 90 -50 90 -50 N +P 4 0 1 0 -100 0 100 0 100 0 100 0 N +X ~ 1 200 0 100 L 10 40 1 1 W +X ~ 2 -200 0 100 R 10 40 1 1 w +ENDDRAW +ENDDEF +# +# C_3x2.5mm2 +# +DEF C_3x2.5mm2 EC 0 10 N Y 1 F N +F0 "EC" -170 130 40 H V C CNN +F1 "C_3x2.5mm2" 0 -100 40 H V C CNN +DRAW +P 2 0 0 0 200 -200 200 -200 N +C -30 50 10 0 1 0 F +P 3 0 1 0 -130 50 -90 50 -90 50 N +P 3 0 1 0 -110 50 -30 -50 -30 -50 N +P 3 0 1 0 -30 50 50 -50 50 -50 N +P 3 0 1 0 10 50 90 -50 90 -50 N +P 4 0 1 0 -100 0 100 0 100 0 100 0 N +X ~ 1 200 0 100 L 10 40 1 1 W +X ~ 2 -200 0 100 R 10 40 1 1 w +ENDDRAW +ENDDEF +# +# C_3x6mm2 +# +DEF C_3x6mm2 EC 0 10 N Y 1 F N +F0 "EC" -170 130 40 H V C CNN +F1 "C_3x6mm2" 0 -100 40 H V C CNN +DRAW +P 2 0 0 0 200 -200 200 -200 N +C -30 50 10 0 1 0 F +P 3 0 1 0 -130 50 -90 50 -90 50 N +P 3 0 1 0 -110 50 -30 -50 -30 -50 N +P 3 0 1 0 -30 50 50 -50 50 -50 N +P 3 0 1 0 10 50 90 -50 90 -50 N +P 4 0 1 0 -100 0 100 0 100 0 100 0 N +X ~ 1 200 0 100 L 10 40 1 1 W +X ~ 2 -200 0 100 R 10 40 1 1 w +ENDDRAW +ENDDEF +# +# D_06A +# +DEF D_06A ED 0 10 N Y 1 F N +F0 "ED" -160 120 40 H V C CNN +F1 "D_06A" -100 -80 40 H V C CNN +DRAW +P 2 0 0 0 200 -200 200 -200 N +P 3 0 1 0 -100 0 60 100 60 100 N +P 3 0 1 0 60 20 100 -20 100 -20 N +P 3 0 1 0 100 20 60 -20 60 -20 N +X ~ 1 200 0 120 L 10 40 1 1 W +X ~ 2 -200 0 100 R 10 40 1 1 w +ENDDRAW +ENDDEF +# +# D_10A +# +DEF D_10A ED 0 10 N Y 1 F N +F0 "ED" -160 120 40 H V C CNN +F1 "D_10A" -100 -80 40 H V C CNN +DRAW +P 2 0 0 0 200 -200 200 -200 N +P 3 0 1 0 -100 0 60 100 60 100 N +P 3 0 1 0 60 20 100 -20 100 -20 N +P 3 0 1 0 100 20 60 -20 60 -20 N +X ~ 1 200 0 120 L 10 40 1 1 W +X ~ 2 -200 0 100 R 10 40 1 1 w +ENDDRAW +ENDDEF +# +# D_16A +# +DEF D_16A ED 0 10 N Y 1 F N +F0 "ED" -160 120 40 H V C CNN +F1 "D_16A" -100 -80 40 H V C CNN +DRAW +P 2 0 0 0 200 -200 200 -200 N +P 3 0 1 0 -100 0 60 100 60 100 N +P 3 0 1 0 60 20 100 -20 100 -20 N +P 3 0 1 0 100 20 60 -20 60 -20 N +X ~ 1 200 0 120 L 10 40 1 1 W +X ~ 2 -200 0 100 R 10 40 1 1 w +ENDDRAW +ENDDEF +# +# D_32A +# +DEF D_32A ED 0 10 N Y 1 F N +F0 "ED" -160 120 40 H V C CNN +F1 "D_32A" -100 -80 40 H V C CNN +DRAW +P 2 0 0 0 200 -200 200 -200 N +P 3 0 1 0 -100 0 60 100 60 100 N +P 3 0 1 0 60 20 100 -20 100 -20 N +P 3 0 1 0 100 20 60 -20 60 -20 N +X ~ 1 200 0 120 L 10 40 1 1 W +X ~ 2 -200 0 100 R 10 40 1 1 w +ENDDRAW +ENDDEF +# +# G_Th_3KVA +# +DEF G_Th_3KVA EG 0 10 N Y 1 F N +F0 "EG" -160 120 40 H V C CNN +F1 "G_Th_3KVA" 0 -120 40 H V C CNN +DRAW +T 0 0 0 70 0 0 0 G Normal 1 C C +P 2 0 0 0 200 -200 200 -200 N +C 0 0 84 0 1 0 N +X ~ 1 200 0 118 L 10 40 1 1 w +ENDDRAW +ENDDEF +# +# I_25A_LUM +# +DEF I_25A_LUM EI 0 10 N Y 1 F N +F0 "EI" -160 120 40 H V C CNN +F1 "I_25A_LUM" 0 -100 40 H V C CNN +DRAW +P 2 0 0 0 200 -200 200 -200 N +C 0 0 36 0 1 0 N +P 3 0 1 0 -100 0 60 100 60 100 N +P 3 0 1 0 30 20 -30 -20 -30 -20 N +P 4 0 1 0 -20 30 20 -30 20 -30 20 -30 N +X ~ 1 200 0 120 L 10 40 1 1 W +X ~ 2 -200 0 100 R 10 40 1 1 w +ENDDRAW +ENDDEF +# +# J_40A_30mA +# +DEF J_40A_30mA EJ 0 10 N Y 1 F N +F0 "EJ" -210 180 40 H V C CNN +F1 "J_40A_30mA" -20 -120 40 H V C CNN +DRAW +T 0 120 200 20 0 0 0 OFS Normal 1 C C +P 2 0 0 0 200 -200 200 -200 N +P 5 0 0 0 120 20 120 -20 120 -20 120 -20 120 -20 N +A -120 60 20 1799 1 0 1 0 N -140 60 -100 60 +P 3 0 1 0 -140 0 -60 0 -60 0 N +P 3 0 1 0 -140 60 -140 -60 -140 -60 N +P 3 0 1 0 -60 0 100 100 100 100 N +P 5 0 1 0 -140 -60 -100 -60 -100 -60 -100 -60 -100 -60 N +P 5 0 1 0 -100 60 -100 -60 -100 -40 -100 -40 -100 -40 N +P 6 0 1 0 -120 80 -120 120 40 120 40 60 40 60 40 60 N +P 10 0 1 0 60 80 60 200 80 200 80 220 160 220 180 200 160 180 80 180 80 200 80 200 N +X ~ 1 250 0 130 L 10 40 1 1 W +X ~ 2 -250 0 110 R 10 40 1 1 w +X ~ 3 250 200 70 L 10 10 1 1 O +ENDDRAW +ENDDEF +# +# O_600VA +# +DEF O_600VA EO 0 10 N Y 1 F N +F0 "EO" -70 120 40 H V C CNN +F1 "O_600VA" -40 -150 40 H V C CNN +DRAW +P 2 0 0 0 200 -200 200 -200 N +C -20 0 31 0 1 0 N +C 20 0 31 0 1 0 N +S -110 40 120 -90 0 1 0 N +P 3 0 1 0 -100 0 -50 0 -50 0 N +P 3 0 1 0 -90 -50 -90 -70 -90 -70 N +P 3 0 1 0 -80 -40 -80 -80 -80 -80 N +P 3 0 1 0 -70 -50 -70 -70 -70 -70 N +P 3 0 1 0 -60 -40 -60 -80 -60 -80 N +P 3 0 1 0 -50 -50 -50 -70 -50 -70 N +P 3 0 1 0 -40 -40 -40 -80 -40 -80 N +P 3 0 1 0 -30 -50 -30 -70 -30 -70 N +P 3 0 1 0 -20 -40 -20 -80 -20 -80 N +P 3 0 1 0 -10 -50 -10 -70 -10 -70 N +P 3 0 1 0 0 -40 0 -80 0 -80 N +P 3 0 1 0 10 -50 10 -70 10 -70 N +P 3 0 1 0 20 -40 20 -80 20 -80 N +P 3 0 1 0 30 -50 30 -70 30 -70 N +P 3 0 1 0 40 -40 40 -80 40 -80 N +P 3 0 1 0 50 -50 50 -70 50 -70 N +P 3 0 1 0 50 0 100 0 100 0 N +P 3 0 1 0 60 -40 60 -80 60 -80 N +P 3 0 1 0 70 -50 70 -70 70 -70 N +P 3 0 1 0 80 -40 80 -80 80 -80 N +P 3 0 1 0 100 -40 100 -80 100 -80 N +P 4 0 1 0 90 -50 90 -70 90 -70 90 -70 N +P 5 0 1 0 -100 -60 100 -60 100 -60 100 -60 100 -60 N +X ~ 1 200 0 100 L 10 40 1 1 W +X ~ 2 -200 0 100 R 10 40 1 1 w +ENDDRAW +ENDDEF +# +# O_900VA +# +DEF O_900VA EO 0 10 N Y 1 F N +F0 "EO" -70 120 40 H V C CNN +F1 "O_900VA" -40 -150 40 H V C CNN +DRAW +P 2 0 0 0 200 -200 200 -200 N +C -20 0 31 0 1 0 N +C 20 0 31 0 1 0 N +S -110 40 120 -90 0 1 0 N +P 3 0 1 0 -100 0 -50 0 -50 0 N +P 3 0 1 0 -90 -50 -90 -70 -90 -70 N +P 3 0 1 0 -80 -40 -80 -80 -80 -80 N +P 3 0 1 0 -70 -50 -70 -70 -70 -70 N +P 3 0 1 0 -60 -40 -60 -80 -60 -80 N +P 3 0 1 0 -50 -50 -50 -70 -50 -70 N +P 3 0 1 0 -40 -40 -40 -80 -40 -80 N +P 3 0 1 0 -30 -50 -30 -70 -30 -70 N +P 3 0 1 0 -20 -40 -20 -80 -20 -80 N +P 3 0 1 0 -10 -50 -10 -70 -10 -70 N +P 3 0 1 0 0 -40 0 -80 0 -80 N +P 3 0 1 0 10 -50 10 -70 10 -70 N +P 3 0 1 0 20 -40 20 -80 20 -80 N +P 3 0 1 0 30 -50 30 -70 30 -70 N +P 3 0 1 0 40 -40 40 -80 40 -80 N +P 3 0 1 0 50 -50 50 -70 50 -70 N +P 3 0 1 0 50 0 100 0 100 0 N +P 3 0 1 0 60 -40 60 -80 60 -80 N +P 3 0 1 0 70 -50 70 -70 70 -70 N +P 3 0 1 0 80 -40 80 -80 80 -80 N +P 3 0 1 0 100 -40 100 -80 100 -80 N +P 4 0 1 0 90 -50 90 -70 90 -70 90 -70 N +P 5 0 1 0 -100 -60 100 -60 100 -60 100 -60 100 -60 N +X ~ 1 200 0 100 L 10 40 1 1 W +X ~ 2 -200 0 100 R 10 40 1 1 w +ENDDRAW +ENDDEF +# +# P_10A +# +DEF P_10A EP 0 10 N Y 1 F N +F0 "EP" -160 120 40 H V C CNN +F1 "P_10A" -80 -140 40 H V C CNN +DRAW +A 0 0 80 891 -891 0 0 0 N 1 80 1 -80 +P 2 0 0 0 200 -200 200 -200 N +X ~ 1 200 0 120 L 10 40 1 1 W +ENDDRAW +ENDDEF +# +# Q_25A_2F2O +# +DEF Q_25A_2F2O EQ 0 10 N Y 1 F N +F0 "EQ" -160 120 40 H V C CNN +F1 "Q_25A_2F2O" 0 -140 40 H V C CNN +DRAW +T 0 90 150 20 0 0 0 O+F Normal 1 C C +S -100 -30 100 -70 0 0 0 N +P 2 0 0 0 200 -200 200 -200 N +P 3 0 0 0 0 60 0 -60 0 -60 N +P 3 0 0 0 20 100 20 60 20 60 N +P 3 0 0 0 40 100 40 90 40 90 N +P 4 0 0 0 -100 -30 -100 -30 100 -70 100 -70 N +P 3 0 1 0 -100 0 60 100 60 100 N +P 5 0 1 0 20 60 20 50 100 50 100 50 100 50 N +P 12 0 1 0 40 100 40 150 50 150 50 160 50 170 120 170 140 150 120 130 60 130 50 130 50 150 50 150 N +X ~ 1 -200 0 100 R 10 40 1 1 U +X ~ 2 200 50 100 L 10 40 1 1 U +X ~ 3 200 0 120 L 10 40 1 1 U +X ~ 4 200 -50 100 L 10 40 1 1 I +X ~ 5 200 150 60 L 10 40 1 1 U +ENDDRAW +ENDDEF +# +# Q_2A_12O_40KV +# +DEF Q_2A_12O_40KV EQ 0 10 N Y 1 F N +F0 "EQ" -160 120 40 H V C CNN +F1 "Q_2A_12O_40KV" 0 -730 40 H V C CNN +DRAW +S -100 -580 100 -620 0 0 0 N +P 2 0 0 0 200 -200 200 -200 N +P 4 0 0 0 -100 -580 -100 -580 100 -620 100 -620 N +P 3 0 1 0 -100 -550 80 -520 80 -520 N +P 3 0 1 0 -100 -500 80 -470 80 -470 N +P 3 0 1 0 -100 -450 80 -420 80 -420 N +P 3 0 1 0 -100 -400 80 -370 80 -370 N +P 3 0 1 0 -100 -350 80 -320 80 -320 N +P 3 0 1 0 -100 -300 80 -270 80 -270 N +P 3 0 1 0 -100 -250 80 -220 80 -220 N +P 3 0 1 0 -100 -200 80 -170 80 -170 N +P 3 0 1 0 -100 -150 80 -120 80 -120 N +P 3 0 1 0 -100 -100 80 -70 80 -70 N +P 3 0 1 0 0 -580 0 20 0 20 N +P 5 0 1 0 -100 0 80 30 80 30 80 30 80 30 N +P 6 0 1 0 -100 -50 80 -20 80 -20 80 -20 80 -20 80 -20 N +X ~ 1 -200 0 100 R 10 40 1 1 U +X ~ 2 200 0 120 L 10 40 1 1 U +X ~ 3 -200 -50 100 R 10 50 1 1 U +X ~ 3 -200 -50 100 R 10 50 1 1 U +X ~ 4 200 -50 120 L 10 50 1 1 U +X ~ 5 -200 -100 100 R 10 50 1 1 U +X ~ 6 200 -100 120 L 10 40 1 1 U +X ~ 7 -200 -150 100 R 10 50 1 1 U +X ~ 8 200 -150 120 L 10 40 1 1 U +X ~ 9 -200 -200 100 R 10 50 1 1 U +X ~ 10 200 -200 120 L 10 40 1 1 U +X ~ 20 200 -450 120 L 10 40 1 1 U +X ~ 11 -200 -250 100 R 10 50 1 1 U +X ~ 21 -200 -500 100 R 10 50 1 1 U +X ~ 12 200 -250 120 L 10 40 1 1 U +X ~ 22 200 -500 120 L 10 40 1 1 U +X ~ 13 -200 -300 100 R 10 50 1 1 U +X ~ 23 -200 -550 100 R 10 50 1 1 U +X ~ 14 200 -300 120 L 10 40 1 1 U +X ~ 24 200 -550 120 L 10 40 1 1 U +X ~ 15 -200 -350 100 R 10 50 1 1 U +X ~ 25 200 -600 100 L 10 40 1 1 I +X ~ 16 200 -350 120 L 10 40 1 1 U +X ~ 17 -200 -400 100 R 10 50 1 1 U +X ~ 18 200 -400 120 L 10 40 1 1 U +X ~ 19 -200 -450 100 R 10 50 1 1 U +ENDDRAW +ENDDEF +# +# R_16A_30mA +# +DEF R_16A_30mA ER 0 10 N Y 1 F N +F0 "ER" -210 180 40 H V C CNN +F1 "R_16A_30mA" 0 -200 40 H V C CNN +DRAW +T 0 20 -100 50 0 0 0 M Normal 1 C C +T 0 120 200 20 0 0 0 OF Normal 1 C C +P 2 0 0 0 200 -200 200 -200 N +P 2 0 0 0 400 -200 400 -200 N +P 3 0 0 0 20 -50 20 50 20 50 N +A -120 60 20 1799 1 0 1 0 N -140 60 -100 60 +C 20 -100 50 0 1 0 N +P 3 0 1 0 -140 0 -60 0 -60 0 N +P 3 0 1 0 -140 60 -140 -60 -140 -60 N +P 3 0 1 0 -60 0 100 100 100 100 N +P 3 0 1 0 140 20 100 -20 100 -20 N +P 4 0 1 0 100 20 140 -20 140 -20 140 -20 N +P 5 0 1 0 -140 -60 -100 -60 -100 -60 -100 -60 -100 -60 N +P 5 0 1 0 -100 60 -100 -60 -100 -40 -100 -40 -100 -40 N +P 6 0 1 0 -120 80 -120 120 40 120 40 60 40 60 40 60 N +P 10 0 1 0 60 80 60 200 80 200 80 220 160 220 180 200 160 180 80 180 80 200 80 200 N +X ~ 1 250 0 130 L 10 40 1 1 W +X ~ 2 -250 0 110 R 10 40 1 1 w +X ~ 3 250 200 70 L 10 10 1 1 O +X ~ 4 250 -100 180 L 10 50 1 1 I +ENDDRAW +ENDDEF +# +# S_63A +# +DEF S_63A ES 0 10 N Y 1 F N +F0 "ES" -210 180 40 H V C CNN +F1 "S_63A" 0 -110 40 H V C CNN +DRAW +T 0 120 200 20 0 0 0 OFS Normal 1 C C +P 2 0 0 0 200 -200 200 -200 N +P 2 0 0 0 400 -200 400 -200 N +P 3 0 0 0 -150 0 -100 0 -100 0 N +P 3 0 0 0 120 20 120 -20 120 -20 N +P 3 0 1 0 -140 0 -60 0 -60 0 N +P 3 0 1 0 -140 60 -140 -60 -140 -60 N +P 3 0 1 0 -140 60 -100 60 -100 60 N +P 3 0 1 0 -120 60 -120 80 -120 80 N +P 3 0 1 0 -60 0 100 100 100 100 N +P 5 0 1 0 -140 -60 -100 -60 -100 -60 -100 -60 -100 -60 N +P 5 0 1 0 -100 60 -100 -60 -100 -40 -100 -40 -100 -40 N +P 6 0 1 0 -120 80 -120 120 40 120 40 60 40 60 40 60 N +P 10 0 1 0 60 80 60 200 80 200 80 220 160 220 180 200 160 180 80 180 80 200 80 200 N +X ~ 1 250 0 130 L 10 40 1 1 W +X ~ 2 -250 0 100 R 10 40 1 1 w +X ~ 3 250 200 70 L 10 10 1 1 O +ENDDRAW +ENDDEF +# +# V_A10A +# +DEF V_A10A EV 0 10 N Y 1 F N +F0 "EV" -160 120 40 H V C CNN +F1 "V_A10A" -60 -140 40 H V C CNN +DRAW +T 0 0 0 70 0 0 0 A Normal 1 C C +P 2 0 0 0 200 -200 200 -200 N +C 0 0 84 0 1 0 N +P 3 0 1 0 -100 0 -80 0 -80 0 N +X ~ 1 -200 0 100 R 10 40 1 1 W +X ~ 2 200 0 118 L 10 40 1 1 w +ENDDRAW +ENDDEF +# +# V_F50Hz +# +DEF V_F50Hz EV 0 10 N Y 1 F N +F0 "EV" -160 120 40 H V C CNN +F1 "V_F50Hz" -40 -140 40 H V C CNN +DRAW +T 0 0 0 50 0 0 0 Hz Normal 1 C C +P 2 0 0 0 200 -200 200 -200 N +C 0 0 84 0 1 0 N +X ~ 1 200 0 118 L 10 40 1 1 W +ENDDRAW +ENDDEF +# +# V_U400V +# +DEF V_U400V EV 0 10 N Y 1 F N +F0 "EV" -160 120 40 H V C CNN +F1 "V_U400V" -60 -140 40 H V C CNN +DRAW +T 0 0 0 70 0 0 0 V Normal 1 C C +P 2 0 0 0 200 -200 200 -200 N +C 0 0 84 0 1 0 N +X ~ 1 200 0 118 L 10 40 1 1 W +ENDDRAW +ENDDEF +# +# W_15KA +# +DEF W_15KA EW 0 10 N Y 1 F N +F0 "EW" -160 120 40 H V C CNN +F1 "W_15KA" -50 -210 40 H V C CNN +DRAW +P 2 0 0 0 200 -200 200 -200 N +S -120 60 120 -60 0 1 0 N +S -10 -40 10 -60 0 1 0 N +P 3 0 1 0 -100 0 -80 0 -80 0 N +P 7 0 1 0 -80 0 -40 0 -80 40 -80 0 -80 -40 -40 0 -40 0 F +P 8 0 1 0 80 0 40 0 80 40 80 -40 80 0 80 -40 40 0 40 0 F +X ~ 1 200 0 100 L 10 40 1 1 W +X ~ 2 -200 0 100 R 10 40 1 1 w +X ~ 3 0 -100 50 U 10 50 1 1 O +ENDDRAW +ENDDEF +# +# Y_ELC +# +DEF Y_ELC EY 0 10 N Y 1 F N +F0 "EY" -10 120 40 H V C CNN +F1 "Y_ELC" 60 -120 40 H V C CNN +DRAW +P 2 0 0 0 200 -200 200 -200 N +P 3 0 0 0 -50 10 -50 -10 -50 -10 N +P 3 0 0 0 -40 20 -40 -20 -40 -20 N +P 3 0 0 0 -30 30 -30 -30 -30 -30 N +P 3 0 0 0 -10 50 -10 -50 -10 -50 N +P 4 0 0 0 -60 0 70 0 80 0 70 0 N +P 4 0 0 0 -20 40 -20 -40 -20 -40 -20 -40 N +P 4 0 0 0 0 60 0 60 0 -60 0 -60 N +X ~ 1 200 0 118 L 10 40 1 1 W +ENDDRAW +ENDDEF +# +#End Library diff --git a/gerbview/class_GERBER.cpp b/gerbview/class_GERBER.cpp index 9a6a97dcae..2ab541f3ea 100644 --- a/gerbview/class_GERBER.cpp +++ b/gerbview/class_GERBER.cpp @@ -95,7 +95,7 @@ GERBER_IMAGE::GERBER_IMAGE( WinEDA_GerberFrame* aParent, int aLayer ) for( unsigned ii = 0; ii < DIM( m_Aperture_List ); ii++ ) m_Aperture_List[ii] = 0; - m_Pcb = 0; + m_Pcb = aParent->GetBoard(); } @@ -151,6 +151,7 @@ void GERBER_IMAGE::ResetDefaultValues() m_FileName.Empty(); m_ImageName = wxT( "no name" ); // Image name from the IN command m_ImageNegative = false; // true = Negative image + m_hasNegativeItems = -1; // set to uninitialized m_ImageJustifyOffset = wxPoint(0,0); // Image justify Offset m_ImageJustifyXCenter = false; // Image Justify Center on X axis (default = false) m_ImageJustifyYCenter = false; // Image Justify Center on Y axis (default = false) @@ -190,6 +191,35 @@ void GERBER_IMAGE::ResetDefaultValues() m_Selected_Tool = FIRST_DCODE; } +/* Function HasNegativeItems + * return true if at least one item must be drawn in background color + * used to optimize screen refresh + */ +bool GERBER_IMAGE::HasNegativeItems() +{ + if( m_hasNegativeItems < 0 ) // negative items are not yet searched: find them if any + { + if( m_ImageNegative ) // A negative layer is expected having always negative objects. + m_hasNegativeItems = 1; + else + { + m_hasNegativeItems = 0; + for( BOARD_ITEM* item = m_Pcb->m_Drawings; item; item = item->Next() ) + { + GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item; + if( gerb_item->GetLayer() != m_GraphicLayer ) + continue; + if( gerb_item->HasNegativeItems() ) + { + m_hasNegativeItems = 1; + break; + } + } + // TODO search for items in list + } + } + return m_hasNegativeItems == 1; +} int GERBER_IMAGE::ReturnUsedDcodeNumber() { diff --git a/gerbview/class_GERBER.h b/gerbview/class_GERBER.h index 0c1c9fc003..abece9021c 100644 --- a/gerbview/class_GERBER.h +++ b/gerbview/class_GERBER.h @@ -128,6 +128,15 @@ public: APERTURE_MACRO_SET m_aperture_macros; ///< a collection of APERTURE_MACROS, sorted by name +private: + int m_hasNegativeItems; // true if the image is negative or has some negative items + // Used to optimize drawing, because when there are no + // negative items screen refresh does not need + // to build an intermediate bitmap specfic to this image + // -1 = negative items are + // 0 = no negative items found + // 1 = have negative items found + public: GERBER_IMAGE( WinEDA_GerberFrame* aParent, int layer ); ~GERBER_IMAGE(); @@ -144,6 +153,13 @@ public: return m_GBRLayerParams; } + /** + * Function HasNegativeItems + * @return true if at least one item must be drawn in background color + * used to optimize screen refresh (when no items are in background color + * refresh can be faster) + */ + bool HasNegativeItems(); /** * Function ReportMessage diff --git a/gerbview/class_aperture_macro.cpp b/gerbview/class_aperture_macro.cpp index c6f61793a1..14c9c487bc 100644 --- a/gerbview/class_aperture_macro.cpp +++ b/gerbview/class_aperture_macro.cpp @@ -738,6 +738,24 @@ void APERTURE_MACRO::DrawApertureMacroShape( GERBER_DRAW_ITEM* aParent, } } +/* Function HasNegativeItems + * return true if this macro has at least one aperture primitives + * that must be drawn in background color + * used to optimize screen refresh + */ +bool APERTURE_MACRO::HasNegativeItems( GERBER_DRAW_ITEM* aParent ) +{ + for( AM_PRIMITIVES::iterator prim_macro = primitives.begin(); + prim_macro != primitives.end(); ++prim_macro ) + { + if( prim_macro->mapExposure( aParent ) == false ) // = is negative + return true; + } + + return false; +} + + /** GetShapeDim * Calculate a value that can be used to evaluate the size of text * when displaying the D-Code of an item diff --git a/gerbview/class_aperture_macro.h b/gerbview/class_aperture_macro.h index 9f04180348..660eaf890e 100644 --- a/gerbview/class_aperture_macro.h +++ b/gerbview/class_aperture_macro.h @@ -208,7 +208,8 @@ struct APERTURE_MACRO void DrawApertureMacroShape( GERBER_DRAW_ITEM* aParent, EDA_Rect* aClipBox, wxDC* aDC, int aColor, int aAltColor, wxPoint aShapePos, bool aFilledShape ); - /** GetShapeDim + /** + * Function GetShapeDim * Calculate a value that can be used to evaluate the size of text * when displaying the D-Code of an item * due to the complexity of a shape using many primitives @@ -220,6 +221,16 @@ struct APERTURE_MACRO * @return a dimension, or -1 if no dim to calculate */ int GetShapeDim( GERBER_DRAW_ITEM* aParent ); + + /** + * Function HasNegativeItems + * @param aParent = the parent GERBER_DRAW_ITEM which is actually drawn + * @return true if this macro has at least one shape (using aperture primitives) + * must be drawn in background color + * used to optimize screen refresh (when no items are in background color + * refresh can be faster) + */ + bool HasNegativeItems( GERBER_DRAW_ITEM* aParent ); }; diff --git a/gerbview/class_gerber_draw_item.cpp b/gerbview/class_gerber_draw_item.cpp index 8f7bd1dc4c..440a1df757 100644 --- a/gerbview/class_gerber_draw_item.cpp +++ b/gerbview/class_gerber_draw_item.cpp @@ -310,6 +310,34 @@ bool GERBER_DRAW_ITEM::Save( FILE* aFile ) const return true; } +/* Function HasNegativeItems + * return true if this item or at least one shape (when using aperture macros) + * must be drawn in background color + * useful to optimize screen refresh + */ +bool GERBER_DRAW_ITEM::HasNegativeItems() +{ + bool isClear = m_LayerNegative ^ m_imageParams->m_ImageNegative; + // if isClear is true, this item has negative shape + // but if isClear is true, and if this item use an aperture macro definition, + // we must see if this aperture macro uses a negative shape. + if( isClear ) + return true; + + // see for a macro def + D_CODE* dcodeDescr = GetDcodeDescr(); + if( dcodeDescr == NULL ) + return false; + if( m_Shape == GBR_SPOT_MACRO ) + { + APERTURE_MACRO* macro = dcodeDescr->GetMacro(); + if( macro ) // macro == NULL should not occurs + return macro->HasNegativeItems( this ); + } + + return false; +} + /*********************************************************************/ void GERBER_DRAW_ITEM::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, int aDrawMode, diff --git a/gerbview/class_gerber_draw_item.h b/gerbview/class_gerber_draw_item.h index eae52a61d7..f0dea60a12 100644 --- a/gerbview/class_gerber_draw_item.h +++ b/gerbview/class_gerber_draw_item.h @@ -119,6 +119,15 @@ public: { return m_LayerNegative; } + + /** + * Function HasNegativeItems + * @return true if this item or at least one shape (when using aperture macros + * must be drawn in background color + * used to optimize screen refresh (when no items are in background color + * refresh can be faster) + */ + bool HasNegativeItems(); /** * Function SetLayerParameters diff --git a/gerbview/draw_gerber_screen.cpp b/gerbview/draw_gerber_screen.cpp index a127385878..d6e2d524a1 100644 --- a/gerbview/draw_gerber_screen.cpp +++ b/gerbview/draw_gerber_screen.cpp @@ -18,8 +18,14 @@ #include "class_gerber_draw_item.h" #include "class_GERBER.h" -static void Show_Items_DCode_Value( WinEDA_DrawPanel* panel, wxDC* DC, - BOARD* Pcb, int drawmode ); +#ifdef __WINDOWS__ +// Blit function seems have problems when scale != 1 and/or offsets +#define AVOID_BLIT_SCALE_BUG true +#else +#define AVOID_BLIT_SCALE_BUG false // not needed on Linux +#endif + + /** * Function PrintPage (virtual) @@ -73,15 +79,37 @@ void WinEDA_GerberFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) if( !GetBoard() ) return; + ActiveScreen = screen; GRSetDrawMode( DC, GR_COPY ); + + int drawMode = -1; + switch ( GetDisplayMode() ) + { + default: + case 0: + break; + + case 1: + drawMode = GR_COPY; + break; + + case 2: + drawMode = GR_OR; + break; + } + GetBoard()->Draw( DrawPanel, DC, + drawMode, // this needs to be GR_COPY or GR_OR, set from a toggle button. + wxPoint( 0, 0 ) ); + + // Draw the "background" now, i.e. grid and axis after gerber layers + // because most of time the actual background is erased by succesive drawings of each gerber layer + // mainly in COPY mode DrawPanel->DrawBackGround( DC ); - GetBoard()->Draw( DrawPanel, DC, GR_COPY, wxPoint( 0, 0 ) ); - if( IsElementVisible( DCODES_VISIBLE ) ) - Show_Items_DCode_Value( DrawPanel, DC, GetBoard(), GR_COPY ); + DrawItemsDCodeID( DC, GR_COPY ); TraceWorkSheet( DC, screen, 0 ); @@ -99,34 +127,61 @@ void WinEDA_GerberFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) /********************************************************************/ void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, int aDrawMode, const wxPoint& aOffset ) /********************************************************************/ -/* Redraw the BOARD items but not cursors, axis or grid */ { // Because Images can be negative (i.e with background filled in color) items are drawn // graphic layer per graphic layer, after the background is filled - int bitmapWidth, bitmapHeight; + wxColour bgColor = MakeColour( g_DrawBgColor ); + wxBrush bgBrush( bgColor, wxSOLID ); + + int bitmapWidth, bitmapHeight; + wxDC* plotDC = aDC; + +#if AVOID_BLIT_SCALE_BUG + // Blit function used below seems to work OK only with scale = 1 and no offsets + // at least under Windows // Store device context scale and origins: - double dc_scalex, dc_scaley; - wxPoint dev_org; - wxPoint logical_org; + double dc_scalex, dc_scaley; + wxPoint dev_org; + wxPoint logical_org; + aDC->GetDeviceOrigin( &dev_org.x, &dev_org.y ); aDC->GetLogicalOrigin( &logical_org.x, &logical_org.y ); - aDC->GetUserScale( &dc_scalex, &dc_scaley); + aDC->GetUserScale( &dc_scalex, &dc_scaley ); - // Blit function used below seems work OK only with scale = 1 and no offsets - aDC->SetUserScale( 1.0, 1.0 ); - aDC->SetDeviceOrigin( 0,0 ); - aDC->SetLogicalOrigin( 0,0 ); + if( aDrawMode != -1 ) + { + aDC->SetUserScale( 1.0, 1.0 ); + aDC->SetDeviceOrigin( 0, 0 ); + aDC->SetLogicalOrigin( 0, 0 ); + } +#endif aPanel->GetClientSize( &bitmapWidth, &bitmapHeight ); - wxBitmap layerBitmap( bitmapWidth, bitmapHeight ); + wxBitmap* layerBitmap = NULL; + wxBitmap* screenBitmap = NULL; - wxMemoryDC memoryDC; - memoryDC.SelectObject( layerBitmap ); + wxMemoryDC layerDC; // used sequentially for each gerber layer + wxMemoryDC screenDC; - wxColour bgColor = MakeColour( g_DrawBgColor ); - wxBrush bgBrush( bgColor, wxSOLID ); + if( aDrawMode != -1 ) + { + layerBitmap = new wxBitmap( bitmapWidth, bitmapHeight ); + screenBitmap = new wxBitmap( bitmapWidth, bitmapHeight ); + layerDC.SelectObject( *layerBitmap ); + layerDC.SetBackground( bgBrush ); + layerDC.Clear(); + screenDC.SelectObject( *screenBitmap ); + screenDC.SetBackground( bgBrush ); + screenDC.Clear(); + + aPanel->DoPrepareDC(layerDC); + aPanel->DrawBackGround( &layerDC ); + plotDC = &layerDC; + } + + bool doBlit = false; // this flag requests an image transfert to actual screen when true. for( int layer = 0; layer < 32; layer++ ) { if( !GetBoard()->IsLayerVisible( layer ) ) @@ -136,96 +191,149 @@ void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, int aDrawMode, const wxPo if( gerber == NULL ) // Graphic layer not yet used continue; - memoryDC.SetUserScale( dc_scalex, dc_scaley ); - memoryDC.SetDeviceOrigin( dev_org.x, dev_org.y ); - memoryDC.SetLogicalOrigin( logical_org.x, logical_org.y ); - // Draw each layer into a bitmap first. Negative Gerber - // layers are drawn in background color. - memoryDC.SetBackground( bgBrush ); - memoryDC.Clear(); + if( aDrawMode != -1 ) + { + // Draw each layer into a bitmap first. Negative Gerber + // layers are drawn in background color. + if( gerber->HasNegativeItems() ) + { + if( doBlit ) + { +#if AVOID_BLIT_SCALE_BUG + layerDC.SetUserScale( 1.0, 1.0 ); + layerDC.SetDeviceOrigin( 0, 0 ); + layerDC.SetLogicalOrigin( 0, 0 ); +#endif + if( aDrawMode == GR_COPY ) + { + // Use the layer bitmap itself as a mask when blitting. + // The bitmap cannot be referenced by a device context + // when setting the mask. + layerDC.SelectObject( wxNullBitmap ); + layerBitmap->SetMask( new wxMask( *layerBitmap, bgColor ) ); + layerDC.SelectObject( *layerBitmap ); + screenDC.Blit( 0, 0, bitmapWidth, bitmapHeight, &layerDC, 0, 0, wxCOPY, true ); + } + else if( aDrawMode == GR_OR ) + { + // On Linux with a large screen, this version is much faster and without flicker, + // but gives a PCBNEW look where layer colors blend together. Plus it works + // only because the background color is black. But it may be more useable for some. + // The difference is due in part because of the cpu cycles needed to create the + // monochromatic bitmap above, and the extra time needed to do bit indexing + // into the monochromatic bitmap on the blit above. + screenDC.Blit( 0, 0, bitmapWidth, bitmapHeight, &layerDC, 0, 0, wxOR ); + } + } + doBlit = false; + layerDC.Clear(); + } + } + +#if AVOID_BLIT_SCALE_BUG + layerDC.SetUserScale( dc_scalex, dc_scaley ); + layerDC.SetDeviceOrigin( dev_org.x, dev_org.y ); + layerDC.SetLogicalOrigin( logical_org.x, logical_org.y ); +#endif if( gerber->m_ImageNegative ) { // Draw background negative (i.e. in graphic layer color) for negative images. - int color = GetBoard()->GetLayerColor( layer ); - GRSetDrawMode( (wxDC*)&memoryDC, GR_COPY ); // GR_COPY is faster than GR_OR + GRSetDrawMode( &layerDC, GR_COPY ); EDA_Rect* cbox = &aPanel->m_ClipBox; - GRSFilledRect( cbox, (wxDC*)&memoryDC, cbox->GetX(), cbox->GetY(), + GRSFilledRect( cbox, plotDC, cbox->GetX(), cbox->GetY(), cbox->GetRight(), cbox->GetBottom(), 0, color, color ); - GRSetDrawMode( (wxDC*)&memoryDC, aDrawMode ); + GRSetDrawMode( plotDC, GR_COPY ); + doBlit = true; } int dcode_highlight = 0; if( layer == m_PcbFrame->GetScreen()->m_Active_Layer ) dcode_highlight = gerber->m_Selected_Tool; - for( BOARD_ITEM* item = GetBoard()->m_Drawings; item; item = item->Next() ) + int layerdrawMode = GR_COPY; + if( aDrawMode == GR_OR && !gerber->HasNegativeItems() ) + layerdrawMode = GR_OR; + for( BOARD_ITEM* item = GetBoard()->m_Drawings; item; item = item->Next() ) { GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item; if( gerb_item->GetLayer() != layer ) continue; - int drawMode = aDrawMode; - if( dcode_highlight == gerb_item->m_DCode ) + int drawMode = layerdrawMode; + if( dcode_highlight && dcode_highlight == gerb_item->m_DCode ) drawMode |= GR_SURBRILL; - gerb_item->Draw( aPanel, (wxDC*)&memoryDC, drawMode ); + gerb_item->Draw( aPanel, plotDC, drawMode ); + doBlit = true; } -#if 0 - // Use the layer bitmap itself as a mask when blitting. - // The bitmap cannot be referenced by a device context - // when setting the mask. - memoryDC.SelectObject( wxNullBitmap ); - layerBitmap.SetMask( new wxMask( layerBitmap, bgColor ) ); - - memoryDC.SelectObject( layerBitmap ); - - aDC->Blit( 0, 0, bitmapWidth, bitmapHeight, - (wxDC*)&memoryDC, 0, 0, wxCOPY, true ); - -#else // Dick: seems a little faster, crisper - - // Blit function seems work OK only with scale = 1 and no offsets - memoryDC.SetUserScale( 1.0, 1.0 ); - memoryDC.SetDeviceOrigin( 0,0 ); - memoryDC.SetLogicalOrigin( 0,0 ); - aDC->Blit( 0, 0, bitmapWidth, bitmapHeight, - &memoryDC, 0, 0, wxOR, false ); - -#endif - } - // Restore scale and offsets values: - aDC->SetUserScale( dc_scalex, dc_scaley ); - aDC->SetDeviceOrigin( dev_org.x, dev_org.y ); - aDC->SetLogicalOrigin( logical_org.x, logical_org.y ); + if( doBlit && aDrawMode != -1 ) // Blit is used only if aDrawMode >= 0 + { + // this is the last transfert to screenDC + // If there are no negative items, this is the only one + #if AVOID_BLIT_SCALE_BUG + if( aDrawMode != -1 ) + { + layerDC.SetUserScale( 1.0, 1.0 ); + layerDC.SetDeviceOrigin( 0, 0 ); + layerDC.SetLogicalOrigin( 0, 0 ); + } +#endif + if( aDrawMode == GR_COPY ) + { + layerDC.SelectObject( wxNullBitmap ); + layerBitmap->SetMask( new wxMask( *layerBitmap, bgColor ) ); + + layerDC.SelectObject( *layerBitmap ); + + screenDC.Blit( 0, 0, bitmapWidth, bitmapHeight, &layerDC, 0, 0, wxCOPY, true ); + } + + else if( aDrawMode == GR_OR ) + screenDC.Blit( 0, 0, bitmapWidth, bitmapHeight, &layerDC, 0, 0, wxOR, false ); + } + + if( aDrawMode != -1 ) + { + aDC->Blit( 0, 0, bitmapWidth, bitmapHeight, &screenDC, 0, 0, wxCOPY ); +#if AVOID_BLIT_SCALE_BUG + // Restore scale and offsets values: + aDC->SetUserScale( dc_scalex, dc_scaley ); + aDC->SetDeviceOrigin( dev_org.x, dev_org.y ); + aDC->SetLogicalOrigin( logical_org.x, logical_org.y ); +#endif + delete layerBitmap; + delete screenBitmap; + } m_PcbFrame->GetScreen()->ClrRefreshReq(); } - -/*****************************************************************************************/ -void Show_Items_DCode_Value( WinEDA_DrawPanel* aPanel, wxDC* aDC, BOARD* aPcb, int aDrawMode ) -/*****************************************************************************************/ +/* Function DrawItemsDCodeID + * Draw the DCode value (if exists) corresponding to gerber item + * Polygons do not have a DCode + */ +void WinEDA_GerberFrame::DrawItemsDCodeID( wxDC* aDC, int aDrawMode ) { wxPoint pos; int width, orient; wxString Line; GRSetDrawMode( aDC, aDrawMode ); - BOARD_ITEM* item = aPcb->m_Drawings; + BOARD_ITEM* item = GetBoard()->m_Drawings; for( ; item != NULL; item = item->Next() ) { GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item; - if( aPcb->IsLayerVisible( gerb_item->GetLayer() ) == false ) + if( GetBoard()->IsLayerVisible( gerb_item->GetLayer() ) == false ) continue; if( gerb_item->m_DCode <= 0 ) continue; @@ -250,7 +358,7 @@ void Show_Items_DCode_Value( WinEDA_DrawPanel* aPanel, wxDC* aDC, BOARD* aPcb, i orient = TEXT_ORIENT_HORIZ; if( gerb_item->m_Flashed ) { - // A reasonnable size for text is width/3 because most ot time this text has 3 chars. + // A reasonnable size for text is width/3 because most of time this text has 3 chars. width /= 3; } else // this item is a line @@ -265,7 +373,7 @@ void Show_Items_DCode_Value( WinEDA_DrawPanel* aPanel, wxDC* aDC, BOARD* aPcb, i int color = g_ColorsSettings.GetItemColor( DCODES_VISIBLE ); - DrawGraphicText( aPanel, aDC, + DrawGraphicText( DrawPanel, aDC, pos, (EDA_Colors) color, Line, orient, wxSize( width, width ), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, diff --git a/gerbview/files.cpp b/gerbview/files.cpp index 9e947931dd..32bbae3434 100644 --- a/gerbview/files.cpp +++ b/gerbview/files.cpp @@ -28,7 +28,7 @@ void WinEDA_GerberFrame::OnFileHistory( wxCommandEvent& event ) if( fn != wxEmptyString ) { Erase_Current_Layer( false ); - LoadOneGerberFile( fn, false ); + LoadGerberFiles( fn ); } } @@ -42,9 +42,8 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event ) { case wxID_FILE: { - wxString fileName = GetScreen()->m_FileName; Erase_Current_Layer( false ); - LoadOneGerberFile( fileName, true ); + LoadGerberFiles( wxEmptyString ); break; } @@ -56,7 +55,7 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event ) { setActiveLayer(origLayer+1); Erase_Current_Layer( false ); - if( !LoadOneGerberFile( wxEmptyString ) ) + if( !LoadGerberFiles( wxEmptyString ) ) setActiveLayer(origLayer); SetToolbars(); } @@ -92,14 +91,16 @@ delete an existing layer to load any new layers." ), NB_LAYERS ); } -bool WinEDA_GerberFrame::LoadOneGerberFile( const wxString& aFullFileName, bool aOpenFileDialog ) +bool WinEDA_GerberFrame::LoadGerberFiles( const wxString& aFullFileName ) { wxString filetypes; + wxArrayString filenamesList; wxFileName filename = aFullFileName; + wxString currentPath; ActiveScreen = GetScreen(); - if( !filename.IsOk() || aOpenFileDialog ) + if( ! filename.IsOk() ) { /* Standard gerber filetypes * (See http://en.wikipedia.org/wiki/Gerber_File) @@ -132,30 +133,57 @@ bool WinEDA_GerberFrame::LoadOneGerberFile( const wxString& aFullFileName, bool filetypes += AllFilesWildcard; /* Use the current working directory if the file name path does not exist. */ - wxString current_path = wxGetCwd(); - if( filename.DirExists() ) - current_path = filename.GetPath(); + currentPath = filename.GetPath(); + else + currentPath = wxGetCwd(); wxFileDialog dlg( this, _( "Open Gerber File" ), - current_path, + currentPath, filename.GetFullName(), filetypes, - wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE | wxFD_CHANGE_DIR ); if( dlg.ShowModal() == wxID_CANCEL ) return false; - filename = dlg.GetPath(); + dlg.GetFilenames( filenamesList ); + currentPath = wxGetCwd(); + } + else + { + wxFileName filename = aFullFileName; + filenamesList.Add( aFullFileName ); + currentPath = filename.GetPath(); } - GetScreen()->m_FileName = filename.GetFullPath(); - wxSetWorkingDirectory( filename.GetPath() ); - filename.SetExt( g_PenFilenameExt ); + // Read gerber files: each file is loaded on a new gerbview layer + int layer = getActiveLayer() - 1; + for( unsigned ii = 0; ii < filenamesList.GetCount(); ii++ ) + { + wxFileName filename = filenamesList[ii]; + filename.SetPath( currentPath ); + GetScreen()->m_FileName = filename.GetFullPath(); + filename.SetExt( g_PenFilenameExt ); - if( Read_GERBER_File( GetScreen()->m_FileName, filename.GetFullPath() ) ) - SetLastProject( GetScreen()->m_FileName ); + layer++; + if( layer >= NB_LAYERS ) + layer = 0; + setActiveLayer(layer); + if( Read_GERBER_File( GetScreen()->m_FileName, filename.GetFullPath() ) ) + { + SetLastProject( GetScreen()->m_FileName ); + } + else + { + layer--; + if( layer >= 0 ) + setActiveLayer(layer); + else + setActiveLayer(0); + } + } Zoom_Automatique( false ); GetScreen()->SetRefreshReq(); @@ -203,36 +231,3 @@ static void LoadDCodeFile( WinEDA_GerberFrame* frame, frame->CopyDCodesSizeToItems(); frame->GetScreen()->SetRefreshReq(); } - - -/* Save the file in ASCII PCB. - */ -bool WinEDA_GerberFrame::SaveGerberFile( const wxString& FullFileName ) -{ - wxString wildcard; - wxFileName fn = FullFileName; - - if( !fn.IsOk() ) - { - fn = GetScreen()->m_FileName; - - wildcard.Printf( _( "Gerber DCODE files (%s)|*.%s" ), - GetChars( g_PenFilenameExt ), - GetChars( g_PenFilenameExt ) ); - - wxFileDialog dlg( this, _( "Save Gerber File" ), fn.GetPath(), - fn.GetFullName(), wildcard, - wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); - - if( dlg.ShowModal() == wxID_CANCEL ) - return false; - - fn = dlg.GetPath(); - } - - GetScreen()->m_FileName = fn.GetFullPath(); - -// TODO - - return true; -} diff --git a/gerbview/gerberframe.cpp b/gerbview/gerberframe.cpp index 896bccef79..f2f5e65386 100644 --- a/gerbview/gerberframe.cpp +++ b/gerbview/gerberframe.cpp @@ -119,6 +119,12 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame ) WinEDA_GerberFrame::OnSelectOptionToolbar ) EVT_TOOL( ID_TB_OPTIONS_SHOW_DCODES, WinEDA_GerberFrame::OnSelectOptionToolbar ) + EVT_TOOL( ID_TB_OPTIONS_SHOW_GBR_MODE_0, + WinEDA_GerberFrame::OnSelectDisplayMode ) + EVT_TOOL( ID_TB_OPTIONS_SHOW_GBR_MODE_1, + WinEDA_GerberFrame::OnSelectDisplayMode ) + EVT_TOOL( ID_TB_OPTIONS_SHOW_GBR_MODE_2, + WinEDA_GerberFrame::OnSelectDisplayMode ) END_EVENT_TABLE() @@ -137,6 +143,7 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father, m_HotkeysZoomAndGridList = s_Gerbview_Hokeys_Descr; m_SelLayerBox = NULL; m_SelLayerTool = NULL; + m_displayMode = 0; if( DrawPanel ) DrawPanel->m_Block_Enable = true; @@ -279,6 +286,7 @@ void WinEDA_GerberFrame::LoadSettings() return; WinEDA_BasePcbFrame::LoadSettings(); + config->Read( GerbviewDrawModeOption, &m_displayMode, 0l ); long pageSize_opt; config->Read( GerbviewShowPageSizeOption, &pageSize_opt, 0l ); int imax = 0; @@ -325,6 +333,8 @@ void WinEDA_GerberFrame::SaveSettings() } } } + + config->Write( GerbviewDrawModeOption, m_displayMode ); config->Write( GerbviewShowPageSizeOption, pageSize_opt ); config->Write( GerbviewShowDCodes, IsElementVisible( DCODES_VISIBLE ) ); } @@ -528,7 +538,8 @@ void WinEDA_GerberFrame::UpdateTitleAndInfo() text = wxGetApp().GetAppName() + wxT( " " ) + GetBuildVersion(); SetTitle( text ); SetStatusText( wxEmptyString, 0 ); - m_TextInfo->Clear(); + text.Printf( _("Layer %d not used"), GetScreen()->m_Active_Layer+1 ); + m_TextInfo->SetValue( text ); ClearMsgPanel(); return; } @@ -556,3 +567,30 @@ void WinEDA_GerberFrame::UpdateTitleAndInfo() } +/* Function OnSelectDisplayMode: called to select display mode + * (fast display, or exact mode with stacked images or with transparency + */ +void WinEDA_GerberFrame::OnSelectDisplayMode( wxCommandEvent& event ) +{ + int oldMode = GetDisplayMode(); + switch( event.GetId() ) + { + case ID_TB_OPTIONS_SHOW_GBR_MODE_0: + SetDisplayMode( 0 ); + break; + + case ID_TB_OPTIONS_SHOW_GBR_MODE_1: + SetDisplayMode( 1 ); + break; + + case ID_TB_OPTIONS_SHOW_GBR_MODE_2: + SetDisplayMode( 2 ); + break; + } + + SetToolbars(); + if( GetDisplayMode() != oldMode ) + DrawPanel->Refresh(); +} + + diff --git a/gerbview/gerbview.cpp b/gerbview/gerbview.cpp index 16c46c5470..5abc26d00c 100644 --- a/gerbview/gerbview.cpp +++ b/gerbview/gerbview.cpp @@ -39,8 +39,9 @@ const wxString GerbviewProjectFileExt( wxT( "cnf" ) ); const wxString GerbviewProjectFileWildcard( _( "GerbView project files (.cnf)|*.cnf" ) ); // Config keywords +const wxString GerbviewDrawModeOption( wxT( "DrawModeOption" ) ); const wxString GerbviewShowPageSizeOption( wxT( "ShowPageSizeOpt" ) ); -extern const wxString GerbviewShowDCodes( wxT( "ShowDCodesOpt" ) ); +const wxString GerbviewShowDCodes( wxT( "ShowDCodesOpt" ) ); GERBER_IMAGE* g_GERBER_List[32]; @@ -68,7 +69,7 @@ void WinEDA_App::MacOpenFile(const wxString &fileName) if( !filename.FileExists() ) return; - frame->LoadOneGerberFile( fileName ); + frame->LoadGerberFiles( fileName ); } @@ -140,7 +141,7 @@ bool WinEDA_App::OnInit() if( fn.FileExists() ) { ( (PCB_SCREEN*) frame->GetScreen() )->m_Active_Layer = ii - 1; - frame->LoadOneGerberFile( fn.GetFullPath() ); + frame->LoadGerberFiles( fn.GetFullPath() ); } } } diff --git a/gerbview/gerbview.h b/gerbview/gerbview.h index c1ff5cf6ca..0601e0ceb1 100644 --- a/gerbview/gerbview.h +++ b/gerbview/gerbview.h @@ -62,6 +62,7 @@ extern const wxString GerbviewProjectFileWildcard; extern Ki_PageDescr* g_GerberPageSizeList[]; // Config keywords +extern const wxString GerbviewDrawModeOption; extern const wxString GerbviewShowPageSizeOption; extern const wxString GerbviewShowDCodes; diff --git a/gerbview/gerbview_id.h b/gerbview/gerbview_id.h index 7bbda7fd52..e2aeb62723 100644 --- a/gerbview/gerbview_id.h +++ b/gerbview/gerbview_id.h @@ -25,6 +25,9 @@ enum gerbview_ids ID_TB_OPTIONS_SHOW_DCODES, ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH, ID_TB_OPTIONS_SHOW_LINES_SKETCH, + ID_TB_OPTIONS_SHOW_GBR_MODE_0, + ID_TB_OPTIONS_SHOW_GBR_MODE_1, + ID_TB_OPTIONS_SHOW_GBR_MODE_2, ID_GERBER_END_LIST }; diff --git a/gerbview/menubar.cpp b/gerbview/menubar.cpp index 77653519c2..4c465bbdd6 100644 --- a/gerbview/menubar.cpp +++ b/gerbview/menubar.cpp @@ -55,8 +55,6 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void ) filesMenu->AppendSeparator(); filesMenu->Append( wxID_PRINT, _( "P&rint" ), _( "Print gerber" ) ); - filesMenu->Append( ID_GEN_PLOT, _( "Plot" ), - _( "Plotting in various formats" ) ); filesMenu->AppendSeparator(); filesMenu->Append( ID_EXIT, _( "E&xit" ), _( "Quit Gerbview" ) ); diff --git a/gerbview/onrightclick.cpp b/gerbview/onrightclick.cpp index 0015e9dc51..f572c9f6b9 100644 --- a/gerbview/onrightclick.cpp +++ b/gerbview/onrightclick.cpp @@ -61,14 +61,10 @@ bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, if( BlockActive ) return true; - PopMenu->Append( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, - _( "Delete Dcode items" ) ); - if( DrawStruct == NULL ) return true; GetScreen()->SetCurItem( DrawStruct ); - PopMenu->AppendSeparator(); return true; } diff --git a/gerbview/rs274x.cpp b/gerbview/rs274x.cpp index 9c5233fb49..6b731651c2 100644 --- a/gerbview/rs274x.cpp +++ b/gerbview/rs274x.cpp @@ -503,6 +503,7 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command, case LAYER_POLARITY: if( *text == 'C' ) GetLayerParams().m_LayerNegative = true; + else GetLayerParams().m_LayerNegative = false; D( printf( "%22s: LAYER_POLARITY m_LayerNegative=%s\n", __func__, diff --git a/gerbview/toolbars_gerber.cpp b/gerbview/toolbars_gerber.cpp index 6b34375e11..102ad6cbad 100644 --- a/gerbview/toolbars_gerber.cpp +++ b/gerbview/toolbars_gerber.cpp @@ -200,6 +200,24 @@ void WinEDA_GerberFrame::ReCreateOptToolbar( void ) wxBitmap( show_dcodenumber_xpm ), _( "Show dcode number" ), wxITEM_CHECK ); + // tools to select draw mode in gerbview + m_OptionsToolBar->AddSeparator(); + m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_0, wxEmptyString, + wxBitmap( gbr_select_mode0_xpm ), + _( "Show layers in raw mode\ +(could have problems with negative items when more than one gerber file is shown)" ), + wxITEM_CHECK ); + m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_1, wxEmptyString, + wxBitmap( gbr_select_mode1_xpm ), + _( "Show layers in stacked mode\ +(show negative items without artefact, sometimes slow)" ), + wxITEM_CHECK ); + m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_2, wxEmptyString, + wxBitmap( gbr_select_mode2_xpm ), + _( "Show layers in tranparency mode\ +(show negative items without artefact, sometimes slow)" ), + wxITEM_CHECK ); + // Tools to show/hide toolbars: m_OptionsToolBar->AddSeparator(); m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR, @@ -258,8 +276,7 @@ void WinEDA_GerberFrame::SetToolbars() { m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_MM, - g_UserUnit == - MILLIMETRES ? true : false ); + g_UserUnit == MILLIMETRES ? true : false ); m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, g_UserUnit == INCHES ? true : false ); @@ -284,6 +301,10 @@ void WinEDA_GerberFrame::SetToolbars() m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_DCODES, IsElementVisible( DCODES_VISIBLE ) ); + m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_GBR_MODE_0, GetDisplayMode() == 0 ); + m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_GBR_MODE_1, GetDisplayMode() == 1 ); + m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_GBR_MODE_2, GetDisplayMode() == 2 ); + m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR, m_show_layer_manager_tools ); if( m_show_layer_manager_tools ) diff --git a/gerbview/wxGerberFrame.h b/gerbview/wxGerberFrame.h index 3417531a23..d3f82f41e9 100644 --- a/gerbview/wxGerberFrame.h +++ b/gerbview/wxGerberFrame.h @@ -46,10 +46,19 @@ protected: public: WinEDALayerChoiceBox* m_SelLayerBox; WinEDAChoiceBox* m_SelLayerTool; - wxTextCtrl* m_TextInfo; // a wxTextCtrl used to display some info about - // gerber data (format..) + wxTextCtrl* m_TextInfo; // a wxTextCtrl used to display some info about + // gerber data (format..) private: + int m_displayMode; // Gerber images ("layers" in Gerbview) can be drawn: + // - in fast mode (write mode) but if there are negative items + // only the last image is correctly drawn + // (no problem to see only one image or when no negative items) + // - in "exact" mode (but slower) in write mode: + // last image covers previous images + // - in "exact" mode (also slower) in OR mode + // (transparency mode) + // m_displayMode = 0, 1 or 2 bool m_show_layer_manager_tools; wxArrayString m_Messages; // An array sting to store warning messages when reaging a gerber file @@ -83,6 +92,22 @@ public: m_Messages.Clear( ); } + /** + * Function GetDisplayMode + * @return 0 for fast mode (not fully compatible with negative objects) + * 1 for exact mode, write mode + * 2 for exact mode, OR mode (transparency mode) + */ + int GetDisplayMode() { return m_displayMode;} + + /** + * Function SetDisplayMode + * @param aMode = 0 for fast mode + * 1 for exact mode, write mode + * 2 for exact mode, OR mode (transparency mode) + */ + void SetDisplayMode( int aMode ) { m_displayMode = aMode;} + /** * Function IsGridVisible() , virtual * @return true if the grid must be shown @@ -234,6 +259,13 @@ public: bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); int BestZoom(); void OnSelectOptionToolbar( wxCommandEvent& event ); + /** + * Function OnSelectDisplayMode + * called on a display mode selection + * Mode selection can be fast display, + * or exact mode with stacked images or with transparency + */ + void OnSelectDisplayMode( wxCommandEvent& event ); void OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct ); GERBER_DRAW_ITEM* GerberGeneralLocateAndDisplay(); @@ -284,7 +316,6 @@ public: */ void Block_Duplicate( wxDC* DC ); - void InstallDrillFrame( wxCommandEvent& event ); void ToPostProcess( wxCommandEvent& event ); /** @@ -318,20 +349,17 @@ public: void OnFileHistory( wxCommandEvent& event ); /** - * Load a photoplot (Gerber) file. - * - * @param aFileName - File name with full path to open or empty string to open a new - * file. - * @param aOpenFileDialog - Set to true to display the open file dialog even if - * aFileName is valid. - * - * @return - True if file was opened successfully. + * function LoadGerberFiles + * Load a photoplot (Gerber) file or many files. + * @param aFileName - void string or file name with full path to open or empty string to open a new + * file. In this case one one file is loaded + * if void string: user will be prompted for filename(s) + * @return true if file was opened successfully. */ - bool LoadOneGerberFile( const wxString& aFileName, bool aOpenFileDialog = false ); + bool LoadGerberFiles( const wxString& aFileName ); int ReadGerberFile( FILE* File, bool Append ); bool Read_GERBER_File( const wxString& GERBER_FullFileName, const wxString& D_Code_FullFileName ); - bool SaveGerberFile( const wxString& FileName ); void GeneralControle( wxDC* DC, wxPoint Mouse ); @@ -409,13 +437,22 @@ public: int aPrintMasklayer, bool aPrintMirrorMode, void * aData = NULL); - /** InstallDialogLayerPairChoice + /** + * Function InstallDialogLayerPairChoice * Install a dialog frame to choose the equivalence * between gerber layers and pcbnew layers * @return the "lookup table" if ok, or NULL */ int* InstallDialogLayerPairChoice( ); + /** + * Function DrawItemsDCodeID + * Draw the DCode value (if exists) corresponding to gerber item + * (polygons do not have a DCode) + * @param aDC = the current device contect + * @param aDrawMode = GR_COPY, GR_OR ... + */ + void DrawItemsDCodeID( wxDC* aDC, int aDrawMode ); DECLARE_EVENT_TABLE() }; diff --git a/include/bitmaps.h b/include/bitmaps.h index e1491902ec..e31380853e 100644 --- a/include/bitmaps.h +++ b/include/bitmaps.h @@ -129,6 +129,9 @@ extern const char* find_xpm[]; extern const char* flag_xpm[]; extern const char* fonts_xpm[]; extern const char* footprint_text_xpm[]; +extern const char* gbr_select_mode0_xpm[]; +extern const char* gbr_select_mode1_xpm[]; +extern const char* gbr_select_mode2_xpm[]; extern const char* general_deletions_xpm[]; extern const char* general_ratsnet_xpm[]; extern const char* glabel2label_xpm[];