fix: Parse directional and locally worse VIS remarks
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
+23
-2
@@ -334,8 +334,29 @@
|
||||
},
|
||||
// VIS
|
||||
{
|
||||
match: p => p[0] === 'VIS' && p.length > 2,
|
||||
decode: p => ({ consumed: 3, text: ` - VIS ${p[1]} ${p[2]}: Sector visibility to the ${p[1]} of ${p[2]} statute miles` })
|
||||
match: p => p[0] === 'VIS' && p.length > 2 && (isDirection(p[1]) || (p[1] === 'LW' && p.length > 3 && isDirection(p[3]))),
|
||||
decode: p => {
|
||||
// VIS LW <visibility> <direction>
|
||||
if (p[1] === 'LW') {
|
||||
const visibility = p[2].replace('SM', '');
|
||||
const direction = p[3];
|
||||
return {
|
||||
consumed: 4,
|
||||
text: ` - VIS LW ${p[2]} ${direction}: Visibility locally worse, ${visibility} statute miles to the ${decodeDirection(direction).replace(/ to /g, '-')}`
|
||||
};
|
||||
}
|
||||
|
||||
// VIS <direction> <visibility>
|
||||
if (isDirection(p[1])) {
|
||||
const visibility = p[2].replace('SM', '');
|
||||
const direction = p[1];
|
||||
const raw_vis = p[2];
|
||||
return {
|
||||
consumed: 3,
|
||||
text: ` - VIS ${direction} ${raw_vis}: Sector visibility ${visibility} statute miles to the ${decodeDirection(direction).replace(/ to /g, '-')}`
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
// VIRGA
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user