private List <FSPoint> CreatePoints(int num, double xStep, int location, int Count) { var Points = new List <FSPoint>(); for (var i = 0; i < num; i++) { var temp = new FSPoint(); temp.Location = location; temp.Z = 999999 * FSCoreDefines.ProfileScale; if (_fsCoreConfig.IsXAxisTrige) { temp.X = -(XStartPos + Count * _inervalTemp); temp.Y = -YStartPos + i * xStep * FSCoreDefines.ProfileScale; } else { temp.X = XStartPos + i * xStep * FSCoreDefines.ProfileScale; temp.Y = YStartPos + Count * _inervalTemp; } Points.Add(temp); } return(Points); }
private List <FSPoint> GetPoints(float[] zValues, float[] intensityValues, int lineLength, double xStep, FsApi.Header header, int Count) { var Points = new List <FSPoint>(); var no_meas = FsApi.NoMeasurement - 1; //for (int i = 0; i < lineLength; i = i + 3) for (var i = 0; i < lineLength; i++) { if (zValues[i] > no_meas) { zValues[i] = 999998; } var temp = new FSPoint(); if (_fsCoreConfig.IsXAxisTrige) { temp.X = -(XStartPos + Count * _inervalTemp); //should be changed by TriggerTable temp.Y = -YStartPos + i * xStep * FSCoreDefines.ProfileScale; } else { if (_fsCoreConfig.FlipXEnabled == 0) { //正常 temp.Y = -(XStartPos + Count * _inervalTemp); temp.X = -YStartPos + i * xStep * FSCoreDefines.ProfileScale; } else if (_fsCoreConfig.FlipXEnabled == 1) { //正常 temp.Y = -(XStartPos + Count * _inervalTemp); temp.X = -YStartPos + (2047 - i) * xStep * FSCoreDefines.ProfileScale; } //temp.X = XStartPos + i * xStep * FSCoreDefines.ProfileScale; //temp.Y = YStartPos + _listBatch.Count * _inervalTemp; } temp.Z = zValues[i] * FSCoreDefines.ProfileScale; temp.Intensity = (int)intensityValues[i]; //temp.Location = header.Location; // temp.Location = _batchCount * 2; temp.Location = header.Location; temp.index = header.Index; Points.Add(temp); } return(Points); }
private void ProfileReceptionCallback(IList <FsApi.Point> profile, FsApi.Header headerIn) { if (!_dataRequest) { return; } _header = headerIn; _averageIntensity = profile.Any() ? profile.Average(p => p.Intensity) : 0.0f; try { var processed = new List <FSPoint>(); _inervalTemp = _fsCoreConfig.TrigInterval; if (!_fsCoreConfig.IsExternalPulsingEnabled) { _inervalTemp = 1.0f / _fsCoreConfig.Freq; } //for (int i = 0; i < profile.Count; i = i + 3) for (var i = 0; i < profile.Count; i++) { var temp = new FSPoint(); if (_fsCoreConfig.IsXAxisTrige) { temp.X = -(XStartPos + (headerIn.Location = _FirstLocation) / 2 * _inervalTemp); temp.Y = -YStartPos + profile[i].X * FSCoreDefines.ProfileScale; } else { temp.X = XStartPos + profile[i].X * FSCoreDefines.ProfileScale; temp.Y = YStartPos + (headerIn.Location = _FirstLocation) / 2 * _inervalTemp; } temp.Z = ZStartPos + profile[i].Y * FSCoreDefines.ProfileScale; temp.Intensity = (int)profile[i].Intensity; temp.index = headerIn.Index; processed.Add(temp); } //_queue.Enqueue(processed); //if (_queue.Count > FSCoreDefines.QueueMaxLength) //{ // List<FSPoint> overflow; // _queue.TryDequeue(out overflow); // overflow.Clear(); //} if ((headerIn.Location = _FirstLocation) / 2 < 5000) { //_listBatch.Add(new List<FSPoint>(processed)); // _listBatch.Add(processed); } if (IsAgcSupported && _fsCoreConfig.IsAgcEnabled) { _agcAdjustedLedPulseWidth = (int)_header.PulseWidth; } } catch (Exception) { } }