public AggregationInspector(RawEventClient client, HeatmapAggregator aggregator)
        {
            m_Aggregator     = aggregator;
            m_RawEventClient = client;

            // Restore cached paths
            m_RawDataPath = EditorPrefs.GetString(k_UrlKey);

            // Set dates based on today (should this be cached?)
            m_EndDate   = String.Format("{0:yyyy-MM-dd}", DateTime.Now);
            m_StartDate = String.Format("{0:yyyy-MM-dd}", DateTime.Now.Subtract(new TimeSpan(5, 0, 0, 0)));

            // Restore other options
            m_Space          = EditorPrefs.GetFloat(k_SpaceKey) == 0 ? k_DefaultSpace : EditorPrefs.GetFloat(k_SpaceKey);
            m_Time           = EditorPrefs.GetFloat(k_KeyToTime) == 0 ? k_DefaultTime : EditorPrefs.GetFloat(k_KeyToTime);
            m_Angle          = EditorPrefs.GetFloat(k_AngleKey) == 0 ? k_DefaultAngle : EditorPrefs.GetFloat(k_AngleKey);
            m_AggregateTime  = EditorPrefs.GetBool(k_AggregateTimeKey);
            m_AggregateAngle = EditorPrefs.GetBool(k_AggregateAngleKey);

            // Restore list of events
            string loadedEvents = EditorPrefs.GetString(k_EventsKey);

            string[] eventsList;
            if (string.IsNullOrEmpty(loadedEvents))
            {
                eventsList = new string[] { };
            }
            else
            {
                eventsList = loadedEvents.Split('|');
            }
            m_Events = new List <string>(eventsList);
        }
        public AggregationInspector(RawEventClient client, HeatmapAggregator aggregator)
        {
            m_Aggregator = aggregator;
            m_RawEventClient = client;

            // Restore cached paths
            m_RawDataPath = EditorPrefs.GetString(k_UrlKey);

            // Set dates based on today (should this be cached?)
            m_EndDate = String.Format("{0:yyyy-MM-dd}", DateTime.Now);
            m_StartDate = String.Format("{0:yyyy-MM-dd}", DateTime.Now.Subtract(new TimeSpan(5, 0, 0, 0)));

            // Restore other options
            m_Space = EditorPrefs.GetFloat(k_SpaceKey) == 0 ? k_DefaultSpace : EditorPrefs.GetFloat(k_SpaceKey);
            m_Time = EditorPrefs.GetFloat(k_KeyToTime) == 0 ? k_DefaultTime : EditorPrefs.GetFloat(k_KeyToTime);
            m_Angle = EditorPrefs.GetFloat(k_AngleKey) == 0 ? k_DefaultAngle : EditorPrefs.GetFloat(k_AngleKey);
            m_AggregateTime = EditorPrefs.GetBool(k_AggregateTimeKey);
            m_AggregateAngle = EditorPrefs.GetBool(k_AggregateAngleKey);

            // Restore list of events
            string loadedEvents = EditorPrefs.GetString(k_EventsKey);
            string[] eventsList;
            if (string.IsNullOrEmpty(loadedEvents))
            {
                eventsList = new string[]{ };
            }
            else
            {
                eventsList = loadedEvents.Split('|');
            }
            m_Events = new List<string>(eventsList);
        }
Exemplo n.º 3
0
 public HeatmapDataProcessor()
 {
     m_ViewModel          = new HeatmapViewModel();
     m_Aggregator         = new HeatmapAggregator(m_RawDataPath);
     m_DataParser         = new HeatmapDataParser();
     m_InspectorViewModel = HeatmapInspectorViewModel.GetInstance();
     m_InspectorViewModel.SettingsChanged += OnSettingsUpdate;
 }
        public AggregationInspector(HeatmapAggregator aggregator)
        {
            m_Aggregator = aggregator;

            // Restore cached paths
            m_RawDataPath       = EditorPrefs.GetString(k_UrlKey);
            m_UseCustomDataPath = EditorPrefs.GetBool(k_UseCustomDataPathKey);
            m_DataPath          = EditorPrefs.GetString(k_DataPathKey);

            // Set dates based on today (should this be cached?)
            m_EndDate   = String.Format("{0:yyyy-MM-dd}", DateTime.UtcNow);
            m_StartDate = String.Format("{0:yyyy-MM-dd}", DateTime.UtcNow.Subtract(new TimeSpan(5, 0, 0, 0)));

            // Restore other options
            m_Space                = EditorPrefs.GetFloat(k_SpaceKey) == 0 ? k_DefaultSpace : EditorPrefs.GetFloat(k_SpaceKey);
            m_Time                 = EditorPrefs.GetFloat(k_KeyToTime) == 0 ? k_DefaultTime : EditorPrefs.GetFloat(k_KeyToTime);
            m_Rotation             = EditorPrefs.GetFloat(k_RotationKey) == 0 ? k_DefaultRotation : EditorPrefs.GetFloat(k_RotationKey);
            m_SmoothSpaceToggle    = EditorPrefs.GetInt(k_SmoothSpaceKey);
            m_SmoothTimeToggle     = EditorPrefs.GetInt(k_SmoothTimeKey);
            m_SmoothRotationToggle = EditorPrefs.GetInt(k_SmoothRotationKey);
            m_SeparateUsers        = EditorPrefs.GetBool(k_SeparateUsersKey);
            m_RemapColor           = EditorPrefs.GetBool(k_RemapColorKey);
            m_RemapColorField      = EditorPrefs.GetString(k_RemapColorFieldKey);
            m_RemapOptionIndex     = EditorPrefs.GetInt(k_RemapOptionIndexKey);

            // Restore list of arbitrary separation fields
            string loadedArbitraryFields = EditorPrefs.GetString(k_ArbitraryFieldsKey);

            string[] arbitraryFieldsList;
            if (string.IsNullOrEmpty(loadedArbitraryFields))
            {
                arbitraryFieldsList = new string[] { };
            }
            else
            {
                arbitraryFieldsList = loadedArbitraryFields.Split('|');
            }
            m_ArbitraryFields = new List <string>(arbitraryFieldsList);


            var unionIcon  = lightSkinUnionIcon;
            var smoothIcon = lightSkinNumberIcon;
            var noneIcon   = lightSkinNoneIcon;

            if (EditorPrefs.GetInt("UserSkin") == 1)
            {
                unionIcon  = darkSkinUnionIcon;
                smoothIcon = darkSkinNumberIcon;
                noneIcon   = darkSkinNoneIcon;
            }

            m_SmootherOptionsContent = new GUIContent[] {
                new GUIContent(smoothIcon, "Smooth to value"),
                new GUIContent(noneIcon, "No smoothing"),
                new GUIContent(unionIcon, "Unify all")
            };
        }
 public static AggregationInspector Init(HeatmapAggregator aggregator)
 {
     return(new AggregationInspector(aggregator));
 }
 public static AggregationInspector Init(RawEventClient client, HeatmapAggregator aggregator)
 {
     return(new AggregationInspector(client, aggregator));
 }
 public static AggregationInspector Init(RawEventClient client, HeatmapAggregator aggregator)
 {
     return new AggregationInspector(client, aggregator);
 }