diff --git a/server/machines/mazak/sync/BuildCurrentStatus.cs b/server/machines/mazak/sync/BuildCurrentStatus.cs index d785c8ed..727e839b 100644 --- a/server/machines/mazak/sync/BuildCurrentStatus.cs +++ b/server/machines/mazak/sync/BuildCurrentStatus.cs @@ -363,6 +363,25 @@ DateTime utcNow } } + // add any pallets on hold that are not currently used in any parts + foreach (var pal in palOnHold?.Where(p => p.Value) ?? []) + { + if (!palletsByName.ContainsKey(pal.Key)) + { + palletsByName.Add( + pal.Key, + new PalletStatus() + { + PalletNum = pal.Key, + CurrentPalletLocation = FindPalletLocation(machineGroupName, mazakData, mazakCfg, pal.Key), + FixtureOnPallet = "", + NumFaces = 1, + OnHold = true, + } + ); + } + } + //now queued var seenMatIds = new HashSet(material.Select(m => m.MaterialID)); material.AddRange( diff --git a/server/test/mazak/read-snapshots/basic-no-material.data.json b/server/test/mazak/read-snapshots/basic-no-material.data.json index ad906538..ab8c39ae 100644 --- a/server/test/mazak/read-snapshots/basic-no-material.data.json +++ b/server/test/mazak/read-snapshots/basic-no-material.data.json @@ -174,6 +174,20 @@ "FixtureGroupV2": 4 } ], + "PalletStatuses": [ + { + "PalletNumber": 2, + "IsOnHold": 1 + }, + { + "PalletNumber": 5, + "IsOnHold": 0 + }, + { + "PalletNumber": 15, + "IsOnHold": 1 + } + ], "PalletSubStatuses": [], "PalletPositions": [ { @@ -195,6 +209,10 @@ { "PalletNumber": 5, "PalletPosition": "S005" + }, + { + "PalletNumber": 15, + "PalletPosition": "S015" } ], "LoadActions": [], diff --git a/server/test/mazak/read-snapshots/basic-no-material.status.json b/server/test/mazak/read-snapshots/basic-no-material.status.json index 44cf58e5..cbd972e5 100644 --- a/server/test/mazak/read-snapshots/basic-no-material.status.json +++ b/server/test/mazak/read-snapshots/basic-no-material.status.json @@ -666,13 +666,24 @@ "2": { "PalletNum": 2, "FixtureOnPallet": "F:0:fixtureBB:1", - "OnHold": false, + "OnHold": true, "CurrentPalletLocation": { "loc": "Buffer", "group": "Buffer", "num": 2 }, "NumFaces": 1 + }, + "15": { + "PalletNum": 15, + "FixtureOnPallet": "", + "OnHold": true, + "CurrentPalletLocation": { + "loc": "Buffer", + "group": "Buffer", + "num": 15 + }, + "NumFaces": 1 } }, "Material": [],