Solve some issues with multiple saved wireless links. They ended up connecting to the wrong devices and making a mess. So, we will start by auto-generating all wireless links.
This commit is contained in:
		@@ -326,7 +326,8 @@ namespace EduNetworkBuilder
 | 
			
		||||
                            break;
 | 
			
		||||
                        case "link":
 | 
			
		||||
                            newNL = new NetworkLink(Individual);
 | 
			
		||||
                            NetComponents.Add(newNL);
 | 
			
		||||
                            if(newNL.theLinkType != LinkType.wireless)
 | 
			
		||||
                                NetComponents.Add(newNL); //do no load wireless links. Rebuild them
 | 
			
		||||
                            break;
 | 
			
		||||
                        case "device":
 | 
			
		||||
                            newND = new NetworkDevice(Individual);
 | 
			
		||||
@@ -411,6 +412,13 @@ namespace EduNetworkBuilder
 | 
			
		||||
                
 | 
			
		||||
            if (newUnique != -1)
 | 
			
		||||
                UniqueIdentifier = newUnique;
 | 
			
		||||
            int maxUI = 0;
 | 
			
		||||
            foreach(NetworkComponent nc in NetComponents)
 | 
			
		||||
            {
 | 
			
		||||
                if (maxUI < nc.GetUniqueIdentifier)
 | 
			
		||||
                    maxUI = nc.GetUniqueIdentifier;
 | 
			
		||||
            }
 | 
			
		||||
            if (maxUI <= UniqueIdentifier) UniqueIdentifier = maxUI + 1;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void OpenHelpIfNeeded(bool skipOpeningWindows)
 | 
			
		||||
@@ -498,7 +506,8 @@ namespace EduNetworkBuilder
 | 
			
		||||
            for (int loop = 0; loop < NetComponents.Count; loop++)
 | 
			
		||||
            {
 | 
			
		||||
                if (NB.GetComponentType(NetComponents[loop]) == GeneralComponentType.link)
 | 
			
		||||
                    NetComponents[loop].Save(writer);
 | 
			
		||||
                    if(((NetworkLink)NetComponents[loop]).theLinkType != LinkType.wireless )
 | 
			
		||||
                        NetComponents[loop].Save(writer); //Wireless links are rebuilt automatically
 | 
			
		||||
            }
 | 
			
		||||
            foreach(NetTest nt in NetTests)
 | 
			
		||||
            {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user