Sfoglia il codice sorgente

Modify SrdRecipeView, PrewetHomePage; Modify galil Home step; Add Prewet simulator;

niuyx 2 mesi fa
parent
commit
662974038d

+ 4 - 4
CyberX8_MainPages/Views/SrdRecipeView.xaml

@@ -82,11 +82,11 @@
                                     </Grid.ColumnDefinitions>
                                     <UserControls:GroupTextBoxControl Grid.Row="0" Title="Rinse Speed" Unit="rpm" MinValue="0" MaxValue="300" IntValue="{Binding Recipe.RinseSpeed,Mode=TwoWay}" ValidResult="{Binding PropertyValidResultDic[RinseSpeed],Mode=TwoWay}" Width="290"/>
                                     <UserControls:GroupTextBoxControl Grid.Row="1" Title="Rinse Time" Unit="sec" MinValue="0" MaxValue="60" IntValue="{Binding Recipe.RinseTime,Mode=TwoWay}" ValidResult="{Binding PropertyValidResultDic[RinseTime],Mode=TwoWay}" Width="290"/>
-                                    <UserControls:GroupTextBoxControl Grid.Row="0" Grid.Column="1" Title="Max Water Pressure" Unit="psi" MinValue="0" MaxValue="100" IntValue="{Binding Recipe.MaxWaterPressure,Mode=TwoWay}" ValidResult="{Binding PropertyValidResultDic[MaxWaterPressure],Mode=TwoWay}" Width="290"/>
+                                    <UserControls:GroupTextBoxControl Grid.Row="0" Grid.Column="1" Title="Max Water Pressure" Unit="psi" MinValue="0" MaxValue="50" IntValue="{Binding Recipe.MaxWaterPressure,Mode=TwoWay}" ValidResult="{Binding PropertyValidResultDic[MaxWaterPressure],Mode=TwoWay}" Width="290"/>
                                     <UserControls:GroupTextBoxControl Grid.Row="2" Title="Flow Check Delay" Unit="sec" MinValue="0" MaxValue="60" IntValue="{Binding Recipe.FlowCheckDelay,Mode=TwoWay}" ValidResult="{Binding PropertyValidResultDic[FlowCheckDelay],Mode=TwoWay}" Width="290"/>
-                                    <UserControls:GroupTextBoxControl Grid.Row="1" Grid.Column="1" Title="Min Water Pressure" Unit="psi" MinValue="0" MaxValue="100" IntValue="{Binding Recipe.MinWaterPressure,Mode=TwoWay}" ValidResult="{Binding PropertyValidResultDic[MinWaterPressure],Mode=TwoWay}" Width="290" />
-                                    <UserControls:GroupTextBoxControl Grid.Row="2" Grid.Column="1" Title="Max SRD Water Flow" Unit="L/min" MinValue="0" MaxValue="100" IntValue="{Binding Recipe.MaxSRDWaterFlow,Mode=TwoWay}" ValidResult="{Binding PropertyValidResultDic[MaxSRDWaterFlow],Mode=TwoWay}" Width="290" />
-                                    <UserControls:GroupTextBoxControl Grid.Row="3" Grid.Column="1" Title="Min SRD Water Flow" Unit="L/min" MinValue="0" MaxValue="100" IntValue="{Binding Recipe.MinSRDWaterFlow,Mode=TwoWay}" ValidResult="{Binding PropertyValidResultDic[MinSRDWaterFlow],Mode=TwoWay}" Width="290" />
+                                    <UserControls:GroupTextBoxControl Grid.Row="1" Grid.Column="1" Title="Min Water Pressure" Unit="psi" MinValue="0" MaxValue="50" IntValue="{Binding Recipe.MinWaterPressure,Mode=TwoWay}" ValidResult="{Binding PropertyValidResultDic[MinWaterPressure],Mode=TwoWay}" Width="290" />
+                                    <UserControls:GroupTextBoxControlDouble Grid.Row="2" Grid.Column="1" Title="Max SRD Water Flow" Unit="L/min" MinValue="0" MaxValue="2.5" DoubleValue="{Binding Recipe.MaxSRDWaterFlow,Mode=TwoWay}" ValidResult="{Binding PropertyValidResultDic[MaxSRDWaterFlow],Mode=TwoWay}" Width="290" />
+                                    <UserControls:GroupTextBoxControlDouble Grid.Row="3" Grid.Column="1" Title="Min SRD Water Flow" Unit="L/min" MinValue="0" MaxValue="2.5" DoubleValue="{Binding Recipe.MinSRDWaterFlow,Mode=TwoWay}" ValidResult="{Binding PropertyValidResultDic[MinSRDWaterFlow],Mode=TwoWay}" Width="290" />
                                 </Grid>
                             </GroupBox>
                         </Grid>

