예제 #1
0
        /// <summary>
        /// Returns a new channel
        /// </summary>
        public virtual Oilfield_Channel GetNewChannel(string name, string unit, string description)
        {
            Oilfield_Channel c = GetIndexCopy();

            if (c != null)
            {
                c.Name        = name;
                c.Unit        = unit;
                c.Description = description;
                c.SetData(Double.NaN);
            }
            return(c);
        }
예제 #2
0
        /// <summary>
        /// Returns the channel, creating one as necessary
        /// </summary>
        public virtual Oilfield_Channel GetOrCreateChannel(string name, string unit, string description, string format)
        {
            Oilfield_Channel c = GetChannel(name);

            if (c != null)
            {
                return(c);
            }
            c             = GetIndexCopy();
            c.Name        = name;
            c.Unit        = unit;
            c.Description = description;
            c.Format      = format;
            c.SetData(Double.NaN);
            Channels.Add(c);
            return(c);
        }