示例#1
0
        private void InitAllTasks()
        {
            //ScanTask
            _scanGroup = new TaskGroup(MainModule.formMain.CreateNewOutputWindow("Scan task", Logs.Log.ScanTaskLog, true));
            _scanTask  = new ScanTask("ScanTask", _scanGroup);
            _scanGroup.AddTaskUnit(_scanTask);
            _scanGroup.StartThreadAlwayScan();

            //WsTask1
            _wsTask1Group = new TaskGroup(MainModule.formMain.CreateNewOutputWindow("Workstation Task1", Logs.Log.WsTask1Log, true));
            _wsTask1      = new WsTask1("WorkstationTask1", _wsTask1Group);
            _wsTask1Group.AddTaskUnit(_wsTask1);
            _wsTask1Group.StartThreadAlwayScan();

            //WsTask2
            _wsTask2Group = new TaskGroup(MainModule.formMain.CreateNewOutputWindow("Workstation Task2", Logs.Log.WsTask2Log, true));
            _wsTask2      = new WsTask2("WorkstationTask2", _wsTask2Group);
            _wsTask2Group.AddTaskUnit(_wsTask2);
            _wsTask2Group.StartThreadAlwayScan();

            //WsTask3
            _wsTask3Group = new TaskGroup(MainModule.formMain.CreateNewOutputWindow("Workstation Task3", Logs.Log.WsTask3Log, true));
            _wsTask3      = new WsTask3("WorkstationTask3", _wsTask3Group);
            _wsTask3Group.AddTaskUnit(_wsTask3);
            _wsTask3Group.StartThreadAlwayScan();

            //WsTask4
            _wsTask4Group = new TaskGroup(MainModule.formMain.CreateNewOutputWindow("Workstation Task4", Logs.Log.WsTask4Log, true));
            _wsTask4      = new WsTask4("WorkstationTask4", _wsTask4Group);
            _wsTask4Group.AddTaskUnit(_wsTask4);
            _wsTask4Group.StartThreadAlwayScan();

            //WsTask5
            _wsTask5Group = new TaskGroup(MainModule.formMain.CreateNewOutputWindow("Workstation Task5", Logs.Log.WsTask5Log, true));
            _wsTask5      = new WsTask5("WorkstationTask5", _wsTask5Group);
            _wsTask5Group.AddTaskUnit(_wsTask5);
            _wsTask5Group.StartThreadAlwayScan();

            //WsTask6
            _wsTask6Group = new TaskGroup(MainModule.formMain.CreateNewOutputWindow("Workstation Task6", Logs.Log.WsTask6Log, true));
            _wsTask6      = new WsTask6("WorkstationTask6", _wsTask6Group);
            _wsTask6Group.AddTaskUnit(_wsTask6);
            _wsTask6Group.StartThreadAlwayScan();
        }
示例#2
0
文件: StartForm.cs 项目: houxpGit/12
        //Load事件
        private void StartForm_Load(object sender, EventArgs e)
        {
            threadList.Add(ThreadHome);
            //  MainControls = new MainControl("运动流程任务", m_WeldingTaskGroup);

            //  MessageBox.Show(testDt.COMM.PortName);
            // testDt.DataReceivedstr = "2";
            hiPerfTimer = new HiPerfTimer();
            resetTimer  = new HiPerfTimer();

            frmOperator          = new FormOperator();
            frmOperator.TopLevel = false;
            panelOP.Controls.Add(frmOperator);
            frmOperator.Size = panelOP.Size;
            frmOperator.Show();
            FormOperator.startButtonPushed += StartClick;
            FormOperator.stopButtonPushed  += StopClick;
            frmOperator.homeButtonPushed   += Home;
            frmOperator.resetUp            += ResetUp;
            frmOperator.resetDown          += ResetDown;

            // lb_Yield.Text = Properties.Settings.Default.Yield.ToString();
            // lb_OKYield.Text = Properties.Settings.Default.OKYield.ToString();
            //  lb_NGYield.Text = Properties.Settings.Default.NGYield.ToString();



            m_MarkJetTaskGroup = new TaskGroup();
            // m_FeederTask = new ComeOut_process("上料托盘任务", m_MarkJetTaskGroup);
            //  m_TransferTask = new Weld_Process("移载任务", m_MarkJetTaskGroup);
            // m_MarkTask = new MarkTask("打标任务", m_MarkJetTaskGroup);
            //  m_JetTask = new Laser_PowerOn_And_Off("喷码任务", m_MarkJetTaskGroup);
            MainControls = MainControl.Instance();
            ///   MainControlLe = MainControlLeft.Instance();
            // m_BlankingTrayTask = new Feed_process("下料托盘任务",m_MarkJetTaskGroup);

            // m_MarkJetTaskGroup.AddTaskUnit(m_FeederTask);
            //m_MarkJetTaskGroup.AddTaskUnit(m_MarkTask);
            //m_MarkJetTaskGroup.AddTaskUnit(m_TransferTask);
            // m_MarkJetTaskGroup.AddTaskUnit(m_JetTask);
            m_MarkJetTaskGroup.AddTaskUnit(MainControls);
            // m_MarkJetTaskGroup.AddTaskUnit(MainControlLe);
            // m_MarkJetTaskGroup.AddTaskUnit(m_BlankingTrayTask);

            m_MarkJetTaskGroup.StartThread();
            //cbIgnoreCCD.Checked = Properties.Settings.Default.IgnoreCCD;

            MarkCom.MarkReadWrite();

            Methods = new Method();
            //视觉定位系统.FormMain ccdForm = new 视觉定位系统.FormMain();
            //ccdForm.FormBorderStyle = FormBorderStyle.None;
            //ccdForm.TopLevel = false;
            //panelCCD.Controls.Add(ccdForm);
            //ccdForm.Size = panelCCD.Size;
            //ccdForm.Show();
            //try
            //{
            //    EXEToWinform showCCDForm = new EXEToWinform(this.panelCCD, "CCD");
            //    showCCDForm.Start(@"E:\优尔数控软件发布V6.4\ur-soft.exe");
            //}
            //catch (Exception)
            //{
            //    MessageBox.Show("激光器软件加载失败");
            //}
            //注册监听
            Weld_Log.Level_Log_CallBack += Level_Log_CallBack;
        }