load-lock-side from reactor and open-insight api

This commit is contained in:
2025-08-25 09:31:01 -07:00
parent 43024c6c30
commit 19b54a7cc8
6 changed files with 55 additions and 37 deletions

View File

@ -7,15 +7,17 @@ public class Input
public string? Area { get; }
public string? EquipmentType { get; }
public string? MID { get; }
public string? Slot { get; }
public string? LoadLock { get; }
public string? MesEntity { get; }
public string? MID { get; }
public string? Recipe { get; }
public string? Sequence { get; }
public string? Slot { get; }
[System.Text.Json.Serialization.JsonConstructor]
public Input(string? area,
string? equipmentType,
string? loadLock,
string? mid,
string? slot,
string? mesEntity,
@ -25,6 +27,7 @@ public class Input
Area = area;
EquipmentType = equipmentType;
LoadLock = loadLock;
MID = mid;
Slot = slot;
MesEntity = mesEntity;
@ -36,6 +39,7 @@ public class Input
{
Area = input.Area;
EquipmentType = input.EquipmentType;
LoadLock = input.LoadLock;
MID = mid;
Slot = input.Slot;
MesEntity = input.MesEntity;

View File

@ -433,8 +433,10 @@ public partial class Job
string mid = string.IsNullOrEmpty(input.MID) ? string.Empty : input.MID;
JsonSerializerOptions jsonSerializerOptions = new() { PropertyNameCaseInsensitive = true };
int? reactor = mid.Length < 2 || !int.TryParse(mid.Substring(0, 2), out int reactorNumber) ? null : reactorNumber;
ReactorRoot? reactorRoot = reactor is null ? null : GetReactorRoot(httpClient, jsonSerializerOptions, reactor);
if (reactorRoot?.Reactor is null || reactor != reactorRoot.Reactor.ReactorNo || reactorRoot.Reactor.LoadedRDS is null || reactorRoot.Reactor.LoadedRDS.Length < 1)
char? loadLockSide = string.IsNullOrEmpty(input.LoadLock) || input.LoadLock[0] is not 'L' and not 'R' ? null : input.LoadLock[0];
ReactorRoot? reactorRoot = reactor is null || loadLockSide is null ? null : GetReactorRoot(httpClient, jsonSerializerOptions, reactor);
rds = loadLockSide is null ? null : loadLockSide == 'L' ? reactorRoot?.Reactor?.LoadLockLeftRDS : loadLockSide == 'R' ? reactorRoot?.Reactor?.LoadLockRightRDS : null;
if (reactorRoot?.Reactor is null || reactor != reactorRoot.Reactor.ReactorNo || rds is null)
{
rds = null;
psn = null;
@ -449,7 +451,6 @@ public partial class Job
}
else
{
rds = reactorRoot.Reactor.LoadedRDS[0];
RunDataSheetRoot? runDataSheetRoot = GetRunDataSheetRoot(httpClient, rds.Value);
if (runDataSheetRoot?.RunDataSheet is null || reactor != runDataSheetRoot.RunDataSheet.Reactor)
{

View File

@ -6,13 +6,15 @@ public class Reactor
{
[JsonConstructor]
public Reactor(int reactorNo, int[] loadedRDS)
public Reactor(int reactorNo, int? loadLockLeftRDS, int? loadLockRightRDS)
{
LoadLockLeftRDS = loadLockLeftRDS;
LoadLockRightRDS = loadLockRightRDS;
ReactorNo = reactorNo;
LoadedRDS = loadedRDS;
}
[JsonPropertyName("reactorNo")] public int ReactorNo { get; } // { init; get; }
[JsonPropertyName("loadedRDS")] public int[] LoadedRDS { get; } // { init; get; }
[JsonPropertyName("loadLockLeftRDS")] public int? LoadLockLeftRDS { get; } // { init; get; }
[JsonPropertyName("loadLockRightRDS")] public int? LoadLockRightRDS { get; } // { init; get; }
}