Browse Source

1.Fix Tru RF/match bugs
2.improve chamberDE UI

hecl 1 year ago
parent
commit
f501000473

+ 3 - 3
Venus/Venus_MainPages/ViewModels/OverVenusDEViewModel.cs

@@ -1489,10 +1489,10 @@ namespace Venus_MainPages.ViewModels
         //    }
         //}
         private async void OnSetBRf()
-        {       
+        {   
             if (BRFData.IsRfOn == true)
             {
-                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetBRf", BRFFwdPowerSetpoint, false);
+                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetBRf", BRFFwdPowerSetpoint, false);
             }
             else
             {
@@ -1500,7 +1500,7 @@ namespace Venus_MainPages.ViewModels
                 {
                     InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{VenusDevice.BiasMatch}.{AITRfOperation.SetMatchPosition}", BRFMatchC1, BRFMatchC2);
                     await Task.Delay(100);
-                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetBRf", BRFFwdPowerSetpoint, true);
+                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetBRf", BRFFwdPowerSetpoint, true);                                                   
                 }
             }
         }

+ 0 - 3
Venus/Venus_MainPages/ViewModels/TopViewModel.cs

@@ -100,7 +100,6 @@ namespace Venus_MainPages.ViewModels
             get { return m_RtDataValues; }
             set { SetProperty(ref m_RtDataValues, value); }
         }
