Пример #1
0
        /// <summary>
        /// precondition: circuit is not null
        /// </summary>
        /// <param name="circuit"></param>
        /// <param name="xmlDocument"></param>
        private static void WriteCircuit(Sketch.Project project, XmlTextWriter xmlDocument)
        {
            xmlDocument.WriteStartElement("circuit");

            SaveToXML.WriteInputOutput(project.inputs, project.outputs, xmlDocument);
            SaveToXML.WriteBehavior(project.behavior, xmlDocument);
            SaveToXML.WriteLogisim(project.saveToCircDoc, xmlDocument);
            xmlDocument.WriteEndElement();
        }
Пример #2
0
        /// <summary>
        /// precondition: circuit is not null
        /// </summary>
        /// <param name="circuit"></param>
        /// <param name="xmlDocument"></param>
        private static void WriteCircuit(CircuitSimLib.Circuit circuit, XmlTextWriter xmlDocument)
        {
            CircuitSimLib.TruthTable truthTable = new CircuitSimLib.TruthTable(circuit);
            xmlDocument.WriteStartElement("circuit");
            List <CircuitSimLib.INPUT>  inputs   = circuit.GlobalInputs;
            List <CircuitSimLib.OUTPUT> outputs  = circuit.GlobalOutputs;
            Dictionary <int, int>       behavior = new Dictionary <int, int>();

            SaveToXML.WriteInputOutput(truthTable, xmlDocument);
            SaveToXML.WriteBehavior(truthTable, xmlDocument);
            xmlDocument.WriteEndElement();
        }