This commit is contained in:
xyy
2026-06-04 10:26:57 +08:00
parent 9a3cfff6d8
commit fed8c9b6dd
2 changed files with 18 additions and 18 deletions

View File

@@ -91,7 +91,7 @@ public partial class D7896ViewModel : ObservableObject
private const double EulerGamma = 0.5772156649; // 欧拉常数
//private const double WireRadius = 0.00003; // 铂丝半径 (0.03 mm)
[ObservableProperty] private double _sampleDensity = 1000.0; // 新增密度默认值1000 kg/m³
int samples = 400; // 1秒 * 1000点/秒
int samples = 200; // 1秒 * 1000点/秒
double heatingDuration = 1; // 加热时间 0.8 秒(需与您的加热脉冲宽度一致)
double totalDuration = 2; // 总采样时间(加热 + 冷却)
public D7896ViewModel()
@@ -609,22 +609,22 @@ public partial class D7896ViewModel : ObservableObject
coolingPoints.Add(new DataPoint(time[i], deltaT[i]));
// 导出CSV
try
{
string tmp = Path.GetTempPath();
string baseName = $"measure_{SampleId}_{DateTime.Now:yyyyMMdd_HHmmss}_{CurrentMeasurementIndex}";
string dataPath = Path.Combine(tmp, baseName + ".csv");
ExportMeasurementCsv(dataPath, time, ustd, upt, deltaT, startIdx, endIdx);
Logger.Log($"已导出测量数据 CSV: {dataPath}");
//try
//{
// string tmp = Path.GetTempPath();
// string baseName = $"measure_{SampleId}_{DateTime.Now:yyyyMMdd_HHmmss}_{CurrentMeasurementIndex}";
// string dataPath = Path.Combine(tmp, baseName + ".csv");
// ExportMeasurementCsv(dataPath, time, ustd, upt, deltaT, startIdx, endIdx);
// Logger.Log($"已导出测量数据 CSV: {dataPath}");
string winPath = Path.Combine(tmp, baseName + "_windows.csv");
ExportCandidateWindowsCsv(winPath, time, deltaT, startIdx, endIdx);
Logger.Log($"已导出候选拟合窗 CSV: {winPath}");
}
catch (Exception ex)
{
Logger.Log($"导出CSV失败: {ex.Message}");
}
// string winPath = Path.Combine(tmp, baseName + "_windows.csv");
// ExportCandidateWindowsCsv(winPath, time, deltaT, startIdx, endIdx);
// Logger.Log($"已导出候选拟合窗 CSV: {winPath}");
//}
//catch (Exception ex)
//{
// Logger.Log($"导出CSV失败: {ex.Message}");
//}
return (lambda, alpha, deltaT, coolingPoints);
}