Ejemplo n.º 1
0
        async Task Culc()
        {
            if (CheckBoxParallel.IsChecked == true)
            {
                await Task.Run(() =>
                {
                    inputdate.H    = h;
                    inputdate.Tau  = tau;
                    inputdate.Time = time;

                    inputdate.Mass_u = CulcService.ToJagged(u);
                    outputDate       = calcservice.CulcTeploParal(inputdate);
                    u = CulcService.ToMultiD(outputDate.Culc_Teplo);
                });

                draw.draw(u);
            }
            else
            {
                await Task.Run(() =>
                {
                    inputdate.H    = h;
                    inputdate.Tau  = tau;
                    inputdate.Time = time;

                    inputdate.Mass_u = CulcService.ToJagged(u);
                    outputDate       = calcservice.CulcTeploPosl(inputdate);
                    u = CulcService.ToMultiD(outputDate.Culc_Teplo);
                });

                draw.draw(u);
            }
        }
Ejemplo n.º 2
0
        public void calculate()
        {
            double time = 0.2;
            double tau  = 0.1;
            double h    = 1;


            for (int j = 0; j < n; j++) //left
            {
                u[0, j] = Convert.ToInt32(left.Text);
            }

            for (int i = 0; i < n; i++) //bottom
            {
                u[i, n - 1] = Convert.ToInt32(bottom.Text);
            }

            for (int j = 0; j < n; j++) //rigth
            {
                u[n - 1, j] = Convert.ToInt32(right.Text);
            }

            for (int i = 0; i < n; i++) //top
            {
                u[i, 0] = Convert.ToInt32(top.Text);
            }

            //CalcService calcservice = new CalcService();
            CalcServiceClient calcservice = new CalcServiceClient();
            InputDate         inputdate   = new InputDate();
            OutputDate        outputDate  = new OutputDate();

            inputdate.H    = h;
            inputdate.Tau  = tau;
            inputdate.Time = time;

            inputdate.Mass_u = ToJagged(u);

            //outputDate = calcservice.CulcTeploPosl(inputdate);
            outputDate = calcservice.CulcTeploPosl(inputdate);

            u = ToMultiD(outputDate.Culc_Teplo);

            //отрисовка
            plotting(u);
        }
Ejemplo n.º 3
0
        private OutputDate Analyze()
        {
            var listUniqFile1 = this.files1.Where(file => !this.files2.Contains(file)).ToList();
            var listUniqFile2 = this.files2.Where(file => !this.files1.Contains(file)).ToList();
            foreach (var file in listUniqFile1)
            {
                this.files1.Remove(file);
            }

            foreach (var file in listUniqFile2)
            {
                this.files2.Remove(file);
            }

            var listSameFile = new List<string>();
            foreach (var file in this.files1)
            {
                var innerFile1 = this.GetContentFile(@"ShipRequest/" + file + ".DAT");
                var innerFile2 = this.GetContentFile(@"ShipRequest2/" + file + ".DAT");
                if (innerFile1.Count == innerFile2.Count)
                {
                    if (!innerFile1.Where((elem, j) => elem != innerFile2[j]).Any())
                    {
                        listSameFile.Add(file);
                    }
                }
            }

            foreach (var file in listSameFile)
            {
                this.files1.Remove(file);
                this.files2.Remove(file);
            }

            var outputDate = new OutputDate
            {
                ListUniqFile1 = listUniqFile1,
                ListUniqFile2 = listUniqFile2,
                CountSameFile = listSameFile.Count
            };
            return outputDate;
        }