Example #1
0
        private void Connect(ModelControl control)
        {
            int snnpA = Convert.ToInt32(control.snnpA);
            int snnpB = Convert.ToInt32(control.snnpB);
            int f1I   = Convert.ToInt32(control.f1I);
            int f1O   = Convert.ToInt32(control.f1O);

            kom.SetConnect(snnpA, snnpB, f1I, f1O, ++Agent.connections);
            // jako id polaczenia podawane jest connections zabrane ze zwyklego agenta, ale zwiekszone o 1 zeby liczba polaczen sie zgadzala

            if (control.konwersja == true)
            {
                kom.SetConversion(control.f2I, control.f2O, Agent.connections);
            }
        }
Example #2
0
        private void Conversion()
        {
            String f1_new, f2_new;

            f1_new = f2_new = null;

            f1_new = command[6].Substring(0, 1);    //poprawic! zeby dzialal tez z liczbami wiekszymi niz 9, zamiana na dwucyfrowy itd
            f2_new = command[6].Substring(1, 1);

            if (f1_new.Length < 2)              //dopelnianie zeby z 1 zrobic 01 itd
            {
                f1_new = f1_new.Insert(0, "0");
            }
            if (f2_new.Length < 2)
            {
                f2_new = f2_new.Insert(0, "0");
            }


            kom.SetConversion(f1_new, f2_new, connections);
        }