@signalk/freeboard-sk 2.24.2 → 3.0.0-beta.0
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 +16 -0
- package/docs/screenshots/2_freeboard-sk.jpg +0 -0
- package/docs/screenshots/3_freeboard-sk.jpg +0 -0
- package/package.json +9 -4
- package/public/3rdpartylicenses.txt +45 -19
- package/public/assets/img/no-such-symbol.svg +4 -0
- package/public/chunk-2FVHKTB6.js +1010 -0
- package/public/chunk-3NORWTAX.js +1 -0
- package/public/chunk-4H477JJR.js +1612 -0
- package/public/chunk-55GTZWIA.js +1 -0
- package/public/chunk-7N46HDRA.js +1 -0
- package/public/chunk-F7DZSD5Z.js +1 -0
- package/public/chunk-FZ6NAONR.js +1 -0
- package/public/chunk-HALNSHCE.js +929 -0
- package/public/chunk-KYXYDUTF.js +1 -0
- package/public/chunk-MNPNP6MN.js +3871 -0
- package/public/{chunk-LXUTMJYP.js → chunk-MZFM2DTJ.js} +1 -1
- package/public/chunk-N7K5OEHJ.js +1709 -0
- package/public/chunk-NPNYOL2H.js +1 -0
- package/public/chunk-QBGO6O5L.js +1 -0
- package/public/chunk-UHBHOIXR.js +107 -0
- package/public/chunk-VHJDKR5K.js +1 -0
- package/public/chunk-Z5RYOUPW.js +2 -0
- package/public/index.html +1 -1
- package/public/main-E44BDMWA.js +466 -0
- package/public/chunk-2AF4T5IB.js +0 -1
- package/public/chunk-3GHIRJ3C.js +0 -2
- package/public/chunk-A4TULHTL.js +0 -1
- package/public/chunk-AFVK3UQJ.js +0 -5482
- package/public/chunk-AX3UMUXB.js +0 -1
- package/public/chunk-EFVTFEXB.js +0 -1
- package/public/chunk-FALIRPMH.js +0 -1035
- package/public/chunk-G4GM24WE.js +0 -1
- package/public/chunk-NTIQMWPW.js +0 -2718
- package/public/chunk-QIOZNURQ.js +0 -1
- package/public/chunk-SBFXQ3G7.js +0 -1
- package/public/main-AZEF35BN.js +0 -466
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ue,b as w,c as me,d as he,e as fe}from"./chunk-FEIJMPL7.js";import{A as pe,C as ce,D as de,f as N,h as z,i as ee,j as te,k as ie,l as ae,m as ne,n as se,o as oe,r as re,v as le}from"./chunk-MNPNP6MN.js";import{b as H}from"./chunk-4H477JJR.js";import{i as q,j as J,k as Q}from"./chunk-MZFM2DTJ.js";import{a as U}from"./chunk-HALNSHCE.js";import"./chunk-UHBHOIXR.js";import{j as Y,o as Z}from"./chunk-2FVHKTB6.js";import{Bd as V,Ca as _,Da as k,Dd as I,Fa as v,Ga as b,Ha as C,Ia as f,J as R,Ja as s,Ka as r,Ld as K,N as D,Nd as B,O as m,P as h,Qd as $,Sa as x,Sd as A,Td as j,Ua as g,Wa as d,c as E,eb as T,ha as p,jb as c,je as L,kb as W,lb as G,ma as y,pa as O,xd as X,yd as F}from"./chunk-N7K5OEHJ.js";import{f as M}from"./chunk-EQVTEUXC.js";var P=class{gpx;constructor(){this.init()}init(){this.gpx=new ue,this.gpx.metadata.name="Signal K Resource Export",this.gpx.metadata.desc="Freeboard export of Signal K resources"}toXML(){return this.gpx.toXML()}setRoutes(i,t){if(t)t.forEach(e=>{i[e]&&this.gpx.rte.push(this.packageRoute(e,i[e]))});else for(let e in i)this.gpx.rte.push(this.packageRoute(e,i[e]))}packageRoute(i,t){let e=new me;e.extensions=e.extensions??{},e.extensions.signalk={},e.extensions.signalk.uuid=i,t.distance&&(e.extensions.signalk.distance=t.distance),e.name=t.name||null,e.desc=t.description||null,e.cmt=t.feature.properties.cmt||null,e.src=t.feature.properties.src||null,e.number=t.feature.properties.number||null,e.type=t.feature.properties.type||null;for(let a of t.feature.geometry.coordinates){let n=new w;n.lon=a[0],n.lat=a[1],n.ele=a[2]||null,e.rtept.push(n),this.gpx.updateBounds(n)}return e}setWaypoints(i,t){if(t)t.forEach(e=>{i[e]&&this.gpx.wpt.push(this.packageWaypoint(e,i[e]))});else for(let e in i)this.gpx.wpt.push(this.packageWaypoint(e,i[e]))}packageWaypoint(i,t){let e=new w;if(e.extensions=e.extensions||{},e.extensions.signalk={},e.extensions.signalk.uuid=i,e.name=t.name||"",e.desc=t.description||"",e.cmt=t.feature.properties.cmt||null,e.geoidHeight=t.feature.properties.geoidHeight||null,e.src=t.feature.properties.src||null,e.sym=t.feature.properties.sym||null,e.type=t.feature.properties.type||null,t.type==="waypoint"){let a=le(t.feature.properties.skIcon);a?.gpxType&&(e.type=a.gpxType),a?.gpxSym&&(e.sym=a.gpxSym)}return e.fix=t.feature.properties.fix||null,e.sat=t.feature.properties.sat||null,e.hdop=t.feature.properties.hdop||null,e.vdop=t.feature.properties.vdop||null,e.pdop=t.feature.properties.pdop||null,e.ageOfGpsData=t.feature.properties.ageOfGpsData||null,e.dgpsid=t.feature.properties.dgpsid||null,e.lat=t.feature.geometry.coordinates[1],e.lon=t.feature.geometry.coordinates[0],e.ele=t.feature.geometry.coordinates[2]||null,this.gpx.updateBounds(e),e}setTracks(i,t){if(t)t.forEach(e=>{i[e]&&this.gpx.trk.push(this.packageTrack(e,i[e]))});else for(let e in i)this.gpx.trk.push(this.packageTrack(e,i[e]))}packageTrack(i,t){let e=new he;e.extensions=e.extensions||{},e.extensions.signalk={},e.extensions.signalk.uuid=i,e.name=t.feature.properties.name||null,e.desc=t.feature.properties.description||null,e.cmt=t.feature.properties.cmt||null,e.src=t.feature.properties.src||null,e.number=t.feature.properties.number||null,e.type=t.feature.properties.type||null;for(let a of t.feature.geometry.coordinates){let n=new fe;for(let o of a){let u=new w;u.lon=o[0],u.lat=o[1],u.ele=o[2]||null,n.trkpt.push(u),this.gpx.updateBounds(u)}e.trkseg.push(n)}return e}};var S=class l{resultSource;result$;sk2gpx;hasFSA;signalk=D(re);constructor(){this.resultSource=new E,this.result$=this.resultSource.asObservable(),this.hasFSA="showOpenFilePicker"in window}clear(){this.sk2gpx=null}prepData(i){let t={routes:[],waypoints:[],tracks:[]},e=1;return t.routes=i.routes.map(a=>{let n=a[1];return n.feature.id=a[0],n}),e=1,t.waypoints=i.waypoints.map(a=>{let n=a[1];return n.feature.id=a[0],n.name=n.name??`Wpt: ${e}`,e++,n}),t.tracks=i.tracks,t}saveToFile(i,t){this.sk2gpx=new P;let e={},a={},n={};for(let o=0;o<t.rte.selected.length;o++)t.rte.selected[o]&&(e[i.routes[o].feature.id]=i.routes[o]);this.sk2gpx.setRoutes(e);for(let o=0;o<t.wpt.selected.length;o++)t.wpt.selected[o]&&(a[i.waypoints[o].feature.id]=i.waypoints[o]);this.sk2gpx.setWaypoints(a);for(let o=0;o<t.trk.selected.length;o++)if(t.trk.selected[o]){let u=this.signalk.uuid;n[u]=new ce,n[u].feature.id=u,n[u].feature.properties.name=`Vessel trail: ${Date().toString()}`,n[u].feature.geometry.coordinates.push(i.tracks[o])}this.sk2gpx.setTracks(n),this.hasFSA?this.fsaSaveFile():this.legacySaveToFile()}legacySaveToFile(){let i=new Blob([this.sk2gpx.toXML()],{type:"text/xml"}),t=document.createElement("a");t.href=URL.createObjectURL(i),t.download="fb_export.gpx",t.click(),URL.revokeObjectURL(t.href),t.remove(),this.resultSource.next(-1)}fsaSaveFile(){window.showSaveFilePicker({types:[{description:"GPX file",accept:{"text/xml":[".gpx"]}}]}).then(i=>{i.createWritable().then(t=>{let e=new Blob([this.sk2gpx.toXML()]);t.write(e).then(()=>{t.close(),this.resultSource.next(0)})}).catch(t=>{console.warn(t),this.resultSource.next(1)})}).catch(()=>{this.resultSource.next(-1)})}static \u0275fac=function(t){return new(t||l)};static \u0275prov=R({token:l,factory:l.\u0275fac,providedIn:"root"})};function _e(l,i){if(l&1){let t=x();s(0,"div",18)(1,"div",19),c(2),r(),s(3,"div",20)(4,"mat-checkbox",21,0),g("change",function(){let a=m(t).$index,n=T(5),o=d(2);return h(o.checkWpt(n.checked,a))}),r()()()}if(l&2){let t=i.$implicit,e=i.$index,a=d(2);p(2),W(t.name),p(2),f("checked",a.selWaypoints[e])}}function ke(l,i){if(l&1){let t=x();s(0,"div",11)(1,"mat-expansion-panel",12),g("opened",function(){m(t);let a=d();return h(a.display.expand.waypoints=!0)})("closed",function(){m(t);let a=d();return h(a.display.expand.waypoints=!1)}),s(2,"mat-expansion-panel-header",13)(3,"mat-panel-title")(4,"mat-icon",14),c(5,"place"),r(),c(6," \xA0"),s(7,"b"),c(8,"Waypoints:"),r()(),s(9,"mat-panel-description")(10,"div",15)(11,"mat-checkbox",16),g("change",function(a){m(t);let n=d();return h(n.checkWpt(a.checked,-1))})("click",function(a){return a.cancelBubble=!0}),r()()()(),s(12,"div",17),b(13,_e,6,2,"div",18,v),r()()()}if(l&2){let t=d();p(),f("expanded",t.display.expand.waypoints),p(10),f("indeterminate",t.display.someWptChecked)("checked",t.display.allWaypointsChecked)("disabled",t.resData.waypoints.length===0),p(2),C(t.resData.waypoints)}}function ve(l,i){if(l&1){let t=x();s(0,"div",18)(1,"div",19)(2,"mat-icon",22),c(3,"directions"),r(),c(4),r(),s(5,"div",20)(6,"mat-checkbox",24,1),g("change",function(){let a=m(t).$index,n=T(7),o=d(2);return h(o.checkRte(n.checked,a))}),r()()()}if(l&2){let t=i.$implicit,e=i.$index,a=d(2);p(4),G(" ",t.name," "),p(2),f("checked",a.selRoutes[e])}}function be(l,i){if(l&1){let t=x();s(0,"div",11)(1,"mat-expansion-panel",12),g("opened",function(){m(t);let a=d();return h(a.display.expand.routes=!0)})("closed",function(){m(t);let a=d();return h(a.display.expand.routes=!1)}),s(2,"mat-expansion-panel-header",13)(3,"mat-panel-title")(4,"mat-icon",22),c(5,"directions"),r(),c(6," \xA0"),s(7,"b"),c(8,"Routes:"),r()(),s(9,"mat-panel-description")(10,"div",15)(11,"mat-checkbox",23),g("change",function(a){m(t);let n=d();return h(n.checkRte(a.checked,-1))})("click",function(a){return a.cancelBubble=!0}),r()()()(),s(12,"div",17),b(13,ve,8,2,"div",18,v),r()()()}if(l&2){let t=d();p(),f("expanded",t.display.expand.routes),p(10),f("indeterminate",t.display.someRteChecked)("checked",t.display.allRoutesChecked)("disabled",t.resData.routes.length==0),p(2),C(t.resData.routes)}}function Ce(l,i){if(l&1){let t=x();s(0,"div",18)(1,"div",19)(2,"mat-icon",26),c(3,"directions_boat"),r(),c(4," Vessel Trail "),r(),s(5,"div",20)(6,"mat-checkbox",28,2),g("change",function(){let a=m(t).$index,n=T(7),o=d(2);return h(o.checkTrk(n.checked,a))}),r()()()}if(l&2){let t=i.$index,e=d(2);p(6),f("checked",e.selTracks[t])}}function Te(l,i){if(l&1){let t=x();s(0,"div",11)(1,"mat-expansion-panel",25)(2,"mat-expansion-panel-header",13)(3,"mat-panel-title")(4,"mat-icon",26),c(5,"show_chart"),r(),c(6," \xA0"),s(7,"b"),c(8,"Tracks:"),r()(),s(9,"mat-panel-description")(10,"div",15)(11,"mat-checkbox",27),g("change",function(a){m(t);let n=d();return h(n.checkTrk(a.checked,-1))})("click",function(a){return a.cancelBubble=!0}),r()()()(),s(12,"div",17),b(13,Ce,8,1,"div",18,v),r()()()}if(l&2){let t=d();p(),f("expanded",!1),p(10),f("indeterminate",!1)("checked",t.display.allTracksChecked)("disabled",t.resData.tracks.length==0),p(2),C(t.resData.tracks)}}var ge=class l{constructor(i,t,e,a,n){this.app=i;this.skres=t;this.facade=e;this.dialogRef=a;this.data=n}resData={routes:[],waypoints:[],tracks:[]};selRoutes=[];selectedRoute=null;selWaypoints=[];selTracks=[];display={notValid:!1,allRoutesChecked:!1,allWaypointsChecked:!1,allTracksChecked:!1,someWptChecked:!1,someRteChecked:!1,someTrkChecked:!1,saveRoutesOK:!1,saveWaypointsOK:!1,saveTracksOK:!1,routeViewer:!1,selCount:{routes:0,waypoints:0,tracks:0},expand:{routes:!1,waypoints:!1,tracks:!1}};unsubscribe=[];ngOnInit(){this.loadResources(),this.unsubscribe.push(this.facade.result$.subscribe(i=>{this.dialogRef.close(i)}))}ngOnDestroy(){this.unsubscribe.forEach(i=>i.unsubscribe()),this.facade.clear()}loadResources(){return M(this,null,function*(){this.data.routes.sort((i,t)=>i[1].name.localeCompare(t[1].name));try{this.app.sIsFetching.set(!0);let i=yield this.skres.listFromServer("waypoints");i.sort((t,e)=>t[1].name.localeCompare(e[1].name)),this.data.waypoints=i,this.app.sIsFetching.set(!1)}catch(i){this.app.sIsFetching.set(!1),this.resData.waypoints=[]}this.parseResourceData()})}save(){this.facade.saveToFile(this.resData,{rte:{selected:this.selRoutes},wpt:{selected:this.selWaypoints},trk:{selected:this.selTracks}})}parseResourceData(){this.display.allRoutesChecked=!1,this.display.saveRoutesOK=!1,this.selRoutes=[],this.display.allWaypointsChecked=!1,this.display.saveWaypointsOK=!1,this.selWaypoints=[],this.display.allTracksChecked=!1,this.display.saveTracksOK=!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.resData=this.facade.prepData(this.data),this.resData.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.saveRoutesOK=!0),this.resData.waypoints.forEach(()=>{this.selWaypoints.push(!1)}),this.selTracks.push(!1)}checkRte(i,t=-1){let e=0;if(t!==-1){this.selRoutes[t]=i,this.display.saveRoutesOK=i;for(let a of this.selRoutes)a&&e++;this.display.saveRoutesOK=e!==0,this.display.selCount.routes=e,this.display.allRoutesChecked=e===this.selRoutes.length}else{for(let a=0;a<this.selRoutes.length;a++)this.selRoutes[a]=i,this.display.saveRoutesOK=i,this.display.allRoutesChecked=i;this.display.selCount.routes=i?this.selRoutes.length:0}this.display.someRteChecked=!(this.display.allRoutesChecked||e===0)}checkWpt(i,t=-1){let e=0;if(t!==-1){this.selWaypoints[t]=i,this.display.saveWaypointsOK=i;for(let a of this.selWaypoints)a&&e++;this.display.saveWaypointsOK=e!==0,this.display.selCount.waypoints=e,this.display.allWaypointsChecked=e===this.selWaypoints.length}else{for(let a=0;a<this.selWaypoints.length;a++)this.selWaypoints[a]=i,this.display.saveWaypointsOK=i,this.display.allWaypointsChecked=i;this.display.selCount.waypoints=i?this.selWaypoints.length:0}this.display.someWptChecked=!(this.display.allWaypointsChecked||e===0)}checkTrk(i,t=-1){let e=0;if(t!==-1){this.selTracks[t]=i,this.display.saveTracksOK=i;for(let a of this.selTracks)a&&e++;this.display.saveTracksOK=e!==0,this.display.selCount.tracks=e,this.display.allTracksChecked=e===this.selTracks.length}else{for(let a=0;a<this.selTracks.length;a++)this.selTracks[a]=i,this.display.saveTracksOK=i,this.display.allTracksChecked=i;this.display.selCount.tracks=i?this.selTracks.length:0}this.display.someTrkChecked=!(this.display.allTracksChecked||e===0)}static \u0275fac=function(t){return new(t||l)(y(pe),y(de),y(S),y(X),y(F))};static \u0275cmp=O({type:l,selectors:[["gpxsave-dialog"]],decls:18,vars:4,consts:[["wval",""],["rval",""],["tval",""],[1,"gpxsave-dialog"],[2,"background-color","transparent"],[2,"display","flex","width","100%"],["mat-raised-button","","matTooltip","Save selected resources","matTooltipPosition","right",2,"width","85px",3,"click","disabled"],[2,"flex","1 1 auto","text-align","center"],[2,"text-align","right"],["mat-icon-button","",3,"click"],["mat-dialog-content","",2,"padding","2px"],[1,"card-group"],[3,"opened","closed","expanded"],[1,"panel-header"],[1,"icon-waypoint"],[1,"panel-description"],["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"],[3,"expanded"],[1,"icon-track"],["matTooltip","Vessel Trail to Track","matTooltipPosition","before",3,"change","click","indeterminate","checked","disabled"],["matTooltip","Select this Track","matTooltipPosition","below",3,"change","checked"]],template:function(t,e){t&1&&(s(0,"div",3)(1,"mat-toolbar",4)(2,"div",5)(3,"div")(4,"button",6),g("click",function(){return e.save()}),s(5,"mat-icon"),c(6,"save"),r(),c(7,"\xA0Save\xA0 "),r()(),s(8,"div",7),c(9,"Export to GPX"),r(),s(10,"div",8)(11,"button",9),g("click",function(){return e.dialogRef.close(-1)}),s(12,"mat-icon"),c(13,"close"),r()()()()(),s(14,"div",10),_(15,ke,15,4,"div",11),_(16,be,15,4,"div",11),_(17,Te,15,4,"div",11),r()()),t&2&&(p(4),f("disabled",!e.display.saveRoutesOK&&!e.display.saveWaypointsOK&&!e.display.saveTracksOK),p(11),k(e.resData.waypoints.length!==0?15:-1),p(),k(e.resData.routes.length!==0?16:-1),p(),k(!e.app.data.serverTrail&&e.resData.tracks.length!==0?17:-1))},dependencies:[oe,se,z,I,V,j,A,$,B,K,q,Y,Z,H,ne,ee,te,ae,ie,Q,J,N,U,L],styles:[".gpxsave-dialog[_ngcontent-%COMP%]{font-family:roboto;position:relative}.dialog-content[_ngcontent-%COMP%]{position:relative;min-height:300px;max-height:400px;width:100%;min-width:240px;overflow-y:auto}.dialog-icon[_ngcontent-%COMP%]{display:none}.card-group[_ngcontent-%COMP%]{padding:5px 5%}.card-group[_ngcontent-%COMP%] .panel-header[_ngcontent-%COMP%]{padding:0 5px}.card-group[_ngcontent-%COMP%] .panel-description[_ngcontent-%COMP%]{text-align:right;width:100%;padding-right:10px}.card-group-title[_ngcontent-%COMP%]{font-weight:700;font-size:10pt;font-family:Arial,Helvetica,sans-serif;padding:10px 0}button[_ngcontent-%COMP%]{min-width:unset;padding:unset}.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}@media only screen and (min-width:475px){button[_ngcontent-%COMP%]{min-width:inherit;padding:inherit}.dialog-content[_ngcontent-%COMP%]{min-width:400px}.dialog-icon[_ngcontent-%COMP%]{display:inline}}@media only screen and (min-width:800px){.card-group[_ngcontent-%COMP%]{padding:5px 5%}}"]})};export{ge as GPXExportDialog};
|