Browse Source

1 add reservoir tc releated
2 add pipe ui
3 add ao data releated

chenzk 1 week ago
parent
commit
0d4a115d4f

+ 20 - 4
PunkHPX8_MainPages/ViewModels/DMReservoirViewModel.cs

@@ -54,6 +54,8 @@ namespace PunkHPX8_MainPages.ViewModels
         private string _tcName;
 
         private ReservoirData _reservoirData;
+        private bool _isCAHighLevel;
+        private bool _isCALowLevel;
 
         private ObservableCollection<RecipeNode> _recipeNodes;
         private string _currentRecipeFileName;
@@ -202,6 +204,16 @@ namespace PunkHPX8_MainPages.ViewModels
             get { return _reservoirData; }
             set { SetProperty(ref _reservoirData, value); }
         }
+        public bool IsCAHighLevel
+        {
+            get { return _isCAHighLevel; }
+            set { SetProperty(ref _isCAHighLevel, value); }
+        }
+        public bool IsCALowLevel
+        {
+            get { return _isCALowLevel; }
+            set { SetProperty(ref _isCALowLevel, value); }
+        }
         #endregion
 
 
@@ -266,7 +278,9 @@ namespace PunkHPX8_MainPages.ViewModels
             _rtDataKeys.Add($"{Module}.FsmState");
             _rtDataKeys.Add($"Safety.SafetyData");
             _rtDataKeys.Add($"{Module}.ReservoirData");
-            //_rtDataKeys.Add($"{Module}.TemperatureControllerData");
+            _rtDataKeys.Add($"{Module}.IsCAHighLevel");
+            _rtDataKeys.Add($"{Module}.IsCALowLevel");
+            _rtDataKeys.Add($"{Module}.TemperatureControllerData");
             if (_timer == null)
             {
                 _timer = new DispatcherTimer();
@@ -305,9 +319,11 @@ namespace PunkHPX8_MainPages.ViewModels
                         IsAutoEnabled = false;
                     }
                     CurrentRecipe = CommonFunction.GetValue<ResRecipe>(_rtDataValueDic, $"{Module}.CurrentRecipe");
-                    //TemperatureControlData = CommonFunction.GetValue<TemperatureControllerData>(_rtDataValueDic, $"{Module}.TemperatureControllerData");
-                    //TCEnableStatus = TemperatureControlData.ControlOperationModel == 0 ? "Disable" : "Enable";
-                    //_tcName = TemperatureControlData.Name;
+                    TemperatureControlData = CommonFunction.GetValue<TemperatureControllerData>(_rtDataValueDic, $"{Module}.TemperatureControllerData");
+                    TCEnableStatus = TemperatureControlData.ControlOperationModel == 0 ? "Disable" : "Enable";
+                    _tcName = TemperatureControlData.Name;
+                    IsCAHighLevel = CommonFunction.GetValue<bool>(_rtDataValueDic, $"{Module}.IsCAHighLevel");
+                    IsCALowLevel = CommonFunction.GetValue<bool>(_rtDataValueDic, $"{Module}.IsCALowLevel");
 
 
                 }

+ 5 - 5
PunkHPX8_MainPages/Views/DMReservoirView.xaml

@@ -290,14 +290,14 @@
                     SampleValve="{Binding ReservoirData.SampleOut}"
                     IsANPumpOpen="{Binding ReservoirData.AnPumpEnable}"
                     IsCAPumpOpen="{Binding ReservoirData.CaPumpEnable}"
-                    IsCALevelHigh="True"
-                    IsCALevelLow="True"
+                    IsCALevelHigh="{Binding IsCAHighLevel}"
+                    IsCALevelLow="{Binding IsCALowLevel}"
                     IsANLevelHigh="{Binding ReservoirData.AnTowerHigh}"
                     IsANLevelLow="{Binding ReservoirData.AnTowerLow}"
-                    ANFlow="0"
-                    CAFlow="0"
+                    ANFlow="{Binding ReservoirData.AnFlow}"
+                    CAFlow="{Binding ReservoirData.CaFlow}"
                     CALevel="{Binding ReservoirData.CaLevel}"
-                    CALevelRaw="{Binding ReservoirData.CaLevel}"
+                    CALevelRaw="{Binding ReservoirData.CaWaterLevel}"
                     ReservoirTemperature ="{Binding TemperatureControlData.ReserviorTemperature}"
                     TCStatus ="{Binding TemperatureControlData.Status}"
                     TCEnableStatus ="{Binding TCEnableStatus}"

+ 4 - 4
PunkHPX8_RT/Config/Devices/Beckhoffcfg - plctask.xml

@@ -110,14 +110,14 @@
 		<!-- facility inputs end -->
 
 
