Browse Source

revise efem and efemsimulator view

chenzk 4 weeks ago
parent
commit
ebde22937c

+ 4 - 0
CyberX8_MainPages/ViewModels/EfemViewModel.cs

@@ -1203,6 +1203,10 @@ namespace CyberX8_MainPages.ViewModels
             m_RtDataKeys.Add("LP1.CurrentControlJob");
             m_RtDataKeys.Add("LP2.CurrentControlJob");
             m_RtDataKeys.Add("LP3.CurrentControlJob");
+
+            m_RtDataKeys.Add("LP1.WaferSize");
+            m_RtDataKeys.Add("LP2.WaferSize");
+            m_RtDataKeys.Add("LP3.WaferSize");
         }
         /// <summary>
         /// Robot位置信息变更(动画)

+ 4 - 1
CyberX8_MainPages/ViewModels/OperationOverViewModel.cs

@@ -1401,7 +1401,10 @@ namespace CyberX8_MainPages.ViewModels
             m_RtDataKeys.Add("LP1.CurrentControlJob");
             m_RtDataKeys.Add("LP2.CurrentControlJob");
             m_RtDataKeys.Add("LP3.CurrentControlJob");
-            
+            m_RtDataKeys.Add("LP1.WaferSize");
+            m_RtDataKeys.Add("LP2.WaferSize");
+            m_RtDataKeys.Add("LP3.WaferSize");
+
 
             m_RtDataKeys.Add("System.IsAutoMode");
             m_RtDataKeys.Add("System.IsBusy");      

+ 14 - 2
CyberX8_MainPages/Views/EfemView.xaml

@@ -16,6 +16,7 @@
 
     <UserControl.Resources>
         <converters:BoolToVisibility2 x:Key="BoolToVisibility2"/>
+        <converters:BoolToVisibility x:Key="BoolToVisibility"/>
         <converters:BoolToColor x:Key="boolToColor"></converters:BoolToColor>
     </UserControl.Resources>
 
@@ -41,15 +42,17 @@
         <TextBlock Text="LP3" Canvas.Top="470" Canvas.Left="350" FontSize="12"></TextBlock>
 
 
-        <StackPanel Canvas.Top="15" Canvas.Left="1550">
+        <StackPanel Canvas.Top="15" Canvas.Left="1700">
             <userControls:FOUPFrontView UnitData="{Binding Dummy2ModuleInfo}" ShowTitle="False" IsEnabled="{Binding RtDataValues[System.IsAutoMode],Converter={StaticResource BoolToBool}}"/>
             <TextBlock Text="Dummy2" HorizontalAlignment="Center" Margin="0,5,0,20" FontSize="12">
             </TextBlock>
+        
+        </StackPanel>
+        <StackPanel Canvas.Top="15" Canvas.Left="1550">
             <userControls:FOUPFrontView UnitData="{Binding Dummy1ModuleInfo}" ShowTitle="False" IsEnabled="{Binding RtDataValues[System.IsAutoMode],Converter={StaticResource BoolToBool}}"/>
             <TextBlock Text="Dummy1" HorizontalAlignment="Center" Margin="0,5,0,0" FontSize="12">
             </TextBlock>
         </StackPanel>
-
         <userControls:SRDFrontView UnitData1="{Binding Srd2ModuleInfo}" UnitData2="{Binding Srd1ModuleInfo}" Title="SRD"  Canvas.Top="80" Canvas.Left="1040"/>
 
         <userControls:RobotFrontView UnitData="{Binding EFEMModuleInfo}" Canvas.Left="1222" Canvas.Top="112"/>
@@ -59,14 +62,23 @@
                 <Rectangle  Width="70" Height="70" Fill="Silver"  Opacity="0.8" RadiusX="0.1" RadiusY="0.1"
                             />
             </Grid>
+            <TextBlock Canvas.Top="485" Canvas.Left="450" Text="{Binding RtDataValues[LP1.WaferSize]}" Visibility="{Binding RtDataValues[LP1.CassettePlaced], Converter={StaticResource BoolToVisibility2}}"
+                       HorizontalAlignment="Center" Margin="0,5,0,0" FontSize="16">
+            </TextBlock>
             <Grid Canvas.Left="499" Canvas.Top="538" Panel.ZIndex="2" Visibility="{Binding IsLP2Unable,Converter={StaticResource bool2VisibilityConverter}}">
                 <Rectangle  Width="70" Height="70" Fill="Silver"  Opacity="0.8" RadiusX="0.1" RadiusY="0.1"
                 />
             </Grid>
