-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/AlienDwarf/open-meteo-dotnet
- Loading branch information
Showing
14 changed files
with
486 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace OpenMeteo | ||
{ | ||
public class CurrentOptions : IEnumerable, ICollection<CurrentOptionsParameter> | ||
{ | ||
/// <summary> | ||
/// Gets a new object containing every parameter | ||
/// </summary> | ||
/// <returns></returns> | ||
public static CurrentOptions All { get { return new CurrentOptions((CurrentOptionsParameter[])Enum.GetValues(typeof(CurrentOptionsParameter))); } } | ||
|
||
/// <summary> | ||
/// Gets a copy of elements contained in the List. | ||
/// </summary> | ||
/// <typeparam name="CurrentOptionsParameter"></typeparam> | ||
/// <returns>A copy of elements contained in the List</returns> | ||
public List<CurrentOptionsParameter> Parameter { get { return new List<CurrentOptionsParameter>(_parameter); } } | ||
|
||
public int Count => _parameter.Count; | ||
|
||
public bool IsReadOnly => false; | ||
|
||
private readonly List<CurrentOptionsParameter> _parameter = new List<CurrentOptionsParameter>(); | ||
|
||
public CurrentOptions() | ||
{ | ||
|
||
} | ||
|
||
public CurrentOptions(CurrentOptionsParameter parameter) | ||
{ | ||
Add(parameter); | ||
} | ||
|
||
public CurrentOptions(CurrentOptionsParameter[] parameter) | ||
{ | ||
Add(parameter); | ||
} | ||
|
||
/// <summary> | ||
/// Index the collection | ||
/// </summary> | ||
/// <param name="index"></param> | ||
/// <returns><see cref="string"/> CurrentOptionsType as string representation at index</returns> | ||
public CurrentOptionsParameter this[int index] | ||
{ | ||
get { return _parameter[index]; } | ||
set | ||
{ | ||
_parameter[index] = value; | ||
} | ||
} | ||
|
||
public void Add(CurrentOptionsParameter param) | ||
{ | ||
// Check that the parameter isn't already added | ||
if (_parameter.Contains(param)) return; | ||
|
||
_parameter.Add(param); | ||
} | ||
|
||
public void Add(CurrentOptionsParameter[] param) | ||
{ | ||
foreach (CurrentOptionsParameter paramToAdd in param) | ||
{ | ||
Add(paramToAdd); | ||
} | ||
} | ||
|
||
public void Clear() | ||
{ | ||
_parameter.Clear(); | ||
} | ||
|
||
public bool Contains(CurrentOptionsParameter item) | ||
{ | ||
return _parameter.Contains(item); | ||
} | ||
|
||
public bool Remove(CurrentOptionsParameter item) | ||
{ | ||
return _parameter.Remove(item); | ||
} | ||
|
||
public void CopyTo(CurrentOptionsParameter[] array, int arrayIndex) | ||
{ | ||
_parameter.CopyTo(array, arrayIndex); | ||
} | ||
|
||
public IEnumerator<CurrentOptionsParameter> GetEnumerator() | ||
{ | ||
return _parameter.GetEnumerator(); | ||
} | ||
|
||
IEnumerator IEnumerable.GetEnumerator() | ||
{ | ||
return this.GetEnumerator(); | ||
} | ||
} | ||
|
||
public enum CurrentOptionsParameter | ||
{ | ||
temperature_2m, | ||
relativehumidity_2m, | ||
apparent_temperature, | ||
is_day, precipitation, | ||
rain, | ||
showers, | ||
snowfall, | ||
weathercode, | ||
cloudcover, | ||
pressure_msl, | ||
surface_pressure, | ||
windspeed_10m, | ||
winddirection_10m, | ||
windgusts_10m | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace OpenMeteo | ||
{ | ||
public class CurrentUnits | ||
{ | ||
public string? Time { get; set; } | ||
public string? Interval { get; set; } | ||
public string? Temperature_2m { get; set; } | ||
public string? Temperature { get { return Temperature_2m; } private set { } } | ||
public string? Relativehumidity_2m { get; set; } | ||
public string? Apparent_temperature { get; set; } | ||
public string? Is_day { get; set; } | ||
public string? Precipitation { get; set; } | ||
public string? Rain { get; set; } | ||
public string? Showers { get; set; } | ||
public string? Snowfall { get; set; } | ||
public string? Weathercode { get; set; } | ||
public string? Cloudcover { get; set; } | ||
public string? Pressure_msl { get; set; } | ||
public string? Surface_pressure { get; set; } | ||
public string? Windspeed_10m { get; set; } | ||
public string? Winddirection_10m { get; set; } | ||
public string? Windgusts_10m { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace OpenMeteo | ||
{ | ||
public class Minutely15 | ||
{ | ||
public string[]? time { get; set; } | ||
public float[]? temperature_2m { get; set; } | ||
public int[]? relativehumidity_2m { get; set; } | ||
public float[]? dewpoint_2m { get; set; } | ||
public float[]? apparent_temperature { get; set; } | ||
public float[]? precipitation { get; set; } | ||
public float[]? rain { get; set; } | ||
public float[]? snowfall { get; set; } | ||
public float?[]? snowfall_height { get; set; } | ||
public float[]? freezinglevel_height { get; set; } | ||
public int[]? weathercode { get; set; } | ||
public float[]? windspeed_10m { get; set; } | ||
public float[]? windspeed_80m { get; set; } | ||
public int[]? winddirection_10m { get; set; } | ||
public int[]? winddirection_80m { get; set; } | ||
public float[]? windgusts_10m { get; set; } | ||
public float[]? visibility { get; set; } | ||
public float[]? cape { get; set; } | ||
public float?[]? lightning_potential { get; set; } | ||
public float[]? shortwave_radiation { get; set; } | ||
public float[]? direct_radiation { get; set; } | ||
public float[]? diffuse_radiation { get; set; } | ||
public float[]? direct_normal_irradiance { get; set; } | ||
public float[]? terrestrial_radiation { get; set; } | ||
public float[]? shortwave_radiation_instant { get; set; } | ||
public float[]? direct_radiation_instant { get; set; } | ||
public float[]? diffuse_radiation_instant { get; set; } | ||
public float[]? direct_normal_irradiance_instant { get; set; } | ||
public float[]? terrestrial_radiation_instant { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace OpenMeteo | ||
{ | ||
public class Minutely15Options : IEnumerable, ICollection<Minutely15OptionsParameter> | ||
{ | ||
/// <summary> | ||
/// Gets a new object containing every parameter | ||
/// </summary> | ||
/// <returns></returns> | ||
public static Minutely15Options All { get { return new Minutely15Options((Minutely15OptionsParameter[])Enum.GetValues(typeof(Minutely15OptionsParameter))); } } | ||
|
||
/// <summary> | ||
/// Gets a copy of elements contained in the List. | ||
/// </summary> | ||
/// <typeparam name="Minutely15OptionsParameter"></typeparam> | ||
/// <returns>A copy of elements contained in the List</returns> | ||
public List<Minutely15OptionsParameter> Parameter { get { return new List<Minutely15OptionsParameter>(_parameter); } } | ||
|
||
public int Count => _parameter.Count; | ||
|
||
public bool IsReadOnly => false; | ||
|
||
private readonly List<Minutely15OptionsParameter> _parameter = new List<Minutely15OptionsParameter>(); | ||
|
||
public Minutely15Options() | ||
{ | ||
|
||
} | ||
|
||
public Minutely15Options(Minutely15OptionsParameter parameter) | ||
{ | ||
Add(parameter); | ||
} | ||
|
||
public Minutely15Options(Minutely15OptionsParameter[] parameter) | ||
{ | ||
Add(parameter); | ||
} | ||
|
||
/// <summary> | ||
/// Index the collection | ||
/// </summary> | ||
/// <param name="index"></param> | ||
/// <returns><see cref="string"/> Minutely15OptionsParameter as string representation at index</returns> | ||
public Minutely15OptionsParameter this[int index] | ||
{ | ||
get { return _parameter[index]; } | ||
set | ||
{ | ||
_parameter[index] = value; | ||
} | ||
} | ||
|
||
public void Add(Minutely15OptionsParameter param) | ||
{ | ||
// Check that the parameter isn't already added | ||
if (_parameter.Contains(param)) return; | ||
|
||
_parameter.Add(param); | ||
} | ||
|
||
public void Add(Minutely15OptionsParameter[] param) | ||
{ | ||
foreach (Minutely15OptionsParameter paramToAdd in param) | ||
{ | ||
Add(paramToAdd); | ||
} | ||
} | ||
|
||
public void Clear() | ||
{ | ||
_parameter.Clear(); | ||
} | ||
|
||
public bool Contains(Minutely15OptionsParameter item) | ||
{ | ||
return _parameter.Contains(item); | ||
} | ||
|
||
public bool Remove(Minutely15OptionsParameter item) | ||
{ | ||
return _parameter.Remove(item); | ||
} | ||
|
||
public void CopyTo(Minutely15OptionsParameter[] array, int arrayIndex) | ||
{ | ||
_parameter.CopyTo(array, arrayIndex); | ||
} | ||
|
||
public IEnumerator<Minutely15OptionsParameter> GetEnumerator() | ||
{ | ||
return _parameter.GetEnumerator(); | ||
} | ||
|
||
IEnumerator IEnumerable.GetEnumerator() | ||
{ | ||
return this.GetEnumerator(); | ||
} | ||
} | ||
|
||
public enum Minutely15OptionsParameter | ||
{ | ||
temperature_2m, | ||
relativehumidity_2m, | ||
dewpoint_2m, | ||
apparent_temperature, | ||
precipitation, | ||
rain, | ||
snowfall, | ||
snowfall_height, | ||
freezinglevel_height, | ||
weathercode, | ||
windspeed_10m, | ||
windspeed_80m, | ||
winddirection_10m, | ||
winddirection_80m, | ||
windgusts_10m, | ||
visibility, | ||
cape, | ||
lightning_potential, | ||
shortwave_radiation, | ||
direct_radiation, | ||
diffuse_radiation, | ||
direct_normal_irradiance, | ||
terrestrial_radiation, | ||
shortwave_radiation_instant, | ||
direct_radiation_instant, | ||
diffuse_radiation_instant, | ||
direct_normal_irradiance_instant, | ||
terrestrial_radiation_instant | ||
} | ||
} |
Oops, something went wrong.