issus / bxlsharp Goto Github PK
View Code? Open in Web Editor NEWUltraLibrarian BXL Reader
License: MIT License
UltraLibrarian BXL Reader
License: MIT License
Starting from the Component in the BXL fileallows you to get something resembling a package name (sometimes) from the Component.PatternName which is the footprint name I believe. I've seen a lot that use that to indicate the packaging type, but I think it's something the person that designed has to set, in some cases it's not that useful.
If there is something in the PatternName field, it should be added as a property to the footprint (Pattern) as a new property called PackageName.
Many symbols from Microchip are not parsed correctly, which causes them not to show any pin labels.
We can open a bxl package and look at the pins with:
var data = BxlDocument.ReadFromFile(fileName, BxlFileType.FromExtension, out var logs);
var result = new List<Package>();
foreach (var symbol in data.Symbols)
{
var package = new Package(symbol.Name);
package.Pins.AddRange(
symbol.Data
.Where(d => d is LibPin &&
(d as LibPin).Name.Text.ToUpperInvariant() != "NC" &&
(d as LibPin).Name.Text.ToUpperInvariant() != "DNC")
.Select(d => d as LibPin)
.Select(d => new Pin(d.Designator.Text, d.Name.Text))
);
result.Add(package);
}
Example file: PIC18C452-X_P and many others in https://www.microchip.com/mymicrochip/filehandler.aspx?ddocname=en537519
(PIC18 CAD/CAE Schematic Symbols @ https://www.microchip.com/development-tools/reference-designs/cad-cae-symbols if that link does not work)
This shows the pins with numbers, but with no name.
This is because BXL files are not always consistent apparently. They can sometimes have the name on the Component rather than the symbol pin.
Currently, the way we read pins is:
So as it's a nested loop, for those cases where the pin has no name you could fall back to the Component's Pins
I think it can get the proper pin matching the Symbol's Pin PinNum with the Component's Pin SymPinNum, the descriptor should match but I wouldn't bet on that for all cases.
component.Pins.First(compPin => p.SymPinNum == pin.PinNum)
If the current method does not have a value for the Name property, it should try to match as above.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.