Example #1
0
        public virtual void OnCurrentProbe()
        {
            ProbeState p = (ProbeState)VisualGrid.availableStates[typeof(ProbeState)];

            p.ptype = ProbeType.current;
            VisualGrid.ChangeState(typeof(ProbeState));
        }
Example #2
0
        public virtual void OnVoltageProbe()
        {
            ProbeState p = (ProbeState)VisualGrid.availableStates[typeof(ProbeState)];

            p.ptype = ProbeType.voltage;
            VisualGrid.ChangeState(typeof(ProbeState));
        }
Example #3
0
 public override void OnKeyBoardEvent(KeyEventArgs e)
 {
     base.OnKeyBoardEvent(e);
     if (e.Key == Key.Escape)
     {
         VisualGrid.ChangeState(typeof(SelectionState));
     }
 }
Example #4
0
 public override void OnKeyBoardEvent(KeyEventArgs e)
 {
     base.OnKeyBoardEvent(e);
     if (e.Key == Key.Escape)
     {
         VisualGrid.ChangeState(typeof(SelectionState));
     }
     if (e.Key == Key.R)
     {
         if (tempR != null)
         {
             rotation += 90;
             rotation  = rotation > 270 ? 0 : rotation;
             tempR.RenderTransform = new RotateTransform(rotation, 50, 50);
         }
     }
 }
Example #5
0
        public override void OnKeyBoardEvent(KeyEventArgs e)
        {
            base.OnKeyBoardEvent(e);
            if (e.Key == Key.W)
            {
                VisualGrid.ChangeState(typeof(WireState));
            }

            else if (e.Key == Key.P)
            {
                VisualGrid.ChangeState(typeof(ComponentState));
            }

            else if (e.Key == Key.Delete || e.Key == Key.Back)
            {
                ComponentManager.DeleteComponent(posX, posY, SelectedComponent);
                SelectedComponent = null;
            }
        }
Example #6
0
        public override void OnKeyBoardEvent(KeyEventArgs e)
        {
            base.OnKeyBoardEvent(e);
            if (e.Key == Key.Escape)
            {
                //means we were drawing and now want to quit
                if (started)
                {
                    started = false;
                    currentCanvas.Children.RemoveAt(tempLineIndex);
                    tempLine = null;
                }

                //if not, then we want to switch to selection mode
                else
                {
                    VisualGrid.ChangeState(typeof(SelectionState));
                }
            }
        }