Exemple #1
0
        private void Main_Load(object sender, EventArgs e)
        {
            try
            {
                bll = new BLLBase();
                lbLog.Scrollable = true;
                Logger.OnLog    += new LogEventHandler(Logger_OnLog);
                context          = new Context();



                ContextInitialize initialize = new ContextInitialize();
                initialize.InitializeContext(context);

                Dispatching.LED2008.LEDUtil.Initialize(context.Attributes["LedCollection"].ToString());

                toolStripButton_StartCrane_Click(null, null);

                dtCrane = bll.FillDataTable("WCS.SelectWCSCRANE");

                System.Threading.Thread.Sleep(1000);
                tmCraneErr.Interval = 3000;
                tmCraneErr.Elapsed += new System.Timers.ElapsedEventHandler(tmCraneWorker);
                tmCraneErr.Start();
            }
            catch (Exception ee)
            {
                Logger.Error("初始化处理失败请检查配置,原因:" + ee.Message);
            }
        }
Exemple #2
0
        private void Main_Shown(object sender, EventArgs e)
        {
            try
            {
                SetBtnEnabled(false);

                lbLog.Scrollable = true;
                Logger.OnLog    += new LogEventHandler(Logger_OnLog);

                context = new Context();
                ContextInitialize initialize = new ContextInitialize();
                initialize.InitializeContext(context);

                //View.frmMonitor f = new View.frmMonitor();
                //ShowForm(f);
                //MainData.OnTask += new TaskEventHandler(Data_OnTask);
                //this.BindData();
                //for (int i = 0; i < this.dgvMain.Columns.Count - 1; i++)
                //    ((DataGridViewAutoFilterTextBoxColumn)this.dgvMain.Columns[i]).FilteringEnabled = true;

                tmWorkTimer.Interval = 3000;
                tmWorkTimer.Elapsed += new System.Timers.ElapsedEventHandler(tmWorker);
                tmWorkTimer.Start();
            }
            catch (Exception ee)
            {
                Logger.Error("初始化配置检查失败,原因:" + ee.Message);
            }
        }
Exemple #3
0
        private void Main_Shown(object sender, EventArgs e)
        {
            try
            {
                lbLog.Scrollable = true;
                Logger.OnLog    += new LogEventHandler(Logger_OnLog);
                context          = new Context();

                ContextInitialize initialize = new ContextInitialize();
                initialize.InitializeContext(context);

                this.TimeDiff = int.Parse(context.Attributes["TimeDiff"].ToString());
                string        MonitorMode = context.Attributes["MonitorMode"].ToString();
                View.BaseForm f;
                if (MonitorMode == "1")
                {
                    f = new View.frmMonitor();
                }
                else
                {
                    f = new View.frmMonitor1();
                }
                ShowForm(f);

                //tmWorkTimer.Interval = 3000;
                //tmWorkTimer.Elapsed += new System.Timers.ElapsedEventHandler(tmWorker);
                //tmWorkTimer.Start();
            }
            catch (Exception ee)
            {
                Logger.Error("初始化处理失败请检查配置,原因:" + ee.Message);
            }
        }
Exemple #4
0
        private void Main_Shown(object sender, EventArgs e)
        {
            try
            {
                lbLog.Scrollable     = true;
                Logger.OnLog        += new LogEventHandler(Logger_OnLog);
                FormDialog.OnDialog += new DialogEventHandler(FormDialog_OnDialog);
                context              = new Context();

                ContextInitialize initialize = new ContextInitialize();
                initialize.InitializeContext(context);

                if (BLL.Server.GetTaskTest() == "0")
                {
                    this.toolStripButton1.Visible = false;
                }


                View.frmMonitor f = new View.frmMonitor();
                ShowForm(f);

                //tmWorkTimer.Interval = 3000;
                //tmWorkTimer.Elapsed += new System.Timers.ElapsedEventHandler(tmWorker);
                //tmWorkTimer.Start();
            }
            catch (Exception ee)
            {
                Logger.Error("初始化处理失败请检查配置,原因:" + ee.Message);
            }
        }
Exemple #5
0
        private void Main_Shown(object sender, EventArgs e)
        {
            try
            {
                lbLog.Scrollable     = true;
                Logger.OnLog        += new LogEventHandler(Logger_OnLog);
                FormDialog.OnDialog += new DialogEventHandler(FormDialog_OnDialog);
                context              = new Context();

                ContextInitialize initialize = new ContextInitialize();
                initialize.InitializeContext(context);
                View.BaseForm f;
                if (Program.WarehouseCode == "A")
                {
                    f = new View.frmMonitorA();
                }
                else if (Program.WarehouseCode == "B")
                {
                    f = new View.frmMonitorB();
                }
                else
                {
                    f = new View.frmMonitor();
                }
                ShowForm(f);

                MainData.OnTask += new TaskEventHandler(Data_OnTask);
                this.BindData();
                for (int i = 0; i < this.dgvMain.Columns.Count - 1; i++)
                {
                    ((DataGridViewAutoFilterTextBoxColumn)this.dgvMain.Columns[i]).FilteringEnabled = true;
                }

                tmWorkTimer.Interval = 3000;
                tmWorkTimer.Elapsed += new System.Timers.ElapsedEventHandler(tmWorker);
                tmWorkTimer.Start();

                tmUpErpWorkTimer.Interval = 600000;
                tmUpErpWorkTimer.Elapsed += new System.Timers.ElapsedEventHandler(tmUpErpWorker);
                tmUpErpWorkTimer.Start();

                PermissionControl();
            }
            catch (Exception ee)
            {
                Logger.Error("初始化处理失败请检查配置,原因:" + ee.Message);
            }
        }
