unque781 5 лет назад
Родитель
Сommit
a208729a71

BIN
Dev/OHV/Assambly/OHVConnector.dll


BIN
Dev/OHV/Assambly/OHVConnector.pdb


+ 6 - 6
Dev/OHV/OHV.Module.Interactivity/PopUp/BatteryConfigView.xaml

@@ -8,9 +8,8 @@
              xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
              prism:ViewModelLocator.AutoWireViewModel="True"
              mc:Ignorable="d" 
-             Width="800"
-             Height="600"
-             Background="#263238">
+             Height="1080" Width="1920"
+             Background="#CC282C34">
 
     <prism:Dialog.WindowStyle>
         <Style TargetType="Window">
@@ -22,6 +21,7 @@
             <Setter Property="BorderThickness" Value="1"/>
             <Setter Property="BorderBrush" Value="{DynamicResource BorderSolidNormal}"/>
             <Setter Property="Template" Value="{DynamicResource WindowTemplateKey}"/>
+            <Setter Property="WindowState" Value="Maximized"/>
 
             <!--<Style.Triggers>
                 <Trigger Property="ResizeMode" Value="CanResizeWithGrip">
@@ -39,7 +39,7 @@
         </ResourceDictionary>
     </UserControl.Resources>
 
-    <Border BorderBrush="Gray" BorderThickness="2">
+    <Border BorderBrush="Gray" BorderThickness="2" Width="800" Height="600">
         <Grid>
             <Grid.ColumnDefinitions>
                 <ColumnDefinition Width="*"/>
@@ -58,7 +58,7 @@
                     <Button Margin="1" HorizontalAlignment="Center" Height="45" BorderBrush="Gray" BorderThickness="0" Background="{x:Null}"
                         HorizontalContentAlignment="Right">
                         <StackPanel Orientation="Horizontal">
-                            <Ellipse Margin="3" Fill="{Binding BatteryConnectBrush, FallbackValue=Gray}" Width="30" Height="30"/>
+                            <Ellipse Margin="0,0,10,0" Fill="{Binding BatteryConnectBrush, FallbackValue=Gray}" Width="23" Height="21"/>
                             <TextBlock Margin="2" Text="{Binding BatteryConnect, FallbackValue=STATUS}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                         </StackPanel>
                     </Button>
@@ -228,5 +228,5 @@
             </Grid>
         </Grid>
     </Border>
-      
+
 </UserControl>

+ 3 - 2
Dev/OHV/OHV.Module.Interactivity/PopUp/ConfigView.xaml

@@ -9,7 +9,7 @@
              prism:ViewModelLocator.AutoWireViewModel="True"
              xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
 
-             d:DesignHeight="350" d:DesignWidth="450" Foreground="White" Width="700" Height="500">
+             d:DesignHeight="350" d:DesignWidth="450" Foreground="White" Height="1080" Width="1920" Background="#CC282C34">
 
     <prism:Dialog.WindowStyle>
         <Style TargetType="Window">
@@ -22,6 +22,7 @@
             <Setter Property="BorderThickness" Value="1"/>
             <Setter Property="BorderBrush" Value="{DynamicResource BorderSolidNormal}"/>
             <Setter Property="Template" Value="{DynamicResource WindowTemplateKey}"/>
+            <Setter Property="WindowState" Value="Maximized"/>
 
             <!--<Style.Triggers>
                 <Trigger Property="ResizeMode" Value="CanResizeWithGrip">
@@ -31,7 +32,7 @@
         </Style>
     </prism:Dialog.WindowStyle>
 
-    <Border BorderThickness="4" BorderBrush="{DynamicResource PrimaryHueMidBrush}">
+    <Border BorderThickness="4" BorderBrush="{DynamicResource PrimaryHueMidBrush}" Height="500" Width="700">
     <Grid Background="#263238">
         <Grid.RowDefinitions>
             <RowDefinition Height="40"/>

+ 6 - 5
Dev/OHV/OHV.Module.Interactivity/PopUp/ConveyorControlView.xaml

@@ -8,8 +8,8 @@
              xmlns:prism="http://prismlibrary.com/"
              prism:ViewModelLocator.AutoWireViewModel="True"
              xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
-             Background="#263238"
-             Height="790" Width="900" >
+             Height="1080" Width="1920"
+             Background="#CC282C34" >
 
     <prism:Dialog.WindowStyle>
         <Style TargetType="Window">
@@ -20,11 +20,12 @@
             <Setter Property="SizeToContent" Value="WidthAndHeight"/>
             <Setter Property="WindowStyle" Value="None"/>
             <Setter Property="BorderThickness" Value="1"/>
+            <Setter Property="WindowState" Value="Maximized"/>
         </Style>
     </prism:Dialog.WindowStyle>
 
-    <Border BorderBrush="Gray" BorderThickness="2">
-        <Grid>
+    <Border BorderBrush="Gray" BorderThickness="2" Width="900" Height="790">
+        <Grid Background="#263238">
             <Grid.ColumnDefinitions>
                 <ColumnDefinition Width="*"/>
                 <ColumnDefinition Width="130"/>
@@ -378,7 +379,7 @@
             <Grid Grid.Column="1" Grid.RowSpan="2" Background="#263238">
                 <Border Margin="1" BorderBrush="#FF00FFD3" BorderThickness="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
                 <StackPanel VerticalAlignment="Bottom">
-                    <Button Margin="10,0,10,20" HorizontalAlignment="Stretch" Height="90" BorderBrush="Gray" BorderThickness="2" Command="{Binding CloseDialogCommand}" CommandParameter="true">
+                    <Button FontSize="20" Margin="10,0,10,10" HorizontalAlignment="Stretch" Height="90" BorderBrush="Gray" BorderThickness="2" Command="{Binding CloseDialogCommand}" CommandParameter="true">
                         <StackPanel>
                             <materialDesign:PackIcon Kind="ExitToApp" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
                             <TextBlock Text="Close" VerticalAlignment="Stretch" HorizontalAlignment="Center" />

+ 5 - 5
Dev/OHV/OHV.Module.Interactivity/PopUp/DriveServoView.xaml

@@ -8,9 +8,8 @@
              xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
              prism:ViewModelLocator.AutoWireViewModel="True"
              mc:Ignorable="d" 
-             Width="1130"
-             Height="750"
-             Background="#263238"
+             Height="1080" Width="1920"
+             Background="#CC282C34"
              xmlns:System="clr-namespace:System;assembly=mscorlib"
              xmlns:SharedEnum="clr-namespace:OHV.Common.Model;assembly=OHV.Common"
              >
@@ -25,6 +24,7 @@
             <Setter Property="BorderThickness" Value="1"/>
             <Setter Property="BorderBrush" Value="{DynamicResource BorderSolidNormal}"/>
             <Setter Property="Template" Value="{DynamicResource WindowTemplateKey}"/>
+            <Setter Property="WindowState" Value="Maximized"/>
 
             <!--<Style.Triggers>
                 <Trigger Property="ResizeMode" Value="CanResizeWithGrip">
@@ -55,8 +55,8 @@
         </ResourceDictionary>
     </UserControl.Resources>
 
