Ejemplo n.º 1
0
        partial void CompareStat(NSObject sender)
        {
            var SelectedRowsArray = StatTableView.SelectedRows.ToArray();

            if (SelectedRowsArray.Length < 2)
            {
                Alert.MessageText = "Пожалуйста, выберите " +
                                    "2 или более записи для сравнения.";
                Alert.RunModal();
                return;
            }
            plotView.Model = null;
            CompareList.Clear();
            var StatDirs = ((StatTableDataSource)StatTableView.DataSource).StatDirs;

            try {
                foreach (var i in SelectedRowsArray)
                {
                    CompareList.Add(new Stat(StatDirs[(int)i].ReadJson(),
                                             Path.GetDirectoryName(StatDirs[(int)i].path)));
                }
            } catch (Exception e)
            {
                Console.WriteLine("Got one!\n" + e);
                CompareList.Clear();
                foreach (var i in SelectedRowsArray)
                {
                    CompareList.Add(new Stat(StatDirs[(int)i].ReadJson(),
                                             Path.GetDirectoryName(StatDirs[(int)i].path)));
                }
            }
            CompareList.BuildIntervalsList();

            //---  Hide label and set plot  ---//
            ChooseLabel.Hidden            = true;
            CompareSort.Enabled           = true;
            CompareDiagramSelect.Enabled  = true;
            IntervalCompareButton.Enabled = true;
            plotView.Model     = PlotMaker.LostTimeComparePlot();
            plotCompareMaxTime = plotView.Model.GetAxis("Time").ActualMaximum;
            ((IntervalCompareOutlineDelegate)CompareIntervalTree.Delegate).maxTimeLost = plotCompareMaxTime;

            //---  Set CompareIntervalTree  ---//
            CompareSplitView.SetPositionOfDivider(CompareSplitView.Frame.Width - 300, 0);
            ((IntervalOutlineDataSource)CompareIntervalTree.DataSource).Intervals.Clear();
            ((IntervalOutlineDataSource)CompareIntervalTree.DataSource).Intervals
            .Add(CompareList.List[0].Interval);
            CompareIntervalTree.ReloadData();
            CompareIntervalTree.ExpandItem(CompareIntervalTree.ItemAtRow(0), true);
            CompareIntervalTree.SelectRow(0, false);
            CompareSplitView.SetPositionOfDivider(CompareSplitView.Frame.Width, 0);
            IntervalCompareButton.State = NSCellStateValue.Off;

            //--- Switch tab  ---//
            TabView.SelectAt(2);
        }
Ejemplo n.º 2
0
 private void IntervalCompareButton_Activated(object sender, EventArgs e)
 {
     if (IntervalCompareButton.State == NSCellStateValue.On)
     {
         CompareSplitView.SetPositionOfDivider(0, 0);
         CompareSplitView.SetPositionOfDivider(CompareSplitView.Frame.Width - 200, 0);
     }
     else
     {
         CompareSplitView.SetPositionOfDivider(CompareSplitView.Frame.Width, 0);
         CompareIntervalTree.SelectRow(0, false);
     }
 }
Ejemplo n.º 3
0
 partial void CompareReset(NSObject sender)
 {
     plotView.Model                = null;
     CompareSort.Enabled           = false;
     CompareDiagramSelect.Enabled  = false;
     IntervalCompareButton.Enabled = false;
     IntervalCompareButton.State   = NSCellStateValue.Off;
     CompareDiagramSelect.SelectItem(0);
     CompareSort.SelectItem(0);
     ChooseLabel.Hidden = false;
     ((IntervalCompareOutlineDelegate)CompareIntervalTree.Delegate).maxTimeLost = -1;
     ((IntervalCompareOutlineDelegate)CompareIntervalTree.Delegate).maxTimeGPU  = -1;
     ((IntervalOutlineDataSource)CompareIntervalTree.DataSource).Intervals.Clear();
     CompareIntervalTree.ReloadData();
     CompareSplitView.SetPositionOfDivider(CompareSplitView.Frame.Width, 0);
 }
Ejemplo n.º 4
0
        void ReleaseDesignerOutlets()
        {
            if (LoadStatLabel != null)
            {
                LoadStatLabel.Dispose();
                LoadStatLabel = null;
            }

            if (ChooseLabel != null)
            {
                ChooseLabel.Dispose();
                ChooseLabel = null;
            }

            if (CompareDiagramSelect != null)
            {
                CompareDiagramSelect.Dispose();
                CompareDiagramSelect = null;
            }

            if (CompareIntervalTree != null)
            {
                CompareIntervalTree.Dispose();
                CompareIntervalTree = null;
            }

            if (CompareSort != null)
            {
                CompareSort.Dispose();
                CompareSort = null;
            }

            if (CompareSplitView != null)
            {
                CompareSplitView.Dispose();
                CompareSplitView = null;
            }

            if (GPUPlotView != null)
            {
                GPUPlotView.Dispose();
                GPUPlotView = null;
            }

            if (GPUScrollView != null)
            {
                GPUScrollView.Dispose();
                GPUScrollView = null;
            }

            if (GPUStackView != null)
            {
                GPUStackView.Dispose();
                GPUStackView = null;
            }

            if (InterText != null)
            {
                InterText.Dispose();
                InterText = null;
            }

            if (InterTreePlotView != null)
            {
                InterTreePlotView.Dispose();
                InterTreePlotView = null;
            }

            if (InterTreeSegmentController != null)
            {
                InterTreeSegmentController.Dispose();
                InterTreeSegmentController = null;
            }

            if (InterTreeSplitView != null)
            {
                InterTreeSplitView.Dispose();
                InterTreeSplitView = null;
            }

            if (IntervalCompareButton != null)
            {
                IntervalCompareButton.Dispose();
                IntervalCompareButton = null;
            }

            if (InterView != null)
            {
                InterView.Dispose();
                InterView = null;
            }

            if (PlotSplitView != null)
            {
                PlotSplitView.Dispose();
                PlotSplitView = null;
            }

            if (plotView != null)
            {
                plotView.Dispose();
                plotView = null;
            }

            if (StatPath != null)
            {
                StatPath.Dispose();
                StatPath = null;
            }

            if (StatTableView != null)
            {
                StatTableView.Dispose();
                StatTableView = null;
            }

            if (TableHeader != null)
            {
                TableHeader.Dispose();
                TableHeader = null;
            }

            if (TabView != null)
            {
                TabView.Dispose();
                TabView = null;
            }
        }