Re: [Kicad-developers] [RFC][PATCH] import pins from CSV
Replying again because I've updated this patch. It now supports pin types, as well as fixing a crash that I noticed after I sent the last one. Cheers, Alex On Tue, Feb 07, 2017 at 12:31:39PM -0800, Alex Bell wrote: > Importing a CSV file into component editor > > 1. Start kicad, launch component editor, create a new component > 2. Click CSV button in top toolbar (far right) > 3. When prompted for file, navigate to a csv file containing pins for import > 4. Pins will be created in a vertical column with 100 mm spacing. Grab blocks > of >pins and move as necessary > > 1,Pin_1 > 2,Pin_2 > 3,VCC > > etc. > > Extra columns should be ignored for now. I've just noticed that a line with > too > few columns is crashing so please don't try that with anything important > unsaved > > Double quotes will be removed automatically. > > I've attached an example file that I was using for testing. > > Let me know how it works for you. I'll try to get a new patch that's a bit > less > brittle up soon. > > Cheers, > Alex > > On Tue, Feb 07, 2017 at 02:11:31PM -0600, Bob Gustafson wrote: > > This sounds like something I could use now. > > > > Do you have any documentation on 'how to use' ? I would also have to > > reinstate my toolchain to be able to use it - not insignificant amount of > > labor. By reading your doc, I could determine the cost/benefit at the > > moment. > > > > Thanks much - Bob G > > > > > > On 02/06/2017 02:12 PM, Alex Bell wrote: > > >I've not submitted a patch before nor really used a mailing list, so > > >please let > > >me know if I did something wrong. > > > > > >This adds a button on the component editor toolbar that prompts for a csv > > >file, > > >and then reads pin numbers and names and generates pins. > > > > > >I decided to start with something small but a few potential avenues for > > >improvement I can see are: > > >- adding a parser for electrical type based on regex > > >- integrating this into it's own dialog with selectors for parsing options, > > > default pin direction > > >- moving the button from the toolbar to the pin table, or even more > > >integration > > > of some sort with pin table > > > > > >I tested it on linux and there is a build that will hopefully finish soon > > >here: > > >http://ci.kicad-pcb.org/job/windows-kicad-msys2-patch/560/ > > > > > >Cheers, > > >Alex > > > > > > > > >___ > > >Mailing list: https://launchpad.net/~kicad-developers > > >Post to : kicad-developers@lists.launchpad.net > > >Unsubscribe : https://launchpad.net/~kicad-developers > > >More help : https://help.launchpad.net/ListHelp > > > 1,"Res" > 2,"Res" > 3,"Res,is,best" > 3,"Res" > 5,"GND" > 6,"GND" > 7,"C1_XM" > 8,"SETC_XM" > 9,"SETP_XM" > 10,"DEN_G" > 11,"INT_G" > 12,"DRDY_G" > 13,"INT1_XM" > 14,"INT2_XM" > 15,"Vdd" > 16,"Vdd" > 17,"Vdd" > 18,"Vdd_IO" > 19,"CS_G" > 20,"CS_XM" > 21,"SCL" > 22,"SDO_G" > 23,"SDO_XM" > 24,"SDA" diff --git a/bitmaps_png/CMakeLists.txt b/bitmaps_png/CMakeLists.txt index 8dae66f..20cb814 100644 --- a/bitmaps_png/CMakeLists.txt +++ b/bitmaps_png/CMakeLists.txt @@ -288,6 +288,7 @@ set( BMAPS_MID image import_brd_file import_cmp_from_lib +import_csv import_footprint_names import_hierarchical_label import_module diff --git a/bitmaps_png/cpp_26/import_csv.cpp b/bitmaps_png/cpp_26/import_csv.cpp new file mode 100644 index 000..e284a72 --- /dev/null +++ b/bitmaps_png/cpp_26/import_csv.cpp @@ -0,0 +1,59 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x02, 0x98, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xed, 0x95, 0x5d, 0x68, 0xcd, + 0x71, 0x18, 0xc7, 0x3f, 0xc7, 0x59, 0x6c, 0xe7, 0xc4, 0x85, 0xad, 0xe5, 0x65, 0x36, 0x8d, 0x09, + 0xb3, 0xb1, 0x71, 0x52, 0x26, 0x6f, 0x69, 0x68, 0xdc, 0xcc, 0x90, 0x2c, 0xad, 0x48, 0x98, 0x3a, + 0xb9, 0x90, 0x2b, 0xda, 0x16, 0xbb, 0x71, 0x81, 0x98, 0x76, 0x76, 0x81, 0x43, 0x29, 0xc5, 0x1c, + 0x76, 0x23, 0x5c, 0xc8, 0xc5, 0x2e, 0xd8, 0x4a, 0x29, 0x84, 0x52, 0xe2, 0x86, 0x68, 0x39, 0x35, + 0xe7, 0xb0, 0x76, 0x7c, 0x9f, 0xed, 0xfc, 0x75, 0x9c, 0x9d, 0x69, 0xf1, 0xbf, 0x5a, 0x9e, 0x7a, + 0xea, 0xf7, 0x7f, 0x9e, 0xf3, 0xbc, 0x7c, 0xbf, 0xcf, 0xf3, 0xfb, 0x1d, 0x18, 0xd7, 0xd2, 0x04, + 0x95, 0xd2, 0xdb, 0xd2, 0x0f, 0x49, 0x8d, 0xb4, 0xc0, 0x6a, 0x57, 0x8b, 0x34, 0x43, 0x63, 0x93, + 0xc7, 0xf3, 0x43, 0xc9, 0x13, 0x2d, 0x59, 0x59, 0x43, 0x6a, 0x67, 0xe9, 0xa0, 0x7c, 0x41, 0xf7, + 0x90, 0xa8, 0x48, 0xab, 0xdf, 0x3f, 0xd8, 0xdb, 0xd1, 0x91, 0x18, 0x88, 0xc7, 0x87, 0xf4, 0x69, + 0x38, 0x9c, 0x30, 0x9b, 0xf9, 0x84, 0xac, 0xc2, 0x8d, 0x42, 0x46, 0x57, 0xc2, 0x8a, 0xa4, 0x4b, + 0x4f, 0x28, 0xe4, 0x20,
Re: [Kicad-developers] [RFC][PATCH] import pins from CSV
Importing a CSV file into component editor 1. Start kicad, launch component editor, create a new component 2. Click CSV button in top toolbar (far right) 3. When prompted for file, navigate to a csv file containing pins for import 4. Pins will be created in a vertical column with 100 mm spacing. Grab blocks of pins and move as necessary 1,Pin_1 2,Pin_2 3,VCC etc. Extra columns should be ignored for now. I've just noticed that a line with too few columns is crashing so please don't try that with anything important unsaved Double quotes will be removed automatically. I've attached an example file that I was using for testing. Let me know how it works for you. I'll try to get a new patch that's a bit less brittle up soon. Cheers, Alex On Tue, Feb 07, 2017 at 02:11:31PM -0600, Bob Gustafson wrote: > This sounds like something I could use now. > > Do you have any documentation on 'how to use' ? I would also have to > reinstate my toolchain to be able to use it - not insignificant amount of > labor. By reading your doc, I could determine the cost/benefit at the > moment. > > Thanks much - Bob G > > > On 02/06/2017 02:12 PM, Alex Bell wrote: > >I've not submitted a patch before nor really used a mailing list, so please > >let > >me know if I did something wrong. > > > >This adds a button on the component editor toolbar that prompts for a csv > >file, > >and then reads pin numbers and names and generates pins. > > > >I decided to start with something small but a few potential avenues for > >improvement I can see are: > >- adding a parser for electrical type based on regex > >- integrating this into it's own dialog with selectors for parsing options, > > default pin direction > >- moving the button from the toolbar to the pin table, or even more > >integration > > of some sort with pin table > > > >I tested it on linux and there is a build that will hopefully finish soon > >here: > >http://ci.kicad-pcb.org/job/windows-kicad-msys2-patch/560/ > > > >Cheers, > >Alex > > > > > >___ > >Mailing list: https://launchpad.net/~kicad-developers > >Post to : kicad-developers@lists.launchpad.net > >Unsubscribe : https://launchpad.net/~kicad-developers > >More help : https://help.launchpad.net/ListHelp > 1,"Res" 2,"Res" 3,"Res,is,best" 3,"Res" 5,"GND" 6,"GND" 7,"C1_XM" 8,"SETC_XM" 9,"SETP_XM" 10,"DEN_G" 11,"INT_G" 12,"DRDY_G" 13,"INT1_XM" 14,"INT2_XM" 15,"Vdd" 16,"Vdd" 17,"Vdd" 18,"Vdd_IO" 19,"CS_G" 20,"CS_XM" 21,"SCL" 22,"SDO_G" 23,"SDO_XM" 24,"SDA" ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] [RFC][PATCH] import pins from CSV
This sounds like something I could use now. Do you have any documentation on 'how to use' ? I would also have to reinstate my toolchain to be able to use it - not insignificant amount of labor. By reading your doc, I could determine the cost/benefit at the moment. Thanks much - Bob G On 02/06/2017 02:12 PM, Alex Bell wrote: I've not submitted a patch before nor really used a mailing list, so please let me know if I did something wrong. This adds a button on the component editor toolbar that prompts for a csv file, and then reads pin numbers and names and generates pins. I decided to start with something small but a few potential avenues for improvement I can see are: - adding a parser for electrical type based on regex - integrating this into it's own dialog with selectors for parsing options, default pin direction - moving the button from the toolbar to the pin table, or even more integration of some sort with pin table I tested it on linux and there is a build that will hopefully finish soon here: http://ci.kicad-pcb.org/job/windows-kicad-msys2-patch/560/ Cheers, Alex ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
[Kicad-developers] [RFC][PATCH] import pins from CSV
I've not submitted a patch before nor really used a mailing list, so please let me know if I did something wrong. This adds a button on the component editor toolbar that prompts for a csv file, and then reads pin numbers and names and generates pins. I decided to start with something small but a few potential avenues for improvement I can see are: - adding a parser for electrical type based on regex - integrating this into it's own dialog with selectors for parsing options, default pin direction - moving the button from the toolbar to the pin table, or even more integration of some sort with pin table I tested it on linux and there is a build that will hopefully finish soon here: http://ci.kicad-pcb.org/job/windows-kicad-msys2-patch/560/ Cheers, Alex --- bitmaps_png/CMakeLists.txt | 1 + bitmaps_png/cpp_26/import_csv.cpp | 59 ++ bitmaps_png/sources/import_csv.svg | 152 + eeschema/eeschema_id.h | 1 + eeschema/libeditframe.cpp | 115 eeschema/libeditframe.h| 13 +++- eeschema/pinedit.cpp | 11 ++- eeschema/tool_lib.cpp | 2 + include/bitmaps.h | 1 + 9 files changed, 349 insertions(+), 6 deletions(-) create mode 100644 bitmaps_png/cpp_26/import_csv.cpp create mode 100644 bitmaps_png/sources/import_csv.svg diff --git a/bitmaps_png/CMakeLists.txt b/bitmaps_png/CMakeLists.txt index 41097a3..68d6fae 100644 --- a/bitmaps_png/CMakeLists.txt +++ b/bitmaps_png/CMakeLists.txt @@ -288,6 +288,7 @@ set( BMAPS_MID image import_brd_file import_cmp_from_lib +import_csv import_footprint_names import_hierarchical_label import_module diff --git a/bitmaps_png/cpp_26/import_csv.cpp b/bitmaps_png/cpp_26/import_csv.cpp new file mode 100644 index 000..e284a72 --- /dev/null +++ b/bitmaps_png/cpp_26/import_csv.cpp @@ -0,0 +1,59 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x02, 0x98, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xed, 0x95, 0x5d, 0x68, 0xcd, + 0x71, 0x18, 0xc7, 0x3f, 0xc7, 0x59, 0x6c, 0xe7, 0xc4, 0x85, 0xad, 0xe5, 0x65, 0x36, 0x8d, 0x09, + 0xb3, 0xb1, 0x71, 0x52, 0x26, 0x6f, 0x69, 0x68, 0xdc, 0xcc, 0x90, 0x2c, 0xad, 0x48, 0x98, 0x3a, + 0xb9, 0x90, 0x2b, 0xda, 0x16, 0xbb, 0x71, 0x81, 0x98, 0x76, 0x76, 0x81, 0x43, 0x29, 0xc5, 0x1c, + 0x76, 0x23, 0x5c, 0xc8, 0xc5, 0x2e, 0xd8, 0x4a, 0x29, 0x84, 0x52, 0xe2, 0x86, 0x68, 0x39, 0x35, + 0xe7, 0xb0, 0x76, 0x7c, 0x9f, 0xed, 0xfc, 0x75, 0x9c, 0x9d, 0x69, 0xf1, 0xbf, 0x5a, 0x9e, 0x7a, + 0xea, 0xf7, 0x7f, 0x9e, 0xf3, 0xbc, 0x7c, 0xbf, 0xcf, 0xf3, 0xfb, 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