فهرست منبع

Merge branch 'master' of http://unque781.synology.me:3000/GSI/OHV

# Conflicts:
#	Dev/OHV/VehicleControlSystem/Managers/Scheduler.cs
#	Dev/OHV/VehicleControlSystem/VCSystem.cs
unque781 6 سال پیش
والد
کامیت
85c2400d26

+ 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>

+ 4 - 0
Dev/OHV/VehicleControlSystem/ControlLayer/MQ/ZmqManager.cs

@@ -248,6 +248,7 @@ namespace VehicleControlSystem.ControlLayer.MQ
                     {
                         case "3050":
                             {
+                                logger.D( $"[Steering_Rep] - 3050/{v[0]}" );
                                 switch ( v[1] )
                                 {
                                     case "1":
@@ -637,6 +638,7 @@ namespace VehicleControlSystem.ControlLayer.MQ
             }
             if ( !this.SetRequest( "5001", val ) )
                 logger.E( $"[Set Obstruction] - Response Time Out" );
+
         }
 
         internal void SetOperationState( eOperatationMode mode )
@@ -690,6 +692,8 @@ namespace VehicleControlSystem.ControlLayer.MQ
             }
             if ( !this.SetRequest( "3060", val ) )
                 logger.E( $"[Set Current Steering] - Response Time Out" );
+
+            logger.D( $"[Steering_Req] - 3060/{val}" );
         }
         #endregion
     }

+ 6 - 4
Dev/OHV/VehicleControlSystem/Managers/AutoManager.cs

@@ -10,6 +10,8 @@ using OHV.Common.Model;
 using OHV.Common.Events;
 using VehicleControlSystem.ControlLayer;
 using GSG.NET.Utils;
+using System.Collections.Generic;
+using System.Linq;
 
 namespace VehicleControlSystem.Managers
 {
@@ -50,6 +52,7 @@ namespace VehicleControlSystem.Managers
         public event Action<int> OnOccurAlarm;
         public event Action<int> OnClearAlarm;
         Alarm activeAlarm = null;
+        List<Alarm> Alarms { get; set; }
 
         IEventAggregator eventAggregator = null;
         SqliteManager sql = null;
@@ -128,11 +131,12 @@ namespace VehicleControlSystem.Managers
             set { buzzerState = value; }
         }
 
-        public AutoManager( IIO io, IEventAggregator ea, SqliteManager sql )
+        public AutoManager( IIO io, IEventAggregator ea, SqliteManager sql, List<Alarm> al )
         {
             this.iO = io;
             this.eventAggregator = ea;
             this.sql = sql;
+            this.Alarms = al;
         }
 
         #region Vehicle Events
@@ -282,10 +286,8 @@ namespace VehicleControlSystem.Managers
                 default:
                     break;
             }
-
         }
 
-
         public void ProcessAlarm( int alarmID )
         {
             this.AutoModeStateProperty = eAutoModeState.ErrorStop;
@@ -293,7 +295,7 @@ namespace VehicleControlSystem.Managers
             this.BuzzerStateProperty = eBuzzerKind.Alarm;
 
             HisAlarm hisAlarm = new HisAlarm();
-            var alarm = sql.AlarmDAL.GetById( alarmID );
+            var alarm = this.Alarms.Where( x => x.AlarmId == alarmID ).FirstOrDefault();
             if ( alarm == null )
             {
                 hisAlarm.AlarmId = alarmID;