示例#1
0
    private void GenerateInterViewButtons()
    {
        GameObject prefabButton = GameObject.Find("InterVieweePrefabButton");

        for (int i = 0; i < Data.InterViews.Count; i++)
        {
            InterView interView = Data.InterViews[i];

            GameObject newButton = Instantiate(prefabButton);

            newButton.transform.SetParent(null);

            if (newButton == null)
            {
                interViewButtons.Clear();
                GenerateInterViewButtons();
            }

            interViewButtons.Add(newButton);
            UnityEngine.UI.Button button = newButton.GetComponent <UnityEngine.UI.Button>();
            button.onClick.AddListener(() => HandleInterViewButtonClick(button));

            Text buttonText = (Text)newButton.GetComponentInChildren(typeof(Text));

            buttonText.text = interView.Name;
        }
        foreach (var button in interViewButtons)
        {
            button.transform.SetParent(scrollContent.transform, false);
        }
    }
示例#2
0
        public void InterView_SelectionDidChange(object sender, EventArgs e)
        {
            var item = InterView.ItemAtRow(InterView.SelectedRow) as Interval;

            InterText.Value         = item.Text;
            InterTreePlotView.Model = PlotMaker.ProcLostTimePlot(LoadedStat, this, item.Row, plotStatMaxTime);
            if (SelectedProc >= 0)
            {
                SelectProcessor(SelectedProc, item.Row);
            }
        }
示例#3
0
 partial void ResetLoadStat(NSObject sender)
 {
     DeselectProcessors();
     LoadedStat = null;
     InterTreePlotView.Model = new OxyPlot.PlotModel();
     ((IntervalOutlineDataSource)InterView.DataSource).Intervals.Clear();
     InterView.ReloadData();
     InterTreeSplitView.SetPositionOfDivider(0, 0);
     InterTreeSegmentController.SetSelected(false, 0);
     InterTreeSplitView.SetPositionOfDivider(InterTreeSplitView.Frame.Width, 1);
     InterTreeSegmentController.SetSelected(false, 1);
     InterText.Value           = "";
     LoadStatLabel.StringValue = "";
     LoadStatLabel.Hidden      = true;
 }
示例#4
0
    private void HandleInterViewButtonClick(Button button)
    {
        GameObject mainInterviewcanvas = GameObject.Find("MainInterviewcanvas");
        GameObject interVieweeCanvas   = mainInterviewcanvas.transform.Find("InterVieweeCanvas").gameObject;
        GameObject interViewCanvas     = mainInterviewcanvas.transform.Find("InterViewCanvas").gameObject;

        interVieweeCanvas.SetActive(true);
        interViewCanvas.SetActive(false);

        interVieweeNamePanel = (Text)GameObject.Find("InterVieweeNamePanel").GetComponentInChildren(typeof(Text));
        interVieweeTextPanel = (Text)GameObject.Find("InterVieweeTextPanel").GetComponentInChildren(typeof(Text));

        Text      buttonText = (Text)button.GetComponentInChildren(typeof(Text));
        InterView interView  = Data.InterViews.Find(i => i.Name == buttonText.text);

        interVieweeNamePanel.text = interView.Name;
        interVieweeTextPanel.text = interView.Text;
    }
示例#5
0
        public void SetDataToInterView(Stat stat, int row = 0)
        {
            LoadedStat                = stat;
            LoadStatLabel.Hidden      = false;
            LoadStatLabel.StringValue = stat.GetInfoForStatDir();
            LoadStatLabel.SetFrameSize(LoadStatLabel.FittingSize);
            InitInterTree();
            InterTreePlotView.Model = PlotMaker.ProcLostTimePlot(LoadedStat, this, 0, plotStatMaxTime);
            plotStatMaxTime         = InterTreePlotView.Model.GetAxis("Time").ActualMaximum;
            InterText.Value         = "";
            var intervals = ((IntervalOutlineDataSource)InterView.DataSource).Intervals;

            intervals.Clear();
            intervals.Add(stat.Interval);
            InterView.ReloadData();
            InterView.ExpandItem(InterView.ItemAtRow(0), true);
            InterView.SelectRow(row, false);
        }
示例#6
0
    private void ReadInterViews(string xmlFileAsText)
    {
        XDocument xmlDoc = XDocument.Parse(xmlFileAsText);

        IEnumerable <XElement> interView       = xmlDoc.Root.Element("InteViewSceneData").Elements("InterView").ToList();
        IEnumerable <XElement> interViewSource = xmlDoc.Root.Element("InteViewSceneData").Elements("Data").ToList();

        foreach (XElement interViewXelement in interView)
        {
            string    imageName     = interViewXelement.Element("Image").Value;
            string    buttonText    = interViewXelement.Element("NameText").Value;
            string    interViewText = interViewXelement.Element("InterViewText").Value;
            InterView interViewData = new InterView(imageName, buttonText, interViewText);
            Data.InterViews.Add(interViewData);
        }

        foreach (XElement interViewSourceXelement in interViewSource)
        {
            string source = interViewSourceXelement.Element("Source").Value;

            sourceText.text = source;
        }
    }
        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;
            }
        }