+ 3 - 3
CyberX8_RT/Config/Devices/ModuleIOCfg.xml

@@ -254,12 +254,12 @@
 	<IO Name="Dryer2.BlowerHigh" IOName="c_HVD_2_HIGH"/>
 	</Module>
 	<Module Name="Prewet1">
-	<IO Name="Prewet1.PumpValve" IOName="c_SPW1_LEV_PUMP_VALVE"/>
+	<IO Name="Prewet1.PumpValve" IOName="c_PREWET_DI_FILL"/>
 	<IO Name="Prewet1.PumpCurrent" IOName="r_SPW1_LEV_PUMP_CURRENT"/>
 	<IO Name="Prewet1.PumpEnable" IOName="c_SPW1_LEV_PUMP_ENB"/>
 	<IO Name="Prewet1.PumpStatus" IOName="r_SPW1_LEV_PUMP_STATUS"/>
-	<IO Name="Prewet1.PumpFlow" IOName="r_SPW1_LEV_PUMP_FLOW"/>
-	<IO Name="Prewet1.PumpPressure" IOName="r_SPW1_LEV_PUMP_PRES"/>
+	<IO Name="Prewet1.PumpFlow" IOName="r_PREWET_FLOW"/>
+	<IO Name="Prewet1.PumpPressure" IOName="r_PREWET_DI_PRESS"/>
 	<IO Name="Prewet1.PumpSpeed" IOName="c_SPW1_LEV_PUMP_SPEED"/>
 	</Module>
 	<Module Name="Safety">

+ 2 - 0
CyberX8_RT/Devices/AXIS/Galil/GalilHomeRoutine.cs

@@ -26,6 +26,7 @@ namespace CyberX8_RT.Devices.AXIS.Galil
             CheckHomingEnd,
             DPDelay,
             DP,
+            WaitDP,
             End
         }
 
@@ -66,6 +67,7 @@ namespace CyberX8_RT.Devices.AXIS.Galil
                     return _axis.MotionData.StopCode == HOME_STOP_CODE&&!_axis.IsRun; },CheckErrorOrWarning,_timeout)
                 .Delay(HomeStep.DPDelay,1000)
                 .Run(HomeStep.DP, () => { return _axis.WriteDP(_homingOffset); }, _delay_1ms)
+                .Delay(HomeStep.WaitDP, 1000)
                 .End(HomeStep.End,NullFun,100);
             return Runner.Status;
         }

+ 2 - 0
CyberX8_RT/Devices/AXIS/GalilLipsel/GalilLipselHomeRoutine.cs

@@ -30,6 +30,7 @@ namespace CyberX8_RT.Devices.AXIS.GalilLipsel
             CheckForwardMotion,
             DPDelay,
             DP,
+            WaitDP,
             End
         }
 
@@ -84,6 +85,7 @@ namespace CyberX8_RT.Devices.AXIS.GalilLipsel
                 .WaitWithStopCondition(HomeStep.CheckForwardMotion, CheckRightMotionEnd, CheckErrorOrWarning, _timeout)
                 .Delay(HomeStep.DPDelay, 1000)
                 .Run(HomeStep.DP, () => { return _axis.WriteDP(_homingOffset); }, _delay_1ms)
+                .Delay(HomeStep.WaitDP, 1000)
                 .End(HomeStep.End,NullFun,100);
             return Runner.Status;
         }

+ 2 - 0
CyberX8_RT/Devices/AXIS/GalilRotation/GalilRotationHomeRoutine.cs

@@ -26,6 +26,7 @@ namespace CyberX8_RT.Devices.AXIS.Galil
             CheckHomingEnd,
             DPDelay,
             DP,
+            WaitDP,
             End
         }
 
@@ -66,6 +67,7 @@ namespace CyberX8_RT.Devices.AXIS.Galil
                     return _axis.MotionData.StopCode == HOME_STOP_CODE&&!_axis.IsRun; },CheckErrorOrWarning,_timeout)
                 .Delay(HomeStep.DPDelay,1000)
                 .Run(HomeStep.DP, () => { return _axis.WriteDP(_homingOffset); }, _delay_1ms)
+                .Delay(HomeStep.WaitDP, 1000)
                 .End(HomeStep.End,NullFun,100);
             return Runner.Status;
         }

+ 5 - 3
CyberX8_RT/Devices/AXIS/JetAxisBase.cs

