Skip to content

Commit

Permalink
mazak: add pallets on hold that have no scheduled jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
wuzzeb committed Nov 12, 2024
1 parent 0589344 commit 33d8ef3
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
19 changes: 19 additions & 0 deletions server/machines/mazak/sync/BuildCurrentStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<long>(material.Select(m => m.MaterialID));
material.AddRange(
Expand Down
18 changes: 18 additions & 0 deletions server/test/mazak/read-snapshots/basic-no-material.data.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,20 @@
"FixtureGroupV2": 4
}
],
"PalletStatuses": [
{
"PalletNumber": 2,
"IsOnHold": 1
},
{
"PalletNumber": 5,
"IsOnHold": 0
},
{
"PalletNumber": 15,
"IsOnHold": 1
}
],
"PalletSubStatuses": [],
"PalletPositions": [
{
Expand All @@ -195,6 +209,10 @@
{
"PalletNumber": 5,
"PalletPosition": "S005"
},
{
"PalletNumber": 15,
"PalletPosition": "S015"
}
],
"LoadActions": [],
Expand Down
13 changes: 12 additions & 1 deletion server/test/mazak/read-snapshots/basic-no-material.status.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand Down

0 comments on commit 33d8ef3

Please sign in to comment.