예제 #1
0
        public ChooseInitTask(DataInit step, Settings settings)
        {
            InitializeComponent();
            UpdateTimer timer = new UpdateTimer();
            timer.Start(Sol, grdMain);
            Settings = settings;
            //сохраняем для последующего получения данных

            fStep = step;
            //enumerable - матрица sUse, в виде списка
            //matA - матрица коэффициентов (каждый список - терм точка, а внутри списка - перечень станций)
            var matA = new List<int[]>();
            var pointCount = fStep.GetPointCount();
            var stationCount = fStep.GetStationCount();
            var matB = new int[pointCount];

            for (int i = 0; i < pointCount; i++)
            {
                matB[i] = fStep.GetPointTask(i);
                matA.Add(new int[stationCount]);

                for (int j = 0; j < stationCount; j++)
                {
                    matA[i][j] = fStep.GetPointNumber(j, i);
                }
            }

            pointsUse = matA;
            pointsMax = matB;
            DataContext = this;
            IntLinearEquationSolve.SetParam(pointsUse, pointsMax);
            stationMin = IntLinearEquationSolve.GetMin();
        }
예제 #2
0
        public StationAndPoints(Settings settings)
        {
            InitializeComponent();
            Settings = settings;

            if (!DataInit.IsAvailable())
            {
                Step = new DataInit();
                Step.AddStation();
                Step.AddPoint();
                AddCol(Step.GetPointCount() - 1);
            }
            else
            {
                RepearDataGrid();
            }
            var timer = new UpdateTimer();
            timer.Start(Next, grMain);

            mainGrid.ItemsSource = Step.Stations;
            pointGrid.ItemsSource = Step.PointsTask;
        }
예제 #3
0
        public PointDistribution(DataInit step, Settings settings)
        {
            InitializeComponent();
            Settings = settings;
            grd.Width = 2000;
            Step = step;
            StationCount = 0;
            PointCount = 0;
            DataContext = this;
            foreach (var pt in Step.GetAllPoints())
            {
                PointCount += pt.Num;
            }

            foreach (var st in Step.Stations)
            {
                StationCount += st.Num;
                //foreach (var pt in st.GetAllPoints())
                //{
                //    pointCount += pt.Num*st.Num;
                //}
            }
        }