ys-hwang 6 rokov pred
rodič
commit
6b439c52c2

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

@@ -235,7 +235,7 @@
             </Grid>
         </Grid>
 
-        <Grid Grid.Column="1" Background="#37474f">
+        <Grid Grid.Column="1" Background="#263238">
             <Border Margin="1" BorderBrush="#FF00FFD3" BorderThickness="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
             <StackPanel>
                 <Button Margin="7,20" HorizontalAlignment="Stretch" Height="Auto" BorderBrush="Gray" BorderThickness="2" Command="{Binding CloseDialogCommand}" CommandParameter="true">

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

@@ -46,8 +46,8 @@
 
                 <Grid Grid.Row="0">
                     <Button Content="Conveyor Control" Foreground="Orange" Background="{x:Null}" FontSize="20"
-                            VerticalAlignment="Top"
-                            Width="Auto" Height="Auto"/>
+                            VerticalAlignment="Top" HorizontalAlignment="Left"
+                            Width="Auto" Height="50"/>
                     <StackPanel Orientation="Horizontal"
                                 HorizontalAlignment="Center">
 
@@ -94,7 +94,9 @@
 
                 <Grid Grid.Row="1">
                     <Button Content="Carrier Control" Foreground="Orange" Background="{x:Null}" FontSize="20"
-                            VerticalAlignment="Top" Width="Auto" Height="Auto"/>
+                            VerticalAlignment="Top" Width="Auto" Height="50"
+                            HorizontalAlignment="Left"/>
+                    
                     <StackPanel Orientation="Horizontal"
                                 HorizontalAlignment="Center">
 
@@ -126,8 +128,8 @@
                 </Grid>
             </Grid>
         </Grid>
-        
-        <Grid Grid.Column="1" Background="#37474f">
+
+        <Grid Grid.Column="1" Background="#263238">
             <Border Margin="1" BorderBrush="#FF00FFD3" BorderThickness="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
             <StackPanel>
                 <Button Margin="7,20" HorizontalAlignment="Stretch" Height="Auto" BorderBrush="Gray" BorderThickness="2" Command="{Binding CloseDialogCommand}" CommandParameter="true">

+ 30 - 36
Dev/OHV/OHV.Module.Interactivity/PopUp/OpticalReadingConfigView.xaml

@@ -35,7 +35,6 @@
         <Grid.ColumnDefinitions>
             <ColumnDefinition Width="*"/>
             <ColumnDefinition Width="130"/>
-            <ColumnDefinition Width="130"/>
         </Grid.ColumnDefinitions>
 
         <Grid Grid.Column="0" Margin="15" Background="#37474f">
@@ -176,7 +175,7 @@
             </StackPanel>-->
 
             <!--OutPut-->
-            <Border Grid.Column="0" Margin="30,10" BorderBrush="#FF00FFD3" BorderThickness="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
+            <Border Grid.Column="0" Margin="39,10" BorderBrush="#FF00FFD3" BorderThickness="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
             <StackPanel VerticalAlignment="Center"
                         HorizontalAlignment="Center"
                         Grid.Column="0">
@@ -221,27 +220,38 @@
 
             <StackPanel Grid.Column="1"
                         VerticalAlignment="Center"
-                        HorizontalAlignment="Center">
-                <StackPanel Orientation="Vertical">
-                    <TextBlock Margin="5"><Run Text="Pattern Result" Foreground="Silver" FontSize="20"/></TextBlock>
-                    <TextBlock Margin="5"><Run Text="Moving Detect = 21" Foreground="Silver" FontSize="18"/></TextBlock>
-                    <TextBlock Margin="5"><Run Text="Curve Detect = 31" Foreground="Silver" FontSize="18"/></TextBlock>
-                    <TextBlock Margin="5"><Run Text="Default = 10" Foreground="Silver" FontSize="18"/></TextBlock>
-                </StackPanel>
+                        HorizontalAlignment="Right"
+                        Margin="15">
+                <Button Height="60">
+                    <StackPanel>
+                        <TextBlock><Run Text="Drive Pattern" FontSize="20"/></TextBlock>
+                    </StackPanel>
+                </Button>
+
+                <Button Background="{x:Null}" Height="60"
+                        Command="{Binding PatternResultKyein}"
+                        CommandParameter="D">
+                    <StackPanel>
+                        <TextBlock><Run Text="{Binding DrivePatternResult, FallbackValue=0}" FontSize="25" Foreground="Orange"/></TextBlock>
+                    </StackPanel>
+                </Button>
             </StackPanel>
 
             <StackPanel Grid.Column="2"
                         VerticalAlignment="Center"
