unque781 6 лет назад
Родитель
Сommit
922b5dfce4

+ 6 - 4
Dev/Connection/OHVProtocolServer/OHVConnector/OHVConnector.csproj

@@ -31,10 +31,6 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="GSG.NET, Version=1.0.0.0, Culture=neutral, PublicKeyToken=807456855d2bd861, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\OHV\Assambly\GSG.NET.dll</HintPath>
-    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
     <Reference Include="System.Xml.Linq" />
@@ -52,5 +48,11 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="QueueObject.cs" />
   </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\..\..\GSG\GSG\GSG.NET\GSG.NET.csproj">
+      <Project>{11e12a58-fdbc-444a-90e6-db96b7e98ff4}</Project>
+      <Name>GSG.NET</Name>
+    </ProjectReference>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

BIN
Dev/OHV/Assambly/GSG.NET.dll


BIN
Dev/OHV/Assambly/GSG.NET.pdb


BIN
Dev/OHV/Assambly/OHVConnector.dll


BIN
Dev/OHV/Assambly/OHVConnector.pdb


+ 6 - 0
Dev/OHV/OHV.Module.Interactivity/MessageController.cs

@@ -36,6 +36,12 @@ namespace OHV.Module.Interactivity
             containerRegistry.RegisterDialog<BatteryConfigView , BatteryConfigViewModel>();
             containerRegistry.RegisterDialog<OpticalReadingConfigView , OpticalReadingConfigViewModel>();
             containerRegistry.RegisterDialog<InOutControlView , InOutControlViewModel>();
+            containerRegistry.RegisterDialog<ConfigView, ConfigViewModel>();
+        }
+
+        public void ShowConfigPopupView()
+        {
+            this.dialogService.ShowDialog("ConfigView", new DialogParameters(), null);
         }
 
         public void ShowNotificationView( string Message , bool isOK = true )

+ 10 - 0
Dev/OHV/OHV.Module.Interactivity/OHV.Module.Interactivity.csproj

@@ -99,6 +99,12 @@
     <Compile Include="PopUp\CalcuratorView.xaml.cs">
       <DependentUpon>CalcuratorView.xaml</DependentUpon>
     </Compile>
+    <Compile Include="PopUp\ConfigView.xaml.cs">
+      <DependentUpon>ConfigView.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="PopUp\ConfigViewModel.cs">
+      <DependentUpon>ConfigView.xaml</DependentUpon>
+    </Compile>
     <Compile Include="PopUp\DriveServoView.xaml.cs">
       <DependentUpon>DriveServoView.xaml</DependentUpon>
     </Compile>
@@ -163,6 +169,10 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="PopUp\ConfigView.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="PopUp\DriveServoView.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

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

@@ -36,7 +36,7 @@
             <ColumnDefinition/>
             <ColumnDefinition Width="130"/>
         </Grid.ColumnDefinitions>
-        
+
         <DockPanel>
             <ContentControl Grid.Column="0" prism:RegionManager.RegionName="IOView"/>
         </DockPanel>

+ 2 - 4
Dev/OHV/OHV.Module.ListViews/Views/CommandListView.xaml

@@ -58,11 +58,9 @@
                                 <Setter Property="Background" Value="{x:Null}"></Setter>
                             </Trigger>
                         </Style.Triggers>
+                        <Setter Property="TextBlock.TextAlignment" Value="Center" />
+                        <Setter Property="FontSize" Value="15"/>
                     </Style>
-                    <!--<Style TargetType="{x:Type DataGridColumnHeader}">
-                        <Setter Property="Foreground" Value="White"/>
-                        <Setter Property="Background" Value="Transparent"/>
-                    </Style>-->
                 </DataGrid.Resources>
 
                 <DataGrid.Columns>

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

@@ -18,7 +18,7 @@
             <ColumnDefinition Width="*"/>
             <ColumnDefinition Width="Auto"/>
         </Grid.ColumnDefinitions>
-        
+
         <Grid Grid.Column="0">
             <Grid Margin="15,15" Background="#263238">
                 <DockPanel>
@@ -74,7 +74,7 @@
                                     </Style>
                                 </DataGridTextColumn.HeaderStyle>
                             </materialDesign:DataGridTextColumn>
-                            
+
                             <materialDesign:DataGridTextColumn Header="Text" Width="150" Binding="{Binding Text}" EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnPopupEditingStyle}">
                                 <DataGridTextColumn.HeaderStyle>
                                     <Style TargetType="{x:Type DataGridColumnHeader}" BasedOn="{StaticResource MaterialDesignDataGridColumnHeader}">
@@ -94,7 +94,7 @@
                                     </Style>
                                 </DataGridTextColumn.HeaderStyle>
                             </materialDesign:DataGridTextColumn>
-                            
+
                             <materialDesign:DataGridTextColumn Header="Solution" Width="300" Binding="{Binding Solution}" EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnPopupEditingStyle}">
                                 <DataGridTextColumn.HeaderStyle>
                                     <Style TargetType="{x:Type DataGridColumnHeader}" BasedOn="{StaticResource MaterialDesignDataGridColumnHeader}">
@@ -104,7 +104,7 @@
                                     </Style>
                                 </DataGridTextColumn.HeaderStyle>
                             </materialDesign:DataGridTextColumn>
-                            
+
                         </DataGrid.Columns>
 
                         <!--<DataGrid.RowStyle>
