Skip to content

Commit

Permalink
Merge pull request #25 from WildernessLabs/v1.3.0
Browse files Browse the repository at this point in the history
V1.3.0
  • Loading branch information
patridge authored Aug 29, 2023
2 parents ecb3e47 + a4cdc28 commit f2bf555
Show file tree
Hide file tree
Showing 25 changed files with 727 additions and 200 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/develop-ci.yml
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
29 changes: 29 additions & 0 deletions .github/workflows/main-ci.yml
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The GNSS Sensor Tracker is an open-source, sensor-rich, GNSS/GPS tracking board
</tr>
<tr>
<td>
You can get a Gnss Sensor Tracker fully assembled from the <strong>Wilderness Labs store</strong>.
You can get a Gnss Sensor Tracker fully assembled from the <a href="https://store.wildernesslabs.co/collections/frontpage/products/gnss-sensor-tracker">Wilderness Labs store</a>.
</td>
<td>
It's also designed so that it can be assembled at home for the adventurous. All design files can be found in the <a href="Hardware/Design%20Files/">Hardware Design</a> folder.
Expand Down
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"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Meadow;
using GnssTracker_SQLite_Demo.Models.Data;
using GnssTracker_SQLite_Demo.Models.Logical;
using Meadow;
using Meadow.Logging;
using SQLite;
using System.IO;
using Meadow.Logging;
using GnssTracker_Demo.Models.Data;
using GnssTracker_Demo.Models.Logical;

namespace GnssTracker_Demo.Controllers
namespace GnssTracker_SQLite_Demo.Controllers
{
public static class DatabaseController
{
Expand Down
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")}";
}
}
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
using Meadow;
using Meadow.Foundation.Sensors.Gnss;
using Meadow.Logging;
using Meadow.Peripherals.Sensors.Location.Gnss;
using System;

namespace GnssTracker_Demo.Controllers
namespace GnssTracker_SQLite_Demo.Controllers
{
/// <summary>
/// Responsible for initializing the GPS stuff and running all things GPS
/// </summary>
public static class GnssController
{
public static event EventHandler<GnssPositionInfo> GnssPositionInfoUpdated = delegate { };

private static Logger Log { get => Resolver.Log; }
private static NeoM8? GnssDevice { get; set; }

Check warning on line 12 in Source/Additional Samples/GnssTracker_SQLite_Demo/Controllers/GnssController.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

/// <summary>
/// Last Gnss Position
/// </summary>
public static GnssPositionInfo? LastGnssPositionInfo { get; private set; }

Check warning on line 14 in Source/Additional Samples/GnssTracker_SQLite_Demo/Controllers/GnssController.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

public static void Initialize(NeoM8 gnssDevice)
Expand Down Expand Up @@ -63,7 +55,7 @@ public static void Initialize(NeoM8 gnssDevice)
{
if (positionCourseAndTime.Valid)
{
Log.Debug($"GNSS - Position: LAT: [{positionCourseAndTime.Position.Latitude}], LON: [{positionCourseAndTime.Position.Longitude}]");
Resolver.Log.Debug($"GNSS - Position: LAT: [{positionCourseAndTime.Position.Latitude}], LON: [{positionCourseAndTime.Position.Longitude}]");
LastGnssPositionInfo = positionCourseAndTime;
Expand Down
Loading

0 comments on commit f2bf555

Please sign in to comment.