コード例 #1
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            #region #1汽车机械采样机

            EquCarJXSamplerDAO carJXSamplerDAO1 = new EquCarJXSamplerDAO(GlobalVars.MachineCode_QCJXCYJ_1);
            //AccessDapperDber accessDapperDber1 = new AccessDapperDber(CommonDAO.GetInstance().GetCommonAppletConfigString("#1汽车机械采样机接口连接字符串"));

            taskSimpleScheduler.StartNewTask("#1汽车机械采样机-快速同步", () =>
            {
                carJXSamplerDAO1.SyncSampleCmd(this.rTxtOutputer.Output);
                //carJXSamplerDAO1.SyncBarrel(this.rTxtOutputer.Output, accessDapperDber1);

                //carJXSamplerDAO1.SyncUnloadResult(this.rTxtOutputer.Output);
                //carJXSamplerDAO1.SyncQCJXCYJError(this.rTxtOutputer.Output);
                carJXSamplerDAO1.SyncSignal(this.rTxtOutputer.Output);
            }, 2000, OutputError);

            this.taskSimpleScheduler.StartNewTask("#1汽车机械采样机-上位机心跳", () =>
            {
                //carJXSamplerDAO1.SyncHeartbeatSignal();
            }, 30000, OutputError);

            #endregion

            #region #2汽车机械采样机

            EquCarJXSamplerDAO carJXSamplerDAO2 = new EquCarJXSamplerDAO(GlobalVars.MachineCode_QCJXCYJ_2);
            //AccessDapperDber accessDapperDber2 = new AccessDapperDber(CommonDAO.GetInstance().GetCommonAppletConfigString("#2汽车机械采样机接口连接字符串"));

            taskSimpleScheduler.StartNewTask("#2汽车机械采样机-快速同步", () =>
            {
                carJXSamplerDAO2.SyncSampleCmd(this.rTxtOutputer.Output);
                //carJXSamplerDAO2.SyncBarrel(this.rTxtOutputer.Output, accessDapperDber2);
                carJXSamplerDAO2.SyncSignal(this.rTxtOutputer.Output);
            }, 2000, OutputError);

            #endregion

            #region OPC

            taskSimpleScheduler.StartNewTask("同步汽车机械采样机OPC", () =>
            {
                EquCarJXSamplerOPC.GetInstance().SyncOPCTags(this.rTxtOutputer.Output);
            }, 0, OutputError);

            taskSimpleScheduler.StartNewTask("#1汽车机械采样机执行命令", () =>
            {
                EquCarJXSamplerOPC.GetInstance().RunCmd1(this.rTxtOutputer.Output);
            }, 500, OutputError);

            taskSimpleScheduler.StartNewTask("#2汽车机械采样机执行命令", () =>
            {
                EquCarJXSamplerOPC.GetInstance().RunCmd2(this.rTxtOutputer.Output);
            }, 500, OutputError);

            #endregion
        }
コード例 #2
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            #region #1汽车机械采样机

            taskSimpleScheduler.StartNewTask("#1汽车机械采样机-快速同步", () =>
            {
                EquCarJXSamplerDAO carJXSamplerDAO1 = new EquCarJXSamplerDAO(GlobalVars.MachineCode_QC_JxSampler_1, new DapperDber.Dbs.SqlServerDb.SqlServerDapperDber(CommonDAO.GetInstance().GetCommonAppletConfigString("#1汽车机械采样机接口连接字符串")));

                if (CommonDAO.GetInstance().TestPing(carJXSamplerDAO1.EquDber.Connection.DataSource))
                {
                    carJXSamplerDAO1.SyncSignal(this.rTxtOutputer.Output);
                    carJXSamplerDAO1.SyncBarrel(this.rTxtOutputer.Output);
                    carJXSamplerDAO1.SyncSampleCmd(this.rTxtOutputer.Output);
                    carJXSamplerDAO1.SyncJXCYControlUnloadCMD(this.rTxtOutputer.Output);
                    carJXSamplerDAO1.SyncResult(this.rTxtOutputer.Output);
                    carJXSamplerDAO1.SyncQCJXCYJError(this.rTxtOutputer.Output);
                }
                else
                {
                    this.rTxtOutputer.Output(string.Format("{0}网络不通", GlobalVars.MachineCode_QC_JxSampler_1), eOutputType.Warn);
                }
            }, 4000, OutputError);
            #endregion

            #region #2汽车机械采样机

            taskSimpleScheduler.StartNewTask("#2汽车机械采样机-快速同步", () =>
            {
                EquCarJXSamplerDAO carJXSamplerDAO2 = new EquCarJXSamplerDAO(GlobalVars.MachineCode_QC_JxSampler_2, new DapperDber.Dbs.SqlServerDb.SqlServerDapperDber(CommonDAO.GetInstance().GetCommonAppletConfigString("#2汽车机械采样机接口连接字符串")));
                if (CommonDAO.GetInstance().TestPing(carJXSamplerDAO2.EquDber.Connection.DataSource))
                {
                    carJXSamplerDAO2.SyncSignal(this.rTxtOutputer.Output);
                    carJXSamplerDAO2.SyncBarrel(this.rTxtOutputer.Output);
                    carJXSamplerDAO2.SyncSampleCmd(this.rTxtOutputer.Output);
                    carJXSamplerDAO2.SyncJXCYControlUnloadCMD(this.rTxtOutputer.Output);
                    carJXSamplerDAO2.SyncResult(this.rTxtOutputer.Output);
                    carJXSamplerDAO2.SyncQCJXCYJError(this.rTxtOutputer.Output);
                }
                else
                {
                    this.rTxtOutputer.Output(string.Format("{0}网络不通", GlobalVars.MachineCode_QC_JxSampler_1), eOutputType.Warn);
                }
            }, 4000, OutputError);
            #endregion
        }