-		<!--Reservoir1 Start-->
+		<!--Reservoir1 outputs Start-->
 		<Input Name="r_RES1_CA_PUMP"  Address="MAIN.RES1_2_DI_8CHANNEL_EL1008_N200_1" Invert="false" Type="Digital" DataType="bool"/>
 		<Input Name="r_RES1_AN_TOWER_HIGH"  Address="MAIN.RES1_2_DI_8CHANNEL_EL1008_N200_3" Invert="false" Type="Digital" DataType="bool"/>
 		<Input Name="r_RES1_AN_TOWER_LOW"  Address="MAIN.RES1_2_DI_8CHANNEL_EL1008_N200_4" Invert="false" Type="Digital" DataType="bool"/>
 		<Input Name="r_CELL1_AN_FLOW"  Address="MAIN.RES1_2_AI_8CHANNEL_4_20MA_EL3058_N202_1" Scaling="0=0,20=32767" Type="Analog" DataType="int"/>
 		<Input Name="r_CELL1_CA_FLOW"  Address="MAIN.RES1_2_AI_8CHANNEL_4_20MA_EL3058_N202_3" Scaling="0=0,20=32767" Type="Analog" DataType="int"/>
 		<Input Name="r_RES1_CA_LEVEL_RAW"  Address="MAIN.RES1_2_AI_8CHANNEL_4_20MA_EL3058_N202_5" Scaling="0=0,100=32767" Type="Analog" DataType="int"/>
-		<!--Reservoir1 End-->
+		<!--Reservoir1 outputs End-->
 
 		
 		<!--VPW Main Start-->
@@ -206,7 +206,7 @@
 		
 		<!-- facility outputs end -->
 		
-		<!--Reservoir1 Start-->
+		<!--Reservoir1 outputs Start-->
 		<Output Name="c_RES1_AN_PUMP_ENABLE" Address="MAIN.RES1_DO_16CHANNEL_EL2809_N201_1" Type="Digital" Invert="false" DataType="bool"/>
 		<Output Name="c_RES1_CA_PUMP_ENABLE" Address="MAIN.RES1_DO_16CHANNEL_EL2809_N201_3" Type="Digital" Invert="false" DataType="bool"/>
 		<Output Name="c_RES1_RETURN_VALVE_ENABLE" Address="MAIN.RES1_DO_16CHANNEL_EL2809_N201_5" Type="Digital" Invert="false" DataType="bool"/>
@@ -219,7 +219,7 @@
 		<Output Name="c_CELL1_CA_ISOLATION" Address="MAIN.RES1_2_PNEU_SMC_EX260_V01_V04" Type="Digital" BitOperated="true" Bit="3" DataType="byte"/>
 		<Output Name="c_RES1_AN_DIW_REPLEN" Address="MAIN.RES1_2_PNEU_SMC_EX260_V01_V04" Type="Digital" BitOperated="true" Bit="4" DataType="byte"/>
 		<Output Name="c_CELL1_AN_ISOLATION" Address="MAIN.RES1_2_PNEU_SMC_EX260_V01_V04" Type="Digital" BitOperated="true" Bit="5" DataType="byte"/>
-		<!--Reservoir1 End-->
+		<!--Reservoir1 outputs End-->
 		
 		<!--VPW Main Start-->
 		<Output Name="c_VPW_CHAMBER_CLOSE" Address="MAIN.MOTION_DO_16CHANNEL_EL2809_N401_15" Type="Digital" Invert="true" DataType="bool"/>

+ 30 - 5
PunkHPX8_RT/Config/Devices/Beckhoffcfg.xml

@@ -84,7 +84,7 @@
 		<Input Name="r_SAMPLE_SYS_2_FLUID_PRESENT" Address="Task 2.Inputs.Facility_DI_16CHANNEL_EL1819_N000_2" Invert="false" Type="Digital" DataType="bool"/>
 		<Input Name="r_CONTAINMENT_FLUID" Address="Task 2.Inputs.Facility_DI_16CHANNEL_EL1819_N000_10" Invert="false" Type="Digital" DataType="bool"/>
 		<Input Name="r_pH3" Address="Task 2.Inputs.Facility_AI_8CHANNEL_4_20mA_EL3058_N005_1" Scaling="0=0, 40=32767" Type="Analog" DataType="int"/>
-		<Input Name="r_DIWRETURN_FLOW" Address="MAIN.Facility_AI_8CHANNEL_4_20mA_EL3058_N006_106" Scaling="0=0, 40=32767" Type="Analog" DataType="int"/>
+		<Input Name="r_DIWRETURN_FLOW" Address="Task 2.Inputs.Facility_AI_8CHANNEL_4_20mA_EL3058_N006_106" Scaling="0=0, 40=32767" Type="Analog" DataType="int"/>
 		<Input Name="r_HCW_FLOW" Address="Task 2.Inputs.Facility_AI_8CHANNEL_4_20mA_EL3058_N005_5" Scaling="0=0, 40=32767" Type="Analog" DataType="int"/>
 		<Input Name="r_SYSTEM_EXHAUST_1" Address="Task 2.Inputs.Facility_AI_8CHANNEL_4_20mA_EL3058_N006_1" Scaling="0=0, 2=32767" Type="Analog" DataType="int"/>
 		<Input Name="r_SYSTEM_EXHAUST_2" Address="Task 2.Inputs.Facility_AI_8CHANNEL_4_20mA_EL3058_N006_2" Scaling="0=0, 2=32767" Type="Analog" DataType="int"/>
