Browse Source

revise operation view/wago simulator

chenzk 3 weeks ago
parent
commit
4cedb89bf1

+ 5 - 1
CyberX8_MainPages/ViewModels/JobOperationViewModel.cs

@@ -937,7 +937,11 @@ namespace CyberX8_MainPages.ViewModels
             m_RtDataKeys.Add("LP1.IsDocked");
             m_RtDataKeys.Add("LP2.IsDocked");
             m_RtDataKeys.Add("LP3.IsDocked");
-            
+
+            m_RtDataKeys.Add("LP1.WaferSize");
+            m_RtDataKeys.Add("LP2.WaferSize");
+            m_RtDataKeys.Add("LP3.WaferSize");
+
         }
         /// <summary>
         /// 更新Wafer情况

+ 10 - 0
CyberX8_MainPages/Views/JobOperationView.xaml

@@ -98,6 +98,7 @@
             <Rectangle  Width="70" Height="70" Fill="Silver"  Opacity="0.8" RadiusX="0.1" RadiusY="0.1"
                 />
         </Grid>
+       
         <Canvas Canvas.Top="74" Height="1126" Width="1920" HorizontalAlignment="Center" VerticalAlignment="Top">
 
             <Canvas Height="406" Width="448" HorizontalAlignment="Left" Canvas.Left="42" VerticalAlignment="Center">
@@ -788,6 +789,15 @@
         <TextBox IsReadOnly="True" BorderThickness="0"  Text="LP1" FontSize="20" Width="40"  Height="28" Background="Transparent" HorizontalContentAlignment="Center" HorizontalAlignment="Left" Canvas.Left="50" Canvas.Top="130" VerticalAlignment="Top"/>
         <TextBox IsReadOnly="True" BorderThickness="0"  Text="LP2" FontSize="20" Width="40"  Height="28" Background="Transparent" HorizontalContentAlignment="Center" Canvas.Left="50" Canvas.Top="266" HorizontalAlignment="Center" VerticalAlignment="Top"/>
         <TextBox IsReadOnly="True" BorderThickness="0"  Text="LP3" FontSize="20" Width="40"  Height="28" Background="Transparent" HorizontalContentAlignment="Center" Canvas.Left="50" Canvas.Top="398" HorizontalAlignment="Center" VerticalAlignment="Top"/>
+        <TextBlock Canvas.Top="150" Canvas.Left="50" Text="{Binding RtDataValues[LP1.WaferSize], StringFormat=({0})}" Visibility="{Binding RtDataValues[LP1.CassettePlaced], Converter={StaticResource BoolToVisibility2}}"
+HorizontalAlignment="Center" Margin="0,5,0,0" FontSize="16">
+        </TextBlock>
+        <TextBlock Canvas.Top="300" Canvas.Left="50" Text="{Binding RtDataValues[LP2.WaferSize], StringFormat=({0})}" Visibility="{Binding RtDataValues[LP2.CassettePlaced], Converter={StaticResource BoolToVisibility2}}"
+HorizontalAlignment="Center" Margin="0,5,0,0" FontSize="16">
+        </TextBlock>
+        <TextBlock Canvas.Top="420" Canvas.Left="50" Text="{Binding RtDataValues[LP3.WaferSize], StringFormat=({0})}" Visibility="{Binding RtDataValues[LP3.CassettePlaced], Converter={StaticResource BoolToVisibility2}}"
+           HorizontalAlignment="Center" Margin="0,5,0,0" FontSize="16">
+        </TextBlock>
     </Canvas>
 
 </UserControl>

+ 7 - 7
CyberX8_MainPages/Views/OperationOverView.xaml

@@ -92,11 +92,11 @@
             </Canvas>
 
             <Canvas Canvas.Left="-210" Canvas.Top="-165">
-                <TabPanel Canvas.Left="1170"  Canvas.Top="140" Visibility="{Binding ElementName=CarrierRadioButton,Path=IsChecked,Converter={StaticResource boolToVisibility2}}">
-                    <Border BorderBrush="Gray" BorderThickness="1">
+                <TabPanel  Canvas.Left="1170"  Canvas.Top="140" Visibility="{Binding ElementName=CarrierRadioButton,Path=IsChecked,Converter={StaticResource boolToVisibility2}}">
+                    <Border BorderBrush="Gray" BorderThickness="1" Width="710" Height="480">
                         <StackPanel Orientation="Horizontal" >
                             <StackPanel>
-                                <TextBox Background="{DynamicResource Table_BG_Title}"  Text="LP1" Width="100" Height="15" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" 
+                                <TextBox Background="{DynamicResource Table_BG_Title}"  Text="LP1" Width="150" Height="15" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" 
                                      IsReadOnly="True" FontSize="10"/>
                                 <ctrls:FOUPFrontView UnitData="{Binding LP1ModuleInfo}"
                                                      IsCassettePlaced="{Binding RtDataValues[LP1.CassettePlaced]}"
