/// <summary>
    /// Asks the user for the maximum number of factors and the cross validation calculation.
    /// </summary>
    /// <param name="options">The PLS options to ask for. On return, this is the user's choice.</param>
    /// <param name="preprocessOptions">The spectral preprocessing options to ask for (output).</param>
    /// <returns>True if the user has made his choice, false if the user pressed the Cancel button.</returns>
    public static bool QuestPLSAnalysisOptions(out MultivariateAnalysisOptions options, out SpectralPreprocessingOptions preprocessOptions)
    {
      options = new MultivariateAnalysisOptions();
      options.MaxNumberOfFactors =20;
      options.CrossPRESSCalculation = CrossPRESSCalculationType.ExcludeGroupsOfSimilarMeasurements;

      PLSStartAnalysisController ctrlAA = new PLSStartAnalysisController(options);
      PLSStartAnalysisControl    viewAA = new PLSStartAnalysisControl();
      ctrlAA.View = viewAA;

      preprocessOptions = new SpectralPreprocessingOptions();
      SpectralPreprocessingController  ctrlBB = new SpectralPreprocessingController(preprocessOptions);
      SpectralPreprocessingControl     viewBB = new SpectralPreprocessingControl();
      ctrlBB.View = viewBB;

      TabbedElementController tabController = new TabbedElementController();
      tabController.AddTab("Factors",ctrlAA,viewAA);
      tabController.AddTab("Preprocessing", ctrlBB, viewBB);
      if (Current.Gui.ShowDialog(tabController, "Enter analysis parameters", false))
      {
        options = ctrlAA.Doc;
        return true;
      }

      /*
      TabbedDialogController dialogctrl = new TabbedDialogController("PLS Analysis",false);
      dialogctrl.AddTab("Factors",ctrlAA,viewAA);
      dialogctrl.AddTab("Preprocessing",ctrlBB,viewBB);
      TabbedDialogView  dialogview = new TabbedDialogView();
      dialogctrl.View = dialogview;

      if(dialogctrl.ShowDialog(Current.MainWindow))
      {
        options = ctrlAA.Doc;

        return true;
      }
      */
      return false;
    }
Example #2
0
		/// <summary>
		/// Asks the user for the maximum number of factors and the cross validation calculation.
		/// </summary>
		/// <param name="options">The PLS options to ask for. On return, this is the user's choice.</param>
		/// <param name="preprocessOptions">The spectral preprocessing options to ask for (output).</param>
		/// <returns>True if the user has made his choice, false if the user pressed the Cancel button.</returns>
		public static bool QuestPLSAnalysisOptions(out MultivariateAnalysisOptions options, out SpectralPreprocessingOptions preprocessOptions)
		{
			options = new MultivariateAnalysisOptions();
			options.MaxNumberOfFactors = 20;
			options.CrossPRESSCalculation = CrossPRESSCalculationType.ExcludeGroupsOfSimilarMeasurements;

			PLSStartAnalysisController ctrlAA = new PLSStartAnalysisController(options);
			Current.Gui.FindAndAttachControlTo(ctrlAA);

			preprocessOptions = new SpectralPreprocessingOptions();
			SpectralPreprocessingController ctrlBB = new SpectralPreprocessingController(preprocessOptions);
			Current.Gui.FindAndAttachControlTo(ctrlBB);

			TabbedElementController tabController = new TabbedElementController();
			tabController.AddTab("Factors", ctrlAA, ctrlAA.ViewObject);
			tabController.AddTab("Preprocessing", ctrlBB, ctrlBB.ViewObject);
			if (Current.Gui.ShowDialog(tabController, "Enter analysis parameters", false))
			{
				options = ctrlAA.Doc;
				return true;
			}
			return false;
		}