public static void Save() { Common.SerializableHelper <MFlexHelper> helper = new Common.SerializableHelper <MFlexHelper>(MFlexHelper.Instance); helper.JsonSerialize(Variable.sPath_Configure + "MFlex.json"); if (MFlexHelper.Instance.CodeFunc != string.Empty) { MFlexHelper.Instance.CodeBean = ReadCodeBean.Load(MFlexHelper.Instance.CodeFunc); } }
public static bool Load() { if (File.Exists(Variable.sPath_Configure + "MFlex.json")) { Common.SerializableHelper <MFlexHelper> helper = new Common.SerializableHelper <MFlexHelper>(); var temp = helper.DeJsonSerialize(Variable.sPath_Configure + "MFlex.json"); if (temp != null) { MFlexHelper.Instance = temp; if (MFlexHelper.Instance.CodeFunc != string.Empty) { MFlexHelper.Instance.CodeBean = ReadCodeBean.Load(MFlexHelper.Instance.CodeFunc); } return(true); } } return(false); }
private void bRead_Click(object sender, EventArgs e) { try { var bean = ReadCodeBean.Load(this.cbCodeList.Text); VisionImage image = Form_Main.Instance.imageSet.Image; for (int i = 0; i < bean.Cycle; ++i) { image = Form_Main.Instance.GainOffset(Form_Main.Instance.imageSet.Image, bean.Gain, bean.Offset); } Algorithms.Copy(image, Form_Main.Instance.imageSet.Image); this.tbBarcode.Text = ReadCodeHelper.ReadCode(Form_Main.Instance.imageSet.Image, bean.ROI.ConvertToRoi(), bean.CodeType); } catch { MessageBox.Show("读取失败"); } }
private void MFlexMesControl_Load(object sender, EventArgs e) { this.ConfigToUI(); this.cbCodeList.Items.AddRange(ReadCodeBean.GetList().ToArray()); }