@@ -119,7 +119,7 @@
 
                             </StackPanel>
                             <StackPanel>
-                                <TextBox Background="{DynamicResource Table_BG_Title}" Text="LP2" Width="100" Height="15" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
+                                <TextBox Background="{DynamicResource Table_BG_Title}" Text="LP2" Width="150" Height="15" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
                                      IsReadOnly="True" FontSize="10"/>
                                 <ctrls:FOUPFrontView UnitData="{Binding LP2ModuleInfo}" 
                                                      IsCassettePlaced="{Binding RtDataValues[LP2.CassettePlaced]}"
@@ -142,7 +142,7 @@
                             </StackPanel>
 
                             <StackPanel >
-                                <TextBox Background="{DynamicResource Table_BG_Title}" Text="LP3" Width="100" Height="15" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
+                                <TextBox Background="{DynamicResource Table_BG_Title}" Text="LP3" Width="150" Height="15" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
                                      IsReadOnly="True" FontSize="10"/>
                                 <ctrls:FOUPFrontView UnitData="{Binding LP3ModuleInfo}" 
                                                      IsCassettePlaced="{Binding RtDataValues[LP3.CassettePlaced]}"
@@ -164,7 +164,7 @@
 
                             </StackPanel>
                             <StackPanel >
-                                <TextBox Background="{DynamicResource Table_BG_Title}" Text="Dummy1" Width="50" Height="15" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
+                                <TextBox Background="{DynamicResource Table_BG_Title}" Text="Dummy1" Width="130" Height="15" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
                                      IsReadOnly="True" FontSize="10"/>
                                 <ctrls:FOUPFrontView UnitData="{Binding Dummy1ModuleInfo}" 
                                                      IsCassettePlaced="{Binding RtDataValues[Dummy1.CassettePlaced]}"
@@ -182,7 +182,7 @@
                                            Visibility="{Binding RtDataValues[Dummy1.CassettePlaced],Converter={StaticResource boolToVisibility2}}"/>
                             </StackPanel>
                             <StackPanel >
-                                <TextBox Background="{DynamicResource Table_BG_Title}" Text="Dummy2" Width="50" Height="15" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
+                                <TextBox Background="{DynamicResource Table_BG_Title}" Text="Dummy2" Width="130" Height="15" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
                                      IsReadOnly="True" FontSize="10"/>
                                 <ctrls:FOUPFrontView UnitData="{Binding Dummy2ModuleInfo}"
                                                      IsCassettePlaced="{Binding RtDataValues[Dummy2.CassettePlaced]}"

+ 1 - 0
CyberX8_Simulator/Config/UILayout.xml

@@ -11,6 +11,7 @@
 		<SubView Id="Wago0" Name="Loader" ViewClass="CyberX8_Simulator.Views.WagoView" Assembly="CyberX8_Simulator" Port ="501"/>
 		<SubView Id="Wago1" Name="Puf" ViewClass="CyberX8_Simulator.Views.WagoView" Assembly="CyberX8_Simulator" Port ="550"/>
 		<SubView Id="Wago2" Name="Wago2" ViewClass="CyberX8_Simulator.Views.WagoView" Assembly="CyberX8_Simulator" Port ="551"/>
+		<SubView Id="Wago3" Name="Wago3" ViewClass="CyberX8_Simulator.Views.WagoView" Assembly="CyberX8_Simulator" Port ="552"/>
 	</Navigation>
 
 	<Navigation Id="Festo" Name="Festo">

+ 28 - 17
CyberX8_Simulator/Devices/WagoSocketSimulator.cs

@@ -159,48 +159,59 @@ namespace CyberX8_Simulator.Devices
                             //加载DO
                             int i = 0;
                             DONameIndexDic = new Dictionary<string, int>();
-                            foreach (var group in config.WagoDigOut.WagoDOGroups)
+                            if(config.WagoDigOut != null && config.WagoDigOut.WagoDOGroups != null)
                             {
-                                foreach (var item in group.WagoDOs)
+                                foreach (var group in config.WagoDigOut.WagoDOGroups)
                                 {
-                                    DONameIndexDic[item.Name] = i;
-                                    i++;
+                                    foreach (var item in group.WagoDOs)
+                                    {
+                                        DONameIndexDic[item.Name] = i;
+                                        i++;
+                                    }
                                 }
                             }
                             //加载DI
                             i = 0;
                             DINameIndexDic = new Dictionary<string, int>();
-                            foreach (var group in config.WagoDigIn.WagoDIGroups)
+                            if(config.WagoDigIn != null && config.WagoDigIn.WagoDIGroups != null)
                             {
-                                foreach(var item in group.WagoDIs)
+                                foreach (var group in config.WagoDigIn.WagoDIGroups)
                                 {
-                                    DINameIndexDic[item.Name] = i;
-                                    i++;
+                                    foreach (var item in group.WagoDIs)
+                                    {
+                                        DINameIndexDic[item.Name] = i;
+                                        i++;
+                                    }
                                 }
                             }
                             //加载AO
                             i = 0;
                             AONameIndexDic = new Dictionary<string, int>();
