Example #1
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            taskSimpleScheduler.StartNewTask("初始化甲路皮带秤", () =>
            {
                bber1.OnDataReceived += Bber1_OnDataReceived;
                bber1.OnReceiveError += Bber1_OnReceiveError;
                if (bber1.OpenCom(commonDAO.GetAppletConfigInt32("甲路皮带秤串口号"), commonDAO.GetAppletConfigInt32("甲路皮带秤波特率"), 8, System.IO.Ports.StopBits.One, System.IO.Ports.Parity.None))
                {
                    this.rTxtOutputer.Output("甲路皮带秤串口打开成功", eOutputType.Important);
                }
                else
                {
                    this.rTxtOutputer.Output("甲路皮带秤串口打开失败", eOutputType.Error);
                }
            });

            taskSimpleScheduler.StartNewTask("初始化乙路皮带秤", () =>
            {
                bber2.OnDataReceived += Bber2_OnDataReceived;
                bber2.OnReceiveError += Bber2_OnReceiveError;
                if (bber2.OpenCom(commonDAO.GetAppletConfigInt32("乙路皮带秤串口号"), commonDAO.GetAppletConfigInt32("乙路皮带秤波特率"), 8, System.IO.Ports.StopBits.One, System.IO.Ports.Parity.None))
                {
                    this.rTxtOutputer.Output("乙路皮带秤串口打开成功", eOutputType.Important);
                }
                else
                {
                    this.rTxtOutputer.Output("乙路皮带秤串口打开失败", eOutputType.Error);
                }
            });
        }
Example #2
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()
        {
            #region #1合样归批机

            EquBatchMachineDAO batchMachineDAO1 = new EquBatchMachineDAO(GlobalVars.MachineCode_HYGPJ_1, new DapperDber.Dbs.SqlServerDb.SqlServerDapperDber(CommonDAO.GetInstance().GetCommonAppletConfigString("合样归批连接字符串")));
            taskSimpleScheduler.StartNewTask("#1合样归批机-快速同步", () =>
            {
                batchMachineDAO1.SyncCmd(this.rTxtOutputer.Output);
                batchMachineDAO1.SyncError(this.rTxtOutputer.Output);
                batchMachineDAO1.SyncBarrel(this.rTxtOutputer.Output);
            }, 2000, OutputError);

            taskSimpleScheduler.StartNewTask("#1合样归批机-OPC同步", () =>
            {
                EquBatchMachineOPC.GetInstance().SyncOPCTags(this.rTxtOutputer.Output);
            }, 0, OutputError);

            taskSimpleScheduler.StartNewTask("#1合样归批机执行命令", () =>
            {
                EquBatchMachineOPC.GetInstance().RunCmd(this.rTxtOutputer.Output);
            }, 500, OutputError);

            taskSimpleScheduler.StartNewTask("送样小车-OPC同步", () =>
            {
                EquSYCarOPC.GetInstance().SyncOPCTags(this.rTxtOutputer.Output);
            }, 0, OutputError);

            taskSimpleScheduler.StartNewTask("送样小车执行命令", () =>
            {
                EquSYCarOPC.GetInstance().RunCmd(this.rTxtOutputer.Output);
            }, 500, OutputError);
            #endregion
        }
