Files
VacuumPressureMembranePoreS…/Models/BubblePointRecord.cs

82 lines
2.5 KiB
C#
Raw Normal View History

2026-03-26 19:43:52 +08:00
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace MembranePoreTester.Models
2026-02-27 16:03:49 +08:00
{
2026-04-02 14:34:29 +08:00
public class BubblePointRecord : INotifyPropertyChanged
2026-02-27 16:03:49 +08:00
{
public string SampleType { get; set; } // 平板膜/中空纤维膜
public string SampleSpec { get; set; } // 规格
public double RoomTemperature { get; set; } // 室温(°C)
public double SoakingTime { get; set; } // 浸润时间(小时)
public TestLiquid Liquid { get; set; } // 测试液体
public string LiquidManufacturer { get; set; } // 生产厂家
2026-03-26 19:43:52 +08:00
private double _bubblePointPressure;
public double BubblePointPressure // 泡点压力(数值)
{
get => _bubblePointPressure;
set
{
if (_bubblePointPressure != value)
{
_bubblePointPressure = value;
OnPropertyChanged(); // 需要触发通知
}
}
}
2026-03-26 21:37:34 +08:00
private double _bubbleCurrentPressure;
// 当前压力 - 添加通知
public double BubbleCurrentPressure
{
get => _bubbleCurrentPressure;
set
{
if (_bubbleCurrentPressure != value)
{
_bubbleCurrentPressure = value;
OnPropertyChanged();
}
}
}
2026-03-31 20:17:17 +08:00
public string PressureUnit { get; set; } = "Pa"; // Pa/cmHg/psi
2026-02-27 16:03:49 +08:00
public DateTime TestDate { get; set; } = DateTime.Now;
public string Tester { get; set; }
2026-04-02 14:34:29 +08:00
public string SpeedRate1 { get; set; }
2026-04-09 21:43:30 +08:00
public string SpeedRate2 { get; set; }
public string SpeedRate3 { get; set; }
2026-04-02 14:34:29 +08:00
2026-02-27 16:03:49 +08:00
public double MaxPoreSize => CalculateMaxPore();
private double CalculateMaxPore()
{
if (Liquid == null) return 0;
return PressureUnit switch
{
"Pa" => Liquid.C_Pa / BubblePointPressure,
"cmHg" => Liquid.C_cmHg / BubblePointPressure,
"psi" => Liquid.C_psi / BubblePointPressure,
_ => 0
};
}
2026-03-26 19:43:52 +08:00
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
2026-02-27 16:03:49 +08:00
}
}