weather detector refactor - #1319
Conversation
|
FYI. There is a merge conflict here. |
d25b9c9 to
e6d9d70
Compare
|
Can you rebase? We recently added new test infra which we will need to add tests for this to. I just pushed the PLZA test skeleton to master. Once you rebase, you'll be able to add tests for this weather detector. Basically you'll want to add the weather detector test here: https://github.com/PokemonAutomation/Arduino-Source/blob/main/SerialPrograms/Source/PokemonLZA/PokemonLZA_Tests.cpp#L17 Here is an example of what the new test structure looks like: https://github.com/PokemonAutomation/Arduino-Source/blob/main/SerialPrograms/Source/PokemonLZA/Inference/PokemonLZA_DialogDetector.cpp#L477-L518 So you'll need to make that, then list the 30-some test files that you merged to the CommandLineTests repo. That way these can be automatically run with the rest of the other tests. |
Refactored the weather detector to use waterfill instead of direct object comparison.
e6d9d70 to
f5afb33
Compare
This pull request refactors and improves the weather icon detection logic for Pokémon LZA. The main change is a switch from a hard-coded template info table to using waterfill template matching. This should improve robustness. The test program is also updated to exercise and debug the new detection logic.
Weather Icon Detection Refactor and Improvements:
WeatherTemplateInfotable and related logic with a matcher-based approach usingWaterfillTemplateMatcherand a newWeatherFullMatcherclass, allowing for more flexible and robust template matching for each weather type.supplemental_template_checksto handle additional region-of-interest template checks for specific weather types, improving detection accuracy and making it easier to add or modify checks.WeatherIconDetectorclass to use the new matcher-based approach, removing unnecessary members and simplifying overlay logic.Test Program and Integration Updates:
Updated the test program (
TestProgramSwitch.cpp) to include the new weather detector and added a debug routine for visualizing and testing weather icon detection. [Code Cleanup:
Removed unused includes and the obsolete
WeatherTemplateInfostruct from headers, reflecting the new detection approach.