@@ -102,6 +102,16 @@
 		<Input Name="r_CLAMSHELL_CYLINDER_PRESSURE" Address="Task 2.Inputs.PlatingCell1_2_AI_8CHANNEL_0_10V_EL3086_N402_3" Scaling="0=0, 100=32767" Type="Analog" DataType="udint"/>
 		<Input Name="r_TILT_CYLINDER_PRESSURE" Address="Task 2.Inputs.PlatingCell1_2_AI_8CHANNEL_0_10V_EL3086_N402_4" Scaling="0=0, 100=32767" Type="Analog" DataType="udint"/>
 		<!-- facility inputs end -->
+		
+		<!--Reservoir1 inputs Start-->
+		<Input Name="r_RES1_CA_PUMP"  Address="Task 2.Inputs.RES1_2_DI_8CHANNEL_EL1008_N200_1" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_RES1_AN_TOWER_HIGH"  Address="Task 2.Inputs.RES1_2_DI_8CHANNEL_EL1008_N200_3" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_RES1_AN_TOWER_LOW"  Address="Task 2.Inputs.RES1_2_DI_8CHANNEL_EL1008_N200_4" Invert="false" Type="Digital" DataType="bool"/>
+		<Input Name="r_CELL1_AN_FLOW"  Address="Task 2.Inputs.RES1_2_AI_8CHANNEL_4_20MA_EL3058_N202_1" Scaling="0=0,20=32767" Type="Analog" DataType="int"/>
+		<Input Name="r_CELL1_CA_FLOW"  Address="Task 2.Inputs.RES1_2_AI_8CHANNEL_4_20MA_EL3058_N202_3" Scaling="0=0,20=32767" Type="Analog" DataType="int"/>
+		<Input Name="r_RES1_CA_LEVEL_RAW"  Address="Task 2.Inputs.RES1_2_AI_8CHANNEL_4_20MA_EL3058_N202_5" Scaling="0=0,100=32767" Type="Analog" DataType="int"/>
+		<!--Reservoir1 inputs End-->
+		
 
 		<!--VPW Main Start-->
 		<Input Name="r_VPW_CHAMBER_CLOSED"  Address="Task 2.Inputs.VPW_DI_16CHANNEL_EL1819_N100_1" Invert="false" Type="Digital" DataType="bool"/>
@@ -182,6 +192,21 @@
 		<Output Name="c_DIW_SRD_ENABLE" Address="Task 2.Outputs.VPW_PNEU_SMC_EX260_BYTE2" Type="Digital" BitOperated="true" Bit="7" DataType="byte"/>
 		<!-- facility outputs end -->
 		
+		<!--Reservoir1 output Start-->
+		<Output Name="c_RES1_AN_PUMP_ENABLE" Address="Task 2.Inputs.RES1_DO_16CHANNEL_EL2809_N201_1" Type="Digital" Invert="false" DataType="bool"/>
+		<Output Name="c_RES1_CA_PUMP_ENABLE" Address="Task 2.Inputs.RES1_DO_16CHANNEL_EL2809_N201_3" Type="Digital" Invert="false" DataType="bool"/>
+		<Output Name="c_RES1_RETURN_VALVE_ENABLE" Address="Task 2.Inputs.RES1_DO_16CHANNEL_EL2809_N201_5" Type="Digital" Invert="false" DataType="bool"/>
+		<Output Name="c_RES1_AN_PUMP_SPEED" Address="Task 2.Inputs.RES1_2_AO_8CHANNEL_0_10V_EL4008_N204_1" Scaling="0=0,100=32767" Type="Analog" DataType="int"/>
+		<Output Name="c_RES1_CA_PUMP_SPEED" Address="Task 2.Inputs.RES1_2_AO_4CHANNEL_4_20mA_EL4024_N205_1" Scaling="0=0,100=32767" Type="Analog" DataType="int"/>
+		<Output Name="c_RES1_RETURN_VALVE_OPENING" Address="Task 2.Inputs.RES1_2_AO_4CHANNEL_4_20mA_EL4024_N205_3" Scaling="0=0,100=32767" Type="Analog" DataType="int"/>
+		<Output Name="c_RES1_CA_DIW_REPLEN" Address="Task 2.Inputs.RES1_2_PNEU_SMC_EX260_V01_V04" Type="Digital" BitOperated="true" Bit="0" DataType="byte"/>
+		<Output Name="c_RES1_SAMPLE_OUT" Address="Task 2.Inputs.RES1_2_PNEU_SMC_EX260_V01_V04" Type="Digital" BitOperated="true" Bit="1" DataType="byte"/>
+		<Output Name="c_RES1_DEGAS_ENABLE" Address="Task 2.Inputs.RES1_2_PNEU_SMC_EX260_V01_V04" Type="Digital" BitOperated="true" Bit="2" DataType="byte"/>
+		<Output Name="c_CELL1_CA_ISOLATION" Address="Task 2.Inputs.RES1_2_PNEU_SMC_EX260_V01_V04" Type="Digital" BitOperated="true" Bit="3" DataType="byte"/>
+		<Output Name="c_RES1_AN_DIW_REPLEN" Address="Task 2.Inputs.RES1_2_PNEU_SMC_EX260_V01_V04" Type="Digital" BitOperated="true" Bit="4" DataType="byte"/>
+		<Output Name="c_CELL1_AN_ISOLATION" Address="Task 2.Inputs.RES1_2_PNEU_SMC_EX260_V01_V04" Type="Digital" BitOperated="true" Bit="5" DataType="byte"/>
+		<!--Reservoir1 output End-->
+		
 		
 		<!--VPW Main Start-->
 		<Output Name="c_VPW_CHAMBER_CLOSE" Address="Task 2.Outputs.MOTION_DO_16CHANNEL_EL2809_N401_15" Type="Digital" Invert="true" DataType="bool"/>
