From 6cf6d40181af62128c2c9ec1f89c659caab99863 Mon Sep 17 00:00:00 2001 From: Adrian Panazzolo <38519157+panaaj@users.noreply.github.com> Date: Thu, 12 Dec 2019 12:29:55 +1030 Subject: [PATCH] v1.8.0 --- src/app/app.component.html | 8 +- src/app/app.component.ts | 7 +- src/app/app.info.ts | 16 +- .../{modules/skresources/grib => lib}/grib.ts | 17 +- src/app/modules/alarms/alarms.facade.ts | 2 +- src/app/modules/gpxload/gpxload.facade.ts | 2 +- src/app/modules/gpxload/import-dialog.ts | 2 - .../map/components/feature-ais.component.ts | 2 +- .../components/layer-colormap.component.ts | 9 +- .../components/layer-windvector.component.ts | 2 +- src/app/modules/map/fb-map.component.html | 1 + src/app/modules/map/fb-map.component.ts | 8 +- src/app/modules/map/map.module.ts | 2 +- src/app/modules/map/popover.component.ts | 4 +- .../signalk-preferredpaths.component.ts | 10 +- src/app/modules/settings/settings-dialog.css | 30 +- src/app/modules/settings/settings-dialog.html | 674 +++++++++--------- src/app/modules/settings/settings-dialog.ts | 9 + src/app/modules/settings/settings.facade.ts | 2 +- src/app/modules/settings/settings.module.ts | 3 +- .../skresources/grib/grib-components.ts | 63 +- src/app/modules/skresources/lists/aislist.ts | 2 +- src/app/modules/skresources/lists/notelist.ts | 2 +- .../modules/skresources/lists/routelist.ts | 4 +- .../modules/skresources/lists/waypointlist.ts | 2 +- .../modules/skresources/notes/note-dialog.ts | 2 +- .../modules/skresources/resource-dialogs.ts | 4 +- .../modules/skresources/resources.module.ts | 9 +- .../modules/skresources/resources.service.ts | 8 +- src/app/modules/skstream/skstream.facade.ts | 4 +- src/app/modules/skstream/skstream.service.ts | 2 +- 31 files changed, 512 insertions(+), 400 deletions(-) rename src/app/{modules/skresources/grib => lib}/grib.ts (90%) diff --git a/src/app/app.component.html b/src/app/app.component.html index e7ee61c1..02eb1372 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -360,7 +360,7 @@
 
