From 3fa1fc381278ecb5529718c10da6ee2035025419 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Tue, 9 Dec 2025 11:05:45 -0500 Subject: [PATCH] Add pctypeid-based equipment filtering in editpc.asp, add Genspect machinetype MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit editpc.asp: - Filter equipment dropdown by pctypeid instead of pcMachineTypeId - pctypeid 5 (CMM) -> machinetypeid 3 (CMM) - pctypeid 6 (Wax/Trace) -> machinetypeid 5 (Wax Trace) - pctypeid 7 (Keyence) -> machinetypeid 23 (Measuring Machine) - pctypeid 8 (Genspect) -> machinetypeid 45 (Genspect) - pctypeid 9 (Heat Treat) -> machinetypeid 14 (Furnace) sql/add_genspect_machinetype.sql: - Add Genspect equipment type (machinetypeid 45) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- editpc.asp | 48 +++++++++++++++++++------------- sql/add_genspect_machinetype.sql | 15 ++++++++++ 2 files changed, 44 insertions(+), 19 deletions(-) create mode 100644 sql/add_genspect_machinetype.sql diff --git a/editpc.asp b/editpc.asp index bc7c8f7..b76e4ec 100644 --- a/editpc.asp +++ b/editpc.asp @@ -54,7 +54,7 @@ End If ' Store machine data - Dim serialnumber, hostname, machinenumber, modelid, businessunitid, alias, machinenotes, mapleft, maptop, pcMachineTypeId, currentMachineStatusId + Dim serialnumber, hostname, machinenumber, modelid, businessunitid, alias, machinenotes, mapleft, maptop, pcMachineTypeId, currentMachineStatusId, currentPcTypeId serialnumber = "" : If NOT IsNull(rsMachine("serialnumber")) Then serialnumber = rsMachine("serialnumber") & "" hostname = "" : If NOT IsNull(rsMachine("hostname")) Then hostname = rsMachine("hostname") & "" machinenumber = "" : If NOT IsNull(rsMachine("machinenumber")) Then machinenumber = rsMachine("machinenumber") & "" @@ -65,6 +65,7 @@ mapleft = "" : If NOT IsNull(rsMachine("mapleft")) Then mapleft = rsMachine("mapleft") maptop = "" : If NOT IsNull(rsMachine("maptop")) Then maptop = rsMachine("maptop") pcMachineTypeId = 0 : If NOT IsNull(rsMachine("pcmachinetypeid")) Then pcMachineTypeId = CLng(rsMachine("pcmachinetypeid")) + currentPcTypeId = 0 : If NOT IsNull(rsMachine("pctypeid")) Then currentPcTypeId = CLng(rsMachine("pctypeid")) currentMachineStatusId = "" : If NOT IsNull(rsMachine("machinestatusid")) Then currentMachineStatusId = rsMachine("machinestatusid") rsMachine.Close @@ -587,19 +588,32 @@ Set rsMachineStatus = Nothing <% ' Show filter info for specialized PCs - If pcMachineTypeId = 41 Then - Response.Write(" Filtered to CMM equipment only") - ElseIf pcMachineTypeId = 42 Then - Response.Write(" Filtered to Wax Trace equipment only") - ElseIf pcMachineTypeId = 43 Then - Response.Write(" Filtered to Measuring Machine equipment only") + If filterDescription <> "" Then + Response.Write(" Filtered to " & filterDescription & " equipment only") Else Response.Write("Select a machine that this PC controls") End If diff --git a/sql/add_genspect_machinetype.sql b/sql/add_genspect_machinetype.sql new file mode 100644 index 0000000..a7a0634 --- /dev/null +++ b/sql/add_genspect_machinetype.sql @@ -0,0 +1,15 @@ +-- Add Genspect/EAS1000 equipment type +-- Run on production database +-- Date: 2025-12-09 + +-- Check if Genspect machinetype already exists +SET @genspect_exists = (SELECT COUNT(*) FROM machinetypes WHERE machinetype = 'Genspect'); + +-- Insert only if it doesn't exist +INSERT INTO machinetypes (machinetype, isactive) +SELECT 'Genspect', 1 +FROM dual +WHERE @genspect_exists = 0; + +-- Show result +SELECT machinetypeid, machinetype FROM machinetypes WHERE machinetype = 'Genspect';