Example #4
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            #region #1全自动制样机
            taskSimpleScheduler.StartNewTask("#1全自动制样机-快速同步", () =>
            {
                EquAutoMakerDAO autoMakerDAO1 = new EquAutoMakerDAO(GlobalVars.MachineCode_QZDZYJ_1, new DapperDber.Dbs.SqlServerDb.SqlServerDapperDber(CommonDAO.GetInstance().GetCommonAppletConfigString("#1全自动制样机接口连接字符串")));
                if (commonDAO.TestPing(autoMakerDAO1.EquDber.Connection.DataSource))
                {
                    autoMakerDAO1.SyncCmd(this.rTxtOutputer.Output);
                    autoMakerDAO1.SyncSignal(this.rTxtOutputer.Output);
                    autoMakerDAO1.SyncMakeDetail(this.rTxtOutputer.Output);
                    autoMakerDAO1.SyncError(this.rTxtOutputer.Output);
                }
                else
                {
                    rTxtOutputer.Output(autoMakerDAO1.MachineCode + "网络不通", eOutputType.Warn);
                }
            }, 3000, OutputError);

            #endregion

            #region #2全自动制样机
            taskSimpleScheduler.StartNewTask("#2全自动制样机-快速同步", () =>
            {
                EquAutoMakerDAO autoMakerDAO2 = new EquAutoMakerDAO(GlobalVars.MachineCode_QZDZYJ_2, new DapperDber.Dbs.SqlServerDb.SqlServerDapperDber(CommonDAO.GetInstance().GetCommonAppletConfigString("#2全自动制样机接口连接字符串")));
                if (commonDAO.TestPing(autoMakerDAO2.EquDber.Connection.DataSource))
                {
                    autoMakerDAO2.SyncCmd(this.rTxtOutputer.Output);
                    autoMakerDAO2.SyncXLCmd(this.rTxtOutputer.Output);
                    autoMakerDAO2.SyncSignal(this.rTxtOutputer.Output);
                    autoMakerDAO2.SyncMakeDetail(this.rTxtOutputer.Output);
                    autoMakerDAO2.SyncError(this.rTxtOutputer.Output);
                }
                else
                {
                    rTxtOutputer.Output(autoMakerDAO2.MachineCode + "网络不通", eOutputType.Warn);
                }
            }, 2000, OutputError);
            #endregion

            #region #3全自动制样机
            taskSimpleScheduler.StartNewTask("#3全自动制样机-快速同步", () =>
            {
                EquAutoMakerDAO autoMakerDAO3 = new EquAutoMakerDAO(GlobalVars.MachineCode_QZDZYJ_3, new DapperDber.Dbs.SqlServerDb.SqlServerDapperDber(CommonDAO.GetInstance().GetCommonAppletConfigString("#3全自动制样机接口连接字符串")));
                if (commonDAO.TestPing(autoMakerDAO3.EquDber.Connection.DataSource))
                {
                    autoMakerDAO3.SyncCmd(this.rTxtOutputer.Output);
                    autoMakerDAO3.SyncXLCmd(this.rTxtOutputer.Output);
                    autoMakerDAO3.SyncSignal(this.rTxtOutputer.Output);
                    autoMakerDAO3.SyncMakeDetail(this.rTxtOutputer.Output);
                    autoMakerDAO3.SyncError(this.rTxtOutputer.Output);
                }
                else
                {
                    rTxtOutputer.Output(autoMakerDAO3.MachineCode + "网络不通", eOutputType.Warn);
                }
            }, 3000, OutputError);
            #endregion
        }
Example #5
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
        }