-        public Dictionary<string, object> _RtDataValues;
 
         public ObservableCollection<EventItem> EventLogList
         {
@@ -297,7 +296,6 @@ namespace Venus_MainPages.ViewModels
         {
             m_SoftwareVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
             string allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString();
-            RtDataValues = new Dictionary<string, object> { };
             PMAIsInstalled = allModules.Contains("PMA");
             PMBIsInstalled = allModules.Contains("PMB");
             PMCIsInstalled = allModules.Contains("PMC");
@@ -404,7 +402,6 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add("EFEM.IsOnline");
             m_RtDataKeys.Add("SETM.FsmState");
             m_RtDataKeys.Add("VCE1.FsmState");
-            m_RtDataKeys.Add("VCE1.FsmState");
             m_RtDataKeys.Add("SYSTEM.FsmState");
             m_RtDataKeys.Add("System.IsAutoMode");
 

+ 6 - 6
Venus/Venus_MainPages/Views/TMOperationView.xaml

@@ -690,13 +690,13 @@
                 <Border  Grid.Row="1" BorderBrush="{DynamicResource Table_BD}"  BorderThickness="1,0,1,1" >
                     <Canvas Background="{DynamicResource Table_BG_Content}" Margin="1" Height="260" Width="712">
                         <Ellipse Width="22" Height="22" Fill="{Binding RtDataValues[PMA.IsSlitDoorClosed],Converter={StaticResource boolToColor2}}"  Canvas.Left="180" Canvas.Top="10" Stroke="Silver" StrokeThickness="2" Visibility="{Binding PMAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
-                        <Button Width="140" Height="25" Content="PMA Door Open"                                             Canvas.Left="210" Canvas.Top="10" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="PMA.SlitDoor.Open" IsEnabled="{Binding RtDataValues[PMA.IsSlitDoorClosed]}" Visibility="{Binding PMAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
+                        <Button Width="140" Height="25" Content="PMA Door Open"                                             Canvas.Left="210" Canvas.Top="10" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="PMA.SlitDoor.Open" IsEnabled="{Binding RtDataValues[PMA.IsSlitDoorClosed],TargetNullValue=false}" Visibility="{Binding PMAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
 
                         <Ellipse Width="22" Height="22" Fill="{Binding RtDataValues[PMA.IsSlitDoorClosed],Converter={StaticResource boolToColor}}"  Canvas.Left="380" Canvas.Top="10" Stroke="Silver" StrokeThickness="2" Visibility="{Binding PMAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
                         <Button Width="140" Height="25" Content="PMA Door Closed"                                               Canvas.Left="410" Canvas.Top="10" Style="{StaticResource SysBtnStyle}" Command="{Binding DoorUpDownCommand}" CommandParameter="PMA.SlitDoor.Close" IsEnabled="{Binding RtDataValues[PMA.IsSlitDoorClosed],Converter={StaticResource BoolToBool}}" Visibility="{Binding PMAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
 
                         <Ellipse Width="22" Height="22" Fill="{Binding RtDataValues[PMB.IsSlitDoorClosed],Converter={StaticResource boolToColor2}}"  Canvas.Left="180" Canvas.Top="40" Stroke="Silver" StrokeThickness="2" Visibility="{Binding PMBIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
-                        <Button Width="140" Height="25" Content="PMB Door Open"                                               Canvas.Left="210" Canvas.Top="40" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="PMB.SlitDoor.Open" IsEnabled="{Binding RtDataValues[PMB.IsSlitDoorClosed]}" Visibility="{Binding PMBIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
+                        <Button Width="140" Height="25" Content="PMB Door Open"                                               Canvas.Left="210" Canvas.Top="40" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="PMB.SlitDoor.Open" IsEnabled="{Binding RtDataValues[PMB.IsSlitDoorClosed],TargetNullValue=false}" Visibility="{Binding PMBIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
 
                         <Ellipse Width="22" Height="22" Fill="{Binding RtDataValues[PMB.IsSlitDoorClosed],Converter={StaticResource boolToColor}}"  Canvas.Left="380" Canvas.Top="40" Stroke="Silver" StrokeThickness="2" Visibility="{Binding PMBIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
                         <Button Width="140" Height="25" Content="PMB Door Closed"                                               Canvas.Left="410" Canvas.Top="40" Style="{StaticResource SysBtnStyle}" Command="{Binding DoorUpDownCommand}" CommandParameter="PMB.SlitDoor.Close" IsEnabled="{Binding RtDataValues[PMB.IsSlitDoorClosed],Converter={StaticResource BoolToBool}}" Visibility="{Binding PMBIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
@@ -714,25 +714,25 @@
                         <Button Width="140" Height="25" Content="PMD Door Closed"                                               Canvas.Left="410" Canvas.Top="100" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="PMD.SlitDoor.Close" IsEnabled="{Binding RtDataValues[PMD.IsSlitDoorClosed],Converter={StaticResource BoolToBool}}" Visibility="{Binding PMDIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
 
                         <Ellipse Width="22" Height="22" Fill="{Binding RtDataValues[TM.LLATSlitDoor.IsClosed],Converter={StaticResource boolToColor2}}"  Canvas.Left="180" Canvas.Top="130" Stroke="Silver" StrokeThickness="2" />
-                        <Button Width="140" Height="25" Content="LLA Inner Door Open"                                               Canvas.Left="210" Canvas.Top="130" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="TM.LLATSlitDoor.Open" IsEnabled="{Binding RtDataValues[TM.LLATSlitDoor.IsClosed]}" />
+                        <Button Width="140" Height="25" Content="LLA Inner Door Open"                                               Canvas.Left="210" Canvas.Top="130" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="TM.LLATSlitDoor.Open" IsEnabled="{Binding RtDataValues[TM.LLATSlitDoor.IsClosed],TargetNullValue=false}" />
 
                         <Ellipse Width="22" Height="22" Fill="{Binding RtDataValues[TM.LLATSlitDoor.IsClosed],Converter={StaticResource boolToColor}}"  Canvas.Left="380" Canvas.Top="130" Stroke="Silver" StrokeThickness="2" />
                         <Button Width="140" Height="25" Content="LLA Inner Door Closed"                                               Canvas.Left="410" Canvas.Top="130" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="TM.LLATSlitDoor.Close" IsEnabled="{Binding RtDataValues[TM.LLATSlitDoor.IsClosed],Converter={StaticResource BoolToBool}}" />
 
                         <Ellipse Width="22" Height="22" Fill="{Binding RtDataValues[TM.LLAESlitDoor.IsClosed],Converter={StaticResource boolToColor2}}"  Canvas.Left="180" Canvas.Top="160" Stroke="Silver" StrokeThickness="2" />
-                        <Button Width="140" Height="25" Content="LLA Outer Door Open"                                               Canvas.Left="210" Canvas.Top="160" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="TM.LLAESlitDoor.Open" IsEnabled="{Binding RtDataValues[TM.LLAESlitDoor.IsClosed]}" />
+                        <Button Width="140" Height="25" Content="LLA Outer Door Open"                                               Canvas.Left="210" Canvas.Top="160" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="TM.LLAESlitDoor.Open" IsEnabled="{Binding RtDataValues[TM.LLAESlitDoor.IsClosed],TargetNullValue=false}" />
 
                         <Ellipse Width="22" Height="22" Fill="{Binding RtDataValues[TM.LLAESlitDoor.IsClosed],Converter={StaticResource boolToColor}}"  Canvas.Left="380" Canvas.Top="160" Stroke="Silver" StrokeThickness="2" />
                         <Button Width="140" Height="25" Content="LLA Outer Door Closed"                                               Canvas.Left="410" Canvas.Top="160" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="TM.LLAESlitDoor.Close" IsEnabled="{Binding RtDataValues[TM.LLAESlitDoor.IsClosed],Converter={StaticResource BoolToBool}}" />
 
                         <Ellipse Width="22" Height="22" Fill="{Binding RtDataValues[TM.LLBTSlitDoor.IsClosed],Converter={StaticResource boolToColor2}}"  Canvas.Left="180" Canvas.Top="190" Stroke="Silver" StrokeThickness="2" />
-                        <Button Width="140" Height="25" Content="LLB Inner Door Open"                                               Canvas.Left="210" Canvas.Top="190" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="TM.LLBTSlitDoor.Open" IsEnabled="{Binding RtDataValues[TM.LLBTSlitDoor.IsClosed]}" />
+                        <Button Width="140" Height="25" Content="LLB Inner Door Open"                                               Canvas.Left="210" Canvas.Top="190" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="TM.LLBTSlitDoor.Open" IsEnabled="{Binding RtDataValues[TM.LLBTSlitDoor.IsClosed],TargetNullValue=false}" />
 
                         <Ellipse Width="22" Height="22" Fill="{Binding RtDataValues[TM.LLBTSlitDoor.IsClosed],Converter={StaticResource boolToColor}}"  Canvas.Left="380" Canvas.Top="190" Stroke="Silver" StrokeThickness="2" />
                         <Button Width="140" Height="25" Content="LLB Inner Door Closed"                                               Canvas.Left="410" Canvas.Top="190" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="TM.LLBTSlitDoor.Close" IsEnabled="{Binding RtDataValues[TM.LLBTSlitDoor.IsClosed],Converter={StaticResource BoolToBool}}" />
 
                         <Ellipse Width="22" Height="22" Fill="{Binding RtDataValues[TM.LLBESlitDoor.IsClosed],Converter={StaticResource boolToColor2}}"  Canvas.Left="180" Canvas.Top="220" Stroke="Silver" StrokeThickness="2" />
-                        <Button Width="140" Height="25" Content="LLB Outer Door Open"                                               Canvas.Left="210" Canvas.Top="220" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="TM.LLBESlitDoor.Open" IsEnabled="{Binding RtDataValues[TM.LLBESlitDoor.IsClosed]}" />
+                        <Button Width="140" Height="25" Content="LLB Outer Door Open"                                               Canvas.Left="210" Canvas.Top="220" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="TM.LLBESlitDoor.Open" IsEnabled="{Binding RtDataValues[TM.LLBESlitDoor.IsClosed],TargetNullValue=false}" />
 
                         <Ellipse Width="22" Height="22" Fill="{Binding RtDataValues[TM.LLBESlitDoor.IsClosed],Converter={StaticResource boolToColor}}"  Canvas.Left="380" Canvas.Top="220" Stroke="Silver" StrokeThickness="2" />
                         <Button Width="140" Height="25" Content="LLB Outer Door Closed"                                               Canvas.Left="410" Canvas.Top="220" Style="{StaticResource SysBtnStyle}"  Command="{Binding DoorUpDownCommand}" CommandParameter="TM.LLBESlitDoor.Close" IsEnabled="{Binding RtDataValues[TM.LLBESlitDoor.IsClosed],Converter={StaticResource BoolToBool}}" />

File diff suppressed because it is too large
+ 1 - 1
Venus/Venus_MainPages/Views/TopView.xaml


File diff suppressed because it is too large
+ 5 - 5
Venus/Venus_MainPages/Views/VenusSeOperationOverView.xaml


+ 0 - 2
Venus/Venus_RT/Devices/IODevices/IoMagnet.cs

@@ -200,12 +200,10 @@ namespace Venus_RT.Devices.IODevices
         }
         public void Reset()
         {
-            _toleranceChecker.Reset(21);
         }
 
         public void Terminate()
         {
-            //throw new NotImplementedException();
         }
     }
 }

