private void btnExecute_Click(object sender, EventArgs e) { string smpFtrNm = cmbSampleFeatureClass.Text; string outP = txtOutputPath.Text; if (smpFtrNm == null || smpFtrNm == "") { MessageBox.Show("You must select a feature Class", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (outP == null || outP == "") { MessageBox.Show("You must select an output model path", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try { Statistics.ModelHelper.runProgressBar("Running Variance Covariance"); List <string> lstInd = new List <string>(); for (int i = 0; i < lstIndependent.Items.Count; i++) { string s = lstIndependent.Items[i].ToString(); lstInd.Add(s); } Statistics.dataPrepVarCovCorr varCov = null; if (ftrDic.ContainsKey(smpFtrNm)) { if (lstInd.Count < 1) { MessageBox.Show("You must select at least one variable field", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } this.Visible = false; ITable ftrCls = ftrDic[smpFtrNm]; varCov = new Statistics.dataPrepVarCovCorr(ftrCls, lstInd.ToArray()); } else { IRaster rs = rstDic[smpFtrNm]; this.Visible = false; varCov = new Statistics.dataPrepVarCovCorr(rs); } varCov.writeModel(outP); varCov.getReport(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { Statistics.ModelHelper.closeProgressBar(); this.Close(); } }
private void btnExecute_Click(object sender, EventArgs e) { string smpFtrNm = cmbSampleFeatureClass.Text; string outP = txtOutputPath.Text; if (smpFtrNm == null || smpFtrNm == "") { MessageBox.Show("You must select a feature Class","Error",MessageBoxButtons.OK,MessageBoxIcon.Error); return; } if (outP == null || outP == "") { MessageBox.Show("You must select an output model path", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try { Statistics.ModelHelper.runProgressBar("Running Variance Covariance"); List<string> lstInd = new List<string>(); for (int i = 0; i < lstIndependent.Items.Count; i++) { string s = lstIndependent.Items[i].ToString(); lstInd.Add(s); } Statistics.dataPrepVarCovCorr varCov = null; if (ftrDic.ContainsKey(smpFtrNm)) { if (lstInd.Count < 1) { MessageBox.Show("You must select at least one variable field", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } this.Visible = false; ITable ftrCls = ftrDic[smpFtrNm]; varCov = new Statistics.dataPrepVarCovCorr(ftrCls, lstInd.ToArray()); } else { IRaster rs = rstDic[smpFtrNm]; this.Visible = false; varCov = new Statistics.dataPrepVarCovCorr(rs); } varCov.writeModel(outP); varCov.getReport(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { Statistics.ModelHelper.closeProgressBar(); this.Close(); } }