예제 #1
0
        }                                          // Консоль узла

        /// <summary>
        /// Создание Узла-Роутера
        /// </summary>
        /// <param name="Knot"></param>
        public RouterKnot(KnotSave Knot)
        {
            this.Knot      = Knot;
            LastsIdMessage = new List <uint>();
            MesIn          = new Queue <Message>();
            MesOut         = new Stack <Message>();
            MesConsole     = new ObservableCollection <Message>();
        }
예제 #2
0
        public List <KnotSave> ListNodes(Net Net)
        {
            string Request = "list-nodes " + Net.name;

            SendRequest(Request);
            List <KnotSave> Nodes = new List <KnotSave>();

            if (!Buffer.Last().StartsWith("list-node-fail"))
            {
                for (int i = 1; i < Buffer.Count - 1; i++)
                {
                    string[] NodeInfo = Buffer[i].Split(' ');
                    KnotSave Node     = new KnotSave(
                        uint.Parse(NodeInfo[1]), NodeInfo[5], double.Parse(NodeInfo[2]),
                        double.Parse(NodeInfo[3]), double.Parse(NodeInfo[4])
                        );
                    Nodes.Add(Node);
                }
            }
            return(Nodes);
        }