@signalk/freeboard-sk 2.24.0-beta.1 → 2.24.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/package.json +1 -1
- package/public/assets/help/img/command-radar.svg +3 -0
- package/public/assets/help/index.html +37 -11
- package/public/{chunk-PZA3QZTP.js → chunk-57OGK3K6.js} +1 -1
- package/public/{chunk-KGDYRDGH.js → chunk-DT3KOU7O.js} +1 -1
- package/public/{chunk-PWNRTQ6O.js → chunk-KII72BJM.js} +1 -1
- package/public/{chunk-FHGR7NXS.js → chunk-PVMR7EP7.js} +73 -65
- package/public/chunk-V6RYVIHA.js +1 -0
- package/public/{chunk-YMSJOPOV.js → chunk-WDCDO7ZN.js} +1 -1
- package/public/{chunk-KGAM4GPE.js → chunk-WIUBUSFZ.js} +1 -1
- package/public/index.html +2 -2
- package/public/{main-JIB7H6RJ.js → main-CDKOXZZ2.js} +11 -11
- package/public/{styles-ISYGHQ6F.css → styles-N7HVRSAT.css} +1 -1
- package/public/{worker-AZ3UW6SK.js → worker-7GKP5VP4.js} +4 -4
- package/public/{worker-V6HMSEDU.js → worker-PVLEZAQQ.js} +4 -4
- package/public/chunk-PMYUKLGR.js +0 -1
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@ See the [FAQs](https://github.com/SignalK/freeboard-sk/wiki) for more informatio
|
|
|
21
21
|
Moving map display with:
|
|
22
22
|
|
|
23
23
|
- Multiple chart overlay using both of online and locally served charts
|
|
24
|
+
- Radar overlay
|
|
24
25
|
- Built in support (no plugin required) for OpenStreetMap and OpenSeaMap(from Signal K server)
|
|
25
26
|
- North-up / Vessel-up orientation
|
|
26
27
|
- Moving Map / Moving Vessel
|
|
@@ -78,6 +79,16 @@ Whilst not specifically defined in the Signal K specification, Freeboard-SK supp
|
|
|
78
79
|
|
|
79
80
|
---
|
|
80
81
|
|
|
82
|
+
### Radar Overlay:
|
|
83
|
+
|
|
84
|
+
Freeboard-SK supports the Signal K RADAR API which provides connection to radars via the MAYARA server.
|
|
85
|
+
|
|
86
|
+
> Note: Requires `signalk-container` & `@marineyachtradar/signalk-plugin` to be installed on the Signal K Server.
|
|
87
|
+
|
|
88
|
+

|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
81
92
|
### Autopilot Console:
|
|
82
93
|
|
|
83
94
|
Freeboard-SK supports the Signal K Autopilot API which enables common operations to be performed
|
|
@@ -190,6 +201,7 @@ The following plugins are recommended for installation on the Signal K Server to
|
|
|
190
201
|
- Charts: `@signalk/charts-plugin`, `signalk-chart-provider-simple`, `signalk-pmtiles-plugin`, etc.
|
|
191
202
|
- Anchor Watch: `signalk-anchoralarm-plugin`
|
|
192
203
|
- Weather Forcasts: `signalk-openweather-provider`
|
|
204
|
+
- Display RADAR overlay: `signalk-container` & `@marineyachtradar/signalk-plugin`
|
|
193
205
|
|
|
194
206
|
---
|
|
195
207
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM21.5 12C21.5 17.2467 17.2467 21.5 12 21.5C6.75329 21.5 2.5 17.2467 2.5 12C2.5 6.75329 6.75329 2.5 12 2.5C14.3534 2.5 16.5069 3.35575 18.1664 4.77305L17.1017 5.83773C16.4879 5.32954 15.8004 4.915 15.0616 4.60896C14.091 4.20693 13.0507 4 12.0001 4C10.9495 4 9.90925 4.20693 8.93865 4.60896C7.96804 5.011 7.08613 5.60028 6.34326 6.34315L7.40392 7.40381C8.0075 6.80023 8.72406 6.32144 9.51267 5.99478C10.3013 5.66813 11.1465 5.5 12.0001 5.5C12.8537 5.5 13.6989 5.66813 14.4876 5.99478C15.0442 6.22533 15.5649 6.53167 16.0353 6.90417L14.9652 7.97423C14.6406 7.73512 14.2875 7.5356 13.9133 7.3806C13.3067 7.12933 12.6565 7 11.9999 7C11.3433 7 10.6931 7.12933 10.0865 7.3806C9.47984 7.63188 8.92865 8.00017 8.46436 8.46447L9.52502 9.52513C9.85002 9.20012 10.2359 8.94231 10.6605 8.76642C11.0851 8.59053 11.5403 8.5 11.9999 8.5C12.4595 8.5 12.9146 8.59053 13.3393 8.76642C13.5304 8.84559 13.7137 8.94135 13.8871 9.05237L12.7812 10.1583C12.5412 10.0564 12.2772 10 12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14C13.1046 14 14 13.1046 14 12C14 11.7229 13.9436 11.459 13.8418 11.219L19.2271 5.83372C20.6443 7.49317 21.5 9.64666 21.5 12Z" fill="#1F1F1F"/>
|
|
3
|
+
</svg>
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
<li><a href="#display">Display</a></li>
|
|
52
52
|
<li><a href="#navdata">Navigation</a></li>
|
|
53
53
|
<li><a href="#autopilot">Autopilot</a></li>
|
|
54
|
+
<li><a href="#radar">RADAR</a></li>
|
|
54
55
|
<li><a href="#resources">Resources</a></li>
|
|
55
56
|
<li><a href="#menus">Menus</a></li>
|
|
56
57
|
<li><a href="#aistargets">- Vessels</a></li>
|
|
@@ -129,17 +130,6 @@
|
|
|
129
130
|
<i>Please note the following feature has been deprecated:</i><br />
|
|
130
131
|
<ul>
|
|
131
132
|
<li>
|
|
132
|
-
<b>Weather Service:</b> With the introduction to the Signal K
|
|
133
|
-
Weather API in Signal K Server 2.16.0 the in-built OpenWeather
|
|
134
|
-
provider is now deprecated and will be removed in an upcoming
|
|
135
|
-
release.<br />
|
|
136
|
-
Once you have updated Signal K Server to v2.16.0 (or later) you
|
|
137
|
-
can install the weather provider plugin(s) of your choice to
|
|
138
|
-
continue having weather data available in Freeboard-SK.<br />
|
|
139
|
-
<b
|
|
140
|
-
>Note: The <i>signalk-openweather-provider</i> plugin provides
|
|
141
|
-
equivalent functionality to the deprecated built-in service.</b
|
|
142
|
-
>
|
|
143
133
|
</li>
|
|
144
134
|
</ul>
|
|
145
135
|
</div>-->
|
|
@@ -225,6 +215,13 @@
|
|
|
225
215
|
<b>signalk-pmtiles-plugin</b>
|
|
226
216
|
</td>
|
|
227
217
|
</tr>
|
|
218
|
+
<tr>
|
|
219
|
+
<td>RADAR Overlay</td>
|
|
220
|
+
<td>
|
|
221
|
+
<b>signalk-container</b><br />
|
|
222
|
+
<b>@marineyachtradar/signalk-plugin</b>
|
|
223
|
+
</td>
|
|
224
|
+
</tr>
|
|
228
225
|
<tr>
|
|
229
226
|
<td>Course data (DTG, VMG, ETA, etc)</td>
|
|
230
227
|
<td>
|
|
@@ -692,6 +689,28 @@
|
|
|
692
689
|
</div>
|
|
693
690
|
</div>
|
|
694
691
|
|
|
692
|
+
<div class="panel" id="radar">
|
|
693
|
+
<h4><img src="./img/command-radar.svg" /> RADAR Overlay</h4>
|
|
694
|
+
|
|
695
|
+
Freeboard-SK supports the Signal K RADAR API which enables
|
|
696
|
+
communication with RADAR devices via a MAYARA server.<br />
|
|
697
|
+
|
|
698
|
+
When RADARs are detected, Freeboard-SK will display the
|
|
699
|
+
<img src="./img/command-radar.svg" />
|
|
700
|
+
button to toggle on/off the RADAR display.
|
|
701
|
+
<br /> <br />
|
|
702
|
+
|
|
703
|
+
When multiple RADAR devices are present you can select the preferred
|
|
704
|
+
device to use in
|
|
705
|
+
<a href="#settings">SETTINGS</a>. <br /> <br />
|
|
706
|
+
|
|
707
|
+
<i
|
|
708
|
+
>Note: To enable RADAR support your Signal K Server must have both
|
|
709
|
+
the <b>signalk-container</b> and
|
|
710
|
+
<b>@marineyachtradar/signalk-plugin</b> plugins installed.
|
|
711
|
+
</i>
|
|
712
|
+
</div>
|
|
713
|
+
|
|
695
714
|
<div class="panel" id="resources">
|
|
696
715
|
<h4><i class="material-icons">layers</i> Resources / Layers</h4>
|
|
697
716
|
|
|
@@ -2677,6 +2696,13 @@
|
|
|
2677
2696
|
|
|
2678
2697
|
<hr />
|
|
2679
2698
|
|
|
2699
|
+
<b>RADAR:</b><br />
|
|
2700
|
+
This section allows you to set the default RADAR device to use when
|
|
2701
|
+
there are multiple RADAR devices available.<br />
|
|
2702
|
+
Click the <b>REFRESH</b> button to fetch the list of RADARs from the
|
|
2703
|
+
Signal K Server.
|
|
2704
|
+
<hr />
|
|
2705
|
+
|
|
2680
2706
|
<b>SIGNAL K:</b><br />
|
|
2681
2707
|
This section allows you to set parameters for the Signal K stream
|
|
2682
2708
|
connection to provide control over the type and number of features
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Da as a}from"./chunk-
|
|
1
|
+
import{Da as a}from"./chunk-PVMR7EP7.js";import"./chunk-TQPGRJVE.js";import"./chunk-QI5ICQLG.js";import"./chunk-QPQHN5VS.js";import"./chunk-EQVTEUXC.js";export{a as GeoJSONImportDialog};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as re}from"./chunk-A7QJNGJ7.js";import{
|
|
1
|
+
import{a as re}from"./chunk-A7QJNGJ7.js";import{E as se,H as le,b as $,c as A,m as H,n as j,o as N,p as Y,q as Z,r as ee,s as te,t as ie,u as ne,v as ae,y as oe}from"./chunk-PVMR7EP7.js";import{i as U,j as z,k as q}from"./chunk-TQPGRJVE.js";import{d as B}from"./chunk-QI5ICQLG.js";import{Aa as f,Ba as x,Da as b,Ea as T,Ed as V,Fa as v,Ga as h,Gd as O,Ha as a,Ia as o,Ja as y,Jd as W,L as C,Ld as F,M as d,Md as K,N as m,Qa as u,Sa as _,Ua as p,cb as w,ce as L,fa as l,hb as r,ib as P,jb as M,ka as S,kb as D,na as I,ne as J,rd as E,sd as R,se as Q,vd as G,xd as X}from"./chunk-QPQHN5VS.js";import{f as k}from"./chunk-EQVTEUXC.js";function ce(s,t){if(s&1){let e=u();a(0,"button",11),_("click",function(){d(e);let i=p();return m(i.load())}),a(1,"mat-icon"),r(2,"file_upload"),o(),r(3," \xA0Load "),o()}if(s&2){let e=p();h("disabled",!e.display.loadRoutesOK&&!e.display.loadWaypointsOK&&!e.display.loadTracksOK)}}function de(s,t){s&1&&(a(0,"div",10)(1,"div")(2,"b"),r(3,"Invalid GPX Data:"),o(),y(4,"br")(5,"br"),a(6,"i"),r(7,"Selected file does not contain GPX data or"),y(8,"br"),r(9," does not correctly implement namespaced <extensions> attributes."),o()()())}function me(s,t){s&1&&y(0,"mat-progress-bar",12)}function he(s,t){if(s&1){let e=u();a(0,"div",23)(1,"div",24),r(2),o(),a(3,"div",25)(4,"mat-checkbox",26,0),_("change",function(){let i=d(e).$index,c=w(5),g=p(4);return m(g.checkWpt(c.checked,i))}),o()()()}if(s&2){let e=t.$implicit,n=t.$index,i=p(4);l(2),P(e.name),l(2),h("checked",i.selWaypoints[n])}}function _e(s,t){if(s&1){let e=u();a(0,"div",13)(1,"mat-expansion-panel",16),_("opened",function(){d(e);let i=p(3);return m(i.display.expand.waypoints=!0)})("closed",function(){d(e);let i=p(3);return m(i.display.expand.waypoints=!1)}),a(2,"mat-expansion-panel-header",17)(3,"mat-panel-title")(4,"mat-icon",18),r(5,"place"),o(),r(6," \xA0\xA0 "),a(7,"b"),r(8,"Waypoints:"),o()(),a(9,"mat-panel-description")(10,"div",5)(11,"span",19),r(12),o(),a(13,"span",20)(14,"mat-checkbox",21),_("change",function(i){d(e);let c=p(3);return m(c.checkWpt(i.checked,-1))})("click",function(i){return d(e),m(i.cancelBubble=!0)}),o()()()()(),a(15,"div",22),T(16,he,6,2,"div",23,b),o()()()}if(s&2){let e=p(3);l(),h("expanded",e.display.expand.waypoints),l(11),D(" (",e.display.selCount.waypoints," of ",e.gpxData==null?null:e.gpxData.waypoints.length,") "),l(2),h("indeterminate",e.display.someWptChecked)("checked",e.display.allWaypointsChecked)("disabled",e.gpxData.waypoints.length===0),l(2),v(e.gpxData.waypoints)}}function ue(s,t){if(s&1){let e=u();a(0,"div",23)(1,"div",24),r(2),o(),a(3,"div",25)(4,"mat-checkbox",29,1),_("change",function(){let i=d(e).$index,c=w(5),g=p(4);return m(g.checkRte(c.checked,i))}),o()()()}if(s&2){let e=t.$implicit,n=t.$index,i=p(4);l(2),P(e.name),l(2),h("checked",i.selRoutes[n])}}function fe(s,t){if(s&1){let e=u();a(0,"div",13)(1,"mat-expansion-panel",16),_("opened",function(){d(e);let i=p(3);return m(i.display.expand.routes=!0)})("closed",function(){d(e);let i=p(3);return m(i.display.expand.routes=!1)}),a(2,"mat-expansion-panel-header",17)(3,"mat-panel-title")(4,"mat-icon",27),r(5,"directions"),o(),r(6," \xA0\xA0 "),a(7,"b"),r(8,"Routes:"),o()(),a(9,"mat-panel-description")(10,"div",5)(11,"span",19),r(12),o(),a(13,"span",20)(14,"mat-checkbox",28),_("change",function(i){d(e);let c=p(3);return m(c.checkRte(i.checked,-1))})("click",function(i){return d(e),m(i.cancelBubble=!0)}),o()()()()(),a(15,"div",22),T(16,ue,6,2,"div",23,b),o()()()}if(s&2){let e=p(3);l(),h("expanded",e.display.expand.routes),l(11),D(" (",e.display.selCount.routes," of ",e.gpxData==null?null:e.gpxData.routes.length,") "),l(2),h("indeterminate",e.display.someRteChecked)("checked",e.display.allRoutesChecked)("disabled",e.gpxData.routes.length==0),l(2),v(e.gpxData.routes)}}function xe(s,t){if(s&1){let e=u();a(0,"div",23)(1,"div",24),r(2),o(),a(3,"div",25)(4,"mat-checkbox",32,2),_("change",function(){let i=d(e).$index,c=w(5),g=p(4);return m(g.checkTrk(c.checked,i))}),o()()()}if(s&2){let e=t.$implicit,n=t.$index,i=p(4);l(2),P(e.name),l(2),h("checked",i.selTracks[n])}}function ge(s,t){if(s&1){let e=u();a(0,"div",13)(1,"mat-expansion-panel",16),_("opened",function(){d(e);let i=p(3);return m(i.display.expand.tracks=!0)})("closed",function(){d(e);let i=p(3);return m(i.display.expand.tracks=!1)}),a(2,"mat-expansion-panel-header",17)(3,"mat-panel-title")(4,"mat-icon",30),r(5,"show_chart"),o(),r(6," \xA0\xA0 "),a(7,"b"),r(8,"Tracks:"),o()(),a(9,"mat-panel-description")(10,"div",5)(11,"span",19),r(12),o(),a(13,"span",20)(14,"mat-checkbox",31),_("change",function(i){d(e);let c=p(3);return m(c.checkTrk(i.checked,-1))})("click",function(i){return d(e),m(i.cancelBubble=!0)}),o()()()()(),a(15,"div",22),T(16,xe,6,2,"div",23,b),o()()()}if(s&2){let e=p(3);l(),h("expanded",e.display.expand.tracks),l(11),D(" (",e.display.selCount.tracks," of ",e.gpxData==null?null:e.gpxData.tracks.length,") "),l(2),h("indeterminate",e.display.someTrkChecked)("checked",e.display.allTracksChecked)("disabled",e.gpxData.tracks.length==0),l(2),v(e.gpxData.tracks)}}function Ce(s,t){if(s&1&&(a(0,"div",13)(1,"div",14)(2,"div"),r(3,"File:"),o(),a(4,"div",15),r(5),o()(),y(6,"mat-divider"),o(),f(7,_e,18,6,"div",13),f(8,fe,18,6,"div",13),f(9,ge,18,6,"div",13)),s&2){let e=p(2);l(5),M(" ",e.data.fileName," "),l(2),x(e.gpxData.waypoints.length!=0?7:-1),l(),x(e.gpxData.routes.length!=0?8:-1),l(),x(e.gpxData.tracks.length!=0&&e.app.featureFlags().resourceTracks?9:-1)}}function ye(s,t){if(s&1&&(a(0,"div",10),f(1,me,1,0,"mat-progress-bar",12)(2,Ce,10,4),o()),s&2){let e=p();l(),x(e.app.sIsFetching()?1:2)}}var pe=class s{constructor(t){this.data=t}gpxData={name:"",routes:[],waypoints:[],tracks:[]};selRoutes=[];selectedRoute=null;selWaypoints=[];selTracks=[];display={notValid:!1,allRoutesChecked:!1,allWaypointsChecked:!1,allTracksChecked:!1,someWptChecked:!1,someRteChecked:!1,someTrkChecked:!1,loadRoutesOK:!1,loadWaypointsOK:!1,loadTracksOK:!1,routeViewer:!1,selCount:{routes:0,waypoints:0,tracks:0},expand:{routes:!1,waypoints:!1,tracks:!1}};errorCount=0;subCount=0;gpx;app=C(se);dialogRef=C(E);skres=C(le);signalk=C(oe);ngOnInit(){this.data.fileData=this.data.fileData||null,this.parseGPXData(this.data.fileData)}ngOnDestroy(){this.clear()}load(){this.uploadToServer({rte:{selected:this.selRoutes},wpt:{selected:this.selWaypoints},trk:{selected:this.selTracks}})}parseGPXData(t){return k(this,null,function*(){if(this.display.allRoutesChecked=!1,this.display.loadRoutesOK=!1,this.selRoutes=[],this.display.allWaypointsChecked=!1,this.display.loadWaypointsOK=!1,this.selWaypoints=[],this.display.allTracksChecked=!1,this.display.loadTracksOK=!1,this.selTracks=[],this.display.selCount={routes:0,waypoints:0,tracks:0},this.display.expand={routes:!1,waypoints:!1,tracks:!1},this.display.notValid=!1,this.gpxData=yield this.parseFileData(t),!this.gpxData){console.warn(`Selected file does not contain GPX data or
|
|
2
2
|
does not correctly implement namespaced <extensions> attributes`,"Invalid GPX Data:"),this.display.notValid=!0;return}this.gpxData.routes.forEach(()=>{this.selRoutes.push(!1)}),this.selRoutes.length===1&&(this.selRoutes[0]=!0,this.display.allRoutesChecked=!0,this.display.expand.routes=!0,this.display.loadRoutesOK=!0,this.display.selCount.routes=1),this.gpxData.waypoints.forEach(()=>{this.selWaypoints.push(!1)}),this.selWaypoints.length===1&&(this.selWaypoints[0]=!0,this.display.allWaypointsChecked=!0,this.display.expand.waypoints=!0,this.display.loadWaypointsOK=!0,this.display.selCount.waypoints=1),this.gpxData.tracks.forEach(()=>{this.selTracks.push(!1)}),this.selTracks.length===1&&(this.selTracks[0]=!0,this.display.allTracksChecked=!0,this.display.expand.tracks=!0,this.display.loadTracksOK=!0,this.display.selCount.tracks=1)})}checkRte(t,e=-1){let n=0;if(e!==-1){this.selRoutes[e]=t,this.display.loadRoutesOK=t;for(let i of this.selRoutes)i&&n++;this.display.loadRoutesOK=n!==0,this.display.selCount.routes=n,this.display.allRoutesChecked=n===this.selRoutes.length}else{for(let i=0;i<this.selRoutes.length;i++)this.selRoutes[i]=t,this.display.loadRoutesOK=t,this.display.allRoutesChecked=t;this.display.selCount.routes=t?this.selRoutes.length:0}this.display.someRteChecked=!(this.display.allRoutesChecked||n===0)}checkWpt(t,e=-1){let n=0;if(e!==-1){this.selWaypoints[e]=t,this.display.loadWaypointsOK=t;for(let i of this.selWaypoints)i&&n++;this.display.loadWaypointsOK=n!==0,this.display.selCount.waypoints=n,this.display.allWaypointsChecked=n===this.selWaypoints.length}else{for(let i=0;i<this.selWaypoints.length;i++)this.selWaypoints[i]=t,this.display.loadWaypointsOK=t,this.display.allWaypointsChecked=t;this.display.selCount.waypoints=t?this.selWaypoints.length:0}this.display.someWptChecked=!(this.display.allWaypointsChecked||n===0)}checkTrk(t,e=-1){let n=0;if(e!==-1){this.selTracks[e]=t,this.display.loadTracksOK=t;for(let i of this.selTracks)i&&n++;this.display.loadTracksOK=n!==0,this.display.selCount.tracks=n,this.display.allTracksChecked=n===this.selTracks.length}else{for(let i=0;i<this.selTracks.length;i++)this.selTracks[i]=t,this.display.loadTracksOK=t,this.display.allTracksChecked=t;this.display.selCount.tracks=t?this.selTracks.length:0}this.display.someTrkChecked=!(this.display.allTracksChecked||n===0)}clear(){this.gpx=null}parseFileData(t){return k(this,null,function*(){let e={name:"",routes:[],waypoints:[],tracks:[]};if(this.gpx=new re,this.app.sIsFetching.set(!0),!(yield this.gpx.parse(t)))return this.app.sIsFetching.set(!1),null;let n=1;return this.gpx.rte.forEach(i=>{e.routes.push({name:i.name!==""?i.name:`Rte: ${n}`,description:i.desc?i.desc:i.cmt?i.cmt:"",wptcount:i.rtept.length}),n++}),n=1,this.gpx.wpt.forEach(i=>{e.waypoints.push({name:i.name?i.name:`Wpt: ${n}`,description:i.desc?i.desc:i.cmt?i.cmt:""}),n++}),n=1,this.gpx.trk.forEach(i=>{e.tracks.push({name:i.name?i.name:`Trk: ${n}`,description:i.desc?i.desc:i.cmt?i.cmt:""}),n++}),this.app.sIsFetching.set(!1),e})}uploadToServer(t){return k(this,null,function*(){this.app.sIsFetching.set(!0),this.errorCount=0,this.subCount=0;for(let n=0;n<t.rte.selected.length;n++)t.rte.selected[n]&&this.transformRoute(this.gpx.rte[n]);for(let n=0;n<t.wpt.selected.length;n++)t.wpt.selected[n]&&this.transformWaypoint(this.gpx.wpt[n]);let e=[];for(let n=0;n<t.trk.selected.length;n++)if(t.trk.selected[n]){let i=this.transformTrack(this.gpx.trk[n]);this.subCount++;try{let c=yield this.skres.postToServer("tracks",i);this.subCount--,Math.floor(c.statusCode/100)===2?(e.push(c.id),this.app.debug("SUCCESS: Track added.")):this.errorCount++,this.checkComplete()}catch(c){this.errorCount++,this.subCount--,this.logError(c),this.checkComplete()}}e.length!==0&&this.skres.trackAddFromServer(e)})}errorList=[];logError(t){let e=t.error?t.error.message:t.message;this.errorList.push({status:t.status,message:e})}checkComplete(){this.subCount===0&&(this.app.sIsFetching.set(!1),this.app.saveConfig(),this.dialogRef.close({errCount:this.errorCount,errList:this.errorList}),this.app.debug(`GPXLoad: complete: ${this.errorCount}`))}transformRoute(t){let e=this.skres.buildRoute(t.rtept.map(i=>[i.lon,i.lat])),n=e[1];n.name=t.name??"",n.description=t.desc??"",t.cmt&&(n.feature.properties.cmt=t.cmt),t.src&&(n.feature.properties.src=t.src),t.number&&(n.feature.properties.number=t.number),t.type&&(n.feature.properties.type=t.type),n.feature.properties.coordinatesMeta=[],n.feature.properties.coordinatesMeta=t.rtept.map(i=>{let c={name:i.name??""};return i.cmt&&(c.description=i.cmt),c}),this.subCount++,this.signalk.api.put(this.app.skApiVersion,`/resources/routes/${e[0]}`,e[1]).subscribe(i=>{this.subCount--,Math.floor(i.statusCode/100)===2?(this.app.debug("SUCCESS: Route added."),this.app.config.selections.routes.push(e[0])):this.errorCount++,this.checkComplete()},i=>{this.errorCount++,this.subCount--,this.logError(i),this.checkComplete()})}transformWaypoint(t){let e=this.skres.buildWaypoint([t.lon,t.lat]),n=e[1];t.ele&&n.feature.geometry.coordinates.push(t.ele),t.name&&t.name.length!==0&&(n.name=t.name),t.desc&&t.desc.length!==0&&(n.description=t.desc),t.type&&(n.type=t.type),t.cmt&&(n.feature.properties.cmt=t.cmt),t.src&&(n.feature.properties.src=t.src),t.sym&&(n.feature.properties.sym=t.sym),this.subCount++,this.signalk.api.put(this.app.skApiVersion,`/resources/waypoints/${e[0]}`,e[1]).subscribe(i=>{this.subCount--,Math.floor(i.statusCode/100)===2?(this.app.debug("SUCCESS: Waypoint added."),this.app.config.selections.waypoints.push(e[0])):this.errorCount++,this.checkComplete()},i=>{this.errorCount++,this.subCount--,this.logError(i),this.checkComplete()})}transformTrack(t){let e={feature:{type:"Feature",geometry:{type:"MultiLineString",coordinates:[]},properties:{},id:""}};return t.trkseg&&t.trkseg.forEach(n=>{let i=[];n.trkpt.forEach(c=>{i.push([c.lon,c.lat])}),e.feature.geometry.coordinates.push(i)}),t.name&&t.name.length!==0?e.feature.properties.name=t.name:e.feature.properties.name=`gpxtrk #${Math.random().toString().slice(-5)}`,t.desc&&t.desc.length!==0&&(e.feature.properties.description=t.desc),t.cmt&&(e.feature.properties.cmt=t.cmt),t.src&&(e.feature.properties.src=t.src),t.type&&(e.feature.properties.type=t.type),e}static \u0275fac=function(e){return new(e||s)(S(R))};static \u0275cmp=I({type:s,selectors:[["gpxload-dialog"]],decls:13,vars:3,consts:[["wval",""],["rval",""],["tval",""],[1,"gpxload-dialog"],[2,"background-color","transparent"],[2,"display","flex","width","100%"],["mat-raised-button","","matTooltip","Load selected resources","matTooltipPosition","right",2,"width","85px",3,"disabled"],[2,"flex","1 1 auto","text-align","center"],[2,"text-align","right"],["mat-icon-button","",3,"click","disabled"],["mat-dialog-content",""],["mat-raised-button","","matTooltip","Load selected resources","matTooltipPosition","right",2,"width","85px",3,"click","disabled"],["mode","indeterminate"],[1,"card-group"],[2,"display","flex"],[2,"flex","1 1 auto","padding-left","10px","overflow","hidden","display","-webkit-box","-webkit-box-orient","vertical","-webkit-line-clamp","1","line-clamp","1","text-overflow","ellipsis"],[3,"opened","closed","expanded"],[2,"padding","0 12px"],[1,"icon-waypoint"],[1,"pnlSelectedItems"],[1,"pnlSelect"],["matTooltip","Select all Waypoints","matTooltipPosition","before",3,"change","click","indeterminate","checked","disabled"],[1,"list-container-scrollable"],[1,"item-row"],[1,"name"],[1,"check"],["matTooltip","Select Waypoint","matTooltipPosition","below",3,"change","checked"],[1,"icon-route"],["matTooltip","Select all Routes","matTooltipPosition","before",3,"change","click","indeterminate","checked","disabled"],["matTooltip","Select this Route","matTooltipPosition","below",3,"change","checked"],[1,"icon-track"],["matTooltip","Select all Tracks","matTooltipPosition","before",3,"change","click","indeterminate","checked","disabled"],["matTooltip","Select this Track","matTooltipPosition","below",3,"change","checked"]],template:function(e,n){e&1&&(a(0,"div",3)(1,"mat-toolbar",4)(2,"div",5)(3,"div"),f(4,ce,4,1,"button",6),o(),a(5,"div",7),r(6,"Import GPX"),o(),a(7,"div",8)(8,"button",9),_("click",function(){return n.dialogRef.close(-1)}),a(9,"mat-icon"),r(10,"close"),o()()()()(),f(11,de,10,0,"div",10)(12,ye,3,1,"div",10),o()),e&2&&(l(4),x(n.app.sIsFetching()?-1:4),l(4),h("disabled",n.app.sIsFetching()),l(3),x(n.display.notValid?11:12))},dependencies:[ae,ne,N,j,X,G,K,F,W,O,V,U,J,Q,A,$,ie,Y,Z,te,ee,q,z,H,B,L],styles:[".gpxload-dialog[_ngcontent-%COMP%]{font-family:roboto;position:relative}.mat-expansion-panel-body[_ngcontent-%COMP%]{padding:0 12px 6px}.card-group-title[_ngcontent-%COMP%]{font-weight:700;font-size:10pt;font-family:Arial,Helvetica,sans-serif;padding:10px 0}.item-row[_ngcontent-%COMP%]{display:flex;width:100%;padding:2px 0}.item-row[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{flex:1 1 auto;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;text-overflow:ellipsis;line-height:2.5em}.item-row[_ngcontent-%COMP%] .check[_ngcontent-%COMP%]{text-align:right;padding-right:15px}.pnlSelectedItems[_ngcontent-%COMP%]{display:none;line-height:2.9em}.pnlSelect[_ngcontent-%COMP%]{flex:1 1 auto;padding-left:3px;padding-right:3px;text-align:right}.txtSelect[_ngcontent-%COMP%]{display:none}button[_ngcontent-%COMP%]{min-width:unset;padding:unset}@media only screen and (min-width:400px){.pnlSelectedItems[_ngcontent-%COMP%]{display:inline}}@media only screen and (min-width:475px){.pnlSelectedItems[_ngcontent-%COMP%]{display:inline;line-height:2.9em}.txtSelect[_ngcontent-%COMP%]{display:inline}.pnlSelect[_ngcontent-%COMP%]{flex:1 1 auto;padding-left:20px;padding-right:15px;text-align:right}button[_ngcontent-%COMP%]{min-width:inherit;padding:inherit}}"]})};export{pe as GPXImportDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{E as Z,Ia as $,m as N,u as Q,v as X,y as Y}from"./chunk-PVMR7EP7.js";import{i as K,k as W}from"./chunk-TQPGRJVE.js";import{d as B,e as J,f as U,h as q}from"./chunk-QI5ICQLG.js";import{Aa as u,Ba as g,Da as y,Ea as M,Ed as V,Fa as I,Ga as _,Gd as A,Ha as i,Ia as t,Ja as h,Jd as F,Ld as O,M as d,Md as j,N as p,Qa as b,Sa as f,Ua as c,ce as L,fa as r,ge as H,hb as o,ib as w,jb as v,ka as m,lb as D,mb as S,me as z,na as C,nb as E,rd as P,sd as R,se as G,vd as k,xd as T}from"./chunk-QPQHN5VS.js";import"./chunk-EQVTEUXC.js";function te(a,n){if(a&1&&(i(0,"mat-option",10),o(1),t()),a&2){let e=n.$implicit;_("value",e),r(),w(e)}}function ie(a,n){if(a&1){let e=b();i(0,"div")(1,"ap-file-input",17),f("chosen",function(l){d(e);let x=c(2);return p(x.parseFile(l))}),i(2,"div",18)(3,"div",19),o(4," Click or Drop file "),t()()()()}a&2&&(r(),_("astext",!0))}function oe(a,n){if(a&1){let e=b();i(0,"div")(1,"div")(2,"b"),o(3,"Invalid Resource Data:"),t(),h(4,"br")(5,"br"),i(6,"i"),o(7,"Selected file does not contain valid data. "),t(),h(8,"br"),t(),i(9,"div",20)(10,"button",21),f("click",function(){d(e);let l=c(2);return p(l.app.showHelp("resource"))}),i(11,"mat-icon"),o(12,"help"),t(),o(13," Help "),t()()()}}function ae(a,n){a&1&&(i(0,"div",16),o(1," Note: Data will not be validated when uploaded to server! "),t())}function ne(a,n){if(a&1){let e=b();i(0,"div",7)(1,"div")(2,"mat-form-field",8)(3,"mat-label"),o(4,"Select Destination Path"),t(),i(5,"mat-select",9,0),E("valueChange",function(l){d(e);let x=c();return S(x.targetPath,l)||(x.targetPath=l),p(l)}),M(7,te,2,2,"mat-option",10,y),t()()(),u(9,ie,5,1,"div"),u(10,oe,14,0,"div"),i(11,"div")(12,"div",11)(13,"div",12)(14,"div")(15,"span",13),o(16,"Name:"),t(),o(17),t(),i(18,"div")(19,"span",13),o(20,"Type:"),t(),o(21),t()()(),i(22,"div",14)(23,"button",15),f("click",function(){d(e);let l=c();return p(l.load())}),i(24,"mat-icon"),o(25,"file_upload"),t(),o(26," \xA0Load\xA0 "),t(),h(27,"br"),o(28,"\xA0 "),u(29,ae,2,0,"div",16),t()()()}if(a&2){let e=c();r(5),_("disabled",!e.resPaths),D("value",e.targetPath),r(2),I(e.resPaths),r(2),g(e.source.name?-1:9),r(),g(e.display.notValid?10:-1),r(7),v(" ",e.source.name," "),r(4),v(" ",e.source.type," "),r(2),_("disabled",!e.targetPath||!e.source.name),r(6),g(e.targetPath&&e.source.name?29:-1)}}var ee=class a{constructor(n,e,s,l){this.app=n;this.skclient=e;this.dialogRef=s;this.data=l}resPaths=[];targetPath=null;source={type:null,name:null,data:null};display={notValid:!1};unsubscribe=[];ngOnInit(){this.skclient.api.get(this.app.skApiVersion,"/resources").subscribe(n=>{this.resPaths=[],this.targetPath=null,this.resPaths=Object.keys(n).filter(e=>!["routes","waypoints","notes","regions","charts","tracks"].includes(e))},()=>{this.resPaths=[],this.targetPath=null})}ngOnDestroy(){this.unsubscribe.forEach(n=>n.unsubscribe())}load(){this.dialogRef.close({path:this.targetPath,data:this.source.data})}parseFile(n){this.source=n,this.source.type="Unknown";try{let e=JSON.parse(n.data);this.source.type=e.type?e.type:this.source.type}catch{console.log("Error parsing resource file!")}}static \u0275fac=function(e){return new(e||a)(m(Z),m(Y),m(P),m(R))};static \u0275cmp=C({type:a,selectors:[["resource-upload-dialog"]],decls:13,vars:1,consts:[["respaths",""],[1,"resourceload-dialog"],[2,"background-color","transparent"],[2,"flex","1 1 auto","text-align","center"],[2,"text-align","right"],["mat-icon-button","",3,"click"],["mat-dialog-content",""],[1,"card-group"],["floatLabel","always",2,"width","100%"],["id","respaths",3,"valueChange","disabled","value"],[3,"value"],[2,"display","flex","flex-wrap","wrap"],[2,"flex","1 1 auto","padding","5px","font-size","smaller"],[2,"font-weight","bold"],[2,"text-align","center","padding-top","15px"],["mat-raised-button","","matTooltip","Load features","matTooltipPosition","below",3,"click","disabled"],[2,"padding","10px","border","gray 1px dashed","font-style","italic"],[3,"chosen","astext"],[2,"width","200px"],[2,"padding","25%","border","gray 1px dashed"],[2,"width","100%","text-align","center"],["mat-raised-button","",3,"click"]],template:function(e,s){e&1&&(i(0,"div",1)(1,"mat-toolbar",2)(2,"span")(3,"mat-icon"),o(4,"category"),t()(),i(5,"span",3),o(6,"Load Resource"),t(),i(7,"span",4)(8,"button",5),f("click",function(){return s.dialogRef.close()}),i(9,"mat-icon"),o(10,"close"),t()()()(),i(11,"div",6),u(12,ne,30,8,"div",7),t()()),e&2&&(r(12),g(s.display.notValid?-1:12))},dependencies:[L,G,z,H,q,U,J,N,B,j,O,K,F,A,V,X,Q,W,T,k,$],styles:[".resourceload-dialog[_ngcontent-%COMP%]{font-family:roboto;position:relative;width:100%}.card-group[_ngcontent-%COMP%]{padding:5px 5%}@media only screen and (min-width:800px){.card-group[_ngcontent-%COMP%]{padding:5px 5%}}"]})};export{ee as ResourceImportDialog};
|