private void ShowResult(IntPtr windowPtr) { CvCure cv = XmlHelper.Deserialize <CvCure>(Path.Combine(Application.StartupPath, ConfigNames.SvCure)); StringBuilder builder = new StringBuilder(); builder.AppendLine("计算结果:"); builder.AppendLine("统计样本平均值X = " + cv.X); builder.AppendLine("变差系数Cv = " + cv.Cv); builder.AppendLine("偏态系数Cs = " + cv.Cs); builder.AppendLine("拟合度N = " + cv.Nihe); FormOutput.AppendLog(builder.ToString()); if (cv != null) { if (_parent.InvokeRequired) { _parent.Invoke(new Action(() => { if (_resutUI == null) { _resutUI = new CaculatePercentUI(); _resutUI.Dock = DockStyle.Fill; _parent.ShowDock("暴雨频率计算", _resutUI); } cv.State = txtState.Text; cv.Time = cmbPercent.SelectedValue.ToString(); _resutUI.BindResult(cv, windowPtr); })); } } }
/// <summary> /// 绑定UI数据 /// </summary> /// <param name="args"></param> public void BindResult(CvCure args, IntPtr windowPtr) { //初始化参数 if (args != null) { numX.Value = Convert.ToDecimal(args.X); numCv.Value = Convert.ToDecimal(args.Cv); numCs.Value = Convert.ToDecimal(args.Cs); txtNihe.Text = args.Nihe; _cuurentState = args.State; _currentTime = args.Time; } //初始化曲线 this.DockFigure(windowPtr); }
private void bgwCaculate_DoWork(object sender, DoWorkEventArgs e) { CvCure cv = e.Argument as CvCure; StringBuilder builder = new StringBuilder(); builder.Append(MethodName.ResearchCure); builder.Append(" "); builder.Append(cv.X); builder.Append(" "); builder.Append(cv.Cv); builder.Append(" "); builder.Append(cv.Cs); builder.Append(" "); builder.Append("c3-" + cv.State + "-" + cv.Time); e.Result = RunExeHelper.RunMethodExit(builder.ToString()); }
/// <summary> /// 将当前时间段当前站点的数据入库 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnInsert_Click(object sender, EventArgs e) { if (bgwCaculate.IsBusy == false) { FormOutput.AppendLog(string.Format("开始入库时间段为{0},站号为{1}的概率数据", _currentTime, _cuurentState)); CvCure arg = new CvCure() { State = _cuurentState, Time = _currentTime, X = Convert.ToDouble(numX.Value), Cv = Convert.ToDouble(numCv.Value), Cs = Convert.ToDouble(numCs.Value) }; bgwCaculate.RunWorkerAsync(arg); } else { FormOutput.AppendLog("当前后台正在入库,请稍候"); } }