Esempio n. 1
0
        public void AddSymbols()
        {
            var classTree = new PrintTreeClass.ClassTree("Class1.Class2");

            classTree.AddSymbol(new PrintTreeClass.PlcSymbol("Variable1", new PrintTreeClass.PlcType("type"), 1, 1, null));
            classTree.AddSymbol(new PrintTreeClass.PlcSymbol("Variable2", new PrintTreeClass.PlcType("type"), 1, 1, null));
            classTree.AddSymbol(new PrintTreeClass.PlcSymbol("Variable1", new PrintTreeClass.PlcType("type"), 1, 1, null));
            Assert.AreEqual(2, classTree.Symbols.Count);
        }
Esempio n. 2
0
        public void AddArray()
        {
            var classTree = new PrintTreeClass.ClassTree("Class1.Class2");

            classTree.AddSymbol(new PrintTreeClass.PlcSymbol("ArrayVariable1", new PrintTreeClass.PlcType("LREAL"), 1, 1, new[] { new PrintTreeClass.ArrayInfo(1, 506) }));
            Assert.AreEqual(1, classTree.Symbols.Count);
            var classRef = new PrintTreeClass();

            classRef.PrintTree(classTree, false, new List <PrintTreeClass.PlcType>());
            Console.WriteLine(PrintTreeClass.PrinterClass.Writer.ToString());
        }