@@ -241,7 +266,7 @@
 			<Input Address="Task 2.Inputs.VPW1RotationPositionError" Type="PositionError" DataType="dint"/>
 			<Input Address="Task 2.Inputs.VPW1RotationActualVelocity" Type="ActualVelocity" DataType="dint"/>
 			<Input Address="Task 2.Inputs.VPW1RotationActualTorque" Type="ActualTorque" DataType="int"/>
-			<!-- Input Address="MAIN.Loader1Rotation_DigitalOutputs" Type="DigitalOutputs" DataType="dint"/ -->
+			<!-- Input Address="Task 2.Inputs.Loader1Rotation_DigitalOutputs" Type="DigitalOutputs" DataType="dint"/ -->
 			<Input Address="0x607D:01" Type="SoftwareLimitMinus" DataType="dint"/>
 			<Input Address="0x607D:02" Type="SoftwareLimitPlus" DataType="dint"/>
 			<Input Address="0x6098:00" Type="HomingMethod" DataType="byte"/>
@@ -264,7 +289,7 @@
 			<Output Address="Task 2.Outputs.VPW1RotationProfileVelocity" Type="ProfileVelocity" DataType="dint"/>
 			<Output Address="Task 2.Outputs.VPW1RotationProfileAccel" Type="ProfileAccel" DataType="dint"/>
 			<Output Address="Task 2.Outputs.VPW1RotationProfileDecel" Type="ProfileDecel" DataType="dint"/>
-			<!-- Output Address="MAIN.Loader1Rotation_DigitalOutputs" Type="DigitalOutputs" DataType="dint"/ -->
+			<!-- Output Address="Task 2.Inputs.Loader1Rotation_DigitalOutputs" Type="DigitalOutputs" DataType="dint"/ -->
 			<Output Address="0x607D:01" Type="SoftwareLimitMinus" DataType="dint"/>
 			<Output Address="0x607D:02" Type="SoftwareLimitPlus" DataType="dint"/>
 			<Output Address="0x607C:00" Type="HomeOffset" DataType="dint"/>
@@ -314,7 +339,7 @@
 			<Input Address="Task 2.Inputs.VPW2RotationPositionError" Type="PositionError" DataType="dint"/>
 			<Input Address="Task 2.Inputs.VPW2RotationActualVelocity" Type="ActualVelocity" DataType="dint"/>
 			<Input Address="Task 2.Inputs.VPW2RotationActualTorque" Type="ActualTorque" DataType="int"/>
-			<!-- Input Address="MAIN.Loader1Rotation_DigitalOutputs" Type="DigitalOutputs" DataType="dint"/ -->
+			<!-- Input Address="Task 2.Inputs.Loader1Rotation_DigitalOutputs" Type="DigitalOutputs" DataType="dint"/ -->
 			<Input Address="0x607D:01" Type="SoftwareLimitMinus" DataType="dint"/>
 			<Input Address="0x607D:02" Type="SoftwareLimitPlus" DataType="dint"/>
 			<Input Address="0x6098:00" Type="HomingMethod" DataType="byte"/>
@@ -337,7 +362,7 @@
 			<Output Address="Task 2.Outputs.VPW2RotationProfileVelocity" Type="ProfileVelocity" DataType="dint"/>
 			<Output Address="Task 2.Outputs.VPW2RotationProfileAccel" Type="ProfileAccel" DataType="dint"/>
 			<Output Address="Task 2.Outputs.VPW2RotationProfileDecel" Type="ProfileDecel" DataType="dint"/>
-			<!-- Output Address="MAIN.Loader1Rotation_DigitalOutputs" Type="DigitalOutputs" DataType="dint"/ -->
+			<!-- Output Address="Task 2.Inputs.Loader1Rotation_DigitalOutputs" Type="DigitalOutputs" DataType="dint"/ -->
 			<Output Address="0x607D:01" Type="SoftwareLimitMinus" DataType="dint"/>
 			<Output Address="0x607D:02" Type="SoftwareLimitPlus" DataType="dint"/>
 			<Output Address="0x607C:00" Type="HomeOffset" DataType="dint"/>

+ 10 - 0
PunkHPX8_RT/Config/Layout/ToolLayoutConfiguration.xml

@@ -155,6 +155,16 @@
 			</Cells>
 		</Item>
 
+		<!-- HEDs -->
+
+		<Item i:type="TempControl">
+			<Installed>true</Installed>
+			<Count>1</Count>
+			<TCID>1</TCID>
+			<SubType>SMC</SubType>
+		</Item>
+
+
 		<Item i:type="Reservoir">
 			<Installed>true</Installed>
 			<ReservoirID>1</ReservoirID>

+ 8 - 0
PunkHPX8_RT/Config/System.sccfg

