public clsOpenEVision(PictureBox picDisplay, string fileName) { this.fileName = fileName; Directory.CreateDirectory(visionPath + "\\" + visionFile); Directory.CreateDirectory(visionPath + "\\" + visionFile + "\\" + fileName); openFileDialog = new OpenFileDialog(); saveFileDialog = new SaveFileDialog(); eCalibration = new clsEasyCalibration(picDisplay); eCalibrFindPattern = new clsEasyFindPattern(picDisplay); calibrPoint = new List <CalibrationPoint>(); eFindPattern = new clsEasyFindPattern(picDisplay); eFindCorner = new Dictionary <CornerLine, clsEasyFindLine>(); eFindCorner.Add(CornerLine.Line_1, new clsEasyFindLine(picDisplay)); eFindCorner.Add(CornerLine.Line_2, new clsEasyFindLine(picDisplay)); eFixture = new clsEasyFixture(picDisplay); eFindCorner[CornerLine.Line_1].Base.Attach(eFixture.Base); eFindCorner[CornerLine.Line_2].Base.Attach(eFixture.Base); line = new Dictionary <CornerLine, ezLine>(); line.Add(CornerLine.Line_1, new ezLine(0, 0, 0)); line.Add(CornerLine.Line_2, new ezLine(0, 0, 0)); }
public frmEVision() { InitializeComponent(); cboCalibrFindMode.DataSource = Enum.GetValues(typeof(EFindContrastMode)); cboFindMode.DataSource = Enum.GetValues(typeof(EFindContrastMode)); cboLine_1_TransitionType.DataSource = Enum.GetValues(typeof(ETransitionType)); cboLine_2_TransitionType.DataSource = Enum.GetValues(typeof(ETransitionType)); Directory.CreateDirectory(visionPath + "\\" + visionFile); openFileDialog = new OpenFileDialog(); saveFileDialog = new SaveFileDialog(); eCalibration = new clsEasyCalibration(picDisplay); eCalibrFindPattern = new clsEasyFindPattern(picDisplay); calibrPoint = new List <CalibrationPoint>(); eFindPattern = new clsEasyFindPattern(picDisplay); eFindLine_1 = new clsEasyFindLine(picDisplay); eFindLine_2 = new clsEasyFindLine(picDisplay); eFixture = new clsEasyFixture(picDisplay); eFindLine_1.Base.Attach(eFixture.Base); eFindLine_2.Base.Attach(eFixture.Base); line_1 = new ezLine(0, 0, 0); line_2 = new ezLine(0, 0, 0); dgvCalibrPointTable.DataSource = eCalibration.CalibrTable; dgvCalibrPatternTable.DataSource = eCalibrFindPattern.PatternTable; dgvPatternTable.DataSource = eFindPattern.PatternTable; dgvLine_1_SampleTable.DataSource = eFindLine_1.SampleTable; dgvLine_2_SampleTable.DataSource = eFindLine_2.SampleTable; }
public void GetPatternWordResults(clsEasyFindPattern findPattern, ref EPoint wordPoint) { try { if (findPattern.FindPattern()) { wordPoint = eCalibration.Fixture.GetPoint(new EPoint(findPattern.Results_CenterX, findPattern.Results_CenterY), CoordinateHook.Hook); } } catch (EException exc) { StackFrame[] stackFrames = new StackTrace(true).GetFrames(); clsLogFile.LogTryCatch(stackFrames, exc.Message, true, true); } catch (Exception ex) { StackFrame[] stackFrames = new StackTrace(true).GetFrames(); clsLogFile.LogTryCatch(stackFrames, ex.Message, true, true); } }