/// <summary> /// 显示 /// </summary> /// <param name="hwin"></param> /// <returns></returns> public override bool show(HWindow hwin) { bool ok = false; if (Ho_crossLine.IsInitialized() && Ho_Point.IsInitialized()) { hwin.DispObj(Ho_crossLine); hwin.DispObj(Ho_Point); ok = true; } return(ok); }
/// <summary> /// 检测 /// </summary> /// <param name="ho_Image"></param> /// <param name="hwin"></param> /// <param name="Key"></param> /// <param name="_dictionary_resulte"></param> /// <returns></returns> public override bool analyze_show(HWindow hwin, string Key, ref Dictionary <string, object> _dictionary_resulte) { bool ok = false; if ((IrectShuJuPianYiOne != null) && (IrectShuJuPianYiTwo != null)) { HTuple distance_; HOperatorSet.DistancePp(IrectShuJuPianYiOne.Row, IrectShuJuPianYiOne.Column, IrectShuJuPianYiTwo.Row, IrectShuJuPianYiTwo.Column, out distance_); HOperatorSet.LineOrientation(IrectShuJuPianYiOne.Row, IrectShuJuPianYiOne.Column, IrectShuJuPianYiTwo.Row, IrectShuJuPianYiTwo.Column, out this.angle); HTuple row_ = new HTuple(), col_ = new HTuple(); HObject ho_cross; HOperatorSet.GenEmptyObj(out ho_cross); row_[0] = IrectShuJuPianYiOne.Row; row_[1] = IrectShuJuPianYiTwo.Row; row_[2] = (row_[0].D + row_[1].D) / 2; col_[0] = IrectShuJuPianYiOne.Column; col_[1] = IrectShuJuPianYiTwo.Column; col_[2] = (col_[0].D + col_[1].D) / 2; HOperatorSet.GenContourPolygonXld(out ho_cross, row_, col_); Ho_crossLine.Dispose(); Ho_crossLine = ho_cross; HObject ho_xld; HOperatorSet.GenEmptyObj(out ho_xld); HOperatorSet.GenCrossContourXld(out ho_xld, row_, col_, 60, 0.78); Ho_Point.Dispose(); Ho_Point = ho_xld; Column = col_[2]; Row = row_[2]; DistanceTwoPoint = distance_; /*********数据分析***********/ //Result_DistanceTwoPoint result_ = new Result_DistanceTwoPoint(); Key = "DistanceTwoPoint_" + Key; _result._tolatName = Key; if ((IrectShuJuPianYiOne.Row.Length > 0) && (IrectShuJuPianYiTwo.Column.Length > 0)) { _result._distance = DistanceTwoPoint; _result._centerCol = Column; _result._centerRow = Row; _result._angle = Angle; _result._tolatResult = true; if (this._ICalibration != null) { HTuple row1_ = row_[0]; HTuple col1_ = col_[0]; HTuple row2_ = row_[1]; HTuple col2_ = col_[1]; this.Cal(this._ICalibration.HomMat2D, ref row1_, ref col1_); this.Cal(this._ICalibration.HomMat2D, ref row2_, ref col2_); HOperatorSet.DistancePp(row1_, col1_, row2_, col2_, out _result._distance); this.Cal(this._ICalibration.HomMat2D, ref _result._centerRow, ref _result._centerCol); } ok = true; } else { _result._distance = 0; _result._centerCol = 0; _result._centerRow = 0; _result._tolatResult = false; } _dictionary_resulte.Add(Key, _result); /**********显示**************/ show(hwin); } return(ok); }