Skip to content

Commit

Permalink
Replaced MatBlazor with RadzenBlazor.
Browse files Browse the repository at this point in the history
  • Loading branch information
microp11 committed Dec 31, 2019
1 parent a9b7b26 commit fae90e9
Show file tree
Hide file tree
Showing 13 changed files with 174 additions and 90 deletions.
3 changes: 2 additions & 1 deletion ComponentsLibrary/ComponentsLibrary.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand All @@ -8,6 +8,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Analyzers" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.0" />
</ItemGroup>

Expand Down
8 changes: 4 additions & 4 deletions IridiumLive/IridiumLive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyVersion>1.0.0.*</AssemblyVersion>
<AssemblyVersion>1.1.0.*</AssemblyVersion>
<Deterministic>false</Deterministic>
<FileVersion>1.0.0.0</FileVersion>
<Version>1.0.0.0</Version>
<Version>1.1.0.0</Version>
</PropertyGroup>

<ItemGroup>
Expand All @@ -15,15 +15,15 @@
<ItemGroup>
<PackageReference Include="Blazor.Extensions.Logging" Version="1.0.0" />
<PackageReference Include="EntityFramework" Version="6.4.0" />
<PackageReference Include="MatBlazor" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.1.0-preview4.19579.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.Analyzers" Version="3.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.0" />
<PackageReference Include="Radzen.Blazor" Version="2.0.13" />
</ItemGroup>

<ItemGroup>
Expand Down
31 changes: 27 additions & 4 deletions IridiumLive/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,35 @@
<p class="iridium-live-version">@getVersion()</p>

<hr />
<p>This is pre-release software. Issues and crashes are to be expected.</p>
<p>Please log issues or comments at: <a href="https://github.com/microp11/iridiumlive/issues">microp11/iridiumlive/issues</a></p>
<p>This is pre-release software. Issues, crashes, things that are not quite right... they all might be around.</p>
<p>Please log issues or comments at: <a href="https://github.com/microp11/iridiumlive/issues" target="_blank">microp11/iridiumlive/issues</a></p>

