Example #1
0
 private void FRM_CC_FormClosing(object sender, FormClosingEventArgs e)
 {
     Process.GetCurrentProcess().Kill();
     this.Close();
     PLCSystem_SRM.stop();
     Program.Log_Agent_CON.Stop();
     Program.Log_Agent_SRM.Stop();
     Program.Log_Agent_BUS.Stop();
     Program.Log_Agent_DB.Stop();
     Program.Log_Agent_TEMP.Stop();
 }
Example #2
0
        private void FRM_CC_Load(object sender, EventArgs e)
        {
            PLCSystem_SRM.InitItem();
            PLCSystem_SRM.InitConn();
            PLCSystem_SRM.Start();

            PLCSystem_CON.InitItem();
            PLCSystem_CON.InitConn();
            PLCSystem_CON.Start();

            timer_CCSTS.Enabled  = true;
            timer_CCSTS.Interval = 3000;
            timer_CCSTS.Start();

            timer_SRM.Enabled  = true;
            timer_SRM.Interval = 3000;
            timer_SRM.Start();

            timer_T_ShowData.Enabled  = true;
            timer_T_ShowData.Interval = 3000;
            timer_T_ShowData.Start();

            //this.Location = new Point(245, 39);
            this.DataGridLoad();
            tm_updateOrder.Start();

            groupBox1.Controls.Clear();
            SrmStatus ss = new SrmStatus();

            groupBox1.Controls.Add(ss);
            ss.Dock = DockStyle.Fill;

            OneIn pm = new OneIn();

            homeContent.Controls.Add(pm);
            pm.Dock = DockStyle.Fill;

            treeView1.SelectedNode = treeView1.Nodes[3];
            treeView1.SelectedNode.Expand();
            treeView1.SelectedNode = treeView1.Nodes[4];
            treeView1.SelectedNode.Expand();
        }
Example #3
0
 private void timer_SRM_Tick(object sender, EventArgs e)
 {
     lbl_SRMStatus.Text = PLCSystem_SRM.GetPLCSts();
 }
Example #4
0
        /// <summary>
        ///入库申请
        /// </summary>
        /// <param name="barcode"></param>
        /// <param name="RequestLoc"></param>
        /// <param name="fromStn"></param>
        /// <param name="outString"></param>
        /// <returns></returns>
        public bool RequestInStock(string barcode, string RequestLoc, out string fromStn, out string outString)
        {
            string newHouseNumber = "";
            string Line           = "";
            bool   r = false;

            fromStn   = "";
            outString = "";
            //1判断是否重复申请
            //2.创建库存
            //3.分配货位
            //4.获取巷到对应EP点
            //5.创建入库执行
            var db = new DBAccess_MySql("MySql");

            try
            {
                db.StartTran();
                r = IsRepeatPallet(barcode, out outString);
                if (r)
                {
                    throw new ApplicationException(string.Format("[{0}]重复的入库申请!{1}", barcode, outString));
                }
                r = AllocationLoc(db, barcode, out newHouseNumber, out outString);
                if (!r)
                {
                    throw new ApplicationException(string.Format("[{0}]分配货位失败!{1}", barcode, outString));
                }
                BarcodeInfo bi = new BarcodeInfo(barcode);
                r = CreateStock(db, newHouseNumber, bi, out outString);
                if (!r)
                {
                    throw new ApplicationException(string.Format("[{0}]创建库存失败{!1}", barcode, outString));
                }
                Line    = PLCSystem_SRM.GetLineByhouseNumber(newHouseNumber).ToString();
                fromStn = PLCSystem_SRM.SysSRMMaping.GetConNodeID(Line, PLCSystem_SRM.InStnNo, eStationType.EP);
                if (Line == "" || fromStn == "")
                {
                    throw new ApplicationException(string.Format("[{0}]获取匹配巷道及入库站点失败!{1}", barcode, outString));
                }
                r = CreateOrderInfo_In(db, barcode, PLCSystem_SRM.InStnNo, newHouseNumber, Line, out outString);
                if (!r)
                {
                    throw new ApplicationException(string.Format("[{0}]创建入库指令失败!{1}", barcode, outString));
                }
                db.CommitTran();
            }
            catch (Exception ex)
            {
                outString = ex.Message;
                Program.Log_Agent_BUS.WriteLog(Enum_LogType.LogType_Error,
                                               Enum_LogGrade.LogGrade_Nin,
                                               Enum_LogMessageType.LogMsgType_Exception,
                                               "RequestInStocke",
                                               ex.Message,
                                               ex.StackTrace);
                r = false;
                db.RollBack();
            }
            return(r);
        }