Exemple #6
0
        private void Main_Shown(object sender, EventArgs e)
        {
            try
            {
                lbLog.Scrollable     = true;
                Logger.OnLog        += new LogEventHandler(Logger_OnLog);
                FormDialog.OnDialog += new DialogEventHandler(FormDialog_OnDialog);

                MainData.OnTask += new TaskEventHandler(Data_OnTask);
                this.BindData();
                for (int i = 0; i < this.dgvMain.Columns.Count - 1; i++)
                {
                    if (this.dgvMain.Columns[i].DataPropertyName.ToLower().IndexOf("date") == -1)
                    {
                        ((DataGridViewAutoFilterTextBoxColumn)this.dgvMain.Columns[i]).FilteringEnabled = true;
                    }
                }

                tmWorkTimer.Interval = 3000;
                tmWorkTimer.Elapsed += new System.Timers.ElapsedEventHandler(tmWorker);
                tmWorkTimer.Start();



                toolStripButton_Login.Image = App.Properties.Resources.user_remove;
                toolStripButton_Login.Text  = "注销用户";
                PermissionControl();

                //连接RFID
                Thread firstChild = new Thread(new ParameterizedThreadStart(ThreadProc));
                firstChild.IsBackground = true;
                firstChild.Start(firstChild.Name);

                //初始化OPC
                context = new Context();
                ContextInitialize initialize = new ContextInitialize();
                initialize.InitializeContext(context);



                View.frmMonitor f = new View.frmMonitor();
                ShowForm(f);
            }
            catch (Exception ee)
            {
                Logger.Error("初始化处理失败请检查配置,原因:" + ee.Message);
            }
        }
Exemple #7
0
        private void Main_Load(object sender, EventArgs e)
        {
            try
            {
                bll = new BLLBase();
                lbLog.Scrollable = true;
                Logger.OnLog    += new LogEventHandler(Logger_OnLog);
                context          = new Context();

                ContextInitialize initialize = new ContextInitialize();
                initialize.InitializeContext(context);



                System.Threading.Thread.Sleep(3000);
                if (Screen.PrimaryScreen.WorkingArea.Width > 1366)
                {
                    View.frmMonitor2 f = new View.frmMonitor2();
                    ShowForm(f);
                }
                else
                {
                    View.frmMonitor f = new View.frmMonitor();
                    ShowForm(f);
                }



                tmWorkTimer.Interval = 5000;
                tmWorkTimer.Elapsed += new System.Timers.ElapsedEventHandler(tmWorker);
                tmWorkTimer.Start();
            }
            catch (Exception ee)
            {
                Logger.Error("初始化处理失败请检查配置,原因:" + ee.Message);
            }



            MainData.OnTask += new TaskEventHandler(Data_OnTask);
            for (int i = 0; i < 3; i++)
            {
                ((DataGridViewAutoFilterTextBoxColumn)this.dgvMain.Columns[i]).FilteringEnabled = true;
            }
        }
        private void MainForm_Shown(object sender, EventArgs e)
        {
            try
            {
                Logger.OnLog += new LogEventHandler(Logger_OnLog);

                context = new Context();

                ContextInitialize initialize = new ContextInitialize();
                context.RegisterProcessControl(buttonArea);
                initialize.InitializeContext(context);
                context.RegisterProcessControl(monitorView);

                //context.Processes["DynamicShowProcess"].Resume();
            }
            catch (Exception ee)
            {
                Logger.Error("初始化处理失败请检查配置,原因:" + ee.Message);
            }
        }
Exemple #9
0
        private void Main_Shown(object sender, EventArgs e)
        {
            try

            {
                lbLog.Scrollable     = true;
                Logger.OnLog        += new LogEventHandler(Logger_OnLog);
                FormDialog.OnDialog += new DialogEventHandler(FormDialog_OnDialog);
                context              = new Context();

                ContextInitialize initialize = new ContextInitialize();
                initialize.InitializeContext(context);

                if (BLL.Server.GetTaskTest() == "0")
                {
                    this.toolStripButton1.Visible = false;
                }

                View.frmMonitor f = new View.frmMonitor();
                ShowForm(f);
                MainData.OnTask += new TaskEventHandler(Data_OnTask);
                this.BindData();
                for (int i = 0; i < this.dgvMain.Columns.Count - 1; i++)
                {
                    ((DataGridViewAutoFilterTextBoxColumn)this.dgvMain.Columns[i]).FilteringEnabled = true;
                }

                tmWorkTimer.Interval = 3000;
                tmWorkTimer.Elapsed += new System.Timers.ElapsedEventHandler(tmWorker);
                tmWorkTimer.Start();
                //tmWorkTimer.Interval = 3000;
                //tmWorkTimer.Elapsed += new System.Timers.ElapsedEventHandler(tmWorker);
                //tmWorkTimer.Start();
            }
            catch (Exception ee)
            {
                Logger.Error("初始化处理失败请检查配置,原因:" + ee.Message);
            }
        }
Exemple #10
0
        private void Main_Shown(object sender, EventArgs e)
        {
            try
            {
                lbLog.Scrollable = true;
                Logger.OnLog    += new LogEventHandler(Logger_OnLog);
                context          = new Context();

                ContextInitialize initialize = new ContextInitialize();
                initialize.InitializeContext(context);

                View.frmMonitor f = new View.frmMonitor();
                ShowForm(f);

                tmWorkTimer.Interval = 3000;
                tmWorkTimer.Elapsed += new System.Timers.ElapsedEventHandler(tmWorker);
                tmWorkTimer.Start();
            }
            catch (Exception ee)
            {
                Logger.Error("初始化处理失败请检查配置,原因:" + ee.Message);
            }
        }