diff --git a/.browserslistrc b/.browserslistrc deleted file mode 100644 index 80848532..00000000 --- a/.browserslistrc +++ /dev/null @@ -1,12 +0,0 @@ -# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. -# For additional information regarding the format and rule options, please see: -# https://github.com/browserslist/browserslist#queries - -# You can see what browsers were selected by your queries by running: -# npx browserslist - -> 0.5% -last 2 versions -Firefox ESR -not dead -not IE 9-11 # For IE 9-11 support, remove 'not'. \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e1ec76dc..8c1913ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # CHANGELOG: Freeboard +### v2.2.1 + +- **Fixed**: Issue where waypoint was not centered on the screen when the center waypoint button was clicked from the entry in the waypoint list. + +- **Fixed**: Issue where invalid fixed location postion was being written to settings. + + ### v2.2.0 - **Added**: Ability to center a vessel in the Vessels List. diff --git a/angular.json b/angular.json index 44cbadc1..0d88c741 100644 --- a/angular.json +++ b/angular.json @@ -124,34 +124,6 @@ } } } - }, - "fb-openlayers": { - "projectType": "library", - "root": "projects/fb-openlayers", - "sourceRoot": "projects/fb-openlayers/src", - "prefix": "lib", - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:ng-packagr", - "options": { - "tsConfig": "projects/fb-openlayers/tsconfig.lib.json", - "project": "projects/fb-openlayers/ng-package.json" - } - , "configurations": { - "production": { - "tsConfig": "projects/fb-openlayers/tsconfig.lib.prod.json" - } - } -}, - "test": { - "builder": "@angular-devkit/build-angular:karma", - "options": { - "main": "projects/fb-openlayers/src/test.ts", - "tsConfig": "projects/fb-openlayers/tsconfig.spec.json", - "karmaConfig": "projects/fb-openlayers/karma.conf.js" - } - } - } } } } \ No newline at end of file diff --git a/package.json b/package.json index fecc9061..3fe32dab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@signalk/freeboard-sk", - "version": "2.2.0", + "version": "2.2.1", "description": "Openlayers chart plotter implementation for Signal K", "keywords": [ "signalk-webapp", @@ -20,9 +20,7 @@ "build": "ng build", "test": "ng test", "format": "prettier --ignore-path .gitignore --write \"src/**/*.+(ts|html)\"", - "format:projects": "prettier --ignore-path .gitignore --write \"projects/**/*.+(ts|html)\"", "format:helper": "prettier --ignore-path .gitignore --write \"helper/**/*.+(ts|html)\"", - "e2e": "ng e2e", "build:helper": "tsc -p tsconfig-helper.json", "build:web": "ng build -c production --output-hashing all", "build:all": "npm run build:helper && npm run build:web", @@ -44,19 +42,19 @@ "tslib": "^2.0.0" }, "devDependencies": { - "@angular-devkit/build-angular": "^14.0.1", - "@angular/animations": "^14.0.1", - "@angular/cdk": "^14.0.1", - "@angular/cli": "^14.0.1", - "@angular/common": "^14.0.1", - "@angular/compiler": "^14.0.1", - "@angular/compiler-cli": "^14.0.1", - "@angular/core": "^14.0.1", - "@angular/forms": "^14.0.1", - "@angular/language-service": "^14.0.1", - "@angular/material": "^14.0.1", - "@angular/platform-browser": "^14.0.1", - "@angular/platform-browser-dynamic": "^14.0.1", + "@angular-devkit/build-angular": "^16.2.0", + "@angular/animations": "^16.2.0", + "@angular/cdk": "^16.2.0", + "@angular/cli": "^16.2.0", + "@angular/common": "^16.2.0", + "@angular/compiler": "^16.2.0", + "@angular/compiler-cli": "^16.2.0", + "@angular/core": "^16.2.0", + "@angular/forms": "^16.2.0", + "@angular/language-service": "^16.2.0", + "@angular/material": "^16.2.0", + "@angular/platform-browser": "^16.2.0", + "@angular/platform-browser-dynamic": "^16.2.0", "@kolkov/angular-editor": "^2.1.0", "@signalk/server-api": "^2.0.0", "@types/arcgis-rest-api": "^10.4.5", @@ -78,7 +76,7 @@ "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", - "ng-packagr": "^14.0.2", + "ng-packagr": "^16.2.0", "ngeohash": "^0.6.3", "ol": "^7.4.0", "pmtiles": "^2.7.0", @@ -91,7 +89,7 @@ "signalk-worker-angular": "^1.1.4", "simplify-ts": "^1.0.2", "ts-node": "~7.0.0", - "typescript": "~4.7.3", - "zone.js": "~0.11.4" + "typescript": "~4.9.5", + "zone.js": "~0.13.1" } -} +} \ No newline at end of file diff --git a/projects/fb-openlayers/README.md b/projects/fb-openlayers/README.md deleted file mode 100644 index 40b9149a..00000000 --- a/projects/fb-openlayers/README.md +++ /dev/null @@ -1,17 +0,0 @@ -## Usage - -Import this library in your NgModule: -```json -imports: [ - FBOpenlayersModule -] -``` - -## Development - -To compile to module to dist output directory: - -```bash -ng build --configuration production fb-openlayers -``` - diff --git a/projects/fb-openlayers/karma.conf.js b/projects/fb-openlayers/karma.conf.js deleted file mode 100644 index f9d5c276..00000000 --- a/projects/fb-openlayers/karma.conf.js +++ /dev/null @@ -1,32 +0,0 @@ -// Karma configuration file, see link for more information -// https://karma-runner.github.io/1.0/config/configuration-file.html - -module.exports = function (config) { - config.set({ - basePath: '', - frameworks: ['jasmine', '@angular-devkit/build-angular'], - plugins: [ - require('karma-jasmine'), - require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), - require('karma-coverage-istanbul-reporter'), - require('@angular-devkit/build-angular/plugins/karma') - ], - client: { - clearContext: false // leave Jasmine Spec Runner output visible in browser - }, - coverageIstanbulReporter: { - dir: require('path').join(__dirname, '../../coverage/fb-openlayers'), - reports: ['html', 'lcovonly', 'text-summary'], - fixWebpackSourcePaths: true - }, - reporters: ['progress', 'kjhtml'], - port: 9876, - colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, - browsers: ['Chrome'], - singleRun: false, - restartOnFileChange: true - }); -}; diff --git a/projects/fb-openlayers/ng-package.json b/projects/fb-openlayers/ng-package.json deleted file mode 100644 index d0cf25be..00000000 --- a/projects/fb-openlayers/ng-package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", - "dest": "../../dist/fb-openlayers", - "lib": { - "entryFile": "src/index.ts" - } -} diff --git a/projects/fb-openlayers/package.json b/projects/fb-openlayers/package.json deleted file mode 100644 index f01c28c0..00000000 --- a/projects/fb-openlayers/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "fb-openlayers", - "description": "Fork of ng-openlayers-lib for Freeboard-SK", - "license": "Apache-2.0", - "version": "1.1.0", - "author": { - "name": "AdrianP" - }, - "keywords": [ - "angular", - "openlayers", - "ol", - "freeboard", - "freeboard-sk" - ], - "dependencies": { - "tslib": "^2.0.0" - }, - "devDependencies": { - "rxjs": "~6.5.5" - }, - "peerDependencies": { - "ol": ">=7.0.0", - "proj4": ">=2.7.2", - "geolib": ">=3.3.3", - "@types/arcgis-rest-api": "^10.4.5", - "@types/geojson": "^7946.0.10", - "@types/topojson-specification": "^1.0.2" - } -} diff --git a/projects/fb-openlayers/src/lib/map.component.scss b/projects/fb-openlayers/src/lib/map.component.scss deleted file mode 100644 index df477c98..00000000 --- a/projects/fb-openlayers/src/lib/map.component.scss +++ /dev/null @@ -1 +0,0 @@ -@import '~ol/ol'; diff --git a/projects/fb-openlayers/src/test.ts b/projects/fb-openlayers/src/test.ts deleted file mode 100644 index b1cc186b..00000000 --- a/projects/fb-openlayers/src/test.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'core-js/es7/reflect'; -import 'zone.js'; -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -declare const require: any; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); -// Then we find all the tests. -const context = require.context('./', true, /\.spec\.ts$/); -// And load the modules. -context.keys().map(context); diff --git a/projects/fb-openlayers/tsconfig.lib.json b/projects/fb-openlayers/tsconfig.lib.json deleted file mode 100644 index e82e4df0..00000000 --- a/projects/fb-openlayers/tsconfig.lib.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "../../out-tsc/lib", - "declarationMap": true, - "target": "es2015", - "declaration": true, - "inlineSources": true, - "types": [], - "lib": [ - "dom", - "es2018" - ] - }, - "angularCompilerOptions": { - "enableIvy": false, - "skipTemplateCodegen": true, - "strictMetadataEmit": true, - "fullTemplateTypeCheck": true, - "strictInjectionParameters": true, - "enableResourceInlining": true - }, - "exclude": [ - "src/test.ts", - "**/*.spec.ts" - ] -} diff --git a/projects/fb-openlayers/tsconfig.lib.prod.json b/projects/fb-openlayers/tsconfig.lib.prod.json deleted file mode 100644 index 2617a83e..00000000 --- a/projects/fb-openlayers/tsconfig.lib.prod.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig.lib.json", - "compilerOptions": { - "declarationMap": false - }, - "angularCompilerOptions": { - "enableIvy": false - } -} \ No newline at end of file diff --git a/projects/fb-openlayers/tsconfig.spec.json b/projects/fb-openlayers/tsconfig.spec.json deleted file mode 100644 index 16da33db..00000000 --- a/projects/fb-openlayers/tsconfig.spec.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "../../out-tsc/spec", - "types": [ - "jasmine", - "node" - ] - }, - "files": [ - "src/test.ts" - ], - "include": [ - "**/*.spec.ts", - "**/*.d.ts" - ] -} diff --git a/src/.browserslistrc b/src/.browserslistrc deleted file mode 100644 index 8e09ab49..00000000 --- a/src/.browserslistrc +++ /dev/null @@ -1,9 +0,0 @@ -# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers -# For additional information regarding the format and rule options, please see: -# https://github.com/browserslist/browserslist#queries -# For IE 9-11 support, please uncomment the last line of the file and adjust as needed -> 0.5% -last 2 versions -Firefox ESR -not dead -# IE 9-11 \ No newline at end of file diff --git a/src/app-theme.scss b/src/app-theme.scss index 46e32193..5f5d058a 100644 --- a/src/app-theme.scss +++ b/src/app-theme.scss @@ -1,42 +1,92 @@ -@import '~@angular/material/theming'; +@use '@angular/material' as mat; +@import '@angular/material/theming'; // Include non-theme styles for core. @include mat-core(); // Define a theme. -$primary: mat-palette($mat-indigo, 500); -$accent: mat-palette($mat-amber, 400); -$warn: mat-palette($mat-red); -$theme: mat-light-theme($primary, $accent, $warn); +$my-primary: mat.define-palette(mat.$indigo-palette, 500,700,200); +$my-accent: mat.define-palette(mat.$amber-palette, 500,700,200); +// The "warn" palette is optional and defaults to red if not specified. +$my-warn: mat.define-palette(mat.$red-palette, 500,700,200); -// Include all theme styles for the components. -@include angular-material-theme($theme); +$my-theme: mat.define-light-theme(( + color: ( + primary: $my-primary, + accent: $my-accent, + warn: $my-warn, + ), + typography: mat.define-typography-config(), + density: 0, +)); -// std elements -a { - color: mat-color($primary); -} +// Define a dark theme. +$my-dark-primary: mat.define-palette(mat.$light-blue-palette, 200,300,400); +$my-dark-accent: mat.define-palette(mat.$amber-palette, A400, A100, A700); +$my-dark-warn: mat.define-palette(mat.$deep-orange-palette, A400); + +$my-dark-theme: mat.define-dark-theme(( + color: ( + primary: $my-dark-primary, + accent: $my-dark-accent, + warn: $my-dark-warn, + ), + typography: mat.define-typography-config(), + density: 0, +)); + +// Include all theme styles for the components. +@include mat.all-component-themes($my-theme); -// Define an alternate dark theme. .dark-theme { - $dark-primary: mat-palette($mat-light-blue); - $dark-accent: mat-palette($mat-amber, A400, A100, A700); - $dark-warn: mat-palette($mat-red); - $dark-theme: mat-dark-theme($dark-primary, $dark-accent, $dark-warn); - - // std elements - a { - color: mat-color($accent); + @include mat.all-component-themes($my-dark-theme); + + .about-row .item a { + color: mat-color($my-dark-accent); } - @include angular-material-theme($dark-theme); + /* Track */ + ::-webkit-scrollbar-track { + background: rgba(0,0,0,.5); + } + + /* Handle on hover */ + ::-webkit-scrollbar-thumb:hover { + background: #999; + } + } + +// std elements +.about-row .item a { + color: mat-color($my-primary); +} + +/* width */ +::-webkit-scrollbar { + width: 6px; + height: 6px; +} + +/* Track */ +::-webkit-scrollbar-track { + background: #f1f1f1; +} + +/* Handle */ +::-webkit-scrollbar-thumb { + background: #888; +} + +/* Handle on hover */ +::-webkit-scrollbar-thumb:hover { + background: #555; } -@mixin popover-theme($theme) { - $primary: map-get($theme, primary); - $accent: map-get($theme, accent); - $warn: map-get($theme, warn); - $background: map-get($theme, background); +@mixin popover-theme($my-theme) { + $primary: map-get($my-theme, primary); + $accent: map-get($my-theme, accent); + $warn: map-get($my-theme, warn); + $background: map-get($my-theme, background); $background-color: map-get($background, background); .popover-title { @@ -65,5 +115,5 @@ a { } // Include theme styles for custom components. -@include popover-theme($theme); +@include popover-theme($my-theme); diff --git a/src/app/app.component.css b/src/app/app.component.css index c17061c0..4abbe85a 100644 --- a/src/app/app.component.css +++ b/src/app/app.component.css @@ -23,18 +23,16 @@ mat-nav-list { .mainToolBar { top: 0; bottom: 0; - right: 39px; left: 0; overflow: auto; position: fixed; - border-top: red 0px solid; } .view { top: 0; bottom: 0; right: 0; - left: 40px; + left: 48px; overflow: auto; position: fixed; border-top: silver 0px solid; @@ -47,7 +45,7 @@ mat-nav-list { bottom: 0; padding-left: 40px; z-index: 5000; - background-color: rgba(200,200,200,.4); + background-color: rgba(200,200,200,.4); } .rightUtilsPanel { @@ -100,6 +98,7 @@ mat-nav-list { display: flex; flex-wrap: nowrap; overflow-x: auto; + overflow-y: hidden; border: gray 1px solid; } diff --git a/src/app/app.component.html b/src/app/app.component.html index 5f8b4b26..2707287b 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -203,15 +203,15 @@ insights Trail to Route - - + {{ @@ -446,505 +446,515 @@ - -
- - - - - - - - - - - - - - - - + +
+ + + + + + + + + + + + + + + + + +
+ + +
- -
+ +
+ +
+ +
 
  +
