Browse Source

add efem view flip select

chenzk 3 weeks ago
parent
commit
ad86e0d238
2 changed files with 31 additions and 16 deletions
  1. 21 6
      PunkHPX8_MainPages/ViewModels/EfemViewModel.cs
  2. 10 10
      PunkHPX8_MainPages/Views/EfemView.xaml

+ 21 - 6
PunkHPX8_MainPages/ViewModels/EfemViewModel.cs

@@ -55,7 +55,7 @@ namespace PunkHPX8_MainPages.ViewModels
         private ModuleInfo m_srd2ModuleInfo;
 
         private List<EFEMModule> m_EFEMModules = new List<EFEMModule>();
-        private List<EFEMModule> m_PUFModules = new List<EFEMModule>();
+        private List<Flip> m_FlipNames = new List<Flip>();
         private EFEMBlade m_PickSelectedBlade;
         private EFEMBlade m_PlaceSelectedBlade;
         private EFEMBlade m_ExtendSelectedBlade;
@@ -65,6 +65,9 @@ namespace PunkHPX8_MainPages.ViewModels
         private ObservableCollection<int> m_ExtendSoltItemsSource = new ObservableCollection<int>();
         private ObservableCollection<int> m_RetractSoltItemsSource = new ObservableCollection<int>();
 
+        private Flip m_PickSoltSelectedFlip;
+        private Flip m_PlaceSoltSelectedFlip;
+
         private int m_PickSoltSelectedIndex;
         private int m_PlaceSoltSelectedIndex;
         private int m_ExtendSoltSelectedIndex;
@@ -177,10 +180,10 @@ namespace PunkHPX8_MainPages.ViewModels
             get { return m_EFEMModules; }
             set { SetProperty(ref m_EFEMModules, value); }
         }
-        public List<EFEMModule> PUFModules
+        public List<Flip> FlipNames
         {
-            get { return m_PUFModules; }
-            set { SetProperty(ref m_PUFModules, value); }
+            get { return m_FlipNames; }
+            set { SetProperty(ref m_FlipNames, value); }
         }
         public EFEMBlade PickSelectedBlade
         {
@@ -224,6 +227,16 @@ namespace PunkHPX8_MainPages.ViewModels
             get { return m_RetractSoltItemsSource; }
             set { SetProperty(ref m_RetractSoltItemsSource, value); }
         }
+        public Flip PickSoltSelectedFlip
+        {
+            get { return m_PickSoltSelectedFlip; }
+            set { SetProperty(ref m_PickSoltSelectedFlip, value); }
+        }
+        public Flip PlaceSoltSelectedFlip
+        {
+            get { return m_PlaceSoltSelectedFlip; }
+            set { SetProperty(ref m_PlaceSoltSelectedFlip, value); }
+        }
         public int PickSoltSelectedIndex
         {
             get { return m_PickSoltSelectedIndex; }
@@ -701,6 +714,8 @@ namespace PunkHPX8_MainPages.ViewModels
             EFEMModules.Add(EFEMModule.PlatingCell4);
             OnModuleChange("Pick");
             OnModuleChange("Place");
+            FlipNames.Add(Flip.Upper);
+            FlipNames.Add(Flip.Down);
 
             Init();
 
@@ -793,7 +808,7 @@ namespace PunkHPX8_MainPages.ViewModels
             Queue<MoveItem> moveItems = new Queue<MoveItem>();
             var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PickSelectedModule.ToString(), true);
             var selectedHand = (Hand)Enum.Parse(typeof(Hand), PickSelectedBlade.ToString(), true);
-            MoveItem moveItem = new MoveItem(moduleName, PickSoltItemsSource[PickSoltSelectedIndex]-1, ModuleName.EfemRobot, 0, selectedHand, Flip.Upper);
+            MoveItem moveItem = new MoveItem(moduleName, PickSoltItemsSource[PickSoltSelectedIndex]-1, ModuleName.EfemRobot, 0, selectedHand, PickSoltSelectedFlip);
             moveItems.Enqueue(moveItem);
             InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Pick}", moveItems);
         }
@@ -802,7 +817,7 @@ namespace PunkHPX8_MainPages.ViewModels
             Queue<MoveItem> moveItems = new Queue<MoveItem>();
             var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PlaceSelectedModule.ToString(), true);
             var selectedHand = (Hand)Enum.Parse(typeof(Hand), PlaceSelectedBlade.ToString(), true);
-            MoveItem moveItem = new MoveItem(ModuleName.EfemRobot, 0, moduleName, PlaceSoltItemsSource[PlaceSoltSelectedIndex]-1, selectedHand,Flip.Upper);
+            MoveItem moveItem = new MoveItem(ModuleName.EfemRobot, 0, moduleName, PlaceSoltItemsSource[PlaceSoltSelectedIndex]-1, selectedHand, PlaceSoltSelectedFlip);
             moveItems.Enqueue(moveItem);
             InvokeClient.Instance.Service.DoOperation($"{ModuleName.EfemRobot}.{EfemOperation.Place}", moveItems);
         }

