Exemplo n.º 1
0
 public NetworkNode()
 {
     this.commutationTable           = new CommutationTable();
     this.borderNodeCommutationTable = new BorderNodeCommutationTable();
     this.eonTable         = new EONTable();
     this.commutationField = new CommutationField(ref borderNodeCommutationTable, ref commutationTable, ref eonTable, 1);
 }
 /// <summary>
 /// Konstruktor z referencjami na tablice i liczba wyjsciowych buforow
 /// </summary>
 /// <param name="borderNodeCommutationTable"></param>
 /// <param name="commutationTable"></param>
 /// <param name="EonTable"></param>
 public CommutationField(ref BorderNodeCommutationTable borderNodeCommutationTable,
     ref CommutationTable commutationTable, ref EONTable EonTable, int buffersOutCount) : this()
 {
     //bufferIn = new Buffer();
     // BuffersOut = new List<Buffer>(buffersOutCount);
     this.borderNodeCommutationTable = borderNodeCommutationTable;
     this.EonTable = EonTable;
     this.commutationTable = commutationTable;
 }
Exemplo n.º 3
0
        public void testDeleteEONRow()
        {
            short frequency = 2;
            short band      = 3;

            //stworzenie nowej tabeli
            EONTable table = new EONTable();

            //stworzenie nowych rzedow
            EONTableRowIN  rowIn  = new EONTableRowIN(frequency, band);
            EONTableRowOut rowOut = new EONTableRowOut(frequency, band);

            //Dodanie rzedow
            table.addRow(rowIn);
            table.addRow(rowOut);

            //usuniecie rzedow
            table.deleteRow(rowIn);
            table.deleteRow(rowOut);

            Assert.IsTrue(table.CheckAvailability(rowIn));
            Assert.IsTrue(table.CheckAvailability(rowOut));

            //Kazdy wpis w tabeli po wyczyszczeniu powinien byc rowny -1
            foreach (short f in table.InFrequencies)
            {
                Assert.AreEqual(-1, f);
            }

            //Nie powinno byc rzedu w tablicy
            Assert.IsFalse(table.TableIN.Contains(rowIn));

            //Kazdy wpis w tabeli po wyczyszczeniu powinien byc rowny -1
            foreach (short f in table.OutFrequencies)
            {
                Assert.AreEqual(-1, f);
            }

            //Nie powinno byc rzedu w tablicy
            Assert.IsFalse(table.TableOut.Contains(rowOut));
        }
Exemplo n.º 4
0
        public void Run(string number, ref CommutationTable commutationTable,
                        ref BorderNodeCommutationTable borderNodeCommutationTable,
                        ref EONTable eonTable)
        {
            this.eonTable                   = eonTable;
            this.commutationTable           = commutationTable;
            this.borderNodeCommutationTable = borderNodeCommutationTable;
            //Zmienna do przechowywania klucza na adres wychodzacy powiazany z socketem sluchaczem
            string settingsString = "";


            //pobranie wlasnosci zapisanych w pliku konfiguracyjnym
            tmp = OperationConfiguration.ReadAllSettings(mySettings);


            //przeszukanie wszystkich kluczy w liscie


            //Uruchamiamy watek na kazdym z tworzonych sluchaczy


            //    CreateConnect("127.0.0.14","1NMS");
            CreateConnect(ConfigurationManager.AppSettings[number + "NMS"], number + "NMS");



            ConsoleKeyInfo cki;

            while (true)
            {
                cki = Console.ReadKey();
                if (cki.Key == ConsoleKey.Escape)
                {
                    break;
                }
            }
        }
Exemplo n.º 5
0
        public void testAddEONRow()
        {
            short frequency = 2;
            short band      = 3;

            //stworzenie nowej tabeli
            EONTable table = new EONTable();

            //stworzenie nowych rzedow
            EONTableRowIN  rowIn  = new EONTableRowIN(frequency, band);
            EONTableRowOut rowOut = new EONTableRowOut(frequency, band);

            //Dodanie rzedow
            table.addRow(rowIn);
            table.addRow(rowOut);

            //Sprawdzenie, czy wybrane czestotliwosci sa zajete
            for (int i = frequency; i < frequency + band; i++)
            {
                Assert.IsTrue(table.InFrequencies[i] == frequency);
                Assert.IsTrue(table.OutFrequencies[i] == frequency);
            }

            //Sprawdzenie wolnych czestotliwosci
            for (int i = 0; i < frequency; i++)
            {
                Assert.IsTrue(table.InFrequencies[i] == -1);
                Assert.IsTrue(table.OutFrequencies[i] == -1);
            }

            for (int i = frequency + band; i < EONTable.capacity; i++)
            {
                Assert.IsTrue(table.InFrequencies[i] == -1);
                Assert.IsTrue(table.OutFrequencies[i] == -1);
            }
        }