예제 #1
0
 //Добавка мгновенных значений, значение берется из типа object
 protected int AddMom(SourceSignal sig, DateTime time, object ob, MomErr err = null)
 {
     if (sig == null)
     {
         return(0);
     }
     sig.BufMom.Object = ob;
     return(sig.AddMom(time, err));
 }
예제 #2
0
 protected int AddMomInt(SourceSignal sig, DateTime time, IRecordRead rec, string field, MomErr err = null)
 {
     if (sig == null)
     {
         return(0);
     }
     sig.BufMom.Integer = rec.GetInt(field);
     return(sig.AddMom(time, err));
 }
예제 #3
0
 protected int AddMom(SourceSignal sig, DateTime time, string s, MomErr err = null)
 {
     if (sig == null)
     {
         return(0);
     }
     sig.BufMom.String = s;
     return(sig.AddMom(time, err));
 }
예제 #4
0
 protected int AddMom(SourceSignal sig, DateTime time, DateTime d, MomErr err = null)
 {
     if (sig == null)
     {
         return(0);
     }
     sig.BufMom.Date = d;
     return(sig.AddMom(time, err));
 }
예제 #5
0
 protected int AddMom(SourceSignal sig, DateTime time, double r, MomErr err = null)
 {
     if (sig == null)
     {
         return(0);
     }
     sig.BufMom.Real = r;
     return(sig.AddMom(time, err));
 }
예제 #6
0
 protected int AddMom(SourceSignal sig, DateTime time, int i, MomErr err = null)
 {
     if (sig == null)
     {
         return(0);
     }
     sig.BufMom.Integer = i;
     return(sig.AddMom(time, err));
 }
예제 #7
0
 //Добавка мгновенных значений разного типа в указанный сигнал
 protected int AddMom(SourceSignal sig, DateTime time, bool b, MomErr err = null)
 {
     if (sig == null)
     {
         return(0);
     }
     sig.BufMom.Boolean = b;
     return(sig.AddMom(time, err));
 }
예제 #8
0
        //Добавить сигнал
        public SourceSignal AddSignal(string fullCode,       //Полный код сигнала
                                      DataType dataType,     //Тип данных
                                      SignalType signalType, //Тип сигнала
                                      string infObject,      //Свойства объекта
                                      string infOut  = "",   //Свойства выхода относительно объекта
                                      string infProp = "")   //Свойства сигнала относительно выхода
        {
            if (_readingSignals.ContainsKey(fullCode))
            {
                return(_readingSignals[fullCode]);
            }
            if (Provider != null)
            {
                Provider.IsPrepared = false;
            }
            var          contextOut = infObject + (infOut.IsEmpty() ? "" : ";" + infOut);
            var          inf        = infObject.ToPropertyDicS().AddDic(infOut.ToPropertyDicS()).AddDic(infProp.ToPropertyDicS());
            SourceSignal sig        = null;

            switch (signalType)
            {
            case SignalType.Mom:
                sig = _initialSignals.Add(fullCode, new MomSignal(this, fullCode, dataType, contextOut, inf));
                break;

            case SignalType.Uniform:
                sig = _initialSignals.Add(fullCode, new UniformSignal(this, fullCode, dataType, contextOut, inf));
                break;

            case SignalType.List:
                sig = _initialSignals.Add(fullCode, new ListSignal(this, fullCode, dataType, contextOut, inf));
                break;

            case SignalType.Clone:
                sig = _initialSignals.Add(fullCode, new CloneSignal((ClonerConnect)this, fullCode, dataType, contextOut, inf));
                break;

            case SignalType.UniformClone:
                sig = _initialSignals.Add(fullCode, new UniformCloneSignal((ClonerConnect)this, fullCode, dataType, contextOut, inf));
                break;
            }
            return(_readingSignals.Add(fullCode, sig));
        }
예제 #9
0
 public CalcSignal(string code, SourceSignal initialSignal, string formula)
     : base((SourceConnect)initialSignal.Connect, code)
 {
     _initialSignal = initialSignal;
     ParseFormula(formula);
 }