Develop #10
@@ -9,6 +9,8 @@
|
||||
|
||||
<ItemGroup>
|
||||
<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\re15.jpg" />
|
||||
<None Remove="Images\stone.png" />
|
||||
@@ -18,6 +20,12 @@
|
||||
<Content Include="Images\CoolBackground.jpg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</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">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
||||
@@ -19,33 +19,21 @@
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Column="0" Grid.Row="0" Orientation="Horizontal" Margin="10">
|
||||
<Label Content="Connected to server:"/>
|
||||
<Label Content="{Binding Path=MainWindowViewModel.InfoModel.ConnectedToServer}"/>
|
||||
<Image Source="{Binding Path=MainWindowViewModel.InfoModel.ConnectedToServer, Converter={StaticResource BoolToMarkConverter}}"/>
|
||||
<StackPanel Grid.Column="0" Grid.Row="0" Orientation="Horizontal" Margin="20" HorizontalAlignment="Center">
|
||||
<Label Content="Connected to server:" VerticalAlignment="Center"/>
|
||||
<Image Source="{Binding Converter={StaticResource BoolToMarkConverter},Path=MainWindowViewModel.InfoModel.ConnectedToServer}" Stretch="Uniform" Width="20" Height="20"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal" Margin="10">
|
||||
<Label Content="Connected to VR-Engine:"/>
|
||||
<Label Content="{Binding Path=MainWindowViewModel.InfoModel.ConnectedToVREngine}"/>
|
||||
<StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal" Margin="20" HorizontalAlignment="Center">
|
||||
<Label Content="Connected to VR-Engine:" VerticalAlignment="Center"/>
|
||||
<Image Source="{Binding Converter={StaticResource BoolToMarkConverter},Path=MainWindowViewModel.InfoModel.ConnectedToVREngine}" Stretch="Uniform" Width="20" Height="20"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="2" Grid.Row="0" Orientation="Horizontal" Margin="10">
|
||||
<Label Content="Doctor connected:"/>
|
||||
<Label Content="{Binding Path=MainWindowViewModel.InfoModel.DoctorConnected}"/>
|
||||
<StackPanel Grid.Column="2" Grid.Row="0" Orientation="Horizontal" Margin="20" HorizontalAlignment="Center">
|
||||
<Label Content="Doctor connected:" VerticalAlignment="Center"/>
|
||||
<Image Source="{Binding Converter={StaticResource BoolToMarkConverter},Path=MainWindowViewModel.InfoModel.DoctorConnected}" Stretch="Uniform" Width="20" Height="20"/>
|
||||
</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>
|
||||
|
||||
</DockPanel>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using ProftaakRH;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
@@ -92,8 +93,17 @@ namespace Hardware.Simulators
|
||||
//Generate an ANT message for page 0x10
|
||||
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 };
|
||||
return bikeByte;
|
||||
//SOMEONE FIX THIS!!!!!!!!!
|
||||
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
|
||||
|
||||
@@ -74,6 +74,7 @@ namespace RH_Engine
|
||||
|
||||
public static string GetID(string json)
|
||||
{
|
||||
//TODO fix null
|
||||
dynamic d = JsonConvert.DeserializeObject(json);
|
||||
return d.id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user