public int AddSubnetwork(string name) { if (Communication == null) { Communication = new tCommunication(); } return(Communication.AddSubNetwork(null)); }
public int ConnectAP(string subnetwork, string ap, tCommunication comm) { int iap = GetAP(ap); if (iap < 0) { return(-1); } if (comm == null) { return(-1); } int isn = comm.GetSubNetwork(subnetwork); if (isn < 0) { return(-1); } var cap = new tConnectedAP(); cap.apName = ap; cap.iedName = name; cap.Address = new tAddress(); var ip = new tP_IP(); ip.Value = comm.SubNetwork[isn].NetworkIP(); cap.Address.AddtP(ip); var gw = new tP_IPGATEWAY(); gw.Value = comm.SubNetwork[isn].LastIP(); cap.Address.AddtP(gw); var ipnm = new tP_IPSUBNET(); cap.Address.AddtP(ipnm); return(comm.SubNetwork[isn].AddConnectedAP(cap)); }