+            <TextBlock Canvas.Top="580" Canvas.Left="450" Text="{Binding RtDataValues[LP2.WaferSize]}" Visibility="{Binding RtDataValues[LP2.CassettePlaced], Converter={StaticResource BoolToVisibility2}}"
+                       HorizontalAlignment="Center" Margin="0,5,0,0" FontSize="16">
+            </TextBlock>
             <Grid Canvas.Left="499" Canvas.Top="635" Panel.ZIndex="2" Visibility="{Binding IsLP3Unable,Converter={StaticResource bool2VisibilityConverter}}">
                 <Rectangle  Width="70" Height="70" Fill="Silver"  Opacity="0.8" RadiusX="0.1" RadiusY="0.1"
                                 />
             </Grid>
+            <TextBlock Canvas.Top="680" Canvas.Left="450" Text="{Binding RtDataValues[LP3.WaferSize]}" Visibility="{Binding RtDataValues[LP3.CassettePlaced], Converter={StaticResource BoolToVisibility2}}"
+                       HorizontalAlignment="Center" Margin="0,5,0,0" FontSize="16">
+            </TextBlock>
             <Viewbox Width="890" Height="890" Canvas.Top="5" Canvas.Left="297" Stretch="Fill">
                 <Canvas Width="1000" Height="1000">
                     <!--<userControls:MainTM Width="300" Height="250" Canvas.Left="380" Canvas.Top="90"/>-->

+ 9 - 0
CyberX8_MainPages/Views/OperationOverView.xaml

@@ -65,6 +65,15 @@
                 <Rectangle  Width="70" Height="70" Fill="Silver"  Opacity="0.8" RadiusX="0.1" RadiusY="0.1"
                          />
             </Grid>
+            <TextBlock Canvas.Top="220" Canvas.Left="70" Text="{Binding RtDataValues[LP1.WaferSize]}" Visibility="{Binding RtDataValues[LP1.CassettePlaced], Converter={StaticResource boolToVisibility2}}"
+    HorizontalAlignment="Center" Margin="0,5,0,0" FontSize="16">
+            </TextBlock>
+            <TextBlock Canvas.Top="320" Canvas.Left="70" Text="{Binding RtDataValues[LP2.WaferSize]}" Visibility="{Binding RtDataValues[LP2.CassettePlaced], Converter={StaticResource boolToVisibility2}}"
+    HorizontalAlignment="Center" Margin="0,5,0,0" FontSize="16">
+            </TextBlock>
+            <TextBlock Canvas.Top="420" Canvas.Left="70" Text="{Binding RtDataValues[LP3.WaferSize]}" Visibility="{Binding RtDataValues[LP3.CassettePlaced], Converter={StaticResource boolToVisibility2}}"
+               HorizontalAlignment="Center" Margin="0,5,0,0" FontSize="16">
+            </TextBlock>
             <Canvas Canvas.Left="280">
 
                 <userControls:EFEM Width="360" Height="300" Canvas.Left="-88" Canvas.Top="169" Aligner1Wafer="{Binding Aligner1Wafer}" 

+ 194 - 151
CyberX8_Simulator/Devices/SunWayEfemSimulator.cs

