Esempio n. 1
0
        public void UpdateTrafficTable()
        {
            // 6 colors
            Color[] colorArray = { Color.Red, Color.Cyan, Color.LightGreen, Color.LightYellow, Color.Indigo, Color.Gray };
            report  rep        = null;

            if (this.dbServer.newReports.Count > 0)
            {
                rep = this.dbServer.newReports.Dequeue();
            }

            if (rep != null)
            {
                Node[] currentNodeArray = new Node[allConnectedNodes.Count];
                allConnectedNodes.CopyTo(currentNodeArray);
                mesh.AddState(new SystemState(rep, currentNodeArray, this.states));
                this.allStates.Add(new SystemState(rep, currentNodeArray, this.states));
                this.states++;



                if (this.flag)
                {
                    if (this.colorInex == 5)
                    {
                        this.colorInex = 0;
                    }
                    else
                    {
                        colorInex++;
                    }
                    this.flag = false;
                }

                if (rep.nextAddr == "Reciever")
                {
                    this.flag = true;
                }



                form.UpdateTrafficTable(rep, colorArray[colorInex]);
                Thread.Sleep(100);
            }
        }