Skip to content

Commit

Permalink
Xamarin: params
Browse files Browse the repository at this point in the history
  • Loading branch information
meee1 committed Apr 17, 2020
1 parent a4f140b commit f4c73d2
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ protected override void Dispose(bool disposing)
}

rtspCancel.Cancel();
Thread.Sleep(100);
codec.Stop();
codec.Dispose();

Expand Down
9 changes: 2 additions & 7 deletions ExtLibs/Xamarin/Xamarin/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,9 @@ private void clientdata(IAsyncResult ar)

mav.Open(false, true);

mav.getParamListAsync(mav.MAV.sysid, mav.MAV.compid).ConfigureAwait(false);
mav.getParamList();
//mav.getParamListAsync(mav.MAV.sysid, mav.MAV.compid).ConfigureAwait(false);

Forms.Device.BeginInvokeOnMainThread(() =>
{

});


}
catch (Exception ex)
{
Expand Down
8 changes: 2 additions & 6 deletions ExtLibs/Xamarin/Xamarin/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Xamarin.MainPage"
xmlns:pages="clr-namespace:Xamarin">
xmlns:pages="clr-namespace:Xamarin" xmlns:gcsviews="clr-namespace:Xamarin.GCSViews">
<MasterDetailPage.ToolbarItems>
<ToolbarItem Text="toggle radio" Clicked="MenuItem_OnClicked"/>
</MasterDetailPage.ToolbarItems>
<MasterDetailPage.Master>
<pages:MasterDetailPage1Master x:Name="MasterPage" />
</MasterDetailPage.Master>
<MasterDetailPage.Detail>
<NavigationPage>
<x:Arguments>
<pages:FlightData />
</x:Arguments>
</NavigationPage>
<gcsviews:Video></gcsviews:Video>
</MasterDetailPage.Detail>
</MasterDetailPage>
2 changes: 1 addition & 1 deletion ExtLibs/Xamarin/Xamarin/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e
{
}

Detail = new NavigationPage(page);
Detail = page;
IsPresented = false;

try
Expand Down
6 changes: 0 additions & 6 deletions ExtLibs/Xamarin/Xamarin/MasterDetailPage1Detail.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Xamarin.MasterDetailPage1Detail"
Title="Detail">
<ContentPage.ToolbarItems>
<ToolbarItem Text="Example Item"

Order="Primary"
Priority="0" />
</ContentPage.ToolbarItems>
<StackLayout Padding="10">
<Label Text="This is a detail page. To get the 'triple' line icon on each platform add a icon to each platform and update the 'Master' page with an Icon that references it."/>
</StackLayout>
Expand Down
21 changes: 18 additions & 3 deletions ExtLibs/Xamarin/Xamarin/ProgressReporterDialogue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,25 @@ public ProgressReporterDialogue(string title)

_timer = new Timer((c) =>
{
Console.WriteLine("ProgressReporterDialogue _timer run");
if (queue.Count == 0)
{
Console.WriteLine("ProgressReporterDialogue _timer run queue = 0");
return;
}

while (queue.Count > 2)
queue.Dequeue();
while (queue.Count >= 2)
{
var item2 = queue.Dequeue();
Console.WriteLine("Dequeue >=2 " + item2);
}

UserDialogs.Instance.Toast(queue.Dequeue(), TimeSpan.FromSeconds(3));
var item = queue.Dequeue();

Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
{
UserDialogs.Instance.Toast(item, TimeSpan.FromSeconds(3));
});
}, this, 1000, 1000);
}

Expand All @@ -45,13 +57,16 @@ public void Dispose()
public void RunBackgroundOperationAsync()
{
DoWork?.Invoke(this);

_timer.Stop();
//throw new NotImplementedException();
}

Queue<string> queue = new Queue<string>();

public void UpdateProgressAndStatus(int progress, string status)
{
Console.WriteLine("Queue message " + status);
queue.Enqueue(status);
}
}
Expand Down

0 comments on commit f4c73d2

Please sign in to comment.