+ 5 - 3
Venus/Venus_RT/Devices/JetVenusDEPM.cs

@@ -904,9 +904,9 @@ namespace Venus_RT.Devices
         public override bool GeneratorBiasSetpower(float val)
         {
             if (_GeneratorBias == null) return false;
-
-            if (Math.Abs(val) > 0.01)
-                _GeneratorBias.SetPower((ushort)val);
+            
+            _GeneratorBias.SetPower((ushort)val);               
+  
             return true;
         }
 
@@ -979,6 +979,8 @@ namespace Venus_RT.Devices
             _MainPump?.ReConnect();
             _TurboPump?.ReConnect();
             _pendulumValve?.ReConnect();
+            _GeneratorBias.Reset();
+            _GeneratorBias.ReConnect();
         }
 
         public override void OnOffChiller(ChillerType chillerType, bool onoff)

+ 167 - 135
Venus/Venus_RT/Devices/TruPlasmaRF.cs

@@ -7,6 +7,7 @@ using Aitex.Core.RT.SCCore;
 using Aitex.Core.RT.Tolerance;
 using Aitex.Core.UI.Control;
 using Aitex.Core.Util;
+using CommunityToolkit.HighPerformance.Buffers;
 using MECF.Framework.Common.Communications;
 using MECF.Framework.Common.DataCenter;
 using MECF.Framework.Common.Device.Bases;
@@ -16,7 +17,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
-using System.Net;
+using System.ServiceModel.Channels;
 using Venus_Core;
 
 namespace Venus_RT.Devices
@@ -24,17 +25,12 @@ namespace Venus_RT.Devices
     public class TruPlasmaRF : RfPowerBase
     {
         private readonly AsyncSerialPort _serial;
-        private static byte _ACK = 0x06;
-        private static byte ParamRead = 0x01;
-        private static byte ParamWrite = 0x02;
-        private static byte TelegramError = 0xFE;
-        private static byte MessageRead = 0x04;
-        private static byte CtllnterfaceAct= 0x05;
-       // private  bool  = 0x05;
+        private List<byte> buffer = new List<byte>(4096);
         public TruPlasmaRF(ModuleName mod, VenusDevice device) : base(mod.ToString(), device.ToString())
         {
+            this.Status = GeneratorStatus.Unknown;
             var portNum = SC.GetStringValue(device == VenusDevice.Rf ? $"{mod}.Rf.Port" : $"{mod}.BiasRf.Port");
-            _serial = new AsyncSerialPort(portNum, 9600, 8, System.IO.Ports.Parity.None, System.IO.Ports.StopBits.One, "\r\r");
+            _serial = new AsyncSerialPort(portNum, 9600, 8, System.IO.Ports.Parity.None, System.IO.Ports.StopBits.One,"/r", false);
         }
         public override bool Initialize()
         {
@@ -45,14 +41,15 @@ namespace Venus_RT.Devices
             {
                 _serial.OnBinaryDataChanged += SerialPortDataReceived;
                 _serial.OnErrorHappened += SerialPortErrorOccurred;
+                ResetCommand();
             }
             else
             {
                 LOG.Write(eEvent.ERR_RF, Module, "Tru 射频发生器串口无法打开");
                 return false;
             }
-         
             return true;
+ 
         }
         public new AITRfData DeviceData =>
             new AITRfData
@@ -67,43 +64,117 @@ namespace Venus_RT.Devices
             };
         private void SerialPortDataReceived(byte[] rawMessage)
         {
-
-            LOG.Write(eEvent.INFO_RF, Module, $"RF byte"+rawMessage.ToString());
             try
             {
-                if (rawMessage.Length==1&& rawMessage[1]== 0x06) //ACK 指令
+                buffer.AddRange(rawMessage);
+                while (buffer.Count >= 18) //至少包含帧头(2字节)、长度(1字节)、校验位(1字节);根据设计不同而不同
                 {
+                //2.1 查找数据头
+                if (buffer[0] == 0x06) //传输数据有帧头,用于判断
+                {                  
+                    //得到完整的数据,复制到ReceiveBytes中进行校验
+                    byte[] ReceiveBytes = new byte[13];
+                    byte[] ReadReceiveBytes = new byte[18];
+
+                    buffer.CopyTo(0, ReceiveBytes, 0, 13);
+                    buffer.CopyTo(0, ReadReceiveBytes, 0, 18);
+                        if ((ReceiveBytes[12] == 0x55)&& (ReceiveBytes[1] == 0xAA)) //校验失败,最后一个字节是校验位
+                        {
+                            parsecmd(ReceiveBytes);
+                            buffer.RemoveRange(0, 13);
+                           
+                        }
+                        else if ((ReadReceiveBytes[17] == 0x55) && (ReceiveBytes[1] == 0xAA))
+                        {
+                            parsecmd(ReadReceiveBytes);
+                            buffer.RemoveRange(0, 18);
+                        }
+                        else
+                        {
+                            buffer.Clear();
+                            LOG.Write(eEvent.ERR_RF, Module, $"rf通讯错误");
+                        }
+                    
 
+                    ///执行对数据进行处理操作RunReceiveDataCallback(ReceiveBytes);
                 }
-                else if (rawMessage.Length > 1)
+                else //帧头不正确时,记得清除
                 {
-                    parsecmd(rawMessage);
+                    //buffer.RemoveAt(0);
                 }
             }
+            }
             catch (Exception ex)
             {
+                buffer.Clear();
                 LOG.WriteExeption(ex);
-            }
+            }         
+        }
+        public GeneratorStatus Status { get; set; }
+        private bool GetBitValue(byte value, int bit)
+        {
+            return (value & (byte)Math.Pow(2, bit)) > 0 ? true : false;
+        }
+        public override bool IsPowerOn
+        {
+            get => Status == GeneratorStatus.ON;
+            set { }
         }
         public void parsecmd(byte[] message)
         {
-           switch (message[4]) 
+            try 
             {
-                case 0x01://ParamRead
-                    int DataValue = BitConverter.ToInt32(new byte[] { message[10], message[11], message[12], message[13] }, 0);
-                    ReflectPower = DataValue;
-                    break;
-                case 0x02://ParamWrite
-                    DataValue = BitConverter.ToInt32(new byte[] { message[10] ,message[11], message[12], message[13] }, 0);
-                    ForwardPower = DataValue;                   
-                   break;
-                case 0xFE://TelegramError
-                    LOG.Write(eEvent.ERR_RF, Module, "Telegram structure is not correct");
-                    break;
-                default:
-                    // 默认代码块
-                    break;
+                IsPowerOn = GetBitValue(message[4], 4);              
+                if (GetBitValue(message[4], 4))
+                {
+                    Status = GeneratorStatus.ON;
+                }
+                else
+                {
+                    Status = GeneratorStatus.OFF;
+
+                }
+                switch (message[5])
+                {
+                    case 0x01://ParamRead
+                        if (message.Length == 18 && message[6]==0x14)
+                        {
+                            int DataValue = BitConverter.ToInt32(new byte[] { message[11], message[12], message[13], message[14] }, 0);
+                            ReflectPower = DataValue;
+                        }else if (message.Length == 18 && message[6] == 0x12)
+                        {
+                            int DataValue1 = BitConverter.ToInt32(new byte[] { message[11], message[12], message[13], message[14] }, 0);
+                            ForwardPower = DataValue1;
+                        }
+                        break;
+                    case 0x02://ParamWrite
+                        break;
+                    case 0xFE://TelegramError
+                        LOG.Write(eEvent.ERR_RF, Module, "Telegram structure is not correct");
+                        break;
+                    default:
+                        // 默认代码块
+                        break;
+                }
+
+                switch (message[9])
+                {
+                    case 0x26:
+                        Status = GeneratorStatus.OFF;
+                        IsPowerOn = false;
+                        break;
+                    case 0x24:
+                        LOG.Write(eEvent.ERR_RF, Module, "Telegram structure is not correct");
+                        break;
+                    default:
+                        // 默认代码块
+                        break;
+                }
             }
+            catch (Exception ex) 
+            { }
+
+
         }
 
 
