Skip to content

Commit fae90e9

Browse files
committed
Replaced MatBlazor with RadzenBlazor.
1 parent a9b7b26 commit fae90e9

File tree

13 files changed

+174
-90
lines changed

13 files changed

+174
-90
lines changed

ComponentsLibrary/ComponentsLibrary.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Razor">
1+
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
@@ -8,6 +8,7 @@
88

99
<ItemGroup>
1010
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.0" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components.Analyzers" Version="3.1.0" />
1112
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.0" />
1213
</ItemGroup>
1314

IridiumLive/IridiumLive.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
5-
<AssemblyVersion>1.0.0.*</AssemblyVersion>
5+
<AssemblyVersion>1.1.0.*</AssemblyVersion>
66
<Deterministic>false</Deterministic>
77
<FileVersion>1.0.0.0</FileVersion>
8-
<Version>1.0.0.0</Version>
8+
<Version>1.1.0.0</Version>
99
</PropertyGroup>
1010

1111
<ItemGroup>
@@ -15,15 +15,15 @@
1515
<ItemGroup>
1616
<PackageReference Include="Blazor.Extensions.Logging" Version="1.0.0" />
1717
<PackageReference Include="EntityFramework" Version="6.4.0" />
18-
<PackageReference Include="MatBlazor" Version="2.0.0" />
19-
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.1.0-preview4.19579.2" />
18+
<PackageReference Include="Microsoft.AspNetCore.Components.Analyzers" Version="3.1.0" />
2019
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.0" />
2120
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.0">
2221
<PrivateAssets>all</PrivateAssets>
2322
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2423
</PackageReference>
2524
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.0" />
2625
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.0" />
26+
<PackageReference Include="Radzen.Blazor" Version="2.0.13" />
2727
</ItemGroup>
2828

2929
<ItemGroup>

IridiumLive/Pages/Index.razor

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,35 @@
66
<p class="iridium-live-version">@getVersion()</p>
77

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

