Parcourir la source

DB 변경 테스트 완료

DESKTOP-Kang il y a 6 ans
Parent
commit
f728439609

+ 1 - 0
Dev/OHV/OHV.Common/OHV.Common.csproj

@@ -110,6 +110,7 @@
     <Compile Include="Model\SubCmd.cs" />
     <Compile Include="Model\VehicleInfo.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Shareds\ConstInt.cs" />
     <Compile Include="Shareds\ConstString.cs" />
     <Compile Include="Shareds\SharedEnumType.cs" />
     <Compile Include="Shareds\RegionNames.cs" />

+ 14 - 0
Dev/OHV/OHV.Common/Shareds/ConstInt.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OHV.Common.Shareds
+{
+    public class ConstInt
+    {
+        public const int EXECUTE_ERROR = -1;
+        public const int EXECUTE_SUCCESS = 0;
+    }
+}

+ 2 - 2
Dev/OHV/OHV.Module.ListViews/Views/CommandListViewModel.cs

@@ -90,12 +90,12 @@ namespace OHV.Module.ListViews.Views
 
         private void ExecuteDeleteCommand()
         {
-            List<Command> deleteList = new List<Command>();
+            List<string> deleteList = new List<string>();
             foreach (var item in this.CommandList)
             {
                 if (item.IsSelected)
                 {
-                    deleteList.Add(item);
+                    deleteList.Add(item.CommandID);
                 }
             }
 

+ 2 - 2
Dev/OHV/OHV.Module.ListViews/Views/SubCommandListViewModel.cs

@@ -107,12 +107,12 @@ namespace OHV.Module.ListViews.Views
 
         private void ExecuteDeleteCommand()
         {
-            List<SubCmd> deleteList = new List<SubCmd>();
+            List<string> deleteList = new List<string>();
             foreach (var item in this.SubCmdList)
             {
                 if (item.IsSelected)
                 {
-                    deleteList.Add(item);
+                    deleteList.Add(item.ID);
                 }
             }
             deleteList.ForEach(x => { this.sql.SubCmdDAL.Delete(x); });

+ 12 - 12
Dev/OHV/OHV.Module.MainViews/Views/HistoryViewModel.cs

@@ -28,7 +28,7 @@ namespace OHV.Module.MainViews.Views
         public HistoryViewModel( SqliteManager _sql )
         {
             this.sql = _sql;
-            this.AlarmResetCommand = new DelegateCommand( ExecuteAlarmResetCommand );
+            //this.AlarmResetCommand = new DelegateCommand( ExecuteAlarmResetCommand );
 
             var ll = sql.HisAlarmDAL.GetAll();
             if ( ll == null )
@@ -36,13 +36,13 @@ namespace OHV.Module.MainViews.Views
             else
                 this.AlarmList = ll.OrderByDescending( x => x.OccurTime ).ToList();
 
-            //this.sql.HisAlarmDAL.ChangedProperty += HisAlarmDAL_ChangedProperty;
+            this.sql.HisAlarmDAL.OnChangeTable += HisAlarmDAL_ChangedProperty;
         }
 
         private void HisAlarmDAL_ChangedProperty()
         {
             //TODO: AlarmList Null Exception 발생함.
-           if ( this.AlarmList.Count <= 0 )
+           if ( this.AlarmList == null )
                 return;
 
             this.AlarmList.Clear();
@@ -51,17 +51,17 @@ namespace OHV.Module.MainViews.Views
             this.AlarmList = sql.HisAlarmDAL.GetAll().OrderByDescending( x => x.OccurTime ).ToList();
         }
 
-        async private void ExecuteAlarmResetCommand( )
-        {
-            //Grid Refresh 대안 찾을것
-            //var backupList = this.AlarmList.ToList();
-            //this.AlarmList.Clear();
+        //async private void ExecuteAlarmResetCommand( )
+        //{
+        //    //Grid Refresh 대안 찾을것
+        //    //var backupList = this.AlarmList.ToList();
+        //    //this.AlarmList.Clear();
 
-            //await Task.Delay( 1000 );
+        //    //await Task.Delay( 1000 );
 
-            //var e = new ObservableCollection<Alarm>( backupList );
-            //this.AlarmList = e;
-        }
+        //    //var e = new ObservableCollection<Alarm>( backupList );
+        //    //this.AlarmList = e;
+        //}
 
         public void Init( ) 
         {

+ 54 - 47
Dev/OHV/OHV.SqliteDAL/DAL/AbstractDAL.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Data.Entity;
+using System.Data.Entity.Core.Objects;
 using System.Linq;
 using System.Linq.Expressions;
 using System.Text;
@@ -11,10 +12,10 @@ namespace OHV.SqliteDAL.DAL
 {
     public interface IRepository<TEntity> where TEntity : class
     {
-        void Create(TEntity entity);
-        void Delete(TEntity entity);
-        void Delete(Guid id);
-        void Edit(TEntity entity);
+        void Create( TEntity entity );
+        void Delete( TEntity entity );
+        void Delete( Guid id );
+        void Edit( TEntity entity );
     }
 
     public class GenericDAL<T> where T : class
@@ -24,7 +25,7 @@ namespace OHV.SqliteDAL.DAL
 
         protected virtual void OnChangedProperty()
         {
-            ChangedProperty?.BeginInvoke(null, null);
+            ChangedProperty?.BeginInvoke( null, null );
         }
 
         public List<T> All
@@ -32,7 +33,7 @@ namespace OHV.SqliteDAL.DAL
             get
             {
                 List<T> ll = new List<T>();
-                using (var db = new OHVDbContext("OHVDb"))
+                using ( var db = new OHVDbContext( "OHVDb" ) )
                 {
                     ll = db.Set<T>().ToList();
                 }
@@ -44,7 +45,7 @@ namespace OHV.SqliteDAL.DAL
         {
             get
             {
-                using (var db = new OHVDbContext("OHVDb"))
+                using ( var db = new OHVDbContext( "OHVDb" ) )
                 {
                     return db.Set<T>().Count();
                 }
@@ -52,63 +53,63 @@ namespace OHV.SqliteDAL.DAL
 
         }
 
-        public T GetK(object key)
+        public T GetK( object key )
         {
-            using (var db = new OHVDbContext("OHVDb"))
+            using ( var db = new OHVDbContext( "OHVDb" ) )
             {
-                return db.Set<T>().Find(key);
+                return db.Set<T>().Find( key );
             }
         }
 
-        public List<T> ListN(Expression<Func<T, bool>> where)
+        public List<T> ListN( Expression<Func<T, bool>> where )
         {
-            using (var db = new OHVDbContext("OHVDb"))
+            using ( var db = new OHVDbContext( "OHVDb" ) )
             {
-                return db.Set<T>().Where(where).ToList();
+                return db.Set<T>().Where( where ).ToList();
             }
         }
 
-        public virtual bool HasK(object key)
+        public virtual bool HasK( object key )
         {
-            return GetK(key) == null ? false: true ;
+            return GetK( key ) == null ? false : true;
         }
 
-        public virtual bool HasN(Expression<Func<T, bool>> where)
+        public virtual bool HasN( Expression<Func<T, bool>> where )
         {
             List<T> ll = new List<T>();
-            using (var db = new OHVDbContext("OHVDb"))
+            using ( var db = new OHVDbContext( "OHVDb" ) )
             {
-                ll = db.Set<T>().Where(where).ToList();
+                ll = db.Set<T>().Where( where ).ToList();
             }
             return ll.Count > 0;
         }
 
-        public void Add(T entity)
+        public void Add( T entity )
         {
-            using (var db = new OHVDbContext("OHVDb"))
+            using ( var db = new OHVDbContext( "OHVDb" ) )
             {
-                db.Set<T>().Add(entity);
+                db.Set<T>().Add( entity );
                 db.SaveChanges();
             }
             OnChangedProperty();
         }
 
-        public void Delete(T entity)
+        public void Delete( T entity )
         {
-            using (var db = new OHVDbContext("OHVDb"))
+            using ( var db = new OHVDbContext( "OHVDb" ) )
             {
-                db.Entry(entity).State = EntityState.Deleted;
+                db.Entry( entity ).State = EntityState.Deleted;
                 //db.Set<T>().Remove(entity);
                 db.SaveChanges();
             }
             OnChangedProperty();
         }
 
-        public virtual void Update(T entity)
+        public virtual void Update( T entity )
         {
-            using (var db = new OHVDbContext("OHVDb"))
+            using ( var db = new OHVDbContext( "OHVDb" ) )
             {
-                db.Entry(entity).State = EntityState.Modified;
+                db.Entry( entity ).State = EntityState.Modified;
                 db.SaveChanges();
             }
             OnChangedProperty();
@@ -116,9 +117,9 @@ namespace OHV.SqliteDAL.DAL
 
         public void Clean()
         {
-            using (var db = new OHVDbContext("OHVDb"))
+            using ( var db = new OHVDbContext( "OHVDb" ) )
             {
-                db.Set<T>().RemoveRange(db.Set<T>());
+                db.Set<T>().RemoveRange( db.Set<T>() );
                 db.SaveChanges();
             }
             OnChangedProperty();
@@ -134,6 +135,8 @@ namespace OHV.SqliteDAL.DAL
 
         public event Action OnChangeTable;
 
+        object lockObj = new object();
+
         public int Count { get => GetAll().Count(); }
 
         public GenericRepository()
@@ -142,7 +145,7 @@ namespace OHV.SqliteDAL.DAL
             this.table = this._context.Set<T>();
         }
 
-        public GenericRepository(OHVDbContext dbContext )
+        public GenericRepository( OHVDbContext dbContext )
         {
             this._context = dbContext;
             this.table = _context.Set<T>();
@@ -151,6 +154,7 @@ namespace OHV.SqliteDAL.DAL
         public IEnumerable<T> GetAll()
         {
             return table.ToList();
+
         }
 
         public virtual IEnumerable<T> Get( Expression<Func<T, bool>> filter = null, Func<IQueryable<T>, IOrderedQueryable<T>> orderBy = null, string includeProperties = "" )
@@ -172,25 +176,25 @@ namespace OHV.SqliteDAL.DAL
                 return query.ToList();
         }
 
-        public T GetById(object id)
+        public T GetById( object id )
         {
-            return table.Find(id);
+            return table.Find( id );
         }
-        public void Insert(T obj)
+        public void Insert( T obj )
         {
-            table.Add(obj);
+            table.Add( obj );
             this.Save();
         }
-        public void Update(T obj)
+        public void Update( T obj )
         {
-            table.Attach(obj);
-            _context.Entry(obj).State = EntityState.Modified;
+            table.Attach( obj );
+            _context.Entry( obj ).State = EntityState.Modified;
             this.Save();
         }
-        public void Delete(object id)
+        public void Delete( object id )
         {
-            T existing = table.Find(id);
-            table.Remove(existing);
+            T existing = table.Find( id );
+            table.Remove( existing );
             this.Save();
         }
         public void Delete( Expression<Func<T, bool>> filter )
@@ -205,13 +209,16 @@ namespace OHV.SqliteDAL.DAL
 
         public void Clean()
         {
-            table.RemoveRange( table);
+            table.RemoveRange( table );
             this.Save();
         }
         public void Save()
         {
-            _context.SaveChanges();
-            this.OnChangeTable?.BeginInvoke(null, null);
+            lock ( this.lockObj )
+            {
+                _context.SaveChanges();
+                this.OnChangeTable?.BeginInvoke( null, null );
+            }
         }
     }
 
@@ -221,10 +228,10 @@ namespace OHV.SqliteDAL.DAL
         int Count { get; }
         IEnumerable<T> GetAll();
         IEnumerable<T> Get( Expression<Func<T, bool>> filter = null, Func<IQueryable<T>, IOrderedQueryable<T>> orderBy = null, string includeProperties = "" );
-        T GetById(object id);
-        void Insert(T obj);
-        void Update(T obj);
-        void Delete(object id);
+        T GetById( object id );
+        void Insert( T obj );
+        void Update( T obj );
+        void Delete( object id );
         void Delete( Expression<Func<T, bool>> filter = null );
         void Clean();
         void Save();

+ 5 - 2
Dev/OHV/OHV.SqliteDAL/OHVDbInitializer.cs

@@ -217,8 +217,11 @@ namespace OHV.SqliteDAL
                 new Alarm { AlarmId = 34, Kind = eAlarmKind.Drive, Name = "PIO", Text="Battery Charge PIO Not Ready On",Solution="", Description="", Level = eAlarmLevel.Falut, },
                 new Alarm { AlarmId = 35, Kind = eAlarmKind.Drive, Name = "PIO", Text="Battery Charge PIO Not SEND_RUN On TimeOver",Solution="", Description="", Level = eAlarmLevel.Falut, },
                 new Alarm { AlarmId = 36, Kind = eAlarmKind.Drive, Name = "PIO", Text="Battery Charge PIO Not SEND_COMPLETE On TimeOver",Solution="", Description="", Level = eAlarmLevel.Falut, },
-                new Alarm { AlarmId = 37, Kind = eAlarmKind.Drive, Name = "PIO", Text="Steering State Abnormal",Solution="", Description="", Level = eAlarmLevel.Falut, },
-                new Alarm { AlarmId = 38, Kind = eAlarmKind.Drive, Name = "PIO", Text="Steering State Abnormal",Solution="", Description="", Level = eAlarmLevel.Falut, },
+                new Alarm { AlarmId = 37, Kind = eAlarmKind.Drive, Name = "Move", Text="Drive Move Start Time Over",Solution="", Description="", Level = eAlarmLevel.Falut, },
+                new Alarm { AlarmId = 38, Kind = eAlarmKind.Drive, Name = "Move", Text="Drive Command Not Response",Solution="", Description="", Level = eAlarmLevel.Falut, },
+                new Alarm { AlarmId = 39, Kind = eAlarmKind.Drive, Name = "Move", Text="Drive Still Running, Over 1 Hour",Solution="", Description="", Level = eAlarmLevel.Falut, },
+                new Alarm { AlarmId = 40, Kind = eAlarmKind.Drive, Name = "Move", Text="Main Command not Exist Motion Stop",Solution="", Description="", Level = eAlarmLevel.Falut, },
+                new Alarm { AlarmId = 41, Kind = eAlarmKind.Drive, Name = "Move", Text="Main Command not Exist Motion command",Solution="", Description="", Level = eAlarmLevel.Falut, },
             } );
 
             //context.Set<HisAlarm>().Add(new HisAlarm { AlarmId = 1, OccurTime = DateTime.Now.AddDays(-10) });

+ 19 - 3
Dev/OHV/VehicleControlSystem/ControlLayer/MQ/ZmqManager.cs

@@ -12,6 +12,7 @@ using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
 using System.Text;
 using System.Threading.Tasks;
 using VehicleControlSystem.ControlLayer.Serial.BatteryTabos;
@@ -171,7 +172,12 @@ namespace VehicleControlSystem.ControlLayer.MQ
 
             req = new RequestSocket();
             this.monitor = new NetMQMonitor( req, "inproc://rep.inproc", SocketEvents.Disconnected | SocketEvents.Connected );
-            this.monitor.Connected += ( s, a ) => { this.IsReqConnected = true; CurrentPointNo = GetCurrentPointNo(); };
+            this.monitor.Connected += ( s, a ) => 
+            { 
+                this.IsReqConnected = true; 
+                CurrentPointNo = GetCurrentPointNo();
+                SetCurrentSteeringState( this.vehicle.GetESteeringState() );
+            };
             this.monitor.Disconnected += ( s, a ) => { this.IsReqConnected = false; };
             this.monitor.StartAsync();
 
@@ -587,15 +593,25 @@ namespace VehicleControlSystem.ControlLayer.MQ
         #endregion
 
         #region Set Request Method
-        internal void SetStartMove()
+        internal int SetStartMove()
         {
             if ( !SetRequest( "3031", "2" ) )
+            {
                 logger.E( $"[Set Start Move] - Response Time Out" );
+                return 38;
+            }
+
+            return ConstInt.EXECUTE_SUCCESS;
         }
-        internal void SetTargetPoint( string point )
+        internal int SetTargetPoint( string point )
         {
             if ( !SetRequest( "3033", point ) )
+            {
                 logger.E( $"[Set TargetPoint] - Response Time Out" );
+                return 38;
+            }
+
+            return ConstInt.EXECUTE_SUCCESS;
         }
 
         internal void SetObstruction( eObstacleState state )

+ 11 - 5
Dev/OHV/VehicleControlSystem/ControlLayer/Motion/GSIDrive.cs

@@ -227,13 +227,19 @@ namespace VehicleControlSystem.ControlLayer.Drive
                 return 34;
 
             //ToDo: 이동 명령 실행.
-            int result = 0;
+            int result = ConstInt.EXECUTE_SUCCESS;
 
             zmq.SetCurrentSteeringState( steering.GetSteeringState() );
             LockUtils.Wait( 100 );
-            zmq.SetTargetPoint( point );
+            result = zmq.SetTargetPoint( point );
+            if ( result != ConstInt.EXECUTE_SUCCESS )
+                return result;
+
             LockUtils.Wait( 100 );
-            zmq.SetStartMove();
+
+            result = zmq.SetStartMove();
+            if ( result != ConstInt.EXECUTE_SUCCESS )
+                return result;
 
             int waitTime = 10000;
             long st = SwUtils.CurrentTimeMillis;
@@ -244,14 +250,14 @@ namespace VehicleControlSystem.ControlLayer.Drive
                 if ( SwUtils.Gt( st, waitTime ) )
                 {
                     logger.D( "MoveToPoint Time Out" );
-                    return -1;
+                    return 37;
                 }
 
                 if ( zmq.IsDriveMoving )
                     break;
             }
 
-            return 0;
+            return ConstInt.EXECUTE_SUCCESS;
         }
 
         /// <summary>

+ 26 - 32
Dev/OHV/VehicleControlSystem/ControlLayer/Vehicle.cs

@@ -841,7 +841,7 @@ namespace VehicleControlSystem.ControlLayer
                     {
                         if ( subCmd.CmdType == SubCmd.eCmdType.Auto ) //자동 명령중 Main Command 가 없으면 삭제.
                         {
-                            sql.SubCmdDAL.Delete( subCmd );
+                            sql.SubCmdDAL.Delete( subCmd.ID );
                             logger.I( $"SubCmd Deleted - ID={subCmd.ID}, CommandID={subCmd.CmdID}" );
                         }
                     }
@@ -871,16 +871,12 @@ namespace VehicleControlSystem.ControlLayer
                             break;
                     }
                 }
