Skip to content
Snippets Groups Projects
Commit 69e4027c authored by Paul-Winpenny's avatar Paul-Winpenny
Browse files

Requesting the new map is now a button in the top left of the page

parent dc744f46
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ namespace RobobinApp.ViewModels ...@@ -29,6 +29,7 @@ namespace RobobinApp.ViewModels
public ObservableCollection<Graph> Graphs { get; } public ObservableCollection<Graph> Graphs { get; }
public ICommand SelectGraphCommand { get; } public ICommand SelectGraphCommand { get; }
public ICommand ToggleModeCommand { get; } public ICommand ToggleModeCommand { get; }
public ICommand GetNewGraphCommand { get; }
public Graph Graph public Graph Graph
{ {
get => _selectedGraph; get => _selectedGraph;
...@@ -55,6 +56,7 @@ namespace RobobinApp.ViewModels ...@@ -55,6 +56,7 @@ namespace RobobinApp.ViewModels
ConnectToRobobinCommand = new Command(async () => await OnConnectToRobobin()); ConnectToRobobinCommand = new Command(async () => await OnConnectToRobobin());
ToggleModeCommand = new Command(async () => await OnToggleMode()); ToggleModeCommand = new Command(async () => await OnToggleMode());
GetNewGraphCommand = new Command(async () => await GetNewGraph());
var graphNodes1 = new List<Node> var graphNodes1 = new List<Node>
{ {
...@@ -110,6 +112,10 @@ namespace RobobinApp.ViewModels ...@@ -110,6 +112,10 @@ namespace RobobinApp.ViewModels
Graph = Graphs.First(); Graph = Graphs.First();
} }
private async Task GetNewGraph()
{
await App.WifiManager.SendMessageAsync("REQMAP");
}
public static (float magnitude, float angle)[,] CalculatePolarConnections(List<Node> nodes, bool[,] connections) public static (float magnitude, float angle)[,] CalculatePolarConnections(List<Node> nodes, bool[,] connections)
{ {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
VerticalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
Grid.Column="0" Grid.Row="0"> Grid.Column="0" Grid.Row="0">
<HorizontalStackLayout HorizontalOptions="Start" VerticalOptions="End"> <HorizontalStackLayout HorizontalOptions="Start" VerticalOptions="End">
<Button Text="Get Graph" Command="{Binding ConnectToRobobinCommand}"/> <Button Text="Get Graph" Command="{Binding GetNewGraphCommand}"/>
<Button Text="Setup" Command="{Binding ConnectToRobobinCommand}"/> <Button Text="Setup" Command="{Binding ConnectToRobobinCommand}"/>
</HorizontalStackLayout> </HorizontalStackLayout>
<sides:ModeBox /> <sides:ModeBox />
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
HorizontalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"
VerticalOptions="Start"> VerticalOptions="Start">
<HorizontalStackLayout HorizontalOptions="Start" VerticalOptions="End"> <HorizontalStackLayout HorizontalOptions="Start" VerticalOptions="End">
<Button Text="Admin" Command="{Binding ConnectToRobobinCommand}"/> <Button Text="Get Graph" Command="{Binding GetNewGraphCommand}"/>
<Button Text="Setup" Command="{Binding ConnectToRobobinCommand}"/> <Button Text="Setup" Command="{Binding ConnectToRobobinCommand}"/>
<Button Text="Info" Command= "{Binding GoToHelpPage}"/> <Button Text="Info" Command= "{Binding GoToHelpPage}"/>
<Button Text="Switch Mode (Follow/Call)" Command="{Binding ToggleModeCommand}"/> <Button Text="Switch Mode (Follow/Call)" Command="{Binding ToggleModeCommand}"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment