示例#1
0
 /// <summary>
 /// 添加波形片段
 /// </summary>
 /// <param name="rwf">波形信息</param>
 /// <returns>添加结果 true-添加成功, fasle-添加失败</returns>
 public bool AddInformation(RecordWaveform rwf)
 {
     //判断通道号
     if (Channel == rwf.Channel)
     {
         if (TimeStamp == null)
         {
             //初始化时间戳
             TimeStamp = new CP56Time2a(rwf.TimeStamp.GetDataArray());
         }
         else
         {
             //判断时间戳是否相同,不同则返回
             if (!TimeStamp.IsEqual(rwf.TimeStamp))
             {
                 return(false);
             }
         }
         if (RecordMask[rwf.WaveformNum - 1][rwf.GroupNum - 1] == false)
         {
             RecordMask[rwf.WaveformNum - 1][rwf.GroupNum - 1] = true;
             //计算数据存储索引
             int index = (rwf.WaveformNum - 1) * WavePointNum + (rwf.GroupNum - 1) * 64;
             Array.Copy(rwf.RawAdcArray, 0, WaveDataAdc, index, rwf.RawAdcArray.Length);
             return(true);
         }
         else
         {
             throw new Exception("重复添加波形--RecordDataItem-AddInformation");
         }
     }
     return(false);
 }
示例#2
0
        public bool DeepEquals(object obj)
        {
            var other = obj as Blog;

            if (other == null)
            {
                return(false);
            }

            var bothNull    = Categories == null && other.Categories == null;
            var bothNotNull = Categories != null && other.Categories != null;

            if (bothNotNull)
            {
                if (Categories.Except(other.Categories).Any())
                {
                    return(false);
                }
            }
            else if (!bothNull)
            {
                return(false);
            }

            bothNull    = Tags == null && other.Tags == null;
            bothNotNull = Tags != null && other.Tags != null;
            if (bothNotNull)
            {
                if (Tags.Except(other.Tags).Any())
                {
                    return(false);
                }
            }
            else if (!bothNull)
            {
                return(false);
            }

            if (!Data.IsEqual(other.Data))
            {
                return(false);
            }
            if (!TimeStamp.IsEqual(other.TimeStamp))
            {
                return(false);
            }
            if (!Summary.IsEqual(other.Summary))
            {
                return(false);
            }
            if (!Title.IsEqual(other.Title))
            {
                return(false);
            }
            return(true);
        }