-                        HorizontalAlignment="Center">
-                <Button >
+                        HorizontalAlignment="Left"
+                        Margin="15">
+                <Button Height="60">
                     <StackPanel>
-                        <TextBlock><Run Text="Pattern Result"/></TextBlock>
+                        <TextBlock><Run Text="Curve Pattern" FontSize="20"/></TextBlock>
                     </StackPanel>
                 </Button>
 
-                <Button Background="{x:Null}">
+                <Button Background="{x:Null}" Height="60"
+                        Command="{Binding PatternResultKyein}"
+                        CommandParameter="C">
                     <StackPanel>
-                        <TextBlock><Run Text="{Binding PatternResult, FallbackValue=0}"/></TextBlock>
+                        <TextBlock><Run Text="{Binding CurvePatternResult, FallbackValue=0}" FontSize="25" Foreground="Orange"/></TextBlock>
                     </StackPanel>
                 </Button>
             </StackPanel>
@@ -250,14 +260,7 @@
         <!--Right Sub Menu Grid-->
         <Grid Grid.Column="1" Background="#37474f">
             <StackPanel>
-                <Button Margin="5,50,5,0" HorizontalAlignment="Stretch" Height="69" 
-                        BorderBrush="Gray" BorderThickness="2" 
-                        Command="{Binding DetectPatternSave}" CommandParameter="true">
-                    <StackPanel>
-                        <materialDesign:PackIcon Kind="CalendarExport" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
-                        <TextBlock Text="Save" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
-                    </StackPanel>
-                </Button>
+                
             </StackPanel>
         </Grid>
 
@@ -265,25 +268,16 @@
         <Grid Grid.Column="2" Background="#263238">
             <Border Margin="1" BorderBrush="#FF00FFD3" BorderThickness="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
             <StackPanel>
-                <Button Margin="5" HorizontalAlignment="Stretch" Height="69" 
-                        BorderBrush="Gray" BorderThickness="2"
-                        Command="{Binding SteeringConnectCommand}" CommandParameter="true">
-                    <StackPanel>
-                        <!--<materialDesign:PackIcon Kind="ExitToApp" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>-->
-                        <TextBlock Text="Connect" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
-                    </StackPanel>
-                </Button>
-
-                <Button Margin="5" HorizontalAlignment="Stretch" Height="69" 
+                <Button Margin="5,10,5,0" HorizontalAlignment="Stretch" Height="69" 
                         BorderBrush="Gray" BorderThickness="2" 
-                        Command="{Binding SteeringDisConnectCommand}" CommandParameter="true">
+                        Command="{Binding DetectPatternSave}" CommandParameter="true">
                     <StackPanel>
-                        <!--<materialDesign:PackIcon Kind="ExitToApp" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>-->
-                        <TextBlock Text="Disonnect" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
+                        <materialDesign:PackIcon Kind="CalendarExport" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
+                        <TextBlock Text="Save" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
                     </StackPanel>
                 </Button>
 
-                <Button Margin="5,50" HorizontalAlignment="Stretch" Height="Auto" BorderBrush="Gray" BorderThickness="2" 
+                <Button Margin="5" HorizontalAlignment="Stretch" Height="Auto" BorderBrush="Gray" BorderThickness="2" 
                         Command="{Binding CloseDialogCommand}" CommandParameter="true">
                     <StackPanel>
                         <materialDesign:PackIcon Kind="ExitToApp" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>

+ 35 - 7
Dev/OHV/OHV.Module.Interactivity/PopUp/OpticalReadingConfigViewModel.cs

@@ -39,11 +39,18 @@ namespace OHV.Module.Interactivity.PopUp
             set { this.SetProperty( ref this._opReaderOutThird , value ); }
         }
 
