Beispiel #1
0
        /// <summary>
        /// Matrix Constructor
        /// </summary>
        /// <param name="config"></param>
        /// <param name="value"></param>
        /// <param name="indexInPmc"></param>
        /// <param name="indexInContainer"></param>
        public Matrix(PmcConfiguration config, T value, int indexInPmc, int indexInContainer) : base(config, value)
        {
            _indexInPmc = indexInPmc;
            _indexInContainer = indexInContainer;

            Dimension = GetPointDimension();
        }
Beispiel #2
0
        /// <summary>
        /// Position Constructor
        /// </summary>
        /// <param name="config"></param>
        /// <param name="value"></param>
        /// <param name="indexInPmc"></param>
        /// <param name="indexInContainer"></param>
        /// <param name="indexInMatrix"></param>
        /// <param name="dimension"></param>
        public Position(PmcConfiguration config, T value, int indexInPmc, int indexInContainer, int indexInMatrix, PointDimension dimension) : base(config, value)
        {
            _indexInPmc       = indexInPmc;
            _indexInContainer = indexInContainer;
            _indexInMatrix    = indexInMatrix;

            Dimension = dimension;
        }
Beispiel #3
0
 public void TestSetup()
 {
     _data   = 5;
     _config = new PmcConfiguration
     {
         CountContainers = 1,
         CountMatrices   = 1,
         CountPositions  = 1,
         CountPoints     = 1
     };
     _developer = new ContainerCollectionDeveloper <int>(_config);
     _pmc       = _developer.Create(_data);
 }
Beispiel #4
0
        //A container collection contains 10 containers.  All data points are double.
        //Each container contains 10 matrices with the first 5 matrices being XY data and the remaining 5 being X data.
        //All positions in all matrices contain values.
        public void ShowExample2()
        {
            var conf = new PmcConfiguration
            {
                CountContainers = 10,
                CountPositions  = 10,
                CountMatrices   = 10,
                MatrixConfig    = new MatrixConfiguration
                {
                    MatrixNumberToDimensionRules = new List <MatrixNumberToDimension>
                    {
                        new MatrixNumberToDimension
                        {
                            Dimension        = PointDimension.Xy,
                            IndexInContainer = new List <int>
                            {
                                0, 1, 2, 3, 4
                            }
                        },
                        new MatrixNumberToDimension
                        {
                            Dimension        = PointDimension.X,
                            IndexInContainer = new List <int>
                            {
                                5, 6, 7, 8, 9
                            }
                        }
                    }
                }
            };

            Developer <double> dev = new ContainerCollectionDeveloper <double>(conf);
            var containers         = dev.Create(10.5);

            Console.WriteLine("Example 2: ");

            Console.WriteLine($"Count containers: {containers.Count}");                    //10
            Console.WriteLine($"Count matrices in each container: {containers[0].Count}"); //10

            for (var i = 0; i < containers[0].Count; i++)
            {
                Console.WriteLine($"{i} matrix dimension: {containers[0][i].Dimension}");// First 5 - XY, other - X
            }


            //Uncomment line below to watch all data

            //ShowData(containers);

            Console.WriteLine();
        }
Beispiel #5
0
        public void TestSetup()
        {
            _data = 18.5;

            _config = new PmcConfiguration
            {
                CountContainers = 10,
                CountPositions  = 10,
                CountMatrices   = 10,
                MatrixConfig    = new MatrixConfiguration
                {
                    MatrixNumberToDimensionRules = new List <MatrixNumberToDimension>
                    {
                        new MatrixNumberToDimension
                        {
                            Dimension        = PointDimension.Xy,
                            IndexInContainer = new List <int>
                            {
                                0,
                                1,
                                2,
                                3,
                                4
                            }
                        },
                        new MatrixNumberToDimension
                        {
                            Dimension        = PointDimension.X,
                            IndexInContainer = new List <int>
                            {
                                5,
                                6,
                                7,
                                8,
                                9
                            }
                        }
                    }
                }
            };

            _developer = new ContainerCollectionDeveloper <double>(_config);
            _pmc       = _developer.Create(_data);
        }
Beispiel #6
0
 /// <summary>
 /// Pmc Constructor
 /// </summary>
 /// <param name="config"></param>
 /// <param name="value"></param>
 public Pmc(PmcConfiguration config, T value) : base(config, value)
 {
 }
 /// <summary>
 /// Handle required params, ConfigurableCollection Constructor
 /// </summary>
 /// <param name="config">Contain all data configuration</param>
 /// <param name="value">Some numeric value, which will be inside containers</param>
 protected ConfigurableCollection(PmcConfiguration config, T value)
 {
     Config    = config;
     DataValue = value;
 }
Beispiel #8
0
 /// <summary>
 /// Init configuration from constructor
 /// </summary>
 /// <param name="config"></param>
 protected Developer(PmcConfiguration config)
 {
     Config = config;
 }
