feat: Add 'Test All METARs' button to decode all loaded METARs
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
+12
@@ -32,10 +32,12 @@
|
|||||||
|
|
||||||
<div id="metar-display"></div>
|
<div id="metar-display"></div>
|
||||||
<button id="new-metar-btn">New METAR</button>
|
<button id="new-metar-btn">New METAR</button>
|
||||||
|
<button id="test-all-btn">Test All METARs</button>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
const metarDisplay = document.getElementById('metar-display');
|
const metarDisplay = document.getElementById('metar-display');
|
||||||
const newMetarBtn = document.getElementById('new-metar-btn');
|
const newMetarBtn = document.getElementById('new-metar-btn');
|
||||||
|
const testAllBtn = document.getElementById('test-all-btn');
|
||||||
const metars = [];
|
const metars = [];
|
||||||
|
|
||||||
function parseMetar(metarString) {
|
function parseMetar(metarString) {
|
||||||
@@ -137,6 +139,16 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
newMetarBtn.addEventListener('click', displayNewMetar);
|
newMetarBtn.addEventListener('click', displayNewMetar);
|
||||||
|
|
||||||
|
function testAllMetars() {
|
||||||
|
console.log(`--- Starting test of ${metars.length} METARs ---`);
|
||||||
|
metars.forEach(metarString => {
|
||||||
|
parseMetar(metarString);
|
||||||
|
});
|
||||||
|
console.log(`--- Test finished ---`);
|
||||||
|
}
|
||||||
|
|
||||||
|
testAllBtn.addEventListener('click', testAllMetars);
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user