From 7fdf86523c6c4a1bc8b29176de000b86e078efbe Mon Sep 17 00:00:00 2001
From: "de@itstall.de" <de@itstall.de>
Date: Tue, 4 Feb 2020 17:26:00 +0100
Subject: [PATCH] Added Data for rain & snow

---
 Wetterstation/Form1.Designer.cs | 126 ++++++++++++++++----------------
 Wetterstation/Form1.cs          |  17 +++--
 2 files changed, 72 insertions(+), 71 deletions(-)

diff --git a/Wetterstation/Form1.Designer.cs b/Wetterstation/Form1.Designer.cs
index 4309f81..982cecb 100644
--- a/Wetterstation/Form1.Designer.cs
+++ b/Wetterstation/Form1.Designer.cs
@@ -85,10 +85,10 @@ namespace Wetterstation
             this.lbSchneemenge = new System.Windows.Forms.Label();
             this.lb1hR = new System.Windows.Forms.Label();
             this.lb3hR = new System.Windows.Forms.Label();
-            this.lb1hRegenmenge = new System.Windows.Forms.Label();
-            this.lb3hRegenmenge = new System.Windows.Forms.Label();
-            this.lb3hSchneemenge = new System.Windows.Forms.Label();
-            this.lb1hSchneemenge = new System.Windows.Forms.Label();
+            this.lbRain1h = new System.Windows.Forms.Label();
+            this.lbRain3h = new System.Windows.Forms.Label();
+            this.lbSnow3h = new System.Windows.Forms.Label();
+            this.lbSnow1h = new System.Windows.Forms.Label();
             this.lb3hS = new System.Windows.Forms.Label();
             this.lb1hS = new System.Windows.Forms.Label();
             this.pbTendenzInnen = new System.Windows.Forms.PictureBox();
@@ -728,57 +728,57 @@ namespace Wetterstation
             this.lb3hR.TabIndex = 64;
             this.lb3hR.Text = "3h";
             // 
