Пример #1
0
        void ClearSignalPars(L_SignalPars _L0, L_SignalPars _L1)
        {
            List <SignalPars> LBuf = new List <SignalPars>();

            if (_L0 != null)
            {
                LBuf.Clear();
                foreach (SignalPars sp in _L0)
                {
                    if (this[sp.Name] == null)
                    {
                        LBuf.Add(sp);
                    }
                }
                foreach (SignalPars sp in LBuf)
                {
                    _L0.Remove(sp);
                }
            }
            if (_L1 != null)
            {
                LBuf.Clear();
                foreach (SignalPars sp in _L1)
                {
                    if (this[sp.Name] == null)
                    {
                        LBuf.Add(sp);
                    }
                }
                foreach (SignalPars sp in LBuf)
                {
                    _L1.Remove(sp);
                }
            }
        }
Пример #2
0
 SignalPars GetPars(L_SignalPars _L, int _pos, int _DigitalOffset, bool _input)
 {
     foreach (SignalPars par in _L)
     {
         if (par.Input != _input)
         {
             continue;
         }
         if (_pos < _DigitalOffset)
         {
             if (par.Digital)
             {
                 continue;
             }
             if (par.Position != _pos)
             {
                 continue;
             }
         }
         else
         {
             if (!par.Digital)
             {
                 continue;
             }
             if (par.Position != _pos + _DigitalOffset)
             {
                 continue;
             }
         }
         return(par);
     }
     return(null);
 }
Пример #3
0
 void SavePanels(L_SignalPars _L)
 {
     if (_L == null)
     {
         return;
     }
     foreach (Signal s in this)
     {
         SignalPars p = _L[s.name];
         if (p == null)
         {
             continue;
         }
         p.X = s.X;
         p.Y = s.Y;
     }
 }
Пример #4
0
        SignalPars GetPars(L_SignalPars _L0, L_SignalPars _L1, string _dn_Name, ref int _board)
        {
            SignalPars p = null;

            _board = -1;
            if (_L0 != null)
            {
                p = _L0[_dn_Name];
            }
            if (p != null)
            {
                _board = 0;
                return(p);
            }
            if (_L1 != null)
            {
                p = _L1[_dn_Name];
            }
            if (p != null)
            {
                _board = 1;
                return(p);
            }
            if (_L0 != null)
            {
                p      = _L0.AddNew() as SignalPars;
                p.Name = _dn_Name;
            }
            if (p != null)
            {
                _board = 0;
                return(p);
            }
            if (_L1 != null)
            {
                p      = _L1.AddNew() as SignalPars;
                p.Name = _dn_Name;
            }
            if (p != null)
            {
                _board = 0;
                return(p);
            }
            return(null);
        }