Exemplo n.º 1
0
        public List <Channel <double> > getParams(String _filePathString, ProcessingMachine machine)
        {
            mChannelsArrayList = new List <Channel <double> >();
            //массив для параметров
            int[] paramsArray = new int[66];
            //вызов метода заполнения массива параметров
            if (machine == ProcessingMachine.CPP)
            {
                getParamsCPP(_filePathString, ref paramsArray);
            }
            else if (machine == ProcessingMachine.Csharp)
            {
                getParamsCS(_filePathString, ref paramsArray);
            }

            mCount     = paramsArray[0];
            mFrequency = paramsArray[65];
            for (int i_channel = 1; i_channel <= mCount; i_channel++)
            {
                Channel <double> currentChannel =
                    new Channel <double>(
                        paramsArray[i_channel],
                        paramsArray[i_channel + 32]
                        );
                mChannelsArrayList.Add(currentChannel);
            }
            return(mChannelsArrayList);
        }
        public static void showDataReport(string _dataPath, ProcessingMachine machine)
        {
            ParamsReader paramsReader = new ParamsReader();
            List <gen.Channel <double> > channelsArrayList =
                paramsReader.getParams(_dataPath + ".prm", machine);

            /*foreach (gen.Channel<double> channel in channelsArrayList)
             * {
             *  Console.WriteLine(channel.number + " " + channel.amp);
             * }*/

            DataReader dataReader = new DataReader();

            dataReader.getData(_dataPath + ".dat", ref channelsArrayList);
            int total = 0;

            foreach (var ch in channelsArrayList)
            {
                //Console.WriteLine($"Data from {_dataPath}. Channel # {ch.number}: {ch.dataArrayList.Count}");
                total += ch.dataArrayList.Count;
            }
            Console.WriteLine($"Data from {_dataPath}. Total: {total}");
        }