@@ -345,21 +345,29 @@
 			<config default="5.0" name="CAMainFlowFaultLow" nameView="CAMainFlowFaultLow" description="CA Main Flow Fault Low" max="30" min="0" paramter="" tag="" unit="" type="Double"></config>
 			<config default="10000" name="FlowFaultHoldOffTime" nameView="FlowFaultHoldOffTime" description="CA Flow Fault Hold Off Time" max="50000" min="0" paramter="" tag="" unit="ms" type="Integer"></config>
 			<config default="0,0,1.5022,94.782" name="CALevelCurve" nameView="CALevelCurve" description="Level curve" max="" min="" paramter="" tag="" unit="" type="String" />
+			<config default="95" name="CAHighLevel" nameView="CAHighLevel" description="CA High Level" max="100" min="0" paramter="" tag="" unit="" type="Double" />
+			<config default="10" name="CALowLevel" nameView="CALowLevel" description="CA Low Level" max="100" min="0" paramter="" tag="" unit="" type="Double" />
 		</configs>
 		<configs name="Reservoir2" nameView="Reservoir2">
 			<config default="5.0" name="CAMainFlowFaultLow" nameView="CAMainFlowFaultLow" description="CA Main Flow Fault Low" max="30" min="0" paramter="" tag="" unit="" type="Double"></config>
 			<config default="10000" name="FlowFaultHoldOffTime" nameView="FlowFaultHoldOffTime" description="CA Flow Fault Hold Off Time" max="50000" min="0" paramter="" tag="" unit="ms" type="Integer"></config>
 			<config default="0,0,1.5022,94.782" name="CALevelCurve" nameView="CALevelCurve" description="Level curve" max="" min="" paramter="" tag="" unit="" type="String" />
+			<config default="95" name="CAHighLevel" nameView="CAHighLevel" description="CA High Level" max="100" min="0" paramter="" tag="" unit="" type="Double" />
+			<config default="10" name="CALowLevel" nameView="CALowLevel" description="CA Low Level" max="100" min="0" paramter="" tag="" unit="" type="Double" />
 		</configs>
 		<configs name="Reservoir3" nameView="Reservoir3">
 			<config default="5.0" name="CAMainFlowFaultLow" nameView="CAMainFlowFaultLow" description="CA Main Flow Fault Low" max="30" min="0" paramter="" tag="" unit="" type="Double"></config>
 			<config default="10000" name="FlowFaultHoldOffTime" nameView="FlowFaultHoldOffTime" description="CA Flow Fault Hold Off Time" max="50000" min="0" paramter="" tag="" unit="ms" type="Integer"></config>
 			<config default="0,0,1.5022,94.782" name="CALevelCurve" nameView="CALevelCurve" description="Level curve" max="" min="" paramter="" tag="" unit="" type="String" />
+			<config default="95" name="CAHighLevel" nameView="CAHighLevel" description="CA High Level" max="100" min="0" paramter="" tag="" unit="" type="Double" />
+			<config default="10" name="CALowLevel" nameView="CALowLevel" description="CA Low Level" max="100" min="0" paramter="" tag="" unit="" type="Double" />
 		</configs>
 		<configs name="Reservoir4" nameView="Reservoir4">
 			<config default="5.0" name="CAMainFlowFaultLow" nameView="CAMainFlowFaultLow" description="CA Main Flow Fault Low" max="30" min="0" paramter="" tag="" unit="" type="Double"></config>
 			<config default="10000" name="FlowFaultHoldOffTime" nameView="FlowFaultHoldOffTime" description="CA Flow Fault Hold Off Time" max="50000" min="0" paramter="" tag="" unit="ms" type="Integer"></config>
 			<config default="0,0,1.5022,94.782" name="CALevelCurve" nameView="CALevelCurve" description="Level curve" max="" min="" paramter="" tag="" unit="" type="String" />
+			<config default="95" name="CAHighLevel" nameView="CAHighLevel" description="CA High Level" max="100" min="0" paramter="" tag="" unit="" type="Double" />
+			<config default="10" name="CALowLevel" nameView="CALowLevel" description="CA Low Level" max="100" min="0" paramter="" tag="" unit="" type="Double" />
 		</configs>
 	</configs>
 </root>

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

@@ -240,6 +240,8 @@ namespace PunkHPX8_RT.Devices.Reservoir
             DATA.Subscribe($"{Module}.ReservoirData", () => _reservoirData, SubscriptionAttribute.FLAG.IgnoreSaveDB);
             DATA.Subscribe($"{Module}.PersistentValue", () => _persistentValue, SubscriptionAttribute.FLAG.IgnoreSaveDB);
             DATA.Subscribe($"{Module}.CurrentRecipe", () => _resRecipe, SubscriptionAttribute.FLAG.IgnoreSaveDB);
+            DATA.Subscribe($"{Module}.IsCAHighLevel", () => IsCAHighLevel, SubscriptionAttribute.FLAG.IgnoreSaveDB);
+            DATA.Subscribe($"{Module}.IsCALowLevel", () => IsCALowLevel, SubscriptionAttribute.FLAG.IgnoreSaveDB);
         }
         /// <summary>
         /// 初始化Operation
@@ -292,6 +294,7 @@ namespace PunkHPX8_RT.Devices.Reservoir
             IoSubscribeUpdateVariable(CA_ISOLATION);
             IoSubscribeUpdateVariable(AN_ISOLATION);
             IoSubscribeUpdateVariable(DEGAS_ENABLE);
