From 93770547677d4f1f3e104571cac36cdc39454243 Mon Sep 17 00:00:00 2001 From: BlubbFish Date: Tue, 29 May 2018 20:07:50 +0000 Subject: [PATCH] [NF] Logrotate --- Mqtt-Dashboard/Form1.cs | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/Mqtt-Dashboard/Form1.cs b/Mqtt-Dashboard/Form1.cs index 062f342..60a9048 100644 --- a/Mqtt-Dashboard/Form1.cs +++ b/Mqtt-Dashboard/Form1.cs @@ -3,17 +3,16 @@ using System.Collections.Generic; using System.Windows.Forms; using BlubbFish.Utils; using Dashboard.Tracings; -using BlubbFish.Utils.IoT.Sensor; using BlubbFish.Utils.IoT.Connector; namespace Dashboard { public partial class Dashboard : Form { - private Dictionary sensors = new Dictionary(); + //private Dictionary sensors = new Dictionary(); private ADataBackend mqtt; public Dashboard(Boolean debug) { InitializeComponent(); - this.mqtt = ADataBackend.GetInstance(InIReader.GetInstance("settings.ini").GetSection("mqtt")); + //this.mqtt = ADataBackend.GetInstance(InIReader.GetInstance("settings.ini").GetSection("mqtt")); this.GenerateSensors(); this.GenerateForms(); @@ -22,8 +21,8 @@ namespace Dashboard { this.SizeChanged += this.Dashboard_SizeChanged; if (debug) { - this.mqtt.MessageIncomming += this.Instance_MessageIncomming; - this.mqtt.MessageSending += this.Instance_MessageSending; + //this.mqtt.MessageIncomming += this.Instance_MessageIncomming; + //this.mqtt.MessageSending += this.Instance_MessageSending; } } @@ -35,7 +34,7 @@ namespace Dashboard { InIReader ini = InIReader.GetInstance("sensor.ini"); List sensorini = ini.GetSections(false); foreach(String sensor in sensorini) { - this.sensors.Add(sensor.ToLower(), ASensor.GetInstance(this.mqtt, ini.GetSection(sensor), sensor)); + //this.sensors.Add(sensor.ToLower(), ASensor.GetInstance(this.mqtt, ini.GetSection(sensor), sensor)); } } @@ -43,7 +42,7 @@ namespace Dashboard { InIReader ini = InIReader.GetInstance("tracings.ini"); List tracingini = ini.GetSections(); foreach(String tracing in tracingini) { - this.flowLayoutPanel2.Controls.Add(ATracings.GetInstance(ini.GetValue(tracing, "type").ToLower(), this.sensors, ini.GetSection(tracing)).GetPanel()); + //this.flowLayoutPanel2.Controls.Add(ATracings.GetInstance(ini.GetValue(tracing, "type").ToLower(), this.sensors, ini.GetSection(tracing)).GetPanel()); } } @@ -51,22 +50,22 @@ namespace Dashboard { this.Dispose(); } private new void Dispose() { - foreach (KeyValuePair item in this.sensors) { + /*foreach (KeyValuePair item in this.sensors) { item.Value.Dispose(); - } - this.sensors.Clear(); - this.mqtt.MessageIncomming -= this.Instance_MessageIncomming; - this.mqtt.MessageSending -= this.Instance_MessageSending; + }*/ + //this.sensors.Clear(); + //this.mqtt.MessageIncomming -= this.Instance_MessageIncomming; + //this.mqtt.MessageSending -= this.Instance_MessageSending; this.mqtt.Dispose(); this.Dispose(true); } - private void Instance_MessageIncomming(Object sender, MqttEventArgs e) { + /*private void Instance_MessageIncomming(Object sender, MqttEventArgs e) { Console.WriteLine("Received = " + e.Message + " on topic " + e.Topic+" at "+DateTime.Now.ToUniversalTime()); } private void Instance_MessageSending(Object sender, MqttEventArgs e) { Console.WriteLine("Sended = " + e.Message + " on topic " + e.Topic + " at " + DateTime.Now.ToUniversalTime()); - } + }*/ } }