示例#1
0
        public MomentData ParseMomentData(byte[] fileData, int offset, int dbp)
        {
            if (dbp > 0)
            {
                _byteReader.Seek(offset + dbp + 28);
                var data = new MomentData()
                {
                    BlockType    = _byteReader.ReadString(fileData, 1),
                    MomentName   = _byteReader.ReadString(fileData, 3),
                    GateCount    = _byteReader.ReadShort(fileData, 4),
                    FirstGate    = ((float)_byteReader.ReadShort(fileData) / 1000),
                    GateSize     = ((float)_byteReader.ReadShort(fileData) / 1000),
                    RfThreshold  = (_byteReader.ReadShort(fileData) / 10),
                    SnrThreshold = (_byteReader.ReadShort(fileData) / 1000),
                    ControlFlags = _byteReader.ReadByte(fileData).Value,
                    DataSize     = _byteReader.ReadByte(fileData).Value,
                    Scale        = _byteReader.ReadFloat(fileData),
                    Offset       = _byteReader.ReadFloat(fileData),
                    DataOffset   = dbp + 28,
                };

                _dataLogger.Log("Location 7 - End of Moment Header Data, before switch - at byte location " + _byteReader.Offset);
                _dataLogger.Log(JsonConvert.SerializeObject(data));

                return(data);
            }

            return(null);
        }
示例#2
0
 public void AppendPointViaDispatcher()
 {
     if (_sourceDatas.Count >= 1)
     {
         _polyline.Points.Add(new Point((MomentData.GetTimeSpan(_sourceDatas, _sourceDatas.Count - 1).TotalSeconds - _minTime) * (_grid.ActualWidth / (_maxTime - _minTime)), _grid.ActualHeight - (_sourceDatas.Last().Value - _minData) * (_grid.ActualHeight / (_maxData - _minData))));
     }
 }
示例#3
0
 //把数据坐标转换成显示的图像坐标
 /// <summary>
 /// 刷新曲线
 /// </summary>
 public void Build()
 {
     _polyline.Points.Clear();
     for (int i = 0; i < _sourceDatas.Count; i++)
     {
         _polyline.Points.Add(new Point((MomentData.GetTimeSpan(_sourceDatas, i).TotalSeconds - _minTime) * (_grid.ActualWidth / (_maxTime - _minTime)), _grid.ActualHeight - (_sourceDatas[i].Value - _minData) * (_grid.ActualHeight / (_maxData - _minData))));
         //(_sourceDatas[i].Time-_sourceDatas[0].Time).TotalSeconds
     }
 }