示例#1
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            EquAssayDeviceDAO assayDeviceDAO = EquAssayDeviceDAO.GetInstance();

            Int32  days    = 100;
            String strDays = CommonDAO.GetInstance().GetAppletConfigString("化验设备数据读取天数");

            if (!String.IsNullOrWhiteSpace(strDays))
            {
                Int32.TryParse(strDays, out days);
            }

            taskSimpleScheduler.StartNewTask("生成标准测硫仪数据", () =>
            {
                assayDeviceDAO.SaveToSulfurAssay(this.rTxtOutputer.Output, days);
            }, 30000, OutputError);

            taskSimpleScheduler.StartNewTask("生成标准量热仪数据", () =>
            {
                assayDeviceDAO.SaveToHeatAssay(this.rTxtOutputer.Output, days);
            }, 30000, OutputError);

            taskSimpleScheduler.StartNewTask("生成标准水分仪数据", () =>
            {
                assayDeviceDAO.SaveToMoistureAssay(this.rTxtOutputer.Output, days);
            }, 30000, OutputError);
        }
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            EquAssayDeviceDAO assayDevice_DAO = EquAssayDeviceDAO.GetInstance();

            taskSimpleScheduler.StartNewTask("生成标准测硫仪数据", () =>
            {
                assayDevice_DAO.CreateToSulfurStdAssay(this.rTxtOutputer.Output);
            }, 30000, OutputError);

            taskSimpleScheduler.StartNewTask("生成标准量热仪数据", () =>
            {
                assayDevice_DAO.CreateToHeatStdAssay(this.rTxtOutputer.Output);
            }, 30000, OutputError);

            taskSimpleScheduler.StartNewTask("生成标准水分仪数据", () =>
            {
                assayDevice_DAO.CreateToMoistureStdAssay(this.rTxtOutputer.Output);
            }, 30000, OutputError);

            taskSimpleScheduler.StartNewTask("生成标准工分仪数据", () =>
            {
                assayDevice_DAO.CreateToProximateStdAssay(this.rTxtOutputer.Output);
            }, 30000, OutputError);

            taskSimpleScheduler.StartNewTask("生成标准碳氢仪数据", () =>
            {
                assayDevice_DAO.CreateToHadStdAssay(this.rTxtOutputer.Output);
            }, 30000, OutputError);

            taskSimpleScheduler.StartNewTask("生成标准灰融仪数据", () =>
            {
                assayDevice_DAO.CreateToAshStdAssay(this.rTxtOutputer.Output);
            }, 30000, OutputError);

            //taskSimpleScheduler.StartNewTask("读取开元数据", () =>
            //{
            //    assayDevice_DAO.SaveToHeatAssay_CSKY(this.rTxtOutputer.Output);
            //    assayDevice_DAO.SaveToMoistureAssay_CSKY(this.rTxtOutputer.Output);
            //    assayDevice_DAO.SaveToSulfurStdAssay_CSKY(this.rTxtOutputer.Output);

            //}, 30000, OutputError);//开元数据同步暂时停掉

            //taskSimpleScheduler.StartNewTask("读取化验设备运行状态", () =>
            //{
            //    assayDevice_DAO.ReadHyMachine(this.rTxtOutputer.Output);

            //}, 10000, OutputError);//改为直接写数据库
        }