fix: 调整进度条的步幅
This commit is contained in:
@@ -183,7 +183,7 @@ public class JtagController : ControllerBase
|
||||
logger.Info($"User {username} processing bitstream file of size: {fileBytes.Length} bytes");
|
||||
|
||||
// 定义进度跟踪
|
||||
var taskId = _tracker.CreateTask(1000);
|
||||
var taskId = _tracker.CreateTask(10000);
|
||||
_tracker.AdvanceProgress(taskId, 10);
|
||||
|
||||
_ = Task.Run(async () =>
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ProgressInfo
|
||||
{
|
||||
public required string TaskId { get; set; }
|
||||
public required ProgressStatus Status { get; set; }
|
||||
public required int ProgressPercent { get; set; }
|
||||
public required double ProgressPercent { get; set; }
|
||||
public required string ErrorMessage { get; set; }
|
||||
};
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public readonly struct TaskProgress
|
||||
TaskState.Cancelled => ProgressStatus.Canceled,
|
||||
_ => ProgressStatus.Failed
|
||||
},
|
||||
ProgressPercent = Total > 0 ? (Current * 100) / Total : 0,
|
||||
ProgressPercent = Total > 0 ? ((double)Current * 100) / (double)Total : 0,
|
||||
ErrorMessage = Error ?? string.Empty
|
||||
};
|
||||
}
|
||||
|
||||
@@ -677,7 +677,7 @@ public sealed class UDPClientPool
|
||||
if (!udpWriteAck.Value.IsSuccessful)
|
||||
return false;
|
||||
|
||||
_progressTracker.AdvanceProgress(progressId, 5);
|
||||
_progressTracker.AdvanceProgress(progressId, 1);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user