示例#1
0
 public FunctionWindow()
 {
     InitializeComponent();
     LinearViewModel      = new LinearViewModel();
     ExponentialViewModel = new ExponentialViewModel();
     PowerViewModel       = new PowerViewModel();
 }
示例#2
0
 public FunctionWindow(double[] xdata, double[] ydata, string functionType)
 {
     InitializeComponent();
     successfullLoad = true;
     try
     {
         if (functionType == "Lineal")
         {
             LinearViewModel = new LinearViewModel(xdata, ydata, minAndMax(xdata), minAndMax(ydata));
             if (!LinearViewModel.displayed)
             {
                 errorMessage    = "It was not possible a lineal regression QR";
                 successfullLoad = false;
             }
             this.DataContext = LinearViewModel;
         }
         if (functionType == "Exponential")
         {
             ExponentialViewModel = new ExponentialViewModel(xdata, ydata, minAndMax(xdata), minAndMax(ydata));
             if (!ExponentialViewModel.displayed)
             {
                 errorMessage    = "It was not possible an exponential regression QR";
                 successfullLoad = false;
             }
             this.DataContext = ExponentialViewModel;
         }
         if (functionType == "Power function")
         {
             PowerViewModel = new PowerViewModel(xdata, ydata, minAndMax(xdata), minAndMax(ydata));
             if (!PowerViewModel.displayed)
             {
                 successfullLoad = false;
             }
             this.DataContext = PowerViewModel;
         }
     }
     catch (Exception)
     {
         errorMessage    = "Unexpected error";
         successfullLoad = false;
     }
 }
 public LinearAttenuationCommand(LinearViewModel pModel)
 {
     mModel = pModel;
 }