+            IoSubscribeUpdateVariable(CA_FLOW);
         }
         /// <summary>
         /// 订阅IO变量
@@ -348,7 +351,7 @@ namespace PunkHPX8_RT.Devices.Reservoir
         protected virtual bool OnTimer()
         {
             //CalculateCALevel();
-            //WaterLevelMonitor();
+            WaterLevelMonitor();
             //DireplenMonitor();
             return true;
         }

+ 53 - 0
PunkHPX8_RT/Modules/Reservoir/ReservoirEntity.cs

@@ -1,4 +1,5 @@
 using Aitex.Core.RT.DataCenter;
+using Aitex.Core.RT.Device;
 using Aitex.Core.RT.Fsm;
 using Aitex.Core.RT.Log;
 using Aitex.Core.RT.RecipeCenter;
@@ -11,6 +12,8 @@ using MECF.Framework.Common.ProcessCell;
 using MECF.Framework.Common.RecipeCenter;
 using MECF.Framework.Common.ToolLayout;
 using PunkHPX8_Core;
+using PunkHPX8_RT.Devices.PowerSupplier;
+using PunkHPX8_RT.Devices.Temperature;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -121,7 +124,22 @@ namespace PunkHPX8_RT.Modules.Reservoir
         /// 用量
         /// </summary>
         public ReservoirUsage ReservoirUsage { get { return ReservoirUsageManager.Instance.GetReservoirUsage(Module.ToString()); } }
+        /// <summary>
+        /// 温度控制设备
+        /// </summary>
+        private TemperatureController _temperatureController;
+        /// <summary>
+        /// Reservoir项
+        /// </summary>
+        private ReservoirItem _reservoirItem;
+        /// <summary>
+        /// 电源
+        /// </summary>
+        private CellPowerSupplier _powerSupplier;
         #endregion
+
+
+
         /// <summary>
         /// 构造函数
         /// </summary>
@@ -141,6 +159,7 @@ namespace PunkHPX8_RT.Modules.Reservoir
             InitializeRoutine();
             InitializeDATA();
             InitializeOperation();
+            LoadAllComponents();
             return true;
         }
 
@@ -169,6 +188,32 @@ namespace PunkHPX8_RT.Modules.Reservoir
             return null;
         }
         /// <summary>
+        /// 加载相关组件
+        /// </summary>
+        private void LoadAllComponents()
+        {
+            _reservoirItem = ReservoirItemManager.Instance.GetReservoirItem(Module.ToString());
+            if (_reservoirItem != null)
+            {
+                List<PlatingCellItem> platingCellItems = _reservoirItem.PlatingCells;
+                if (platingCellItems != null && platingCellItems.Count > 0)
+                {
+                    foreach (PlatingCellItem platingCellItem in platingCellItems)
+                    { 
+                    }
+                }
+                if (!string.IsNullOrEmpty(_reservoirItem.CMMSupplyID))
+                {
+                    _powerSupplier = DEVICE.GetDevice<CellPowerSupplier>(_reservoirItem.CMMSupplyID);
+                }
+
+                if (!string.IsNullOrEmpty(_reservoirItem.TCID))
+                {
+                    _temperatureController = DEVICE.GetDevice<TemperatureController>(_reservoirItem.TCID);
+                }
+            }
+        }
+        /// <summary>
         /// 初始化Routine
         /// </summary>
         private void InitializeRoutine()
@@ -181,6 +226,14 @@ namespace PunkHPX8_RT.Modules.Reservoir
         private void InitializeDATA()
         {
             DATA.Subscribe($"{Module}.FsmState", () => ((ReservoirState)fsm.State).ToString(), SubscriptionAttribute.FLAG.IgnoreSaveDB);
+            DATA.Subscribe($"{Module}.TemperatureControllerData", () => _temperatureController == null ? null : _temperatureController.TemperatureData, SubscriptionAttribute.FLAG.IgnoreSaveDB);
+            
+            DATA.Subscribe($"{Module}.Temperature", () => _temperatureController != null ? _temperatureController.TemperatureData.ReserviorTemperature : 0, SubscriptionAttribute.FLAG.IgnoreSaveDB);
+            DATA.Subscribe($"{Module}.Temperature.ID", () => _temperatureController != null ? _temperatureController.Module : "", SubscriptionAttribute.FLAG.IgnoreSaveDB);
+            DATA.Subscribe($"{Module}.Temperature.Status", () => _temperatureController != null ? _temperatureController.TemperatureData.Status : "", SubscriptionAttribute.FLAG.IgnoreSaveDB);
+            DATA.Subscribe($"{Module}.Temperature.TargetTemperature", () => _temperatureController != null ? _temperatureController.TemperatureData.TargetTemperature : 0, SubscriptionAttribute.FLAG.IgnoreSaveDB);
+            DATA.Subscribe($"{Module}.Temperature.Alarm", () => _temperatureController != null ? _temperatureController.TemperatureData.Alarm : "", SubscriptionAttribute.FLAG.IgnoreSaveDB);
+            DATA.Subscribe($"{Module}.Temperature.HeatExchangerTemperature", () => _temperatureController != null ? _temperatureController.TemperatureData.HeatExchangerTemperature : 0, SubscriptionAttribute.FLAG.IgnoreSaveDB);
         }
         /// <summary>
         /// 初始化Operation