-    <Border BorderBrush="Gray" BorderThickness="2">
-        <Grid>
+    <Border BorderBrush="Gray" BorderThickness="2" Width="1130" Height="750">
+        <Grid Background="#263238">
             <Grid.ColumnDefinitions>
                 <ColumnDefinition/>
                 <!--<ColumnDefinition Width="130"/>-->

+ 5 - 4
Dev/OHV/OHV.Module.Interactivity/PopUp/InOutView.xaml

@@ -9,8 +9,8 @@
              xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
              xmlns:prism="http://prismlibrary.com/"
              prism:ViewModelLocator.AutoWireViewModel="True"
-             Width="1000" Height="800"
-             Background="#37474f">
+             Height="1080" Width="1920"
+             Background="#CC282C34">
 
     <prism:Dialog.WindowStyle>
         <Style TargetType="Window">
@@ -23,6 +23,7 @@
             <Setter Property="BorderThickness" Value="1"/>
             <Setter Property="BorderBrush" Value="{DynamicResource BorderSolidNormal}"/>
             <Setter Property="Template" Value="{DynamicResource WindowTemplateKey}"/>
+            <Setter Property="WindowState" Value="Maximized"/>
 
             <!--<Style.Triggers>
                 <Trigger Property="ResizeMode" Value="CanResizeWithGrip">
@@ -32,7 +33,7 @@
         </Style>
     </prism:Dialog.WindowStyle>
 
-    <Border BorderBrush="Gray" BorderThickness="1">
+    <Border BorderBrush="Gray" BorderThickness="1" Width="1000" Height="800">
         <Grid>
         <Grid.ColumnDefinitions>
             <ColumnDefinition/>
@@ -46,7 +47,7 @@
             <Grid Grid.Column="1" HorizontalAlignment="Stretch" Background="#263238">
                 <Border Margin="1" BorderBrush="#FF00FFD3" BorderThickness="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
                 <StackPanel VerticalAlignment="Bottom">
-                    <Button Margin="10,0,10,10" HorizontalAlignment="Stretch" Height="90" BorderBrush="Gray" BorderThickness="2" Command="{Binding CloseDialogCommand}" CommandParameter="true">
+                    <Button FontSize="20" Margin="10,0,10,10" HorizontalAlignment="Stretch" Height="90" BorderBrush="Gray" BorderThickness="2" Command="{Binding CloseDialogCommand}" CommandParameter="true">
                         <StackPanel>
                             <materialDesign:PackIcon Kind="ExitToApp" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
                             <TextBlock Text="Close" VerticalAlignment="Stretch" HorizontalAlignment="Center" />

+ 7 - 7
Dev/OHV/OHV.Module.Interactivity/PopUp/LockServoView.xaml

@@ -12,9 +12,8 @@
              mc:Ignorable="d" 
              xmlns:c ="clr-namespace:GSG.NET.WPF.CalcBinding;assembly=GSG.NET.WPF"
              xmlns:media ="clr-namespace:System.Windows.Media;assembly=PresentationCore"
-             Width="900"
-             Height="700"
-             Background="#263238">
+             Height="1080" Width="1920"
+             Background="#CC282C34">
 
     <prism:Dialog.WindowStyle>
         <Style TargetType="Window">
@@ -26,6 +25,7 @@
             <Setter Property="BorderThickness" Value="1"/>
             <Setter Property="BorderBrush" Value="{DynamicResource BorderSolidNormal}"/>
             <Setter Property="Template" Value="{DynamicResource WindowTemplateKey}"/>
+            <Setter Property="WindowState" Value="Maximized"/>
 
             <!--<Style.Triggers>
                 <Trigger Property="ResizeMode" Value="CanResizeWithGrip">
@@ -57,8 +57,8 @@
         </Style>
     </UserControl.Resources>
 
-    <Border BorderBrush="Gray" BorderThickness="2">
-        <Grid>
+    <Border BorderBrush="Gray" BorderThickness="2" Width="900" Height="700">
+        <Grid Background="#263238">
             <Grid.ColumnDefinitions>
                 <ColumnDefinition/>
                 <ColumnDefinition Width="130"/>
@@ -70,10 +70,10 @@
             </Grid.RowDefinitions>
 
             <Grid Grid.Row="0">
-                <TextBlock Margin="15,0,0,0" Text="Clam View" FontSize="25" Foreground="White"/>
+                <TextBlock Margin="15,0,0,0" Text="Clamp View" FontSize="25" Foreground="White"/>
             </Grid>
 
-            <Grid Grid.Column="0" Grid.Row="1">
+            <Grid Grid.Column="0" Grid.Row="1" Background="#263238">
                 <Grid Margin="15,15" Background="#37474f">
                     <Grid.RowDefinitions>
                         <RowDefinition/>

+ 7 - 7
Dev/OHV/OHV.Module.Interactivity/PopUp/OpticalReadingConfigView.xaml

@@ -8,9 +8,8 @@
              xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
              prism:ViewModelLocator.AutoWireViewModel="True"
              mc:Ignorable="d" 
-             Width="600"
-             Height="600"
-             Background="#263238">
+             Height="1080" Width="1920"
+             Background="#CC282C34">
 
     <prism:Dialog.WindowStyle>
         <Style TargetType="Window">
@@ -22,6 +21,7 @@
             <Setter Property="BorderThickness" Value="1"/>
             <Setter Property="BorderBrush" Value="{DynamicResource BorderSolidNormal}"/>
             <Setter Property="Template" Value="{DynamicResource WindowTemplateKey}"/>
+            <Setter Property="WindowState" Value="Maximized"/>
 
             <!--<Style.Triggers>
                 <Trigger Property="ResizeMode" Value="CanResizeWithGrip">
@@ -31,8 +31,8 @@
         </Style>
     </prism:Dialog.WindowStyle>
 
-    <Border BorderBrush="Gray" BorderThickness="2">
-        <Grid>
+    <Border BorderBrush="Gray" BorderThickness="2" Width="800" Height="600">
+        <Grid Background="#263238">
             <Grid.ColumnDefinitions>
                 <ColumnDefinition Width="*"/>
                 <ColumnDefinition Width="130"/>
@@ -66,7 +66,7 @@
                     <Border BorderBrush="Gray" BorderThickness="1"/>
                     <StackPanel VerticalAlignment="Center" 
                                 HorizontalAlignment="Left"
-                            Margin="30">
+                            Margin="100,0,0,0">
                         <Button Height="60">
                             <StackPanel>
                                 <TextBlock><Run Text="Detect State" FontSize="20"/></TextBlock>
@@ -82,7 +82,7 @@
 
                     <StackPanel Orientation="Horizontal"
                                 VerticalAlignment="Center"
-                                HorizontalAlignment="Right">
+                                HorizontalAlignment="Right" Margin="0,0,80,0">
                         <StackPanel Margin="30"
                                     VerticalAlignment="Center"
                                     HorizontalAlignment="Center">

+ 1 - 1
Dev/OHV/OHV.Vehicle/App.xaml.cs