Example #6
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            #region #1汽车机械采样机

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

            taskSimpleScheduler.StartNewTask("#1汽车机械采样机-快速同步", () =>
            {
                carJXSamplerDAO1.SyncBarrel(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, new DapperDber.Dbs.SqlServerDb.SqlServerDapperDber(CommonDAO.GetInstance().GetCommonAppletConfigString("#2汽车机械采样机接口连接字符串")));

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

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

            #endregion

            #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.SyncQCJXCYJError(this.rTxtOutputer.Output);
                carJXSamplerDAO3.SyncSignal(this.rTxtOutputer.Output);
            }, 2000, OutputError);

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

            #endregion
        }
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            EquWeightBridgerDAO weightBridger_DAO = EquWeightBridgerDAO.GetInstance();

            taskSimpleScheduler.StartNewTask("同步轨道衡过衡数据", () =>
            {
                weightBridger_DAO.SyncTrainWeightInfo(this.rTxtOutputer.Output);
            }, 60000, OutputError);

            taskSimpleScheduler.StartNewTask("同步火车车号识别数据", () =>
            {
                weightBridger_DAO.SyncTrainRecognitionInfo(this.rTxtOutputer.Output);
            }, 2000, OutputError);
        }
        /// <summary>
        /// 翻车业务逻辑入口
        /// </summary>
        private void CreateMainTask()
        {
            taskSimpleScheduler = new TaskSimpleScheduler();

            autoResetEvent.Reset();

            taskSimpleScheduler.StartNewTask("翻车业务逻辑", () =>
            {
                // 获取待处理的车号识别记录 - 入厂方向
                CmcsTrainCarriagePass inTrainCarriagePass = carriageRecognitionerDAO.GetUnHandleTrainCarriagePass(this.carriageRecognitionerMachineCode, eTrainPassDirection.进厂);
                if (inTrainCarriagePass != null)
                {
                    this.CurrentTrainCarriagePass = inTrainCarriagePass;

                    // 检测采样机系统的状态
                    string samplerSystemStatue = commonDAO.GetSignalDataValue(this.trainBeltSampler.EquipmentCode, eSignalDataName.系统.ToString());
                    if (samplerSystemStatue == eEquInfSamplerSystemStatus.发生故障.ToString() || samplerSystemStatue == eEquInfSamplerSystemStatus.正在卸样.ToString())
                    {
                        MessageBoxEx2Show("禁止翻车, " + this.trainBeltSampler.EquipmentName + "发生故障或正在卸样,已暂停运行", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                        btnStartTurnover.Enabled = true;

                        // 取消任务
                        this.taskSimpleScheduler.Cancal();

                        return;
                    }

                    StartTippingTask(this.CurrentTrainCarriagePass);

                    autoResetEvent.WaitOne();
                }
            }, 4000);
        }
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            this.taskSimpleScheduler.StartNewTask("同步上位机运行状态", () =>
            {
                EquAutoCupboardDAO autoCupboard_DAO = new EquAutoCupboardDAO(GlobalVars.MachineCode_CYG1, new SqlServerDapperDber(CommonDAO.GetInstance().GetCommonAppletConfigString("智能存样柜接口连接字符串")));
                //if (CommonDAO.GetInstance().TestPing(autoCupboard_DAO.EquDber.Connection.DataSource))
                //{
                //#1存样柜
                autoCupboard_DAO.SyncCYGToBSInfo(this.rTxtOutputer.Output);
                autoCupboard_DAO.SyncCYGHistoryToBSInfo(this.rTxtOutputer.Output);
                autoCupboard_DAO.SyncClearCmdToCS(this.rTxtOutputer.Output);
                autoCupboard_DAO.SyncTakeCmdToCS(this.rTxtOutputer.Output);

                autoCupboard_DAO.SyncCYGError(this.rTxtOutputer.Output);
                autoCupboard_DAO.SyncCYGInfo(this.rTxtOutputer.Output);
                autoCupboard_DAO.SyncCYGCmd(this.rTxtOutputer.Output);
                autoCupboard_DAO.SyncCYGResult(this.rTxtOutputer.Output);
                autoCupboard_DAO.SyncSignalDatal(this.rTxtOutputer.Output);
                autoCupboard_DAO.SyncCYGRecord(this.rTxtOutputer.Output);
                //}
                //else
                //    rTxtOutputer.Output(autoCupboard_DAO.MachineCode + "网络不通", eOutputType.Warn);
            }, 5000, OutputError);

            taskSimpleScheduler.StartNewTask("#1全自动存样柜-OPC同步", () =>
            {
                EquAutoCupboardOPC.GetInstance().SyncOPCTags(this.rTxtOutputer.Output);
            }, 0, OutputError);
        }
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            //taskSimpleScheduler.StartNewTask("定时检测设备", () =>
            //{
            //    InitPerformer();
            //    foreach (IAssayGraber graber in Grabers)
            //    {
            //        graber.SocketMethod.StartListening(graber.Milliseconds * 1000 / 2);
            //    }
            //}, 0, OutputError);

            taskSimpleScheduler.StartNewTask("定时检测设备", () =>
            {
                //DateTime time = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " " + CommonDAO.GetInstance().GetCommonAppletConfigString("温湿度仪写入时间"));
                //if (!IsStart && DateTime.Now >= time && DateTime.Now < time.AddMinutes(2))
                //{
                InitPerformer();
                IsStart = true;
                foreach (IAssayGraber graber in Grabers)
                {
                    graber.SocketMethod.StartListening(graber.Milliseconds * 1000 / 2);
                }
                //}
                //else if (IsStart && DateTime.Now >= time.AddMinutes(2))
                //{
                //	IsStart = false;
                //	ClosePerformer();
                //}
            }, 0, OutputError);
        }