@@ -113,27 +184,61 @@ namespace Venus_RT.Devices
         }
         public override void SetPower(float val)
         {
-            //var power = !_scEnableCalibration.BoolValue ? val : CalibrationData(val, true);
-            ForwardPower=val;
             List<byte> baseBytes = new List<byte>() { 0xAA, 0x02, 0x0B, 0x00, 0x02, 0x06, 0x00, 0x01, 0x00, 0x04 };
             byte[] valueBytes = BitConverter.GetBytes((int)val);
             baseBytes.AddRange(valueBytes);
             baseBytes = CRC16(baseBytes.ToArray());
-            baseBytes.Add(0x55);
+            baseBytes.Add(0x55);           
             _serial.Write(baseBytes.ToArray());
         }
-
-        public override bool SetPowerOnOff(bool on, out string str)
+        public override void Monitor()
+        {
+            readpi();
+            readpr();
+        }
+        public void getcontrol()
         {
+            byte[] getincontrol = new byte[] { 0xAA, 0x02, 0x06, 0x00, 0x05, 0x01, 0x00, 0x00, 0xFF, 0x34, 0x8A, 0x55 };
+            _serial.Write(getincontrol.ToArray());
+        }
+        public void releasecontrol()
+        {
+            byte[] getincontrol = new byte[] { 0xAA, 0x02, 0x06, 0x00, 0x05, 0x02, 0x00, 0x00, 0xFF, 0xE8, 0x11, 0x55 };
+            _serial.Write(getincontrol.ToArray());
+        }
+        public void readpr()//reflect
+        {
+            byte[] getincontrol = new byte[] { 0xAA, 0x02, 0x06, 0x00, 0x01, 0x14, 0x00, 0x01, 0xFF, 0xE1, 0x97, 0x55 };
+            _serial.Write(getincontrol.ToArray());
+        }
+        public void readpi()//forward
+        {
+            byte[] getincontrola = new byte[] { 0xAA, 0x02, 0x06, 0x00, 0x01, 0x12, 0x00, 0x01, 0xFF, 0x78, 0xB0, 0x55 };
+            _serial.Write(getincontrola.ToArray());
+        }
+        public void ResetCommand()
+        {
+            LOG.Write(eEvent.ERR_RF, Module, $"Send rest");
+            byte[] getincontrol = new byte[] { 0xAA, 0x02, 0x0B, 0x00, 0x02, 0x4D, 0x00, 0x01, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x30, 0x72, 0x55 };
+            _serial.Write(getincontrol.ToArray());
+        }
+        public override void Reset()
+        {
+            byte[] getincontrol = new byte[] { 0xAA, 0x02, 0x0B, 0x00, 0x02, 0x4D, 0x00, 0x01, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x30, 0x72, 0x55 };
+            _serial.Write(getincontrol.ToArray());
+        }
+        public override bool SetPowerOnOff(bool on, out string str)
+        {           
             str = "";
             var _chamber = DEVICE.GetDevice<JetPMBase>(Module);
             if (on && !_chamber.CheckGeneratorAndHVInterlock(VenusDevice.Rf))
             {
                 return false;
             }
+            getcontrol();
             List<byte> baseBytes = new List<byte>() { 0xAA, 0x02, 0x0B, 0x00, 0x02, 0x6F, 0x00, 0x01, 0x00, 0x07 };
             if (on == true)
-            {
+            {          
                 baseBytes.AddRange(new List<byte> { 0x01, 0x00, 0x00, 0x00 });
             }
             else
@@ -143,6 +248,10 @@ namespace Venus_RT.Devices
             baseBytes = CRC16(baseBytes.ToArray());
             baseBytes.Add(0x55);
             _serial.Write(baseBytes.ToArray());
+            if (on == false)
+            {
+                releasecontrol();
+            }
             return true;
         }
         public override void SetPulseMode(bool on)
@@ -264,14 +373,6 @@ namespace Venus_RT.Devices
         private const ushort S3_HEAD_LENGTH = 2;
         private readonly DeviceTimer _timerQueryStatus = new DeviceTimer();
         private int QUERY_INTERVAL = 1000;
-        //private int                      _scMatchPresetMode;
-        //private int                      _scMatchMode;
-        //private readonly SCConfigItem    _scMatchPositionC1;
-        //private readonly SCConfigItem    _scMatchPositionC2;
-        //private readonly bool            _scEnableC1C2Position;
-
-        // --------------------------Properties------------------------
-        //
         [Subscription("MatchWorkMode")]
         public EnumRfMatchTuneMode WorkMode { get; set; }
         public float C1 { get; set; }
@@ -298,28 +399,8 @@ namespace Venus_RT.Devices
         public TruPlasmaMatch(ModuleName mod, VenusDevice device) : base(mod.ToString(), device.ToString())
         {
             var portNum = SC.GetStringValue($"{mod}.{device}.Port");
-
-            _serial = new AsyncSerialPort(portNum, 9600, 8);
-
-            //_scMatchPresetMode    = SC.GetValue<int>($"{Module}.Rf.PresetMode");
-            //_scMatchMode          = SC.GetValue<int>($"{Module}.Rf.MatchMode");
-            //_scMatchPositionC1    = SC.GetConfigItem($"{Module}.Rf.MatchPositionC1");
-            //_scMatchPositionC2    = SC.GetConfigItem($"{Module}.Rf.MatchPositionC2");
-            //_scEnableC1C2Position = SC.GetValue<bool>($"{Module}.Rf.EnableC1C2Position");
-            SerachCommandList = new List<string>()
-            {
-            AdTecMatchMessage.READ_POS,
-            AdTecMatchMessage.START_QUERY
-            };
+           _serial = new AsyncSerialPort(portNum, 9600, 8, System.IO.Ports.Parity.None, System.IO.Ports.StopBits.One, "/r", false);
             intervalTime = 100;
-            sendDataChangedEvent += TruMatch_sendDataChangedEvent;
-            baseStopwatch.Start();
-            baseTimer.Enabled = true;
-        }
-
-        private void TruMatch_sendDataChangedEvent(string obj)
-        {
-            this.SendCmd(obj);
         }
 
         ~TruPlasmaMatch()
@@ -379,38 +460,21 @@ namespace Venus_RT.Devices
                 SetMatchMode((string)param[0] == "Auto" ? EnumRfMatchTuneMode.Auto : EnumRfMatchTuneMode.Manual, out reason);
                 return true;
             });
