public JPTCG.Vision.HalconInspection.RectData FindCircleCenter(double caliValues, HWindowControl hWin) { MachineVision Mc = new MachineVision(); _result result = new _result(); if (Para.MachineOnline) { //if mhalcon_image2 myImage = BaslerCam.mhalcon_image2; } HTuple hv_High, hv_width; HOperatorSet.GetImageSize(myImage, out hv_width, out hv_High); HOperatorSet.SetPart(hWin.HalconWindow, 0, 0, hv_High, hv_width); myImage.DispObj(hWin.HalconWindow); result = Mc.Analys(myImage, hWin); JPTCG.Vision.HalconInspection.RectData myResult = new JPTCG.Vision.HalconInspection.RectData(); if (myImage == null) { return(myResult); } myResult.X = result.centerX; myResult.Y = result.centerY; if (myResult.X != 0.0 && myResult.Y != 0.00) { myResult.Found = true; } else { myResult.Found = false; } return(myResult); }
public static _result GetStaticSettings() { _result rslt = new _result(); try { if (File.Exists(SettingsFilePath)) { string json = File.ReadAllText(SettingsFilePath); StaticSetting = JsonConvert.DeserializeObject <_StaticSetting>(json); rslt.Succes = true; } else { rslt.Succes = false; rslt.Message = "'" + SettingsFilePath + "' adında bir dosya bulunamadı!"; } } catch (Exception ex) { rslt.Succes = false; rslt.Message = ex.Message; } return(rslt); }
public static _result SaveStaticSettings() { _result rslt = new _result(); try { string json = JsonConvert.SerializeObject(StaticSetting); File.WriteAllText(SettingsFilePath, json); rslt.Succes = true; } catch (Exception ex) { rslt.Succes = false; rslt.Message = ex.Message; } return(rslt); }
set => SetProperty(ref _result, value);