-        private int _patternResult;
-        public int PatternResult
+        private int _curvePatternResult;
+        public int CurvePatternResult
         {
-            get { return this._patternResult; }
-            set { this.SetProperty( ref this._patternResult , value ); }
+            get { return this._curvePatternResult; }
+            set { this.SetProperty( ref this._curvePatternResult , value ); }
+        }
+
+        private int _drivePatternResult;
+        public int DrivePatternResult
+        {
+            get { return this._drivePatternResult; }
+            set { this.SetProperty( ref this._drivePatternResult , value ); }
         }
 
         private bool _resultPatternOne;
@@ -108,6 +115,8 @@ namespace OHV.Module.Interactivity.PopUp
 
         public ICommand DetectPatternSave { get; set; }
         public ICommand ResultPattern { get; set; }
+        public ICommand PatternResultKyein { get; set; }
+
 
         public event Action<IDialogResult> RequestClose;
 
@@ -121,6 +130,25 @@ namespace OHV.Module.Interactivity.PopUp
 
             this.DetectPatternSave = new DelegateCommand( ExecuteDetectPatternSave );
             this.ResultPattern = new DelegateCommand<object>( ExecuteResultPattern );
+            this.PatternResultKyein = new DelegateCommand<object>( ExecutePatternResultKyein );
+        }
+
+        private void ExecutePatternResultKyein( object obj)
+        {
+            var numpad = new CalcuratorView();
+            var result = numpad.ShowDialog(0);
+
+            var pattern = obj.ToString();
+
+            switch(pattern)
+            {
+                case "C":
+                    this.CurvePatternResult = Convert.ToInt32( result );
+                    break;
+                case "D":
+                    this.DrivePatternResult = Convert.ToInt32( result );
+                    break;
+            }
         }
 
         private void ExecuteResultPattern(object _obj)
