Пример #1
0
        public void visit(CyPhy.Component component)
        {
            Logger.WriteDebug("visit(CyPhy.Component): {0}", component.Path);

            var part = new MfgBom.Bom.Part();

            // Check for a Property called "octopart_mpn"
            var octopart_mpn = component.Children.PropertyCollection.FirstOrDefault(p => p.Name == "octopart_mpn" &&
                                                                                    !String.IsNullOrWhiteSpace(p.Attributes.Value));

            if (octopart_mpn != null)
            {
                part.octopart_mpn = octopart_mpn.Attributes.Value;
            }

            var instance = new MfgBom.Bom.ComponentInstance()
            {
                gme_object_id = component.ID,
                path          = TrimPath(component.Path)
            };

            part.AddInstance(instance);

            bom.AddPart(part);
        }
        public void visit(CyPhy.Component component)
        {
            Logger.WriteDebug("visit(CyPhy.Component): {0}", component.Path);
            
            var part = new MfgBom.Bom.Part();

            // Check for a Property called "octopart_mpn"
            var octopart_mpn = component.Children.PropertyCollection.FirstOrDefault(p => p.Name == "octopart_mpn" &&
                                                                                         !String.IsNullOrWhiteSpace(p.Attributes.Value));
            if (octopart_mpn != null)
            {
                part.octopart_mpn = octopart_mpn.Attributes.Value;
            }
            
            var instance = new MfgBom.Bom.ComponentInstance()
                                {
                                    gme_object_id = component.ID,
                                    path = TrimPath(component.Path)
                                };
            part.AddInstance(instance);
            
            bom.AddPart(part);
        }