public void ImageChangeRun() { if (ImgTime != null) { ImgTime.TimeStrat(); } }
void MyLastSeatSumTime_TimeTo(object sender, EventArgs e) { MyLastSeatSumTime.TimeStop(); _LastSeatCount = TerminalOperatorService.LastSeatCount(ClientObject.ClientSetting.DeviceSetting.Rooms); OnPropertyChanged("LastSeat"); MyLastSeatSumTime.TimeStrat(); }
public void Start() { try { int loopTime = 0; if (!int.TryParse(loopInterval, out loopTime)) { WriteLog.Write("数据统计服务:运行间隔时间获取失败,请检查是否配置了‘StatisticsServiceInterval’项"); } if (!DateTime.TryParse(staticticsTime, out runTime)) { WriteLog.Write("数据统计服务:运行间隔时间获取失败,请检查是否配置了‘StatisticsServiceRunTime’项"); } enterOutLogStatictics = new Code.EnterOutLogStatistics(); roomFlowStatictics = new Code.RoomFlowStatistics(); roomUsageStatictics = new Code.RoomUsageStatistics(); terminalFlowStatistics = new Code.TerminalFlowStatistics(); terminalUsageStatictics = new Code.TerminalUsageStatistics(); advertUsageStatistics = new Code.AdvertUsageStatistics(); //时间循环启动 timeLoop = new TimeLoop(loopTime); timeLoop.TimeTo += new EventHandler(timeLoop_TimeTo); timeLoop.TimeStrat(); } catch (Exception ex) { WriteLog.Write(string.Format("数据统计服务:服务执行遇到错误:{0}", ex.Message)); } }
void MyCheckCodeTime_TimeTo(object sender, EventArgs e) { MyCheckCodeTime.TimeStop(); if (CodeChange != null) { CodeChange(); } MyCheckCodeTime.TimeStrat(); }
public void ImageChangePause() { if (ImgTime != null) { ImgTime.TimeStop(); } if (ImgTimeStop != null) { ImgTimeStop.TimeStop(); ImgTimeStop.TimeStrat(); } }
static void Main(string[] args) { int loopTime = 0; if (!int.TryParse(loopInterval, out loopTime)) { WriteLog.Write("运行间隔时间获取失败,请检查是否配置了‘CheckTimes’项"); } timeLoop = new TimeLoop(loopTime); timeLoop.TimeTo += new EventHandler(timeLoop_TimeTo); timeLoop.TimeStrat(); Console.WriteLine(CurrentTime + "监控服务程序启动"); Console.ReadLine(); }
public void Start() { int loopTime = 0; if (!int.TryParse(loopInterval, out loopTime)) { WriteLog.Write("读者信息同步:运行间隔时间获取失败,请检查是否配置了‘MonitorServiceInterval’项"); } monitorService = new Code.SeatDataOperation(); monitorService.ClearSeat(); timeLoop = new TimeLoop(loopTime); timeLoop.TimeTo += new EventHandler(timeLoop_TimeTo); timeLoop.TimeStrat(); }
static void Main(string[] args) { Display("解释程序启动"); int loopTime = 0; if (!int.TryParse(loopInterval, out loopTime)) { SeatManage.SeatManageComm.WriteLog.Write("运行间隔时间获取失败,请检查是否配置了‘CheckTimes’项"); Console.WriteLine("运行间隔时间获取失败,请检查是否配置了‘CheckTimes’项"); } timeLoop = new TimeLoop(loopTime); timeLoop.TimeTo += new EventHandler(timeLoop_TimeTo); timeLoop.TimeStrat(); Console.ReadLine(); }
TimeLoop timeLoop;//循环时间 /// <summary> /// 点击刷卡 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnGetNo_Copy_Click(object sender, RoutedEventArgs e) { if (IsWork) { return; } if (btnGetNo_Copy.Content.ToString() == "点击刷卡") //判断如果按钮文字如果是“点击刷卡”就开始读卡操作 { StartRead(); //读卡 StopRead(); //停止读卡 StartRead(); //读卡 timeLoop = new TimeLoop(1000); //初始化定时器,1000表示一秒 timeLoop.TimeTo += new EventHandler(timeLoop_TimeTo); //注册定时器触发的动作函数 timeLoop.TimeStrat(); //定时器开始工作 IsWork = true; //布尔值表示工作 } }
/// <summary> /// 时间达到监控处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void timeLoop_TimeTo(object sender, EventArgs e) { //停止计时 timeLoop.TimeStop(); try { //同步读者信息 readerSync.SysnceReaderInfo(ref readerInfoUpdated); } catch (Exception ex) { WriteLog.Write(string.Format("读者信息同步:服务执行遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } finally { //开始计时 timeLoop.TimeStrat(); } }
public void Start() { try { //监控服务启动 SeatServerWatch = new WatchOperate(); SeatServerWatch.ServiceStartOperate(); //标示读者库更新 ReaderInfoUpdated = false; //时间循环启动 timeLoop = new TimeLoop(15000); timeLoop.TimeTo += new EventHandler(timeLoop_TimeTo); timeLoop.TimeStrat(); } catch (Exception ex) { WriteLog.Write(string.Format("服务执行遇到错误:{0}", ex.Message)); } }
/// <summary> /// 执行图片切换 /// </summary> public void ImageChangeRun() { try { SchoolNotices = SystemObject.GetInstance().SchoolNote; PromotionAd = SystemObject.GetInstance().PromotionAdvert; UserGuide = SystemObject.GetInstance().UserGuide; noticeNum = 0; promotionNum = 0; guideNum = 0; if (UserGuide != null && UserGuide.ImageFilePath.Count > 0) { NowShowImage = new System.Windows.Media.Imaging.BitmapImage(new Uri(Apppath + "UserGuide\\" + UserGuide.ImageFilePath[guideNum], UriKind.RelativeOrAbsolute)); NowTap = AdType.None; } if (PromotionAd.Count > 0) { NowShowImage = new System.Windows.Media.Imaging.BitmapImage(new Uri(Apppath + "PromotionImage\\" + PromotionAd[promotionNum].AdImagePath, UriKind.RelativeOrAbsolute)); NowTap = AdType.PromotionAd; } if (SchoolNotices.Count > 0) { NowShowImage = new System.Windows.Media.Imaging.BitmapImage(new Uri(Apppath + "NoteImage\\" + SchoolNotices[noticeNum].NoteImagePath, UriKind.RelativeOrAbsolute)); NowTap = AdType.SchoolNotice; } BtnVisible(); if (ImageSwitch != null) { ImageSwitch(this, new EventArgs()); } ImgTime = new TimeLoop(10 * 1000); ImgTime.TimeTo += ImgTime_TimeTo; ImgTimeStop = new TimeLoop(10 * 1000); ImgTimeStop.TimeTo += ImgTimeStop_TimeTo; ImgTime.TimeStrat(); } catch (Exception ex) { WriteLog.Write("消息滚动启动失败:" + ex.Message); } }
private SystemObject() { //设置定时器,间隔10s执行一次阅览室设置更新 timeloop = new TimeLoop(20000); timeloop.TimeTo += timeloop_TimeTo; try { _RegulationRulesSet = GetRegulationRulesSetting(); _clientSetting = GetClientSet(); if (_clientSetting == null) { return; } _BackgroundImagesResource = GetBitmapImageResource(_clientSetting.DeviceSetting); timeloop.TimeStrat(); } catch { throw; } }
public void Start() { try { int loopTime = 0; if (!int.TryParse(loopInterval, out loopTime)) { WriteLog.Write("读者信息同步:运行间隔时间获取失败,请检查是否配置了‘ReaderSyncServiceInterval’项"); } //监控服务启动 readerSync = new Code.ReaderSync(); //标示读者库更新 readerInfoUpdated = false; //时间循环启动 timeLoop = new TimeLoop(loopTime); timeLoop.TimeTo += new EventHandler(timeLoop_TimeTo); timeLoop.TimeStrat(); } catch (Exception ex) { WriteLog.Write(string.Format("读者信息同步:服务执行遇到错误:{0}", ex.Message)); } }
/// <summary> /// 时间达到监控处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void timeLoop_TimeTo(object sender, EventArgs e) { //停止计时 timeLoop.TimeStop(); try { try { //重新获取阅览室设置 SeatServerWatch.GetSetting(); } catch (Exception ex) { WriteLog.Write(string.Format("获取阅览室设置遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //开闭馆处理 SeatServerWatch.OpenCloseReadingRoom(); } catch (Exception ex) { WriteLog.Write(string.Format("开闭馆处理遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //超时处理(在座超时,预约超时,暂离超时,等待成功,违规记录过期) SeatServerWatch.OverTimeOperate(); } catch (Exception ex) { WriteLog.Write(string.Format("处理超时记录遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //异常锁定处理 SeatServerWatch.LockOverTime(); } catch (Exception ex) { WriteLog.Write(string.Format("解锁锁定座位遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //黑名单到时处理 SeatServerWatch.BlacklistOverTime(); } catch (Exception ex) { WriteLog.Write(string.Format("处理黑名单遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //违规记录超时处理 SeatServerWatch.ViolationRecordsOverTime(); } catch (Exception ex) { WriteLog.Write(string.Format("处理违规记录遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //删除过期媒体文件 //SeatServerWatch.MediaOverDate(); SeatServerWatch.AdvertOverTime(); } catch (Exception ex) { WriteLog.Write(string.Format("处理过期的媒体文件遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //读者库同步 SeatServerWatch.SysnceReaderInfo(ref ReaderInfoUpdated); } catch (Exception ex) { WriteLog.Write(string.Format("同步读者信息遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //进出记录统计 SeatServerWatch.EnterOutStatistics(ref EnterOutLogStatistic); } catch (Exception ex) { WriteLog.Write(string.Format("统计进出记录遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //删除一个月前的日志文件 WriteLog.DeleteLog(DateTime.Now.AddMonths(-1)); } catch (Exception ex) { WriteLog.Write(string.Format("删除过期日志文件遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } } catch (Exception ex) { WriteLog.Write(string.Format("服务执行遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } finally { //开始计时 timeLoop.TimeStrat(); } }
public void CheckCodeRun() { MyCheckCodeTime = new TimeLoop(10 * 1000); MyCheckCodeTime.TimeTo += MyCheckCodeTime_TimeTo; MyCheckCodeTime.TimeStrat(); }
/// <summary> /// 图片停止切换 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ImgTimeStop_TimeTo(object sender, EventArgs e) { ImgTimeStop.TimeStop(); ImgTime.TimeStrat(); }
public void ImageChangeStop() { ImgTime.TimeStop(); ImgTimeStop.TimeStop(); ImgTimeStop.TimeStrat(); }
/// <summary> /// 开始自动更新 /// </summary> public void StartAutoUpdateConfig() { timeloop.TimeStrat(); }
/// <summary> /// 时间达到监控处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void timeLoop_TimeTo(object sender, EventArgs e) { //停止计时 timeLoop.TimeStop(); try { try { //统计进出记录 enterOutLogStatictics.Run(ref enterOutLogIsStatictics, runTime); } catch (Exception ex) { WriteLog.Write(string.Format("数据统计服务:删除过期广告遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //删除过期的广告 advertUsageStatistics.AdvertOverTime(); } catch (Exception ex) { WriteLog.Write(string.Format("数据统计服务:删除过期广告遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //阅览室人次统计 roomFlowStatictics.Run(ref roomFlowIsStatictics, runTime); } catch (Exception ex) { WriteLog.Write(string.Format("数据统计服务:统计阅览室人流量遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //阅览室使用情况统计 roomUsageStatictics.Run(ref roomUsageIsStatictics, runTime); } catch (Exception ex) { WriteLog.Write(string.Format("数据统计服务:统计阅览室使用情况遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //终端人次统计 terminalFlowStatistics.Run(ref terminalFlowIsStatistics, runTime); } catch (Exception ex) { WriteLog.Write(string.Format("数据统计服务:统计设备人流量遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //终端使用情况统计 terminalUsageStatictics.Run(ref terminalUsageIsStatictics, runTime); } catch (Exception ex) { WriteLog.Write(string.Format("数据统计服务:统计设备使用情况遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } } catch (Exception ex) { WriteLog.Write(string.Format("数据统计服务:服务执行遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } finally { //开始计时 timeLoop.TimeStrat(); } }
/// <summary> /// 时间达到监控处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void timeLoop_TimeTo(object sender, EventArgs e) { //停止计时 timeLoop.TimeStop(); try { try { //重新获取阅览室设置 monitorService.GetSetting(); } catch (Exception ex) { WriteLog.Write(string.Format("监控服务:获取阅览室设置遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //开闭馆处理 monitorService.OpenCloseReadingRoom(); } catch (Exception ex) { WriteLog.Write(string.Format("监控服务:开闭馆处理遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //超时处理(在座超时,预约超时,暂离超时,等待成功,违规记录过期) monitorService.EnterOutLogOperate(); } catch (Exception ex) { WriteLog.Write(string.Format("监控服务:处理超时记录遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //处理预约记录 monitorService.BeapeakLogOperating(); } catch (Exception ex) { WriteLog.Write(string.Format("监控服务:处理预约超时遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //异常锁定处理 monitorService.LockOverTime(); } catch (Exception ex) { WriteLog.Write(string.Format("监控服务:解锁锁定座位遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //黑名单到时处理 monitorService.BlacklistOperating(); } catch (Exception ex) { WriteLog.Write(string.Format("监控服务:处理黑名单遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } try { //违规记录超时处理 monitorService.ViolationRecordsOperating(); } catch (Exception ex) { WriteLog.Write(string.Format("监控服务:处理违规记录遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } } catch (Exception ex) { WriteLog.Write(string.Format("监控服务:服务执行遇到错误,异常来自:{0},错误信息:{1}", ex.Source, ex.Message)); } finally { //开始计时 timeLoop.TimeStrat(); } }