@@ -43,7 +43,7 @@ namespace OHV.Vehicle
 
             try
             {
-                QuartzUtils.Init(10);
+                QuartzUtils.Init(20);
                 logger.I(string.Format(string.Empty.PadRight(40, '+') + $" Ver. {AssemblyUtils.GetVersion()} " + string.Empty.PadRight(40, '+')));
 
 

+ 3 - 2
Dev/OHV/OHV.Vehicle/Concept/AnimatedSplashScreenWindow.xaml

@@ -40,8 +40,8 @@
     </Window.Resources>
     <Grid>
         <Grid.RowDefinitions>
-            <RowDefinition Height="*"/>
-            <RowDefinition Height="*"/>
+            <RowDefinition/>
+            <RowDefinition Height="115"/>
             <RowDefinition Height="AUto"/>
             <RowDefinition Height="Auto"/>
         </Grid.RowDefinitions>
@@ -75,6 +75,7 @@
 
         <Label x:Name="UpdateMessageLabel" Grid.Row="2" Foreground="LightGray" FontStyle="Italic" Height="30" Content="Start APPS ..." HorizontalAlignment="Center" VerticalAlignment="Center"/>
         <ProgressBar x:Name="ProgressBar" Grid.Row="3" Height="10" Foreground="BlueViolet" Style="{StaticResource FlatProgressBar}" Value="{Binding ProgressValue}"/>
+        <!--<ProgressBar Grid.Row="3" Height="10" Style="{StaticResource MaterialDesignLinearProgressBar}" Value="0" IsIndeterminate="True" Background="Transparent"/>-->
         <ProgressBar Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" IsIndeterminate="True" Width="40" Height="40" Margin="352,10,358,65" Grid.Row="1"/>
         <Label Grid.Row="1" Content="Please Wait..." Foreground="LightGray" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" Margin="302,55,311,27"/>
     </Grid>

+ 9 - 9
Dev/OHV/OHV.Vehicle/Concept/AnimatedSplashScreenWindow.xaml.cs

@@ -39,25 +39,25 @@ namespace OHV.Vehicle.Concept
         }
         #endregion
 
