コード例 #1
0
ファイル: Child.cs プロジェクト: ehershey/development
		public Child(Order doc, ViewType viewType)
			: this()
		{
			// Configure the title.
			this.Text = doc.LastFileName;
			this.Document = doc;

			// Create a reference for the view.
			// This reference can accomodate any type of control.
			Control view = null;

			// Instantiate the appropriate view.
			switch (viewType)
			{
				case ViewType.ItemGrid:
					view = new OrderGridView(doc);
					break;
				case ViewType.PrintPreview:
					view = new OrderPrintPreview(doc);
					break;
			}

			// Add the view to the form.
			view.Dock = DockStyle.Fill;
			this.Controls.Add(view);
		}
コード例 #2
0
ファイル: NavigationRouter.cs プロジェクト: sclcwwl/Gimela
        private static void CloseView(ViewType viewType)
        {
            if (_cacheSingle.ContainsKey(viewType) && _cacheSingle[viewType].IsAlive)
              {
            ResponsiveMDIChild view = _cacheSingle[viewType].Target as ResponsiveMDIChild;
            if (view != null)
            {
              view.Close();
            }
            _cacheSingle[viewType].Target = null;
            _cacheSingle.Remove(viewType);
              }

              List<ViewType> deleteItems = new List<ViewType>();
              foreach (var item in _cacheSingle)
              {
            if (item.Value.IsAlive == false || item.Value.Target == null)
            {
              deleteItems.Add(item.Key);
            }
              }
              foreach (var item in deleteItems)
              {
            _cacheSingle.Remove(item);
              }
        }
コード例 #3
0
    //This gets called from SceneManager's Start()
    public virtual void InitManager()
    {
        m_UIEventHandler.CloseView          += OnTappedOnCloseButton;
        InputController.SingleTapped        += OnSingleTapped;

        mActiveViewType = ViewType.ARCAMERAVIEW;
    }
コード例 #4
0
 public PostCommentModel(PostComment comment, ViewType viewType)
     : this()
 {
     this.Comment = comment;
     this.ViewMode = viewType;
     this.Root_ContentID = this.Comment.Root_ContentID;
 }
コード例 #5
0
 public AdditionalViewControlsAttribute(string message, string messagePropertyName, ViewType targetViewType, AdditionalViewControlsProviderPosition additionalViewControlsProviderPosition)
 {
     this.message = message;
     this.messagePropertyName = messagePropertyName;
     this.targetViewType = targetViewType;
     this.additionalViewControlsProviderPosition = additionalViewControlsProviderPosition;
 }
コード例 #6
0
 public SearchUserViewModel(ViewType viewType, Decimal TwitterAccountID)
 {
     this.TwitterAccountID = TwitterAccountID;
       this.CancelCommand = new RelayCommand(new Action(this.Cancel));
       this.OKCommand = new RelayCommand(new Action(this.OK));
       this.viewType = viewType;
 }
コード例 #7
0
 private void OnDoubleTapped()
 {
     if(mActiveViewType == ViewType.ARCAMERAVIEW)
     {
         mActiveViewType = ViewType.UIVIEW;
     }
 }
コード例 #8
0
 public ActionStateRuleAttribute(string id, string actionId, Nesting targetViewNesting, string normalCriteria,
                                 string emptyCriteria, ViewType viewType, string module, ActionState actionState,
                                 string viewId)
     : base(id, targetViewNesting, normalCriteria, emptyCriteria, viewType, module, viewId) {
     this.actionId = actionId;
     ActionState = actionState;
 }
コード例 #9
0
ファイル: LogicAttribute.cs プロジェクト: akingunes/eXpand
 protected LogicAttribute(string id,Nesting targetViewNesting, ViewType viewType,string viewId)
 {
     ViewId = viewId;
     ID=id;
     ViewType = viewType;
     Nesting = targetViewNesting;   
 }
コード例 #10
0
 void Register(ViewType type, Uri address)
 {
     if (!_views.ContainsKey(type))
         _views.Add(type, address);
     else
         _views[type] = address;
 }