@@ -614,12 +614,12 @@ namespace CyberX8_RT.Devices.AXIS
         {
             switch (variable)
             {
+                case ACTUAL_VELOCITY:
                 case PROFILE_VELOCITY:
                 case PROFILE_ACCEL:
                 case PROFILE_DECEL:
                 case MOTOR_POSITION:
-                case POSITION_ERROR:
-                case ACTUAL_VELOCITY:
+                case POSITION_ERROR:                
                 case TARGET_POSITION:
                 case HOMING_ACCEL:
                 case HOMING_VELOCITY:
@@ -873,7 +873,7 @@ namespace CyberX8_RT.Devices.AXIS
             }
             if(variable == ACTUAL_VELOCITY)
             {
-                MotionData.ActualVelocity = (int)value;
+                MotionData.ActualVelocity = Math.Round((int)value / _scaleFactor, 2);
             }
         }
 
@@ -1126,6 +1126,7 @@ namespace CyberX8_RT.Devices.AXIS
         /// <returns></returns>
         public bool WriteAbsolutePosition(int absolutePosition)
         {
+            MotionData.TargetPosition= absolutePosition / _scaleFactor;
             return GalilControllerCfgManager.Instance.SetAxisCommand(Module, Name, "PA", absolutePosition);
         }
         /// <summary>
@@ -1201,6 +1202,7 @@ namespace CyberX8_RT.Devices.AXIS
         /// <returns></returns>
         public bool WriteDP(int dp)
         {
+            MotionData.TargetPosition = 0;
             bool result= GalilControllerCfgManager.Instance.SetAxisCommand(Module, Name, "DP", dp);
             if (result)
             {

+ 1 - 2
CyberX8_RT/Modules/SRD/SRDEntity.cs

@@ -672,8 +672,7 @@ namespace CyberX8_RT.Modules.SRD
             RState ret = _processRecipeRoutine.Monitor();
             if (ret == RState.Failed || ret == RState.Timeout)
             {
-                //PostMsg(SRDMSG.ProcessError);
-                PostMsg(SRDMSG.Error);
+                PostMsg(SRDMSG.ProcessError);
                 //记录LotTrack
                 _runRecipeCompleteTime = DateTime.Now;
                 _processRecipeRoutine.SRDLotTrackHeaderDatas.ProcessTime = (_runRecipeCompleteTime - _runRecipeStartTime).TotalSeconds.ToString("F2");

+ 1 - 1
CyberX8_Simulator/Config/SimulatorIOMapCfg.xml

@@ -21,6 +21,6 @@
 	<SimulatorIOMapItem SourceIOName="c_QDRD3_DUMP" TargetIONameA="r_QDRD3_WATER_LEVEL"/>
 	<SimulatorIOMapItem SourceIOName="c_QDRD4_DI_FILL" TargetIONameA="r_QDRD4_WATER_LEVEL"/>
 	<SimulatorIOMapItem SourceIOName="c_QDRD4_DUMP" TargetIONameA="r_QDRD4_WATER_LEVEL"/>
-	<SimulatorIOMapItem SourceIOName="c_QDRD4_DUMP" TargetIONameA="r_QDRD4_WATER_LEVEL"/>
 	<SimulatorIOMapItem SourceIOName="c_METAL4_PUMP_ON" TargetIONameA="r_PUMP4_FLOW"/>
+	<SimulatorIOMapItem SourceIOName="c_PREWET_DI_FILL" TargetIONameA="r_PREWET_DI_PRESS"/>	
 </SimulatorIOMapConfig>

+ 6 - 0
CyberX8_Simulator/Devices/WagoSocketSimulator.cs

@@ -125,6 +125,10 @@ namespace CyberX8_Simulator.Devices
                     case "r_LOADERB_WS_BLADDER_PRESSURE":
                         AIShorts[AINameIndexDic[name]] = value ? (short)0x2AF8 : (short)0x00;
                         break;
+                    case "r_PREWET_DI_PRESS":
+                        AIShorts[AINameIndexDic[name]] = value ? (short)15000 : (short)3276;
+                        AIShorts[AINameIndexDic["r_PREWET_FLOW"]] = value ? (short)25000 : (short)3276;
+                        break;
                     default:
                         break;
                 }
@@ -297,6 +301,8 @@ namespace CyberX8_Simulator.Devices
                 value = _doNameWagoDODic["c_METAL4_PUMP_ON"].Invert ? !value : value;
                 UpdataDIBytes("r_METAL4_PUMP_ON", value ? 1 : 0);
             }
+
+            
         }
         /// <summary>
         /// 初始化字典

+ 7 - 0
CyberX8_Themes/CyberX8_Themes.csproj

@@ -243,6 +243,9 @@
     <Compile Include="UserControls\GroupTextBoxControl.xaml.cs">
       <DependentUpon>GroupTextBoxControl.xaml</DependentUpon>
     </Compile>
+    <Compile Include="UserControls\GroupTextBoxControlDouble.xaml.cs">
+      <DependentUpon>GroupTextBoxControlDouble.xaml</DependentUpon>
+    </Compile>
     <Compile Include="UserControls\LinMotOtherControl.xaml.cs">
       <DependentUpon>LinMotOtherControl.xaml</DependentUpon>
     </Compile>