コード例 #3
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            #region #3汽车机械采样机

            EquCarJXSamplerDAO carJXSamplerDAO3 = new EquCarJXSamplerDAO(GlobalVars.MachineCode_QCJXCYJ_3, new DapperDber.Dbs.SqlServerDb.SqlServerDapperDber(CommonDAO.GetInstance().GetCommonAppletConfigString("#3汽车机械采样机接口连接字符串")));

            taskSimpleScheduler.StartNewTask("#3汽车机械采样机-快速同步", () =>
            {
                carJXSamplerDAO3.SyncBarrel(this.rTxtOutputer.Output);
                carJXSamplerDAO3.SyncSampleCmd(this.rTxtOutputer.Output);
                //carJXSamplerDAO3.SyncJXCYControlUnloadCMD(this.rTxtOutputer.Output);
                carJXSamplerDAO3.SyncUnloadResult(this.rTxtOutputer.Output);
                carJXSamplerDAO3.SyncQCJXCYJError(this.rTxtOutputer.Output);
                carJXSamplerDAO3.SyncSignal(this.rTxtOutputer.Output);
            }, 2000, OutputError);

            this.taskSimpleScheduler.StartNewTask("#3汽车机械采样机-上位机心跳", () =>
            {
                carJXSamplerDAO3.SyncHeartbeatSignal();
            }, 30000, OutputError);

            #endregion

            #region #4汽车机械采样机

            EquCarJXSamplerDAO carJXSamplerDAO4 = new EquCarJXSamplerDAO(GlobalVars.MachineCode_QCJXCYJ_4, new DapperDber.Dbs.SqlServerDb.SqlServerDapperDber(CommonDAO.GetInstance().GetCommonAppletConfigString("#4汽车机械采样机接口连接字符串")));

            taskSimpleScheduler.StartNewTask("#4汽车机械采样机-快速同步", () =>
            {
                carJXSamplerDAO4.SyncBarrel(this.rTxtOutputer.Output);
                carJXSamplerDAO4.SyncSampleCmd(this.rTxtOutputer.Output);
                //carJXSamplerDAO3.SyncJXCYControlUnloadCMD(this.rTxtOutputer.Output);
                carJXSamplerDAO4.SyncUnloadResult(this.rTxtOutputer.Output);
                carJXSamplerDAO4.SyncQCJXCYJError(this.rTxtOutputer.Output);
                carJXSamplerDAO4.SyncSignal(this.rTxtOutputer.Output);
            }, 2000, OutputError);

            this.taskSimpleScheduler.StartNewTask("#4汽车机械采样机-上位机心跳", () =>
            {
                carJXSamplerDAO4.SyncHeartbeatSignal();
            }, 30000, OutputError);

            #endregion

            #region #5汽车机械采样机

            EquCarJXSamplerDAO carJXSamplerDAO5 = new EquCarJXSamplerDAO(GlobalVars.MachineCode_QCJXCYJ_5, new DapperDber.Dbs.SqlServerDb.SqlServerDapperDber(CommonDAO.GetInstance().GetCommonAppletConfigString("#5汽车机械采样机接口连接字符串")));

            taskSimpleScheduler.StartNewTask("#5汽车机械采样机-快速同步", () =>
            {
                carJXSamplerDAO5.SyncBarrel(this.rTxtOutputer.Output);
                carJXSamplerDAO5.SyncSampleCmd(this.rTxtOutputer.Output);
                //carJXSamplerDAO1.SyncJXCYControlUnloadCMD(this.rTxtOutputer.Output);
                carJXSamplerDAO5.SyncUnloadResult(this.rTxtOutputer.Output);
                carJXSamplerDAO5.SyncQCJXCYJError(this.rTxtOutputer.Output);
                carJXSamplerDAO5.SyncSignal(this.rTxtOutputer.Output);
            }, 2000, OutputError);

            this.taskSimpleScheduler.StartNewTask("#5汽车机械采样机-上位机心跳", () =>
            {
                carJXSamplerDAO5.SyncHeartbeatSignal();
            }, 30000, OutputError);

            #endregion
        }