-        public void SetRange(int count )
+        public void SetRange( int count )
         {
-            Dispatcher.Invoke( new Action( () => 
+            Dispatcher.Invoke( new Action( () =>
             {
                 ProgressValue = 0;
                 ProgressBar.Maximum = count;
             } ) );
-            
+
         }
 
         public void StepIt()
         {
-            Dispatcher.Invoke( new Action(()=> 
-            {
-                if ( this.ProgressBar.Maximum <= ProgressValue )
-                    return;
+            Dispatcher.Invoke( new Action( () =>
+             {
+                 if ( this.ProgressBar.Maximum <= ProgressValue )
+                     return;
 
-                this.ProgressValue += 1;
-            } ));
+                 this.ProgressValue += 1;
+             } ) );
         }
 
         public AnimatedSplashScreenWindow()

+ 26 - 26
Dev/OHV/OHV.sln

@@ -57,8 +57,8 @@ Global
 		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Release|Any CPU.Build.0 = Release|Any CPU
-		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
-		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Remote1|Any CPU.ActiveCfg = Release|Any CPU
+		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Remote1|Any CPU.Build.0 = Release|Any CPU
 		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
 		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{12D8B660-6FC6-4228-9198-63E3E455CAAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -73,96 +73,96 @@ Global
 		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Release|Any CPU.Build.0 = Release|Any CPU
-		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
-		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Remote1|Any CPU.ActiveCfg = Release|Any CPU
+		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Remote1|Any CPU.Build.0 = Release|Any CPU
 		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
 		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{902A80B4-DECE-41C1-9552-51A1362537C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{902A80B4-DECE-41C1-9552-51A1362537C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{902A80B4-DECE-41C1-9552-51A1362537C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{902A80B4-DECE-41C1-9552-51A1362537C9}.Release|Any CPU.Build.0 = Release|Any CPU
-		{902A80B4-DECE-41C1-9552-51A1362537C9}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
-		{902A80B4-DECE-41C1-9552-51A1362537C9}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{902A80B4-DECE-41C1-9552-51A1362537C9}.Remote1|Any CPU.ActiveCfg = Release|Any CPU
+		{902A80B4-DECE-41C1-9552-51A1362537C9}.Remote1|Any CPU.Build.0 = Release|Any CPU
 		{902A80B4-DECE-41C1-9552-51A1362537C9}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
 		{902A80B4-DECE-41C1-9552-51A1362537C9}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Release|Any CPU.Build.0 = Release|Any CPU
-		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
-		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Remote1|Any CPU.ActiveCfg = Release|Any CPU
+		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Remote1|Any CPU.Build.0 = Release|Any CPU
 		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
 		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Release|Any CPU.Build.0 = Release|Any CPU
-		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
-		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Remote1|Any CPU.ActiveCfg = Release|Any CPU
+		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Remote1|Any CPU.Build.0 = Release|Any CPU
 		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
 		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{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 = Remote1|Any CPU
-		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Remote1|Any CPU.Build.0 = Remote1|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}.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 = Remote1|Any CPU
-		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Remote1|Any CPU.Build.0 = Remote1|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}.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
 		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Release|Any CPU.Build.0 = Release|Any CPU
-		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
-		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Remote1|Any CPU.ActiveCfg = Release|Any CPU
+		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Remote1|Any CPU.Build.0 = Release|Any CPU
 		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
 		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Release|Any CPU.Build.0 = Release|Any CPU
-		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
-		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Remote1|Any CPU.ActiveCfg = Release|Any CPU
+		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Remote1|Any CPU.Build.0 = Release|Any CPU
 		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
 		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Release|Any CPU.Build.0 = Release|Any CPU
-		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
-		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Remote1|Any CPU.ActiveCfg = Release|Any CPU
+		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Remote1|Any CPU.Build.0 = Release|Any CPU
 		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
 		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{0043B4EC-A651-401C-9845-57A7C7576E28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{0043B4EC-A651-401C-9845-57A7C7576E28}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{0043B4EC-A651-401C-9845-57A7C7576E28}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{0043B4EC-A651-401C-9845-57A7C7576E28}.Release|Any CPU.Build.0 = Release|Any CPU
-		{0043B4EC-A651-401C-9845-57A7C7576E28}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
-		{0043B4EC-A651-401C-9845-57A7C7576E28}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{0043B4EC-A651-401C-9845-57A7C7576E28}.Remote1|Any CPU.ActiveCfg = Release|Any CPU
+		{0043B4EC-A651-401C-9845-57A7C7576E28}.Remote1|Any CPU.Build.0 = Release|Any CPU
 		{0043B4EC-A651-401C-9845-57A7C7576E28}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
 		{0043B4EC-A651-401C-9845-57A7C7576E28}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Release|Any CPU.Build.0 = Release|Any CPU
-		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
-		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Remote1|Any CPU.ActiveCfg = Release|Any CPU
+		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Remote1|Any CPU.Build.0 = Release|Any CPU
 		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
 		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{B9A8B13B-518B-4AE4-B8B6-C2684DF6608A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{B9A8B13B-518B-4AE4-B8B6-C2684DF6608A}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{B9A8B13B-518B-4AE4-B8B6-C2684DF6608A}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{B9A8B13B-518B-4AE4-B8B6-C2684DF6608A}.Release|Any CPU.Build.0 = Release|Any CPU
-		{B9A8B13B-518B-4AE4-B8B6-C2684DF6608A}.Remote1|Any CPU.ActiveCfg = Debug|Any CPU
-		{B9A8B13B-518B-4AE4-B8B6-C2684DF6608A}.Remote1|Any CPU.Build.0 = Debug|Any CPU
+		{B9A8B13B-518B-4AE4-B8B6-C2684DF6608A}.Remote1|Any CPU.ActiveCfg = Release|Any CPU
+		{B9A8B13B-518B-4AE4-B8B6-C2684DF6608A}.Remote1|Any CPU.Build.0 = Release|Any CPU
 		{B9A8B13B-518B-4AE4-B8B6-C2684DF6608A}.Remote2|Any CPU.ActiveCfg = Debug|Any CPU
 		{B9A8B13B-518B-4AE4-B8B6-C2684DF6608A}.Remote2|Any CPU.Build.0 = Debug|Any CPU
 		{2B965366-444B-442A-9187-80DF60433192}.Debug|Any CPU.ActiveCfg = Debug|Any CPU

+ 310 - 46
Dev/OHV/VehicleControlSystem/ControlLayer/MQ/ZmqManager.cs

@@ -10,6 +10,7 @@ using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.Linq;
+using System.Text;
 using VehicleControlSystem.ControlLayer.Serial.BatteryTabos;
 using VehicleControlSystem.ControlLayer.Serial.DataModel;
 using VehicleControlSystem.Managers;
@@ -40,7 +41,9 @@ namespace VehicleControlSystem.ControlLayer.MQ
 
         ThreadCancel threadCancel = new ThreadCancel();
 
-        BlockingCollection<ZmqMessage> sendQueue = new BlockingCollection<ZmqMessage>(new ConcurrentQueue<ZmqMessage>());
+        BlockingCollection<ZmqMessage> sendQueue = new BlockingCollection<ZmqMessage>( new ConcurrentQueue<ZmqMessage>() );
+
+        string endServer = "tcp://127.0.0.1:5567";
 
         private bool isReqConnected = false;
         public bool IsReqConnected
@@ -54,7 +57,7 @@ namespace VehicleControlSystem.ControlLayer.MQ
         public eSteeringState RequestSteering
         {
             get { return requestSteering; }
-            set { SetField( ref this.requestSteering, value ); }
+            set { SetField( ref this.requestSteering, value, false ); }
         }
 
         private bool isDriveMoving = false;
@@ -173,16 +176,15 @@ 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; 
+            this.monitor.Connected += ( s, a ) =>
+            {
+                this.IsReqConnected = true;
                 CurrentPointNo = GetCurrentPointNo();
                 SetCurrentSteeringState( this.steering.GetSteeringState() );
             };
 
             this.monitor.Disconnected += ( s, a ) => { this.IsReqConnected = false; };
             this.monitor.StartAsync();
-
             req.Connect( "tcp://127.0.0.1:5567" );
 
             this.poller = new NetMQPoller { this.rep };
@@ -227,7 +229,7 @@ namespace VehicleControlSystem.ControlLayer.MQ
             catch ( Exception ex )
             {
                 logger.E( ex );
-            }   
+            }
         }
 
         public void Dispose()
@@ -248,9 +250,9 @@ namespace VehicleControlSystem.ControlLayer.MQ
         }
 
         object lockPulish = new object();
-        public void Publish(string key, string val) 
+        public void Publish( string key, string val )
         {
-            lock(lockPulish)
+            lock ( lockPulish )
                 this.pub.SendMoreFrame( key ).SendFrame( val );
         }
 
@@ -437,22 +439,6 @@ namespace VehicleControlSystem.ControlLayer.MQ
             }
         }
 
-        void Th_SubPoller()
-        {
-            while ( !this.threadCancel.Canceled )
-            {
-                LockUtils.Wait( 1000 );
-                //this.pub.SendMoreFrame( "1000" ).SendFrame( "Test" );
-                LockUtils.Wait( 100 );
-
-                NetMQMessage msg = new NetMQMessage();
-                if ( this.sub.TryReceiveMultipartMessage( TimeSpan.FromSeconds( 1 ), ref msg ) )
-                {
-                    var m = msg;
-                }
-            }
-        }
-
         object lockObj = new object();
         bool Request( string topic, string value, out string response )
         {
@@ -585,34 +571,139 @@ namespace VehicleControlSystem.ControlLayer.MQ
             return true;
         }
 
+        #region RequestSocket
+        List<string> GetRequest( string index )
+        {
+            var rll = RequestDrive( "getm", index );
+            if ( rll.Count == 0 )
+                return rll;
+
+            rll.RemoveAt( 0 );
+
+            var ret = rll[0].Split( '/' );
+
+            List<string> retll = new List<string>();
+            foreach ( var item in ret )
+            {
+                if ( item.Equals( "ok" ) || item.Equals( "nok" ) || item.Equals( index ) )
+                    continue;
+
+                retll.Add( item );
+            }
+
+            return retll;
+        }
+
+        List<string> RequestDrive( string key, string msg )
+        {
+            logger.D( $"[Request] - {key} / {msg}" );
+
+            var client = this.CreateRequestSocket( endServer );
+            client.SendMoreFrame( key ).SendFrame( msg );
+
+            var ll = new List<string>();
+
+            //if ( !client.Poll( TimeSpan.FromMilliseconds( 2000 ) ) )
+            //    isSuccess = false;
+
+            if ( !client.TryReceiveMultipartStrings( TimeSpan.FromSeconds( 1 ), ref ll ) )
+                logger.D( $"[Reply Timeout] - {key} / {msg}" );
+
+            this.TerminateRequestSocket( client );
+
+            return ll;
+        }
+
+        RequestSocket CreateRequestSocket( string endServer )
+        {
+            var guid = Guid.NewGuid();
+            var client = new RequestSocket
+            {
+                Options =
+                {
+                    Linger = TimeSpan.Zero,
+                    Identity = Encoding.Unicode.GetBytes(guid.ToString())
+                }
+            };
+
+            client.Connect( endServer );
+            //client.ReceiveReady += Client_ReceiveReady;
+
+            return client;
+        }
+
+        void TerminateRequestSocket( RequestSocket client )
+        {
+            client.Disconnect( this.endServer );
+            client.Close();
+        }
+
+        private void Client_ReceiveReady( object sender, NetMQSocketEventArgs e )
+        {
+            var rsp = e.Socket.ReceiveMultipartStrings();
+
+            logger.D( $"[Reply] - {rsp[0]} / {rsp[1]}" );
+
+            switch ( rsp[0] )
+            {
+                case "3009":
+                    break;
+                default:
+                    break;
+            }
+        }
+        #endregion
+
         #region Get Request Method
         public eOperatationMode GetOperationMode()
         {
-            List<string> rll;
-            if ( !this.GetRequst( "111", out rll ) )
+            var rll = GetRequest( "111" );
+            if ( rll.Count == 0 )
             {
                 logger.E( $"[Get Operation Mode] - Response Time Out" );
                 return eOperatationMode.InitialMode;
             }
 
-            if ( rll[0].Equals( "1" ) )
+            if ( rll[0].Equals( "4" ) )
                 return eOperatationMode.AutoMode;
             else
                 return eOperatationMode.ManualMode;
+
+
+            //List<string> rll;
+            //if ( !this.GetRequst( "111", out rll ) )
+            //{
+            //    logger.E( $"[Get Operation Mode] - Response Time Out" );
+            //    return eOperatationMode.InitialMode;
+            //}
+
+            //if ( rll[0].Equals( "1" ) )
+            //    return eOperatationMode.AutoMode;
+            //else
+            //    return eOperatationMode.ManualMode;
         }
 
         public int GetCurrentPointNo()
         {
             int ret = 0;
-            List<string> rll;
-            if ( this.GetRequst( "3009", out rll ) )
-            {
-                int.TryParse( rll[0], out ret );
-            }
-            else
-                logger.E( $"[Get Current Point] - Response Time Out" );
+
+            var rll = this.GetRequest( "3009" );
+            if ( rll.Count == 0 )
+                return 0;
+
+            if ( !int.TryParse( rll[0], out ret ) )
+                logger.E( $"[Get Current Point] - Try Parse Error" );
 
             return ret;
+
+            //if ( this.GetRequst( "3009", out rll ) )
+            //{
+            //    int.TryParse( rll[0], out ret );
+            //}
+            //else
+            //    logger.E( $"[Get Current Point] - Response Time Out" );
+
+            //return ret;
         }
         #endregion
 
@@ -625,33 +716,55 @@ namespace VehicleControlSystem.ControlLayer.MQ
             else
                 cmd = "2";
 
-            if ( !SetRequest( "3031", cmd ) )
+            var rll = this.RequestDrive( "setm", $"3031/{cmd}" );
+            if ( rll.Count == 0 )
             {
                 logger.E( $"[Set Start Move] - Response Time Out" );
                 return 38;
             }
 
+            //if ( !SetRequest( "3031", cmd ) )
+            //{
+            //    logger.E( $"[Set Start Move] - Response Time Out" );
+            //    return 38;
+            //}
+
             return ConstInt.EXECUTE_SUCCESS;
         }
+
         internal int SetTargetPoint( string point )
         {
-            if ( !SetRequest( "3033", point ) )
+            var rll = this.RequestDrive( "setm", $"3033/{point}" );
+            if ( rll.Count == 0 )
             {
                 logger.E( $"[Set TargetPoint] - Response Time Out" );
                 return 38;
             }
 
+            //if ( !SetRequest( "3033", point ) )
+            //{
+            //    logger.E( $"[Set TargetPoint] - Response Time Out" );
+            //    return 38;
+            //}
+
             return ConstInt.EXECUTE_SUCCESS;
         }
 
-        internal int SetTargetPointArray(string point )
+        internal int SetTargetPointArray( string point )
         {
-            if ( !SetRequest( "3034", point ) )
+            var rll = this.RequestDrive( "setm", $"3034/{point}" );
+            if ( rll.Count == 0 )
             {
                 logger.E( $"[Set TargetPoint] - Response Time Out" );
                 return 38;
             }
 
+            //if ( !SetRequest( "3034", point ) )
+            //{
+            //    logger.E( $"[Set TargetPoint] - Response Time Out" );
+            //    return 38;
+            //}
+
             return ConstInt.EXECUTE_SUCCESS;
         }
 
@@ -677,9 +790,13 @@ namespace VehicleControlSystem.ControlLayer.MQ
                 default:
                     break;
             }
