feat: Decode variable wind between two headings
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -98,6 +98,11 @@
|
|||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function decodeVariableWind(code) {
|
||||||
|
const [dir1, dir2] = code.split('V');
|
||||||
|
return `${code}: Wind variable between ${dir1}° and ${dir2}°`;
|
||||||
|
}
|
||||||
|
|
||||||
function decodeVisibility(code) {
|
function decodeVisibility(code) {
|
||||||
const vis = code.replace('SM', '');
|
const vis = code.replace('SM', '');
|
||||||
return `${code}: Visibility ${vis} statute miles`;
|
return `${code}: Visibility ${vis} statute miles`;
|
||||||
@@ -579,6 +584,8 @@
|
|||||||
|
|
||||||
if (part.endsWith('KT')) {
|
if (part.endsWith('KT')) {
|
||||||
sections.push({ raw: part, decoded: decodeWind(part) });
|
sections.push({ raw: part, decoded: decodeWind(part) });
|
||||||
|
} else if (part.match(/^\d{3}V\d{3}$/)) {
|
||||||
|
sections.push({ raw: part, decoded: decodeVariableWind(part) });
|
||||||
} else if (part.endsWith('SM') || part.match(/^\d+$/)) {
|
} else if (part.endsWith('SM') || part.match(/^\d+$/)) {
|
||||||
sections.push({ raw: part, decoded: decodeVisibility(part) });
|
sections.push({ raw: part, decoded: decodeVisibility(part) });
|
||||||
} else if (part.match(/^([+-]|VC)?(MI|PR|BC|DR|BL|SH|TS|FZ|DZ|RA|SN|SG|IC|PL|GR|GS|UP|BR|FG|FU|VA|DU|SA|HZ|PY|PO|SQ|FC|SS|DS|TR)+$/)) {
|
} else if (part.match(/^([+-]|VC)?(MI|PR|BC|DR|BL|SH|TS|FZ|DZ|RA|SN|SG|IC|PL|GR|GS|UP|BR|FG|FU|VA|DU|SA|HZ|PY|PO|SQ|FC|SS|DS|TR)+$/)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user