Projekt

Obecné

Profil

Stáhnout (1.83 KB) Statistiky
| Větev: | Tag: | Revize:
1
//
2
// Author: A. Konig
3
//
4

    
5
using System;
6

    
7
namespace ServerApp.Parser.InputData
8
{
9
    /// <summary>
10
    /// Data from weather data file
11
    /// 
12
    /// Csv format:
13
    ///     "30.04.2019 16:19:01";20.3;5.3;0;19
14
    ///     [date time];[temperature];[wind];[rain];[luminance]
15
    /// </summary>
16
    /// <author>A. Konig</author>
17
    public class WeatherInstance
18
    {
19
        /// <summary> Date and time </summary>
20
        // index 0
21
        public DateTime dateTime;
22
        /// <summary> Temperature in °C </summary>
23
        // index 1
24
        public double temp;
25
        /// <summary> Wind in m/s </summary>
26
        // index 2
27
        public double wind;
28
        /// <summary> Rain (0 if none, 1 if rain) </summary>
29
        // index 3
30
        public int rain;
31
        /// <summary>  Luminance in klux </summary>
32
        // index 4
33
        public double lum;
34

    
35
        /// <summary>
36
        /// Constructor
37
        /// </summary>
38
        /// <param name="date"></param>
39
        /// <param name="temp"></param>
40
        /// <param name="wind"></param>
41
        /// <param name="rain"></param>
42
        /// <param name="lum"></param>
43
        public WeatherInstance(DateTime date, double temp, double wind, int rain, double lum)
44
        {
45
            this.dateTime = date;
46
            this.temp = temp;
47
            this.wind = wind;
48
            this.rain = rain;
49
            this.lum = lum;
50
        }
51

    
52
        /// <summary>
53
        /// Eqquals
54
        /// </summary>
55
        /// <param name="obj"> Other object </param>
56
        /// <returns></returns>
57
        public override bool Equals(object obj)
58
        {
59
            WeatherInstance other = (WeatherInstance) obj;
60

    
61
            if (dateTime == other.dateTime && temp == other.temp && wind == other.wind && rain == other.rain && lum == other.lum)
62
                return true;
63

    
64
            return false;
65
        }
66
    }
67
}
(5-5/5)