diff --git a/demos/interf_u/image.emp b/demos/interf_u/image.emp
deleted file mode 100644
index 76c436679e..0000000000
--- a/demos/interf_u/image.emp
+++ /dev/null
@@ -1,453 +0,0 @@
-PCBNEW-LibModule-V1
-$INDEX
-LOGO
-$EndINDEX
-#
-# LOGO
-# pixmap w = 229, h = 270
-#
-$MODULE LOGO
-Po 0 0 0 15 00000000 00000000 ~~
-T0 0 4800 600 600 0 120 N I 21 "G***"
-T1 0 -4800 600 600 0 120 N I 21 "LOGO"
-DP 0 0 0 0 5 1 21
-Dl -3783 4516
-Dl -3766 -4466
-Dl 3850 -4483
-Dl -3800 -4500
-Dl -3783 4516
-DP 0 0 0 0 390 1 21
-Dl 1632 4131
-Dl 1638 4131
-Dl 1780 4126
-Dl 1890 4102
-Dl 2002 4043
-Dl 2149 3930
-Dl 2363 3747
-Dl 2609 3558
-Dl 2925 3367
-Dl 2953 3353
-Dl 3208 3199
-Dl 3374 3049
-Dl 3430 2920
-Dl 3427 2889
-Dl 3408 2899
-Dl 3352 2984
-Dl 3273 3033
-Dl 3265 3034
-Dl 3196 3087
-Dl 3127 3137
-Dl 2968 3224
-Dl 2766 3322
-Dl 2565 3409
-Dl 2409 3464
-Dl 2322 3492
-Dl 2250 3532
-Dl 2193 3578
-Dl 2046 3649
-Dl 1874 3708
-Dl 1736 3733
-Dl 1669 3729
-Dl 1582 3691
-Dl 1484 3578
-Dl 1479 3570
-Dl 1408 3458
-Dl 1371 3333
-Dl 1360 3154
-Dl 1369 2883
-Dl 1374 2686
-Dl 1361 2510
-Dl 1318 2351
-Dl 1286 2218
-Dl 1266 2017
-Dl 1257 1890
-Dl 1233 1816
-Dl 1230 1815
-Dl 1208 1871
-Dl 1199 2043
-Dl 1199 2110
-Dl 1190 2365
-Dl 1158 2536
-Dl 1091 2664
-Dl 977 2790
-Dl 920 2843
-Dl 516 3128
-Dl 70 3289
-Dl -404 3323
-Dl -637 3292
-Dl -853 3202
-Dl -1017 3037
-Dl -1126 2886
-Dl -999 2829
-Dl -983 2821
-Dl -843 2712
-Dl -822 2563
-Dl -822 2562
-Dl -856 2472
-Dl -936 2370
-Dl -1082 2234
-Dl -1316 2041
-Dl -1493 1900
-Dl -1665 1757
-Dl -1767 1658
-Dl -1816 1577
-Dl -1831 1491
-Dl -1832 1376
-Dl -1818 1157
-Dl -1783 920
-Dl -1783 919
-Dl -1720 715
-Dl -1617 463
-Dl -1494 206
-Dl -1372 -10
-Dl -1272 -144
-Dl -1237 -179
-Dl -1193 -249
-Dl -1222 -335
-Dl -1248 -399
-Dl -1243 -481
-Dl -1185 -620
-Dl -1093 -804
-Dl -979 -1005
-Dl -973 -1016
-Dl -889 -1183
-Dl -877 -1295
-Dl -885 -1396
-Dl -865 -1410
-Dl -865 -2009
-Dl -930 -2105
-Dl -953 -2213
-Dl -966 -2390
-Dl -966 -2426
-Dl -943 -2572
-Dl -861 -2701
-Dl -786 -2787
-Dl -733 -2833
-Dl -692 -2808
-Dl -592 -2724
-Dl -547 -2679
-Dl -450 -2495
-Dl -476 -2314
-Dl -523 -2224
-Dl -543 -2349
-Dl -559 -2417
-Dl -638 -2554
-Dl -744 -2596
-Dl -848 -2525
-Dl -897 -2373
-Dl -832 -2172
-Dl -798 -2106
-Dl -784 -2031
-Dl -794 -2018
-Dl -865 -2009
-Dl -865 -1410
-Dl -838 -1429
-Dl -731 -1345
-Dl -637 -1263
-Dl -471 -1159
-Dl -412 -1136
-Dl -412 -1333
-Dl -483 -1366
-Dl -484 -1369
-Dl -453 -1399
-Dl -412 -1380
-Dl -412 -1473
-Dl -617 -1494
-Dl -737 -1573
-Dl -743 -1597
-Dl -719 -1723
-Dl -644 -1899
-Dl -626 -1935
-Dl -600 -2011
-Dl -580 -2047
-Dl -496 -2136
-Dl -472 -2157
-Dl -369 -2218
-Dl -221 -2228
-Dl -123 -2221
-Dl -125 -2209
-Dl -133 -2208
-Dl -197 -2165
-Dl -133 -2116
-Dl -123 -2113
-Dl -33 -2118
-Dl -18 -2168
-Dl -24 -2193
-Dl 49 -2183
-Dl 233 -2099
-Dl 245 -2094
-Dl 391 -2027
-Dl 478 -1999
-Dl 495 -1996
-Dl 495 -2037
-Dl 423 -2065
-Dl 467 -2158
-Dl 520 -2276
-Dl 512 -2442
-Dl 434 -2577
-Dl 303 -2633
-Dl 230 -2607
-Dl 138 -2490
-Dl 98 -2320
-Dl 97 -2183
-Dl 31 -2262
-Dl -55 -2423
-Dl -45 -2589
-Dl 74 -2708
-Dl 142 -2741
-Dl 313 -2816
-Dl 412 -2842
-Dl 473 -2829
-Dl 484 -2822
-Dl 533 -2739
-Dl 536 -2719
-Dl 596 -2627
-Dl 644 -2561
-Dl 685 -2383
-Dl 659 -2182
-Dl 614 -2083
-Dl 532 -2040
-Dl 495 -2037
-Dl 495 -1996
-Dl 506 -1993
-Dl 604 -1935
-Dl 656 -1882
-Dl 640 -1827
-Dl 614 -1805
-Dl 569 -1828
-Dl 561 -1839
-Dl 511 -1850
-Dl 413 -1805
-Dl 236 -1690
-Dl 89 -1608
-Dl -108 -1528
-Dl -159 -1513
-Dl -412 -1473
-Dl -412 -1380
-Dl -383 -1366
-Dl -381 -1363
-Dl -412 -1333
-Dl -412 -1136
-Dl -399 -1131
-Dl -220 -1110
-Dl -22 -1170
-Dl 232 -1318
-Dl 324 -1377
-Dl 514 -1477
-Dl 628 -1491
-Dl 684 -1425
-Dl 697 -1388
-Dl 760 -1249
-Dl 850 -1065
-Dl 884 -995
-Dl 985 -757
-Dl 1053 -548
-Dl 1117 -358
-Dl 1203 -199
-Dl 1383 97
-Dl 1511 450
-Dl 1536 567
-Dl 1577 892
-Dl 1589 1224
-Dl 1567 1496
-Dl 1556 1560
-Dl 1545 1685
-Dl 1569 1735
-Dl 1579 1744
-Dl 1583 1813
-Dl 1535 1967
-Dl 1534 1970
-Dl 1486 2117
-Dl 1481 2211
-Dl 1516 2321
-Dl 1522 2335
-Dl 1658 2502
-Dl 1859 2582
-Dl 2077 2554
-Dl 2078 2554
-Dl 2201 2473
-Dl 2339 2346
-Dl 2453 2214
-Dl 2499 2120
-Dl 2526 2030
-Dl 2595 1887
-Dl 2618 1845
-Dl 2736 1510
-Dl 2760 1129
-Dl 2690 686
-Dl 2526 166
-Dl 2419 -91
-Dl 2285 -326
-Dl 2107 -549
-Dl 2084 -575
-Dl 1788 -972
-Dl 1513 -1466
-Dl 1410 -1707
-Dl 1349 -1962
-Dl 1333 -2269
-Dl 1331 -2416
-Dl 1285 -2920
-Dl 1171 -3320
-Dl 982 -3631
-Dl 710 -3865
-Dl 349 -4036
-Dl 179 -4082
-Dl -197 -4100
-Dl -546 -4006
-Dl -639 -3959
-Dl -881 -3774
-Dl -1056 -3508
-Dl -1150 -3316
-Dl -1150 -1281
-Dl -1262 -1095
-Dl -1314 -1016
-Dl -1453 -826
-Dl -1612 -629
-Dl -1622 -616
-Dl -1775 -422
-Dl -1887 -238
-Dl -1983 -19
-Dl -2086 281
-Dl -2109 349
-Dl -2204 591
-Dl -2300 793
-Dl -2310 812
-Dl -2400 976
-Dl -2460 1087
-Dl -2484 1146
-Dl -2519 1309
-Dl -2527 1476
-Dl -2503 1579
-Dl -2486 1643
-Dl -2536 1765
-Dl -2631 1904
-Dl -2761 1977
-Dl -2975 2009
-Dl -2990 2010
-Dl -3154 2034
-Dl -3249 2066
-Dl -3294 2122
-Dl -3338 2308
-Dl -3323 2604
-Dl -3321 2625
-Dl -3304 2811
-Dl -3316 2944
-Dl -3361 3099
-Dl -3407 3256
-Dl -3427 3451
-Dl -3365 3565
-Dl -3216 3619
-Dl -3085 3647
-Dl -2900 3701
-Dl -2717 3757
-Dl -2500 3813
-Dl -2192 3895
-Dl -1716 4063
-Dl -1618 4091
-Dl -1618 3724
-Dl -1877 3667
-Dl -2040 3621
-Dl -2194 3587
-Dl -2223 3583
-Dl -2405 3553
-Dl -2631 3514
-Dl -2857 3472
-Dl -3038 3437
-Dl -3132 3416
-Dl -3176 3385
-Dl -3212 3269
-Dl -3178 3139
-Dl -3169 3121
-Dl -3143 2964
-Dl -3148 2711
-Dl -3185 2390
-Dl -3188 2367
-Dl -3179 2222
-Dl -3088 2153
-Dl -2893 2138
-Dl -2693 2117
-Dl -2509 2005
-Dl -2421 1802
-Dl -2395 1718
-Dl -2299 1601
-Dl -2175 1580
-Dl -2092 1629
-Dl -1936 1793
-Dl -1734 2069
-Dl -1482 2464
-Dl -1128 3045
-Dl -1150 3247
-Dl -1168 3355
-Dl -1249 3572
-Dl -1367 3700
-Dl -1418 3719
-Dl -1618 3724
-Dl -1618 4091
-Dl -1549 4111
-Dl -1325 4130
-Dl -1156 4095
-Dl -1096 4057
-Dl -973 3961
-Dl -901 3905
-Dl -829 3866
-Dl -823 3866
-Dl -748 3819
-Dl -729 3806
-Dl -585 3769
-Dl -337 3745
-Dl -7 3736
-Dl 382 3744
-Dl 652 3757
-Dl 868 3774
-Dl 998 3797
-Dl 1067 3833
-Dl 1100 3885
-Dl 1142 3947
-Dl 1256 4047
-Dl 1334 4094
-Dl 1450 4125
-Dl 1632 4131
-DP 0 0 0 0 5 1 21
-Dl 3387 2800
-Dl 3383 2766
-Dl 3346 2733
-Dl 3350 2766
-Dl 3387 2800
-DP 0 0 0 0 5 1 21
-Dl 3283 2733
-Dl 3300 2716
-Dl 3283 2700
-Dl 3266 2716
-Dl 3283 2733
-DP 0 0 0 0 5 1 21
-Dl 3216 2700
-Dl 3233 2683
-Dl 3216 2666
-Dl 3200 2683
-Dl 3216 2700
-DP 0 0 0 0 9 1 21
-Dl 3129 2633
-Dl 3119 2613
-Dl 3050 2533
-Dl 2990 2474
-Dl 2937 2433
-Dl 2946 2453
-Dl 3016 2533
-Dl 3076 2591
-Dl 3129 2633
-DP 0 0 0 0 5 1 21
-Dl 2920 2400
-Dl 2916 2366
-Dl 2879 2333
-Dl 2883 2366
-Dl 2920 2400
-DP 0 0 0 0 7 1 21
-Dl 2812 2179
-Dl 2823 2175
-Dl 2825 2161
-Dl 2823 2025
-Dl 2814 2012
-Dl 2809 2100
-Dl 2812 2179
-$EndMODULE LOGO
-$EndLIBRARY
diff --git a/demos/interf_u/image.mod b/demos/interf_u/image.mod
new file mode 100644
index 0000000000..e4012b5eab
--- /dev/null
+++ b/demos/interf_u/image.mod
@@ -0,0 +1,432 @@
+PCBNEW-LibModule-V1
+$INDEX
+LOGO
+$EndINDEX
+#
+# LOGO
+# pixmap w = 229, h = 270
+#
+$MODULE LOGO
+Po 0 0 0 15 00000000 00000000 ~~
+T0 0 4800 600 600 0 120 N I 21 "G***"
+T1 0 -4800 600 600 0 120 N I 21 "LOGO"
+DP 0 0 0 0 5 1 21
+Dl -3783 4516
+Dl -3766 -4466
+Dl 3850 -4483
+Dl -3800 -4500
+Dl -3783 4516
+DP 0 0 0 0 374 1 21
+Dl 1586 4128
+Dl 1741 4127
+Dl 1914 4087
+Dl 2086 3984
+Dl 2299 3797
+Dl 2405 3706
+Dl 2593 3565
+Dl 2790 3434
+Dl 2958 3337
+Dl 3061 3300
+Dl 3100 3266
+Dl 3141 3233
+Dl 3183 3218
+Dl 3268 3162
+Dl 3338 3098
+Dl 3343 3067
+Dl 3281 3102
+Dl 3276 3107
+Dl 3189 3159
+Dl 3027 3244
+Dl 2829 3342
+Dl 2634 3436
+Dl 2479 3505
+Dl 2402 3533
+Dl 2382 3539
+Dl 2296 3595
+Dl 2249 3627
+Dl 2059 3716
+Dl 1845 3777
+Dl 1678 3788
+Dl 1640 3780
+Dl 1454 3667
+Dl 1338 3469
+Dl 1319 3353
+Dl 1305 3143
+Dl 1299 2894
+Dl 1299 2844
+Dl 1294 2599
+Dl 1279 2454
+Dl 1251 2381
+Dl 1236 2362
+Dl 1207 2349
+Dl 1201 2444
+Dl 1189 2532
+Dl 1134 2627
+Dl 1008 2763
+Dl 936 2831
+Dl 528 3122
+Dl 80 3288
+Dl -401 3325
+Dl -608 3301
+Dl -844 3210
+Dl -1024 3038
+Dl -1134 2893
+Dl -992 2821
+Dl -954 2801
+Dl -865 2731
+Dl -839 2625
+Dl -837 2569
+Dl -862 2466
+Dl -947 2359
+Dl -1116 2214
+Dl -1179 2163
+Dl -1377 2002
+Dl -1579 1835
+Dl -1841 1616
+Dl -1824 1266
+Dl -1819 1172
+Dl -1786 912
+Dl -1724 699
+Dl -1692 618
+Dl -1583 370
+Dl -1465 134
+Dl -1367 -33
+Dl -1364 -38
+Dl -1314 -165
+Dl -1273 -345
+Dl -1257 -430
+Dl -1191 -626
+Dl -1068 -856
+Dl -980 -1011
+Dl -917 -1160
+Dl -900 -1283
+Dl -888 -1401
+Dl -868 -1420
+Dl -868 -1985
+Dl -915 -2076
+Dl -948 -2201
+Dl -966 -2388
+Dl -966 -2389
+Dl -948 -2566
+Dl -878 -2706
+Dl -813 -2784
+Dl -737 -2832
+Dl -721 -2830
+Dl -620 -2763
+Dl -512 -2643
+Dl -448 -2523
+Dl -443 -2483
+Dl -468 -2328
+Dl -511 -2224
+Dl -552 -2363
+Dl -560 -2387
+Dl -644 -2554
+Dl -745 -2602
+Dl -848 -2525
+Dl -897 -2371
+Dl -830 -2170
+Dl -817 -2147
+Dl -781 -2061
+Dl -813 -2005
+Dl -825 -1993
+Dl -868 -1985
+Dl -868 -1420
+Dl -836 -1450
+Dl -745 -1373
+Dl -541 -1197
+Dl -400 -1160
+Dl -400 -1304
+Dl -476 -1320
+Dl -477 -1322
+Dl -491 -1381
+Dl -476 -1382
+Dl -476 -1470
+Dl -650 -1498
+Dl -674 -1510
+Dl -778 -1593
+Dl -786 -1603
+Dl -817 -1655
+Dl -801 -1727
+Dl -730 -1867
+Dl -632 -2020
+Dl -543 -2102
+Dl -518 -2114
+Dl -466 -2178
+Dl -459 -2204
+Dl -368 -2255
+Dl -216 -2267
+Dl -52 -2234
+Dl 2 -2214
+Dl 26 -2228
+Dl -18 -2327
+Dl -40 -2384
+Dl -60 -2540
+Dl -51 -2589
+Dl 0 -2668
+Dl 133 -2759
+Dl 241 -2816
+Dl 411 -2854
+Dl 513 -2783
+Dl 528 -2757
+Dl 606 -2639
+Dl 638 -2586
+Dl 684 -2413
+Dl 677 -2232
+Dl 622 -2090
+Dl 526 -2032
+Dl 520 -2031
+Dl 483 -2021
+Dl 558 -1983
+Dl 616 -1953
+Dl 662 -1883
+Dl 647 -1744
+Dl 641 -1722
+Dl 532 -1594
+Dl 324 -1498
+Dl 305 -1493
+Dl 235 -1496
+Dl 269 -1559
+Dl 399 -1666
+Dl 517 -1756
+Dl 565 -1808
+Dl 552 -1831
+Dl 457 -1806
+Dl 266 -1699
+Dl 248 -1688
+Dl 55 -1585
+Dl -114 -1516
+Dl -250 -1485
+Dl -476 -1470
+Dl -476 -1382
+Dl -391 -1393
+Dl -338 -1384
+Dl -283 -1349
+Dl -309 -1323
+Dl -400 -1304
+Dl -400 -1160
+Dl -275 -1128
+Dl -171 -1130
+Dl -63 -1156
+Dl 68 -1224
+Dl 266 -1351
+Dl 418 -1450
+Dl 539 -1507
+Dl 623 -1484
+Dl 704 -1367
+Dl 815 -1145
+Dl 903 -954
+Dl 1000 -716
+Dl 1059 -536
+Dl 1100 -405
+Dl 1224 -170
+Dl 1308 -54
+Dl 1383 67
+Dl 1438 197
+Dl 1522 510
+Dl 1576 870
+Dl 1593 1222
+Dl 1567 1512
+Dl 1544 1668
+Dl 1563 1731
+Dl 1584 1788
+Dl 1572 1958
+Dl 1560 2157
+Dl 1608 2331
+Dl 1733 2423
+Dl 1883 2459
+Dl 2126 2431
+Dl 2335 2277
+Dl 2391 2209
+Dl 2531 1991
+Dl 2657 1745
+Dl 2733 1537
+Dl 2762 1168
+Dl 2694 707
+Dl 2526 166
+Dl 2414 -95
+Dl 2261 -352
+Dl 2042 -630
+Dl 2039 -634
+Dl 1815 -939
+Dl 1598 -1302
+Dl 1431 -1655
+Dl 1399 -1737
+Dl 1356 -1884
+Dl 1337 -2043
+Dl 1332 -2275
+Dl 1326 -2501
+Dl 1263 -3000
+Dl 1132 -3390
+Dl 1008 -3600
+Dl 817 -3793
+Dl 541 -3955
+Dl 354 -4037
+Dl 194 -4077
+Dl -19 -4093
+Dl -97 -4097
+Dl -266 -4095
+Dl -392 -4069
+Dl -541 -4006
+Dl -702 -3920
+Dl -910 -3735
+Dl -1069 -3466
+Dl -1169 -3249
+Dl -1150 -1249
+Dl -1325 -996
+Dl -1358 -949
+Dl -1522 -731
+Dl -1678 -538
+Dl -1734 -472
+Dl -1828 -347
+Dl -1902 -210
+Dl -1976 -24
+Dl -2068 250
+Dl -2214 634
+Dl -2433 1050
+Dl -2487 1173
+Dl -2523 1386
+Dl -2501 1563
+Dl -2490 1592
+Dl -2485 1678
+Dl -2546 1795
+Dl -2570 1831
+Dl -2659 1933
+Dl -2776 1984
+Dl -2975 2008
+Dl -2990 2009
+Dl -3154 2033
+Dl -3249 2066
+Dl -3281 2100
+Dl -3337 2285
+Dl -3323 2581
+Dl -3306 2722
+Dl -3308 2881
+Dl -3348 3059
+Dl -3393 3229
+Dl -3424 3383
+Dl -3419 3473
+Dl -3382 3534
+Dl -3358 3556
+Dl -3265 3600
+Dl -3252 3601
+Dl -3135 3627
+Dl -2962 3678
+Dl -2944 3684
+Dl -2724 3749
+Dl -2533 3800
+Dl -2391 3837
+Dl -2145 3908
+Dl -1912 3984
+Dl -1750 4046
+Dl -1700 4068
+Dl -1600 4109
+Dl -1550 4119
+Dl -1550 3783
+Dl -1727 3764
+Dl -1907 3729
+Dl -2022 3690
+Dl -2031 3686
+Dl -2142 3655
+Dl -2332 3617
+Dl -2555 3579
+Dl -2766 3550
+Dl -2913 3526
+Dl -3105 3479
+Dl -3206 3434
+Dl -3287 3323
+Dl -3247 3161
+Dl -3225 3111
+Dl -3209 3031
+Dl -3208 2908
+Dl -3222 2711
+Dl -3252 2413
+Dl -3262 2297
+Dl -3249 2202
+Dl -3195 2135
+Dl -3168 2112
+Dl -3081 2074
+Dl -2933 2076
+Dl -2752 2073
+Dl -2597 1997
+Dl -2485 1818
+Dl -2462 1769
+Dl -2348 1613
+Dl -2206 1566
+Dl -2169 1579
+Dl -2053 1669
+Dl -1908 1817
+Dl -1763 1989
+Dl -1651 2152
+Dl -1584 2266
+Dl -1463 2467
+Dl -1327 2690
+Dl -1219 2874
+Dl -1100 3138
+Dl -1071 3345
+Dl -1130 3521
+Dl -1276 3693
+Dl -1322 3727
+Dl -1470 3782
+Dl -1550 3783
+Dl -1550 4119
+Dl -1512 4126
+Dl -1332 4126
+Dl -1180 4098
+Dl -1108 4061
+Dl -976 3965
+Dl -901 3905
+Dl -829 3866
+Dl -823 3866
+Dl -748 3819
+Dl -729 3806
+Dl -585 3769
+Dl -337 3745
+Dl -7 3736
+Dl 382 3744
+Dl 646 3756
+Dl 865 3773
+Dl 997 3797
+Dl 1066 3832
+Dl 1100 3883
+Dl 1140 3955
+Dl 1313 4075
+Dl 1586 4128
+DP 0 0 0 0 5 1 21
+Dl 3050 2566
+Dl 3066 2550
+Dl 3050 2533
+Dl 3033 2550
+Dl 3050 2566
+DP 0 0 0 0 7 1 21
+Dl 2811 2149
+Dl 2823 2141
+Dl 2826 2124
+Dl 2822 2007
+Dl 2813 2000
+Dl 2808 2083
+Dl 2811 2149
+DP 0 0 0 0 14 1 21
+Dl 347 -2071
+Dl 464 -2154
+Dl 497 -2207
+Dl 530 -2389
+Dl 451 -2551
+Dl 403 -2590
+Dl 303 -2633
+Dl 232 -2607
+Dl 139 -2493
+Dl 100 -2337
+Dl 100 -2318
+Dl 125 -2186
+Dl 216 -2106
+Dl 347 -2071
+DP 0 0 0 0 7 1 21
+Dl -81 -2117
+Dl -33 -2168
+Dl -35 -2175
+Dl -100 -2199
+Dl -164 -2171
+Dl -125 -2123
+Dl -81 -2117
+$EndMODULE LOGO
+$EndLIBRARY
diff --git a/demos/pspice/pspice.cache.lib b/demos/pspice/pspice-cache.lib
similarity index 66%
rename from demos/pspice/pspice.cache.lib
rename to demos/pspice/pspice-cache.lib
index d8507ab27d..2f6be086e5 100644
--- a/demos/pspice/pspice.cache.lib
+++ b/demos/pspice/pspice-cache.lib
@@ -1,101 +1,100 @@
-EESchema-LIBRARY Version 18/6/2008-08:34:30
-#
-#
-# +12V
-#
-DEF +12V #PWR 0 0 N Y 1 F N
-F0 "#PWR" 0 200 40 H I C C
-F1 "+12V" 0 150 40 H V C C
-DRAW
-P 2 0 1 0 0 60 0 0 N
-C 0 80 20 0 1 0 N
-X +12V 1 0 0 0 R 40 40 0 0 W N
-ENDDRAW
-ENDDEF
-#
-# 0
-#
-DEF 0 #GND 0 0 Y Y 1 F N
-F0 "#GND" 0 -100 40 H I C C
-F1 "0" 0 -70 40 H V C C
-DRAW
-P 4 0 1 0 -50 0 0 -50 50 0 -50 0 N
-X 0 1 0 0 0 R 40 40 1 1 W N
-ENDDRAW
-ENDDEF
-#
-# CAP
-#
-DEF CAP C 0 10 Y Y 1 F N
-F0 "C" 100 150 50 V V C C
-F1 "CAP" 100 -150 50 V V C C
-ALIAS C
-DRAW
-P 2 0 1 0 -150 -50 150 -50 N
-P 2 0 1 0 -150 50 150 50 N
-X ~ 1 0 250 200 D 40 40 1 1 P
-X ~ 2 0 -250 200 U 40 40 1 1 P
-ENDDRAW
-ENDDEF
-#
-# INDUCTOR
-#
-DEF INDUCTOR L 0 0 N Y 0 F N
-F0 "L" 0 100 70 H V C C
-F1 "INDUCTOR" 0 -100 70 H V C C
-DRAW
-A -300 0 100 0 1800 0 0 0 N -200 0 -400 0
-A -100 0 100 0 1800 0 0 0 N 0 0 -200 0
-A 100 0 100 0 1800 0 0 0 N 200 0 0 0
-A 300 0 100 0 1800 0 0 0 N 400 0 200 0
-X 2 2 700 0 300 L 70 70 1 1 I
-X 1 1 -700 0 300 R 70 70 1 1 I
-ENDDRAW
-ENDDEF
-#
-# QNPN
-#
-DEF QNPN Q 0 0 Y Y 0 F N
-F0 "Q" -100 300 50 H V C C
-F1 "QNPN" -100 200 50 H V C C
-DRAW
-P 4 0 0 0 150 -150 150 -50 50 -150 150 -150 F
-P 4 0 1 0 -100 -150 0 -150 0 -150 0 -150 N
-P 2 0 0 0 0 0 150 -150 N
-P 2 0 1 0 0 0 150 150 N
-P 2 0 1 0 0 -150 0 150 N
-X C 1 150 350 200 D 40 40 1 1 P
-X B 2 -300 0 300 R 40 40 1 1 I
-X Substrat 4 -100 -350 200 U 50 20 1 1 I
-X E 3 150 -350 200 U 40 40 1 1 P
-ENDDRAW
-ENDDEF
-#
-# R
-#
-DEF R R 0 0 N Y 0 F N
-F0 "R" 80 0 50 V V C C
-F1 "R" 0 0 50 V V C C
-DRAW
-S -40 150 40 -150 0 1 0 N
-X ~ 1 0 250 100 D 60 60 1 1 P
-X ~ 2 0 -250 100 U 60 60 1 1 P
-ENDDRAW
-ENDDEF
-#
-# VSOURCE
-#
-DEF VSOURCE V 0 40 Y Y 1 F N
-F0 "V" 0 -100 60 H V C C
-F1 "VSOURCE" 0 100 60 H V C C
-DRAW
-P 3 0 1 0 -300 150 -250 250 -200 150 F
-P 2 0 1 0 -250 -250 -250 150 F
-C 0 0 400 0 1 0 N
-T 0 -320 -10 100 0 0 1 V
-X E1 1 0 700 300 D 60 60 1 1 I
-X E2 2 0 -700 300 U 60 60 1 1 I
-ENDDRAW
-ENDDEF
-#
-#EndLibrary
+EESchema-LIBRARY Version 2.3 Date: 14/07/2010 15:02:10
+#
+# +12V
+#
+DEF +12V #PWR 0 0 N Y 1 F N
+F0 "#PWR" 0 200 40 H I C CNN
+F1 "+12V" 0 150 40 H V C CNN
+DRAW
+X +12V 1 0 0 0 R 40 40 0 0 W N
+C 0 80 20 0 1 0 N
+P 2 0 1 0 0 60 0 0 N
+ENDDRAW
+ENDDEF
+#
+# 0
+#
+DEF 0 #GND 0 0 Y Y 1 F N
+F0 "#GND" 0 -100 40 H I C CNN
+F1 "0" 0 -70 40 H V C CNN
+DRAW
+P 4 0 1 0 -50 0 0 -50 50 0 -50 0 N
+X 0 1 0 0 0 R 40 40 1 1 W N
+ENDDRAW
+ENDDEF
+#
+# CAP
+#
+DEF CAP C 0 10 Y Y 1 F N
+F0 "C" 100 150 50 V V C CNN
+F1 "CAP" 100 -150 50 V V C CNN
+ALIAS C
+DRAW
+P 2 0 1 0 -150 -50 150 -50 N
+P 2 0 1 0 -150 50 150 50 N
+X ~ 1 0 250 200 D 40 40 1 1 P
+X ~ 2 0 -250 200 U 40 40 1 1 P
+ENDDRAW
+ENDDEF
+#
+# INDUCTOR
+#
+DEF INDUCTOR L 0 0 N Y 1 F N
+F0 "L" 0 100 70 H V C CNN
+F1 "INDUCTOR" 0 -100 70 H V C CNN
+DRAW
+A -300 0 100 0 1800 0 0 0 N -200 0 -400 0
+A -100 0 100 0 1800 0 0 0 N 0 0 -200 0
+A 100 0 100 0 1800 0 0 0 N 200 0 0 0
+A 300 0 100 0 1800 0 0 0 N 400 0 200 0
+X 1 1 -700 0 300 R 70 70 1 1 I
+X 2 2 700 0 300 L 70 70 1 1 I
+ENDDRAW
+ENDDEF
+#
+# QNPN
+#
+DEF QNPN Q 0 0 Y Y 1 F N
+F0 "Q" -100 300 50 H V C CNN
+F1 "QNPN" -100 200 50 H V C CNN
+DRAW
+P 2 0 0 0 0 0 150 -150 N
+P 4 0 0 0 150 -150 150 -50 50 -150 150 -150 F
+P 2 0 1 0 0 -150 0 150 N
+P 2 0 1 0 0 0 150 150 N
+P 4 0 1 0 -100 -150 0 -150 0 -150 0 -150 N
+X C 1 150 350 200 D 40 40 1 1 P
+X B 2 -300 0 300 R 40 40 1 1 I
+X E 3 150 -350 200 U 40 40 1 1 P
+X Substrat 4 -100 -350 200 U 50 20 1 1 I
+ENDDRAW
+ENDDEF
+#
+# R
+#
+DEF R R 0 0 N Y 1 F N
+F0 "R" 80 0 50 V V C CNN
+F1 "R" 0 0 50 V V C CNN
+DRAW
+S -40 150 40 -150 0 1 0 N
+X ~ 1 0 250 100 D 60 60 1 1 P
+X ~ 2 0 -250 100 U 60 60 1 1 P
+ENDDRAW
+ENDDEF
+#
+# VSOURCE
+#
+DEF VSOURCE V 0 40 Y Y 1 F N
+F0 "V" 0 -100 60 H V C CNN
+F1 "VSOURCE" 0 100 60 H V C CNN
+DRAW
+C 0 0 400 0 1 0 N
+T 0 -320 -10 100 0 0 1 V Normal 1 C C
+P 2 0 1 0 -250 -250 -250 150 F
+P 3 0 1 0 -300 150 -250 250 -200 150 F
+X E1 1 0 700 300 D 60 60 1 1 I
+X E2 2 0 -700 300 U 60 60 1 1 I
+ENDDRAW
+ENDDEF
+#
+#End Library
diff --git a/demos/pspice/pspice.cir b/demos/pspice/pspice.cir
index 8c3e6e51ef..014ce28ac7 100644
--- a/demos/pspice/pspice.cir
+++ b/demos/pspice/pspice.cir
@@ -1,31 +1,30 @@
-* EESchema Netlist Version 1.1 (Spice format) creation date: 18/6/2008-08:38:03
-
-.model Q2N2222 npn (bf=200)
-.AC 10 1Meg *1.2
-.DC V1 10 12 0.5
-
-R12 /VOUT N-000003 22K
-R11 +12V N-000003 100
-L1 N-000003 /VOUT 100mH
-R10 N-000005 N-000004 220
-C3 N-000005 0 10uF
-C2 N-000009 0 1nF
-R8 N-000004 0 2.2K
-Q3 /VOUT N-000009 N-000004 N-000004 Q2N2222
-V2 N-000008 0 AC 0.1
-C1 /VIN N-000008 1UF
-V1 +12V 0 DC 12V
-R2 /VIN 0 10K
-R6 +12V /VIN 22K
-R5 +12V N-000012 22K
-R1 N-000012 0 10K
-R7 N-000007 0 470
-R4 +12V N-000009 1K
-R3 +12V N-000010 1K
-Q2 N-000009 N-000012 N-000007 N-000007 Q2N2222
-Q1 N-000010 /VIN N-000007 N-000007 Q2N2222
-
-.print ac v(vout)
-.plot ac v(nodes) (-1,5)
-
-.end
+* EESchema Netlist Version 1.1 (Spice format) creation date: 14/07/2010 20:09:58
+
+
+R12 /VOUT N-000010 22K
+R11 +12V N-000010 100
+L1 N-000010 /VOUT 100mH
+R10 N-000009 N-000004 220
+C3 N-000009 0 10uF
+C2 N-000008 0 1nF
+R8 N-000004 0 2.2K
+Q3 /VOUT N-000008 N-000004 N-000004 Q2N2222
+V2 N-000003 0 AC 0.1
+C1 /VIN N-000003 1UF
+V1 +12V 0 DC 12V
+R2 /VIN 0 10K
+R6 +12V /VIN 22K
+R5 +12V N-000006 22K
+R1 N-000006 0 10K
+R7 N-000005 0 470
+R4 +12V N-000008 1K
+R3 +12V N-000007 1K
+Q2 N-000008 N-000006 N-000005 N-000005 Q2N2222
+Q1 N-000007 /VIN N-000005 N-000005 Q2N2222
+
+.model Q2N2222 npn (bf=200)
+.print tran v(nodes)
+.print dc v(nodes)
+.tran 10 10000 10 > pspice.dat
+
+.end
diff --git a/demos/pspice/pspice.sch b/demos/pspice/pspice.sch
index 5abb6691dd..ec93275e7d 100644
--- a/demos/pspice/pspice.sch
+++ b/demos/pspice/pspice.sch
@@ -1,391 +1,392 @@
-EESchema Schematic File Version 2
-LIBS:pspice,.\pspice.cache
-EELAYER 20 0
-EELAYER END
-$Descr A4 11700 8267
-Sheet 1 1
-Title ""
-Date "22 feb 2008"
-Rev ""
-Comp ""
-Comment1 ""
-Comment2 ""
-Comment3 ""
-Comment4 ""
-$EndDescr
-Kmarq B 8400 3300 "Warning Pin power_in non pilotée (Net 6)" F=1
-Kmarq B 7700 1000 "Warning Pin power_in non pilotée (Net 2)" F=1
-Wire Wire Line
- 5300 2800 4400 2800
-Text Label 4500 2800 0 60 ~
-VIN
-Text Label 8350 2100 0 60 ~
-VOUT
-Connection ~ 9200 1800
-Wire Wire Line
- 8700 1800 9200 1800
-Wire Wire Line
- 8200 1800 7800 1800
-Wire Wire Line
- 7800 1800 7800 1500
-$Comp
-L R R12
-U 1 1 3E9D53DA
-P 8450 1800
-F 0 "R12" V 8530 1800 50 0000 C C
-F 1 "22K" V 8450 1800 50 0000 C C
- 1 8450 1800
- 0 1 1 0
-$EndComp
-$Comp
-L R R11
-U 1 1 3E9D4D47
-P 7700 1250
-F 0 "R11" V 7780 1250 50 0000 C C
-F 1 "100" V 7700 1250 50 0000 C C
- 1 7700 1250
- 1 0 0 -1
-$EndComp
-Wire Wire Line
- 7800 1500 7700 1500
-Wire Wire Line
- 7700 2100 9200 2100
-Wire Wire Line
- 9200 2100 9200 1500
-$Comp
-L INDUCTOR L1
-U 1 1 3E9D4A5D
-P 8500 1500
-F 0 "L1" H 8500 1600 70 0000 C C
-F 1 "100mH" H 8500 1400 70 0000 C C
- 1 8500 1500
- 1 0 0 1
-$EndComp
-Text Notes 3500 1200 0 60 ~
-+gnucap .plot ac v(nodes) (-1,5)
-Connection ~ 7700 2800
-Wire Wire Line
- 8250 2800 8400 2800
-Wire Wire Line
- 7750 2800 7450 2800
-$Comp
-L R R10
-U 1 1 3E9D3DED
-P 8000 2800
-F 0 "R10" V 8080 2800 50 0000 C C
-F 1 "220" V 8000 2800 50 0000 C C
- 1 8000 2800
- 0 1 1 0
-$EndComp
-$Comp
-L 0 #GND8
-U 1 1 3E9D3DE2
-P 8400 3300
-F 0 "#GND8" H 8400 3200 40 0001 C C
-F 1 "0" H 8400 3230 40 0000 C C
- 1 8400 3300
- 1 0 0 -1
-$EndComp
-$Comp
-L CAP C3
-U 1 1 3E9D3DD3
-P 8400 3050
-F 0 "C3" V 8500 3200 50 0000 C C
-F 1 "10uF" V 8500 2900 50 0000 C C
- 1 8400 3050
- 1 0 0 -1
-$EndComp
-Text Notes 3500 1000 0 60 ~
--PSPICE .DC V1 10 12 0.5
-Connection ~ 7050 2450
-Wire Wire Line
- 7050 2600 7050 2450
-$Comp
-L 0 #GND7
-U 1 1 3E9D1EFF
-P 7050 3100
-F 0 "#GND7" H 7050 3000 40 0001 C C
-F 1 "0" H 7050 3030 40 0000 C C
- 1 7050 3100
- 1 0 0 -1
-$EndComp
-$Comp
-L C C2
-U 1 1 3E9D1EF8
-P 7050 2850
-F 0 "C2" V 7150 3000 50 0000 C C
-F 1 "1nF" V 7150 2700 50 0000 C C
- 1 7050 2850
- 1 0 0 -1
-$EndComp
-Connection ~ 5750 3200
-Connection ~ 6100 3200
-Wire Wire Line
- 6350 3150 6350 3200
-Wire Wire Line
- 6350 3200 5500 3200
-Wire Wire Line
- 5750 3200 5750 3150
-Wire Wire Line
- 5500 3200 5500 3150
-Wire Wire Line
- 3900 2800 3850 2800
-Wire Wire Line
- 7700 2950 7700 2800
-$Comp
-L 0 #GND6
-U 1 1 32E8B852
-P 7700 3450
-F 0 "#GND6" H 7700 3350 40 0001 C C
-F 1 "0" H 7700 3380 40 0000 C C
- 1 7700 3450
- 1 0 0 -1
-$EndComp
-$Comp
-L +12V #+12V6
-U 1 1 32E8B84A
-P 7700 1000
-F 0 "#+12V6" H 7700 1200 40 0001 C C
-F 1 "+12V" H 7700 1150 40 0000 C C
- 1 7700 1000
- 1 0 0 -1
-$EndComp
-$Comp
-L R R8
-U 1 1 32E8B80E
-P 7700 3200
-F 0 "R8" V 7780 3200 50 0000 C C
-F 1 "2.2K" V 7700 3200 50 0000 C C
- 1 7700 3200
- 1 0 0 -1
-$EndComp
-$Comp
-L QNPN Q3
-U 1 1 32E8B7FC
-P 7550 2450
-F 0 "Q3" H 7450 2750 50 0000 C C
-F 1 "Q2N2222" H 7450 2650 50 0000 C C
- 1 7550 2450
- 1 0 0 -1
-$EndComp
-Wire Wire Line
- 7250 2450 6100 2450
-Text Notes 3500 800 0 60 ~
--PSPICE .model Q2N2222 npn (bf=200)
-$Comp
-L 0 #GND5
-U 1 1 32CFC469
-P 3850 4200
-F 0 "#GND5" H 3850 4100 40 0001 C C
-F 1 "0" H 3850 4130 40 0000 C C
- 1 3850 4200
- 1 0 0 -1
-$EndComp
-$Comp
-L VSOURCE V2
-U 1 1 32CFC454
-P 3850 3500
-F 0 "V2" H 3850 3400 60 0000 C C
-F 1 "AC 0.1" H 3850 3600 60 0000 C C
- 1 3850 3500
- 1 0 0 -1
-$EndComp
-$Comp
-L C C1
-U 1 1 32CFC413
-P 4150 2800
-F 0 "C1" V 4250 2950 50 0000 C C
-F 1 "1UF" V 4250 2650 50 0000 C C
- 1 4150 2800
- 0 1 1 0
-$EndComp
-Text Notes 3500 900 0 60 ~
--gnucap .AC 10 1Meg *1.2
-Text Notes 3500 1100 0 60 ~
-+PSPICE .print ac v(vout)
-$Comp
-L +12V #+12V5
-U 1 1 32CFC34D
-P 2850 1500
-F 0 "#+12V5" H 2850 1700 40 0001 C C
-F 1 "+12V" H 2850 1650 40 0000 C C
- 1 2850 1500
- 1 0 0 -1
-$EndComp
-$Comp
-L 0 #GND4
-U 1 1 32CFC344
-P 2850 2900
-F 0 "#GND4" H 2850 2800 40 0001 C C
-F 1 "0" H 2850 2830 40 0000 C C
- 1 2850 2900
- 1 0 0 -1
-$EndComp
-$Comp
-L VSOURCE V1
-U 1 1 32CFC337
-P 2850 2200
-F 0 "V1" H 2850 2100 60 0000 C C
-F 1 "DC 12V" H 2850 2300 60 0000 C C
- 1 2850 2200
- 1 0 0 -1
-$EndComp
-Wire Wire Line
- 6100 2450 6100 2300
-Wire Wire Line
- 5750 2450 5750 2300
-$Comp
-L +12V #+12V4
-U 1 1 32CFC303
-P 6700 1800
-F 0 "#+12V4" H 6700 2000 40 0001 C C
-F 1 "+12V" H 6700 1950 40 0000 C C
- 1 6700 1800
- 1 0 0 -1
-$EndComp
-$Comp
-L +12V #+12V3
-U 1 1 32CFC2FF
-P 6100 1800
-F 0 "#+12V3" H 6100 2000 40 0001 C C
-F 1 "+12V" H 6100 1950 40 0000 C C
- 1 6100 1800
- 1 0 0 -1
-$EndComp
-$Comp
-L +12V #+12V2
-U 1 1 32CFC2FD
-P 5750 1800
-F 0 "#+12V2" H 5750 2000 40 0001 C C
-F 1 "+12V" H 5750 1950 40 0000 C C
- 1 5750 1800
- 1 0 0 -1
-$EndComp
-$Comp
-L +12V #+12V1
-U 1 1 32CFC2F7
-P 5100 1800
-F 0 "#+12V1" H 5100 2000 40 0001 C C
-F 1 "+12V" H 5100 1950 40 0000 C C
- 1 5100 1800
- 1 0 0 -1
-$EndComp
-Connection ~ 5100 2800
-Connection ~ 6700 2800
-Wire Wire Line
- 6550 2800 6700 2800
-Wire Wire Line
- 6700 2300 6700 3300
-Wire Wire Line
- 6100 3300 6100 3150
-Wire Wire Line
- 5100 2300 5100 3300
-$Comp
-L 0 #GND3
-U 1 1 32CFC2B8
-P 6700 3800
-F 0 "#GND3" H 6700 3700 40 0001 C C
-F 1 "0" H 6700 3730 40 0000 C C
- 1 6700 3800
- 1 0 0 -1
-$EndComp
-$Comp
-L 0 #GND2
-U 1 1 32CFC2B5
-P 5100 3800
-F 0 "#GND2" H 5100 3700 40 0001 C C
-F 1 "0" H 5100 3730 40 0000 C C
- 1 5100 3800
- 1 0 0 -1
-$EndComp
-$Comp
-L R R2
-U 1 1 32CFC293
-P 5100 3550
-F 0 "R2" V 5180 3550 50 0000 C C
-F 1 "10K" V 5100 3550 50 0000 C C
- 1 5100 3550
- 1 0 0 -1
-$EndComp
-$Comp
-L R R6
-U 1 1 32CFC288
-P 5100 2050
-F 0 "R6" V 5180 2050 50 0000 C C
-F 1 "22K" V 5100 2050 50 0000 C C
- 1 5100 2050
- 1 0 0 -1
-$EndComp
-$Comp
-L R R5
-U 1 1 32CFC27F
-P 6700 2050
-F 0 "R5" V 6780 2050 50 0000 C C
-F 1 "22K" V 6700 2050 50 0000 C C
- 1 6700 2050
- 1 0 0 -1
-$EndComp
-$Comp
-L R R1
-U 1 1 32CFC277
-P 6700 3550
-F 0 "R1" V 6780 3550 50 0000 C C
-F 1 "10K" V 6700 3550 50 0000 C C
- 1 6700 3550
- 1 0 0 -1
-$EndComp
-$Comp
-L 0 #GND1
-U 1 1 32CFC26C
-P 6100 3800
-F 0 "#GND1" H 6100 3700 40 0001 C C
-F 1 "0" H 6100 3730 40 0000 C C
- 1 6100 3800
- 1 0 0 -1
-$EndComp
-$Comp
-L R R7
-U 1 1 32CFC25A
-P 6100 3550
-F 0 "R7" V 6180 3550 50 0000 C C
-F 1 "470" V 6100 3550 50 0000 C C
- 1 6100 3550
- 1 0 0 -1
-$EndComp
-$Comp
-L R R4
-U 1 1 32CFC254
-P 6100 2050
-F 0 "R4" V 6180 2050 50 0000 C C
-F 1 "1K" V 6100 2050 50 0000 C C
- 1 6100 2050
- 1 0 0 -1
-$EndComp
-$Comp
-L R R3
-U 1 1 32CFC24C
-P 5750 2050
-F 0 "R3" V 5830 2050 50 0000 C C
-F 1 "1K" V 5750 2050 50 0000 C C
- 1 5750 2050
- 1 0 0 -1
-$EndComp
-$Comp
-L QNPN Q2
-U 1 1 32CFC230
-P 6250 2800
-F 0 "Q2" H 6150 3100 50 0000 C C
-F 1 "Q2N2222" H 6150 3000 50 0000 C C
- 1 6250 2800
- -1 0 0 -1
-$EndComp
-$Comp
-L QNPN Q1
-U 1 1 32CFC227
-P 5600 2800
-F 0 "Q1" H 5500 3100 50 0000 C C
-F 1 "Q2N2222" H 5500 3000 50 0000 C C
- 1 5600 2800
- 1 0 0 -1
-$EndComp
-$EndSCHEMATC
+EESchema Schematic File Version 2 date 14/07/2010 20:10:02
+LIBS:pspice
+LIBS:pspice-cache
+EELAYER 24 0
+EELAYER END
+$Descr A4 11700 8267
+Sheet 1 1
+Title ""
+Date "14 jul 2010"
+Rev ""
+Comp ""
+Comment1 ""
+Comment2 ""
+Comment3 ""
+Comment4 ""
+$EndDescr
+Text Label 4550 2800 0 60 ~ 0
+VIN
+Text Label 8650 2100 0 60 ~ 0
+VOUT
+Wire Notes Line
+ 4050 6600 4050 5700
+Wire Notes Line
+ 4050 6600 6850 6600
+Wire Notes Line
+ 6850 6600 6850 5700
+Wire Notes Line
+ 6850 5700 4050 5700
+Wire Wire Line
+ 5300 2800 4400 2800
+Connection ~ 9200 1800
+Wire Wire Line
+ 8700 1800 9200 1800
+Wire Wire Line
+ 8200 1800 7800 1800
+Wire Wire Line
+ 7800 1800 7800 1500
+Wire Wire Line
+ 7800 1500 7700 1500
+Wire Wire Line
+ 9200 1500 9200 2100
+Connection ~ 7700 2800
+Wire Wire Line
+ 8250 2800 8400 2800
+Wire Wire Line
+ 7750 2800 7450 2800
+Connection ~ 7050 2450
+Wire Wire Line
+ 7050 2600 7050 2450
+Connection ~ 5750 3200
+Connection ~ 6100 3200
+Wire Wire Line
+ 6350 3150 6350 3200
+Wire Wire Line
+ 6350 3200 5500 3200
+Wire Wire Line
+ 5750 3150 5750 3200
+Wire Wire Line
+ 5500 3200 5500 3150
+Wire Wire Line
+ 3900 2800 3850 2800
+Wire Wire Line
+ 7700 2950 7700 2800
+Wire Wire Line
+ 7250 2450 6100 2450
+Wire Wire Line
+ 6100 2450 6100 2300
+Wire Wire Line
+ 5750 2450 5750 2300
+Connection ~ 5100 2800
+Connection ~ 6700 2800
+Wire Wire Line
+ 6550 2800 6700 2800
+Wire Wire Line
+ 6700 2300 6700 3300
+Wire Wire Line
+ 6100 3300 6100 3150
+Wire Wire Line
+ 5100 2300 5100 3300
+Wire Wire Line
+ 9200 2100 7700 2100
+Text Notes 4200 5900 0 60 ~ 0
++gnucap .model Q2N2222 npn (bf=200)\n.print tran v(nodes)\n.print dc v(nodes)\n.tran 10 10000 10 > pspice.dat\n
+Text Notes 4050 5700 0 60 ~ 0
+Pspice directives using one multiline text:
+$Comp
+L R R12
+U 1 1 3E9D53DA
+P 8450 1800
+F 0 "R12" V 8530 1800 50 0000 C CNN
+F 1 "22K" V 8450 1800 50 0000 C CNN
+ 1 8450 1800
+ 0 1 1 0
+$EndComp
+$Comp
+L R R11
+U 1 1 3E9D4D47
+P 7700 1250
+F 0 "R11" V 7780 1250 50 0000 C CNN
+F 1 "100" V 7700 1250 50 0000 C CNN
+ 1 7700 1250
+ 1 0 0 -1
+$EndComp
+$Comp
+L INDUCTOR L1
+U 1 1 3E9D4A5D
+P 8500 1500
+F 0 "L1" H 8500 1600 70 0000 C CNN
+F 1 "100mH" H 8500 1350 70 0000 C CNN
+ 1 8500 1500
+ 1 0 0 1
+$EndComp
+$Comp
+L R R10
+U 1 1 3E9D3DED
+P 8000 2800
+F 0 "R10" V 8080 2800 50 0000 C CNN
+F 1 "220" V 8000 2800 50 0000 C CNN
+ 1 8000 2800
+ 0 1 1 0
+$EndComp
+$Comp
+L 0 #GND8
+U 1 1 3E9D3DE2
+P 8400 3300
+F 0 "#GND8" H 8400 3200 40 0001 C CNN
+F 1 "0" H 8400 3230 40 0000 C CNN
+ 1 8400 3300
+ 1 0 0 -1
+$EndComp
+$Comp
+L CAP C3
+U 1 1 3E9D3DD3
+P 8400 3050
+F 0 "C3" V 8500 3200 50 0000 C CNN
+F 1 "10uF" V 8500 2900 50 0000 C CNN
+ 1 8400 3050
+ 1 0 0 -1
+$EndComp
+$Comp
+L 0 #GND7
+U 1 1 3E9D1EFF
+P 7050 3100
+F 0 "#GND7" H 7050 3000 40 0001 C CNN
+F 1 "0" H 7050 3030 40 0000 C CNN
+ 1 7050 3100
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C2
+U 1 1 3E9D1EF8
+P 7050 2850
+F 0 "C2" V 7150 3000 50 0000 C CNN
+F 1 "1nF" V 7150 2700 50 0000 C CNN
+ 1 7050 2850
+ 1 0 0 -1
+$EndComp
+$Comp
+L 0 #GND6
+U 1 1 32E8B852
+P 7700 3450
+F 0 "#GND6" H 7700 3350 40 0001 C CNN
+F 1 "0" H 7700 3380 40 0000 C CNN
+ 1 7700 3450
+ 1 0 0 -1
+$EndComp
+$Comp
+L +12V #+12V6
+U 1 1 32E8B84A
+P 7700 1000
+F 0 "#+12V6" H 7700 1200 40 0001 C CNN
+F 1 "+12V" H 7700 1150 40 0000 C CNN
+ 1 7700 1000
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R8
+U 1 1 32E8B80E
+P 7700 3200
+F 0 "R8" V 7780 3200 50 0000 C CNN
+F 1 "2.2K" V 7700 3200 50 0000 C CNN
+ 1 7700 3200
+ 1 0 0 -1
+$EndComp
+$Comp
+L QNPN Q3
+U 1 1 32E8B7FC
+P 7550 2450
+F 0 "Q3" H 7450 2750 50 0000 C CNN
+F 1 "Q2N2222" H 7450 2650 50 0000 C CNN
+ 1 7550 2450
+ 1 0 0 -1
+$EndComp
+$Comp
+L 0 #GND5
+U 1 1 32CFC469
+P 3850 4200
+F 0 "#GND5" H 3850 4100 40 0001 C CNN
+F 1 "0" H 3850 4130 40 0000 C CNN
+ 1 3850 4200
+ 1 0 0 -1
+$EndComp
+$Comp
+L VSOURCE V2
+U 1 1 32CFC454
+P 3850 3500
+F 0 "V2" H 3850 3400 60 0000 C CNN
+F 1 "AC 0.1" H 3850 3600 60 0000 C CNN
+ 1 3850 3500
+ 1 0 0 -1
+$EndComp
+$Comp
+L C C1
+U 1 1 32CFC413
+P 4150 2800
+F 0 "C1" V 4250 2950 50 0000 C CNN
+F 1 "1UF" V 4250 2650 50 0000 C CNN
+ 1 4150 2800
+ 0 1 1 0
+$EndComp
+$Comp
+L +12V #+12V5
+U 1 1 32CFC34D
+P 2850 1500
+F 0 "#+12V5" H 2850 1700 40 0001 C CNN
+F 1 "+12V" H 2850 1650 40 0000 C CNN
+ 1 2850 1500
+ 1 0 0 -1
+$EndComp
+$Comp
+L 0 #GND4
+U 1 1 32CFC344
+P 2850 2900
+F 0 "#GND4" H 2850 2800 40 0001 C CNN
+F 1 "0" H 2850 2830 40 0000 C CNN
+ 1 2850 2900
+ 1 0 0 -1
+$EndComp
+$Comp
+L VSOURCE V1
+U 1 1 32CFC337
+P 2850 2200
+F 0 "V1" H 2850 2100 60 0000 C CNN
+F 1 "DC 12V" H 2850 2300 60 0000 C CNN
+ 1 2850 2200
+ 1 0 0 -1
+$EndComp
+$Comp
+L +12V #+12V4
+U 1 1 32CFC303
+P 6700 1800
+F 0 "#+12V4" H 6700 2000 40 0001 C CNN
+F 1 "+12V" H 6700 1950 40 0000 C CNN
+ 1 6700 1800
+ 1 0 0 -1
+$EndComp
+$Comp
+L +12V #+12V3
+U 1 1 32CFC2FF
+P 6100 1800
+F 0 "#+12V3" H 6100 2000 40 0001 C CNN
+F 1 "+12V" H 6100 1950 40 0000 C CNN
+ 1 6100 1800
+ 1 0 0 -1
+$EndComp
+$Comp
+L +12V #+12V2
+U 1 1 32CFC2FD
+P 5750 1800
+F 0 "#+12V2" H 5750 2000 40 0001 C CNN
+F 1 "+12V" H 5750 1950 40 0000 C CNN
+ 1 5750 1800
+ 1 0 0 -1
+$EndComp
+$Comp
+L +12V #+12V1
+U 1 1 32CFC2F7
+P 5100 1800
+F 0 "#+12V1" H 5100 2000 40 0001 C CNN
+F 1 "+12V" H 5100 1950 40 0000 C CNN
+ 1 5100 1800
+ 1 0 0 -1
+$EndComp
+$Comp
+L 0 #GND3
+U 1 1 32CFC2B8
+P 6700 3800
+F 0 "#GND3" H 6700 3700 40 0001 C CNN
+F 1 "0" H 6700 3730 40 0000 C CNN
+ 1 6700 3800
+ 1 0 0 -1
+$EndComp
+$Comp
+L 0 #GND2
+U 1 1 32CFC2B5
+P 5100 3800
+F 0 "#GND2" H 5100 3700 40 0001 C CNN
+F 1 "0" H 5100 3730 40 0000 C CNN
+ 1 5100 3800
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R2
+U 1 1 32CFC293
+P 5100 3550
+F 0 "R2" V 5180 3550 50 0000 C CNN
+F 1 "10K" V 5100 3550 50 0000 C CNN
+ 1 5100 3550
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R6
+U 1 1 32CFC288
+P 5100 2050
+F 0 "R6" V 5180 2050 50 0000 C CNN
+F 1 "22K" V 5100 2050 50 0000 C CNN
+ 1 5100 2050
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R5
+U 1 1 32CFC27F
+P 6700 2050
+F 0 "R5" V 6780 2050 50 0000 C CNN
+F 1 "22K" V 6700 2050 50 0000 C CNN
+ 1 6700 2050
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R1
+U 1 1 32CFC277
+P 6700 3550
+F 0 "R1" V 6780 3550 50 0000 C CNN
+F 1 "10K" V 6700 3550 50 0000 C CNN
+ 1 6700 3550
+ 1 0 0 -1
+$EndComp
+$Comp
+L 0 #GND1
+U 1 1 32CFC26C
+P 6100 3800
+F 0 "#GND1" H 6100 3700 40 0001 C CNN
+F 1 "0" H 6100 3730 40 0000 C CNN
+ 1 6100 3800
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R7
+U 1 1 32CFC25A
+P 6100 3550
+F 0 "R7" V 6180 3550 50 0000 C CNN
+F 1 "470" V 6100 3550 50 0000 C CNN
+ 1 6100 3550
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R4
+U 1 1 32CFC254
+P 6100 2050
+F 0 "R4" V 6180 2050 50 0000 C CNN
+F 1 "1K" V 6100 2050 50 0000 C CNN
+ 1 6100 2050
+ 1 0 0 -1
+$EndComp
+$Comp
+L R R3
+U 1 1 32CFC24C
+P 5750 2050
+F 0 "R3" V 5830 2050 50 0000 C CNN
+F 1 "1K" V 5750 2050 50 0000 C CNN
+ 1 5750 2050
+ 1 0 0 -1
+$EndComp
+$Comp
+L QNPN Q2
+U 1 1 32CFC230
+P 6250 2800
+F 0 "Q2" H 6150 3100 50 0000 C CNN
+F 1 "Q2N2222" H 6150 3000 50 0000 C CNN
+ 1 6250 2800
+ -1 0 0 -1
+$EndComp
+$Comp
+L QNPN Q1
+U 1 1 32CFC227
+P 5600 2800
+F 0 "Q1" H 5500 3100 50 0000 C CNN
+F 1 "Q2N2222" H 5500 3000 50 0000 C CNN
+ 1 5600 2800
+ 1 0 0 -1
+$EndComp
+$EndSCHEMATC
diff --git a/eeschema/dialog_edit_label_base.cpp b/eeschema/dialog_edit_label_base.cpp
index 72b08435b6..b373a075bb 100644
--- a/eeschema/dialog_edit_label_base.cpp
+++ b/eeschema/dialog_edit_label_base.cpp
@@ -1,111 +1,110 @@
-///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Apr 16 2008)
-// http://www.wxformbuilder.org/
-//
-// PLEASE DO "NOT" EDIT THIS FILE!
-///////////////////////////////////////////////////////////////////////////
-
-#include "dialog_edit_label_base.h"
-
-///////////////////////////////////////////////////////////////////////////
-
-DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
-{
- this->SetSizeHints( wxDefaultSize, wxDefaultSize );
-
- wxBoxSizer* bMainSizer;
- bMainSizer = new wxBoxSizer( wxVERTICAL );
-
- m_textControlSizer = new wxFlexGridSizer( 2, 2, 3, 3 );
- m_textControlSizer->AddGrowableCol( 1 );
- m_textControlSizer->AddGrowableRow( 0 );
- m_textControlSizer->SetFlexibleDirection( wxBOTH );
- m_textControlSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-
- m_staticText1 = new wxStaticText( this, wxID_ANY, _("&Text:"), wxDefaultPosition, wxDefaultSize, 0 );
- m_staticText1->Wrap( -1 );
- m_textControlSizer->Add( m_staticText1, 0, wxRIGHT, 3 );
-
- wxBoxSizer* bSizeText;
- bSizeText = new wxBoxSizer( wxVERTICAL );
-
- m_textLabelSingleLine = new wxTextCtrl( this, wxID_VALUESINGLE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
- m_textLabelSingleLine->SetToolTip( _("Enter the text to be used within the schematic") );
-
- bSizeText->Add( m_textLabelSingleLine, 0, wxEXPAND|wxLEFT, 3 );
-
- m_textLabelMultiLine = new wxTextCtrl( this, wxID_VALUEMULTI, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_PROCESS_ENTER );
- m_textLabelMultiLine->SetToolTip( _("Enter the text to be used within the schematic") );
- m_textLabelMultiLine->SetMinSize( wxSize( -1,60 ) );
-
- bSizeText->Add( m_textLabelMultiLine, 1, wxEXPAND|wxLEFT, 3 );
-
- m_textControlSizer->Add( bSizeText, 1, wxEXPAND, 3 );
-
- m_SizeTitle = new wxStaticText( this, wxID_ANY, _("&Size:"), wxDefaultPosition, wxDefaultSize, 0 );
- m_SizeTitle->Wrap( -1 );
- m_textControlSizer->Add( m_SizeTitle, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 3 );
-
- wxBoxSizer* bSizeCtrlSizer;
- bSizeCtrlSizer = new wxBoxSizer( wxHORIZONTAL );
-
- m_TextSize = new wxTextCtrl( this, wxID_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
- bSizeCtrlSizer->Add( m_TextSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT, 3 );
-
- m_staticSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
- m_staticSizeUnits->Wrap( -1 );
- bSizeCtrlSizer->Add( m_staticSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 3 );
-
- m_textControlSizer->Add( bSizeCtrlSizer, 1, wxEXPAND, 3 );
-
- bMainSizer->Add( m_textControlSizer, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 12 );
-
- wxBoxSizer* m_OptionsSizer;
- m_OptionsSizer = new wxBoxSizer( wxHORIZONTAL );
-
- wxString m_TextOrientChoices[] = { _("Right"), _("Up"), _("Left"), _("Down") };
- int m_TextOrientNChoices = sizeof( m_TextOrientChoices ) / sizeof( wxString );
- m_TextOrient = new wxRadioBox( this, wxID_ANY, _("O&rietation"), wxDefaultPosition, wxDefaultSize, m_TextOrientNChoices, m_TextOrientChoices, 1, wxRA_SPECIFY_COLS );
- m_TextOrient->SetSelection( 0 );
- m_OptionsSizer->Add( m_TextOrient, 1, wxRIGHT|wxTOP, 3 );
-
- wxString m_TextStyleChoices[] = { _("Normal"), _("Italic"), _("Bold"), _("Bold Italic") };
- int m_TextStyleNChoices = sizeof( m_TextStyleChoices ) / sizeof( wxString );
- m_TextStyle = new wxRadioBox( this, wxID_ANY, _("St&yle"), wxDefaultPosition, wxDefaultSize, m_TextStyleNChoices, m_TextStyleChoices, 1, wxRA_SPECIFY_COLS );
- m_TextStyle->SetSelection( 0 );
- m_OptionsSizer->Add( m_TextStyle, 1, wxLEFT|wxRIGHT|wxTOP, 3 );
-
- wxString m_TextShapeChoices[] = { _("Input"), _("Output"), _("Bidirectional"), _("Tri-State"), _("Passive") };
- int m_TextShapeNChoices = sizeof( m_TextShapeChoices ) / sizeof( wxString );
- m_TextShape = new wxRadioBox( this, wxID_ANY, _("S&hape"), wxDefaultPosition, wxDefaultSize, m_TextShapeNChoices, m_TextShapeChoices, 1, wxRA_SPECIFY_COLS );
- m_TextShape->SetSelection( 2 );
- m_OptionsSizer->Add( m_TextShape, 1, wxALL|wxLEFT|wxTOP, 3 );
-
- bMainSizer->Add( m_OptionsSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 12 );
-
- m_sdbSizer1 = new wxStdDialogButtonSizer();
- m_sdbSizer1OK = new wxButton( this, wxID_OK );
- m_sdbSizer1->AddButton( m_sdbSizer1OK );
- m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
- m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
- m_sdbSizer1->Realize();
- bMainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 12 );
-
- this->SetSizer( bMainSizer );
- this->Layout();
-
- // Connect Events
- m_textLabelSingleLine->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DialogLabelEditor_Base::OnEnterKey ), NULL, this );
- m_textLabelMultiLine->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DialogLabelEditor_Base::OnEnterKey ), NULL, this );
- m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogLabelEditor_Base::OnCancelClick ), NULL, this );
- m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogLabelEditor_Base::OnOkClick ), NULL, this );
-}
-
-DialogLabelEditor_Base::~DialogLabelEditor_Base()
-{
- // Disconnect Events
- m_textLabelSingleLine->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DialogLabelEditor_Base::OnEnterKey ), NULL, this );
- m_textLabelMultiLine->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DialogLabelEditor_Base::OnEnterKey ), NULL, this );
- m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogLabelEditor_Base::OnCancelClick ), NULL, this );
- m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogLabelEditor_Base::OnOkClick ), NULL, this );
-}
+///////////////////////////////////////////////////////////////////////////
+// C++ code generated with wxFormBuilder (version Apr 16 2008)
+// http://www.wxformbuilder.org/
+//
+// PLEASE DO "NOT" EDIT THIS FILE!
+///////////////////////////////////////////////////////////////////////////
+
+#include "dialog_edit_label_base.h"
+
+///////////////////////////////////////////////////////////////////////////
+
+DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
+{
+ this->SetSizeHints( wxDefaultSize, wxDefaultSize );
+
+ wxBoxSizer* bMainSizer;
+ bMainSizer = new wxBoxSizer( wxVERTICAL );
+
+ m_textControlSizer = new wxFlexGridSizer( 2, 2, 3, 3 );
+ m_textControlSizer->AddGrowableCol( 1 );
+ m_textControlSizer->AddGrowableRow( 0 );
+ m_textControlSizer->SetFlexibleDirection( wxBOTH );
+ m_textControlSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+
+ m_staticText1 = new wxStaticText( this, wxID_ANY, _("&Text:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText1->Wrap( -1 );
+ m_staticText1->SetToolTip( _("Enter the text to be used within the schematic") );
+
+ m_textControlSizer->Add( m_staticText1, 0, wxRIGHT, 3 );
+
+ wxBoxSizer* bSizeText;
+ bSizeText = new wxBoxSizer( wxVERTICAL );
+
+ m_textLabelSingleLine = new wxTextCtrl( this, wxID_VALUESINGLE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
+ bSizeText->Add( m_textLabelSingleLine, 0, wxEXPAND|wxLEFT, 3 );
+
+ m_textLabelMultiLine = new wxTextCtrl( this, wxID_VALUEMULTI, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_PROCESS_ENTER );
+ m_textLabelMultiLine->SetMinSize( wxSize( -1,60 ) );
+
+ bSizeText->Add( m_textLabelMultiLine, 1, wxEXPAND|wxLEFT, 3 );
+
+ m_textControlSizer->Add( bSizeText, 1, wxEXPAND, 3 );
+
+ m_SizeTitle = new wxStaticText( this, wxID_ANY, _("&Size:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_SizeTitle->Wrap( -1 );
+ m_textControlSizer->Add( m_SizeTitle, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 3 );
+
+ wxBoxSizer* bSizeCtrlSizer;
+ bSizeCtrlSizer = new wxBoxSizer( wxHORIZONTAL );
+
+ m_TextSize = new wxTextCtrl( this, wxID_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
+ bSizeCtrlSizer->Add( m_TextSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT, 3 );
+
+ m_staticSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticSizeUnits->Wrap( -1 );
+ bSizeCtrlSizer->Add( m_staticSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 3 );
+
+ m_textControlSizer->Add( bSizeCtrlSizer, 1, wxEXPAND, 3 );
+
+ bMainSizer->Add( m_textControlSizer, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 12 );
+
+ wxBoxSizer* m_OptionsSizer;
+ m_OptionsSizer = new wxBoxSizer( wxHORIZONTAL );
+
+ wxString m_TextOrientChoices[] = { _("Right"), _("Up"), _("Left"), _("Down") };
+ int m_TextOrientNChoices = sizeof( m_TextOrientChoices ) / sizeof( wxString );
+ m_TextOrient = new wxRadioBox( this, wxID_ANY, _("O&rientation"), wxDefaultPosition, wxDefaultSize, m_TextOrientNChoices, m_TextOrientChoices, 1, wxRA_SPECIFY_COLS );
+ m_TextOrient->SetSelection( 0 );
+ m_OptionsSizer->Add( m_TextOrient, 1, wxRIGHT|wxTOP, 3 );
+
+ wxString m_TextStyleChoices[] = { _("Normal"), _("Italic"), _("Bold"), _("Bold Italic") };
+ int m_TextStyleNChoices = sizeof( m_TextStyleChoices ) / sizeof( wxString );
+ m_TextStyle = new wxRadioBox( this, wxID_ANY, _("St&yle"), wxDefaultPosition, wxDefaultSize, m_TextStyleNChoices, m_TextStyleChoices, 1, wxRA_SPECIFY_COLS );
+ m_TextStyle->SetSelection( 0 );
+ m_OptionsSizer->Add( m_TextStyle, 1, wxLEFT|wxRIGHT|wxTOP, 3 );
+
+ wxString m_TextShapeChoices[] = { _("Input"), _("Output"), _("Bidirectional"), _("Tri-State"), _("Passive") };
+ int m_TextShapeNChoices = sizeof( m_TextShapeChoices ) / sizeof( wxString );
+ m_TextShape = new wxRadioBox( this, wxID_ANY, _("S&hape"), wxDefaultPosition, wxDefaultSize, m_TextShapeNChoices, m_TextShapeChoices, 1, wxRA_SPECIFY_COLS );
+ m_TextShape->SetSelection( 0 );
+ m_OptionsSizer->Add( m_TextShape, 1, wxALL|wxLEFT|wxTOP, 3 );
+
+ bMainSizer->Add( m_OptionsSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 12 );
+
+ m_sdbSizer1 = new wxStdDialogButtonSizer();
+ m_sdbSizer1OK = new wxButton( this, wxID_OK );
+ m_sdbSizer1->AddButton( m_sdbSizer1OK );
+ m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
+ m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
+ m_sdbSizer1->Realize();
+ bMainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 12 );
+
+ this->SetSizer( bMainSizer );
+ this->Layout();
+
+ // Connect Events
+ m_textLabelSingleLine->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DialogLabelEditor_Base::OnEnterKey ), NULL, this );
+ m_textLabelMultiLine->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DialogLabelEditor_Base::OnEnterKey ), NULL, this );
+ m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogLabelEditor_Base::OnCancelClick ), NULL, this );
+ m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogLabelEditor_Base::OnOkClick ), NULL, this );
+}
+
+DialogLabelEditor_Base::~DialogLabelEditor_Base()
+{
+ // Disconnect Events
+ m_textLabelSingleLine->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DialogLabelEditor_Base::OnEnterKey ), NULL, this );
+ m_textLabelMultiLine->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DialogLabelEditor_Base::OnEnterKey ), NULL, this );
+ m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogLabelEditor_Base::OnCancelClick ), NULL, this );
+ m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogLabelEditor_Base::OnOkClick ), NULL, this );
+}
diff --git a/eeschema/dialog_edit_label_base.fbp b/eeschema/dialog_edit_label_base.fbp
index ef0de52a9b..c77af14713 100644
--- a/eeschema/dialog_edit_label_base.fbp
+++ b/eeschema/dialog_edit_label_base.fbp
@@ -1,638 +1,638 @@
-
-
-
-
-
+
+
+
+
+
+ C++
+ 1
+ UTF-8
+ connect
+ dialog_edit_label_base
+ 1000
+ none
+ 1
+ dialog_edit_label_base
+
+ .
+
+ 1
+ 1
+ 0
+
+
+
+
+ 1
+
+
+
+ 0
+ wxID_ANY
+
+
+ DialogLabelEditor_Base
+
+ 359,347
+ wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER
+
+ Text Editor
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ bMainSizer
+ wxVERTICAL
+ none
+
+ 12
+ wxEXPAND|wxLEFT|wxRIGHT|wxTOP
+ 1
+
+ 2
+ wxBOTH
+ 1
+ 0
+ 3
+
+ m_textControlSizer
+ wxFLEX_GROWMODE_SPECIFIED
+ protected
+ 2
+ 3
+
+ 3
+ wxRIGHT
+ 0
+
+
+
+ 1
+
+
+ 0
+ wxID_ANY
+ &Text:
+
+
+ m_staticText1
+ protected
+
+
+
+
+ Enter the text to be used within the schematic
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxEXPAND
+ 1
+
+
+ bSizeText
+ wxVERTICAL
+ none
+
+ 3
+ wxEXPAND|wxLEFT
+ 0
+
+
+
+ 1
+
+
+ 0
+ wxID_VALUESINGLE
+
+ 0
+
+ m_textLabelSingleLine
+ protected
+
+
+ wxTE_PROCESS_ENTER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OnEnterKey
+
+
+
+
+
+
+ 3
+ wxEXPAND|wxLEFT
+ 1
+
+
+
+ 1
+
+
+ 0
+ wxID_VALUEMULTI
+
+ 0
+ -1,60
+ m_textLabelMultiLine
+ protected
+
+
+ wxTE_MULTILINE|wxTE_PROCESS_ENTER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OnEnterKey
+
+
+
+
+
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxRIGHT
+ 0
+
+
+
+ 1
+
+
+ 0
+ wxID_ANY
+ &Size:
+
+
+ m_SizeTitle
+ protected
+
+
+
+
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxEXPAND
+ 1
+
+
+ bSizeCtrlSizer
+ wxHORIZONTAL
+ none
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT
+ 0
+
+
+
+ 1
+
+
+ 0
+ wxID_SIZE
+
+ 0
+
+ m_TextSize
+ protected
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxALIGN_CENTER_VERTICAL|wxLEFT
+ 0
+
+
+
+ 1
+
+
+ 0
+ wxID_ANY
+ units
+
+
+ m_staticSizeUnits
+ protected
+
+
+
+
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 12
+ wxEXPAND|wxLEFT|wxRIGHT|wxTOP
+ 0
+
+
+ m_OptionsSizer
+ wxHORIZONTAL
+ none
+
+ 3
+ wxRIGHT|wxTOP
+ 1
+
+
+ "Right" "Up" "Left" "Down"
+
+ 1
+
+
+ 0
+ wxID_ANY
+ O&rientation
+ 1
+
+
+ m_TextOrient
+ protected
+
+ 0
+
+ wxRA_SPECIFY_COLS
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxLEFT|wxRIGHT|wxTOP
+ 1
+
+
+ "Normal" "Italic" "Bold" "Bold Italic"
+
+ 1
+
+
+ 0
+ wxID_ANY
+ St&yle
+ 1
+
+
+ m_TextStyle
+ protected
+
+ 0
+
+ wxRA_SPECIFY_COLS
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+ wxALL|wxLEFT|wxTOP
+ 1
+
+
+ "Input" "Output" "Bidirectional" "Tri-State" "Passive"
+
+ 1
+
+
+ 0
+ wxID_ANY
+ S&hape
+ 1
+
+
+ m_TextShape
+ protected
+
+ 0
+
+ wxRA_SPECIFY_COLS
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 12
+ wxALL|wxEXPAND
+ 0
+
+ 0
+ 1
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+
+ m_sdbSizer1
+ protected
+
+ OnCancelClick
+
+
+
+ OnOkClick
+
+
+
+
+
+
+
+
diff --git a/eeschema/dialog_edit_label_base.h b/eeschema/dialog_edit_label_base.h
index 74fe3ac917..914fb24d35 100644
--- a/eeschema/dialog_edit_label_base.h
+++ b/eeschema/dialog_edit_label_base.h
@@ -1,68 +1,68 @@
-///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Apr 16 2008)
-// http://www.wxformbuilder.org/
-//
-// PLEASE DO "NOT" EDIT THIS FILE!
-///////////////////////////////////////////////////////////////////////////
-
-#ifndef __dialog_edit_label_base__
-#define __dialog_edit_label_base__
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-///////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-/// Class DialogLabelEditor_Base
-///////////////////////////////////////////////////////////////////////////////
-class DialogLabelEditor_Base : public wxDialog
-{
- private:
-
- protected:
- enum
- {
- wxID_VALUESINGLE = 1000,
- wxID_VALUEMULTI,
- wxID_SIZE,
- };
-
- wxFlexGridSizer* m_textControlSizer;
- wxStaticText* m_staticText1;
- wxTextCtrl* m_textLabelSingleLine;
- wxTextCtrl* m_textLabelMultiLine;
- wxStaticText* m_SizeTitle;
- wxTextCtrl* m_TextSize;
- wxStaticText* m_staticSizeUnits;
- wxRadioBox* m_TextOrient;
- wxRadioBox* m_TextStyle;
- wxRadioBox* m_TextShape;
- wxStdDialogButtonSizer* m_sdbSizer1;
- wxButton* m_sdbSizer1OK;
- wxButton* m_sdbSizer1Cancel;
-
- // Virtual event handlers, overide them in your derived class
- virtual void OnEnterKey( wxCommandEvent& event ){ event.Skip(); }
- virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
- virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
-
-
- public:
- DialogLabelEditor_Base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Text Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 359,347 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
- ~DialogLabelEditor_Base();
-
-};
-
-#endif //__dialog_edit_label_base__
+///////////////////////////////////////////////////////////////////////////
+// C++ code generated with wxFormBuilder (version Apr 16 2008)
+// http://www.wxformbuilder.org/
+//
+// PLEASE DO "NOT" EDIT THIS FILE!
+///////////////////////////////////////////////////////////////////////////
+
+#ifndef __dialog_edit_label_base__
+#define __dialog_edit_label_base__
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+///////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////////////////
+/// Class DialogLabelEditor_Base
+///////////////////////////////////////////////////////////////////////////////
+class DialogLabelEditor_Base : public wxDialog
+{
+ private:
+
+ protected:
+ enum
+ {
+ wxID_VALUESINGLE = 1000,
+ wxID_VALUEMULTI,
+ wxID_SIZE,
+ };
+
+ wxFlexGridSizer* m_textControlSizer;
+ wxStaticText* m_staticText1;
+ wxTextCtrl* m_textLabelSingleLine;
+ wxTextCtrl* m_textLabelMultiLine;
+ wxStaticText* m_SizeTitle;
+ wxTextCtrl* m_TextSize;
+ wxStaticText* m_staticSizeUnits;
+ wxRadioBox* m_TextOrient;
+ wxRadioBox* m_TextStyle;
+ wxRadioBox* m_TextShape;
+ wxStdDialogButtonSizer* m_sdbSizer1;
+ wxButton* m_sdbSizer1OK;
+ wxButton* m_sdbSizer1Cancel;
+
+ // Virtual event handlers, overide them in your derived class
+ virtual void OnEnterKey( wxCommandEvent& event ){ event.Skip(); }
+ virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
+ virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
+
+
+ public:
+ DialogLabelEditor_Base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Text Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 359,347 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+ ~DialogLabelEditor_Base();
+
+};
+
+#endif //__dialog_edit_label_base__
diff --git a/eeschema/eeschema.cpp b/eeschema/eeschema.cpp
index 8e4af9c905..21b260e8d0 100644
--- a/eeschema/eeschema.cpp
+++ b/eeschema/eeschema.cpp
@@ -21,7 +21,7 @@
// Global variables
-int g_OptNetListUseNames; /* TRUE to use names rather than net
+bool g_OptNetListUseNames; /* TRUE to use names rather than net
* The numbers (PSPICE netlist only) */
SCH_ITEM* g_ItemToRepeat; /* Pointer to the last structure
* for duplicatation by the repeat command.
diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp
index 9248fcaca4..e0cb490c0e 100644
--- a/eeschema/eeschema_config.cpp
+++ b/eeschema/eeschema_config.cpp
@@ -4,7 +4,6 @@
#include "fctsys.h"
#include "appl_wxstruct.h"
-#include "gr_basic.h"
#include "common.h"
#include "eeschema_id.h"
#include "class_drawpanel.h"
@@ -12,6 +11,7 @@
#include "gestfich.h"
#include "program.h"
#include "general.h"
+#include "netlist.h"
#include "protos.h"
#include "libeditframe.h"
#include "eeschema_config.h"
@@ -363,11 +363,6 @@ PARAM_CFG_ARRAY& WinEDA_SchematicFrame::GetProjectFileParameters( void )
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "RptLab" ),
&g_RepeatDeltaLabel,
1, -10, +10 ) );
- m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "SimCmd" ),
- &g_SimulatorCommandLine ) );
- m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "UseNetN" ),
- &g_OptNetListUseNames,
- 0, 0, 1 ) );
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "LabSize" ),
&g_DefaultTextLabelSize,
DEFAULT_SIZE_TEXT, 0,
@@ -473,6 +468,8 @@ static const wxString ReplaceStringEntry( wxT( "LastReplaceString" ) );
static const wxString FindStringHistoryEntry( wxT( "FindStringHistoryList%d" ) );
static const wxString ReplaceStringHistoryEntry( wxT( "ReplaceStringHistoryList%d" ) );
static const wxString FieldNamesEntry( wxT( "FieldNames" ) );
+static const wxString SpiceNetNamesEntry( wxT( "SpiceUseNetNames" ) );
+static const wxString SimulatorCommandEntry( wxT( "SimCmdLine" ) );
/*
* Return the EESchema applications settings list.
@@ -496,7 +493,7 @@ PARAM_CFG_ARRAY& WinEDA_SchematicFrame::GetConfigurationSettings( void )
return m_configSettings;
m_configSettings.push_back( new PARAM_CFG_INT( wxT( "Unite" ),
- (int*)&g_UserUnit, 0 ) );
+ (int*)&g_UserUnit, 0 ) );
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColWire" ),
&g_LayerDescr.LayerColor[LAYER_WIRE],
GREEN ) );
@@ -615,6 +612,10 @@ void WinEDA_SchematicFrame::LoadSettings()
cfg->Read( PrintDialogHeightEntry, &tmp, -1 );
m_printDialogSize.SetHeight( (int) tmp );
+ // Load netlists options:
+ cfg->Read( SpiceNetNamesEntry, &g_OptNetListUseNames, false );
+ cfg->Read( SimulatorCommandEntry, &g_SimulatorCommandLine );
+
/* Load find dialog session setting. */
cfg->Read( FindDialogPositionXEntry, &tmp, -1 );
m_findDialogPosition.x = (int) tmp;
@@ -668,6 +669,7 @@ void WinEDA_SchematicFrame::LoadSettings()
CONV_TO_UTF8(e.errorText) );)
}
}
+
}
@@ -700,6 +702,10 @@ void WinEDA_SchematicFrame::SaveSettings()
cfg->Write( PrintDialogWidthEntry, m_printDialogSize.GetWidth() );
cfg->Write( PrintDialogHeightEntry, m_printDialogSize.GetHeight() );
+ // Save netlists options:
+ cfg->Write( SpiceNetNamesEntry, g_OptNetListUseNames );
+ cfg->Write( SimulatorCommandEntry, g_SimulatorCommandLine );
+
/* Save find dialog session setting. */
cfg->Write( FindDialogPositionXEntry, m_findDialogPosition.x );
cfg->Write( FindDialogPositionYEntry, m_findDialogPosition.y );
diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp
index 02e9958c1a..5cfe5f3454 100644
--- a/eeschema/files-io.cpp
+++ b/eeschema/files-io.cpp
@@ -249,14 +249,3 @@ void WinEDA_SchematicFrame::SaveProject()
LibArchive( this, fn.GetFullPath() );
}
-
-/**
- * Return the number of components in the schematic.
- *
- * Power components are not included.
- */
-
-int CountCmpNumber()
-{
- return g_RootSheet->ComponentCount();
-}
diff --git a/eeschema/general.h b/eeschema/general.h
index dc3a77bca8..487e423c89 100644
--- a/eeschema/general.h
+++ b/eeschema/general.h
@@ -95,9 +95,6 @@ typedef enum
} FileSaveType;
-extern int g_OptNetListUseNames; /* TRUE to use names rather than
- * net numbers (PSPICE netlist
- * only) */
extern SCH_ITEM* g_ItemToRepeat; /* Pointer to the last structure used
* by the repeat command. NULL if no
* item to repeat */
diff --git a/eeschema/netform.cpp b/eeschema/netform.cpp
index cf23debc86..38e6008b72 100644
--- a/eeschema/netform.cpp
+++ b/eeschema/netform.cpp
@@ -54,52 +54,60 @@ static NETLIST_OBJECT_LIST s_SortedComponentPinList;
static wxArrayString s_ReferencesAlreadyFound;
-/* Create the netlist file ( Format is given by frame->m_NetlistFormat )
- * bool use_netnames is used only for Spice netlist
+/** function WriteNetListFile
+ * Create the netlist file. Netlist info must be existing
+ * @param aFormat = netlist format (NET_TYPE_PCBNEW ...)
+ * @param aFullFileName = full netlist file name
+ * @param aUse_netnames = bool. if true, use net names from labels in schematic
+ * if false, use net numbers (net codes)
+ * bool aUse_netnames is used only for Spice netlist
+ * @return true if success.
*/
-void WriteNetList( WinEDA_SchematicFrame* frame, const wxString& FileNameNL,
- bool use_netnames )
+bool WinEDA_SchematicFrame::WriteNetListFile( int aFormat, const wxString& aFullFileName,
+ bool aUse_netnames )
{
FILE* f = NULL;
- if( frame->m_NetlistFormat < NET_TYPE_CUSTOM1 )
+ if( aFormat < NET_TYPE_CUSTOM1 )
{
- if( ( f = wxFopen( FileNameNL, wxT( "wt" ) ) ) == NULL )
+ if( ( f = wxFopen( aFullFileName, wxT( "wt" ) ) ) == NULL )
{
- wxString msg = _( "Failed to create file " ) + FileNameNL;
- DisplayError( frame, msg );
- return;
+ wxString msg = _( "Failed to create file " ) + aFullFileName;
+ DisplayError( this, msg );
+ return false;
}
}
wxBusyCursor Busy;
- switch( frame->m_NetlistFormat )
+ switch( aFormat )
{
case NET_TYPE_PCBNEW:
- WriteNetListPCBNEW( frame, f, TRUE );
+ WriteNetListPCBNEW( this, f, TRUE );
fclose( f );
break;
case NET_TYPE_ORCADPCB2:
- WriteNetListPCBNEW( frame, f, FALSE );
+ WriteNetListPCBNEW( this, f, FALSE );
fclose( f );
break;
case NET_TYPE_CADSTAR:
- WriteNetListCADSTAR( frame, f );
+ WriteNetListCADSTAR( this, f );
fclose( f );
break;
case NET_TYPE_SPICE:
- WriteNetListPspice( frame, f, use_netnames );
+ WriteNetListPspice( this, f, aUse_netnames );
fclose( f );
break;
default:
- Write_GENERIC_NetList( frame, FileNameNL );
+ Write_GENERIC_NetList( this, aFullFileName );
break;
}
+
+ return true;
}
@@ -179,8 +187,8 @@ static SCH_COMPONENT* FindNextComponentAndCreatPinList( EDA_BaseStruct* DrawList
AddPinToComponentPinList( Component, sheet, Pin );
}
}
- else // Multiple parts per package: Collect all parts ans pins for
- // this reference
+ else // Multiple parts per package: Collect all parts ans pins for
+ // this reference
FindAllsInstancesOfComponent( Component, Entry, sheet );
/* Sort Pins in s_SortedComponentPinList by pin number */
@@ -218,7 +226,8 @@ static wxString ReturnPinNetName( NETLIST_OBJECT* Pin, const wxString& DefaultFo
if( !NetName.IsEmpty() )
{
// prefix non global labels names by the sheet path, to avoid names collisions
- if( netref->m_Type != NET_PINLABEL )
+ if( ( netref->m_Type != NET_PINLABEL )
+ && ( netref->m_Type != NET_GLOBLABEL ) )
{
wxString lnet = NetName;
NetName = netref->m_SheetList.PathHumanReadable();
@@ -387,12 +396,12 @@ static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, bool use_
SCH_SHEET_LIST SheetList;
for( sheet = SheetList.GetFirst();
- sheet != NULL;
- sheet = SheetList.GetNext() )
+ sheet != NULL;
+ sheet = SheetList.GetNext() )
{
for( DrawList = sheet->LastDrawList();
- DrawList != NULL;
- DrawList = DrawList->Next() )
+ DrawList != NULL;
+ DrawList = DrawList->Next() )
{
wxChar ident;
if( DrawList->Type() != TYPE_SCH_TEXT )
@@ -418,6 +427,7 @@ static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, bool use_
}
text = DRAWTEXT->m_Text.AfterFirst( ' ' );
+
// First BUFYPOS_LEN char are the Y position.
msg.Printf( wxT( "%s %s" ), bufnum, text.GetData() );
if( ident == '+' )
@@ -464,7 +474,7 @@ static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, bool use_
NETLIST_OBJECT* Pin = s_SortedComponentPinList[ii];
if( !Pin )
continue;
- wxString NetName = ReturnPinNetName( Pin, wxT( "N-%.6d" ) );
+ wxString NetName = ReturnPinNetName( Pin, wxT( "N-%.6d" ) );
if( NetName.IsEmpty() )
NetName = wxT( "?" );
if( use_netnames )
@@ -481,7 +491,7 @@ static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, bool use_
}
fprintf( f, " %s\n",
- CONV_TO_UTF8( Component->GetField( VALUE )->m_Text ) );
+ CONV_TO_UTF8( Component->GetField( VALUE )->m_Text ) );
}
}
@@ -518,7 +528,7 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
char Buf[256];
SCH_SHEET_PATH* sheet;
EDA_BaseStruct* DrawList;
- SCH_COMPONENT* Component;
+ SCH_COMPONENT* Component;
OBJ_CMP_TO_LIST* CmpList = NULL;
int CmpListCount = 0, CmpListSize = 1000;
@@ -560,14 +570,14 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
if( CmpListCount >= CmpListSize )
{
CmpListSize += 1000;
- CmpList =
+ CmpList =
(OBJ_CMP_TO_LIST*) realloc( CmpList,
sizeof(OBJ_CMP_TO_LIST)
* CmpListSize );
}
CmpList[CmpListCount].m_RootCmp = Component;
strcpy( CmpList[CmpListCount].m_Reference,
- Component->GetRef( sheet ).mb_str() );
+ Component->GetRef( sheet ).mb_str() );
CmpListCount++;
}
}
@@ -582,8 +592,8 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
Line = Component->GetRef( sheet );
fprintf( f, " ( %s %s",
- CONV_TO_UTF8( Component->GetPath( sheet ) ),
- CONV_TO_UTF8( FootprintName ) );
+ CONV_TO_UTF8( Component->GetPath( sheet ) ),
+ CONV_TO_UTF8( FootprintName ) );
fprintf( f, " %s", CONV_TO_UTF8( Line ) );
Line = Component->GetField( VALUE )->m_Text;
@@ -610,7 +620,7 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
netname.Replace( wxT( " " ), wxT( "_" ) );
fprintf( f, " ( %4.4s %s )\n", (char*) &Pin->m_PinNum,
- CONV_TO_UTF8( netname ) );
+ CONV_TO_UTF8( netname ) );
}
fprintf( f, " )\n" );
@@ -629,7 +639,7 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
for( int ii = 0; ii < CmpListCount; ii++ )
{
Component = CmpList[ii].m_RootCmp;
- Entry = CMP_LIBRARY::FindLibraryComponent( Component->m_ChipName );
+ Entry = CMP_LIBRARY::FindLibraryComponent( Component->m_ChipName );
//Line.Printf(_("%s"), CmpList[ii].m_Ref);
//Line.Replace( wxT( " " ), wxT( "_" ) );
@@ -647,7 +657,7 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
for( unsigned jj = 0; jj < Entry->m_FootprintList.GetCount(); jj++ )
{
fprintf( f, " %s\n",
- CONV_TO_UTF8( Entry->m_FootprintList[jj] ) );
+ CONV_TO_UTF8( Entry->m_FootprintList[jj] ) );
}
fprintf( f, "$endlist\n" );
@@ -736,6 +746,7 @@ static void EraseDuplicatePins( NETLIST_OBJECT_LIST& aPinList )
{
if( aPinList[jj] == NULL ) // Already removed
continue;
+
// other pin num end of duplicate list.
if( aPinList[idxref]->m_PinNum != aPinList[jj]->m_PinNum )
break;
@@ -860,7 +871,8 @@ static void WriteGENERICListOfNets( FILE* f, NETLIST_OBJECT_LIST& aObjectsList )
NetcodeName += wxT( "\"" );
if( !NetName.IsEmpty() )
{
- if( netref->m_Type != NET_PINLABEL )
+ if( ( netref->m_Type != NET_PINLABEL )
+ && ( netref->m_Type != NET_GLOBLABEL ) )
{
// usual net name, prefix it by the sheet path
NetcodeName += netref->m_SheetList.PathHumanReadable();
@@ -1037,7 +1049,8 @@ static void WriteListOfNetsCADSTAR( FILE* f, NETLIST_OBJECT_LIST& aObjectsList )
NetcodeName = wxT( "\"" );
if( !NetName.IsEmpty() )
{
- if( netref->m_Type != NET_PINLABEL )
+ if( ( netref->m_Type != NET_PINLABEL )
+ && ( netref->m_Type != NET_GLOBLABEL ) )
{
// usual net name, prefix it by the sheet path
NetcodeName +=
@@ -1074,10 +1087,10 @@ static void WriteListOfNetsCADSTAR( FILE* f, NETLIST_OBJECT_LIST& aObjectsList )
buf[4] = 0;
str_pinnum = CONV_FROM_UTF8( buf );
InitNetDescLine.Printf( wxT( "\n%s %s %.4s %s" ),
- GetChars(InitNetDesc),
- GetChars(refstr),
- GetChars(str_pinnum),
- GetChars(NetcodeName) );
+ GetChars( InitNetDesc ),
+ GetChars( refstr ),
+ GetChars( str_pinnum ),
+ GetChars( NetcodeName ) );
}
print_ter++;
break;
diff --git a/eeschema/netlist.cpp b/eeschema/netlist.cpp
index c8dab63ddc..597da6604b 100644
--- a/eeschema/netlist.cpp
+++ b/eeschema/netlist.cpp
@@ -342,6 +342,7 @@ void FindBestNetNameForEachNet( NETLIST_OBJECT_LIST& aNetItemBuffer )
case NET_HIERLABEL:
case NET_LABEL:
case NET_PINLABEL:
+ case NET_GLOBLABEL:
candidates.push_back( item );
break;
@@ -368,8 +369,22 @@ static NETLIST_OBJECT* FindBestNetName( NETLIST_OBJECT_LIST& aLabelItemBuffer )
if( aLabelItemBuffer.size() == 0 )
return NULL;
+ int priority_order[4] =
+ { NET_LABEL, NET_HIERLABEL, NET_PINLABEL, NET_GLOBLABEL };
+
NETLIST_OBJECT*item = aLabelItemBuffer[0];
+ // Calculate item priority
+ int item_priority = 0;
+ for( unsigned ii = 0; ii < 4; ii++ )
+ {
+ if ( item->m_Type == priority_order[ii] )
+ {
+ item_priority = ii;
+ break;
+ }
+ }
+
for( unsigned ii = 1; ii < aLabelItemBuffer.size(); ii++ )
{
NETLIST_OBJECT* candidate = aLabelItemBuffer[ii];
@@ -378,38 +393,23 @@ static NETLIST_OBJECT* FindBestNetName( NETLIST_OBJECT_LIST& aLabelItemBuffer )
item = candidate;
continue;
}
- switch ( item->m_Type )
+ // Calculate candidate priority
+ int candidate_priority = 0;
+ for( unsigned ii = 0; ii < 4; ii++ )
{
- case NET_HIERLABEL:
- if( candidate->m_Type == NET_PINLABEL )
- item = candidate;
- else if( candidate->m_Type == NET_HIERLABEL )
- {
- if( candidate->m_Label.Cmp( item->m_Label ) < 0 )
- item = candidate;
- }
+ if ( candidate->m_Type == priority_order[ii] )
+ {
+ candidate_priority = ii;
break;
-
- case NET_LABEL:
- if( candidate->m_Type == NET_LABEL )
- {
- if( candidate->m_Label.Cmp( item->m_Label ) < 0 )
- item = candidate;
- }
- else
- item = candidate;
- break;
-
- case NET_PINLABEL:
- if( candidate->m_Type != NET_PINLABEL )
- break;
- if( candidate->m_Label.Cmp( item->m_Label ) < 0 )
- item = candidate;
- break;
-
- default: // Should not occur.
- break;
- }
+ }
+ }
+ if( candidate_priority > item_priority )
+ item = candidate;
+ else if( candidate_priority == item_priority )
+ {
+ if( candidate->m_Label.Cmp( item->m_Label ) < 0 )
+ item = candidate;
+ }
}
return item;
}
diff --git a/eeschema/netlist.h b/eeschema/netlist.h
index 3bd1b81aec..99204b4cbd 100644
--- a/eeschema/netlist.h
+++ b/eeschema/netlist.h
@@ -49,7 +49,7 @@ public:
SCH_COMPONENT* m_RootCmp; // the component in schematic
LIB_COMPONENT* m_Entry; // the source component in library
int m_Unit; /* Selected part (For multi parts per
- * package) depending on sheet path */
+ * package) depending on sheet path */
SCH_SHEET_PATH m_SheetPath; /* the sheet path for this component */
unsigned long m_TimeStamp; /* unique identification number
* depending on sheet path */
@@ -104,11 +104,11 @@ public:
typedef std::vector NETLIST_OBJECT_LIST;
extern NETLIST_OBJECT_LIST g_NetObjectslist;
+extern bool g_OptNetListUseNames; /* TRUE to use names rather than
+ * net numbers. SPICE netlist only
+ */
/* Prototypes: */
-void WriteNetList( WinEDA_SchematicFrame* frame,
- const wxString& FileNameNL,
- bool use_netnames );
void FreeNetObjectsList( std::vector & aNetObjectslist );
/** Function ReturnUserNetlistTypeName
diff --git a/eeschema/netlist_control.cpp b/eeschema/netlist_control.cpp
index 67eb8e1f35..c20d7aa7b8 100644
--- a/eeschema/netlist_control.cpp
+++ b/eeschema/netlist_control.cpp
@@ -25,7 +25,7 @@
#include "netlist_control.h"
//Imported function:
-int TestDuplicateSheetNames(bool aCreateMarker);
+int TestDuplicateSheetNames( bool aCreateMarker );
// ID for configuration:
#define CUSTOM_NETLIST_TITLE wxT( "CustomNetlistTitle" )
@@ -62,14 +62,14 @@ wxString ReturnUserNetlistTypeName( bool first_item )
BEGIN_EVENT_TABLE( WinEDA_NetlistFrame, wxDialog )
- EVT_BUTTON( wxID_CANCEL, WinEDA_NetlistFrame::OnCancelClick )
- EVT_BUTTON( ID_CREATE_NETLIST, WinEDA_NetlistFrame::GenNetlist )
- EVT_BUTTON( ID_SETUP_PLUGIN, WinEDA_NetlistFrame::SetupPluginData )
- EVT_BUTTON( ID_DELETE_PLUGIN, WinEDA_NetlistFrame::DeletePluginPanel )
- EVT_BUTTON( ID_VALIDATE_PLUGIN, WinEDA_NetlistFrame::ValidatePluginPanel )
- EVT_CHECKBOX( ID_CURRENT_FORMAT_IS_DEFAULT,
- WinEDA_NetlistFrame::SelectNetlistType )
- EVT_BUTTON( ID_RUN_SIMULATOR, WinEDA_NetlistFrame::RunSimulator )
+EVT_BUTTON( wxID_CANCEL, WinEDA_NetlistFrame::OnCancelClick )
+EVT_BUTTON( ID_CREATE_NETLIST, WinEDA_NetlistFrame::GenNetlist )
+EVT_BUTTON( ID_SETUP_PLUGIN, WinEDA_NetlistFrame::SetupPluginData )
+EVT_BUTTON( ID_DELETE_PLUGIN, WinEDA_NetlistFrame::DeletePluginPanel )
+EVT_BUTTON( ID_VALIDATE_PLUGIN, WinEDA_NetlistFrame::ValidatePluginPanel )
+EVT_CHECKBOX( ID_CURRENT_FORMAT_IS_DEFAULT,
+ WinEDA_NetlistFrame::SelectNetlistType )
+EVT_BUTTON( ID_RUN_SIMULATOR, WinEDA_NetlistFrame::RunSimulator )
END_EVENT_TABLE()
@@ -185,8 +185,6 @@ WinEDA_NetlistFrame::WinEDA_NetlistFrame( WinEDA_SchematicFrame* parent ) :
m_PanelNetType[ii] = NULL;
}
- Centre();
-
wxBoxSizer* GeneralBoxSizer = new wxBoxSizer( wxVERTICAL );
SetSizer( GeneralBoxSizer );
@@ -231,6 +229,7 @@ WinEDA_NetlistFrame::WinEDA_NetlistFrame( WinEDA_SchematicFrame* parent ) :
GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this );
+ Centre();
}
@@ -245,15 +244,15 @@ void WinEDA_NetlistFrame::InstallPageSpice()
EDA_NoteBookPage* page;
page = m_PanelNetType[PANELSPICE] =
- new EDA_NoteBookPage( m_NoteBook,
- wxT( "Spice" ),
- NET_TYPE_SPICE,
- 0, 0,
- m_Parent->m_NetlistFormat == NET_TYPE_SPICE );
+ new EDA_NoteBookPage( m_NoteBook,
+ wxT( "Spice" ),
+ NET_TYPE_SPICE,
+ 0, 0,
+ m_Parent->m_NetlistFormat == NET_TYPE_SPICE );
page->m_IsCurrentFormat =
new wxCheckBox( page, ID_CURRENT_FORMAT_IS_DEFAULT,
- _( "Default format" ) );
+ _( "Default format" ) );
page->m_IsCurrentFormat->SetValue( m_Parent->m_NetlistFormat == NET_TYPE_SPICE );
page->m_LeftBoxSizer->Add( page->m_IsCurrentFormat, 0, wxGROW | wxALL, 5 );
@@ -291,8 +290,8 @@ void WinEDA_NetlistFrame::InstallCustomPages()
/* create the pages for custom netlist format selection:
*/
{
- bool selected;
- int ii, CustomCount;
+ bool selected;
+ int ii, CustomCount;
wxString title, previoustitle, msg;
EDA_NoteBookPage* CurrPage;
@@ -381,8 +380,8 @@ void WinEDA_NetlistFrame::SetupPluginData( wxCommandEvent& event )
wxString title = CurrPage->m_TitleStringCtrl->GetValue();
if( title.IsEmpty() )
DisplayInfoMessage( this,
- _( "Do not forget to choose a title for this \
-netlist control page" ) );
+ _( "Do not forget to choose a title for this \
+netlist control page" ) );
}
@@ -444,21 +443,18 @@ void WinEDA_NetlistFrame::GenNetlist( wxCommandEvent& event )
*/
{
wxFileName fn;
- wxString FileWildcard, FileExt;
- wxString msg, Command;
- int netformat_tmp = m_Parent->m_NetlistFormat;
+ wxString FileWildcard, FileExt;
+ wxString msg, Command;
NetlistUpdateOpt();
EDA_NoteBookPage* CurrPage;
-
- CurrPage = (EDA_NoteBookPage*) m_NoteBook->GetCurrentPage();
- m_Parent->m_NetlistFormat = CurrPage->m_IdNetType;
+ CurrPage = (EDA_NoteBookPage*) m_NoteBook->GetCurrentPage();
/* Calculate the netlist filename */
fn = g_RootSheet->m_AssociatedScreen->m_FileName;
- switch( m_Parent->m_NetlistFormat )
+ switch( CurrPage->m_IdNetType )
{
case NET_TYPE_SPICE:
FileExt = wxT( "cir" );
@@ -480,25 +476,55 @@ void WinEDA_NetlistFrame::GenNetlist( wxCommandEvent& event )
wxFileDialog dlg( this, _( "Save Netlist Files" ), fn.GetPath(),
fn.GetFullName(), FileWildcard,
- wxFD_SAVE /*| wxFD_OVERWRITE_PROMPT*/ );
+ wxFD_SAVE );
if( dlg.ShowModal() == wxID_CANCEL )
return;
m_Parent->ClearMsgPanel();
+ if( CurrPage->m_CommandStringCtrl )
+ g_NetListerCommandLine = CurrPage->m_CommandStringCtrl->GetValue();
+ else
+ g_NetListerCommandLine.Empty();
+
+ m_Parent->CreateNetlist( CurrPage->m_IdNetType, dlg.GetPath(), g_OptNetListUseNames );
+
+ WriteCurrentNetlistSetup();
+
+ EndModal( NET_OK );
+}
+
+
+/** Function CreateNetlist
+ * Create a netlist file:
+ * build netlist info
+ * test issues
+ * create file
+ * @param aFormat = netlist format (NET_TYPE_PCBNEW ...)
+ * @param aFullFileName = full netlist file name
+ * @param aUse_netnames = bool. if true, use net names from labels in schematic
+ * if false, use net numbers (net codes)
+ * bool aUse_netnames is used only for Spice netlist
+ * @return true if success.
+ */
+bool WinEDA_SchematicFrame::CreateNetlist( int aFormat, const wxString& aFullFileName,
+ bool aUse_netnames )
+{
ReAnnotatePowerSymbolsOnly();
- if( m_Parent->CheckAnnotate( NULL, 0 ) )
+
+ // Performs some controls:
+ if( CheckAnnotate( NULL, 0 ) )
{
- if( !IsOK( this, _( "Must be Annotated, Continue ?" ) ) )
- return;
+ if( !IsOK( NULL, _( "Must be Annotated, Continue ?" ) ) )
+ return false;
}
// Test duplicate sheet names:
- if( TestDuplicateSheetNames(false ) > 0 )
+ if( TestDuplicateSheetNames( false ) > 0 )
{
- if( !IsOK( this, _( "Error: duplicate sheet names. Continue?" ) ) )
- return;
+ if( !IsOK( NULL, _( "Error: duplicate sheet names. Continue?" ) ) )
+ return false;
}
/* Cleanup the entire hierarchy */
@@ -516,35 +542,10 @@ void WinEDA_NetlistFrame::GenNetlist( wxCommandEvent& event )
screen->ClearUndoRedoList();
}
- m_Parent->BuildNetListBase();
- if( CurrPage->m_CommandStringCtrl )
- g_NetListerCommandLine = CurrPage->m_CommandStringCtrl->GetValue();
- else
- g_NetListerCommandLine.Empty();
+ BuildNetListBase();
+ bool success = WriteNetListFile( aFormat, aFullFileName, g_OptNetListUseNames );
- switch( m_Parent->m_NetlistFormat )
- {
- default:
- WriteNetList( m_Parent, dlg.GetPath(), TRUE );
- break;
-
- case NET_TYPE_CADSTAR:
- case NET_TYPE_ORCADPCB2:
- WriteNetList( m_Parent, dlg.GetPath(), FALSE );
-
- case NET_TYPE_SPICE:
- g_OptNetListUseNames = TRUE; // Used for pspice, gnucap
- if( m_UseNetNamesInNetlist->GetSelection() == 1 )
- g_OptNetListUseNames = FALSE;
- WriteNetList( m_Parent, dlg.GetPath(), g_OptNetListUseNames );
- break;
- }
-
- m_Parent->m_NetlistFormat = netformat_tmp;
-
- WriteCurrentNetlistSetup();
-
- EndModal( NET_OK );
+ return success;
}
@@ -561,7 +562,7 @@ void WinEDA_NetlistFrame::RunSimulator( wxCommandEvent& event )
/***********************************************************/
{
wxFileName fn;
- wxString ExecFile, CommandLine;
+ wxString ExecFile, CommandLine;
g_SimulatorCommandLine =
m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->GetValue();
@@ -576,6 +577,13 @@ void WinEDA_NetlistFrame::RunSimulator( wxCommandEvent& event )
fn.SetExt( wxT( "cir" ) );
CommandLine += wxT( " \"" ) + fn.GetFullPath() + wxT( "\"" );
+ g_OptNetListUseNames = m_UseNetNamesInNetlist->GetSelection() == 0;
+ EDA_NoteBookPage* CurrPage;
+ CurrPage = (EDA_NoteBookPage*) m_NoteBook->GetCurrentPage();
+
+ if( ! m_Parent->CreateNetlist( CurrPage->m_IdNetType, fn.GetFullPath(), g_OptNetListUseNames ) )
+ return;
+
ExecuteFile( this, ExecFile, CommandLine );
}
@@ -588,7 +596,7 @@ void WinEDA_NetlistFrame::WriteCurrentNetlistSetup( void )
* Write the current netlist options setup in the configuration
*/
{
- wxString msg, Command;
+ wxString msg, Command;
wxConfig* config = wxGetApp().m_EDA_Config;
NetlistUpdateOpt();
diff --git a/eeschema/protos.h b/eeschema/protos.h
index 227d8cf858..6ff40707dd 100644
--- a/eeschema/protos.h
+++ b/eeschema/protos.h
@@ -171,11 +171,6 @@ EDA_Colors ReturnLayerColor( int Layer );
void DisplayColorSetupFrame( WinEDA_DrawFrame* parent,
const wxPoint& pos );
-/*************/
-/* EELOAD.CPP */
-/*************/
-int CountCmpNumber();
-
/***************/
/* EECONFIG.CPP */
/***************/
diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp
index 83327e9531..91cc51f93b 100644
--- a/eeschema/schframe.cpp
+++ b/eeschema/schframe.cpp
@@ -563,8 +563,6 @@ void WinEDA_SchematicFrame::OnUpdateSelectCursor( wxUpdateUIEvent& event )
void WinEDA_SchematicFrame::OnUpdateUnits( wxUpdateUIEvent& event )
{
- bool is_metric = ( g_UserUnit == MILLIMETRES ) ? true : false;
-
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_MM, g_UserUnit == MILLIMETRES );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, g_UserUnit == INCHES );
DisplayUnitsMsg();
diff --git a/include/wxEeschemaStruct.h b/include/wxEeschemaStruct.h
index 1f3f59a561..d6a49ba28e 100644
--- a/include/wxEeschemaStruct.h
+++ b/include/wxEeschemaStruct.h
@@ -39,17 +39,16 @@ class wxFindReplaceData;
/* enum used in RotationMiroir() */
-enum fl_rot_cmp
-{
- CMP_NORMAL, // Normal orientation, no rotation or mirror
- CMP_ROTATE_CLOCKWISE, // Rotate -90
- CMP_ROTATE_COUNTERCLOCKWISE, // Rotate +90
- CMP_ORIENT_0, // No rotation and no mirror id CMP_NORMAL
- CMP_ORIENT_90, // Rotate 90, no mirror
- CMP_ORIENT_180, // Rotate 180, no mirror
- CMP_ORIENT_270, // Rotate -90, no mirror
- CMP_MIRROR_X = 0x100, // Mirror around X axis
- CMP_MIRROR_Y = 0x200 // Mirror around Y axis
+enum fl_rot_cmp {
+ CMP_NORMAL, // Normal orientation, no rotation or mirror
+ CMP_ROTATE_CLOCKWISE, // Rotate -90
+ CMP_ROTATE_COUNTERCLOCKWISE, // Rotate +90
+ CMP_ORIENT_0, // No rotation and no mirror id CMP_NORMAL
+ CMP_ORIENT_90, // Rotate 90, no mirror
+ CMP_ORIENT_180, // Rotate 180, no mirror
+ CMP_ORIENT_270, // Rotate -90, no mirror
+ CMP_MIRROR_X = 0x100, // Mirror around X axis
+ CMP_MIRROR_Y = 0x200 // Mirror around Y axis
};
@@ -61,8 +60,8 @@ class WinEDA_SchematicFrame : public WinEDA_DrawFrame
public:
WinEDAChoiceBox* m_SelPartBox;
SCH_SHEET_PATH* m_CurrentSheet; ///< which sheet we are presently working on.
- int m_Multiflag;
- int m_NetlistFormat;
+ int m_Multiflag;
+ int m_NetlistFormat;
bool m_ShowAllPins;
wxPoint m_OldPos;
WinEDA_LibeditFrame* m_LibeditFrame;
@@ -76,7 +75,7 @@ protected:
private:
wxString m_DefaultSchematicFileName;
SCH_FIELD* m_CurrentField;
- int m_TextFieldSize;
+ int m_TextFieldSize;
bool m_ShowGrid;
PARAM_CFG_ARRAY m_projectFileParams;
PARAM_CFG_ARRAY m_configSettings;
@@ -102,15 +101,15 @@ public:
~WinEDA_SchematicFrame();
- void OnCloseWindow( wxCloseEvent& Event );
- void Process_Special_Functions( wxCommandEvent& event );
- void Process_Config( wxCommandEvent& event );
+ void OnCloseWindow( wxCloseEvent& Event );
+ void Process_Special_Functions( wxCommandEvent& event );
+ void Process_Config( wxCommandEvent& event );
- void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels );
+ void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels );
PARAM_CFG_ARRAY& GetProjectFileParameters( void );
- void SaveProjectFile( wxWindow* displayframe, bool askoverwrite = true );
- bool LoadProjectFile( const wxString& CfgFileName, bool ForceRereadConfig );
+ void SaveProjectFile( wxWindow* displayframe, bool askoverwrite = true );
+ bool LoadProjectFile( const wxString& CfgFileName, bool ForceRereadConfig );
/**
* Function GetDefaultFieldName
@@ -118,7 +117,7 @@ public:
* These fieldnames are not modifiable, but template fieldnames are.
* @param aFieldNdx The field number index
*/
- static wxString GetDefaultFieldName( int aFieldNdx );
+ static wxString GetDefaultFieldName( int aFieldNdx );
/**
@@ -137,6 +136,7 @@ public:
return m_TemplateFieldNames.AddTemplateFieldName( aFieldName );
}
+
/**
* Function GetTemplateFieldName
* returns a template fieldnames list for read only access.
@@ -146,6 +146,7 @@ public:
return m_TemplateFieldNames.GetTemplateFieldNames();
}
+
/**
* Function DeleteAllTemplateFieldNames
* removes all template fieldnames.
@@ -155,34 +156,36 @@ public:
m_TemplateFieldNames.DeleteAllTemplateFieldNames();
}
+
PARAM_CFG_ARRAY& GetConfigurationSettings( void );
- void LoadSettings();
- void SaveSettings();
+ void LoadSettings();
+ void SaveSettings();
- void RedrawActiveWindow( wxDC* DC, bool EraseBg );
+ void RedrawActiveWindow( wxDC* DC, bool EraseBg );
- void CreateScreens();
- void ReCreateHToolbar();
- void ReCreateVToolbar();
- void ReCreateOptToolbar();
- void ReCreateMenuBar();
- void OnHotKey( wxDC* DC,
- int hotkey,
- EDA_BaseStruct* DrawStruct );
+ void CreateScreens();
+ void ReCreateHToolbar();
+ void ReCreateVToolbar();
+ void ReCreateOptToolbar();
+ void ReCreateMenuBar();
+ void OnHotKey( wxDC* DC,
+ int hotkey,
+ EDA_BaseStruct* DrawStruct );
- SCH_FIELD* GetCurrentField() { return m_CurrentField; }
+ SCH_FIELD* GetCurrentField() { return m_CurrentField; }
void SetCurrentField( SCH_FIELD* aCurrentField )
{
m_CurrentField = aCurrentField;
}
+
/** Function OnModify()
* Must be called after a schematic change
* in order to set the "modify" flag of the current screen
* and update the date in frame reference
*/
- void OnModify( );
+ void OnModify();
SCH_SHEET_PATH* GetSheet();
@@ -202,7 +205,7 @@ public:
SCH_ITEM* SchematicGeneralLocateAndDisplay( bool IncludePin = TRUE );
SCH_ITEM* SchematicGeneralLocateAndDisplay( const wxPoint& refpoint,
- bool IncludePin );
+ bool IncludePin );
/**
* Function FillFootprintFieldForAllInstancesofComponent
@@ -219,22 +222,51 @@ public:
* components) the search is not stopped when a reference is found
* (all instances must be found).
*/
- bool FillFootprintFieldForAllInstancesofComponent( const wxString& aReference,
- const wxString& aFootPrint,
- bool aSetVisible );
+ bool FillFootprintFieldForAllInstancesofComponent( const wxString& aReference,
+ const wxString& aFootPrint,
+ bool aSetVisible );
- SCH_ITEM* FindComponentAndItem( const wxString& component_reference,
- bool Find_in_hierarchy,
- int SearchType,
- const wxString& text_to_find,
- bool mouseWarp );
+ SCH_ITEM* FindComponentAndItem( const wxString& component_reference,
+ bool Find_in_hierarchy,
+ int SearchType,
+ const wxString& text_to_find,
+ bool mouseWarp );
/* Cross probing with pcbnew */
- void SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
- SCH_COMPONENT* LibItem );
+ void SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
+ SCH_COMPONENT* LibItem );
/* netlist generation */
- void BuildNetListBase();
+ void BuildNetListBase();
+
+ /** Function CreateNetlist
+ * Create a netlist file:
+ * build netlist info
+ * test issues
+ * create file
+ * @param aFormat = netlist format (NET_TYPE_PCBNEW ...)
+ * @param aFullFileName = full netlist file name
+ * @param aUse_netnames = bool. if true, use net names from labels in schematic
+ * if false, use net numbers (net codes)
+ * bool aUse_netnames is used only for Spice netlist
+ * @return true if success.
+ */
+ bool CreateNetlist( int aFormat,
+ const wxString& aFullFileName,
+ bool aUse_netnames );
+
+ /** function WriteNetListFile
+ * Create the netlist file. Netlist info must be existing
+ * @param aFormat = netlist format (NET_TYPE_PCBNEW ...)
+ * @param aFullFileName = full netlist file name
+ * @param aUse_netnames = bool. if true, use net names from labels in schematic
+ * if false, use net numbers (net codes)
+ * bool aUse_netnames is used only for Spice netlist
+ * @return true if success.
+ */
+ bool WriteNetListFile( int aFormat,
+ const wxString& aFullFileName,
+ bool aUse_netnames );
/**
* Function DeleteAnnotation
@@ -244,11 +276,11 @@ public:
* sheet only
* @param aRedraw : true to refresh display
*/
- void DeleteAnnotation( bool aCurrentSheetOnly, bool aRedraw );
+ void DeleteAnnotation( bool aCurrentSheetOnly, bool aRedraw );
// Functions used for hierarchy handling
- void InstallPreviousSheet();
- void InstallNextScreen( SCH_SHEET* Sheet );
+ void InstallPreviousSheet();
+ void InstallNextScreen( SCH_SHEET* Sheet );
/** Function GetUniqueFilenameForCurrentSheet
* @return a filename that can be used in plot and print functions
@@ -261,7 +293,7 @@ public:
* and has no extension.
* However if filename is too long name is -
*/
- wxString GetUniqueFilenameForCurrentSheet();
+ wxString GetUniqueFilenameForCurrentSheet();
/**
* Function SetSheetNumberAndCount
@@ -269,7 +301,7 @@ public:
* must be called after a delete or add sheet command, and when entering
* a sheet
*/
- void SetSheetNumberAndCount();
+ void SetSheetNumberAndCount();
/** Virtual function PrintPage
* used to print a page
@@ -281,27 +313,30 @@ public:
* @param aData = a pointer on an auxiliary data (not always used, NULL if not used)
*/
virtual void PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref,
- int aPrintMask, bool aPrintMirrorMode,
- void * aData = NULL);
+ int aPrintMask, bool aPrintMirrorMode,
+ void* aData = NULL );
+
/**
* Show the print dialog
*/
- void OnPrint( wxCommandEvent& event );
+ void OnPrint( wxCommandEvent& event );
wxPageSetupDialogData& GetPageSetupData() { return m_pageSetupData; }
void SetPreviewPosition( const wxPoint& aPoint ) { m_previewPosition = aPoint; }
void SetPreviewSize( const wxSize& aSize ) { m_previewSize = aSize; }
- const wxPoint& GetPreviewPosition() { return m_previewPosition; }
- const wxSize& GetPreviewSize() { return m_previewSize; }
+ const wxPoint& GetPreviewPosition() { return m_previewPosition; }
+ const wxSize& GetPreviewSize() { return m_previewSize; }
void SetPrintDialogPosition( const wxPoint& aPoint )
{
m_printDialogPosition = aPoint;
}
+
+
void SetPrintDialogSize( const wxSize& aSize ) { m_printDialogSize = aSize; }
- const wxPoint& GetPrintDialogPosition() { return m_printDialogPosition; }
- const wxSize& GetPrintDialogSize() { return m_printDialogSize; }
+ const wxPoint& GetPrintDialogPosition() { return m_printDialogPosition; }
+ const wxSize& GetPrintDialogSize() { return m_printDialogSize; }
bool GetPrintMonochrome() { return m_printMonochrome; }
void SetPrintMonochrome( bool aMonochrome ) { m_printMonochrome = aMonochrome; }
@@ -309,172 +344,172 @@ public:
void SetShowSheetReference( bool aShow ) { m_showSheetReference = aShow; }
// Plot functions:
- void ToPlot_PS( wxCommandEvent& event );
- void ToPlot_HPGL( wxCommandEvent& event );
- void ToPlot_DXF( wxCommandEvent& event );
- void ToPostProcess( wxCommandEvent& event );
+ void ToPlot_PS( wxCommandEvent& event );
+ void ToPlot_HPGL( wxCommandEvent& event );
+ void ToPlot_DXF( wxCommandEvent& event );
+ void ToPostProcess( wxCommandEvent& event );
// read and save files
- void Save_File( wxCommandEvent& event );
- void SaveProject();
- bool LoadOneEEProject( const wxString& FileName, bool IsNew );
- bool LoadOneEEFile( SCH_SCREEN* screen,
- const wxString& FullFileName );
- bool ReadInputStuffFile();
+ void Save_File( wxCommandEvent& event );
+ void SaveProject();
+ bool LoadOneEEProject( const wxString& FileName, bool IsNew );
+ bool LoadOneEEFile( SCH_SCREEN* screen,
+ const wxString& FullFileName );
+ bool ReadInputStuffFile();
/**
* Function ProcessStuffFile
* gets footprint info from each line in the Stuff File by Ref Desg
* @param aFilename The file to read from.
* @param aSetFielsAttributeToVisible = true to set the footprint field
- flag to visible
+ * flag to visible
* @return bool - true if success, else true.
*/
- bool ProcessStuffFile( FILE* aFilename,
- bool aSetFielsAttributeToVisible );
+ bool ProcessStuffFile( FILE* aFilename,
+ bool aSetFielsAttributeToVisible );
- bool SaveEEFile( SCH_SCREEN* screen, int FileSave );
+ bool SaveEEFile( SCH_SCREEN* screen, int FileSave );
// General search:
private:
- void Process_Move_Item( SCH_ITEM* DrawStruct, wxDC* DC );
- void OnExit( wxCommandEvent& event );
- void OnAnnotate( wxCommandEvent& event );
- void OnErc( wxCommandEvent& event );
- void OnCreateNetlist( wxCommandEvent& event );
- void OnCreateBillOfMaterials( wxCommandEvent& event );
- void OnFindItems( wxCommandEvent& event );
- void OnFindDialogClose( wxFindDialogEvent& event );
- void OnFindDrcMarker( wxFindDialogEvent& event );
- void OnFindCompnentInLib( wxFindDialogEvent& event );
- void OnFindSchematicItem( wxFindDialogEvent& event );
- void OnLoadFile( wxCommandEvent& event );
- void OnLoadStuffFile( wxCommandEvent& event );
- void OnNewProject( wxCommandEvent& event );
- void OnLoadProject( wxCommandEvent& event );
- void OnOpenPcbnew( wxCommandEvent& event );
- void OnOpenCvpcb( wxCommandEvent& event );
- void OnOpenLibraryViewer( wxCommandEvent& event );
- void OnOpenLibraryEditor( wxCommandEvent& event );
- void OnSetOptions( wxCommandEvent& event );
+ void Process_Move_Item( SCH_ITEM* DrawStruct, wxDC* DC );
+ void OnExit( wxCommandEvent& event );
+ void OnAnnotate( wxCommandEvent& event );
+ void OnErc( wxCommandEvent& event );
+ void OnCreateNetlist( wxCommandEvent& event );
+ void OnCreateBillOfMaterials( wxCommandEvent& event );
+ void OnFindItems( wxCommandEvent& event );
+ void OnFindDialogClose( wxFindDialogEvent& event );
+ void OnFindDrcMarker( wxFindDialogEvent& event );
+ void OnFindCompnentInLib( wxFindDialogEvent& event );
+ void OnFindSchematicItem( wxFindDialogEvent& event );
+ void OnLoadFile( wxCommandEvent& event );
+ void OnLoadStuffFile( wxCommandEvent& event );
+ void OnNewProject( wxCommandEvent& event );
+ void OnLoadProject( wxCommandEvent& event );
+ void OnOpenPcbnew( wxCommandEvent& event );
+ void OnOpenCvpcb( wxCommandEvent& event );
+ void OnOpenLibraryViewer( wxCommandEvent& event );
+ void OnOpenLibraryEditor( wxCommandEvent& event );
+ void OnSetOptions( wxCommandEvent& event );
/* edition events functions */
- void OnCopySchematicItemRequest( wxCommandEvent& event );
+ void OnCopySchematicItemRequest( wxCommandEvent& event );
/* User interface update event handlers. */
- void OnUpdateBlockSelected( wxUpdateUIEvent& event );
- void OnUpdatePaste( wxUpdateUIEvent& event );
- void OnUpdateSchematicUndo( wxUpdateUIEvent& event );
- void OnUpdateSchematicRedo( wxUpdateUIEvent& event );
- void OnUpdateGrid( wxUpdateUIEvent& event );
- void OnUpdateUnits( wxUpdateUIEvent& event );
- void OnUpdateSelectCursor( wxUpdateUIEvent& event );
- void OnUpdateHiddenPins( wxUpdateUIEvent& event );
- void OnUpdateBusOrientation( wxUpdateUIEvent& event );
+ void OnUpdateBlockSelected( wxUpdateUIEvent& event );
+ void OnUpdatePaste( wxUpdateUIEvent& event );
+ void OnUpdateSchematicUndo( wxUpdateUIEvent& event );
+ void OnUpdateSchematicRedo( wxUpdateUIEvent& event );
+ void OnUpdateGrid( wxUpdateUIEvent& event );
+ void OnUpdateUnits( wxUpdateUIEvent& event );
+ void OnUpdateSelectCursor( wxUpdateUIEvent& event );
+ void OnUpdateHiddenPins( wxUpdateUIEvent& event );
+ void OnUpdateBusOrientation( wxUpdateUIEvent& event );
/** function SetLanguage
* called on a language menu selection
*/
- void SetLanguage( wxCommandEvent& event );
+ void SetLanguage( wxCommandEvent& event );
// Bus Entry
- SCH_BUS_ENTRY* CreateBusEntry( wxDC* DC, int entry_type );
- void SetBusEntryShape( wxDC* DC,
- SCH_BUS_ENTRY* BusEntry,
- int entry_type );
- int GetBusEntryShape( SCH_BUS_ENTRY* BusEntry );
- void StartMoveBusEntry( SCH_BUS_ENTRY* DrawLibItem,
- wxDC* DC );
+ SCH_BUS_ENTRY* CreateBusEntry( wxDC* DC, int entry_type );
+ void SetBusEntryShape( wxDC* DC,
+ SCH_BUS_ENTRY* BusEntry,
+ int entry_type );
+ int GetBusEntryShape( SCH_BUS_ENTRY* BusEntry );
+ void StartMoveBusEntry( SCH_BUS_ENTRY* DrawLibItem,
+ wxDC* DC );
// NoConnect
- SCH_NO_CONNECT* CreateNewNoConnectStruct( wxDC* DC );
+ SCH_NO_CONNECT* CreateNewNoConnectStruct( wxDC* DC );
// Junction
- SCH_JUNCTION* CreateNewJunctionStruct( wxDC* DC,
- const wxPoint& pos,
- bool PutInUndoList = FALSE );
+ SCH_JUNCTION* CreateNewJunctionStruct( wxDC* DC,
+ const wxPoint& pos,
+ bool PutInUndoList = FALSE );
// Text ,label, glabel
- SCH_TEXT* CreateNewText( wxDC* DC, int type );
- void EditSchematicText( SCH_TEXT* TextStruct );
- void ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC );
- void StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC );
- void ConvertTextType( SCH_TEXT* Text, wxDC* DC, int newtype );
+ SCH_TEXT* CreateNewText( wxDC* DC, int type );
+ void EditSchematicText( SCH_TEXT* TextStruct );
+ void ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC );
+ void StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC );
+ void ConvertTextType( SCH_TEXT* Text, wxDC* DC, int newtype );
// Wire, Bus
- void BeginSegment( wxDC* DC, int type );
- void EndSegment( wxDC* DC );
- void DeleteCurrentSegment( wxDC* DC );
- void DeleteConnection( bool DeleteFullConnection );
+ void BeginSegment( wxDC* DC, int type );
+ void EndSegment( wxDC* DC );
+ void DeleteCurrentSegment( wxDC* DC );
+ void DeleteConnection( bool DeleteFullConnection );
// graphic lines
- void Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC );
- void Drawing_SetNewWidth( DRAWSEGMENT* DrawSegm, wxDC* DC );
- void Delete_Drawings_All_Layer( DRAWSEGMENT* Segment, wxDC* DC );
- DRAWSEGMENT* Begin_Edge( DRAWSEGMENT* Segment, wxDC* DC );
+ void Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC );
+ void Drawing_SetNewWidth( DRAWSEGMENT* DrawSegm, wxDC* DC );
+ void Delete_Drawings_All_Layer( DRAWSEGMENT* Segment, wxDC* DC );
+ DRAWSEGMENT* Begin_Edge( DRAWSEGMENT* Segment, wxDC* DC );
// Hierarchical Sheet & PinSheet
- void InstallHierarchyFrame( wxDC* DC, wxPoint& pos );
- SCH_SHEET* CreateSheet( wxDC* DC );
- void ReSizeSheet( SCH_SHEET* Sheet, wxDC* DC );
+ void InstallHierarchyFrame( wxDC* DC, wxPoint& pos );
+ SCH_SHEET* CreateSheet( wxDC* DC );
+ void ReSizeSheet( SCH_SHEET* Sheet, wxDC* DC );
/**
* Use the component viewer to select component to import into schematic.
*/
- wxString SelectFromLibBrowser( void );
+ wxString SelectFromLibBrowser( void );
public:
- bool EditSheet( SCH_SHEET* Sheet, wxDC* DC );
+ bool EditSheet( SCH_SHEET* Sheet, wxDC* DC );
/** Function UpdateSheetNumberAndDate
* Set a sheet number, the sheet count for sheets in the whole schematic
* and update the date in all screens
*/
- void UpdateSheetNumberAndDate();
+ void UpdateSheetNumberAndDate();
private:
- void StartMoveSheet( SCH_SHEET* sheet, wxDC* DC );
- SCH_SHEET_PIN* Create_PinSheet( SCH_SHEET* Sheet, wxDC* DC );
- int Edit_PinSheet( SCH_SHEET_PIN* SheetLabel, wxDC* DC );
- void StartMove_PinSheet( SCH_SHEET_PIN* SheetLabel,
- wxDC* DC );
- void Place_PinSheet( SCH_SHEET_PIN* SheetLabel,
- wxDC* DC );
- SCH_SHEET_PIN* Import_PinSheet( SCH_SHEET* Sheet, wxDC* DC );
+ void StartMoveSheet( SCH_SHEET* sheet, wxDC* DC );
+ SCH_SHEET_PIN* Create_PinSheet( SCH_SHEET* Sheet, wxDC* DC );
+ int Edit_PinSheet( SCH_SHEET_PIN* SheetLabel, wxDC* DC );
+ void StartMove_PinSheet( SCH_SHEET_PIN* SheetLabel,
+ wxDC* DC );
+ void Place_PinSheet( SCH_SHEET_PIN* SheetLabel,
+ wxDC* DC );
+ SCH_SHEET_PIN* Import_PinSheet( SCH_SHEET* Sheet, wxDC* DC );
public:
- void DeleteSheetLabel( bool aRedraw,
- SCH_SHEET_PIN* aSheetLabelToDel );
+ void DeleteSheetLabel( bool aRedraw,
+ SCH_SHEET_PIN* aSheetLabelToDel );
private:
// Component
- SCH_COMPONENT* Load_Component( wxDC* DC,
- const wxString& libname,
- wxArrayString& List,
- bool UseLibBrowser );
- void StartMovePart( SCH_COMPONENT* DrawLibItem, wxDC* DC );
+ SCH_COMPONENT* Load_Component( wxDC* DC,
+ const wxString& libname,
+ wxArrayString& List,
+ bool UseLibBrowser );
+ void StartMovePart( SCH_COMPONENT* DrawLibItem, wxDC* DC );
public:
- void CmpRotationMiroir( SCH_COMPONENT* DrawComponent,
- wxDC* DC, int type_rotate );
+ void CmpRotationMiroir( SCH_COMPONENT* DrawComponent,
+ wxDC* DC, int type_rotate );
private:
- void SelPartUnit( SCH_COMPONENT* DrawComponent,
- int unit, wxDC* DC );
- void ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC );
- void SetInitCmp( SCH_COMPONENT* DrawComponent, wxDC* DC );
- void EditComponentReference( SCH_COMPONENT* DrawLibItem,
- wxDC* DC );
- void EditComponentValue( SCH_COMPONENT* DrawLibItem, wxDC* DC );
- void EditComponentFootprint( SCH_COMPONENT* DrawLibItem,
- wxDC* DC );
- void StartMoveCmpField( SCH_FIELD* Field, wxDC* DC );
- void EditCmpFieldText( SCH_FIELD* Field, wxDC* DC );
- void RotateCmpField( SCH_FIELD* Field, wxDC* DC );
+ void SelPartUnit( SCH_COMPONENT* DrawComponent,
+ int unit, wxDC* DC );
+ void ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC );
+ void SetInitCmp( SCH_COMPONENT* DrawComponent, wxDC* DC );
+ void EditComponentReference( SCH_COMPONENT* DrawLibItem,
+ wxDC* DC );
+ void EditComponentValue( SCH_COMPONENT* DrawLibItem, wxDC* DC );
+ void EditComponentFootprint( SCH_COMPONENT* DrawLibItem,
+ wxDC* DC );
+ void StartMoveCmpField( SCH_FIELD* Field, wxDC* DC );
+ void EditCmpFieldText( SCH_FIELD* Field, wxDC* DC );
+ void RotateCmpField( SCH_FIELD* Field, wxDC* DC );
- void PasteListOfItems( wxDC* DC );
+ void PasteListOfItems( wxDC* DC );
/* Undo - redo */
public:
@@ -488,8 +523,8 @@ public:
* for commands like move
*/
void SaveCopyInUndoList( SCH_ITEM* aItemToCopy,
- UndoRedoOpType aTypeCommand,
- const wxPoint& aTransformPoint = wxPoint( 0, 0 ) );
+ UndoRedoOpType aTypeCommand,
+ const wxPoint& aTransformPoint = wxPoint( 0, 0 ) );
/** Function SaveCopyInUndoList (overloaded).
* Creates a new entry in undo list of commands.
@@ -500,10 +535,11 @@ public:
* for commands like move
*/
void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
- UndoRedoOpType aTypeCommand,
- const wxPoint& aTransformPoint = wxPoint( 0, 0 ) );
+ UndoRedoOpType aTypeCommand,
+ const wxPoint& aTransformPoint = wxPoint( 0, 0 ) );
private:
+
/** Function PutDataInPreviousState()
* Used in undo or redo command.
* Put data pointed by List in the previous state, i.e. the state
@@ -512,7 +548,7 @@ private:
* undo/redo
* @param aRedoCommand = a bool: true for redo, false for undo
*/
- void PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRedoCommand );
+ void PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRedoCommand );
/** Function GetSchematicFromRedoList
* Redo the last edition:
@@ -520,7 +556,7 @@ private:
* - Get an old version of the schematic from Redo list
* @return none
*/
- void GetSchematicFromRedoList(wxCommandEvent& event);
+ void GetSchematicFromRedoList( wxCommandEvent& event );
/** Function GetSchematicFromUndoList
* Undo the last edition:
@@ -528,25 +564,26 @@ private:
* - Get an old version of the schematic from Undo list
* @return none
*/
- void GetSchematicFromUndoList(wxCommandEvent& event);
+ void GetSchematicFromUndoList( wxCommandEvent& event );
public:
- void Key( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct );
+ void Key( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct );
/* Block operations. */
- int ReturnBlockCommand( int key );
- void InitBlockPasteInfos();
- void HandleBlockPlace( wxDC* DC );
- int HandleBlockEnd( wxDC* DC );
- void HandleBlockEndByPopUp( int Command, wxDC* DC );
+ int ReturnBlockCommand( int key );
+ void InitBlockPasteInfos();
+ void HandleBlockPlace( wxDC* DC );
+ int HandleBlockEnd( wxDC* DC );
+ void HandleBlockEndByPopUp( int Command, wxDC* DC );
- void RepeatDrawItem( wxDC* DC );
+ void RepeatDrawItem( wxDC* DC );
- void TestDanglingEnds( SCH_ITEM* DrawList, wxDC* DC );
- LIB_PIN* LocatePinEnd( SCH_ITEM* DrawList, const wxPoint& pos );
+ void TestDanglingEnds( SCH_ITEM* DrawList, wxDC* DC );
+ LIB_PIN* LocatePinEnd( SCH_ITEM* DrawList, const wxPoint& pos );
// ERC:
+
/**
* Function CheckAnnotate
* Check errors relatives to annotation:
@@ -561,12 +598,12 @@ public:
* @param aOneSheetOnly : true = search is made only in the current sheet
* false = search in whole hierarchy (usual search).
*/
- int CheckAnnotate( wxArrayString * aMessageList, bool aOneSheetOnly );
+ int CheckAnnotate( wxArrayString* aMessageList, bool aOneSheetOnly );
/**
* Load component libraries defined in project file.
*/
- void LoadLibraries( void );
+ void LoadLibraries( void );
DECLARE_EVENT_TABLE()
diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp
index b7e5169f52..b516f82b1d 100644
--- a/pcbnew/pcbframe.cpp
+++ b/pcbnew/pcbframe.cpp
@@ -215,8 +215,8 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_TOOL_RANGE( ID_PCB_MUWAVE_START_CMD, ID_PCB_MUWAVE_END_CMD,
WinEDA_PcbFrame::ProcessMuWaveFunctions )
-EVT_TOOL( ID_PCB_PLACE_GRID_COORD_BUTT,
- WinEDA_PcbFrame::Process_Special_Functions )
+ EVT_TOOL( ID_PCB_PLACE_GRID_COORD_BUTT,
+ WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL_RCLICKED( ID_TRACK_BUTT, WinEDA_PcbFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_CIRCLE_BUTT, WinEDA_PcbFrame::ToolOnRightClick )
diff --git a/pcbnew/set_grid.cpp b/pcbnew/set_grid.cpp
index 8af541aae7..23d6180514 100644
--- a/pcbnew/set_grid.cpp
+++ b/pcbnew/set_grid.cpp
@@ -14,25 +14,25 @@
#include "dialog_set_grid_base.h"
-class DIALOG_SET_GRID: public DIALOG_SET_GRID_BASE
+class DIALOG_SET_GRID : public DIALOG_SET_GRID_BASE
{
- public:
- int m_internalUnits;
+public:
+ int m_internalUnits;
- public:
- DIALOG_SET_GRID( wxWindow* parent, const wxPoint& pos );
- ~DIALOG_SET_GRID() { }
- void SetGridSize( const wxRealPoint& grid );
- wxRealPoint GetGridSize();
- void SetGridUnits( int units );
- int GetGridUnits();
- void SetGridOrigin( const wxPoint& grid );
- wxPoint GetGridOrigin();
+public:
+ DIALOG_SET_GRID( wxWindow* parent, const wxPoint& pos );
+ ~DIALOG_SET_GRID() { }
+ void SetGridSize( const wxRealPoint& grid );
+ wxRealPoint GetGridSize();
+ void SetGridUnits( int units );
+ int GetGridUnits();
+ void SetGridOrigin( const wxPoint& grid );
+ wxPoint GetGridOrigin();
- private:
- void OnResetGridOrgClick( wxCommandEvent& event );
- void OnCancelClick( wxCommandEvent& event );
- void OnOkClick( wxCommandEvent& event );
+private:
+ void OnResetGridOrgClick( wxCommandEvent& event );
+ void OnCancelClick( wxCommandEvent& event );
+ void OnOkClick( wxCommandEvent& event );
};
void WinEDA_BasePcbFrame::InstallGridFrame( const wxPoint& pos )
@@ -47,9 +47,9 @@ void WinEDA_BasePcbFrame::InstallGridFrame( const wxPoint& pos )
if( dlg.ShowModal() == wxID_CANCEL )
return;
- m_UserGridSize = dlg.GetGridSize();
- m_UserGridUnit = (UserUnitType)dlg.GetGridUnits();
- GetScreen()->m_GridOrigin = dlg.GetGridOrigin( );
+ m_UserGridSize = dlg.GetGridSize();
+ m_UserGridUnit = (UserUnitType) dlg.GetGridUnits();
+ GetScreen()->m_GridOrigin = dlg.GetGridOrigin();
GetScreen()->AddGrid( m_UserGridSize, m_UserGridUnit, ID_POPUP_GRID_USER );
@@ -62,14 +62,16 @@ void WinEDA_BasePcbFrame::InstallGridFrame( const wxPoint& pos )
}
-DIALOG_SET_GRID::DIALOG_SET_GRID( wxWindow* parent, const wxPoint& pos )
- : DIALOG_SET_GRID_BASE( parent )
+DIALOG_SET_GRID::DIALOG_SET_GRID( wxWindow* parent, const wxPoint& pos ) :
+ DIALOG_SET_GRID_BASE( parent )
{
+ SetFocus();
+
m_TextPosXUnits->SetLabel( GetUnitsLabel( g_UserUnit ) );
m_TextPosYUnits->SetLabel( GetUnitsLabel( g_UserUnit ) );
GetSizer()->SetSizeHints( this );
- Centre( );
+ Centre();
}
@@ -103,47 +105,51 @@ void DIALOG_SET_GRID::SetGridUnits( int units )
m_UnitGrid->SetSelection( 1 );
}
+
int DIALOG_SET_GRID::GetGridUnits()
{
return m_UnitGrid->GetSelection();
}
+
wxPoint DIALOG_SET_GRID::GetGridOrigin()
{
wxPoint grid;
/* TODO: Some error checking here would be a good thing. */
- grid.x = ReturnValueFromTextCtrl( *m_GridOriginXCtrl, m_internalUnits );
- grid.y = ReturnValueFromTextCtrl( *m_GridOriginYCtrl, m_internalUnits );
+ grid.x = ReturnValueFromTextCtrl( *m_GridOriginXCtrl, m_internalUnits );
+ grid.y = ReturnValueFromTextCtrl( *m_GridOriginYCtrl, m_internalUnits );
return grid;
}
+
void DIALOG_SET_GRID::SetGridOrigin( const wxPoint& grid )
{
wxString msg;
+
PutValueInLocalUnits( *m_GridOriginXCtrl, grid.x, m_internalUnits );
PutValueInLocalUnits( *m_GridOriginYCtrl, grid.y, m_internalUnits );
}
-void DIALOG_SET_GRID::OnResetGridOrgClick(wxCommandEvent& event)
+void DIALOG_SET_GRID::OnResetGridOrgClick( wxCommandEvent& event )
{
- wxString msg(_("0") );
- m_GridOriginXCtrl->SetValue(msg);
- m_GridOriginYCtrl->SetValue(msg);
+ SetGridOrigin( wxPoint(0,0) );
}
+
/*****************************************************************/
void DIALOG_SET_GRID::OnCancelClick( wxCommandEvent& event )
/*****************************************************************/
{
- EndModal(wxID_CANCEL);
+ EndModal( wxID_CANCEL );
}
+
/*************************************************************************/
-void DIALOG_SET_GRID::OnOkClick(wxCommandEvent& event)
+void DIALOG_SET_GRID::OnOkClick( wxCommandEvent& event )
/*************************************************************************/
{
- EndModal(wxID_OK);
+ EndModal( wxID_OK );
}
diff --git a/pcbnew/tool_onrightclick.cpp b/pcbnew/tool_onrightclick.cpp
index 88fe48e3c7..d4b8030e8c 100644
--- a/pcbnew/tool_onrightclick.cpp
+++ b/pcbnew/tool_onrightclick.cpp
@@ -18,8 +18,6 @@ void WinEDA_PcbFrame::ToolOnRightClick( wxCommandEvent& event )
int id = event.GetSelection();
wxGetMousePosition( &pos.x, &pos.y );
- pos.x -= 400;
- pos.y -= 30;
switch( id )
{