-
-            _timerQueryStatus.Start(QUERY_INTERVAL);
-            this.SendCmd(AdTecMatchMessage.START_QUERY);
-
-            //LOG.Write(eEvent.ERR_RF, Module, "Initialize done.");
             return true;
         }
 
         public override void Monitor()
         {
-            //try
-            //{
-            //    if (_timerQueryStatus.IsTimeout())
-            //    {
-            //        this.SendCmd(AdTecMatchMessage.READ_POS);
-            //        _timerQueryStatus.Start(QUERY_INTERVAL);
-            //    }
-            //}
-            //catch (Exception ex)
-            //{
-            //    LOG.WriteExeption(ex);
-            //}
+
+
         }
 
         public override void Terminate()
         {
-            this.SendCmd(AdTecMatchMessage.STOP_QUERY);
         }
 
         public override void Reset()
         {
-            //SendCmd(AdTecMatchMessage.STOP_QUERY);
         }
 
         /// <summary>
@@ -421,25 +485,11 @@ namespace Venus_RT.Devices
         /// 
         private void executeMatchPostion(float c1, float c2)
         {
-            //SetWorkMode(EnumRfMatchTuneMode.Manual);
-            ////await Task.Delay(200);
 
             SetPosition(c1, c2);
-            //await Task.Delay(200);
-
-            //SetPresetMemory(0);
-            //await Task.Delay(200);
-            // SetWorkMode(EnumRfMatchTuneMode.Auto);
         }
         public override void SetMatchPosition(float c1, float c2, out string reason)
         {
-            float DataValue = BitConverter.ToSingle(new byte[] { 0x9A, 0x99, 0x19,0x3F }, 0);
-            byte[] floatAsBytes = BitConverter.GetBytes(DataValue);
-            float DataValue1= BitConverter.ToSingle(new byte[] { floatAsBytes[0], floatAsBytes[1], floatAsBytes[2], floatAsBytes[3] }, 0);
-            //LOG.Write(eEvent.WARN_RF, Module, $"AdTec Match error [{c1}, {c2}]");
-
-            base.SetMatchPosition(c1, c2, out reason);
-
             executeMatchPostion(c1, c2);
 
             reason = "";
@@ -453,17 +503,17 @@ namespace Venus_RT.Devices
         //
         private void SerialBinaryPortDataReceived(byte[] message)
         {
-            if(message.Count()==0)
+            if (message.Count()<10)
             {
                 LOG.Write(eEvent.ERR_RF, Module, "收到 Match 数据为空");
                        return;
             }
             else 
             {
-                if (message[0] ==0x1D && message[6]==0x60 && message[7] == 0x00)
+                if (message[0] ==0x1D && message[8]==0x60)
                 {
-                    this.TunePosition1 = BitConverter.ToSingle(new byte[] { message[10], message[11], message[12], message[13] }, 0) * 10;
-                    this.TunePosition2 = BitConverter.ToSingle(new byte[] { message[14], message[15], message[16], message[17] }, 0) * 10;
+                    TunePosition1 = BitConverter.ToSingle(new byte[] { message[10], message[11], message[12], message[13] }, 0) * 100;
+                    TunePosition2 = BitConverter.ToSingle(new byte[] { message[14], message[15], message[16], message[17] }, 0) * 100;
                     switch (message[7])
                     {
                         case 0x01:
@@ -477,37 +527,25 @@ namespace Venus_RT.Devices
                             break;                           
                         default:
                             break;
-                    }
-                       
-                    
+                    }                                       
                 }
-            }
-                
-            }
-
-        
+            }               
+        }
 
         private void SerialPortErrorOccurred(string str)
         {
             LOG.Write(eEvent.ERR_RF, Module, $"AdTec Match error [{str}]");
         }
 
