Explorar el Código

Alarm DB 에서 excel 파일로 변경

DESKTOP-Kang hace 6 años
padre
commit
1fdd912cdc

+ 1 - 0
Dev/OHV/OHV.Common/Shareds/SharedEnumType.cs

@@ -155,6 +155,7 @@
 
 	public enum eAlarmKind
 	{
+		None,
 		Axis,
 		Cylinder,
 		Drive,

+ 0 - 21
Dev/OHV/OHV.Vehicle/Config/AlarmDefind..csv

@@ -1,21 +0,0 @@
-1,LeftClampServoError,Left Clamp Lock Motion Error,,,1,0
-2,LeftClampServoError,Left Clamp Unlock Motion Error,,,1,0
-3,RightClamServoError,Right Clamp Lock Motion Error,,,1,0
-4,RightClamServoError,Right Clamp Unlock Motion Error,,,1,0
-5,RightClamServoError,Is Not Origin Return,,,1,0
-6,LeftClampServoError,Is Not Origin Return,,,1,0
-7,RightClamServoError,Origin Return Fail,,,1,0
-8,LeftClampServoError,Origin Return Fail,,,1,0
-9,Conveyor,Already Exist Carrier,,,1,0
-10,Conveyor,Loading Time Over,,,1,0
-11,Conveyor,Not Exist Carrier,,,1,0
-12,Conveyor,Unloading Time Over,,,1,0
-13,Conveyor,Lifter Not Unloading Position,,,1,0
-14,Conveyor,Lifter Not Loading Position,,,1,0
-15,Conveyor,Lifter have not Carrier,,,1,0
-16,Conveyor,Inverter Error,,,1,0
-17,PIO,Port PIO Ready Off,,,1,0
-18,PIO,Port PIO Time Out,,,1,0
-19,PIO,Port PIO InterLock On,,,1,0
-20,Conveyor,Loading Position Wrong,,,1,0
-21,Conveyor,Loading Position Wrong,,,1,0

BIN
Dev/OHV/OHV.Vehicle/Config/AlarmDefind.xlsx


+ 3 - 0
Dev/OHV/OHV.Vehicle/OHV.Vehicle.csproj

@@ -237,6 +237,9 @@
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     </EmbeddedResource>
+    <None Include="Config\AlarmDefind.xlsx">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Include="Config\IO.xlsx">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>

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

@@ -1,6 +1,9 @@
 using System;
+using System.Collections.Generic;
 using System.IO;
+using System.Linq;
 using System.Threading;
+using GSG.NET.Excel;
 using GSG.NET.Extensions;
 using GSG.NET.Logging;
 using GSG.NET.Quartz;
@@ -43,6 +46,8 @@ namespace VehicleControlSystem
 
         public RouteManager RouteManager { get; set; }
 
+        public List<Alarm> Alarms { get; set; }
+
         public VCSystem( IEventAggregator ea, SqliteManager sql )
         {
             this.sql = sql;
@@ -62,6 +67,8 @@ namespace VehicleControlSystem
             this.RouteManager = RouteManager.Instance;
             RouteManager.Instance.Init( this.sql );
 
+            Alarms = new ExcelMapper( Path.Combine( System.Environment.CurrentDirectory ) + @"\Config\AlarmDefind.xlsx" ).Fetch<Alarm>().ToList();
+
             //Create IO
             this.IO = new EzIO();
             var mapPath = Path.Combine( System.Environment.CurrentDirectory ) + @"\Config\IO.xlsx";
@@ -109,7 +116,7 @@ namespace VehicleControlSystem
             refObject.ZmqManager = this.zmqManager;
 
             //Process
-            this.autoManager = new AutoManager( this.IO, this.eventAggregator, this.sql );
+            this.autoManager = new AutoManager( this.IO, this.eventAggregator, this.sql, this.Alarms );
             this.scheduler = new Scheduler( eventAggregator, this.autoManager, this.sql );
 
             this.vehicle = new Vehicle( refObject, this.IO, this.sql, this.eventAggregator, this.autoManager );