Added minor input slot display to Controller Readings

This commit is contained in:
Travis Nickles 2020-03-14 16:05:29 -05:00
parent 08018d27a1
commit 942342d3f9
2 changed files with 11 additions and 1 deletions

View File

@ -12,7 +12,8 @@
d:DesignHeight="450" d:DesignWidth="430">
<DockPanel LastChildFill="False">
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
<Label x:Name="inputDelayLb" Content="Input Delay: N/A">
<Label x:Name="inputContNum" Content="#" FontWeight="Bold"/>
<Label x:Name="inputDelayLb" Content="Input Delay: N/A" Margin="8,0,0,0">
<Label.Background>
<SolidColorBrush x:Name="inpuDelayBackBrush" Color="Transparent" />
</Label.Background>

View File

@ -30,6 +30,7 @@ namespace DS4WinWPF.DS4Forms
}
private int deviceNum;
private event EventHandler DeviceNumChanged;
private NonFormTimer readingTimer;
private bool useTimer;
private double lsDead;
@ -113,6 +114,7 @@ namespace DS4WinWPF.DS4Forms
public ControllerReadingsControl()
{
InitializeComponent();
inputContNum.Content = $"#{deviceNum+1}";
readingTimer = new NonFormTimer();
readingTimer.Interval = 1000 / 60.0;
@ -121,6 +123,12 @@ namespace DS4WinWPF.DS4Forms
RsDeadChanged += ChangeRsDeadControls;
SixAxisDeadXChanged += ChangeSixAxisDeadControls;
SixAxisDeadZChanged += ChangeSixAxisDeadControls;
DeviceNumChanged += ControllerReadingsControl_DeviceNumChanged;
}
private void ControllerReadingsControl_DeviceNumChanged(object sender, EventArgs e)
{
inputContNum.Content = $"#{deviceNum+1}";
}
private void ChangeSixAxisDeadControls(object sender, EventArgs e)
@ -150,6 +158,7 @@ namespace DS4WinWPF.DS4Forms
public void UseDevice(int index)
{
deviceNum = index;
DeviceNumChanged?.Invoke(this, EventArgs.Empty);
}
public void EnableControl(bool state)