Example #11
0
        private void CreateMainTask()
        {
            taskSimpleScheduler = new TaskSimpleScheduler();

            autoResetEvent.Reset();

            taskSimpleScheduler.StartNewTask("模拟业务", () =>
            {
                if (!this.IsStartSimulator)
                {
                    return;
                }

                // 心跳
                this.EquDber.Execute("update " + EntityReflectionUtil.GetTableName <EquQZDZYJSignal>() + " set TagValue=@TagValue where TagName=@TagName", new { TagName = GlobalVars.EquHeartbeatName, TagValue = DateTime.Now.ToString() });
                // 更新采样计划
                this.EquDber.Execute("update " + EntityReflectionUtil.GetTableName <EquQZDZYJPlan>() + " set DataFlag=1 where DataFlag=0");

                // 控制命令
                EquQZDZYJCmd pDCYJCmd = this.EquDber.Entity <EquQZDZYJCmd>("where DataFlag=0 order by CreateDate desc");
                if (pDCYJCmd != null)
                {
                    CmdHandle(pDCYJCmd);

                    autoResetEvent.WaitOne();
                }
            }, 3000);
        }
Example #12
0
 /// <summary>
 /// 执行所有任务
 /// </summary>
 void ExecuteAllTask()
 {
     #region 封装归批机
     try
     {
         taskSimpleScheduler.StartNewTask("矩阵合样归批机-快速同步", () =>
         {
             EquPackagingBatchDAO batchDAO = new EquPackagingBatchDAO(new DapperDber.Dbs.SqlServerDb.SqlServerDapperDber(CommonDAO.GetInstance().GetCommonAppletConfigString("矩阵合样归批机接口连接字符串")));
             if (CommonDAO.GetInstance().TestPing(batchDAO.EquDber.Connection.DataSource))
             {
                 batchDAO.SyncCmd(this.rTxtOutputer.Output);
                 batchDAO.SyncCoord(this.rTxtOutputer.Output);
                 batchDAO.SyncError(this.rTxtOutputer.Output);
                 batchDAO.SyncSignal(this.rTxtOutputer.Output);
             }
             else
             {
                 this.rTxtOutputer.Output(string.Format("{0}网络不通", batchDAO.MachineCode), eOutputType.Warn);
             }
         }, 5000, OutputError);
     }
     catch (Exception ex)
     {
         OutputError("矩阵合样归批机-快速同步", ex);
     }
     #endregion
 }
Example #13
0
 /// <summary>
 /// 执行所有任务
 /// </summary>
 void ExecuteAllTask()
 {
     taskSimpleScheduler.StartNewTask("全自动存样柜-快速同步", () =>
     {
         EquAutoCupboardDAO.GetInstance().SyncCYGInfo(this.rTxtOutputer.Output);
     }, 50000, OutputError);
 }
Example #14
0
        private void btnRegsit_Click(object sender, EventArgs e)
        {
            int number = 0;

            try
            {
                number = int.Parse(txtFingerNumber.Text);
            }
            catch (Exception)
            {
            }
            taskSimpleScheduler.StartNewTask("注册指纹", () =>
            {
                if (finger.RegistFinger(number))
                {
                    taskSimpleScheduler.Cancal();
                }
                InvokeEx(() =>
                {
                    this.txtMessage.Text = finger.MessageStr;
                });
            }, 1000);

            finger.RegistFinger(number);
            if (finger.CurrentImage != null)
            {
                this.picFinger.Image = finger.CurrentImage;
            }
        }
Example #15
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            InOutStorageDAO inOutStorageDAO = InOutStorageDAO.GetInstance();

            taskSimpleScheduler.StartNewTask("创建煤场快照数据", () =>
            {
                if (isExecuted)
                {
                    isExecuted  = false;
                    string time = inOutStorageDAO.GetTimeParamter();
                    if (String.IsNullOrWhiteSpace(time))
                    {
                        this.rTxtOutputer.Output("未在系统中查询到【煤场快照数据生成时间点】的参数管理!", eOutputType.Error);
                        isExecuted = true;
                        return;
                    }
                    string setDateTime = DateTime.Now.ToString("yyyy-MM-dd") + " " + time;
                    DateTime dt        = DateTime.Now;
                    if (!DateTime.TryParse(setDateTime, out dt))
                    {
                        this.rTxtOutputer.Output(string.Format("时间节点:【{0}】格式不正确,转换为时间失败", time), eOutputType.Error);
                        isExecuted = true;
                        return;
                    }
                    if (DateTime.Now.ToString("yyyy-MM-dd HH:mm") == dt.ToString("yyyy-MM-dd HH:mm"))
                    {
                        inOutStorageDAO.CreateInOutStorage(this.rTxtOutputer.Output);
                    }
                    isExecuted = true;
                }
            }, 1000 * 60, OutputError);//1分钟执行一次  //时间只精确到时分,不精确到秒,因为连接数据库查询参数存在耗时间导致错过秒数的匹配
        }