@@ -92,41 +92,42 @@ namespace CyberX8_Simulator.Devices
         protected override void ProcessUnsplitMessage(string str)
         {
 
-            string ack = ""; 
-            if (str.StartsWith("RQ LOAD")) //查询手指是否带片
-            {
-                ack = "LOAD A OFF\n_RDY"; 
-            }
-            else if(str.StartsWith("RSR"))  //返回扫片结果
-            {
-                string[] strings = str.Split(' ').ToArray();
-                int stationNumber = int.Parse(strings[1]);
-                if (stationNumber >= 50 && stationNumber <= 58) //LP
-                {
-                    string lpwafer = "";
-                    foreach(var item in _slotMap)
-                    {
-                        lpwafer += $" {item}";
-                    }
-                    ack = "MAP" + lpwafer;
-                }
-                else if (stationNumber >= 59 && stationNumber <= 64) //dummy
-                {
-                    string dummywafer = "";
-                    foreach (var item in _slotDummy)
-                    {
-                        dummywafer += $" {item}";
-                    }
-                    ack = "MAP" + dummywafer;
-                }
-            }
-            else //默认回复
-            {
-                ack = str + "\n_RDY"; ;
-            }
-            OnWriteMessage(ack);
+            //string ack = ""; 
+            //if (str.StartsWith("RQ LOAD")) //查询手指是否带片
+            //{
+            //    ack = "LOAD A OFF\n_RDY"; 
+            //}
+            //else if(str.StartsWith("RSR"))  //返回扫片结果
+            //{
+            //    string[] strings = str.Split(' ').ToArray();
+            //    int stationNumber = int.Parse(strings[1]);
+            //    if (stationNumber >= 50 && stationNumber <= 58) //LP
+            //    {
+            //        string lpwafer = "";
+            //        foreach(var item in _slotMap)
+            //        {
+            //            lpwafer += $" {item}";
+            //        }
+            //        ack = "MAP" + lpwafer;
+            //    }
+            //    else if (stationNumber >= 59 && stationNumber <= 64) //dummy
+            //    {
+            //        string dummywafer = "";
+            //        foreach (var item in _slotDummy)
+            //        {
+            //            dummywafer += $" {item}";
+            //        }
+            //        ack = "MAP" + dummywafer;
+            //    }
+            //}
+            //else //默认回复
+            //{
+            //    ack = str + "\n_RDY"; ;
+            //}
+            //OnWriteMessage(ack);
+
             // 处理INF
-            //OnWork(str);
+            OnWork(str);
         }
         internal void SetCassetteDoor(bool doorOpen)
         {
@@ -175,131 +176,173 @@ namespace CyberX8_Simulator.Devices
             string msg = $"EVT:SIGSTAT/System/{data:X8}/00000000;";
             OnWriteMessage(msg);
         }
