Пример #1
0
        public async Task Initialize(IHyperArgsSink store, string metadataSetId, int smallestPageSize)
        {
            this.HyperStore = store;

            if (metadataSetId == null)
            {
                MetadataSetLoadFailed.Value = true;
                return;
            }

            MetadataSetId = new HyperDocumentId(metadataSetId, typeof(HyperMetadataSet));

            var metadataSetFilter = await store.ExecuteAsync(new RetrieveHyperDocumentArgs(MetadataSetId));

            if (metadataSetFilter != null)
            {
                this._smallestPageSize = smallestPageSize;

                PageSize = smallestPageSize;

                this._metadataSet = metadataSetFilter.GetPayload <HyperMetadataSet>();
                this.DashApiPort  = await GetDashApiPort();

                await LoadTotalPages();
                await LoadHyperTags();

                await InitializeMetadatasetEdgeDates();
            }
            else
            {
                MetadataSetLoadFailed.Value = true;
            }
        }
        protected override async Task OnInitializedAsync()
        {
            var authState = await AuthenticationStateTask;

            var claimToken = authState.User.Claims.FirstOrDefault(it => it.Type == System.Security.Claims.ClaimTypes.Sid);

            var claimConnection = authState.User.Claims.FirstOrDefault(it => it.Type == System.Security.Claims.ClaimTypes.Uri);

            HyperStore = await NetStore.ConnectAsyncThrows(claimConnection.Value);

            HyperStore.DefaultAuthenticationInfo = new HyperAuthenticationInfo()
            {
                Auth = new HyperArgsAuthentication()
                {
                    Token = claimToken.Value
                }
            };

            try
            {
                // Verify connection is correct.
                await HyperStore.ExecuteAsyncThrows(new RetrieveAssetsIdsArgs()
                {
                    Limit = 1
                });
            }
            catch (Exception ex)
            {            // Handle failed login here.
            }

            await base.OnInitializedAsync();
        }
Пример #3
0
        public MasksHeatmapRenderer(IHyperArgsSink hyperStore, HyperMetadataSet metadataSet, HeatmapSettings settings)
        {
            _hyperStore  = hyperStore;
            _metadataSet = metadataSet;
            _settings    = settings;

            _keepWorking = true;
            _ctSource    = new CancellationTokenSource();
        }
Пример #4
0
        public MissionItemVm(HyperMission mission, IHyperArgsSink store)
        {
            Mission    = mission;
            HyperStore = store;

            ClearCommandWarning.AsyncDelegate = OnClearCommandWarningAsync;
            ClearCommand.AsyncDelegate        = OnClearCommandAsync;
            LoadCommand.Delegate        = OnLoadCommand;
            UnloadCommand.AsyncDelegate = OnUnloadCommandAsync;
        }
Пример #5
0
        public TimelineUtility(
            IHyperArgsSink store)
        {
            if (store == null)
            {
                throw new ArgumentException(nameof(store));
            }

            _store = store;
        }
Пример #6
0
        private async Task <string> LoadModelOnNodeAsync(IHyperArgsSink store, HyperMissionInstance instance = null, bool allowAutoMissionResume = true)
        {
            if (this.Mission == null)
            {
                return(string.Empty);
            }

            this.ResetModelStatus();

            if (store == null)
            {
                await OnToastMessage.InvokeAsync(new ToastMessage($"No Node selected, loading model failed.", ToastMessageType.Info));
            }

            var args = new LoadHyperMissionArgs()
            {
                AllowMissionAutoResume = allowAutoMissionResume
            };

            if (instance == null)
            {
                args.MissionConfigurationId = Mission.Id;
            }
            else
            {
                args.MissionInstance = instance;
            }

            var missionStatus = await store.ExecuteAsync(args);

            if (missionStatus == null)
            {
                if (args.ExecutionResult.IsNotSuccess)
                {
                    await OnToastMessage.InvokeAsync(new ToastMessage(args.ExecutionResult.Message, ToastMessageType.Error));
                }
                else
                {
                    await OnToastMessage.InvokeAsync(new ToastMessage($"Failed to load model instance.", ToastMessageType.Info));
                }
            }

            if (this != null)
            {
                await this.UpdateModelStatusAsync();
            }

            return("Model loading, status: " + missionStatus);
        }
Пример #7
0
 public override Task VisualizeInCrossModuleAsync(IModuleVm moduleVm, IHyperArgsSink hyperStore, CrossModuleVisualizationRequest request, HyperDocumentId moduleContainerId, string pageTitle, bool?showInExternalBrowser)
 {
     throw new NotImplementedException();
 }
Пример #8
0
 public HeatmapCacheHelper(IHyperArgsSink store, MasksHeatmapRenderer.HeatmapSettings heatmapSettings)
 {
     _store           = store;
     _heatmapSettings = heatmapSettings;
 }
Пример #9
0
 bool IDialogService.ShowDialogue(DialogueTypes type, IHyperArgsSink store, object source, Action callback)
 {
     throw new NotImplementedException();
 }