private async Task pickWorkspace() { var parameters = WorkspaceParameters.Create(workspaceId, Resources.Workspaces, allowQuerying: true); var selectedWorkspaceId = await navigationService .Navigate <SelectWorkspaceViewModel, WorkspaceParameters, long>(parameters); if (selectedWorkspaceId == workspaceId) { return; } var workspace = await dataSource.Workspaces.GetById(selectedWorkspaceId); clientId = null; ClientName = ""; workspaceId = selectedWorkspaceId; WorkspaceName = workspace.Name; await setupNameAlreadyTakenError(); isPro = await dataSource.Workspaces.WorkspaceHasFeature(workspaceId, WorkspaceFeatureId.Pro); if (isPro || Array.IndexOf(Helper.Color.DefaultProjectColors, Color) >= 0) { return; } pickRandomColor(); }
private async Task pickWorkspace() { var parameters = WorkspaceParameters.Create(workspaceId, Resources.Workspaces, allowQuerying: false); var selectedWorkspaceId = await navigationService .Navigate <SelectWorkspaceViewModel, WorkspaceParameters, long>(parameters); if (selectedWorkspaceId == workspaceId) { return; } var workspace = await interactorFactory.GetWorkspaceById(selectedWorkspaceId).Execute(); clientId = null; ClientName = ""; workspaceId = selectedWorkspaceId; WorkspaceName = workspace.Name; await setupNameAlreadyTakenError(); areCustomColorsEnabled = await interactorFactory.AreCustomColorsEnabledForWorkspace(workspace.Id).Execute(); if (areCustomColorsEnabled || Array.IndexOf(Helper.Color.DefaultProjectColors, Color) >= 0) { return; } pickRandomColor(); }
public void SetsTheTitle(NonEmptyString title) { var parameters = WorkspaceParameters.Create(10, title.Get, false); ViewModel.Prepare(parameters); ViewModel.Title.Should().Be(title.Get); }
public void SetsTheAllowsQueryingProperty(bool allowsQuerying) { var parameters = WorkspaceParameters.Create(10, "", allowsQuerying); ViewModel.Prepare(parameters); ViewModel.AllowQuerying.Should().Be(allowsQuerying); }
public async Task pickDefaultWorkspace() { var parameters = WorkspaceParameters.Create(workspaceId, Resources.SetDefaultWorkspace, allowQuerying: false); var selectedWorkspaceId = await navigationService .Navigate <SelectWorkspaceViewModel, WorkspaceParameters, long>(parameters); await changeDefaultWorkspace(selectedWorkspaceId); }
public async Task SetsTheDefaultWorkspaceId() { const long expectedId = 8; var parameters = WorkspaceParameters.Create(expectedId, "", true); ViewModel.Prepare(parameters); await ViewModel.Initialize(); ViewModel.Suggestions.Single(x => x.Selected).WorkspaceId.Should().Be(expectedId); }
public async Task ReturnsTheWorkspacePassedOnPrepare() { const long expectedId = 10; var parameters = WorkspaceParameters.Create(expectedId, "", true); ViewModel.Prepare(parameters); await ViewModel.Initialize(); ViewModel.CloseCommand.ExecuteAsync().Wait(); await NavigationService.Received() .Close(Arg.Is(ViewModel), expectedId); }
public MotionPlanRequest(WorkspaceParameters workspace_parameters, RobotState start_state, Constraints[] goal_constraints, Constraints path_constraints, TrajectoryConstraints trajectory_constraints, GenericTrajectory[] reference_trajectories, string planner_id, string group_name, int num_planning_attempts, double allowed_planning_time, double max_velocity_scaling_factor, double max_acceleration_scaling_factor, string cartesian_speed_end_effector_link, double max_cartesian_speed) { this.workspace_parameters = workspace_parameters; this.start_state = start_state; this.goal_constraints = goal_constraints; this.path_constraints = path_constraints; this.trajectory_constraints = trajectory_constraints; this.reference_trajectories = reference_trajectories; this.planner_id = planner_id; this.group_name = group_name; this.num_planning_attempts = num_planning_attempts; this.allowed_planning_time = allowed_planning_time; this.max_velocity_scaling_factor = max_velocity_scaling_factor; this.max_acceleration_scaling_factor = max_acceleration_scaling_factor; this.cartesian_speed_end_effector_link = cartesian_speed_end_effector_link; this.max_cartesian_speed = max_cartesian_speed; }
public async Task editWorkspace() { var parameters = WorkspaceParameters.Create(workspaceId, Resources.SetDefaultWorkspaces, allowQuerying: false); var selectedWorkspaceId = await navigationService .Navigate <SelectWorkspaceViewModel, WorkspaceParameters, long>(parameters); if (selectedWorkspaceId == workspaceId) { return; } var workspace = await dataSource.Workspaces.GetById(selectedWorkspaceId); workspaceId = selectedWorkspaceId; WorkspaceName = workspace.Name; await dataSource.User.UpdateWorkspace(workspaceId); await dataSource.SyncManager.PushSync(); }