Example #1
0
        /// <summary>
        /// Create and return a randomly-generated BOM data structure.
        /// </summary>
        /// <returns></returns>
        public static MfgBom CreateFakeBOM()
        {
            var bom = new MfgBom()
            {
                Parts = new List <Part>()
            };

            Random random = new Random();

            for (int i = 0; i <= 3; i++)
            {
                var part = new Part()
                {
                    octopart_mpn = Path.GetRandomFileName()
                };
                bom.Parts.Add(part);

                for (int j = 0; j <= 3; j++)
                {
                    var instance = new ComponentInstance()
                    {
                        gme_object_id = random.Next(100000).ToString(),
                        path          = Path.GetRandomFileName()
                    };
                    part.AddInstance(instance);
                }
            }

            return(bom);
        }
Example #2
0
 /// <summary>
 /// Add a ComponentInstance to the list of this part's instances.
 /// </summary>
 /// <param name="instance"></param>
 public void AddInstance(ComponentInstance instance)
 {
     instances_in_design.Add(instance);
 }
        /// <summary>
        /// Create and return a randomly-generated BOM data structure.
        /// </summary>
        /// <returns></returns>
        public static MfgBom CreateFakeBOM()
        {
            var bom = new MfgBom()
            {
                Parts = new List<Part>()
            };

            Random random = new Random();
            for (int i = 0; i <= 3; i++)
            {
                var part = new Part()
                {
                    octopart_mpn = Path.GetRandomFileName()
                };
                bom.Parts.Add(part);

                for (int j = 0; j <= 3; j++)
                {
                    var instance = new ComponentInstance()
                    {
                        gme_object_id = random.Next(100000).ToString(),
                        path = Path.GetRandomFileName()
                    };
                    part.AddInstance(instance);
                }
            }

            return bom;
        }
 /// <summary>
 /// Add a ComponentInstance to the list of this part's instances.
 /// </summary>
 /// <param name="instance"></param>
 public void AddInstance(ComponentInstance instance)
 {
     instances_in_design.Add(instance);
 }