-            if ( !this.SetRequest( "5001", val ) )
+
+            var rll = this.RequestDrive( "setm", $"5001/{val}" );
+            if ( rll.Count == 0 )
                 logger.E( $"[Set Obstruction] - Response Time Out" );
 
+            //if ( !this.SetRequest( "5001", val ) )
+            //    logger.E( $"[Set Obstruction] - Response Time Out" );
         }
 
         internal void SetOperationState( eOperatationMode mode )
@@ -688,14 +805,18 @@ namespace VehicleControlSystem.ControlLayer.MQ
             string val = string.Empty;
 
             if ( mode == eOperatationMode.AutoMode )
-                val = "1";
+                val = "2";
             else if ( mode == eOperatationMode.ManualMode )
-                val = "0";
+                val = "3";
             else
-            { }
+                return;
 
-            if ( !SetRequest( "112", val ) )
+            var rll = this.RequestDrive( "setm", $"112/{val}" );
+            if ( rll.Count == 0 )
                 logger.E( $"[Set Operation State] - Response Time Out" );
+
+            //if ( !SetRequest( "112", val ) )
+            //    logger.E( $"[Set Operation State] - Response Time Out" );
         }
 
         internal void SetMCState( bool isOn )
@@ -708,8 +829,12 @@ namespace VehicleControlSystem.ControlLayer.MQ
             else
                 val = "0";
 
-            if ( !this.SetRequest( "5000", val ) )
+            var rll = this.RequestDrive( "setm", $"5000/{val}" );
+            if ( rll.Count == 0 )
                 logger.E( $"[Set MCState] - Response Time Out" );
+
+            //if ( !this.SetRequest( "5000", val ) )
+            //    logger.E( $"[Set MCState] - Response Time Out" );
         }
 
         internal void SetCurrentSteeringState( eSteeringState state )
@@ -731,11 +856,150 @@ namespace VehicleControlSystem.ControlLayer.MQ
                 default:
                     break;
             }
-            if ( !this.SetRequest( "3060", val ) )
+            var rll = this.RequestDrive( "setm", $"3060/{val}" );
+            if ( rll.Count == 0 )
+            {
                 logger.E( $"[Set Current Steering] - Response Time Out" );
+                return;
+            }
+
+            //if ( !this.SetRequest( "3060", val ) )
+            //    logger.E( $"[Set Current Steering] - Response Time Out" );
 
             logger.D( $"[Steering_Req] - 3060/{val}" );
         }
