mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Draw no buoy for a virtual aid to navigation
A virtual aid (AIS message 21's VirtualAtoN flag) is a mark broadcast where nothing physical stands, so drawing it as a buoy showed a mark that is not there. The vessel source record now carries `virtual` (false unless a source says true; any source may set it), AISStream sets it from VirtualAtoN, and the vessel layer keeps such an aid's disc: vesselModelSpec returns null for it and the layer gathers no model item for it. Its card, selected card and readout add VIRTUAL after its kind.
This commit is contained in:
1 parent
9ae121c7c0
commit
52507a0755
31 files changed
+160
-18
No files matched your search
@@ -24,7 +24,10 @@ export function createCards({
|
||||
text: [
|
||||
t('AIS: {name}', { name: trimHudValue(record.name, 32) }),
|
||||
aid
|
||||
? trimHudValue(record.type || t('AID TO NAVIGATION'), 24)
|
||||
? aidKind(
|
||||
trimHudValue(record.type || t('AID TO NAVIGATION'), 24),
|
||||
record,
|
||||
)
|
||||
: t('{type} SPD: {speed} HDG: {heading}', {
|
||||
type: trimHudValue(record.type || t('VESSEL'), 24),
|
||||
speed: formatSpeed(record.speed),
|
||||
@@ -60,6 +63,7 @@ export function createCards({
|
||||
const aid = isAidToNavigation(record);
|
||||
const type = vesselTypeShort(record);
|
||||
if (type) parts.push(type);
|
||||
if (record.virtual === true) parts.push(t('VIRTUAL'));
|
||||
if (!aid && record.speed !== null && record.speed !== undefined)
|
||||
parts.push(formatSpeed(record.speed));
|
||||
const direction = record.heading ?? record.course;
|
||||
@@ -95,7 +99,7 @@ export function createCards({
|
||||
const direction = record.heading ?? record.course;
|
||||
const details = [
|
||||
aid
|
||||
? vesselTypeShort(record) || t('AID TO NAVIGATION')
|
||||
? aidKind(vesselTypeShort(record) || t('AID TO NAVIGATION'), record)
|
||||
: [
|
||||
vesselTypeShort(record) || t('VESSEL'),
|
||||
formatSpeed(record.speed),
|
||||
@@ -125,6 +129,12 @@ export function createCards({
|
||||
};
|
||||
}
|
||||
|
||||
/** An aid's kind, marked virtual when nothing physical stands there. */
|
||||
|
||||
function aidKind(kind, record) {
|
||||
return record.virtual === true ? `${kind} · ${t('VIRTUAL')}` : kind;
|
||||
}
|
||||
|
||||
/** A card's accent: an aid's disc colour, else its ship type's. */
|
||||
|
||||
function vesselAccent(record, aid) {
|
||||
|
||||
Reference in new issue
Block a user