nickoe / kicadocaml

Automatically exported from code.google.com/p/kicadocaml
0 stars 0 forks source link

bug with 'Move modules based on schematic position' #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have kicadocaml built from source - with this change in schematic.ml: 

////
    method componentPositon (ts:string) = (
        (* find the component position *)
        let comp =
            try Some (List.find (fun c ->
                c#getPath () = ts ;
            ) m_components )
            with Not_found -> (Printf.printf "%s comonent not found!\n" ts ; None)
////

I have eeschema with the sch file opened, then I run kicadocaml; I load the 
board; I load the schematic too upon prompt. 

When I try to do 'Move modules based on schematic position' after that; the 
output says: 

...
4F5626E0 comonent not found!
4F5626DF comonent not found!
4F5626DD comonent not found!
...

So, the "timestamp" looked for is, say, 4F5626DF ... searching for that, I 
found in the board file this: 

...
$MODULE SOT23BSV
Po 61250 48750 900 15 4F55FAFD 4F5626DF ~~
Li SOT23BSV
Cd Module CMS SOT23 Transistore EBC
Kw CMS SOT
Sc 4F5626DF
AR /4F4E2AAF
Op 0 0 0
At SMD 
T0 0 -950 300 300 900 75 N V 21 N"Q1"
T1 0 0 300 300 900 75 N I 21 N"N2N4401"
DS -600 -150 600 -150 50 21
DS 600 -150 600 150 50 21
DS 600 150 -600 150 50 21
DS -600 150 -600 -150 50 21
$PAD
...
$EndPAD
$PAD
...
$EndPAD
$PAD
...
$EndPAD
$SHAPE3D
...
$EndSHAPE3D
$EndMODULE  SOT23BSV
...

So, what is being looked for, is the board module "Sc 4F5626DF" argument... And 
the corresponding element in my kicad .sch is this: 

...
$Comp
L N2N4401 Q1
U 1 1 4F4E2AAF
P 10900 17000
F 0 "Qrm_EMPTY1" H 10850 17150 50  0000 C CNN
F 1 "N2N4401" V 11100 17000 50  0000 C CNN
F 2 "SOT23BSV" V 11050 17000 40  0000 C CNN
    1    10900 17000
    -1   0    0    -1  
$EndComp
$Comp
...

Notably, the 4F5626DF doesn't show up anywhere in the schematic - instead, 
there is this "U" element, that has a different signature (4F4E2AAF); however, 
that signature appears in the board module as attribute "AR /4F4E2AAF". 

I am presuming this is a bug with the timestamp checking - but unfortunately, I 
cannot do much about it, as I'm quite dumb with ocaml; I tried, for instance, 
to print out values during iteraton: 

////
        let comp =
            try Some (List.find (fun c ->
                c#getPath () = ts ;
                print_endline "c ts %s\n%!" (c#getTimeStamp ());
            ) m_components )
            with Not_found -> (Printf.printf "%s comonent not found!\n" ts ; None)
////

... and this obviously doesn't work - and I cannot really understand the printf 
syntax in ocaml :( 

Well, hope I can get some suggestions on this, 

Cheers!

Original issue reported on code.google.com by s...@imi.aau.dk on 19 Mar 2012 at 1:55