Ejemplo n.º 1
0
        public override void Initialize(Context context)
        {
            try
            {
                //获取堆垛机信息
                DataTable dt = bll.FillDataTable("CMD.SelectCrane", new DataParameter[] { new DataParameter("{0}", "1=1") });
                for (int i = 1; i <= dt.Rows.Count; i++)
                {
                    if (!dCrnStatus.ContainsKey(i))
                    {
                        rCrnStatus crnsta = new rCrnStatus();
                        dCrnStatus.Add(i, crnsta);

                        dCrnStatus[i].TaskNo = "";
                        dCrnStatus[i].Status = int.Parse(dt.Rows[i-1]["State"].ToString());
                        dCrnStatus[i].TaskStatus = 0;
                        dCrnStatus[i].ErrCode = 0;
                        dCrnStatus[i].Action = 0;
                    }
                }

                tmWorkTimer.Interval = 1000;
                tmWorkTimer.Elapsed += new ElapsedEventHandler(tmWorker);

                base.Initialize(context);
            }
            catch (Exception ex)
            {
                Logger.Error("THOK.XC.Process.Process_Crane.CraneProcess堆垛机初始化出错,原因:" + ex.Message);
            }
        }
Ejemplo n.º 2
0
        public override void Initialize(Context context)
        {
            try
            {
                //获取堆垛机信息
                DataTable dt = bll.FillDataTable("CMD.SelectDevice", new DataParameter[] { new DataParameter("{0}", "Flag=1") });
                for (int i = 1; i <= dt.Rows.Count; i++)
                {
                    if (!dCrnStatus.ContainsKey(i))
                    {
                        rCrnStatus crnsta = new rCrnStatus();
                        dCrnStatus.Add(i, crnsta);

                        dCrnStatus[i].io_flag     = 0;
                        dCrnStatus[i].ServiceName = dt.Rows[i - 1]["ServiceName"].ToString();
                        dCrnStatus[i].Action      = int.Parse(dt.Rows[i - 1]["State"].ToString());
                        dCrnStatus[i].DeviceNo    = dt.Rows[i - 1]["DeviceNo"].ToString();
                    }
                }
                tmWorkTimer          = new Timer();
                tmWorkTimer.Interval = 2000;
                tmWorkTimer.Elapsed += new ElapsedEventHandler(tmWorker);
                dtDeviceAlarm        = bll.FillDataTable("WCS.SelectDeviceAlarm", new DataParameter[] { new DataParameter("{0}", "Flag=1") });

                base.Initialize(context);
            }
            catch (Exception ex)
            {
                Logger.Error("CraneProcess堆垛机初始化出錯,原因:" + ex.Message);
            }
        }
Ejemplo n.º 3
0
        public override void Initialize(Context context)
        {
            try
            {
                //获取堆垛机信息
                DataTable dt = bll.FillDataTable("CMD.SelectCrane", new DataParameter[] { new DataParameter("{0}", "1=1") });
                for (int i = 1; i <= dt.Rows.Count; i++)
                {
                    if (!dCrnStatus.ContainsKey(i))
                    {
                        rCrnStatus crnsta = new rCrnStatus();
                        dCrnStatus.Add(i, crnsta);

                        dCrnStatus[i].TaskNo     = "";
                        dCrnStatus[i].Status     = int.Parse(dt.Rows[i - 1]["State"].ToString());
                        dCrnStatus[i].TaskStatus = 0;
                        dCrnStatus[i].ErrCode    = 0;
                        dCrnStatus[i].Action     = 0;
                    }
                }
                BalanceCounter = int.Parse(context.Attributes["BalanceCounter"].ToString());

                tmWorkTimer.Interval = 1000;
                tmWorkTimer.Elapsed += new ElapsedEventHandler(tmWorker);


                base.Initialize(context);
            }
            catch (Exception ex)
            {
                Logger.Error("Dispatching.Process.Process_Crane.CraneProcess堆垛机初始化出错,原因:" + ex.Message);
            }
        }
Ejemplo n.º 4
0
        public override void Initialize(Context context)
        {
            try
            {
                dtCraneErr = bll.FillDataTable("WCS.SelectCraneError");
                AreaCode   = BLL.Server.GetAreaCode();
                //获取堆垛机信息
                DataTable dt = bll.FillDataTable("CMD.SelectCrane", new DataParameter[] { new DataParameter("{0}", "1=1") });
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (!dCrnStatus.ContainsKey(i))
                    {
                        rCrnStatus crnsta = new rCrnStatus();
                        dCrnStatus.Add(i, crnsta);

                        dCrnStatus[i].TaskNo     = "";
                        dCrnStatus[i].Status     = int.Parse(dt.Rows[i]["State"].ToString());
                        dCrnStatus[i].TaskStatus = 0;
                        dCrnStatus[i].ErrCode    = 0;
                        dCrnStatus[i].Action     = 0;
                    }
                }

                tmWorkTimer.Interval = 2001;
                tmWorkTimer.Elapsed += new ElapsedEventHandler(tmWorker);


                base.Initialize(context);
            }
            catch (Exception ex)
            {
                Logger.Error("CraneProcess堆垛机初始化出错,原因:" + ex.Message);
            }
        }