@@ -112,7 +112,7 @@
                                 <Setter Property="TextAlignment" Value="Center"/>
                             </Style>
                         </DataGrid.RowStyle>-->
-                        
+
                     </DataGrid>
                 </DockPanel>
             </Grid>

+ 12 - 0
Dev/OHV/OHV.Module.MainViews/Views/UnitView.xaml

@@ -81,6 +81,18 @@
                                 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"
                             Style="{StaticResource MaterialDesignRaisedButton}"
                             Margin="20"

+ 7 - 0
Dev/OHV/OHV.Module.MainViews/Views/UnitViewModel.cs

@@ -22,6 +22,7 @@ namespace OHV.Module.MainViews.Views
         public ICommand InoutPupup { get; set; }
         public ICommand BatteryPopup { get; set; }
         public ICommand OpticalReaderPopup { get; set; }
+        public ICommand ConfigCommand { get; set; }
 
         public UnitViewModel( IEventAggregator _ea , VCSystem _vcSystem , MessageController _msgController )
         {
@@ -33,6 +34,12 @@ namespace OHV.Module.MainViews.Views
             this.InoutPupup = new DelegateCommand( ExecuteInOutCommand );
             this.BatteryPopup = new DelegateCommand( ExecuteBatteryCommand );
             this.OpticalReaderPopup = new DelegateCommand( ExecuteOpticalReadCommand );
+            this.ConfigCommand = new DelegateCommand(ExecuteConfigCommand);
+        }
+
+        private void ExecuteConfigCommand()
+        {
+            this.msgController.ShowConfigPopupView();
         }
 
         private void ExecuteOpticalReadCommand( )

+ 15 - 0
Dev/OHV/OHV.SqliteDAL/DAL/AbstractDAL.cs

@@ -68,6 +68,21 @@ namespace OHV.SqliteDAL.DAL
             }
         }
 
+        public virtual bool HasK(object key)
+        {
+            return GetK(key) == null ? false: true ;
+        }
+
+        public virtual bool HasN(Expression<Func<T, bool>> where)
+        {
+            List<T> ll = new List<T>();
+            using (var db = new OHVDbContext("OHVDb"))
+            {
+                ll = db.Set<T>().Where(where).ToList();
+            }
+            return ll.Count > 0;
+        }
+
         public void Add(T entity)
         {
             using (var db = new OHVDbContext("OHVDb"))

+ 14 - 0
Dev/OHV/OHV.SqliteDAL/DAL/RouteDAL.cs

@@ -35,5 +35,19 @@ namespace OHV.SqliteDAL.DAL
 
             return count;
         }
+
+        public Route GetRouteFromOCSMatchID(string matchID)
+        {
+            Route route = null;
+
+            using (var db = new OHVDbContext("OHVDb"))
+            {
+                route = db.Set<Route>().Where(x => x.OCSMatchID.Equals(matchID)).SingleOrDefault();
+            }
+
+            return route;
+        }
+
+
     }
 }

+ 13 - 1
Dev/OHV/VehicleControlSystem/ControlLayer/Vehicle.cs

@@ -128,7 +128,6 @@ namespace VehicleControlSystem.ControlLayer
         }
 
         private eVehicleState vehicleState;
-
         public eVehicleState VehicleStateProperty
         {
             get { return vehicleState; }
@@ -391,7 +390,13 @@ namespace VehicleControlSystem.ControlLayer
 
                 if ( this.ObstacleStateProperty == eObstacleState.Blocked )
                     return false;
+
+                //Todo: 이동중 명령이 삭제 되면 처리 할일들.
+                if (!sql.SubCmdDAL.HasK(this.CurrentSubCommand.ID))
+                {
+                }
             }
+
             return true;
         }
 
@@ -426,6 +431,7 @@ namespace VehicleControlSystem.ControlLayer
                 return false;
             }
 
+            //Load, Unload 가 끝나면 메인 Command 를 완료 했다고 판다.
             sql.CommandDAL.UpdateState( sub.CmdID, eCommandState.Complete );
             sql.SubCmdDAL.Delete( sub );
 
@@ -462,6 +468,12 @@ namespace VehicleControlSystem.ControlLayer
             return true;
         }
 
+        /// <summary>
+        /// Battery Charge
+        /// 
+        /// </summary>
+        /// <param name="sub"></param>
+        /// <returns></returns>
         public bool BatteryCharge( SubCmd sub )
         {
 

+ 9 - 1
Dev/OHV/VehicleControlSystem/Managers/HostManager.cs

@@ -328,7 +328,6 @@ namespace VehicleControlSystem.Managers
             this.Reply( msg );
 
             var cmd = new Command();
-            cmd.TargetID = msg.Tag;
 
             switch ( msg.SubCode )
             {
@@ -347,7 +346,16 @@ namespace VehicleControlSystem.Managers
                 default:
                     return;
             }
+
             //Todo: 등록 되어 있는 경로 가 있는 지 확인 필요.
+            var route = this.sql.RouteDal.GetRouteFromOCSMatchID(msg.Tag);
+            if (route == null)
+            {
+                logger.E($"[OCS] Message Tag [{msg.Tag}] - not found route");
+                return;
+            }
+
+            cmd.TargetID = route.Name;
 
             this.sql.CommandDAL.Add( cmd );
 

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

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