From 908b668bdee5a69cd03f62ff23e2353a7f8b59c5 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Wed, 13 May 2026 10:17:24 -0400 Subject: [PATCH] shopfloor: instrument 09-Setup-CMM, Common, Heattreat with Send-PxeStatus Wires the imaging-progress helper into the three PC-type setup scripts that were either clean (CMM) or untracked (Common, Heattreat). Each gains two calls per the pattern committed for Keyence in 9122b28: * idx 5/8 - "09-Setup-: starting" right after the session start banner * idx 6/8 - "09-Setup-: complete" just before the completion banner Display, Genspect, and WaxAndTrace also got the same two-line additions locally and on the live server, but those files have pre-existing WIP edits intermixed so they aren't staged here. They'll travel along when the operator commits their unrelated shopfloor work. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../gea-shopfloor-cmm/09-Setup-CMM.ps1 | 9 +++++++ .../gea-shopfloor-common/09-Setup-Common.ps1 | 24 +++++++++++++++++++ .../09-Setup-Heattreat.ps1 | 22 +++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 playbook/shopfloor-setup/gea-shopfloor-common/09-Setup-Common.ps1 create mode 100644 playbook/shopfloor-setup/gea-shopfloor-heattreat/09-Setup-Heattreat.ps1 diff --git a/playbook/shopfloor-setup/gea-shopfloor-cmm/09-Setup-CMM.ps1 b/playbook/shopfloor-setup/gea-shopfloor-cmm/09-Setup-CMM.ps1 index 6ff926b..8edaae2 100644 --- a/playbook/shopfloor-setup/gea-shopfloor-cmm/09-Setup-CMM.ps1 +++ b/playbook/shopfloor-setup/gea-shopfloor-cmm/09-Setup-CMM.ps1 @@ -52,6 +52,12 @@ Write-CMMLog "=== CMM Setup (imaging-time) session start (PID $PID) ===" Write-CMMLog "Running as: $([System.Security.Principal.WindowsIdentity]::GetCurrent().Name)" Write-CMMLog "================================================================" +# Status push to PXE webapp - best-effort, never blocks imaging. +$pxeStatusLib = Join-Path $PSScriptRoot '..\Shopfloor\lib\Send-PxeStatus.ps1' +if (Test-Path $pxeStatusLib) { + try { . $pxeStatusLib; Send-PxeStatus -Stage '09-Setup-CMM: starting' -StageIndex 5 -StageTotal 8 } catch { } +} + # Diagnostic dump - knowing WHY the script took a branch is half the battle. Write-CMMLog "Script root: $PSScriptRoot" foreach ($file in @('pc-type.txt','pc-subtype.txt','machine-number.txt')) { @@ -172,5 +178,8 @@ if (Test-Path $stagingRoot) { } } +if (Get-Command Send-PxeStatus -ErrorAction SilentlyContinue) { + Send-PxeStatus -Stage '09-Setup-CMM: complete' -StageIndex 6 -StageTotal 8 +} Write-CMMLog "=== CMM Setup Complete ===" try { Stop-Transcript | Out-Null } catch {} diff --git a/playbook/shopfloor-setup/gea-shopfloor-common/09-Setup-Common.ps1 b/playbook/shopfloor-setup/gea-shopfloor-common/09-Setup-Common.ps1 new file mode 100644 index 0000000..e8c3ff4 --- /dev/null +++ b/playbook/shopfloor-setup/gea-shopfloor-common/09-Setup-Common.ps1 @@ -0,0 +1,24 @@ +# 09-Setup-Common.ps1 - common pc-type setup +# +# common = OpenText-only shopfloor PC. No UDC (collections-only), +# no eDNC (collections + nocollections only). OpenText installs in +# the preinstall phase via Setup-OpenText.ps1; this script just adds +# the auto-start so HostExplorer's "WJ Shopfloor" session launches +# at every login. + +$lib = Join-Path $PSScriptRoot '..\Shopfloor\lib\Set-OpenTextAutoStart.ps1' + +Write-Host '=== Common Setup ===' +$pxeStatusLib = Join-Path $PSScriptRoot '..\Shopfloor\lib\Send-PxeStatus.ps1' +if (Test-Path $pxeStatusLib) { + try { . $pxeStatusLib; Send-PxeStatus -Stage '09-Setup-Common: starting' -StageIndex 5 -StageTotal 8 } catch { } +} +if (Test-Path -LiteralPath $lib) { + & $lib +} else { + Write-Warning "Set-OpenTextAutoStart.ps1 not found at $lib - OpenText auto-start NOT configured" +} +if (Get-Command Send-PxeStatus -ErrorAction SilentlyContinue) { + Send-PxeStatus -Stage '09-Setup-Common: complete' -StageIndex 6 -StageTotal 8 +} +Write-Host '=== Common Setup Complete ===' diff --git a/playbook/shopfloor-setup/gea-shopfloor-heattreat/09-Setup-Heattreat.ps1 b/playbook/shopfloor-setup/gea-shopfloor-heattreat/09-Setup-Heattreat.ps1 new file mode 100644 index 0000000..c18b35f --- /dev/null +++ b/playbook/shopfloor-setup/gea-shopfloor-heattreat/09-Setup-Heattreat.ps1 @@ -0,0 +1,22 @@ +# 09-Setup-Heattreat.ps1 - Heattreat pc-type setup +# +# Currently OpenText-only (same as common). Heattreat-specific software +# will be added here when the application catalog is finalized. + +$lib = Join-Path $PSScriptRoot '..\Shopfloor\lib\Set-OpenTextAutoStart.ps1' + +Write-Host '=== Heattreat Setup ===' +$pxeStatusLib = Join-Path $PSScriptRoot '..\Shopfloor\lib\Send-PxeStatus.ps1' +if (Test-Path $pxeStatusLib) { + try { . $pxeStatusLib; Send-PxeStatus -Stage '09-Setup-Heattreat: starting' -StageIndex 5 -StageTotal 8 } catch { } +} +if (Test-Path -LiteralPath $lib) { + & $lib +} else { + Write-Warning "Set-OpenTextAutoStart.ps1 not found at $lib - OpenText auto-start NOT configured" +} +# TODO: Heattreat-specific apps go here. +if (Get-Command Send-PxeStatus -ErrorAction SilentlyContinue) { + Send-PxeStatus -Stage '09-Setup-Heattreat: complete' -StageIndex 6 -StageTotal 8 +} +Write-Host '=== Heattreat Setup Complete ==='