Ejemplo n.º 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);
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 3
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;
        }
Ejemplo n.º 4
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);
 }