Пример #1
0
 public Pov(Controller parentController, PovType type, string name, int povNumber)
 {
     _parentController = parentController;
     _type             = type;
     _name             = name;
     PovNumber         = povNumber;
 }
Пример #2
0
        public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            var filename = TraceFilename.GetFirstValue(payload.Data);

            var trace = Trace.LoadFromFile(filename);

            var newExecution = new Execution
            {
                CbAuthor      = CbAuthor.GetFirstValue(payload.Data),
                CbId          = 0,
                ExecutionId   = (uint)ExecutionID.GetFirstValue(payload.Data),
                PovType       = PovType.GetFirstValue(payload.Data),
                RequestId     = (uint)RequestId.GetFirstValue(payload.Data),
                ServiceId     = new ServiceIdentifier(),
                RequestNature = RequestNature.GetFirstValue(payload.Data),
                Success       = Success.GetFirstValue(payload.Data),
                Traces        = new List <Trace> {
                    trace
                }
            };

            var executionMutable = ExecutionAdapter.ExecutionToMutable(
                newExecution,
                IncludeMemory.GetFirstValue(payload.Data),
                PovType.GetFirstValue(payload.Data));

            ExecutionTarget.SetValue(executionMutable, payload.Data);

            var iterator = Router.TransmitAll(payload);

            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }
Пример #3
0
        public void SetType(PovType newPovType)
        {
            if (newPovType == PovType.Button4 || newPovType == PovType.Button8)
            {
                int numNewButtons = 0;
                if (newPovType == PovType.Button4)
                {
                    numNewButtons = 4;
                }
                if (newPovType == PovType.Button8)
                {
                    numNewButtons = 8;
                }

                // Remove any old PovButtons from controller and the refs
                foreach (StandardButton button in _buttonRefs)
                {
                    _parentController.Buttons.Remove(button);
                }
                _buttonRefs.Clear();

                // Add new "virtual" pov buttons
                for (int i = 0; i < numNewButtons; i++)
                {
                    PovButton newPovButton = new PovButton
                                             (
                        parentController: _parentController,
                        name: "pov" + (i + 1),
                        buttonNumber: _parentController.Buttons.Count + 1,
                        onValue: (36000 / numNewButtons) * i,
                        povParent: this
                                             );
                    _parentController.Buttons.Add(newPovButton);
                    string povName = "pov" + PovNumber;
                    switch ((36000 / numNewButtons) * i) // There must be a better way...
                    {
                    case 0:
                        povName += "up";
                        break;

                    case 9000:
                        povName += "right";
                        break;

                    case 18000:
                        povName += "down";
                        break;

                    case 27000:
                        povName += "left";
                        break;
                    }

                    _parentController.ButtonsByName.Add(povName, newPovButton);
                    _buttonRefs.Add(newPovButton); // Keep a ref so I can remove it later - I don't think I need / want this anymore..
                }
            }
        }
Пример #4
0
 public WinMMJoyDetails(int num_axes)
 {
     Min     = new float[num_axes];
     Max     = new float[num_axes];
     PovType = PovType.None;
 }
Пример #5
0
 public WinMMJoyDetails(int num_axes)
 {
     Min = new float[num_axes];
     Max = new float[num_axes];
     PovType = PovType.None;
 }
Пример #6
0
 public Pov(string name, int index, PovType type = PovType.Polar)
     : base(name)
 {
     PovIndex = index;
     Type     = type;
 }
Пример #7
0
		public Pov(string name, int index, PovType type = PovType.Polar)
			: base(name)
		{
			PovIndex = index;
			Type = type;
		}