API is now used over Scrape
Refactor CommonB and Job classes to remove LoadLockSide and ReactorType properties; update constructors and methods to accommodate changes and improve data handling
This commit is contained in:
@ -1,25 +1,74 @@
|
||||
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||
|
||||
#nullable enable
|
||||
|
||||
public class CommonB
|
||||
{
|
||||
|
||||
public string Layer { get; }
|
||||
public string LoadLockSide { get; }
|
||||
public string? Layer { get; }
|
||||
public int? RDSNumber { get; }
|
||||
public string ReactorType { get; }
|
||||
public string PSN { get; }
|
||||
public string? PSN { get; }
|
||||
public int? ReactorNumber { get; }
|
||||
public string Zone { get; }
|
||||
public string? Zone { get; }
|
||||
|
||||
public CommonB(string layer, string loadLockSide, int? rdsNumber, string reactorType, string psn, int? reactorNumber, string zone)
|
||||
public CommonB(string? layer,
|
||||
int? rdsNumber,
|
||||
string? psn,
|
||||
int? reactorNumber,
|
||||
string? zone)
|
||||
{
|
||||
Layer = layer;
|
||||
LoadLockSide = loadLockSide;
|
||||
RDSNumber = rdsNumber;
|
||||
ReactorType = reactorType;
|
||||
PSN = psn;
|
||||
ReactorNumber = reactorNumber;
|
||||
Zone = zone;
|
||||
}
|
||||
|
||||
internal static CommonB Get(Common common, RunDataSheetRoot? runDataSheetRoot, Run[]? runs)
|
||||
{
|
||||
CommonB result;
|
||||
string? psn;
|
||||
string? zone;
|
||||
string? layer;
|
||||
int? reactorNumber;
|
||||
if (runs is null || runs.Length == 0)
|
||||
{
|
||||
zone = common.Zone;
|
||||
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];
|
||||
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);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user