예제 #1
0
        /// <summary>
        /// Create an XML representation of this IC and all nested ICs, recursively.
        /// </summary>
        /// <param name="ic"></param>
        /// <returns></returns>
        public XElement CreateXML(UIGates.IC ic)
        {
            XElement root = new XElement("CircuitGroup");

            root.SetAttributeValue("Version", "1.2");

            TopologicalSort   ts  = new TopologicalSort();
            List <UIGates.IC> ics = ts.Sort(ic, icl);

            foreach (UIGates.IC theic in ics)
            {
                root.Add(CreateCircuitXML(theic));
            }
            return(root);
        }
예제 #2
0
        /// <summary>
        /// Create an XML representation of the circuit in the given gate canvas,
        /// together with ALL ICs in the gate canvas' icl (whether they are referenced or not)
        /// and save the whole thing to a file.
        /// </summary>
        /// <param name="path"></param>
        /// <param name="gc"></param>
        public void Save(string path, GateCanvas gc)
        {
            XElement root = new XElement("CircuitGroup");

            root.SetAttributeValue("Version", "1.2");

            XElement maincircuit = CreateCircuitXML(gc.CreateIC("", GateCanvas.SELECTED_GATES.ALL));

            maincircuit.SetAttributeValue("Name", null);


            TopologicalSort   ts  = new TopologicalSort();
            List <UIGates.IC> ics = ts.Sort(icl, icl);

            foreach (UIGates.IC theic in ics)
            {
                root.Add(CreateCircuitXML(theic));
            }
            root.Add(maincircuit);

            root.Save(path);
        }
예제 #3
0
        /// <summary>
        /// Create an XML representation of the circuit in the given gate canvas,
        /// together with ALL ICs in the gate canvas' icl (whether they are referenced or not)
        /// and save the whole thing to a file.
        /// </summary>
        /// <param name="path"></param>
        /// <param name="gc"></param>
        public void Save(string path, GateCanvas gc)
        {
            XElement root = new XElement("CircuitGroup");
            root.SetAttributeValue("Version", "1.2");

            XElement maincircuit = CreateCircuitXML(gc.CreateIC("", GateCanvas.SELECTED_GATES.ALL));
            maincircuit.SetAttributeValue("Name", null);

            TopologicalSort ts = new TopologicalSort();
            List<UIGates.IC> ics = ts.Sort(icl, icl);
            
            foreach (UIGates.IC theic in ics)
            {
                root.Add(CreateCircuitXML(theic));
            }
            
            root.Add(maincircuit);

            root.Save(path);
        }
예제 #4
0
        /// <summary>
        /// Create an XML representation of this IC and all nested ICs, recursively.
        /// </summary>
        /// <param name="ic"></param>
        /// <returns></returns>
        public XElement CreateXML(UIGates.IC ic)
        {
            XElement root = new XElement("CircuitGroup");
            root.SetAttributeValue("Version", "1.2");

            TopologicalSort ts = new TopologicalSort();
            List<UIGates.IC> ics = ts.Sort(ic, icl);

            foreach (UIGates.IC theic in ics)
            {
                root.Add(CreateCircuitXML(theic));
            }
            return root;
        }