protected void ctrlProductScan_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { string sn, quality_status = "A"; RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ""; arg.MessageBody = ""; if (e.MessageHead == null) { return; } if (e.MessageHead == "SN") { //上线后打印条码 sn = e.MessageBody.ToString(); product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);//获取sn信息 ThisSmTm = product.PLAN_SO + "^DCEC^" + sn; PublicClass.PrintTmISDE(product.PLAN_CODE, ThisSmTm); arg.MessageHead = "CLEAR1"; arg.MessageBody = ""; SendDataChangeMessage(arg); timer1.Enabled = true; } if (e.MessageHead == "REFRESHCLPLAN") { timer1.Enabled = true; } }
void ctrlStockScan_RMesDataChanged(object obj, RMESEventArgs e) { //if (e.MessageHead == "MESLL") //{ // WorkunitCode = StationFactory.GetByKey(StationCode).WORKUNIT_CODE; // LineSideStoreEntity ent = LinesideStoreFactory.GetByWKUnit(CompanyCode, WorkunitCode); // LinesideStockCode = ent.STORE_CODE; // LinesideStockName = ent.STORE_NAME; // InitLinesideStock(); // string txt = e.MessageBody.ToString(); // this.Visible = true; // return; // //testIssueReceive frm = new testIssueReceive(txt); // //frm.receive += new testIssueReceive.IssueReceived(received); // //frm.ShowDialog(this.Parent); //} //else if (e.MessageHead.ToString() == "WORK" || e.MessageHead.ToString() == "QUA") //{ // this.Visible = false; // return; //} }
void ctrl_Fx_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { try { RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ""; arg.MessageBody = ""; if (e.MessageHead == null) { return; } if (e.MessageHead == "SN") { TheSn = e.MessageBody.ToString(); product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, TheSn);//获取sn信息 if (product == null) { return; } TheSo = product.PLAN_SO; ThePlancode = product.PLAN_CODE; } } catch (Exception e1) { MessageBox.Show(e1.Message); } }
private void gridProcessList_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } if (gridProcessList.Rows[e.RowIndex].Cells["colProcessCode"].Value == null) { return; } string process_code = gridProcessList.Rows[e.RowIndex].Cells["colProcessCode"].Value.ToString().Trim(); PlanEntity ent = PlanFactory.GetByKey(this.plancode); if (ent.PRODUCT_SERIES == null) { MessageBox.Show("此计划工序没有定义相应的工序指导文件"); return; } RMESEventArgs args = new RMESEventArgs(); args.MessageHead = "INFO"; args.MessageBody = process_code; args.MessageBody += "^" + plancode; SendDataChangeMessage(args); FrmShowProcessNote spn = new FrmShowProcessNote(plancode, process_code); spn.Show(); }
protected void ctrlOptionComplete_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { if (e.MessageHead == "VIN") { gridOptionList.Enabled = true; ProductInfoEntity product = (ProductInfoEntity)e.MessageBody; sn = product.SN; switch (type) { case "0": //站点 initials(); break; case "1": //工序 initial(); break; default: break; } OptionShow_Load(); if (state == 0) //报完工发送消息 { RMESEventArgs args = new RMESEventArgs(); args.MessageHead = "OPTIONCOMPLETES"; args.MessageBody = null; UiFactory.CallDataChanged(this, args); } } }
private void btnOK_Click(object sender, EventArgs e) { string item_code = txtItemCode.Text; string item_qty = txtItemQty.Text; float itemQty; if (string.IsNullOrWhiteSpace(item_code)) { MessageBox.Show("物料代码不能为空"); return; } if (string.IsNullOrWhiteSpace(item_qty)) { MessageBox.Show("计划数量不能为空"); return; } try { itemQty = float.Parse(item_qty); } catch { MessageBox.Show("计划数量必须是数字"); return; } Add2BomTemp(item_code, itemQty); RMESEventArgs thisEventArg = new RMESEventArgs(); thisEventArg.MessageHead = "BOM"; thisEventArg.MessageBody = SN; SendDataChangeMessage(thisEventArg); (Parent as frmBomNew).Close(); }
private void dgvTj_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { //双击流水号进行标定 if (e.RowIndex < 0) { return; } timer1.Enabled = false; RMESEventArgs thisEventArg = new RMESEventArgs(); thisEventArg.MessageHead = ""; thisEventArg.MessageBody = ""; dgvInsite.ClearSelection(); string sn = dgvInsite.Rows[e.RowIndex].Cells["colSn"].Value.ToString(); string plan_so = dgvInsite.Rows[e.RowIndex].Cells["colSo"].Value.ToString(); string plan_code = dgvInsite.Rows[e.RowIndex].Cells["colPlancode"].Value.ToString(); List <ProductInfoEntity> newProduct = ProductInfoFactory.GetByCompanyCodeSN(LoginInfo.CompanyInfo.COMPANY_CODE, sn); if (newProduct.Count != 0) { thisEventArg.MessageHead = "FILLSN"; thisEventArg.MessageBody = sn + "^" + plan_so + "^" + newProduct.First <ProductInfoEntity>().PRODUCT_MODEL + "^" + plan_code; SendDataChangeMessage(thisEventArg); } timer1.Enabled = true; }
private void SendBomConfirm2SN() { RMESEventArgs args = new RMESEventArgs(); bool control_completed = true; for (int i = 0; i < GridQuality.Rows.Count; i++) { if (GridQuality.Rows[i].Cells["colDetectFlag"].Value.ToString() != "Y" && GridQuality.Rows[i].Cells["colDetectFlag"].Value.ToString() != "") //if (GridQuality.Rows[i].Cells["colDetectFlag"].Value.ToString() != "Y") { control_completed = false; break; } } if (control_completed) { args.MessageHead = "CCP"; args.MessageBody = SN + "^Rmes.WinForm.Controls.ctrlQualityDetect^B"; UiFactory.CallDataChanged(this, args); } else { args.MessageHead = "CCP"; args.MessageBody = SN + "^Rmes.WinForm.Controls.ctrlQualityDetect^A"; UiFactory.CallDataChanged(this, args); } }
private void timer1_Tick(object sender, EventArgs e) { timer1.Stop(); OPCMessageEntity ent = OPCMessageFactory.GetMyMessage(); if (ent != null) { if (ent.MESSAGE_CODE == "sn") { if (!DealSn(ent.MESSAGE_VALUE)) { return; } } RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ent.MESSAGE_CODE == "sn"?"SN":ent.MESSAGE_CODE; arg.MessageBody = ent.MESSAGE_VALUE; SendDataChangeMessage(arg); ent.MESSAGE_FLAG = "R"; OPCMessageFactory.UpdateMessage(ent); } timer1.Start(); }
private void ItemQulified_Click(object sender, EventArgs e) { List <SNControlEntity> list_control = SNControlFactory.GetByPlanStatonSn(CompanyCode, PlineCode, StationCode, PlanCode, SN); foreach (SNControlEntity lst in list_control) { string control_script = list_control.First <SNControlEntity>().CONTROL_SCRIPT; if (lst.CONTROL_SCRIPT == "工序完工模块") { MessageBox.Show("工序完工模块没有操作完成,请重新进行"); return; } DialogResult drt = MessageBox.Show(control_script + "没有报完成,要继续吗?", "提示", MessageBoxButtons.YesNo); if (drt == DialogResult.No) { return; } } ProductSnFactory.HandleStationComplete(CompanyCode, PlineCode, StationCode, PlanCode, SN, "A"); RMESEventArgs args = new RMESEventArgs(); args.MessageHead = "SCP"; SendDataChangeMessage(args); }
private void 报废处理ToolStripMenuItem_Click(object sender, EventArgs e) { //分装CL报废处理 DialogResult drt = MessageBox.Show("执行该功能将对缸盖进行报废处理,要继续吗?", "提示", MessageBoxButtons.YesNo); if (drt == DialogResult.No) { return; } string ghtm = Microsoft.VisualBasic.Interaction.InputBox("请输入缸盖流水号", "输入"); if (ghtm.Trim() == "") { return; } string outstr = ""; ProductDataFactory.WGG_MODIFY_JHB(ghtm, LoginInfo.ProductLineInfo.PLINE_CODE, out outstr); if (outstr != "GOOD") { MessageBox.Show(outstr, "提示"); } //刷新计划 RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = "REFRESHCLPLAN"; arg.MessageBody = ""; SendDataChangeMessage(arg); }
private void listFault2_DoubleClick(object sender, EventArgs e) { FaultListEntity fl = new FaultListEntity(); //fl.RMES_ID = DB.GetInstance().ExecuteScalar<string>("SELECT SYS_GUID() FROM DUAL"); fl.RMES_ID = DateTime.Now.ToString(); fl.SN = VIN; fl.FAULT_CODE = listFault2.SelectedValue.ToString(); fl.COMPANY_CODE = LoginInfo.CompanyInfo.COMPANY_CODE.ToString(); fl.PLINE_CODE = LoginInfo.StationInfo.RMES_ID.ToString(); fl.STATION_CODE = LoginInfo.StationInfo.RMES_ID.ToString(); fl.SHIFT_CODE = LoginInfo.ShiftInfo.SHIFT_CODE.ToString(); fl.TEAM_CODE = LoginInfo.TeamInfo.TEAM_CODE.ToString(); fl.EMPLOYEE_CODE = LoginInfo.UserInfo.USER_ID.ToString(); fl.WORK_TIME = System.DateTime.Now; fl.REPAIR_FLAG = "N"; fl.DELETE_FLAG = "N"; FaultListFactory.Save(fl); RMESEventArgs arg = new RMESEventArgs(); arg.MessageBody = product; arg.MessageHead = "qcADD"; UiFactory.CallDataChanged(this, arg); }
void ctrStatis_RMesDataChanged(object obj, RMESEventArgs e) { if (e.MessageHead == "SN" || e.MessageHead == "ONLINE" || e.MessageHead == "OFFLINE" || e.MessageHead == "REFRESHPLAN") { initPlan(); } }
private void timer1_Tick(object sender, EventArgs e) { timer1.Enabled = false; //刷新计划数据 string sql = "SELECT plan_seq,product_model,plan_code,plan_so,plan_qty,online_qty,offline_qty,customer_name,begin_date,end_date,create_time,remark " + " FROM data_plan Where run_flag='Y' and confirm_flag='Y' and pline_code='" + PlineCode1 + "' AND plan_qty > online_qty AND to_char(end_date,'yyyymmdd')<=to_char(sysdate+30,'yyyymmdd') AND to_char(begin_date,'yyyymmdd')>=to_char(sysdate-30,'yyyymmdd') order by begin_date,plan_seq "; DataTable dt = dataConn.GetTable(sql); if (dt.Rows.Count == 0) { MessageBox.Show("当前没有可执行的计划", "提示"); return; } ThePlancode = dt.Rows[0]["PLAN_CODE"].ToString(); TheSo = dt.Rows[0]["PLAN_SO"].ToString(); TheProductModel = dt.Rows[0]["PRODUCT_MODEL"].ToString(); //显示计划对应的BOM RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = "CL_PLAN"; arg.MessageBody = ThePlancode + "^" + TheSo + "^" + TheProductModel; SendDataChangeMessage(arg); //关联流水号 }
void ctrPlan_RMesDataChanged(object obj, RMESEventArgs e) { if (e.MessageHead == null) { return; } //if (e.MessageHead == "MESLL" || e.MessageHead=="QUA") //{ // this.Visible = false; // return; //} //if (e.MessageHead.ToString() == "WORK") //{ // this.Visible = true; // return; //} //if (e.MessageHead.ToString() == "PLAN") //{ // InitPlan(e.MessageBody.ToString()); // return; //} if (e.MessageHead == "SN") { string sn = e.MessageBody.ToString(); ProductInfoEntity ent = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn); if (ent != null) { planCode = ent.PLAN_CODE; initPlan(); InitPlan(planCode); return; } } if (e.MessageHead == "REFRESHPLAN") { string sn = e.MessageBody.ToString(); ProductInfoEntity ent = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn); if (ent != null) { planCode = ent.PLAN_CODE; initPlan(); InitPlan(planCode); return; } } //if (e.MessageHead == "SCP") //{ // getPlan(PlineCode); // CurPlancode = "none"; // return; //} //if (e.MessageHead == "EXIT") //{ // //HandleExit(CurPlancode); // return; //} }
private void GridPlan_CellContentClick(object sender, DataGridViewCellEventArgs e) { RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = "REFRESHCLPLAN"; arg.MessageBody = ""; SendDataChangeMessage(arg); }
private void ItemFailedOffline_Click(object sender, EventArgs e) { RMESEventArgs args = new RMESEventArgs(); args.MessageHead = "OFFLINE"; args.MessageBody = SN + "^B"; SendDataChangeMessage(args); }
private void ItemPause_Click(object sender, EventArgs e) { ProductSnFactory.HandleStationPause(CompanyCode, PlineCode, StationCode, PlanCode, SN, "A"); RMESEventArgs args = new RMESEventArgs(); args.MessageHead = "PAUSE"; args.MessageBody = SN + "^P"; SendDataChangeMessage(args); }
private void GridPlan_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { //得到计划号 if (e.RowIndex < 0) { return; } timer1.Enabled = false; if (string.IsNullOrWhiteSpace(GridPlan.Rows[e.RowIndex].Cells["ColPlanCode"].Value as string)) { return; } string plan_code = GridPlan.Rows[e.RowIndex].Cells["ColPlanCode"].Value.ToString(); string item_code = GridPlan.Rows[e.RowIndex].Cells["colPlanSo"].Value.ToString(); string batch_code = GridPlan.Rows[e.RowIndex].Cells["colPlanBatch"].Value.ToString(); string sn_flag = GridPlan.Rows[e.RowIndex].Cells["colSnFlag"].Value.ToString(); ItemEntity iItem = ItemFactory.GetByItem(LoginInfo.CompanyInfo.COMPANY_CODE, item_code); if (iItem != null) { if (iItem.MANAGE_FLAG == "A") { FrmShowPlanSn ps = new FrmShowPlanSn(plan_code, batch_code); ps.Show(); } else if (iItem.MANAGE_FLAG == "A" && sn_flag == "N") { List <ProductInfoEntity> newProduct = ProductInfoFactory.GetByCompanyCodeSN(LoginInfo.CompanyInfo.COMPANY_CODE, batch_code); RMESEventArgs thisEventArg = new RMESEventArgs(); if (newProduct.Count != 0) { thisEventArg.MessageHead = "SN"; thisEventArg.MessageBody = newProduct.First <ProductInfoEntity>(); } } else { List <ProductInfoEntity> newProduct = ProductInfoFactory.GetByCompanyCodeBatch(LoginInfo.CompanyInfo.COMPANY_CODE, batch_code); RMESEventArgs thisEventArg = new RMESEventArgs(); if (newProduct.Count != 0) { thisEventArg.MessageHead = "BATCH"; thisEventArg.MessageBody = newProduct.First <ProductInfoEntity>(); } else { thisEventArg.MessageHead = null; thisEventArg.MessageBody = null; } SendDataChangeMessage(thisEventArg); } } }
void ctrl_Tj_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ""; arg.MessageBody = ""; if (e.MessageHead == null) { return; } }
protected void ctrlProductScan_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { string sn, quality_status = "A"; RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ""; arg.MessageBody = ""; if (e.MessageHead == null) { return; } }
void ctrl_sub_RMesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { try { RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ""; arg.MessageBody = ""; if (e.MessageHead == null) { return; } if (e.MessageHead == "SN") { SN = e.MessageBody.ToString(); } //BOM展示完成后校验总成零件是否存在 //if (e.MessageHead == "SHOWBOMOK") //{ // string subzc = ""; // try // { // subzc = dc.GetValue("select sub_zc from code_station_sub where substation_code='" + StationCode + "' and pline_code='" + PlineID + "'"); // } // catch { subzc = ""; } // if (subzc != "") // { // arg.MessageHead = "SUBCHECK"; // arg.MessageBody = SN + "^" + subzc; // SendDataChangeMessage(arg); // } //} //if (e.MessageHead == "SUBCHECKOK") //{ // string item_info = e.MessageBody.ToString();//消息体是三段码 // string[] cmd_info = item_info.Split('^'); // string subzc = cmd_info[1]; // string subItem = ""; // if (subzc != "") // { // //判断bom中是否包含该总成零件 // //分装总成零件不为空 则打印分装总成零件条码 // subItem = subzc + "^SUB^" + SN; // //Print // PublicClass.PrintSub(SN, "", subItem); // } //} } catch (Exception e1) { MessageBox.Show(e1.Message); } }
void ctrlAndonCall_RMesDataChanged(object obj, RMESEventArgs e) { if (e.MessageHead == "MESLL") { this.Visible = false; return; } if (e.MessageHead.ToString() == "WORK" || e.MessageHead.ToString() == "QUA") { this.Visible = true; return; } }
private void workItem_Click(object sender, EventArgs e) { RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = "WORK"; arg.MessageBody = "back to work"; SendDataChangeMessage(arg); BaseForm form = (BaseForm)this.ParentForm; if (!form.Text.Equals(LoginInfo.CompanyInfo.COMPANY_NAME_BRIEF + "MES系统")) { form.Owner.Show(); form.Dispose(); } }
void ctrlSignalPanel_OnRMesDataChanged(object obj, RMESEventArgs e) { string msgcode = e.MessageHead; string msgvalue; if (msgcode == "workpiece_arrival_plc") { msgvalue = e.MessageBody.ToString(); listView1.Items[0].ImageIndex = msgvalue == "TRUE" ? 2 : 0; } else if (msgcode == "going_out") { msgvalue = e.MessageBody.ToString(); listView1.Items[3].ImageIndex = msgvalue == "TRUE" ? 2 : 0; } }
void ctrPlan_RMesDataChanged(object obj, RMESEventArgs e) { if (e.MessageHead == null) { return; } if (e.MessageHead == "SN") { string sn = e.MessageBody.ToString(); ProductInfoEntity ent = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn); if (ent != null) { planCode = ent.PLAN_CODE; initPlan(); InitPlan(planCode); return; } } }
protected void ctrlPrintOffline_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { if (e.MessageHead == "OFFLINE") { string[] txt = e.MessageBody.ToString().Split('^'); Sn = txt[0]; string quality_status = txt[1]; PlanSnEntity plansn1 = PlanSnFactory.GetBySn(Sn); PlanCode = plansn1.PLAN_CODE; PrintOfflineLabel(); } else if (e.MessageHead == "SN") { RMESEventArgs args = new RMESEventArgs(); args.MessageHead = "OFFCTRL"; args.MessageBody = ""; SendDataChangeMessage(args); } }
void ctrlProcessFile_RMesDataChanged(object obj, RMESEventArgs e) { if (e.MessageHead == null) { return; } if (e.MessageHead == "SN" || e.MessageHead == "CHECK") { string sn = e.MessageBody.ToString(); product = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);//获取sn信息 if (product != null) { TheSo = product.PLAN_SO; TheSn = product.SN; ThePlancode = product.PLAN_CODE; initInfo(""); } } //if (!string.IsNullOrWhiteSpace(e.MessageHead) && e.MessageHead == "PRCS") //{ // string msgbody = e.MessageBody as string; // if (string.IsNullOrWhiteSpace(msgbody)) return; // string processcode = ""; // if (msgbody.IndexOf('^') <= 0) //只发送了工序的信息 // processcode = msgbody; // else // processcode = msgbody.Split('^')[0].ToString(); // initInfo(processcode); //} //else if (e.MessageHead == "MESLL") //{ // this.Visible = false; // return; //} //if (e.MessageHead.ToString() == "WORK" || e.MessageHead.ToString() == "QUA") //{ // this.Visible = true; // return; //} //throw new NotImplementedException(); }
private void ItemFailed_Click(object sender, EventArgs e) { //List<SNControlEntity> list_control = SNControlFactory.GetByPlanStatonSn(CompanyCode, PlineCode, StationCode, PlanCode, SN); List <SNControlEntity> list_control = SNControlFactory.GetByPlanStatonSn(CompanyCode, PlineCode, StationCode, PlanCode, SN); if (list_control.Count > 0) { string control_script = list_control.First <SNControlEntity>().CONTROL_SCRIPT; DialogResult drt = MessageBox.Show(control_script + "没有报完成,要继续吗?", "提示", MessageBoxButtons.YesNo); if (drt == DialogResult.No) { return; } } ProductSnFactory.HandleStationComplete(CompanyCode, PlineCode, StationCode, PlanCode, SN, "B"); RMESEventArgs args = new RMESEventArgs(); args.MessageHead = "SCP"; SendDataChangeMessage(args); }
protected void ctrlNavigation_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e) { //if (e.MessageHead == "QUACTRL") mnuQuality.Enabled = true; RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ""; arg.MessageBody = ""; if (e.MessageHead == null) { return; } if (e.MessageHead == "SN" || e.MessageHead == "RECHECK" || e.MessageHead == "CHECKOK") { Thesn = e.MessageBody.ToString(); } if (e.MessageHead == "PRINTISDE") { string[] txt = e.MessageBody.ToString().Split('|'); TheSmTm = txt[0]; ThePlanCode = txt[1]; } if (e.MessageHead == "SHOWBOMLQ") { string txt = e.MessageBody.ToString(); ProductInfoEntity product = ProductInfoFactory.GetByCompanyCodeSNSingle(LoginInfo.CompanyInfo.COMPANY_CODE, txt); if (product == null) { return; } string oldplancode = ""; oldplancode = dataConn.GetValue("select jhmcold from atpujhsn where jhmc='" + product.PLAN_CODE + "' and is_valid='N' and rownum=1"); if (oldplancode == "") { return; } ProductInfoEntity productold = ProductInfoFactory.GetByCompanyCodeSNSingleLQ(LoginInfo.CompanyInfo.COMPANY_CODE, txt, oldplancode); oldPlinecode = productold.PLINE_CODE; } }