@@ -759,6 +762,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="UserControls\GroupTextBoxControlDouble.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="UserControls\LinMotOtherControl.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>

+ 22 - 0
CyberX8_Themes/UserControls/GroupTextBoxControlDouble.xaml

@@ -0,0 +1,22 @@
+<UserControl x:Class="CyberX8_Themes.UserControls.GroupTextBoxControlDouble"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:CyberX8_Themes.UserControls"
+             xmlns:Control="clr-namespace:MECF.Framework.UI.Core.Control;assembly=MECF.Framework.UI.Core"  
+             mc:Ignorable="d" Name="self"
+             d:DesignHeight="70" Width="486">
+    <Grid>
+        <GroupBox Grid.Row="3" Header="{Binding ElementName=self,Path=Title}" IsEnabled="{Binding Enable}">
+            <Grid>
+                <Rectangle x:Name="RectangleSetPoint" Fill="Transparent" Stroke="Transparent" StrokeThickness="1" HorizontalAlignment="Left" 
+                       VerticalAlignment="Top" Width="435" Height="36" Margin="10,0,0,0"/>
+                <Control:DoubleTextBox Name="txtValue" Value="{Binding ElementName=self,Path=DoubleValue,Mode=TwoWay}" Height="30" VerticalAlignment="Top"  Margin="18,3,55,0"/>
+                <Label Content="{Binding ElementName=self,Path=Unit}" HorizontalAlignment="Right" VerticalAlignment="Top" Height="30" Width="55" Margin="0,3,0,0"></Label>
+                <Label Content="{Binding ElementName=self,Path=MinValue}" HorizontalAlignment="Left" Width="40" Margin="17,31,0,-9"/>
+                <Label Content="{Binding ElementName=self,Path=MaxValue}" HorizontalAlignment="Right" Width="40" Margin="0,31,30,-9"/>
+            </Grid>
+        </GroupBox>
+    </Grid>
+</UserControl>

+ 158 - 0
CyberX8_Themes/UserControls/GroupTextBoxControlDouble.xaml.cs

@@ -0,0 +1,158 @@
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+
+namespace CyberX8_Themes.UserControls
+{
+    /// <summary>
+    /// GroupTextBoxControlDouble.xaml 的交互逻辑
+    /// </summary>
+    public partial class GroupTextBoxControlDouble : UserControl
+    {
+        #region 属性
+        public static readonly DependencyProperty TitleProperty = DependencyProperty.Register("Title", typeof(string), typeof(GroupTextBoxControlDouble),
+          new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
+        /// <summary>
+        /// 标题
+        /// </summary>
+        public string Title
+        {
+            get
+            {
+                return (string)this.GetValue(TitleProperty);
+            }
+            set
+            {
+                this.SetValue(TitleProperty, value);
+            }
+        }
+        public static readonly DependencyProperty UnitProperty = DependencyProperty.Register("Unit", typeof(string), typeof(GroupTextBoxControlDouble),
+         new FrameworkPropertyMetadata("deg", FrameworkPropertyMetadataOptions.AffectsRender));
+        /// <summary>
+        /// 单位
+        /// </summary>
+        public string Unit
+        {
+            get
+            {
+                return (string)this.GetValue(UnitProperty);
+            }
+            set
+            {
+                this.SetValue(UnitProperty, value);
+            }
+        }
+        public static readonly DependencyProperty DoubleValueProperty = DependencyProperty.Register("DoubleValue", typeof(double), typeof(GroupTextBoxControlDouble),
+        new PropertyMetadata(-1.0, new PropertyChangedCallback(DoubleValueChanged)));
+        /// <summary>
+        /// 数值
+        /// </summary>
+        public double DoubleValue
+        {
+            get
+            {
+                return (double)this.GetValue(DoubleValueProperty);
+            }
+            set
+            {
+                this.SetValue(DoubleValueProperty, value);
+            }
+        }
+
+        public static readonly DependencyProperty MinValueProperty = DependencyProperty.Register("MinValue", typeof(double), typeof(GroupTextBoxControlDouble),
+        new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
+        /// <summary>
+        /// 最小数值
+        /// </summary>
+        public double MinValue
+        {
+            get
+            {
+                return (double)this.GetValue(MinValueProperty);
+            }
+            set
+            {
+                this.SetValue(MinValueProperty, value);
+            }
+        }
+        public static readonly DependencyProperty MaxValueProperty = DependencyProperty.Register("MaxValue", typeof(double), typeof(GroupTextBoxControlDouble),
+        new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
+        /// <summary>
+        /// 最大数值
+        /// </summary>
+        public double MaxValue
+        {
+            get
+            {
+                return (double)this.GetValue(MaxValueProperty);
+            }
+            set
+            {
+                this.SetValue(MaxValueProperty, value);
+            }
+        }
+        public static readonly DependencyProperty EnableProperty = DependencyProperty.Register("Enable", typeof(bool), typeof(GroupTextBoxControlDouble),
+        new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.AffectsRender));
+        /// <summary>
+        /// 可用性
+        /// </summary>
+        public bool Enable
+        {
+            get
+            {
+                return (bool)this.GetValue(EnableProperty);
+            }
+            set
+            {
+                this.SetValue(EnableProperty, value);
+            }
+        }
+
+        public static readonly DependencyProperty ValidResultProperty = DependencyProperty.Register("ValidResult", typeof(bool), typeof(GroupTextBoxControlDouble),
+     new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.AffectsRender));
+        /// <summary>
+        /// 合理性
+        /// </summary>
+        public bool ValidResult
+        {
+            get
+            {
+                return (bool)this.GetValue(ValidResultProperty);
+            }
+            set
+            {
+                this.SetValue(ValidResultProperty, value);
+            }
+        }
+        /// <summary>
+        /// 数值发生变化事件
+        /// </summary>
+        /// <param name="d"></param>
+        /// <param name="e"></param>
+        private static void DoubleValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            if (e.NewValue != null)
+            {
+                double newValue = (double)e.NewValue;
+                double minValue = (double)d.GetValue(MinValueProperty);
+                double maxValue = (double)d.GetValue(MaxValueProperty);
+                bool validResult = newValue >= minValue && newValue <= maxValue;
+                d.SetValue(ValidResultProperty, validResult);
+            }
+        }
+        #endregion
+        public GroupTextBoxControlDouble()
+        {
+            InitializeComponent();
+        }
+
+        protected override void OnRender(DrawingContext drawingContext)
+        {
+            base.OnRender(drawingContext);
+
+            ValidResult = DoubleValue >= MinValue && DoubleValue <= MaxValue;
+            RectangleSetPoint.Fill = ValidResult ? new SolidColorBrush(Colors.Transparent) : new SolidColorBrush(Colors.Yellow);
+            txtValue.Background = ValidResult ? new SolidColorBrush(Colors.Transparent) : new SolidColorBrush(Colors.Yellow);
+        }
+    }
+}