+ 10 - 10
PunkHPX8_MainPages/Views/EfemView.xaml

@@ -143,7 +143,7 @@
             </Grid>
 
         </GroupBox>
-        <Grid Canvas.Top="253" Canvas.Left="1020" Width="500" HorizontalAlignment="Center" VerticalAlignment="Top">
+        <Grid Canvas.Top="253" Canvas.Left="1020" Width="560" HorizontalAlignment="Center" VerticalAlignment="Top">
             <Grid.RowDefinitions>
                 <RowDefinition Height="30"/>
                 <RowDefinition Height="36"/>
@@ -190,23 +190,21 @@
                     <RowDefinition Height="25"/>
                     <RowDefinition/>
                     <RowDefinition/>
-                    <!--<RowDefinition/>
-                    <RowDefinition/>-->
-                    <!--<RowDefinition/>-->
                 </Grid.RowDefinitions>
                 <Grid.ColumnDefinitions>
                     <ColumnDefinition/>
                     <ColumnDefinition/>
                     <ColumnDefinition/>
                     <ColumnDefinition/>
+                    <ColumnDefinition Width="100"/>
                 </Grid.ColumnDefinitions>
-
-                <TextBlock Text="Module"                    HorizontalAlignment="Center" VerticalAlignment="Center"   FontSize="14" />
+                <TextBlock Text="Module"  Grid.Column="0"  HorizontalAlignment="Center" VerticalAlignment="Center"   FontSize="14" />
                 <TextBlock Text="Slot" Grid.Column="1"      HorizontalAlignment="Center" VerticalAlignment="Center"   FontSize="14"/>
                 <TextBlock Text="Blade" Grid.Column="2"       HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14"/>
-                <TextBlock Text="Operation" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"   FontSize="14"/>
+                <TextBlock Text="Operation" Grid.Column="4" HorizontalAlignment="Center" VerticalAlignment="Center"   FontSize="14"/>
+                <TextBlock Text="Flip" Grid.Column="3"  HorizontalAlignment="Center" VerticalAlignment="Center"   FontSize="14"/>
 
-                <ComboBox Grid.Row="1"                 Margin="5" SelectedItem="{Binding PickSelectedModule}" ItemsSource="{Binding EFEMModules}">
+                <ComboBox Grid.Row="1"       Margin="5" SelectedItem="{Binding PickSelectedModule}" ItemsSource="{Binding EFEMModules}">
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectionChanged">
                             <i:InvokeCommandAction Command="{Binding ModuleChangeCommand}" CommandParameter="Pick"/>
@@ -215,7 +213,8 @@
                 </ComboBox>
                 <ComboBox Grid.Row="1" Grid.Column="1"   Margin="5" ItemsSource="{Binding PickSoltItemsSource}" SelectedIndex="{Binding PickSoltSelectedIndex}"/>
                 <ComboBox Grid.Row="1" Grid.Column="2"   Margin="5"  SelectedItem="{Binding PickSelectedBlade}" unity:ItemsControlHelper.EnumValuesToItemsSource="True"/>
-                <Button   Grid.Row="1" Grid.Column="3"   Content="Pick" Command="{Binding PickCommand}"/>
+                <ComboBox Grid.Row="1" Grid.Column="3"   Margin="5"  SelectedItem="{Binding PickSoltSelectedFlip}" unity:ItemsControlHelper.EnumValuesToItemsSource="True"/>
+                <Button   Grid.Row="1" Grid.Column="4"   Content="Pick" Command="{Binding PickCommand}"/>
 
                 <ComboBox Grid.Row="2"   Margin="5" SelectedItem="{Binding PlaceSelectedModule}" ItemsSource="{Binding EFEMModules}">
                     <i:Interaction.Triggers>
@@ -226,7 +225,8 @@
                 </ComboBox>
                 <ComboBox Grid.Row="2" Grid.Column="1" Margin="5" ItemsSource="{Binding PlaceSoltItemsSource}" SelectedIndex="{Binding PlaceSoltSelectedIndex}"/>
                 <ComboBox Grid.Row="2" Grid.Column="2" Margin="5" SelectedItem="{Binding PlaceSelectedBlade}" unity:ItemsControlHelper.EnumValuesToItemsSource="True"/>
-                <Button   Grid.Row="2" Grid.Column="3"  Content="Place"  Command="{Binding PlaceCommand}"/>
+                <ComboBox Grid.Row="2" Grid.Column="3" Margin="5" SelectedItem="{Binding PlaceSoltSelectedFlip}" unity:ItemsControlHelper.EnumValuesToItemsSource="True"/>
+                <Button   Grid.Row="2" Grid.Column="4"  Content="Place"  Command="{Binding PlaceCommand}"/>
 
 
                 <!--<ComboBox Grid.Row="3"                 Margin="5" SelectedItem="{Binding ExtendSelectedModule}" ItemsSource="{Binding EFEMModules}">