Esempio n. 1
0
 private void btnSchmidtSelect_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (this.ActiveDataForm != null && !this.ActiveDataForm.IsBusy)
     {
         var targetform  = this.ActiveDataForm;
         var targettable = targetform.GetDataTable();
         ConfigForm.AttributeSelectionForm configform = new ConfigForm.AttributeSelectionForm(targettable.Name, targettable.GetColumnsList(false, typeof(string), typeof(DateTime), typeof(bool)));
         if (configform.ShowDialog() == DialogResult.OK)
         {
             try
             {
                 MdiForm.MdiSchmidtResultForm  resultform = new MdiForm.MdiSchmidtResultForm(targetform);
                 Protocol.Structure.WaitObject wt         = new Protocol.Structure.WaitObject();
                 targetform.DoMethod("施密特正交约减", (ThreadPool) =>
                 {
                     resultform.Result = Kernel.BusinessLogicOperation.DataProcessOperation.Schmidt(targettable, configform.SelectedColumns);
                 }, wt, () =>
                 {
                     this.Invoke(new Action(() =>
                     {
                         resultform.ShowResult();
                         resultform.Show();
                     }));
                 });
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message);
             }
         }
     }
 }
 private void btnEntropy_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (this.ActiveDataForm != null && !this.ActiveDataForm.IsBusy)
     {
         var targetform = this.ActiveDataForm;
         var targettable = targetform.GetDataTable();
         ConfigForm.AttributeSelectionForm configform = new ConfigForm.AttributeSelectionForm(targettable.Name, targettable.GetColumnsList(false, typeof(string), typeof(DateTime), typeof(bool)));
         if (configform.ShowDialog() == DialogResult.OK)
         {
             try
             {
                 MdiForm.MdiEntropyResultForm resultform = new MdiForm.MdiEntropyResultForm(targetform);
                 Protocol.Structure.WaitObject wt = new Protocol.Structure.WaitObject();
                 targetform.DoMethod("计算信息熵", (ThreadPool) =>
                 {
                     resultform.Result = Kernel.BusinessLogicOperation.DataProcessOperation.Entropy(targettable, configform.SelectedColumns, wt);
                 }, wt, () =>
                 {
                     this.Invoke(new Action(() =>
                         {
                             resultform.ShowResult();
                             resultform.Show();
                         }));
                 });
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message);
             }
         }
     }
 }