Example #16
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            DataHandlerDAO dataHandlerDAO = DataHandlerDAO.GetInstance();

            //taskSimpleScheduler.StartNewTask("同步入厂煤运输记录", () =>
            //{
            //	dataHandlerDAO.SyncBuyFulTransportFromQCH(this.rTxtOutputer.Output);

            //}, 10000, OutputError);

            taskSimpleScheduler.StartNewTask("同步批次明细", () =>
            {
                dataHandlerDAO.SyncToBatch(this.rTxtOutputer.Output);
            }, 60000, OutputError);

            //taskSimpleScheduler.StartNewTask("处理事件", () =>
            //{
            //	dataHandlerDAO.SyncHandleEvent(this.rTxtOutputer.Output);

            //}, 60000, OutputError);

            //AccessDapperDber doorDapperDber = new AccessDapperDber("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info =true;Data Source=\\\\10.36.0.71\\ZKAccess3.5\\ZKAccess.mdb;");
            //taskSimpleScheduler.StartNewTask("同步门禁数据", () =>
            //{
            //    dataHandlerDAO.SyncDoorData(this.rTxtOutputer.Output, doorDapperDber);

            //}, 60000, OutputError);
        }
Example #17
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            UploadXmlHelper    xmlHelper = new UploadXmlHelper();
            List <TableOrView> list      = xmlHelper.LoadConfig().Where(a => a.IsUse.ToLower() == "true").ToList();

            if (list.Count <= 0)
            {
                this.rTxtOutputer.Output("未进行相关配置,请在【UploadData.AppConfig.xml】中进行配置后重新打开程序!", eOutputType.Error);
                return;
            }

            UploadDataDAO dao = UploadDataDAO.GetInstance();

            taskSimpleScheduler.StartNewTask("数据同步(无人值守<-->智仁)", () =>
            {
                if (isExeFinish)
                {
                    isExeFinish = false;
                    //执行任务
                    dao.TransferData(list, rTxtOutputer.Output);
                    isExeFinish = true;
                }
            }, 60 * 1000, OutputError);            //一分钟一次,上报不需要那么快


            taskSimpleScheduler.StartNewTask("数据同步【基础信息变更日志】(智仁-->无人值守)", () =>
            {
                if (isBaseLogExeFinish)
                {
                    isBaseLogExeFinish = false;
                    //执行任务
                    dao.TransferBaseOperLog(rTxtOutputer.Output);
                    isBaseLogExeFinish = true;
                }
            }, 60 * 1000, BaseLogOutputError);

            taskSimpleScheduler.StartNewTask("数据同步【化验数据】(智仁-->无人值守)", () =>
            {
                if (isAssayExeFinish)
                {
                    isAssayExeFinish = false;
                    //执行任务
                    dao.TransferAssayQulity(rTxtOutputer.Output);
                    isAssayExeFinish = true;
                }
            }, 60 * 1000, AssayOutputError);
        }
Example #18
0
 /// <summary>
 /// 执行所有任务
 /// </summary>
 void ExecuteAllTask()
 {
     taskSimpleScheduler.StartNewTask("同步斗轮机实时信号数据", () =>
     {
         SignalDataSyncDAO dataHandlerDAO = SignalDataSyncDAO.GetInstance();
         dataHandlerDAO.SyncDLJSignal(this.rTxtOutputer.Output);
     }, 60000, OutputError);
 }
Example #19
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
        }
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            EquWeightBridgerDAO weightBridger_DAO = EquWeightBridgerDAO.GetInstance();

            taskSimpleScheduler.StartNewTask("同步翻车衡过衡数据", () =>
            {
                weightBridger_DAO.SyncLwCarsInfo(this.rTxtOutputer.Output);
            }, 30000, OutputError);
        }
