status is now shown by image

This commit is contained in:
shinichi
2020-10-16 10:41:38 +02:00
parent 5280e70feb
commit 29037f1774
4 changed files with 30 additions and 23 deletions

View File

@@ -9,6 +9,8 @@
<ItemGroup> <ItemGroup>
<None Remove="Images\CoolBackground.jpg" /> <None Remove="Images\CoolBackground.jpg" />
<None Remove="Images\Icons\CheckMark.png" />
<None Remove="Images\Icons\CrossMark.png" />
<None Remove="Images\Logo\icon1.ico" /> <None Remove="Images\Logo\icon1.ico" />
<None Remove="Images\re15.jpg" /> <None Remove="Images\re15.jpg" />
<None Remove="Images\stone.png" /> <None Remove="Images\stone.png" />
@@ -18,6 +20,12 @@
<Content Include="Images\CoolBackground.jpg"> <Content Include="Images\CoolBackground.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Images\Icons\CheckMark.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\Icons\CrossMark.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\Logo\icon1.ico"> <Content Include="Images\Logo\icon1.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>

View File

@@ -19,33 +19,21 @@
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Grid.Column="0" Grid.Row="0" Orientation="Horizontal" Margin="10"> <StackPanel Grid.Column="0" Grid.Row="0" Orientation="Horizontal" Margin="20" HorizontalAlignment="Center">
<Label Content="Connected to server:"/> <Label Content="Connected to server:" VerticalAlignment="Center"/>
<Label Content="{Binding Path=MainWindowViewModel.InfoModel.ConnectedToServer}"/> <Image Source="{Binding Converter={StaticResource BoolToMarkConverter},Path=MainWindowViewModel.InfoModel.ConnectedToServer}" Stretch="Uniform" Width="20" Height="20"/>
<Image Source="{Binding Path=MainWindowViewModel.InfoModel.ConnectedToServer, Converter={StaticResource BoolToMarkConverter}}"/>
</StackPanel> </StackPanel>
<StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal" Margin="10"> <StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal" Margin="20" HorizontalAlignment="Center">
<Label Content="Connected to VR-Engine:"/> <Label Content="Connected to VR-Engine:" VerticalAlignment="Center"/>
<Label Content="{Binding Path=MainWindowViewModel.InfoModel.ConnectedToVREngine}"/> <Image Source="{Binding Converter={StaticResource BoolToMarkConverter},Path=MainWindowViewModel.InfoModel.ConnectedToVREngine}" Stretch="Uniform" Width="20" Height="20"/>
</StackPanel> </StackPanel>
<StackPanel Grid.Column="2" Grid.Row="0" Orientation="Horizontal" Margin="10"> <StackPanel Grid.Column="2" Grid.Row="0" Orientation="Horizontal" Margin="20" HorizontalAlignment="Center">
<Label Content="Doctor connected:"/> <Label Content="Doctor connected:" VerticalAlignment="Center"/>
<Label Content="{Binding Path=MainWindowViewModel.InfoModel.DoctorConnected}"/> <Image Source="{Binding Converter={StaticResource BoolToMarkConverter},Path=MainWindowViewModel.InfoModel.DoctorConnected}" Stretch="Uniform" Width="20" Height="20"/>
</StackPanel> </StackPanel>
<Button Grid.Column="0" Grid.Row="1" Command="{Binding RetryServerCommand}" Width="50" Height="20">
<Button.Content>
<TextBlock TextWrapping="Wrap" Text="retry"/>
</Button.Content>
</Button>
</Grid> </Grid>
</DockPanel> </DockPanel>

View File

@@ -2,6 +2,7 @@
using ProftaakRH; using ProftaakRH;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
@@ -92,8 +93,17 @@ namespace Hardware.Simulators
//Generate an ANT message for page 0x10 //Generate an ANT message for page 0x10
private byte[] GenerateBike0x10() private byte[] GenerateBike0x10()
{ {
byte[] bikeByte = { 0x10, Convert.ToByte(equipmentType), Convert.ToByte(elapsedTime * 4 % 64), Convert.ToByte(distanceTraveled), speedArray[0], speedArray[1], Convert.ToByte(BPM), 0xFF }; //SOMEONE FIX THIS!!!!!!!!!
return bikeByte; try
{
byte[] bikeByte = { 0x10, Convert.ToByte(equipmentType), Convert.ToByte(elapsedTime * 4 % 64), Convert.ToByte(distanceTraveled), speedArray[0], speedArray[1], Convert.ToByte(BPM), 0xFF };
return bikeByte;
}
catch (OverflowException e)
{
Debug.WriteLine(e);
return GenerateBike0x10();
}
} }
//Generate an ANT message for BPM //Generate an ANT message for BPM

View File

@@ -74,6 +74,7 @@ namespace RH_Engine
public static string GetID(string json) public static string GetID(string json)
{ {
//TODO fix null
dynamic d = JsonConvert.DeserializeObject(json); dynamic d = JsonConvert.DeserializeObject(json);
return d.id; return d.id;
} }