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 SetConf()  //powiadamia Komutator ze trzeba krosowac
        {
            int portIn, portOut, f1, f2;

            communicationT.Send_Text(Protokol.SET_R, Network.outputControl);
            portIn  = Convert.ToInt32(command[connections].Substring(0, 1));
            portOut = Convert.ToInt32(command[connections].Substring(1, 1));
            f1      = Convert.ToInt32(command[connections].Substring(2, 1));
            f2      = Convert.ToInt32(command[connections].Substring(3, 1));

            if (Network.strumienCloud != null)
            {
                connections++;                                        //zwiekszanie licznika polaczen
                kom.SetConnect(portIn, portOut, f1, f2, connections); // wyslanie danych nowego polaczenia, connections = id polaczenia
            }
        }
Example #3
0
        private void CheckParameters()  // sprawdza czy mamy juz 2 odpowiadajace sobie jednostki,
        {                               //od GieneraƂa i od LRM, jesli tak, zestawiamy polaczenie
            foreach (ModelControl s in ControlList)
            {
                foreach (ModelLRM t in LRMList)
                {
                    if (s.id.Equals(t.id))
                    {
                        int snnpA, snnpB, f1, f2;               // ta bezsensowna konwersja ale trudno
                        snnpA = Convert.ToInt32(s.snnpA);
                        snnpB = Convert.ToInt32(s.snnpB);
                        f1    = Convert.ToInt32(t.f1);
                        f2    = Convert.ToInt32(t.f2);

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