@signalk/freeboard-sk 2.23.0 → 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/3rdpartylicenses.txt +670 -670
- package/public/assets/help/img/command-radar.svg +3 -0
- package/public/assets/help/index.html +37 -11
- package/public/assets/img/poi/dive-site.svg +20 -0
- package/public/assets/img/waypoints/waypoint.svg +114 -0
- package/public/chunk-57OGK3K6.js +1 -0
- package/public/chunk-A7QJNGJ7.js +80 -0
- package/public/chunk-AZGA6QFQ.js +1 -0
- package/public/chunk-DT3KOU7O.js +2 -0
- package/public/chunk-KII72BJM.js +1 -0
- package/public/chunk-PVMR7EP7.js +135 -0
- package/public/chunk-QI5ICQLG.js +13 -0
- package/public/chunk-QPQHN5VS.js +22 -0
- package/public/chunk-TLBNKF2R.js +1 -0
- package/public/chunk-TQPGRJVE.js +19 -0
- package/public/chunk-V6RYVIHA.js +1 -0
- package/public/chunk-WDCDO7ZN.js +1 -0
- package/public/chunk-WIUBUSFZ.js +1 -0
- package/public/index.html +2 -2
- package/public/main-CDKOXZZ2.js +11 -0
- package/public/{styles-ISYGHQ6F.css → styles-N7HVRSAT.css} +1 -1
- package/public/{worker-XLDLGEWQ.js → worker-7GKP5VP4.js} +4 -4
- package/public/{worker-V6HMSEDU.js → worker-PVLEZAQQ.js} +4 -4
- package/public/main-YHMZXR5G.js +0 -264
- package/public/worker-JWBESAJK.js +0 -10
|
@@ -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
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="37" height="37" viewBox="0 0 9.7895835 9.7895833" role="img" aria-label="Dive site marker">
|
|
2
|
+
<g transform="matrix(0.99999841,0,0,1,32.673127,29.165453)">
|
|
3
|
+
<path
|
|
4
|
+
d="m -32.535751,-19.676465 0.0064,-7.695701 0.09903,-0.465033 0.240152,-0.571408 0.437852,-0.393465 0.418232,-0.233737 0.457312,0.01597 6.156289,0.04183 0.308492,0.107446 0.432171,0.257976 0.750932,0.909871 0.214847,0.335007 0.07726,3.416753 -0.03113,0.345431 -0.06223,0.283445 -0.07527,0.231807 -0.09872,0.211878 -0.130778,0.196819 -0.115461,0.13976 -0.155803,0.140387 -0.247952,0.142869 -0.242445,0.123935 -0.29986,0.11325 -0.459529,0.06646 -5.065536,-0.07878 z"
|
|
5
|
+
fill="#ffffff"
|
|
6
|
+
stroke="#000000"
|
|
7
|
+
stroke-width="0.269632"/>
|
|
8
|
+
<path
|
|
9
|
+
d="m -32.523247,-20.10579 0.011,-7.324442 0.09779,-0.447488 0.23615,-0.549849 0.429054,-0.378616 0.409549,-0.224919 0.447196,0.01546 6.05154,-0.01625 0.405717,0.08928 0.434506,0.249203 0.509216,0.508393 0.274262,0.576575 0.07818,3.47028 -0.07691,0.575196 -0.18238,0.487537 -0.349753,0.409738 -0.465305,0.25505 -0.359656,0.132511 -0.447437,0.06075 -5.146873,-0.04995 z"
|
|
10
|
+
fill="#d71920"
|
|
11
|
+
stroke="#ffffff"
|
|
12
|
+
stroke-width="0.29900024"/>
|
|
13
|
+
</g>
|
|
14
|
+
<path
|
|
15
|
+
d="M 2.05,1.0 7.65,6.32"
|
|
16
|
+
fill="none"
|
|
17
|
+
stroke="#ffffff"
|
|
18
|
+
stroke-width="1.25"
|
|
19
|
+
stroke-linecap="round"/>
|
|
20
|
+
</svg>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<svg
|
|
3
|
+
width="24"
|
|
4
|
+
height="24"
|
|
5
|
+
viewBox="0 0 24 24"
|
|
6
|
+
fill="none"
|
|
7
|
+
version="1.1"
|
|
8
|
+
id="svg12033"
|
|
9
|
+
sodipodi:docname="waypoint.svg"
|
|
10
|
+
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
|
|
11
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
12
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
13
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
xmlns:svg="http://www.w3.org/2000/svg">
|
|
16
|
+
<defs
|
|
17
|
+
id="defs12037">
|
|
18
|
+
<linearGradient
|
|
19
|
+
inkscape:collect="always"
|
|
20
|
+
id="linearGradient19247">
|
|
21
|
+
<stop
|
|
22
|
+
style="stop-color:#ff9955;stop-opacity:1;"
|
|
23
|
+
offset="0"
|
|
24
|
+
id="stop19243" />
|
|
25
|
+
<stop
|
|
26
|
+
style="stop-color:#ff9955;stop-opacity:0.24310344;"
|
|
27
|
+
offset="1"
|
|
28
|
+
id="stop19245" />
|
|
29
|
+
</linearGradient>
|
|
30
|
+
<radialGradient
|
|
31
|
+
inkscape:collect="always"
|
|
32
|
+
xlink:href="#linearGradient19247"
|
|
33
|
+
id="radialGradient19249"
|
|
34
|
+
cx="12.328149"
|
|
35
|
+
cy="9.0834799"
|
|
36
|
+
fx="12.328149"
|
|
37
|
+
fy="9.0834799"
|
|
38
|
+
r="2.9431041"
|
|
39
|
+
gradientTransform="matrix(1,0,0,1.0051871,0,-0.04711693)"
|
|
40
|
+
gradientUnits="userSpaceOnUse" />
|
|
41
|
+
</defs>
|
|
42
|
+
<sodipodi:namedview
|
|
43
|
+
id="namedview12035"
|
|
44
|
+
pagecolor="#ffffff"
|
|
45
|
+
bordercolor="#000000"
|
|
46
|
+
borderopacity="0.25"
|
|
47
|
+
inkscape:showpageshadow="2"
|
|
48
|
+
inkscape:pageopacity="0.0"
|
|
49
|
+
inkscape:pagecheckerboard="0"
|
|
50
|
+
inkscape:deskcolor="#d1d1d1"
|
|
51
|
+
showgrid="false"
|
|
52
|
+
inkscape:zoom="27.225903"
|
|
53
|
+
inkscape:cx="12.928864"
|
|
54
|
+
inkscape:cy="11.808607"
|
|
55
|
+
inkscape:window-width="1434"
|
|
56
|
+
inkscape:window-height="925"
|
|
57
|
+
inkscape:window-x="415"
|
|
58
|
+
inkscape:window-y="69"
|
|
59
|
+
inkscape:window-maximized="0"
|
|
60
|
+
inkscape:current-layer="layer2" />
|
|
61
|
+
<g
|
|
62
|
+
inkscape:groupmode="layer"
|
|
63
|
+
id="layer2"
|
|
64
|
+
inkscape:label="pin">
|
|
65
|
+
<ellipse
|
|
66
|
+
style="fill:#ff9955;fill-opacity:1;stroke:#000000;stroke-width:1.294;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
|
67
|
+
id="path2222"
|
|
68
|
+
cx="12.278757"
|
|
69
|
+
cy="9.3068466"
|
|
70
|
+
rx="8.9613438"
|
|
71
|
+
ry="8.6382751" />
|
|
72
|
+
<ellipse
|
|
73
|
+
style="fill:#ff9955;fill-opacity:1;stroke:#000000;stroke-width:1.294;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;opacity:0"
|
|
74
|
+
id="path2222-35"
|
|
75
|
+
cx="4.4442968"
|
|
76
|
+
cy="13.332891"
|
|
77
|
+
rx="8.9613438"
|
|
78
|
+
ry="8.6382751" />
|
|
79
|
+
<ellipse
|
|
80
|
+
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.455199;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
|
81
|
+
id="path2222-3"
|
|
82
|
+
cx="12.308941"
|
|
83
|
+
cy="9.1160927"
|
|
84
|
+
rx="3.0996795"
|
|
85
|
+
ry="3.0904188" />
|
|
86
|
+
<ellipse
|
|
87
|
+
style="fill:url(#radialGradient19249);fill-opacity:1;stroke:#000000;stroke-width:0.404247;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
|
88
|
+
id="path2222-3-5"
|
|
89
|
+
cx="12.328149"
|
|
90
|
+
cy="9.0834799"
|
|
91
|
+
rx="2.7409806"
|
|
92
|
+
ry="2.7562468" />
|
|
93
|
+
<path
|
|
94
|
+
style="fill:#ff9dff;fill-opacity:1;stroke:#ff9dff;stroke-width:0.63301;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
|
95
|
+
d="m 12.066236,20.572947 -1.668668,-3.775082 3.330849,0.0325 z"
|
|
96
|
+
id="path17920"
|
|
97
|
+
sodipodi:nodetypes="cccc" />
|
|
98
|
+
<path
|
|
99
|
+
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.294;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
|
100
|
+
d="M 5.4043387,14.836239 12.00147,23.360966 19.211901,14.80538 Z"
|
|
101
|
+
id="path25670"
|
|
102
|
+
sodipodi:nodetypes="cccc" />
|
|
103
|
+
<path
|
|
104
|
+
style="fill:#ff9955;fill-opacity:1;stroke:#ff7f2a;stroke-width:0;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
|
105
|
+
d="m 5.4090737,13.871734 6.6860623,8.527051 7.120156,-8.63152 z"
|
|
106
|
+
id="path25670-5"
|
|
107
|
+
sodipodi:nodetypes="cccc" />
|
|
108
|
+
</g>
|
|
109
|
+
<g
|
|
110
|
+
inkscape:groupmode="layer"
|
|
111
|
+
id="layer1"
|
|
112
|
+
inkscape:label="Layer 1"
|
|
113
|
+
style="display:inline" />
|
|
114
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import{f as d}from"./chunk-EQVTEUXC.js";var b=r=>typeof Worker>"u"?Promise.reject(new Error("Error starting Worker!")):new Promise((t,e)=>{let s=new Worker(new URL("worker-UZNU4LIJ.js",import.meta.url),{type:"module"}),a=n=>{s.terminate(),n?t(n):e(new Error("Error processing content!"))};s.onmessage=n=>a(n.data),s.onerror=()=>a(null),s.postMessage({sourceType:"xml",value:r})});var y=class{version;creator;wpt;rte;trk;extensions;metadata;constructor(){this.init()}init(){this.version="1.1",this.creator="@panaaj",this.wpt=[],this.rte=[],this.trk=[],this.extensions={},this.metadata=new l}stringify(){return this.toXML()}toXML(){let t=`<?xml version="1.0" encoding="UTF-8"?>\r
|
|
2
|
+
<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="${this.version}" xmlns="http://www.topografix.com/GPX/1/1" creator="${this.creator}" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.topografix.com/GPX/Private/TopoGrafix/0/1 http://www.topografix.com/GPX/Private/TopoGrafix/0/1/topografix.xsd" xmlns:topografix="http://www.topografix.com/GPX/Private/TopoGrafix/0/1">\r
|
|
3
|
+
`+this.metadataToXML()+this.waypointsToXML()+this.routesToXML()+this.tracksToXML();return t+=this.extensionsToXML(this.extensions),t+=`</gpx>\r
|
|
4
|
+
`,t}metadataToXML(){let t=` <metadata>\r
|
|
5
|
+
<name>${this.metadata.name||""}</name>\r
|
|
6
|
+
<desc>${this.metadata.desc||""}</desc>\r
|
|
7
|
+
<time>${this.metadata.time||""}</time>\r
|
|
8
|
+
`;return t+=this.metadata.keywords?` <keywords>${this.metadata.keywords||""}</keywords>\r
|
|
9
|
+
`:"",this.metadata.author&&(t+=` <author>\r
|
|
10
|
+
<name>${this.metadata.author.name||""}</name>\r
|
|
11
|
+
<email>\r
|
|
12
|
+
<id>${this.metadata.author.email.id||""}</id>\r
|
|
13
|
+
<domain>${this.metadata.author.email.domain||""}</domain>\r
|
|
14
|
+
</email>\r
|
|
15
|
+
<link href="${this.metadata.author.link.href||""}">\r
|
|
16
|
+
<text>${this.metadata.author.link.text||""}</text>\r
|
|
17
|
+
<type>${this.metadata.author.link.type||""}</type>\r
|
|
18
|
+
</link>\r
|
|
19
|
+
</author>\r
|
|
20
|
+
`),this.metadata.copyright&&(t+=` <copyright author="${this.metadata.copyright||""}">\r
|
|
21
|
+
<year>${this.metadata.copyright.year||""}</year>\r
|
|
22
|
+
<license>${this.metadata.copyright.license||""}</license>\r
|
|
23
|
+
</copyright>\r
|
|
24
|
+
`),this.metadata.link.forEach(e=>{t+=` <link href="${e.href||""}">\r
|
|
25
|
+
<text>${e.text||""}</text>\r
|
|
26
|
+
<type>${e.type||""}</type>\r
|
|
27
|
+
</link>\r
|
|
28
|
+
`}),t+=` <bounds minlat="${this.metadata.bounds.minLat}" minlon="${this.metadata.bounds.minLon}" maxlat="${this.metadata.bounds.maxLat}" maxlon="${this.metadata.bounds.maxLon}"></bounds>\r
|
|
29
|
+
`,t+=this.extensionsToXML(this.metadata.extensions,2),t+=` </metadata>\r
|
|
30
|
+
`,t}waypointsToXML(){let t="";for(let e of this.wpt)t+=this.ptToXML(e,"wpt");return t}routesToXML(){let t="";return this.rte.forEach(e=>{t+=` <rte>\r
|
|
31
|
+
`,t+=e.name?` <name>${e.name||""}</name>\r
|
|
32
|
+
`:"",t+=e.cmt?` <cmt>${e.cmt||""}</cmt>\r
|
|
33
|
+
`:"",t+=e.desc?` <desc>${e.desc||""}</desc>\r
|
|
34
|
+
`:"",t+=e.src?` <src>${e.src||""}</src>\r
|
|
35
|
+
`:"",t+=e.number?` <number>${e.number||""}</number>\r
|
|
36
|
+
`:"",t+=e.type?` <type>${e.type||""}</type>\r
|
|
37
|
+
`:"",e.link.forEach(s=>{t+=` <link href="${s.href||""}">\r
|
|
38
|
+
<text>${s.text||""}</text>\r
|
|
39
|
+
<type>${s.type||""}</type>\r
|
|
40
|
+
</link>\r
|
|
41
|
+
`}),t+=this.extensionsToXML(e.extensions,2);for(let s of e.rtept)t+=this.ptToXML(s,"rtept");t+=` </rte>\r
|
|
42
|
+
`}),t}tracksToXML(){let t="";return this.trk.forEach(e=>{t+=` <trk>\r
|
|
43
|
+
`,t+=e.name?` <name>${e.name||""}</name>\r
|
|
44
|
+
`:"",t+=e.cmt?` <cmt>${e.cmt||""}</cmt>\r
|
|
45
|
+
`:"",t+=e.desc?` <desc>${e.desc||""}</desc>\r
|
|
46
|
+
`:"",t+=e.src?` <src>${e.src||""}</src>\r
|
|
47
|
+
`:"",t+=e.number?` <number>${e.number||""}</number>\r
|
|
48
|
+
`:"",t+=e.type?` <type>${e.type||""}</type>\r
|
|
49
|
+
`:"",t+=this.extensionsToXML(e.extensions,2),e.trkseg.forEach(s=>{t+=` <trkseg>\r
|
|
50
|
+
`;for(let a of s.trkpt)t+=this.ptToXML(a,"trkpt");t+=` </trkseg>\r
|
|
51
|
+
`}),t+=` </trk>\r
|
|
52
|
+
`}),t}ptToXML(t,e){let s="",a=2;switch(e){case"trkpt":s=" ",a=4;break;case"rtept":s=" ",a=3;break}let n="";return n+=`${s} <${e} lat="${t.lat.toFixed(6)}" lon="${t.lon.toFixed(6)}">\r
|
|
53
|
+
`,n+=t.sym?`${s} <sym>${t.sym||""}</sym>\r
|
|
54
|
+
`:"",n+=t.name?`${s} <name>${t.name||""}</name>\r
|
|
55
|
+
`:"",n+=t.cmt?`${s} <cmt>${t.cmt||""}</cmt>\r
|
|
56
|
+
`:"",n+=t.desc?`${s} <desc>${t.desc||""}</desc>\r
|
|
57
|
+
`:"",n+=t.src?`${s} <src>${t.src||""}</src>\r
|
|
58
|
+
`:"",n+=t.type?`${s} <type>${t.type||""}</type>\r
|
|
59
|
+
`:"",n+=t.time?`${s} <time>${t.datetime||""}</time>\r
|
|
60
|
+
`:"",n+=t.fix?`${s} <fix>${t.fix||""}</fix>\r
|
|
61
|
+
`:"",n+=t.ele?`${s} <ele>${t.ele||""}</ele>\r
|
|
62
|
+
`:"",n+=t.magvar?`${s} <magvar>${t.magvar||""}</magvar>\r
|
|
63
|
+
`:"",n+=t.geoidHeight?`${s} <geoidheight>${t.geoidHeight||""}</geoidheight>\r
|
|
64
|
+
`:"",n+=t.sat?`${s} <sat>${t.sat||""}</sat>\r
|
|
65
|
+
`:"",n+=t.vdop?`${s} <vdop>${t.vdop||""}</vdop>\r
|
|
66
|
+
`:"",n+=t.hdop?`${s} <hdop>${t.hdop||""}</hdop>\r
|
|
67
|
+
`:"",n+=t.pdop?`${s} <pdop>${t.pdop||""}</pdop>\r
|
|
68
|
+
`:"",n+=t.ageOfGpsData?`${s} <ageofdgpsdata>${t.ageOfGpsData||""}</ageofdgpsdata>\r
|
|
69
|
+
`:"",n+=t.dgpsid?`${s} <dgpsid>${t.dgpsid||""}</dgpsid>\r
|
|
70
|
+
`:"",t.link.forEach(i=>{n+=`${s} <link href="${i.href||""}">\r
|
|
71
|
+
${s} <text>${i.text||""}</text>\r
|
|
72
|
+
${s} <type>${i.type||""}</type>\r
|
|
73
|
+
${s} </link>\r
|
|
74
|
+
`}),n+=this.extensionsToXML(t.extensions,a),n+=`${s} </${e}>\r
|
|
75
|
+
`,n}extensionsToXML(t,e=1){let s="";if(t&&Object.keys(t).length!==0){let a=" ".slice(0-e),n="";t.signalk&&Object.keys(t.signalk).forEach(i=>{n+=`${a} <${i}>${t.signalk[i]}</${i}>\r
|
|
76
|
+
`}),s+=`${a}<extensions>\r
|
|
77
|
+
${a} <signalk>\r
|
|
78
|
+
`+n+`${a} </signalk>\r
|
|
79
|
+
${a}</extensions>\r
|
|
80
|
+
`}return s}xValue(t){if(t&&Array.isArray(t))return t.length!==0?t[0]:null}parse(t){return d(this,null,function*(){if(!t||t.indexOf("<gpx")===-1)return!1;this.init();try{let e=yield b(t);if(e.gpx.metadata){let s=this.xValue(e.gpx.metadata);if(this.metadata.name=s.name?this.xValue(s.name):null,this.metadata.desc=s.desc?this.xValue(s.desc):null,this.metadata.keywords=s.keywords?s.keywords:null,s.bounds){let a=this.xValue(s.bounds);this.metadata.bounds.minLat=Number(a.$.minlat)??null,this.metadata.bounds.minLon=Number(a.$.minlon)??null,this.metadata.bounds.maxLat=Number(a.$.maxlat)??null,this.metadata.bounds.maxLon=Number(a.$.maxlon)??null}this.metadata.extensions=s.extensions?this.parseExtensions(s.extensions):{}}return e.gpx.wpt&&this.parseWaypoints(e.gpx.wpt),e.gpx.rte&&this.parseRoutes(e.gpx.rte),e.gpx.trk&&this.parseTracks(e.gpx.trk),this.extensions=e.gpx.extensions?this.parseExtensions(e.gpx.extensions):{},!0}catch{return!1}})}parseWaypoints(t){if(Array.isArray(t))t.forEach(e=>{let s=this.toWpt(e);this.updateBounds(s),this.wpt.push(s)});else{let e=this.toWpt(t);this.updateBounds(e),this.wpt.push(e)}}parseRoutes(t){if(Array.isArray(t))t.forEach(e=>{let s=this.toRte(e);this.updateBounds(s),this.rte.push(s)});else{let e=this.toRte(t);this.updateBounds(e),this.rte.push(e)}}parseTracks(t){if(Array.isArray(t))t.forEach(e=>{let s=this.toTrk(e);this.updateBounds(s),this.trk.push(s)});else{let e=this.toTrk(t);this.updateBounds(e),this.trk.push(e)}}parseExtensions(t){if(!t)return{};if(!Array.isArray(t))return{};let e={};return t.forEach(s=>{if(s.signalk){let a={},n=this.xValue(s.signalk);Object.keys(n).forEach(i=>{a[i]=this.xValue(n[i])}),e.signalk=a}}),e}parseLinks(t){let e=[];if(!t)return e;if(Array.isArray(t))t.forEach(s=>{let a=new u;a.href=s._href,a.text=s.text,a.type=s.type,e.push(a)});else{let s=new u;s.href=t._href,s.text=t.text,s.type=t.type,e.push(s)}return e}toRte(t){let e=new p;return e.name=t.name?this.xValue(t.name):null,e.cmt=t.cmt?this.xValue(t.cmt):null,e.desc=t.desc?this.xValue(t.desc):null,e.src=t.src?this.xValue(t.src):null,e.extensions=t.extensions?this.parseExtensions(t.extensions):{},t.rtept&&(e.rtept=this.toPtArray(t.rtept)),e}toWpt(t){let e=new c;return e.lat=Number(t.$.lat)||0,e.lon=Number(t.$.lon)||0,e.ele=t.ele?Number(this.xValue(t.ele)):null,e.sym=t.sym?this.xValue(t.sym):null,e.name=t.name?this.xValue(t.name):null,e.cmt=t.cmt?this.xValue(t.cmt):null,e.desc=t.desc?this.xValue(t.desc):null,e.src=t.src?this.xValue(t.src):null,e.type=t.type?this.xValue(t.type):null,e.extensions=t.extensions?this.parseExtensions(t.extensions):{},e}toTrk(t){let e=new h;if(e.name=t.name?this.xValue(t.name):null,e.cmt=t.cmt?this.xValue(t.cmt):null,e.desc=t.desc?this.xValue(t.desc):null,e.src=t.src?this.xValue(t.src):null,e.number=t.number?Number(this.xValue(t.number)):null,e.type=t.type?this.xValue(t.type):null,e.extensions=t.extensions?this.parseExtensions(t.extensions):{},t.trkseg)if(Array.isArray(t.trkseg))t.trkseg.forEach(s=>{let a=new o;a.extensions=s.extensions?this.parseExtensions(s.extensions):{},s.trkpt&&(a.trkpt=this.toPtArray(s.trkpt)),e.trkseg.push(a)});else{let s=new o;s.extensions=t.trkseg.extensions?this.parseExtensions(t.trkseg.extensions):{},t.trkseg.trkpt&&(s.trkpt=this.toPtArray(t.trkseg.trkpt)),e.trkseg.push(s)}return e}toPtArray(t){let e=[];if(Array.isArray(t))t.forEach(s=>{let a=this.toWpt(s);this.updateBounds(a),e.push(a)});else{let s=this.toWpt(t);this.updateBounds(s),e.push(s)}return e}setExtension(t,e,s){t.extensions||(t.extensions={});let a=e.split("."),n=t.extensions;a.forEach(i=>{n[i]||(n[i]={}),n=n[i]}),t.extensions.signalk.uuid=s}updateBounds(t){this.metadata.bounds.minLat=t.lat<this.metadata.bounds.minLat?t.lat:this.metadata.bounds.minLat,this.metadata.bounds.minLon=t.lon<this.metadata.bounds.minLon?t.lon:this.metadata.bounds.minLon,this.metadata.bounds.maxLat=t.lat>this.metadata.bounds.maxLat?t.lat:this.metadata.bounds.maxLat,this.metadata.bounds.maxLon=t.lon>this.metadata.bounds.maxLon?t.lon:this.metadata.bounds.maxLon}},c=class{lat;lon;ele;datetime;magvar;geoidHeight;name;cmt;desc;src;link=[];sym;type;fix;sat;hdop;vdop;pdop;ageOfGpsData;dgpsid;extensions={};constructor(t,e){this.lat=t||0,this.lon=e||0}},p=class{name;cmt;desc;src;link=[];number;type;extensions={};rtept=[];constructor(t){this.name=t||""}},h=class{name;cmt;desc;src;link=[];number;type;extensions={};trkseg=[];constructor(t){this.name=t||""}},o=class{trkpt=[];extensions={}};var l=class{name="";desc="";author;copyright;link=[];time=new Date().toISOString();keywords="";bounds=new m;extensions={}},u=class{href="";text="";type=""};var m=class{minLat=90;minLon=180;maxLat=-90;maxLon=-180};export{y as a,c as b,p as c,h as d,o as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as a}from"./chunk-QI5ICQLG.js";import"./chunk-QPQHN5VS.js";import"./chunk-EQVTEUXC.js";export{a as PlaybackDialog};
|
|
@@ -0,0 +1,2 @@
|
|
|
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
|
+
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|