现场优化6

This commit is contained in:
2026-08-17 15:52:48 +08:00
parent 2bb8313f99
commit fb6e5b3cb1
61 changed files with 23694 additions and 146356 deletions
+8
View File
@@ -332,6 +332,14 @@ namespace DeviceCommand.Devices
{
try
{
string FileDirectory = Path.GetDirectoryName(saveFilePath) ?? ""; // 获取目录
string fileNameWithoutExt = Path.GetFileNameWithoutExtension(saveFilePath); // 获取纯文件名
string extension = Path.GetExtension(saveFilePath); // 获取后缀名 (如 .png)
// 生成时间戳,格式为 年月日_时分秒 (例如 20260817_123045)
string timeStamp = DateTime.Now.ToString("yyyyMMdd_HHmmss");
// 组合成新的路径
saveFilePath = Path.Combine(FileDirectory, $"{fileNameWithoutExt}_{timeStamp}{extension}");
// 1. 调用我们在基类 Tcp 中全新实现的 ReadRawAsync
// 它会在内部下发 ":PRINt? PNG\n",自动接收完整的网络字节流
byte[] pureImageBytes = await ReadAllBytesAsync($":PRINt? PNG{ScpiDelimiter}", ct);