+
+        internal void SetSafetyBumper()
+        {
+            var rll = this.RequestDrive( "setm", $"6105/1" );
+            if ( rll.Count == 0 )
+            {
+                logger.E( $"[Set Safety Bumper] - Bumper is Pushed Time Out" );
+                return;
+            }
+
+            //if ( !this.SetRequest( "6105", "1" ) )
+            //    logger.E( $"[Set Safety Bumper] - Bumper is Pushed Time Out" );
+
+            logger.D( $"[Set Safety Bumper] - Bumper is Pushed" );
+        }
+
+        /// <summary>
+        /// forward 1, backward -1
+        /// </summary>
+        /// <param name="isForward"></param>
+        internal void SetJogMove(bool isForward = true )
+        {
+            string v = string.Empty;
+            if ( isForward )
+                v = "1";
+            else
+                v = "-1";
+
+            var rll = this.RequestDrive( "setm", $"4091/1" );
+            if ( rll.Count == 0 )
+            {
+                logger.E( $"[Set Jog Move] - Jog Move Time Out" );
+                return;
+            }
+        }
+
+        #endregion
+
+        #region Get/Set Parameter
+        internal double GetJogSpeed()
+        {
+            var rll = this.RequestDrive( "getm", "4053" );
+            if ( rll.Count == 0 )
+            {
+                logger.E( $"[Set Jog Speed] - Jog Speed Time Out" );
+                return 0d;
+            }
+
+            double ret = 0d;
+            double.TryParse( rll[0], out ret );
+
+            return ret;
+        }
+
+        /// <summary>
+        /// 전진 후진 동시에 같은 값으로 설정.
+        /// </summary>
+        /// <param name="speed"></param>
+        internal void SetJogSpeed( double speed )
+        {
+            var rll = this.RequestDrive( "setm", $"4053/{speed}/{speed}" );
+            if ( rll.Count == 0 )
+            {
+                logger.E( $"[Set Drive Speed] - Drive Speed Time Out" );
+                return;
+            }
+
+            //if ( !this.SetRequest( "6105", "1" ) )
+            //    logger.E( $"[Set Safety Bumper] - Bumper is Pushed Time Out" );
+
+            logger.D( $"[Set Jog Speed] - Set Jog Speed {speed}" );
+        }
+
+        internal double GetDriveLinerSpeed()
+        {
+            var rll = this.RequestDrive( "getm", "3016" );
+            if ( rll.Count == 0 )
+            {
+                logger.E( $"[Set Drive Speed] - Drive Speed Time Out" );
+                return 0d;
+            }
+
+            double ret = 0d;
+            double.TryParse( rll[0], out ret );
+
+            return ret;
+        }
+        internal double GetDriveCurveSpeed()
+        {
+            var rll = this.RequestDrive( "getm", "3016" );
+            if ( rll.Count == 0 )
+            {
+                logger.E( $"[Set Drive Speed] - Drive Speed Time Out" );
+                return 0d;
+            }
+
+            double ret = 0d;
+            double.TryParse( rll[1], out ret );
+
+            return ret;
+        }
+
+        internal void SetDriveSpeed( string liner, string curve )
+        {
+            var rll = this.RequestDrive( "setm", $"3016/{liner}/{curve}" );
+            if ( rll.Count == 0 )
+            {
+                logger.E( $"[Set Drive Speed] - Drive Speed Time Out" );
+                return;
+            }
+
+            //if ( !this.SetRequest( "6105", "1" ) )
+            //    logger.E( $"[Set Safety Bumper] - Bumper is Pushed Time Out" );
+
+            logger.D( $"[Set Drive Speed] - Set Drive Speed Liner{liner}, Curve{curve}" );
+        }
+
+        internal void SetDriveSpeedProfile( string accel, string decel, string creep, string creepDistance )
+        {
+            var rll = this.RequestDrive( "setm", $"3013/{accel}/{decel}/{creep}/{creepDistance}" );
+            if ( rll.Count == 0 )
+            {
+                logger.E( $"[Set Drive Speed] - Drive Speed Time Out" );
+                return;
+            }
+
+            //if ( !this.SetRequest( "6105", "1" ) )
+            //    logger.E( $"[Set Safety Bumper] - Bumper is Pushed Time Out" );
+
+            logger.D( $"[Set Drive Speed] - Set Drive Speed Accel {accel}, Decel {decel}, Creep{creep}/{creepDistance}" );
+        }
+
         #endregion
     }
 }

+ 73 - 64
Dev/OHV/VehicleControlSystem/ControlLayer/Steering.cs

@@ -2,6 +2,7 @@
 using System.Threading.Tasks;
 using GSG.NET.Concurrent;
 using GSG.NET.Logging;
+using GSG.NET.Quartz;
 using GSG.NET.Utils;
 using OHV.Common.Shareds;
 using OHV.SqliteDAL;
@@ -25,10 +26,10 @@ namespace VehicleControlSystem.ControlLayer
         public eSteeringState SteeringState
         {
             get { return steeringState; }
-            set { SetField( ref this.steeringState , value ); }
+            set { SetField( ref this.steeringState, value ); }
         }
 
-        public Steering( IIO io , SqliteManager sql , IEventAggregator ea )
+        public Steering( IIO io, SqliteManager sql, IEventAggregator ea )
         {
             this.iO = io as EzIO;
             this.sql = sql;
@@ -45,7 +46,7 @@ namespace VehicleControlSystem.ControlLayer
             //    this.GetSteeringState();
         }
 
-        public eSteeringState GetSteeringState( )
+        public eSteeringState GetSteeringState()
         {
             eSteeringState frontState = eSteeringState.None;
             //if ( this.IsFrontLeft() && this.IsFrontRight() )
@@ -94,87 +95,95 @@ namespace VehicleControlSystem.ControlLayer
         }
 
         bool isExecuteSteering = false;
+        readonly object lockObject = new object();
         public int ControlSteering( bool isLeft = false )
         {
-            if ( this.isExecuteSteering )
-                return 0;
+            //if ( this.isExecuteSteering )
+            //    return 0;
 
-            this.isExecuteSteering = true;
+            //this.isExecuteSteering = true;
+            var sT = SwUtils.CurrentTimeMillis;
 
-            if ( isLeft ) //Left IO 가 직진 이라고 생각하자.
+            lock ( lockObject )
             {
-                this.iO.WriteOutputIO( "OUT_F_STEERING_CWCCW" , false );
-                this.iO.WriteOutputIO( "OUT_R_STEERING_CWCCW" , true );
-                this.SetHightVolt();
-                if ( this.SteeringState == eSteeringState.Left )
+                if ( isLeft ) //Left IO 가 직진 이라고 생각하자.
                 {
-                    this.isExecuteSteering = false;
-                    return 0;
+                    this.iO.WriteOutputIO( "OUT_F_STEERING_CWCCW", false );
+                    this.iO.WriteOutputIO( "OUT_R_STEERING_CWCCW", true );
+                    this.SetHightVolt();
+                    if ( this.SteeringState == eSteeringState.Left )
+                    {
+                        this.isExecuteSteering = false;
+                        return 0;
+                    }
                 }
-            }
-            else
-            {
-                this.iO.WriteOutputIO( "OUT_F_STEERING_CWCCW" , true );
-                this.iO.WriteOutputIO( "OUT_R_STEERING_CWCCW" , false );
-                this.SetHightVolt();
-                if ( this.SteeringState == eSteeringState.Right )
+                else
                 {
-                    this.isExecuteSteering = false;
-                    return 0;
+                    this.iO.WriteOutputIO( "OUT_F_STEERING_CWCCW", true );
+                    this.iO.WriteOutputIO( "OUT_R_STEERING_CWCCW", false );
+                    this.SetHightVolt();
+                    if ( this.SteeringState == eSteeringState.Right )
+                    {
+                        this.isExecuteSteering = false;
+                        return 0;
+                    }
                 }
-            }
 
-            var task = Task<bool>.Run( ( ) =>
-             {
-                 long sTime = SwUtils.CurrentTimeMillis;
-                 while ( true )
+                var task = Task<bool>.Run( () =>
                  {
-                     LockUtils.Wait( 5 );
-
-                     if ( SwUtils.Gt( sTime , 3 * ConstUtils.ONE_SECOND ) ) //Wait 3Sec
-                         return false;
-
-                     if ( isLeft )
+                     long sTime = SwUtils.CurrentTimeMillis;
+                     while ( true )
                      {
-                         if ( this.IsLeft())
-                             break;
+                         LockUtils.Wait( 5 );
+
+                         if ( SwUtils.Gt( sTime, 2 * ConstUtils.ONE_SECOND ) ) //Wait 3Sec
+                             return false;
+
+                         if ( isLeft )
+                         {
+                             if ( this.IsLeft() )
+                                 break;
+                         }
+                         else
+                         {
+                             if ( this.IsRight() )
+                                 break;
+                         }
                      }
-                     else
-                     {
-                         if ( this.IsRight() )
-                             break;
-                     }
-                 }
-                 return true;
-             } ).ContinueWith( t =>
-                  {
-                      if ( !t.Result )
-                          this.OnSteeringError?.BeginInvoke( this , 33 , null , null );
-                      else
-                          this.OnSteeringError?.BeginInvoke( this , 0 , null , null );
-
-                      LockUtils.Wait( 200 );
-                      GetSteeringState();
-                      this.isExecuteSteering = false;
-                  } );
+                     return true;
+                 } ).ContinueWith( t =>
+                      {
+                          if ( !t.Result )
+                              this.OnSteeringError?.BeginInvoke( this, 33, null, null );
+                          else
+                              this.OnSteeringError?.BeginInvoke( this, 0, null, null );
+
+                          logger.D( $"[Steer Release Lock] - {SwUtils.Elapsed( sT )} ms" );
+
+                          LockUtils.Wait( 200 );
+                          GetSteeringState();
+                          this.isExecuteSteering = false;
+
+                      } );
+            }
 
             return 0;
         }
 