+ 21 - 21
CyberX8_Themes/UserControls/PrewetLeftSideControl.xaml

@@ -100,7 +100,7 @@
         <Grid Grid.Row="4" Grid.Column="3" Grid.ColumnSpan="2">
             <Button Style="{StaticResource SysBtnStyle}" Margin="0,0,10,0" Grid.Column="1" Height="25" Width="60" HorizontalAlignment="Center" Content="Close" Click="Close_Click"></Button>
         </Grid>
-        <Grid Grid.Row="5" Grid.Column="0">
+        <!--<Grid Grid.Row="5" Grid.Column="0">
             <Label Content="Pump Speed" FontSize="16" FontWeight="Bold" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
         </Grid>
         <Grid Grid.Row="5" Grid.Column="1">
@@ -156,25 +156,25 @@
         </Border>
         <Border Grid.Row="9" Grid.Column="3"  Margin="5,5,5,5" Background="Black">
             <TextBlock  Text="mA" Foreground="Lime" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Left"/>
-        </Border>
-        <Grid Grid.Row="10" Grid.Column="0" >
+        </Border>-->
+        <Grid Grid.Row="5" Grid.Column="0" >
             <Label Content="Pump Flow" FontSize="16" FontWeight="Bold" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
         </Grid>
-        <TextBlock Grid.Row="10" Grid.Column="2"  VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" Width="60" Background="LightGray" Foreground="White" 
+        <TextBlock Grid.Row="5" Grid.Column="2"  VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" Width="60" Background="LightGray" Foreground="White" 
                    Text="{Binding ElementName=self,Path=PumpData.PumpFlowData.MinError}"></TextBlock>
-        <TextBlock Grid.Row="10" Grid.Column="3"  VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" Width="60" Background="LightGray" Foreground="White" 
+        <TextBlock Grid.Row="5" Grid.Column="3"  VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" Width="60" Background="LightGray" Foreground="White" 
                    Text="{Binding ElementName=self,Path=PumpData.PumpFlowData.MinWarning}"></TextBlock>
         <!--<TextBlock Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" Width="60" Background="Black" Foreground="Lime" Text="{Binding HouseChilledWaterFlowData.Value}"></TextBlock>-->
-        <UserControls:PressureBlockControl  Grid.Row="10" Grid.Column="4"  VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" Width="60"
+        <UserControls:PressureBlockControl  Grid.Row="5" Grid.Column="4"  VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" Width="60"
                            Value="{Binding ElementName=self,Path=PumpData.PumpFlowData.Value }"
                            IsError="{Binding ElementName=self,Path=PumpData.PumpFlowData.IsError}" 
                            IsWarning="{Binding ElementName=self,Path=PumpData.PumpFlowData.IsWarning}"/>