コード例 #11
0
 public EditNodeWindow(Sidebar sidebar, string Type, string Name, ViewType viewType)
     : this(sidebar, viewType)
 {
     titlePanelEditNode.lblTitle.Text = "Edit " + Type;
     lblName.Text = Type + " Name:";
     txtName.Text = Name;
 }
コード例 #12
0
 public View Create(Element subject, ViewType viewType)
 {
     var view = new View(subject, viewType);
     view.Model = _model;
     Views.Add(view);
     return view;
 }
コード例 #13
0
 public void RegisterAppearance(ChartAppearance appearance, ViewType viewType, Palette palette)
 {
     AppearanceColors row = new AppearanceColors(appearance, palette);
     matrix.Add(row);
     for (int i = 0; i <= palette.Count; i++)
         row[i] = AddStyleEditor(AppearanceImageHelper.CreateImage(viewType, appearance, palette, i), i);
     lastRegisteredAppearance++;
 }
コード例 #14
0
        public override Texture ToTextureView(ViewType viewType, int arraySlice, int mipMapSlice)
        {
            // Exists since OpenGL 4.3
            if (viewType != ViewType.Full || arraySlice != 0 || mipMapSlice != 0)
                throw new NotImplementedException();

            return new Texture2D(GraphicsDevice, this);
        }
コード例 #15
0
 public static Texture ToTextureView(this Texture texture, ViewType type, int arraySlice, int mipLevel)
 {
     var viewDescription = texture.ViewDescription;
     viewDescription.Type = type;
     viewDescription.ArraySlice = arraySlice;
     viewDescription.MipLevel = mipLevel;
     return texture.ToTextureView(viewDescription);
 }
コード例 #16
0
 public ControllerStateRuleAttribute(string id, Type controllerType, Nesting targetViewNesting,
                                     string normalCriteria,
                                     string emptyCriteria, ViewType viewType, string module, State state,
                                     string viewId)
     : base(id, targetViewNesting, normalCriteria, emptyCriteria, viewType, module, state, viewId)
 {
     this.controllerType = controllerType;
 }
コード例 #17
0
ファイル: ViewInfo.cs プロジェクト: rizwan3d/elalang
 public ViewInfo(string key, string title, string shortcut, ViewType viewType, Type type)
     : base(key)
 {
     Title = title;
     Shortcut = shortcut;
     ViewType = viewType;
     Type = type;
 }
コード例 #18
0
ファイル: ModuleView.cs プロジェクト: rickeygalloway/Test
 public ModuleView(string moduleName, string name, string displayName, string description, ViewType viewType)
 {
     ModuleName = moduleName;
     Name = name;
     DisplayName = displayName;
     Description = description;
     ViewType = viewType;
 }
コード例 #19
0
 public void NavigateTo(ViewType type)
 {
     if (!_views.ContainsKey(type)) return;
     var address = _views[type];
     var root = Application.Current.RootVisual as PhoneApplicationFrame;
     Debug.Assert(root != null, "Root is null");
     root.Navigate(address);
 }
コード例 #20
0
		public PageDisplaySettings(int imagesPerRow, ViewType viewType, double horizontalOffsetBetweenPages, ImageRotation rotation = ImageRotation.None, float zoomFactor = 1.0f)
		{
			this.ImagesPerRow = imagesPerRow;
			this.ZoomFactor = zoomFactor;
			this.ViewType = viewType;
			this.HorizontalOffsetBetweenPages = viewType == ViewType.SinglePage ? 0 : horizontalOffsetBetweenPages;
			this.Rotation = rotation;
		}
