Przeglądaj źródła

add dm reservoir direplen ui releated

chenzk 1 tydzień temu
rodzic
commit
035003f201

+ 2 - 0
PunkHPX8_MainPages/ViewModels/DMReservoirViewModel.cs

@@ -414,6 +414,8 @@ namespace PunkHPX8_MainPages.ViewModels
                 if (_rtDataValueDic != null)
                 {
                     State = CommonFunction.GetValue<string>(_rtDataValueDic, $"{Module}.FsmState");
+                    //Error时UI腔体变红
+                    IsError = "Error".Equals(State) ? true : false;
                     ReservoirData = CommonFunction.GetValue<ReservoirData>(_rtDataValueDic, $"{Module}.ReservoirData");
                     CommonSafetyData = CommonFunction.GetValue<SafetyData>(_rtDataValueDic, $"Safety.SafetyData");
                     ReservoirsPersistent = CommonFunction.GetValue<ReservoirsPersistentValue>(_rtDataValueDic, $"{Module}.{PERSISTENT_VALUE}");

+ 15 - 12
PunkHPX8_MainPages/Views/DMReservoirView.xaml

@@ -108,7 +108,7 @@
                     </Grid>
                 </Grid>
             </GroupBox>
-            <GroupBox Header="AN DIW Replen" FontWeight="Bold" FontSize="15" Grid.Row="2" Grid.Column="0" Width="200" Grid.RowSpan="3" Height="320" Margin="0,130,270,0">
+            <GroupBox Header="AN DIW Replen" FontWeight="Bold" FontSize="15" Grid.Row="2" Grid.Column="0" Width="200" Grid.RowSpan="3" Height="320" Margin="0,110,270,0">
                 <Grid>
                     <Grid.RowDefinitions>
                         <RowDefinition Height="35"></RowDefinition>
@@ -154,8 +154,8 @@
                     </Grid>
                 </Grid>
             </GroupBox>
-            <Grid Grid.Row="1" Grid.Column="2" Grid.RowSpan="2" Margin="10 0 0 200">
-                <userControls:RecipeLoad Margin="10,10,0,0" 
+            <Grid Grid.Row="1" Grid.Column="2" Grid.RowSpan="2" Margin="20 0 0 200">
+                <userControls:RecipeLoad Margin="50,10,0,0" 
                   Module="{Binding Module}" 
                   HeadName="Res Recipe"
                   RecipeType="{Binding RecipeType}" IsEnabled="{Binding IsEnabled}"
@@ -169,26 +169,26 @@
                     <RowDefinition Height="50"></RowDefinition>
                 </Grid.RowDefinitions>
                 <Grid Grid.Row="0">
-                    <Label Content="{Binding Module}"  FontSize="35" FontWeight="Bold" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0"></Label>
+                    <Label Content="{Binding Module}"  FontSize="35" FontWeight="Bold" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,-100,0"></Label>
                 </Grid>
                 <Grid Grid.Row="1">
-                    <Button IsEnabled="{Binding IsAutoEnabled}" Style="{StaticResource SysBtnStyle}"  Grid.Column="1" Height="30" Width="100" HorizontalAlignment="Center" Content="Initialize" Command="{Binding InitializeCommand}"></Button>
+                    <Button IsEnabled="{Binding IsAutoEnabled}" Style="{StaticResource SysBtnStyle}"  Grid.Column="1" Height="30" Width="100" HorizontalAlignment="Center" Content="Initialize" Command="{Binding InitializeCommand}" Margin="0,0,-100,0"></Button>
                 </Grid>
                 <Grid Grid.Row="2">
-                    <Label Content="Operating Mode"  FontSize="15" FontWeight="Bold" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Top" HorizontalAlignment="Center"></Label>
+                    <Label Content="Operating Mode"  FontSize="15" FontWeight="Bold" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,0,-100,0"></Label>
                 </Grid>
             </Grid>
-            <userControls:OperatingModeControl HorizontalAlignment="Center" Margin="0,0,0,100" VerticalAlignment="Center"   Grid.Row="1" Grid.Column="3" Grid.RowSpan="2"
+            <userControls:OperatingModeControl HorizontalAlignment="Center" Margin="0,0,-100,100" VerticalAlignment="Center"   Grid.Row="1" Grid.Column="3" Grid.RowSpan="2"
                                    ModuleName="{Binding Module}"
                                    OperationModeValue="{Binding ReservoirsPersistent.OperatingMode}"/>
  
             <Grid Grid.Row="2" Grid.Column="3">
-                <Label Content="Recipe Mode"  FontSize="15" FontWeight="Bold" Margin="0,0,0,90" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center"></Label>
-                <userControls:RecipeModeControl HorizontalAlignment="Center" Margin="0,140,0,0" VerticalAlignment="Top" Width="190"
+                <Label Content="Recipe Mode"  FontSize="15" FontWeight="Bold" Margin="0,0,-100,90" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center"></Label>
+                <userControls:RecipeModeControl HorizontalAlignment="Center" Margin="0,140,-100,0" VerticalAlignment="Top" Width="190"
                                    ModuleName="{Binding Module}"
                                    RecipeModeValue="{Binding ReservoirsPersistent.RecipeOperatingMode}" />
             </Grid>
-            <GroupBox Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2" Grid.RowSpan="3" HorizontalAlignment="Right" Height="200" VerticalAlignment="Center" Margin="0,0,50,180">
+            <GroupBox Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2" Grid.RowSpan="3" HorizontalAlignment="Right" Height="200" VerticalAlignment="Center" Margin="0,0,-50,180">
                 <Grid>
                     <Grid.RowDefinitions>
                         <RowDefinition Height="30"/>
@@ -241,7 +241,7 @@
                     </Grid>
                 </Grid>
             </GroupBox>
-            <GroupBox Header="Status" Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="2" Grid.RowSpan="2" HorizontalAlignment="Right" Height="150" VerticalAlignment="Center" Margin="0,0,50,170">
+            <GroupBox Header="Status" Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="2" Grid.RowSpan="2" HorizontalAlignment="Right" Height="150" VerticalAlignment="Center" Margin="0,0,-50,170">
                 <Grid>
                     <Grid.RowDefinitions>
                         <RowDefinition Height="30"/>
@@ -280,7 +280,7 @@
                     </Border>
                 </Grid>
             </GroupBox>
-            <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Grid.RowSpan="3" Margin="210,-50,0,0">
+            <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Grid.RowSpan="3" Margin="250,-50,0,0">
                 <userControls:DMReservoirUIControl
                     ModuleName="{Binding Module}"
                     ANIsolationValve="{Binding ReservoirData.AnIsolation}"
@@ -301,6 +301,9 @@
                     ReservoirTemperature ="{Binding TemperatureControlData.ReserviorTemperature}"
                     TCStatus ="{Binding TemperatureControlData.Status}"
                     TCEnableStatus ="{Binding TCEnableStatus}"
+                    ANDiReplenValve="{Binding ReservoirData.AnDiReplen}"
+                    CADiReplenValve="{Binding ReservoirData.CaDiReplen}"
+                    IsError="{Binding IsError}"
                     >
                     
                 </userControls:DMReservoirUIControl>

+ 3 - 0
PunkHPX8_RT/Devices/Reservoir/DMReservoirDevice.cs

@@ -100,6 +100,9 @@ namespace PunkHPX8_RT.Devices.Reservoir
             OP.Subscribe($"{Module}.ANIsolationOn", (cmd, para) => { return ANIsolationOn(); });
             OP.Subscribe($"{Module}.ANIsolationOff", (cmd, para) => { return ANIsolationOff(); });
 
+            OP.Subscribe($"{Module}.ANDiReplenOn", ANDiReplenOnOperation);
+            OP.Subscribe($"{Module}.ANDiReplenOff", ANDiReplenOff);
+
             OP.Subscribe($"{Module}.ManualANDiReplen", ManualANDiReplen);
         }
 

