fritzing / fritzing-parts

Electronic components for use in the Fritzing app (aka the parts library)
http://fritzing.org/parts
Other
505 stars 358 forks source link

Broken part that might confuse Fritzing #371

Open KjellMorgenstern opened 1 year ago

KjellMorgenstern commented 1 year ago

In https://github.com/fritzing/fritzing-app/issues/3904 we suspected that a broken part might leave orphaned connections in the project.

This issue is about detecting such broken parts, possibly adding a check to the CI pipeline for Fritzing parts.

@vanepp If you still have that part or can create a similar one, it would be great to post it here.

vanepp commented 1 year ago

Easy enough to do here is a copy of the broken part

DM860A Stepper Motor Driver-broken.fzpz.zip

(remove the trailing .zip to recover the .fzpz file)

and the error

    <pcbView>
      <layers image="breadboard/prefix0000_911c140c21fa07989d9ddccd6943645a_1_breadboard.svg">
   </layers>

should be

      <layers image="breadboard/prefix0000_911c140c21fa07989d9ddccd6943645a_1_breadboard.svg">
        <layer layerId="breadboard"/>
      </layers>

Here is a copy of a sketch with the bad part in it which when loaded illustrates the problem

Winder-Retrofit01-Breadboard.fzz.zip

(again delete the trailing .zip to keep gitub happy to get the .fzz file.)

On load you get this error

capture

clicking OK loads the sketch but without the motor driver

capture1

The lack of the layerId in pcb causes the part to not be exported to the .fzz file when the sketch is is saved causing a "Unable to find part.prefix0000_911c140c21fa07989d9ddccd6943645a_1.fzp" type error message when the sketch is loaded (and the part is missing from the sketch, breaking the sketch). The fzp file is in the fz file but the actual .fzp file is not present in the .fzz file which means the sketch won't work (it will load but the motor driver part is missing!) I think this will likely only happen with the pcb layer. For some reason we seem to need a renderable (even if invalid and thus not displayed as in this case, used to suppress the part in pcb as opposed to adding inhibit to the .fzp file) layer in pcb. I think we can successfully omit either breadboard or schematic views.