Exemplo n.º 1
0
        internal void ProcessData(string movementData1, string movementData2)
        {
            MovementData movement1Pre = helper.ConvertInputDataToMovementData(movementData1);
            MovementData movement2Pre = helper.ConvertInputDataToMovementData(movementData2);

            MovementData movement1 = Helper.GetShorterMovement(movement1Pre, movement2Pre);
            MovementData movement2 = Helper.GetLongerMovement(movement1Pre, movement2Pre);

            MovementForDistanceCoeffitient movementX = new MovementForDistanceCoeffitient(movement1.doubleDataX, movement2.doubleDataX);
            MovementForDistanceCoeffitient movementY = new MovementForDistanceCoeffitient(movement1.doubleDataY, movement2.doubleDataY);
            MovementForDistanceCoeffitient movementZ = new MovementForDistanceCoeffitient(movement1.doubleDataZ, movement2.doubleDataZ);

            List <DataForCountingDifference> differencesX = GetDifferences(movementX);
            List <DataForCountingDifference> differencesY = GetDifferences(movementY);
            List <DataForCountingDifference> differencesZ = GetDifferences(movementZ);

            double distanceCoefX       = CalculateDistanceCoefficient(differencesX);
            double distanceCoefY       = CalculateDistanceCoefficient(differencesY);
            double distanceCoefZ       = CalculateDistanceCoefficient(differencesZ);
            double distanceCoefAverage = (distanceCoefX + distanceCoefY + distanceCoefZ) / 3.0;

            mainForm.SetTab3DistanceCoefficientX(distanceCoefX.ToString("0.####"));
            mainForm.SetTab3DistanceCoefficientY(distanceCoefY.ToString("0.####"));
            mainForm.SetTab3DistanceCoefficientZ(distanceCoefZ.ToString("0.####"));
            mainForm.SetTab3DistanceCoefficientAverage(distanceCoefAverage.ToString("0.####"));

            Bitmap visualizationX = GenerateDifferencesVisualizationImage(differencesX);
            Bitmap visualizationY = GenerateDifferencesVisualizationImage(differencesY);
            Bitmap visualizationZ = GenerateDifferencesVisualizationImage(differencesZ);

            mainForm.SetTab3PictureX(visualizationX);
            mainForm.SetTab3PictureY(visualizationY);
            mainForm.SetTab3PictureZ(visualizationZ);
        }
Exemplo n.º 2
0
        private List <DataForCountingDifference> GetDifferences(MovementForDistanceCoeffitient movement)
        {
            List <DataForCountingDifference> differences = new List <DataForCountingDifference>();

            for (int i = 0; i < movement.Lenght; i++)
            {
                DataForCountingDifference data = new DataForCountingDifference();
                data.MinValue   = movement.Bounds.Lower;
                data.MaxValue   = movement.Bounds.Upper;
                data.Difference = Math.Abs(movement.Movement1Data[i] - movement.Movement2Data[i]);
                data.StartValue = Math.Min(movement.Movement1Data[i], movement.Movement2Data[i]);
                differences.Add(data);
            }

            return(differences);
        }