/// <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 }
/// <summary> /// 执行所有任务 /// </summary> void ExecuteAllTask() { #region #1全自动制样机 EquAutoMakerDAO autoMakerDAO1 = new EquAutoMakerDAO(GlobalVars.MachineCode_QZDZYJ_1, new DapperDber.Dbs.SqlServerDb.SqlServerDapperDber(CommonDAO.GetInstance().GetCommonAppletConfigString("#1全自动制样机接口连接字符串"))); taskSimpleScheduler.StartNewTask("#1全自动制样机-快速同步", () => { //autoMakerDAO1.SyncPlan(this.rTxtOutputer.Output); //autoMakerDAO1.SyncCmd(this.rTxtOutputer.Output); //autoMakerDAO1.SyncError(this.rTxtOutputer.Output); autoMakerDAO1.SyncState(this.rTxtOutputer.Output); //autoMakerDAO1.SyncMakeDetail(this.rTxtOutputer.Output); }, 2000, OutputError); //this.taskSimpleScheduler.StartNewTask("#1全自动制样机-同步上位机心跳", () => //{ // autoMakerDAO1.SyncHeartbeatSignal(); //}, 30000, OutputError); #endregion }
/// <summary> /// 执行所有任务 /// </summary> void ExecuteAllTask() { #region #1全自动制样机 EquAutoMakerDAO autoMakerDAO1 = new EquAutoMakerDAO(GlobalVars.MachineCode_QZDZYJ_1, new DapperDber.Dbs.SqlServerDb.SqlServerDapperDber(CommonDAO.GetInstance().GetCommonAppletConfigString("#1全自动制样机接口连接字符串"))); taskSimpleScheduler.StartNewTask("#1全自动制样机-快速同步", () => { autoMakerDAO1.SyncCmd(this.rTxtOutputer.Output); autoMakerDAO1.SyncError(this.rTxtOutputer.Output); autoMakerDAO1.SyncSignal(this.rTxtOutputer.Output); autoMakerDAO1.SyncMakeDetail(this.rTxtOutputer.Output); }, 2000, OutputError); taskSimpleScheduler.StartNewTask("#1全自动制样机-OPC同步", () => { EquAutoMakerOPC.GetInstance().SyncOPCTags(this.rTxtOutputer.Output); }, 0, OutputError); taskSimpleScheduler.StartNewTask("#1全自动制样机执行命令", () => { EquAutoMakerOPC.GetInstance().RunCmd(this.rTxtOutputer.Output); }, 500, OutputError); #endregion }