示例#1
0
        public void SelectProcessor(int procNum, int intervalNum)
        {
            SelectedProc = procNum;
            ClearGPUStackView();
            var inter = LoadedStat.Info.inter[intervalNum];

            //---  If there is no GPU return  ---//
            if (inter.proc_times[procNum].gpu_times == null)
            {
                return;
            }

            //---  Init GPU-cards  ---//
            nfloat maxSize = 0;
            int    i       = 1;

            foreach (var gpu in inter.proc_times[procNum].gpu_times)
            {
                var GPUCardController = storyboard.InstantiateControllerWithIdentifier("GPUId") as GPUViewController;
                GPUCardController.LoadView();
                GPUCardController.Init(gpu, i++);
                GPUStackView.AddView(GPUCardController.View, NSStackViewGravity.Top);
                if (GPUCardController.Height > maxSize)
                {
                    maxSize = GPUCardController.Height;
                }
            }

            GPUStackView.SetFrameSize(new CGSize(675, maxSize * inter.proc_times[procNum].num_gpu + 5));

            if (GPUScrollView.Frame.Height < 10)
            {
                PlotSplitView.SetPositionOfDivider(
                    (nfloat)Math.Max(PlotSplitView.Frame.Height - 250,
                                     PlotSplitView.Frame.Height - GPUStackView.Frame.Height), 0);
            }
            //TODO: Скроллить наверх
            //CGPoint newScrollOrigin;
            //if (GPUScrollView.ContentView.IsFlipped)
            //    newScrollOrigin = new CGPoint(0.0, 0.0);
            //else
            //    newScrollOrigin = new CGPoint(0.0, (GPUScrollView.DocumentView as NSView).Frame.Height -
            //                  GPUScrollView.Frame.Height/2 - 50);
            //    //GPUScrollView.ContentView.ScrollToPoint(new CGPoint(0, maxSize * inter.proc_times[procNum].num_gpu - maxSize));
            //GPUScrollView.ContentView.ScrollToPoint(newScrollOrigin);
        }
示例#2
0
 public void DeselectProcessors()
 {
     SelectedProc = -1;
     ClearGPUStackView();
     PlotSplitView.SetPositionOfDivider(PlotSplitView.Frame.Height, 0);
 }