コード例 #1
0
        /// <summary>
        /// Test
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            BrewML b = new BrewML();

            BrewDBContext db = new BrewDBContext();

            WriteDb Report = new WriteDb();

            Plant p = new Plant();


            FluentEQType types = new FluentEQType();

            //types.AddEQType("Pump").Final();
            //types.AddEQType("Valve").Final();
            //types.AddEQType("TempController").Final();
            Console.WriteLine("---------------------------------------------");


            types.AddEQType("Pump");
            types.AddEQType("Valve");
            types.AddEQType("TempController");

            Report.reportit();
            Console.WriteLine("---------------------------------------------");

            FluentPlant pd = new FluentPlant();

//            pd.AddPlant("Little Jakes").Final();
            pd.AddPlant("Little Jakes");


            pd.ForPlant("Little Jakes")
            .HasLoops()
            .AddControlLoop("WaterPump", "Pump")
            .SetSetPoint(215);
//                .Final();

            //Console.WriteLine(pd.GetMessage());
            //Console.WriteLine(pd.ForPlant("Little Jakes").HasLoops("WaterInfeed").GetSetPoint());

            pd.ForPlant("Little Jakes")
            .HasLoops()
            .AddControlLoop("TempControl1", "TempController")
            .SetSetPoint(222);
//                .Final();

            Report.reportit();

            //Console.WriteLine(pd.ForPlant("Little Jakes").HasLoops("TempControl1").GetSetPoint());


            pd.ForPlant("Little Jakes")
            .HasLoops("TempControl1")
            .SetSetPoint(678)
            .HasType("Valve");
//                .Final();

            pd.ForPlant("Little Jakes")
            .HasLoops()
            .AddControlLoop("TempControl122", "TempController")
            .SetSetPoint(678)
            .HasType("Valve");    //// WHAT IS THIS?
            //.Final();

            pd.ForPlant("Little Jakes").HasLoops().ForControlLoop("TempControl1").SetSetPoint(353);

            //Console.WriteLine(pd.ForPlant("Little Jakes").HasLoops("TempControl1").GetSetPoint());

//            pd.AddPlant("Big Jakes").Final();
            pd.AddPlant("Big Jakes");

            pd.ForPlant("Big Jakes")
            .HasLoops()
            .AddControlLoop("ValveXV1321", "Valve")
            .SetSetPoint(33);
//                .Final();

            pd.ForPlant("Big Jakes")
            .HasLoops()
            .AddControlLoop("DumpValve12", "Valve")
            .SetSetPoint(123);
//                .Final();
            //.Final();


            //Console.WriteLine("-------------------");


            pd.ForPlant("Big Jakes")
            .HasLoops("ValveXV1321")
            .SetSetPoint(678)
            .HasType("Valve")
            .SetSetPoint(99);
//                .Final();


            Console.WriteLine("---------------------------------------------");
            Console.WriteLine("-------adding units--------------------------------------");


            FluentUnit fu = new FluentUnit();


            Report.reportUnits();

            //fu.AddUnit("test unit 1","Big Jakes");

            pd.ForPlant("Big Jakes").HasUnits().AddUnit("test unit 1");

            Report.reportUnits();
            pd.ForPlant("Little Jakes").HasUnits().AddUnit("test unit 1");
            Report.reportUnits();
            pd.ForPlant("Big Jakes").HasUnits().AddUnit("test unit 1");
            Report.reportUnits();
            //pd.ForPlant("Little Jakes").HasLoopsInUnit("test unit 1").AddControlLoop("ValveXV1321");

            //fu.ForUnit("test unit 1").HasLoops().AddControlLoop("ValveXV1321");

            pd.ForPlant("Little Jakes").HasUnits().AddUnit("asdfasdf").HasLoops().AddControlLoop("ValveXV1321");

            pd.ForPlant("Big Jakes").HasUnits().AddUnit("asdfaddsdf").HasLoops().AddControlLoop("ValveXV1321x", "Valve");

            pd.ForPlant("Big Jakes").HasUnits().AddUnit("again").HasLoops().AddControlLoop("ValveXV1321xxx", "Valve");
            //Console.WriteLine(pd.ForPlant("Big Jakes").HasLoops("ValveXV1321").GetSetPoint());

            //Console.WriteLine(pd.ForPlant("Big Jakes").HasLoops("ValveXV1321").GetSetPoint());
            Report.reportUnits();
            Console.WriteLine("---------------------------------------------");

            Console.WriteLine("Recipe Test ");


            FluentRecipe rec = new FluentRecipe();

            rec.AddRecipe("Big Eddy")
            .SetBrandDescription("hey this is big stuff")
            .SetQualityTarget("always high quality");
//                .Final();

            rec.ForRecipe("Big Eddy")
            .HasRecOperations()
            .AddOperation("Heat 12")
            .SetSetPoint(33);
