diff --git a/Wetterstation/Form1.Designer.cs b/Wetterstation/Form1.Designer.cs index 7e6ab1850b0d63edec032bd751e8c5552a1a6428..f1148402492fc63bae5b94797b2777cb6fdb1280 100644 --- a/Wetterstation/Form1.Designer.cs +++ b/Wetterstation/Form1.Designer.cs @@ -36,10 +36,10 @@ namespace Wetterstation /// </summary> private void InitializeComponent() { - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); - System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend(); + System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series(); + System.Windows.Forms.DataVisualization.Charting.Title title2 = new System.Windows.Forms.DataVisualization.Charting.Title(); this.lbTextInnentemp = new System.Windows.Forms.Label(); this.lbTextAussentemp = new System.Windows.Forms.Label(); this.lbTextWindSpeed = new System.Windows.Forms.Label(); @@ -54,15 +54,15 @@ namespace Wetterstation this.lbUhr = new System.Windows.Forms.Label(); this.lbDatum = new System.Windows.Forms.Label(); this.lbTextTendenz = new System.Windows.Forms.Label(); - this.lbWT1 = new System.Windows.Forms.Label(); - this.picTg2 = new System.Windows.Forms.PictureBox(); - this.picTg3 = new System.Windows.Forms.PictureBox(); - this.picTg4 = new System.Windows.Forms.PictureBox(); - this.picTg5 = new System.Windows.Forms.PictureBox(); - this.lbWt2 = new System.Windows.Forms.Label(); - this.lbWt3 = new System.Windows.Forms.Label(); - this.lbWt4 = new System.Windows.Forms.Label(); - this.lbWt5 = new System.Windows.Forms.Label(); + this.lbForecastDay1 = new System.Windows.Forms.Label(); + this.lbForecastImage2 = new System.Windows.Forms.PictureBox(); + this.lbForecastImage3 = new System.Windows.Forms.PictureBox(); + this.lbForecastImage4 = new System.Windows.Forms.PictureBox(); + this.lbForecastImage5 = new System.Windows.Forms.PictureBox(); + this.lbForecastDay2 = new System.Windows.Forms.Label(); + this.lbForecastDay3 = new System.Windows.Forms.Label(); + this.lbForecastDay4 = new System.Windows.Forms.Label(); + this.lbForecastDay5 = new System.Windows.Forms.Label(); this.lbLuftfeuchtAussen = new System.Windows.Forms.Label(); this.lbTextLuftfeuchtAussen = new System.Windows.Forms.Label(); this.lbTextLuftdruck = new System.Windows.Forms.Label(); @@ -70,7 +70,7 @@ namespace Wetterstation this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.lbHintergrund = new System.Windows.Forms.Label(); this.lbCity = new System.Windows.Forms.Label(); - this.picTg1 = new System.Windows.Forms.PictureBox(); + this.lbForecastImage1 = new System.Windows.Forms.PictureBox(); this.btSystemKnopf = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); @@ -80,13 +80,18 @@ namespace Wetterstation this.lbTempMax = new System.Windows.Forms.Label(); this.lbTempMin = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label(); + this.lbForecastTemp1 = new System.Windows.Forms.Label(); + this.lbForecastTemp2 = new System.Windows.Forms.Label(); + this.lbForecastTemp3 = new System.Windows.Forms.Label(); + this.lbForecastTemp4 = new System.Windows.Forms.Label(); + this.lbForecastTemp5 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.picTg2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.picTg3)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.picTg4)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.picTg5)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.lbForecastImage2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.lbForecastImage3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.lbForecastImage4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.lbForecastImage5)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.picTg1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.lbForecastImage1)).BeginInit(); this.SuspendLayout(); // // lbTextInnentemp @@ -176,9 +181,9 @@ namespace Wetterstation this.lbInnenTemp.Location = new System.Drawing.Point(177, 54); this.lbInnenTemp.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbInnenTemp.Name = "lbInnenTemp"; - this.lbInnenTemp.Size = new System.Drawing.Size(306, 93); + this.lbInnenTemp.Size = new System.Drawing.Size(262, 93); this.lbInnenTemp.TabIndex = 13; - this.lbInnenTemp.Text = "23,3 C°"; + this.lbInnenTemp.Text = "NA C°"; // // lbAussenTemp // @@ -190,9 +195,9 @@ namespace Wetterstation this.lbAussenTemp.Location = new System.Drawing.Point(176, 186); this.lbAussenTemp.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbAussenTemp.Name = "lbAussenTemp"; - this.lbAussenTemp.Size = new System.Drawing.Size(196, 93); + this.lbAussenTemp.Size = new System.Drawing.Size(262, 93); this.lbAussenTemp.TabIndex = 15; - this.lbAussenTemp.Text = "0 C°"; + this.lbAussenTemp.Text = "NA °C"; // // lbWindSpeed // @@ -203,9 +208,9 @@ namespace Wetterstation this.lbWindSpeed.Location = new System.Drawing.Point(844, 55); this.lbWindSpeed.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbWindSpeed.Name = "lbWindSpeed"; - this.lbWindSpeed.Size = new System.Drawing.Size(83, 35); + this.lbWindSpeed.Size = new System.Drawing.Size(108, 35); this.lbWindSpeed.TabIndex = 16; - this.lbWindSpeed.Text = "0 ms"; + this.lbWindSpeed.Text = "NA ms"; // // lbLuftFeuchtInnen // @@ -216,9 +221,9 @@ namespace Wetterstation this.lbLuftFeuchtInnen.Location = new System.Drawing.Point(547, 63); this.lbLuftFeuchtInnen.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbLuftFeuchtInnen.Name = "lbLuftFeuchtInnen"; - this.lbLuftFeuchtInnen.Size = new System.Drawing.Size(131, 70); + this.lbLuftFeuchtInnen.Size = new System.Drawing.Size(180, 70); this.lbLuftFeuchtInnen.TabIndex = 17; - this.lbLuftFeuchtInnen.Text = "0 %"; + this.lbLuftFeuchtInnen.Text = "NA %"; // // lbWindricht // @@ -229,9 +234,9 @@ namespace Wetterstation this.lbWindricht.Location = new System.Drawing.Point(1185, 199); this.lbWindricht.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbWindricht.Name = "lbWindricht"; - this.lbWindricht.Size = new System.Drawing.Size(67, 32); + this.lbWindricht.Size = new System.Drawing.Size(54, 32); this.lbWindricht.TabIndex = 18; - this.lbWindricht.Text = "Süd"; + this.lbWindricht.Text = "NA"; // // lbUhr // @@ -272,119 +277,119 @@ namespace Wetterstation this.lbTextTendenz.TabIndex = 25; this.lbTextTendenz.Text = "Tendenz"; // - // lbWT1 - // - this.lbWT1.Anchor = System.Windows.Forms.AnchorStyles.None; - this.lbWT1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); - this.lbWT1.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbWT1.ForeColor = System.Drawing.SystemColors.ButtonHighlight; - this.lbWT1.Location = new System.Drawing.Point(169, 293); - this.lbWT1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lbWT1.Name = "lbWT1"; - this.lbWT1.Size = new System.Drawing.Size(64, 58); - this.lbWT1.TabIndex = 27; - this.lbWT1.Text = "MO"; - this.lbWT1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // picTg2 - // - this.picTg2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); - this.picTg2.Location = new System.Drawing.Point(236, 334); - this.picTg2.Margin = new System.Windows.Forms.Padding(4); - this.picTg2.Name = "picTg2"; - this.picTg2.Size = new System.Drawing.Size(71, 54); - this.picTg2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.picTg2.TabIndex = 29; - this.picTg2.TabStop = false; - // - // picTg3 - // - this.picTg3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); - this.picTg3.Location = new System.Drawing.Point(307, 334); - this.picTg3.Margin = new System.Windows.Forms.Padding(4); - this.picTg3.Name = "picTg3"; - this.picTg3.Size = new System.Drawing.Size(71, 54); - this.picTg3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.picTg3.TabIndex = 30; - this.picTg3.TabStop = false; - // - // picTg4 - // - this.picTg4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); - this.picTg4.Location = new System.Drawing.Point(376, 334); - this.picTg4.Margin = new System.Windows.Forms.Padding(4); - this.picTg4.Name = "picTg4"; - this.picTg4.Size = new System.Drawing.Size(71, 54); - this.picTg4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.picTg4.TabIndex = 31; - this.picTg4.TabStop = false; - // - // picTg5 - // - this.picTg5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); - this.picTg5.Location = new System.Drawing.Point(441, 334); - this.picTg5.Margin = new System.Windows.Forms.Padding(4); - this.picTg5.Name = "picTg5"; - this.picTg5.Size = new System.Drawing.Size(71, 54); - this.picTg5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.picTg5.TabIndex = 32; - this.picTg5.TabStop = false; - // - // lbWt2 - // - this.lbWt2.Anchor = System.Windows.Forms.AnchorStyles.None; - this.lbWt2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); - this.lbWt2.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbWt2.ForeColor = System.Drawing.SystemColors.ButtonHighlight; - this.lbWt2.Location = new System.Drawing.Point(239, 293); - this.lbWt2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lbWt2.Name = "lbWt2"; - this.lbWt2.Size = new System.Drawing.Size(64, 58); - this.lbWt2.TabIndex = 33; - this.lbWt2.Text = "DI"; - this.lbWt2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // lbWt3 - // - this.lbWt3.Anchor = System.Windows.Forms.AnchorStyles.None; - this.lbWt3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); - this.lbWt3.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbWt3.ForeColor = System.Drawing.SystemColors.ButtonHighlight; - this.lbWt3.Location = new System.Drawing.Point(312, 293); - this.lbWt3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lbWt3.Name = "lbWt3"; - this.lbWt3.Size = new System.Drawing.Size(64, 58); - this.lbWt3.TabIndex = 34; - this.lbWt3.Text = "Mi"; - this.lbWt3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // lbWt4 - // - this.lbWt4.Anchor = System.Windows.Forms.AnchorStyles.None; - this.lbWt4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); - this.lbWt4.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbWt4.ForeColor = System.Drawing.SystemColors.ButtonHighlight; - this.lbWt4.Location = new System.Drawing.Point(376, 293); - this.lbWt4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lbWt4.Name = "lbWt4"; - this.lbWt4.Size = new System.Drawing.Size(64, 58); - this.lbWt4.TabIndex = 35; - this.lbWt4.Text = "DO"; - this.lbWt4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // lbWt5 - // - this.lbWt5.Anchor = System.Windows.Forms.AnchorStyles.None; - this.lbWt5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); - this.lbWt5.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbWt5.ForeColor = System.Drawing.SystemColors.ButtonHighlight; - this.lbWt5.Location = new System.Drawing.Point(444, 293); - this.lbWt5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lbWt5.Name = "lbWt5"; - this.lbWt5.Size = new System.Drawing.Size(64, 58); - this.lbWt5.TabIndex = 36; - this.lbWt5.Text = "FR"; - this.lbWt5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // lbForecastDay1 + // + this.lbForecastDay1.Anchor = System.Windows.Forms.AnchorStyles.None; + this.lbForecastDay1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbForecastDay1.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbForecastDay1.ForeColor = System.Drawing.SystemColors.ButtonHighlight; + this.lbForecastDay1.Location = new System.Drawing.Point(169, 293); + this.lbForecastDay1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lbForecastDay1.Name = "lbForecastDay1"; + this.lbForecastDay1.Size = new System.Drawing.Size(64, 58); + this.lbForecastDay1.TabIndex = 27; + this.lbForecastDay1.Text = "MO"; + this.lbForecastDay1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lbForecastImage2 + // + this.lbForecastImage2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbForecastImage2.Location = new System.Drawing.Point(236, 334); + this.lbForecastImage2.Margin = new System.Windows.Forms.Padding(4); + this.lbForecastImage2.Name = "lbForecastImage2"; + this.lbForecastImage2.Size = new System.Drawing.Size(71, 68); + this.lbForecastImage2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.lbForecastImage2.TabIndex = 29; + this.lbForecastImage2.TabStop = false; + // + // lbForecastImage3 + // + this.lbForecastImage3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbForecastImage3.Location = new System.Drawing.Point(307, 334); + this.lbForecastImage3.Margin = new System.Windows.Forms.Padding(4); + this.lbForecastImage3.Name = "lbForecastImage3"; + this.lbForecastImage3.Size = new System.Drawing.Size(71, 68); + this.lbForecastImage3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.lbForecastImage3.TabIndex = 30; + this.lbForecastImage3.TabStop = false; + // + // lbForecastImage4 + // + this.lbForecastImage4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbForecastImage4.Location = new System.Drawing.Point(376, 334); + this.lbForecastImage4.Margin = new System.Windows.Forms.Padding(4); + this.lbForecastImage4.Name = "lbForecastImage4"; + this.lbForecastImage4.Size = new System.Drawing.Size(71, 68); + this.lbForecastImage4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.lbForecastImage4.TabIndex = 31; + this.lbForecastImage4.TabStop = false; + // + // lbForecastImage5 + // + this.lbForecastImage5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbForecastImage5.Location = new System.Drawing.Point(441, 334); + this.lbForecastImage5.Margin = new System.Windows.Forms.Padding(4); + this.lbForecastImage5.Name = "lbForecastImage5"; + this.lbForecastImage5.Size = new System.Drawing.Size(71, 68); + this.lbForecastImage5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.lbForecastImage5.TabIndex = 32; + this.lbForecastImage5.TabStop = false; + // + // lbForecastDay2 + // + this.lbForecastDay2.Anchor = System.Windows.Forms.AnchorStyles.None; + this.lbForecastDay2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbForecastDay2.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbForecastDay2.ForeColor = System.Drawing.SystemColors.ButtonHighlight; + this.lbForecastDay2.Location = new System.Drawing.Point(239, 293); + this.lbForecastDay2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lbForecastDay2.Name = "lbForecastDay2"; + this.lbForecastDay2.Size = new System.Drawing.Size(64, 58); + this.lbForecastDay2.TabIndex = 33; + this.lbForecastDay2.Text = "DI"; + this.lbForecastDay2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lbForecastDay3 + // + this.lbForecastDay3.Anchor = System.Windows.Forms.AnchorStyles.None; + this.lbForecastDay3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbForecastDay3.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbForecastDay3.ForeColor = System.Drawing.SystemColors.ButtonHighlight; + this.lbForecastDay3.Location = new System.Drawing.Point(312, 293); + this.lbForecastDay3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lbForecastDay3.Name = "lbForecastDay3"; + this.lbForecastDay3.Size = new System.Drawing.Size(64, 58); + this.lbForecastDay3.TabIndex = 34; + this.lbForecastDay3.Text = "Mi"; + this.lbForecastDay3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lbForecastDay4 + // + this.lbForecastDay4.Anchor = System.Windows.Forms.AnchorStyles.None; + this.lbForecastDay4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbForecastDay4.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbForecastDay4.ForeColor = System.Drawing.SystemColors.ButtonHighlight; + this.lbForecastDay4.Location = new System.Drawing.Point(376, 293); + this.lbForecastDay4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lbForecastDay4.Name = "lbForecastDay4"; + this.lbForecastDay4.Size = new System.Drawing.Size(64, 58); + this.lbForecastDay4.TabIndex = 35; + this.lbForecastDay4.Text = "DO"; + this.lbForecastDay4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lbForecastDay5 + // + this.lbForecastDay5.Anchor = System.Windows.Forms.AnchorStyles.None; + this.lbForecastDay5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbForecastDay5.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbForecastDay5.ForeColor = System.Drawing.SystemColors.ButtonHighlight; + this.lbForecastDay5.Location = new System.Drawing.Point(444, 293); + this.lbForecastDay5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lbForecastDay5.Name = "lbForecastDay5"; + this.lbForecastDay5.Size = new System.Drawing.Size(64, 58); + this.lbForecastDay5.TabIndex = 36; + this.lbForecastDay5.Text = "FR"; + this.lbForecastDay5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lbLuftfeuchtAussen // @@ -395,9 +400,9 @@ namespace Wetterstation this.lbLuftfeuchtAussen.Location = new System.Drawing.Point(549, 196); this.lbLuftfeuchtAussen.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbLuftfeuchtAussen.Name = "lbLuftfeuchtAussen"; - this.lbLuftfeuchtAussen.Size = new System.Drawing.Size(131, 70); + this.lbLuftfeuchtAussen.Size = new System.Drawing.Size(180, 70); this.lbLuftfeuchtAussen.TabIndex = 37; - this.lbLuftfeuchtAussen.Text = "0 %"; + this.lbLuftfeuchtAussen.Text = "NA %"; // // lbTextLuftfeuchtAussen // @@ -434,30 +439,30 @@ namespace Wetterstation this.lbLuftdruck.Location = new System.Drawing.Point(832, 135); this.lbLuftdruck.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbLuftdruck.Name = "lbLuftdruck"; - this.lbLuftdruck.Size = new System.Drawing.Size(95, 35); + this.lbLuftdruck.Size = new System.Drawing.Size(120, 35); this.lbLuftdruck.TabIndex = 40; - this.lbLuftdruck.Text = "0 hPa"; + this.lbLuftdruck.Text = "NA hPa"; // // chart1 // this.chart1.Anchor = System.Windows.Forms.AnchorStyles.None; - chartArea1.Name = "ChartArea1"; - this.chart1.ChartAreas.Add(chartArea1); - legend1.Name = "Legend1"; - this.chart1.Legends.Add(legend1); + chartArea2.Name = "ChartArea1"; + this.chart1.ChartAreas.Add(chartArea2); + legend2.Name = "Legend1"; + this.chart1.Legends.Add(legend2); this.chart1.Location = new System.Drawing.Point(37, 672); this.chart1.Margin = new System.Windows.Forms.Padding(4); this.chart1.Name = "chart1"; this.chart1.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.Excel; - series1.ChartArea = "ChartArea1"; - series1.Legend = "Legend1"; - series1.Name = "Series1"; - this.chart1.Series.Add(series1); + series2.ChartArea = "ChartArea1"; + series2.Legend = "Legend1"; + series2.Name = "Series1"; + this.chart1.Series.Add(series2); this.chart1.Size = new System.Drawing.Size(991, 132); this.chart1.TabIndex = 41; this.chart1.Text = "chTendenz"; - title1.Name = "Title1"; - this.chart1.Titles.Add(title1); + title2.Name = "Title1"; + this.chart1.Titles.Add(title2); // // lbHintergrund // @@ -466,7 +471,7 @@ namespace Wetterstation this.lbHintergrund.Location = new System.Drawing.Point(16, 22); this.lbHintergrund.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbHintergrund.Name = "lbHintergrund"; - this.lbHintergrund.Size = new System.Drawing.Size(1312, 370); + this.lbHintergrund.Size = new System.Drawing.Size(1312, 436); this.lbHintergrund.TabIndex = 42; // // lbCity @@ -479,19 +484,20 @@ namespace Wetterstation this.lbCity.Name = "lbCity"; this.lbCity.Size = new System.Drawing.Size(1343, 62); this.lbCity.TabIndex = 43; - this.lbCity.Text = "Hier könnte ihr Ort stehen"; + this.lbCity.Text = "Ort: NA"; this.lbCity.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // picTg1 + // lbForecastImage1 // - this.picTg1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); - this.picTg1.Location = new System.Drawing.Point(165, 334); - this.picTg1.Margin = new System.Windows.Forms.Padding(4); - this.picTg1.Name = "picTg1"; - this.picTg1.Size = new System.Drawing.Size(71, 54); - this.picTg1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.picTg1.TabIndex = 44; - this.picTg1.TabStop = false; + this.lbForecastImage1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbForecastImage1.InitialImage = global::Wetterstation.Properties.Resources._01d_2x; + this.lbForecastImage1.Location = new System.Drawing.Point(165, 334); + this.lbForecastImage1.Margin = new System.Windows.Forms.Padding(4); + this.lbForecastImage1.Name = "lbForecastImage1"; + this.lbForecastImage1.Size = new System.Drawing.Size(71, 68); + this.lbForecastImage1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.lbForecastImage1.TabIndex = 44; + this.lbForecastImage1.TabStop = false; // // btSystemKnopf // @@ -510,82 +516,166 @@ namespace Wetterstation // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(100, 607); + this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.label1.Location = new System.Drawing.Point(636, 358); this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(37, 17); + this.label1.Size = new System.Drawing.Size(41, 17); this.label1.TabIndex = 47; this.label1.Text = "max."; // // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(100, 634); + this.label2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.label2.Location = new System.Drawing.Point(639, 385); this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(34, 17); + this.label2.Size = new System.Drawing.Size(38, 17); this.label2.TabIndex = 48; this.label2.Text = "min."; // // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(163, 583); + this.label4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label4.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.label4.Location = new System.Drawing.Point(702, 334); this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(43, 17); + this.label4.Size = new System.Drawing.Size(48, 17); this.label4.TabIndex = 49; this.label4.Text = "Innen"; // // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(287, 583); + this.label3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label3.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.label3.Location = new System.Drawing.Point(777, 334); this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(55, 17); + this.label3.Size = new System.Drawing.Size(61, 17); this.label3.TabIndex = 50; this.label3.Text = "Aussen"; // // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(161, 607); + this.label5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label5.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.label5.Location = new System.Drawing.Point(697, 358); this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(55, 17); + this.label5.Size = new System.Drawing.Size(51, 17); this.label5.TabIndex = 51; - this.label5.Text = "12,4 C°"; + this.label5.Text = "NA C°"; // // lbTempMax // this.lbTempMax.AutoSize = true; - this.lbTempMax.Location = new System.Drawing.Point(281, 607); + this.lbTempMax.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbTempMax.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbTempMax.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.lbTempMax.Location = new System.Drawing.Point(786, 358); this.lbTempMax.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbTempMax.Name = "lbTempMax"; - this.lbTempMax.Size = new System.Drawing.Size(35, 17); + this.lbTempMax.Size = new System.Drawing.Size(51, 17); this.lbTempMax.TabIndex = 52; - this.lbTempMax.Text = "0 C°"; + this.lbTempMax.Text = "NA C°"; // // lbTempMin // this.lbTempMin.AutoSize = true; - this.lbTempMin.Location = new System.Drawing.Point(281, 634); + this.lbTempMin.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbTempMin.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbTempMin.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.lbTempMin.Location = new System.Drawing.Point(786, 385); this.lbTempMin.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbTempMin.Name = "lbTempMin"; - this.lbTempMin.Size = new System.Drawing.Size(35, 17); + this.lbTempMin.Size = new System.Drawing.Size(51, 17); this.lbTempMin.TabIndex = 54; - this.lbTempMin.Text = "0 C°"; + this.lbTempMin.Text = "NA C°"; // // label8 // this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(161, 634); + this.label8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label8.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.label8.Location = new System.Drawing.Point(699, 385); this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(55, 17); + this.label8.Size = new System.Drawing.Size(51, 17); this.label8.TabIndex = 53; - this.label8.Text = "12,4 C°"; + this.label8.Text = "NA C°"; + // + // lbForecastTemp1 + // + this.lbForecastTemp1.AutoSize = true; + this.lbForecastTemp1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbForecastTemp1.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbForecastTemp1.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.lbForecastTemp1.Location = new System.Drawing.Point(177, 406); + this.lbForecastTemp1.Name = "lbForecastTemp1"; + this.lbForecastTemp1.Size = new System.Drawing.Size(51, 17); + this.lbForecastTemp1.TabIndex = 55; + this.lbForecastTemp1.Text = "NA °C"; + // + // lbForecastTemp2 + // + this.lbForecastTemp2.AutoSize = true; + this.lbForecastTemp2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbForecastTemp2.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbForecastTemp2.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.lbForecastTemp2.Location = new System.Drawing.Point(249, 406); + this.lbForecastTemp2.Name = "lbForecastTemp2"; + this.lbForecastTemp2.Size = new System.Drawing.Size(51, 17); + this.lbForecastTemp2.TabIndex = 56; + this.lbForecastTemp2.Text = "NA °C"; + // + // lbForecastTemp3 + // + this.lbForecastTemp3.AutoSize = true; + this.lbForecastTemp3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbForecastTemp3.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbForecastTemp3.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.lbForecastTemp3.Location = new System.Drawing.Point(319, 406); + this.lbForecastTemp3.Name = "lbForecastTemp3"; + this.lbForecastTemp3.Size = new System.Drawing.Size(51, 17); + this.lbForecastTemp3.TabIndex = 57; + this.lbForecastTemp3.Text = "NA °C"; + // + // lbForecastTemp4 + // + this.lbForecastTemp4.AutoSize = true; + this.lbForecastTemp4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbForecastTemp4.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbForecastTemp4.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.lbForecastTemp4.Location = new System.Drawing.Point(384, 406); + this.lbForecastTemp4.Name = "lbForecastTemp4"; + this.lbForecastTemp4.Size = new System.Drawing.Size(51, 17); + this.lbForecastTemp4.TabIndex = 58; + this.lbForecastTemp4.Text = "NA °C"; + // + // lbForecastTemp5 + // + this.lbForecastTemp5.AutoSize = true; + this.lbForecastTemp5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(10)))), ((int)(((byte)(80)))), ((int)(((byte)(147))))); + this.lbForecastTemp5.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbForecastTemp5.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.lbForecastTemp5.Location = new System.Drawing.Point(452, 406); + this.lbForecastTemp5.Name = "lbForecastTemp5"; + this.lbForecastTemp5.Size = new System.Drawing.Size(51, 17); + this.lbForecastTemp5.TabIndex = 59; + this.lbForecastTemp5.Text = "NA °C"; // // Hintergrund // @@ -594,6 +684,11 @@ namespace Wetterstation this.BackgroundImage = global::Wetterstation.Properties.Resources.Bild_Dennis_Formatiert; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.ClientSize = new System.Drawing.Size(1344, 897); + this.Controls.Add(this.lbForecastTemp5); + this.Controls.Add(this.lbForecastTemp4); + this.Controls.Add(this.lbForecastTemp3); + this.Controls.Add(this.lbForecastTemp2); + this.Controls.Add(this.lbForecastTemp1); this.Controls.Add(this.lbTempMin); this.Controls.Add(this.label8); this.Controls.Add(this.lbTempMax); @@ -603,22 +698,22 @@ namespace Wetterstation this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Controls.Add(this.btSystemKnopf); - this.Controls.Add(this.picTg1); - this.Controls.Add(this.lbWT1); - this.Controls.Add(this.lbWt2); - this.Controls.Add(this.lbWt3); - this.Controls.Add(this.lbWt4); - this.Controls.Add(this.lbWt5); + this.Controls.Add(this.lbForecastImage1); + this.Controls.Add(this.lbForecastDay1); + this.Controls.Add(this.lbForecastDay2); + this.Controls.Add(this.lbForecastDay3); + this.Controls.Add(this.lbForecastDay4); + this.Controls.Add(this.lbForecastDay5); this.Controls.Add(this.lbAussenTemp); this.Controls.Add(this.chart1); this.Controls.Add(this.lbLuftdruck); this.Controls.Add(this.lbTextLuftdruck); this.Controls.Add(this.lbTextLuftfeuchtAussen); this.Controls.Add(this.lbLuftfeuchtAussen); - this.Controls.Add(this.picTg5); - this.Controls.Add(this.picTg4); - this.Controls.Add(this.picTg3); - this.Controls.Add(this.picTg2); + this.Controls.Add(this.lbForecastImage5); + this.Controls.Add(this.lbForecastImage4); + this.Controls.Add(this.lbForecastImage3); + this.Controls.Add(this.lbForecastImage2); this.Controls.Add(this.lbTextTendenz); this.Controls.Add(this.lbDatum); this.Controls.Add(this.lbUhr); @@ -638,14 +733,15 @@ namespace Wetterstation this.Margin = new System.Windows.Forms.Padding(4); this.Name = "Hintergrund"; this.Text = "Wetterstation"; + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Hintergrund_FormClosed); this.Load += new System.EventHandler(this.Hintergrund_Load); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.picTg2)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.picTg3)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.picTg4)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.picTg5)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.lbForecastImage2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.lbForecastImage3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.lbForecastImage4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.lbForecastImage5)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.picTg1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.lbForecastImage1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -667,15 +763,15 @@ namespace Wetterstation private System.Windows.Forms.Label lbUhr; private System.Windows.Forms.Label lbDatum; private System.Windows.Forms.Label lbTextTendenz; - private Label lbWT1; - private PictureBox picTg2; - private PictureBox picTg3; - private PictureBox picTg4; - private PictureBox picTg5; - private Label lbWt2; - private Label lbWt3; - private Label lbWt4; - private Label lbWt5; + private Label lbForecastDay1; + private PictureBox lbForecastImage2; + private PictureBox lbForecastImage3; + private PictureBox lbForecastImage4; + private PictureBox lbForecastImage5; + private Label lbForecastDay2; + private Label lbForecastDay3; + private Label lbForecastDay4; + private Label lbForecastDay5; private Label lbLuftfeuchtAussen; private Label lbTextLuftfeuchtAussen; private Label lbTextLuftdruck; @@ -683,7 +779,7 @@ namespace Wetterstation private System.Windows.Forms.DataVisualization.Charting.Chart chart1; private Label lbHintergrund; private Label lbCity; - private PictureBox picTg1; + private PictureBox lbForecastImage1; private Button btSystemKnopf; private Label label1; private Label label2; @@ -693,6 +789,11 @@ namespace Wetterstation private Label lbTempMin; private Label label8; private Label lbTempMax; + private Label lbForecastTemp1; + private Label lbForecastTemp2; + private Label lbForecastTemp3; + private Label lbForecastTemp4; + private Label lbForecastTemp5; } } diff --git a/Wetterstation/Form1.cs b/Wetterstation/Form1.cs index d2a8b33160f080b631958a55d78d95458277eb1f..bf15394b8d1b82ba3cf5c75cf1216b8341617cd1 100644 --- a/Wetterstation/Form1.cs +++ b/Wetterstation/Form1.cs @@ -5,6 +5,7 @@ using System.Windows.Forms; using uPLibrary.Networking.M2Mqtt; using uPLibrary.Networking.M2Mqtt.Messages; using Newtonsoft.Json; +using System.Globalization; namespace Wetterstation { @@ -77,8 +78,8 @@ namespace Wetterstation //MQTT connect public void mqttStart() { - String topic_publish = "/wetterstation/backend/"; - String topic_subscribe = "/wetterstation/frontend/#"; + String topic_publish = "/wetterstation/backend/" + WeatherstationSettings.frontendId + "/"; + String topic_subscribe = "/wetterstation/frontend/" + WeatherstationSettings.frontendId + "/#"; System.Console.WriteLine("Hello, World!"); // Create Client instance @@ -131,7 +132,7 @@ namespace Wetterstation try { dynamic weatherData = JsonConvert.DeserializeObject(message.ToString()); - lbAussenTemp.Invoke(new Action(() => { lbAussenTemp.Text = weatherData.sensors[1].temperature + " °C"; })); + lbAussenTemp.Invoke(new Action(() => { lbAussenTemp.Text = weatherData.temp + " °C"; })); lbTempMin.Invoke(new Action(() => { lbTempMin.Text = weatherData.tempMin + " °C"; })); lbTempMax.Invoke(new Action(() => { lbTempMax.Text = weatherData.tempMax + " °C"; })); lbLuftfeuchtAussen.Invoke(new Action(() => { lbLuftfeuchtAussen.Text = weatherData.humidity + " %"; })); @@ -148,11 +149,36 @@ namespace Wetterstation try { dynamic weatherData = JsonConvert.DeserializeObject(message.ToString()); - lbAussenTemp.Invoke(new Action(() => { lbAussenTemp.Text = weatherData.sensors[1].temperature + " °C"; })); + lbForecastImage1.Invoke(new Action(() => { lbForecastImage1.Image = global::Wetterstation.Properties.Resources.ResourceManager.GetObject("_" + weatherData[0].icon1 + "_2x"); })); + lbForecastTemp1.Invoke(new Action(() => { lbForecastTemp1.Text = weatherData[0].temp + " °C"; })); + lbForecastDay1.Invoke(new Action(() => { lbForecastDay1.Text = getDayFromDateString(weatherData[0].from.ToString()); })); + + lbForecastImage2.Invoke(new Action(() => { lbForecastImage2.Image = global::Wetterstation.Properties.Resources.ResourceManager.GetObject("_" + weatherData[1].icon1 + "_2x"); })); + lbForecastTemp2.Invoke(new Action(() => { lbForecastTemp2.Text = weatherData[1].temp + " °C"; })); + lbForecastDay2.Invoke(new Action(() => { lbForecastDay2.Text = getDayFromDateString(weatherData[1].from.ToString()); })); + + lbForecastImage3.Invoke(new Action(() => { lbForecastImage3.Image = global::Wetterstation.Properties.Resources.ResourceManager.GetObject("_" + weatherData[2].icon1 + "_2x"); })); + lbForecastTemp3.Invoke(new Action(() => { lbForecastTemp3.Text = weatherData[2].temp + " °C"; }));lbForecastDay1.Invoke(new Action(() => { lbForecastDay1.Text = getDayFromDateString(weatherData[0].from.ToString()); })); + lbForecastDay3.Invoke(new Action(() => { lbForecastDay3.Text = getDayFromDateString(weatherData[2].from.ToString()); })); + + lbForecastImage4.Invoke(new Action(() => { lbForecastImage4.Image = global::Wetterstation.Properties.Resources.ResourceManager.GetObject("_" + weatherData[3].icon1 + "_2x"); })); + lbForecastTemp4.Invoke(new Action(() => { lbForecastTemp4.Text = weatherData[3].temp + " °C"; })); + lbForecastDay4.Invoke(new Action(() => { lbForecastDay4.Text = getDayFromDateString(weatherData[3].from.ToString()); })); + + lbForecastImage5.Invoke(new Action(() => { lbForecastImage5.Image = global::Wetterstation.Properties.Resources.ResourceManager.GetObject("_" + weatherData[4].icon1 + "_2x"); })); + lbForecastTemp5.Invoke(new Action(() => { lbForecastTemp5.Text = weatherData[4].temp + " °C"; })); + lbForecastDay5.Invoke(new Action(() => { lbForecastDay5.Text = getDayFromDateString(weatherData[4].from.ToString()); })); } catch (Exception ignored) { } } + public String getDayFromDateString(String strDate) + { + DateTime dt = DateTime.ParseExact(strDate, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture); + CultureInfo culture = new CultureInfo("de-DE"); + return culture.DateTimeFormat.GetDayName(dt.DayOfWeek).Substring(0, 2).ToString(); + } + public void updateFormSensors(String message) { Console.WriteLine("Entered updateFormSensors"); @@ -179,9 +205,13 @@ namespace Wetterstation private void BtSystemKnopf_Click(object sender, EventArgs e) { Form settings = new Settings(); - // abhängig von Form1 + // Settings als Dialog starten, dann wird das Frontend geblockt und auf abschluss gewartet settings.ShowDialog(); updateFormComplete(); + // MQTT beenden und Verbindung neu aufbauen + this.myClient.Disconnect(); + this.mqttStart(); + // Neue Einstellungen an Backend senden this.updateSettings2Mqtt(); } @@ -189,5 +219,11 @@ namespace Wetterstation { } + + private void Hintergrund_FormClosed(object sender, FormClosedEventArgs e) + { + this.myClient.Disconnect(); + Application.Exit(); + } } } diff --git a/Wetterstation/Properties/Resources.Designer.cs b/Wetterstation/Properties/Resources.Designer.cs index 75646b9e32c99a59972cb42e2200c2c1f5458edd..4fc441b04f960fe03a73c531190c6dda3bd415c2 100644 --- a/Wetterstation/Properties/Resources.Designer.cs +++ b/Wetterstation/Properties/Resources.Designer.cs @@ -60,6 +60,186 @@ namespace Wetterstation.Properties { } } + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _01d_2x { + get { + object obj = ResourceManager.GetObject("_01d_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _01n_2x { + get { + object obj = ResourceManager.GetObject("_01n_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _02d_2x { + get { + object obj = ResourceManager.GetObject("_02d_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _02n_2x { + get { + object obj = ResourceManager.GetObject("_02n_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _03d_2x { + get { + object obj = ResourceManager.GetObject("_03d_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _03n_2x { + get { + object obj = ResourceManager.GetObject("_03n_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _04d_2x { + get { + object obj = ResourceManager.GetObject("_04d_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _04n_2x { + get { + object obj = ResourceManager.GetObject("_04n_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _09d_2x { + get { + object obj = ResourceManager.GetObject("_09d_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _09n_2x { + get { + object obj = ResourceManager.GetObject("_09n_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _10d_2x { + get { + object obj = ResourceManager.GetObject("_10d_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _10n_2x { + get { + object obj = ResourceManager.GetObject("_10n_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _11d_2x { + get { + object obj = ResourceManager.GetObject("_11d_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _11n_2x { + get { + object obj = ResourceManager.GetObject("_11n_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _13d_2x { + get { + object obj = ResourceManager.GetObject("_13d_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _13n_2x { + get { + object obj = ResourceManager.GetObject("_13n_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _50d_2x { + get { + object obj = ResourceManager.GetObject("_50d_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap _50n_2x { + get { + object obj = ResourceManager.GetObject("_50n_2x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// <summary> /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// </summary> diff --git a/Wetterstation/Properties/Resources.resx b/Wetterstation/Properties/Resources.resx index 3a5128575992cf212cf4a445d97f1a061e4b7577..89cfcf1cf1c901f4df10193190899f0d13f9fccd 100644 --- a/Wetterstation/Properties/Resources.resx +++ b/Wetterstation/Properties/Resources.resx @@ -148,4 +148,58 @@ <data name="Zahnrad12" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\Zahnrad12.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> + <data name="_01d_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\01d@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_01n_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\01n@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_02d_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\02d@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_02n_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\02n@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_03d_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\03d@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_03n_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\03n@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_04d_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\04d@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_04n_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\04n@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_09d_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\09d@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_09n_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\09n@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_10d_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\10d@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_10n_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\10n@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_11d_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\11d@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_11n_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\11n@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_13d_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\13d@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_13n_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\13n@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_50d_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\50d@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="_50n_2x" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\50n@2x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> </root> \ No newline at end of file