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,7 +670,9 @@ 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(index >= 0 && index < NICs.Count) if (myType == NetworkComponentType.microwave || myType == NetworkComponentType.fluorescent)
return myList;
if (index >= 0 && index < NICs.Count)
{ {
myList.AddRange(NICs[index].IPAddresses()); myList.AddRange(NICs[index].IPAddresses());
} }
@ -772,20 +776,23 @@ 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)
{ {
if(nic.GetNicType != NicType.lo && nic.GetNicType != NicType.port && nic.GetNicType != NicType.wport) foreach (NetworkCard nic in NICs)
{ {
string title = ""; if (nic.GetNicType != NicType.lo && nic.GetNicType != NicType.port && nic.GetNicType != NicType.wport)
if (nic.GetNicType == NicType.management_interface)
title += "if: ";
else
title += nic.NicName() + ": ";
foreach(string addr_str in nic.IPAddresses(true))
{ {
CenterString(BaseImage, x, y + (counter * gap), title + addr_str, Color.Black); string title = "";
counter++; if (nic.GetNicType == NicType.management_interface)
title += "if: ";
else
title += nic.NicName() + ": ";
foreach (string addr_str in nic.IPAddresses(true))
{
CenterString(BaseImage, x, y + (counter * gap), title + addr_str, Color.Black);
counter++;
}
} }
} }
} }