-        private void SendCmd(string str)
-        {
-            _serial?.Write(str + "\r");
-            //EV.PostInfoLog(Module.ToString(), $"Match send [{str}]");
-        }
-
         private void SetPosition(float c1val, float c2val)
         {
-
             List<byte> Len = new List<byte>() { 0x16, 0xE9};
-            List<byte> DstSrc = new List<byte>() { 0x00, 0x0A, 0x00, 0x00};
+            List<byte> DstSrc = new List<byte>() { 0x00, 0x02, 0x00, 0x01};
             List<byte> Cmd = new List<byte> { 0x60, 0x40 };
             byte[] val1Bytes = BitConverter.GetBytes(c1val / 100);
             byte[] val2Bytes = BitConverter.GetBytes(c2val / 100);
-            List<byte> Act = new List<byte>() { 0x64 };
-            List<byte> Ctr123 = new List<byte> { 0x08, 0x01, 0x80 };            
+            List<byte> Act = new List<byte>() { 0x00 };
+            List<byte> Ctr123 = new List<byte> { 0x08, 0x00, 0x00 };
             List<byte> baseBytes = new List<byte>() { };
             baseBytes.AddRange(Len);
             baseBytes.AddRange(DstSrc);
@@ -516,37 +554,31 @@ namespace Venus_RT.Devices
             baseBytes.AddRange(val2Bytes);
             baseBytes.AddRange(Act);
             baseBytes.AddRange(Ctr123);
-            byte ack=0x00;
+            int a = 0;
             for (int i=2; i< baseBytes.Count;i++)
             {
-                ack += baseBytes[i];
+                a+=(Int16)baseBytes[i];
             }
-            baseBytes.Add(ack);
-            //SetPointCommandQueue.Add(cmd);
+            byte []ackture= new byte[2];
+            
+            byte[]ackbyte= BitConverter.GetBytes(a);
+            ackture[0] = ackbyte[1];
+            ackture[1] = ackbyte[0];
+            baseBytes.AddRange(ackture);
             _serial.Write(baseBytes.ToArray());
         }
-
         public override bool SetMatchMode(EnumRfMatchTuneMode enumRfMatchTuneMode, out string reason)
         {
             reason = string.Empty;
-            SetWorkMode(enumRfMatchTuneMode);
-
             return true;
         }
 
         private void SetWorkMode(EnumRfMatchTuneMode mode)
         {
-            //string data = mode == EnumRfMatchTuneMode.Auto ? AdTecMatchMessage.AUTO :
-            //    mode == EnumRfMatchTuneMode.Manual ? AdTecMatchMessage.MANUAL : "";
-            //this.SendCmd(mode == EnumRfMatchTuneMode.Auto ? AdTecMatchMessage.AUTO :
-            //    mode == EnumRfMatchTuneMode.Manual ? AdTecMatchMessage.MANUAL : "");
-            //SetPointCommandQueue.Add(data);
         }
 
         private void SetPresetMemory(byte gear)
         {
-            //this.SendCmd(AdTecMatchMessage.PRESET_MEM + gear.ToString());
-            //SetPointCommandQueue.Add(AdTecMatchMessage.PRESET_MEM + gear.ToString());
         }
     }
 }

+ 44 - 51
Venus/Venus_Themes/UserControls/ChamberDE.xaml

@@ -163,16 +163,13 @@
                         </Style.Triggers>
                     </Style>
                 </Grid.Style>
-                <Rectangle x:Name="BG_Status_Copy15"  Cursor="Hand" RenderTransformOrigin="-0.375,0.425" Margin="128,0,48,-2">
-                    <Rectangle.Style>
-                        <Style>
-                            <Setter Property="Shape.Fill" Value="WhiteSmoke"/>
-                        </Style>
-                    </Rectangle.Style>
-                </Rectangle>
             </Grid>
             <Grid Grid.RowSpan="2" Height="167" VerticalAlignment="Bottom" Margin="17,0,40,2" Grid.Column="2">
-                <Rectangle Height="12" Stroke="Gray" VerticalAlignment="Top" Width="150" Margin="0,98,0,0">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="73*"/>
+                    <ColumnDefinition Width="88*"/>
+                </Grid.ColumnDefinitions>
+                <Rectangle Height="12" Stroke="Gray" VerticalAlignment="Top" Width="150" Margin="5,98,5,0" Grid.ColumnSpan="2">
                     <Rectangle.Fill>
                         <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                             <GradientStop Color="#FFABABAB" Offset="0"/>
@@ -180,7 +177,7 @@
                         </LinearGradientBrush>
                     </Rectangle.Fill>
                 </Rectangle>
-                <Rectangle Height="12" Margin="0,109,0,0" Stroke="Gray" VerticalAlignment="Top" Width="160">
+                <Rectangle Height="12" Margin="0,109,0,0" Stroke="Gray" VerticalAlignment="Top" Width="160" Grid.ColumnSpan="2">
                     <Rectangle.Fill>
                         <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                             <GradientStop Color="#FFABABAB" Offset="0"/>
@@ -190,7 +187,7 @@
                 </Rectangle>
 
                 <!--4寸 guide pin-->
-                <Grid x:Name="Bottom_LiftPin" Height="75" VerticalAlignment="Bottom" Margin="0,0,0,0" >
+                <Grid x:Name="Bottom_LiftPin" Height="75" VerticalAlignment="Bottom" Margin="0,0,0,0" Grid.ColumnSpan="2" >
                     <Grid.Resources>
                         <Storyboard x:Key="BottomPinUp">
                             <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" >
@@ -225,7 +222,7 @@
                 </Grid>
 
                 <!--3寸 guide pin-->
-                <Grid x:Name="Middle_LiftPin" Width="120" Height="63" VerticalAlignment="Bottom" Margin="0,0,0,12" >
+                <Grid x:Name="Middle_LiftPin" Width="120" Height="63" VerticalAlignment="Bottom" Margin="20,0,20,12" Grid.ColumnSpan="2" >
                     <Grid.Resources>
                         <Storyboard x:Key="MidPinUp">
                             <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" >
@@ -262,7 +259,7 @@
                 </Grid>
 
                 <!--lift pin-->
-                <Grid x:Name="Top_LiftPin" Height="51" VerticalAlignment="Bottom" Margin="0,0,0,28" >
+                <Grid x:Name="Top_LiftPin" Height="51" VerticalAlignment="Bottom" Margin="0,0,0,28" Grid.ColumnSpan="2" >
                     <Grid.Resources>
                         <Storyboard x:Key="TopPinUp">
                             <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" >
