Skip to content
Snippets Groups Projects
Commit 72e6c315 authored by Dennis Eisold's avatar Dennis Eisold
Browse files

Changed settings Topic

parent f159e279
No related branches found
No related tags found
No related merge requests found
...@@ -36,10 +36,10 @@ namespace Wetterstation ...@@ -36,10 +36,10 @@ namespace Wetterstation
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = 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.Legend legend3 = 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.Series series3 = 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.Title title3 = new System.Windows.Forms.DataVisualization.Charting.Title();
this.lbTextInnentemp = new System.Windows.Forms.Label(); this.lbTextInnentemp = new System.Windows.Forms.Label();
this.lbTextAussentemp = new System.Windows.Forms.Label(); this.lbTextAussentemp = new System.Windows.Forms.Label();
this.lbTextWindSpeed = new System.Windows.Forms.Label(); this.lbTextWindSpeed = new System.Windows.Forms.Label();
...@@ -446,23 +446,23 @@ namespace Wetterstation ...@@ -446,23 +446,23 @@ namespace Wetterstation
// chart1 // chart1
// //
this.chart1.Anchor = System.Windows.Forms.AnchorStyles.None; this.chart1.Anchor = System.Windows.Forms.AnchorStyles.None;
chartArea1.Name = "ChartArea1"; chartArea3.Name = "ChartArea1";
this.chart1.ChartAreas.Add(chartArea1); this.chart1.ChartAreas.Add(chartArea3);
legend1.Name = "Legend1"; legend3.Name = "Legend1";
this.chart1.Legends.Add(legend1); this.chart1.Legends.Add(legend3);
this.chart1.Location = new System.Drawing.Point(37, 672); this.chart1.Location = new System.Drawing.Point(37, 672);
this.chart1.Margin = new System.Windows.Forms.Padding(4); this.chart1.Margin = new System.Windows.Forms.Padding(4);
this.chart1.Name = "chart1"; this.chart1.Name = "chart1";
this.chart1.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.Excel; this.chart1.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.Excel;
series1.ChartArea = "ChartArea1"; series3.ChartArea = "ChartArea1";
series1.Legend = "Legend1"; series3.Legend = "Legend1";
series1.Name = "Series1"; series3.Name = "Series1";
this.chart1.Series.Add(series1); this.chart1.Series.Add(series3);
this.chart1.Size = new System.Drawing.Size(991, 132); this.chart1.Size = new System.Drawing.Size(991, 132);
this.chart1.TabIndex = 41; this.chart1.TabIndex = 41;
this.chart1.Text = "chTendenz"; this.chart1.Text = "chTendenz";
title1.Name = "Title1"; title3.Name = "Title1";
this.chart1.Titles.Add(title1); this.chart1.Titles.Add(title3);
// //
// lbHintergrund // lbHintergrund
// //
...@@ -504,7 +504,7 @@ namespace Wetterstation ...@@ -504,7 +504,7 @@ namespace Wetterstation
this.btSystemKnopf.BackColor = System.Drawing.Color.Transparent; this.btSystemKnopf.BackColor = System.Drawing.Color.Transparent;
this.btSystemKnopf.BackgroundImage = global::Wetterstation.Properties.Resources.Zahnrad12; this.btSystemKnopf.BackgroundImage = global::Wetterstation.Properties.Resources.Zahnrad12;
this.btSystemKnopf.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.btSystemKnopf.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btSystemKnopf.Location = new System.Drawing.Point(1288, 846); this.btSystemKnopf.Location = new System.Drawing.Point(1291, 847);
this.btSystemKnopf.Margin = new System.Windows.Forms.Padding(4); this.btSystemKnopf.Margin = new System.Windows.Forms.Padding(4);
this.btSystemKnopf.Name = "btSystemKnopf"; this.btSystemKnopf.Name = "btSystemKnopf";
this.btSystemKnopf.Size = new System.Drawing.Size(40, 37); this.btSystemKnopf.Size = new System.Drawing.Size(40, 37);
......
...@@ -149,23 +149,23 @@ namespace Wetterstation ...@@ -149,23 +149,23 @@ namespace Wetterstation
try try
{ {
dynamic weatherData = JsonConvert.DeserializeObject(message.ToString()); dynamic weatherData = JsonConvert.DeserializeObject(message.ToString());
lbForecastImage1.Invoke(new Action(() => { lbForecastImage1.Image = global::Wetterstation.Properties.Resources.ResourceManager.GetObject("_" + weatherData[0].icon1 + "_2x"); })); if(weatherData[0].icon1 != null) 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"; })); lbForecastTemp1.Invoke(new Action(() => { lbForecastTemp1.Text = weatherData[0].temp + " °C"; }));
lbForecastDay1.Invoke(new Action(() => { lbForecastDay1.Text = getDayFromDateString(weatherData[0].from.ToString()); })); 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"); })); if (weatherData[1].icon1 != null) 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"; })); lbForecastTemp2.Invoke(new Action(() => { lbForecastTemp2.Text = weatherData[1].temp + " °C"; }));
lbForecastDay2.Invoke(new Action(() => { lbForecastDay2.Text = getDayFromDateString(weatherData[1].from.ToString()); })); 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"); })); if (weatherData[2].icon1 != null) 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()); })); 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()); })); 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"); })); if (weatherData[3].icon1 != null) 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"; })); lbForecastTemp4.Invoke(new Action(() => { lbForecastTemp4.Text = weatherData[3].temp + " °C"; }));
lbForecastDay4.Invoke(new Action(() => { lbForecastDay4.Text = getDayFromDateString(weatherData[3].from.ToString()); })); 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"); })); if (weatherData[4].icon1 != null) 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"; })); lbForecastTemp5.Invoke(new Action(() => { lbForecastTemp5.Text = weatherData[4].temp + " °C"; }));
lbForecastDay5.Invoke(new Action(() => { lbForecastDay5.Text = getDayFromDateString(weatherData[4].from.ToString()); })); lbForecastDay5.Invoke(new Action(() => { lbForecastDay5.Text = getDayFromDateString(weatherData[4].from.ToString()); }));
} }
...@@ -199,7 +199,7 @@ namespace Wetterstation ...@@ -199,7 +199,7 @@ namespace Wetterstation
public void updateSettings2Mqtt() public void updateSettings2Mqtt()
{ {
Console.WriteLine(JsonConvert.SerializeObject(WeatherstationSettings).ToString()); Console.WriteLine(JsonConvert.SerializeObject(WeatherstationSettings).ToString());
this.msgPublish(WeatherstationSettings.mqtt_topic_backend + WeatherstationSettings.frontendId + "/settings", JsonConvert.SerializeObject(WeatherstationSettings).ToString()); this.msgPublish(WeatherstationSettings.mqtt_topic_backend + "settings", JsonConvert.SerializeObject(WeatherstationSettings).ToString());
} }
private void BtSystemKnopf_Click(object sender, EventArgs e) private void BtSystemKnopf_Click(object sender, EventArgs e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment