Esempio n. 1
0
        public async Task <DiffModel> GetCurrentSnapshot(AppliedFilter filter = null, int sessionId = 0)
        {
            var dashboardInstanceGrain = GrainClient.GrainFactory.GetGrain <IDashboardInstanceGrain>(sessionId);
            var diffmodel = await dashboardInstanceGrain.GetAll(filter);

            return(diffmodel);
        }
Esempio n. 2
0
        public async Task <DiffModel> GetAll(AppliedFilter filter = null)
        {
            _logger.Verbose($"GetAll called DashboardInstance Grain [Id : {this.GetPrimaryKeyLong()}][CurrentStatsCount : {CurrentStats?.Count}]");
            _currentFilter = filter;
            CurrentStats   = await ApplyFilter(await _dashboardCollectorGrain.GetAll());

            _logger.Verbose($"GetAll called DashboardInstance Grain [Id : {this.GetPrimaryKeyLong()}][CurrentStatsCount : {CurrentStats?.Count}]");

            //if we are over the summaryViewLimit we need to keep the summary model details, then the counts will be updated every time new items are pushed here from the DashboardCollecterGrain/
            if (InSummaryMode)
            {
                return(new DiffModel
                {
                    SummaryView = InSummaryMode,
                    NewGrains = GetGrainSummaries(),
                    SummaryViewLinks = GetGrainSummaryLinks()
                });
            }

            //under normal circumstances we just returned the detail grains.
            return(new DiffModel
            {
                NewGrains = CurrentStats
            });
        }
Esempio n. 3
0
        public async Task <DiffModel> GetCurrentSnapshot(AppliedFilter filter, string grainSessionId)
        {
            var clusterClient = await GrainClientMultiton.GetAndConnectClient(grainSessionId);

            var dashboardInstanceGrain = clusterClient.GetGrain <IDashboardInstanceGrain>(0);

            var diffmodel = await dashboardInstanceGrain.GetAll(filter);

            return(diffmodel);
        }
Esempio n. 4
0
 public async Task <DiffModel> GetCurrentSnapshot(AppliedFilter filter = null)
 {
     return(await OrniscientObserver.Instance.GetCurrentSnapshot(filter, SessionId));
 }
 /// <summary>
 /// Checks whether represented data equals to corresponding data of object
 /// </summary>
 /// <param name="obj">Compared object</param>
 /// <returns></returns>
 public bool ContainedDataEquals(IDisplayingEntity obj)
 {
     if (obj is DispatcheredUIDiscrepancyCollection)
     {
         if (containedData is Aircraft && obj.ContainedData is Aircraft)
         {
             return(((Aircraft)containedData).ID == ((Aircraft)obj.ContainedData).ID && AppliedFilter.Equals(((DispatcheredUIDiscrepancyCollection)obj).AppliedFilter));
         }
         if (containedData is BaseDetail && obj.ContainedData is BaseDetail)
         {
             return(((BaseDetail)containedData).ID == ((BaseDetail)obj.ContainedData).ID && AppliedFilter.Equals(((DispatcheredUIDiscrepancyCollection)obj).AppliedFilter));
         }
     }
     return(false);
 }
 /// <summary>
 /// Checks whether represented data equals to corresponding data of object
 /// </summary>
 /// <param name="obj">Compared object</param>
 /// <returns></returns>
 public bool ContainedDataEquals(IDisplayingEntity obj)
 {
     if (obj is DispatcheredDiscrepanciesScreen)
     {
         if (containedData is Aircraft && obj.ContainedData is Aircraft)
             return ((Aircraft)containedData).ID == ((Aircraft)obj.ContainedData).ID && AppliedFilter.Equals(((DispatcheredDiscrepanciesScreen)obj).AppliedFilter);
         if (containedData is BaseDetail && obj.ContainedData is BaseDetail)
             return ((BaseDetail)containedData).ID == ((BaseDetail)obj.ContainedData).ID && AppliedFilter.Equals(((DispatcheredDiscrepanciesScreen)obj).AppliedFilter);
     }
     return false;
 }
Esempio n. 7
0
        public async Task <DiffModel> GetCurrentSnapshot(AppliedFilter filter = null)
        {
            var grainsSessionCookie = Context.RequestCookies.FirstOrDefault(x => x.Key == "GrainSessionId").Value;

            return(await OrniscientObserver.Instance.GetCurrentSnapshot(filter, grainsSessionCookie.Value));
        }