-                catch ( ThreadInterruptedException threadInterruptedException )
-                {
-                }
                 catch ( Exception exception )
                 {
                     logger.E( exception );
                 }
                 finally
                 {
-                    //sql.SubCmdDAL.Clean();
                     LockUtils.Wait( 500 );
                 }
             }
@@ -915,25 +911,25 @@ namespace VehicleControlSystem.ControlLayer
                 }
             }
 
-            if ( this.MoveTo( sub.TargetID ) )
+            result = this.MoveTo( sub.TargetID );
+            if ( result != ConstInt.EXECUTE_SUCCESS )
             {
+                OccurVehicleAlarm( result );
             }
 
+            this.taskMoveCancel.Cancel();
+            this.taskMoveCancel.WaitAll();
+
             sql.SubCmdDAL.Clean();
         }
 
-        bool MoveTo( string pointID )
+        int MoveTo( string pointID )
         {
-            //this.BuzzerOnOff( true, eBuzzerKind.StartWarn );
-            ////TimerUtils.Once(3000, BuzzerOnOff, false, eBuzzerKind.StartWarn );
-            //Thread.Sleep( 3000 );
-            //this.BuzzerOnOff( false );
-
             if ( this.VehicleStateProperty == eVehicleState.Idle )
             {
                 this.OnMoveReady?.Invoke();
 
-                var moveReadyBuzzerTime = CastTo<int>.From<string>( sql.ConfigDal.GetById( ConstString.BuzzerStartReadyTime ).Value );
+                var moveReadyBuzzerTime = Convert.ToInt32( sql.ConfigDal.GetById( ConstString.BuzzerStartReadyTime ).Value );
                 Thread.Sleep( moveReadyBuzzerTime );
 
                 this.VehicleStateProperty = eVehicleState.Move;
@@ -944,19 +940,17 @@ namespace VehicleControlSystem.ControlLayer
             //이전에 있던 작업들 종료 및 삭제
             this.taskMoveCancel.Cancel();
             this.taskMoveCancel.WaitAll();
-
             this.taskMoveCancel.Add( CheckCrossPoint() );
 
-            //PhysicalCheckupLogger.Instance.SetPLCStartDrive();
             this.VehicleStateProperty = eVehicleState.Move;
-            //this.BuzzerOnOff(true, eBuzzerKind.Moving);
-            this.refObjects.Drive.MoveToPoint( pointID, 100 );
 
-            bool result = Wait4MoveDone();
-            //this.BuzzerOnOff(false);
+            int result = this.refObjects.Drive.MoveToPoint( pointID, 100 );
+            if ( result != ConstInt.EXECUTE_SUCCESS )
+                return result;
 
-            this.taskMoveCancel.Cancel();
-            this.taskMoveCancel.WaitAll();
+            result = this.Wait4MoveDone();
+            if ( result != ConstInt.EXECUTE_SUCCESS )
+                return result;
 
             //Drive 에서 정지 확인 후 상태 변경
             if ( this.refObjects.Drive.IsDriveStop() )
@@ -970,9 +964,9 @@ namespace VehicleControlSystem.ControlLayer
             return result;
         }
 
-        bool Wait4MoveDone()
+        int Wait4MoveDone()
         {
-            int waitTime = 60000; //설정 할 수있게.
+            int waitTime = ConstUtils.ONE_HOUR; //설정 할 수있게.
             long st = SwUtils.CurrentTimeMillis;
 
             //Todo: 이동시 확인 사항들.
@@ -980,12 +974,12 @@ namespace VehicleControlSystem.ControlLayer
             {
                 Thread.Sleep( 5 );
 
-                //if ( SwUtils.Gt( st, waitTime ) )
-                //{
-                //    //Todo: 이동시간 초과 시 동작들.
-                //    logger.D( "Wait4MoveDone Time Over" );
-                //    break;
-                //}
+                if ( SwUtils.Gt( st, waitTime ) )
+                {
+                    //Todo: 이동시간 초과 시 동작들.
+                    logger.D( "Wait4MoveDone Time Over" );
+                    return 39;
+                }
 
                 //Todo: 이동중 명령이 삭제 되면 처리 할일들.
                 //이동중 메인 명력이 없어진다면 정지 후 
@@ -997,12 +991,12 @@ namespace VehicleControlSystem.ControlLayer
                     {
                         logger.D( "[Wait Move Done] - Main Command not Exist Motion Stop" );
                         this.refObjects.Drive.Stop();
-                        return true;
+                        return 40;
                     }
                     else
                     {
                         logger.D( "[Wait Move Done] - Main Command not Exist Motion command 없음" );
-                        return true;
+                        return 41;
                     }
                 }
 
@@ -1010,7 +1004,7 @@ namespace VehicleControlSystem.ControlLayer
                     break;
             }
 
-            return true;
+            return ConstInt.EXECUTE_SUCCESS;
         }
 
         Task CheckCrossPoint()

