diff --git a/Wetterstation/Form1.Designer.cs b/Wetterstation/Form1.Designer.cs index 7e0171c31fa6200f9ba9f617487cc65562c54b24..4d991ad5bea839de3fd456e6045bb81d2a18eed0 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(); @@ -443,23 +443,23 @@ namespace Wetterstation // 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 // @@ -481,7 +481,7 @@ namespace Wetterstation this.lbCity.Name = "lbCity"; this.lbCity.Size = new System.Drawing.Size(1343, 62); this.lbCity.TabIndex = 43; - this.lbCity.Text = "Marienhausen"; + this.lbCity.Text = "Hier könnte ihr Ort stehen"; this.lbCity.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // picTg1 diff --git a/Wetterstation/Form1.cs b/Wetterstation/Form1.cs index b448cc645f6f955362be30c5324ebe934e9afbfc..c116fe14b2434cc7973009c0b1310af4f6f66369 100644 --- a/Wetterstation/Form1.cs +++ b/Wetterstation/Form1.cs @@ -18,8 +18,20 @@ namespace Wetterstation InitializeComponent(); WeatherstationSettings = SqliteDataAccess.LoadWeatherstationSettings(); lbCity.Text = WeatherstationSettings.city; + + // Start a timer for date and time + Timer t = new Timer(); + t.Interval = 1000; + t.Tick += new EventHandler(this.t_DateTime); + t.Start(); + mqttStart(); } + private void t_DateTime(object sender, EventArgs e) + { + lbUhr.Text = DateTime.Now.ToLongTimeString(); + lbDatum.Text = DateTime.Now.ToShortDateString(); + } private void LED_Click(object sender, EventArgs e) {