added CHRON_ID to LOT_EVENT table to have a sequential integer for debugging

This commit is contained in:
Infineon\StieberD
2025-08-13 15:53:30 -07:00
parent a094971d7d
commit adc247fd4c
3 changed files with 34 additions and 23 deletions

View File

@ -32,7 +32,8 @@ DataFields := "EVENT_BEGIN_WAFER_QTY" :@VM:SQL_Format(Rec(LOT_EVENT_EVENT_BEGIN
DataFields := "EVENT_END_WAFER_QTY" :@VM:SQL_Format(Rec(LOT_EVENT_EVENT_END_WAFER_QTY$), "INT"):@FM
DataFields := "EVENT_OPERATION_ID" :@VM:SQL_Format(Rec(LOT_EVENT_EVENT_OPERATION_ID$), "STR"):@FM
DataFields := "EVENT_OPERATOR_ID" :@VM:SQL_Format(Rec(LOT_EVENT_EVENT_OPERATOR_ID$), "STR"):@FM
DataFields := "SEQUENCE" :@VM:SQL_Format(Rec(LOT_EVENT_SEQUENCE$), "INT")
DataFields := "SEQUENCE" :@VM:SQL_Format(Rec(LOT_EVENT_SEQUENCE$), "INT"):@FM
DataFields := "CHRON_ID" :@VM:SQL_Format(Rec(LOT_EVENT_CHRON_ID$), "INT")
// Symbolics
@ -43,3 +44,4 @@ Ans = SQL_Write(Connection, "LOT_EVENT", Keys, DataFields);
// Multi-valued Fields
Return Ans

View File

@ -55,7 +55,7 @@ $Insert LOT_EQUATES
$Insert LOT_OPERATION_EQUATES
Declare function Error_Services, Logging_Services, Environment_Services, Database_Services, RTI_CreateGUID
Declare function Lot_Event_Services, Lot_Services
Declare function Lot_Event_Services, Lot_Services, NextKey
Declare subroutine Error_Services, Logging_Services, Database_Services, Lot_Services, Service_Services
Declare subroutine Transaction_Services
@ -92,6 +92,8 @@ Service CreateLotEvent(LotId, EventDateTime, EventType=EVENT_TYPES, EventNote, E
CurrLotOperation = Lot_Services('GetLotCurrOperationId', LotId)
NewEventId = RTI_CreateGUID()
If NewEventId NE '' then
NextEventChronId = NextKey('LOT_EVENT')
If NextEventChronId NE 0 then
NewEventSequence = Lot_Event_Services('GetLotEventNextSequence', LotId)
If Error_Services('NoError') then
NewEventRec = ''
@ -103,6 +105,7 @@ Service CreateLotEvent(LotId, EventDateTime, EventType=EVENT_TYPES, EventNote, E
NewEventRec<LOT_EVENT_EQUIPMENT_ID$> = EventEquipmentId
NewEventRec<LOT_EVENT_EVENT_OPERATOR_ID$> = OperatorId
NewEventRec<LOT_EVENT_SEQUENCE$> = NewEventSequence
NewEventRec<LOT_EVENT_CHRON_ID$> = NextEventChronId
Database_Services('WriteDataRow', 'LOT_EVENT', NewEventId, NewEventRec)
If Error_Services('NoError') then
Transaction_Services('PostWriteFieldTransaction', 'LOT', LotId, LOT_MOST_RECENT_LOT_EVENT_ID$, NewEventId)
@ -113,6 +116,9 @@ Service CreateLotEvent(LotId, EventDateTime, EventType=EVENT_TYPES, EventNote, E
end else
ErrorMessage = Error_Services('GetMessage')
end
end else
ErrorMessage = 'Error creating new event. Error calling NextKey("LOT_EVENT") to get LOT_EVENT_CHRON_ID.'
end
end else
ErrorMessage = 'Error creating an event Id.'
end
@ -236,3 +242,4 @@ return

View File

@ -19,5 +19,7 @@ compile insert LOT_EVENT_EQUATES
equ LOT_EVENT_EVENT_OPERATION_ID$ to 10
equ LOT_EVENT_EVENT_OPERATOR_ID$ to 11
equ LOT_EVENT_SEQUENCE$ to 12
equ LOT_EVENT_CHRON_ID$ to 13
#endif