Ejemplo n.º 1
0
 /// <summary>
 /// Method for Statistics commands
 /// </summary>
 /// <param name="command">Enum for StatisticsCommands</param>
 private void DesignAdvancedStatisticsCommand(AdvancedStatisticsCommands command)
 {
     try
     {
         Rule_Context Context = this.mainForm.EpiInterpreter.Context;
         switch (command)
         {
             case AdvancedStatisticsCommands.CoxProportionalHazards:
                 if (Context.CurrentRead != null)
                 {
                     DesignAndProcessCommand(new CoxProportionalHazardsDialog(mainForm));
                 }
                 else
                 {
                     DisplayNoDataSourceMessage();
                 }
                 break;
             case AdvancedStatisticsCommands.KaplanMeierSurvival:
                 if (Context.CurrentRead != null)
                 {
                     DesignAndProcessCommand(new KaplanMeierSurvivalDialog(mainForm));
                 }
                 else
                 {
                     DisplayNoDataSourceMessage();
                 }
                 break;
             case AdvancedStatisticsCommands.LinearRegression:
                 if (Context.CurrentRead != null)
                 {
                     DesignAndProcessCommand(new LinearRegressionDialog(mainForm));
                 }
                 else
                 {
                     DisplayNoDataSourceMessage();
                 }
                 break;
             case AdvancedStatisticsCommands.LogisticRegression:
                 if (Context.CurrentRead != null)
                 {
                     DesignAndProcessCommand(new LogisticRegressionDialog(mainForm));
                 }
                 else
                 {
                     DisplayNoDataSourceMessage();
                 }
                 break;
             case AdvancedStatisticsCommands.ComplexSampleTables:
                 if (Context.CurrentRead != null)
                 {
                     DesignAndProcessCommand(new ComplexSampleTablesDialog(mainForm));
                 }
                 else
                 {
                     DisplayNoDataSourceMessage();
                 }
                 break;
             case AdvancedStatisticsCommands.ComplexSampleMeans:
                 if (Context.CurrentRead != null)
                 {
                     DesignAndProcessCommand(new ComplexSampleMeansDialog(mainForm));
                 }
                 else
                 {
                     DisplayNoDataSourceMessage();
                 }
                 break;
             case AdvancedStatisticsCommands.ComplexSampleFrequencies:
                 if (Context.CurrentRead != null)
                 {
                     DesignAndProcessCommand(new ComplexSampleFrequencyDialog(mainForm));
                 }
                 else
                 {
                     DisplayNoDataSourceMessage();
                 }
                 break;
             default:
                 break;
         }//switch
     } //try
     finally
     {
         //programEditor.SavePGM(Files.LastPgm);
     }//finally
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Method for Statistics commands
        /// </summary>
        /// <param name="command">Enum for StatisticsCommands</param>
        private void DesignAdvancedStatisticsCommand(AdvancedStatisticsCommands command)
        {
            try
            {
                Rule_Context Context = this.mainForm.EpiInterpreter.Context;
                switch (command)
                {
                case AdvancedStatisticsCommands.CoxProportionalHazards:
                    if (Context.CurrentRead != null)
                    {
                        DesignAndProcessCommand(new CoxProportionalHazardsDialog(mainForm));
                    }
                    else
                    {
                        DisplayNoDataSourceMessage();
                    }
                    break;

                case AdvancedStatisticsCommands.KaplanMeierSurvival:
                    if (Context.CurrentRead != null)
                    {
                        DesignAndProcessCommand(new KaplanMeierSurvivalDialog(mainForm));
                    }
                    else
                    {
                        DisplayNoDataSourceMessage();
                    }
                    break;

                case AdvancedStatisticsCommands.LinearRegression:
                    if (Context.CurrentRead != null)
                    {
                        DesignAndProcessCommand(new LinearRegressionDialog(mainForm));
                    }
                    else
                    {
                        DisplayNoDataSourceMessage();
                    }
                    break;

                case AdvancedStatisticsCommands.LogisticRegression:
                    if (Context.CurrentRead != null)
                    {
                        DesignAndProcessCommand(new LogisticRegressionDialog(mainForm));
                    }
                    else
                    {
                        DisplayNoDataSourceMessage();
                    }
                    break;

                case AdvancedStatisticsCommands.ComplexSampleTables:
                    if (Context.CurrentRead != null)
                    {
                        DesignAndProcessCommand(new ComplexSampleTablesDialog(mainForm));
                    }
                    else
                    {
                        DisplayNoDataSourceMessage();
                    }
                    break;

                case AdvancedStatisticsCommands.ComplexSampleMeans:
                    if (Context.CurrentRead != null)
                    {
                        DesignAndProcessCommand(new ComplexSampleMeansDialog(mainForm));
                    }
                    else
                    {
                        DisplayNoDataSourceMessage();
                    }
                    break;

                case AdvancedStatisticsCommands.ComplexSampleFrequencies:
                    if (Context.CurrentRead != null)
                    {
                        DesignAndProcessCommand(new ComplexSampleFrequencyDialog(mainForm));
                    }
                    else
                    {
                        DisplayNoDataSourceMessage();
                    }
                    break;

                default:
                    break;
                } //switch
            }     //try
            finally
            {
                //programEditor.SavePGM(Files.LastPgm);
            }//finally
        }