Files
wg_cpso/CPSO/Commands/0100_Analysis/CReplaceJob.cs

44 lines
1.3 KiB
C#
Raw Permalink Normal View History

2026-03-25 18:20:24 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CPSO;
using CaeModel;
using CaeMesh;
using CaeGlobals;
using CaeJob;
namespace CPSO.Commands
{
[Serializable]
class CReplaceJob : PreprocessCommand
{
// Variables
private string _oldJobName;
private AnalysisJob _newJob;
// Constructor
public CReplaceJob(string oldJobName, AnalysisJob newJob)
: base("Edit analysis")
{
_oldJobName = oldJobName;
_newJob = newJob.DeepClone();
_newJob.ClearFileContents();
}
// Methods
public override bool Execute(Controller receiver)
{
receiver.ReplaceJob(_oldJobName, _newJob.DeepClone());
return true;
}
public override string GetCommandString()
{
return base.GetCommandString() + _oldJobName + ", " + _newJob.ToString();
}
}
}