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_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_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 := "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 // Symbolics
@ -43,3 +44,4 @@ Ans = SQL_Write(Connection, "LOT_EVENT", Keys, DataFields);
// Multi-valued Fields // Multi-valued Fields
Return Ans Return Ans

View File

@ -55,7 +55,7 @@ $Insert LOT_EQUATES
$Insert LOT_OPERATION_EQUATES $Insert LOT_OPERATION_EQUATES
Declare function Error_Services, Logging_Services, Environment_Services, Database_Services, RTI_CreateGUID 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 Error_Services, Logging_Services, Database_Services, Lot_Services, Service_Services
Declare subroutine Transaction_Services Declare subroutine Transaction_Services
@ -92,27 +92,33 @@ Service CreateLotEvent(LotId, EventDateTime, EventType=EVENT_TYPES, EventNote, E
CurrLotOperation = Lot_Services('GetLotCurrOperationId', LotId) CurrLotOperation = Lot_Services('GetLotCurrOperationId', LotId)
NewEventId = RTI_CreateGUID() NewEventId = RTI_CreateGUID()
If NewEventId NE '' then If NewEventId NE '' then
NewEventSequence = Lot_Event_Services('GetLotEventNextSequence', LotId) NextEventChronId = NextKey('LOT_EVENT')
If Error_Services('NoError') then If NextEventChronId NE 0 then
NewEventRec = '' NewEventSequence = Lot_Event_Services('GetLotEventNextSequence', LotId)
NewEventRec<LOT_EVENT_LOT_ID$> = LotId If Error_Services('NoError') then
NewEventRec<LOT_EVENT_LOT_EVENT_TYPE$> = EventType NewEventRec = ''
NewEventRec<LOT_EVENT_EVENT_DATETIME$> = EventDatetime NewEventRec<LOT_EVENT_LOT_ID$> = LotId
NewEventRec<LOT_EVENT_EVENT_NOTE$> = EventNote NewEventRec<LOT_EVENT_LOT_EVENT_TYPE$> = EventType
NewEventRec<LOT_EVENT_EVENT_OPERATION_ID$> = CurrLotOperation NewEventRec<LOT_EVENT_EVENT_DATETIME$> = EventDatetime
NewEventRec<LOT_EVENT_EQUIPMENT_ID$> = EventEquipmentId NewEventRec<LOT_EVENT_EVENT_NOTE$> = EventNote
NewEventRec<LOT_EVENT_EVENT_OPERATOR_ID$> = OperatorId NewEventRec<LOT_EVENT_EVENT_OPERATION_ID$> = CurrLotOperation
NewEventRec<LOT_EVENT_SEQUENCE$> = NewEventSequence NewEventRec<LOT_EVENT_EQUIPMENT_ID$> = EventEquipmentId
Database_Services('WriteDataRow', 'LOT_EVENT', NewEventId, NewEventRec) NewEventRec<LOT_EVENT_EVENT_OPERATOR_ID$> = OperatorId
If Error_Services('NoError') then NewEventRec<LOT_EVENT_SEQUENCE$> = NewEventSequence
Transaction_Services('PostWriteFieldTransaction', 'LOT', LotId, LOT_MOST_RECENT_LOT_EVENT_ID$, NewEventId) NewEventRec<LOT_EVENT_CHRON_ID$> = NextEventChronId
If Error_Services('HasError') then ErrorMessage = Error_Services('GetMessage') Database_Services('WriteDataRow', 'LOT_EVENT', NewEventId, NewEventRec)
end else If Error_Services('NoError') then
ErrorMessage = 'Error creating new event : ' : Error_Services('GetMessage') Transaction_Services('PostWriteFieldTransaction', 'LOT', LotId, LOT_MOST_RECENT_LOT_EVENT_ID$, NewEventId)
end If Error_Services('HasError') then ErrorMessage = Error_Services('GetMessage')
end else end else
ErrorMessage = Error_Services('GetMessage') ErrorMessage = 'Error creating new event : ' : Error_Services('GetMessage')
end end
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 end else
ErrorMessage = 'Error creating an event Id.' ErrorMessage = 'Error creating an event Id.'
end 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_OPERATION_ID$ to 10
equ LOT_EVENT_EVENT_OPERATOR_ID$ to 11 equ LOT_EVENT_EVENT_OPERATOR_ID$ to 11
equ LOT_EVENT_SEQUENCE$ to 12 equ LOT_EVENT_SEQUENCE$ to 12
equ LOT_EVENT_CHRON_ID$ to 13
#endif #endif