[NF] Logrotate
This commit is contained in:
parent
e70c08ce72
commit
9377054767
@ -3,17 +3,16 @@ using System.Collections.Generic;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using BlubbFish.Utils;
|
using BlubbFish.Utils;
|
||||||
using Dashboard.Tracings;
|
using Dashboard.Tracings;
|
||||||
using BlubbFish.Utils.IoT.Sensor;
|
|
||||||
using BlubbFish.Utils.IoT.Connector;
|
using BlubbFish.Utils.IoT.Connector;
|
||||||
|
|
||||||
namespace Dashboard {
|
namespace Dashboard {
|
||||||
public partial class Dashboard : Form {
|
public partial class Dashboard : Form {
|
||||||
private Dictionary<String, ASensor> sensors = new Dictionary<String, ASensor>();
|
//private Dictionary<String, ASensor> sensors = new Dictionary<String, ASensor>();
|
||||||
private ADataBackend mqtt;
|
private ADataBackend mqtt;
|
||||||
|
|
||||||
public Dashboard(Boolean debug) {
|
public Dashboard(Boolean debug) {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.mqtt = ADataBackend.GetInstance(InIReader.GetInstance("settings.ini").GetSection("mqtt"));
|
//this.mqtt = ADataBackend.GetInstance(InIReader.GetInstance("settings.ini").GetSection("mqtt"));
|
||||||
|
|
||||||
this.GenerateSensors();
|
this.GenerateSensors();
|
||||||
this.GenerateForms();
|
this.GenerateForms();
|
||||||
@ -22,8 +21,8 @@ namespace Dashboard {
|
|||||||
this.SizeChanged += this.Dashboard_SizeChanged;
|
this.SizeChanged += this.Dashboard_SizeChanged;
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
this.mqtt.MessageIncomming += this.Instance_MessageIncomming;
|
//this.mqtt.MessageIncomming += this.Instance_MessageIncomming;
|
||||||
this.mqtt.MessageSending += this.Instance_MessageSending;
|
//this.mqtt.MessageSending += this.Instance_MessageSending;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,7 +34,7 @@ namespace Dashboard {
|
|||||||
InIReader ini = InIReader.GetInstance("sensor.ini");
|
InIReader ini = InIReader.GetInstance("sensor.ini");
|
||||||
List<String> sensorini = ini.GetSections(false);
|
List<String> sensorini = ini.GetSections(false);
|
||||||
foreach(String sensor in sensorini) {
|
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");
|
InIReader ini = InIReader.GetInstance("tracings.ini");
|
||||||
List<String> tracingini = ini.GetSections();
|
List<String> tracingini = ini.GetSections();
|
||||||
foreach(String tracing in tracingini) {
|
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();
|
this.Dispose();
|
||||||
}
|
}
|
||||||
private new void Dispose() {
|
private new void Dispose() {
|
||||||
foreach (KeyValuePair<String, ASensor> item in this.sensors) {
|
/*foreach (KeyValuePair<String, ASensor> item in this.sensors) {
|
||||||
item.Value.Dispose();
|
item.Value.Dispose();
|
||||||
}
|
}*/
|
||||||
this.sensors.Clear();
|
//this.sensors.Clear();
|
||||||
this.mqtt.MessageIncomming -= this.Instance_MessageIncomming;
|
//this.mqtt.MessageIncomming -= this.Instance_MessageIncomming;
|
||||||
this.mqtt.MessageSending -= this.Instance_MessageSending;
|
//this.mqtt.MessageSending -= this.Instance_MessageSending;
|
||||||
this.mqtt.Dispose();
|
this.mqtt.Dispose();
|
||||||
this.Dispose(true);
|
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());
|
Console.WriteLine("Received = " + e.Message + " on topic " + e.Topic+" at "+DateTime.Now.ToUniversalTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Instance_MessageSending(Object sender, MqttEventArgs e) {
|
private void Instance_MessageSending(Object sender, MqttEventArgs e) {
|
||||||
Console.WriteLine("Sended = " + e.Message + " on topic " + e.Topic + " at " + DateTime.Now.ToUniversalTime());
|
Console.WriteLine("Sended = " + e.Message + " on topic " + e.Topic + " at " + DateTime.Now.ToUniversalTime());
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user