-        private void OnWork(string strACK)
+        private void OnWork(string str)
         {
-            // match basic
-            Match m1 = Regex.Match(strACK, SCMD);
-
-            // get mock delay time
-            string sBasic = m1.Groups[1].Value;
-
-            if (string.IsNullOrEmpty(sBasic))
-                return;
-
-
-
-            EfemOperation op = EfemConstant.ToOperation(sBasic);
-            ushort millionSec = this.SimuOperationTime(op);
-
-            // delay
-            //await Task.Delay(millionSec);
-            Thread.Sleep(millionSec);
-
-            // build the INF string
-            string strINF = string.Empty;
-
-            switch (EfemConstant.ToOperation(strACK))
+            string ack = "";
+            if (str.StartsWith("RQ LOAD")) //查询手指是否带片
             {
-                case EfemOperation.GetWaferInfo:
-                    strINF = strACK.Replace(ACK, "INF");
-                    strINF = strINF.TrimEnd(';');
-                    string map1 = string.Join("", _slotMap);
-                    strINF += $"/{map1};";
-                    break;
-                case EfemOperation.Home:
-                    int data1 = 0b011111111010100000;
-                    string s1 = $"EVT:SIGSTAT/LP1/00000000/00000003;\rEVT:SIGSTAT/LP2/0000000/00000003;\rEVT:SIGSTAT/LP3/000000/00000003;\rEVT:SIGSTAT/System/{data1}/00000;\r";
-
-                    strINF = s1 + strACK.Replace(ACK, "INF");
-                    SendSystemData();
-                    SendLP1Data();
-                    SendLP2Data();
-                    SendLP3Data();
-                    SendAlignData();
-                    OnWriteMessage(strACK.Replace(ACK, "INF"));
-                    return;
-                case EfemOperation.Map:
-                    if(strACK.Contains("BF"))
-                    {
-                        string map = string.Join("", _slotDummy);
-                        string strEVT = strACK.Replace(ACK,"EVT");
-                        strEVT = strEVT.Replace("WAFSH","MAPDT");
-                        strEVT = strEVT.TrimEnd(';');
-                        string str = $"{strEVT}/{map};";
-                        OnWriteMessage(str);
-                    }
-                    else if (strACK.Contains("LP"))
-                    {
-                        string map = string.Join("", _slotMap);
-                        string strEVT = strACK.Replace(ACK, "EVT");
-                        strEVT = strEVT.Replace("WAFSH", "MAPDT");
-                        strEVT = strEVT.TrimEnd(';');
-                        string str = $"{strEVT}/{map};";
-                        OnWriteMessage(str);
-                    }
-                    strINF = strACK.Replace(ACK, "INF");
-                    break;
-                case EfemOperation.Load:                  
-                        strINF = strACK.Replace(ACK, "INF"); 
-                    break;
-                case EfemOperation.StateTrack:
-                    strINF = "INF:STATE/TRACK/NONE/NONE;";
-                    break;
-                case EfemOperation.CarrierId:
-                    
-                    
-                    break;
-
-                case EfemOperation.Size:
-                    
-                    break;
-                case EfemOperation.Dock:
-                    Match mDock = Regex.Match(strACK, SFOUP);
-                    if (mDock.Success)
-                    {
-                        UpdateLocked(mDock.Groups[1].Value, true);
-                    }
-                    strINF = strACK.Replace(ACK, "INF");
-                    break;
-                case EfemOperation.Undock:
-                    Match mUnDock = Regex.Match(strACK, SFOUP);
-                    if (mUnDock.Success)
-                    {
-                        UpdateLocked(mUnDock.Groups[1].Value, false);
-                    }
-                    strINF = strACK.Replace(ACK, "INF");
-                    break;
-                case EfemOperation.Clamp:
-                    Match mClamp= Regex.Match(strACK, SFOUP);
-                    if (mClamp.Success)
+                ack = "LOAD A OFF\n_RDY";
+            }
+            else if (str.StartsWith("RSR"))  //返回扫片结果
+            {
+                string[] strings = str.Split(' ').ToArray();
+                int stationNumber = int.Parse(strings[1]);
+                if (stationNumber >= 50 && stationNumber <= 58) //LP
+                {
+                    string lpwafer = "";
+                    foreach (var item in _slotMap)
                     {
-                        UpdateClamped(mClamp.Groups[1].Value, true);
+                        lpwafer += $" {item}";
                     }
-                    strINF = strACK.Replace(ACK, "INF");
-                    break;
-                case EfemOperation.Unclamp:
-                    Match mUnClamp = Regex.Match(strACK, SFOUP);
-                    if (mUnClamp.Success)
+                    ack = "MAP" + lpwafer;
+                }
+                else if (stationNumber >= 59 && stationNumber <= 64) //dummy
+                {
+                    string dummywafer = "";
+                    foreach (var item in _slotDummy)
                     {
-                        UpdateClamped(mUnClamp.Groups[1].Value, false);
+                        dummywafer += $" {item}";
                     }
-                    strINF = strACK.Replace(ACK, "INF");
-                    break;
-                case EfemOperation.Speed:
-                    
-                    break;
-                case EfemOperation.Align:
-                case EfemOperation.Pick:
-                case EfemOperation.Place:
-                case EfemOperation.Orgsh:
-                case EfemOperation.Light:
-                case EfemOperation.SigStatus:
-                default:
-                    strINF = strACK.Replace(ACK, "INF");
-                    break;
+                    ack = "MAP" + dummywafer;
+                }
+            }
+            else //默认回复
+            {
+                if (str.StartsWith("PICK") || str.StartsWith("PLACE") || str.StartsWith("MAP"))
+                {
+                    Thread.Sleep((ushort)3000);
+                }
+                ack = str + "\n_RDY"; ;
             }
+            OnWriteMessage(ack);
+            //if (strACK.StartsWith("PICK") || strACK.StartsWith("PLACE") || strACK.StartsWith("MAP"))
+            //{
+            //    Thread.Sleep((ushort)3000);
+            //}
+            //// match basic
+            //Match m1 = Regex.Match(strACK, SCMD);
+
+            //// get mock delay time
+            //string sBasic = m1.Groups[1].Value;
+
+            //if (string.IsNullOrEmpty(sBasic))
+            //    return;
+
+
+
+            //EfemOperation op = EfemConstant.ToOperation(sBasic);
+            //ushort millionSec = this.SimuOperationTime(op);
+
+            //// delay
+            ////await Task.Delay(millionSec);
+            //Thread.Sleep(millionSec);
+
+            //// build the INF string
+            //string strINF = string.Empty;
+
+            //switch (EfemConstant.ToOperation(strACK))
+            //{
+            //    case EfemOperation.GetWaferInfo:
+            //        strINF = strACK.Replace(ACK, "INF");
+            //        strINF = strINF.TrimEnd(';');
+            //        string map1 = string.Join("", _slotMap);
+            //        strINF += $"/{map1};";
+            //        break;
+            //    case EfemOperation.Home:
+            //        int data1 = 0b011111111010100000;
+            //        string s1 = $"EVT:SIGSTAT/LP1/00000000/00000003;\rEVT:SIGSTAT/LP2/0000000/00000003;\rEVT:SIGSTAT/LP3/000000/00000003;\rEVT:SIGSTAT/System/{data1}/00000;\r";
+
+            //        strINF = s1 + strACK.Replace(ACK, "INF");
+            //        SendSystemData();
+            //        SendLP1Data();
+            //        SendLP2Data();
+            //        SendLP3Data();
+            //        SendAlignData();
+            //        OnWriteMessage(strACK.Replace(ACK, "INF"));
+            //        return;
+            //    case EfemOperation.Map:
+            //        if(strACK.Contains("BF"))
+            //        {
+            //            string map = string.Join("", _slotDummy);
+            //            string strEVT = strACK.Replace(ACK,"EVT");
+            //            strEVT = strEVT.Replace("WAFSH","MAPDT");
+            //            strEVT = strEVT.TrimEnd(';');
+            //            string str = $"{strEVT}/{map};";
+            //            OnWriteMessage(str);
+            //        }
+            //        else if (strACK.Contains("LP"))
+            //        {
+            //            string map = string.Join("", _slotMap);
+            //            string strEVT = strACK.Replace(ACK, "EVT");
+            //            strEVT = strEVT.Replace("WAFSH", "MAPDT");
+            //            strEVT = strEVT.TrimEnd(';');
+            //            string str = $"{strEVT}/{map};";
+            //            OnWriteMessage(str);
+            //        }
+            //        strINF = strACK.Replace(ACK, "INF");
+            //        break;
+            //    case EfemOperation.Load:                  
+            //            strINF = strACK.Replace(ACK, "INF"); 
+            //        break;
+            //    case EfemOperation.StateTrack:
+            //        strINF = "INF:STATE/TRACK/NONE/NONE;";
+            //        break;
+            //    case EfemOperation.CarrierId:
+
+
+            //        break;
+
+            //    case EfemOperation.Size:
+
+            //        break;
+            //    case EfemOperation.Dock:
+            //        Match mDock = Regex.Match(strACK, SFOUP);
+            //        if (mDock.Success)
+            //        {
+            //            UpdateLocked(mDock.Groups[1].Value, true);
+            //        }
+            //        strINF = strACK.Replace(ACK, "INF");
+            //        break;
+            //    case EfemOperation.Undock:
+            //        Match mUnDock = Regex.Match(strACK, SFOUP);
+            //        if (mUnDock.Success)
+            //        {
+            //            UpdateLocked(mUnDock.Groups[1].Value, false);
+            //        }
+            //        strINF = strACK.Replace(ACK, "INF");
+            //        break;
+            //    case EfemOperation.Clamp:
+            //        Match mClamp= Regex.Match(strACK, SFOUP);
+            //        if (mClamp.Success)
+            //        {
+            //            UpdateClamped(mClamp.Groups[1].Value, true);
+            //        }
+            //        strINF = strACK.Replace(ACK, "INF");
+            //        break;
+            //    case EfemOperation.Unclamp:
+            //        Match mUnClamp = Regex.Match(strACK, SFOUP);
+            //        if (mUnClamp.Success)
+            //        {
+            //            UpdateClamped(mUnClamp.Groups[1].Value, false);
+            //        }
+            //        strINF = strACK.Replace(ACK, "INF");
+            //        break;
+            //    case EfemOperation.Speed:
+
+            //        break;
+            //    case EfemOperation.Align:
+            //    case EfemOperation.Pick:
+            //    case EfemOperation.Place:
+            //    case EfemOperation.Orgsh:
+            //    case EfemOperation.Light:
+            //    case EfemOperation.SigStatus:
+            //    default:
+            //        strINF = strACK.Replace(ACK, "INF");
+            //        break;
+            //}
+
+            //OnWriteMessage(strINF);
 
-            OnWriteMessage(strINF);
         }
 
         private void UpdateLocked(string lpNumber,bool locked)