@@ -141,9 +169,9 @@ namespace OHV.Module.Interactivity.PopUp
             {
                 if ( r.Result == ButtonResult.OK )
                 {
-                    bool[] bitResult = new bool[] { this.ResultPatternOne , this.ResultPatternTwo , this.ResultPatternThree , this.ResultPatternFour , this.ResultPatternFive };
-                    var result = new System.Collections.BitArray( bitResult );
-                    this.PatternResult = ConvertToByte( result );
+                    //bool[] bitResult = new bool[] { this.ResultPatternOne , this.ResultPatternTwo , this.ResultPatternThree , this.ResultPatternFour , this.ResultPatternFive };
+                    //var result = new System.Collections.BitArray( bitResult );
+                    //this.PatternResult = ConvertToByte( result );
 
                     //this.Publish(this.PatternResult);
                 }

+ 110 - 4
Dev/OHV/OHV.Module.Status/VehicleStatusView.xaml

@@ -12,15 +12,121 @@
              >
 
     <Grid Background="#263238">
-        <Grid Margin="15">
-            <Border BorderBrush="Gray" BorderThickness="1"/>
+        <Grid Margin="5">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="*"/>
+                <ColumnDefinition Width="*"/>
+                <ColumnDefinition Width="*"/>
+                <ColumnDefinition Width="*"/>
+            </Grid.ColumnDefinitions>
+
+            <Grid.RowDefinitions>
+                <RowDefinition Height="*"/>
+                <RowDefinition Height="*"/>
+                <RowDefinition Height="*"/>
+            </Grid.RowDefinitions>
+
+            <StackPanel Orientation="Vertical"
+                        VerticalAlignment="Center"
+                        HorizontalAlignment="Center"
+                        Grid.Column="0"
+                        Grid.Row="1">
+                <TextBlock Margin="5" Text="Clamp State" Foreground="Silver" FontSize="25"/>
+                <TextBlock Margin="5" HorizontalAlignment="Center" 
+                           Text="{Binding VehicleClampState, FallbackValue=OFF}" Foreground="Orange" FontSize="30"/>
+            </StackPanel>
+
+            <StackPanel Orientation="Vertical"
+                        VerticalAlignment="Center"
+                        HorizontalAlignment="Center"
+                        Grid.Column="1" 
+                        Grid.Row="1">
+
+                <TextBlock Margin="5" Text="Conveyor" Foreground="Silver" FontSize="25"/>
+                <TextBlock Margin="5" HorizontalAlignment="Center" 
+                           Text="{Binding VehicleCVState, FallbackValue=OFF}" Foreground="Orange" FontSize="30"/>
+            </StackPanel>
+
+            <StackPanel Orientation="Vertical"
+                        VerticalAlignment="Center"
+                        HorizontalAlignment="Center"
+                        Grid.Column="2"
+                        Grid.Row="1">
+                <TextBlock Margin="5" Text="Vehicle Position" Foreground="Silver" FontSize="25"/>
+                <TextBlock Margin="5" HorizontalAlignment="Center" 
+                           Text="{Binding VehicleCurrentPos, FallbackValue=1517}" Foreground="Orange" FontSize="30"/>
+            </StackPanel>
+
+
             <StackPanel Orientation="Vertical"
                         VerticalAlignment="Center"
-                        HorizontalAlignment="Center">
-                <TextBlock Margin="5" Text="Vehicle Current State" Foreground="Silver" FontSize="30"/>
+                        HorizontalAlignment="Center"
+                        Grid.Column="4" 
+                        Grid.Row="1">
+
+                <TextBlock Margin="5" Text="Vehicle Mode" Foreground="Silver" FontSize="25"/>
                 <TextBlock Margin="5" HorizontalAlignment="Center" 
                            Text="{Binding VehicleState, FallbackValue=IDLE}" Foreground="Orange" FontSize="30"/>
             </StackPanel>
+
+            <StackPanel Orientation="Vertical"
+                        VerticalAlignment="Center"
+                        HorizontalAlignment="Left" 
+                        Grid.Column="0"
+                        Grid.Row="2">
+
+                <Button Background="{x:Null}">
+                    <StackPanel Orientation="Horizontal">
+                        <Ellipse Margin="0,0,16,0" Width="20" Height="20" Fill="Red"/>
+                        <TextBlock Text="CV SPD-H"/>
+                    </StackPanel>
+                </Button>
+
+                <Button Background="{x:Null}">
+                    <StackPanel Orientation="Horizontal">
+                        <Ellipse Margin="0,0,19,0" Width="20" Height="20" Fill="Red"/>
+                        <TextBlock Text="CV SPD-L"/>
+                    </StackPanel>
+                </Button>
+
+                <Button Background="{x:Null}">
+                    <StackPanel Orientation="Horizontal">
+                        <Ellipse Margin="0,0,10,0" Width="20" Height="20" Fill="Red"/>
+                        <TextBlock Text="CV EntryIN"/>
+                    </StackPanel>
+                </Button>
+
+                
+            </StackPanel>
+
+            <StackPanel Orientation="Vertical"
+                        VerticalAlignment="Center"
+                        HorizontalAlignment="Left" 
+                        Grid.Column="1"
+                        Grid.Row="2">
+
+                <Button Background="{x:Null}">
+                    <StackPanel Orientation="Horizontal">
+                        <Ellipse Margin="0,0,10,0" Width="20" Height="20" Fill="Red"/>
+                        <TextBlock Text="CV Slow-S"/>
+                    </StackPanel>
+                </Button>
+
+                <Button Background="{x:Null}">
+                    <StackPanel Orientation="Horizontal">
+                        <Ellipse Margin="0,0,10,0" Width="20" Height="20" Fill="Red"/>
+                        <TextBlock Text="CV Stop-S"/>
+                    </StackPanel>
+                </Button>
+
+                <Button Background="{x:Null}">
+                    <StackPanel Orientation="Horizontal">
+                        <Ellipse Margin="0,0,10,0" Width="20" Height="20" Fill="Red"/>
+                        <TextBlock Text="CV-ERROR"/>
+                    </StackPanel>
+                </Button>
+
+            </StackPanel>
         </Grid>
     </Grid>
 </UserControl>

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

@@ -43,9 +43,6 @@ namespace VehicleControlSystem.Managers
         }
         public event Action<eOperatationMode> OnOperationModeChanged;
 
-        private delegate void OperationModeChanging();
-        public event Action OperationModeChanged;
-
         private eAutoModeState autoModeState;
         public eAutoModeState AutoModeStateProperty
         {