private void ShowScannnedData(ScannedData scannedData)
        {
            if (scannedData == null)
            {
                return;
            }

            List <double> indexList = new List <double>();
            List <double> xAxisData;
            List <double> yAxisData;

            if (scannedData.dim2Data != null)
            {
                indexList.AddRange(scannedData.dim2Data);
                xAxisData = scannedData.dim1Data;
                yAxisData = scannedData.dim2Data;
            }
            else
            {
                for (int i = 0; i < scannedData.dim1Data.Count; i++)
                {
                    indexList.Add(i + 1);
                }
                xAxisData = indexList;
                yAxisData = scannedData.dim1Data;
            }
            linegraph.Plot(xAxisData, yAxisData); // x and y are IEnumerable<double>
        }
        private void ShowSampleCurve(SampleCurve sampleCurve)
        {
            if (sampleCurve == null)
            {
                return;
            }
            DimensionDataPoint dimensionDataPoint = sampleCurve.SampleCurveData;

            if (dimensionDataPoint.ScannedData != null)
            {
                ScannedData scannedData = dimensionDataPoint.ScannedData;
                ShowScannnedData(scannedData);
            }
            else if (dimensionDataPoint.DimensionDataList != null)
            {
                Z_DimValues.Clear();
                string paramName = null;
                for (int i = 0; i < dimensionDataPoint.DimensionDataList.Count; i++)
                {
                    Z_DimValues.Add(dimensionDataPoint.DimensionDataList[i].GetParamValueString());
                    paramName = dimensionDataPoint.DimensionDataList[i].GetParamValueName();
                }
                if (paramName != null)
                {
                    txtDimZ.Text = paramName;
                }
                cbDimZValue.ItemsSource     = Z_DimValues;
                cbDimZValue.SelectedIndex   = 0;
                _currrentDimensionDataPoint = dimensionDataPoint;
                CbDimZValue_SelectionChanged(null, null);
            }
        }
예제 #3
0
        public Sample CreateSampleScanResult(ScannedData scannedData)
        {
            SampleOperation sampleOperation = GetParentOperationByType(typeof(SampleOperation)) as SampleOperation;

            if (sampleOperation != null)
            {
                SampleCurve sampleCurve = new SampleCurve();
                sampleCurve.CurveName                   = sampleOperation.Name;
                sampleCurve.SampleCurveData             = new DimensionDataPoint();
                sampleCurve.SampleCurveData.ScannedData = scannedData;

                Sample sample = new Sample();
                sample.SampleName = sampleOperation.Name;
                sample.AddCurve(sampleCurve);
                return(sample);
            }
            return(null);
        }