diff --git a/.vs/CPSO/DesignTimeBuild/.dtbcache.v2 b/.vs/CPSO/DesignTimeBuild/.dtbcache.v2 index feee24b..a75af13 100644 Binary files a/.vs/CPSO/DesignTimeBuild/.dtbcache.v2 and b/.vs/CPSO/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/CPSO/FileContentIndex/92b1f4f8-7aac-44aa-a91f-ad2af3fc7bb4.vsidx b/.vs/CPSO/FileContentIndex/92b1f4f8-7aac-44aa-a91f-ad2af3fc7bb4.vsidx new file mode 100644 index 0000000..06d9787 Binary files /dev/null and b/.vs/CPSO/FileContentIndex/92b1f4f8-7aac-44aa-a91f-ad2af3fc7bb4.vsidx differ diff --git a/.vs/CPSO/FileContentIndex/c9f035e5-4087-4496-8920-706c74edcb44.vsidx b/.vs/CPSO/FileContentIndex/c9f035e5-4087-4496-8920-706c74edcb44.vsidx new file mode 100644 index 0000000..287ee65 Binary files /dev/null and b/.vs/CPSO/FileContentIndex/c9f035e5-4087-4496-8920-706c74edcb44.vsidx differ diff --git a/.vs/CPSO/FileContentIndex/cb8dd1d3-3aad-4e01-8ad7-b420d7cf6c50.vsidx b/.vs/CPSO/FileContentIndex/cb8dd1d3-3aad-4e01-8ad7-b420d7cf6c50.vsidx new file mode 100644 index 0000000..cc4b621 Binary files /dev/null and b/.vs/CPSO/FileContentIndex/cb8dd1d3-3aad-4e01-8ad7-b420d7cf6c50.vsidx differ diff --git a/.vs/CPSO/FileContentIndex/e99efc25-d4c4-4965-a941-b91b8402f25b.vsidx b/.vs/CPSO/FileContentIndex/e99efc25-d4c4-4965-a941-b91b8402f25b.vsidx new file mode 100644 index 0000000..6c34dd8 Binary files /dev/null and b/.vs/CPSO/FileContentIndex/e99efc25-d4c4-4965-a941-b91b8402f25b.vsidx differ diff --git a/.vs/CPSO/FileContentIndex/f90280cc-b4a5-4989-a19b-c664b761d5dc.vsidx b/.vs/CPSO/FileContentIndex/f90280cc-b4a5-4989-a19b-c664b761d5dc.vsidx new file mode 100644 index 0000000..379bd82 Binary files /dev/null and b/.vs/CPSO/FileContentIndex/f90280cc-b4a5-4989-a19b-c664b761d5dc.vsidx differ diff --git a/.vs/CPSO/v17/.futdcache.v2 b/.vs/CPSO/v17/.futdcache.v2 index b3697e2..979bb02 100644 Binary files a/.vs/CPSO/v17/.futdcache.v2 and b/.vs/CPSO/v17/.futdcache.v2 differ diff --git a/.vs/CPSO/v17/.suo b/.vs/CPSO/v17/.suo index 8c1d429..f6c3b47 100644 Binary files a/.vs/CPSO/v17/.suo and b/.vs/CPSO/v17/.suo differ diff --git a/.vs/CPSO/v17/Browse.VC.db b/.vs/CPSO/v17/Browse.VC.db index b056361..ab7549a 100644 Binary files a/.vs/CPSO/v17/Browse.VC.db and b/.vs/CPSO/v17/Browse.VC.db differ diff --git a/.vs/CPSO/v17/TestStore/0/000.testlog b/.vs/CPSO/v17/TestStore/0/000.testlog new file mode 100644 index 0000000..20cd9f9 Binary files /dev/null and b/.vs/CPSO/v17/TestStore/0/000.testlog differ diff --git a/.vs/CPSO/v17/TestStore/0/testlog.manifest b/.vs/CPSO/v17/TestStore/0/testlog.manifest new file mode 100644 index 0000000..e92ede2 Binary files /dev/null and b/.vs/CPSO/v17/TestStore/0/testlog.manifest differ diff --git a/.vs/CPSO/v17/fileList.bin b/.vs/CPSO/v17/fileList.bin index 06181d7..0e9f3db 100644 Binary files a/.vs/CPSO/v17/fileList.bin and b/.vs/CPSO/v17/fileList.bin differ diff --git a/CPSO/Forms/92_Knowledge/ViewAnalysisJob.cs b/CPSO/Forms/92_Knowledge/ViewAnalysisJob.cs new file mode 100644 index 0000000..0ff29bd --- /dev/null +++ b/CPSO/Forms/92_Knowledge/ViewAnalysisJob.cs @@ -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(ref T field, T value, [CallerMemberName] string propertyName = null) + { + if (EqualityComparer.Default.Equals(field, value)) return false; + field = value; + OnPropertyChanged(propertyName); + return true; + } + } +} \ No newline at end of file diff --git a/CPSO/Forms/92_Knowledge/ViewJobs.cs b/CPSO/Forms/92_Knowledge/ViewJobs.cs new file mode 100644 index 0000000..6c1a4f1 --- /dev/null +++ b/CPSO/Forms/92_Knowledge/ViewJobs.cs @@ -0,0 +1,71 @@ +using CaeGlobals; +using CaeKnowledge.View; +using DynamicTypeDescriptor; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing.Design; +using System.Linq; + +namespace CPSO.Forms._92_Knowledge +{ + public class ViewJobs + { + private readonly DynamicCustomTypeDescriptor _dctd; + + private readonly Controller _controller; + + [Category("1数据")] + [OrderedDisplayName(0, 3, "计算步Step")] + [Description("选择要继承的计算步")] + public string Step { get; set; } + + [Category("1数据")] + [OrderedDisplayName(1, 3, "曲面集")] + [Description("选择要载荷所在的曲面集")] + public string Surface { get; set; } + + [Category("1数据")] + [OrderedDisplayName(2, 3, "切削力")] + [Editor(typeof(MyCollectionEditor), typeof(UITypeEditor))] + public List ToolPositionList { get; set; } = new List(); + + [Category("2分析")] + [DisplayName("新分析步名称")] + public string NewStepName { get; set; } = "Step"; + + public ViewJobs(Controller self) + { + _controller = self; + + _dctd = ProviderInstaller.Install(this); + + PopulateDropDownList(); + } + + public void PopulateDropDownList() + { + // ReSharper disable once JoinDeclarationAndInitializer + CustomPropertyDescriptor cpd; + + // 1.加入已有的Steps列表 + cpd = _dctd.GetProperty(nameof(Step)); + cpd.StatandardValues.Clear(); + + _controller.Model.StepCollection.StepsList.ForEach(x => + { + cpd.StatandardValues.Add(new StandardValueAttribute(x.Name)); + }); + + // 2.加入已有的Surface列表 + cpd = _dctd.GetProperty(nameof(Surface)); + cpd.StatandardValues.Clear(); + + foreach (var surfaceName in _controller.Model.Mesh.Surfaces.Values + .Where(x => !x.Internal) + .Select(x => x.Name)) + { + cpd.StatandardValues.Add(new StandardValueAttribute(surfaceName)); + } + } + } +} \ No newline at end of file