-        void SetHightVolt( )
+        void SetHightVolt()
         {
-            this.iO.WriteOutputIO( "OUT_F_STEERING_DA" , true );
-            this.iO.WriteOutputIO( "OUT_R_STEERING_DA" , true );
-            this.iO.WriteOutputIO( "OUT_F_STEERING_DA" , false , 400 );
-            this.iO.WriteOutputIO( "OUT_R_STEERING_DA" , false , 700 );
+            this.iO.WriteOutputIO( "OUT_F_STEERING_DA", true );
+            this.iO.WriteOutputIO( "OUT_R_STEERING_DA", true );
+            this.iO.WriteOutputIO( "OUT_F_STEERING_DA", false, 400 );
+            this.iO.WriteOutputIO( "OUT_R_STEERING_DA", false, 700 );
         }
 
-        bool IsFrontLeft( ) => this.iO.IsOn( "IN_F_STEERING_DETECT_LEFT" );
-        bool IsFrontRight( ) => this.iO.IsOn( "IN_F_STEERING_DETECT_RIGHT" );
-        bool IsRearLeft( ) => this.iO.IsOn( "IN_R_STEERING_DETECT_LEFT" );
-        bool IsRearRight( ) => this.iO.IsOn( "IN_R_STEERING_DETECT_RIGHT" );
+        bool IsFrontLeft() => this.iO.IsOn( "IN_F_STEERING_DETECT_LEFT" );
+        bool IsFrontRight() => this.iO.IsOn( "IN_F_STEERING_DETECT_RIGHT" );
+        bool IsRearLeft() => this.iO.IsOn( "IN_R_STEERING_DETECT_LEFT" );
+        bool IsRearRight() => this.iO.IsOn( "IN_R_STEERING_DETECT_RIGHT" );
 
-        public bool IsLeft( ) => this.IsFrontLeft() && this.IsRearLeft();
-        public bool IsRight( ) => this.IsFrontRight() && this.IsRearRight();
+        public bool IsLeft() => this.IsFrontLeft() && this.IsRearLeft();
+        public bool IsRight() => this.IsFrontRight() && this.IsRearRight();
     }
 }

+ 40 - 15
Dev/OHV/VehicleControlSystem/ControlLayer/Vehicle.cs

@@ -235,9 +235,11 @@ namespace VehicleControlSystem.ControlLayer
                         this.OnChargingStart?.Invoke();
                         LockUtils.Wait( 200 );
                         this.OnCharging?.Invoke();
+
+                        QuartzUtils.Invoke( "BatterLogger", QuartzUtils.GetExpnMinute( 1 ), () => { batteryLogger.I( $"SOC - {this.BatteryStateOfCharge} / Current - {this.BatteryCurrent} / Voltage - {this.BatteryVoltage} / Capacity - {this.BatteryCapacity} / Energy - {this.BatteryEnergy}" ); } );
                     }
-                    //else
-                    //    this.OnChargingFull?.Invoke();
+                    else
+                        QuartzUtils.StopSchedule( "BatterLogger" );
                 }
             }
         }
@@ -295,7 +297,7 @@ namespace VehicleControlSystem.ControlLayer
         public double BatteryStateOfHealth
         {
             get { return this.batteryStateOfHealth; }
-            set 
+            set
             {
                 if ( this.SetField( ref this.batteryStateOfHealth, value ) ) { }
             }
@@ -657,6 +659,9 @@ namespace VehicleControlSystem.ControlLayer
 #else
             int result = 0;
 
+            //PIOClear();
+            //PIOSensorOff();
+
             if ( this.refObjects.Conveyor.IsDetectedCenter() ) //자제가 있으면 Lock
                 result = this.refObjects.Clamp.Lock_Sync();
             else
@@ -941,9 +946,11 @@ namespace VehicleControlSystem.ControlLayer
         #region For Moving
         void Move( SubCmd sub )
         {
+            logger.I( $"[SubCommand Start] - Target : {sub.TargetID} / Type : {sub.Type}" );
+
             //Move 시작 시 충전 중이면 충전 중지 실행.
             int result = 0;
-            if ( this.CheckBatteryCharge() || this.VehicleStateProperty == eVehicleState.Charge || this.BatteryChargeState)
+            if ( this.CheckBatteryCharge() || this.VehicleStateProperty == eVehicleState.Charge || this.BatteryChargeState )
             {
                 result = this.StopBatteryCharge();
                 if ( result != 0 )
@@ -968,7 +975,7 @@ namespace VehicleControlSystem.ControlLayer
             this.taskMoveCancel.Cancel();
             this.taskMoveCancel.WaitAll();
 
-            logger.D( $"[Move Command Complete] {sub.TargetID}" );
+            logger.I( $"[SubCommand Complete] - Target : {sub.TargetID} / Type : {sub.Type}" );
         }
 
         int MoveTo( SubCmd sub )
@@ -1076,6 +1083,8 @@ namespace VehicleControlSystem.ControlLayer
 
         public bool LoadCarrier( SubCmd sub )
         {
+            logger.I( $"[SubCommand Start] - Target : {sub.TargetID} / Type : {sub.Type}" );
+
             this.VehicleStateProperty = eVehicleState.Load;
 
             //var route = sql.RouteDal.GetRoute( sub.TargetID );
@@ -1098,6 +1107,7 @@ namespace VehicleControlSystem.ControlLayer
             this.PIOSensorOff();
 
             //Load, Unload 가 끝나면 메인 Command 를 완료 했다고 판단.
+            logger.I( $"[SubCommand Complete] - Target : {sub.TargetID} / Type : {sub.Type}" );
             sql.SubCmdDAL.Clean();
             var cmd = sql.CommandDAL.GetById( sub.CmdID );
             if ( cmd != null )
@@ -1117,6 +1127,8 @@ namespace VehicleControlSystem.ControlLayer
 
         public bool UnloadCarrier( SubCmd sub )
         {
+            logger.I( $"[SubCommand Start] - Target : {sub.TargetID} / Type : {sub.Type}" );
+
             this.VehicleStateProperty = eVehicleState.Unload;
 
             var targetNo = Convert.ToInt32( sub.TargetID );
@@ -1153,6 +1165,7 @@ namespace VehicleControlSystem.ControlLayer
 
             this.PIOSensorOff();
 
+            logger.I( $"[SubCommand Complete] - Target : {sub.TargetID} / Type : {sub.Type}" );
             sql.SubCmdDAL.Clean();
             var cmd = sql.CommandDAL.GetById( sub.CmdID );
             if ( cmd != null )
@@ -1167,8 +1180,6 @@ namespace VehicleControlSystem.ControlLayer
             //this.OnUnloadComplete?.Invoke(); //일찍 주면 다음 명령을 500ms 안에 주는 현상 있음. 그러니까 천천히 주자 
             this.VehicleStateProperty = eVehicleState.Idle;
 
-            logger.D( $"[Unloading End]--------------------------------------" );
-
             return true;
         }
 
@@ -1410,7 +1421,7 @@ namespace VehicleControlSystem.ControlLayer
             if ( this.refObjects.IO.IsOff( "IN_OBSTRUCTION_DETECT_SAFETY" ) || this.refObjects.IO.IsOff( "IN_OBSTRUCTION_DETECT_ERROR" ) )
             {
                 this.ObstacleStateProperty = eObstacleState.Abnormal;
-                this.OccurVehicleAlarm( 42 );
+                //this.OccurVehicleAlarm( 42 );
             }
             else if ( this.refObjects.IO.IsOff( "IN_OBSTRUCTION_DETECT_STOP" ) )
             {
@@ -1425,7 +1436,7 @@ namespace VehicleControlSystem.ControlLayer
                 this.ObstacleStateProperty = eObstacleState.Normal;
             }
 
-            //this.refObjects.Drive.SetObstacleState( this.ObstacleStateProperty );
+            this.refObjects.Drive.SetObstacleState( this.ObstacleStateProperty );
 
             return false;
         }
@@ -1793,7 +1804,7 @@ namespace VehicleControlSystem.ControlLayer
                                 return result;
                             }
                         }
