@oicl/openbridge-webcomponents 2.0.0-next.105 → 2.0.0-next.106
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/bundle/openbridge-webcomponents.bundle.js +197 -100
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +46 -0
- package/dist/navigation-instruments/pitch-roll/pitch-roll.d.ts +26 -0
- package/dist/navigation-instruments/pitch-roll/pitch-roll.d.ts.map +1 -1
- package/dist/navigation-instruments/pitch-roll/pitch-roll.js +205 -102
- package/dist/navigation-instruments/pitch-roll/pitch-roll.js.map +1 -1
- package/package.json +1 -1
|
@@ -222792,6 +222792,7 @@ const MIN_ARC_HALF_DEG = 2;
|
|
|
222792
222792
|
let ObcPitchRoll = class extends i$4 {
|
|
222793
222793
|
constructor() {
|
|
222794
222794
|
super(...arguments);
|
|
222795
|
+
this.type = "dual-scale";
|
|
222795
222796
|
this.pitch = 0;
|
|
222796
222797
|
this.roll = 0;
|
|
222797
222798
|
this.minAvgPitch = 0;
|
|
@@ -222842,6 +222843,9 @@ let ObcPitchRoll = class extends i$4 {
|
|
|
222842
222843
|
get requestedRollArcAngle() {
|
|
222843
222844
|
return normalizeArcAngle(this.rollArcAngle ?? this.arcAngle, 30);
|
|
222844
222845
|
}
|
|
222846
|
+
get isSingleScale() {
|
|
222847
|
+
return this.type === "single-scale";
|
|
222848
|
+
}
|
|
222845
222849
|
render() {
|
|
222846
222850
|
const pitchReq = this.requestedPitchArcAngle;
|
|
222847
222851
|
const rollReq = this.requestedRollArcAngle;
|
|
@@ -222852,18 +222856,6 @@ let ObcPitchRoll = class extends i$4 {
|
|
|
222852
222856
|
roundOutsideCut: true,
|
|
222853
222857
|
roundInsideCut: true
|
|
222854
222858
|
},
|
|
222855
|
-
{
|
|
222856
|
-
startAngle: 270 - pitchReq,
|
|
222857
|
-
endAngle: 270 + pitchReq,
|
|
222858
|
-
roundOutsideCut: true,
|
|
222859
|
-
roundInsideCut: true
|
|
222860
|
-
},
|
|
222861
|
-
{
|
|
222862
|
-
startAngle: 360 - rollReq,
|
|
222863
|
-
endAngle: rollReq,
|
|
222864
|
-
roundOutsideCut: true,
|
|
222865
|
-
roundInsideCut: true
|
|
222866
|
-
},
|
|
222867
222859
|
{
|
|
222868
222860
|
startAngle: 180 - rollReq,
|
|
222869
222861
|
endAngle: 180 + rollReq,
|
|
@@ -222871,19 +222863,75 @@ let ObcPitchRoll = class extends i$4 {
|
|
|
222871
222863
|
roundInsideCut: true
|
|
222872
222864
|
}
|
|
222873
222865
|
];
|
|
222866
|
+
if (!this.isSingleScale) {
|
|
222867
|
+
areas.push(
|
|
222868
|
+
{
|
|
222869
|
+
startAngle: 270 - pitchReq,
|
|
222870
|
+
endAngle: 270 + pitchReq,
|
|
222871
|
+
roundOutsideCut: true,
|
|
222872
|
+
roundInsideCut: true
|
|
222873
|
+
},
|
|
222874
|
+
{
|
|
222875
|
+
startAngle: 360 - rollReq,
|
|
222876
|
+
endAngle: rollReq,
|
|
222877
|
+
roundOutsideCut: true,
|
|
222878
|
+
roundInsideCut: true
|
|
222879
|
+
}
|
|
222880
|
+
);
|
|
222881
|
+
}
|
|
222874
222882
|
const overlayViewBox = `-${CENTRE_HALF} -${CENTRE_HALF} ${CENTRE_HALF * 2} ${CENTRE_HALF * 2}`;
|
|
222875
222883
|
const vesselScale = 224 / 160;
|
|
222876
222884
|
return b`
|
|
222877
222885
|
<div class="container">
|
|
222878
222886
|
<svg viewBox="${overlayViewBox}">
|
|
222887
|
+
${this.isSingleScale && !this.zoomToFitArc ? this.renderRingComplement(pitchReq, rollReq) : A}
|
|
222879
222888
|
${this.hasReadout ? A : w`
|
|
222880
|
-
|
|
222881
|
-
|
|
222882
|
-
|
|
222883
|
-
|
|
222884
|
-
|
|
222885
|
-
|
|
222886
|
-
|
|
222889
|
+
${this.isSingleScale ? w`
|
|
222890
|
+
<line
|
|
222891
|
+
x1=${-OUTER_RING_RADIUS}
|
|
222892
|
+
y1="0"
|
|
222893
|
+
x2=${OUTER_RING_RADIUS}
|
|
222894
|
+
y2="0"
|
|
222895
|
+
stroke="var(--instrument-frame-tertiary-color)"
|
|
222896
|
+
/>
|
|
222897
|
+
<line
|
|
222898
|
+
x1="0"
|
|
222899
|
+
y1=${-OUTER_RING_RADIUS}
|
|
222900
|
+
x2="0"
|
|
222901
|
+
y2=${OUTER_RING_RADIUS}
|
|
222902
|
+
stroke="var(--instrument-frame-tertiary-color)"
|
|
222903
|
+
/>
|
|
222904
|
+
<line
|
|
222905
|
+
x1="0"
|
|
222906
|
+
y1="0"
|
|
222907
|
+
x2=${OUTER_RING_RADIUS - 10}
|
|
222908
|
+
y2="0"
|
|
222909
|
+
stroke="${this.needleColor(
|
|
222910
|
+
"pitch"
|
|
222911
|
+
/* pitch */
|
|
222912
|
+
)}"
|
|
222913
|
+
transform="rotate(${this.pitch} 0 0)"
|
|
222914
|
+
/>
|
|
222915
|
+
<line
|
|
222916
|
+
x1="0"
|
|
222917
|
+
y1="0"
|
|
222918
|
+
x2="0"
|
|
222919
|
+
y2=${OUTER_RING_RADIUS - 10}
|
|
222920
|
+
stroke="${this.needleColor(
|
|
222921
|
+
"roll"
|
|
222922
|
+
/* roll */
|
|
222923
|
+
)}"
|
|
222924
|
+
transform="rotate(${this.roll} 0 0)"
|
|
222925
|
+
/>
|
|
222926
|
+
` : w`
|
|
222927
|
+
<line
|
|
222928
|
+
x1="-150"
|
|
222929
|
+
y1="0"
|
|
222930
|
+
x2="150"
|
|
222931
|
+
y2="0"
|
|
222932
|
+
stroke="var(--instrument-frame-tertiary-color)"
|
|
222933
|
+
/>
|
|
222934
|
+
`}
|
|
222887
222935
|
<g
|
|
222888
222936
|
style="transform: rotate(${this.pitch}deg) scale(${vesselScale}) translate(-80px, -80px);"
|
|
222889
222937
|
>
|
|
@@ -222926,6 +222974,37 @@ let ObcPitchRoll = class extends i$4 {
|
|
|
222926
222974
|
</div>
|
|
222927
222975
|
`;
|
|
222928
222976
|
}
|
|
222977
|
+
/**
|
|
222978
|
+
* Thin ring segments completing the circle between the single-scale arcs:
|
|
222979
|
+
* one short segment between the pitch (right) and roll (bottom) arcs, and
|
|
222980
|
+
* one long segment the other way around (left and top).
|
|
222981
|
+
*/
|
|
222982
|
+
renderRingComplement(pitchArc, rollArc) {
|
|
222983
|
+
const r2 = OUTER_RING_RADIUS;
|
|
222984
|
+
const pt = (deg) => {
|
|
222985
|
+
const rad = (deg - 90) * Math.PI / 180;
|
|
222986
|
+
return [r2 * Math.cos(rad), r2 * Math.sin(rad)];
|
|
222987
|
+
};
|
|
222988
|
+
const segment = (from2, to2) => {
|
|
222989
|
+
if (to2 - from2 <= 0) {
|
|
222990
|
+
return A;
|
|
222991
|
+
}
|
|
222992
|
+
const [x1, y1] = pt(from2);
|
|
222993
|
+
const [x2, y22] = pt(to2);
|
|
222994
|
+
const large = to2 - from2 > 180 ? 1 : 0;
|
|
222995
|
+
return w`
|
|
222996
|
+
<path
|
|
222997
|
+
d="M ${x1} ${y1} A ${r2} ${r2} 0 ${large} 1 ${x2} ${y22}"
|
|
222998
|
+
fill="none"
|
|
222999
|
+
stroke="var(--instrument-frame-tertiary-color)"
|
|
223000
|
+
/>
|
|
223001
|
+
`;
|
|
223002
|
+
};
|
|
223003
|
+
return w`
|
|
223004
|
+
${segment(90 + pitchArc, 180 - rollArc)}
|
|
223005
|
+
${segment(180 + rollArc, 450 - pitchArc)}
|
|
223006
|
+
`;
|
|
223007
|
+
}
|
|
222929
223008
|
/**
|
|
222930
223009
|
* Zoomed-arc layer: four CSS-rotated `<obc-watch>` instances, each
|
|
222931
223010
|
* containing a single arc rendered at the watch's natural top
|
|
@@ -223117,7 +223196,7 @@ let ObcPitchRoll = class extends i$4 {
|
|
|
223117
223196
|
></obc-watch>
|
|
223118
223197
|
`;
|
|
223119
223198
|
return b`
|
|
223120
|
-
${subWatch(
|
|
223199
|
+
${this.isSingleScale ? A : subWatch(
|
|
223121
223200
|
0,
|
|
223122
223201
|
rollFrame.subArcFrame,
|
|
223123
223202
|
rollAreas,
|
|
@@ -223147,7 +223226,7 @@ let ObcPitchRoll = class extends i$4 {
|
|
|
223147
223226
|
rollClip,
|
|
223148
223227
|
rollTickmarks
|
|
223149
223228
|
)}
|
|
223150
|
-
${subWatch(
|
|
223229
|
+
${this.isSingleScale ? A : subWatch(
|
|
223151
223230
|
270,
|
|
223152
223231
|
pitchFrame.subArcFrame,
|
|
223153
223232
|
pitchAreas,
|
|
@@ -223193,20 +223272,7 @@ let ObcPitchRoll = class extends i$4 {
|
|
|
223193
223272
|
}
|
|
223194
223273
|
/** Full unzoomed watch — original single-instance render. */
|
|
223195
223274
|
renderFullWatch(areas) {
|
|
223196
|
-
|
|
223197
|
-
<obc-watch
|
|
223198
|
-
.watchCircleType=${WatchCircleType.double}
|
|
223199
|
-
.zoomToFitArc=${false}
|
|
223200
|
-
.areas=${areas}
|
|
223201
|
-
.barAreas=${[
|
|
223202
|
-
{
|
|
223203
|
-
startAngle: this.minAvgRoll,
|
|
223204
|
-
endAngle: this.maxAvgRoll,
|
|
223205
|
-
fillColor: this.barColor(
|
|
223206
|
-
"roll"
|
|
223207
|
-
/* roll */
|
|
223208
|
-
)
|
|
223209
|
-
},
|
|
223275
|
+
const barAreas = [
|
|
223210
223276
|
{
|
|
223211
223277
|
startAngle: 180 + this.minAvgRoll,
|
|
223212
223278
|
endAngle: 180 + this.maxAvgRoll,
|
|
@@ -223222,25 +223288,9 @@ let ObcPitchRoll = class extends i$4 {
|
|
|
223222
223288
|
"pitch"
|
|
223223
223289
|
/* pitch */
|
|
223224
223290
|
)
|
|
223225
|
-
},
|
|
223226
|
-
{
|
|
223227
|
-
startAngle: 270 + this.minAvgPitch,
|
|
223228
|
-
endAngle: 270 + this.maxAvgPitch,
|
|
223229
|
-
fillColor: this.barColor(
|
|
223230
|
-
"pitch"
|
|
223231
|
-
/* pitch */
|
|
223232
|
-
)
|
|
223233
223291
|
}
|
|
223234
|
-
]
|
|
223235
|
-
|
|
223236
|
-
{
|
|
223237
|
-
angle: this.roll,
|
|
223238
|
-
fillColor: this.needleColor(
|
|
223239
|
-
"roll"
|
|
223240
|
-
/* roll */
|
|
223241
|
-
),
|
|
223242
|
-
strokeColor: "var(--border-silhouette-color)"
|
|
223243
|
-
},
|
|
223292
|
+
];
|
|
223293
|
+
const needles = [
|
|
223244
223294
|
{
|
|
223245
223295
|
angle: 180 + this.roll,
|
|
223246
223296
|
fillColor: this.needleColor(
|
|
@@ -223256,16 +223306,65 @@ let ObcPitchRoll = class extends i$4 {
|
|
|
223256
223306
|
/* pitch */
|
|
223257
223307
|
),
|
|
223258
223308
|
strokeColor: "var(--border-silhouette-color)"
|
|
223259
|
-
},
|
|
223260
|
-
{
|
|
223261
|
-
angle: 270 + this.pitch,
|
|
223262
|
-
fillColor: this.needleColor(
|
|
223263
|
-
"pitch"
|
|
223264
|
-
/* pitch */
|
|
223265
|
-
),
|
|
223266
|
-
strokeColor: "var(--border-silhouette-color)"
|
|
223267
223309
|
}
|
|
223268
|
-
]
|
|
223310
|
+
];
|
|
223311
|
+
const tickmarks = [
|
|
223312
|
+
{ angle: 90, type: TickmarkType$1.main },
|
|
223313
|
+
{ angle: 180, type: TickmarkType$1.main },
|
|
223314
|
+
...arcTickmarks(90, this.requestedPitchArcAngle),
|
|
223315
|
+
...arcTickmarks(180, this.requestedRollArcAngle)
|
|
223316
|
+
];
|
|
223317
|
+
if (!this.isSingleScale) {
|
|
223318
|
+
barAreas.push(
|
|
223319
|
+
{
|
|
223320
|
+
startAngle: this.minAvgRoll,
|
|
223321
|
+
endAngle: this.maxAvgRoll,
|
|
223322
|
+
fillColor: this.barColor(
|
|
223323
|
+
"roll"
|
|
223324
|
+
/* roll */
|
|
223325
|
+
)
|
|
223326
|
+
},
|
|
223327
|
+
{
|
|
223328
|
+
startAngle: 270 + this.minAvgPitch,
|
|
223329
|
+
endAngle: 270 + this.maxAvgPitch,
|
|
223330
|
+
fillColor: this.barColor(
|
|
223331
|
+
"pitch"
|
|
223332
|
+
/* pitch */
|
|
223333
|
+
)
|
|
223334
|
+
}
|
|
223335
|
+
);
|
|
223336
|
+
needles.push(
|
|
223337
|
+
{
|
|
223338
|
+
angle: this.roll,
|
|
223339
|
+
fillColor: this.needleColor(
|
|
223340
|
+
"roll"
|
|
223341
|
+
/* roll */
|
|
223342
|
+
),
|
|
223343
|
+
strokeColor: "var(--border-silhouette-color)"
|
|
223344
|
+
},
|
|
223345
|
+
{
|
|
223346
|
+
angle: 270 + this.pitch,
|
|
223347
|
+
fillColor: this.needleColor(
|
|
223348
|
+
"pitch"
|
|
223349
|
+
/* pitch */
|
|
223350
|
+
),
|
|
223351
|
+
strokeColor: "var(--border-silhouette-color)"
|
|
223352
|
+
}
|
|
223353
|
+
);
|
|
223354
|
+
tickmarks.push(
|
|
223355
|
+
{ angle: 0, type: TickmarkType$1.main },
|
|
223356
|
+
{ angle: 270, type: TickmarkType$1.main },
|
|
223357
|
+
...arcTickmarks(0, this.requestedRollArcAngle),
|
|
223358
|
+
...arcTickmarks(270, this.requestedPitchArcAngle)
|
|
223359
|
+
);
|
|
223360
|
+
}
|
|
223361
|
+
return b`
|
|
223362
|
+
<obc-watch
|
|
223363
|
+
.watchCircleType=${WatchCircleType.double}
|
|
223364
|
+
.zoomToFitArc=${false}
|
|
223365
|
+
.areas=${areas}
|
|
223366
|
+
.barAreas=${barAreas}
|
|
223367
|
+
.needles=${needles}
|
|
223269
223368
|
.vessels=${this.hasReadout ? [] : [
|
|
223270
223369
|
{
|
|
223271
223370
|
size: VesselImageSize.large,
|
|
@@ -223278,16 +223377,7 @@ let ObcPitchRoll = class extends i$4 {
|
|
|
223278
223377
|
transform: `rotate(${this.roll}deg) scale(${this.normalizedScaleForeImage})`
|
|
223279
223378
|
}
|
|
223280
223379
|
]}
|
|
223281
|
-
.tickmarks=${
|
|
223282
|
-
{ angle: 0, type: TickmarkType$1.main },
|
|
223283
|
-
{ angle: 90, type: TickmarkType$1.main },
|
|
223284
|
-
{ angle: 180, type: TickmarkType$1.main },
|
|
223285
|
-
{ angle: 270, type: TickmarkType$1.main },
|
|
223286
|
-
...arcTickmarks(0, this.requestedRollArcAngle),
|
|
223287
|
-
...arcTickmarks(180, this.requestedRollArcAngle),
|
|
223288
|
-
...arcTickmarks(90, this.requestedPitchArcAngle),
|
|
223289
|
-
...arcTickmarks(270, this.requestedPitchArcAngle)
|
|
223290
|
-
]}
|
|
223380
|
+
.tickmarks=${tickmarks}
|
|
223291
223381
|
.advices=${this.advices}
|
|
223292
223382
|
></obc-watch>
|
|
223293
223383
|
`;
|
|
@@ -223314,39 +223404,27 @@ let ObcPitchRoll = class extends i$4 {
|
|
|
223314
223404
|
state,
|
|
223315
223405
|
hideMaxTickmark: true
|
|
223316
223406
|
});
|
|
223317
|
-
|
|
223318
|
-
|
|
223319
|
-
|
|
223320
|
-
|
|
223321
|
-
|
|
223322
|
-
|
|
223323
|
-
|
|
223324
|
-
|
|
223325
|
-
|
|
223326
|
-
|
|
223327
|
-
|
|
223328
|
-
|
|
223329
|
-
|
|
223330
|
-
|
|
223407
|
+
if (!this.isSingleScale) {
|
|
223408
|
+
advices.push({
|
|
223409
|
+
minAngle: 270 - outer,
|
|
223410
|
+
maxAngle: 270 - inner,
|
|
223411
|
+
type: AdviceType.caution,
|
|
223412
|
+
state,
|
|
223413
|
+
hideMinTickmark: true
|
|
223414
|
+
});
|
|
223415
|
+
advices.push({
|
|
223416
|
+
minAngle: 270 + inner,
|
|
223417
|
+
maxAngle: 270 + outer,
|
|
223418
|
+
type: AdviceType.caution,
|
|
223419
|
+
state,
|
|
223420
|
+
hideMaxTickmark: true
|
|
223421
|
+
});
|
|
223422
|
+
}
|
|
223331
223423
|
}
|
|
223332
223424
|
if (this.maxRollAdvice !== void 0) {
|
|
223333
223425
|
const outer = Math.min(rollReq, 45);
|
|
223334
223426
|
const inner = Math.min(this.maxRollAdvice, outer);
|
|
223335
223427
|
const state = this.triggerRollAdvice ? AdviceState.triggered : AdviceState.regular;
|
|
223336
|
-
advices.push({
|
|
223337
|
-
minAngle: -outer,
|
|
223338
|
-
maxAngle: -inner,
|
|
223339
|
-
type: AdviceType.caution,
|
|
223340
|
-
state,
|
|
223341
|
-
hideMinTickmark: true
|
|
223342
|
-
});
|
|
223343
|
-
advices.push({
|
|
223344
|
-
minAngle: inner,
|
|
223345
|
-
maxAngle: outer,
|
|
223346
|
-
type: AdviceType.caution,
|
|
223347
|
-
state,
|
|
223348
|
-
hideMaxTickmark: true
|
|
223349
|
-
});
|
|
223350
223428
|
advices.push({
|
|
223351
223429
|
minAngle: 180 - outer,
|
|
223352
223430
|
maxAngle: 180 - inner,
|
|
@@ -223361,6 +223439,22 @@ let ObcPitchRoll = class extends i$4 {
|
|
|
223361
223439
|
state,
|
|
223362
223440
|
hideMaxTickmark: true
|
|
223363
223441
|
});
|
|
223442
|
+
if (!this.isSingleScale) {
|
|
223443
|
+
advices.push({
|
|
223444
|
+
minAngle: -outer,
|
|
223445
|
+
maxAngle: -inner,
|
|
223446
|
+
type: AdviceType.caution,
|
|
223447
|
+
state,
|
|
223448
|
+
hideMinTickmark: true
|
|
223449
|
+
});
|
|
223450
|
+
advices.push({
|
|
223451
|
+
minAngle: inner,
|
|
223452
|
+
maxAngle: outer,
|
|
223453
|
+
type: AdviceType.caution,
|
|
223454
|
+
state,
|
|
223455
|
+
hideMaxTickmark: true
|
|
223456
|
+
});
|
|
223457
|
+
}
|
|
223364
223458
|
}
|
|
223365
223459
|
return advices;
|
|
223366
223460
|
}
|
|
@@ -223393,6 +223487,9 @@ ObcPitchRoll.styles = [
|
|
|
223393
223487
|
}
|
|
223394
223488
|
`
|
|
223395
223489
|
];
|
|
223490
|
+
__decorateClass$n([
|
|
223491
|
+
n$3({ type: String })
|
|
223492
|
+
], ObcPitchRoll.prototype, "type", 2);
|
|
223396
223493
|
__decorateClass$n([
|
|
223397
223494
|
n$3({ type: Number })
|
|
223398
223495
|
], ObcPitchRoll.prototype, "pitch", 2);
|