Files
VacuumPressureMembranePoreS…/Models/BubblePointRecord.cs
2026-04-09 21:43:30 +08:00

82 lines
2.5 KiB
C#

using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace MembranePoreTester.Models
{
public class BubblePointRecord : INotifyPropertyChanged
{
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; } // 生产厂家
private double _bubblePointPressure;
public double BubblePointPressure // 泡点压力(数值)
{
get => _bubblePointPressure;
set
{
if (_bubblePointPressure != value)
{
_bubblePointPressure = value;
OnPropertyChanged(); // 需要触发通知
}
}
}
private double _bubbleCurrentPressure;
// 当前压力 - 添加通知
public double BubbleCurrentPressure
{
get => _bubbleCurrentPressure;
set
{
if (_bubbleCurrentPressure != value)
{
_bubbleCurrentPressure = value;
OnPropertyChanged();
}
}
}
public string PressureUnit { get; set; } = "Pa"; // Pa/cmHg/psi
public DateTime TestDate { get; set; } = DateTime.Now;
public string Tester { get; set; }
public string SpeedRate1 { get; set; }
public string SpeedRate2 { get; set; }
public string SpeedRate3 { get; set; }
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
};
}
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}