Example #21
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            taskSimpleScheduler.StartNewTask("综合事件处理", () =>
            {
                DataHandlerDAO dataHandlerDAO = DataHandlerDAO.GetInstance();

                dataHandlerDAO.Start(this.rTxtOutputer.Output);
            }, 60000, OutputError);
        }
Example #22
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            TruckWeightDAO weightBridger_DAO = TruckWeightDAO.GetInstance();

            taskSimpleScheduler.StartNewTask("同步汽车衡过衡数据", () =>
            {
                weightBridger_DAO.SyncTransport(this.rTxtOutputer.Output);
            }, 30000, OutputError);
        }
Example #23
0
 /// <summary>
 /// 执行所有任务
 /// </summary>
 void ExecuteAllTask()
 {
     #region
     EquPLCDAO equPLCDAO = new EquPLCDAO();
     taskSimpleScheduler.StartNewTask("气动传输-快速同步", () =>
     {
         equPLCDAO.StartTask(this.rTxtOutputer.Output);
     }, 0, OutputError);
     #endregion
 }
Example #24
0
 /// <summary>
 /// 执行所有任务
 /// </summary>
 void ExecuteAllTask()
 {
     taskSimpleScheduler.StartNewTask("皮带秤", () =>
     {
         foreach (IBeltWeightGraber graber in Grabers)
         {
             graber.SocketMethod.StartListening(graber.Milliseconds * 1000, graber.DelDays);
         }
     }, 0, OutputError);
 }
Example #25
0
 /// <summary>
 /// 执行所有任务
 /// </summary>
 void ExecuteAllTask()
 {
     taskSimpleScheduler.StartNewTask("煤场测温仪", () =>
     {
         InitPerformer();
         foreach (ITemperGraber graber in Grabers)
         {
             graber.ComMethod.SyncTemp(this.rTxtOutputer.Output, graber.Milliseconds);
         }
     }, 0, OutputError);
 }
Example #26
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            DataHandlerDAO dataHandlerDAO = DataHandlerDAO.GetInstance();
            string         outNetWebApi   = commonDAO.GetAppletConfigString(CommonAppConfig.GetInstance().AppIdentifier, "外网Api请求地址");

            taskSimpleScheduler.StartNewTask("同步外网矿发运输记录信息", () =>
            {
                dataHandlerDAO.SyncOutNetTransport(this.rTxtOutputer.Output, outNetWebApi);
            }, 10000, OutputError);

            taskSimpleScheduler.StartNewTask("同步更新外网矿发运输记录节点状态", () =>
            {
                dataHandlerDAO.SyncUpdateTransportStepName(this.rTxtOutputer.Output, outNetWebApi);
            }, 2000, OutputError);

            taskSimpleScheduler.StartNewTask("同步运输记录到批次明细", () =>
            {
                dataHandlerDAO.SyncToBatch(this.rTxtOutputer.Output);
            }, 2000, OutputError);
        }
Example #27
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            //停留位置判断:设置的停留多长时间就多长时间循环一次查询,然后比较那个车的最近两个点是不是在同一个地点,如果是的话记录下来,然后如果在途的车都在那个点停留的车数是不是超过设定值

            CarStopTimeDAO carStopTimeDAO = CarStopTimeDAO.GetInstance();

            taskSimpleScheduler.StartNewTask("获取设定值", () =>
            {
                if (isExeFinish)
                {
                    isExeFinish = false;
                    var entity  = carStopTimeDAO.GetSettingTime(this.rTxtOutputer.Output);
                    if (this.warning == null)
                    {
                        this.warning = entity;
                    }
                    else if (warning.StopNumber != entity.StopNumber || warning.StopTime != entity.StopTime)
                    {
                        this.warning = entity;
                    }
                    isExeFinish = true;
                }
            }, 10 * 1000, OutputError);

            while (true)
            {
                if (warning != null)
                {
                    taskSimpleScheduler.StartNewTask("车辆异常停留位置监测", () =>
                    {
                        if (isExeFinish && warning != null)
                        {
                            isExeFinish = false;
                            carStopTimeDAO.SaveToCarStopTime(this.rTxtOutputer.Output, warning);
                            isExeFinish = true;
                        }
                    }, (int)(warning.StopTime * 60 * 1000), OutputError);
                    break;
                }
            }
        }
