Send commitlog mailing list submissions to
commitlog@lists.openmoko.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
commitlog-requ...@lists.openmoko.org
You can reach the person managing the list at
commitlog-ow...@lists.openmoko.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:
1. r5513 - trunk/gta02-core (alvie...@docs.openmoko.org)
2. r5514 - trunk/eda/fped (wer...@docs.openmoko.org)
3. r5515 - trunk/eda/fped (wer...@docs.openmoko.org)
--- Begin Message ---
Author: alvieboy
Date: 2009-08-21 19:28:19 +0200 (Fri, 21 Aug 2009)
New Revision: 5513
Modified:
trunk/gta02-core/pmu.sch
Log:
Small cleanups
Modified: trunk/gta02-core/pmu.sch
===================================================================
--- trunk/gta02-core/pmu.sch 2009-08-21 16:29:02 UTC (rev 5512)
+++ trunk/gta02-core/pmu.sch 2009-08-21 17:28:19 UTC (rev 5513)
@@ -1,4 +1,4 @@
-EESchema Schematic File Version 2 date Fri 21 Aug 2009 17:27:02 WEST
+EESchema Schematic File Version 2 date Fri 21 Aug 2009 18:20:22 WEST
LIBS:power,device,conn,gta02-core,gta02-core-cache
EELAYER 24 0
EELAYER END
@@ -13,11 +13,19 @@
Comment3 ""
Comment4 ""
$EndDescr
+Kmarq B 2500 7500 "Warning Pin passive not driven (Net 144)" F=1
+Kmarq B 10500 5250 "Error: Pin power_out connected to Pin power_out (net 135)"
F=2
+Kmarq B 7550 6050 "Error: Pin power_out connected to Pin power_out (net 133)"
F=2
+Kmarq B 3100 4750 "Warning Pin passive Unconnected" F=1
+Kmarq B 13750 9600 "Warning: Pin power_out connected to Pin BiDi (net 100)" F=1
+Kmarq B 5400 1750 "Warning: Pin power_out connected to Pin BiDi (net 37)" F=1
+Text Notes 11850 800 0 60 ~ 0
+ecn0029: move 0R resistors after filter/buffer caps
Connection ~ 13900 5250
Wire Wire Line
- 13900 6550 13900 6750
+ 13900 6750 13900 6550
Wire Wire Line
- 14700 5600 13900 5600
+ 14800 5600 13900 5600
Wire Wire Line
13900 5600 13300 5600
Wire Wire Line
@@ -25,7 +33,7 @@
Wire Wire Line
13300 7650 10500 7650
Wire Wire Line
- 13050 7350 13050 4450
+ 13050 4450 13050 7350
Wire Wire Line
13050 7350 10500 7350
Wire Wire Line
@@ -45,13 +53,13 @@
Connection ~ 15500 3300
Connection ~ 11900 6850
Wire Wire Line
- 12200 6950 12200 6850
+ 12200 6850 12200 6950
Wire Wire Line
- 12200 6850 11900 6850
+ 10500 6850 11600 6850
Wire Wire Line
- 11900 6850 11600 6850
+ 11600 6850 11900 6850
Wire Wire Line
- 11600 6850 10500 6850
+ 11900 6850 12200 6850
Wire Wire Line
11250 9500 11450 9500
Wire Wire Line
@@ -81,7 +89,7 @@
Wire Wire Line
10500 8150 12400 8150
Wire Wire Line
- 15200 5600 15500 5600
+ 15300 5600 15500 5600
Wire Wire Line
13900 4650 13900 4450
Wire Wire Line
@@ -95,7 +103,7 @@
Wire Wire Line
15300 1000 15500 1000
Wire Wire Line
- 3850 7700 3850 8550
+ 3850 8550 3850 7700
Wire Wire Line
3850 7700 7550 7700
Wire Wire Line
@@ -114,11 +122,11 @@
Connection ~ 14250 1800
Connection ~ 3400 9600
Wire Wire Line
- 9750 10500 9750 10700
+ 9750 10700 9750 10500
Wire Wire Line
- 9750 10700 9350 10700
+ 9150 10700 9350 10700
Wire Wire Line
- 9350 10700 9150 10700
+ 9350 10700 9750 10700
Wire Wire Line
8650 10700 8450 10700
Wire Wire Line
@@ -170,11 +178,11 @@
Wire Wire Line
4600 8450 7550 8450
Wire Wire Line
- 2500 9600 2050 9600
+ 2050 9600 2500 9600
Wire Wire Line
5300 8900 5300 9100
Wire Wire Line
- 5650 8700 5650 9800
+ 5650 9800 5650 8700
Wire Wire Line
11400 5550 11600 5550
Wire Wire Line
@@ -192,7 +200,7 @@
Wire Wire Line
3500 2550 3700 2550
Wire Wire Line
- 4800 1600 4600 1600
+ 4600 1600 4800 1600
Wire Wire Line
10700 2050 10500 2050
Wire Wire Line
@@ -214,7 +222,7 @@
Wire Wire Line
9750 2650 9350 2650
Wire Wire Line
- 9750 3450 10100 3450
+ 10100 3450 9750 3450
Wire Wire Line
10100 3450 10100 3250
Wire Wire Line
@@ -298,25 +306,25 @@
9100 9450 9100 9650
Wire Wire Line
9100 9650 9100 9850
-Connection ~ 6700 10000
+Connection ~ 6700 10050
Wire Wire Line
- 6050 10000 6700 10000
+ 7350 10050 6700 10050
Wire Wire Line
- 6700 10000 7350 10000
-Connection ~ 6050 9200
+ 6700 10050 6050 10050
+Connection ~ 6050 9250
Wire Wire Line
- 6050 9400 6050 9200
+ 6050 9450 6050 9250
Wire Wire Line
- 6050 9200 6050 8800
+ 6050 9250 6050 8800
Wire Wire Line
- 6250 9200 6050 9200
+ 6250 9250 6050 9250
Wire Wire Line
6050 8800 7550 8800
Connection ~ 11600 5550
Wire Wire Line
- 13900 1800 14250 1800
+ 14600 1800 14250 1800
Wire Wire Line
- 14250 1800 14600 1800
+ 14250 1800 13900 1800
Wire Wire Line
14600 1800 14600 1600
Connection ~ 14600 1000
@@ -350,7 +358,7 @@
Wire Wire Line
10700 6550 10500 6550
Wire Wire Line
- 11600 6050 11600 6150
+ 11600 6150 11600 6050
Wire Wire Line
11600 6150 10500 6150
Wire Wire Line
@@ -361,9 +369,9 @@
Wire Wire Line
11600 4850 11600 4650
Wire Wire Line
- 11600 4850 10700 4850
+ 10500 4850 10700 4850
Wire Wire Line
- 10700 4850 10500 4850
+ 10700 4850 11600 4850
Connection ~ 10700 4650
Wire Wire Line
10800 4650 10700 4650
@@ -383,7 +391,7 @@
Wire Wire Line
10700 5250 10700 5150
Wire Wire Line
- 6150 4900 6150 5000
+ 6150 5000 6150 4900
Connection ~ 7350 6050
Wire Wire Line
6650 6050 6650 5950
@@ -438,19 +446,19 @@
Wire Wire Line
7350 5950 7350 6050
Wire Wire Line
- 6150 5000 7350 5000
+ 7550 5000 7350 5000
Wire Wire Line
- 7350 5000 7550 5000
+ 7350 5000 6150 5000
Wire Wire Line
10500 4250 10700 4250
Wire Wire Line
- 10500 4350 10700 4350
+ 10700 4350 10500 4350
Wire Wire Line
10500 4950 10700 4950
Wire Wire Line
- 10700 4350 10700 4250
+ 10700 4150 10700 4250
Wire Wire Line
- 10700 4250 10700 4150
+ 10700 4250 10700 4350
Connection ~ 10700 4250
Wire Wire Line
10500 5150 10700 5150
@@ -489,9 +497,9 @@
13900 1800 13900 1900
Connection ~ 13900 1800
Wire Wire Line
- 13900 2950 14250 2950
+ 14600 2950 14250 2950
Wire Wire Line
- 14250 2950 14600 2950
+ 14250 2950 13900 2950
Wire Wire Line
14600 2950 14600 2750
Wire Wire Line
@@ -511,9 +519,9 @@
Connection ~ 13900 2950
Connection ~ 14250 2950
Wire Wire Line
- 13900 4100 14250 4100
+ 14600 4100 14250 4100
Wire Wire Line
- 14250 4100 14600 4100
+ 14250 4100 13900 4100
Wire Wire Line
14600 4100 14600 3900
Connection ~ 13900 3300
@@ -531,23 +539,23 @@
Connection ~ 13900 4100
Connection ~ 14250 4100
Wire Wire Line
- 7550 8900 7350 8900
+ 7350 8900 7550 8900
Wire Wire Line
- 7150 9200 7350 9200
+ 7150 9250 7350 9250
Wire Wire Line
- 7350 8900 7350 9200
+ 7350 9450 7350 9250
Wire Wire Line
- 7350 9200 7350 9400
-Connection ~ 7350 9200
+ 7350 9250 7350 8900
+Connection ~ 7350 9250
Wire Wire Line
- 6700 9600 6700 10000
+ 6700 9650 6700 10050
Wire Wire Line
- 7350 10000 7350 9800
+ 7350 10050 7350 9850
Wire Wire Line
- 6050 10250 6050 10000
+ 6050 10300 6050 10050
Wire Wire Line
- 6050 10000 6050 9800
-Connection ~ 6050 10000
+ 6050 10050 6050 9850
+Connection ~ 6050 10050
Wire Wire Line
8900 9450 8900 9650
Wire Wire Line
@@ -556,13 +564,13 @@
Wire Wire Line
13900 5050 13900 5250
Wire Wire Line
+ 13900 5250 13900 5350
+Wire Wire Line
13900 5250 14250 5250
Connection ~ 13900 5600
Wire Wire Line
- 14250 5050 14250 5250
+ 14250 5250 14250 5050
Wire Wire Line
- 13900 5250 13900 5350
-Wire Wire Line
13900 7150 13900 7250
Wire Wire Line
15500 6450 15500 6550
@@ -599,15 +607,15 @@
Wire Wire Line
1600 8050 1600 8250
Wire Wire Line
- 1250 8050 1250 8250
+ 1250 8250 1250 8050
Wire Wire Line
1600 7650 1600 7100
Wire Wire Line
1600 7100 7550 7100
Wire Wire Line
- 1250 8250 1600 8250
+ 1950 8250 1600 8250
Wire Wire Line
- 1600 8250 1950 8250
+ 1600 8250 1250 8250
Connection ~ 1600 8250
Connection ~ 1950 8250
Wire Wire Line
@@ -645,23 +653,23 @@
9750 3450 9750 3550
Connection ~ 9750 3450
Wire Wire Line
- 9350 2300 9550 2300
+ 9550 2300 9350 2300
Wire Wire Line
- 9550 2300 9550 2050
+ 9550 1850 9550 2050
Wire Wire Line
- 9550 2050 9550 1850
+ 9550 2050 9550 2300
Connection ~ 10500 2050
Wire Wire Line
9800 2050 9550 2050
Wire Wire Line
4800 1700 4600 1700
Wire Wire Line
- 4600 1600 4600 1700
+ 4600 1950 4600 1700
Wire Wire Line
- 4600 1700 4600 1950
+ 4600 1700 4600 1600
Connection ~ 4600 1700
Wire Wire Line
- 1900 2550 1900 2900
+ 1900 2900 1900 2550
Wire Wire Line
1900 2900 2100 2900
Wire Wire Line
@@ -680,14 +688,14 @@
Wire Wire Line
5300 9600 5300 9800
Wire Wire Line
- 5650 9800 5300 9800
+ 5100 9800 5300 9800
Wire Wire Line
- 5300 9800 5100 9800
+ 5300 9800 5650 9800
Connection ~ 5300 9800
Wire Wire Line
- 2050 9600 2050 10050
+ 2050 10250 2050 10050
Wire Wire Line
- 2050 10050 2050 10250
+ 2050 10050 2050 9600
Wire Wire Line
2900 9850 2900 10050
Wire Wire Line
@@ -734,9 +742,9 @@
Wire Wire Line
3400 8350 3400 8550
Wire Wire Line
- 3850 8550 3400 8550
+ 3150 8550 3400 8550
Wire Wire Line
- 3400 8550 3150 8550
+ 3400 8550 3850 8550
Connection ~ 3400 8550
Wire Wire Line
5350 8300 5350 8000
@@ -774,7 +782,7 @@
7650 1300 8050 1300
Connection ~ 8050 1300
Wire Wire Line
- 7550 8050 7350 8050
+ 7350 8050 7550 8050
Wire Wire Line
7350 8050 7350 8150
Wire Wire Line
@@ -799,7 +807,7 @@
Connection ~ 13900 4450
Connection ~ 15500 5600
Wire Wire Line
- 15150 6550 15500 6550
+ 15300 6550 15500 6550
Wire Wire Line
15350 9100 15550 9100
Wire Wire Line
@@ -807,11 +815,11 @@
Wire Wire Line
13550 9500 13750 9500
Wire Wire Line
- 10500 8550 11800 8550
+ 11800 8550 10500 8550
Wire Wire Line
- 11800 8550 11800 9500
+ 11800 9700 11800 9500
Wire Wire Line
- 11800 9500 11800 9700
+ 11800 9500 11800 8550
Wire Wire Line
10750 9500 10550 9500
Wire Wire Line
@@ -856,25 +864,19 @@
15500 4450 15500 4550
Connection ~ 15500 4450
Wire Wire Line
- 13050 4450 13900 4450
+ 14800 4450 14250 4450
Wire Wire Line
- 13900 4450 14250 4450
+ 14250 4450 13900 4450
Wire Wire Line
- 14250 4450 14800 4450
+ 13900 4450 13050 4450
Wire Wire Line
10500 7750 13600 7750
Wire Wire Line
- 13600 7750 13600 6550
+ 13600 6550 13600 7750
Wire Wire Line
- 13600 6550 13900 6550
+ 14800 6550 13900 6550
Wire Wire Line
- 13900 6550 14650 6550
-Kmarq B 2500 7500 "Warning Pin passive not driven (Net 145)" F=1
-Kmarq B 10500 5250 "Error: Pin power_out connected to Pin power_out (net 136)"
F=2
-Kmarq B 7550 6050 "Error: Pin power_out connected to Pin power_out (net 134)"
F=2
-Kmarq B 3100 4750 "Warning Pin passive Unconnected" F=1
-Kmarq B 13750 9600 "Warning: Pin power_out connected to Pin BiDi (net 99)" F=1
-Kmarq B 5400 1750 "Warning: Pin power_out connected to Pin BiDi (net 37)" F=1
+ 13900 6550 13600 6550
$Comp
L PWR_FLAG #FLG0116
U 1 1 4A8EC46C
@@ -2022,39 +2024,39 @@
$Comp
L GND #PWR0189
U 1 1 4A3A7E21
-P 6050 10250
-F 0 "#PWR0189" H 6050 10250 30 0001 C CNN
-F 1 "GND" H 6050 10180 30 0001 C CNN
- 1 6050 10250
+P 6050 10300
+F 0 "#PWR0189" H 6050 10300 30 0001 C CNN
+F 1 "GND" H 6050 10230 30 0001 C CNN
+ 1 6050 10300
1 0 0 -1
$EndComp
$Comp
L C C1702
U 1 1 4A3A7DE6
-P 6050 9600
-F 0 "C1702" H 6100 9700 50 0000 L CNN
-F 1 "10p" H 6100 9500 50 0000 L CNN
-F 2 "C0402-H" H 6050 9600 60 0001 C CNN
- 1 6050 9600
+P 6050 9650
+F 0 "C1702" H 6100 9750 50 0000 L CNN
+F 1 "10p" H 6100 9550 50 0000 L CNN
+F 2 "C0402-H" H 6050 9650 60 0001 C CNN
+ 1 6050 9650
1 0 0 -1
$EndComp
$Comp
L C C1703
U 1 1 4A3A7DA5
-P 7350 9600
-F 0 "C1703" H 7400 9700 50 0000 L CNN
-F 1 "10p" H 7400 9500 50 0000 L CNN
-F 2 "C0402-H" H 7350 9600 60 0001 C CNN
- 1 7350 9600
+P 7350 9650
+F 0 "C1703" H 7400 9750 50 0000 L CNN
+F 1 "10p" H 7400 9550 50 0000 L CNN
+F 2 "C0402-H" H 7350 9650 60 0001 C CNN
+ 1 7350 9650
1 0 0 -1
$EndComp
$Comp
L MS2V-T1S X1701
U 1 1 4A3A7D91
-P 6700 9200
-F 0 "X1701" H 6700 9550 60 0000 C CNN
-F 1 "MS2V-T1S" H 6700 9450 60 0000 C CNN
- 1 6700 9200
+P 6700 9250
+F 0 "X1701" H 6700 9600 60 0000 C CNN
+F 1 "MS2V-T1S" H 6700 9500 60 0000 C CNN
+ 1 6700 9250
1 0 0 -1
$EndComp
$Comp
@@ -2216,21 +2218,21 @@
$Comp
L R_US R1717
U 1 1 4A39FA05
-P 14900 6550
-F 0 "R1717" H 14900 6650 50 0000 C CNN
-F 1 "0R" H 15100 6600 50 0000 C CNN
-F 2 "R0402-H" H 14900 6550 60 0001 C CNN
- 1 14900 6550
+P 15050 6550
+F 0 "R1717" H 15050 6650 50 0000 C CNN
+F 1 "0R" H 15050 6450 50 0000 C CNN
+F 2 "R0402-H" H 15050 6550 60 0001 C CNN
+ 1 15050 6550
1 0 0 -1
$EndComp
$Comp
L R_US R1718
U 1 1 4A39FA02
-P 14950 5600
-F 0 "R1718" H 14950 5700 50 0000 C CNN
-F 1 "0R" H 15150 5650 50 0000 C CNN
-F 2 "R0402-H" H 14950 5600 60 0001 C CNN
- 1 14950 5600
+P 15050 5600
+F 0 "R1718" H 15050 5700 50 0000 C CNN
+F 1 "0R" H 15050 5500 50 0000 C CNN
+F 2 "R0402-H" H 15050 5600 60 0001 C CNN
+ 1 15050 5600
1 0 0 -1
$EndComp
$Comp
--- End Message ---
--- Begin Message ---
Author: werner
Date: 2009-08-21 20:20:37 +0200 (Fri, 21 Aug 2009)
New Revision: 5514
Added:
trunk/eda/fped/leak.supp
Modified:
trunk/eda/fped/TODO
trunk/eda/fped/fped.c
trunk/eda/fped/gui.c
trunk/eda/fped/gui_style.c
trunk/eda/fped/gui_style.h
trunk/eda/fped/gui_tool.c
trunk/eda/fped/gui_tool.h
trunk/eda/fped/inst.c
trunk/eda/fped/inst.h
trunk/eda/fped/leakcheck
trunk/eda/fped/meas.c
trunk/eda/fped/obj.c
Log:
- measurement offsets can now use variables. We evaluate the offset during
instantiation and create a partially formed instance. During measurement
instantiation, we complete that instance.
- leak.supp: finally figured out how to write a valgrind suppression file
- fped.c: we don't need the FPED_NO_GUI kludge anymore
- fped.c: moved gui_cleanup_style to gui_main
- dereference icons (seems that this doesn't deallocate everything, though)
Modified: trunk/eda/fped/TODO
===================================================================
--- trunk/eda/fped/TODO 2009-08-21 17:28:19 UTC (rev 5513)
+++ trunk/eda/fped/TODO 2009-08-21 18:20:37 UTC (rev 5514)
@@ -34,8 +34,6 @@
- whenever we call parse_* for input parsing, we may leak lots of expressions
- can't edit measurement labels through the GUI
- r of rpads is misleading, particularly if we have a circle
-- using variables in a measurement offset causes a crash because evaluation
- takes place after all table entries have been visited
Code cleanup:
- merge edit_unique with edit_name
Modified: trunk/eda/fped/fped.c
===================================================================
--- trunk/eda/fped/fped.c 2009-08-21 17:28:19 UTC (rev 5513)
+++ trunk/eda/fped/fped.c 2009-08-21 18:20:37 UTC (rev 5514)
@@ -56,13 +56,10 @@
int error;
int batch_write_kicad = 0, batch_write_ps = 0;
int c;
- int have_gui = !getenv("FPED_NO_GUI");
- if (have_gui) {
- error = gui_init(&argc, &argv);
- if (error)
- return error;
- }
+ error = gui_init(&argc, &argv);
+ if (error)
+ return error;
while ((c = getopt(argc, argv, "kp")) != EOF)
switch (c) {
@@ -106,7 +103,7 @@
write_kicad();
if (batch_write_ps)
write_ps();
- if (have_gui && !batch_write_kicad && !batch_write_ps) {
+ if (!batch_write_kicad && !batch_write_ps) {
error = gui_main();
if (error)
return error;
Modified: trunk/eda/fped/gui.c
===================================================================
--- trunk/eda/fped/gui.c 2009-08-21 17:28:19 UTC (rev 5513)
+++ trunk/eda/fped/gui.c 2009-08-21 18:20:37 UTC (rev 5514)
@@ -139,6 +139,15 @@
}
+static void cleanup_tool_bar(void)
+{
+ g_object_unref(stuff_image[0]);
+ g_object_unref(stuff_image[1]);
+ g_object_unref(meas_image[0]);
+ g_object_unref(meas_image[1]);
+}
+
+
static void make_top_bar(GtkWidget *vbox)
{
GtkWidget *hbox;
@@ -248,5 +257,9 @@
gtk_main();
+ gui_cleanup_style();
+ gui_cleanup_tools();
+ cleanup_tool_bar();
+
return 0;
}
Modified: trunk/eda/fped/gui_style.c
===================================================================
--- trunk/eda/fped/gui_style.c 2009-08-21 17:28:19 UTC (rev 5513)
+++ trunk/eda/fped/gui_style.c 2009-08-21 18:20:37 UTC (rev 5514)
@@ -74,3 +74,9 @@
item_list_font = pango_font_description_from_string(ITEM_LIST_FONT);
}
+
+
+void gui_cleanup_style(void)
+{
+ pango_font_description_free(item_list_font);
+}
Modified: trunk/eda/fped/gui_style.h
===================================================================
--- trunk/eda/fped/gui_style.h 2009-08-21 17:28:19 UTC (rev 5513)
+++ trunk/eda/fped/gui_style.h 2009-08-21 18:20:37 UTC (rev 5514)
@@ -115,5 +115,6 @@
extern PangoFontDescription *item_list_font;
void gui_setup_style(GdkDrawable *drawable);
+void gui_cleanup_style(void);
#endif /* !GUI_STYLE_H */
Modified: trunk/eda/fped/gui_tool.c
===================================================================
--- trunk/eda/fped/gui_tool.c 2009-08-21 17:28:19 UTC (rev 5513)
+++ trunk/eda/fped/gui_tool.c 2009-08-21 18:20:37 UTC (rev 5514)
@@ -1044,3 +1044,13 @@
return bar;
}
+
+
+void gui_cleanup_tools(void)
+{
+ g_object_unref(frame_image);
+ g_object_unref(frame_image_locked);
+ g_object_unref(frame_image_ready);
+ g_object_unref(delete_image[0]);
+ g_object_unref(delete_image[1]);
+}
Modified: trunk/eda/fped/gui_tool.h
===================================================================
--- trunk/eda/fped/gui_tool.h 2009-08-21 17:28:19 UTC (rev 5513)
+++ trunk/eda/fped/gui_tool.h 2009-08-21 18:20:37 UTC (rev 5514)
@@ -77,5 +77,6 @@
void tool_reset(void);
GtkWidget *gui_setup_tools(GdkDrawable *drawable);
+void gui_cleanup_tools(void);
#endif /* !GUI_TOOL_H */
Modified: trunk/eda/fped/inst.c
===================================================================
--- trunk/eda/fped/inst.c 2009-08-21 17:28:19 UTC (rev 5513)
+++ trunk/eda/fped/inst.c 2009-08-21 18:20:37 UTC (rev 5514)
@@ -803,18 +803,28 @@
};
-int inst_meas(struct obj *obj,
- struct coord from, struct coord to, unit_type offset)
+static struct inst *find_meas_hint(const struct obj *obj)
{
struct inst *inst;
+
+ for (inst = curr_pkg->insts[ip_meas]; inst; inst = inst->next)
+ if (inst->obj == obj)
+ break;
+ return inst;
+}
+
+
+int inst_meas(struct obj *obj, struct coord from, struct coord to)
+{
+ struct inst *inst;
struct coord a1, b1;
- inst = add_inst(&meas_ops, ip_meas, from);
- inst->obj = obj;
+ inst = find_meas_hint(obj);
+ assert(inst);
+ inst->base = from;
inst->u.meas.end = to;
- inst->u.meas.offset = offset;
- inst->active = 1; /* measurements are always active */
/* @@@ we still need to consider the text size as well */
+ update_bbox(&inst->bbox, from);
update_bbox(&inst->bbox, to);
project_meas(inst, &a1, &b1);
update_bbox(&inst->bbox, a1);
@@ -824,6 +834,21 @@
}
+void inst_meas_hint(struct obj *obj, unit_type offset)
+{
+ static const struct coord zero = { 0, 0 };
+ struct inst *inst;
+
+ inst = find_meas_hint(obj);
+ if (inst)
+ return;
+ inst = add_inst(&meas_ops, ip_meas, zero);
+ inst->obj = obj;
+ inst->u.meas.offset = offset;
+ inst->active = 1; /* measurements are always active */
+}
+
+
/* ----- direct editing of objects ----------------------------------------- */
Modified: trunk/eda/fped/inst.h
===================================================================
--- trunk/eda/fped/inst.h 2009-08-21 17:28:19 UTC (rev 5513)
+++ trunk/eda/fped/inst.h 2009-08-21 18:20:37 UTC (rev 5514)
@@ -164,8 +164,8 @@
int inst_pad(struct obj *obj, const char *name, struct coord a, struct coord
b);
int inst_arc(struct obj *obj, struct coord center, struct coord start,
struct coord stop, unit_type width);
-int inst_meas(struct obj *obj, struct coord from, struct coord to,
- unit_type offset);
+int inst_meas(struct obj *obj, struct coord from, struct coord to);
+void inst_meas_hint(struct obj *obj, unit_type offset);
void inst_begin_active(int active);
void inst_end_active(void);
Added: trunk/eda/fped/leak.supp
===================================================================
--- trunk/eda/fped/leak.supp (rev 0)
+++ trunk/eda/fped/leak.supp 2009-08-21 18:20:37 UTC (rev 5514)
@@ -0,0 +1,31 @@
+{
+ gtk_internal
+ Memcheck:Leak
+ ...
+ fun:gtk_init
+}
+
+{
+ lex
+ Memcheck:Leak
+ fun:malloc
+ ...
+ fun:yyensure_buffer_stack
+ ...
+}
+
+{
+ pango_leaks_like_crazy
+ Memcheck:Leak
+ ...
+ fun:pango_*
+ ...
+}
+
+{
+ gdk_pixbuf_new_from_xpm_data_leaks_through_dlopen
+ Memcheck:Leak
+ ...
+ fun:dlopen
+ ...
+}
Modified: trunk/eda/fped/leakcheck
===================================================================
--- trunk/eda/fped/leakcheck 2009-08-21 17:28:19 UTC (rev 5513)
+++ trunk/eda/fped/leakcheck 2009-08-21 18:20:37 UTC (rev 5514)
@@ -1,13 +1,4 @@
#!/bin/sh
-#valgrind --leak-check=full --show-reachable=yes --suppressions=leak.supp \
-# ./fped "$@"
-
-#
-# Seems that we can't suppress warnings from gtk_init, so we use FPED_NO_GUI
-# to avoid bringing up Gtk+ at all.
-#
-FPED_NO_GUI=y valgrind --leak-check=full --show-reachable=yes \
+valgrind --leak-check=full --show-reachable=yes --num-callers=50 \
+ --suppressions=leak.supp \
./fped "$@"
-
-#valgrind --leak-check=full --show-reachable=no \
-# ./fped "$@"
Modified: trunk/eda/fped/meas.c
===================================================================
--- trunk/eda/fped/meas.c 2009-08-21 17:28:19 UTC (rev 5513)
+++ trunk/eda/fped/meas.c 2009-08-21 18:20:37 UTC (rev 5514)
@@ -231,7 +231,6 @@
const struct meas *meas;
struct coord a0, b0;
lt_op_type lt;
- struct num offset;
for (obj = root_frame->objs; obj; obj = obj->next) {
if (obj->type != ot_meas)
@@ -250,18 +249,8 @@
b0 = meas_find_max(lt,
curr_pkg->samples[meas->high->n]);
- if (!meas->offset)
- offset.n = 0;
- else {
- offset = eval_unit(meas->offset, root_frame);
- if (is_undef(offset)) {
- instantiation_error = obj;
- return 0;
- }
- }
inst_meas(obj,
- meas->inverted ? b0 : a0, meas->inverted ? a0 : b0,
- offset.n);
+ meas->inverted ? b0 : a0, meas->inverted ? a0 : b0);
}
return 1;
}
Modified: trunk/eda/fped/obj.c
===================================================================
--- trunk/eda/fped/obj.c 2009-08-21 17:28:19 UTC (rev 5513)
+++ trunk/eda/fped/obj.c 2009-08-21 18:20:37 UTC (rev 5514)
@@ -94,10 +94,15 @@
static int generate_objs(struct frame *frame, struct coord base, int active)
{
+ static const struct num zero_offset = {
+ .type = nt_mm,
+ .exponent = 0,
+ .n = 0,
+ };
struct obj *obj;
char *name;
int ok;
- struct num width;
+ struct num width, offset;
for (obj = frame->objs; obj; obj = obj->next)
switch (obj->type) {
@@ -150,6 +155,12 @@
goto error;
break;
case ot_meas:
+ assert(frame == root_frame);
+ offset = eval_unit_default(obj->u.meas.offset, frame,
+ zero_offset);
+ if (is_undef(offset))
+ goto error;
+ inst_meas_hint(obj, offset.n);
break;
default:
abort();
--- End Message ---
--- Begin Message ---
Author: werner
Date: 2009-08-21 21:19:33 +0200 (Fri, 21 Aug 2009)
New Revision: 5515
Modified:
trunk/eda/fped/TODO
trunk/eda/fped/inst.c
Log:
- calculation of a rounded pad's diagonal is now more sensible. We use the
length of the part of the diagonal that's on the pad. In the case of a
circle (BGA), this is just the diameter.
- changed label for diagonals from "r" to "d"
Modified: trunk/eda/fped/TODO
===================================================================
--- trunk/eda/fped/TODO 2009-08-21 18:20:37 UTC (rev 5514)
+++ trunk/eda/fped/TODO 2009-08-21 19:19:33 UTC (rev 5515)
@@ -33,7 +33,7 @@
- focus should return to canvas if nobody else wants it
- whenever we call parse_* for input parsing, we may leak lots of expressions
- can't edit measurement labels through the GUI
-- r of rpads is misleading, particularly if we have a circle
+- unbalanced parentheses in text throw off Postscript syntax
Code cleanup:
- merge edit_unique with edit_name
Modified: trunk/eda/fped/inst.c
===================================================================
--- trunk/eda/fped/inst.c 2009-08-21 18:20:37 UTC (rev 5514)
+++ trunk/eda/fped/inst.c 2009-08-21 19:19:33 UTC (rev 5515)
@@ -364,10 +364,12 @@
/* ----- common status reporting ------------------------------------------- */
-static void rect_status(struct coord a, struct coord b, unit_type width)
+static void rect_status(struct coord a, struct coord b, unit_type width,
+ int rounded)
{
struct coord d = sub_vec(b, a);
- double angle;
+ double angle, r;
+ unit_type diag;
status_set_xy(d);
if (!d.x && !d.y)
@@ -376,7 +378,33 @@
angle = theta(a, b);
status_set_angle("a = %3.1f deg", angle);
}
- set_with_units(status_set_r, "r = ", hypot(d.x, d.y));
+ if (d.x < 0)
+ d.x = -d.x;
+ if (d.y < 0)
+ d.y = -d.y;
+ diag = hypot(d.x, d.y);
+ if (rounded) {
+ /*
+ * Only consider the part of the diagonal that is on the pad
+ * surface.
+ *
+ * The circle: (x-r)^2+(y-r)^2 = r^2
+ * The diagonal: x = t*cos(theta), y = t*sin(theta)
+ *
+ * t is the distance from the corner of the surrounding
+ * rectangle to the half-circle:
+ *
+ * t = 2*r*(s+c-sqrt(2*s*c))
+ *
+ * With s = sin(theta) and c = cos(theta).
+ *
+ * Since d.x = diag*cos(theta), we don't need to calculate the
+ * sinus and cosinus but can use d.x and d.y directly.
+ */
+ r = (d.x > d.y ? d.y : d.x)/2;
+ diag -= 2*r*(d.x+d.y-sqrt(2*d.x*d.y))/diag;
+ }
+ set_with_units(status_set_r, "d = ", diag);
if (width != -1) {
status_set_type_entry("width =");
set_with_units(status_set_name, "", width);
@@ -467,7 +495,7 @@
{
status_set_type_entry("ref =");
status_set_name("%s", self->vec->name ? self->vec->name : "");
- rect_status(self->base, self->u.rect.end, -1);
+ rect_status(self->base, self->u.rect.end, -1, 0);
vec_edit(self->vec);
}
@@ -538,7 +566,7 @@
static void line_op_select(struct inst *self)
{
- rect_status(self->bbox.min, self->bbox.max, self->u.rect.width);
+ rect_status(self->bbox.min, self->bbox.max, self->u.rect.width, 0);
obj_line_edit(self->obj);
}
@@ -588,7 +616,7 @@
static void rect_op_select(struct inst *self)
{
- rect_status(self->bbox.min, self->bbox.max, self->u.rect.width);
+ rect_status(self->bbox.min, self->bbox.max, self->u.rect.width, 0);
obj_rect_edit(self->obj);
}
@@ -642,7 +670,7 @@
{
status_set_type_entry("label =");
status_set_name("%s", self->u.pad.name);
- rect_status(self->base, self->u.pad.other, -1);
+ rect_status(self->base, self->u.pad.other, -1, 0);
obj_pad_edit(self->obj);
}
@@ -666,10 +694,19 @@
};
+static void rpad_op_select(struct inst *self)
+{
+ status_set_type_entry("label =");
+ status_set_name("%s", self->u.pad.name);
+ rect_status(self->base, self->u.pad.other, -1, 1);
+ obj_pad_edit(self->obj);
+}
+
+
static struct inst_ops rpad_ops = {
.draw = gui_draw_rpad,
.distance = gui_dist_pad, /* @@@ */
- .select = pad_op_select,
+ .select = rpad_op_select,
.anchors = pad_op_anchors,
.draw_move = draw_move_rpad,
};
@@ -773,7 +810,7 @@
static void meas_op_select(struct inst *self)
{
- rect_status(self->bbox.min, self->bbox.max, -1);
+ rect_status(self->bbox.min, self->bbox.max, -1, 0);
status_set_type_entry("offset =");
set_with_units(status_set_name, "", self->u.meas.offset);
obj_meas_edit(self->obj);
@@ -898,7 +935,7 @@
static void frame_op_select(struct inst *self)
{
- rect_status(self->bbox.min, self->bbox.max, -1);
+ rect_status(self->bbox.min, self->bbox.max, -1, 0);
status_set_type_entry("name =");
status_set_name("%s", self->u.frame.ref->name);
}
--- End Message ---
_______________________________________________
commitlog mailing list
commitlog@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/commitlog