コード例 #21
0
        private EditNodeWindow(Sidebar sidebar, ViewType viewType)
        {
            this.sidebar = sidebar;
            this.manager = sidebar.manager;
            neoSidebar = new NeoSidebar(manager);
            neoSidebar.Init();
            int tomtom = 5;
            neoSidebar.ClientArea.BackColor = UserInterface.TomDark;
            neoSidebar.BackColor = Color.Black;
            neoSidebar.BevelBorder = BevelBorder.All;
            Margins tomtomtomtom = new Margins(tomtom, tomtom, tomtom, tomtom);
            neoSidebar.ClientMargins = tomtomtomtom;

            neoSidebar.Left = sidebar.master.Left;
            neoSidebar.Width = sidebar.Width;
            neoSidebar.Top = 0;
            neoSidebar.Resizable = false;
            neoSidebar.Movable = false;
            neoSidebar.Height = OrbIt.ScreenHeight;
            neoSidebar.Text = "Edit";
            manager.Add(neoSidebar);

            int width = 120;
            int offset = neoSidebar.Width - width - 20;

            titlePanelEditNode = new TitlePanel(sidebar, neoSidebar, "Edit", true);
            titlePanelEditNode.btnBack.Click += (s, e) =>
            {
                sidebar.groupsView.UpdateGroups();
                manager.Remove(neoSidebar);
            };

            HeightCounter += titlePanelEditNode.Height;

            lblName = new Label(manager);
            lblName.Init();
            lblName.Parent = neoSidebar;
            lblName.Left = LeftPadding;
            lblName.Top = HeightCounter;
            lblName.Width = width;

            txtName = new TextBox(manager);
            txtName.Init();
            txtName.Parent = neoSidebar;
            txtName.Top = HeightCounter;
            txtName.Width = width;
            txtName.Left = offset;
            HeightCounter += txtName.Height + LeftPadding;
            txtName.TextColor = Color.Black;
            txtName.Enabled = false;

            componentView = new ComponentView(sidebar, neoSidebar, 0, HeightCounter, viewType);
            componentView.Width = neoSidebar.Width - 20;
            componentView.insView.Height += componentView.insView.Height / 2;

            neoSidebar.Width += 100;
            neoSidebar.Width -= 100;
        }
コード例 #22
0
        public static void Navigate(ViewType sourcePageType, object parameter)
        {
            var pageType = GetViewType(sourcePageType);

            if (pageType != null)
            {
                ((Frame)Window.Current.Content).Navigate(pageType, parameter);
            }
        }
コード例 #23
0
 public static GameObject GetViewParent(ViewType type)
 {
     switch(type)
     {
         case ViewType.CityView: return cityUI;
         case ViewType.BattleView: return battleUI;
         default: return ui;
     }
 }
コード例 #24
0
ファイル: Form1.cs プロジェクト: isachpaz/Calc
 void ChangeSeries(ViewType viewType)
 {
     //double[] values = { 3.1, 2.3, 3.2, 3.9, 5.1 };
     //Series series = new Series("Series", viewType);
     //for (int i = 0; i < values.Length; i++)
       //  series.Points.Add(new SeriesPoint((i + 1) * 10, new double[] { values[i], values[i] + 3, values[i] + 2, values[i] + 1 }));
     //chartControl.Series.Clear();
     //chartControl.Series.Add(series);
 }
コード例 #25
0
		public void ChangeView(ViewType viewType)
		{
			_selectedViewType = viewType;
			foreach (var view in _views.Values)
				view.Active = false;
			if (_views.ContainsKey(viewType))
				_views[viewType].ShowView();
			gbDate.Visible = viewType != ViewType.VideoInfoReport;
		}
