diff --git a/CapMachine.Wpf/App.config b/CapMachine.Wpf/App.config index c98640a..133d9f2 100644 --- a/CapMachine.Wpf/App.config +++ b/CapMachine.Wpf/App.config @@ -7,6 +7,7 @@ + \ No newline at end of file diff --git a/CapMachine.Wpf/CapMachine.Wpf.csproj b/CapMachine.Wpf/CapMachine.Wpf.csproj index 3a92362..3776fa6 100644 --- a/CapMachine.Wpf/CapMachine.Wpf.csproj +++ b/CapMachine.Wpf/CapMachine.Wpf.csproj @@ -723,6 +723,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/CapMachine.Wpf/EnvSupport/NIST2391.EXE b/CapMachine.Wpf/EnvSupport/NIST2391.EXE new file mode 100644 index 0000000..58eb64c Binary files /dev/null and b/CapMachine.Wpf/EnvSupport/NIST2391.EXE differ diff --git a/CapMachine.Wpf/PPCalculation/IRefProp64.cs b/CapMachine.Wpf/PPCalculation/IRefProp64.cs index 479ce61..495e2b3 100644 --- a/CapMachine.Wpf/PPCalculation/IRefProp64.cs +++ b/CapMachine.Wpf/PPCalculation/IRefProp64.cs @@ -6,11 +6,12 @@ namespace CapMachine.Wpf.PPCalculation /// /// This is C# Wrapper Class for REFPROP. + /// REFPROP.DLL 是32程序的Dll文件,如果应用程序是32位的,需要使用REFPROP.DLL,修改为: [DllImport(@".\PPCalculation\REFPROP\REFPROP.DLL")] + /// REFPRP64.DLL 是64位程序的Dll文件,如果应用程序是64位的,需要使用REFPRP64.DLL 修改为: [DllImport(@".\PPCalculation\REFPROP\REFPRP64.DLL")] + /// 还请搭配流体文件的数据(请注意路径的长度) /// public static class IRefProp64 { - static bool is64Bit = Environment.Is64BitProcess; - /************************************************************** * Set the path where the fluid files are located. * The path does not need to contain the ending "\" and it can diff --git a/CapMachine.Wpf/Services/ConfigService.cs b/CapMachine.Wpf/Services/ConfigService.cs index e4b549e..9bc5fea 100644 --- a/CapMachine.Wpf/Services/ConfigService.cs +++ b/CapMachine.Wpf/Services/ConfigService.cs @@ -13,6 +13,7 @@ namespace CapMachine.Wpf.Services public ConfigService() { CurUserDto = new UserDto(); + } /// @@ -57,6 +58,7 @@ namespace CapMachine.Wpf.Services /// public int ChartRtDataCacheTimeSec { get; set; } = 3600_8; + private HistoryExp _CurExpInfo; /// /// 当前的试验信息 diff --git a/CapMachine.Wpf/Services/PPCService.cs b/CapMachine.Wpf/Services/PPCService.cs index 88ec389..0403a50 100644 --- a/CapMachine.Wpf/Services/PPCService.cs +++ b/CapMachine.Wpf/Services/PPCService.cs @@ -1,4 +1,5 @@ -using CapMachine.Shared.Controls; +using CapMachine.Core; +using CapMachine.Shared.Controls; using CapMachine.Wpf.Models.Tag; using CapMachine.Wpf.PPCalculation; using Prism.Events; @@ -65,9 +66,21 @@ namespace CapMachine.Wpf.Services //Cond1TempTag = TagManager.DicTags.GetValueOrDefault("冷凝器出口水温[℃]"); //CondInTempTag = TagManager.DicTags.GetValueOrDefault("冷凝器进口温度[℃]"); - //RtScanDeviceStart(); + FluidsPath = ConfigHelper.GetValue("FluidsPath"); + + RtScanDeviceStart(); } + + /// + /// 过热度和过冷度计算FLUID路径 + /// REFPROP + /// REFPRP64.DLL + /// + /// ****FluidsPath 路径不能太长,否则会导致错误*********** + /// + public string FluidsPath { get; set; } = "C:\\Program Files (x86)\\REFPROP\\fluids"; + /// /// 吸气压力 /// @@ -123,7 +136,7 @@ namespace CapMachine.Wpf.Services /// /// 启用计算 /// - private bool RtCalcEnable { get; set; }=true; + private bool RtCalcEnable { get; set; } = true; /// @@ -151,7 +164,7 @@ namespace CapMachine.Wpf.Services //textBox5.Text = ""; - string hpath = @".\PPCalculation\REFPROP\FLUIDS"; + string hpath = FluidsPath; long size = hpath.Length; hpath += new String(' ', 255 - (int)size); @@ -199,7 +212,7 @@ namespace CapMachine.Wpf.Services kph = 1; p1 = (TxvFrPressTag.EngPvValue) * 1000.0;//textBox3 Evap.膨胀阀前压力(Mpa) - //p1 = Convert.ToDouble(textBox3.Text) * 1000.0;//textBox3 Evap.膨胀阀前压力(Mpa) + //p1 = Convert.ToDouble(textBox3.Text) * 1000.0;//textBox3 Evap.膨胀阀前压力(Mpa) IRefProp64.SATPdll(ref p, x, ref kph, ref te, ref Dl, ref Dv, xliq, xvap, ref iErr, ref herr, ref herrLen); if (iErr == 0) @@ -299,7 +312,7 @@ namespace CapMachine.Wpf.Services //p1 = (ListKRLogCellValue.Find(a => a.Name == "膨胀阀前压力").Value) * 1000.0;//textBox3 Evap.膨胀阀前压力(Mpa) p1 = (TxvFrPressTag.EngPvValue) * 1000.0;//textBox3 Evap.膨胀阀前压力(Mpa) - //p1 = Convert.ToDouble(textBox3.Text) * 1000.0;//textBox3 Evap.膨胀阀前压力(Mpa) + //p1 = Convert.ToDouble(textBox3.Text) * 1000.0;//textBox3 Evap.膨胀阀前压力(Mpa) IRefProp64.SATPdll(ref p, x, ref kph, ref te, ref Dl, ref Dv, xliq, xvap, ref iErr, ref herr, ref herrLen);