+ 16 - 16
PunkHPX8_Themes/UserControls/DMReservoirUIControl.xaml

@@ -266,8 +266,8 @@
             </Grid>
         </Grid>
         <Canvas Width="150" Height="100" Canvas.Left="727" Canvas.Top="528" HorizontalAlignment="Left" VerticalAlignment="Top">
-            <userControls:TempControl TempValue="{Binding ReservoirTemperature}" Status="{Binding TCStatus}"
-                              DisableStatus="{Binding TCEnableStatus}">
+            <userControls:TempControl TempValue="{Binding ElementName=self,Path=ReservoirTemperature}" Status="{Binding ElementName=self,Path=TCStatus}"
+                              DisableStatus="{Binding ElementName=self,Path=TCEnableStatus}">
             </userControls:TempControl>
         </Canvas>
         <Grid Canvas.Left="178" Canvas.Top="430" HorizontalAlignment="Center" VerticalAlignment="Top">
@@ -310,21 +310,21 @@
         <Ellipse Canvas.Left="256" Canvas.Top="100" Width="16" Height="16"  Fill="{Binding IsANLevelHigh, Converter={StaticResource boolToRedColor}}" Stroke="Silver"/>
         <Ellipse Canvas.Left="256" Canvas.Top="160" Width="16" Height="16"  Fill="{Binding IsANLevelLow, Converter={StaticResource boolToRedColor}}" Stroke="Silver" HorizontalAlignment="Left" VerticalAlignment="Top"/>
 
-        <ctrls:FlowPipe IsFlowing="{Binding ReservoirData.CAByPass}" Height="8"  Width="120"  Canvas.Left="135"  Canvas.Top="198" RotateTransformValue="90" HorizontalAlignment="Left" VerticalAlignment="Center" Panel.ZIndex="-1"/>
-        <ctrls:FlowPipe IsFlowing="{Binding ReservoirData.CAByPass}" Height="8"  Width="95"  Canvas.Left="463"  Canvas.Top="224" RotateTransformValue="90" HorizontalAlignment="Left" VerticalAlignment="Top" Panel.ZIndex="-1"/>
-        <ctrls:FlowPipe IsFlowing="{Binding ReservoirData.CAByPass}" Height="8"  Width="200"  Canvas.Left="603"  Canvas.Top="224" RotateTransformValue="90" HorizontalAlignment="Left" VerticalAlignment="Center" Panel.ZIndex="-1"/>
-        <ctrls:FlowPipe IsFlowing="{Binding ReservoirData.CAByPass}" Height="8"  Width="80"  Canvas.Left="590"  Canvas.Top="591" RotateTransformValue="90" HorizontalAlignment="Left" VerticalAlignment="Center" Panel.ZIndex="-1"/>
-        <ctrls:FlowPipe IsFlowing="{Binding ReservoirData.CAByPass}" Height="8"  Width="120"  Canvas.Left="797"  Canvas.Top="415" RotateTransformValue="90" HorizontalAlignment="Center" VerticalAlignment="Top" Panel.ZIndex="-1"/>
-        <ctrls:FlowPipe IsFlowing="{Binding ReservoirData.CAByPass}" Height="8"  Width="60"  Canvas.Left="797"  Canvas.Top="210" RotateTransformValue="90" HorizontalAlignment="Center" VerticalAlignment="Top" Panel.ZIndex="-1"/>
-        <ctrls:FlowPipe IsFlowing="{Binding ReservoirData.CAByPass}" Height="8"  Width="160"  Canvas.Left="868"  Canvas.Top="328" RotateTransformValue="90" HorizontalAlignment="Left" VerticalAlignment="Center" Panel.ZIndex="-1"/>
+        <ctrls:FlowPipe IsReverse="True" IsFlowing="{Binding IsANPumpOpen,Mode=TwoWay,ElementName=self}" Height="8"  Width="120"  Canvas.Left="135"  Canvas.Top="198" RotateTransformValue="90" HorizontalAlignment="Left" VerticalAlignment="Center" Panel.ZIndex="-1"/>
+        <ctrls:FlowPipe IsFlowing="{Binding ElementName=self,Path=ANIsolationValve}" Height="8"  Width="95"  Canvas.Left="463"  Canvas.Top="224" RotateTransformValue="90" HorizontalAlignment="Left" VerticalAlignment="Top" Panel.ZIndex="-1"/>
+        <ctrls:FlowPipe IsFlowing="{Binding ElementName=self,Path=ReturnFlowValve}" Height="8"  Width="200"  Canvas.Left="603"  Canvas.Top="224" RotateTransformValue="90" HorizontalAlignment="Left" VerticalAlignment="Center" Panel.ZIndex="-1"/>
+        <ctrls:FlowPipe IsFlowing="{Binding ElementName=self,Path=SampleValve}" Height="8"  Width="80"  Canvas.Left="590"  Canvas.Top="591" RotateTransformValue="90" HorizontalAlignment="Left" VerticalAlignment="Center" Panel.ZIndex="-1"/>
+        <ctrls:FlowPipe IsReverse="True" IsFlowing="{Binding IsCAPumpOpen,Mode=TwoWay,ElementName=self}" Height="8"  Width="120"  Canvas.Left="797"  Canvas.Top="415" RotateTransformValue="90" HorizontalAlignment="Center" VerticalAlignment="Top" Panel.ZIndex="-1"/>
+        <ctrls:FlowPipe IsReverse="True" IsFlowing="{Binding IsCAPumpOpen,Mode=TwoWay,ElementName=self}" Height="8"  Width="60"  Canvas.Left="797"  Canvas.Top="210" RotateTransformValue="90" HorizontalAlignment="Center" VerticalAlignment="Top" Panel.ZIndex="-1"/>
+        <ctrls:FlowPipe IsReverse="True" IsFlowing="{Binding ElementName=self,Path=DegasValve}" Height="8"  Width="160"  Canvas.Left="868"  Canvas.Top="328" RotateTransformValue="90" HorizontalAlignment="Left" VerticalAlignment="Center" Panel.ZIndex="-1"/>
 
