Modify

Opened 6 years ago

Last modified 5 years ago

#10286 assigned Patch - Feature

Weather world map for mythweather

Reported by: joachim@… Owned by: beirdo
Priority: minor Milestone: unknown
Component: Plugin - MythWeather Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

I've created a patch, which extends MythWeather? with a screen, which displays a world map with weather of different locations (actuall only one can be defined). As a map it uses the NASA blue marble maps. Since both maps are a little bit bigger files, the patch containing both maps is also a little bit bigger (about 40MB). Therefore I've hosted the patch at http://ftp.engsas.de/mythweather-worldweathermap.patch.

The screen is not finished yet, since two questions are not solved.

  1. How can multiple locations can be assigned to one screen?
  2. How can weather locations be mapped to geo coordinates more reliable? (Actually it works, if the weather location is something like CITY, COUNTRY (e.g. London, Great Britain)

Nevertheless I'll hope some others find that idea nice and want to help a bit.

Attachments (4)

example.jpg (136.3 KB) - added by joachim@… 6 years ago.
How the screen looks like right now
mythweather-worldweathermap.patch (24.5 KB) - added by joachim@… 6 years ago.
Patch without binary files
mythweather-worldweathermap.2.patch (20.5 KB) - added by joachim@… 6 years ago.
Patch without binary files and any changes made to the sources
mythweather-worldweathermap.3.patch (24.2 KB) - added by joachim@… 6 years ago.
Complete patch without binary files

Download all attachments as: .zip

Change History (15)

Changed 6 years ago by joachim@…

How the screen looks like right now

comment:1 Changed 6 years ago by markk

Joachim - can I suggest you produce a patch without the embedded maps. I doubt we would add those files directly to the source anyway and at the moment, it takes my dev box 5 minutes to open the patch.

Changed 6 years ago by joachim@…

Patch without binary files

comment:2 Changed 6 years ago by joachim@…

I'm a bit confused, if the patch is correct now. The last patch missed some changes in file weatherScreen.cpp. Therefore I've commit those changes locally now, but I'm not sure if some parts of the code was already added and now some whitespaces are changed or something.

I'm not very familliar with git right now, so I hope the patch will work.

Changed 6 years ago by joachim@…

Patch without binary files and any changes made to the sources

comment:3 Changed 6 years ago by joachim@…

The file mythweather-worldweathermap.2.patch is a working patch with all changes but the added binary files, which are the two maps. Actually the satellite maps day and night are used. But must be converted into png before they can be used with Qt. Both maps must be located at mythweather/mythweather/bluemarble

comment:4 Changed 6 years ago by beirdo

OK, I have tried to apply this.

  • it is against 0.24 code base, and development of new features is done on master (which will become 0.25)
  • the formatting is not even close to our standards (4-space indentation, 80 column width)
  • this requires Qt Mobility which is not even packaged for some distros. As my main development system is Ubuntu 10.04 LTS, I can not actually compile this code as it was not packaged until 10.10, and I will not be upgrading to non-LTS.
    • can this code be reworked to not use Qt Mobility?
  • we will need to look into the legality of using those map images
  • if it is legitimate to use them, we should download them with the download manager, and convert them to the correct screen size on loading. We will not want to be scaling them over and over.

I'm sure I'll have other notes later.

comment:5 Changed 6 years ago by beirdo

http://earthobservatory.nasa.gov/ImageUse/

Looks like we are OK on the use of the images.

comment:6 Changed 6 years ago by stuartm

A copy of the image should be assigned to MythUIImage since MythUIImage takes ownership and can/will modify it including scaling/cropping which would break later calls to addToMap(). It may even delete it before the screen is closed. You would need to call SetImage?() after drawing the icons to the map image.

To guard against leaks or crashes, MythImage? is reference counted, UpRef?() should be called after it's creation and DownRef?() when it should be deleted - in this case the screen's destructor.

setCurrentTemperatur should be setCurrentTemperature

comment:7 Changed 6 years ago by joachim@…

  • Yes, the maps can be used for free, but a copyright notice is needed (E.g. a small text at the bottom of the map).
  • But rescaling of the map must be possible, if the screen size change (e.g. called with --geometry or on a laptop with disconnect external monitor). Believing the messages on the terminal, the themes are also rescaled in this case. May be this is a good approach.
  • Is it possible to compile myth master without installing everything from it? I have a running 0.24 installation, therefore I've choosen that branch, because the merging of a changeset should not be that compicated, or not?
  • QtMobility Location is needed. But this QtMobility module is already moved into Qt-5. So with Qt5 no extra dependency is needed. Until then, it may be a good solution, to enable this screen, only if configure have found QtMobility Location module. (With cmake this is just easy, but I'm not familiar with your build system).
    • Using it without the Location API, is not very useful, because the mapping between city and geo coordinates (longitude, latitude) is done with Location API.
  • Im going to format the code, if I know, that it will be accepted. Before that, it just takes time, for eventually nothing.
  • I'm going to change the stuff regarding MythUIImage during the next days.

comment:8 Changed 6 years ago by beirdo

MythTV's prerequisite is at this time Qt 4.6, last I heard. We may transition to Qt 4.7 sometime relatively soon, but Qt 5 has not even been discussed yet. If this new feature requires Qt 5 or at least add-ons that aren't readily available for many users yet, I'm afraid that the priority of getting it added before the 0.25 freeze may well be affected. I guess it can go in with configure checks to enable/disable it, though, so please work on adding that as well.

The formatting would be a lot easier if you did it from the beginning, but I don't care, as long as what finally goes in is formatted correctly.

Changed 6 years ago by joachim@…

Complete patch without binary files

comment:9 Changed 6 years ago by joachim@…

Changes contained in new patch:

  • MythUIImage only gets copies of MythImage
  • UpRef() is called on all MythImages after creation and DownRef() for deletion
  • The loaded map is scaled once after loading to main window size
  • World Weather Screen can be activated with ./configure --enable-worldweather
  • Should match coding standards now

What is not done yet:

  • Supporting multiple locations in configure screen
  • More reliable translation of weather locations into geo coordinates

comment:10 Changed 6 years ago by beirdo

  • Milestone changed from unknown to 0.26
  • Status changed from new to assigned

This will not be going in for 0.25, but I don't mind starting to work it in shortly after release.

comment:11 Changed 5 years ago by beirdo

  • Milestone changed from 0.26 to unknown

Add Comment

Modify Ticket

Action
as assigned The owner will remain beirdo.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.