+ 4 - 1
PunkHPX8_RT/Devices/Reservoir/ReservoirDevice.cs

@@ -338,7 +338,10 @@ namespace PunkHPX8_RT.Devices.Reservoir
 
             OP.Subscribe($"{Module}.CAIsolationOn", (cmd, para) => { return CAIsolationOn(); });
             OP.Subscribe($"{Module}.CAIsolationOff", (cmd, para) => { return CAIsolationOff(); });
-   
+
+            OP.Subscribe($"{Module}.CADiReplenOn", CADiReplenOnOperation);
+            OP.Subscribe($"{Module}.CADiReplenOff", CADiReplenOff);
+
             OP.Subscribe($"{Module}.SampleOutValveOn", (cmd, para) => { return SampleOutValveOn(); });
             OP.Subscribe($"{Module}.SampleOutValveOff", (cmd, para) => { return SampleOutValveOff(); });
             OP.Subscribe($"{Module}.DegasValveOn", (cmd, para) => { return DegasValveOn(); });

+ 16 - 0
PunkHPX8_Themes/UserControls/DMReservoirUIControl.xaml

@@ -37,6 +37,14 @@
             <MenuItem Header="Open" Click="OpenSampleValve_Click"/>
             <MenuItem Header="Close" Click="CloseSampleValve_Click"/>
         </ContextMenu>
