private void LoadDependencyCache(bool update = true)
        {
            _nodeDependencyLookupContext.Reset();

            ResolverUsageDefinitionList resolverUsageDefinitionList = CreateCacheUsageList();

            ProgressBase progress = new ProgressBase(null);

            progress.SetProgressFunction((title, info, value) => EditorUtility.DisplayProgressBar(title, info, value));

            NodeDependencyLookupUtility.LoadDependencyLookupForCaches(_nodeDependencyLookupContext, resolverUsageDefinitionList, progress, true, update);

            SetNodeHandlerContext();
        }
Esempio n. 2
0
        public void Update(ProgressBase progress)
        {
            AddressableAssetSettings settings = UnityEditor.AddressableAssets.AddressableAssetSettingsDefaultObject.Settings;

            if (settings == null)
            {
                return;
            }

            Lookup.Clear();
            Nodes = new IResolvedNode[0];

            List <IResolvedNode> nodes = new List <IResolvedNode>();

            foreach (AddressableAssetGroup group in settings.groups)
            {
                AddressableAssetGroupDependencyNode node = new AddressableAssetGroupDependencyNode();
                node.groupId = group.Name;

                int i = 0;

                foreach (AddressableAssetEntry addressableAssetEntry in group.entries)
                {
                    List <AddressableAssetEntry> entries = new List <AddressableAssetEntry>();
                    addressableAssetEntry.GatherAllAssets(entries, true, true, false);

                    foreach (AddressableAssetEntry assetEntry in entries)
                    {
                        string assetId       = NodeDependencyLookupUtility.GetAssetIdForAsset(assetEntry.MainAsset);
                        string componentName = "GroupUsage " + i++;
                        node.Dependencies.Add(new Dependency(assetId, "AddressableGroupUsage", "Asset", new [] { new PathSegment(componentName, PathSegmentType.Property), }));
                    }
                }

                nodes.Add(node);
                Lookup.Add(node.Id, node);
            }

            Nodes = nodes.ToArray();
        }
Esempio n. 3
0
        protected void LoadProgress(string userId, string firstName, ProgressBase progress)
        {
            try
            {
                using (IDynamoDBContext context = Factory.DynamoDBContext)
                {
                    Factory.Logger.Log("Loading User");

                    progress.User = context.LoadAsync <WeighInUser>(userId, firstName).Result;

                    if (progress.User == null)
                    {
                        Factory.Logger.Log("User not found");
                        throw new WeighInException($"User \"{userId},{firstName}\" not found");
                    }

                    Factory.Logger.Log("User loaded");

                    DateTime             week1Start = DateTime.Today.AddDays(-6);
                    DateTime             week1End   = DateTime.Today;
                    IEnumerable <object> week1      = (new List <object>()
                    {
                        week1Start, week1End
                    });

                    DateTime             week2Start = week1Start.AddDays(-7);
                    DateTime             week2End   = week1End.AddDays(-7);
                    IEnumerable <object> week2      = (new List <object>()
                    {
                        week2Start, week2End
                    });

                    DateTime             week3Start = week2Start.AddDays(-7);
                    DateTime             week3End   = week2End.AddDays(-7);
                    IEnumerable <object> week3      = (new List <object>()
                    {
                        week3Start, week3End
                    });

                    DateTime             week4Start = week3Start.AddDays(-7);
                    DateTime             week4End   = week3End.AddDays(-7);
                    IEnumerable <object> week4      = (new List <object>()
                    {
                        week4Start, week4End
                    });

                    Factory.Logger.Log("Loading Weights Week 1");

                    progress.WeightsLastWeek = context.QueryAsync <WeighInWeight>(progress.User.UserKey, QueryOperator.Between, week1).GetRemainingAsync().Result.Select(W => W.Weight).ToList();

                    Factory.Logger.Log("Loading Weights Week 2");

                    progress.Weights2WeeksAgo = context.QueryAsync <WeighInWeight>(progress.User.UserKey, QueryOperator.Between, week2).GetRemainingAsync().Result.Select(W => W.Weight).ToList();

                    Factory.Logger.Log("Loading Weights Week 3");

                    progress.Weights3WeeksAgo = context.QueryAsync <WeighInWeight>(progress.User.UserKey, QueryOperator.Between, week3).GetRemainingAsync().Result.Select(W => W.Weight).ToList();

                    Factory.Logger.Log("Loading Weights Week 4");

                    progress.Weights4WeeksAgo = context.QueryAsync <WeighInWeight>(progress.User.UserKey, QueryOperator.Between, week4).GetRemainingAsync().Result.Select(W => W.Weight).ToList();

                    Factory.Logger.Log("4 weeks loaded");
                }
            }
            catch (Exception ex)
            {
                Factory.Logger.Log($"Error getting Progress with userId=\"{userId}\" and firstName=\"{firstName}\"");
                Factory.Logger.Log(ex.Message);
                Factory.Logger.Log(ex.StackTrace);
                throw new WeighInException(ex.Message);
            }
        }
Esempio n. 4
0
 public bool NeedsUpdate(ProgressBase progress)
 {
     return(true);
 }
Esempio n. 5
0
 public static void SetBusyElementSize([NotNull] ProgressBase obj, double value)
 {
     ValidationHelper.NotNull(obj, "obj");
     obj.SetValue(BusyElementSizeProperty, value);
 }
Esempio n. 6
0
 public static double GetBusyElementSize([NotNull] ProgressBase obj)
 {
     ValidationHelper.NotNull(obj, "obj");
     DoubleUtil.EnsureNonNegative();
     return(BoxingHelper <double> .Unbox(obj.GetValue(BusyElementSizeProperty)));
 }
 public ResolverProgress(ProgressBase parent, int amount, float complexityMultiplicator) : base(parent)
 {
     m_complexity = amount * complexityMultiplicator;
     m_amount     = amount;
 }
Esempio n. 8
0
 public ProgressAutomationPeer([NotNull] ProgressBase owner) : base(owner)
 {
 }
        public void Initialize(AssetDependencyCache cache, HashSet <string> changedAssets, ProgressBase progress)
        {
            SubSystem.Clear();

            foreach (string assetId in changedAssets)
            {
                string guid = NodeDependencyLookupUtility.GetGuidFromAssetId(assetId);
                if (validGuids.Contains(guid))
                {
                    cache._hierarchyTraverser.AddAssetId(assetId, SubSystem);
                }
            }
        }