Example #1
0
        public void ConstruireLesPagesDePreduction()
        {
            InfoPresente = true;
            List <AffichageJour> ListeDesPages = new List <AffichageJour>();
            DataWilayaPrediction DonnesMeteo   = IOData.LireDonnesWilayaPrediction(@"..\..\DonneePre", NumWilaya, Duree);

            if (DonnesMeteo == null)
            {
                MessageBoxAlert.Show("Fin De la restauration.", "Les Donées de la wilaya : " + NumWilaya + " et la durée: " + Duree + "n'existe pas !");
            }
            else
            {
                ListeDesPrediction = DonnesMeteo.CalculerPreduction(DounneesToday);
                for (int i = 0; (i < 10 && i < ListeDesPrediction.Count); i++)
                {
                    AffichageJour LaPage = new AffichageJour();
                    SetElements(ref LaPage, ListeDesPrediction[i], NumWilaya);
                    ListeDesPages.Add(LaPage);
                }
                flipView1.ItemsSource = ListeDesPages;
            }
        }
Example #2
0
        public void SetElements(ref AffichageJour LaPage, Tuple <float, DayData> DataDuJour, int wilaya)
        {
            if (!DataDuJour.Item2.VideTempuratureMax() && ((bool)ToggTempurature.IsChecked))
            {
                LaPage.TempMax.Content = DataDuJour.Item2.TempuratureMax + " °";
            }
            else
            {
                LaPage.TmpMaxGrid.Visibility = Visibility.Hidden;
            }

            if (!DataDuJour.Item2.VideTempuratureMin() && ((bool)ToggTempurature.IsChecked))
            {
                LaPage.TempMin.Content = DataDuJour.Item2.TempuratureMin + " °";
            }
            else
            {
                LaPage.TmpMinGrid.Visibility = Visibility.Hidden;
            }

            if (!DataDuJour.Item2.VideHumidite() && ((bool)ToggHumidite.IsChecked))
            {
                LaPage.HumiditeBar.Value     = DataDuJour.Item2.Humidite;
                LaPage.HumiditeLabel.Content = DataDuJour.Item2.Humidite + " %";
            }
            else
            {
                LaPage.HumiditeGrid.Visibility = Visibility.Hidden;
            }

            if (!DataDuJour.Item2.VidePrecipitation() && ((bool)ToggPrecipitation.IsChecked))
            {
                LaPage.PrecipitationBar.Value     = DataDuJour.Item2.Precipitation;
                LaPage.PrecipitationLabel.Content = DataDuJour.Item2.Precipitation + " mm";
            }
            else
            {
                LaPage.PrecipitationGrid.Visibility = Visibility.Hidden;
            }
            if (!DataDuJour.Item2.VideNebulosite() && ((bool)ToggNebulosite.IsChecked))
            {
                LaPage.NubulisiteBar.Value     = DataDuJour.Item2.Nebulosite;
                LaPage.NubulisiteLabel.Content = DataDuJour.Item2.Nebulosite + " %";
            }
            else
            {
                LaPage.NubulositeGrig.Visibility = Visibility.Hidden;
            }


            if (!DataDuJour.Item2.VidePression() && ((bool)ToggPression.IsChecked))
            {
                LaPage.PressionBar.Value     = DataDuJour.Item2.Pression;
                LaPage.PressionLabel.Content = DataDuJour.Item2.Pression;
            }
            else
            {
                LaPage.PressionGrid.Visibility = Visibility.Hidden;
            }

            if (!DataDuJour.Item2.VideDistanceDeVisibilite() && ((bool)ToggVisibilite.IsChecked))
            {
                LaPage.VisibiliteBar.Value     = DataDuJour.Item2.DistanceDeVisibilite;
                LaPage.VisibiliteLabel.Content = DataDuJour.Item2.DistanceDeVisibilite + " Km";
            }
            else
            {
                LaPage.DistanceDeVisibiliteGrid.Visibility = Visibility.Hidden;
            }
            if (!DataDuJour.Item2.VideVitesseDuVent() && ((bool)ToggVent.IsChecked))
            {
                LaPage.LaBoussole.SetValue(DataDuJour.Item2.VitesseDuVent, DataDuJour.Item2.DirectionDuVent[0]);
            }
            else
            {
                LaPage.LaBoussole.Visibility = Visibility.Hidden;
            }
            LaPage.WilayaLabel.Content = (WilayaAlgerie)(wilaya - 1);
            LaPage.DureeLabel.Content  = "Prevision dans " + Duree + " jour";
            //LaPage.DateLabel.Content = DataDuJour.Item2.DateDuJour.ToLongDateString();
            LaPage.SimilariteGauge.Value = (int)DataDuJour.Item1;
        }