prueker / METARMap

Raspberry Pi project to visualize flight conditions on a map using WS8211 LEDs addressed via NeoPixel
MIT License
119 stars 72 forks source link

Highlight current METAR LED #30

Closed nesincg closed 1 year ago

nesincg commented 2 years ago

I wanted to highlight the Map LED of the airport that is currently displaying the METAR on the screen. Thought that would be cool.

In the future it would be awesome to put some proximity buttons on the frame and scroll through manually or go back if you missed one. Probably won't happen.

I'm like the worst programmer in the world, but I wanted to try to do this to learn. Perhaps you'll delete this, which I'm okay with. I probably could have used less variables. Because I didn't want to upload the whole file, I'm hoping I got everything. It doesn't even start working until the second METAR.

Thanks for giving me this project to explore my limited programming skills. My next project is to make a welcome screen for the display. Many people give these as gifts. So Property of.... Many thanks too....

lynolamero commented 2 years ago

For the COLOR_VFR line that is replaced, it is missing: else COLOR_HIGH_WINDS if highWinds else (COLOR_VFR_FADE if FADE_INSTEAD_OF_BLINK else COLOR_CLEAR). Should the high winds, fades and blinks be included?

lynolamero commented 2 years ago

After updating metar.py with the code, all LEDs are showing the Highlighted color. So, I set displayCode to false: if airportcode == displayAirportCode: displayCode = True else: displayCode = False

nesincg commented 2 years ago

Well crap. Ill be back to my laptop tonight. Try to look it over. Problem is it doesn't update the current apt until the end of the loop. I couldn't figure a better way. I may send the full file to you. Can I just update the pull request with the whole file?

On Tue, Feb 1, 2022, 12:38 lynolamero @.***> wrote:

After updating the metar.py, the small display is blinking (flashes) 3x the next airport while the current airport is displayed. At the forth blink it displays the next airport METAR information.

— Reply to this email directly, view it on GitHub https://github.com/prueker/METARMap/pull/30#issuecomment-1027110466, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASC3AF6CMRPA6DMKTRJZTDLUZAK7ZANCNFSM5ND7I3GA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

nesincg commented 2 years ago

Well crap. Ill be back to my laptop tonight. Try to look it over. Problem is it doesn't update the current apt until the end of the loop. I couldn't figure a better way. I may send the full file to you. Can I just update the pull request with the whole file?

Also. A lot of people, including me give these away as gifts. I was trying to find a place to insert text on the display loop. Maybe get data from a welcome file. Would you start in metar.py or displaymetar? This one may be above my head.

From this page. https://exerror.com/repository-http-deb-debian-org-debian-buster-updates-inrelease-changed-its-suite-value-from-stable-updates-to-oldstable-updates/

On Tue, Feb 1, 2022, 12:38 lynolamero @.***> wrote:

After updating the metar.py, the small display is blinking (flashes) 3x the next airport while the current airport is displayed. At the forth blink it displays the next airport METAR information.

— Reply to this email directly, view it on GitHub https://github.com/prueker/METARMap/pull/30#issuecomment-1027110466, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASC3AF6CMRPA6DMKTRJZTDLUZAK7ZANCNFSM5ND7I3GA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

prueker commented 2 years ago

Also. A lot of people, including me give these away as gifts. I was trying to find a place to insert text on the display loop. Maybe get data from a welcome file. Would you start in metar.py or displaymetar? This one may be above my head.

You would want to just write a new method in the dispaymetar.py (copying the outputMetar(...) method) and just have it output your text. Then in metar.py before the #Setting LED colors based on weather conditions you would want to add invoking this new method, something like

displaymetar.outputwelcome()
time.sleep(10.0) #this will wait 10 seconds
nesincg commented 2 years ago

Thanks for the tips. Will be buying you several cups of coffee.

On Tue, Feb 1, 2022, 18:52 Philip Rueker @.***> wrote:

Also. A lot of people, including me give these away as gifts. I was trying to find a place to insert text on the display loop. Maybe get data from a welcome file. Would you start in metar.py or displaymetar? This one may be above my head.

You would want to just write a new method in the dispaymetar.py (copying the outputMetar(...) method) and just have it output your text. Then in metar.py before the #Setting LED colors based on weather conditions you would want to add invoking this new method, something like

displaymetar.outputwelcome() time.sleep(10.0) #this will wait 10 seconds

— Reply to this email directly, view it on GitHub https://github.com/prueker/METARMap/pull/30#issuecomment-1027402605, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASC3AF747MXOX3RCIP4GPCLUZBW5TANCNFSM5ND7I3GA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

nesincg commented 2 years ago

I updated things and added a line that may fix this, but I never saw my display blink. That might be something different in settings than I have different, though I'm trying several changes. Mine is currently functioning as planned.

After updating the metar.py, the small display is blinking (flashes) 3x the next airport while the current airport is displayed. At the forth blink it displays the next airport METAR information.

Fixed all the COLOR if statements in airport loop including getting rid of some (parenthesis). Added displayCode = False at the end of the airport loop. This should fix the: all LEDs showing highlight color. All references to displayCode and displayAirportCode should be correct with the addition of that line.

I also added the import timedelta that was for another pull request. I'm new at all this.

Message ID: @.***>

lynolamero commented 2 years ago

I have resolved the blinking issue with a restart. I believe two instances were running at the same time.