Add pctypeid-based equipment filtering in editpc.asp, add Genspect machinetype
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 <noreply@anthropic.com>
This commit is contained in:
48
editpc.asp
48
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
|
||||
<select class="form-control" id="controllingpc" name="controllingpc">
|
||||
<option value="">-- None --</option>
|
||||
<%
|
||||
' Filter controlled machines based on PC type
|
||||
' PC - CMM (41) -> CMM equipment (machinetypeid 3)
|
||||
' PC - Wax Trace (42) -> Wax Trace equipment (machinetypeid 5)
|
||||
' PC - Measuring Tool (43) -> Measuring Machine equipment (machinetypeid 23)
|
||||
Dim rsControlPCs, equipmentTypeFilter
|
||||
' Filter controlled machines based on pctypeid
|
||||
' pctypeid 5 (CMM) -> CMM equipment (machinetypeid 3)
|
||||
' pctypeid 6 (Wax/Trace) -> Wax Trace equipment (machinetypeid 5)
|
||||
' pctypeid 7 (Keyence) -> Measuring Machine equipment (machinetypeid 23)
|
||||
' pctypeid 8 (Genspect/EAS1000) -> Measuring Machine equipment (machinetypeid 23)
|
||||
' pctypeid 9 (Heat Treat) -> Furnace equipment (machinetypeid 14)
|
||||
' pctypeid 10 (Part Marker) -> no filter (show all equipment)
|
||||
Dim rsControlPCs, equipmentTypeFilter, filterDescription
|
||||
equipmentTypeFilter = ""
|
||||
Select Case pcMachineTypeId
|
||||
Case 41
|
||||
equipmentTypeFilter = " AND m.machinetypeid = 3" ' CMM
|
||||
Case 42
|
||||
equipmentTypeFilter = " AND m.machinetypeid = 5" ' Wax Trace
|
||||
Case 43
|
||||
equipmentTypeFilter = " AND m.machinetypeid = 23" ' Measuring Machine
|
||||
filterDescription = ""
|
||||
Select Case currentPcTypeId
|
||||
Case 5
|
||||
equipmentTypeFilter = " AND m.machinetypeid = 3"
|
||||
filterDescription = "CMM"
|
||||
Case 6
|
||||
equipmentTypeFilter = " AND m.machinetypeid = 5"
|
||||
filterDescription = "Wax Trace"
|
||||
Case 7
|
||||
equipmentTypeFilter = " AND m.machinetypeid = 23"
|
||||
filterDescription = "Keyence/Measuring Machine"
|
||||
Case 8
|
||||
equipmentTypeFilter = " AND m.machinetypeid = 45"
|
||||
filterDescription = "Genspect/EAS1000"
|
||||
Case 9
|
||||
equipmentTypeFilter = " AND m.machinetypeid = 14"
|
||||
filterDescription = "Furnace (Heat Treat)"
|
||||
End Select
|
||||
strSQL = "SELECT m.machineid, m.machinenumber, m.alias FROM machines m " &_
|
||||
"LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid " &_
|
||||
@@ -627,12 +641,8 @@ Set rsMachineStatus = Nothing
|
||||
</select>
|
||||
<%
|
||||
' Show filter info for specialized PCs
|
||||
If pcMachineTypeId = 41 Then
|
||||
Response.Write("<small class='form-text text-info'><i class='zmdi zmdi-filter-list'></i> Filtered to CMM equipment only</small>")
|
||||
ElseIf pcMachineTypeId = 42 Then
|
||||
Response.Write("<small class='form-text text-info'><i class='zmdi zmdi-filter-list'></i> Filtered to Wax Trace equipment only</small>")
|
||||
ElseIf pcMachineTypeId = 43 Then
|
||||
Response.Write("<small class='form-text text-info'><i class='zmdi zmdi-filter-list'></i> Filtered to Measuring Machine equipment only</small>")
|
||||
If filterDescription <> "" Then
|
||||
Response.Write("<small class='form-text text-info'><i class='zmdi zmdi-filter-list'></i> Filtered to " & filterDescription & " equipment only</small>")
|
||||
Else
|
||||
Response.Write("<small class='form-text text-muted'>Select a machine that this PC controls</small>")
|
||||
End If
|
||||
|
||||
15
sql/add_genspect_machinetype.sql
Normal file
15
sql/add_genspect_machinetype.sql
Normal file
@@ -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';
|
||||
Reference in New Issue
Block a user