Ejemplo n.º 1
0
        //copia lista de parametro a la lista de paths
        public static void copiarPath(List <Compuerta> lista_a_copiar)
        {
            Compuerta[] copia = new Compuerta[lista_a_copiar.Count];

            try {
                lista_a_copiar.CopyTo(copia);
            }
            catch (ArgumentException) {
                Console.WriteLine("largo pathTemp" + lista_a_copiar.Count + ", largo copia:" + copia.Length);
            }

            paths.Add(copia.ToList <Compuerta>());
        }
Ejemplo n.º 2
0
        //lee xml, llena lista de compuertas y entradas
        private static void configs()
        {
            XmlTextReader reader = new XmlTextReader(@"C:\Users\Public\ED\circuito1.xml");

            while (reader.Read())
            {
                switch (reader.NodeType)
                {
                case XmlNodeType.Element:

                    switch (reader.Name)
                    {
                    case "Compuertas":

                        compuertaFinal = int.Parse(reader.GetAttribute("CompuertaFinal"));
                        break;

                    case "compuerta":

                        int    id = int.Parse(reader.GetAttribute("id"));
                        string name, delayP1, delayP2, conn;
                        name    = reader.GetAttribute("name");
                        delayP1 = reader.GetAttribute("delayP1");
                        delayP2 = reader.GetAttribute("delayP2");
                        conn    = reader.GetAttribute("conn");
                        int       salida = int.Parse(reader.GetAttribute("salida"));
                        Compuerta temp   = new Compuerta(id, name, delayP1, delayP2, conn, salida);
                        compuertas.Add(temp);
                        break;

                    case "entrada":

                        int    id1 = int.Parse(reader.GetAttribute("id"));
                        string nombre1, conn1;
                        nombre1 = reader.GetAttribute("name");
                        conn1   = reader.GetAttribute("conn");
                        Entrada temp1 = new Entrada(id1, nombre1, conn1);
                        entradas.Add(temp1);
                        break;
                    }

                    break;
                }
            }
        }
Ejemplo n.º 3
0
        //lee xml, llena lista de compuertas y entradas
        private static void configs()
        {
            XmlTextReader reader = new XmlTextReader(@"C:\Users\Public\ED\circuito1.xml");

            while (reader.Read()) {

                switch (reader.NodeType) {

                    case XmlNodeType.Element:

                        switch (reader.Name) {

                            case "Compuertas":

                                compuertaFinal = int.Parse(reader.GetAttribute("CompuertaFinal"));
                                break;

                            case "compuerta":

                                int id = int.Parse(reader.GetAttribute("id"));
                                string name, delayP1, delayP2, conn;
                                name = reader.GetAttribute("name");
                                delayP1 = reader.GetAttribute("delayP1");
                                delayP2 = reader.GetAttribute("delayP2");
                                conn = reader.GetAttribute("conn");
                                int salida = int.Parse(reader.GetAttribute("salida"));
                                Compuerta temp = new Compuerta(id, name, delayP1, delayP2, conn, salida);
                                compuertas.Add(temp);
                                break;

                            case "entrada":

                                int id1 = int.Parse(reader.GetAttribute("id"));
                                string nombre1, conn1;
                                nombre1 = reader.GetAttribute("name");
                                conn1 = reader.GetAttribute("conn");
                                Entrada temp1 = new Entrada(id1, nombre1, conn1);
                                entradas.Add(temp1);
                                break;
                        }

                        break;
                }
            }
        }
Ejemplo n.º 4
0
        //copia lista de parametro a la lista de paths
        public static void copiarPath(List<Compuerta> lista_a_copiar)
        {
            Compuerta[] copia = new Compuerta[lista_a_copiar.Count];

            try {
                lista_a_copiar.CopyTo(copia);
            }
            catch (ArgumentException) {

                Console.WriteLine("largo pathTemp" + lista_a_copiar.Count + ", largo copia:" + copia.Length);
            }

            paths.Add(copia.ToList<Compuerta>());
        }