Esempio n. 1
0
        /// <summary>
        /// Triggers Events for Sunrise and Sunset
        /// </summary>
        private void InvokeDayTimeEvent()
        {
            if (_isNight && timeOfDay >= 0.25 && timeOfDay < 0.70)
            {
                _isNight = !_isNight;
                SunRise?.Invoke();
            }

            if (!_isNight && timeOfDay >= 0.70)
            {
                _isNight = !_isNight;
                SunSet?.Invoke();
            }

            if (!_moonShines && timeOfDay >= 0.85)
            {
                _moonShines = !_moonShines;
                MoonRise?.Invoke();
            }

            if (_moonShines && TimeOfDay > 0.15 && timeOfDay < 0.85)
            {
                _moonShines = !_moonShines;
                MoonSet?.Invoke();
            }
        }
Esempio n. 2
0
 /// <summary>
 /// initForecastObjects init and allocate all forecast objects
 /// </summary>
 private void initForecastObjects()
 {
     this.location      = new Location();
     this.sunRise       = new SunRise();
     this.temperature   = new Temperature();
     this.humidity      = new Humidity();
     this.pressure      = new Pressure();
     this.windSpeed     = new WindSpeed();
     this.windDirection = new WindDirection();
     this.clouds        = new Clouds();
     this.precipitation = new Precipitation();
     this.weather       = new Weather();
     this.lastupdate    = new Lastupdate();
 }
Esempio n. 3
0
 public override string ToString()
 {
     return(string.Format("{0}\t{1,3:N0}\t{2,3:N0}\t{3,3:N0}\t{4,3:N0}\t{5,3:N0}\t{6,6:N1}\t{7,3:N0}\t{8,3:N0}\t{9,3:N0}\t{10,3:N0}\t{11,3:N0}\t{12,3:N0} \t{13} \t{14} \t{15} \t{16}",
                          TakenAt.ToString("ddMMMyy HH:mm"), // 0
                          TempAir,                           // 1
                          Humidity,                          // 2
                          DewPoint,                          // 3
                          WindKmH,                           // 4
                          WindGust,                          // 5
                          Pressure,                          // 6
                          Visibility,                        // 7
                          Humidex,                           // 8
                          TempYesterdayMin,                  // 9
                          TempYesterdayMax,                  // 10
                          TempNormMin,                       // 11
                          TempNormMax,                       // 12
                          SunRise.ToString("ddMMMyy HH:mm"), // 13
                          SunSet.ToString("ddMMMyy HH:mm"),  // 14
                          Conditions,                        // 15
                          WindDir));                         // 16
 }
 /// <summary>
 /// initForecastObjects init and allocate all forecast objects
 /// </summary>
 private void initForecastObjects()
 {
     this.location = new Location();
     this.sunRise = new SunRise();
     this.temperature = new Temperature();
     this.humidity = new Humidity();
     this.pressure = new Pressure();
     this.windSpeed = new WindSpeed();
     this.windDirection = new WindDirection();
     this.clouds = new Clouds();
     this.precipitation = new Precipitation();
     this.weather = new Weather();
     this.lastupdate = new Lastupdate();
 }