Ejemplo n.º 1
0
        //Добавляет один сигнал в список
        protected override ProviderOut AddOut(ProviderSignal sig)
        {
            if (sig.Inf.Get("ObjectType") == "Operator")
            {
                return(OperatorOut ?? (OperatorOut = new KosmOperatorOut(this)));
            }

            var     ind = new OutIndex(sig.Inf.GetInt("SysNum"), sig.Inf.GetInt("NumType"), sig.Inf.GetInt("Appartment"), sig.Inf.GetInt("NumOut"));
            KosmOut obj;

            if (ind.Out == 1 && (ind.NumType == 1 || ind.NumType == 3 || ind.NumType == 32))
            {
                if (Analogs.ContainsKey(ind))
                {
                    obj = Analogs[ind];
                }
                else
                {
                    Analogs.Add(ind, obj = new KosmOut(this, ind));
                }
            }
            else
            {
                if (Outs.ContainsKey(ind))
                {
                    obj = Outs[ind];
                }
                else
                {
                    Outs.Add(ind, obj = new KosmOut(this, ind));
                }
            }
            return(obj);
        }
Ejemplo n.º 2
0
 internal KosmOut(KosmotronikaBaseSource source, OutIndex ind) : base(source)
 {
     Sn         = ind.Sn;
     NumType    = ind.NumType;
     Appartment = ind.Appartment;
     Out        = ind.Out;
 }
Ejemplo n.º 3
0
        //Определение текущего считываемого выхода
        protected override ListSourceOut DefineOut(IRecordRead rec)
        {
            int dn  = this is KosmotronikaRetroSource ? 1 : 0;
            var ind = new OutIndex(rec.GetInt(0), rec.GetInt(1), rec.GetInt(2), IsAnalog ? 1 : rec.GetInt(5 + dn));

            if (IsAnalog && Analogs.ContainsKey(ind))
            {
                return(Analogs[ind]);
            }
            return(Outs.ContainsKey(ind) ? Outs[ind] : null);
        }