Add labels to the DIP switch display.

master
Glenn Maynard 6 years ago
parent f806ad8a00
commit def39becf9
  1. 10
      smx-config/DiagnosticsWidgets.cs
  2. 28
      smx-config/MainWindow.xaml
  3. BIN
      smx-config/Resources/DIP labels.png
  4. 3
      smx-config/SMXConfig.csproj

@ -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,24 +612,41 @@ 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" />
<Grid>
<Image
x:Name="DIPLabelLeft"
Source="Resources/DIP labels.png"
Width="16" Height="100"
Margin="-68 0 0 0"
VerticalAlignment="Center" HorizontalAlignment="Center"
/>
<controls:FrameImage <controls:FrameImage
Image="Resources/DIP.png" Image="Resources/DIP.png"
x:Name="CurrentDIP" x:Name="CurrentDIP"
FramesX="16" FramesX="16"
Frame="1" Frame="1"
Width="60" Width="60" Height="100"
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" />
<Grid>
<Image
x:Name="DIPLabelRight"
Source="Resources/DIP labels.png"
Width="16" Height="100"
Margin="68 0 0 0"
VerticalAlignment="Center" HorizontalAlignment="Center"
/>
<controls:FrameImage <controls:FrameImage
Image="Resources/DIP.png" Image="Resources/DIP.png"
x:Name="ExpectedDIP" x:Name="ExpectedDIP"
@ -638,6 +655,7 @@ Use if the platform is too sensitive.</clr:String>
Width="60" Width="60"
Height="100" Height="100"
/> />
</Grid>
</StackPanel> </StackPanel>
</Grid> </Grid>
</ControlTemplate> </ControlTemplate>

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.

Loading…
Cancel
Save