internal override void ProcessData(IConnectedDevice device, int incomingValue, int offset) { switch (properties.Information.Aspect) { case ObjectAspect.Position: float newValue = incomingValue * sensitivity; if (newValue > 0) newValue = Math.Min(axisMax, newValue); else if (newValue < 0) newValue = Math.Max(axisMin, newValue); OnNewValue((int)newValue); break; } }
internal override void ProcessData(IConnectedDevice device, int incomingValue, int offset) { switch (properties.Information.Aspect) { case ObjectAspect.Position: int pos = (int)lerp(nRange, pRange, (float)incomingValue / rawRange) + rawOffset; if (inverted) pos *= -1; if (deadband > 0 && Math.Abs(pos) < deadband) OnNewValue(0); else OnNewValue(pos); break; } }
internal override void ProcessData(IConnectedDevice device, int incomingValue, int offset) { bool wasPressed = Value > 0; bool isPressed = inverted ? incomingValue <= 0 : incomingValue > 0; OnNewValue(isPressed ? 1 : 0); if(ButtonPressed != null) { if (!wasPressed && isPressed) ButtonPressed(this); } if(ButtonReleased != null) { if (wasPressed && !isPressed) ButtonReleased(this); } }
internal override void ProcessData(IConnectedDevice device, int incomingValue, int offset) { int oldValue = value; if (device.Device == positive.Properties.Device && offset == positive.Properties.RealOffset) positive.ProcessData(device, incomingValue, offset); else if (device.Device == negative.Properties.Device && offset == negative.Properties.RealOffset) negative.ProcessData(device, incomingValue, offset); if (positive.Value > 0) value = toSet; else if (negative.Value > 0) value = -toSet; else value = 0; if ((oldValue != value) && (InputChanged != null)) InputChanged(this, oldValue, incomingValue); }
internal override void ProcessData(IConnectedDevice device, int incomingValue, int offset) { }
internal abstract void ProcessData(IConnectedDevice device, int incomingValue, int offset);