2026-3-26
This commit is contained in:
51
CPSO/Forms/92_Knowledge/ViewAnalysisJob.cs
Normal file
51
CPSO/Forms/92_Knowledge/ViewAnalysisJob.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using CaeJob;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace CPSO.Forms._92_Knowledge
|
||||
{
|
||||
public class ViewAnalysisJob: INotifyPropertyChanged
|
||||
{
|
||||
private AnalysisJob Job { get; }
|
||||
|
||||
public void UpdateProgress()
|
||||
{
|
||||
OnPropertyChanged(nameof(Status));
|
||||
}
|
||||
|
||||
public ViewAnalysisJob(AnalysisJob job)
|
||||
{
|
||||
Job = job;
|
||||
}
|
||||
|
||||
[DisplayName("Job名称")]
|
||||
public string JobName => Job.Name;
|
||||
|
||||
private string _stepName;
|
||||
[DisplayName("Step名称")]
|
||||
public string StepName { get => _stepName; set => SetField(ref _stepName, value); }
|
||||
|
||||
private string _surfaceName;
|
||||
[DisplayName("Surface名称")]
|
||||
public string SurfaceName { get => _surfaceName; set => SetField(ref _surfaceName, value); }
|
||||
|
||||
[DisplayName("状态")]
|
||||
public JobStatus Status => Job.JobStatus;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
|
||||
{
|
||||
if (EqualityComparer<T>.Default.Equals(field, value)) return false;
|
||||
field = value;
|
||||
OnPropertyChanged(propertyName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user