//                .Final()
//               .Final();


            rec.AddRecipe("So Smooth")
            .SetQualityTarget("top notch")
            .HasRecOperations()
            .AddOperation("Heat Phase 1")
            .SetSetPoint(170);
            //.Final()
            //.Final();

            rec.ForRecipe("So Smooth")
            .HasRecOperations()
            .AddOperation("heat phase 2")
            .SetSetPoint(33)
            //.HasRecOperations()
            .AddOperation("Heat Phase 3")
            .SetSetPoint(34)
            .AddOperation("test chain 3")
            .SetSetPoint(55);

            //.Final()
            //.Final();

            rec.ForRecipe("So Smooth")
            .HasRecOperations()
            .AddOperation("cool phase 3")
            .SetSetPoint(123)
            //.HasRecOperations()
            .AddOperation("cool phase 4")
            .SetSetPoint(155);
            //.Final().Final();
            Console.WriteLine("-------------------");
            Report.reportMasterRecipes();
            rec.ForRecipe("So Smooth").HasRecOperations().AddAllowedUnits("again");

            Console.WriteLine("-------------------");
            Report.reportMasterRecipes();
            rec.ForRecipe("So Smooth").HasRecOperations("cool phase 3").AddAllowedUnits("asdfasdf").AddAllowedUnits("asdfaddsdf");

            pd.ForPlant("Big Jakes").HasUnits().AddUnit("test2ss3Unit");
            rec.ForRecipe("So Smooth").HasRecOperations("cool phase 3").AddAllowedUnits("test2ss3Unit");

            rec.ForRecipe("So Smooth").HasRecOperations("cool phase 3").AddAllowedUnits("test unit 1").AddAllowedUnits("asdfaddsdf");
            Console.WriteLine("-------------------");
            Report.reportMasterRecipes();
            rec.ForRecipe("So Smooth").HasRecOperations().AddAllowedUnits("test unit 1");


            rec.ForRecipe("Big Eddy")
            .HasRecOperations()
            .AddOperation("Heat 33")
            .SetSetPoint(33);
            Console.WriteLine("-------------------");
            Report.reportMasterRecipes();
            Console.WriteLine("-------------------");

            Console.WriteLine("-------------------");

            Console.WriteLine("-------------------");


            Report.reportit();


            Report.reportPlants();
            Console.WriteLine("-------------------");

            Console.WriteLine("-------------------");

            Console.WriteLine("-------------------");
            Report.reportMasterRecipes();
            Console.WriteLine("hit key");
            var name = Console.ReadLine();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: JamesClark99/BrewMLLib
        /// <summary>
        /// Test
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            BrewML b = new BrewML();

            BrewDBContext db = new BrewDBContext();

            WriteDb Report = new WriteDb();

            Plant p = new Plant();

            FluentEQType types = new FluentEQType();

            types.AddEQType("Pump").Final();
            types.AddEQType("Valve").Final();
            types.AddEQType("TempController").Final();

            Report.reportit();

            FluentPlant pd = new FluentPlant();

            pd.AddPlant("Little Jakes").Final();

            pd.ForPlant("Little Jakes")
                .HasLoops()
                .AddControlLoop("WaterPump","Pump")
                .SetSetPoint(215)
                .Final();

            //Console.WriteLine(pd.GetMessage());
            //Console.WriteLine(pd.ForPlant("Little Jakes").HasLoops("WaterInfeed").GetSetPoint());

            pd.ForPlant("Little Jakes")
                .HasLoops()
                .AddControlLoop("TempControl1", "TempController")
                .SetSetPoint(222)
                .Final();

            Report.reportit();

            //Console.WriteLine(pd.ForPlant("Little Jakes").HasLoops("TempControl1").GetSetPoint());

            pd.ForPlant("Little Jakes")
                .HasLoops("TempControl1")
                .SetSetPoint(678)
                .HasType("Valve")
                .Final();

            pd.ForPlant("Little Jakes").HasLoops().ForControlLoop("TempControl1").SetSetPoint(33).Final();

            //Console.WriteLine(pd.ForPlant("Little Jakes").HasLoops("TempControl1").GetSetPoint());

            pd.AddPlant("Big Jakes").Final();

            pd.ForPlant("Big Jakes")
                .HasLoops()
                .AddControlLoop("ValveXV1321", "Valve")
                .SetSetPoint(33)
                .Final()
                .HasLoops()
                .AddControlLoop("DumpValve12", "Valve")
                .SetSetPoint(123)
                .Final()
                .Final();

            //Console.WriteLine("-------------------");

            pd.ForPlant("Big Jakes")
                .HasLoops("ValveXV1321")
                .SetSetPoint(678)
                .HasType("Valve")
                .SetSetPoint(99)
                .Final();

            //Console.WriteLine(pd.ForPlant("Big Jakes").HasLoops("ValveXV1321").GetSetPoint());

            //Console.WriteLine(pd.ForPlant("Big Jakes").HasLoops("ValveXV1321").GetSetPoint());

            Console.WriteLine("-------------------");
            Console.WriteLine("Recipe Test ");

            FluentRecipe rec = new FluentRecipe();

            rec.AddRecipe("Big Eddy")
                .SetBrandDescription("hey this is big stuff")
                .SetQualityTarget("always high quality")
                .Final();

            rec.ForRecipe("Big Eddy")
                .HasRecOperations()
                .AddOperation("Heat 12")
                .SetSetPoint(33)
                .Final()
                .Final();

            rec.AddRecipe("So Smooth")
                .SetQualityTarget("top notch")
                .HasRecOperations()
                .AddOperation("Heat Phase 1")
                .SetSetPoint(170)
                .Final()
                .Final();

            rec.ForRecipe("So Smooth")
                .HasRecOperations()
                .AddOperation("heat phase 2")
                .SetSetPoint(33)
                .Final()
                .HasRecOperations()
                .AddOperation("Heat Phase 3")
                .SetSetPoint(34)
                .Final()
                .Final();

            rec.ForRecipe("So Smooth")
                .HasRecOperations()
                .AddOperation("cool phase 3")
                .SetSetPoint(123)
                .Final()
                .HasRecOperations()
                .AddOperation("cool phase 4")
                .SetSetPoint(155).Final().Final();

            Console.WriteLine("-------------------");

            Console.WriteLine("-------------------");

            Console.WriteLine("-------------------");

            Report.reportit();

            Console.WriteLine("hit key");
            var name = Console.ReadLine();
        }