Beispiel #9
0
        //Example 1:  A container collection contains 3 containers.  All data points are decimal.  Each matrix contains 100 positions.
        //Each container contains 2 matrices with the first matrix in each container being XY data and the second matrix in each container being X data.
        //Position 1 of the XY data contains 50 points.  Position 2 of the XY data contains 200 points.  The other XY positions are empty.
        //Position 1 and 2 of the X data matrix contain a numerical value, the others do not
        public void ShowExample1()
        {
            var conf = new PmcConfiguration
            {
                CountContainers = 3,
                CountPositions  = 100,
                CountMatrices   = 2,
                MatrixConfig    = new MatrixConfiguration
                {
                    MatrixNumberToDimensionRules = new List <MatrixNumberToDimension>
                    {
                        new MatrixNumberToDimension
                        {
                            Dimension        = PointDimension.Xy,
                            IndexInContainer = new List <int>
                            {
                                0
                            }
                        },
                        new MatrixNumberToDimension
                        {
                            Dimension        = PointDimension.X,
                            IndexInContainer = new List <int>
                            {
                                1
                            }
                        }
                    }
                },
                XyConfig = new XyConfiguration
                {
                    Rules = new List <XyRule>
                    {
                        new XyRule
                        {
                            CountPoints = 50,
                            Path        = new PointPath
                            {
                                IndexInMatrix = 0
                            }
                        },
                        new XyRule
                        {
                            CountPoints = 200,
                            Path        = new PointPath
                            {
                                IndexInMatrix = 1
                            }
                        }
                    },
                    DefaultCountPoints = 0
                },
                XConfig = new XConfiguration
                {
                    DefaultCountPoints = 0,
                    Rules = new List <XRule>
                    {
                        new XRule
                        {
                            CountPoints = 1,
                            Path        = new PointPath
                            {
                                IndexInMatrix = 0
                            }
                        },
                        new XRule
                        {
                            CountPoints = 1,
                            Path        = new PointPath
                            {
                                IndexInMatrix = 1
                            }
                        }
                    }
                }
            };

            Developer <decimal> dev = new ContainerCollectionDeveloper <decimal>(conf);
            var containers          = dev.Create(new decimal(150));

            Console.WriteLine("Example 1: ");

            Console.WriteLine($"Count containers: {containers.Count}");                                                               //3
            Console.WriteLine($"Count matrices in each container: {containers[0].Count}");                                            //2
            Console.WriteLine($"First matrix dimension: {containers[0][0].Dimension}");                                               //XY
            Console.WriteLine($"Second matrix dimension: {containers[0][1].Dimension}");                                              //X
            Console.WriteLine($"Position 1 of the XY data contains {containers[0][0][0].Count} points");                              //50
            Console.WriteLine($"Position 2 of the XY data contains {containers[0][0][1].Count} points");                              //200
            Console.WriteLine($"Position 3 and other of the XY data contains {containers[0][0][2].Count} points");                    //0
            Console.WriteLine($"Position 1 of the X data contains {containers[0][1][0].Count} points");                               //numerical value, 1 at this case
            Console.WriteLine($"Position 2 of the X data contains {containers[0][1][1].Count} points");                               //numerical value, 1 at this case
            Console.WriteLine($"Position 3 and other of the X data contains {containers[0][1][2].Count} points");                     //0

            Console.WriteLine($"Data value at 1 container, 1 matrix, 1 position, 1 point, X: {containers[0][0][0][0].DataValue[0]}"); //150

            //Uncomment line below to watch all data

            //ShowData(containers);

            Console.WriteLine();
        }
Beispiel #10
0
 public void TestTearDown()
 {
     _config    = null;
     _developer = null;
 }
Beispiel #11
0
 /// <summary>
 /// Handle configuration by constructor
 /// </summary>
 /// <param name="config"></param>
 public ContainerCollectionDeveloper(PmcConfiguration config) : base(config)
 {
 }
Beispiel #12
0
        public void TestSetup()
        {
            _data = 5;

            _pos1XYpointsCount       = 50;
            _pos2XYpointsCount       = 200;
            _posDefaultXYpointsCount = 0;

            _pos1XpointsCount       = _pos2XpointsCount = 1;
            _posDefaultXpointsCount = 0;

            _config = new PmcConfiguration
            {
                CountContainers = 3,
                CountPositions  = 100,
                CountMatrices   = 2,
                MatrixConfig    = new MatrixConfiguration
                {
                    MatrixNumberToDimensionRules = new List <MatrixNumberToDimension>
                    {
                        new MatrixNumberToDimension
                        {
                            Dimension        = PointDimension.Xy,
                            IndexInContainer = new List <int>
                            {
                                0
                            }
                        },
                        new MatrixNumberToDimension
                        {
                            Dimension        = PointDimension.X,
                            IndexInContainer = new List <int>
                            {
                                1
                            }
                        }
                    }
                },
                XyConfig = new XyConfiguration
                {
                    Rules = new List <XyRule>
                    {
                        new XyRule
                        {
                            CountPoints = _pos1XYpointsCount,
                            Path        = new PointPath
                            {
                                IndexInMatrix = 0
                            }
                        },
                        new XyRule
                        {
                            CountPoints = _pos2XYpointsCount,
                            Path        = new PointPath
                            {
                                IndexInMatrix = 1
                            }
                        }
                    },
                    DefaultCountPoints = _posDefaultXYpointsCount
                },
                XConfig = new XConfiguration
                {
                    DefaultCountPoints = _posDefaultXpointsCount,
                    Rules = new List <XRule>
                    {
                        new XRule
                        {
                            CountPoints = _pos1XpointsCount,
                            Path        = new PointPath
                            {
                                IndexInMatrix = 0
                            }
                        },
                        new XRule
                        {
                            CountPoints = _pos2XpointsCount,
                            Path        = new PointPath
                            {
                                IndexInMatrix = 1
                            }
                        }
                    }
                }
            };
            _developer = new ContainerCollectionDeveloper <int>(_config);
            _pmc       = _developer.Create(_data);
        }
Beispiel #13
0
 /// <summary>
 /// Container Constructor
 /// </summary>
 /// <param name="config"></param>
 /// <param name="value"></param>
 /// <param name="indexInPmc"></param>
 public Container(PmcConfiguration config, T value, int indexInPmc) : base(config, value)
 {
     _indexInPmc = indexInPmc;
 }