-        <TextBlock Grid.Row="10" Grid.Column="5"  VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" Width="60" Background="LightGray" Foreground="White" 
+        <TextBlock Grid.Row="5" Grid.Column="5"  VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" Width="60" Background="LightGray" Foreground="White" 
                    Text="{Binding ElementName=self,Path=PumpData.PumpFlowData.MaxError}"></TextBlock>
-        <TextBlock Grid.Row="10" Grid.Column="6" VerticalAlignment="Center"  HorizontalAlignment="Center" FontSize="18" Width="60" Background="LightGray" Foreground="White" 
+        <TextBlock Grid.Row="5" Grid.Column="6" VerticalAlignment="Center"  HorizontalAlignment="Center" FontSize="18" Width="60" Background="LightGray" Foreground="White" 
                    Text="{Binding ElementName=self,Path=PumpData.PumpFlowData.MaxWarning}"></TextBlock>
-        <TextBlock Grid.Row="10" Grid.Column="7" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12" Background="Transparent">L/min</TextBlock>
-        <Grid Grid.Row="11" Grid.Column="0">
+        <TextBlock Grid.Row="5" Grid.Column="7" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12" Background="Transparent">L/min</TextBlock>
+        <!--<Grid Grid.Row="11" Grid.Column="0">
             <Label  Content="Pressure Target" FontSize="16" FontWeight="Bold" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
         </Grid>
         <Border Grid.Row="11" Grid.Column="2"  Margin="5,5,5,5" Background="Black">
@@ -182,28 +182,28 @@
         </Border>
         <Border Grid.Row="11" Grid.Column="3"  Margin="5,5,5,5" Background="Black">
             <TextBlock  Text="Psi" Foreground="Lime" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Left"/>
-        </Border>
-        <Grid Grid.Row="12" Grid.Column="0">
-            <Label Content="Pump Pressure" FontSize="16" FontWeight="Bold" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
+        </Border>-->
+        <Grid Grid.Row="6" Grid.Column="0">
+            <Label Content="Pressure" FontSize="16" FontWeight="Bold" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
         </Grid>
-        <TextBlock Grid.Row="12" Grid.Column="2" VerticalAlignment="Center"  HorizontalAlignment="Center" FontSize="18" Width="60" Background="LightGray" Foreground="White" 
+        <TextBlock Grid.Row="6" Grid.Column="2" VerticalAlignment="Center"  HorizontalAlignment="Center" FontSize="18" Width="60" Background="LightGray" Foreground="White" 
                    Text="{Binding ElementName=self,Path=PumpData.PumpPressureData.MinError}"></TextBlock>
-        <TextBlock Grid.Row="12" Grid.Column="3" VerticalAlignment="Center"  HorizontalAlignment="Center" FontSize="18" Width="60" Background="LightGray" Foreground="White" 
+        <TextBlock Grid.Row="6" Grid.Column="3" VerticalAlignment="Center"  HorizontalAlignment="Center" FontSize="18" Width="60" Background="LightGray" Foreground="White" 
                    Text="{Binding ElementName=self,Path=PumpData.PumpPressureData.MinWarning}"></TextBlock>
         <!--<TextBlock Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" Width="60" Background="Black" Foreground="Lime" Text="{Binding HouseChilledWaterFlowData.Value}"></TextBlock>-->
-        <UserControls:PressureBlockControl  Grid.Row="12" Grid.Column="4"  VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" Width="60"
+        <UserControls:PressureBlockControl  Grid.Row="6" Grid.Column="4"  VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" Width="60"
                       Value="{Binding ElementName=self,Path=PumpData.PumpPressureData.Value}"
                       IsError="{Binding ElementName=self,Path=PumpData.PumpPressureData.IsError}" 
                       IsWarning="{Binding ElementName=self,Path=PumpData.PumpPressureData.IsWarning}"/>
-        <TextBlock Grid.Row="12" Grid.Column="5" VerticalAlignment="Center"  HorizontalAlignment="Center" FontSize="18" Width="60" Background="LightGray" Foreground="White" 
+        <TextBlock Grid.Row="6" Grid.Column="5" VerticalAlignment="Center"  HorizontalAlignment="Center" FontSize="18" Width="60" Background="LightGray" Foreground="White" 
                    Text="{Binding ElementName=self,Path=PumpData.PumpPressureData.MaxWarning}"></TextBlock>
-        <TextBlock Grid.Row="12" Grid.Column="6" VerticalAlignment="Center"  HorizontalAlignment="Center" FontSize="18" Width="60" Background="LightGray" Foreground="White" 
+        <TextBlock Grid.Row="6" Grid.Column="6" VerticalAlignment="Center"  HorizontalAlignment="Center" FontSize="18" Width="60" Background="LightGray" Foreground="White" 
                    Text="{Binding ElementName=self,Path=PumpData.PumpPressureData.MaxError}" ></TextBlock>
