@idm-plugin/vessel 1.7.1 → 1.7.3
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/dist/index.js +504 -474
- package/dist/index.umd.cjs +1 -1
- package/dist/speed/src/index.d.ts +8 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var G = (
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { LngLatHelper as
|
|
8
|
-
import { MeteoHelper2 as
|
|
9
|
-
import { Meteo2Assist as
|
|
10
|
-
let
|
|
1
|
+
var dt = Object.defineProperty;
|
|
2
|
+
var ut = (C, e, t) => e in C ? dt(C, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : C[e] = t;
|
|
3
|
+
var G = (C, e, t) => (ut(C, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import V from "got";
|
|
5
|
+
import ot from "@log4js-node/log4js-api";
|
|
6
|
+
import b from "moment";
|
|
7
|
+
import { LngLatHelper as J, LaneHelper as W } from "@idm-plugin/geo2";
|
|
8
|
+
import { MeteoHelper2 as ht, MeteoHelper as lt } from "@idm-plugin/meteo2";
|
|
9
|
+
import { Meteo2Assist as ct } from "@idm-plugin/meteo";
|
|
10
|
+
let g;
|
|
11
11
|
try {
|
|
12
|
-
|
|
12
|
+
g = ot.getLogger("vessel");
|
|
13
13
|
} catch {
|
|
14
14
|
} finally {
|
|
15
15
|
}
|
|
16
|
-
class
|
|
16
|
+
class tt {
|
|
17
17
|
/**
|
|
18
18
|
* 解析AIS状态码
|
|
19
19
|
* @param status
|
|
@@ -54,7 +54,7 @@ class st {
|
|
|
54
54
|
return { labelCn: t, labelEn: n };
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
class
|
|
57
|
+
class xt extends tt {
|
|
58
58
|
constructor(t, n) {
|
|
59
59
|
super();
|
|
60
60
|
G(this, "clientId");
|
|
@@ -63,39 +63,39 @@ class kt extends st {
|
|
|
63
63
|
this.clientId = t, this.clientSecret = n;
|
|
64
64
|
}
|
|
65
65
|
async authToken(t = {}) {
|
|
66
|
-
const n = "https://svc.data.myvessel.cn/ada/oauth/token",
|
|
66
|
+
const n = "https://svc.data.myvessel.cn/ada/oauth/token", i = {
|
|
67
67
|
searchParams: {
|
|
68
68
|
client_id: this.clientId,
|
|
69
69
|
client_secret: this.clientSecret,
|
|
70
70
|
grant_type: "client_credentials"
|
|
71
71
|
}
|
|
72
|
-
}, o = await
|
|
73
|
-
|
|
72
|
+
}, o = await V.post(n, i).json();
|
|
73
|
+
g == null || g.info("[%s] fetch access token from: %s - %j", t.requestId, n, o), o.error || (this.token = {
|
|
74
74
|
accessToken: o.access_token,
|
|
75
75
|
tokenType: o.token_type,
|
|
76
76
|
expiresIn: o.expires_in,
|
|
77
77
|
scope: o.scope,
|
|
78
78
|
jti: o.jti,
|
|
79
|
-
issuedAt:
|
|
79
|
+
issuedAt: b().utc().format()
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
async realTimePosition(t, n = {}) {
|
|
83
83
|
var u, m, l;
|
|
84
|
-
(!this.token ||
|
|
85
|
-
const
|
|
84
|
+
(!this.token || b().diff(b(this.token.issuedAt), "seconds") > ((u = this.token) == null ? void 0 : u.expiresIn) - 300) && await this.authToken(n);
|
|
85
|
+
const i = "https://svc.data.myvessel.cn/sdc/v1/vessels/status/location/unit", o = {
|
|
86
86
|
headers: {
|
|
87
87
|
Authorization: `${(m = this.token) == null ? void 0 : m.tokenType} ${(l = this.token) == null ? void 0 : l.accessToken}`
|
|
88
88
|
},
|
|
89
89
|
searchParams: { mmsi: t }
|
|
90
90
|
};
|
|
91
|
-
|
|
92
|
-
const a = await
|
|
91
|
+
g == null || g.info("[%s] fetch realtime position from: %s - %j", n.requestId, i, o);
|
|
92
|
+
const a = await V.get(i, o).json();
|
|
93
93
|
if (a.code)
|
|
94
|
-
return
|
|
94
|
+
return g == null || g.warn("[%s] fetch realtime position failed: %j", n.requestId, i, { message: a.message, status: a.status, code: a.code }), a;
|
|
95
95
|
const s = a.data;
|
|
96
96
|
for (const y in s)
|
|
97
97
|
!isNaN(s[y]) && Number(s[y]) !== 1 / 0 && (s[y] = Number(s[y]));
|
|
98
|
-
const d =
|
|
98
|
+
const d = b(`${s.postime} +08:00`, "YYYY-MM-DD HH:mm:ss +08:00");
|
|
99
99
|
return {
|
|
100
100
|
mmsi: s.mmsi,
|
|
101
101
|
name: s.vesselName,
|
|
@@ -110,7 +110,7 @@ class kt extends st {
|
|
|
110
110
|
cog: s.cog,
|
|
111
111
|
hdg: s.hdg,
|
|
112
112
|
rot: s.rot,
|
|
113
|
-
eta: /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/.test(s.eta) ?
|
|
113
|
+
eta: /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/.test(s.eta) ? b.utc(s.eta).format() : void 0,
|
|
114
114
|
destination: s.dest,
|
|
115
115
|
positionTime: d.unix(),
|
|
116
116
|
status: s.status,
|
|
@@ -121,78 +121,78 @@ class kt extends st {
|
|
|
121
121
|
utc: d.utc().format()
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
|
-
async trajectory(t, n,
|
|
125
|
-
(!this.token ||
|
|
126
|
-
const d = await this.realTimePosition(t, s),
|
|
127
|
-
for (; u.diff(
|
|
128
|
-
await this.trajectoryIn30Day(t,
|
|
129
|
-
return await this.trajectoryIn30Day(t,
|
|
124
|
+
async trajectory(t, n, i, o, a = !0, s = {}) {
|
|
125
|
+
(!this.token || b().diff(b(this.token.issuedAt), "seconds") > this.token.expiresIn - 300) && await this.authToken(s);
|
|
126
|
+
const d = await this.realTimePosition(t, s), c = b(n), u = b(i), m = [];
|
|
127
|
+
for (; u.diff(c, "day", !0) > 30; )
|
|
128
|
+
await this.trajectoryIn30Day(t, c, c.clone().add(30, "day"), d, o, m, s), c.add(30, "day");
|
|
129
|
+
return await this.trajectoryIn30Day(t, c, u, d, o, m, s), m;
|
|
130
130
|
}
|
|
131
|
-
async trajectoryIn30Day(t, n,
|
|
132
|
-
var f,
|
|
133
|
-
const
|
|
131
|
+
async trajectoryIn30Day(t, n, i, o, a, s, d = {}) {
|
|
132
|
+
var f, x, F, w, v;
|
|
133
|
+
const c = "https://svc.data.myvessel.cn/sdc/v1/vessels/status/track", u = {
|
|
134
134
|
headers: {
|
|
135
|
-
Authorization: `${(f = this.token) == null ? void 0 : f.tokenType} ${(
|
|
135
|
+
Authorization: `${(f = this.token) == null ? void 0 : f.tokenType} ${(x = this.token) == null ? void 0 : x.accessToken}`
|
|
136
136
|
},
|
|
137
137
|
json: {
|
|
138
138
|
mmsi: t,
|
|
139
139
|
startTime: n.utcOffset(8).format("YYYY-MM-DD HH:mm:ss"),
|
|
140
|
-
endTime:
|
|
140
|
+
endTime: i.utcOffset(8).format("YYYY-MM-DD HH:mm:ss")
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
|
-
|
|
144
|
-
const m = await
|
|
143
|
+
g == null || g.info("[%s] fetch trajectory from: %s - %j", d.requestId, c, u);
|
|
144
|
+
const m = await V.post(c, u).json();
|
|
145
145
|
if (m.code)
|
|
146
|
-
return
|
|
146
|
+
return g == null || g.warn("[%s] fetch trajectory failed: %j", d.requestId, c, { message: m.message, status: m.status, code: m.code }), m;
|
|
147
147
|
let l = -1;
|
|
148
|
-
const y =
|
|
149
|
-
return (v = m.data) == null || v.forEach((
|
|
150
|
-
for (const
|
|
151
|
-
!isNaN(
|
|
152
|
-
const
|
|
153
|
-
mmsi:
|
|
148
|
+
const y = b(`${(w = (F = m.data) == null ? void 0 : F[0]) == null ? void 0 : w.postime} +08:00`, "YYYY-MM-DD HH:mm:ss +08:00");
|
|
149
|
+
return (v = m.data) == null || v.forEach((r) => {
|
|
150
|
+
for (const Y in r)
|
|
151
|
+
!isNaN(r[Y]) && Number(r[Y]) !== 1 / 0 && (r[Y] = Number(r[Y]));
|
|
152
|
+
const p = b(`${r.postime} +08:00`, "YYYY-MM-DD HH:mm:ss +08:00"), M = r.status, { labelCn: h, labelEn: S } = this.parseStatus(M), k = {
|
|
153
|
+
mmsi: r.mmsi,
|
|
154
154
|
imo: o == null ? void 0 : o.imo,
|
|
155
|
-
lat:
|
|
156
|
-
lng:
|
|
157
|
-
sog:
|
|
158
|
-
cog:
|
|
159
|
-
hdg:
|
|
160
|
-
draught:
|
|
161
|
-
status:
|
|
162
|
-
eta: /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/.test(
|
|
163
|
-
destination:
|
|
164
|
-
positionTime:
|
|
165
|
-
labelCn:
|
|
166
|
-
labelEn:
|
|
155
|
+
lat: r.lat,
|
|
156
|
+
lng: r.lon,
|
|
157
|
+
sog: r.sog,
|
|
158
|
+
cog: r.cog,
|
|
159
|
+
hdg: r.hdg,
|
|
160
|
+
draught: r.draught,
|
|
161
|
+
status: M,
|
|
162
|
+
eta: /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/.test(r.eta) ? b(`${r.eta} +08:00`, "YYYY-MM-DD HH:mm:ss +08:00").utc().format() : void 0,
|
|
163
|
+
destination: r.dest,
|
|
164
|
+
positionTime: p.unix(),
|
|
165
|
+
labelCn: h,
|
|
166
|
+
labelEn: S,
|
|
167
167
|
method: "trajectory",
|
|
168
168
|
vendor: "myVessel",
|
|
169
|
-
utc:
|
|
170
|
-
},
|
|
171
|
-
|
|
169
|
+
utc: p.utc().format()
|
|
170
|
+
}, P = Math.floor(p.diff(y, "minute", !0) / (a || 1));
|
|
171
|
+
P !== l && (l = P, s.push(k));
|
|
172
172
|
}), s;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
class
|
|
175
|
+
class Ct extends tt {
|
|
176
176
|
constructor(t) {
|
|
177
177
|
super();
|
|
178
178
|
G(this, "token");
|
|
179
179
|
this.token = t;
|
|
180
180
|
}
|
|
181
181
|
async realTimePosition(t, n = {}) {
|
|
182
|
-
const
|
|
182
|
+
const i = "https://api.hifleet.com/position/position/get/token", o = {
|
|
183
183
|
searchParams: {
|
|
184
184
|
mmsi: t,
|
|
185
185
|
usertoken: this.token
|
|
186
186
|
}
|
|
187
|
-
}, a = await
|
|
188
|
-
|
|
187
|
+
}, a = await V.post(i, o).json();
|
|
188
|
+
g == null || g.info("[%s] fetch realtime position from: %s - %j", n.requestId, i, o);
|
|
189
189
|
const s = a == null ? void 0 : a.list;
|
|
190
190
|
if (!s)
|
|
191
|
-
return
|
|
191
|
+
return g == null || g.warn("[%s] fetch realtime position failed: %j", n.requestId, i, a), a;
|
|
192
192
|
for (const y in s)
|
|
193
193
|
!isNaN(s[y]) && Number(s[y]) !== 1 / 0 && (s[y] = Number(s[y]));
|
|
194
194
|
s.status = s.sp > 3 ? 0 : 1;
|
|
195
|
-
const d = s.status, { labelCn:
|
|
195
|
+
const d = s.status, { labelCn: c, labelEn: u } = this.parseStatus(d), m = b(`${s.ti} +08:00`, "YYYY-MM-DD HH:mm:ss +08:00");
|
|
196
196
|
return {
|
|
197
197
|
mmsi: s.m,
|
|
198
198
|
name: s.n,
|
|
@@ -207,19 +207,19 @@ class St extends st {
|
|
|
207
207
|
cog: s.co,
|
|
208
208
|
hdg: s.h,
|
|
209
209
|
rot: isNaN(s.rot) ? 0 : s.rot,
|
|
210
|
-
eta: /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/.test(s.eta) ?
|
|
210
|
+
eta: /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/.test(s.eta) ? b.utc(s.eta).format() : void 0,
|
|
211
211
|
destination: s.destination,
|
|
212
212
|
positionTime: m.unix(),
|
|
213
213
|
utc: m.utc().format(),
|
|
214
214
|
status: d,
|
|
215
|
-
labelCn:
|
|
215
|
+
labelCn: c,
|
|
216
216
|
labelEn: u,
|
|
217
217
|
method: "position",
|
|
218
218
|
vendor: "hifleet"
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
221
|
async search(t, n = {}) {
|
|
222
|
-
let
|
|
222
|
+
let i = "https://www.hifleet.com/hifleetapi/searchVesselOL.do";
|
|
223
223
|
const o = {
|
|
224
224
|
searchParams: {
|
|
225
225
|
keyword: t
|
|
@@ -230,8 +230,8 @@ class St extends st {
|
|
|
230
230
|
Host: "www.hifleet.com"
|
|
231
231
|
}
|
|
232
232
|
};
|
|
233
|
-
let a = await
|
|
234
|
-
|
|
233
|
+
let a = await V.post(i, o).json();
|
|
234
|
+
g == null || g.info("[%s] fetch vessel props from: %s - %j", n.requestId, i, o), a instanceof Array && (a = a[0]);
|
|
235
235
|
for (const d in a)
|
|
236
236
|
!isNaN(a[d]) && Number(a[d]) !== 1 / 0 && (a[d] = Number(a[d]));
|
|
237
237
|
const s = {
|
|
@@ -244,10 +244,10 @@ class St extends st {
|
|
|
244
244
|
draught: a.dr,
|
|
245
245
|
type: a.t
|
|
246
246
|
};
|
|
247
|
-
return
|
|
247
|
+
return i = "https://www.hifleet.com/hifleetapi/sameShipSearch.do", a = await V.post(i, o).json(), g == null || g.info("[%s] search vessel dead weight from: %s - %j", n.requestId, i, o), a instanceof Array && (a = a[0]), a && (s.deadweight = Number(a.dwt)), s;
|
|
248
248
|
}
|
|
249
249
|
async suggest(t, n = {}) {
|
|
250
|
-
const
|
|
250
|
+
const i = "https://www.hifleet.com/hifleetapi/getShipSuggest.do", o = {
|
|
251
251
|
searchParams: {
|
|
252
252
|
q: t
|
|
253
253
|
},
|
|
@@ -256,8 +256,8 @@ class St extends st {
|
|
|
256
256
|
Origin: "https://www.hifleet.com",
|
|
257
257
|
Host: "www.hifleet.com"
|
|
258
258
|
}
|
|
259
|
-
}, a = await
|
|
260
|
-
|
|
259
|
+
}, a = await V.post(i, o).json();
|
|
260
|
+
g == null || g.info("[%s] suggest vessel props from: %s - %j", n.requestId, i, o);
|
|
261
261
|
const s = [];
|
|
262
262
|
for (const d of a)
|
|
263
263
|
s.push({
|
|
@@ -267,79 +267,79 @@ class St extends st {
|
|
|
267
267
|
imo: !d.imo || isNaN(d.imo) ? null : Number(d.imo),
|
|
268
268
|
score: d._score
|
|
269
269
|
});
|
|
270
|
-
return s.sort((d,
|
|
270
|
+
return s.sort((d, c) => c.score - d.score), s;
|
|
271
271
|
}
|
|
272
|
-
async trajectory(t, n,
|
|
273
|
-
var
|
|
272
|
+
async trajectory(t, n, i, o, a = !0, s = {}) {
|
|
273
|
+
var r, p, M;
|
|
274
274
|
const d = await this.realTimePosition(t, s);
|
|
275
|
-
let
|
|
276
|
-
const u =
|
|
275
|
+
let c = b(n);
|
|
276
|
+
const u = b(i), m = b();
|
|
277
277
|
if (a) {
|
|
278
|
-
let
|
|
279
|
-
|
|
278
|
+
let h = u.diff(c, "d", !0);
|
|
279
|
+
h < 0 ? c = u.clone().subtract(40, "d") : h < 30 ? c.subtract(10, "d") : h < 60 ? c.subtract(5, "d") : c = u.clone().subtract(80, "d"), h = m.diff(u, "d", !0), u.add(h > 10 ? 240 : h * 24, "h");
|
|
280
280
|
}
|
|
281
281
|
const l = {
|
|
282
282
|
searchParams: {
|
|
283
283
|
endtime: u.utcOffset("+8:00").format("YYYY-MM-DD HH:mm:ss"),
|
|
284
|
-
starttime:
|
|
284
|
+
starttime: c.utcOffset("+8:00").format("YYYY-MM-DD HH:mm:ss"),
|
|
285
285
|
mmsi: t,
|
|
286
286
|
usertoken: this.token
|
|
287
287
|
}
|
|
288
|
-
}, y = "https://api.hifleet.com/position/trajectory/nocompressed/withstatic/token", f = await
|
|
289
|
-
|
|
290
|
-
let
|
|
291
|
-
f && (
|
|
292
|
-
const
|
|
293
|
-
let
|
|
294
|
-
const v =
|
|
295
|
-
for (const
|
|
296
|
-
for (const
|
|
297
|
-
!isNaN(
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
const { labelEn:
|
|
301
|
-
mmsi:
|
|
302
|
-
name:
|
|
288
|
+
}, y = "https://api.hifleet.com/position/trajectory/nocompressed/withstatic/token", f = await V.get(y, l).json();
|
|
289
|
+
g == null || g.info("[%s] fetch trajectory from: %s - %j", s.requestId, y, l);
|
|
290
|
+
let x;
|
|
291
|
+
f && (x = ((p = (r = f.ships) == null ? void 0 : r.offors) == null ? void 0 : p.ship) || [], x.length || g == null || g.warn("[%s] fetch trajectory failed: %j", s.requestId, f));
|
|
292
|
+
const F = [];
|
|
293
|
+
let w = -1;
|
|
294
|
+
const v = b(`${(M = x == null ? void 0 : x[0]) == null ? void 0 : M.ti} +08:00`, "YYYY-MM-DD HH:mm:ss +08:00");
|
|
295
|
+
for (const h of x) {
|
|
296
|
+
for (const D in h)
|
|
297
|
+
!isNaN(h[D]) && Number(h[D]) !== 1 / 0 && (h[D] = Number(h[D]));
|
|
298
|
+
const S = b(`${h.ti} +08:00`, "YYYY-MM-DD HH:mm:ss +08:00");
|
|
299
|
+
h.status = h.sp > 4 ? 0 : 1;
|
|
300
|
+
const { labelEn: k, labelCn: P } = this.parseStatus(h.status), Y = {
|
|
301
|
+
mmsi: h.m,
|
|
302
|
+
name: h.n,
|
|
303
303
|
imo: d == null ? void 0 : d.imo,
|
|
304
|
-
lat:
|
|
305
|
-
lng:
|
|
306
|
-
draught:
|
|
307
|
-
sog:
|
|
308
|
-
cog:
|
|
309
|
-
hdg:
|
|
310
|
-
positionTime:
|
|
311
|
-
utc:
|
|
312
|
-
status:
|
|
313
|
-
labelCn:
|
|
314
|
-
labelEn:
|
|
304
|
+
lat: h.la,
|
|
305
|
+
lng: h.lo,
|
|
306
|
+
draught: h.draught,
|
|
307
|
+
sog: h.sp,
|
|
308
|
+
cog: h.co,
|
|
309
|
+
hdg: h.hdg,
|
|
310
|
+
positionTime: S.unix(),
|
|
311
|
+
utc: S.utc().format(),
|
|
312
|
+
status: h.status,
|
|
313
|
+
labelCn: P,
|
|
314
|
+
labelEn: k,
|
|
315
315
|
method: "trajectory",
|
|
316
316
|
vendor: "hifleet"
|
|
317
|
-
},
|
|
318
|
-
|
|
317
|
+
}, E = Math.floor(S.diff(v, "minute", !0) / (o || 1));
|
|
318
|
+
E !== w && (w = E, F.push(Y));
|
|
319
319
|
}
|
|
320
|
-
return
|
|
320
|
+
return F;
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
class
|
|
323
|
+
class jt extends tt {
|
|
324
324
|
constructor(t) {
|
|
325
325
|
super();
|
|
326
326
|
G(this, "token");
|
|
327
327
|
this.token = t;
|
|
328
328
|
}
|
|
329
329
|
async realTimePosition(t, n = {}) {
|
|
330
|
-
const
|
|
330
|
+
const i = {
|
|
331
331
|
searchParams: {
|
|
332
332
|
id: t,
|
|
333
333
|
k: this.token,
|
|
334
334
|
enc: 1
|
|
335
335
|
}
|
|
336
|
-
}, o = "https://api.shipxy.com/apicall/GetSingleShip", a = await
|
|
337
|
-
if (
|
|
336
|
+
}, o = "https://api.shipxy.com/apicall/GetSingleShip", a = await V.get(o, i).json();
|
|
337
|
+
if (g == null || g.info("[%s] fetch realtime position from: %s - %j", n.requestId, o, i), (a == null ? void 0 : a.status) !== 0)
|
|
338
338
|
return a;
|
|
339
339
|
const s = a.data[0];
|
|
340
340
|
for (const l in s)
|
|
341
341
|
!isNaN(s[l]) && Number(s[l]) !== 1 / 0 && (s[l] = Number(s[l]));
|
|
342
|
-
const { labelCn: d, labelEn:
|
|
342
|
+
const { labelCn: d, labelEn: c } = await this.parseStatus(s.navistat), u = b.unix(s.lasttime);
|
|
343
343
|
return {
|
|
344
344
|
mmsi: s.ShipID,
|
|
345
345
|
name: s.name,
|
|
@@ -357,77 +357,77 @@ class Yt extends st {
|
|
|
357
357
|
positionTime: s.lasttime,
|
|
358
358
|
utc: u.utc().format(),
|
|
359
359
|
status: s.navistat,
|
|
360
|
-
labelEn:
|
|
360
|
+
labelEn: c,
|
|
361
361
|
labelCn: d,
|
|
362
362
|
method: "position",
|
|
363
363
|
vendor: "shipxy"
|
|
364
364
|
};
|
|
365
365
|
}
|
|
366
|
-
async trajectory(t, n,
|
|
366
|
+
async trajectory(t, n, i, o, a = !0, s = {}) {
|
|
367
367
|
var v;
|
|
368
|
-
const d = await this.realTimePosition(t, s),
|
|
368
|
+
const d = await this.realTimePosition(t, s), c = b(n), u = b(i), m = "https://api.shipxy.com/apicall/GetShipTrack", l = {
|
|
369
369
|
searchParams: {
|
|
370
370
|
id: t,
|
|
371
371
|
k: this.token,
|
|
372
372
|
enc: 1,
|
|
373
373
|
cut: 0,
|
|
374
|
-
btm:
|
|
374
|
+
btm: c.unix(),
|
|
375
375
|
etm: u.unix()
|
|
376
376
|
}
|
|
377
|
-
}, y = await
|
|
378
|
-
if (
|
|
377
|
+
}, y = await V.get(m, l).json();
|
|
378
|
+
if (g == null || g.info("[%s] fetch trajectory from: %s - %j", s.requestId, m, l), (y == null ? void 0 : y.status) !== 0)
|
|
379
379
|
return y;
|
|
380
|
-
const f = y == null ? void 0 : y.points,
|
|
381
|
-
let
|
|
382
|
-
for (const
|
|
383
|
-
const
|
|
380
|
+
const f = y == null ? void 0 : y.points, x = [], F = b.unix((v = f[0]) == null ? void 0 : v.utc);
|
|
381
|
+
let w = -1;
|
|
382
|
+
for (const r of f) {
|
|
383
|
+
const p = b.unix(r.utc), M = {
|
|
384
384
|
imo: d == null ? void 0 : d.imo,
|
|
385
385
|
mmsi: t,
|
|
386
|
-
sog: Math.round(
|
|
387
|
-
cog: Math.round(
|
|
388
|
-
lat: Math.round(
|
|
389
|
-
lng: Math.round(
|
|
390
|
-
positionTime:
|
|
391
|
-
utc:
|
|
386
|
+
sog: Math.round(r.sog * 3600 / 1e3 / 1852 * 100) / 100,
|
|
387
|
+
cog: Math.round(r.cog / 100 * 100) / 100,
|
|
388
|
+
lat: Math.round(r.lat / 1e6 * 1e5) / 1e5,
|
|
389
|
+
lng: Math.round(r.lon / 1e6 * 1e5) / 1e5,
|
|
390
|
+
positionTime: p.unix(),
|
|
391
|
+
utc: p.utc().format(),
|
|
392
392
|
method: "trajectory",
|
|
393
393
|
vendor: "shipxy"
|
|
394
|
-
},
|
|
395
|
-
|
|
394
|
+
}, h = Math.floor(p.diff(F, "minute", !0) / (o || 1));
|
|
395
|
+
h !== w && (w = h, x.push(M));
|
|
396
396
|
}
|
|
397
|
-
return
|
|
397
|
+
return x;
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
class
|
|
400
|
+
class Et extends tt {
|
|
401
401
|
constructor(t) {
|
|
402
402
|
super();
|
|
403
403
|
G(this, "token");
|
|
404
404
|
this.token = t;
|
|
405
405
|
}
|
|
406
406
|
async getShipId(t, n = {}) {
|
|
407
|
-
const
|
|
407
|
+
const i = {
|
|
408
408
|
headers: {
|
|
409
409
|
appKey: this.token
|
|
410
410
|
},
|
|
411
411
|
json: {
|
|
412
412
|
mmsiList: t
|
|
413
413
|
}
|
|
414
|
-
}, o = "https://api3.myships.com/sp/ships/getShipIdByMMSI", a = await
|
|
415
|
-
return
|
|
414
|
+
}, o = "https://api3.myships.com/sp/ships/getShipIdByMMSI", a = await V.post(o, i).json();
|
|
415
|
+
return g == null || g.info("[%s] fetch ship id from: %s - %j", n.requestId, o, i), a.code !== "0" ? a : a.data[0].shipId;
|
|
416
416
|
}
|
|
417
417
|
async getShipInfo(t, n = {}) {
|
|
418
|
-
const
|
|
418
|
+
const i = {
|
|
419
419
|
headers: {
|
|
420
420
|
appKey: this.token
|
|
421
421
|
},
|
|
422
422
|
json: {
|
|
423
423
|
shipId: t
|
|
424
424
|
}
|
|
425
|
-
}, o = "https://api3.myships.com/sp/ships/aissta", a = await
|
|
426
|
-
if (
|
|
425
|
+
}, o = "https://api3.myships.com/sp/ships/aissta", a = await V.post(o, i).json();
|
|
426
|
+
if (g == null || g.info("[%s] fetch ship info from: %s - %j", n.requestId, o, i), a.code !== "0")
|
|
427
427
|
return a;
|
|
428
428
|
const s = a.data;
|
|
429
429
|
let d = s.imo;
|
|
430
|
-
return t === "407170" && (d = "9198379",
|
|
430
|
+
return t === "407170" && (d = "9198379", g == null || g.warn("[%s] ship(%s) imo error: %s, should be %s", n.requestId, t, s.imo, d)), {
|
|
431
431
|
mmsi: s.mmsi,
|
|
432
432
|
name: s.shipnameEn,
|
|
433
433
|
imo: d,
|
|
@@ -438,45 +438,45 @@ class jt extends st {
|
|
|
438
438
|
};
|
|
439
439
|
}
|
|
440
440
|
async realTimePosition(t, n = {}) {
|
|
441
|
-
const
|
|
441
|
+
const i = await this.getShipId(t, n), o = await this.getShipInfo(i, n), a = {
|
|
442
442
|
headers: {
|
|
443
443
|
appKey: this.token
|
|
444
444
|
},
|
|
445
445
|
json: {
|
|
446
|
-
shipId:
|
|
446
|
+
shipId: i
|
|
447
447
|
}
|
|
448
|
-
}, s = "https://api3.myships.com/sp/ships/position/latest", d = await
|
|
449
|
-
|
|
450
|
-
const
|
|
451
|
-
for (const f in
|
|
452
|
-
!isNaN(
|
|
453
|
-
const { labelCn: u, labelEn: m } = await this.parseStatus(
|
|
448
|
+
}, s = "https://api3.myships.com/sp/ships/position/latest", d = await V.post(s, a).json();
|
|
449
|
+
g == null || g.info("[%s] fetch realtime position from: %s - %j", n.requestId, s, a);
|
|
450
|
+
const c = d.data[0];
|
|
451
|
+
for (const f in c)
|
|
452
|
+
!isNaN(c[f]) && Number(c[f]) !== 1 / 0 && (c[f] = Number(c[f]));
|
|
453
|
+
const { labelCn: u, labelEn: m } = await this.parseStatus(c.aisNavStatus), l = b.unix(c.posTime);
|
|
454
454
|
return {
|
|
455
455
|
...o,
|
|
456
456
|
mmsi: t,
|
|
457
|
-
lat: Math.round(
|
|
458
|
-
lng: Math.round(
|
|
459
|
-
sog: Math.round(
|
|
460
|
-
cog: Math.round(
|
|
461
|
-
hdg: Math.round(
|
|
462
|
-
rot: Math.round(
|
|
463
|
-
positionTime:
|
|
457
|
+
lat: Math.round(c.lat / 1e4 / 60 * 1e5) / 1e5,
|
|
458
|
+
lng: Math.round(c.lon / 1e4 / 60 * 1e5) / 1e5,
|
|
459
|
+
sog: Math.round(c.sog / 10 * 100) / 100,
|
|
460
|
+
cog: Math.round(c.cog / 10 * 100) / 100,
|
|
461
|
+
hdg: Math.round(c.heading * 100) / 100,
|
|
462
|
+
rot: Math.round(c.rot * 100) / 100,
|
|
463
|
+
positionTime: c.posTime,
|
|
464
464
|
utc: l.utc().format(),
|
|
465
|
-
status:
|
|
465
|
+
status: c.aisNavStatus,
|
|
466
466
|
labelEn: m,
|
|
467
467
|
labelCn: u,
|
|
468
468
|
method: "position",
|
|
469
469
|
vendor: "myship"
|
|
470
470
|
};
|
|
471
471
|
}
|
|
472
|
-
async trajectory(t, n,
|
|
473
|
-
const d =
|
|
474
|
-
for (;
|
|
472
|
+
async trajectory(t, n, i, o, a = !0, s = {}) {
|
|
473
|
+
const d = b(n), c = b(i), u = await this.getShipId(t), m = await this.getShipInfo(u), l = [];
|
|
474
|
+
for (; c.diff(d, "day", !0) > 30; )
|
|
475
475
|
await this.trajectoryIn30Day(u, d.unix(), d.add(30, "day").unix(), m, t, o, l);
|
|
476
|
-
return await this.trajectoryIn30Day(u, d.unix(),
|
|
476
|
+
return await this.trajectoryIn30Day(u, d.unix(), c.unix(), m, t, o, l), l;
|
|
477
477
|
}
|
|
478
|
-
async trajectoryIn30Day(t, n,
|
|
479
|
-
var
|
|
478
|
+
async trajectoryIn30Day(t, n, i, o, a, s, d, c = {}) {
|
|
479
|
+
var F;
|
|
480
480
|
const u = {
|
|
481
481
|
headers: {
|
|
482
482
|
appKey: this.token
|
|
@@ -484,44 +484,44 @@ class jt extends st {
|
|
|
484
484
|
json: {
|
|
485
485
|
shipId: t,
|
|
486
486
|
startTime: n,
|
|
487
|
-
endTime:
|
|
487
|
+
endTime: i
|
|
488
488
|
}
|
|
489
|
-
}, m = "https://api3.myships.com/sp/ships/position/history", l = await
|
|
490
|
-
if (
|
|
491
|
-
return
|
|
489
|
+
}, m = "https://api3.myships.com/sp/ships/position/history", l = await V.post(m, u).json();
|
|
490
|
+
if (g == null || g.info("[%s] fetch trajectory from: %s - %j", c.requestId, m, u), l.code !== "0")
|
|
491
|
+
return g == null || g.warn("[%s] invoke myship trajectory failed: %j", c.requestId, l), l;
|
|
492
492
|
const y = l.data;
|
|
493
|
-
for (const
|
|
494
|
-
!isNaN(y[
|
|
495
|
-
const f =
|
|
496
|
-
let
|
|
497
|
-
for (const
|
|
498
|
-
const v =
|
|
493
|
+
for (const w in y)
|
|
494
|
+
!isNaN(y[w]) && Number(y[w]) !== 1 / 0 && (y[w] = Number(y[w]));
|
|
495
|
+
const f = b.unix((F = y[0]) == null ? void 0 : F.posTime);
|
|
496
|
+
let x = -1;
|
|
497
|
+
for (const w of y) {
|
|
498
|
+
const v = b.unix(w.posTime), r = {
|
|
499
499
|
imo: o == null ? void 0 : o.imo,
|
|
500
500
|
mmsi: a,
|
|
501
|
-
lat: Math.round(
|
|
502
|
-
lng: Math.round(
|
|
503
|
-
sog: Math.round(
|
|
504
|
-
cog: Math.round(
|
|
505
|
-
hdg: Math.round(
|
|
506
|
-
rot: Math.round(
|
|
501
|
+
lat: Math.round(w.lat / 1e4 / 60 * 1e5) / 1e5,
|
|
502
|
+
lng: Math.round(w.lon / 1e4 / 60 * 1e5) / 1e5,
|
|
503
|
+
sog: Math.round(w.sog / 10 * 100) / 100,
|
|
504
|
+
cog: Math.round(w.cog / 10 * 100) / 100,
|
|
505
|
+
hdg: Math.round(w.heading * 100) / 100,
|
|
506
|
+
rot: Math.round(w.rot * 100) / 100,
|
|
507
507
|
positionTime: v.unix(),
|
|
508
508
|
utc: v.utc().format(),
|
|
509
509
|
method: "trajectory",
|
|
510
510
|
vendor: "myship"
|
|
511
|
-
},
|
|
512
|
-
|
|
511
|
+
}, p = Math.floor(v.diff(f, "minute", !0) / (s || 1));
|
|
512
|
+
p !== x && (x = p, d.push(r));
|
|
513
513
|
}
|
|
514
514
|
return d;
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
-
let
|
|
517
|
+
let B;
|
|
518
518
|
try {
|
|
519
|
-
|
|
519
|
+
B = ot.getLogger("vessel");
|
|
520
520
|
} catch {
|
|
521
521
|
} finally {
|
|
522
522
|
}
|
|
523
|
-
var
|
|
524
|
-
class
|
|
523
|
+
var ft = /* @__PURE__ */ ((C) => (C.NOTICE = "NOTICE", C.WARN = "WARN", C.HEAVY = "HEAVY", C.SEVERE = "SEVERE", C.ERROR = "ERROR", C.FATAL = "FATAL", C))(ft || {});
|
|
524
|
+
class mt {
|
|
525
525
|
/**
|
|
526
526
|
* 解析告警规则, 多规则场景
|
|
527
527
|
* @param rule
|
|
@@ -531,14 +531,14 @@ class ht {
|
|
|
531
531
|
* @param options
|
|
532
532
|
*/
|
|
533
533
|
parsePrinciple(e, t = {}) {
|
|
534
|
-
var s, d,
|
|
535
|
-
|
|
536
|
-
const n = new RegExp("(?<=\\[)(.+)(?=])", "g"),
|
|
534
|
+
var s, d, c;
|
|
535
|
+
B == null || B.info("[%s] parse rule: %s", t.requestId, e);
|
|
536
|
+
const n = new RegExp("(?<=\\[)(.+)(?=])", "g"), i = e.match(n) ? (s = e.match(n)) == null ? void 0 : s[0] : void 0, o = i == null ? void 0 : i.split(";");
|
|
537
537
|
if (!o)
|
|
538
538
|
return;
|
|
539
539
|
const a = {};
|
|
540
540
|
for (let u = 0; u < (o == null ? void 0 : o.length); u++) {
|
|
541
|
-
const m = (
|
|
541
|
+
const m = (c = (d = o[u].match(n)) == null ? void 0 : d[0]) == null ? void 0 : c.split("],");
|
|
542
542
|
if (u === 0 && !m)
|
|
543
543
|
a.scope = o[0];
|
|
544
544
|
else if (m)
|
|
@@ -557,8 +557,8 @@ class ht {
|
|
|
557
557
|
*/
|
|
558
558
|
parseRule(e, t = {}) {
|
|
559
559
|
var a;
|
|
560
|
-
|
|
561
|
-
const n = new RegExp("(?<=\\[)(.+?)(?=])", "g"),
|
|
560
|
+
B == null || B.info("[%s] parse rule: %s", t.requestId, e), e = e.startsWith("[") ? e : `[${e}`, e = e.endsWith("]") ? e : `${e}]`;
|
|
561
|
+
const n = new RegExp("(?<=\\[)(.+?)(?=])", "g"), i = (a = e == null ? void 0 : e.match(n)) == null ? void 0 : a[0], o = i == null ? void 0 : i.split(",");
|
|
562
562
|
if (o)
|
|
563
563
|
return {
|
|
564
564
|
operator: o[0],
|
|
@@ -575,26 +575,26 @@ class ht {
|
|
|
575
575
|
* @param options
|
|
576
576
|
*/
|
|
577
577
|
checkWeather(e, t, n = {}) {
|
|
578
|
-
var f,
|
|
579
|
-
let
|
|
580
|
-
const d = Math.round(((
|
|
581
|
-
for (let
|
|
582
|
-
const
|
|
583
|
-
s =
|
|
578
|
+
var f, x, F, w, v, r, p, M, h, S, k, P, Y, E, D;
|
|
579
|
+
let i = 0, o = 0, a = 0, s = 0;
|
|
580
|
+
const d = Math.round(((x = (f = t == null ? void 0 : t.SEVERE) == null ? void 0 : f.sigWave) == null ? void 0 : x.number) * 1.6 * 100) / 100, c = (w = (F = t == null ? void 0 : t.SEVERE) == null ? void 0 : F.sigWave) == null ? void 0 : w.number, u = (r = (v = t == null ? void 0 : t.HEAVY) == null ? void 0 : v.sigWave) == null ? void 0 : r.number, m = Math.round((((M = (p = t == null ? void 0 : t.SEVERE) == null ? void 0 : p.wind) == null ? void 0 : M.number) + 2) * 100) / 100, l = (S = (h = t == null ? void 0 : t.SEVERE) == null ? void 0 : h.wind) == null ? void 0 : S.number, y = (P = (k = t == null ? void 0 : t.HEAVY) == null ? void 0 : k.wind) == null ? void 0 : P.number;
|
|
581
|
+
for (let N = 0; N < (e == null ? void 0 : e.length); N++) {
|
|
582
|
+
const j = e[N], A = (E = (Y = j == null ? void 0 : j.meteo) == null ? void 0 : Y.wave) == null ? void 0 : E.sig, R = (D = j == null ? void 0 : j.meteo) == null ? void 0 : D.wind, K = N ? b(j.eta).diff(b(e[N - 1].eta), "hour", !0) : 0;
|
|
583
|
+
s = K > s ? K : s, B == null || B.info("[%s] check sig.wave: %j", n.requestId, { ...A, dgThd4Wv: d, svThd4Wv: c, hvThd4Wv: u }), (A == null ? void 0 : A.height) >= d ? j.isDangerous = !0 : (A == null ? void 0 : A.height) >= c ? j.isSevere = !0 : (A == null ? void 0 : A.height) >= u && (j.isHeavy = !0), B == null || B.info("[%s] check wind: %j", n.requestId, { ...R, dgThd4Wd: m, svThd4Wd: l, hvThd4Wd: y }), (R == null ? void 0 : R.scale) >= m ? (j.isDangerous = !0, delete j.isSevere, delete j.isHeavy) : (R == null ? void 0 : R.scale) > l ? (j.isDangerous || (j.isSevere = !0), delete j.isHeavy) : (R == null ? void 0 : R.scale) === y && !j.isDangerous && !j.isSevere && (j.isHeavy = !0), i += j.isDangerous ? K : 0, o += j.isSevere ? K : 0, a += j.isHeavy ? K : 0;
|
|
584
584
|
}
|
|
585
|
-
return
|
|
585
|
+
return i = Math.round(i * 100) / 100, o = Math.round(o * 100) / 100, a = Math.round(a * 100) / 100, s = Math.round(s), { sample: e, dangerous: i, severe: o, heavy: a, step: s < 3 ? 3 : s, wind: { dgThd4Wd: m, svThd4Wd: l, hvThd4Wd: y }, sig: { dgThd4Wv: d, svThd4Wv: c, hvThd4Wv: u } };
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
|
-
const
|
|
589
|
-
let
|
|
588
|
+
const Nt = new mt();
|
|
589
|
+
let I;
|
|
590
590
|
try {
|
|
591
|
-
|
|
591
|
+
I = ot.getLogger("vessel");
|
|
592
592
|
} catch {
|
|
593
593
|
} finally {
|
|
594
594
|
}
|
|
595
|
-
const
|
|
596
|
-
var
|
|
597
|
-
class
|
|
595
|
+
const yt = new ht("", !0);
|
|
596
|
+
var Mt = /* @__PURE__ */ ((C) => (C.common = "common", C.container = "container", C.tugs = "tugs", C))(Mt || {}), gt = /* @__PURE__ */ ((C) => (C.Ballast = "Ballast", C.Laden = "Laden", C))(gt || {}), bt = /* @__PURE__ */ ((C) => (C.Cp = "CP", C.Perf = "Basis", C.Instruct = "Other", C))(bt || {});
|
|
597
|
+
class O {
|
|
598
598
|
/**
|
|
599
599
|
* @see https://baike.baidu.com/item/%E6%96%B9%E5%BD%A2%E7%B3%BB%E6%95%B0/4965568?fr=aladdin
|
|
600
600
|
* 方形系数(block coefficient)
|
|
@@ -607,8 +607,8 @@ class A {
|
|
|
607
607
|
* @param draught 吃水 m
|
|
608
608
|
* @return [0.55, 0.85]
|
|
609
609
|
*/
|
|
610
|
-
static blockCoefficient(e, t, n,
|
|
611
|
-
let o = Math.round(e / (t * n *
|
|
610
|
+
static blockCoefficient(e, t, n, i) {
|
|
611
|
+
let o = Math.round(e / (t * n * i) * 100) / 100;
|
|
612
612
|
o = o < 0.55 ? 0.55 : o > 0.85 ? 0.85 : o;
|
|
613
613
|
const a = [0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85], s = a.map((d) => Math.abs(d - o));
|
|
614
614
|
return a[s.indexOf(Math.min(...s))];
|
|
@@ -625,8 +625,8 @@ class A {
|
|
|
625
625
|
* @return [0.05, 0.30]
|
|
626
626
|
*/
|
|
627
627
|
static froudeNumber(e, t, n = 9.8) {
|
|
628
|
-
let
|
|
629
|
-
return
|
|
628
|
+
let i = Math.round(Math.sqrt(e * e / (n * t)) * 100) / 100;
|
|
629
|
+
return i = i < 0.05 ? 0.05 : i > 0.3 ? 0.3 : i, i;
|
|
630
630
|
}
|
|
631
631
|
/**
|
|
632
632
|
* 失速修正系數
|
|
@@ -636,7 +636,7 @@ class A {
|
|
|
636
636
|
* @private
|
|
637
637
|
*/
|
|
638
638
|
static amendFactor(e, t, n) {
|
|
639
|
-
const
|
|
639
|
+
const i = {
|
|
640
640
|
0.55: [1.7, -1.4, -7.4],
|
|
641
641
|
0.6: [2.2, -2.5, -9.7],
|
|
642
642
|
0.65: [2.6, -3.7, -11.6],
|
|
@@ -654,7 +654,7 @@ class A {
|
|
|
654
654
|
0.8: [3, -16.3, -21.6],
|
|
655
655
|
0.85: [3.4, -20.9, 31.8]
|
|
656
656
|
}[e];
|
|
657
|
-
return n === "Laden" && (a =
|
|
657
|
+
return n === "Laden" && (a = i[e]), a[0] + a[1] * t + a[2] * Math.pow(t, 2);
|
|
658
658
|
}
|
|
659
659
|
/**
|
|
660
660
|
* 失速方向因子
|
|
@@ -682,10 +682,10 @@ class A {
|
|
|
682
682
|
* @param bn
|
|
683
683
|
* @private
|
|
684
684
|
*/
|
|
685
|
-
static vesselTagFactor(e, t, n,
|
|
686
|
-
|
|
685
|
+
static vesselTagFactor(e, t, n, i = 0) {
|
|
686
|
+
i = i > 6 ? i - 0.9 * (i - 6) : i;
|
|
687
687
|
let o;
|
|
688
|
-
return n === "container" ? o = 0.7 *
|
|
688
|
+
return n === "container" ? o = 0.7 * i + Math.pow(i, 6.5) / (22 * Math.pow(e, 2 / 3)) : t === "Ballast" ? o = 0.7 * i + Math.pow(i, 6.5) / (2.7 * Math.pow(e, 2 / 3)) : o = 0.5 * i + Math.pow(i, 6.5) / (2.7 * Math.pow(e, 2 / 3)), o;
|
|
689
689
|
}
|
|
690
690
|
/**
|
|
691
691
|
* 浪高影响因子
|
|
@@ -705,11 +705,11 @@ class A {
|
|
|
705
705
|
* @param bearing 方位角
|
|
706
706
|
* @private
|
|
707
707
|
*/
|
|
708
|
-
static assembleProperties(e, t, n,
|
|
708
|
+
static assembleProperties(e, t, n, i) {
|
|
709
709
|
var l;
|
|
710
|
-
const o = e.lbp ?? e.length ?? e.lengthOverall ?? 198.9642, a = e.draught ?? 8, s = e.breadthMoulded ?? e.breadth ?? e.breadthExtreme ?? 32.4572, d = e.deadweight ?? 67035.7773,
|
|
710
|
+
const o = e.lbp ?? e.length ?? e.lengthOverall ?? 198.9642, a = e.draught ?? 8, s = e.breadthMoulded ?? e.breadth ?? e.breadthExtreme ?? 32.4572, d = e.deadweight ?? 67035.7773, c = ((l = e == null ? void 0 : e.type) == null ? void 0 : l.toLowerCase()) || "common";
|
|
711
711
|
return {
|
|
712
|
-
tag:
|
|
712
|
+
tag: c.indexOf("container") > -1 ? "container" : c.indexOf("tugs") > -1 ? "tugs" : "common",
|
|
713
713
|
lbp: o,
|
|
714
714
|
loadCondition: t,
|
|
715
715
|
draught: a,
|
|
@@ -719,7 +719,7 @@ class A {
|
|
|
719
719
|
displacement: Math.round((d / 1.025 + a * s * o * 0.7) * 1e4) / 1e4,
|
|
720
720
|
// 换算为m/s
|
|
721
721
|
speed: Math.round((n ?? 14.1382) * 1852 / 3600 * 1e4) / 1e4,
|
|
722
|
-
bearing:
|
|
722
|
+
bearing: i || 90
|
|
723
723
|
};
|
|
724
724
|
}
|
|
725
725
|
/**
|
|
@@ -732,37 +732,37 @@ class A {
|
|
|
732
732
|
* @param useMeteo true 启用气象分析
|
|
733
733
|
* @param useRouteParam true 启用设置速度
|
|
734
734
|
*/
|
|
735
|
-
static async speedLoseAt(e, t, n,
|
|
736
|
-
let
|
|
737
|
-
if (t.velocity && s && (e.speed =
|
|
735
|
+
static async speedLoseAt(e, t, n, i = "", o = 2, a = !0, s = !1, d = {}) {
|
|
736
|
+
let c;
|
|
737
|
+
if (t.velocity && s && (e.speed = J.roundPrecision(t.velocity * 1852 / 3600, 6)), a) {
|
|
738
738
|
let u;
|
|
739
739
|
if (d.meteo2)
|
|
740
740
|
try {
|
|
741
|
-
const f = await
|
|
742
|
-
u =
|
|
741
|
+
const f = await yt.spotForecast(t.lat, t.lng, n.utc().format(), !1, !1, !0, d), [x] = ct.pickHourly(f, n);
|
|
742
|
+
u = ct.toLegacy(x);
|
|
743
743
|
} catch (f) {
|
|
744
|
-
|
|
744
|
+
I.warn("[%s] meteo2 spot(%j) forecast failed: %s", d.requestId, { ...t, eta: n.utc().format() }, f);
|
|
745
745
|
}
|
|
746
746
|
else
|
|
747
|
-
u = await
|
|
748
|
-
const m =
|
|
749
|
-
|
|
747
|
+
u = await lt.queryPointFactor(t.lng, t.lat, n.valueOf(), "wind,wave,current,watertemp", i, d);
|
|
748
|
+
const m = O.weatherFactor(e, u), l = O.currentFactor(e.bearing, u == null ? void 0 : u.current, o), y = Math.round((e.speed * 1.943844 + m + l) * 100) / 100;
|
|
749
|
+
c = {
|
|
750
750
|
meteo: { ...u },
|
|
751
751
|
wxFactor: m,
|
|
752
752
|
cFactor: l,
|
|
753
753
|
speed: t.velocity && s ? t.velocity : y < 0 ? 1 : y,
|
|
754
|
-
eta: n.utc().format(
|
|
755
|
-
etd: n.utc().format(
|
|
754
|
+
eta: n.utc().format(),
|
|
755
|
+
etd: n.utc().format()
|
|
756
756
|
};
|
|
757
757
|
} else
|
|
758
|
-
|
|
758
|
+
c = {
|
|
759
759
|
wxFactor: 0,
|
|
760
760
|
cFactor: 0,
|
|
761
761
|
speed: t.velocity && s ? t.velocity : Math.round((e.speed * 1.943844 + 0 + 0) * 100) / 100,
|
|
762
|
-
eta: n.utc().format(
|
|
763
|
-
etd: n.utc().format(
|
|
762
|
+
eta: n.utc().format(),
|
|
763
|
+
etd: n.utc().format()
|
|
764
764
|
};
|
|
765
|
-
return delete t.meteo, delete t.wxFactor, delete t.cFactor, delete t.speed, delete t.etd, { ...
|
|
765
|
+
return delete t.meteo, delete t.wxFactor, delete t.cFactor, delete t.speed, delete t.etd, { ...c, ...t };
|
|
766
766
|
}
|
|
767
767
|
/**
|
|
768
768
|
* 基于步长计算失速样本
|
|
@@ -777,53 +777,53 @@ class A {
|
|
|
777
777
|
* @param useRouteParam true 启用航线上设置的参数 { suspend: 停留时长(小时), velocity: 速度(kts)}
|
|
778
778
|
* @private
|
|
779
779
|
*/
|
|
780
|
-
static async speedLoseInHoursStep(e, t, n,
|
|
780
|
+
static async speedLoseInHoursStep(e, t, n, i, o, a, s = "", d = !0, c = !1, u = {}) {
|
|
781
781
|
t.utc();
|
|
782
782
|
const m = t.clone().add(14, "days"), l = [], y = [];
|
|
783
|
-
let f = 0,
|
|
783
|
+
let f = 0, x = 0, F, w;
|
|
784
784
|
for (let v = 0; v < a.length - 1; v++) {
|
|
785
|
-
let
|
|
786
|
-
|
|
787
|
-
const
|
|
788
|
-
if (e.bearing =
|
|
789
|
-
|
|
790
|
-
const
|
|
791
|
-
if (
|
|
792
|
-
|
|
785
|
+
let r = a[v];
|
|
786
|
+
r.distanceFromStart = Math.round((o + x) * 1e4) / 1e4;
|
|
787
|
+
const p = a[v + 1];
|
|
788
|
+
if (e.bearing = W.calculateBearing(r, p, !p.gcToPrevious), r.bearing = e.bearing, r.suspend && c) {
|
|
789
|
+
r.eta = r.eta || t.utc().format(), r.elapsed = r.elapsed ?? 0;
|
|
790
|
+
const S = r.suspend - r.elapsed;
|
|
791
|
+
if (i - f > S)
|
|
792
|
+
i = i - f - S, t.add(S, "hour"), r.elapsed = r.suspend;
|
|
793
793
|
else {
|
|
794
|
-
const
|
|
795
|
-
|
|
794
|
+
const k = i - f;
|
|
795
|
+
r.elapsed += k, t.add(k, "hour"), i = 0;
|
|
796
796
|
}
|
|
797
|
-
if (
|
|
798
|
-
return
|
|
797
|
+
if (I == null || I.info(`[%s] suspend ${r.elapsed} hours at %j, and remain ${i} hours need to go...`, u.requestId, r), i === 0)
|
|
798
|
+
return r.distanceFromPrevious = x, { etd: t, from: w || r, to: r, next: a.filter((k) => k), wps: l, days: y };
|
|
799
799
|
} else
|
|
800
|
-
|
|
801
|
-
d = t.isAfter(m) ? !1 : d,
|
|
802
|
-
const
|
|
803
|
-
let
|
|
804
|
-
if (f +
|
|
805
|
-
if (f +=
|
|
806
|
-
`[%s] go to %j from %j with ${
|
|
800
|
+
r.suspend = 0;
|
|
801
|
+
d = t.isAfter(m) ? !1 : d, r = await O.speedLoseAt(e, r, t, s, 0, d, c, u), w = w || r, r.important && l.push(r), t.isSameOrAfter(n) && (y.push(r), n.add(24, "hour"));
|
|
802
|
+
const M = W.calculateDistance(r, p, !p.gcToPrevious);
|
|
803
|
+
let h = Math.round(M / w.speed * 1e5) / 1e5;
|
|
804
|
+
if (f + h < i) {
|
|
805
|
+
if (f += h, t.add(h, "hour"), delete a[v], I == null || I.debug(
|
|
806
|
+
`[%s] go to %j from %j with ${M}nm, and cost ${h} hours`,
|
|
807
807
|
u.requestId,
|
|
808
|
-
{ lat:
|
|
809
|
-
{ lat:
|
|
810
|
-
),
|
|
811
|
-
|
|
808
|
+
{ lat: p.lat, lng: p.lng },
|
|
809
|
+
{ lat: w.lat, lng: w.lng, etd: w.etd }
|
|
810
|
+
), x += M, a.filter((S) => S).length <= 1) {
|
|
811
|
+
F = p, F.eta = t.utc().format(), F.distanceFromPrevious = M, F.distanceFromStart = Math.round((o + x) * 1e4) / 1e4, l.push(F), delete a[v + 1];
|
|
812
812
|
break;
|
|
813
813
|
}
|
|
814
814
|
} else {
|
|
815
|
-
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
-
`[%s] go to %j from %j with ${
|
|
815
|
+
h = i - f, t.add(h, "hour");
|
|
816
|
+
const S = J.roundPrecision(w.speed * h, 5);
|
|
817
|
+
F = W.calculateCoordinate(r, e.bearing, S, "nauticalmiles", !p.gcToPrevious), F.eta = t.utc().format(), a[v] = F, I == null || I.debug(
|
|
818
|
+
`[%s] go to %j from %j with ${S}nm, and cost ${h} hours`,
|
|
819
819
|
u.requestId,
|
|
820
|
-
{ lat:
|
|
821
|
-
{ lat:
|
|
822
|
-
),
|
|
820
|
+
{ lat: F.lat, lng: F.lng },
|
|
821
|
+
{ lat: r.lat, lng: r.lng, etd: r.etd }
|
|
822
|
+
), x += S, F.distanceFromPrevious = Math.round(x * 1e4) / 1e4, F.distanceFromStart = Math.round((o + x) * 1e4) / 1e4;
|
|
823
823
|
break;
|
|
824
824
|
}
|
|
825
825
|
}
|
|
826
|
-
return { etd: t, from:
|
|
826
|
+
return { etd: t, from: w, to: F, next: a.filter((v) => v), wps: l, days: y };
|
|
827
827
|
}
|
|
828
828
|
/**
|
|
829
829
|
* 洋流影响因子
|
|
@@ -832,10 +832,10 @@ class A {
|
|
|
832
832
|
* @param role 1: 船东, 2: 租家, 0: 未知
|
|
833
833
|
*/
|
|
834
834
|
static currentFactor(e, t, n = 0) {
|
|
835
|
-
const
|
|
836
|
-
if (Math.abs(
|
|
835
|
+
const i = (e - (t == null ? void 0 : t.degree) || 0) / 180 * Math.PI;
|
|
836
|
+
if (Math.abs(i) === Math.PI / 2)
|
|
837
837
|
return 0;
|
|
838
|
-
let o = ((t == null ? void 0 : t.kts) || 0) * Math.cos(
|
|
838
|
+
let o = ((t == null ? void 0 : t.kts) || 0) * Math.cos(i);
|
|
839
839
|
return n & 2 ? o = Math.ceil(o * 100) / 100 : n & 1 ? o = Math.floor(o * 100) / 100 : o = Math.round(o * 100) / 100, Math.abs(o) > 5 ? 0 : o;
|
|
840
840
|
}
|
|
841
841
|
/**
|
|
@@ -844,16 +844,16 @@ class A {
|
|
|
844
844
|
* @param wwc 气象要素
|
|
845
845
|
*/
|
|
846
846
|
static weatherFactor(e, t) {
|
|
847
|
-
var m, l, y, f,
|
|
848
|
-
|
|
849
|
-
const n =
|
|
847
|
+
var m, l, y, f, x, F, w;
|
|
848
|
+
I == null || I.debug("calculate weather factor via: %j", { ...e, ...t });
|
|
849
|
+
const n = O.blockCoefficient(e.displacement, e.lbp, e.breadthMoulded, e.draught), i = O.froudeNumber(e.speed, e.lbp), o = O.amendFactor(n, i, e.loadCondition);
|
|
850
850
|
let a = Math.abs(e.bearing % 360 - (((m = t == null ? void 0 : t.wind) == null ? void 0 : m.degree) % 360 || 0));
|
|
851
851
|
a = a > 180 ? 360 - a : a;
|
|
852
|
-
const s =
|
|
853
|
-
let
|
|
854
|
-
|
|
855
|
-
const u =
|
|
856
|
-
return
|
|
852
|
+
const s = O.directionFactor(a, (l = t == null ? void 0 : t.wind) == null ? void 0 : l.scale), d = O.vesselTagFactor(e.displacement, e.loadCondition, e.tag, (y = t == null ? void 0 : t.wind) == null ? void 0 : y.scale);
|
|
853
|
+
let c = s * o * d / 100 * e.speed;
|
|
854
|
+
c = Math.round(c * 1.943844 * 1e4) / 1e4 * -1, e.tag === "tugs" && Math.abs(c) > 1 && (c = c / (Math.abs(Math.round(c)) + 1)), I == null || I.debug("wind wx factor = %d", c), a = Math.abs(e.bearing % 360 - (((x = (f = t == null ? void 0 : t.wave) == null ? void 0 : f.sig) == null ? void 0 : x.degree) % 360 || 0));
|
|
855
|
+
const u = O.waveHeightFactor(((w = (F = t == null ? void 0 : t.wave) == null ? void 0 : F.sig) == null ? void 0 : w.height) ?? 1, a);
|
|
856
|
+
return I == null || I.debug("wave wx factor = %d", u), c = c * 0.4 + u, I == null || I.debug("weather factor = %d", c), c = Math.abs(c) > 4 ? 4 * (Math.abs(c) / c) + Math.abs(c) / c * (Math.abs(c) - 4) * 0.1 : c, Math.round((c || 0) * 100) / 100;
|
|
857
857
|
}
|
|
858
858
|
/**
|
|
859
859
|
* 全程失速分析(走完航程)
|
|
@@ -867,74 +867,75 @@ class A {
|
|
|
867
867
|
* @param useMeteo true 启用气象分析
|
|
868
868
|
* @param useRouteParam
|
|
869
869
|
*/
|
|
870
|
-
static async analyseInstant(e, t, n,
|
|
871
|
-
var
|
|
872
|
-
const m =
|
|
873
|
-
e.lng =
|
|
874
|
-
const { route: l, waypoints: y } = o.points, f =
|
|
875
|
-
if (((
|
|
870
|
+
static async analyseInstant(e, t, n, i, o, a = "", s = 0, d = !0, c = !1, u = {}) {
|
|
871
|
+
var z, U, Q, X, Z;
|
|
872
|
+
const m = b().valueOf();
|
|
873
|
+
e.lng = J.convertToStdLng(e.lng);
|
|
874
|
+
const { route: l, waypoints: y } = o.points, f = W.calculateSubRoute(e, l);
|
|
875
|
+
if (((z = f[0]) == null ? void 0 : z.length) <= 1)
|
|
876
876
|
return;
|
|
877
|
-
const { v0:
|
|
877
|
+
const { v0: x, label: F } = e.sog ? {
|
|
878
878
|
v0: e.sog,
|
|
879
879
|
label: "Other"
|
|
880
880
|
/* Instruct */
|
|
881
881
|
} : {
|
|
882
|
-
v0:
|
|
882
|
+
v0: i.speed,
|
|
883
883
|
label: "CP"
|
|
884
884
|
/* Cp */
|
|
885
|
-
},
|
|
886
|
-
v.forEach((
|
|
887
|
-
const
|
|
885
|
+
}, w = O.assembleProperties(n, i.loadCondition, x, 0), v = y.length ? W.calculateSubWaypoints(e, y) : [];
|
|
886
|
+
v.forEach((H) => H.important = !0);
|
|
887
|
+
const r = {
|
|
888
888
|
from: { ...e },
|
|
889
889
|
route: f,
|
|
890
890
|
waypoints: v,
|
|
891
|
-
v0:
|
|
892
|
-
label:
|
|
893
|
-
},
|
|
891
|
+
v0: x,
|
|
892
|
+
label: F
|
|
893
|
+
}, p = {
|
|
894
894
|
hours: [],
|
|
895
895
|
days: [],
|
|
896
896
|
wps: []
|
|
897
897
|
};
|
|
898
|
-
s || (
|
|
899
|
-
let
|
|
900
|
-
t =
|
|
901
|
-
const
|
|
902
|
-
for (;
|
|
903
|
-
const
|
|
904
|
-
|
|
898
|
+
s || (W.calculateRouteDistance(f) / i.speed <= 72 ? s = 3 : s = 6);
|
|
899
|
+
let M = W.simplifyRouteToCoordinates(f, v, 0), h = 0, S = 0, k = 0, P = 0;
|
|
900
|
+
t = b(t).utc();
|
|
901
|
+
const Y = t.clone();
|
|
902
|
+
for (; M.length > 0; ) {
|
|
903
|
+
const H = s - t.hour() % s, _ = Math.ceil(t.clone().add(H, "h").set({ minute: 0, second: 0, millisecond: 0 }).diff(t, "h", !0) * 1e4) / 1e4, T = await O.speedLoseInHoursStep(
|
|
904
|
+
w,
|
|
905
905
|
t,
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
906
|
+
Y,
|
|
907
|
+
_,
|
|
908
|
+
h,
|
|
909
|
+
M,
|
|
910
910
|
a,
|
|
911
911
|
d,
|
|
912
|
-
|
|
912
|
+
c,
|
|
913
913
|
u
|
|
914
914
|
);
|
|
915
|
-
(
|
|
915
|
+
(U = T.from) != null && U.speed && (p.hours.push(T.from), p.wps.push(...T.wps), p.days.push(...T.days)), M = T == null ? void 0 : T.next, M.length || p.hours.push(T == null ? void 0 : T.to), h += Math.round((((Q = T == null ? void 0 : T.to) == null ? void 0 : Q.distanceFromPrevious) ?? 0) * 1e4) / 1e4;
|
|
916
916
|
}
|
|
917
|
-
const
|
|
918
|
-
for (let
|
|
919
|
-
const
|
|
920
|
-
|
|
917
|
+
const E = p.hours;
|
|
918
|
+
for (let H = 0; H < E.length - 1; H++) {
|
|
919
|
+
const _ = b(E[H + 1].eta).diff(E[H].etd, "hour", !0) || 1;
|
|
920
|
+
S += (E[H].wxFactor || 0) * _, k += (E[H].cFactor || 0) * _, P += _;
|
|
921
921
|
}
|
|
922
|
-
(
|
|
923
|
-
if (
|
|
924
|
-
const
|
|
925
|
-
|
|
926
|
-
N.avgSpd = H.speed;
|
|
927
|
-
else {
|
|
928
|
-
N.avgSpd = Math.round(et / z * 100) / 100;
|
|
929
|
-
const U = Math.round((H.speed + N.speed) / 2 * 100) / 100;
|
|
930
|
-
N.avgSpd = N.avgSpd > U ? U : N.avgSpd;
|
|
931
|
-
}
|
|
922
|
+
(X = p.wps) == null || X.forEach((H, _) => {
|
|
923
|
+
if (H.positionTime = b.utc(H.etd || H.eta).unix(), _) {
|
|
924
|
+
const T = p.wps[_ - 1], L = H.distanceFromStart - T.distanceFromStart, q = b(H.eta).diff(b(T.etd), "h", !0);
|
|
925
|
+
q < 0.5 ? H.avgSpd = T.speed : H.avgSpd = Math.round(L / q * 100) / 100;
|
|
932
926
|
}
|
|
933
|
-
}),
|
|
934
|
-
const
|
|
935
|
-
|
|
936
|
-
const
|
|
937
|
-
|
|
927
|
+
}), r.sample = p;
|
|
928
|
+
const D = p.hours.at(0), N = p.hours.at(-1);
|
|
929
|
+
r.distance = Math.round(N.distanceFromStart * 1e4) / 1e4, r.etd = b(D.eta).utc().format(), r.eta = b(N.eta).utc().format(), r.wxFactor = Math.round(S / P * 1e4) / 1e4, r.cFactor = Math.round(k / P * 1e4) / 1e4, r.avgSpeed = Math.round(N.distanceFromStart / P * 1e4) / 1e4, r.totalHrs = Math.round(P * 1e4) / 1e4;
|
|
930
|
+
const { distanceInECA: j, hoursInECA: A, totalDgoConsInECA: R, eca: K } = await this.calculateECA(r, i, u), et = J.roundPrecision(i.fo / 24 * (P - A), 3), st = J.roundPrecision(i.dgo / 24 * P, 3);
|
|
931
|
+
r.extend = {
|
|
932
|
+
eca: K,
|
|
933
|
+
distanceInECA: j,
|
|
934
|
+
hoursInECA: A,
|
|
935
|
+
totalDgoConsInECA: R
|
|
936
|
+
}, r.totalFoCons = et, r.totalDgoCons = st;
|
|
937
|
+
const $ = b().valueOf() - m, at = ((Z = p == null ? void 0 : p.hours) == null ? void 0 : Z.length) || 1;
|
|
938
|
+
return I == null || I.info("[%s] each hour-sample speed analyse cost: (%d / %d = %d) ms", u == null ? void 0 : u.requestId, $, at, Math.round($ / at * 1e3) / 1e3), r;
|
|
938
939
|
}
|
|
939
940
|
/**
|
|
940
941
|
* 分段失速分析(最多走hours 小时)
|
|
@@ -949,11 +950,11 @@ class A {
|
|
|
949
950
|
* @param useMeteo true 启用气象分析
|
|
950
951
|
* @param useRouteParam
|
|
951
952
|
*/
|
|
952
|
-
static async analyseInstantWithThreshed(e, t, n,
|
|
953
|
-
var
|
|
954
|
-
const y =
|
|
955
|
-
e.lng =
|
|
956
|
-
const { v0: f, label:
|
|
953
|
+
static async analyseInstantWithThreshed(e, t, n, i, o, a, s, d = "", c = 3, u = !0, m = !1, l = {}) {
|
|
954
|
+
var Q, X, Z, H, _;
|
|
955
|
+
const y = b().valueOf();
|
|
956
|
+
e.lng = J.convertToStdLng(e.lng);
|
|
957
|
+
const { v0: f, label: x } = e.sog ? {
|
|
957
958
|
v0: e.sog,
|
|
958
959
|
label: "Other"
|
|
959
960
|
/* Instruct */
|
|
@@ -961,52 +962,63 @@ class A {
|
|
|
961
962
|
v0: o.speed,
|
|
962
963
|
label: "CP"
|
|
963
964
|
/* Cp */
|
|
964
|
-
},
|
|
965
|
-
if (((
|
|
965
|
+
}, F = O.assembleProperties(i, o.loadCondition, f, 0), w = W.calculateSubRoute(e, a);
|
|
966
|
+
if (((Q = w[0]) == null ? void 0 : Q.length) <= 1)
|
|
966
967
|
return;
|
|
967
|
-
const v = s.length ?
|
|
968
|
-
v.forEach((
|
|
969
|
-
let
|
|
970
|
-
const
|
|
968
|
+
const v = s.length ? W.calculateSubWaypoints(e, s) : [];
|
|
969
|
+
v.forEach((T) => T.important = !0);
|
|
970
|
+
let r = W.simplifyRouteToCoordinates(w, v, 0), p = 0, M = 0, h = 0, S = 0;
|
|
971
|
+
const k = {
|
|
971
972
|
hours: [],
|
|
972
973
|
wps: [],
|
|
973
974
|
days: []
|
|
974
975
|
};
|
|
975
|
-
t =
|
|
976
|
-
const
|
|
977
|
-
for (;
|
|
978
|
-
const
|
|
979
|
-
let
|
|
980
|
-
|
|
981
|
-
const
|
|
982
|
-
if ((
|
|
976
|
+
t = b(t).utc();
|
|
977
|
+
const P = t.clone();
|
|
978
|
+
for (; r.length > 0; ) {
|
|
979
|
+
const T = c - t.hour() % c;
|
|
980
|
+
let L = Math.ceil(t.clone().add(T, "h").set({ minute: 0, second: 0, millisecond: 0 }).diff(t, "h", !0) * 1e4) / 1e4;
|
|
981
|
+
L = t.clone().add(L, "h").isSameOrAfter(n) ? n.diff(t, "h", !0) * 1e4 / 1e4 : L;
|
|
982
|
+
const q = await O.speedLoseInHoursStep(F, t, P, L, p, r, d, u, m, l);
|
|
983
|
+
if ((X = q.from) != null && X.speed && (k.hours.push(q.from), q != null && q.wps && k.wps.push(...q.wps), k.days.push(...q.days)), r = q == null ? void 0 : q.next, r.length || k.hours.push(q == null ? void 0 : q.to), p += Math.round((((Z = q == null ? void 0 : q.to) == null ? void 0 : Z.distanceFromPrevious) ?? 0) * 1e4) / 1e4, !L)
|
|
983
984
|
break;
|
|
984
985
|
}
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
986
|
+
(H = k.wps) == null || H.forEach((T, L) => {
|
|
987
|
+
if (L) {
|
|
988
|
+
const q = k.wps[L - 1], rt = T.distanceFromStart - q.distanceFromStart, it = b(T.eta).diff(b(q.etd), "h", !0);
|
|
989
|
+
it < 0.5 ? T.avgSpd = q.speed : T.avgSpd = Math.round(rt / it * 100) / 100;
|
|
990
|
+
}
|
|
991
|
+
});
|
|
992
|
+
const Y = k.hours;
|
|
993
|
+
for (let T = 0; T < Y.length - 1; T++) {
|
|
994
|
+
const L = b(Y[T + 1].eta).diff(Y[T].etd, "hour", !0);
|
|
995
|
+
M += Y[T].wxFactor * L, h += Y[T].cFactor * L, S += L;
|
|
989
996
|
}
|
|
990
|
-
const
|
|
991
|
-
sample:
|
|
992
|
-
distance: Math.round(((
|
|
997
|
+
const E = k.hours.at(0), D = k.hours.at(-1), N = await W.calculateRangeRoute(E, D, w), j = await W.calculateRangeWaypoints(E, D, w, v), A = {
|
|
998
|
+
sample: k,
|
|
999
|
+
distance: Math.round(((D == null ? void 0 : D.distanceFromStart) || 0) * 1e4) / 1e4,
|
|
993
1000
|
// 注意,可能会在first节点Drift,所有采用eta做为初始出发时间
|
|
994
|
-
etd:
|
|
995
|
-
eta:
|
|
996
|
-
wxFactor: Math.round(
|
|
997
|
-
cFactor: Math.round(
|
|
998
|
-
avgSpeed: Math.round(((
|
|
999
|
-
totalHrs: Math.round(
|
|
1000
|
-
from:
|
|
1001
|
-
to:
|
|
1002
|
-
route:
|
|
1003
|
-
waypoints:
|
|
1001
|
+
etd: b(E.eta).utc().format(),
|
|
1002
|
+
eta: b(D == null ? void 0 : D.eta).utc().format(),
|
|
1003
|
+
wxFactor: Math.round(M / S * 1e4) / 1e4,
|
|
1004
|
+
cFactor: Math.round(h / S * 1e4) / 1e4,
|
|
1005
|
+
avgSpeed: Math.round(((D == null ? void 0 : D.distanceFromStart) || 0) / S * 1e4) / 1e4,
|
|
1006
|
+
totalHrs: Math.round(S * 1e4) / 1e4,
|
|
1007
|
+
from: E,
|
|
1008
|
+
to: D,
|
|
1009
|
+
route: N,
|
|
1010
|
+
waypoints: j,
|
|
1004
1011
|
v0: f,
|
|
1005
|
-
label:
|
|
1006
|
-
}, { distanceInECA:
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1012
|
+
label: x
|
|
1013
|
+
}, { distanceInECA: R, hoursInECA: K, totalDgoConsInECA: et, eca: st } = await this.calculateECA(A, o, l), nt = J.roundPrecision(o.fo / 24 * (S - K), 3), $ = J.roundPrecision(o.dgo / 24 * S, 3);
|
|
1014
|
+
A.extend = {
|
|
1015
|
+
eca: st,
|
|
1016
|
+
distanceInECA: R,
|
|
1017
|
+
hoursInECA: K,
|
|
1018
|
+
totalDgoConsInECA: et
|
|
1019
|
+
}, A.totalDgoCons = $, A.totalFoCons = nt;
|
|
1020
|
+
const z = b().valueOf() - y, U = ((_ = k == null ? void 0 : k.hours) == null ? void 0 : _.length) || 1;
|
|
1021
|
+
return I == null || I.debug("[%s] each hour-sample speed analyse cost: (%d / %d = %d) ms", l == null ? void 0 : l.requestId, z, U, Math.round(z / U * 1e3) / 1e3), A;
|
|
1010
1022
|
}
|
|
1011
1023
|
/**
|
|
1012
1024
|
* 在指定航线条件下,基于多CP,动态计算最优成本(租金+油费)方案
|
|
@@ -1023,57 +1035,57 @@ class A {
|
|
|
1023
1035
|
* @param lane 基础航线(重要转向点)
|
|
1024
1036
|
* @param options
|
|
1025
1037
|
*/
|
|
1026
|
-
static async analyseCost(e, t, n,
|
|
1027
|
-
var
|
|
1028
|
-
const a =
|
|
1038
|
+
static async analyseCost(e, t, n, i, o = {}) {
|
|
1039
|
+
var w, v;
|
|
1040
|
+
const a = b().valueOf(), s = [];
|
|
1029
1041
|
o.meteo2 = o.meteo2 || !0, e.speedStep = e.speedStep || 3, e.alterStep = e.alterStep ?? 1;
|
|
1030
|
-
const d =
|
|
1031
|
-
let
|
|
1032
|
-
n.forEach((
|
|
1033
|
-
const
|
|
1034
|
-
|
|
1035
|
-
}),
|
|
1036
|
-
const u =
|
|
1042
|
+
const d = W.calculateRouteDistance(i.route);
|
|
1043
|
+
let c = 0;
|
|
1044
|
+
n.forEach((r) => {
|
|
1045
|
+
const p = Math.ceil(d / r.speed / 24);
|
|
1046
|
+
c = c < p ? p : c;
|
|
1047
|
+
}), c = c * 1.3;
|
|
1048
|
+
const u = b.utc(e.etd).add(c ?? 14, "day");
|
|
1037
1049
|
let m = 1;
|
|
1038
|
-
for (const
|
|
1039
|
-
const
|
|
1050
|
+
for (const r of n) {
|
|
1051
|
+
const p = JSON.parse(JSON.stringify(i.route)), M = JSON.parse(JSON.stringify(i.waypoints)), h = await O.analyseInstantWithThreshed(
|
|
1040
1052
|
{ lat: e.lat, lng: e.lng },
|
|
1041
1053
|
e.etd,
|
|
1042
1054
|
u,
|
|
1043
1055
|
t,
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1056
|
+
r,
|
|
1057
|
+
p,
|
|
1058
|
+
M,
|
|
1047
1059
|
e.meteoVendor,
|
|
1048
1060
|
e.speedStep,
|
|
1049
1061
|
e.useMeteo,
|
|
1050
1062
|
e.useRouteParam,
|
|
1051
1063
|
o
|
|
1052
1064
|
);
|
|
1053
|
-
|
|
1054
|
-
cost:
|
|
1055
|
-
distance:
|
|
1056
|
-
hours:
|
|
1057
|
-
cp: `${
|
|
1065
|
+
h && (await O.calculateCost(h, r, e, o), s.push(h), I == null || I.info("[%s][L%d-%d] analyse from %s to %s cost: %j", o.requestId, 1, m, e.etd, u.format(), {
|
|
1066
|
+
cost: h.cost.total,
|
|
1067
|
+
distance: h.distance,
|
|
1068
|
+
hours: h.totalHrs,
|
|
1069
|
+
cp: `${r.speed}/${r.fo}/${r.dgo}`
|
|
1058
1070
|
})), m++;
|
|
1059
1071
|
}
|
|
1060
|
-
s.sort((
|
|
1072
|
+
s.sort((r, p) => r.cost.total - p.cost.total);
|
|
1061
1073
|
const l = s.at(0), y = s.at(1), f = [];
|
|
1062
|
-
if (f.push({ combined: !1, speeds: [l], cost: (
|
|
1063
|
-
const
|
|
1064
|
-
let
|
|
1065
|
-
|
|
1066
|
-
let
|
|
1067
|
-
for (;
|
|
1068
|
-
const
|
|
1069
|
-
if (
|
|
1074
|
+
if (f.push({ combined: !1, speeds: [l], cost: (w = l.cost) == null ? void 0 : w.total }), y) {
|
|
1075
|
+
const r = l.cost.cp, p = y.cost.cp, M = b(l.eta), h = b(l.etd), S = M.diff(h, "days", !0);
|
|
1076
|
+
let k = Math.ceil(S / 2);
|
|
1077
|
+
k = k > 7 ? 7 : k < e.alterStep ? e.alterStep : k;
|
|
1078
|
+
let P = 2, Y = { combined: !1, speeds: [y], cost: (v = y.cost) == null ? void 0 : v.total }, E;
|
|
1079
|
+
for (; k >= e.alterStep; ) {
|
|
1080
|
+
const D = await O.combinedAnalyse(e, t, u, [r, p], i, k, { ...o, level: P });
|
|
1081
|
+
if (Y.cost > D.cost ? E ? (E == null ? void 0 : E.cost) > D.cost && (E = D) : (E = Y, Y = D) : (!E || (E == null ? void 0 : E.cost) > D.cost) && (E = D), k <= e.alterStep)
|
|
1070
1082
|
break;
|
|
1071
|
-
|
|
1083
|
+
k = Math.ceil(k / 2), P += 1;
|
|
1072
1084
|
}
|
|
1073
|
-
f.push(
|
|
1085
|
+
f.push(Y), E && f.push(E);
|
|
1074
1086
|
}
|
|
1075
|
-
const
|
|
1076
|
-
return
|
|
1087
|
+
const F = b().valueOf() - a;
|
|
1088
|
+
return I == null || I.info("[%s] analyse elapsed: %d ms", o == null ? void 0 : o.requestId, F), f.sort((r, p) => r.cost - p.cost);
|
|
1077
1089
|
}
|
|
1078
1090
|
/**
|
|
1079
1091
|
* 按步长多次减半,分别用7,4,2,1天步长及cpa,cpb交替计算各种组合下的成本
|
|
@@ -1085,12 +1097,12 @@ class A {
|
|
|
1085
1097
|
* @param step 步长,7,4,2,1
|
|
1086
1098
|
* @param options
|
|
1087
1099
|
*/
|
|
1088
|
-
static async combinedAnalyse(e, t, n,
|
|
1089
|
-
s.counter = 1,
|
|
1090
|
-
const d = await
|
|
1091
|
-
|
|
1092
|
-
const u = await
|
|
1093
|
-
return
|
|
1100
|
+
static async combinedAnalyse(e, t, n, i, o, a, s = {}) {
|
|
1101
|
+
s.counter = 1, I == null || I.info("[%s][L%d] analyse with alternate cp in every %d days", s.requestId, s.level, a);
|
|
1102
|
+
const d = await O.alternateAnalyse(e, t, n, i, 0, o, a, s), c = d.reduce((l, y) => l + y.cost.total, 0);
|
|
1103
|
+
I == null || I.info("[%s][L%d] cost with cpa/cpb turn: %d", s.requestId, s.level, c);
|
|
1104
|
+
const u = await O.alternateAnalyse(e, t, n, i, 1, o, a, s), m = u.reduce((l, y) => l + y.cost.total, 0);
|
|
1105
|
+
return I == null || I.info("[%s][L%d] cost with cpb/cpa turn: %d", s.requestId, s.level, m), c < m ? { combined: !0, cost: Math.round(c * 1e3) / 1e3, speeds: d, step: a } : { combined: !0, cost: Math.round(m * 1e3) / 1e3, speeds: u, step: a };
|
|
1094
1106
|
}
|
|
1095
1107
|
/**
|
|
1096
1108
|
* 基于cp索引,交替计算指定步长下的成本
|
|
@@ -1103,37 +1115,37 @@ class A {
|
|
|
1103
1115
|
* @param step 步长,7,4,2,1
|
|
1104
1116
|
* @param options
|
|
1105
1117
|
*/
|
|
1106
|
-
static async alternateAnalyse(e, t, n,
|
|
1118
|
+
static async alternateAnalyse(e, t, n, i, o, a, s, d = {}) {
|
|
1107
1119
|
var l, y;
|
|
1108
|
-
let
|
|
1120
|
+
let c = b.utc(e.etd);
|
|
1109
1121
|
const u = { lat: e.lat, lng: e.lng }, m = [];
|
|
1110
|
-
for (;
|
|
1111
|
-
const f =
|
|
1122
|
+
for (; c.isBefore(n); ) {
|
|
1123
|
+
const f = c.clone().utc().add(s, "day"), x = JSON.parse(JSON.stringify(a.route)), F = JSON.parse(JSON.stringify(a.waypoints)), w = i[o], v = await O.analyseInstantWithThreshed(
|
|
1112
1124
|
u,
|
|
1113
|
-
|
|
1125
|
+
c.utc().format(),
|
|
1114
1126
|
f,
|
|
1115
1127
|
t,
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1128
|
+
w,
|
|
1129
|
+
x,
|
|
1130
|
+
F,
|
|
1119
1131
|
e.meteoVendor,
|
|
1120
1132
|
e.speedStep,
|
|
1121
1133
|
e.useMeteo,
|
|
1122
1134
|
e.useRouteParam,
|
|
1123
1135
|
d
|
|
1124
1136
|
);
|
|
1125
|
-
v && (await
|
|
1137
|
+
v && (await O.calculateCost(v, w, e, d), I == null || I.info(
|
|
1126
1138
|
"[%s][L%d-%d] analyse from %s to %s cost: %j",
|
|
1127
1139
|
d.requestId,
|
|
1128
1140
|
d.level,
|
|
1129
1141
|
d.counter,
|
|
1130
|
-
|
|
1142
|
+
c.utc().format(),
|
|
1131
1143
|
f.utc().format(),
|
|
1132
|
-
{ cost: v.cost.total, distance: v.distance, hours: v.totalHrs, cp: `${
|
|
1144
|
+
{ cost: v.cost.total, distance: v.distance, hours: v.totalHrs, cp: `${w.speed}/${w.fo}/${w.dgo}` }
|
|
1133
1145
|
)), d.counter = d.counter + 1;
|
|
1134
|
-
const
|
|
1135
|
-
if (
|
|
1136
|
-
u.lat =
|
|
1146
|
+
const r = (y = (l = v == null ? void 0 : v.sample) == null ? void 0 : l.hours) == null ? void 0 : y.at(-1);
|
|
1147
|
+
if (r)
|
|
1148
|
+
u.lat = r.lat, u.lng = r.lng, c = b(r.eta), m.push(v), o = o ? 0 : 1;
|
|
1137
1149
|
else
|
|
1138
1150
|
break;
|
|
1139
1151
|
}
|
|
@@ -1146,13 +1158,14 @@ class A {
|
|
|
1146
1158
|
* @param props
|
|
1147
1159
|
* @param options
|
|
1148
1160
|
*/
|
|
1149
|
-
static async calculateCost(e, t, n,
|
|
1161
|
+
static async calculateCost(e, t, n, i = {}) {
|
|
1162
|
+
var o;
|
|
1150
1163
|
if (e) {
|
|
1151
|
-
const
|
|
1164
|
+
const a = Math.round(e.totalHrs / 24 * (n.dailyHire || 0) * (1 - (n.addComm || 0)) * 1e3) / 1e3, s = Math.round(e.totalFoCons * (n.priceFO || 0) * 1e3) / 1e3, d = Math.round((e.totalDgoCons + (((o = e.extend) == null ? void 0 : o.totalDgoConsInECA) || 0)) * (n.priceDGO || 0) * 1e3) / 1e3;
|
|
1152
1165
|
e.cost = {
|
|
1153
|
-
total: Math.round((
|
|
1154
|
-
hire:
|
|
1155
|
-
bunker: Math.round((
|
|
1166
|
+
total: Math.round((a + s + d) * 1e3) / 1e3,
|
|
1167
|
+
hire: a,
|
|
1168
|
+
bunker: Math.round((s + d) * 1e3) / 1e3,
|
|
1156
1169
|
cp: t
|
|
1157
1170
|
};
|
|
1158
1171
|
}
|
|
@@ -1162,22 +1175,22 @@ class A {
|
|
|
1162
1175
|
* 计算单cp模式下的ECA属性
|
|
1163
1176
|
*/
|
|
1164
1177
|
static async calculateECA(e, t, n = {}) {
|
|
1165
|
-
var d,
|
|
1166
|
-
const
|
|
1178
|
+
var d, c;
|
|
1179
|
+
const i = await W.intersectInECA(e.route);
|
|
1167
1180
|
let o = 0, a = 0, s = 0;
|
|
1168
1181
|
e.sample.wps.forEach((u) => {
|
|
1169
|
-
u.positionTime =
|
|
1182
|
+
u.positionTime = b.utc(u.etd || u.eta).unix();
|
|
1170
1183
|
});
|
|
1171
|
-
for (const u of
|
|
1184
|
+
for (const u of i) {
|
|
1172
1185
|
o += u.distance;
|
|
1173
|
-
const m = await
|
|
1174
|
-
u.in = m, u.out = l, u.totalHrs =
|
|
1186
|
+
const m = await W.deadReckoningTime((d = u.waypoints) == null ? void 0 : d.at(0), e.sample.wps), l = await W.deadReckoningTime((c = u.waypoints) == null ? void 0 : c.at(-1), e.sample.wps);
|
|
1187
|
+
u.in = m, u.out = l, u.totalHrs = J.roundPrecision((l.positionTime - m.positionTime) / 3600, 2), u.totalDgoCons = J.roundPrecision(t.fo / 24 * u.totalHrs, 3), a += u.totalHrs, s += u.totalDgoCons;
|
|
1175
1188
|
}
|
|
1176
|
-
return o =
|
|
1189
|
+
return o = J.roundPrecision(o, 3), a = J.roundPrecision(a, 3), s = J.roundPrecision(s, 3), {
|
|
1177
1190
|
distanceInECA: o,
|
|
1178
1191
|
hoursInECA: a,
|
|
1179
1192
|
totalDgoConsInECA: s,
|
|
1180
|
-
eca:
|
|
1193
|
+
eca: i
|
|
1181
1194
|
};
|
|
1182
1195
|
}
|
|
1183
1196
|
/**
|
|
@@ -1186,34 +1199,48 @@ class A {
|
|
|
1186
1199
|
* @param options
|
|
1187
1200
|
*/
|
|
1188
1201
|
static async mergeSpeeds(e, t = {}) {
|
|
1189
|
-
var
|
|
1202
|
+
var r, p;
|
|
1190
1203
|
const n = {
|
|
1191
1204
|
hours: [],
|
|
1192
1205
|
wps: [],
|
|
1193
1206
|
days: []
|
|
1194
|
-
},
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
h.
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1207
|
+
}, i = e.reduce((M, h) => M + h.distance, 0), o = e.reduce((M, h) => {
|
|
1208
|
+
var S;
|
|
1209
|
+
return M + (((S = h.extend) == null ? void 0 : S.distanceInECA) || 0);
|
|
1210
|
+
}, 0), a = e.reduce((M, h) => M + h.totalHrs, 0), s = e.reduce((M, h) => {
|
|
1211
|
+
var S;
|
|
1212
|
+
return M + (((S = h.extend) == null ? void 0 : S.hoursInECA) || 0);
|
|
1213
|
+
}, 0), d = e.reduce((M, h) => {
|
|
1214
|
+
var S;
|
|
1215
|
+
return M + (((S = h.extend) == null ? void 0 : S.totalDgoConsInECA) || 0);
|
|
1216
|
+
}, 0), c = e.reduce((M, h) => M + h.wxFactor * h.totalHrs / a, 0), u = e.reduce((M, h) => M + h.cFactor * h.totalHrs / a, 0), m = e.reduce((M, h) => M + h.totalFoCons, 0), l = e.reduce((M, h) => M + h.totalDgoCons, 0), y = e.reduce((M, h) => M + h.cost.total, 0), f = e.reduce((M, h) => M + h.cost.hire, 0), x = e.reduce((M, h) => M + h.cost.bunker, 0), F = [], w = [];
|
|
1217
|
+
let v;
|
|
1218
|
+
for (const M of e) {
|
|
1219
|
+
w.push(...((r = M.extend) == null ? void 0 : r.eca) || []);
|
|
1220
|
+
const h = M.sample.hours, S = M.sample.wps, k = M.sample.days, P = h.at(0);
|
|
1221
|
+
v && (P.distanceFromPrevious = v.distanceFromPrevious, P.distanceFromStart = v.distanceFromStart, h.forEach((N, j) => {
|
|
1222
|
+
j && (N.distanceFromStart = N.distanceFromStart + v.distanceFromStart);
|
|
1223
|
+
}), S.at(0).distanceFromPrevious = v.distanceFromPrevious, S.at(0).distanceFromStart = v.distanceFromStart, S.forEach((N, j) => {
|
|
1224
|
+
j && (N.distanceFromStart = N.distanceFromStart + v.distanceFromStart);
|
|
1225
|
+
}), k.at(0).distanceFromPrevious = v.distanceFromPrevious, k.at(0).distanceFromStart = v.distanceFromStart, k.forEach((N, j) => {
|
|
1226
|
+
j && (N.distanceFromStart = N.distanceFromStart + v.distanceFromStart);
|
|
1227
|
+
})), P.cp = M.cost.cp;
|
|
1228
|
+
const Y = [M.etd, M.eta], E = F.findIndex((N) => N.id === P.cp.id);
|
|
1229
|
+
E === -1 ? (P.cp.segment = [Y], F.push(P.cp)) : F[E].segment.push(Y), h.forEach((N) => {
|
|
1230
|
+
var A;
|
|
1231
|
+
((A = n.hours) == null ? void 0 : A.findIndex((R) => R.eta === N.eta)) === -1 && n.hours.push(N);
|
|
1232
|
+
}), S.forEach((N) => {
|
|
1233
|
+
var A;
|
|
1234
|
+
((A = n.wps) == null ? void 0 : A.findIndex((R) => R.eta === N.eta)) === -1 && n.wps.push(N);
|
|
1235
|
+
}), k.forEach((N) => {
|
|
1236
|
+
var A;
|
|
1237
|
+
((A = n == null ? void 0 : n.days) == null ? void 0 : A.findIndex((R) => R.eta === N.eta)) === -1 && n.days.push(N);
|
|
1211
1238
|
});
|
|
1212
|
-
const
|
|
1213
|
-
|
|
1239
|
+
const D = (p = n.wps) == null ? void 0 : p.findIndex((N) => N.eta === P.eta);
|
|
1240
|
+
D === -1 ? n.wps.push(P) : n.wps[D] = P, v = h.at(-1);
|
|
1214
1241
|
}
|
|
1215
|
-
return n.wps.sort((
|
|
1216
|
-
|
|
1242
|
+
return n.wps.sort((M, h) => {
|
|
1243
|
+
b(M.etd).unix() - b(h.etd).unix();
|
|
1217
1244
|
}), {
|
|
1218
1245
|
sample: n,
|
|
1219
1246
|
etd: e.at(0).etd,
|
|
@@ -1222,37 +1249,40 @@ class A {
|
|
|
1222
1249
|
to: e.at(-1).to,
|
|
1223
1250
|
v0: e.at(0).v0,
|
|
1224
1251
|
label: "Combined",
|
|
1225
|
-
distance: Math.round(
|
|
1226
|
-
distanceInECA: Math.round(o * 1e4) / 1e4,
|
|
1252
|
+
distance: Math.round(i * 1e4) / 1e4,
|
|
1227
1253
|
totalHrs: Math.round(a * 1e3) / 1e3,
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
wxFactor: Math.round(r / a * 1e3) / 1e3,
|
|
1254
|
+
avgSpeed: Math.round(i / a * 1e3) / 1e3,
|
|
1255
|
+
wxFactor: Math.round(c / a * 1e3) / 1e3,
|
|
1231
1256
|
cFactor: Math.round(u / a * 1e3) / 1e3,
|
|
1232
1257
|
totalFoCons: Math.round(m * 1e3) / 1e3,
|
|
1233
1258
|
totalDgoCons: Math.round(l * 1e3) / 1e3,
|
|
1234
|
-
totalDgoConsInECA: Math.round(d * 1e3) / 1e3,
|
|
1235
1259
|
cost: {
|
|
1236
1260
|
total: Math.round(y * 1e3) / 1e3,
|
|
1237
1261
|
hire: Math.round(f * 1e3) / 1e3,
|
|
1238
|
-
bunker: Math.round(
|
|
1262
|
+
bunker: Math.round(x * 1e3) / 1e3
|
|
1239
1263
|
},
|
|
1240
|
-
|
|
1241
|
-
|
|
1264
|
+
extend: {
|
|
1265
|
+
cps: F,
|
|
1266
|
+
eca: w,
|
|
1267
|
+
distanceInECA: Math.round(o * 1e4) / 1e4,
|
|
1268
|
+
hoursInECA: Math.round(s * 1e3) / 1e3,
|
|
1269
|
+
totalDgoConsInECA: Math.round(d * 1e3) / 1e3,
|
|
1270
|
+
speeds: e
|
|
1271
|
+
}
|
|
1242
1272
|
};
|
|
1243
1273
|
}
|
|
1244
1274
|
}
|
|
1245
1275
|
export {
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1276
|
+
tt as AISImpl,
|
|
1277
|
+
mt as AlertHelper,
|
|
1278
|
+
ft as AlertLevel,
|
|
1279
|
+
Ct as HifleetImpl,
|
|
1280
|
+
gt as LoadCondition,
|
|
1281
|
+
Et as MyShipImpl,
|
|
1282
|
+
xt as MyVesselImpl,
|
|
1283
|
+
jt as ShipxyImpl,
|
|
1284
|
+
O as SpeedHelper,
|
|
1285
|
+
bt as SpeedLabel,
|
|
1286
|
+
Mt as VesselTag,
|
|
1287
|
+
Nt as alertHelper
|
|
1258
1288
|
};
|