From 765eee55d45732cafe15730a2066e0df1c892132 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Wed, 16 Aug 2017 19:35:51 -0500 Subject: [PATCH] leave network test messages in the network so we can retrieve them later. --- EduNetworkBuilder/Network.cs | 12 +++++++----- EduNetworkBuilder/PacketMessage.cs | 8 ++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/EduNetworkBuilder/Network.cs b/EduNetworkBuilder/Network.cs index 3d4178c..c24e7a5 100644 --- a/EduNetworkBuilder/Network.cs +++ b/EduNetworkBuilder/Network.cs @@ -1779,7 +1779,6 @@ namespace EduNetworkBuilder { Console.WriteLine(one); } - myMessages.Clear(); } /// @@ -1791,12 +1790,11 @@ namespace EduNetworkBuilder bool HadIssues = false; NB.RegisterInvisibleNetwork(this); DoAllMarkAsLinked(); - + myMessages.Clear(); //Erase any old messages we might have //do dhcp request on everything. DoAllDHCP(); NonVisualProcessPacketsOnce(); //loop until we "timeout" or all packets are done. - DumpInvisibleNetMessages(); foreach (NetTest NT in NetTests) { @@ -1834,15 +1832,19 @@ namespace EduNetworkBuilder break; } NonVisualProcessPacketsOnce(); //loop until we "timeout" or all packets are done. - DumpInvisibleNetMessages(); } foreach (NetTest NT in NetTests) { //Here we test it. bool WasComplete = NT.TestComplete(this); - Console.WriteLine(NT.GetDescription(NetTestVerbosity.full) + " done: " + WasComplete.ToString()); + string tMessage = NT.GetDescription(NetTestVerbosity.full) + " done: " + WasComplete.ToString(); + //Console.WriteLine(NT.GetDescription(NetTestVerbosity.full) + " done: " + WasComplete.ToString()); + AddMessage(new PacketMessage("NetTest", tMessage)); } + + DumpInvisibleNetMessages(); + NB.UnregisterInvisibleNetwork(); if(HadIssues) diff --git a/EduNetworkBuilder/PacketMessage.cs b/EduNetworkBuilder/PacketMessage.cs index 6cc3694..677bd44 100644 --- a/EduNetworkBuilder/PacketMessage.cs +++ b/EduNetworkBuilder/PacketMessage.cs @@ -40,6 +40,14 @@ namespace EduNetworkBuilder set { if (!Finished) _Status = value; } } + public PacketMessage() { } + public PacketMessage(string Host, string OneMessage) + { + DebugMessage DM = new DebugMessage(DebugLevel.info, Host, OneMessage); + Status = OneMessage; + Messages.Add(DM); + } + public static T Clone(T source) { if (!typeof(T).IsSerializable)