コード例 #26
0
ファイル: RenderTarget2D.cs プロジェクト: pH200/SharpDX
        internal override RenderTargetView GetRenderTargetView(ViewType viewType, int arrayOrDepthSlice, int mipIndex)
        {
            if ((this.Description.BindFlags & BindFlags.RenderTarget) == 0)
                return null;

            if (viewType == ViewType.MipBand)
                throw new NotSupportedException("ViewSlice.MipBand is not supported for render targets");

            int arrayCount;
            int mipCount;
            GetViewSliceBounds(viewType, ref arrayOrDepthSlice, ref mipIndex, out arrayCount, out mipCount);

            var rtvIndex = GetViewIndex(viewType, arrayOrDepthSlice, mipIndex);

            lock (this.renderTargetViews)
            {
                var rtv = this.renderTargetViews[rtvIndex];

                // Creates the shader resource view
                if (rtv == null)
                {
                    // Create the render target view
                    var rtvDescription = new RenderTargetViewDescription() { Format = this.Description.Format };

                    if (this.Description.ArraySize > 1)
                    {
                        rtvDescription.Dimension = this.Description.SampleDescription.Count > 1 ? RenderTargetViewDimension.Texture2DMultisampledArray : RenderTargetViewDimension.Texture2DArray;
                        if (this.Description.SampleDescription.Count > 1)
                        {
                            rtvDescription.Texture2DMSArray.ArraySize = arrayCount;
                            rtvDescription.Texture2DMSArray.FirstArraySlice = arrayOrDepthSlice;
                        }
                        else
                        {
                            rtvDescription.Texture2DArray.ArraySize = arrayCount;
                            rtvDescription.Texture2DArray.FirstArraySlice = arrayOrDepthSlice;
                            rtvDescription.Texture2DArray.MipSlice = mipIndex;
                        }
                    }
                    else
                    {
                        rtvDescription.Dimension = this.Description.SampleDescription.Count > 1 ? RenderTargetViewDimension.Texture2DMultisampled : RenderTargetViewDimension.Texture2D;
                        if (this.Description.SampleDescription.Count <= 1)
                            rtvDescription.Texture2D.MipSlice = mipIndex;
                    }

                    rtv = new RenderTargetView(GraphicsDevice, Resource, rtvDescription);
                    this.renderTargetViews[rtvIndex] = ToDispose(rtv);
                }

                // Associate this instance
                rtv.Tag = this;

                return rtv;
            }
        }
コード例 #27
0
ファイル: StateRuleAttribute.cs プロジェクト: cevious/eXpand
 protected StateRuleAttribute(string id,Nesting targetViewNesting, string normalCriteria, string emptyCriteria, ViewType viewType,State state,string viewId)
 {
     this.state=state;
     ViewId = viewId;
     ID=id;
     ViewType = viewType;
     Nesting = targetViewNesting;
     NormalCriteria = normalCriteria;
     EmptyCriteria = emptyCriteria;
 }
コード例 #28
0
ファイル: AppViewModel.cs プロジェクト: forkbomb/pikto
 public void SecondaryViewTypeWithStep(ViewType viewType, string step)
 {
     if (step != wizardStep || viewType != secondaryViewType)
     {
         secondaryViewType = viewType;
         wizardStep = step;
         OnPropertyChanged("SecondaryViewType");
         OnPropertyChanged("WizardStep");
     }
 }
コード例 #29
0
 public bool IsMatchTextBoxEnabled(int rowNumber, ViewType viewType)
 {
     List<UITestControl> dataGridRowChildList = GetDataGridRowChildList(rowNumber, viewType);
     UITestControl firstOrDefault = dataGridRowChildList[3].GetChildren().FirstOrDefault(c => c.ControlType == ControlType.Edit);
     if(firstOrDefault == null)
     {
         throw new Exception("Could not find the matches text box.");
     }
     return firstOrDefault.IsEnabled();
 }
コード例 #30
0
        void Register(ViewType type, Uri address)
        {
            if (views.ContainsKey(type)) //update
            {
                views[type] = address;
                return;
            }

            views.Add(type, address); //add
        }
コード例 #31
0
ファイル: IPresenter.cs プロジェクト: tsdeveloper/mShop-1
 public ViewChangedArgs(ViewType viewType)
 {
     ViewType = viewType;
 }