-        <ctrls:FlowPipe IsFlowing="{Binding ReservoirData.CADiReplen}" Height="8"  Width="420"  Canvas.Left="308"  Canvas.Top="580" RotateTransformValue="0" HorizontalAlignment="Left" VerticalAlignment="Center" Panel.ZIndex="-1"/>
-        <ctrls:FlowPipe IsFlowing="{Binding ReservoirData.CADiReplen}" Height="8"  Width="290"  Canvas.Left="308"  Canvas.Top="420" RotateTransformValue="0" HorizontalAlignment="Center" VerticalAlignment="Top" Panel.ZIndex="-1"/>
-        <ctrls:FlowPipe IsFlowing="{Binding ReservoirData.CADiReplen}" Height="8"  Width="325"  Canvas.Left="131"  Canvas.Top="317" RotateTransformValue="0" HorizontalAlignment="Left" VerticalAlignment="Center" Panel.ZIndex="-1"/>
-        <ctrls:FlowPipe IsFlowing="{Binding ReservoirData.CADiReplen}" Height="8"  Width="325"  Canvas.Left="135"  Canvas.Top="191" RotateTransformValue="0" HorizontalAlignment="Center" VerticalAlignment="Top" Panel.ZIndex="-1"/>
-        <ctrls:FlowPipe IsFlowing="{Binding ReservoirData.CADiReplen}" Height="8"  Width="160"  Canvas.Left="629"  Canvas.Top="200" RotateTransformValue="0" HorizontalAlignment="Left" VerticalAlignment="Center" Panel.ZIndex="-1"/>
-        <ctrls:FlowPipe IsFlowing="{Binding ReservoirData.CADiReplen}" Height="8"  Width="50"  Canvas.Left="812"  Canvas.Top="319" RotateTransformValue="0" HorizontalAlignment="Left" VerticalAlignment="Top" Panel.ZIndex="-1"/>
-        <ctrls:FlowPipe IsFlowing="{Binding ReservoirData.CADiReplen}" Height="8"  Width="50"  Canvas.Left="812"  Canvas.Top="380" RotateTransformValue="0" HorizontalAlignment="Left" VerticalAlignment="Top" Panel.ZIndex="-1"/>
+        <ctrls:FlowPipe IsFlowing="{Binding IsCAPumpOpen,Mode=TwoWay,ElementName=self}" Height="8"  Width="420"  Canvas.Left="308"  Canvas.Top="580" RotateTransformValue="0" HorizontalAlignment="Left" VerticalAlignment="Center" Panel.ZIndex="-1"/>
+        <ctrls:FlowPipe IsReverse="True" IsFlowing="{Binding ElementName=self,Path=ReturnFlowValve}" Height="8"  Width="290"  Canvas.Left="308"  Canvas.Top="420" RotateTransformValue="0" HorizontalAlignment="Center" VerticalAlignment="Top" Panel.ZIndex="-1"/>
+        <ctrls:FlowPipe IsReverse="True" IsFlowing="{Binding ElementName=self,Path=ANIsolationValve}" Height="8"  Width="325"  Canvas.Left="131"  Canvas.Top="317" RotateTransformValue="0" HorizontalAlignment="Left" VerticalAlignment="Center" Panel.ZIndex="-1"/>
+        <ctrls:FlowPipe IsFlowing="{Binding IsANPumpOpen,Mode=TwoWay,ElementName=self}" Height="8"  Width="325"  Canvas.Left="135"  Canvas.Top="191" RotateTransformValue="0" HorizontalAlignment="Center" VerticalAlignment="Top" Panel.ZIndex="-1"/>
+        <ctrls:FlowPipe IsReverse="True" IsFlowing="{Binding ElementName=self,Path=CAIsolationValve}" Height="8"  Width="160"  Canvas.Left="629"  Canvas.Top="200" RotateTransformValue="0" HorizontalAlignment="Left" VerticalAlignment="Center" Panel.ZIndex="-1"/>
+        <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:Pipe2   Canvas.Left="590"  Canvas.Top="415" HorizontalAlignment="Center" VerticalAlignment="Top" RotateTransformValue="0" RenderTransformOrigin="0.5,0.5" >