more G-Labs products

Author Topic: Program.Parameter vs RaiseEvent  (Read 871 times)

July 14, 2015, 03:56:09 PM
Read 871 times

kevin1

  • *****
  • Information
  • Hero Member
  • Posts: 330
What is difference between these:

Code: [Select]
Program.Parameter("jkUtils.OpenWeatherMap.Rain.H1").Value = data.rain["1h"] ?? "";

Program.RaiseEvent("jkUtils.OpenWeatherMap.Rain.H1", data.rain["1h"], "OWD-Rain one hour");

WeatherUnderground uses Program.RaiseEvent to refresh data in the widget.  OpenWeather uses Program.Parameter... so both work?

I have noticed that the RaiseEvent data also appears on the statistics/chart (WeatherUnderground for example) while I don't think Program.Paramter shows on the chart (OpenWeather example).  I'd like to remove the WeatherUnderground forecast from the chart as it clutters and doesn't seem useful.




July 15, 2015, 07:23:33 PM
Reply #1

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Program.Parameter just changes the parameter value without notifying any event to the system.
Program.RaiseEvent changes the parameter value and notifies the event to the system.

July 15, 2015, 08:11:08 PM
Reply #2

kevin1

  • *****
  • Information
  • Hero Member
  • Posts: 330
Program.Parameter seems to update the widget though as in the OpenWeather