+ 1 - 1
Dev/OHV/VehicleControlSystem/Managers/HostManager.cs

@@ -426,7 +426,7 @@ namespace VehicleControlSystem.Managers
             if ( hasCommand != null )
             {
                 if ( !hasCommand.IsSecondCommanded )
-                    sql.CommandDAL.Delete( hasCommand );
+                    sql.CommandDAL.Delete( hasCommand.CommandID );
                 else
                 {
                     loggerHost.E( $"[OCS] Cmd - {msg.Kind} Message Tag [{msg.Tag}] - Already Load/Unload " );

+ 1 - 1
Dev/OHV/VehicleControlSystem/Managers/Scheduler.cs

@@ -222,7 +222,7 @@ namespace VehicleControlSystem.Managers
                     break;
 
                 case OHV.Common.Shareds.eCommandState.Complete:
-                    sql.CommandDAL.Delete( cmd );
+                    sql.CommandDAL.Delete( cmd.CommandID );
                     break;
                 default:
                     break;

+ 1 - 1
Dev/OHV/VehicleControlSystem/VCSystem.cs

@@ -57,7 +57,7 @@ namespace VehicleControlSystem
 
         public void Init()
         {
-            QuartzUtils.Invoke( "HIS_ALARM", QuartzUtils.GetExpnMinute( 1 ), this.CleanHisAlarm );
+            QuartzUtils.Invoke( "HIS_ALARM", QuartzUtils.GetExpnHour( 5 ), this.CleanHisAlarm );
 
             this.RouteManager = RouteManager.Instance;
             RouteManager.Instance.Init( this.sql );