more G-Labs products

Author Topic: Buienradar (Rain radar) for NL and BE users  (Read 8483 times)

July 21, 2015, 08:19:43 AM
Reply #15

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
I've updated Mono to 4.0.2:
Mono JIT compiler version 4.0.2 (Stable 4.0.2.5/c99aa0c Wed Jun 24 10:33:52 UTC 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com

But I can't seem to reproduce the problem you're seeing Dani, compilation is giving me no errors.

NicoVermeir, the error you're getting is in the Widget Editor? I get the same error if I haven't set the 'bind to module', see image:

* Edit, Added second image with correct binding.
 
« Last Edit: July 21, 2015, 08:41:28 AM by mvdarend »

July 21, 2015, 10:21:07 AM
Reply #16

NicoVermeir

  • ****
  • Information
  • Sr. Member
  • Posts: 122
    • My blog
Edit: never mind, got it to work. I was trying to import the hgx as a widget but it's a program. I feel like a noob now :D

thx for the assist
« Last Edit: July 21, 2015, 10:25:12 AM by NicoVermeir »

July 21, 2015, 04:13:46 PM
Reply #17

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi MvdaRend,

It's not at the compilation that I get the error. The error is generated when I run the task. So if you call DecimalValue of the property, you get the same result than Convert.ToDouble
Just make new try and I get same issue.

July 22, 2015, 08:30:25 AM
Reply #18

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
Nico: Thanks for the update, any feedback/improvements greatly appreciated.

Dani: I still can't reproduce the problem. Could it be that you're using commas (,) instead of points (.) in your values? I always use points, and hadn't thought to test for commas.

July 25, 2015, 07:13:54 AM
Reply #19

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi mvdarend,

1 - First time today I have rain so you project doesn't work in France.
I got that line in the rawdata :
0,39|07:10,0,22|07:15,0,18|07:20,0,45|07:25,0,24|07:30,0,12|07:35,0,13|07:40,0,17|07:45,0,19|07:50,0,06|07:55,0|08:00,0|08:05,0|08:10,0|08:15,0|08:20,0|08:25,0|08:30,0|08:35,0|08:40,0|08:45,0|08:50,0|08:55,0|09:00,0|09:05,0|09:10
As you can see, the value has coma. So I think it will be better to separate the raw by ';'. If not the widget crash due to coma that you use at first to split the properties.
2 - You represent only the raw of :00 and :30 so it will be judicious to add the values for each half past time, for exemple XX:00 add XX:00 XX :05 XX:10 XX:15 XX:20 and XX:25.
Because now the rain is some mm for one hour and the graph don't show any barregraph.
3 - You don't display the current Half Hour.
4 - For now I have Max expected 0,45mm/hour and nothing in the graph. I think it's for 10 mns. So you have to multiply by 12.

I don't know exactly what value they send, but my feeling is that each value is for the next 5 mns, isn't it ? Regarding to the raining time I get now.

If you agree I make modification and I post it

Cheers
Dani
« Last Edit: July 25, 2015, 07:56:18 AM by dani »

July 25, 2015, 08:38:50 AM
Reply #20

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
Thanks Dani, here are some replies I know the answer to:

1: Thanks, I'll have to either use a ; or force the using of a point instead of a comma iwhen calculating the real values from the data-feed.
2: There is a bar shown for every value given, but the widget only shows the time labels for to :00 and :30 times. (ie. in between these times the bars for other times should be shown, see example picture in first post)
3: That's strange, mine has always shown the current half hour, could you show a screenshot?
4: I'm not sure what you mean here, could you elaborate?

Quote
I don't know exactly what value they send..

Here are the exact values they send: (example given is for the default location)
http://gps.buienradar.nl/getrr.php?lat=52&lon=4
here is some info:
http://gps.buienradar.nl/

Here is a translation of the most important part:
mm/per hour = 10^((value-109)/32)
eg. 77 = 0.1 mm/uur

Thanks for your feedback, any improvements you wish to make will be greatly appreciated.

July 25, 2015, 10:47:22 AM
Reply #21

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hello Mvdarend,
Thank's for your answers.
I will make more invertigation, but for now no rain here.

Cheers
Dani

Actually 11:20 for your coordinate I get that screen.
There are some values but no graph is shown.

PS : Now I got current time in the list. because I had (x ==0) test in .js file.
        if ( x == 0 || theTime.indexOf(':00') > 0 || theTime.indexOf(':30') > 0)  

Now I got graph display, I modify .js file :
        var theRain = data[0].replace(',', '.');

Only now the graph is not align with time.

« Last Edit: July 25, 2015, 11:38:54 AM by dani »

July 27, 2015, 07:46:36 AM
Reply #22

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
Thanks for the update Dani, I'll have to adjust and test it properly with commas instead of points in the values.

Could you try the following:

In the .hgx file replace the following: (ie, change the comma "," to a semicolon ";")
Code: [Select]
// RawDataForWidget is a slightly modified version of the original data
//RawDataForWidget += String.Format("{0}|{1},", mmPerHour, dataPoint[1]);
RawDataForWidget += String.Format("{0}|{1};", mmPerHour, dataPoint[1]); // this is the changed line
LoopNumber += 1;

And in the widget, the following:
Code: [Select]
          if (module.Properties[p].Name == 'Buienradar.RawData') {
            var maxValue = 0;
            // var lines = propValue.split(',');
            var lines = propValue.split(';');
            // create the graph


Oh, I misread your post, I see that you've got it working.
Yes, the bars are not perfectly aligned with the times. Depending on the start time of the feed they'll shift slightly. I haven't found a good way to make them line up perfectly yet, although I'm fairly happy with it as it is now as it gives a fairly good idea of what's to come.

Any ideas for getting them to line up perfectly?

July 27, 2015, 06:25:16 PM
Reply #23

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
I will try by adding a minus sign behind the hour and after I will try to align the drawing.

July 30, 2015, 11:23:41 AM
Reply #24

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi MvdArend,

I join here some improvments of your Widget :
HGX : Adding TimeSlice in the result string RawData to align with 30 mns scale.
Widget : Align Graph with time points.

Cheers
Dani

July 30, 2015, 11:27:06 AM
Reply #25

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
Thanks Dani, I'll try it out later on.

I see that you've added FR as supported country, I thought only NL and BE was supported. Does it work for all of France, or only the northern area?

July 30, 2015, 11:07:51 PM
Reply #26

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
I don't know if it's work for all France. It's real, I stay north of France (Near Boulogne sur mer under Calais).

August 07, 2015, 09:01:08 AM
Reply #27

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
Thanks for the improvements Dani, I've updated the first post with your files.

August 28, 2015, 08:47:02 AM
Reply #28

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
I've made the widget clickable, showing the Rain Radar map.

November 25, 2015, 05:07:11 PM
Reply #29

bastienboutonnet

  • *
  • Information
  • Newbie
  • Posts: 2
Hey. Looks like a fun app. I was thinking of designing one as a way to teach myself js actually.

I have two questions:
1. How do I install that on a mac os? All bits of info about installation do not seem to make sense to me
2. Is there a documentation on how gps.buienradar.nl's API works? Like how you get maybe other info like the current temperature and conditions? I assume maybe you already know? I emailed then 3 days ago but I have not heard anything back and I think I probably never will.