← Back to team overview

kicad-developers team mailing list archive

Re: Kicad Library Concept Ideas

 

On Feb 3, 2011, at 19:13 PM, Dick Hollenbeck wrote:

> On 02/03/2011 12:37 AM, Dick Hollenbeck wrote:
>> Start by conceptually, i.e. algorithmically walking through:
>>  PART* LIB_TABLE::LookupPart( const LPID& aLPID, LIB* aLocalLib )
>> 
>> and conceptually step through that until you end up in
>> 
>>  DIR_LIB_SOURCE::ReadPart()
>> 
>> 
>> This path is basically a matter of resolving the four elements of the LPID.
>> 
>> 
>> LookupPart does work already, and there are some lazy operations that happen
>> only once and only when needed.
>> 
>> When I have more time I will make a main test program for the DSO/DLL.
> 
> 
> Man I love CMake and Linux.  It took only about 5 minutes to park a test
> program on top of libsweet.so.  So now you can single step through the code
> if you are on Linux.  Windows/Mingw might need some additional work but
> nothing significant.
> 
> The test data are generated with a script called
> make-dir-lib-source-test-data.sh, invoked first.
> Then the test program is run from the same directory simply with
> $ ./test_sch_lib_table
> 
> The reported error is correct, since value has not yet been taught to the
> parser, and the parser is that last thing that had run:
> 
> 
> (part tigers/ears (value 22)(footprint SM0805))
>                   ^
> 
> ===<captured output>==================================================
> dick@dick-intel:/svn/kicad/work/new$ ./make-dir-lib-source-test-data.sh
> 
> dick@dick-intel:/svn/kicad/work/new$ md build
> dick@dick-intel:/svn/kicad/work/new$ cd build
> 
> dick@dick-intel:/svn/kicad/work/new/build$ cmake -DCMAKE_BUILD_TYPE=Debug ../
> -- The C compiler identification is GNU
> -- The CXX compiler identification is GNU
> -- Check for working C compiler: /usr/bin/gcc
> -- Check for working C compiler: /usr/bin/gcc -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Check for working CXX compiler: /usr/bin/c++
> -- Check for working CXX compiler: /usr/bin/c++ -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Found Doxygen: /usr/bin/doxygen
> -- Check for installed wxWidgets -- found
> -- Found PythonLibs: /usr/lib/libpython2.6.so
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /svn/kicad/work/new/build
> 
> 
> dick@dick-intel:/svn/kicad/work/new/build$ make
> Scanning dependencies of target sweet
> [  7%] Building CXX object CMakeFiles/sweet.dir/sch_lib_table.cpp.o
> [ 14%] Building CXX object CMakeFiles/sweet.dir/sch_lib_table_keywords.cpp.o
> [ 21%] Building CXX object CMakeFiles/sweet.dir/sch_lib.cpp.o
> [ 28%] Building CXX object CMakeFiles/sweet.dir/sch_lpid.cpp.o
> [ 35%] Building CXX object CMakeFiles/sweet.dir/sch_dir_lib_source.cpp.o
> [ 42%] Building CXX object CMakeFiles/sweet.dir/sch_part.cpp.o
> [ 50%] Building CXX object CMakeFiles/sweet.dir/sweet_keywords.cpp.o
> [ 57%] Building CXX object
> CMakeFiles/sweet.dir/svn/kicad/work/common/richio.cpp.o
> [ 64%] Building CXX object
> CMakeFiles/sweet.dir/svn/kicad/work/common/dsnlexer.cpp.o
> Linking CXX shared library libsweet.so
> [ 78%] Built target sweet
> [ 85%] Swig source
> /svn/kicad/work/new/sch_lib_table.h:202: Warning(312): Nested class not
> currently supported (ignored).
> Scanning dependencies of target _sweet
> [ 92%] Building CXX object CMakeFiles/_sweet.dir/sweetPYTHON_wrap.cxx.o
> Linking CXX shared module _sweet.so
> [ 92%] Built target _sweet
> Scanning dependencies of target test_sch_lib_table
> [100%] Building CXX object
> CMakeFiles/test_sch_lib_table.dir/test_sch_lib_table.cpp.o
> Linking CXX executable test_sch_lib_table
> [100%] Built target test_sch_lib_table
> 
> 
> 
> dick@dick-intel:/svn/kicad/work/new/build$ ./test_sch_lib_table
> test 'Parse() <-> Format()' round tripping:
> (lib_table
>  (lib (logical meparts)(type dir)(full_uri /tmp/eeschema-lib)(options
> useVersioning))
>  (lib (logical old-project)(type schematic)(full_uri
> /tmp/old-schematic.sch)(options ""))
>  (lib (logical www)(type http)(full_uri http://kicad.org/libs)(options ""))
> )
> 
> test a lookup of 'www':
>  (lib (logical www)(type http)(full_uri http://kicad.org/libs)(options ""))
> 
> list of logical libraries:
> logicalName: meparts
> logicalName: old-project
> logicalName: www
> lookupPart:kitties/ears
> lookupPart:kitties/eyes
> lookupPart:kitties/feet
> lookupPart:lions/ears
> lookupPart:lions/eyes
> lookupPart:lions/feet
> lookupPart:tigers/ears
> lookupPart:tigers/eyes
> lookupPart:tigers/feet
> lookupPartRev:rev10
> lookupPartRev:rev5
> lookupPartRev:rev1
> PART::PART(tigers/ears/rev10)
> lookupPartLatestRev:tigers/ears/rev10
> PARSE_ERROR: Expecting 'anchor|value|footprint|model|keywords|alternates
> |property
>  |property_del
> |pin
>  |pin_merge|pin_swap|pin_renum|pin_rename|route_pin_swap
> |polyline|line|rectangle|circle|arc|bezier|text' in input/source
> "meparts:tigers/ears", line 1, offset 20
> from /svn/kicad/work/common/dsnlexer.cpp : Expecting : 291
> (part tigers/ears (value 22)(footprint SM0805))
>                   ^
> dick@dick-intel:/svn/kicad/work/new/build$
> 
> ======================================================================

Sweet!

Sorry, couldn't resist.
/Martijn


Follow ups

References