88 lines
2.7 KiB
C#
88 lines
2.7 KiB
C#
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
|
|
|
#nullable enable
|
|
|
|
public class CommonB
|
|
{
|
|
|
|
public string? Layer { get; }
|
|
public int? RDSNumber { get; }
|
|
public string? PSN { get; }
|
|
public int? ReactorNumber { get; }
|
|
public string? Zone { get; }
|
|
public string? ExportControl { get; }
|
|
public string? ReactorMode { get; }
|
|
|
|
public CommonB(string? layer,
|
|
int? rdsNumber,
|
|
string? psn,
|
|
int? reactorNumber,
|
|
string? zone,
|
|
string? exportControl,
|
|
string? reactorMode)
|
|
{
|
|
Layer = layer;
|
|
RDSNumber = rdsNumber;
|
|
PSN = psn;
|
|
ReactorNumber = reactorNumber;
|
|
Zone = zone;
|
|
ExportControl = exportControl;
|
|
ReactorMode = reactorMode;
|
|
}
|
|
|
|
internal static CommonB Get(Common common, RunDataSheetRoot? runDataSheetRoot, Run[]? runs)
|
|
{
|
|
CommonB result;
|
|
string? psn;
|
|
string? zone;
|
|
string? layer;
|
|
int? reactorNumber;
|
|
string? reactorMode;
|
|
string? exportControl;
|
|
if (runs is null || runs.Length == 0)
|
|
{
|
|
reactorMode = null;
|
|
zone = common.Zone;
|
|
exportControl = null;
|
|
layer = common.Layer;
|
|
if (runDataSheetRoot?.RunDataSheet is null)
|
|
{
|
|
psn = common.PSN;
|
|
reactorNumber = common.ReactorNumber;
|
|
}
|
|
else
|
|
{
|
|
psn = runDataSheetRoot?.RunDataSheet.PSN.ToString();
|
|
reactorNumber = runDataSheetRoot?.RunDataSheet.Reactor;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
const int zero = 0;
|
|
Run run = runs[zero];
|
|
reactorMode = run.ReactorMode;
|
|
exportControl = run.ExportControl;
|
|
if (runDataSheetRoot?.RunDataSheet is not null)
|
|
{
|
|
psn = runDataSheetRoot?.RunDataSheet.PSN.ToString();
|
|
reactorNumber = runDataSheetRoot?.RunDataSheet.Reactor;
|
|
}
|
|
else
|
|
{
|
|
psn = string.IsNullOrEmpty(common.PSN) ? run.PSN : common.PSN;
|
|
reactorNumber = common.ReactorNumber is null ? run.Reactor : common.ReactorNumber;
|
|
}
|
|
zone = string.IsNullOrEmpty(common.Zone) ? run.Zone : common.Zone;
|
|
layer = string.IsNullOrEmpty(common.Layer) ? run.EpiLayer : common.Layer;
|
|
}
|
|
result = new(layer: layer,
|
|
rdsNumber: common.RDSNumber,
|
|
psn: psn,
|
|
reactorNumber: reactorNumber,
|
|
zone: zone,
|
|
exportControl: exportControl,
|
|
reactorMode: reactorMode);
|
|
return result;
|
|
}
|
|
|
|
} |