Forráskód Böngészése

Clamp Origin 동작 관련 수정

unque781 5 éve
szülő
commit
9cd4c4b528

BIN
Dev/OHV/Assambly/OHVConnector.dll


BIN
Dev/OHV/Assambly/OHVConnector.pdb


+ 1 - 0
Dev/OHV/OHV.SqliteDAL/App.config

@@ -28,6 +28,7 @@
         <parameter value="mssqllocaldb"/>
       </parameters>
     </defaultConnectionFactory>
+
     <providers>
       <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
       <provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6"/>

+ 0 - 4
Dev/OHV/OHV.SqliteDAL/CustomHistory.cs

@@ -1,9 +1,5 @@
 using SQLite.CodeFirst;
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace OHV.SqliteDAL
 {

+ 35 - 28
Dev/OHV/OHV.Vehicle/App.config

@@ -1,31 +1,38 @@
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
-  <configSections>
-    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
-    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
-  </configSections>
-  <connectionStrings>
-    <add name="OHVDb" connectionString="data source=C:\DB\OHVDb.sqlite;foreign keys=true" providerName="System.Data.SQLite" />
-  </connectionStrings>
-  <startup>
-    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
-  </startup>
-  <entityFramework>
-    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
-      <parameters>
-        <parameter value="mssqllocaldb" />
-      </parameters>
-    </defaultConnectionFactory>
-    <providers>
-      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
-      <provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
-      <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
-    </providers>
-  </entityFramework>
-  <system.data>
-    <DbProviderFactories>
-      <remove invariant="System.Data.SQLite.EF6" />
-      <add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
-    <remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
-  </system.data>
+	<configSections>
+		<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
+		<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+	</configSections>
+
+	<connectionStrings>
+		<add name="OHVDb" connectionString="data source=C:\DB\OHVDb.sqlite;foreign keys=true" providerName="System.Data.SQLite" />
+	</connectionStrings>
+
+	<startup>
+		<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
+	</startup>
+
+	<entityFramework>
+		<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
+			<parameters>
+				<parameter value="mssqllocaldb" />
+			</parameters>
+		</defaultConnectionFactory>
+		<providers>
+			<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
+			<provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
+			<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
+		</providers>
+	</entityFramework>
+
+	<system.data>
+		<DbProviderFactories>
+			<remove invariant="System.Data.SQLite.EF6" />
+			<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
+			<remove invariant="System.Data.SQLite" />
+			<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
+		</DbProviderFactories>
+	</system.data>
+
 </configuration>

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


+ 4 - 4
Dev/OHV/OHV.sln

@@ -105,16 +105,16 @@ Global
 		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Release|Any CPU.Build.0 = Release|Any CPU
-		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Remote1|Any CPU.ActiveCfg = Release|Any CPU
-		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Remote1|Any CPU.Build.0 = Release|Any CPU
+		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Remote1|Any CPU.ActiveCfg = Debug|Any CPU
+		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Remote1|Any CPU.Build.0 = Debug|Any CPU
 		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
 		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Release|Any CPU.Build.0 = Release|Any CPU
-		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Remote1|Any CPU.ActiveCfg = Release|Any CPU
-		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Remote1|Any CPU.Build.0 = Release|Any CPU
+		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Remote1|Any CPU.ActiveCfg = Debug|Any CPU
+		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Remote1|Any CPU.Build.0 = Debug|Any CPU
 		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
 		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU

+ 28 - 6
Dev/OHV/VehicleControlSystem/ControlLayer/Clamp.cs

@@ -336,11 +336,9 @@ namespace VehicleControlSystem.ControlLayer
                 Kind = eAxisControlKind.AllOriginReturn
             };
 
-            var ll = this.AllOriginReturn();
+            var result = this.AllOriginReturn();
 
-            LockUtils.Wait( 3000 );
-
-            var result = this.IsAllAxisOriginReturn();
+            result = this.IsAllAxisOriginReturn();
             if ( result == 5 )
                 msg.Result = Results.Fail( "Left Fail" );
             else if ( result == 6 )
@@ -475,12 +473,27 @@ namespace VehicleControlSystem.ControlLayer
             if ( result != EziMOTIONPlusELib.FMM_OK )
                 return 7;
 
-            Thread.Sleep( 1000 );
-
             result = RightOriginReturn();
             if ( result != EziMOTIONPlusELib.FMM_OK )
                 return 8;
 
+            LockUtils.Wait( 500 );
+
+            var sw = SwUtils.CurrentTimeMillis;
+            while ( true )
+            {
+                LockUtils.Wait( 5 );
+
+                if ( SwUtils.Gt( sw, 10000 ) )
+                    break;
+
+                if ( this.axes.Any( axis => axis.IsAmpFault() ) )
+                    break;
+
+                if ( this.axes.All( a => a.IsAxisDone() ) )
+                    break;
+            }
+
             return result;
         }
 