コード例 #32
0
        public void Activate(bool activate, ViewType chgMode)
        {
            if (activate)
            {
                GCodeSender.RewindFile();
                GCodeSender.CallHandler(GCode.File.IsLoaded ? StreamingState.Idle : (sdStream ? StreamingState.Start : StreamingState.NoFile), false);
                sdStream = false;

                if (initOK != true)
                {
                    focusedControl = this;
                    model.Message  = string.Format("Waiting for controller ({0})...", AppConfig.Settings.Base.PortParams);

                    string response = GrblInfo.Startup();

                    if (response.StartsWith("<Alarm"))
                    {
                        GrblViewModel data = DataContext as GrblViewModel;
                        data.ParseStatus(response);

                        // Alarm 1, 2 and 10 are critical events
                        if (!(data.GrblState.Substate == 1 || data.GrblState.Substate == 2 || data.GrblState.Substate == 10))
                        {
                            InitSystem();
                        }
                    }
                    else if (response.StartsWith("<Tool"))
                    {
                        Comms.com.WriteByte(GrblConstants.CMD_STOP);
                        GrblViewModel data = DataContext as GrblViewModel;
                        data.ParseStatus(Comms.com.Reply);
                    }
                    else if (response != string.Empty)
                    {
                        InitSystem();
                    }
                }

                if (initOK == null)
                {
                    initOK = false;
                }

                #if ADD_CAMERA
                if (MainWindow.UIViewModel.Camera != null)
                {
                    MainWindow.UIViewModel.Camera.MoveOffset += Camera_MoveOffset;
                    MainWindow.UIViewModel.Camera.Opened     += Camera_Opened;
                }
                #endif
                //if (viewer == null)
                //    viewer = new Viewer();

                if (GCode.File.IsLoaded)
                {
                    MainWindow.ui.WindowTitle = ((GrblViewModel)DataContext).FileName;
                }
            }
            else if (ViewType != ViewType.Shutdown)
            {
                DRO.IsFocusable = false;
                #if ADD_CAMERA
                if (MainWindow.UIViewModel.Camera != null)
                {
                    MainWindow.UIViewModel.Camera.MoveOffset -= Camera_MoveOffset;
                }
                #endif
                focusedControl = AppConfig.Settings.Base.KeepMdiFocus && Keyboard.FocusedElement is TextBox && (string)(Keyboard.FocusedElement as TextBox).Tag == "MDI"
                                  ? Keyboard.FocusedElement
                                  : this;
            }

            if (GCodeSender.Activate(activate))
            {
                Task.Delay(500).ContinueWith(t => DRO.EnableFocus());
                Application.Current.Dispatcher.BeginInvoke(new System.Action(() =>
                {
                    focusedControl.Focus();
                }), DispatcherPriority.Render);
            }
        }
コード例 #33
0
 public void Navigate(ViewType viewType)
 {
     InitializeView(viewType);
     ContentOwner.ContentControl.Content = ViewsDictionary[viewType];
 }
コード例 #34
0
 private Task <IActionResult> RenderAsync(ViewType viewType, object model)
 {
     ViewData["ViewType"] = viewType;
     return(RenderViewAsync(MenuItems.AdminUsers, model));
 }
コード例 #35
0
 public RenderTarget ToRenderTarget(ViewType viewType, int arrayOrDepthSlice, int mipIndex)
 {
     return(null);
 }