+        <ContextMenu x:Key="ANDiReplenInValve">
+            <MenuItem Header="Open" Click="OpenANDiReplenInValve_Click"/>
+            <MenuItem Header="Close" Click="CloseANDiReplenInValve_Click"/>
+        </ContextMenu>
+        <ContextMenu x:Key="CADiReplenInValve">
+            <MenuItem Header="Open" Click="OpenCADiReplenInValve_Click"/>
+            <MenuItem Header="Close" Click="CloseCADiReplenInValve_Click"/>
+        </ContextMenu>
     </UserControl.Resources>
     <Canvas>
         <Canvas Canvas.Left="171" Canvas.Top="428" HorizontalAlignment="Center" VerticalAlignment="Top" >
@@ -49,6 +57,8 @@
                 BorderThickness="2" Canvas.Left="-83" Canvas.Top="-21" 
         />
         </Canvas>
+        <Rectangle x:Name="ErrorRectangle" Fill="Red" Height="200" Width="200" VerticalAlignment="Center"  Opacity="0.5" Panel.ZIndex="3"
+         Visibility="{Binding ElementName=self,Path=IsError,Converter={StaticResource boolToVisibility2}}" Canvas.Left="99" Canvas.Top="417" HorizontalAlignment="Left"/>
         <Canvas Width="200" Height="120" Canvas.Left="430" Canvas.Top="124">
             <Rectangle Width="200" Height="100" Fill="Yellow" Canvas.Top="0" />
             <!-- 中间橙色矩形 -->
@@ -323,6 +333,12 @@
         <ctrls:FlowPipe IsReverse="True" IsFlowing="{Binding ElementName=self,Path=DegasValve}" Height="8"  Width="50"  Canvas.Left="812"  Canvas.Top="319" RotateTransformValue="0" HorizontalAlignment="Left" VerticalAlignment="Top" Panel.ZIndex="-1"/>
         <ctrls:FlowPipe IsReverse="True" IsFlowing="{Binding ElementName=self,Path=DegasValve}" Height="8"  Width="50"  Canvas.Left="812"  Canvas.Top="380" RotateTransformValue="0" HorizontalAlignment="Left" VerticalAlignment="Top" Panel.ZIndex="-1"/>
 