- -
- -
- -
- -
 
  -
+ +
+ +
 
+
- -
- -
 
-
+ +
+ +
 
+
- -
- -
 
-
+ + +
 
+
- -
- -
 
-
+ +
+ +
 
+
- -
- -
 
+ +
+ +
 
+
- -
- - -
 
-
+ +
+ + + +
+ +
- -
- -
 
+ Click on the Map where to drop the feature. +
+
+
    +
  1. Click on the Map to place a point along the Route.
  2. +
  3. Click on the last Point to end drawing.
  4. +
+
+
+
    +
  1. Click on the Map to place a vertex of the Region.
  2. +
  3. Click on the last point to end drawing.
  4. +
+
- - -
-
+
+ + straighten Measure: + +
+
    +
  1. Click on the Map to start measuring.
  2. +
  3. Click on the last Point to end measuring.
  4. +
+
+
+
+ + - add_location - -
 
+ close + {{ draw.modify ? 'FINISH' : 'CANCEL' }} +
- - - - - - - -
- -
+ +
+
+ access_time Playback: +
+
{{ display.playback.time }}
+
- -
-
- - edit Drawing Help: - -
+
+ - Click on the Map where to drop the feature. -
-
-
    -
  1. Click on the Map to place a point along the Route.
  2. -
  3. Click on the last Point to end drawing.
  4. -
-
-
-
    -
  1. Click on the Map to place a vertex of the Region.
  2. -
  3. Click on the last point to end drawing.
  4. -
-
-
-
- - edit Modify: - -
-
    -
  1. Click and drag to move point.
  2. -
  3. Ctrl-Click to remove point from line.
  4. -
-
-
-
- - straighten Measure: - -
-
    -
  1. Click on the Map to start measuring.
  2. -
  3. Click on the last Point to end measuring.
  4. -