@code {
private string version;
<hr />
<h3>To do:</h3>
<ul>
<li>Sats
<ul>
<li>Load button from github for the current sats name and more info about them</li>
<li>Inline editing</li>
</ul>
</li>
<li>Stats
<ul>
<li>Add histograms, quality based</li>
</ul>
</li>
<li>Live
<ul>
<li>Fix and enable sat corridors</li>
<li>Replace sat with its name</li>
<li>Add more info to popups and make them easier to be clicked on</li>
<li>Either fix heat map colors or make them user editable through xml</li>
</ul>
</li>

</ul>

@code {
string getVersion()
{
Assembly currentAssembly = Assembly.GetEntryAssembly();
Expand Down
45 changes: 25 additions & 20 deletions IridiumLive/Pages/Live.razor
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

@if (viewIras == null || liveMap == null || oldViewIras == null)
{
<p>Awaiting for data...</p>
<RadzenProgressBar Value="100" ShowValue="false" Mode="ProgressBarMode.Indeterminate" class="ui-progressbar-2" />
}
else
{
Expand All @@ -27,24 +27,29 @@ else
{
oldViewIras = viewIras;
}
<MatTable Items="@viewIras">
<MatTableHeader>
<th>Sat</th>
<th>Time</th>
<th>Quality</th>
<th>Beam</th>
<th>Coordinates</th>
<th>Altitude</th>
</MatTableHeader>
<MatTableRow>
<td>@context.Name</td>
<td>@context.Time</td>
<td>@context.Quality %</td>
<td>@context.Beam</td>
<td>@context.Lat N @context.Lon E</td>
<td>@string.Format("{0} km", context.Alt)</td>
</MatTableRow>
</MatTable>

<RadzenGrid AllowPaging="true" Data="@viewIras" TItem="ViewIra">
<Columns>
<RadzenGridColumn TItem="ViewIra" Property="Name" Title="Sat" />
<RadzenGridColumn TItem="ViewIra" Property="Time" Title="Time" Width="200px" />
<RadzenGridColumn TItem="ViewIra" Property="Quality" Title="Quality">
<Template Context="context">
@context.Quality %
</Template>
</RadzenGridColumn>
<RadzenGridColumn TItem="ViewIra" Property="Beam" Title="Beam" />
<RadzenGridColumn TItem="ViewIra" Title="Coordinates" Width="120px">
<Template Context="context">
@context.Lat N @context.Lon E
</Template>
</RadzenGridColumn>
<RadzenGridColumn TItem="ViewIra" Title="Altitude">
<Template Context="context">
@string.Format("{0} km", context.Alt)
</Template>
</RadzenGridColumn>
</Columns>
</RadzenGrid>
}

@code {
Expand All @@ -60,7 +65,7 @@ else
{
if (firstRender)
{
lastUtcTicks = DateTimeOffset.Now.AddSeconds(-15).UtcTicks;
lastUtcTicks = 0;
SetLocation(location);
}
StartTimer(interval);
Expand Down
63 changes: 44 additions & 19 deletions IridiumLive/Pages/Playback.razor
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,32 @@
<Map Zoom="4" Location="location" Markers="markers" @ref="liveMap" />
</div>
<p>Red dots indicate the physical satellite position, blue dots indicate signal activity in ground vecinity.</p>
<MatDatePicker Label="From" Enable24hours="true" Format="MM/dd/yy HH:mm" @bind-Value="FromValue" EnableTime="true"></MatDatePicker>
<MatDatePicker Label="To" Enable24hours="true" Format="MM/dd/yy HH:mm" @bind-Value="ToValue" EnableTime="true"></MatDatePicker>
<MatButton Outlined="true" @onclick="LoadDataAsync">Load</MatButton>
<RadzenDatePicker TValue="DateTime" ShowTime="true" @bind-Value="FromValue" DateFormat="MM/dd/yyyy HH:mm" />
<RadzenDatePicker TValue="DateTime" ShowTime="true" @bind-Value="ToValue" DateFormat="MM/dd/yyyy HH:mm" />
<RadzenButton Click="@LoadDataAsync" Icon="replay" Text="Load" ButtonStyle="ButtonStyle.Secondary" Style="position: relative; top: -1px;" />

@if (stats == null || stats.Count == 0)
{
<p>Make your selection...</p>
@if (progressbar)
{
<RadzenProgressBar Value="100" ShowValue="false" Mode="ProgressBarMode.Indeterminate" class="ui-progressbar-2" />
}
else
{
<p></p>
<p>Make your selection...</p>
}
}
else
{
<MatTable Items="@stats">
<MatTableHeader>
<th>Sat</th>
<th>Ring alerts</th>
<th>Broadcasts</th>
</MatTableHeader>
<MatTableRow>
<td>@context.SatNo</td>
<td>@context.Iras</td>
<td>@context.Ibcs</td>
</MatTableRow>
</MatTable>
<p></p>
<RadzenGrid AllowPaging="true" Data="@stats" TItem="Stat">
<Columns>
<RadzenGridColumn TItem="Stat" Property="SatNo" Title="Sat" />
<RadzenGridColumn TItem="Stat" Property="Iras" Title="Ring alerts" />
<RadzenGridColumn TItem="Stat" Property="Ibcs" Title="Broadcasts" />
</Columns>
</RadzenGrid>
}

@code {
Expand All @@ -43,9 +47,10 @@ else
private ICollection<ViewIra> playbackIras;
private ICollection<Stat> stats;
private Map liveMap;
private bool progressbar = false;

public DateTime FromValue { get; set; } = DateTime.Now.AddMinutes(-10).ToLocalTime();
public DateTime ToValue { get; set; } = DateTime.Now.ToLocalTime();
public DateTime FromValue { get; set; } = DateTime.SpecifyKind(DateTime.Now.AddMinutes(-10), DateTimeKind.Local);
public DateTime ToValue { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local);

protected override Task OnAfterRenderAsync(bool firstRender)
{
Expand All @@ -64,10 +69,24 @@ else
await liveMap.ClearMarkers();
}

//display the progress bar
try
{
progressbar = true;
stats = null;
StateHasChanged();
}
finally
{
progressbar = false;
}

//Debug.WriteLine("ReloadOnTimer thread {0}", Thread.CurrentThread.ManagedThreadId);
try
{
playbackIras = await playbackService.GetViewIraAsync(FromValue.ToLocalTime(), ToValue.ToLocalTime());
FromValue = SetKind(FromValue, DateTimeKind.Local);
ToValue = SetKind(ToValue, DateTimeKind.Local);
playbackIras = await playbackService.GetViewIraAsync(FromValue, ToValue);
var playbackira = playbackIras.LastOrDefault();
if (playbackira != null)
{
Expand Down Expand Up @@ -117,4 +136,10 @@ else
{
ButtonState = "Clicked";
}

public static DateTime SetKind(DateTime DT, DateTimeKind DTKind)
{
var NewDT = new DateTime(DT.Year, DT.Month, DT.Day, DT.Hour, DT.Minute, DT.Second, DT.Millisecond, DTKind);
return NewDT;
}
}
40 changes: 23 additions & 17 deletions IridiumLive/Pages/Sats.razor
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,32 @@

@if (sats == null)
{
<p>Loading...</p>
<RadzenProgressBar Value="100" ShowValue="false" Mode="ProgressBarMode.Indeterminate" class="ui-progressbar-2" />
}
else
{
<MatTable Items="@sats">
<MatTableHeader>
<th>Sat</th>
<th>Name</th>
<th>Notes</th>
<th>@satCount</th>
</MatTableHeader>
<MatTableRow>
<td>@context.SatNo</td>
<td>@context.Name</td>
<td>@context.Notes</td>
<td>
<a href='/editsat/@context.Id'>Edit</a>
</td>
</MatTableRow>
</MatTable>
<RadzenDataList WrapItems="true" AllowPaging="true" Data="@sats" TItem="Sat">
<Template Context="sat">
<RadzenCard Style="width:300px;">
<div class="row">
<div class="col-md-6">
<div>Sat:</div>
<b>@sat.SatNo</b>
</div>
<div class="col-md-6">
<div>Name:</div>
<b>@string.Format(new System.Globalization.CultureInfo("en-US"), "{0:C}", @sat.Name)</b>
</div>
<div class="col-lg" style="margin-top: 6px;">
<div>Notes:</div>
<b>@sat.Notes</b>
<hr />
<a href='/editsat/@sat.Id'>Edit</a>
</div>
</div>
</RadzenCard>
</Template>
</RadzenDataList>
}

@code {
Expand Down
21 changes: 8 additions & 13 deletions IridiumLive/Pages/Stats.razor
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,17 @@

@if (stats == null)
{
<p>Loading...</p>
<RadzenProgressBar Value="100" ShowValue="false" Mode="ProgressBarMode.Indeterminate" class="ui-progressbar-2" />
}
else
{
<MatTable Items="@stats">
<MatTableHeader>
<th>Sat</th>
<th>Ring alerts</th>
<th>Broadcasts</th>
</MatTableHeader>
<MatTableRow>
<td>@context.SatNo</td>
<td>@context.Iras</td>
<td>@context.Ibcs</td>
</MatTableRow>
</MatTable>
<RadzenGrid AllowPaging="true" Data="@stats" TItem="Stat">
<Columns>
<RadzenGridColumn TItem="Stat" Property="SatNo" Title="Sat" />
<RadzenGridColumn TItem="Stat" Property="Iras" Title="Ring alerts" />
<RadzenGridColumn TItem="Stat" Property="Ibcs" Title="Broadcasts" />
</Columns>
</RadzenGrid>
}

@code {
Expand Down
3 changes: 2 additions & 1 deletion IridiumLive/Pages/_Host.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/site.css" rel="stylesheet" />
<link href="_content/ComponentsLibrary/leaflet/leaflet.css" rel="stylesheet" />
<link href="_content/Radzen.Blazor/css/default.css" rel="stylesheet">
</head>
<body>
<app>
Expand All @@ -34,8 +35,8 @@

<script src="_framework/blazor.server.js"></script>
<script src="_content/ComponentsLibrary/leaflet/leaflet.js"></script>
<script src="_content/MatBlazor/dist/matBlazor.js"></script>
<script src="_content/ComponentsLibrary/leaflet-corridor.js"></script>
<script src="_content/ComponentsLibrary/deliveryMap.js"></script>
<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>
</body>
</html>
Loading

0 comments on commit fae90e9

Please sign in to comment.