12-
@code {
13-
private string version;
12+
<hr />
13+
<h3>To do:</h3>
14+
<ul>
15+
<li>Sats
16+
<ul>
17+
<li>Load button from github for the current sats name and more info about them</li>
18+
<li>Inline editing</li>
19+
</ul>
20+
</li>
21+
<li>Stats
22+
<ul>
23+
<li>Add histograms, quality based</li>
24+
</ul>
25+
</li>
26+
<li>Live
27+
<ul>
28+
<li>Fix and enable sat corridors</li>
29+
<li>Replace sat with its name</li>
30+
<li>Add more info to popups and make them easier to be clicked on</li>
31+
<li>Either fix heat map colors or make them user editable through xml</li>
32+
</ul>
33+
</li>
1434

35+
</ul>
36+
37+
@code {
1538
string getVersion()
1639
{
1740
Assembly currentAssembly = Assembly.GetEntryAssembly();

IridiumLive/Pages/Live.razor

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
@if (viewIras == null || liveMap == null || oldViewIras == null)
1717
{
18-
<p>Awaiting for data...</p>
18+
<RadzenProgressBar Value="100" ShowValue="false" Mode="ProgressBarMode.Indeterminate" class="ui-progressbar-2" />
1919
}
2020
else
2121
{
@@ -27,24 +27,29 @@ else
2727
{
2828
oldViewIras = viewIras;
2929
}
30-
<MatTable Items="@viewIras">
31-
<MatTableHeader>
32-
<th>Sat</th>
33-
<th>Time</th>
34-
<th>Quality</th>
35-
<th>Beam</th>
36-
<th>Coordinates</th>
37-
<th>Altitude</th>
38-
</MatTableHeader>
39-
<MatTableRow>
40-
<td>@context.Name</td>
41-
<td>@context.Time</td>
42-
<td>@context.Quality %</td>
43-
<td>@context.Beam</td>
44-
<td>@context.Lat N @context.Lon E</td>
45-
<td>@string.Format("{0} km", context.Alt)</td>
46-
</MatTableRow>
47-
</MatTable>
30+
31+
<RadzenGrid AllowPaging="true" Data="@viewIras" TItem="ViewIra">
32+
<Columns>
33+
<RadzenGridColumn TItem="ViewIra" Property="Name" Title="Sat" />
34+
<RadzenGridColumn TItem="ViewIra" Property="Time" Title="Time" Width="200px" />
35+
<RadzenGridColumn TItem="ViewIra" Property="Quality" Title="Quality">
36+
<Template Context="context">
37+
@context.Quality %
38+
</Template>
39+
</RadzenGridColumn>
40+
<RadzenGridColumn TItem="ViewIra" Property="Beam" Title="Beam" />
41+
<RadzenGridColumn TItem="ViewIra" Title="Coordinates" Width="120px">
42+
<Template Context="context">
43+
@context.Lat N @context.Lon E
44+
</Template>
45+
</RadzenGridColumn>
46+
<RadzenGridColumn TItem="ViewIra" Title="Altitude">
47+
<Template Context="context">
48+
@string.Format("{0} km", context.Alt)
49+
</Template>
50+
</RadzenGridColumn>
51+
</Columns>
52+
</RadzenGrid>
4853
}
4954

5055
@code {
@@ -60,7 +65,7 @@ else
6065
{
6166
if (firstRender)
6267
{
63-
lastUtcTicks = DateTimeOffset.Now.AddSeconds(-15).UtcTicks;
68+
lastUtcTicks = 0;
6469
SetLocation(location);
6570
}
6671
StartTimer(interval);

IridiumLive/Pages/Playback.razor

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,32 @@
1212
<Map Zoom="4" Location="location" Markers="markers" @ref="liveMap" />
1313
</div>
1414
<p>Red dots indicate the physical satellite position, blue dots indicate signal activity in ground vecinity.</p>
15-
<MatDatePicker Label="From" Enable24hours="true" Format="MM/dd/yy HH:mm" @bind-Value="FromValue" EnableTime="true"></MatDatePicker>
16-
<MatDatePicker Label="To" Enable24hours="true" Format="MM/dd/yy HH:mm" @bind-Value="ToValue" EnableTime="true"></MatDatePicker>
17-
<MatButton Outlined="true" @onclick="LoadDataAsync">Load</MatButton>
15+
<RadzenDatePicker TValue="DateTime" ShowTime="true" @bind-Value="FromValue" DateFormat="MM/dd/yyyy HH:mm" />
16+
<RadzenDatePicker TValue="DateTime" ShowTime="true" @bind-Value="ToValue" DateFormat="MM/dd/yyyy HH:mm" />
17+
<RadzenButton Click="@LoadDataAsync" Icon="replay" Text="Load" ButtonStyle="ButtonStyle.Secondary" Style="position: relative; top: -1px;" />
1818

1919
@if (stats == null || stats.Count == 0)
2020
{
21-
<p>Make your selection...</p>
21+
@if (progressbar)
22+
{
23+
<RadzenProgressBar Value="100" ShowValue="false" Mode="ProgressBarMode.Indeterminate" class="ui-progressbar-2" />
24+
}
25+
else
26+
{
27+
<p></p>
28+
<p>Make your selection...</p>
29+
}
2230
}
2331
else
2432
{
25-
<MatTable Items="@stats">
26-
<MatTableHeader>
27-
<th>Sat</th>
28-
<th>Ring alerts</th>
29-
<th>Broadcasts</th>
30-
</MatTableHeader>
31-
<MatTableRow>
32-
<td>@context.SatNo</td>
33-
<td>@context.Iras</td>
34-
<td>@context.Ibcs</td>
35-
</MatTableRow>
36-
</MatTable>
33+
<p></p>
34+
<RadzenGrid AllowPaging="true" Data="@stats" TItem="Stat">
35+
<Columns>
36+
<RadzenGridColumn TItem="Stat" Property="SatNo" Title="Sat" />
37+
<RadzenGridColumn TItem="Stat" Property="Iras" Title="Ring alerts" />
38+
<RadzenGridColumn TItem="Stat" Property="Ibcs" Title="Broadcasts" />
39+
</Columns>
40+
</RadzenGrid>
3741
}
3842

3943
@code {
@@ -43,9 +47,10 @@ else
4347
private ICollection<ViewIra> playbackIras;
4448
private ICollection<Stat> stats;
4549
private Map liveMap;
50+
private bool progressbar = false;
4651

47-
public DateTime FromValue { get; set; } = DateTime.Now.AddMinutes(-10).ToLocalTime();
48-
public DateTime ToValue { get; set; } = DateTime.Now.ToLocalTime();
52+
public DateTime FromValue { get; set; } = DateTime.SpecifyKind(DateTime.Now.AddMinutes(-10), DateTimeKind.Local);
53+
public DateTime ToValue { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local);
4954

5055
protected override Task OnAfterRenderAsync(bool firstRender)
5156
{
@@ -64,10 +69,24 @@ else
6469
await liveMap.ClearMarkers();
6570
}
6671

72+
//display the progress bar
73+
try
74+
{
75+
progressbar = true;
76+
stats = null;
77+
StateHasChanged();
78+
}
79+
finally
80+
{
81+
progressbar = false;
82+
}
83+
6784
//Debug.WriteLine("ReloadOnTimer thread {0}", Thread.CurrentThread.ManagedThreadId);
6885
try
6986
{
70-
playbackIras = await playbackService.GetViewIraAsync(FromValue.ToLocalTime(), ToValue.ToLocalTime());
87+
FromValue = SetKind(FromValue, DateTimeKind.Local);
88+
ToValue = SetKind(ToValue, DateTimeKind.Local);
89+
playbackIras = await playbackService.GetViewIraAsync(FromValue, ToValue);
7190
var playbackira = playbackIras.LastOrDefault();
7291
if (playbackira != null)
7392
{
@@ -117,4 +136,10 @@ else
117136
{
118137
ButtonState = "Clicked";
119138
}
139+
140+
public static DateTime SetKind(DateTime DT, DateTimeKind DTKind)
141+
{
142+
var NewDT = new DateTime(DT.Year, DT.Month, DT.Day, DT.Hour, DT.Minute, DT.Second, DT.Millisecond, DTKind);
143+
return NewDT;
144+
}
120145
}

IridiumLive/Pages/Sats.razor

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,32 @@
1010

1111
@if (sats == null)
1212
{
13-
<p>Loading...</p>
13+
<RadzenProgressBar Value="100" ShowValue="false" Mode="ProgressBarMode.Indeterminate" class="ui-progressbar-2" />
1414
}
1515
else
1616
{
17-
<MatTable Items="@sats">
18-
<MatTableHeader>
19-
<th>Sat</th>
20-
<th>Name</th>
21-
<th>Notes</th>
22-
<th>@satCount</th>
23-
</MatTableHeader>
24-
<MatTableRow>
25-
<td>@context.SatNo</td>
26-
<td>@context.Name</td>
27-
<td>@context.Notes</td>
28-
<td>
29-
<a href='/editsat/@context.Id'>Edit</a>
30-
</td>
31-
</MatTableRow>
32-
</MatTable>
17+
<RadzenDataList WrapItems="true" AllowPaging="true" Data="@sats" TItem="Sat">
18+
<Template Context="sat">
19+
<RadzenCard Style="width:300px;">
20+
<div class="row">
21+
<div class="col-md-6">
22+
<div>Sat:</div>
23+
<b>@sat.SatNo</b>
24+
</div>
25+
<div class="col-md-6">
26+
<div>Name:</div>
27+
<b>@string.Format(new System.Globalization.CultureInfo("en-US"), "{0:C}", @sat.Name)</b>
28+
</div>
29+
<div class="col-lg" style="margin-top: 6px;">
30+
<div>Notes:</div>
31+
<b>@sat.Notes</b>
32+
<hr />
33+
<a href='/editsat/@sat.Id'>Edit</a>
34+
</div>
35+
</div>
36+
</RadzenCard>
37+
</Template>
38+
</RadzenDataList>
3339
}
3440

3541
@code {

IridiumLive/Pages/Stats.razor

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,17 @@
1212

1313
@if (stats == null)
1414
{
15-
<p>Loading...</p>
15+
<RadzenProgressBar Value="100" ShowValue="false" Mode="ProgressBarMode.Indeterminate" class="ui-progressbar-2" />
1616
}
1717
else
1818
{
19-
<MatTable Items="@stats">
20-
<MatTableHeader>
21-
<th>Sat</th>
22-
<th>Ring alerts</th>
23-
<th>Broadcasts</th>
24-
</MatTableHeader>
25-
<MatTableRow>
26-
<td>@context.SatNo</td>
27-
<td>@context.Iras</td>
28-
<td>@context.Ibcs</td>
29-
</MatTableRow>
30-
</MatTable>
19+
<RadzenGrid AllowPaging="true" Data="@stats" TItem="Stat">
20+
<Columns>
21+
<RadzenGridColumn TItem="Stat" Property="SatNo" Title="Sat" />
22+
<RadzenGridColumn TItem="Stat" Property="Iras" Title="Ring alerts" />
23+
<RadzenGridColumn TItem="Stat" Property="Ibcs" Title="Broadcasts" />
24+
</Columns>
25+
</RadzenGrid>
3126
}
3227

3328
@code {

IridiumLive/Pages/_Host.cshtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
1616
<link href="css/site.css" rel="stylesheet" />
1717
<link href="_content/ComponentsLibrary/leaflet/leaflet.css" rel="stylesheet" />
18+
<link href="_content/Radzen.Blazor/css/default.css" rel="stylesheet">
1819
</head>
1920
<body>
2021
<app>
@@ -34,8 +35,8 @@
3435

3536
<script src="_framework/blazor.server.js"></script>
3637
<script src="_content/ComponentsLibrary/leaflet/leaflet.js"></script>
37-
<script src="_content/MatBlazor/dist/matBlazor.js"></script>
3838
<script src="_content/ComponentsLibrary/leaflet-corridor.js"></script>
3939
<script src="_content/ComponentsLibrary/deliveryMap.js"></script>
40+
<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>
4041
</body>
4142
</html>

0 commit comments

Comments
 (0)