-
Notifications
You must be signed in to change notification settings - Fork 4
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 #25 from WildernessLabs/v1.3.0
V1.3.0
- Loading branch information
Showing
25 changed files
with
727 additions
and
200 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Develop Build | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: [ develop ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout Meadow.Logging | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: WildernessLabs/Meadow.Logging | ||
path: Meadow.Logging | ||
ref: develop | ||
|
||
- name: Checkout Meadow.Units | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: WildernessLabs/Meadow.Units | ||
path: Meadow.Units | ||
ref: develop | ||
|
||
- name: Checkout Meadow.Contracts | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: WildernessLabs/Meadow.Contracts | ||
path: Meadow.Contracts | ||
ref: develop | ||
|
||
- name: Checkout Meadow.Core | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: WildernessLabs/Meadow.Core | ||
path: Meadow.Core | ||
ref: develop | ||
|
||
- name: Checkout MQTTnet | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: WildernessLabs/MQTTnet | ||
path: MQTTnet | ||
ref: develop | ||
|
||
- name: Checkout Meadow.Modbus | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: WildernessLabs/Meadow.Modbus | ||
path: Meadow.Modbus | ||
ref: develop | ||
|
||
- name: Checkout Meadow.Foundation | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: WildernessLabs/Meadow.Foundation | ||
path: Meadow.Foundation | ||
ref: develop | ||
|
||
- name: Checkout GNSS_Sensor_Tracker | ||
uses: actions/checkout@v3 | ||
with: | ||
path: GNSS_Sensor_Tracker | ||
ref: develop | ||
|
||
- name: Setup .NET SDK | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: | ||
7.0.x | ||
|
||
- name: Build GNSS_Sensor_Tracker | ||
run: dotnet build -c Release GNSS_Sensor_Tracker/Source/Meadow.GnssTracker.sln |
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,29 @@ | ||
name: Main Build | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
|
||
- name: Checkout GNSS_Sensor_Tracker | ||
uses: actions/checkout@v3 | ||
with: | ||
path: GNSS_Sensor_Tracker | ||
ref: main | ||
|
||
- name: Setup .NET SDK | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: | ||
7.0.x | ||
|
||
- name: Build GNSS_Sensor_Tracker | ||
run: dotnet build -c Release GNSS_Sensor_Tracker/Source/Meadow.GnssTracker.sln |
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
14 changes: 14 additions & 0 deletions
14
Source/Additional Samples/GnssTracker_SQLite_Demo/.vscode/launch.json
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,14 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Deploy", | ||
"type": "meadow", | ||
"request": "launch", | ||
"preLaunchTask": "meadow: Build" | ||
} | ||
] | ||
} |
10 changes: 5 additions & 5 deletions
10
...er_Demo/Controllers/DatabaseController.cs → ...te_Demo/Controllers/DatabaseController.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
162 changes: 162 additions & 0 deletions
162
Source/Additional Samples/GnssTracker_SQLite_Demo/Controllers/DisplayController.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 |
---|---|---|
@@ -0,0 +1,162 @@ | ||
using GnssTracker_SQLite_Demo.Models.Logical; | ||
using Meadow; | ||
using Meadow.Foundation; | ||
using Meadow.Foundation.Graphics; | ||
using Meadow.Foundation.Graphics.MicroLayout; | ||
using Meadow.Logging; | ||
using System; | ||
|
||
namespace GnssTracker_SQLite_Demo.Controllers | ||
{ | ||
public class DisplayController | ||
{ | ||
protected int counter = 0; | ||
protected Logger Log { get => Resolver.Log; } | ||
protected DisplayScreen DisplayScreen { get; set; } | ||
|
||
protected Font12x20 largeFont { get; set; } | ||
protected Font4x8 smallFont { get; set; } | ||
|
||
protected DisplayLabel TempLabel { get; set; } | ||
protected DisplayLabel HumidityLabel { get; set; } | ||
protected DisplayLabel PressureLabel { get; set; } | ||
protected DisplayLabel LatitudeLabel { get; set; } | ||
protected DisplayLabel LongitudeLabel { get; set; } | ||
protected DisplayLabel CounterLabel { get; set; } | ||
|
||
public DisplayController(IGraphicsDisplay display) | ||
{ | ||
largeFont = new Font12x20(); | ||
smallFont = new Font4x8(); | ||
|
||
DisplayScreen = new DisplayScreen(display, RotationType._270Degrees); | ||
} | ||
|
||
public void ShowSplashScreen() | ||
{ | ||
var image = Image.LoadFromResource("GnssTracker_SQLite_Demo.gnss_tracker.bmp"); | ||
|
||
var displayImage = new DisplayImage(0, 0, 250, 122, image) | ||
{ | ||
BackColor = Color.FromHex("#23ABE3"), | ||
HorizontalAlignment = HorizontalAlignment.Center, | ||
VerticalAlignment = VerticalAlignment.Center, | ||
}; | ||
|
||
DisplayScreen.Controls.Add(displayImage); | ||
} | ||
|
||
public void LoadDataScreen() | ||
{ | ||
try | ||
{ | ||
DisplayScreen.Controls.Clear(); | ||
|
||
var box = new DisplayBox(0, 0, DisplayScreen.Width, DisplayScreen.Height) | ||
{ | ||
ForeColor = Color.White, | ||
Filled = true | ||
}; | ||
|
||
var frame = new DisplayBox(5, 5, 240, 112) | ||
{ | ||
ForeColor = Color.Black, | ||
Filled = false | ||
}; | ||
|
||
TempLabel = new DisplayLabel(10, 10, DisplayScreen.Width - 20, largeFont.Height) | ||
{ | ||
Text = $"Temp: 0.00°C", | ||
TextColor = Color.Black, | ||
BackColor = Color.White, | ||
Font = largeFont, | ||
VerticalAlignment = VerticalAlignment.Center, | ||
HorizontalAlignment = HorizontalAlignment.Left | ||
}; | ||
|
||
HumidityLabel = new DisplayLabel(10, 30, DisplayScreen.Width - 20, largeFont.Height) | ||
{ | ||
Text = $"Humidity: 0.00%", | ||
TextColor = Color.Black, | ||
BackColor = Color.White, | ||
Font = largeFont, | ||
VerticalAlignment = VerticalAlignment.Center, | ||
HorizontalAlignment = HorizontalAlignment.Left | ||
}; | ||
|
||
PressureLabel = new DisplayLabel(10, 50, DisplayScreen.Width - 20, largeFont.Height) | ||
{ | ||
Text = $"Pressure: 0.00atm", | ||
TextColor = Color.Black, | ||
BackColor = Color.White, | ||
Font = largeFont, | ||
VerticalAlignment = VerticalAlignment.Center, | ||
HorizontalAlignment = HorizontalAlignment.Left | ||
}; | ||
|
||
LatitudeLabel = new DisplayLabel(10, 72, DisplayScreen.Width - 20, largeFont.Height) | ||
{ | ||
Text = $"Lat: 0°0'0.0\"", | ||
TextColor = Color.White, | ||
BackColor = Color.Red, | ||
Font = largeFont, | ||
VerticalAlignment = VerticalAlignment.Center, | ||
HorizontalAlignment = HorizontalAlignment.Left | ||
}; | ||
|
||
LongitudeLabel = new DisplayLabel(10, 92, DisplayScreen.Width - 20, largeFont.Height) | ||
{ | ||
Text = $"Lon: 0°0'0.0\"", | ||
TextColor = Color.White, | ||
BackColor = Color.Red, | ||
Font = largeFont, | ||
VerticalAlignment = VerticalAlignment.Center, | ||
HorizontalAlignment = HorizontalAlignment.Left | ||
}; | ||
|
||
counter++; | ||
CounterLabel = new DisplayLabel(222, 113, 20, 8) | ||
{ | ||
Text = $"{counter.ToString("D4")}", | ||
TextColor = Color.Black, | ||
BackColor = Color.White, | ||
Font = smallFont, | ||
VerticalAlignment = VerticalAlignment.Center, | ||
HorizontalAlignment = HorizontalAlignment.Center | ||
}; | ||
|
||
DisplayScreen.Controls.Add(box, frame, TempLabel, HumidityLabel, PressureLabel, LatitudeLabel, LongitudeLabel, CounterLabel); | ||
} | ||
catch (Exception e) | ||
{ | ||
Log?.Error($"err while rendering: {e.Message}"); | ||
} | ||
} | ||
|
||
public void UpdateDisplay(AtmosphericModel conditions, LocationModel locationInfo) | ||
{ | ||
TempLabel.Text = $"Temp: {conditions.Temperature?.Celsius:n2}°C"; | ||
HumidityLabel.Text = $"Humidity: {conditions.RelativeHumidity?.Percent:n2}%"; | ||
PressureLabel.Text = $"Pressure: {conditions.Pressure?.StandardAtmosphere:n2}atm"; | ||
|
||
string lat = locationInfo.PositionInformation == null | ||
? $"Lat: 0°0'0.0\"" | ||
: $"Lat: " + | ||
$"{locationInfo.PositionInformation?.Position?.Latitude?.Degrees}°" + | ||
$"{locationInfo.PositionInformation?.Position?.Latitude?.Minutes:n2}'" + | ||
$"{locationInfo.PositionInformation?.Position?.Latitude?.seconds}\""; | ||
LatitudeLabel.Text = lat; | ||
|
||
string lon = locationInfo.PositionInformation == null | ||
? $"Lon: 0°0'0.0\"" | ||
: $"Lon: " + | ||
$"{locationInfo.PositionInformation?.Position?.Longitude?.Degrees}°" + | ||
$"{locationInfo.PositionInformation?.Position?.Longitude?.Minutes:n2}'" + | ||
$"{locationInfo.PositionInformation?.Position?.Longitude?.seconds}\""; | ||
LongitudeLabel.Text = lon; | ||
|
||
counter++; | ||
CounterLabel.Text = $"{counter.ToString("D4")}"; | ||
} | ||
} | ||
} |
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.