From 83267cf4ffcae3d1e971df1991984a92c8168056 Mon Sep 17 00:00:00 2001 From: wangsr Date: Wed, 20 Dec 2023 11:37:30 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E9=99=90=E5=88=B6=E5=8E=8B?= =?UTF-8?q?=E5=8A=9B=E6=9B=B2=E7=BA=BF=E5=9B=BE=E4=B8=8D=E5=B0=8F=E4=BA=8E?= =?UTF-8?q?0=EF=BC=8C=E9=99=90=E5=88=B6=E4=B8=89=E4=BD=8D=E5=B0=8F?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LjDeliver/ControlsHelper.cs | 12 +++++++++++- .../LjDeliver/DeliverInitAction.cs | 18 +++++++++--------- .../Data/MCProject/nodeForm/LjDeliver.xml | 2 +- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/ControlsHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/ControlsHelper.cs index 11077a9..fc37deb 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/ControlsHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/ControlsHelper.cs @@ -15,6 +15,16 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver { public class ControlsHelper : ControlsImprot { - + public static double NoNegative(double value) + { + if(value < 0) + { + return 0; + } + else + { + return value; + } + } } } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs index f8ef9d6..6c61341 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs @@ -552,15 +552,15 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver ControlsHelper.SetMCLabel(LabelE.PR1PCP02, (float)Math.Round(PlcTemp.PR1PCP02_Set, 2)+ " MPa"); ControlsHelper.SetMCLabel(LabelE.PR1PCP03, (float)Math.Round(PlcTemp.PR1PCP03_Set, 2)+ " MPa"); - PressureCurve.PointValue1 = Math.Round(PlcTemp.PR1DBT02_Set, 4); - PressureCurve.PointValue2 = Math.Round(PlcTemp.PR1DBT03_Set, 4); - PressureCurve.PointValue3 = Math.Round(PlcTemp.PR1DBT04_Set, 4); - PressureCurve.PointValue4 = Math.Round(PlcTemp.PR2DBT02_Set, 4); - PressureCurve.PointValue5 = Math.Round(PlcTemp.PR2DBT03_Set, 4); - PressureCurve.PointValue6 = Math.Round(PlcTemp.PR2DBT04_Set, 4); - PressureCurve.PointValue7 = Math.Round(PlcTemp.PR3DBT02_Set, 4); - PressureCurve.PointValue8 = Math.Round(PlcTemp.PR3DBT03_Set, 4); - PressureCurve.PointValue9 = Math.Round(PlcTemp.PR3DBT04_Set, 4); + PressureCurve.PointValue1 = ControlsHelper.NoNegative(Math.Round(PlcTemp.PR1DBT02_Set, 3)); + PressureCurve.PointValue2 = ControlsHelper.NoNegative(Math.Round(PlcTemp.PR1DBT03_Set, 3)); + PressureCurve.PointValue3 = ControlsHelper.NoNegative(Math.Round(PlcTemp.PR1DBT04_Set, 3)); + PressureCurve.PointValue4 = ControlsHelper.NoNegative(Math.Round(PlcTemp.PR2DBT02_Set, 3)); + PressureCurve.PointValue5 = ControlsHelper.NoNegative(Math.Round(PlcTemp.PR2DBT03_Set, 3)); + PressureCurve.PointValue6 = ControlsHelper.NoNegative(Math.Round(PlcTemp.PR2DBT04_Set, 3)); + PressureCurve.PointValue7 = ControlsHelper.NoNegative(Math.Round(PlcTemp.PR3DBT02_Set, 3)); + PressureCurve.PointValue8 = ControlsHelper.NoNegative(Math.Round(PlcTemp.PR3DBT03_Set, 3)); + PressureCurve.PointValue9 = ControlsHelper.NoNegative(Math.Round(PlcTemp.PR3DBT04_Set, 3)); ControlsHelper.SetHslBottle(bottleE.Bottle1, PlcTemp.Bottle1_Set); ControlsHelper.SetHslBottle(bottleE.Bottle2, PlcTemp.Bottle2_Set); diff --git a/Main/MCEdit/Data/MCProject/nodeForm/LjDeliver.xml b/Main/MCEdit/Data/MCProject/nodeForm/LjDeliver.xml index 50e4a13..f62be5e 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/LjDeliver.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/LjDeliver.xml @@ -77,7 +77,7 @@ True MPa ButtonHighlight - 713, 498 + 710, 494 MCLabel1 23, 12