microwave and light logic for display

This commit is contained in:
Tim Young 2015-08-13 20:11:33 -06:00
parent bc68ff91b0
commit d128340987
2 changed files with 21 additions and 12 deletions

View File

@ -953,6 +953,8 @@ namespace EduNetworkBuilder
if(NB.GetComponentType(NC) == GeneralComponentType.device) if(NB.GetComponentType(NC) == GeneralComponentType.device)
{ {
ND = (NetworkDevice)NC; ND = (NetworkDevice)NC;
if (ND.GetNetType() == NetworkComponentType.microwave || ND.GetNetType() == NetworkComponentType.fluorescent)
continue;
tList.Add(ND.hostname); tList.Add(ND.hostname);
} }
} }

View File

@ -646,6 +646,8 @@ namespace EduNetworkBuilder
List<string> macStrings = new List<string>(); List<string> macStrings = new List<string>();
int counter = 0; int counter = 0;
bool CanUse = true; bool CanUse = true;
if (myType == NetworkComponentType.microwave || myType == NetworkComponentType.fluorescent)
return macStrings;
foreach (NetworkCard nic in NICs) foreach (NetworkCard nic in NICs)
{ {
if (OnlyUnused) if (OnlyUnused)
@ -668,6 +670,8 @@ namespace EduNetworkBuilder
public List<string> NetworkCardInterfaceStrings(int index) public List<string> NetworkCardInterfaceStrings(int index)
{ {
List<string> myList = new List<string>(); List<string> myList = new List<string>();
if (myType == NetworkComponentType.microwave || myType == NetworkComponentType.fluorescent)
return myList;
if (index >= 0 && index < NICs.Count) if (index >= 0 && index < NICs.Count)
{ {
myList.AddRange(NICs[index].IPAddresses()); myList.AddRange(NICs[index].IPAddresses());
@ -772,7 +776,8 @@ namespace EduNetworkBuilder
int counter = 0; int counter = 0;
CenterString(BaseImage, x, y + (counter * gap), hostname, Color.Black); CenterString(BaseImage, x, y + (counter * gap), hostname, Color.Black);
counter++; counter++;
if (myType != NetworkComponentType.microwave && myType != NetworkComponentType.fluorescent)
{
foreach (NetworkCard nic in NICs) foreach (NetworkCard nic in NICs)
{ {
if (nic.GetNicType != NicType.lo && nic.GetNicType != NicType.port && nic.GetNicType != NicType.wport) if (nic.GetNicType != NicType.lo && nic.GetNicType != NicType.port && nic.GetNicType != NicType.wport)
@ -782,6 +787,7 @@ namespace EduNetworkBuilder
title += "if: "; title += "if: ";
else else
title += nic.NicName() + ": "; title += nic.NicName() + ": ";
foreach (string addr_str in nic.IPAddresses(true)) foreach (string addr_str in nic.IPAddresses(true))
{ {
CenterString(BaseImage, x, y + (counter * gap), title + addr_str, Color.Black); CenterString(BaseImage, x, y + (counter * gap), title + addr_str, Color.Black);
@ -790,6 +796,7 @@ namespace EduNetworkBuilder
} }
} }
} }
}
IsDirty = false; //We printed it, now we are content that we are clean IsDirty = false; //We printed it, now we are content that we are clean
} }