Example #1
0
    public bool Load(string filename)
    {
        m_hanoiData = null;
        GraphItLuaPro.Clear();
        try
        {
            string text = System.IO.File.ReadAllText(filename);
            HanoiNode.s_count = 0;

            m_hanoiData           = new HanoiRoot();
            m_hanoiData.callStats = new HanoiNode(null);

            //invaild json doc ,convert correct;
            string templateJsonText         = "[$$]";
            var    resovleSessionJsonResult = handleSessionJsonObj(new JSONObject(templateJsonText.Replace("$$", text)));
            if (resovleSessionJsonResult != null)
            {
                m_hanoiData.callStats.Children.AddRange(resovleSessionJsonResult.DetailResult);
                var dataInfoMap = resovleSessionJsonResult.NavigateResult;
                GraphItLuaPro.Log(HanoiData.GRAPH_TIMECONSUMING, HanoiData.SUBGRAPH_LUA_TIMECONSUMING_INCLUSIVE, dataInfoMap[HanoiData.SUBGRAPH_LUA_TIMECONSUMING_INCLUSIVE]);
                GraphItLuaPro.Log(HanoiData.GRAPH_TIMECONSUMING, HanoiData.SUBGRAPH_LUA_TIMECONSUMING_EXCLUSIVE, dataInfoMap[HanoiData.SUBGRAPH_LUA_TIMECONSUMING_EXCLUSIVE]);
                GraphItLuaPro.Log(HanoiData.GRAPH_TIME_PERCENT, HanoiData.SUBGRAPH_LUA_PERCENT_INCLUSIVE, dataInfoMap[HanoiData.SUBGRAPH_LUA_PERCENT_INCLUSIVE]);
                GraphItLuaPro.Log(HanoiData.GRAPH_TIME_PERCENT, HanoiData.SUBGRAPH_LUA_PERCENT_EXCLUSIVE, dataInfoMap[HanoiData.SUBGRAPH_LUA_PERCENT_EXCLUSIVE]);
            }
            Debug.LogFormat("reading {0} objects.", HanoiNode.s_count);
        }
        catch (Exception e)
        {
            Debug.LogException(e);
            return(false);
        }
        return(true);
    }
Example #2
0
 private void ClearHanoiRoot()
 {
     GraphItLuaPro.Clear();
     m_data.m_hanoiData                = new HanoiRoot();
     m_data.Root.callStats             = new HanoiNode(null);
     GraphItWindowLuaPro.MouseXOnPause = -1;
 }