public override void OnClick() { MyIODATA_FRM myIODATA_FRM = new MyIODATA_FRM(); if (myIODATA_FRM.ShowDialog() != DialogResult.OK) { return; } ISODataClassification_Exchange_Info iSODataClassification = new ISODataClassification_Exchange_Info(); iSODataClassification = MyIODATA_FRM.ISODataParams; ISODataClassificationAlgo iSODataClassificationAlgo = new ISODataClassificationAlgo { Params = iSODataClassification }; AlgoFactory.Instance().AsynExecuteAlgo(iSODataClassificationAlgo); ISystemAlgoEvents systemAlgoEvents = iSODataClassificationAlgo as ISystemAlgoEvents; systemAlgoEvents.OnExecuteCompleted += OnAlgoExecuteCompleted; //systemAlgoEvents.OnProgressChanged += OnAlgoProgresChanged; //PIE.AxControls.IStatusBar statusBar = m_Application.StatusBar; //statusBar.ShowProgress(0, 100, ""); //Application.DoEvents(); ProgressBar progressBar = new ProgressBar(); }
private void Bn_Excecute_Click(object sender, EventArgs e) { IList <int> lowBand = new List <int>(); for (int i = 0; i < BandCount; i++) { if (LB_BandDisplay.GetSelected(i)) { lowBand.Add(i); } } if (lowBand.Count == 0) { MessageBox.Show("请至少选择一个波段!"); } else if (Tb_OutputPath.Text == "") { MessageBox.Show("请输入输出路径!"); } else { iSODataParams.LowBands = lowBand; ISODataParams.ProspClassNum = Convert.ToInt16(nud_PreCateNum.Value); iSODataParams.InitClassNum = Convert.ToInt16(nud_InitCateNum.Value); iSODataParams.MinSam = Convert.ToInt16(nud_MinPixelNum.Value); iSODataParams.MaxMerge = Convert.ToInt16(nud_MaxComCpNum.Value); iSODataParams.MaxLoop = Convert.ToInt16(nud_MaxIteraNum.Value); try { iSODataParams.MinDis = Convert.ToDouble(Tb_MinCenDistance.Text); iSODataParams.Dev = Convert.ToDouble(Tb_MaxSD.Text); } catch (Exception exp) { MessageBox.Show("最大标准差和最小中心距离应为数字,请检查!"); return; } if (iSODataParams.MinDis < 0 || iSODataParams.Dev < 0) { MessageBox.Show("最大标准差和最小中心距离应为正数,请检查!"); return; } iSODataParams.FuncName = "ISODATA分类"; iSODataParams.FileTypeCode = "GTiff"; ISODataClassificationAlgo iSODataClassificationAlgo = new ISODataClassificationAlgo { Params = iSODataParams }; DialogResult = DialogResult.OK; } }
public override void OnClick() { ISODATA_FRM myIODATA_FRM = new ISODATA_FRM(); if (myIODATA_FRM.ShowDialog() != DialogResult.OK) { return; } ISODataClassification_Exchange_Info iSODataClassification = new ISODataClassification_Exchange_Info(); iSODataClassification = ISODATA_FRM.ISODataParams; ISODataClassificationAlgo iSODataClassificationAlgo = new ISODataClassificationAlgo { Params = iSODataClassification }; Application.DoEvents(); AlgoFactory.Instance().AsynExecuteAlgo(iSODataClassificationAlgo); ISystemAlgoEvents systemAlgoEvents = iSODataClassificationAlgo as ISystemAlgoEvents; systemAlgoEvents.OnExecuteCompleted += OnAlgoExecuteCompleted; systemAlgoEvents.OnProgressChanged += OnAlgoProgresChanged; }