Example #1
0
        public static InputDataObject CheckInput(UserWindow uWindow)
        {
            var inpDObj = new InputDataObject();
            var checkPassed = true;

            // Проверка геометрических параметров
            var geomVector = new GeometryVector();

            geomVector.L = CheckTextBox(uWindow.lengthTextBox);
            if (geomVector.L == 0) checkPassed = false;
            geomVector.W = CheckTextBox(uWindow.widthTextBox);
            if (geomVector.W == 0) checkPassed = false;
            geomVector.H = CheckTextBox(uWindow.heightTextBox);
            if (geomVector.H == 0) checkPassed = false;

            // Добавление во входной объект
            inpDObj.GeometryVector = geomVector;

            // Проверка режимных параметров
            var modeVector = new ModeVector();
            modeVector.Tu = CheckTextBox(uWindow.temperatureTextBox);
            if (modeVector.Tu == 0) checkPassed = false;
            modeVector.Vu = CheckTextBox(uWindow.velocityTextBox);
            if (modeVector.Vu == 0) checkPassed = false;

            // Добавление во входной объект
            inpDObj.ModeVector = modeVector;

            inpDObj.DiscretizationStep = CheckTextBox(uWindow.stepTextBox);
            if (inpDObj.DiscretizationStep == 0) checkPassed = false;

            return !checkPassed ? null : inpDObj;
        }
Example #2
0
 public void initProcessController()
 {
     uWindow = new UserWindow();
     uWindow.Show();
     processControllerCycleThread = new Thread(processControllerCycle);
     processControllerCycleThread.SetApartmentState(ApartmentState.STA);
     processControllerCycleThread.Start();
 }