@@ -320,7 +317,7 @@
                 </Canvas>-->
 
                 <!--左边slit door-->
-                <Grid x:Name="Slit_valve" Margin="-41,-9,191,26.5" >
+                <Grid x:Name="Slit_valve" Margin="-41,-9,104,27" >
                     <Grid.RowDefinitions>
                         <RowDefinition/>
                         <RowDefinition Height="74.75"/>
@@ -334,7 +331,7 @@
                     <Rectangle x:Name="SlitValve_Top"  Style="{StaticResource SlitValve_Animation}" Fill="{StaticResource doorColor}" VerticalAlignment="Top" Height="78" Margin="1,3,1,0" Grid.RowSpan="2"   />
                     <Rectangle x:Name="SlitValve_Bottom" Style="{StaticResource SlitValve_Animation}" Width="8" Fill="{StaticResource doorColor}" VerticalAlignment="Bottom" Height="70" Margin="1,70,1,0" Grid.RowSpan="2" />
                 </Grid>
-                <Grid x:Name="liner_valve" Margin="-8,-8,10,26" >
+                <Grid x:Name="liner_valve" Margin="-8,-8,10,26" Grid.ColumnSpan="2" >
                     <Grid.RowDefinitions>
                         <RowDefinition Height="36*"/>
                         <RowDefinition Height="75*"/>
@@ -349,7 +346,7 @@
                     <Rectangle x:Name="linerValve_Bottom"  Style="{StaticResource SlitValve_Animation2}" Fill="{StaticResource doorColor}" VerticalAlignment="Top" Panel.ZIndex="3" Height="44" Margin="-16,34,168,0" Grid.RowSpan="2" />
                 </Grid>
                 <!--slit door右边-->
-                <Grid Margin="190,-10,-40,29" Cursor="Hand">
+                <Grid Margin="118,-10,-40,29" Cursor="Hand" Grid.Column="1">
 
                     <Rectangle  Fill="{StaticResource doorColor}"  Width="8" VerticalAlignment="Top" Height="68" Margin="1,7,1,0" />
 
@@ -412,28 +409,19 @@
                 </TransformGroup>
             </Rectangle.RenderTransform>
         </Rectangle>
-        <Path Data="M0,0 L 50,100 100,0z" Stroke="#FF747474" Stretch="Fill" Height="22" Canvas.Top="62.125" Width="16" Canvas.Left="100.448" HorizontalAlignment="Center" VerticalAlignment="Top" Fill="WhiteSmoke"/>
+        <Path Data="M0,0 L 50,100 100,0z" Stroke="#FF747474" Stretch="Fill" Height="22" Canvas.Top="62.167" Width="16" Canvas.Left="103" HorizontalAlignment="Center" VerticalAlignment="Top" Fill="WhiteSmoke"/>
         <Path Data="M0,0 L 100,0 100,100 90,100 90,10 0,10z" Stroke="Black" Stretch="Fill" Height="36" Canvas.Top="114" Width="31" HorizontalAlignment="Left" VerticalAlignment="Center" Fill="black"/>
         <Path Data="M0,0 L 80,0 80,10 10,10 10,210 -30,210 -30,200 0,200" Stroke="Black" Fill="black" Canvas.Left="199.75" Canvas.Top="118.375" Height="100" Stretch="Fill" Width="39" HorizontalAlignment="Center" VerticalAlignment="Center"/>
         <Rectangle x:Name="BG_Status_Copy1" Visibility="{Binding BiasRfPowerOnChamberVisibility}" Cursor="Hand" Height="14" Canvas.Left="202" Canvas.Top="54" Width="6" HorizontalAlignment="Center" VerticalAlignment="Top" RenderTransformOrigin="0.583,0.361">
-            <Rectangle.ContextMenu >
-                <ContextMenu>
-                    <MenuItem Header="Create Wafer"  Click="CreateWafer_Click"     IsChecked="{Binding IsHasWafer}" IsEnabled="{Binding IsHasWafer, Converter={StaticResource BoolToBool}}"/>
-                    <MenuItem Header="Delete Wafer"  Click="DeleteWafer_Click"     IsChecked="{Binding IsHasWafer, Converter={StaticResource BoolToBool}}" IsEnabled="{Binding IsHasWafer}"/>
-                </ContextMenu>
-            </Rectangle.ContextMenu>
             <Rectangle.Style>
                 <Style>
                     <Setter Property="Shape.Fill" Value="WhiteSmoke"/>
                     <Style.Triggers>
-                        <DataTrigger Binding="{Binding IsBRFOn, ElementName=chamber}"  Value="True">
-                            <Setter Property="Shape.Fill" Value="#FFFF9292"/>
-                        </DataTrigger>
                     </Style.Triggers>
                 </Style>
             </Rectangle.Style>
         </Rectangle>
-        <Rectangle x:Name="BG_Status_Copy2" Visibility="{Binding BiasRfPowerOnChamberVisibility}" Cursor="Hand" Height="100" Canvas.Left="155" Canvas.Top="16" Width="6" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
+        <Rectangle x:Name="BG_Status_Copy2"  Cursor="Hand" Height="100" Canvas.Left="155" Canvas.Top="16" Width="6" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
             <Rectangle.RenderTransform>
                 <TransformGroup>
                     <ScaleTransform/>
@@ -442,32 +430,16 @@
                     <TranslateTransform/>
                 </TransformGroup>
             </Rectangle.RenderTransform>
-            <Rectangle.ContextMenu >
-                <ContextMenu>
-                    <MenuItem Header="Create Wafer"  Click="CreateWafer_Click"     IsChecked="{Binding IsHasWafer}" IsEnabled="{Binding IsHasWafer, Converter={StaticResource BoolToBool}}"/>
-                    <MenuItem Header="Delete Wafer"  Click="DeleteWafer_Click"     IsChecked="{Binding IsHasWafer, Converter={StaticResource BoolToBool}}" IsEnabled="{Binding IsHasWafer}"/>
-                </ContextMenu>
-            </Rectangle.ContextMenu>
             <Rectangle.Style>
                 <Style>
                     <Setter Property="Shape.Fill" Value="WhiteSmoke"/>