+        <ctrls:FlowPipe IsFlowing="{Binding ElementName=self,Path=ANDiReplenValve}" Height="8"  Width="120"  Canvas.Left="104"  Canvas.Top="79" RotateTransformValue="0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
+        <ctrls:FlowPipe IsFlowing="{Binding ElementName=self,Path=CADiReplenValve}" Height="8"  Width="80"  Canvas.Left="9"  Canvas.Top="423" RotateTransformValue="0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
+        <customControls:CommonValveControl IsEnabled="{Binding IsEnabled}" Canvas.Left="156"  Canvas.Top="72" Status="{Binding ElementName=self,Path=ANDiReplenValve,Mode=TwoWay}" ContextMenu="{StaticResource ANDiReplenInValve}" ValveOrientation="Horizontal"  Height="20" Width="20"  IsCanEdit="True" HorizontalAlignment="Center" VerticalAlignment="Top"/>
+        <customControls:CommonValveControl IsEnabled="{Binding IsEnabled}" Canvas.Left="43"  Canvas.Top="416" Status="{Binding ElementName=self,Path=CADiReplenValve,Mode=TwoWay}" ContextMenu="{StaticResource CADiReplenInValve}" ValveOrientation="Horizontal"  Height="20" Width="20"  IsCanEdit="True" HorizontalAlignment="Left" VerticalAlignment="Center"/>
+        <Label Canvas.Left="129" Canvas.Top="92"  Height="30" Width="80" FontSize="10"  FontWeight="Bold" Content="AN DI RepleIn" />
+        <Label Canvas.Left="10" Canvas.Top="435"  Height="30" Width="80" FontSize="10"  FontWeight="Bold" Content="CA DI RepleIn" />
 
         <ctrls:Pipe2   Canvas.Left="590"  Canvas.Top="415" HorizontalAlignment="Center" VerticalAlignment="Top" RotateTransformValue="0" RenderTransformOrigin="0.5,0.5" >
             <local:Pipe2.RenderTransform>

+ 73 - 0
PunkHPX8_Themes/UserControls/DMReservoirUIControl.xaml.cs

@@ -350,6 +350,59 @@ namespace PunkHPX8_Themes.UserControls
             }
         }
 
+        public static readonly DependencyProperty ANDiReplenValveProerty = DependencyProperty.Register(
+            "ANDiReplenValve", typeof(bool), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
+        /// <summary>
+        ///ANDiReplenValve
+        /// </summary>
+        public bool ANDiReplenValve
+        {
+            get
+            {
+                return (bool)this.GetValue(ANDiReplenValveProerty);
+            }
+            set
+            {
+                this.SetValue(ANDiReplenValveProerty, value);
+            }
+        }
+
+        public static readonly DependencyProperty CADiReplenValveProerty = DependencyProperty.Register(
+            "CADiReplenValve", typeof(bool), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
+        /// <summary>
+        ///CADiReplenValve
+        /// </summary>
+        public bool CADiReplenValve
+        {
+            get
+            {
+                return (bool)this.GetValue(CADiReplenValveProerty);
+            }
+            set
+            {
+                this.SetValue(CADiReplenValveProerty, value);
+            }
+        }
+        /// <summary>
+        /// 是否处于error状态
+        /// </summary>
+        public static readonly DependencyProperty IsErrorProerty = DependencyProperty.Register(
+            "IsError", typeof(bool), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
+        /// <summary>
+        ///IsError
+        /// </summary>
+        public bool IsError
+        {
+            get
+            {
+                return (bool)this.GetValue(IsErrorProerty);
+            }
+            set
+            {
+                this.SetValue(IsErrorProerty, value);
+            }
+        }
+
         private void OpenANIsolationValve_Click(object sender, RoutedEventArgs e)
         {
             InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ANIsolationOn"); 
@@ -404,6 +457,26 @@ namespace PunkHPX8_Themes.UserControls
         {
             GlobalEvents.OnSwitchFixedTabItem("HardWare", "TemperatureController", "TC1");
         }
+
+        private void OpenANDiReplenInValve_Click(object sender, RoutedEventArgs e)
+        {
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ANDiReplenOn");
+        }
+
+        private void CloseANDiReplenInValve_Click(object sender, RoutedEventArgs e)
+        {
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ANDiReplenOff");
+        }
+
+        private void OpenCADiReplenInValve_Click(object sender, RoutedEventArgs e)
+        {
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.CADiReplenOn");
+        }
+
+        private void CloseCADiReplenInValve_Click(object sender, RoutedEventArgs e)
+        {
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.CADiReplenOff");
+        }
     }