[NF] Debugmode eingebaut
This commit is contained in:
parent
e3bafaf014
commit
7f0de5503f
@ -61,6 +61,8 @@ namespace Dashboard.Connector {
|
||||
send.StartInfo.Arguments = args + "-m \""+data.Replace("\"","\\\"")+"\" -t \""+topic+"\" -d";
|
||||
send.StartInfo.CreateNoWindow = true;
|
||||
send.StartInfo.UseShellExecute = false;
|
||||
send.StartInfo.RedirectStandardOutput = true;
|
||||
send.StartInfo.RedirectStandardError = true;
|
||||
send.Start();
|
||||
send.WaitForExit();
|
||||
MessageSending?.Invoke(this, new MqttEventArgs(data, topic));
|
||||
|
9
Mqtt-Dashboard/Dashboard.csproj.user
Normal file
9
Mqtt-Dashboard/Dashboard.csproj.user
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<StartArguments>-debug</StartArguments>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<StartArguments>-debug</StartArguments>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@ -10,7 +10,7 @@ namespace Dashboard {
|
||||
public partial class Dashboard : Form {
|
||||
private Dictionary<String, ASensor> sensors = new Dictionary<String, ASensor>();
|
||||
|
||||
public Dashboard() {
|
||||
public Dashboard(Boolean debug) {
|
||||
InitializeComponent();
|
||||
ADataBackend.SetInstance(InIReader.GetInstance("settings.ini").GetSection("mqtt"));
|
||||
|
||||
@ -19,9 +19,11 @@ namespace Dashboard {
|
||||
|
||||
this.FormClosed += this.Dashboard_FormClosed;
|
||||
this.SizeChanged += this.Dashboard_SizeChanged;
|
||||
|
||||
ADataBackend.Instance.MessageIncomming += this.Instance_MessageIncomming;
|
||||
ADataBackend.Instance.MessageSending += this.Instance_MessageSending;
|
||||
|
||||
if (debug) {
|
||||
ADataBackend.Instance.MessageIncomming += this.Instance_MessageIncomming;
|
||||
ADataBackend.Instance.MessageSending += this.Instance_MessageSending;
|
||||
}
|
||||
}
|
||||
|
||||
private void Dashboard_SizeChanged(Object sender, EventArgs e) {
|
||||
@ -58,11 +60,11 @@ namespace Dashboard {
|
||||
}
|
||||
|
||||
private void Instance_MessageIncomming(Object sender, MqttEventArgs e) {
|
||||
System.Diagnostics.Debug.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) {
|
||||
System.Diagnostics.Debug.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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using BlubbFish.Utils;
|
||||
|
||||
namespace Dashboard {
|
||||
static class Program {
|
||||
@ -7,10 +9,18 @@ namespace Dashboard {
|
||||
/// Der Haupteinstiegspunkt für die Anwendung.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main() {
|
||||
static void Main(String[] args) {
|
||||
Dictionary<String, CmdArgs.VaildArguments> pargs = new Dictionary<String, CmdArgs.VaildArguments> {
|
||||
{ "-debug", new CmdArgs.VaildArguments(CmdArgs.ArgLength.Single) }
|
||||
};
|
||||
CmdArgs.Instance.SetArguments(pargs, args);
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Dashboard());
|
||||
Boolean debug = false;
|
||||
if(CmdArgs.Instance.HasArgumentType("-debug")) {
|
||||
debug = true;
|
||||
}
|
||||
Application.Run(new Dashboard(debug));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user