public void ShowMesBean(BJZS_Config bean) { this.rbConnectAlarm.Checked = bean.ConnectAlarm; this.rbCodeFailAlarm.Checked = bean.DataAlarm; this.tbFeeder1No.Text = bean.FeederNo[0]; this.tbFeeder2No.Text = bean.FeederNo[1]; this.tbFeeder1Order.Text = bean.FeederOrder[0]; this.tbFeeder2Order.Text = bean.FeederOrder[1]; this.tbLeftFeeder.Text = bean.FeederID[0]; this.tbRightFeeder.Text = bean.FeederID[1]; this.ndTimeOut.Value = ZDTHelper.Instance.TimeOut; this.tBJZSAddress.Text = ZDTHelper.Instance.WebServiceAddress; this.tLineNo.Text = ZDTHelper.Instance.LineID; this.tMachineNO.Text = ZDTHelper.Instance.MachineID; this.combLocation.Text = ZDTHelper.Instance.Area; this.tFactoryArea.Text = ZDTHelper.Instance.FactoryID; this.tEmployeID.Text = ZDTHelper.Instance.EmployeeID; this.tEmployerNo.Text = ZDTHelper.Instance.EmployeeName; this.tFpcNo.Text = ZDTHelper.Instance.FpcNo; this.tReadCodeName.Text = bean.ReadCodeBean; this.nuRemainCount.Value = bean.AlarmCount; this.nuRemainTime.Value = bean.AlarmHour; this.chbEnableLimit.Checked = bean.EnableAlarmCount; this.chbEnableMaterialTime.Checked = bean.EnableAlarmHour; this.bEnableJY.Checked = ZDTHelper.Instance.EnableJY; this.bEnableBJZS.Checked = ZDTHelper.Instance.EnableBJZS; this.bEnableAlarmUpload.Checked = ZDTHelper.Instance.EnableAlarmUpload; this.tUser.Text = ZDTHelper.Instance.User; this.tPass.Text = ZDTHelper.Instance.PassWd; this.tReadCodeName.Items.AddRange(ReadCodeBean.GetList().ToArray()); }
private void bLoad_Click(object sender, EventArgs e) { this.openFileDialog1.InitialDirectory = Variable.sPath_ReadCodeBean; if (this.openFileDialog1.ShowDialog() == DialogResult.OK) { var name = this.openFileDialog1.FileName.Replace(".json", "").Replace(Variable.sPath_ReadCodeBean, ""); this.Bean = ReadCodeBean.Load(name); this.ShowBean(); } }
public static void Save() { Common.SerializableHelper <ZDTHelper> helper = new Common.SerializableHelper <ZDTHelper>(ZDTHelper.Instance); helper.JsonSerialize(Variable.sPath_Configure + "ZDT.json"); if (ZDTHelper.Instance.JY_Config.ReadCodeBean != string.Empty) { ZDTHelper.Instance.SPICodeBean = ReadCodeBean.Load(ZDTHelper.Instance.JY_Config.ReadCodeBean); } if (ZDTHelper.Instance.BJZS_Config.ReadCodeBean != string.Empty) { ZDTHelper.Instance.TrayCodeBean = ReadCodeBean.Load(ZDTHelper.Instance.BJZS_Config.ReadCodeBean); } }
private void fmZDT_Tool_Load(object sender, EventArgs e) { var config = ZDTHelper.Instance.JY_Config; this.cb_ReadCodeName.Text = config.ReadCodeBean; this.cbSide.SelectedIndex = (int)config.MES_Side; this.tIP_Local.Text = config.LocalIp; this.tPort_Local.Text = config.LocalPort.ToString(); this.tIP_Remote.Text = config.RemoteIp; this.tPort_Remote.Text = config.RemotePort.ToString(); this.rB_SPI.Checked = !config.bUseRemote; this.rB_XPanel.Checked = config.bUseRemote; this.rB_Alarm.Checked = config.bAlarm; this.rB_DisAlarm.Checked = !config.bAlarm; this.rB_PasteNone.Checked = !config.bPaste; this.rB_PasteAll.Checked = config.bPaste; this.tBadMarkNO.Text = config.BadmarkLen.ToString(); this.cb_ReadCodeName.Items.AddRange(ReadCodeBean.GetList().ToArray()); }
private void bTest_Click(object sender, EventArgs e) { try { var bean = ReadCodeBean.Load(this.cb_ReadCodeName.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.tLinkCode.Text = ReadCodeHelper.ReadCode(Form_Main.Instance.imageSet.Image, bean.ROI.ConvertToRoi(), bean.CodeType); } catch { MessageBox.Show("读取失败"); } }
private void bNew_Click(object sender, EventArgs e) { string s = Interaction.InputBox("请输入 新建程式名称", "提示", "Code", -1, -1); if (string.IsNullOrEmpty(s)) { MessageBox.Show("输入错误请正确输入"); return; } if (File.Exists(Variable.sPath_ReadCodeBean + s + ".json")) { MessageBox.Show("新建的读条码方案已经存在!!"); return; } else { this.Bean = new ReadCodeBean(); this.Bean.BeanName = s; } }
private void bSave_Click(object sender, EventArgs e) { this.Bean.Shutter = int.Parse(this.tZJExp.Text); this.Bean.BarcodeFormateEN = this.cB_BarcodeFormateEN.Checked; ReadCodeBean.Save(this.Bean); }
public static void Save(ReadCodeBean bean) { Common.SerializableHelper <ReadCodeBean> helper = new Common.SerializableHelper <ReadCodeBean>(bean); helper.JsonSerialize(Variable.sPath_ReadCodeBean + bean.BeanName + ".json"); }