-
-
-
- - - close - {{ draw.modify ? 'FINISH' : 'CANCEL' }} - -
-
- - -
-
- access_time Playback: + +
-
{{ display.playback.time }}
-
- -
- - + + - - -
+
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 5f343d70..34310644 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -7,17 +7,26 @@ import { OverlayContainer } from '@angular/cdk/overlay'; import { Observable, Subject } from 'rxjs'; import { AppInfo } from './app.info'; -import { SettingsMessage } from './lib/info/info.service'; -import { AboutDialog, LoginDialog } from 'src/app/lib'; -import { PlaybackDialog } from 'src/app/lib/ui/playback-dialog'; - +import { SettingsMessage } from './lib/services'; +import { + AboutDialog, + LoginDialog, + PlaybackDialog, + GeoJSONImportDialog, + Trail2RouteDialog, + GPXImportDialog, + GPXExportDialog +} from 'src/app/lib/components/dialogs'; +import { + CourseSettingsModal +} from 'src/app/lib/components'; import { SettingsDialog, - AlarmsFacade, - AlarmsDialog, SKStreamFacade, SKSTREAM_MODE, StreamOptions, + AlarmsFacade, + AlarmsDialog, SKResources, SKRoute, SKVessel, @@ -30,14 +39,9 @@ import { AtoNPropertiesModal, AircraftPropertiesModal, ActiveResourcePropertiesModal, - GPXImportDialog, - GPXExportDialog, - GeoJSONImportDialog, TracksModal, ResourceSetModal, - CourseSettingsModal, ResourceImportDialog, - Trail2RouteDialog, WeatherForecastModal } from 'src/app/modules'; @@ -147,7 +151,7 @@ export class AppComponent { const wr = this.app.showWelcome(); if (wr) { wr.afterClosed().subscribe((r) => { - if (r) this.openSettings(r); + if (r) this.openSettings(); }); } }, 500); @@ -163,6 +167,11 @@ export class AppComponent { setTimeout(() => (this.app.data.hasWakeLock = value), 500); } + handleWakelockChange(value: boolean) { + this.app.config.selections.wakeLock = value; + this.app.saveConfig(); + } + ngOnInit() { // ** audio context handing ** this.display.audio.state = this.app.audio.context.state; @@ -727,11 +736,11 @@ export class AppComponent { } // ** open settings dialog ** - public openSettings(prefs = false) { + public openSettings() { this.dialog .open(SettingsDialog, { disableClose: true, - data: { openPrefs: prefs }, + data: {}, maxWidth: '90vw', minWidth: '90vw' }) diff --git a/src/app/app.info.ts b/src/app/app.info.ts index 00d07a3c..1e0ea7f4 100644 --- a/src/app/app.info.ts +++ b/src/app/app.info.ts @@ -4,22 +4,24 @@ import { Injectable } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatSnackBar } from '@angular/material/snack-bar'; +import { Subject, Observable } from 'rxjs'; import { Info, + SettingsMessage, + AppUpdateMessage, + IndexedDB +} from './lib/services'; +import { AlertDialog, ConfirmDialog, WelcomeDialog, MessageBarComponent -} from './lib'; +} from './lib/components/dialogs'; -import { SettingsMessage, AppUpdateMessage } from './lib/info/info.service'; -import { Subject, Observable } from 'rxjs'; import { Convert } from './lib/convert'; -import { IndexedDB } from './lib/info/indexeddb'; import { SignalKClient } from 'signalk-client-angular'; -import { SKVessel } from './modules/skresources/resource-classes'; -import { SKChart } from './modules/skresources/resource-classes'; +import { SKVessel, SKChart } from './modules/skresources/resource-classes'; import { SKStreamProvider } from './modules/skstream/skstream.service'; export interface PluginSettings { @@ -113,7 +115,8 @@ const FreeboardConfig = { wakeLock: false, course: { autoNextPointOnArrival: false, - autoNextPointDelay: 5 + autoNextPointDelay: 5000, + autoNextPointTrigger: 'perpendicularPassed' } }, resources: { @@ -259,10 +262,10 @@ export class AppInfo extends Info { this.debug('host:', this.host); this.id = 'freeboard'; - this.name = 'Freeboard'; - this.shortName = 'freeboard'; + this.name = 'Freeboard-SK'; + this.shortName = 'Freeboard'; this.description = `Signal K Chart Plotter.`; - this.version = '2.2.0'; + this.version = '2.2.1'; this.url = 'https://github.com/signalk/freeboard-sk'; this.logo = './assets/img/app_logo.png'; @@ -683,8 +686,15 @@ export class AppInfo extends Info { if (typeof settings.selections.course === 'undefined') { settings.selections.course = { autoNextPointOnArrival: false, - autoNextPointDelay: 5 + autoNextPointDelay: 5000, + autoNextPointTrigger: 'perpendicularPassed' }; + } else { + if ( + typeof settings.selections.course.autoNextPointTrigger === 'undefined' + ) { + settings.selections.course.autoNextPointTrigger = 'perpendicularPassed'; + } } if (typeof settings.plugins === 'undefined') { diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 63026034..18069a35 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,40 +3,78 @@ import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { HttpClientModule } from '@angular/common/http'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; + +import { DragDropModule } from '@angular/cdk/drag-drop'; +import { MatBadgeModule } from '@angular/material/badge'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatListModule } from '@angular/material/list'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatSelectModule } from '@angular/material/select'; +import { MatSidenavModule } from '@angular/material/sidenav'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatToolbarModule } from '@angular/material/toolbar'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; + // *** import { AppComponent } from './app.component'; -import { AppMaterialModule, AppUIModule } from './lib'; - import { - SettingsModule, - GPXModule, - GeoJSONModule, AlarmsModule, + SettingsModule, ExperimentsModule, SKStreamModule, SignalKResourcesModule, - FBMapModule, - CourseModule + FBMapModule } from './modules'; +import { CommonDialogs, GPXModule } from './lib/components/dialogs'; +import { + TextDialComponent, + FileInputComponent, + PiPVideoComponent, + WakeLockComponent +} from './lib/components'; @NgModule({ declarations: [AppComponent], imports: [ + MatMenuModule, + MatToolbarModule, + MatSidenavModule, + MatCardModule, + MatSlideToggleModule, + MatBadgeModule, + MatSelectModule, + MatInputModule, + MatCheckboxModule, + MatButtonModule, + MatListModule, + MatIconModule, + MatTooltipModule, + MatDialogModule, + DragDropModule, + MatSnackBarModule, + GPXModule, BrowserModule, BrowserAnimationsModule, FormsModule, HttpClientModule, - AppMaterialModule, - AppUIModule, + CommonDialogs, ExperimentsModule, SignalKResourcesModule, FBMapModule, - CourseModule, GPXModule, - GeoJSONModule, SettingsModule, AlarmsModule, - SKStreamModule + SKStreamModule, + TextDialComponent, + FileInputComponent, + PiPVideoComponent, + WakeLockComponent ], exports: [], providers: [], diff --git a/src/app/modules/course/course-settings.ts b/src/app/lib/components/course-settings.ts similarity index 76% rename from src/app/modules/course/course-settings.ts rename to src/app/lib/components/course-settings.ts index 3b85db2e..ffee7478 100644 --- a/src/app/modules/course/course-settings.ts +++ b/src/app/lib/components/course-settings.ts @@ -1,15 +1,34 @@ import { Component, OnInit, Inject, ChangeDetectorRef } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { HttpErrorResponse } from '@angular/common/http'; +import { FormsModule } from '@angular/forms'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { + MatBottomSheetModule, MatBottomSheetRef, MAT_BOTTOM_SHEET_DATA } from '@angular/material/bottom-sheet'; +import { MatToolbarModule } from '@angular/material/toolbar'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatCardModule } from '@angular/material/card'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatDatepickerModule } from '@angular/material/datepicker'; +import { CommonDialogs } from 'src/app/lib/components/dialogs'; import { AppInfo } from 'src/app/app.info'; import { SignalKClient } from 'signalk-client-angular'; import { Convert } from 'src/app/lib/convert'; -import { HttpErrorResponse } from '@angular/common/http'; import { SKStreamFacade } from 'src/app/modules'; import { UpdateMessage } from 'src/app/types'; import { Subscription } from 'rxjs'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE +} from '@angular/material/core'; /********* Course Settings Modal ******** data: { @@ -17,10 +36,27 @@ import { Subscription } from 'rxjs'; } ***********************************/ @Component({ + standalone: true, selector: 'ap-course-modal', + imports: [ + CommonModule, + FormsModule, + MatInputModule, + MatSelectModule, + MatBottomSheetModule, + MatCardModule, + MatIconModule, + MatButtonModule, + MatToolbarModule, + MatCheckboxModule, + MatTooltipModule, + MatSlideToggleModule, + MatDatepickerModule, + CommonDialogs + ], template: `
- + settings @@ -39,48 +75,45 @@ import { Subscription } from 'rxjs'; - -
-
Arrival Circle
-
- - Arrival Circle radius ({{ - app.config.units.distance == 'm' - ? app.config.units.distance - : 'NM' - }}): - - - -
-
-
+
+ Arrival -
-
- - -
+ + Arrival Circle radius ({{ + app.config.units.distance == 'm' + ? app.config.units.distance + : 'NM' + }}): + + + + +
+ + Target Arrival time + +
+
- - Target Arrival Date + + Date MM/DD/YYYY
+
- - Time + + Hour - + + Minutes - + + seconds
- +
- +
+ Auto-Pilot
-
Auto-Pilot:
-
+
+ Enable
-
-
-
-
Mode:
-
- - + Mode + + - - {{ i }} - - - -
-
+ {{ i }} + + +
- +
`, styles: [ diff --git a/src/app/lib/ui/dial-text.css b/src/app/lib/components/dial-text.css similarity index 87% rename from src/app/lib/ui/dial-text.css rename to src/app/lib/components/dial-text.css index b805189b..7cca3bc2 100644 --- a/src/app/lib/ui/dial-text.css +++ b/src/app/lib/components/dial-text.css @@ -1,6 +1,6 @@ .dial-text { padding: 0 10px; - height: 80px; + height: 96px; font-family: roboto; border: transparent 1px solid; } diff --git a/src/app/lib/ui/dial-text.ts b/src/app/lib/components/dial-text.ts similarity index 95% rename from src/app/lib/ui/dial-text.ts rename to src/app/lib/components/dial-text.ts index 4d69f887..b80c9d79 100644 --- a/src/app/lib/ui/dial-text.ts +++ b/src/app/lib/components/dial-text.ts @@ -9,7 +9,9 @@ value: "" display value, units: "" dsisplay units, ***********************************/ @Component({ + standalone: true, selector: 'ap-dial-text', + imports: [], template: `
{{ title }}
diff --git a/src/app/lib/ui/dialogs.ts b/src/app/lib/components/dialogs/common/dialogs.component.ts similarity index 82% rename from src/app/lib/ui/dialogs.ts rename to src/app/lib/components/dialogs/common/dialogs.component.ts index 385c7f54..3ba704f9 100644 --- a/src/app/lib/ui/dialogs.ts +++ b/src/app/lib/components/dialogs/common/dialogs.component.ts @@ -24,16 +24,14 @@ import { MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar';
{{ line }} 
- -
- -
+ + `, @@ -89,16 +87,14 @@ export class MsgBox implements OnInit { - -
- -
+ + `, @@ -183,19 +179,17 @@ export class AlertDialog implements OnInit { - -
- - -
+ + + `, @@ -253,7 +247,7 @@ export class ConfirmDialog implements OnInit { template: `

About:

-
+
@@ -272,37 +266,27 @@ export class ConfirmDialog implements OnInit { Visit Website
-
-
-
- -
-
-
+ + + +
`, styles: [ ` - .about h1 { - font-weight: normal !important; - } .about-row { - display: -webkit-box; - display: -moz-box; - display: -ms-flexbox; - display: -webkit-flex; display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: flex-start; align-content: stretch; - font-family: roboto, Arial, Helvetica, sans-serif; + font-family: roboto; } .about-row .item.stretch { text-align: center; @@ -338,52 +322,54 @@ export class AboutDialog { selector: 'ap-login-dialog', styles: [], template: ` - - - account_circle - Sign-In - {{ data.message }} - - - -
- - - -
- - -    - - -
+ + + + account_circle + Sign-In + {{ data.message }} + + + +
+ + + +
+ + +    + + +
+
` }) export class LoginDialog implements OnInit { diff --git a/src/app/lib/ui/ui.module.ts b/src/app/lib/components/dialogs/common/dialogs.module.ts similarity index 67% rename from src/app/lib/ui/ui.module.ts rename to src/app/lib/components/dialogs/common/dialogs.module.ts index 18295dbe..f3dafb60 100644 --- a/src/app/lib/ui/ui.module.ts +++ b/src/app/lib/components/dialogs/common/dialogs.module.ts @@ -27,15 +27,7 @@ import { AboutDialog, LoginDialog, MessageBarComponent -} from './dialogs'; -import { FileInputComponent } from './file-input.component'; -import { TextDialComponent } from './dial-text'; -import { PlaybackDialog } from './playback-dialog'; -import { PiPVideoComponent } from './pip.component'; -import { WakeLockComponent } from './wakelock.component'; -import { TimerButtonComponent } from './timer-button.component'; - -import { SignalKDetailsComponent } from './signalk-details.component'; +} from './dialogs.component'; @NgModule({ imports: [ @@ -60,16 +52,9 @@ import { SignalKDetailsComponent } from './signalk-details.component'; AlertDialog, ConfirmDialog, AboutDialog, - FileInputComponent, - TextDialComponent, LoginDialog, MessageBarComponent, - WelcomeDialog, - PlaybackDialog, - PiPVideoComponent, - SignalKDetailsComponent, - WakeLockComponent, - TimerButtonComponent + WelcomeDialog ], exports: [ MsgBox, @@ -77,15 +62,10 @@ import { SignalKDetailsComponent } from './signalk-details.component'; ConfirmDialog, AboutDialog, MessageBarComponent, - FileInputComponent, - TextDialComponent, - LoginDialog, - PlaybackDialog, - PiPVideoComponent, - SignalKDetailsComponent, - WakeLockComponent, - TimerButtonComponent + LoginDialog ], providers: [] }) -export class AppUIModule {} +export class CommonDialogs {} + +export * from './dialogs.component'; diff --git a/src/app/modules/geojson/geojson.css b/src/app/lib/components/dialogs/geojson-dialog.css similarity index 61% rename from src/app/modules/geojson/geojson.css rename to src/app/lib/components/dialogs/geojson-dialog.css index ead3d60b..4b45f497 100644 --- a/src/app/modules/geojson/geojson.css +++ b/src/app/lib/components/dialogs/geojson-dialog.css @@ -3,22 +3,10 @@ position: relative; width: 100%; } -.dialog-content { - position: relative; - min-height: 300px; - max-height: 400px; - width: 100%; - min-width: 240px; - overflow-y: auto; -} - .dialog-icon { display: none; } -.card-group { - padding: 5px 5% 5px 5%; -} .card-group-title { font-weight: bold; font-size: 10pt; @@ -45,25 +33,20 @@ } .pnlArrow { - width:40px; + width:30px; text-align:center; } .pnlSKType { width: unset; padding-left:3px; - padding-right:3px; + padding-right:0; + flex: 1 1 auto; } /* phone */ -@media only screen and (min-width : 400px) { - .pnlSKType { - width: 45%; - } - .pnlGeoType { - flex: auto; - } +@media only screen and (min-width : 400px) { } /* tablet */ @@ -78,7 +61,4 @@ /* large */ @media only screen and (min-width : 800px) { - .card-group { - padding: 5px 5% 5px 5%; - } } diff --git a/src/app/modules/geojson/geojson.facade.ts b/src/app/lib/components/dialogs/geojson-dialog.facade.ts similarity index 98% rename from src/app/modules/geojson/geojson.facade.ts rename to src/app/lib/components/dialogs/geojson-dialog.facade.ts index 01df439f..ebafd932 100644 --- a/src/app/modules/geojson/geojson.facade.ts +++ b/src/app/lib/components/dialogs/geojson-dialog.facade.ts @@ -1,4 +1,4 @@ -/** Settings abstraction Facade +/** GeoJSON abstraction Facade * ************************************/ import { Injectable } from '@angular/core'; import { Subject, Observable } from 'rxjs'; @@ -11,8 +11,7 @@ import { SKWaypoint, SKRegion, SKTrack -} from '../skresources/'; -//import { GeoUtils, Position } from 'src/app/lib/geoutils'; +} from 'src/app/modules/skresources/'; import { LineStringFeature, MultiLineStringFeature, diff --git a/src/app/modules/geojson/geojson-dialog.html b/src/app/lib/components/dialogs/geojson-dialog.html similarity index 76% rename from src/app/modules/geojson/geojson-dialog.html rename to src/app/lib/components/dialogs/geojson-dialog.html index 4b856cab..11546506 100644 --- a/src/app/modules/geojson/geojson-dialog.html +++ b/src/app/lib/components/dialogs/geojson-dialog.html @@ -9,15 +9,15 @@ -
-
+
+
Invalid GeoJSON Data:

Selected file does not contain valid GeoJSON data or
does not define a valid FeatureCollection.

-
+
-
+
-
- {{data.fileName}} -
-
- -
+
{{data.fileName}}
@@ -59,7 +45,7 @@
Point: -    +  
arrow_forward @@ -67,7 +53,7 @@
place Waypoints: -    ({{geoData?.waypoints.length}}) +  ({{geoData?.waypoints.length}})
@@ -79,7 +65,7 @@
LineString: -    +  
arrow_forward @@ -87,7 +73,7 @@
directions Routes: -    ({{geoData?.routes.length}}) +  ({{geoData?.routes.length}})
@@ -102,7 +88,7 @@
MultiLineString: -    +  
arrow_forward @@ -110,7 +96,7 @@
show_chart Tracks: -    ({{geoData?.tracks.length}}) +  ({{geoData?.tracks.length}})
@@ -122,7 +108,7 @@
Polygon: -    +  
arrow_forward @@ -130,10 +116,23 @@
tab_unselected Regions: -    ({{geoData?.regions.length}}) +  ({{geoData?.regions.length}})
+ +
+ +
diff --git a/src/app/modules/geojson/geojson-dialog.ts b/src/app/lib/components/dialogs/geojson-dialog.ts similarity index 64% rename from src/app/modules/geojson/geojson-dialog.ts rename to src/app/lib/components/dialogs/geojson-dialog.ts index 4ef314a8..a6da21bc 100644 --- a/src/app/modules/geojson/geojson-dialog.ts +++ b/src/app/lib/components/dialogs/geojson-dialog.ts @@ -1,14 +1,44 @@ import { Component, OnInit, Inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { + MatDialogModule, + MatDialogRef, + MAT_DIALOG_DATA +} from '@angular/material/dialog'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatExpansionModule } from '@angular/material/expansion'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatToolbarModule } from '@angular/material/toolbar'; +import { MatTooltipModule } from '@angular/material/tooltip'; -import { GeoJSONLoadFacade } from './geojson.facade'; +import { GeoJSONLoadFacade } from './geojson-dialog.facade'; import { AppInfo } from 'src/app/app.info'; //** GeoJSON import dialog ** @Component({ + standalone: true, selector: 'geojson-dialog', + imports: [ + CommonModule, + FormsModule, + MatDialogModule, + MatIconModule, + MatButtonModule, + MatCardModule, + MatExpansionModule, + MatCheckboxModule, + MatTooltipModule, + MatToolbarModule, + MatFormFieldModule, + MatInputModule + ], templateUrl: './geojson-dialog.html', - styleUrls: ['./geojson.css'] + styleUrls: ['./geojson-dialog.css'] }) export class GeoJSONImportDialog implements OnInit { public geoData = { diff --git a/src/app/modules/gpx/gpx.module.ts b/src/app/lib/components/dialogs/gpx/gpx.module.ts similarity index 86% rename from src/app/modules/gpx/gpx.module.ts rename to src/app/lib/components/dialogs/gpx/gpx.module.ts index ec5a69f5..0d7bb2d9 100644 --- a/src/app/modules/gpx/gpx.module.ts +++ b/src/app/lib/components/dialogs/gpx/gpx.module.ts @@ -18,8 +18,8 @@ import { MatTooltipModule } from '@angular/material/tooltip'; // ** components ** -import { GPXImportDialog } from './gpxload/import-dialog'; -import { GPXExportDialog } from './gpxsave/export-dialog'; +import { GPXImportDialog } from './gpxload/gpxload-dialog'; +import { GPXExportDialog } from './gpxsave/gpxsave-dialog'; @NgModule({ imports: [ @@ -42,5 +42,5 @@ import { GPXExportDialog } from './gpxsave/export-dialog'; }) export class GPXModule {} -export * from './gpxload/import-dialog'; -export * from './gpxsave/export-dialog'; +export * from './gpxload/gpxload-dialog'; +export * from './gpxsave/gpxsave-dialog'; diff --git a/src/app/modules/gpx/gpxlib.ts b/src/app/lib/components/dialogs/gpx/gpxlib.ts similarity index 100% rename from src/app/modules/gpx/gpxlib.ts rename to src/app/lib/components/dialogs/gpx/gpxlib.ts diff --git a/src/app/modules/gpx/gpxload/gpxload.css b/src/app/lib/components/dialogs/gpx/gpxload/gpxload-dialog.css similarity index 78% rename from src/app/modules/gpx/gpxload/gpxload.css rename to src/app/lib/components/dialogs/gpx/gpxload/gpxload-dialog.css index 2e908007..4bdb923b 100644 --- a/src/app/modules/gpx/gpxload/gpxload.css +++ b/src/app/lib/components/dialogs/gpx/gpxload/gpxload-dialog.css @@ -1,24 +1,16 @@ .gpxload-dialog { font-family: roboto; - position: relative; width: 100%; -} - -.dialog-content { - position: relative; - min-height: 300px; - max-height: 400px; - width: 100%; - min-width: 240px; - overflow-y: auto; + position: relative; width: 75vw; } .dialog-icon { display: none; } -.card-group { - padding: 5px 5% 5px 5%; +.mat-expansion-panel-body { + padding: 0 12px 6px; } + .card-group-title { font-weight: bold; font-size: 10pt; @@ -36,6 +28,7 @@ .pnlSelectedItems { display: none; + line-height: 2.9em; } .pnlSelect { @@ -65,6 +58,7 @@ button { @media only screen and (min-width : 475px) { .pnlSelectedItems { display: inline; + line-height: 2.9em; } .txtSelect { display: inline; @@ -89,9 +83,6 @@ button { /* large */ @media only screen and (min-width : 800px) { - .card-group { - padding: 5px 5% 5px 5%; - } } diff --git a/src/app/modules/gpx/gpxload/gpxload.facade.ts b/src/app/lib/components/dialogs/gpx/gpxload/gpxload-dialog.facade.ts similarity index 99% rename from src/app/modules/gpx/gpxload/gpxload.facade.ts rename to src/app/lib/components/dialogs/gpx/gpxload/gpxload-dialog.facade.ts index e7ba96a7..c3684bcb 100644 --- a/src/app/modules/gpx/gpxload/gpxload.facade.ts +++ b/src/app/lib/components/dialogs/gpx/gpxload/gpxload-dialog.facade.ts @@ -5,7 +5,7 @@ import { Subject, Observable } from 'rxjs'; import { AppInfo } from 'src/app/app.info'; import { SignalKClient } from 'signalk-client-angular'; -import { SKResources } from '../../skresources'; +import { SKResources } from '../../../../../modules/skresources'; import { GPX, GPXRoute, diff --git a/src/app/modules/gpx/gpxload/import-dialog.html b/src/app/lib/components/dialogs/gpx/gpxload/gpxload-dialog.html similarity index 94% rename from src/app/modules/gpx/gpxload/import-dialog.html rename to src/app/lib/components/dialogs/gpx/gpxload/gpxload-dialog.html index 1908b64f..ff0ea9aa 100644 --- a/src/app/modules/gpx/gpxload/import-dialog.html +++ b/src/app/lib/components/dialogs/gpx/gpxload/gpxload-dialog.html @@ -12,7 +12,7 @@ -
+
Invalid GPX Data:

-
+
-
- {{data.fileName}} -
+
{{data.fileName}}
+ + + + +
+
+ + + +  Points: {{pointCount}} +
+
+ + Include Trail from server + +
+
+
+
+ + + +
+
+
+ + +
+ +
+
+
diff --git a/src/app/modules/trail2route/trail2route-dialog.ts b/src/app/lib/components/dialogs/trail2route-dialog.ts similarity index 75% rename from src/app/modules/trail2route/trail2route-dialog.ts rename to src/app/lib/components/dialogs/trail2route-dialog.ts index 2d7f1326..ebd984f5 100644 --- a/src/app/modules/trail2route/trail2route-dialog.ts +++ b/src/app/lib/components/dialogs/trail2route-dialog.ts @@ -2,11 +2,25 @@ ********************************/ import { Component, OnInit, Inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { + MatDialogModule, + MatDialogRef, + MAT_DIALOG_DATA +} from '@angular/material/dialog'; +import { CommonModule } from '@angular/common'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { MatSliderModule } from '@angular/material/slider'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatToolbarModule } from '@angular/material/toolbar'; + +import { CommonDialogs } from 'src/app/lib/components/dialogs'; +import { FreeboardOpenlayersModule } from 'src/app/modules/map/ol'; import { SimplifyAP } from 'simplify-ts'; import { SKRoute } from 'src/app/modules/skresources/resource-classes'; import { SKResources } from 'src/app/modules/skresources//resources.service'; -import { SKStreamFacade } from '../skstream/skstream.facade'; +import { SKStreamFacade } from 'src/app/modules/skstream/skstream.facade'; import { AppInfo } from 'src/app/app.info'; /********* Trail2RouteDialog ********** @@ -14,8 +28,21 @@ import { AppInfo } from 'src/app/app.info'; } ***********************************/ @Component({ + standalone: true, selector: 'ap-trail2routedialog', - templateUrl: `./trail2route.html`, + imports: [ + CommonModule, + MatIconModule, + MatButtonModule, + MatDialogModule, + MatTooltipModule, + MatSliderModule, + MatCheckboxModule, + MatToolbarModule, + CommonDialogs, + FreeboardOpenlayersModule + ], + templateUrl: `./trail2route-dialog.html`, styles: [ ` ._ap-trail2route { diff --git a/src/app/lib/ui/file-input.component.css b/src/app/lib/components/file-input.component.css similarity index 100% rename from src/app/lib/ui/file-input.component.css rename to src/app/lib/components/file-input.component.css diff --git a/src/app/lib/ui/file-input.component.html b/src/app/lib/components/file-input.component.html similarity index 100% rename from src/app/lib/ui/file-input.component.html rename to src/app/lib/components/file-input.component.html diff --git a/src/app/lib/ui/file-input.component.ts b/src/app/lib/components/file-input.component.ts similarity index 92% rename from src/app/lib/ui/file-input.component.ts rename to src/app/lib/components/file-input.component.ts index a86c6a44..8fb6f1fd 100644 --- a/src/app/lib/ui/file-input.component.ts +++ b/src/app/lib/components/file-input.component.ts @@ -3,6 +3,7 @@ * **************************************/ +import { CommonModule } from '@angular/common'; import { Component, Input, @@ -12,7 +13,9 @@ import { } from '@angular/core'; @Component({ + standalone: true, selector: 'ap-file-input', + imports: [ CommonModule ], templateUrl: './file-input.component.html', styleUrls: ['./file-input.component.css'] }) @@ -25,9 +28,15 @@ export class FileInputComponent { @Input() preview = false; @Input() icon = false; @Input() label = 'Upload File'; // ** button text - @Output() chosen: EventEmitter = new EventEmitter(); - @Output() invalid: EventEmitter = new EventEmitter(); - @Output() cleared: EventEmitter = new EventEmitter(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + @Output() chosen: EventEmitter<{ name: string; data: any }> = + new EventEmitter(); + @Output() invalid: EventEmitter<{ + type: string; + value: string; + message: string; + }> = new EventEmitter(); + @Output() cleared: EventEmitter = new EventEmitter(); public avatar = null; diff --git a/src/app/lib/components/index.ts b/src/app/lib/components/index.ts new file mode 100644 index 00000000..8b707a0d --- /dev/null +++ b/src/app/lib/components/index.ts @@ -0,0 +1,6 @@ +export * from './course-settings'; +export * from './dial-text'; +export * from './file-input.component'; +export * from './pip.component'; +export * from './signalk-details.component'; +export * from './wakelock.component'; diff --git a/src/app/lib/ui/pip.component.ts b/src/app/lib/components/pip.component.ts similarity index 75% rename from src/app/lib/ui/pip.component.ts rename to src/app/lib/components/pip.component.ts index 721d3358..76588932 100644 --- a/src/app/lib/ui/pip.component.ts +++ b/src/app/lib/components/pip.component.ts @@ -7,14 +7,20 @@ import { Output, EventEmitter } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; interface PiPVideoElement extends HTMLVideoElement { + // eslint-disable-next-line @typescript-eslint/no-explicit-any requestPictureInPicture(): any; } //** Picture in Picture video component ** @Component({ + standalone: true, selector: 'pip-video', + imports: [MatButtonModule, MatTooltipModule, MatIconModule], template: `
@@ -23,7 +29,6 @@ interface PiPVideoElement extends HTMLVideoElement { -
-
+ +
{{ i.title }} - + -
- + + +
+
+
Anchor Watch:
+
+
+ +
+
+
-
- +
Status:
@@ -54,16 +55,19 @@
+
+ - -
-
-
- RAISE - - - DROP -
+ +
+
+
+ RAISE + + + DROP
- - -
+
+
+
diff --git a/src/app/modules/alarms/anchor-watch.component.ts b/src/app/modules/alarms/components/anchor-watch.component.ts similarity index 67% rename from src/app/modules/alarms/anchor-watch.component.ts rename to src/app/modules/alarms/components/anchor-watch.component.ts index c238144c..a433b36c 100644 --- a/src/app/modules/alarms/anchor-watch.component.ts +++ b/src/app/modules/alarms/components/anchor-watch.component.ts @@ -3,9 +3,15 @@ import { Input, Output, EventEmitter, - ChangeDetectionStrategy + ChangeDetectionStrategy, + SimpleChanges } from '@angular/core'; +interface OutputMessage { + radius: number | null; + raised: boolean +} + @Component({ selector: 'anchor-watch', changeDetection: ChangeDetectionStrategy.OnPush, @@ -20,12 +26,12 @@ export class AnchorWatchComponent { @Input() feet = false; @Input() raised = true; @Input() disable = false; - @Output() change: EventEmitter = new EventEmitter(); - @Output() closed: EventEmitter = new EventEmitter(); + @Output() change: EventEmitter = new EventEmitter(); + @Output() closed: EventEmitter = new EventEmitter(); bgImage: string; display = { sliderColor: 'primary' }; - msg = { radius: null, raised: true }; + msg: OutputMessage = { radius: null, raised: true }; //constructor() { } @@ -36,8 +42,14 @@ export class AnchorWatchComponent { //ngAfterViewInit() { } - ngOnChanges() { + ngOnChanges(changes: SimpleChanges) { this.display.sliderColor = !this.raised ? 'warn' : 'primary'; + if (changes.sliderValue) { + this.sliderValue = + changes.sliderValue.currentValue ?? + changes.sliderValue.previousValue ?? + 0; + } this.bgImage = `url('${ this.raised ? './assets/img/anchor-radius-raised.png' @@ -45,10 +57,10 @@ export class AnchorWatchComponent { }')`; } - setRadius(e: any) { - console.log('raw:', e.value); - console.log('converted:', this.feet ? this.ftToM(e.value) : e.value); - this.msg.radius = this.feet ? this.ftToM(e.value) : e.value; + setRadius(value: number) { + console.log('raw:', value); + console.log('converted:', this.feet ? this.ftToM(value) : value); + this.msg.radius = this.feet ? this.ftToM(value) : value; if (!this.raised) { this.msg.raised = null; // set radius change only this.change.emit(this.msg); diff --git a/src/app/lib/ui/timer-button.component.ts b/src/app/modules/alarms/components/timer-button.component.ts similarity index 82% rename from src/app/lib/ui/timer-button.component.ts rename to src/app/modules/alarms/components/timer-button.component.ts index f94f46f7..2bf64d0a 100644 --- a/src/app/lib/ui/timer-button.component.ts +++ b/src/app/modules/alarms/components/timer-button.component.ts @@ -10,14 +10,20 @@ import { ChangeDetectorRef, EventEmitter } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; @Component({ + standalone: true, selector: 'timer-button', + imports: [CommonModule, MatButtonModule, MatIconModule], changeDetection: ChangeDetectionStrategy.OnPush, styles: [``], template: `
- diff --git a/src/app/modules/course/course.module.ts b/src/app/modules/course/course.module.ts deleted file mode 100644 index 2afbfef0..00000000 --- a/src/app/modules/course/course.module.ts +++ /dev/null @@ -1,49 +0,0 @@ -/***************************** - * Experiments Module - *****************************/ - -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; -import { MatInputModule } from '@angular/material/input'; -import { MatSelectModule } from '@angular/material/select'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { MatBottomSheetModule } from '@angular/material/bottom-sheet'; -import { MatToolbarModule } from '@angular/material/toolbar'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatCardModule } from '@angular/material/card'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatDatepickerModule } from '@angular/material/datepicker'; -//import { MatDialogModule } from '@angular/material/dialog'; -import { AppUIModule } from 'src/app/lib'; - -// ** components ** -import { CourseSettingsModal } from './course-settings'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - MatInputModule, - MatSelectModule, - MatBottomSheetModule, - MatCardModule, - MatIconModule, - MatButtonModule, - MatToolbarModule, - MatCheckboxModule, - MatTooltipModule, - MatSlideToggleModule, - MatDatepickerModule, - //MatDialogModule, - AppUIModule - ], - declarations: [CourseSettingsModal], - exports: [CourseSettingsModal], - providers: [] -}) -export class CourseModule {} - -export * from './course-settings'; diff --git a/src/app/modules/experiments/experiments.module.ts b/src/app/modules/experiments/experiments.module.ts index edf60e8e..5057953d 100644 --- a/src/app/modules/experiments/experiments.module.ts +++ b/src/app/modules/experiments/experiments.module.ts @@ -8,7 +8,7 @@ import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatMenuModule } from '@angular/material/menu'; -import { AppUIModule } from 'src/app/lib'; +import { CommonDialogs } from 'src/app/lib/components/dialogs'; // ** components ** import { ExperimentsComponent } from './experiments'; @@ -20,7 +20,7 @@ import { ExperimentsComponent } from './experiments'; MatIconModule, MatButtonModule, MatTooltipModule, - AppUIModule + CommonDialogs ], declarations: [ExperimentsComponent], exports: [ExperimentsComponent], diff --git a/src/app/modules/experiments/weather/weather-forecast.ts b/src/app/modules/experiments/weather/weather-forecast.ts index 72e8ec4e..8583a9a8 100644 --- a/src/app/modules/experiments/weather/weather-forecast.ts +++ b/src/app/modules/experiments/weather/weather-forecast.ts @@ -20,7 +20,7 @@ import { WeatherData } from './components/weather-data.component'; selector: 'weather-forecast-modal', template: `
- + ac_unit diff --git a/src/app/modules/experiments/weather/weather.module.ts b/src/app/modules/experiments/weather/weather.module.ts index 6455a4e2..e18677b0 100644 --- a/src/app/modules/experiments/weather/weather.module.ts +++ b/src/app/modules/experiments/weather/weather.module.ts @@ -15,8 +15,8 @@ import { MatStepperModule } from '@angular/material/stepper'; import { WeatherForecastModal } from './weather-forecast'; import { WeatherDataComponent } from './components/weather-data.component'; -import { AppUIModule } from 'src/app/lib/ui/ui.module'; -import { UtilitiesModule } from 'src/app/modules/utils/utils.module'; +import { CommonDialogs } from 'src/app/lib/components/dialogs'; +import { PipesModule } from 'src/app/lib/pipes'; @NgModule({ imports: [ @@ -32,8 +32,8 @@ import { UtilitiesModule } from 'src/app/modules/utils/utils.module'; MatInputModule, MatToolbarModule, MatStepperModule, - AppUIModule, - UtilitiesModule + CommonDialogs, + PipesModule ], declarations: [WeatherForecastModal, WeatherDataComponent], exports: [WeatherForecastModal, WeatherDataComponent] diff --git a/src/app/modules/geojson/geojson.module.ts b/src/app/modules/geojson/geojson.module.ts deleted file mode 100644 index 53634acd..00000000 --- a/src/app/modules/geojson/geojson.module.ts +++ /dev/null @@ -1,44 +0,0 @@ -/***************************** - * GPX to Signal K components - *****************************/ - -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatExpansionModule } from '@angular/material/expansion'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatToolbarModule } from '@angular/material/toolbar'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -// ** components ** - -import { GeoJSONImportDialog } from './geojson-dialog'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - MatDialogModule, - MatIconModule, - MatButtonModule, - MatCardModule, - MatExpansionModule, - MatCheckboxModule, - MatTooltipModule, - MatToolbarModule, - MatFormFieldModule, - MatInputModule - ], - declarations: [GeoJSONImportDialog], - exports: [GeoJSONImportDialog], - providers: [] -}) -export class GeoJSONModule {} - -export * from './geojson-dialog'; diff --git a/src/app/modules/index.ts b/src/app/modules/index.ts index 6120b58e..ac60c72d 100644 --- a/src/app/modules/index.ts +++ b/src/app/modules/index.ts @@ -1,12 +1,7 @@ -export * from './settings/settings.module'; -export * from './gpx/gpx.module'; -export * from './geojson/geojson.module'; export * from './alarms/alarms.module'; +export * from './settings/settings.module'; export * from './skresources/resources.module'; export * from './map/map.module'; -export * from './utils/utils.module'; -export * from './course/course.module'; -export * from './trail2route/trail2route.module'; export * from './skstream/skstream.module'; export * from './experiments/experiments.module'; diff --git a/src/app/modules/map/components/navigation/nextpoint.component.ts b/src/app/modules/map/components/navigation/nextpoint.component.ts index 9869ee54..3acb0397 100644 --- a/src/app/modules/map/components/navigation/nextpoint.component.ts +++ b/src/app/modules/map/components/navigation/nextpoint.component.ts @@ -17,7 +17,10 @@ total: number - total number of points selector: 'route-nextpoint', changeDetection: ChangeDetectionStrategy.OnPush, template: ` -
+
-
+
{{ index + 1 }} of {{ total }}
diff --git a/src/app/modules/map/fb-map.component.css b/src/app/modules/map/fb-map.component.css index 62fda689..d6a53587 100644 --- a/src/app/modules/map/fb-map.component.css +++ b/src/app/modules/map/fb-map.component.css @@ -4,33 +4,6 @@ z-index: 4900; } -.playbackPanel { - position: absolute; - z-index: 4900; - bottom: 150px; - left: 10px; - top: auto; - width:100px; - border: gray 1px solid; - border-radius: 5px; - background-color: white; - font-family: roboto; - text-align:center; -} - -.navdataPanel { - position: absolute; - z-index: 4901; - bottom: 25px; - left: 0; - max-width:100%; - max-height: 100px; - text-align: center; - display: flex; - flex-wrap: nowrap; - overflow-x: auto; -} - .control { display: flex; align-items: center; diff --git a/src/app/modules/map/fb-map.component.ts b/src/app/modules/map/fb-map.component.ts index d54b2f90..d0ebf390 100644 --- a/src/app/modules/map/fb-map.component.ts +++ b/src/app/modules/map/fb-map.component.ts @@ -18,7 +18,7 @@ import { Convert } from 'src/app/lib/convert'; import { GeoUtils, Position } from 'src/app/lib/geoutils'; import { AppInfo } from 'src/app/app.info'; -import { SettingsMessage } from 'src/app/lib/info/info.service'; +import { SettingsMessage } from 'src/app/lib/services'; import { SKResources } from '../skresources/resources.service'; import { SKOtherResources } from '../skresources/sets/resource-sets.service'; import { diff --git a/src/app/modules/map/map.module.ts b/src/app/modules/map/map.module.ts index 98065c17..da2e6fb4 100644 --- a/src/app/modules/map/map.module.ts +++ b/src/app/modules/map/map.module.ts @@ -25,9 +25,9 @@ import { RouteNextPointComponent } from './components/navigation'; // ** profiles import { VesselPopoverComponent } from './components/profiles/default'; -import { FreeboardOpenlayersModule } from 'fb-openlayers'; +import { FreeboardOpenlayersModule } from 'src/app/modules/map/ol'; import { FBMapComponent } from './fb-map.component'; -import { UtilitiesModule } from 'src/app/modules/utils/utils.module'; +import { PipesModule } from 'src/app/lib/pipes'; @NgModule({ imports: [ @@ -37,7 +37,7 @@ import { UtilitiesModule } from 'src/app/modules/utils/utils.module'; MatIconModule, MatButtonModule, MatTooltipModule, - UtilitiesModule, + PipesModule, MatCardModule, MatMenuModule, FreeboardOpenlayersModule diff --git a/src/app/modules/map/mapconfig.ts b/src/app/modules/map/mapconfig.ts index 155245ea..76a7137d 100644 --- a/src/app/modules/map/mapconfig.ts +++ b/src/app/modules/map/mapconfig.ts @@ -61,7 +61,7 @@ export const vesselStyles = { anchorXUnits: 'pixels', anchorYUnits: 'pixels', size: [50, 50], - scale: 0.75, + scale: 0.5, rotateWithView: false }) }) diff --git a/projects/fb-openlayers/src/index.ts b/src/app/modules/map/ol/index.ts similarity index 100% rename from projects/fb-openlayers/src/index.ts rename to src/app/modules/map/ol/index.ts diff --git a/projects/fb-openlayers/src/lib/alarms/layer-anchor-alarm.component.ts b/src/app/modules/map/ol/lib/alarms/layer-anchor-alarm.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/alarms/layer-anchor-alarm.component.ts rename to src/app/modules/map/ol/lib/alarms/layer-anchor-alarm.component.ts diff --git a/projects/fb-openlayers/src/lib/alarms/layer-cpa-alarm.component.ts b/src/app/modules/map/ol/lib/alarms/layer-cpa-alarm.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/alarms/layer-cpa-alarm.component.ts rename to src/app/modules/map/ol/lib/alarms/layer-cpa-alarm.component.ts diff --git a/projects/fb-openlayers/src/lib/content.component.ts b/src/app/modules/map/ol/lib/content.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/content.component.ts rename to src/app/modules/map/ol/lib/content.component.ts diff --git a/projects/fb-openlayers/src/lib/control.component.ts b/src/app/modules/map/ol/lib/control.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/control.component.ts rename to src/app/modules/map/ol/lib/control.component.ts diff --git a/projects/fb-openlayers/src/lib/controls.directive.ts b/src/app/modules/map/ol/lib/controls.directive.ts similarity index 100% rename from projects/fb-openlayers/src/lib/controls.directive.ts rename to src/app/modules/map/ol/lib/controls.directive.ts diff --git a/projects/fb-openlayers/src/lib/interactions.directive.ts b/src/app/modules/map/ol/lib/interactions.directive.ts similarity index 100% rename from projects/fb-openlayers/src/lib/interactions.directive.ts rename to src/app/modules/map/ol/lib/interactions.directive.ts diff --git a/projects/fb-openlayers/src/lib/interactions/interaction-draw.component.ts b/src/app/modules/map/ol/lib/interactions/interaction-draw.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/interactions/interaction-draw.component.ts rename to src/app/modules/map/ol/lib/interactions/interaction-draw.component.ts diff --git a/projects/fb-openlayers/src/lib/interactions/interaction-modify.component.ts b/src/app/modules/map/ol/lib/interactions/interaction-modify.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/interactions/interaction-modify.component.ts rename to src/app/modules/map/ol/lib/interactions/interaction-modify.component.ts diff --git a/projects/fb-openlayers/src/lib/layer.component.ts b/src/app/modules/map/ol/lib/layer.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/layer.component.ts rename to src/app/modules/map/ol/lib/layer.component.ts diff --git a/src/app/modules/map/ol/lib/map.component.scss b/src/app/modules/map/ol/lib/map.component.scss new file mode 100644 index 00000000..da777cb3 --- /dev/null +++ b/src/app/modules/map/ol/lib/map.component.scss @@ -0,0 +1 @@ +@import 'ol/ol'; diff --git a/projects/fb-openlayers/src/lib/map.component.ts b/src/app/modules/map/ol/lib/map.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/map.component.ts rename to src/app/modules/map/ol/lib/map.component.ts diff --git a/projects/fb-openlayers/src/lib/map.service.ts b/src/app/modules/map/ol/lib/map.service.ts similarity index 100% rename from projects/fb-openlayers/src/lib/map.service.ts rename to src/app/modules/map/ol/lib/map.service.ts diff --git a/projects/fb-openlayers/src/lib/models.ts b/src/app/modules/map/ol/lib/models.ts similarity index 100% rename from projects/fb-openlayers/src/lib/models.ts rename to src/app/modules/map/ol/lib/models.ts diff --git a/projects/fb-openlayers/src/lib/navigation/layer-arrival-circle.component.ts b/src/app/modules/map/ol/lib/navigation/layer-arrival-circle.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/navigation/layer-arrival-circle.component.ts rename to src/app/modules/map/ol/lib/navigation/layer-arrival-circle.component.ts diff --git a/projects/fb-openlayers/src/lib/navigation/layer-bearing-line.component.ts b/src/app/modules/map/ol/lib/navigation/layer-bearing-line.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/navigation/layer-bearing-line.component.ts rename to src/app/modules/map/ol/lib/navigation/layer-bearing-line.component.ts diff --git a/projects/fb-openlayers/src/lib/navigation/layer-dot.component.ts b/src/app/modules/map/ol/lib/navigation/layer-dot.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/navigation/layer-dot.component.ts rename to src/app/modules/map/ol/lib/navigation/layer-dot.component.ts diff --git a/projects/fb-openlayers/src/lib/navigation/layer-xte-path.component.ts b/src/app/modules/map/ol/lib/navigation/layer-xte-path.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/navigation/layer-xte-path.component.ts rename to src/app/modules/map/ol/lib/navigation/layer-xte-path.component.ts diff --git a/projects/fb-openlayers/src/lib/overlay.component.ts b/src/app/modules/map/ol/lib/overlay.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/overlay.component.ts rename to src/app/modules/map/ol/lib/overlay.component.ts diff --git a/projects/fb-openlayers/src/lib/resources/layer-charts.component.ts b/src/app/modules/map/ol/lib/resources/layer-charts.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/resources/layer-charts.component.ts rename to src/app/modules/map/ol/lib/resources/layer-charts.component.ts diff --git a/projects/fb-openlayers/src/lib/resources/layer-notes.component.ts b/src/app/modules/map/ol/lib/resources/layer-notes.component.ts similarity index 98% rename from projects/fb-openlayers/src/lib/resources/layer-notes.component.ts rename to src/app/modules/map/ol/lib/resources/layer-notes.component.ts index ba41265e..fa1d7b39 100644 --- a/projects/fb-openlayers/src/lib/resources/layer-notes.component.ts +++ b/src/app/modules/map/ol/lib/resources/layer-notes.component.ts @@ -160,7 +160,7 @@ export class NoteLayerComponent implements OnInit, OnDestroy, OnChanges { changeDetection: ChangeDetectionStrategy.OnPush }) export class FreeboardNoteLayerComponent extends NoteLayerComponent { - @Input() notes: Array<[string, SKNote, boolean]>; + @Input() notes: Array<[string, SKNote, boolean]> = []; constructor( protected changeDetectorRef: ChangeDetectorRef, diff --git a/projects/fb-openlayers/src/lib/resources/layer-regions.component.ts b/src/app/modules/map/ol/lib/resources/layer-regions.component.ts similarity index 99% rename from projects/fb-openlayers/src/lib/resources/layer-regions.component.ts rename to src/app/modules/map/ol/lib/resources/layer-regions.component.ts index 7c4fc9ce..a235e7e0 100644 --- a/projects/fb-openlayers/src/lib/resources/layer-regions.component.ts +++ b/src/app/modules/map/ol/lib/resources/layer-regions.component.ts @@ -179,7 +179,7 @@ export class RegionLayerComponent implements OnInit, OnDestroy, OnChanges { changeDetection: ChangeDetectionStrategy.OnPush }) export class FreeboardRegionLayerComponent extends RegionLayerComponent { - @Input() regions: Array<[string, SKRegion, boolean]>; + @Input() regions: Array<[string, SKRegion, boolean]> = []; constructor( protected changeDetectorRef: ChangeDetectorRef, diff --git a/projects/fb-openlayers/src/lib/resources/layer-resourceset.component.ts b/src/app/modules/map/ol/lib/resources/layer-resourceset.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/resources/layer-resourceset.component.ts rename to src/app/modules/map/ol/lib/resources/layer-resourceset.component.ts diff --git a/projects/fb-openlayers/src/lib/resources/layer-routes.component.ts b/src/app/modules/map/ol/lib/resources/layer-routes.component.ts similarity index 99% rename from projects/fb-openlayers/src/lib/resources/layer-routes.component.ts rename to src/app/modules/map/ol/lib/resources/layer-routes.component.ts index eb39c395..9562ca55 100644 --- a/projects/fb-openlayers/src/lib/resources/layer-routes.component.ts +++ b/src/app/modules/map/ol/lib/resources/layer-routes.component.ts @@ -182,7 +182,7 @@ export class RouteLayerComponent implements OnInit, OnDestroy, OnChanges { changeDetection: ChangeDetectionStrategy.OnPush }) export class FreeboardRouteLayerComponent extends RouteLayerComponent { - @Input() routes: Array<[string, SKRoute, boolean]>; + @Input() routes: Array<[string, SKRoute, boolean]> = []; constructor( protected changeDetectorRef: ChangeDetectorRef, diff --git a/projects/fb-openlayers/src/lib/resources/layer-sktarget-tracks.component.ts b/src/app/modules/map/ol/lib/resources/layer-sktarget-tracks.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/resources/layer-sktarget-tracks.component.ts rename to src/app/modules/map/ol/lib/resources/layer-sktarget-tracks.component.ts diff --git a/projects/fb-openlayers/src/lib/resources/layer-sktargets.component.ts b/src/app/modules/map/ol/lib/resources/layer-sktargets.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/resources/layer-sktargets.component.ts rename to src/app/modules/map/ol/lib/resources/layer-sktargets.component.ts diff --git a/projects/fb-openlayers/src/lib/resources/layer-skvessels.component.ts b/src/app/modules/map/ol/lib/resources/layer-skvessels.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/resources/layer-skvessels.component.ts rename to src/app/modules/map/ol/lib/resources/layer-skvessels.component.ts diff --git a/projects/fb-openlayers/src/lib/resources/layer-tracks.component.ts b/src/app/modules/map/ol/lib/resources/layer-tracks.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/resources/layer-tracks.component.ts rename to src/app/modules/map/ol/lib/resources/layer-tracks.component.ts diff --git a/projects/fb-openlayers/src/lib/resources/layer-waypoints.component.ts b/src/app/modules/map/ol/lib/resources/layer-waypoints.component.ts similarity index 99% rename from projects/fb-openlayers/src/lib/resources/layer-waypoints.component.ts rename to src/app/modules/map/ol/lib/resources/layer-waypoints.component.ts index 802217d2..35c6bb23 100644 --- a/projects/fb-openlayers/src/lib/resources/layer-waypoints.component.ts +++ b/src/app/modules/map/ol/lib/resources/layer-waypoints.component.ts @@ -239,7 +239,7 @@ export class WaypointLayerComponent implements OnInit, OnDestroy, OnChanges { changeDetection: ChangeDetectionStrategy.OnPush }) export class FreeboardWaypointLayerComponent extends WaypointLayerComponent { - @Input() waypoints: Array<[string, SKWaypoint, boolean]>; + @Input() waypoints: Array<[string, SKWaypoint, boolean]> = []; constructor( protected changeDetectorRef: ChangeDetectorRef, diff --git a/projects/fb-openlayers/src/lib/util.ts b/src/app/modules/map/ol/lib/util.ts similarity index 100% rename from projects/fb-openlayers/src/lib/util.ts rename to src/app/modules/map/ol/lib/util.ts diff --git a/projects/fb-openlayers/src/lib/vessel/layer-vessel-trail.component.ts b/src/app/modules/map/ol/lib/vessel/layer-vessel-trail.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/vessel/layer-vessel-trail.component.ts rename to src/app/modules/map/ol/lib/vessel/layer-vessel-trail.component.ts diff --git a/projects/fb-openlayers/src/lib/vessel/layer-vessel.component.ts b/src/app/modules/map/ol/lib/vessel/layer-vessel.component.ts similarity index 100% rename from projects/fb-openlayers/src/lib/vessel/layer-vessel.component.ts rename to src/app/modules/map/ol/lib/vessel/layer-vessel.component.ts diff --git a/projects/fb-openlayers/src/lib/view.directive.ts b/src/app/modules/map/ol/lib/view.directive.ts similarity index 100% rename from projects/fb-openlayers/src/lib/view.directive.ts rename to src/app/modules/map/ol/lib/view.directive.ts diff --git a/src/app/modules/settings/components/signalk-preferredpaths.component.ts b/src/app/modules/settings/components/signalk-preferredpaths.component.ts index 6c6a723a..e2f96a57 100644 --- a/src/app/modules/settings/components/signalk-preferredpaths.component.ts +++ b/src/app/modules/settings/components/signalk-preferredpaths.component.ts @@ -17,56 +17,33 @@ import { AppInfo } from 'src/app/app.info'; changeDetection: ChangeDetectionStrategy.OnPush, styleUrls: ['./signalk-preferredpaths.component.css'], template: ` - - -
-
-
-
-
{{ item.value.name }}
-
-
-
+ {{ title }} +
+
+
+
{{ item.value.name }}
+
+
+
+ - - {{ path.split('.').slice(-1) }} - -
+ {{ path.split('.').slice(-1) }} +
-
- - -
- -    - -
-
- +
+ ` }) export class SignalKPreferredPathsComponent { diff --git a/src/app/modules/settings/settings-dialog.css b/src/app/modules/settings/settings-dialog.css index 5241e18e..974af7f6 100644 --- a/src/app/modules/settings/settings-dialog.css +++ b/src/app/modules/settings/settings-dialog.css @@ -23,6 +23,10 @@ min-width: 140px; } +.left-settings-menu-button { + display: none; +} + .right-settings-content { margin-left: 140px; } @@ -42,6 +46,9 @@ only screen and (min-width : 800px) { .left-settings-menu { display: none; } + .left-settings-menu-button { + display: initial; + } .right-settings-content { margin-left: initial; } diff --git a/src/app/modules/settings/settings-dialog.html b/src/app/modules/settings/settings-dialog.html index c54c9bdf..09a55d9e 100644 --- a/src/app/modules/settings/settings-dialog.html +++ b/src/app/modules/settings/settings-dialog.html @@ -1,32 +1,28 @@ -
- - - {{i.text}} - - - -
+ + + {{i.text}} + + + + -
-
- Settings - Preferred Paths -
-
- -
-
+ +
-
+
-
+
DISPLAY
@@ -48,11 +41,11 @@ >
+ Select Instruments App
- parameters: + Parameters
+ Alarm Smoothing Time
+ Dark Mode setting
+ Distance units + Depth units + Speed units + Temperature units + Position display format
-
- -
+ +
+
+ Prefer True / Magnetic values + Notification type to use + Time to wait before advancing
- + Latitude - + Longitude + Length ({{facade.settings.selections.trailDuration}} hrs)
@@ -543,12 +536,12 @@
+ Resolution: Last hour
+ Resolution: 1 hr -> 24 hrs
+ Resolution: > 24 hrs
+ Mark AIS target inactive after + Remove AIS target after + Wind Vector Value + Wind / Trail Zoom Level + Display Profile
+ Notes Zoom Level
+ {{'Fetch Notes radius: (' + + facade.availableUnits.distance.get(distunits.value) + + ')'}}
diff --git a/src/app/modules/settings/settings-dialog.ts b/src/app/modules/settings/settings-dialog.ts index c8af18ee..88f0c4a9 100644 --- a/src/app/modules/settings/settings-dialog.ts +++ b/src/app/modules/settings/settings-dialog.ts @@ -2,6 +2,7 @@ import { Component, OnInit, Inject, ElementRef } from '@angular/core'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { SettingsFacade } from './settings.facade'; +import { FormControl } from '@angular/forms'; interface PreferredPathsResult { save: boolean; @@ -15,7 +16,7 @@ interface PreferredPathsResult { styleUrls: ['./settings-dialog.css'] }) export class SettingsDialog implements OnInit { - public display = { paths: false, favourites: false }; + public display = { favourites: false }; public menuItems = [ { id: 'sectDisplay', text: 'Display' }, { id: 'sectUnits', text: 'Units & Values' }, @@ -43,7 +44,6 @@ export class SettingsDialog implements OnInit { ngOnInit() { this.facade.refresh(); - this.display.paths = this.data.openPrefs; this.facade.settings.selections.aisState.forEach((i: string) => { if (i in this.aisStateFilter) { this.aisStateFilter[i] = true; @@ -72,7 +72,7 @@ export class SettingsDialog implements OnInit { this.display.favourites = this.display.favourites ? false : true; } - onFormChange(e: unknown, f, deferSave = false) { + onFormChange(e: unknown, f: any, deferSave = false) { if (deferSave) { this.saveOnClose = true; } else { @@ -85,7 +85,6 @@ export class SettingsDialog implements OnInit { } onPreferredPaths(e: PreferredPathsResult) { - this.display.paths = false; if (e.save) { this.facade.settings.selections.preferredPaths = e.value; this.facade.applySettings(); diff --git a/src/app/modules/settings/settings.facade.ts b/src/app/modules/settings/settings.facade.ts index 08914aae..e0900fae 100644 --- a/src/app/modules/settings/settings.facade.ts +++ b/src/app/modules/settings/settings.facade.ts @@ -4,7 +4,7 @@ import { Injectable } from '@angular/core'; import { Subject } from 'rxjs'; import { AppInfo } from 'src/app/app.info'; -import { SettingsMessage } from 'src/app/lib/info/info.service'; +import { SettingsMessage } from 'src/app/lib/services'; import { SignalKClient } from 'signalk-client-angular'; interface SKAppsList { @@ -130,9 +130,11 @@ export class SettingsFacade { ]) }; + fixedPosition = [0, 0]; + // ***************************************************** - settings = this.app.config; - data = this.app.data; + public settings!: any; + public data!: any; update$() { return this.app.settings$; @@ -150,6 +152,10 @@ export class SettingsFacade { // ******************************************************* constructor(private app: AppInfo, public signalk: SignalKClient) { + this.data = this.app.data; + this.settings = this.app.config; + this.fixedPosition = this.settings.fixedPosition.slice(); + if (!this.app.config.chartApi) { this.app.config.chartApi = 1; } @@ -168,6 +174,7 @@ export class SettingsFacade { // refresh dynamic data from sources refresh() { this.settings = this.app.config; + this.fixedPosition = this.settings.fixedPosition.slice(); this.getApps(); this.getResourcePaths(); } @@ -264,6 +271,12 @@ export class SettingsFacade { if (!this.app.config.vesselTrail) { this.app.config.selections.trailFromServer = false; } + if ( + typeof this.fixedPosition[0] === 'number' && + typeof this.fixedPosition[1] === 'number' + ) { + this.settings.fixedPosition = this.fixedPosition.slice(); + } this.app.saveConfig(); } } diff --git a/src/app/modules/settings/settings.module.ts b/src/app/modules/settings/settings.module.ts index 2bd1e644..16368222 100644 --- a/src/app/modules/settings/settings.module.ts +++ b/src/app/modules/settings/settings.module.ts @@ -17,6 +17,7 @@ import { MatSlideToggleModule } from '@angular/material/slide-toggle'; 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 { SettingsDialog } from './settings-dialog'; import { SignalKPreferredPathsComponent } from './components/signalk-preferredpaths.component'; @@ -39,7 +40,8 @@ import { SignalKPreferredPathsComponent } from './components/signalk-preferredpa MatSelectModule, MatFormFieldModule, MatInputModule, - MatMenuModule + MatMenuModule, + MatToolbarModule ], declarations: [SettingsDialog, SignalKPreferredPathsComponent], exports: [SettingsDialog, SignalKPreferredPathsComponent] diff --git a/src/app/modules/skresources/lists/aislist.html b/src/app/modules/skresources/lists/aislist.html index c413df08..9a6e0cac 100644 --- a/src/app/modules/skresources/lists/aislist.html +++ b/src/app/modules/skresources/lists/aislist.html @@ -1,58 +1,66 @@
- -
-
Vessels:
-
- - + + +
+
Vessels:
+
- -    - - - +
-
-
- -
+ + +
+
+ + Type to filter list + + + +
+
+ +
+
+ + +
+
+
@@ -61,31 +69,33 @@ *cdkVirtualFor="let r of filterList; let i= index;" style="border-bottom: silver 1px outset" > -
-
- - {{(r[1].name) ? r[1].name : (r[1].mmsi) ? r[1].mmsi : 'Vessel-' - + i}} +
+ -
- - + {{(r[1].name) ? r[1].name : (r[1].mmsi) ? r[1].mmsi : + 'Vessel-' + i}} + +
+
+ + +
-
+
@@ -110,13 +120,13 @@
- - - -   - - +
+ + +
+
+ + Type to filter list + + + +
+
+ +
+
+ +
+
+ + +
+
+
-
-
- -
+
@@ -83,39 +95,41 @@ *cdkVirtualFor="let r of filterList; let i= index;" style="border-bottom: silver 1px outset" > -
-
-
- {{isLocal(r[1].url)}} -  {{r[1].name}} + +
+
+
+ {{isLocal(r[1].url)}} +  {{r[1].name}} +
+
+ {{r[1].description}} +
-
- {{r[1].description}} +
+ +
-
- - -
-
+
@@ -132,6 +146,7 @@ + -
- + +
- (drag to re-order) +
Top Layer
+
+ (drag to re-order) +
-
- Top Layer -
-
-
+ + +
-
+ +
-
-
- {{ isLocal(ch[1].url) }} -
- {{ ch[1].name }} +
+ {{ isLocal(ch[1].url) }} +
+
+ {{ ch[1].name }} +
+
+ drag_indicator +
-
- drag_indicator -
-
+
-
- -
+ + +
- (e.g. World Map) +
Base Layer
+
+ (e.g. World Map) +
-
- Base Layer -
-
-
+ +
`, styles: [ diff --git a/src/app/modules/skresources/lists/notelist.html b/src/app/modules/skresources/lists/notelist.html index c95f16aa..bd1d9a6b 100644 --- a/src/app/modules/skresources/lists/notelist.html +++ b/src/app/modules/skresources/lists/notelist.html @@ -1,65 +1,75 @@
- -
-
Notes:
-
- - + + +
+
Notes:
+
- - - -   - - +
-
-
- -
+ + +
+
+ + Type to filter list + + + +
+
+ +
+
+ +
+
+ + +
+
+
@@ -68,20 +78,22 @@ *cdkVirtualFor="let r of filterList; let i= index;" style="border-bottom: silver 1px outset" > -
-
-
- local_offer -  {{r[1].name}} + +
+
+
+ local_offer +  {{r[1].name}} +
-
+
diff --git a/src/app/modules/skresources/lists/resourcelist.css b/src/app/modules/skresources/lists/resourcelist.css index 570a4c74..ffdf3306 100644 --- a/src/app/modules/skresources/lists/resourcelist.css +++ b/src/app/modules/skresources/lists/resourcelist.css @@ -1,5 +1,5 @@ .resourcelist { - min-width: 150px; + min-width: 180px; position: relative; height: 100%; } @@ -21,7 +21,7 @@ left: 0; right: 0; bottom: 0; - top: 80px; + top: 108px; } .resourcelist .vscroller { diff --git a/src/app/modules/skresources/lists/routelist.html b/src/app/modules/skresources/lists/routelist.html index b2b4f692..a72bd819 100644 --- a/src/app/modules/skresources/lists/routelist.html +++ b/src/app/modules/skresources/lists/routelist.html @@ -1,60 +1,68 @@
- -
-
Routes:
-
- - + + +
+
Routes:
+
- -    - - - +
-
-
- -
+ + +
+
+ + Type to filter list + + + +
+
+ +
+
+ + +
+
+
@@ -66,46 +74,49 @@ *cdkVirtualFor="let r of filterList; let i= index;" style="border-bottom: silver 1px outset" > -
-
-
- {{r[1].name}} -
-
- {{r[1].description}} + +
+
+
+ {{r[1].name}} +
+
+ {{r[1].description}} +
+
+ {{ app.config.units.distance!='m' ? + km2Nm(r[1].distance/1000).toFixed(2) + 'NM' : + (r[1].distance/1000).toFixed(2) + 'km'}} + +
-
- {{ app.config.units.distance!='m' ? - km2Nm(r[1].distance/1000).toFixed(2) + 'NM' : - (r[1].distance/1000).toFixed(2) + 'km'}} - +
+ +
-
- - -
-
+
diff --git a/src/app/modules/skresources/lists/waypointlist.html b/src/app/modules/skresources/lists/waypointlist.html index ece64a4d..077ae3df 100644 --- a/src/app/modules/skresources/lists/waypointlist.html +++ b/src/app/modules/skresources/lists/waypointlist.html @@ -1,60 +1,68 @@
- -
-
Waypoints:
-
- - + + +
+
Waypoints:
+
- -    - - - +
-
-
- -
+ + +
+
+ + Type to filter list + + + +
+
+ +
+
+ + +
+
+
@@ -66,35 +74,37 @@ *cdkVirtualFor="let r of filterList; let i= index;" style="border-bottom: silver 1px outset" > -
-
-
- +
+
+
- room - - {{(r[1].name) ? r[1].name : 'Wpt-' + r[0].slice(-6)}} + + room + + {{(r[1].name) ? r[1].name : 'Wpt-' + r[0].slice(-6)}} +
+
+
+ +
-
- - -
-
+
@@ -145,7 +155,7 @@ -
-
+ + @@ -137,26 +135,23 @@
-
-
- {{(!data.title) ? (data.addMode) ? 'New Note:' : 'Edit Note:' : - data.title}} -
-
+ + {{(!data.title) ? (data.addMode) ? 'New Note' : 'Edit Note' : + data.title}} +
-
- local_offer -
- + + Note name @@ -168,12 +163,12 @@
- + + Group Name @@ -189,7 +184,8 @@
- + + Link to additional content
-
-
- 360 -
-
{{relatedBy}} Notes
-
+ + 360 + {{relatedBy}} Notes + -
-
+ +
-
-

{{ data['title'] }}

+
+
+ {{ + icon + }} +
+
+

{{ data['title'] }}

+
+ -
-
- {{ icon }} -
-
-
-
- - - - Please enter a waypoint name - - -
-
- - + +
+
+ + Signal K Type + + - - -
-
- - - - {{ i.name }} - - - + {{ i.name }} + + + +
+
+
+
Lat:
+
-
-
-
Lat:
-
-
-
-
Lon:
-
-
+
+
Lon:
+
@@ -177,6 +179,7 @@ export class ResourceDialog implements OnInit { title: string; name: string; comment: string; + type?: string; } ) {} @@ -214,7 +217,7 @@ export class ResourceDialog implements OnInit { selector: 'ap-ais-modal', template: `
- + directions_boat @@ -438,7 +441,7 @@ export class AISPropertiesModal implements OnInit { selector: 'ap-aton-modal', template: `
- + {{ data.icon }} @@ -519,7 +522,7 @@ export class AtoNPropertiesModal implements OnInit { selector: 'ap-aircraft-modal', template: `
- + airplanemode_active @@ -607,7 +610,7 @@ export class AircraftPropertiesModal implements OnInit { template: `
- + -
-
- + +
+
Name:
@@ -974,7 +969,7 @@ export class ActiveResourcePropertiesModal implements OnInit {
- +
`, styles: [ @@ -1029,7 +1024,7 @@ export class ChartInfoDialog { selector: 'ap-tracks-modal', template: `
- + -
-
- -
-
- - -  Points: {{pointCount}} -
-
- - Include Trail from server - -
-
-
-
- - - -
-
- - -
- -
-
-
diff --git a/src/app/modules/trail2route/trail2route.module.ts b/src/app/modules/trail2route/trail2route.module.ts deleted file mode 100644 index 58f87405..00000000 --- a/src/app/modules/trail2route/trail2route.module.ts +++ /dev/null @@ -1,38 +0,0 @@ -/***************************** - * Experiments Module - *****************************/ - -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatSliderModule } from '@angular/material/slider'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { AppUIModule } from 'src/app/lib'; - -import { FreeboardOpenlayersModule } from 'fb-openlayers'; - -// ** components ** -import { Trail2RouteDialog } from './trail2route-dialog'; - -@NgModule({ - imports: [ - CommonModule, - MatIconModule, - MatButtonModule, - MatDialogModule, - MatTooltipModule, - MatSliderModule, - MatCheckboxModule, - AppUIModule, - FreeboardOpenlayersModule - ], - declarations: [Trail2RouteDialog], - exports: [Trail2RouteDialog], - providers: [] -}) -export class Trail2RouteModule {} - -export * from './trail2route-dialog'; diff --git a/src/assets/help/index.html b/src/assets/help/index.html index de4a6ecc..1d9ab222 100644 --- a/src/assets/help/index.html +++ b/src/assets/help/index.html @@ -1694,8 +1694,10 @@

settings Settings

  • - Fixed Location Mode: Select when operating from a fixed location e.g. building, etc.
    - Selecting this mode will change the vessel icon to + Fixed Location Mode: Select when operating from a fixed + location e.g. building, etc.
    + Selecting this mode will change the vessel icon to +
    Enter the latitude and longitude of the fixed location.
  • diff --git a/src/styles.scss b/src/styles.scss index e38633ac..46641f59 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -8,6 +8,7 @@ * { tap-highlight-color: transparent; } body { + font-family: Roboto, "Helvetica Neue", sans-serif; background-color: white; margin: 0 0 0 0; -webkit-user-select: none; diff --git a/tsconfig.json b/tsconfig.json index 69a3bd9e..f6b73653 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,24 +7,20 @@ "declaration": false, "downlevelIteration": true, "experimentalDecorators": true, - "module": "es2020", + "module": "es2022", "moduleResolution": "node", "importHelpers": true, - "target": "es2015", + "target": "es2022", "typeRoots": [ "node_modules/@types" ], "lib": [ "es2018", + "es2020", + "es2022", "dom" ], "paths": { - "fb-openlayers": [ - "projects/fb-openlayers/src" - ], - "fb-openlayers/*": [ - "projects/fb-openlayers/src/*" - ], "ol": ["node_modules/@types/ol"], "ol/*": ["node_modules/@types/ol/*"] }