Esempio n. 1
0
        private void to_frmSxChange()
        {
            frmSxChange frmSxChange = new frmSxChange();

            Global.frmCurrent = frmSxChange;
            frmSxChange.Owner = this;
            frmSxChange.Show();
            this.Hide();
        }
Esempio n. 2
0
        private void frmDgv2_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F21)         //环形键
            {
                if (Global.curFrame.KZ == "重") //入库作业
                {
                    string data = Global.sUserId + AllCode.stringInterfaceChar;
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + AllCode.stringInterfaceChar;
                    data += Global.sBb + AllCode.stringInterfaceChar;                              //班别
                    data += Global.sZyq + AllCode.stringInterfaceChar;                             //作业区
                    data += Global.curFrame.TCH + AllCode.stringInterfaceChar;                     //停车号
                    data += Global.curFrame.QY + Global.curFrame.CH + AllCode.stringInterfaceChar; //车号

                    int    cnt = 0;
                    string msg = "";

                    foreach (KeyValuePair <CoilPoint, Coil> kv in Global.coils)
                    {
                        Coil c = kv.Value;
                        if (c.clh != "")
                        {
                            msg += c.p.barcode.Substring(c.p.barcode.Length - 3, 2) + AllCode.stringInterfaceChar;                  //层号
                            // msg += c.p.barcode + AllCode.stringInterfaceChar;                  //层号
                            //msg += c.zzdy + AllCode.stringInterfaceChar;                        //制造单元
                            msg += c.clh + AllCode.stringInterfaceChar;                        //材料号
                            //msg += c.scantime + AllCode.stringInterfaceChar;                  //扫描时间
                            // msg += c.qa + AllCode.stringInterfaceChar;                         //质量代码
                            // msg += c.scanflag.ToString() + AllCode.stringInterfaceChar;       //处理标志
                            // msg += c.wide + AllCode.stringInterfaceChar;                   //钢卷宽度
                            //msg += c.diameter + AllCode.stringInterfaceChar;                   //钢卷内径

                            cnt++;
                        }
                    }

                    if (cnt > 0)
                    {
                        data += cnt.ToString() + AllCode.stringInterfaceChar;//材料数量
                        if (msg.Length > 0)
                        {
                            msg = msg.Substring(0, msg.Length - 1);
                        }
                        data += msg;
                        data += AllCode.stringInterfaceChar;

                        if (Global.sDebug == "False")
                        {
                            frmMessage frmMessage = new frmMessage();
                            frmMessage.ShowDialog("是否上传入库手持扫描结果?", "选择", "确定", "取消");
                            if (frmMessage.ret == true)
                            {
                                Business.SendText(Business.msg.Package("ZDUA17", data));//入库手持扫描完成
                            }
                            frmMessage.Dispose();
                        }
                    }
                }
                else//出库作业
                {
                    string data = Global.sUserId + ";";
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";";
                    data += Global.sBb + ";";
                    data += Global.sZyq + ";";
                    data += Global.curFrame.TCH + ";";
                    data += Global.curFrame.QY + Global.curFrame.CH + ";";

                    int    cnt = 0;
                    string msg = "";

                    foreach (KeyValuePair <CoilPoint, Coil> kv in Global.coils)
                    {
                        Coil c = kv.Value;
                        if (c.clh != "")
                        {
                            msg += c.p.barcode + ";";                   //逻辑位置
                            msg += c.zzdy + ";";                        //制造单元
                            msg += c.clh + ";";                         //材料号
                            msg += c.scantime + ";";                    //扫描时间
                            msg += c.qa + ";";                          //质量代码
                            msg += c.wide + ";";                        //钢卷宽度
                            msg += c.diameter + ";";                    //钢卷内径

                            cnt++;
                        }
                    }

                    if (cnt > 0)
                    {
                        data += cnt.ToString() + ";";
                        if (msg.Length > 0)
                        {
                            msg = msg.Substring(0, msg.Length - 1);
                        }
                        data += msg;

                        if (Global.sDebug == "False")
                        {
                            frmMessage frmMessage = new frmMessage();
                            frmMessage.ShowDialog("是否上传出库手持扫描结果?", "选择", "确定", "取消");
                            if (frmMessage.ret == true)
                            {
                                Business.SendText(Business.msg.Package("ZDUA07", data));//出库手持扫描完成
                            }
                            frmMessage.Dispose();
                        }
                    }
                }

                if (Global.curFrame.KZ == "重")
                {
                    frmSxChange frmSxChange = new frmSxChange();
                    Global.frmCurrent = frmSxChange;
                    frmSxChange.Owner = this;
                    frmSxChange.Show();
                    this.Hide();
                }
            }
            else if (e.KeyCode == Keys.Escape)
            {
                Global.frmCurrent = this.Owner;
                this.Owner.Show();
                this.Owner = null;
                this.Close();
            }
            else if (e.KeyCode == Keys.Tab)
            {
                if (Global.curFrame.KZ == "重")
                {
                    frmSxChange frmSxChange = new frmSxChange();
                    Global.frmCurrent = frmSxChange;
                    frmSxChange.Owner = this;
                    frmSxChange.Show();
                    this.Hide();
                }
            }
            else if (e.KeyCode == Keys.F5)//F1键
            {
                if (Global.sDebug == "False")
                {
                    string data = Global.sUserId + ";";
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";";
                    data += Global.sBb + ";";
                    data += Global.sZyq + ";";
                    data += "15" + ";";//15号行车
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss");

                    Business.SendText(Business.msg.Package("ZDUA06", data));//控制15号行车紧停
                }
            }
            else if (e.KeyCode == Keys.F3)//F3键
            {
                if (Global.sDebug == "False")
                {
                    string data = Global.sUserId + ";";
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";";
                    data += Global.sBb + ";";
                    data += Global.sZyq + ";";
                    data += "17" + ";";//17号行车
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss");

                    Business.SendText(Business.msg.Package("ZDUA06", data));//控制17号行车紧停
                }
            }
            else if (e.KeyCode == Keys.F4)//F4键
            {
                if (Global.sDebug == "False")
                {
                    string data = Global.sUserId + ";";
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";";
                    data += Global.sBb + ";";
                    data += Global.sZyq + ";";
                    data += "21" + ";";//21号行车
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss");

                    Business.SendText(Business.msg.Package("ZDUA06", data));//控制21号行车紧停
                }
            }
            else if (e.KeyCode == Keys.F2)//F2键
            {
                if (Global.sDebug == "False")
                {
                    string data = Global.sUserId + ";";
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";";
                    data += Global.sBb + ";";
                    data += Global.sZyq + ";";
                    data += "22" + ";";//22号行车
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss");

                    Business.SendText(Business.msg.Package("ZDUA06", data));//控制22号行车紧停
                }
            }
            else if (e.KeyCode == Keys.F22 || e.KeyCode == Keys.F23)
            {
                if (curPoint.row >= 0)
                {
                    if (Global.coils.ContainsKey(curPoint))
                    {
                        Coil   coil = Global.coils[curPoint];
                        string clh  = coil.clh;
                        string qa   = coil.qa;
                        if (clh != "")
                        {
                            frmQuality frmQuality = new frmQuality();
                            Global.frmCurrent = frmQuality;
                            frmQuality.Owner  = this;
                            this.Hide();
                            frmQuality.Show(clh, qa, curPoint);
                        }

                        coil = null;
                    }
                }
            }
        }