Pocket Weather

digitaldon37

Active Member
Licensed User
Longtime User
Version 1.1 / D.41

Latest version has been rolled up into a new public release (1.1) and has been uploaded to the main post.

Latest version is public release 1.1


To Do (Future Features)
====================================================================
1. Plug-ins to support weatherpanel map (will be html/javascript)
2. Finger scroll up: settings, down: minimize, side: switch locations
3. Option for full screen (will enable when #2 is in place)
4. Roll forecasts when date rolls over (current=display message only)


History

1.1 (12/14/08)
====================================================================
- public release containing developer fixes d.39 to d.41

.41 (12/11/08)
====================================================================
- Added AppToDate support
- Added check for outdated cache (displays message only)

.40 (12/11/08) Klaus
====================================================================
- adapted image sizes to
condition 48*48
details 40*40
buttons 48*48
add/delete 20*20 the png images are still 16*16 in the gfx folder
- increased saved locations from 5 to 10
- panel messages in the middle of the screen (eliminate double redraw)


.39 (12/8/08)
====================================================================
- fix Russian language file
- fix fuzzy font (eliminated setTransparency)
 

digitaldon37

Active Member
Licensed User
Longtime User
Developer's release .43

Attached is the latest version, it incorporates base code for public release 1.1 and some bug fixes

History

.43 (12/17/08)
====================================================================
- add S2U key update to "RefreshWeather" -was only updated on main refresh
- fix bug where interval set to zero and deletes location cache
- fix refreshweather bug (was setting timer off for ini=0)

.42 (12/16/08)
====================================================================
- add klaus's update for city/location id (sorted array)


1.1 (12/14/08)
====================================================================
- public release containing developer fixes d.39 to d.41
 
Last edited:

digitaldon37

Active Member
Licensed User
Longtime User
Hi Don,

Here you have version 0_44 with the finger swapping of locations.

Best regards.

Thanks Klaus. Is there any way to restrict the swiping to a rectangle? This code triggers a swipe whether it's top to bottom, left to right, etc. The result is that you may get an unintended swipe.

I had been thinking that for scrolling locations, to limit the swipe to the "Tomorrow" section on the main page. That seems to be coordinates 10,140 to 180, 180
 

klaus

Expert
Licensed User
Longtime User
Yes it could be restricted to a certain rectangle.

The principle was the following.
Swiping left to right or top down increased the location index by one if there is a location. If there is no location it increased one more till the end.
Swiping right to left or bottom to top decreased the index. So there shouldn't have been an unintended swipe.
The swip must be, at the moment, at least 50 pixels wide between MouseDown and MouseUp. This could of course also also be changed.
The swipe works in all 3 screens, today, detail anf fourcast.

In the attached file the swipe is limited to the rectangle you gave.
The swipe is limited to right-left and left-right only and still 50 pixel min. (and now 100 pixel on a VGA sreen). I increased the version number t0 0.45.
The values are in variables so it would be easy to change them in the Form1.MouseUp routine.

Best regards.
 

digitaldon37

Active Member
Licensed User
Longtime User
Yes it could be restricted to a certain rectangle.

The principle was the following.
Swiping left to right or top down increased the location index by one if there is a location. If there is no location it increased one more till the end.
Swiping right to left or bottom to top decreased the index. So there shouldn't have been an unintended swipe.
The swip must be, at the moment, at least 50 pixels wide between MouseDown and MouseUp. This could of course also also be changed.
The swipe works in all 3 screens, today, detail anf fourcast.

In the attached file the swipe is limited to the rectangle you gave.
The swipe is limited to right-left and left-right only and still 50 pixel min. (and now 100 pixel on a VGA sreen). I increased the version number t0 0.45.
The values are in variables so it would be easy to change them in the Form1.MouseUp routine.

Best regards.

Thanks Klaus! This works great.
 

digitaldon37

Active Member
Licensed User
Longtime User
A new version for test:
- Increased the swiping area it covers now the Today and Tomorrow dispalys
- Changed Today display with weather conditions, the Tomorrow display is still the previous one for comparison.

Best regards.

Hi Klaus. I like the concept but it seems to mess up in other languages (specifically French and German) - the words run together

[update] - I'm uploading your code with a change in the GetRemoteRSS error routine. I had added a check for the location cache file which fixes wolfkmann's issue of not being able to switch between locations when there was no connection to the internet.
 
Last edited:

klaus

Expert
Licensed User
Longtime User
Hi Don,
What words are overlapping or running together, I tried mainly in English,French and German and have not yet found overlapping words.
Is it the first line with Today and the date, the 2nd one with the day name and the temperatures or the 3rd one with the conditions? Is it on the device only or on both?
Did you also have a look at the desktop version, what about having two arrows up and down before the temperatures instead of the two letters?

Best regards.
 

digitaldon37

Active Member
Licensed User
Longtime User
Hi Don,
What words are overlapping or running together, I tried mainly in English,French and German and have not yet found overlapping words.
Is it the first line with Today and the date, the 2nd one with the day name and the temperatures or the 3rd one with the conditions? Is it on the device only or on both?
Did you also have a look at the desktop version, what about having two arrows up and down before the temperatures instead of the two letters?

Best regards.

I got the overlaps on my PC (the temp was overwritten by the German day word) as well as on my PDA.

I've been trying to create a routine to justify text, but I'm not having much success because I don't have much experience with font sizes and calculating spaces. Here is what I'm trying to print, I think this may get everything in the spaces needed:

Today (left justified, font 12) - mm/dd/yy (right justified, font 11) - image
Day of week (left justified, font 11) - high / low (right justified, font 11) - image
Weather conditions (left justified, font 11)

The text that is right justified (date, temps) will be consistent so they will always align properly, and most of the language text seems to fit left justified (we can truncate if necessary)

[update] Attached is screenshot of what I have working, I'm going to clean up the code and upload that shortly
[update2] Attached is 46.2
 

Attachments

  • pfcast.JPG
    pfcast.JPG
    23.3 KB · Views: 343
Last edited:

digitaldon37

Active Member
Licensed User
Longtime User
What is your default Font on the desktop, I use Arial, yours look wider.

The DrawText routine has text justification already included, cLeft, cRight, cCenter !

I use Arial. If there is not a font name listed in the theme.ini it defaults to Arial on the desktop, and Tahoma on the PDA.

By the way, your finger swiping to change locations is really cool!
 

digitaldon37

Active Member
Licensed User
Longtime User
I use Arial too, and get the attached image.

But anyway, yours is OK too !

I added the condition description to the top "current" weather - I had to change how the city/region is displayed and check for string length & set font size for long city/region

current version=.46.4

[update] I changed the sorted lists for city from "index/city" to "city/index" with a check before inserting. The cities were not sorted in the drop down list.
[update2] fixed bug where "today" was listed in "tomorrow" section
 
Last edited:

digitaldon37

Active Member
Licensed User
Longtime User
Version .47

Cross-posted at XDA

I have uploaded version .47 to the main post. This version integrates with Levenum's Today Screen plug-in ([New release] Registry display plugin - xda-developers) to display either the current weather or forecast.

If everything tests out ok I will be rolling all the latest development releases into a new public release build.

.47 (12/19/08)
==================================================================
- add Today Screen plug-in integration (Levenum project)

.46 (12/18/08)
===================================================================
- add condition descriptions on main page


.45 (12/17/08)
====================================================================
- left/right & right/left finger swipe to switch locations (klaus)

.44 (12/17/08)
====================================================================
- fix offline cache / location switching bug

.43 (12/17/08)
====================================================================
- add S2U key update to "RefreshWeather"
- fix bug where interval set to zero and deletes location cache
- fix refreshweather bug (sets timer off for ini=0)

.42 (12/16/08)
====================================================================
- add klaus's update for city/location id (sorted array)

1.1 (12/14/08)
====================================================================
- public release containing developer fixes d.39 to d.41
 
D

Deleted member 103

Guest
Hi digitaldon37,

I have a mistake in the procedure found ChangeToVGA.
Please change the procedure this way:
Sub ChangeToVGA
'Handles resolutions of 480 * 640
Controls() = GetControls("")

For i = 0 To ArrayLen(Controls()) - 1
Crttype=ControlType(Controls(i))
If Crttype = "CheckBox" OR Crttype = "TextBox" OR Crttype = "Label" OR Crttype = "Button" OR Crttype = "Panel" OR Crttype = "Image" OR Crttype = "ComboBox" OR Crttype = "ImageButton" OR Crttype = "RadioBtn" Then
Control(Controls(i)).Left = 2 * Control(Controls(i)).Left
Control(Controls(i)).Top = 2 * Control(Controls(i)).Top
Control(Controls(i)).Height = 2 * Control(Controls(i)).Height
Control(Controls(i)).Width = 2 * Control(Controls(i)).Width
If Not(cPPC) Then
Control(Controls(i)).FontSize = 2 * Control(Controls(i)).FontSize
'There is no need to change the font size on the VGA device.
End If
End If
Next
' VScroll.Left = 2 * VScroll.Left
' VScroll.Top = 2 * VScroll.Top
' VScroll.Height = 2 * VScroll.Height
' VScroll.Width = 2 * VScroll.Width
' VScroll.Maximum = 2 * VScroll.Maximum
' VScroll.LargeChange = 2 * VScroll.LargeChange
' VScroll.SmallChange = 2 * VScroll.SmallChange
End Sub

and so these lines:
VScroll.New1("pnlLocations",210 * scale,0,15 * scale,125 * scale,True)
VScroll.Minimum=0
VScroll.Maximum=150 * scale
VScroll.LargeChange=25 * scale
VScroll.SmallChange=25 * scale

Ciao,
Filippo
 

digitaldon37

Active Member
Licensed User
Longtime User
Hi digitaldon37,


Test OK!
Thanks for the code and for testing.

[update] Version .49 is attached - changes made so that when you scroll through location is parses the cached location file (if it exists) instead of going out to the internet. The reasoning is that people may scroll through several locations to get to the one that they want and downloading for each location scrolled uses a lot of air-time.
 
Last edited:
Top