コード例 #36
0
        public void Activate(bool activate, ViewType chgMode)
        {
            if (activate)
            {
                GCodeSender.RewindFile();
                GCodeSender.CallHandler(GCode.File.IsLoaded ? StreamingState.Idle : (model.IsSDCardJob ? StreamingState.Start : StreamingState.NoFile), false);

                model.ResponseLogFilterOk = AppConfig.Settings.Base.FilterOkResponse;

                if (Controller == null)
                {
                    Controller = new Controller(model);
                }

                if (initOK != true)
                {
                    focusedControl = this;

                    switch (Controller.Restart())
                    {
                    case Controller.RestartResult.Ok:
                        initOK = InitSystem();
                        break;

                    case Controller.RestartResult.Close:
                        MainWindow.ui.Close();
                        break;

                    case Controller.RestartResult.Exit:
                        Environment.Exit(-1);
                        break;
                    }

                    model.Message = Controller.Message;
                }

                if (initOK == null)
                {
                    initOK = false;
                }

                #if ADD_CAMERA
                if (MainWindow.UIViewModel.Camera != null)
                {
                    MainWindow.UIViewModel.Camera.MoveOffset          += Camera_MoveOffset;
                    MainWindow.UIViewModel.Camera.IsVisibilityChanged += Camera_Opened;
                }
                #endif
                //if (viewer == null)
                //    viewer = new Viewer();

                if (GCode.File.IsLoaded)
                {
                    MainWindow.ui.WindowTitle = ((GrblViewModel)DataContext).FileName;
                }
            }
            else if (ViewType != ViewType.Shutdown)
            {
                DRO.IsFocusable = false;
                #if ADD_CAMERA
                if (MainWindow.UIViewModel.Camera != null)
                {
                    MainWindow.UIViewModel.Camera.MoveOffset -= Camera_MoveOffset;
                }
                #endif
                focusedControl = focusedControl = AppConfig.Settings.Base.KeepMdiFocus &&
                                                  Keyboard.FocusedElement is TextBox &&
                                                  (Keyboard.FocusedElement as TextBox).Tag is string &&
                                                  (string)(Keyboard.FocusedElement as TextBox).Tag == "MDI"
                                  ? Keyboard.FocusedElement
                                  : this;
            }

            if (GCodeSender.Activate(activate))
            {
                showProgramLimits();
                Task.Delay(500).ContinueWith(t => DRO.EnableFocus());
                Application.Current.Dispatcher.BeginInvoke(new System.Action(() =>
                {
                    focusedControl.Focus();
                }), DispatcherPriority.Render);
            }
        }
コード例 #37
0
 internal override TextureView GetRenderTargetView(ViewType viewType, int arrayOrDepthSlice, int mipIndex)
 {
     throw new NotSupportedException();
 }
コード例 #38
0
ファイル: Texture2DBase.cs プロジェクト: OkashiKami/Odyssey
        internal override TextureView GetShaderResourceView(Format viewFormat, ViewType viewType, int arrayOrDepthSlice, int mipIndex)
        {
            if ((Description.BindFlags & BindFlags.ShaderResource) == 0)
            {
                return(null);
            }

            int arrayCount;
            int mipCount;

            GetViewSliceBounds(viewType, ref arrayOrDepthSlice, ref mipIndex, out arrayCount, out mipCount);

            var textureViewKey = new TextureViewKey(viewFormat, viewType, arrayOrDepthSlice, mipIndex);

            lock (shaderResourceViews)
            {
                TextureView srv;
                // Creates the shader resource view
                if (!shaderResourceViews.TryGetValue(textureViewKey, out srv))
                {
                    // Create the view
                    var srvDescription = new ShaderResourceViewDescription {
                        Format = viewFormat
                    };

                    // Initialize for texture arrays or texture cube
                    if (Description.ArraySize > 1)
                    {
                        // If texture cube
                        if ((Description.OptionFlags & ResourceOptionFlags.TextureCube) != 0)
                        {
                            srvDescription.Dimension                   = ShaderResourceViewDimension.TextureCube;
                            srvDescription.TextureCube.MipLevels       = mipCount;
                            srvDescription.TextureCube.MostDetailedMip = mipIndex;
                        }
                        else
                        {
                            // Else regular Texture2D
                            srvDescription.Dimension = Description.SampleDescription.Count > 1 ? ShaderResourceViewDimension.Texture2DMultisampledArray : ShaderResourceViewDimension.Texture2DArray;

                            // Multisample?
                            if (Description.SampleDescription.Count > 1)
                            {
                                srvDescription.Texture2DMSArray.ArraySize       = arrayCount;
                                srvDescription.Texture2DMSArray.FirstArraySlice = arrayOrDepthSlice;
                            }
                            else
                            {
                                srvDescription.Texture2DArray.ArraySize       = arrayCount;
                                srvDescription.Texture2DArray.FirstArraySlice = arrayOrDepthSlice;
                                srvDescription.Texture2DArray.MipLevels       = mipCount;
                                srvDescription.Texture2DArray.MostDetailedMip = mipIndex;
                            }
                        }
                    }
                    else
                    {
                        srvDescription.Dimension = Description.SampleDescription.Count > 1 ? ShaderResourceViewDimension.Texture2DMultisampled : ShaderResourceViewDimension.Texture2D;
                        if (Description.SampleDescription.Count <= 1)
                        {
                            srvDescription.Texture2D.MipLevels       = mipCount;
                            srvDescription.Texture2D.MostDetailedMip = mipIndex;
                        }
                    }

                    srv = new TextureView(this, new ShaderResourceView(Device, Resource, srvDescription));
                    shaderResourceViews.Add(textureViewKey, ToDispose(srv));
                }

                return(srv);
            }
        }
