Exemple #1
0
        public static Project SampleProject()
        {
            var def = new DefaultsFor2Pipe
            {
                TillTemp = 65,
                ReturTemp = 45
            };
            var part2_1 = new Part2Pipe(def) {Name = "Exempel 1"};

            var childPipe = new NodePipe2Pipe(def) {Name = "N", Direction = Dir.N};
            childPipe.AddChild(new NodePipe2Radiator(def) {Name = "E2", Direction = Dir.E});
            childPipe.AddChild(new NodePipe2Radiator(def) {Name = "W2", Direction = Dir.W});

            part2_1.Root.AddChild(childPipe);
            part2_1.Root.AddChild(new NodePipe2Radiator(def) {Name = "E", Direction = Dir.E});
            part2_1.Root.AddChild(new NodePipe2Radiator(def) {Name = "W", Direction = Dir.W});

            var part2_2 = new Part2Pipe(def) { Name = "Exempel 2" };

            var childPipe2 = new NodePipe2Pipe(def) { Name = "W", Direction = Dir.N };
            childPipe2.AddChild(new NodePipe2Radiator(def) { Name = "W3", Direction = Dir.W });
            childPipe2.AddChild(new NodePipe2Radiator(def) { Name = "N3", Direction = Dir.N });

            var childPipe3 = new NodePipe2Pipe(def) { Name = "N", Direction = Dir.N };
            childPipe3.AddChild(childPipe2);
            childPipe3.AddChild(new NodePipe2Radiator(def) { Name = "E2", Direction = Dir.E });
            childPipe3.AddChild(new NodePipe2Radiator(def) { Name = "N2", Direction = Dir.N });

            part2_2.Root.AddChild(childPipe3);
            part2_2.Root.AddChild(new NodePipe2Radiator(def) { Name = "E", Direction = Dir.E });
            part2_2.Root.AddChild(new NodePipe2Radiator(def) { Name = "W", Direction = Dir.W });

            var proj = new Project
            {
                Name = "Demoobjekt",
                DefaultFor2Pipe = def,
                P2Pipes = new[] { part2_1, part2_2 }.ToList()
            };

            return proj;
        }
Exemple #2
0
        public void TestTree()
        {
            var def = new DefaultsFor2Pipe
            {
                TillTemp = 65,
                ReturTemp = 45
            };
            var p = new Part2Pipe(def);
            Assert.AreEqual(0, p.Root.Flow);

            var childPipe = new NodePipe2Pipe(def) { Name = "N", Direction = Dir.N };
            childPipe.AddChild(new NodePipe2Radiator(def) { Name = "E2", Direction = Dir.E });
            childPipe.AddChild(new NodePipe2Radiator(def) { Name = "W2", Direction = Dir.W });

            p.Root.AddChild(childPipe);

            p.Root.AddChild(new NodePipe2Radiator(def) { Name = "E", Direction = Dir.E });
            p.Root.AddChild(new NodePipe2Radiator(def) { Name = "W", Direction = Dir.W });

            var chart = Chart.CreateChart(p.Root);
            var commands = new List<ChartGraphicsCommand>();
            chart.Paint(commands, 0, 0);
        }
Exemple #3
0
 public Part2Pipe(DefaultsFor2Pipe defaults)
 {
     Root = new NodePipe2Pipe(defaults);
 }
 public NodePipe2Radiator(DefaultsFor2Pipe defaults)
     : base(defaults)
 {
 }