-                        else 
+                        else
                             return 0;
                     }
                 }
@@ -1837,23 +1848,23 @@ namespace VehicleControlSystem.ControlLayer
         #endregion
 
         #region Help Method
-        void BatteryChargeStateLED(double percent )
+        void BatteryChargeStateLED( double percent )
         {
-            if ( percent > 65 )
+            if ( percent > 60 )
             {
                 this.refObjects.IO.WriteOutputIO( "OUT_BATTERY_LED_00", true );
                 this.refObjects.IO.WriteOutputIO( "OUT_BATTERY_LED_01", true );
                 this.refObjects.IO.WriteOutputIO( "OUT_BATTERY_LED_02", true );
                 this.refObjects.IO.WriteOutputIO( "OUT_BATTERY_LED_03", true );
             }
-            else if ( percent > 50 )
+            else if ( percent > 45 )
             {
                 this.refObjects.IO.WriteOutputIO( "OUT_BATTERY_LED_00", true );
                 this.refObjects.IO.WriteOutputIO( "OUT_BATTERY_LED_01", true );
                 this.refObjects.IO.WriteOutputIO( "OUT_BATTERY_LED_02", true );
                 this.refObjects.IO.WriteOutputIO( "OUT_BATTERY_LED_03", false );
             }
-            else if ( percent > 40 )
+            else if ( percent > 30 )
             {
                 this.refObjects.IO.WriteOutputIO( "OUT_BATTERY_LED_00", true );
                 this.refObjects.IO.WriteOutputIO( "OUT_BATTERY_LED_01", true );
@@ -1885,6 +1896,7 @@ namespace VehicleControlSystem.ControlLayer
             var obstacle = RouteManager.Instance.Obstacles.Where( o => o.segmentID == v ).Single();
 
             this.ChgObstacleDetectPattern( obstacle.fieldset );
+            logger.D( $"[Obstacle Pattern Chg] - {obstacle.fieldset}" );
         }
 
         /// <summary>
@@ -2099,6 +2111,7 @@ namespace VehicleControlSystem.ControlLayer
                             default:
                                 break;
                         }
+                        logger.D( $"[Request Steering] - {v}" );
                     }
                     break;
 
@@ -2310,7 +2323,13 @@ namespace VehicleControlSystem.ControlLayer
                             this.VehicleStateProperty = eVehicleState.Idle;
                     }
                     else
-                        this.OccurVehicleAlarm( 29 );
+                    {
+                        if ( this.ObstacleStateProperty == eObstacleState.Abnormal )
+                            this.OccurVehicleAlarm( 42 );
+                        else
+                            this.OccurVehicleAlarm( 29 );
+
+                    }
                     break;
 
                 case "IN_EMS_SW":
@@ -2328,6 +2347,7 @@ namespace VehicleControlSystem.ControlLayer
                         this.OccurVehicleAlarm( 30 );
                     break;
 
+
                 case "IN_OBSTRUCTION_DETECT_ERROR":
                 case "IN_OBSTRUCTION_DETECT_SAFETY":
                 case "IN_OBSTRUCTION_DETECT_STOP":
@@ -2335,6 +2355,11 @@ namespace VehicleControlSystem.ControlLayer
                     CheckObstacle();
                     break;
 
+                case "IN_BUMPER_DETECT":
+                    if ( bit.IsBitOn )
+                        this.refObjects.ZmqManager.SetSafetyBumper();
+                    break;
+
                 default:
                     break;
             }

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

@@ -319,6 +319,8 @@ namespace VehicleControlSystem.Managers
             }
             sql.HisAlarmDAL.Insert( hisAlarm );
 
+            logger.I( $"[Alarm Occur] - ID : {alarmID} / Text : {hisAlarm.Text}" );
+
             //UI 로는 처음 발생한 Error 만 전송한다.
             if ( IsErrorProcessing )
                 return;

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

@@ -85,6 +85,7 @@ namespace VehicleControlSystem.Managers
             try
             {
                 this.sql.CommandDAL.Insert( cmd );
+                logger.I( $"[Command Added] - Target : {cmd.TargetID} / Type : {cmd.Type}" );
             }
             catch ( Exception ex )
             {
@@ -166,7 +167,7 @@ namespace VehicleControlSystem.Managers
             if ( !IsCreateDryRunCommand )
                 return;
 
-            if ( this.bMUManager.ReceivedDataDic[eDataKind.SOC].Value <= 30 )
+            if ( this.bMUManager.ReceivedDataDic[eDataKind.SOC].Value <= 15 )
             {
                 var chargePoint = "2";
                 Command chageCmd = new Command() { TargetID = chargePoint, Type = eCommandType.Charging };
@@ -305,6 +306,7 @@ namespace VehicleControlSystem.Managers
 
                 case OHV.Common.Shareds.eCommandState.Complete:
                     sql.CommandDAL.Delete( cmd.CommandID );
+                    logger.I( $"[Command Deleted] - Target : {cmd.TargetID} / Type : {cmd.Type}" );
                     break;
                 default:
                     break;