コード例 #39
0
        /// <summary>
        /// Gets a specific <see cref="DepthStencilView" /> from this texture.
        /// </summary>
        /// <param name="viewType">Type of the view slice.</param>
        /// <param name="arrayOrDepthSlice">The texture array slice index.</param>
        /// <param name="mipMapSlice">The mip map slice index.</param>
        /// <param name="readOnlyView">Indicates if the view is read-only.</param>
        /// <returns>A <see cref="DepthStencilView" /></returns>
        internal virtual TextureView GetDepthStencilView(ViewType viewType, int arrayOrDepthSlice, int mipIndex, bool readOnlyView)
        {
            if ((this.Description.BindFlags & BindFlags.DepthStencil) == 0)
            {
                return(null);
            }

            if (viewType == ViewType.MipBand)
            {
                throw new NotSupportedException("ViewSlice.MipBand is not supported for depth stencils");
            }

            if (readOnlyView && !HasReadOnlyView)
            {
                return(null);
            }

            var views = readOnlyView ? readOnlyViews : depthStencilViews;

            int arrayCount;
            int mipCount;

            GetViewSliceBounds(viewType, ref arrayOrDepthSlice, ref mipIndex, out arrayCount, out mipCount);

            var dsvIndex = GetViewIndex(viewType, arrayOrDepthSlice, mipIndex);

            lock (views)
            {
                var dsv = views[dsvIndex];

                // Creates the shader resource view
                if (dsv == null)
                {
                    // Create the depth stencil view
                    var dsvDescription = new DepthStencilViewDescription()
                    {
                        Format = (Format)DepthFormat
                    };

                    if (this.Description.ArraySize > 1)
                    {
                        dsvDescription.Dimension = this.Description.SampleDescription.Count > 1 ? DepthStencilViewDimension.Texture2DMultisampledArray : DepthStencilViewDimension.Texture2DArray;
                        if (this.Description.SampleDescription.Count > 1)
                        {
                            dsvDescription.Texture2DMSArray.ArraySize       = arrayCount;
                            dsvDescription.Texture2DMSArray.FirstArraySlice = arrayOrDepthSlice;
                        }
                        else
                        {
                            dsvDescription.Texture2DArray.ArraySize       = arrayCount;
                            dsvDescription.Texture2DArray.FirstArraySlice = arrayOrDepthSlice;
                            dsvDescription.Texture2DArray.MipSlice        = mipIndex;
                        }
                    }
                    else
                    {
                        dsvDescription.Dimension = this.Description.SampleDescription.Count > 1 ? DepthStencilViewDimension.Texture2DMultisampled : DepthStencilViewDimension.Texture2D;
                        if (this.Description.SampleDescription.Count <= 1)
                        {
                            dsvDescription.Texture2D.MipSlice = mipIndex;
                        }
                    }

                    if (readOnlyView)
                    {
                        dsvDescription.Flags = DepthStencilViewFlags.ReadOnlyDepth;
                        if (HasStencil)
                        {
                            dsvDescription.Flags |= DepthStencilViewFlags.ReadOnlyStencil;
                        }
                    }

                    dsv             = new TextureView(this, new DepthStencilView(GraphicsDevice, Resource, dsvDescription));
                    views[dsvIndex] = ToDispose(dsv);
                }

                return(dsv);
            }
        }