- - - - Settings - Preferred Paths - - - - - +
+ +
+
+ Settings + Preferred Paths +
+
+ +
+ -
-
-
-
DISPLAY
- -
-
- - - - {{i.name}} - - - -
-
- - parameters: - - -
-
- - Halt App on hide - -
-
- -
-
-
-
-
Select Favourite Apps:
- - - - {{fav.name}} - - +
+ +
+
+
+
+
DISPLAY
+ +
+
+ + + + {{i.name}} + + + +
+
+ + parameters: + + +
+
+ + Halt App on hide + +
+
+ +
-
- -
- -
-
- - Show DEPTH Alarms - -
-
- - - {{i.value}} - - -
-
-
- - Display Vessel Trail - -
-
-
- -
-
- - - {{i.value}} - - +
+
+
+
Select Favourite Apps: +
+ + + + {{fav.name}} + + +
+
+ +
+ +
+
+ + Show DEPTH Alarms + +
+
+ + + {{i.value}} + + +
+
+
+ + Display Vessel Trail + +
+
+
+ +
+
+ + + {{i.value}} + + +
-
- -
+
+
-
-
UNITS & VALUES
- -
-
- - - {{i.value}} - - -
+
+
UNITS & VALUES
+ +
+
+ + + {{i.value}} + + +
-
- - - {{i.value}} - - -
-
-
- +
+ + + {{i.value}} + + +
+
+
+ +
+
+ + + {{i[1]}} + + +
-
- - - {{i[1]}} - - -
-
- -
+
+
-
-
OTHER VESSELS
- -
-
- - - {{i.value}} - - -
+
+
OTHER VESSELS
+ +
+
+ + + {{i.value}} + + +
-
- - - {{i}} - - -
+
+ + + {{i}} + + +
-
-
-
- -
-
RESOURCES: NOTES
- -
-
- - Display Notes on Map - -
-
- - - {{i}} - - -
-
-
-
- - - {{i}} - - -
-
-
-
- - Notes fetch filter: - - - -
-
-
-
- - Edit Group Names -
-
- - Position Group Note - -
-
-
-
- -
-
RESOURCES: VIDEO
- -
-
- - Enable Video - -
-
- - url: - - - Value required. - - -
-
-
+ +
+ +
+
RESOURCES: NOTES
+ +
+
+ + Display Notes on Map + +
+
+ + + {{i}} + + +
+
+
+
+ + + {{i}} + + +
+
+
+
+ + Notes fetch filter: + + + +
+
+
+
+ + Edit Group Names + +
+
+ + Position Group Note + +
+
+
+
+ +
+
RESOURCES: VIDEO
+ +
+
+ + Enable Video + +
+
+ + url: + + + Value required. + + +
+
+
+
+ +
+
+ + Experimental Features + +
+
-
-
-
- - +
+
+ + +
diff --git a/src/app/modules/settings/settings-dialog.ts b/src/app/modules/settings/settings-dialog.ts index c8523953..2f5ff851 100644 --- a/src/app/modules/settings/settings-dialog.ts +++ b/src/app/modules/settings/settings-dialog.ts @@ -13,6 +13,13 @@ import { SettingsFacade } from './settings.facade'; export class SettingsDialog implements OnInit { public display= { paths: false, favourites: false } + public menuItems= [ + {href: "#sectDisplay", text: 'Display'}, + {href: "#sectunits", text: 'Units & Values'}, + {href: "#sectVessels", text: 'Vessels'}, + {href: "#sectNotes", text: 'Notes'}, + {href: "#sectVideo", text: 'Video'} + ]; constructor( public facade: SettingsFacade, @@ -26,6 +33,8 @@ export class SettingsDialog implements OnInit { ngOnDestroy() { } + toggleFavourites() { this.display.favourites= (this.display.favourites) ? false : true } + onFormChange(e:any, f:any) { if(!f.invalid) { this.facade.applySettings() } else { console.warn('SETTINGS:','Form field invalid: Config NOT Saved!') } diff --git a/src/app/modules/settings/settings.facade.ts b/src/app/modules/settings/settings.facade.ts index 79078ac7..f252eed3 100644 --- a/src/app/modules/settings/settings.facade.ts +++ b/src/app/modules/settings/settings.facade.ts @@ -3,7 +3,7 @@ import { Injectable } from '@angular/core'; import { Subject } from 'rxjs'; -import { AppInfo } from '../../app.info'; +import { AppInfo } from 'src/app/app.info'; import { SignalKClient } from 'signalk-client-angular'; @Injectable({ providedIn: 'root' }) diff --git a/src/app/modules/settings/settings.module.ts b/src/app/modules/settings/settings.module.ts index d232912c..eabced2c 100644 --- a/src/app/modules/settings/settings.module.ts +++ b/src/app/modules/settings/settings.module.ts @@ -17,7 +17,6 @@ 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'; @@ -28,7 +27,7 @@ import { SignalKPreferredPathsComponent } from './components/signalk-preferredpa MatCheckboxModule, MatRadioModule, MatCardModule, MatListModule, MatButtonModule, MatIconModule, MatTooltipModule, MatSliderModule, MatSlideToggleModule, MatSelectModule, - MatFormFieldModule, MatInputModule, MatMenuModule, MatToolbarModule + MatFormFieldModule, MatInputModule, MatMenuModule ], declarations: [ SettingsDialog, SignalKPreferredPathsComponent diff --git a/src/app/modules/skresources/grib/grib-components.ts b/src/app/modules/skresources/grib/grib-components.ts index 7f4bb390..79d040ee 100644 --- a/src/app/modules/skresources/grib/grib-components.ts +++ b/src/app/modules/skresources/grib/grib-components.ts @@ -1,9 +1,9 @@ /** GRIB Components ** ********************************/ -import { Component, OnInit, EventEmitter, Output } from '@angular/core'; +import { Component, OnInit, EventEmitter, Output, Input } from '@angular/core'; import { SKResources } from '../resources.service'; -import { GRIB_CATEGORIES } from './grib'; +import { GRIB_CATEGORIES, TEMPERATURE_GRADIENT, ColorGradient } from 'src/app/lib/grib'; /********* GRIBPanel **********/ @Component({ @@ -40,18 +40,22 @@ import { GRIB_CATEGORIES } from './grib';
-
+
- {{i.key}} + {{i.key}}  + +
+
*Zoom In to display
`, styles: [` .grib-panel { font-family: roboto; @@ -80,6 +84,8 @@ export class GRIBPanel implements OnInit { } public selections= {}; // selected entries + @Input() zoomLevel:number; + @Input() minZoom:number= 10; @Output() change:EventEmitter= new EventEmitter(); constructor(private skres: SKResources) { } @@ -88,8 +94,9 @@ export class GRIBPanel implements OnInit { ngOnInit() { // initialise selections GRIB_CATEGORIES.forEach( v=> { - this.selections[v.name]= {selected: false, disabled: true } - this.display.content[v.name]= {} + this.selections[v.name]= {selected: false, disabled: true }; + this.display.content[v.name]= {}; + if(v.name=='Temperature') { this.display.content[v.name]['gradient']= TEMPERATURE_GRADIENT }; }); this.refresh(); } @@ -115,7 +122,8 @@ export class GRIBPanel implements OnInit { // disable check boxes / init content GRIB_CATEGORIES.forEach( v=> { this.selections[v.name].disabled= true; - this.display.content[v.name]= {index: null, type: null} + this.display.content[v.name]['index']= null; + this.display.content[v.name]['type']= null; }); // check for supported content let eidx:number= 0; @@ -185,3 +193,44 @@ export class GRIBPanel implements OnInit { } } + +/********* GRIBGradient **********/ +@Component({ + selector: 'grib-gradient', + template: ` +
+
+ {{(i.hi!=null) ? '<' + i.hi : ''}} + {{(i.hi==null) ? '>' + i.lo : ''}} +
+
+ `, + styles: [` + .grib-gradient { + font-family: roboto; + display: flex; + border: gray 1px solid; + } + .grib-gradient > .cell { + text-align: center; + min-width: 30px; + font-size: 10pt; + } + @media only screen + and (min-device-width : 768px) + and (max-device-width : 1024px), + only screen and (min-width : 800px) { + } + `] +}) +export class GRIBGradient implements OnInit { + + @Input() values:Array= []; + + constructor() { } + + //** lifecycle: events ** + ngOnInit() { } + +} diff --git a/src/app/modules/skresources/lists/aislist.ts b/src/app/modules/skresources/lists/aislist.ts index 574bf331..779685b4 100644 --- a/src/app/modules/skresources/lists/aislist.ts +++ b/src/app/modules/skresources/lists/aislist.ts @@ -1,5 +1,5 @@ import {Component, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core'; -import { AppInfo } from '../../../app.info'; +import { AppInfo } from 'src/app/app.info'; //** AIS Dialog ** @Component({ diff --git a/src/app/modules/skresources/lists/notelist.ts b/src/app/modules/skresources/lists/notelist.ts index d397551d..f60a491f 100644 --- a/src/app/modules/skresources/lists/notelist.ts +++ b/src/app/modules/skresources/lists/notelist.ts @@ -1,5 +1,5 @@ import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core'; -import { AppInfo } from '../../../app.info'; +import { AppInfo } from 'src/app/app.info'; @Component({ selector: 'note-list', diff --git a/src/app/modules/skresources/lists/routelist.ts b/src/app/modules/skresources/lists/routelist.ts index f04d71f4..537b9885 100644 --- a/src/app/modules/skresources/lists/routelist.ts +++ b/src/app/modules/skresources/lists/routelist.ts @@ -1,6 +1,6 @@ import { Component, OnInit, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core'; -import { AppInfo } from '../../../app.info'; -import { Convert } from '../../../lib/convert'; +import { AppInfo } from 'src/app/app.info'; +import { Convert } from 'src/app/lib/convert'; @Component({ selector: 'route-list', diff --git a/src/app/modules/skresources/lists/waypointlist.ts b/src/app/modules/skresources/lists/waypointlist.ts index 3310e0db..5163e4d1 100644 --- a/src/app/modules/skresources/lists/waypointlist.ts +++ b/src/app/modules/skresources/lists/waypointlist.ts @@ -1,5 +1,5 @@ import { Component, OnInit, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core'; -import { AppInfo } from '../../../app.info'; +import { AppInfo } from 'src/app/app.info'; @Component({ selector: 'waypoint-list', diff --git a/src/app/modules/skresources/notes/note-dialog.ts b/src/app/modules/skresources/notes/note-dialog.ts index c4c25a3d..4a3e527c 100644 --- a/src/app/modules/skresources/notes/note-dialog.ts +++ b/src/app/modules/skresources/notes/note-dialog.ts @@ -4,7 +4,7 @@ import {Component, OnInit, Inject} from '@angular/core'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { AppInfo } from '../../../app.info'; +import { AppInfo } from 'src/app/app.info'; import * as ClassicEditor from '@ckeditor/ckeditor5-build-classic'; diff --git a/src/app/modules/skresources/resource-dialogs.ts b/src/app/modules/skresources/resource-dialogs.ts index d98546fc..387d681a 100644 --- a/src/app/modules/skresources/resource-dialogs.ts +++ b/src/app/modules/skresources/resource-dialogs.ts @@ -5,8 +5,8 @@ import {Component, OnInit, Inject} from '@angular/core'; import { SignalKClient } from 'signalk-client-angular'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { Convert } from '../../lib/convert' -import { AppInfo } from '../../app.info' +import { Convert } from 'src/app/lib/convert' +import { AppInfo } from 'src/app/app.info' /********* ResourceDialog ********** data: { diff --git a/src/app/modules/skresources/resources.module.ts b/src/app/modules/skresources/resources.module.ts index 21295d3e..0c2b2666 100644 --- a/src/app/modules/skresources/resources.module.ts +++ b/src/app/modules/skresources/resources.module.ts @@ -24,9 +24,9 @@ import { NoteListComponent } from './lists/notelist'; import { AISListComponent } from './lists/aislist'; import { ResourceDialog, AISPropertiesDialog, AtoNPropertiesDialog } from './resource-dialogs'; -import { GRIBPanel } from './grib/grib-components'; +import { GRIBPanel, GRIBGradient } from './grib/grib-components'; import { SKNotesModule } from './notes'; -import { AppUIModule } from '../../lib/ui/ui.module'; +import { AppUIModule } from 'src/app/lib/ui/ui.module'; @NgModule({ imports: [ @@ -40,13 +40,13 @@ import { AppUIModule } from '../../lib/ui/ui.module'; RouteListComponent, WaypointListComponent, ChartListComponent, AISListComponent, NoteListComponent, ResourceDialog, AISPropertiesDialog, AtoNPropertiesDialog, - GRIBPanel + GRIBPanel, GRIBGradient ], exports: [ RouteListComponent, WaypointListComponent, ChartListComponent, AISListComponent, NoteListComponent, ResourceDialog, AISPropertiesDialog, AtoNPropertiesDialog, - SKNotesModule, GRIBPanel + SKNotesModule, GRIBPanel, GRIBGradient ], entryComponents: [ ResourceDialog, AISPropertiesDialog, AtoNPropertiesDialog @@ -59,4 +59,3 @@ export * from './resource-dialogs'; export * from './resource-classes'; export * from './notes'; export * from './grib/grib-components'; -export * from './grib/grib'; diff --git a/src/app/modules/skresources/resources.service.ts b/src/app/modules/skresources/resources.service.ts index d66efa7c..f2e8e46a 100644 --- a/src/app/modules/skresources/resources.service.ts +++ b/src/app/modules/skresources/resources.service.ts @@ -4,14 +4,14 @@ import { forkJoin, of, Subject, Observable } from 'rxjs'; import { catchError } from 'rxjs/operators'; import { SignalKClient } from 'signalk-client-angular'; -import { AppInfo } from '../../app.info'; -import { GeoUtils, GeoHash } from '../../lib/geoutils' +import { AppInfo } from 'src/app/app.info'; +import { GeoUtils, GeoHash } from 'src/app/lib/geoutils' -import { LoginDialog } from '../../lib/app-ui'; +import { LoginDialog } from 'src/app/lib/app-ui'; import { NoteDialog, RegionDialog } from './notes' import { ResourceDialog } from './resource-dialogs' import { SKChart, SKRoute, SKWaypoint, SKRegion, SKNote } from './resource-classes' -import { GRIB_PATH, Grib } from './grib/grib' +import { GRIB_PATH, Grib } from 'src/app/lib/grib' interface IActiveRoute { action: string; diff --git a/src/app/modules/skstream/skstream.facade.ts b/src/app/modules/skstream/skstream.facade.ts index adbdff2d..28e99e67 100644 --- a/src/app/modules/skstream/skstream.facade.ts +++ b/src/app/modules/skstream/skstream.facade.ts @@ -3,12 +3,12 @@ import { Injectable } from '@angular/core'; import { Observable, Subject } from 'rxjs'; -import { AppInfo } from '../../app.info'; +import { AppInfo } from 'src/app/app.info'; import { SignalKClient } from 'signalk-client-angular'; import { SKStreamProvider } from './skstream.service'; import { SKVessel } from '../skresources/resource-classes'; import { AlarmsFacade } from '../alarms/alarms.facade'; -import { Convert } from '../../lib/convert'; +import { Convert } from 'src/app/lib/convert'; import { SKResources } from '../skresources'; diff --git a/src/app/modules/skstream/skstream.service.ts b/src/app/modules/skstream/skstream.service.ts index 328fa33e..c3392daf 100644 --- a/src/app/modules/skstream/skstream.service.ts +++ b/src/app/modules/skstream/skstream.service.ts @@ -3,7 +3,7 @@ import { Injectable } from '@angular/core'; import { Subject } from 'rxjs'; -import { AppInfo } from '../../app.info'; +import { AppInfo } from 'src/app/app.info'; interface IWorkerCommand { options: any;