Пример #1
0
 private void LoadAnalogZeroOffset(C3DParameterDictionary dictionary)
 {
     if (dictionary != null && dictionary.ContainsParameter("ANALOG", "OFFSET"))
     {
         this._analogZeroOffset = this.LoadFromArray <Int16>(dictionary["ANALOG", "OFFSET"], this._analogChannelCount);
     }
     else
     {
         this._analogZeroOffset = null;
     }
 }
Пример #2
0
 private void LoadAnalogGeneralScale(C3DParameterDictionary dictionary)
 {
     if (dictionary != null && dictionary.ContainsParameter("ANALOG", "GEN_SCALE"))
     {
         this._analogGeneralScale = Convert.ToSingle(dictionary["ANALOG", "GEN_SCALE"].GetData(0));
     }
     else
     {
         this._analogGeneralScale = C3DConstants.DEFAULT_ANALOG_GEN_SCALE;
     }
 }
Пример #3
0
 private void LoadAnalogChannelScale(C3DParameterDictionary dictionary)
 {
     if (dictionary != null && dictionary.ContainsParameter("ANALOG", "SCALE"))
     {
         this._analogChannelScale = this.LoadFromArray <Single>(dictionary["ANALOG", "SCALE"], this._analogChannelCount);
     }
     else
     {
         this._analogChannelScale = null;
     }
 }
Пример #4
0
 private void LoadAnalogChannelCount(C3DHeader header, C3DParameterDictionary dictionary)
 {
     if (dictionary != null && dictionary.ContainsParameter("ANALOG", "USED"))
     {
         this._analogChannelCount = (UInt16)Convert.ToInt16(dictionary["ANALOG", "USED"].GetData(0));
     }
     else if (header != null)
     {
         this._analogChannelCount = (UInt16)(header.AnalogSamplesPerFrame != 0 ? header.AnalogMeasurementCount / header.AnalogSamplesPerFrame : 0);
     }
     else
     {
         this._analogChannelCount = C3DConstants.DEFAULT_ANALOG_USED;
     }
 }
Пример #5
0
 private void LoadAnalogSamplesPerFrame(C3DHeader header, C3DParameterDictionary dictionary)
 {
     if (dictionary != null && dictionary.ContainsParameter("ANALOG", "RATE"))
     {
         this._analogSamplesPerFrame = (UInt16)(Convert.ToSingle(dictionary["ANALOG", "RATE"].GetData(0)) / this._frameRate);
     }
     else if (header != null)
     {
         this._analogSamplesPerFrame = header.AnalogSamplesPerFrame;
     }
     else
     {
         this._analogSamplesPerFrame = (UInt16)(C3DConstants.DEFAULT_ANALOG_RATE / C3DConstants.DEFAULT_POINT_RATE);
     }
 }
Пример #6
0
 private void LoadFrameRate(C3DHeader header, C3DParameterDictionary dictionary)
 {
     if (dictionary != null && dictionary.ContainsParameter("POINT", "RATE"))
     {
         this._frameRate = Convert.ToSingle(dictionary["POINT", "RATE"].GetData(0));
     }
     else if (header != null)
     {
         this._frameRate = header.FrameRate;
     }
     else
     {
         this._frameRate = C3DConstants.DEFAULT_POINT_RATE;
     }
 }
Пример #7
0
 private void LoadFrameCount(C3DHeader header, C3DParameterDictionary dictionary)
 {
     if (dictionary != null && dictionary.ContainsParameter("POINT", "FRAMES"))
     {
         this._frameCount = (UInt16)Convert.ToInt16(dictionary["POINT", "FRAMES"].GetData(0));
     }
     else if (header != null)
     {
         this._frameCount = (UInt16)(header.LastFrameIndex - header.FirstFrameIndex + 1);
     }
     else
     {
         this._frameCount = C3DConstants.DEFAULT_POINT_LAST_FRAME - C3DConstants.DEFAULT_POINT_FIRST_FRAME + 1;
     }
 }
Пример #8
0
 private void LoadScaleFactor(C3DHeader header, C3DParameterDictionary dictionary)
 {
     if (dictionary != null && dictionary.ContainsParameter("POINT", "SCALE"))
     {
         this._scaleFactor = Convert.ToSingle(dictionary["POINT", "SCALE"].GetData(0));
     }
     else if (header != null)
     {
         this._scaleFactor = header.ScaleFactor;
     }
     else
     {
         this._scaleFactor = C3DConstants.DEFAULT_POINT_SCALE;
     }
 }
Пример #9
0
 private void LoadPointCount(C3DHeader header, C3DParameterDictionary dictionary)
 {
     if (dictionary != null && dictionary.ContainsParameter("POINT", "USED"))
     {
         this._pointCount = (UInt16)Convert.ToInt16(dictionary["POINT", "USED"].GetData(0));
     }
     else if (header != null)
     {
         this._pointCount = header.PointCount;
     }
     else
     {
         this._pointCount = C3DConstants.DEFAULT_POINT_USED;
     }
 }
Пример #10
0
        private void LoadFirstDataBlockPosition(C3DHeader header, C3DParameterDictionary dictionary)
        {
            this._firstDataBlockPosition = 0;

            if (dictionary != null && dictionary.ContainsParameter("POINT", "DATA_START"))
            {
                this._firstDataBlockPosition = ((UInt16)Convert.ToInt16(dictionary["POINT", "DATA_START"].GetData(0)) - 1) * C3DConstants.FILE_SECTION_SIZE;
            }

            if (header != null && this._firstDataBlockPosition <= 0)
            {
                this._firstDataBlockPosition = (header.FirstDataSectionID - 1) * C3DConstants.FILE_SECTION_SIZE;
            }

            if (this._firstDataBlockPosition <= 0)
            {
                this._firstDataBlockPosition = (C3DConstants.FILE_DEFAULT_FIRST_PARAM_SECTION - 1) * C3DConstants.FILE_SECTION_SIZE;
            }
        }