-                            foreach (var group in config.WagoAnoOut.WagoAOGroups)
+                            if (config.WagoAnoOut != null && config.WagoAnoOut.WagoAOGroups != null)
                             {
-                                foreach (var item in group.WagoAOs)
+                                foreach (var group in config.WagoAnoOut.WagoAOGroups)
                                 {
-                                    AONameIndexDic[item.Name] = i;
-                                    i++;
+                                    foreach (var item in group.WagoAOs)
+                                    {
+                                        AONameIndexDic[item.Name] = i;
+                                        i++;
+                                    }
                                 }
                             }
                             //加载AI
                             i = 0;
                             AINameIndexDic = new Dictionary<string, int>();
-                            foreach (var group in config.WagoAnoIn.WagoAIGroups)
+                            if (config.WagoAnoIn != null && config.WagoAnoIn.WagoAIGroups != null)
                             {
-                                foreach (var item in group.WagoAIs)
+                                foreach (var group in config.WagoAnoIn.WagoAIGroups)
                                 {
-                                    AINameIndexDic[item.Name] = i;
-                                    i++;
+                                    foreach (var item in group.WagoAIs)
+                                    {
+                                        AINameIndexDic[item.Name] = i;
+                                        i++;
+                                    }
                                 }
                             }
-
                         }
                     }
                 }

+ 2 - 3
CyberX8_Simulator/Views/WagoView.xaml.cs

@@ -230,7 +230,6 @@ namespace CyberX8_Simulator.Views
         public WagoViewModel(string str) : base("WagoViewModel")
         {
 
-
             DOSelectionChangedCommand = new DelegateCommand<object>(DOSelectionChangedAction);
             DISelectionChangedCommand = new DelegateCommand<object>(DISelectionChangedAction);
             AOSelectionChangedCommand = new DelegateCommand<object>(AOSelectionChangedAction);
@@ -274,7 +273,7 @@ namespace CyberX8_Simulator.Views
 
         private void DOSelectionChangedAction(object obj)
         {
-            if (DOSelectedItem == null)
+            if (DOSelectedItem == null) 
             {
                 return;
             }
@@ -298,7 +297,7 @@ namespace CyberX8_Simulator.Views
         }
         private void AISelectionChangedAction(object obj)
         {
-            if(AISelectedItem == null)
+            if(AISelectedItem == null) //若来自其它的模块更新了AI的值,且当前选中的是该项,实时更新该项的值
             {
                return;
             }

+ 4 - 4
Framework/Common/Device/Wago/WagoControllerCfgManager.cs

@@ -141,7 +141,7 @@ namespace MECF.Framework.Common.Device.Wago
             //DI
             ushort diStartAddress = 0;
             ushort diCount = 0;
-            if (deviceConfig.WagoDigIn.WagoDIGroups?.Count != 0)
+            if (deviceConfig.WagoDigIn != null &&  deviceConfig.WagoDigIn.WagoDIGroups?.Count != 0)
             {
                 diStartAddress = (ushort)deviceConfig.WagoDigIn.WagoDIGroups[0].WagoDIs[0].Address;
                 List<string> diLst = new List<string>();
@@ -163,7 +163,7 @@ namespace MECF.Framework.Common.Device.Wago
             //DO
             ushort doStartAddress = 0;
             ushort doCount = 0;
-            if (deviceConfig.WagoDigOut.WagoDOGroups?.Count != 0)
+            if (deviceConfig.WagoDigOut != null && deviceConfig.WagoDigOut.WagoDOGroups?.Count != 0)
             {
                 doStartAddress = (ushort)deviceConfig.WagoDigOut.WagoDOGroups[0].WagoDOs[0].Address;
                 List<string> doList = new List<string>();
@@ -187,7 +187,7 @@ namespace MECF.Framework.Common.Device.Wago
             //AI
             ushort aiCount = 0;
             ushort aiStartAddress = 0;
-            if (deviceConfig.WagoAnoIn.WagoAIGroups?.Count != 0)
+            if ( deviceConfig.WagoAnoIn != null && deviceConfig.WagoAnoIn.WagoAIGroups?.Count != 0)
             {
                 aiStartAddress = (ushort)deviceConfig.WagoAnoIn.WagoAIGroups[0].WagoAIs[0].Address;
                 int index = 0;
@@ -213,7 +213,7 @@ namespace MECF.Framework.Common.Device.Wago
             //AO
             ushort aoStartAddress = 0;
             ushort aoCount = 0;
-            if (deviceConfig.WagoAnoOut.WagoAOGroups?.Count != 0)
+            if (deviceConfig.WagoAnoOut!= null && deviceConfig.WagoAnoOut.WagoAOGroups?.Count != 0)
             {
                 aoStartAddress = (ushort)deviceConfig.WagoAnoOut.WagoAOGroups[0].WagoAOs[0].Address;
                 int index = 0;