Wire carries stick-up as negative; Invert Y opts back to physical
The old Invert joystick Y box (checked by default) is now the wire's native convention: full up = -80 in AnalogReply with the flag off. Checking the renamed Invert Y sends the physical direction (up = +80). Control strip cleanup: test-mode buttons and the firmware selector are gone (the device still reports 4.2), Keyboard/Gamepad/Invert Y share one line, the help text drops the bindings sentence, and the wire log gets the reclaimed height. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -61,15 +61,15 @@ public class VRioDeviceTests
|
||||
Assert.Equal(1000, AnalogCodec.Combine(p[0], p[1])); // throttle
|
||||
Assert.Equal(0, AnalogCodec.Combine(p[2], p[3])); // left pedal
|
||||
Assert.Equal(0, AnalogCodec.Combine(p[4], p[5])); // right pedal
|
||||
Assert.Equal(3000, AnalogCodec.Combine(p[6], p[7])); // joystick Y
|
||||
Assert.Equal(-3000, AnalogCodec.Combine(p[6], p[7])); // joystick Y (up is negative on the wire)
|
||||
Assert.Equal(-5000, AnalogCodec.Combine(p[8], p[9])); // joystick X
|
||||
Assert.Equal(1, device.AnalogRequests);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InvertJoystickY_flips_the_wire_but_not_local_state()
|
||||
public void Joystick_Y_is_negated_on_the_wire_but_not_locally()
|
||||
{
|
||||
var device = new VRioDevice { InvertJoystickY = true };
|
||||
var device = new VRioDevice();
|
||||
var wire = new Wire(device);
|
||||
device.SetAxis(RioAxis.JoystickY, 3000);
|
||||
|
||||
@@ -88,6 +88,20 @@ public class VRioDeviceTests
|
||||
Assert.Equal(AnalogCodec.Max, AnalogCodec.Combine(p[6], p[7]));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InvertJoystickY_sends_the_physical_direction_instead()
|
||||
{
|
||||
var device = new VRioDevice { InvertJoystickY = true };
|
||||
var wire = new Wire(device);
|
||||
device.SetAxis(RioAxis.JoystickY, 3000);
|
||||
|
||||
Send(device, PacketBuilder.Build(RioCommand.AnalogRequest));
|
||||
|
||||
byte[] p = Assert.Single(wire.Packets).Payload;
|
||||
Assert.Equal(3000, AnalogCodec.Combine(p[6], p[7]));
|
||||
Assert.Equal(3000, device.GetWireAxis(RioAxis.JoystickY));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void VersionRequest_reports_configured_firmware()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user