@@ -497,6 +510,15 @@ namespace VehicleControlSystem.ControlLayer
                          result = 6;
                      return;
                  }
+
+                 if ( x.IsServoOff())
+                 {
+                     if ( x.Config.AxisName.Equals( ConstString.AXIS_CARRIER_LOCK_LEFT ) )
+                         result = 5;
+                     else
+                         result = 6;
+                     return;
+                 }
              } );
 
             return result;

+ 9 - 2
Dev/OHV/VehicleControlSystem/ControlLayer/IO/EzIO.cs

@@ -312,12 +312,16 @@ namespace VehicleControlSystem.ControlLayer.IO
                 bitMask = bitOnMask[outIO.Index];
                 result = EziMOTIONPlusELib.FAS_SetOutput( outIO.BoardNo, bitMask, 0 );
             }
+
+            if ( outputTag.Equals( "OUT_F_STEERING_DA" ) || outputTag.Equals( "OUT_R_STEERING_DA" ) )
+                logger.D( $"{outputTag} -  On" );
+
         }
-        void WriteOutputOff( string strIOAddr )
+        void WriteOutputOff( string outPutTag )
         {
             int result = 0;
 
-            var outIO = this._outPutIOList.Where( x => strIOAddr.Equals( x.Tag ) ).FirstOrDefault();
+            var outIO = this._outPutIOList.Where( x => outPutTag.Equals( x.Tag ) ).FirstOrDefault();
             var boardType = this.BoardList.Where( x => x.BoardID == outIO.BoardNo ).FirstOrDefault().Type;
 
             uint bitMask = 0;
@@ -331,6 +335,9 @@ namespace VehicleControlSystem.ControlLayer.IO
                 bitMask = bitOnMask[outIO.Index];
                 result = EziMOTIONPlusELib.FAS_SetOutput( outIO.BoardNo, 0, bitMask );
             }
+
+            if ( outPutTag.Equals( "OUT_F_STEERING_DA" ) || outPutTag.Equals( "OUT_R_STEERING_DA" ) )
+                logger.D( $"{outPutTag} -  OFF" );
         }
 
         public void WriteOutputIO( string tag, bool on, int after = 0 )

+ 7 - 0
Dev/OHV/VehicleControlSystem/ControlLayer/Vehicle.cs

@@ -662,6 +662,13 @@ namespace VehicleControlSystem.ControlLayer
             //PIOClear();
             //PIOSensorOff();
 
+            result = this.refObjects.Clamp.IsAllAxisOriginReturn();
+            if ( result != ConstInt.EXECUTE_SUCCESS )
+            {
+                this.refObjects.Clamp.AllOriginReturn();
+                LockUtils.Wait( 2000 );
+            }
+
             if ( this.refObjects.Conveyor.IsDetectedCenter() ) //자제가 있으면 Lock
                 result = this.refObjects.Clamp.Lock_Sync();
             else

+ 5 - 0
Dev/OHV/VehicleControlSystem/Managers/AutoManager.cs

@@ -148,6 +148,8 @@ namespace VehicleControlSystem.Managers
             this.eventAggregator = ea;
             this.sql = sql;
             this.Alarms = al;
+
+            this.ActiveAlarms = new List<Alarm>();
         }
 
         #region Vehicle Events
@@ -331,6 +333,9 @@ namespace VehicleControlSystem.Managers
 
             logger.I( $"[Alarm Occur] - ID : {alarmID} / Text : {hisAlarm.Text}" );
 
+            if ( this.ActiveAlarms == null )
+                return;
+
             this.ActiveAlarms.Add( alarm );
             this.OnOccurAlarm?.BeginInvoke( alarm.AlarmId, null, null );
 

+ 2 - 0
Dev/OHV/VehicleControlSystem/Managers/HostManager.cs

@@ -541,6 +541,8 @@ namespace VehicleControlSystem.Managers
 
         private void Manager_OnDiscontd( string id, Exception e )
         {
+            this.vehicle.OccurVehicleAlarm( 43 );
+
             var msg = new HostConnectedEventArgs( HostConnectedEventArgs.eConnectedState.Disconnected );
             this.eventAggregator.GetEvent<HostConnectedPubSubEvent>().Publish( msg );
 

+ 1 - 1
Dev/OHV/VehicleControlSystem/VehicleControlSystem.csproj

@@ -18,7 +18,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;SIMULATION</DefineConstants>
+    <DefineConstants>TRACE;DEBUG</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>