-            // lb1hRegenmenge
-            // 
-            this.lb1hRegenmenge.AutoSize = true;
-            this.lb1hRegenmenge.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147)))));
-            this.lb1hRegenmenge.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.lb1hRegenmenge.ForeColor = System.Drawing.SystemColors.ButtonFace;
-            this.lb1hRegenmenge.Location = new System.Drawing.Point(939, 358);
-            this.lb1hRegenmenge.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.lb1hRegenmenge.Name = "lb1hRegenmenge";
-            this.lb1hRegenmenge.Size = new System.Drawing.Size(52, 17);
-            this.lb1hRegenmenge.TabIndex = 65;
-            this.lb1hRegenmenge.Text = "NA l/h";
-            // 
-            // lb3hRegenmenge
-            // 
-            this.lb3hRegenmenge.AutoSize = true;
-            this.lb3hRegenmenge.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147)))));
-            this.lb3hRegenmenge.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.lb3hRegenmenge.ForeColor = System.Drawing.SystemColors.ButtonFace;
-            this.lb3hRegenmenge.Location = new System.Drawing.Point(939, 385);
-            this.lb3hRegenmenge.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.lb3hRegenmenge.Name = "lb3hRegenmenge";
-            this.lb3hRegenmenge.Size = new System.Drawing.Size(52, 17);
-            this.lb3hRegenmenge.TabIndex = 66;
-            this.lb3hRegenmenge.Text = "NA l/h";
-            // 
-            // lb3hSchneemenge
-            // 
-            this.lb3hSchneemenge.AutoSize = true;
-            this.lb3hSchneemenge.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147)))));
-            this.lb3hSchneemenge.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.lb3hSchneemenge.ForeColor = System.Drawing.SystemColors.ButtonFace;
-            this.lb3hSchneemenge.Location = new System.Drawing.Point(1109, 385);
-            this.lb3hSchneemenge.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.lb3hSchneemenge.Name = "lb3hSchneemenge";
-            this.lb3hSchneemenge.Size = new System.Drawing.Size(68, 17);
-            this.lb3hSchneemenge.TabIndex = 70;
-            this.lb3hSchneemenge.Text = "NA cm/h";
-            // 
-            // lb1hSchneemenge
-            // 
-            this.lb1hSchneemenge.AutoSize = true;
-            this.lb1hSchneemenge.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147)))));
-            this.lb1hSchneemenge.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.lb1hSchneemenge.ForeColor = System.Drawing.SystemColors.ButtonFace;
-            this.lb1hSchneemenge.Location = new System.Drawing.Point(1109, 358);
-            this.lb1hSchneemenge.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.lb1hSchneemenge.Name = "lb1hSchneemenge";
-            this.lb1hSchneemenge.Size = new System.Drawing.Size(68, 17);
-            this.lb1hSchneemenge.TabIndex = 69;
-            this.lb1hSchneemenge.Text = "NA cm/h";
+            // lbRain1h
+            // 
+            this.lbRain1h.AutoSize = true;
+            this.lbRain1h.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147)))));
+            this.lbRain1h.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lbRain1h.ForeColor = System.Drawing.SystemColors.ButtonFace;
+            this.lbRain1h.Location = new System.Drawing.Point(939, 358);
+            this.lbRain1h.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.lbRain1h.Name = "lbRain1h";
+            this.lbRain1h.Size = new System.Drawing.Size(52, 17);
+            this.lbRain1h.TabIndex = 65;
+            this.lbRain1h.Text = "NA l/h";
+            // 
+            // lbRain3h
+            // 
+            this.lbRain3h.AutoSize = true;
+            this.lbRain3h.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147)))));
+            this.lbRain3h.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lbRain3h.ForeColor = System.Drawing.SystemColors.ButtonFace;
+            this.lbRain3h.Location = new System.Drawing.Point(939, 385);
+            this.lbRain3h.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.lbRain3h.Name = "lbRain3h";
+            this.lbRain3h.Size = new System.Drawing.Size(52, 17);
+            this.lbRain3h.TabIndex = 66;
+            this.lbRain3h.Text = "NA l/h";
+            // 
+            // lbSnow3h
+            // 
+            this.lbSnow3h.AutoSize = true;
+            this.lbSnow3h.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147)))));
+            this.lbSnow3h.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lbSnow3h.ForeColor = System.Drawing.SystemColors.ButtonFace;
+            this.lbSnow3h.Location = new System.Drawing.Point(1109, 385);
+            this.lbSnow3h.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.lbSnow3h.Name = "lbSnow3h";
+            this.lbSnow3h.Size = new System.Drawing.Size(68, 17);
+            this.lbSnow3h.TabIndex = 70;
+            this.lbSnow3h.Text = "NA cm/h";
+            // 
+            // lbSnow1h
+            // 
+            this.lbSnow1h.AutoSize = true;
+            this.lbSnow1h.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147)))));
+            this.lbSnow1h.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lbSnow1h.ForeColor = System.Drawing.SystemColors.ButtonFace;
+            this.lbSnow1h.Location = new System.Drawing.Point(1109, 358);
+            this.lbSnow1h.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.lbSnow1h.Name = "lbSnow1h";
+            this.lbSnow1h.Size = new System.Drawing.Size(68, 17);
+            this.lbSnow1h.TabIndex = 69;
+            this.lbSnow1h.Text = "NA cm/h";
             // 
             // lb3hS
             // 
@@ -839,12 +839,12 @@ namespace Wetterstation
             this.ClientSize = new System.Drawing.Size(1344, 897);
             this.Controls.Add(this.pictureBox2);
             this.Controls.Add(this.pbTendenzInnen);
-            this.Controls.Add(this.lb3hSchneemenge);
-            this.Controls.Add(this.lb1hSchneemenge);
+            this.Controls.Add(this.lbSnow3h);
+            this.Controls.Add(this.lbSnow1h);
             this.Controls.Add(this.lb3hS);
             this.Controls.Add(this.lb1hS);
