private void Integrator(Param param, Helpers.ConfigurationHelpers.Output output)
        {
            //deleta arquivo, se existir
            if (File.Exists(dirServerExcel + @"\" + excelFileName))
            {
                File.Delete(dirServerExcel + @"\" + excelFileName);
            }

            GridProteinFolding.Middle.Helpers.IOHelpers.Directory.CreateDirIfNotExist(dirServerExcel);

            XLWorkbook workbook = new XLWorkbook();


            if (output.distribution)
            {
                GICO.WriteLine(String.Format("  Excel: SheetDistribution..."));
                SheetDistribution(ref workbook);
                Save(ref workbook);
            }

            if (param.output.evolution)
            {
                GICO.WriteLine(String.Format("  Excel: SheetEvolutionRadiusGyration..."));
                SheetEvolutionRadiusGyration(ref workbook);
                GICO.WriteLine(String.Format("  Excel: SheetEvolutionValueMediumOfEnergy..."));
                SheetEvolutionValueMediumOfEnergy(ref workbook);
                Save(ref workbook);
            }

            if (param.output.configuration)
            {
                GICO.WriteLine(String.Format("  Excel: SheetConfiguration..."));
                SheetConfiguration(ref workbook);
                Save(ref workbook);
            }

            if (output.histogram)
            {
                GICO.WriteLine(String.Format("  Excel: SheetsHistogram..."));
                SheetsHistogram(ref workbook);
                Save(ref workbook);
            }

            if (output.trajectory)
            {
                GICO.WriteLine(String.Format("  Excel: SheetTrajectory..."));
                SheetTrajectory(ref workbook);
                Save(ref workbook);
            }

            if (output.debug)
            {
                GICO.WriteLine(String.Format("  Excel: SheetDebug..."));
                SheetDebug(ref workbook);
                Save(ref workbook);
            }

            workbook = null;
        }
        public void Execute(Helpers.ConfigurationHelpers.Output output)
        {
            //Config.CurrentGuid = param.dataToProcess.Guid;

            //try
            //{
            this.maxInterations = param.dataToProcess.maxInterations; //numero maximo de tentativas
            this.sites          = param.dataToProcess.totalSitio;     //número total de sítios do monomero

            this.dirServerExcel     = DirBaseServer + param.dataToProcess.Guid.ToString() + @"\" + Resource.DirResult + @"\" + Resource.SubDirExcel;
            this.dirWebExcel        = DirBaseWeb + param.dataToProcess.Guid.ToString() + @"\" + Resource.DirResult;// + @"\" + Resource.SubDirExcel;
            this.dirServerNeighbors = DirBaseServer + param.dataToProcess.Guid.ToString() + @"\" + Resource.DirDebug + @"\" + Resource.SubDirNeighbors;
            this.dirServerHistogram = DirBaseServer + param.dataToProcess.Guid.ToString() + @"\" + Resource.DirDebug + @"\" + Resource.SubDirHistogram;
            this.dirServerDebug     = DirBaseServer + param.dataToProcess.Guid.ToString() + @"\" + Resource.DirDebug + @"\" + Resource.SubDirDebug;
            this.dirWebDebug        = DirBaseWeb + param.dataToProcess.Guid.ToString() + @"\" + Resource.DirDebug + @"\" + Resource.SubDirDebug;

            excelFileName  = param.dataToProcess.Guid.ToString() + ".xlsx";
            valueDivResult = param.dataToResults.valueDivResult;

            this.MCSteps = maxInterations * sites * 5;
            this.delta   = MCSteps / valueDivResult;

            //IF EXIST, EXECUTE INTEGRATOR
            if (Directory.Exists(dirServerDebug))
            {
                GICO.WriteLine(String.Format("  Excel: Integrator..."));
                Integrator(param, output);

                GICO.WriteLine(String.Format("  Excel: CopyFile..."));
                CopyFile(param);
            }
            else
            {
                GICO.WriteLine(AppConfigClient.CurrentGuid, String.Format("Directory not found: {0}  Integrator of Excel not executed...", dirServerDebug));
            }
            //}
            //catch (Exception ex)
            //{
            //    GICO.WriteLine(ex);
            //}
        }