Files
wg_cpso/CPSO/Commands/0082_HistoryOutput/CReplaceHistoryOutput.cs

44 lines
1.5 KiB
C#
Raw 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 CaeGlobals;
namespace CPSO.Commands
{
[Serializable]
class CReplaceHistoryOutput : PreprocessCommand
{
// Variables
private string _stepName;
private string _oldHistoryOutputName;
private HistoryOutput _newHistoryOutput;
// Constructor
public CReplaceHistoryOutput(string stepName, string oldHistoryOutputName, HistoryOutput newHistoryOutput)
: base("Edit history output")
{
_stepName = stepName;
_oldHistoryOutputName = oldHistoryOutputName;
_newHistoryOutput = newHistoryOutput.DeepClone();
}
// Methods
public override bool Execute(Controller receiver)
{
receiver.ReplaceHistoryOutput(_stepName, _oldHistoryOutputName, _newHistoryOutput.DeepClone());
return true;
}
public override string GetCommandString()
{
return base.GetCommandString() + _stepName + ": " + _oldHistoryOutputName + ", " + _newHistoryOutput.ToString();
}
}
}