-            this.Controls.Add(this.lb3hRegenmenge);
-            this.Controls.Add(this.lb1hRegenmenge);
+            this.Controls.Add(this.lbRain3h);
+            this.Controls.Add(this.lbRain1h);
             this.Controls.Add(this.lb3hR);
             this.Controls.Add(this.lb1hR);
             this.Controls.Add(this.lbSchneemenge);
@@ -963,10 +963,10 @@ namespace Wetterstation
         private Label lbSchneemenge;
         private Label lb1hR;
         private Label lb3hR;
-        private Label lb1hRegenmenge;
-        private Label lb3hRegenmenge;
-        private Label lb3hSchneemenge;
-        private Label lb1hSchneemenge;
+        private Label lbRain1h;
+        private Label lbRain3h;
+        private Label lbSnow3h;
+        private Label lbSnow1h;
         private Label lb3hS;
         private Label lb1hS;
         private PictureBox pbTendenzInnen;
diff --git a/Wetterstation/Form1.cs b/Wetterstation/Form1.cs
index 167e1e0..52365b0 100644
--- a/Wetterstation/Form1.cs
+++ b/Wetterstation/Form1.cs
@@ -70,28 +70,28 @@ namespace Wetterstation
 
             cartesianChart1.AxisY.Add(new Axis
             {
-                LabelFormatter = val => val + "°C",
+                LabelFormatter = val => val + " °C",
                 IsEnabled = false,
                 Position = AxisPosition.LeftBottom
             });
 
             cartesianChart1.AxisY.Add(new Axis
             {
-                LabelFormatter = val => val + "%",
+                LabelFormatter = val => val + " %",
                 IsEnabled = false,
                 Position = AxisPosition.LeftBottom
             });
 
             cartesianChart1.AxisY.Add(new Axis
             {
-                LabelFormatter = val => val + "hPa",
+                LabelFormatter = val => val + " hPa",
                 IsEnabled = true,
                 Position = AxisPosition.RightTop
             });
 
             cartesianChart1.AxisY.Add(new Axis
             {
-                LabelFormatter = val => val + "ms",
+                LabelFormatter = val => val + " ms",
                 IsEnabled = false,
                 Position = AxisPosition.LeftBottom
             });
@@ -242,10 +242,11 @@ namespace Wetterstation
                 lbWindSpeed.Invoke(new Action(() => { lbWindSpeed.Text = weatherData.windSpeed + " ms"; }));
                 lbWindricht.Invoke(new Action(() => { lbWindricht.Text = weatherData.windDeg + " °"; }));
                 lbLuftdruck.Invoke(new Action(() => { lbLuftdruck.Text = weatherData.pressure + " mbar"; }));
-                pbKompassrose.Invoke(new Action(() => {
-                    pbKompassrose.Image = RotateImage((Bitmap)global::Wetterstation.Properties.Resources.ResourceManager.GetObject("WindRose_neu"), (int)weatherData.windDeg);
-                }));
-
+                pbKompassrose.Invoke(new Action(() => { pbKompassrose.Image = RotateImage((Bitmap)global::Wetterstation.Properties.Resources.ResourceManager.GetObject("WindRose_neu"), (int)weatherData.windDeg); }));
+                lbRain1h.Invoke(new Action(() => { lbRain1h.Text = weatherData.rain1h + " L/h"; }));
+                lbRain3h.Invoke(new Action(() => { lbRain3h.Text = weatherData.rain3h + " L/h"; }));
+                lbSnow1h.Invoke(new Action(() => { lbSnow1h.Text = weatherData.snow1h + " mm/h"; }));
+                lbSnow3h.Invoke(new Action(() => { lbSnow3h.Text = weatherData.snow3h + " mm/h"; }));
             }
             catch (Exception ignored) { }
         }
-- 
GitLab