-                    <Style.Triggers>
-                        <DataTrigger Binding="{Binding IsBRFOn, ElementName=chamber}"  Value="True">
-                            <Setter Property="Shape.Fill" Value="#FFFF9292"/>
-                        </DataTrigger>
-                    </Style.Triggers>
                 </Style>
             </Rectangle.Style>
         </Rectangle>
-        <Rectangle x:Name="BG_Status_Copy14" Visibility="{Binding BiasRfPowerOnChamberVisibility}" Cursor="Hand" Height="53" Canvas.Left="10" Canvas.Top="46" Width="21" HorizontalAlignment="Center" VerticalAlignment="Center">
+        <Rectangle x:Name="BG_Status_Copy14"   Cursor="Hand" Height="53" Canvas.Left="10" Canvas.Top="46" Width="21" HorizontalAlignment="Center" VerticalAlignment="Center">
             <Rectangle.Style>
                 <Style>
                     <Setter Property="Shape.Fill" Value="#D2B48C "/>
-                    <Style.Triggers>
-                        <DataTrigger Binding="{Binding IsBRFOn, ElementName=chamber}"  Value="True">
-                            <Setter Property="Shape.Fill" Value="#FFFF9292"/>
-                        </DataTrigger>
-                    </Style.Triggers>
                 </Style>
             </Rectangle.Style>
         </Rectangle>
@@ -546,56 +518,77 @@
                 </Style>
             </Rectangle.Style>
         </Rectangle>
-        <Rectangle x:Name="BG_Status_Copy9"  Cursor="Hand" Height="16" Canvas.Left="112" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
+        <Rectangle x:Name="BG_Status_Copy9"  Cursor="Hand" Height="16" Canvas.Left="112" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Center" VerticalAlignment="Center">
+            <Rectangle.Style>
+                <Style>
+                    <Setter Property="Shape.Fill" Value="WhiteSmoke"/>
+                </Style>
+            </Rectangle.Style>
+        </Rectangle>
+        <Rectangle x:Name="BG_Status_Copy8"  Cursor="Hand" Height="16" Canvas.Left="103" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
+            <Rectangle.Style>
+                <Style>
+                    <Setter Property="Shape.Fill" Value="WhiteSmoke"/>
+                </Style>
+            </Rectangle.Style>
+        </Rectangle>
+        <Rectangle x:Name="BG_Status_Copy7"  Cursor="Hand" Height="16" Canvas.Left="94" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
+            <Rectangle.Style>
+                <Style>
+                    <Setter Property="Shape.Fill" Value="WhiteSmoke"/>
+                </Style>
+            </Rectangle.Style>
+        </Rectangle>
+        <Rectangle x:Name="BG_Status_Copy3"  Cursor="Hand" Height="16" Canvas.Left="85" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
             <Rectangle.Style>
                 <Style>
                     <Setter Property="Shape.Fill" Value="WhiteSmoke"/>
                 </Style>
             </Rectangle.Style>
         </Rectangle>
-        <Rectangle x:Name="BG_Status_Copy8"  Cursor="Hand" Height="16" Canvas.Left="101" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
+        <Rectangle x:Name="BG_Status_Copy5"  Cursor="Hand" Height="16" Canvas.Left="76" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
             <Rectangle.Style>
                 <Style>
                     <Setter Property="Shape.Fill" Value="WhiteSmoke"/>
                 </Style>
             </Rectangle.Style>
         </Rectangle>
-        <Rectangle x:Name="BG_Status_Copy7"  Cursor="Hand" Height="16" Canvas.Left="92" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
+        <Rectangle x:Name="BG_Status_Copy6"  Cursor="Hand" Height="16" Canvas.Left="67" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
             <Rectangle.Style>
                 <Style>
                     <Setter Property="Shape.Fill" Value="WhiteSmoke"/>
                 </Style>
             </Rectangle.Style>
         </Rectangle>
-        <Rectangle x:Name="BG_Status_Copy3"  Cursor="Hand" Height="16" Canvas.Left="83" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
+        <Rectangle x:Name="BG_Status_Copy18"  Cursor="Hand" Height="16" Canvas.Left="58" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
             <Rectangle.Style>
                 <Style>
                     <Setter Property="Shape.Fill" Value="WhiteSmoke"/>
                 </Style>
             </Rectangle.Style>
         </Rectangle>
-        <Rectangle x:Name="BG_Status_Copy5"  Cursor="Hand" Height="16" Canvas.Left="74" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
+        <Rectangle x:Name="BG_Status_Copy19"  Cursor="Hand" Height="16" Canvas.Left="49" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
             <Rectangle.Style>
                 <Style>
                     <Setter Property="Shape.Fill" Value="WhiteSmoke"/>
                 </Style>
             </Rectangle.Style>
         </Rectangle>
-        <Rectangle x:Name="BG_Status_Copy6"  Cursor="Hand" Height="16" Canvas.Left="65" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
+        <Rectangle x:Name="BG_Status_Copy17复制__C_"  Cursor="Hand" Height="16" Canvas.Left="175" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
             <Rectangle.Style>
                 <Style>
                     <Setter Property="Shape.Fill" Value="WhiteSmoke"/>
                 </Style>
             </Rectangle.Style>
         </Rectangle>
-        <Rectangle x:Name="BG_Status_Copy18"  Cursor="Hand" Height="16" Canvas.Left="56" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
+        <Rectangle x:Name="BG_Status_Copy17复制__C_1"  Cursor="Hand" Height="16" Canvas.Left="184" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
             <Rectangle.Style>
                 <Style>
                     <Setter Property="Shape.Fill" Value="WhiteSmoke"/>
                 </Style>
             </Rectangle.Style>
         </Rectangle>
-        <Rectangle x:Name="BG_Status_Copy19"  Cursor="Hand" Height="16" Canvas.Left="47" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
+        <Rectangle x:Name="BG_Status_Copy17复制__C_1复制__C_"  Cursor="Hand" Height="16" Canvas.Left="193" Canvas.Top="83" Width="4" RenderTransformOrigin="-0.375,0.425" HorizontalAlignment="Left" VerticalAlignment="Center">
             <Rectangle.Style>
                 <Style>
                     <Setter Property="Shape.Fill" Value="WhiteSmoke"/>