-        <TextBlock Grid.Row="12" Grid.Column="7" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12" Background="Transparent">Psi</TextBlock>
-        <Grid Grid.Row="13" Grid.Column="0" Grid.ColumnSpan="5">
+        <TextBlock Grid.Row="6" Grid.Column="7" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12" Background="Transparent">Psi</TextBlock>
+        <Grid Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="5">
             <Button Style="{StaticResource SysBtnStyle}" Grid.Column="1" Height="30" Width="150" VerticalAlignment="Center" HorizontalAlignment="Center" Content="Keep Wet" Click="KeepWet_Click"></Button>
         </Grid>
-        <Grid Grid.Row="13" Grid.Column="3" Grid.ColumnSpan="5">
+        <Grid Grid.Row="7" Grid.Column="3" Grid.ColumnSpan="5">
             <Button Style="{StaticResource SysBtnStyle}" Grid.Column="1" Height="30" Width="150" VerticalAlignment="Center" HorizontalAlignment="Center" Content="Prepare to Transfer" Click="PreparetoTransfer_Click"></Button>
         </Grid>
     </Grid>

+ 5 - 5
CyberX8_Themes/UserControls/PrewetUIControl.xaml

@@ -134,14 +134,14 @@
                                                IsCanEdit="True" ContextMenu="{StaticResource IsPumpValveOpen}"/>
         </Canvas>
         <Label  Height="20" Width="40" FontSize="10"  FontWeight="Bold" Content="DI In" Margin="602,373,158,57"  />
-        <Label  Height="25" Width="90" FontSize="10"  FontWeight="Bold" Content="Booster Pump" Margin="526,402,184,23"  />
-        <Border Width="35" Height="15" CornerRadius="17"  Opacity="0.95" x:Name="border1" Margin="548,393,216,42">
+        <!--<Label  Height="25" Width="90" FontSize="10"  FontWeight="Bold" Content="Booster Pump" Margin="526,402,184,23"  />-->
+        <!--<Border Width="35" Height="15" CornerRadius="17"  Opacity="0.95" x:Name="border1" Margin="548,393,216,42">
             <Path Width="31" Height="10" Fill="Black" Stroke="Black"  Stretch="Fill" Data="M213.333333 507.733333h725.333334v42.666667H204.8l145.066667 145.066667-29.866667 29.866666L128 533.333333 320 341.333333l29.866667 29.866667L213.333333 507.733333z"/>
-        </Border>
-        <Canvas Width="80" Height="80" Margin="526,313,194,57" Panel.ZIndex="2">
+        </Border>-->
+        <!--<Canvas Width="80" Height="80" Margin="526,313,194,57" Panel.ZIndex="2">
             <userControls:Pump1 RotateTransformValue="0" IsOpenPump="{Binding ElementName=self,Path=PumpData.PumpEnable,Mode=TwoWay}" Canvas.Top="10" HorizontalAlignment="Left" VerticalAlignment="Top"
                                 ModuleName="{Binding ElementName=self, Path=ModuleName}"/>
-        </Canvas>
+        </Canvas>-->
         <!--中间动画模块-->
         <Grid Width="400" Height="300"  Panel.ZIndex="2" Margin="91,38,309,12">
             <Canvas x:Name="linmot" >

+ 1 - 1
CyberX8_Themes/UserControls/ProcessControl.xaml.cs

@@ -240,7 +240,7 @@ namespace CyberX8_Themes.UserControls
                         ReserviorControl reserviorControl = new ReserviorControl();
                         reserviorControl.ReserviorName = item;
                         var maxmin = GetReserviorWidth(_reservoirMetals[item]);
-                        reserviorControl.ReserviorInfo = GenerateReserviorInfo(item, maxmin.max - maxmin.min + 2 * RESERVIOR_MARGIN_LEFT);
+                        reserviorControl.ReserviorInfo = GenerateReserviorInfo($"Res{item.Substring(item.Length - 1, 1)}", maxmin.max - maxmin.min + 2 * RESERVIOR_MARGIN_LEFT);
                         Canvas.SetLeft(reserviorControl, maxmin.min - RESERVIOR_MARGIN_LEFT);
                         Canvas.SetTop(reserviorControl, maxmin.minTop);
                         Canvas.SetZIndex(reserviorControl, -1);

+ 1 - 1
CyberX8_Themes/UserControls/SRDLeftInformation.xaml

@@ -86,7 +86,7 @@
                 <TextBlock  Text="{Binding CommonData.WaterFlow, ElementName=self, StringFormat=\{0:F2\}}"  Foreground="Lime" FontSize="16" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
             </Border>
             <Border Grid.Column="1"  Margin="2,5,5,5" Background="Black">
