From 5d3da334b42a8901255b2b78c2f14daa66615490 Mon Sep 17 00:00:00 2001 From: panaaj <38519157+panaaj@users.noreply.github.com> Date: Sun, 8 Sep 2024 16:23:25 +0930 Subject: [PATCH] Radar scaffold --- CHANGELOG.md | 6 +- src/app/app.settings.ts | 9 +- .../dialogs/common/dialogs.component.ts | 12 +- src/app/modules/radar/settings/index.ts | 14 + .../settings/components/settings-dialog.html | 2279 +++++++++-------- .../settings/components/settings-dialog.ts | 2 + src/app/modules/skstream/skstream.facade.ts | 2 +- 7 files changed, 1184 insertions(+), 1140 deletions(-) create mode 100644 src/app/modules/radar/settings/index.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bc79bdc..f0d194e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG: Freeboard +### v2.11.3 + +- **Fixed**: VMG not being displayed in course data when destination is active. + ### v2.11.2 - **Updated**: Proxy mode operation is now the default and configuration option removed. (#159) @@ -8,7 +12,7 @@ - **Updated**: When editing a route (on a touch device) `long-press` on a route point to delete it. (#169) - **Added**: Toggle charts on/of by clicking chart boundaries on map. - **Added**: Lock in `Follow Vessel` setting to remain in this mode when map is panned. (#185) -- **Fixed**: Not rendering laylines when preferred path is `environment.wind.directionMagnetic`. +- **Fixed**: Not rendering laylines when preferred path is `environment.wind.directionMagnetic`. (#184) - **Fixed**: Cursor position display formatting issue when using `028°15.345'S` format. (#188) ### v2.11.1 diff --git a/src/app/app.settings.ts b/src/app/app.settings.ts index 8715df88..592a7ebc 100644 --- a/src/app/app.settings.ts +++ b/src/app/app.settings.ts @@ -1,4 +1,5 @@ import { Position } from './types'; +import { cleanConfig as cleanRadarConfig, IRadarConfig } from './modules/radar/settings'; // validate supplied settings against base config export function validateConfig(settings: IAppConfig): boolean { @@ -260,6 +261,10 @@ export function cleanConfig( console.warn('Invalid zoom level supplied!'); } } + + if (this.config.radar) { + cleanRadarConfig(this.config.radar); + } } // ** Default Configuration** @@ -387,7 +392,8 @@ export const DefaultConfig: IAppConfig = { url: null }, paths: [] - } + }, + radar: {} }; export interface IAppConfig { @@ -516,4 +522,5 @@ export interface IAppConfig { }; paths: string[]; }; + radar: IRadarConfig; } diff --git a/src/app/lib/components/dialogs/common/dialogs.component.ts b/src/app/lib/components/dialogs/common/dialogs.component.ts index c0357784..d5b20c9c 100644 --- a/src/app/lib/components/dialogs/common/dialogs.component.ts +++ b/src/app/lib/components/dialogs/common/dialogs.component.ts @@ -265,14 +265,12 @@ export class ConfirmDialog implements OnInit { - + @if(data.url) { - - } + Visit Website +   } diff --git a/src/app/modules/radar/settings/index.ts b/src/app/modules/radar/settings/index.ts new file mode 100644 index 00000000..f48e95c5 --- /dev/null +++ b/src/app/modules/radar/settings/index.ts @@ -0,0 +1,14 @@ + +// ** Default Configuration** +export const DefaultRadarConfig: IRadarConfig = {}; + +export interface IRadarConfig { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any +} + +// clean loaded radar config +export function cleanConfig(settings: IRadarConfig) { + // parse and clean persisted radar configuration +} + diff --git a/src/app/modules/settings/components/settings-dialog.html b/src/app/modules/settings/components/settings-dialog.html index 62f1f280..b4bd5246 100644 --- a/src/app/modules/settings/components/settings-dialog.html +++ b/src/app/modules/settings/components/settings-dialog.html @@ -21,1187 +21,1206 @@ -
-
- - @for(i of menuItems; track i) { - {{i.text}} - } - -
-
-
-
-
-
DISPLAY & SOUND
- @if(facade.data.optAppPanel) { - - - @if(facade.list.applications.length > 1) { -
-
- - Select Instruments App - - @for(i of facade.list.applications; track i) { - - {{i.name}} - - } - - -
-
- - Parameters - - -
+ + + +
+
+ + @for(i of menuItems; track i) { + {{i.text}} + } + +
+
+
+
+
+
DISPLAY & SOUND
+ @if(facade.data.optAppPanel) { + + + @if(facade.list.applications.length > 1) { +
+
+ + Select Instruments App + + @for(i of facade.list.applications; track i) { + + {{i.name}} + + } + + +
+
+ + Parameters + + +
-
- - Halt App on hide - -
-
- -
-
- } @if(display.favourites) { -
-
-
-
Select Favourite Apps: -
- - - @for(fav of facade.list.favourites; track fav) { - - {{fav.name}} - +
+ + Halt App on hide + +
+
+ +
+
+ } @if(display.favourites) { +
+
+
+
Select Favourite Apps: +
+ + + @for(fav of facade.list.favourites; track fav) { + + {{fav.name}} + + } + +
+
} - -
-
- } - - - } -
- - -
-
- - Lock Follow Vessel - -
-
- - Do not Play Sounds - -
-
- - Show DEPTH Alarms - -
-
- - Alarm Smoothing Time - - {{i.value}} - - -
-
-
-
- - - -
-
- - Prevent Device Sleeping - -
-
- - Dark Mode setting - - {{i.value}} - - -
-
-
-
+ + + } +
+ + +
+
+ + Lock Follow Vessel + +
+
+ + Do not Play Sounds + +
+
+ + Show DEPTH Alarms + +
+
+ + Alarm Smoothing Time + + {{i.value}} + + +
+
+
+
-
MAP
- - -
-
- - Feature label zoom level - - @for(i of facade.list.minZoom; track i) { - {{i}} - } - - -
-
- - Popovers close with button - -
-
- - Double click to Zoom - -
-
-
-
-
+ + +
+
+ + Prevent Device Sleeping + +
+
+ + Dark Mode setting + + {{i.value}} + + +
+
+
+
-
-
VECTOR CHARTS
- - -
-
- - Graphics Style - - {{i.value}} - - -
-
- - Boundaries - - {{i.value}} - - -
-
- - Colors - - @for(i of facade.s57Options.colors; track i) { - {{i}} - } - - -
+
MAP
+ + +
+
+ + Feature label zoom level + + @for(i of facade.list.minZoom; track i) { + {{i}} + } + + +
+
+ + Popovers close with button + +
+
+ + Double click to Zoom + +
+
+
+
-
-
- - Shallow depth - - m - -
-
- - Safety depth - - m - -
-
- - Deep depth - - m - -
+ +
+
VECTOR CHARTS
+ + +
+
+ + Graphics Style + + {{i.value}} + + +
+
+ + Boundaries + + {{i.value}} + + +
+
+ + Colors + + @for(i of facade.s57Options.colors; track i) { + {{i}} + } + + +
+
+
+
+ + Shallow depth + + m + +
+
+ + Safety depth + + m + +
+
+ + Deep depth + + m + +
+
+
+
- - -
-
-
UNITS & VALUES
- - -
-
- - Distance units - - {{i.value}} - - -
+
+
UNITS & VALUES
+ + +
+
+ + Distance units + + {{i.value}} + + +
-
- - Depth units - - {{i.value}} - - -
+
+ + Depth units + + {{i.value}} + + +
-
- - Speed units - - {{i.value}} - - -
+
+ + Speed units + + {{i.value}} + + +
-
- - Temperature units - - {{i.value}} - - -
+
+ + Temperature units + + {{i.value}} + + +
- @if(facade.preferredValues.coords.length !== 0) { -
- - Position display format - - @for(i of facade.preferredValues.coords; track i) { - {{i[1]}} + @if(facade.preferredValues.coords.length !== 0) { +
+ + Position display format + + @for(i of facade.preferredValues.coords; track i) { + {{i[1]}} + } + + +
} -
-
-
- } -
- - -
+
+ + +
- @if(facade.preferredValues.heading.length !== 0) { -
- - Prefer True / Magnetic values - - @for(i of facade.preferredValues.heading; track i) { - {{i[1]}} + @if(facade.preferredValues.heading.length !== 0) { +
+ + Prefer True / Magnetic values + + @for(i of facade.preferredValues.heading; track i) { + {{i[1]}} + } + + +
} -
-
-
- } +
+
+
- - -
-
-
COURSE
- - -
-
- - Auto-advance to next point on arrival - +
+
COURSE
+ + +
+
+ + Auto-advance to next point on arrival + - - Notification type to use - - @for(i of facade.list.nextPointTriggers; track i) { - {{i}} - } - - + + Notification type to use + + @for(i of facade.list.nextPointTriggers; track i) { + {{i}} + } + + - - Time to wait before advancing - - {{i.value}} - - -
+ + Time to wait before advancing + + {{i.value}} + + +
+
+ +
- - -
-
-
VESSEL
- - -
-
- - - Fixed Location Mode - - -
+
+
VESSEL
+ +
- - Latitude - - @if(fixedlat.invalid && (fixedlat.dirty || - fixedlat.touched)) { - - Please enter a value between -90 and 90 (max 9 - decimals) - - } - - - Longitude - - @if(fixedlon.invalid && (fixedlon.dirty || - fixedlon.touched)) { - - Please enter a value between -180 and 180 (max 9 - decimals) - - } - +
+ + + Fixed Location Mode + + +
+
+ + Latitude + + @if(fixedlat.invalid && (fixedlat.dirty || + fixedlat.touched)) { + + Please enter a value between -90 and 90 (max 9 + decimals) + + } + + + Longitude + + @if(fixedlon.invalid && (fixedlon.dirty || + fixedlon.touched)) { + + Please enter a value between -180 and 180 (max 9 + decimals) + + } + +
+
+
-
-
-
-
-
-
- Vessel Lines: +
+
+
+ Vessel Lines: - - Display Wind Vectors - + + Display Wind Vectors + - - Display Laylines - + + Display Laylines + - - Heading Line Length - - {{i.value}} - - + + Heading Line Length + + {{i.value}} + + - - COG Line Length - - {{i.value}} - - -
-
-
-
- - - Display Vessel Trail - - -
-
- - Get Trail from server - -    - - - - - Length ({{facade.settings.selections.trailDuration}} hrs) -
-
-
-
- - Resolution: Last hour - - {{i.value}} - - -
-
- - Resolution: 1 hr -> 24 hrs - - {{i.value}} - - -
-
- - Resolution: > 24 hrs - - {{i.value}} + COG Line Length + + {{i.value}} + + +
+
+
+
+ + - - -
-
- -
-
+ Display Vessel Trail + + +
+
+ + Get Trail from server + +    -
OTHER VESSELS
- - -
-
- - Mark AIS target inactive after - - {{i.value}} - - -
+ + + + Length ({{facade.settings.selections.trailDuration}} hrs) +
+
+
+
+ + Resolution: Last hour + + {{i.value}} + + +
+
+ + Resolution: 1 hr -> 24 hrs + + {{i.value}} + + +
+
+ + Resolution: > 24 hrs + + {{i.value}} + + +
+
+ + + -
- - Remove AIS target after - - {{i.value}} - - -
+
OTHER VESSELS
+ + +
+
+ + Mark AIS target inactive after + + {{i.value}} + + +
-
- - Wind Vector Value - - {{i.value}} - - -
+
+ + Remove AIS target after + + {{i.value}} + + +
-
- - Wind / Trail Zoom Level - - @for(i of facade.list.minZoom; track i) { - {{i}} - } - - -
+
+ + Wind Vector Value + + {{i.value}} + + +
-
- - Show Trails - -   - - Hide Moored - -   - - Hide Anchored - -
+
+ + Wind / Trail Zoom Level + + @for(i of facade.list.minZoom; track i) { + {{i}} + } + + +
-
- - COG Line - - @for(i of facade.list.aisCogLine; track i[0]) { - {{i[1]}} - } - - -
+
+ + Show Trails + +   + + Hide Moored + +   + + Hide Anchored + +
-
- - Display Profile - - {{i.value}} - - -
-
-
-
-
+
+ + COG Line + + @for(i of facade.list.aisCogLine; track i[0]) { + {{i[1]}} + } + + +
-
-
RESOURCES: NOTES
- - -
-
- - Display Notes on Map - -
-
- - Notes Zoom Level - - @for(i of facade.list.minZoom; track i) { - {{i}} - } - - -
-
-
-
- - {{'Fetch Notes radius: (' + - facade.availableUnits.distance.get(distunits.value) + - ')'}} - - @for(i of facade.list.resourceRadius;track i) { - {{i}} - } - - -
-
-
-
- - Notes fetch filter: - - @if(notesrootfilter.value) { - - } - -
-
-
-
- - Edit Group Names - -
-
- - Position Group Note - -
+
+ + Display Profile + + {{i.value}} + + +
+
+
+
- - -
-
-
RESOURCES: VIDEO
- - -
-
- - Enable Video - -
-
- - url: - - @if(videourl.invalid) { - Value required. - } - -
+
+
RESOURCES: NOTES
+ + +
+
+ + Display Notes on Map + +
+
+ + Notes Zoom Level + + @for(i of facade.list.minZoom; track i) { + {{i}} + } + + +
+
+
+
+ + {{'Fetch Notes radius: (' + + facade.availableUnits.distance.get(distunits.value) + + ')'}} + + @for(i of facade.list.resourceRadius;track i) { + {{i}} + } + + +
+
+
+
+ + Notes fetch filter: + + @if(notesrootfilter.value) { + + } + +
+
+
+
+ + Edit Group Names + +
+
+ + Position Group Note + +
+
+
+
- - -
-
-
RESOURCES: LAYERS
- - -
-
-
- path: ./resources/<name> -
- - @for(f of facade.list.resourcePaths; track f) { - - {{f}} - - } - -
+
+
RESOURCES: VIDEO
+ + +
+
+ + Enable Video + +
+
+ + url: + + @if(videourl.invalid) { + Value required. + } + +
+
+
+
- - -
-
-
SIGNAL K: CONNECTION
- - - -
-
- Filter Stream data: - - Check to include Signal K schema groups on display.
- Use to manage display performance. -
-
- - Vessels (other than Self) - -
-
- - Aids to Navigation (AtoN) - -
-
- - Aircraft - -
-
- - Search and Rescue (SaR) - -
-
- - Weather (Meteo) - -
+
+
RESOURCES: LAYERS
+ + +
+
+
+ path: ./resources/<name> +
+ + @for(f of facade.list.resourcePaths; track f) { + + {{f}} + + } + +
+
+
+
+
-
-
- - Max. distance from vessel - +
SIGNAL K: CONNECTION
+ + + +
+
+ Filter Stream data: + + Check to include Signal K schema groups on display.
+ Use to manage display performance. +
+
+ + Vessels (other than Self) + +
+
+ + Aids to Navigation (AtoN) + +
+
+ + Aircraft + +
+
+ + Search and Rescue (SaR) + +
+
+ + Weather (Meteo) + +
+ +
+
+ + Max. distance from vessel + + {{i.value}} + + +
+
+
+
+
+
-
+ key_off + +
+
+
+
-
+ +
- + science Experimental Features +
- - -
- -
-
- - science Experimental Features - +
-
-
-
+
+
+ + @if(facade.settings.radar) { + + +
+
+ Radar Settings +
+
+
+
+ } + +
diff --git a/src/app/modules/settings/components/settings-dialog.ts b/src/app/modules/settings/components/settings-dialog.ts index d7c09f07..64f39322 100644 --- a/src/app/modules/settings/components/settings-dialog.ts +++ b/src/app/modules/settings/components/settings-dialog.ts @@ -20,6 +20,7 @@ import { MatSliderModule } from '@angular/material/slider'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatMenuModule } from '@angular/material/menu'; import { MatToolbarModule } from '@angular/material/toolbar'; +import { MatTabsModule } from '@angular/material/tabs'; import { SignalKPreferredPathsComponent } from './signalk-preferredpaths.component'; import { SettingsFacade } from '../settings.facade'; @@ -51,6 +52,7 @@ interface PreferredPathsResult { MatInputModule, MatMenuModule, MatToolbarModule, + MatTabsModule, SignalKPreferredPathsComponent ], templateUrl: './settings-dialog.html', diff --git a/src/app/modules/skstream/skstream.facade.ts b/src/app/modules/skstream/skstream.facade.ts index b2520380..0ada3938 100644 --- a/src/app/modules/skstream/skstream.facade.ts +++ b/src/app/modules/skstream/skstream.facade.ts @@ -404,7 +404,7 @@ export class SKStreamFacade { } } if (typeof v['course.velocityMadeGood'] !== 'undefined') { - this.app.data.navData.vmg = v['course.nextPoint.velocityMadeGood']; + this.app.data.navData.vmg = v['course.velocityMadeGood']; } if (typeof v['course.timeToGo'] !== 'undefined') { this.app.data.navData.ttg = v['course.timeToGo'] / 60;