| | |
| | | static readonly TraceSource log = Log.CreateSource("TestPlan"); |
| | | static readonly TraceSource resultLog = Log.CreateSource("Resources"); |
| | | |
| | | public VariableContext LocalsRuntime { get; internal set; } |
| | | |
| | | /// <summary> |
| | | /// FileGlobals运行时 |
| | | /// </summary> |
| | | public VariableContext ParametersRuntime { get; private set; } |
| | | |
| | | public FileGlobalsContext fileGlobalsContext { get; private set; } |
| | | /// <summary> |
| | | /// FileGlobals运行时 |
| | | /// </summary> |
| | | public VariableContext FileGlobalsRuntime { get; private set; } |
| | | public VariableContext FileGlobalsRuntime { get => fileGlobalsContext?.GetFileGlobals(plan); } |
| | | |
| | | /// <summary> |
| | | /// StationGlobals运行时 |
| | |
| | | |
| | | void RefreshFileGlobals() |
| | | { |
| | | if (variableContainer?.FileGlobals != null) |
| | | //if (variableContainer?.FileGlobals != null) |
| | | //{ |
| | | // FileGlobalsRuntime = variableContainer.FileGlobals; |
| | | //} |
| | | //else |
| | | //{ |
| | | // var runtimeVariablePool = new ConcurrentDictionary<string, RuntimeVariable>(); |
| | | // foreach (var data in plan.Variables) |
| | | // { |
| | | // RuntimeVariable runTime = data.ToRuntime(); |
| | | // if (runTime == null) continue; |
| | | // runtimeVariablePool[runTime.Name] = runTime; |
| | | // } |
| | | // this.FileGlobalsRuntime = new VariableContext(runtimeVariablePool); |
| | | //} |
| | | |
| | | if (variableContainer?.fileGlobalsContext != null) |
| | | { |
| | | FileGlobalsRuntime = variableContainer.FileGlobals; |
| | | fileGlobalsContext = variableContainer.fileGlobalsContext; |
| | | } |
| | | else |
| | | { |
| | | var runtimeVariablePool = new ConcurrentDictionary<string, RuntimeVariable>(); |
| | | foreach (var data in plan.Variables) |
| | | { |
| | | RuntimeVariable runTime = data.ToRuntime(); |
| | | if (runTime == null) continue; |
| | | runtimeVariablePool[runTime.Name] = runTime; |
| | | } |
| | | this.FileGlobalsRuntime = new VariableContext(runtimeVariablePool); |
| | | fileGlobalsContext = new FileGlobalsContext(); |
| | | var _ = fileGlobalsContext.GetFileGlobals(plan); |
| | | } |
| | | } |
| | | |