Example #28
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            DataHandlerDAO dataHandlerDAO = DataHandlerDAO.GetInstance();

            taskSimpleScheduler.StartNewTask("同步批次明细", () =>
            {
                dataHandlerDAO.SyncToBatch(this.rTxtOutputer.Output);
            }, 60000, OutputError);

            taskSimpleScheduler.StartNewTask("同步集控信号", () =>
            {
                dataHandlerDAO.SyncHomePageSignalData(this.rTxtOutputer.Output);
            }, 60000, OutputError);

            AccessDapperDber doorDapperDber = new AccessDapperDber("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info =true;Data Source=\\\\10.36.0.71\\ZKAccess3.5\\ZKAccess.mdb;");

            taskSimpleScheduler.StartNewTask("同步门禁数据", () =>
            {
                //dataHandlerDAO.SyncDoorData(this.rTxtOutputer.Output, doorDapperDber);
            }, 60000, OutputError);
        }
Example #29
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            DataHandlerDAO      dataHandlerDAO = DataHandlerDAO.GetInstance();
            SqlServerDapperDber qgcDapperDber  = new SqlServerDapperDber(commonDAO.GetCommonAppletConfigString("全过程接口连接字符串"));

            taskSimpleScheduler.StartNewTask("同步全过程基础信息", () =>
            {
                dataHandlerDAO.SyncBaseInfoForCHLGL(this.rTxtOutputer.Output, qgcDapperDber);
                //dataHandlerDAO.SyncBaseInfoForDYJH(this.rTxtOutputer.Output, qgcDapperDber);
                dataHandlerDAO.SyncBaseInfoForGYS(this.rTxtOutputer.Output, qgcDapperDber);
                //dataHandlerDAO.SyncBaseInfoForCHYSH(this.rTxtOutputer.Output, qgcDapperDber);
                dataHandlerDAO.SyncBaseInfoForKB(this.rTxtOutputer.Output, qgcDapperDber);
                dataHandlerDAO.SyncBaseInfoForMZ(this.rTxtOutputer.Output, qgcDapperDber);
                dataHandlerDAO.SyncBaseInfoForDYJHK(this.rTxtOutputer.Output, qgcDapperDber);
                dataHandlerDAO.SyncBaseInfoForYAPFK(this.rTxtOutputer.Output, qgcDapperDber);
                dataHandlerDAO.SyncBaseInfoForQCLMYGP(this.rTxtOutputer.Output, qgcDapperDber);
                dataHandlerDAO.SyncBaseInfoForWZJHCL(this.rTxtOutputer.Output, qgcDapperDber);
                dataHandlerDAO.SyncBaseInfoForJLMZ(this.rTxtOutputer.Output, qgcDapperDber);
                dataHandlerDAO.SyncBaseInfoForJLPZ(this.rTxtOutputer.Output, qgcDapperDber);
                dataHandlerDAO.SyncBaseInfoForcCLGLLSPZ(this.rTxtOutputer.Output, qgcDapperDber);
            }, 10000, OutputError);

            taskSimpleScheduler.StartNewTask("处理集控首页数据", () =>
            {
                dataHandlerDAO.HandleHomePageData(this.rTxtOutputer.Output);
            }, 10000, OutputError);

            //初始化Api
            string ip     = commonDAO.GetCommonAppletConfigString("海康平台地址");
            int    port   = commonDAO.GetCommonAppletConfigInt32("海康协议端口号");
            string Appkey = commonDAO.GetCommonAppletConfigString("海康Appkey");
            string Secret = commonDAO.GetCommonAppletConfigString("海康Secret");

            HttpUtillib.SetPlatformInfo(Appkey, Secret, ip, port, false);

            taskSimpleScheduler.StartNewTask("同步门禁数据", () =>
            {
                dataHandlerDAO.SyncDoorEventData(this.rTxtOutputer.Output);
            }, 60000, OutputError);
        }
Example #30
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            EquAssayDeviceDAO assayDevice_DAO = EquAssayDeviceDAO.GetInstance();

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

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

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

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

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

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