Add Heat Treat detection and PC type filter

- PowerShell scripts: Add Heat Treat detection to Update-PC-Minimal.ps1
  and Update-ShopfloorPCs-Remote.ps1 with proper priority chain
  (CMM > Wax Trace > Keyence > EAS1000 > Genspect > Heat Treat > Shopfloor)
- displaypcs.asp: Add PC Type dropdown filter using pctypeid
- displaypcs.asp: Fix SQL spacing issues in WHERE clause filters

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
cproudlock
2025-12-09 09:23:40 -05:00
parent 9f58adaf19
commit 01d4aae38d
3 changed files with 66 additions and 15 deletions

View File

@@ -282,6 +282,8 @@ $hasDODA = $false
$hasFormStatusMonitor = $false
$hasGageCal = $false
$hasNISoftware = $false
$hasGenspect = $false
$hasHeatTreat = $false
try {
$regPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*",
@@ -336,6 +338,8 @@ try {
"Keyence VR Series" { $hasKeyence = $true }
"GageCal" { $hasGageCal = $true }
"NI Software" { $hasNISoftware = $true }
"Genspect" { $hasGenspect = $true }
"HeatTreat" { $hasHeatTreat = $true }
}
}
break
@@ -419,7 +423,7 @@ if ($matchedApps.Count -gt 0) {
}
# Set PC type based on application detection
# Priority: CMM > Wax Trace > Keyence > EAS1000 > Part Marker > Generic hint > default Measuring
# Priority: CMM > Wax Trace > Keyence > EAS1000 > Genspect > Heat Treat > Generic hint > default Shopfloor
$isCMM = ($hasPcDmis -or $hasGoCMM -or $hasDODA)
$isWaxTrace = ($hasFormTracePak -or $hasFormStatusMonitor)
$isEAS1000 = ($hasGageCal -or $hasNISoftware)
@@ -446,12 +450,19 @@ if ($isCMM) {
if ($hasGageCal) { $detected += "GageCal" }
if ($hasNISoftware) { $detected += "NI Software" }
"PC Type set to: EAS1000 ($($detected -join ', '))" | Tee-Object -FilePath $logFile -Append
} elseif ($hasGenspect) {
$data.pcType = "Genspect"
"PC Type set to: Genspect" | Tee-Object -FilePath $logFile -Append
} elseif ($hasHeatTreat) {
$data.pcType = "Heat Treat"
"PC Type set to: Heat Treat" | Tee-Object -FilePath $logFile -Append
} elseif ($script:genericTypeHint) {
# Use generic machine number hint when no software detected
$data.pcType = $script:genericTypeHint
"PC Type set to: $($script:genericTypeHint) (from generic machine # - requires manual assignment)" | Tee-Object -FilePath $logFile -Append
} else {
"No specialized apps detected, keeping type: $($data.pcType)" | Tee-Object -FilePath $logFile -Append
$data.pcType = "Shopfloor"
"No specialized apps detected, defaulting to: Shopfloor" | Tee-Object -FilePath $logFile -Append
}
# Send to API

View File

@@ -498,6 +498,7 @@ function Get-RemotePCInfo {
@{ app_id = 73; app_name = "goCMM"; patterns = @("goCMM") }
@{ app_id = 74; app_name = "DODA"; patterns = @("Dovetail Digital Analysis", "DODA") }
@{ app_id = 75; app_name = "FormStatusMonitor"; patterns = @("FormStatusMonitor") }
@{ app_id = 77; app_name = "HeatTreat"; patterns = @("HeatTreat") }
)
$matchedApps = @()
@@ -605,7 +606,7 @@ function Get-RemotePCInfo {
$result.HasNISoftware = $hasNISoftware
$result.IsEAS1000 = ($hasGageCal -or $hasNISoftware)
# Genspect Detection (could be Keyence or EAS1000)
# Genspect Detection
$hasGenspect = $false
foreach ($app in $installedApps) {
if ($app -match "^Genspect") {
@@ -615,9 +616,19 @@ function Get-RemotePCInfo {
}
$result.HasGenspect = $hasGenspect
# Heat Treat Detection
$hasHeatTreat = $false
foreach ($app in $installedApps) {
if ($app -match "^HeatTreat") {
$hasHeatTreat = $true
break
}
}
$result.HasHeatTreat = $hasHeatTreat
# Determine PC Type based on detected software
# Priority: CMM > Wax Trace > Keyence > EAS1000 > Generic hint > Measuring (default)
$detectedPcType = "Measuring" # Default for shopfloor PCs
# Priority: CMM > Wax Trace > Keyence > EAS1000 > Genspect > Heat Treat > Generic hint > Shopfloor (default)
$detectedPcType = "Shopfloor" # Default for shopfloor PCs
if ($result.IsCMM) {
$detectedPcType = "CMM"
} elseif ($result.IsWaxTrace) {
@@ -626,6 +637,10 @@ function Get-RemotePCInfo {
$detectedPcType = "Keyence"
} elseif ($result.IsEAS1000) {
$detectedPcType = "EAS1000"
} elseif ($hasGenspect) {
$detectedPcType = "Genspect"
} elseif ($hasHeatTreat) {
$detectedPcType = "Heat Treat"
} elseif ($result.GenericTypeHint) {
# Use generic machine number hint when no software detected
$detectedPcType = $result.GenericTypeHint
@@ -910,6 +925,7 @@ foreach ($result in $results) {
if ($result.HasGageCal) { $detectedSoftware += "GageCal" }
if ($result.HasNISoftware) { $detectedSoftware += "NI Software" }
if ($result.HasGenspect) { $detectedSoftware += "Genspect" }
if ($result.HasHeatTreat) { $detectedSoftware += "HeatTreat" }
$softwareStr = if ($detectedSoftware.Count -gt 0) { " (" + ($detectedSoftware -join ", ") + ")" } else { "" }
Write-Log " PC Type: $($result.DetectedPcType)$softwareStr" -Level "INFO"