Add labels to the DIP switch display.
This commit is contained in:
parent
f806ad8a00
commit
def39becf9
@ -147,6 +147,7 @@ namespace smx_config
|
|||||||
private FrameworkElement NoResponseFromPanel;
|
private FrameworkElement NoResponseFromPanel;
|
||||||
private FrameworkElement NoResponseFromSensors;
|
private FrameworkElement NoResponseFromSensors;
|
||||||
private FrameworkElement P1Diagnostics, P2Diagnostics;
|
private FrameworkElement P1Diagnostics, P2Diagnostics;
|
||||||
|
private FrameworkElement DIPLabelLeft, DIPLabelRight;
|
||||||
|
|
||||||
public delegate void ShowAllLightsEvent(bool on);
|
public delegate void ShowAllLightsEvent(bool on);
|
||||||
public event ShowAllLightsEvent SetShowAllLights;
|
public event ShowAllLightsEvent SetShowAllLights;
|
||||||
@ -178,6 +179,9 @@ namespace smx_config
|
|||||||
// Only show the mode dropdown in debug mode. In regular use, just show calibrated values.
|
// Only show the mode dropdown in debug mode. In regular use, just show calibrated values.
|
||||||
DiagnosticMode.Visibility = Helpers.GetDebug()? Visibility.Visible:Visibility.Collapsed;
|
DiagnosticMode.Visibility = Helpers.GetDebug()? Visibility.Visible:Visibility.Collapsed;
|
||||||
|
|
||||||
|
DIPLabelRight = Template.FindName("DIPLabelRight", this) as FrameworkElement;
|
||||||
|
DIPLabelLeft = Template.FindName("DIPLabelLeft", this) as FrameworkElement;
|
||||||
|
|
||||||
Button Recalibrate = Template.FindName("Recalibrate", this) as Button;
|
Button Recalibrate = Template.FindName("Recalibrate", this) as Button;
|
||||||
Recalibrate.Click += delegate(object sender, RoutedEventArgs e)
|
Recalibrate.Click += delegate(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
@ -251,6 +255,12 @@ namespace smx_config
|
|||||||
AnySensorsNotResponding = args.controller[SelectedPad].test_data.AnySensorsOnPanelNotResponding(PanelIndex);
|
AnySensorsNotResponding = args.controller[SelectedPad].test_data.AnySensorsOnPanelNotResponding(PanelIndex);
|
||||||
NoResponseFromSensors.Visibility = AnySensorsNotResponding? Visibility.Visible:Visibility.Collapsed;
|
NoResponseFromSensors.Visibility = AnySensorsNotResponding? Visibility.Visible:Visibility.Collapsed;
|
||||||
|
|
||||||
|
// Adjust the DIP labels to match the PCB.
|
||||||
|
SMX.SMXConfig config = ActivePad.GetFirstActivePadConfig(args);
|
||||||
|
bool DIPLabelsOnLeft = config.masterVersion < 4;
|
||||||
|
DIPLabelRight.Visibility = DIPLabelsOnLeft? Visibility.Collapsed:Visibility.Visible;
|
||||||
|
DIPLabelLeft.Visibility = DIPLabelsOnLeft? Visibility.Visible:Visibility.Collapsed;
|
||||||
|
|
||||||
// Update the level bar from the test mode data for the selected panel.
|
// Update the level bar from the test mode data for the selected panel.
|
||||||
for(int sensor = 0; sensor < 4; ++sensor)
|
for(int sensor = 0; sensor < 4; ++sensor)
|
||||||
{
|
{
|
||||||
|
@ -612,32 +612,50 @@ Use if the platform is too sensitive.</clr:String>
|
|||||||
|
|
||||||
<StackPanel Orientation="Vertical"
|
<StackPanel Orientation="Vertical"
|
||||||
HorizontalAlignment="Left" VerticalAlignment="Top"
|
HorizontalAlignment="Left" VerticalAlignment="Top"
|
||||||
Margin="300,350,0,0"
|
Margin="320,350,0,0"
|
||||||
>
|
>
|
||||||
<TextBlock Text="Current DIP"/>
|
<TextBlock Text="Current DIP" HorizontalAlignment="Center" />
|
||||||
<controls:FrameImage
|
<Grid>
|
||||||
Image="Resources/DIP.png"
|
<Image
|
||||||
x:Name="CurrentDIP"
|
x:Name="DIPLabelLeft"
|
||||||
FramesX="16"
|
Source="Resources/DIP labels.png"
|
||||||
Frame="1"
|
Width="16" Height="100"
|
||||||
Width="60"
|
Margin="-68 0 0 0"
|
||||||
Height="100"
|
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||||
/>
|
/>
|
||||||
|
<controls:FrameImage
|
||||||
|
Image="Resources/DIP.png"
|
||||||
|
x:Name="CurrentDIP"
|
||||||
|
FramesX="16"
|
||||||
|
Frame="1"
|
||||||
|
Width="60" Height="100"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Orientation="Vertical"
|
<StackPanel Orientation="Vertical"
|
||||||
HorizontalAlignment="Left" VerticalAlignment="Top"
|
HorizontalAlignment="Left" VerticalAlignment="Top"
|
||||||
Margin="400,350,0,0"
|
Margin="400,350,0,0"
|
||||||
>
|
>
|
||||||
<TextBlock Text="Expected DIP"/>
|
<TextBlock Text="Expected DIP" HorizontalAlignment="Center" />
|
||||||
<controls:FrameImage
|
<Grid>
|
||||||
Image="Resources/DIP.png"
|
<Image
|
||||||
x:Name="ExpectedDIP"
|
x:Name="DIPLabelRight"
|
||||||
FramesX="16"
|
Source="Resources/DIP labels.png"
|
||||||
Frame="1"
|
Width="16" Height="100"
|
||||||
Width="60"
|
Margin="68 0 0 0"
|
||||||
Height="100"
|
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||||
/>
|
/>
|
||||||
|
<controls:FrameImage
|
||||||
|
Image="Resources/DIP.png"
|
||||||
|
x:Name="ExpectedDIP"
|
||||||
|
FramesX="16"
|
||||||
|
Frame="1"
|
||||||
|
Width="60"
|
||||||
|
Height="100"
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
BIN
smx-config/Resources/DIP labels.png
Normal file
BIN
smx-config/Resources/DIP labels.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
@ -209,6 +209,9 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Resources\window icon.ico" />
|
<Resource Include="Resources\window icon.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\DIP labels.png" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
@ -217,4 +220,4 @@
|
|||||||
<Target Name="AfterBuild">
|
<Target Name="AfterBuild">
|
||||||
</Target>
|
</Target>
|
||||||
-->
|
-->
|
||||||
</Project>
|
</Project>
|
Loading…
x
Reference in New Issue
Block a user