mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 09:27:07 +00:00
Add tooltips for preplot layers
This commit is contained in:
@@ -20,6 +20,8 @@ export default {
|
||||
return this.eventLogTooltip(args);
|
||||
} else if (args?.layer?.id == "pplp" || args?.layer?.id == "pslp") {
|
||||
return this.preplotPointsTooltip(args);
|
||||
} else if (args?.layer?.id == "ppll" || args?.layer?.id == "psll") {
|
||||
return this.preplotLinesTooltip(args);
|
||||
} else if (args?.layer?.id == "plan") {
|
||||
return this.plannedLinesTooltip(args);
|
||||
} else if (args?.layer?.id == "seqrl" || args?.layer?.id == "seqfl") {
|
||||
@@ -30,18 +32,49 @@ export default {
|
||||
},
|
||||
|
||||
preplotPointsTooltip (args) {
|
||||
const p = args?.object?.properties;
|
||||
const isSailline = args?.layer?.id == "psl";
|
||||
const p = args?.object;
|
||||
if (p) {
|
||||
let html = `${isSailline ? "Sail" : "Preplot"} line ${p.line} (${p.incr ? "+" : "-"})`;
|
||||
if (p.ntba) {
|
||||
html += ` <b title="Not to be acquired">NTBA</a>`;
|
||||
let html = "Preplot<br/>\n";
|
||||
|
||||
if ("sailline" in p) {
|
||||
// If there is a "sailline" attribute, this is actually a source line
|
||||
// "i" is the source line number, "sailline" the sail line number.
|
||||
html += `S${String(p.i).padStart(4, "0")}<br/>\n`;
|
||||
html += `V${String(p.sailline).padStart(4, "0")}<br/>\n`;
|
||||
} else {
|
||||
html += `V${String(p.i).padStart(4, "0")}<br/>\n`;
|
||||
}
|
||||
if (p.remarks) {
|
||||
html += `<br/>\n${p.remarks}`;
|
||||
html += `P${String(p.j).padStart(4, "0")}<br/>\n`;
|
||||
|
||||
if (p.sailline_ntba) {
|
||||
html += `<b>Line <abbr title="Not to be acquired">NTBA</abbr></b><br/>\n`;
|
||||
}
|
||||
|
||||
const style = { "max-width": "50ex"};
|
||||
if (p.ntba) {
|
||||
html += `<b>Point <abbr title="Not to be acquired">NTBA</abbr></b><br/>\n`;
|
||||
}
|
||||
|
||||
return {html, style: this.tooltipDefaultStyle};
|
||||
}
|
||||
},
|
||||
|
||||
preplotLinesTooltip (args) {
|
||||
const p = args?.object?.properties;
|
||||
if (p) {
|
||||
const lineType = args.layer.id == "psll" ? "Sailline" : "Source line";
|
||||
const direction = p.incr ? "▲" : "▼";
|
||||
let html = "";
|
||||
|
||||
html += `L${String(p.line).padStart(4, "0")} ${direction}<br/>\n`;
|
||||
html += `${lineType}<br/>\n`;
|
||||
|
||||
if (p.ntba) {
|
||||
html += "<b>Not to be acquired (NTBA)</b><br/>\n";
|
||||
}
|
||||
|
||||
if (p.remarks) {
|
||||
html += `<hr/>\n${this.$root.markdown(p.remarks)}\n`;
|
||||
}
|
||||
|
||||
return {html, style: this.tooltipDefaultStyle};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user