-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from Delubear/Rewrite
.Net 6 Update and App Streamlining
- Loading branch information
Showing
39 changed files
with
283 additions
and
552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
GlucoseTrayCore/Enums/AlertLevel.cs → GlucoseTray/Enums/AlertLevel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace GlucoseTrayCore.Enums | ||
namespace GlucoseTray.Enums | ||
{ | ||
public enum AlertLevel | ||
{ | ||
|
2 changes: 1 addition & 1 deletion
2
GlucoseTrayCore/Enums/DexcomServer.cs → GlucoseTray/Enums/DexcomServer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
GlucoseTrayCore/Enums/FetchMethod.cs → GlucoseTray/Enums/FetchMethod.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace GlucoseTrayCore.Enums | ||
namespace GlucoseTray.Enums | ||
{ | ||
public enum FetchMethod | ||
{ | ||
|
2 changes: 1 addition & 1 deletion
2
GlucoseTrayCore/Enums/GlucoseUnitType.cs → GlucoseTray/Enums/GlucoseUnitType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace GlucoseTrayCore.Enums | ||
namespace GlucoseTray.Enums | ||
{ | ||
public enum GlucoseUnitType | ||
{ | ||
|
2 changes: 1 addition & 1 deletion
2
GlucoseTrayCore/Enums/TrendResult.cs → GlucoseTray/Enums/TrendResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace GlucoseTrayCore.Enums | ||
namespace GlucoseTray.Enums | ||
{ | ||
public enum TrendResult | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace GlucoseTrayCore.Enums | ||
namespace GlucoseTray.Enums | ||
{ | ||
public enum UpDown | ||
{ | ||
|
14 changes: 5 additions & 9 deletions
14
...xtensions/GlucoseFetchResultExtensions.cs → ...xtensions/GlucoseFetchResultExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
using GlucoseTrayCore.Enums; | ||
using GlucoseTrayCore.Models; | ||
using GlucoseTray.Enums; | ||
using GlucoseTray.Models; | ||
|
||
namespace GlucoseTrayCore.Extensions | ||
namespace GlucoseTray.Extensions | ||
{ | ||
public static class GlucoseFetchResultExtensions | ||
{ | ||
public static string GetFormattedStringValue(this GlucoseResult fetchResult, GlucoseUnitType type) => type == GlucoseUnitType.MG ? fetchResult.MgValue.ToString() : fetchResult.MmolValue.ToString("0.0"); | ||
|
||
public static bool IsStale(this GlucoseResult fetchResult, int minutes) | ||
{ | ||
var ts = System.DateTime.Now.ToUniversalTime() - fetchResult.DateTimeUTC; | ||
return ts.TotalMinutes > minutes; | ||
} | ||
public static bool IsStale(this GlucoseResult fetchResult, int minutes) => (System.DateTime.Now.ToUniversalTime() - fetchResult.DateTimeUTC).TotalMinutes > minutes; | ||
|
||
public static string StaleMessage(this GlucoseResult fetchResult, int minutes) | ||
{ | ||
var ts = System.DateTime.Now.ToUniversalTime() - fetchResult.DateTimeUTC; | ||
return ts.TotalMinutes > minutes ? $"\r\n{ts.TotalMinutes:#} minutes ago" : ""; | ||
return ts.TotalMinutes > minutes ? $"\r\n{ts.TotalMinutes:#} minutes ago" : string.Empty; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using GlucoseTray.Enums; | ||
|
||
namespace GlucoseTray.Extensions | ||
{ | ||
public static class StringExtensions | ||
{ | ||
public static string GetTrendArrow(this TrendResult input) | ||
{ | ||
return input switch | ||
{ | ||
TrendResult.TripleUp => "⤊", | ||
TrendResult.DoubleUp => "⮅", | ||
TrendResult.SingleUp => "↑", | ||
TrendResult.FortyFiveUp => "↗", | ||
TrendResult.Flat => "→", | ||
TrendResult.FortFiveDown => "↘", | ||
TrendResult.SingleDown => "↓", | ||
TrendResult.DoubleDown => "⮇", | ||
TrendResult.TripleDown => "⤋", | ||
TrendResult.Unknown => "Unknown", | ||
_ => string.Empty, | ||
}; | ||
} | ||
|
||
public static TrendResult GetTrend(this string direction) | ||
{ | ||
// Values for Direction copied from https://github.com/nightscout/cgm-remote-monitor/blob/41ac93f7217b1b7023ec6ad6fc35d29dcf2e4f88/lib/plugins/direction.js | ||
return direction switch | ||
{ | ||
"TripleUp" => TrendResult.TripleUp, | ||
"DoubleUp" => TrendResult.DoubleUp, | ||
"SingleUp" => TrendResult.SingleUp, | ||
"FortyFiveUp" => TrendResult.FortyFiveUp, | ||
"Flat" => TrendResult.Flat, | ||
"FortyFiveDown" => TrendResult.FortFiveDown, | ||
"SingleDown" => TrendResult.SingleDown, | ||
"DoubleDown" => TrendResult.DoubleDown, | ||
"TripleDown" => TrendResult.TripleDown, | ||
_ => TrendResult.Unknown, | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.