فهرست منبع

LockServoView 수정

SK.Kang 6 سال پیش
والد
کامیت
d42398b6b8

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

@@ -7,6 +7,7 @@
              xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
              xmlns:local="clr-namespace:OHV.Module.Interactivity.PopUp"
              xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+             xmlns:OHVCommonShareds="clr-namespace:OHV.Common.Shareds;assembly=OHV.Common"
              prism:ViewModelLocator.AutoWireViewModel="True"
              mc:Ignorable="d" 
              Width="800"
@@ -67,7 +68,7 @@
                     <Button Background="{x:Null}" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Stretch" Margin="5" Height="auto"
                             Style="{StaticResource MaterialDesignRaisedButton}"
                             materialDesign:ButtonAssist.CornerRadius="10"
-                            ToolTip="MaterialDesignRaisedButton with Round Corners">
+                            ToolTip="MaterialDesignRaisedButton with Round Corners" >
                         <StackPanel>
                             <TextBlock HorizontalAlignment="Center"><Run Text="Axis"/></TextBlock>
                             <TextBlock HorizontalAlignment="Center"><Run Text="Select"/></TextBlock>
@@ -112,7 +113,7 @@
                             Style="{StaticResource MaterialDesignRaisedButton}"
                             materialDesign:ButtonAssist.CornerRadius="10"
                             ToolTip="MaterialDesignRaisedButton with Round Corners"
-                            Command="{Binding SelectAxisCommand}">
+                            Command="{Binding SelectAxisCommand}" CommandParameter="{x:Static OHVCommonShareds:ConstString.AXIS_CARRIER_LOCK_LEFT}">
                         <TextBlock><Run Text="#Motor1"/></TextBlock>
                     </Button>
 
@@ -145,7 +146,7 @@
                             Style="{StaticResource MaterialDesignRaisedButton}"
                             materialDesign:ButtonAssist.CornerRadius="10"
                             ToolTip="MaterialDesignRaisedButton with Round Corners"
-                            Command="{Binding SelectAxisCommand}">
+                            Command="{Binding SelectAxisCommand}" CommandParameter="{x:Static OHVCommonShareds:ConstString.AXIS_CARRIER_LOCK_RIGHT}">
                         <TextBlock><Run Text="#Motor2"/></TextBlock>
                     </Button>
 
@@ -248,22 +249,22 @@
                     </StackPanel>
 
                     <StackPanel Margin="30,0,0,50" Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Left">
-                        <Button
+                        <RepeatButton
                             Margin="5"
                             Grid.Row="2" 
                             Grid.Column="1"
                             HorizontalAlignment="Stretch"
-                            Height="auto">
+                            Height="auto" Command="{Binding JogCommand}" CommandParameter="-">
                             <StackPanel>
                                 <materialDesign:PackIcon Kind="ArrowLeftBoldCircleOutline" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="30" Width="auto"/>
                                 <TextBlock><Run Text="Jog(-)"/></TextBlock>
                             </StackPanel>
-                            <i:Interaction.Triggers>
+                            <!--<i:Interaction.Triggers>
                                 <i:EventTrigger EventName="PreviewMouseDown">
                                     <i:InvokeCommandAction Command="{Binding JogCommand}" CommandParameter="-"/>
                                 </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </Button>
+                            </i:Interaction.Triggers>-->
+                        </RepeatButton>
 
                         <materialDesign:Badged
                             Grid.Row="2"
@@ -281,23 +282,22 @@
                             </Button>
                         </materialDesign:Badged>
 
-                        <Button
+                        <RepeatButton
                     Margin="5"
                     Grid.Row="2" 
                     Grid.Column="3"
                     HorizontalAlignment="Stretch"
-                    Height="auto">
+                    Height="auto" Command="{Binding JogCommand}" CommandParameter="+">
                             <StackPanel>
                                 <materialDesign:PackIcon Kind="ArrowRightBoldCircleOutline" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="30" Width="auto"/>
                                 <TextBlock><Run Text="Jog(+)"/></TextBlock>
                             </StackPanel>
-                            <i:Interaction.Triggers>
+                            <!--<i:Interaction.Triggers>
                                 <i:EventTrigger EventName="PreviewMouseDown">
                                     <i:InvokeCommandAction Command="{Binding JogCommand}" CommandParameter="+"/>
                                 </i:EventTrigger>
-                            </i:Interaction.Triggers>
-
-                        </Button>
+                            </i:Interaction.Triggers>-->
+                        </RepeatButton>
                     </StackPanel>
                 </Grid>
             </Grid>

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

@@ -15,7 +15,6 @@ namespace OHV.Module.Interactivity.PopUp
 {
     public class LockServoViewModel : BindableBase, IDialogAware
     {
-
         private DelegateCommand<string> _closeDialogCommand;
         public DelegateCommand<string> CloseDialogCommand =>
             _closeDialogCommand ?? (_closeDialogCommand = new DelegateCommand<string>(CloseDialog));
@@ -127,9 +126,6 @@ namespace OHV.Module.Interactivity.PopUp
             this.eventAggregator = ea;
             this.eventAggregator.GetEvent<AxisControlPubSubEvent>().Unsubscribe(UICallbackCommunication);
             this.eventAggregator.GetEvent<AxisControlPubSubEvent>().Subscribe(UICallbackCommunication, ThreadOption.UIThread);
-
-
-
         }
 
         private void ExecuteJogCommand(object obj)
@@ -146,7 +142,7 @@ namespace OHV.Module.Interactivity.PopUp
             else
                 msg.JogDir = AxisControlEventArgs.eJogMoveDir.Negative;
 
-            PublishEvent(msg);
+            this.PublishEvent(msg);
         }
 
         void PublishEvent(AxisControlEventArgs args)

+ 36 - 0
Dev/OHV/OHV.Vehicle/Logger.cs

@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Prism.Logging;
+using log4net;
+
+namespace OHV.Vehicle
+{
+    public class Log4NetLogger : ILoggerFacade
+    {
+        // Member variables
+        private readonly ILog m_Logger = LogManager.GetLogger(typeof(Log4NetLogger));
+
+        public void Log(string message, Category category, Priority priority)
+        {
+            switch (category)
+            {
+                case Category.Debug:
+                    m_Logger.Debug(message);
+                    break;
+                case Category.Warn:
+                    m_Logger.Warn(message);
+                    break;
+                case Category.Exception:
+                    m_Logger.Error(message);
+                    break;
+                case Category.Info:
+                    m_Logger.Info(message);
+                    break;
+            }
+        }
+
+    }
+}

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

@@ -147,6 +147,7 @@
       <DependentUpon>D_MainWindow.xaml</DependentUpon>
     </Compile>
     <Compile Include="Helpler\DeskTopInfo.cs" />
+    <Compile Include="Logger.cs" />
     <Compile Include="MainWindow.xaml.cs">
       <DependentUpon>MainWindow.xaml</DependentUpon>
       <SubType>Code</SubType>