+ 0 - 6
CyberX8_Simulator/Views/Simu_SunWayEfemView.xaml

@@ -30,12 +30,6 @@
             </StackPanel>
 
             <StackPanel Grid.Row="1" Orientation="Horizontal" Width="1300" Canvas.Top="50">
-                <Button Content="Place1" Margin="10,6,0,0" Width="100" Height="35"   Command="{Binding Place1Command}" ></Button>
-                <Button Content="Remove1" Margin="20,6,0,0" Width="100" Height="35"   Command="{Binding Remove1Command}"  ></Button>
-                <Button Content="Place2" Margin="20,6,0,0" Width="100" Height="35"   Command="{Binding Place2Command}"  ></Button>
-                <Button Content="Remove2" Margin="20,6,0,0" Width="100" Height="35"   Command="{Binding Remove2Command}"  ></Button>
-                <Button Content="Place3" Margin="20,6,0,0" Width="100" Height="35"   Command="{Binding Place3Command}"  ></Button>
-                <Button Content="Remove3" Margin="20,6,0,0" Width="100" Height="35"   Command="{Binding Remove3Command}"  ></Button>
                 <Button Content="SetAll" Width="100" Height="35"   Command="{Binding SetAllCommand}"  Margin="20,6,0,0"></Button>
                 <Button Content="Random" Width="100" Height="35"   Command="{Binding RandomCommand}" Margin="20,6,0,0"></Button>
                 <Button Content="RandomDummy" Width="150" Height="35"   Command="{Binding RandomDummyCommand}" Margin="20,6,0,0"></Button>