-                <TextBlock   Text="mL/min"  Foreground="Lime" FontSize="16" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Center"/>
+                <TextBlock   Text="L/min"  Foreground="Lime" FontSize="16" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Center"/>
             </Border>
         </Grid>
         <Grid Grid.Column ="3" Grid.Row="4">

+ 2 - 0
Framework/Common/Simulator/MotorSimulator.cs

@@ -136,6 +136,8 @@ namespace MECF.Framework.Common.Simulator
                             _motorNameDataDic[item.Name].PositiveTorqueLimit = item.PositiveTorqueLimit;
                             _motorNameDataDic[item.Name].SwitchSignal = true;
                             _motorNameDataDic[item.Name].ModuleName = config.Module;
+                            _motorNameDataDic[item.Name].ReverseLimit = true;
+                            _motorNameDataDic[item.Name].ForwardLimit = true;
                         }
                     }
                 }

+ 19 - 0
Framework/UICore/Control/DoubleTextBox.xaml

@@ -0,0 +1,19 @@
+<UserControl x:Class="MECF.Framework.UI.Core.Control.DoubleTextBox"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:MECF.Framework.UI.Core.Control"
+             mc:Ignorable="d" x:Name="self"
+             d:DesignHeight="35" d:DesignWidth="200">
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="*"></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*"></ColumnDefinition>
+        </Grid.ColumnDefinitions>
+        <TextBox Name="txtInput" VerticalContentAlignment="Center" Grid.Row="0" Grid.RowSpan="2" Text="{Binding ElementName=self,Path=Value}" 
+             PreviewTextInput="OnPreviewTextInput" InputMethod.IsInputMethodEnabled="False" KeyDown="txtInput_KeyDown"></TextBox>
+    </Grid>
+</UserControl>

+ 103 - 0
Framework/UICore/Control/DoubleTextBox.xaml.cs

@@ -0,0 +1,103 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace MECF.Framework.UI.Core.Control
+{
+    /// <summary>
+    /// DoubleTextBox.xaml 的交互逻辑
+    /// </summary>
+    public partial class DoubleTextBox : UserControl
+    {
+        #region 属性
+        public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
+            "Value", typeof(double), typeof(DoubleTextBox), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
+        /// <summary>
+        /// 数值
+        /// </summary>
+        public double Value
+        {
+            get
+            {
+                return (double)this.GetValue(ValueProperty);
+            }
+            set
+            {
+                this.SetValue(ValueProperty, value);
+            }
+        }
+
+        public static readonly DependencyProperty TextboxNameProperty = DependencyProperty.Register(
+            "TextboxName", typeof(string), typeof(DoubleTextBox), new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
+        /// <summary>
+        /// 名称
+        /// </summary>
+        public string TextboxName
+        {
+            get
+            {
+                return (string)this.GetValue(TextboxNameProperty);
+            }
+            set
+            {
+                this.SetValue(TextboxNameProperty, value);
+            }
+        }
+        public static readonly DependencyProperty KeyOperationProperty = DependencyProperty.Register("KeyOperation", typeof(ICommand), typeof(DoubleTextBox));
+        public ICommand KeyOperation
+        {
+            get
+            {
+                return (ICommand)this.GetValue(KeyOperationProperty);
+            }
+            set
+            {
+                this.SetValue(KeyOperationProperty, value);
+            }
+        }
+        #endregion
+
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        public DoubleTextBox()
+        {
+            InitializeComponent();
+        }
+
+        private void OnPreviewTextInput(object sender, TextCompositionEventArgs e)
+        {
+            e.Handled = !IsTextAllowed(e.Text, ((TextBox)sender).Text);
+        }
+
+        private bool IsTextAllowed(string key, string text)
+        {
+            Regex regex = new Regex(@"[^0-9\.]+$"); //regex that matches disallowed text
+            bool result = !regex.IsMatch(key);
+            return result;
+        }
+
+        private void txtInput_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Enter)
+            {
+                if (KeyOperation != null)
+                {
+                    KeyOperation.Execute(new object[] { TextboxName, txtInput.Text });
+                }
+            }
+        }
+    }
+}

+ 7 - 0
Framework/UICore/UICore.csproj

@@ -166,6 +166,9 @@
     <Compile Include="Control\DoItemEditor.xaml.cs">
       <DependentUpon>DoItemEditor.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Control\DoubleTextBox.xaml.cs">
+      <DependentUpon>DoubleTextBox.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Control\Filter.xaml.cs">
       <DependentUpon>Filter.xaml</DependentUpon>
     </Compile>
@@ -572,6 +575,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Control\DoubleTextBox.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Control\Filter.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>