コード例 #40
0
 internal void Navigate(ViewType viewType, MyProcess process = null)
 {
     _navigationModel.Navigate(viewType, process);
 }
コード例 #41
0
        public void Activate(bool activate, ViewType chgMode)
        {
            if (activate)
            {
                if (model.CoordinateSystems.Count == 0)
                {
                    //                   model.CoordinateSystems.Add(model.CoordinateSystem = new CoordinateSystem("Active", "0"));
                    foreach (var cs in GrblWorkParameters.CoordinateSystems)
                    {
                        if (cs.Id > 0 && cs.Id < 9)
                        {
                            model.CoordinateSystems.Add(new CoordinateSystem(cs.Code, "0"));
                        }

                        if (cs.Id == 9)
                        {
                            model.HasCoordinateSystem9 = true;
                        }
                    }
                    model.HasToolTable = GrblInfo.NumTools > 0;
                }

                if (GrblInfo.IsGrblHAL)
                {
                    Comms.com.WriteByte(GrblConstants.CMD_STATUS_REPORT_ALL);
                }

                if (!model.Grbl.IsGrblHAL && !AppConfig.Settings.Jog.KeyboardEnable)
                {
                    Jog.Visibility = Visibility.Collapsed;
                }

                GrblWorkParameters.Get();
                GrblParserState.Get(true);
                model.DistanceMode     = GrblParserState.DistanceMode;
                model.Tool             = model.Grbl.Tool == GrblConstants.NO_TOOL ? "0" : model.Grbl.Tool;
                model.CanProbe         = !model.Grbl.Signals.Value.HasFlag(Signals.Probe);
                model.HeightMapApplied = GCode.File.HeightMapApplied;
                int csid = GrblWorkParameters.GetCoordinateSystem(model.Grbl.WorkCoordinateSystem).Id;
                model.CoordinateSystem     = csid == 0 || csid >= 9 ? 1 : csid;
                model.ReferenceToolOffset &= model.CanReferenceToolOffset;

                if (model.Grbl.IsTloReferenceSet && !double.IsNaN(model.Grbl.TloReference))
                {
                    model.TloReference        = model.Grbl.TloReference;
                    model.ReferenceToolOffset = false;
                }

                getView(tab.SelectedItem as TabItem)?.Activate();

                model.Grbl.PropertyChanged += Grbl_PropertyChanged;

                probeTriggered    = model.Grbl.Signals.Value.HasFlag(Signals.Probe);
                probeDisconnected = model.Grbl.Signals.Value.HasFlag(Signals.ProbeDisconnected);
                cycleStartSignal  = model.Grbl.Signals.Value.HasFlag(Signals.CycleStart);

                DisplayPosition(model.Grbl);
            }
            else
            {
                model.Grbl.PropertyChanged -= Grbl_PropertyChanged;

                // If probing alarm active unlock
                //if(model.Grbl.GrblState.State == GrblStates.Alarm && (model.Grbl.GrblState.Substate == 4 || model.Grbl.GrblState.Substate == 5))
                //    model.Grbl.ExecuteCommand(GrblConstants.CMD_UNLOCK);
                //else
                if (model.Grbl.GrblError != 0)
                {
                    model.Grbl.ExecuteCommand("");  // Clear error
                }
                model.Grbl.ExecuteCommand(model.DistanceMode == DistanceMode.Absolute ? "G90" : "G91");
            }

            model.Message = string.Empty;
            model.Grbl.Poller.SetState(activate ? AppConfig.Settings.Base.PollInterval : 0);
        }
コード例 #42
0
 protected abstract void InitializeView(ViewType viewType);