+ 1 - 41
CyberX8_Simulator/Views/Simu_SunWayEfemView.xaml.cs

@@ -173,13 +173,6 @@ namespace CyberX8_Simulator.Views
         }
         private SunWayEfemSimulator _sim;
 
-        public ICommand Place1Command { get; set; }
-        public ICommand Remove1Command { get; set; }
-        public ICommand Place2Command { get; set; }
-        public ICommand Remove2Command { get; set; }
-
-        public ICommand Place3Command { get; set; }
-        public ICommand Remove3Command { get; set; }
         public ICommand ClearCommand { get; set; }
         public ICommand SetAllCommand { get; set; }
         public ICommand RandomCommand { get; set; }
@@ -187,12 +180,7 @@ namespace CyberX8_Simulator.Views
 
         public Simu_SunWayEfemViewModel() : base("SunWayEfemSimuViewModel")
         {
-            Place1Command = new DelegateCommand<string>(Place1);
-            Remove1Command = new DelegateCommand<string>(Remove1);
-            Place2Command = new DelegateCommand<string>(Place2);
-            Remove2Command = new DelegateCommand<string>(Remove2);
-            Place3Command = new DelegateCommand<string>(Place3);
-            Remove3Command = new DelegateCommand<string>(Remove3);
+            
             ClearCommand = new DelegateCommand<string>(Clear);
             SetAllCommand = new DelegateCommand<string>(SetAll);
             RandomCommand = new DelegateCommand<string>(RandomGenerateWafer);
@@ -222,34 +210,6 @@ namespace CyberX8_Simulator.Views
             _sim.ClearWafer();
         }
 
-        private void Remove1(string obj)
-        {
-            _sim.RemoveCarrier1();
-        }
-
-        private void Place1(string obj)
-        {
-            _sim.PlaceCarrier1();
-        }
-
-        private void Remove2(string obj)
-        {
-            _sim.RemoveCarrier2();
-        }
-
-        private void Place2(string obj)
-        {
-            _sim.PlaceCarrier2();
-        }
-        private void Remove3(string obj)
-        {
-            _sim.RemoveCarrier3();
-        }
-
-        private void Place3(string obj)
-        {
-            _sim.PlaceCarrier3();
-        }
         private List<string> _WaferSizeItems = new List<string>() { "200", "300"};
         public List<string> WaferSizeItems
         {