Browse Source

현장 작업 업데이트

ys-hwang 6 years ago
parent
commit
48490f5cba

+ 1 - 0
Dev/OHV/OHV.Common/Events/MessageEventArgs.cs

@@ -112,6 +112,7 @@ namespace OHV.Common.Events
         {
             NONE = -1,
             OriginReturn,
+            AllOriginReturn,
             Stop,
             EStop,
             Move,

+ 4 - 3
Dev/OHV/OHV.Module.Interactivity/PopUp/BatteryConfigView.xaml

@@ -54,10 +54,11 @@
             <StackPanel VerticalAlignment="Center"
                         HorizontalAlignment="Right"
                         Margin="1">
-                <Button Margin="1" HorizontalAlignment="Center" Height="45" BorderBrush="Gray" BorderThickness="1" Background="{x:Null}">
+                <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"/>
-                        <TextBlock Margin="2" Text="{Binding BatteryConnect, FallbackValue=DisConnecting}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
+                        <TextBlock Margin="2" Text="{Binding BatteryConnect, FallbackValue=STATUS}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                     </StackPanel>
                 </Button>
             </StackPanel>
@@ -154,7 +155,7 @@
                                VerticalAlignment="Center"
                                HorizontalAlignment="Center"
                                Foreground="Orange" FontSize="20">
-                                <Run Text="{Binding AvereageTimeToFull,StringFormat={}{0:0.0}H, FallbackValue=H}"/>
+                                <Run Text="{Binding AverageTimeToFull,StringFormat={}{0:0.0}H, FallbackValue=H}"/>
                         </TextBlock>
                     </Border>
 

+ 5 - 1
Dev/OHV/OHV.Module.Interactivity/PopUp/BatteryConfigViewModel.cs

@@ -13,6 +13,7 @@ using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Input;
 using System.Windows.Media;
+using VehicleControlSystem;
 
 namespace OHV.Module.Interactivity.PopUp
 {
@@ -120,8 +121,11 @@ namespace OHV.Module.Interactivity.PopUp
         public ICommand BatteryOpenCommand { get; set; }
         public ICommand BatteryCloseCommand { get; set; }
 
+
         IEventAggregator eventAggregator = null;
-        public BatteryConfigViewModel( IEventAggregator _ea )
+        VCSystem vcSystem;
+
+        public BatteryConfigViewModel( IEventAggregator _ea, VCSystem vcSystem)
         {
             this.eventAggregator = _ea;
             this.eventAggregator.GetEvent<GUIMessagePubSubEvent>().Unsubscribe( UICallbackCommunication );

+ 11 - 2
Dev/OHV/OHV.Module.Interactivity/PopUp/LockServoView.xaml

@@ -457,7 +457,6 @@
                     </StackPanel>
                 </Button>
 
-
                 <Button Margin="10,10,10,5" HorizontalAlignment="Stretch" Height="90" BorderBrush="Gray" BorderThickness="2" Command="{Binding CurrentToTargetCommand}"
                         Style="{DynamicResource MaterialDesignRaisedButton}"
                         materialDesign:ShadowAssist.ShadowDepth="Depth5">
@@ -467,8 +466,18 @@
                         <TextBlock Text="To Target" FontSize="18" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
                     </StackPanel>
                 </Button>
+            </StackPanel>
 
-
+            <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,40,0,0">
+                <Button Margin="10,10,10,10" HorizontalAlignment="Stretch" Height="90" Width="110" BorderBrush="Gray" BorderThickness="2" Command="{Binding AllOriginCommand}"
+                        Style="{DynamicResource MaterialDesignRaisedButton}"
+                        materialDesign:ShadowAssist.ShadowDepth="Depth5">
+                    <StackPanel>
+                        <!--<materialDesign:PackIcon Kind="GearBox" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>-->
+                        <TextBlock Text="ALL" FontSize="20" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
+                        <TextBlock Text="Origin" FontSize="18" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
+                    </StackPanel>
+                </Button>
             </StackPanel>
         </Grid>
 

+ 28 - 0
Dev/OHV/OHV.Module.Interactivity/PopUp/LockServoViewModel.cs

@@ -193,6 +193,7 @@ namespace OHV.Module.Interactivity.PopUp
         public ICommand SelectedPosDataSave { get; set; }
         public ICommand JogVelPopupCommand { get; set; }
         public ICommand JogStopCommand { get; set; } 
+        public ICommand AllOriginCommand { get; set; }
         #endregion
 
         public event Action<IDialogResult> RequestClose;
@@ -213,6 +214,7 @@ namespace OHV.Module.Interactivity.PopUp
             this.ServoOffCommand = new DelegateCommand<object>( ExecuteServoOffCommand );
             this.FaultResetCommand = new DelegateCommand<object>( ExecuteFaultResetCommand );
             this.OriginCommand = new DelegateCommand<object>( ExecuteOriginCommand );
+            this.AllOriginCommand = new DelegateCommand( ExecuteAllOriginCommand );
 
             this.SelectedPosDataSave = new DelegateCommand<object>( ExecuteSelectedPosDataSave );
             this.JogCommand = new DelegateCommand<object>( ExecuteJogCommand );
@@ -233,6 +235,17 @@ namespace OHV.Module.Interactivity.PopUp
             //초기 선택 축
         }
 
+        private void ExecuteAllOriginCommand( )
+        {
+            var msg = new AxisControlEventArgs
+            {
+                Dir = eEventDir.ToBack ,
+                Kind = eAxisControlKind.AllOriginReturn ,
+            };
+
+            this.PublishEvent( msg );
+        }
+
         public void Init()
         {
             this.SelectAxis = ConstString.AXIS_CARRIER_LOCK_LEFT;
@@ -381,6 +394,21 @@ namespace OHV.Module.Interactivity.PopUp
                     case eAxisControlKind.AxisState:
                         AxisState( args );
                         break;
+                    case eAxisControlKind.AllOriginReturn:
+                        {
+                            var msg = string.Empty;
+                            if ( args.Result.IsSuccess )
+                                msg = $"All Origin Success";
+                            else
+                                msg = $"{args.Result.Reasons[0].Message}";
+
+                            this.messageController.ShowNotificationView( msg );
+                        }
+                        break;
+                    case eAxisControlKind.SyncMove:
+                        break;
+                    case eAxisControlKind.SyncState:
+                        break;
                     default:
                         break;
                 }

+ 4 - 2
Dev/OHV/OHV.Module.MainViews/MainViewModules.cs

@@ -19,13 +19,15 @@ namespace OHV.Module.MainViews
             /* view model assign*/
             ViewModelLocationProvider.Register<AutoView , AutoViewModel>();
             ViewModelLocationProvider.Register<TeachView , TeachViewModel>();
-            ViewModelLocationProvider.Register<UnitView , UnitViewModel>();
+            ViewModelLocationProvider.Register<EditView , EditViewModel>();
+            ViewModelLocationProvider.Register<ControlView , ControlViewModel>();
             ViewModelLocationProvider.Register<HistoryView , HistoryViewModel>();
 
             var regionManager = containerProvider.Resolve<IRegionManager>();
             regionManager.RegisterViewWithRegion( RegionNames.MainView , typeof( AutoView ) );
             regionManager.RegisterViewWithRegion( RegionNames.MainView , typeof( TeachView ) );
-            regionManager.RegisterViewWithRegion( RegionNames.MainView , typeof( UnitView ) );
+            regionManager.RegisterViewWithRegion( RegionNames.MainView , typeof( EditView ) );
+            regionManager.RegisterViewWithRegion( RegionNames.MainView , typeof( ControlView ) );
             regionManager.RegisterViewWithRegion( RegionNames.MainView , typeof( HistoryView ) );
         }
 

+ 12 - 12
Dev/OHV/OHV.Module.MainViews/OHV.Module.MainViews.csproj

@@ -94,17 +94,20 @@
     <Compile Include="Views\AutoViewModel.cs">
       <DependentUpon>AutoView.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\ControlViewModel.cs">
+      <DependentUpon>ControlView.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditViewModel.cs">
+      <DependentUpon>EditView.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\HistoryView.xaml.cs">
       <DependentUpon>HistoryView.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\HistoryViewModel.cs">
       <DependentUpon>HistoryView.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\SettingView.xaml.cs">
-      <DependentUpon>SettingView.xaml</DependentUpon>
-    </Compile>
-    <Compile Include="Views\SettingViewModel.cs">
-      <DependentUpon>SettingView.xaml</DependentUpon>
+    <Compile Include="Views\ControlView.xaml.cs">
+      <DependentUpon>ControlView.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\TeachView.xaml.cs">
       <DependentUpon>TeachView.xaml</DependentUpon>
@@ -115,11 +118,8 @@
     <Compile Include="Views\TeachViewModel.cs">
       <DependentUpon>TeachView.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\UnitView.xaml.cs">
-      <DependentUpon>UnitView.xaml</DependentUpon>
-    </Compile>
-    <Compile Include="Views\UnitViewModel.cs">
-      <DependentUpon>UnitView.xaml</DependentUpon>
+    <Compile Include="Views\EditView.xaml.cs">
+      <DependentUpon>EditView.xaml</DependentUpon>
     </Compile>
   </ItemGroup>
   <ItemGroup>
@@ -127,7 +127,7 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\SettingView.xaml">
+    <Page Include="Views\ControlView.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
@@ -139,7 +139,7 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
-    <Page Include="Views\UnitView.xaml">
+    <Page Include="Views\EditView.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>

+ 64 - 0
Dev/OHV/OHV.Module.MainViews/Views/ControlView.xaml

@@ -0,0 +1,64 @@
+<UserControl x:Class="OHV.Module.MainViews.Views.ControlView"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:OHV.Module.MainViews.Views"
+             xmlns:prism="http://prismlibrary.com/"      
+             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             mc:Ignorable="d" 
+             Height="942"
+             Width="Auto"
+             MinWidth="1386"
+             Background="#37474f">
+    <Grid>
+        <Grid Margin="15,15" Background="#263238">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="*"/>
+            </Grid.RowDefinitions>
+
+            <Grid Grid.Row="0">
+                <StackPanel Orientation="Horizontal" Margin="20"
+                                VerticalAlignment="Center"
+                                HorizontalAlignment="Center">
+                    <Button HorizontalAlignment="Stretch"
+                            Style="{StaticResource MaterialDesignRaisedButton}"
+                            Margin="20"
+                            materialDesign:ButtonAssist.CornerRadius="20"
+                            Command="{Binding InoutPupup}"
+                            Height="150" Width="220">
+                        <StackPanel>
+                            <materialDesign:PackIcon Kind="LedOn" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="100"/>
+                            <TextBlock FontSize="30" Text="InOut" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
+                        </StackPanel>
+                    </Button>
+
+                    <Button HorizontalAlignment="Stretch"
+                            Style="{StaticResource MaterialDesignRaisedButton}"
+                            Margin="20"
+                            materialDesign:ButtonAssist.CornerRadius="20"
+                            Command="{Binding OpticalReaderPopup}"
+                            Height="150" Width="220">
+                        <StackPanel>
+                            <materialDesign:PackIcon Kind="Altimeter" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="auto" Height="100"/>
+                            <TextBlock FontSize="30" Text="Detect" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
+                        </StackPanel>
+                    </Button>
+
+                    <Button HorizontalAlignment="Stretch"
+                            Style="{StaticResource MaterialDesignRaisedButton}"
+                            Margin="20"
+                            materialDesign:ButtonAssist.CornerRadius="20"
+                            Command="{Binding ConveyorPopup}"
+                            Height="150" Width="220">
+                        <StackPanel>
+                            <materialDesign:PackIcon Kind="ElevatorUp" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="auto" Height="100"/>
+                            <TextBlock FontSize="30" Text="Conveyor" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
+                        </StackPanel>
+                    </Button>
+                </StackPanel>
+            </Grid>
+        </Grid>
+    </Grid>
+</UserControl>

+ 11 - 3
Dev/OHV/OHV.Module.MainViews/Views/SettingView.xaml.cs

@@ -16,13 +16,21 @@ using System.Windows.Shapes;
 namespace OHV.Module.MainViews.Views
 {
     /// <summary>
-    /// SettingView.xaml에 대한 상호 작용 논리
+    /// ControlView.xaml에 대한 상호 작용 논리
     /// </summary>
-    public partial class SettingView : UserControl
+    public partial class ControlView : UserControl
     {
-        public SettingView( )
+        public ControlViewModel ViewModel { get => this.DataContext as ControlViewModel; }
+        public ControlView( )
         {
             InitializeComponent();
+
+            this.Loaded += ControlView_Loaded;
+        }
+
+        private void ControlView_Loaded( object sender , RoutedEventArgs e )
+        {
+            this.ViewModel.Init();
         }
     }
 }

+ 76 - 0
Dev/OHV/OHV.Module.MainViews/Views/ControlViewModel.cs

@@ -0,0 +1,76 @@
+using OHV.Module.Interactivity;
+using Prism.Commands;
+using Prism.Events;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Input;
+using VehicleControlSystem;
+
+namespace OHV.Module.MainViews.Views
+{
+    public class ControlViewModel : BindableBase
+    {
+        IEventAggregator eventAggregator = null;
+        VCSystem vcSystem = null;
+        MessageController msgController = null;
+
+        #region ICommand
+        public ICommand ServoConfigCommand { get; set; }
+        public ICommand InoutPupup { get; set; }
+        public ICommand BatteryPopup { get; set; }
+        public ICommand OpticalReaderPopup { get; set; }
+        public ICommand ConfigCommand { get; set; }
+        public ICommand ConveyorPopup { get; set; } 
+        #endregion
+
+        public ControlViewModel( IEventAggregator _ea , VCSystem _vcSystem , MessageController _msgController )
+        {
+            this.eventAggregator = _ea;
+            this.vcSystem = _vcSystem;
+            this.msgController = _msgController;
+
+            this.ServoConfigCommand = new DelegateCommand( ExecuteServoConfigCommand );
+            this.InoutPupup = new DelegateCommand( ExecuteInOutCommand );
+            this.BatteryPopup = new DelegateCommand( ExecuteBatteryCommand );
+            this.OpticalReaderPopup = new DelegateCommand( ExecuteOpticalReadCommand );
+            this.ConfigCommand = new DelegateCommand( ExecuteConfigCommand );
+            this.ConveyorPopup = new DelegateCommand( ExecuteConveyorCommand );
+        }
+
+        private void ExecuteConveyorCommand( )
+        {
+            this.msgController.ShowConveyorPopupView();
+        }
+
+        private void ExecuteConfigCommand( )
+        {
+            this.msgController.ShowConfigPopupView();
+        }
+
+        private void ExecuteOpticalReadCommand( )
+        {
+            this.msgController.ShowOpticalReadPopupView();
+        }
+
+        private void ExecuteBatteryCommand( )
+        {
+            this.msgController.ShowBatteryPopupView();
+        }
+
+        private void ExecuteInOutCommand( )
+        {
+            this.msgController.ShowInOutPopupView();
+        }
+
+        private void ExecuteServoConfigCommand( )
+        {
+            this.msgController.ShowServoConfigPopupView();
+        }
+
+        public void Init( ) { }
+    }
+}

+ 21 - 20
Dev/OHV/OHV.Module.MainViews/Views/UnitView.xaml

@@ -1,4 +1,4 @@
-<UserControl x:Class="OHV.Module.MainViews.Views.UnitView"
+<UserControl x:Class="OHV.Module.MainViews.Views.EditView"
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
@@ -24,16 +24,15 @@
 
                 <Grid.RowDefinitions>
                     <RowDefinition Height="*"/>
-                    <RowDefinition Height="*"/>
                 </Grid.RowDefinitions>
 
                 <Grid Grid.Row="0">
                     <StackPanel Orientation="Horizontal"
-                                VerticalAlignment="Bottom"
+                                VerticalAlignment="Center"
                                 HorizontalAlignment="Center" Margin="20">
                         
-                        <Button HorizontalAlignment="Stretch"
-                             Style="{StaticResource MaterialDesignRaisedButton}"
+                        <!--<Button HorizontalAlignment="Stretch"
+                            Style="{StaticResource MaterialDesignRaisedButton}"
                             Margin="20"
                             materialDesign:ButtonAssist.CornerRadius="20"
                             Command="{Binding InoutPupup}"
@@ -42,6 +41,18 @@
                                 <materialDesign:PackIcon Kind="LedOn" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="100"/>
                                 <TextBlock FontSize="30" Text="InOut" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
                             </StackPanel>
+                        </Button>-->
+
+                        <Button HorizontalAlignment="Stretch"
+                             Style="{StaticResource MaterialDesignRaisedButton}"
+                            Margin="20"
+                            materialDesign:ButtonAssist.CornerRadius="20"
+                            Command="{Binding ConfigCommand}"
+                            Height="150" Width="220">
+                            <StackPanel>
+                                <materialDesign:PackIcon Kind="Gear" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="100"/>
+                                <TextBlock FontSize="30" Text="Config" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
+                            </StackPanel>
                         </Button>
 
                         <Button HorizontalAlignment="Stretch"
@@ -76,19 +87,9 @@
                                 HorizontalAlignment="Center"
                                 Margin="20">
 
-                        <Button HorizontalAlignment="Stretch"
-                             Style="{StaticResource MaterialDesignRaisedButton}"
-                            Margin="20"
-                            materialDesign:ButtonAssist.CornerRadius="20"
-                            Command="{Binding ConfigCommand}"
-                            Height="150" Width="220">
-                            <StackPanel>
-                                <materialDesign:PackIcon Kind="Gear" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="100"/>
-                                <TextBlock FontSize="30" Text="Config" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
-                            </StackPanel>
-                        </Button>
+                        
 
-                        <Button HorizontalAlignment="Stretch"
+                        <!--<Button HorizontalAlignment="Stretch"
                             Style="{StaticResource MaterialDesignRaisedButton}"
                             Margin="20"
                             materialDesign:ButtonAssist.CornerRadius="20"
@@ -98,9 +99,9 @@
                                 <materialDesign:PackIcon Kind="Altimeter" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="auto" Height="100"/>
                                 <TextBlock FontSize="30" Text="Detect" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
                             </StackPanel>
-                        </Button>
+                        </Button>-->
 
-                        <Button HorizontalAlignment="Stretch"
+                        <!--<Button HorizontalAlignment="Stretch"
                             Style="{StaticResource MaterialDesignRaisedButton}"
                             Margin="20"
                             materialDesign:ButtonAssist.CornerRadius="20"
@@ -110,7 +111,7 @@
                                 <materialDesign:PackIcon Kind="ElevatorUp" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="auto" Height="100"/>
                                 <TextBlock FontSize="30" Text="Conveyor" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
                             </StackPanel>
-                        </Button>
+                        </Button>-->
                     </StackPanel>
                 </Grid>
             </Grid>

+ 5 - 5
Dev/OHV/OHV.Module.MainViews/Views/UnitView.xaml.cs

@@ -18,17 +18,17 @@ namespace OHV.Module.MainViews.Views
     /// <summary>
     /// UnitModule.xaml에 대한 상호 작용 논리
     /// </summary>
-    public partial class UnitView : UserControl
+    public partial class EditView : UserControl
     {
-        public UnitViewModel ViewModel { get => this.DataContext as UnitViewModel; }
-        public UnitView()
+        public EditViewModel ViewModel { get => this.DataContext as EditViewModel; }
+        public EditView()
         { 
             InitializeComponent();
 
-            this.Loaded += UnitView_Loaded;
+            this.Loaded += EditView_Loaded;
         }
 
-        private void UnitView_Loaded( object sender , RoutedEventArgs e )
+        private void EditView_Loaded( object sender , RoutedEventArgs e )
         {
             this.ViewModel.Init();
         }

+ 2 - 2
Dev/OHV/OHV.Module.MainViews/Views/UnitViewModel.cs

@@ -12,7 +12,7 @@ using VehicleControlSystem;
 
 namespace OHV.Module.MainViews.Views
 {
-    public class UnitViewModel : BindableBase
+    public class EditViewModel : BindableBase
     {
         IEventAggregator eventAggregator = null;
         VCSystem vcSystem = null;
@@ -25,7 +25,7 @@ namespace OHV.Module.MainViews.Views
         public ICommand ConfigCommand { get; set; }
         public ICommand ConveyorPopup { get; set; }
 
-        public UnitViewModel( IEventAggregator _ea , VCSystem _vcSystem , MessageController _msgController )
+        public EditViewModel( IEventAggregator _ea , VCSystem _vcSystem , MessageController _msgController )
         {
             this.eventAggregator = _ea;
             this.vcSystem = _vcSystem;

+ 2 - 2
Dev/OHV/OHV.Module.MainViews/Views/HistoryView.xaml

@@ -114,7 +114,7 @@
             </Grid>
         </Grid>
 
-        <Grid Grid.Column="1" HorizontalAlignment="Right" Background="#263238">
+        <!--<Grid Grid.Column="1" HorizontalAlignment="Right" Background="#263238">
             <StackPanel>
                 <Button HorizontalAlignment="Stretch"
                     Style="{StaticResource MaterialDesignRaisedButton}"
@@ -130,6 +130,6 @@
                     </StackPanel>
                 </Button>
             </StackPanel>
-        </Grid>
+        </Grid>-->
     </Grid>
 </UserControl>

+ 0 - 20
Dev/OHV/OHV.Module.MainViews/Views/SettingView.xaml

@@ -1,20 +0,0 @@
-<UserControl x:Class="OHV.Module.MainViews.Views.SettingView"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-             xmlns:local="clr-namespace:OHV.Module.MainViews.Views"
-             xmlns:prism="http://prismlibrary.com/"      
-             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
-             prism:ViewModelLocator.AutoWireViewModel="True"
-             mc:Ignorable="d" 
-             Height="942"
-             Width="Auto"
-             MinWidth="1386"
-             Background="#37474f">
-    <Grid>
-        <Grid Margin="15,15" Background="#263238">
-            
-        </Grid>
-    </Grid>
-</UserControl>

+ 0 - 12
Dev/OHV/OHV.Module.MainViews/Views/SettingViewModel.cs

@@ -1,12 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace OHV.Module.MainViews.Views
-{
-    class SettingViewModel
-    {
-    }
-}

+ 1 - 1
Dev/OHV/OHV.SqliteDAL/OHVDbInitializer.cs

@@ -73,7 +73,7 @@ namespace OHV.SqliteDAL
                 {
                     ID = ConstString.PIOTimeOut,
                     Name= ConstString.PIOTimeOut,
-                    Value = "1000",
+                    Value = "5000",
                     Desc = "PIO Time Out",
                     EditTime = DateTime.Now,
                 },

+ 7 - 3
Dev/OHV/OHV.Vehicle/App.xaml

@@ -19,13 +19,17 @@
             <!--PRIMARY-->
             <!--<SolidColorBrush x:Key="PrimaryHueLightBrush" Color="#349fda"/>
             <SolidColorBrush x:Key="PrimaryHueLightForegroundBrush" Color="#333333"/>-->
+            
+            <!--Default Color-->
             <SolidColorBrush x:Key="PrimaryHueMidBrush" Color="#349fda"/>
-            <SolidColorBrush x:Key="PrimaryHueMidForegroundBrush" Color="#FFFFFF"/>
+            <SolidColorBrush x:Key="PrimaryHueDarkBrush" Color="#FF09432D"/>
+
+            <!--<SolidColorBrush x:Key="PrimaryHueMidForegroundBrush" Color="#FFFFFF"/>-->
             <!--<SolidColorBrush x:Key="PrimaryHueDarkBrush" Color="#689f38"/>
             <SolidColorBrush x:Key="PrimaryHueDarkForegroundBrush" Color="#FFFFFF"/>-->
             <!--ACCENT-->
-            <SolidColorBrush x:Key="SecondaryAccentBrush" Color="#689f38"/>
-            <SolidColorBrush x:Key="SecondaryAccentForegroundBrush" Color="Black"/>
+            <!--<SolidColorBrush x:Key="SecondaryAccentBrush" Color="#689f38"/>-->
+            <!--<SolidColorBrush x:Key="SecondaryAccentForegroundBrush" Color="Black"/>-->
         </ResourceDictionary>
 
     </Application.Resources>

+ 9 - 2
Dev/OHV/OHV.Vehicle/Concept/D_MainWindow.xaml

@@ -61,10 +61,17 @@
                     </StackPanel>
                 </Button>
 
-                <Button Margin="10,0" Background="{x:Null}" Height="Auto" BorderThickness="0" Command="{Binding NavigateCommand}" CommandParameter="UnitView" IsEnabled="{Binding IsManualMode}">
+                <Button Margin="10,0" Background="{x:Null}" Height="Auto" BorderThickness="0" Command="{Binding NavigateCommand}" CommandParameter="EditView" IsEnabled="{Binding IsManualMode}">
                     <StackPanel Orientation="Horizontal">
                         <materialDesign:PackIcon Kind="SettingsTransferOutline" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,10,0" Height="30" Width="auto"/>
-                        <TextBlock Text="SETTING" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="25"/>
+                        <TextBlock Text="EDIT" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="25"/>
+                    </StackPanel>
+                </Button>
+
+                <Button Margin="10,0" Background="{x:Null}" Height="Auto" BorderThickness="0" Command="{Binding NavigateCommand}" CommandParameter="ControlView" IsEnabled="{Binding IsManualMode}">
+                    <StackPanel Orientation="Horizontal">
+                        <materialDesign:PackIcon Kind="GesturePinch" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,10,0" Height="30" Width="auto"/>
+                        <TextBlock Text="CONTROL" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="25"/>
                     </StackPanel>
                 </Button>
 

+ 1 - 1
Dev/OHV/OHV.Vehicle/MainWindow.xaml

@@ -129,7 +129,7 @@
                             </StackPanel>
                     </ListViewItem>
 
-                    <ListViewItem Height="60" x:Name="UnitView">
+                    <ListViewItem Height="60" x:Name="EditView">
                         <StackPanel Orientation="Horizontal">
                             <materialDesign:PackIcon Kind="CarConnected" Width="25" Height="25" VerticalAlignment="Center" Margin="10"/>
                             <TextBlock Text="Config" VerticalAlignment="Center" Margin="20, 10"/>

+ 24 - 0
Dev/OHV/VehicleControlSystem/ControlLayer/Clamp.cs

@@ -98,6 +98,9 @@ namespace VehicleControlSystem.ControlLayer
                         case eAxisControlKind.SyncState:
                             ReqSyncState( arg );
                             break;
+                        case eAxisControlKind.AllOriginReturn:
+                            ReqAllOriginReturn( );
+                            break;
                         default:
                             break;
                     }
@@ -328,6 +331,27 @@ namespace VehicleControlSystem.ControlLayer
             this.PublishEvent( msg );
         }
 
+        void ReqAllOriginReturn( )
+        {
+            var msg = new AxisControlEventArgs
+            {
+                Kind = eAxisControlKind.AllOriginReturn
+            };
+
+            var ll = this.AllOriginReturn();
+
+            var result = this.IsAllAxisOriginReturn();
+
+            if ( result == 5 )
+                msg.Result = Results.Fail( "Left Fail" );
+            else if ( result == 6 )
+                msg.Result = Results.Fail( "Right Fail" );
+            else if ( result <= 0 )
+                msg.Result = Results.Ok();
+
+            this.PublishEvent( msg );
+        }
+
         void ReqOrderByMove( AxisControlEventArgs arg )
         {
             var msg = new AxisControlEventArgs();

+ 12 - 9
Dev/OHV/VehicleControlSystem/ControlLayer/Serial/BatteryTabos/BMUManager.cs

@@ -17,10 +17,11 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
     {
         static Logger logger = Logger.GetLogger();
 
-        Peak com = null;
+        Peak peakCom = null;
         Advantech adCom = null;
         public Config BMUConfig { get; set; }
         public bool IsConnected { get { return this.adCom.IsConnected; } }
+        //public bool IsConnected { get { return this.peakCom.IsConnected; } }
 
         internal Dictionary<eDataKind, ReceivedData> ReceivedDataDic = new Dictionary<eDataKind , DataModel.ReceivedData>();
         protected TsQueue<QueObject> qq = new TsQueue<QueObject>( 512 );
@@ -39,12 +40,12 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
             Peak
         }
 
-        #region Event
+    #region Event
         public event Action<string,bool> OnConnect;
         public event Action<string, bool> OnDisconnect;
         public event Action<ReceivedData> OnChangedReceivedData;
         public event Action<List<ReceivedData>> OnFirstColtd;
-        #endregion
+    #endregion
 
         public BMUManager()
         {
@@ -99,6 +100,8 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
         protected void EnqueueToNet( object o )
         {
             this.adCom.Enqueue( o );
+            
+            //this.peakCom.Enqueue( o );
         }
 
 
@@ -137,7 +140,7 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
         }
 
 
-        #region Net Invoke Method
+    #region Net Invoke Method
         internal void _OnConnected()
         {
             if ( 0 != collectNo )
@@ -204,10 +207,10 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
         //{
         //    this.qq.Enqueue( new QoSendMessageSuccess { Arg0 = data } );
         //}
-        #endregion
+    #endregion
 
 
-        #region Public Method
+    #region Public Method
         public void Connect(eCANSelect select)
         {
             //외부 전달 시작
@@ -222,8 +225,8 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
                     this.cancel.AddGo( this.adCom._ThreadPoolingReceiveData );
                     break;
                 case eCANSelect.Peak:
-                    this.com = new Peak( this );
-                    this.cancel.AddGo( this.com._ThreadPoolingReceiveData );
+                    this.peakCom = new Peak( this );
+                    this.cancel.AddGo( this.peakCom._ThreadPoolingReceiveData );
                     break;
             }
         }
@@ -242,6 +245,6 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
             var clone = this.ReceivedDataDic.Values.FirstOrDefault(); 
             this.qq.Enqueue( new QoReceivedDataChanged { Arg0 = clone } );
         }
-        #endregion
+    #endregion
     }
 }

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

@@ -257,7 +257,10 @@ namespace VehicleControlSystem
                 MessageText = msg.MessageText,
             };
 
-            //result = this.vehicle.PIOBatteryCharge( SubCmd.eSubCmdState );
+            var subCmd = this.sql.SubCmdDAL.GetSubCmd();
+            subCmd.Type = eSubCommandType.Charge;
+
+            result = this.vehicle.PIOBatteryCharge( subCmd );
 
             if ( result <= 0 )
                 reply.Result = FluentResults.Results.Ok();