Esempio n. 1
0
        public static double[] LoadData(BasicEnums.ChainTypes chainType, BasicEnums.HistTypes histType)
        {
            string file = firstNameFiles + chainType.ToString();

            string dir = IO.Directory.SubDirCoord;
            string pathFileSpinningRayValue = dir + @"\" + file + histType.ToString() + Consts.extensionOfFile;

            ExtendedStreamReader srSpinningRay = new ExtendedStreamReader(pathFileSpinningRayValue, Config.CurrentGuid, Config.Crypt);

            string allText = srSpinningRay.ReadToEnd();

            if (allText != null)
            {
                string[] arrString = Regex.Split(allText, ";");
                //Array.Resize(ref arrString, arrString.Length -1); //tira o bug do ENTER

                srSpinningRay.Close();
                srSpinningRay.Dispose();

                double[] arrDouble = new double[arrString.Length - 1];
                for (int i = 0; i < arrString.Length - 1; i++)
                {
                    arrDouble[i] = Convert.ToDouble(arrString[i]);
                }

                return(arrDouble);
            }
            else
            {
                return(null);
            }
        }