예제 #1
0
        static void Main(string[] args)
        {
            var water  = new WaterManagingSubsystem();
            var thermo = new Thermo();
            var engine = new Engine();
            var dryer  = new Dryer();

            var washingMachine = new WashingMachine.WashingMachine(dryer, engine, thermo, water);

            // Cotton
            Console.WriteLine("Cotton");
            washingMachine.WashCotton();

            // Wool
            Console.WriteLine("Wool");
            washingMachine.WashWool();

            int temp = washingMachine.GetTemperature();

            // 1. принадлежат самому объекту
            // 2. методы объектов параметров
            // 3. созданы внутри метода
            // 4. поля текущего объекта

            Console.ReadLine();
        }
예제 #2
0
        public static object[,] Thermo_CEA([ExcelArgument("temperature, C")] double t, [ExcelArgument("specie name")] string spName)
        {
            object otdr = ML.CallHandler.ThermoJANAF(spName, t);

            if (otdr.GetType() != typeof(Thermo.ThermoDataRecord))
            {
                object[] retS = new object[1];
                retS[0] = otdr;
                return(myExcelInt.retRowArray(retS));
            }

            Thermo.ThermoDataRecord tdr = (Thermo.ThermoDataRecord)otdr;
            object[] ret     = new object[7];
            int      spIndex = Thermo.findSpecieIndex(spName);

            ret[0] = tdr.cP;
            ret[1] = tdr.hHTRef / 1000;
            ret[2] = tdr.s;
            ret[3] = tdr.gHTRef_T;
            ret[4] = Thermo.allSpecies[spIndex].heatForm / 1000 + tdr.hHTRef / 1000;
            ret[5] = tdr.deltaHf / 1000;
            ret[6] = tdr.log10Kf;

            return(myExcelInt.retRowArray(ret));
        }
예제 #3
0
 public WashingMachine(WashManagingSubsystem water, Thermo thermo, Engine engine, Dryer dryer)
 {
     _water  = water;
     _thermo = thermo;
     _engine = engine;
     _dryer  = dryer;
 }
예제 #4
0
 public double getTemperature()
 {
     if (Thermo == null)
     {
         return(Double.NaN);
     }
     return(Thermo.Measure());
 }
예제 #5
0
파일: UnitTest1.cs 프로젝트: dmuromkin/WPF
        public void LoggerTest()//logger test
        {
            double[,,] check = new double[10, 10, 10];
            double  time  = 1;
            double  tau   = 0.1;
            double  h     = 1;
            ILogger log   = new NLogAdapter();
            Thermo  teplo = new Thermo(log);

            teplo.PoslCulс3D(check, time, tau, h);
            log = teplo._Logger;
            Assert.AreNotEqual(log, null);
        }
예제 #6
0
        public OutputDate3D CulcTeploParal3D(InputDate3D inputDate)
        {
            OutputDate3D mass_data = new OutputDate3D();

            double[,,] array1 = ToMulti3D(inputDate.Mass_u);

            double  h     = inputDate.H;
            double  time  = inputDate.Time;
            double  tau   = inputDate.Tau;
            ILogger log   = new NLogAdapter();
            Thermo  teplo = new Thermo(log);

            double[,,] array2    = teplo.ЗDParalCulc(array1, time, tau, h);
            mass_data.Culc_Teplo = ToJagged3D(array2);
            return(mass_data);
        }
예제 #7
0
        public OutputDate CulcTeploPosl(InputDate inputDate)
        {
            OutputDate mass_data = new OutputDate();

            double[,] array1 = ToMultiD(inputDate.Mass_u);

            double  h     = inputDate.H;
            double  time  = inputDate.Time;
            double  tau   = inputDate.Tau;
            ILogger log   = new NLogAdapter();
            Thermo  teplo = new Thermo(log);

            double[,] array2 = teplo.PoslCulc(array1, time, tau, h);

            mass_data.Culc_Teplo = ToJagged(array2);
            return(mass_data);
        }
예제 #8
0
        static void Main(string[] args)
        {
            var water  = new WaterManagingSubsystem();
            var thermo = new Thermo();
            var engine = new Engine();
            var dryer  = new Dryer();

            var washingMachine = new WashingMachine.WashingMachine(dryer, engine, thermo, water);

            Console.WriteLine("Cotton");
            washingMachine.WashCotton();

            Console.WriteLine("Wool");
            washingMachine.WashWool();

            Console.ReadLine();
        }
예제 #9
0
파일: UnitTest1.cs 프로젝트: dmuromkin/WPF
        public void CalculationTest()//calculation test
        {
            int n = 10;

            double[,,] test   = new double[n, n, n];
            double[,,] actual = new double[n, n, n];
            test   = initial();
            actual = initial();
            ILogger log   = new NLogAdapter();
            Thermo  teplo = new Thermo(log);
            double  time  = 1;
            double  tau   = 0.1;
            double  h     = 1;

            teplo.PoslCulс3D(test, time, tau, h);
            Assert.AreNotEqual(test, actual);
        }
예제 #10
0
        static void Main(string[] args)
        {
            var water  = new WaterManagingSubsystem();
            var thermo = new Thermo();
            var engine = new Engine();
            var dryer  = new Dryer();

            var washingMachine = new WashingMachine.WashingMachine(dryer, engine, thermo, water);

            Console.WriteLine();
            Console.WriteLine("\t\t\t\t\t\tForm");
            washingMachine.WashForm();

            Console.WriteLine();
            Console.WriteLine("\t\t\t\t\t\tSneakers");
            washingMachine.WashSneakers();

            int temp = washingMachine.GetTemperature();

            Console.ReadKey();
        }
예제 #11
0
        public object Clone()
        {
            WeatherStation cl = new WeatherStation(Name, loc);

            if (Thermo != null)
            {
                cl.Insert((Thermometer)Thermo.Clone());
            }
            if (Anemo != null)
            {
                cl.Insert((WindMeter)Anemo.Clone());
            }
            if (Bar != null)
            {
                cl.Insert((Barometer)Bar.Clone());
            }
            if (Hygro != null)
            {
                cl.Insert((Hygrometer)Hygro.Clone());
            }

            return(cl);
        }