Merged PR 11840: Added MFS logic to ensure notes data cannot be removed.
Added MFS logic to ensure notes data cannot be removed. Related work items: #231781
This commit is contained in:
parent
15495aa7ef
commit
6fd0d30717
@ -59,7 +59,7 @@ $Insert WO_MAT_QA_EQUATES
|
||||
Equ WOCust$ to 2
|
||||
Equ Comma$ to ','
|
||||
|
||||
Declare function Error_Services, Database_Services, Logging_Services, Environment_Services, Nica_Orders_Services
|
||||
Declare function Error_Services, Database_Services, Logging_Services, Environment_Services, Nica_Orders_Services, SRP_Sort_Array
|
||||
Declare subroutine Error_Services, Database_Services, Logging_Services, Set_Status, Reactor_Log_Services, Rds_Services
|
||||
Declare subroutine Nica_Orders_Services
|
||||
|
||||
@ -142,65 +142,81 @@ READONLY_RECORD:
|
||||
return
|
||||
|
||||
WRITE_RECORD_PRE:
|
||||
|
||||
OrigROTRFlag = OrigRecord<REACTOR_LOG_ROTR$>
|
||||
NewROTRFlag = Record<REACTOR_LOG_ROTR$>
|
||||
|
||||
ReactNo = Record<REACTOR_LOG_REACTOR$>
|
||||
StopRDS = Xlate('REACT_STATE', ReactNo, 'LAST_RDS_NO', 'X')
|
||||
|
||||
OrigWafersRemoved = OrigRecord<REACTOR_LOG_WAFERS_REMOVED$>
|
||||
NewWafersRemoved = Record<REACTOR_LOG_WAFERS_REMOVED$>
|
||||
|
||||
If (Not(OrigROTRFlag) and NewROTRFlag EQ True$) or (Not(OrigWafersRemoved) and NewWafersRemoved) then
|
||||
If ReactNo NE '' then
|
||||
ReactRec = Database_Services('ReadDataRow', 'REACTOR', ReactNo)
|
||||
ReactRec<REACTOR_ROTR_STOP_RDS$> = StopRDS
|
||||
Database_Services('WriteDataRow', 'REACTOR', ReactNo, ReactRec, True$, False$, True$)
|
||||
ActionFlow = ACTION_CONTINUE$
|
||||
//Ensures notes are not deleted
|
||||
OrigNotes = OrigRecord<REACTOR_LOG_NOTES$>
|
||||
UpdatedNotes = Record<REACTOR_LOG_NOTES$>
|
||||
for each OrigNote in OrigNotes using @VM setting NotePos
|
||||
If OrigNote NE UpdatedNotes<1, NotePos> then
|
||||
Error_Services('Add', 'Notes content error.')
|
||||
OrigFileError = 104:': Notes content error.'
|
||||
Status = 0
|
||||
Record = ''
|
||||
ActionFlow = ACTION_STOP$
|
||||
end
|
||||
until ActionFlow EQ ACTION_STOP$
|
||||
Next UpdatedNote
|
||||
|
||||
If ActionFlow NE ACTION_STOP$ then
|
||||
OrigROTRFlag = OrigRecord<REACTOR_LOG_ROTR$>
|
||||
UpdatedROTRFlag = OrigRecord<REACTOR_LOG_ROTR$>
|
||||
NewROTRFlag = Record<REACTOR_LOG_ROTR$>
|
||||
|
||||
ReactNo = Record<REACTOR_LOG_REACTOR$>
|
||||
StopRDS = Xlate('REACT_STATE', ReactNo, 'LAST_RDS_NO', 'X')
|
||||
|
||||
OrigWafersRemoved = OrigRecord<REACTOR_LOG_WAFERS_REMOVED$>
|
||||
NewWafersRemoved = Record<REACTOR_LOG_WAFERS_REMOVED$>
|
||||
|
||||
If (Not(OrigROTRFlag) and NewROTRFlag EQ True$) or (Not(OrigWafersRemoved) and NewWafersRemoved) then
|
||||
If ReactNo NE '' then
|
||||
ReactRec = Database_Services('ReadDataRow', 'REACTOR', ReactNo)
|
||||
ReactRec<REACTOR_ROTR_STOP_RDS$> = StopRDS
|
||||
Database_Services('WriteDataRow', 'REACTOR', ReactNo, ReactRec, True$, False$, True$)
|
||||
end
|
||||
end
|
||||
|
||||
RdsKeys = Record<REACTOR_LOG_WAFERS_REMOVED_RDS$>
|
||||
|
||||
If (Not(OrigWafersRemoved)) and (NewWafersRemoved EQ True$) and (ReactNo NE '') and (RdsKeys NE '') then
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\ReactorLog'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : 'Wafers Removed Log.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'ReactorNo' : @FM : 'Notes'
|
||||
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$, True$)
|
||||
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
// Log metrology modification attempt
|
||||
Swap @VM with ',' in RdsKeys
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<2> = ReactNo
|
||||
LogData<3> = 'Wafers removed from reactor, ReactorLog ':Name:'. Attempting to apply abort metrology on RdsKeys ':RdsKeys:'.'
|
||||
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
||||
|
||||
Swap ',' with @FM in RdsKeys
|
||||
Rds_Services('ApplyAbortMetrology', RdsKeys)
|
||||
If Error_Services('HasError') then
|
||||
// Log failure
|
||||
ErrorMsg = Error_Services('GetMessage')
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<2> = ReactNo
|
||||
LogData<3> = 'Error applying abort metrology. Error message: ':ErrorMsg
|
||||
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
||||
end else
|
||||
// Log success
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<2> = ReactNo
|
||||
LogData<3> = 'Successfully applied abort metrology'
|
||||
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
RdsKeys = Record<REACTOR_LOG_WAFERS_REMOVED_RDS$>
|
||||
|
||||
If (Not(OrigWafersRemoved)) and (NewWafersRemoved EQ True$) and (ReactNo NE '') and (RdsKeys NE '') then
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\ReactorLog'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : 'Wafers Removed Log.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'ReactorNo' : @FM : 'Notes'
|
||||
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$, True$)
|
||||
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
// Log metrology modification attempt
|
||||
Swap @VM with ',' in RdsKeys
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<2> = ReactNo
|
||||
LogData<3> = 'Wafers removed from reactor, ReactorLog ':Name:'. Attempting to apply abort metrology on RdsKeys ':RdsKeys:'.'
|
||||
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
||||
|
||||
Swap ',' with @FM in RdsKeys
|
||||
Rds_Services('ApplyAbortMetrology', RdsKeys)
|
||||
If Error_Services('HasError') then
|
||||
// Log failure
|
||||
ErrorMsg = Error_Services('GetMessage')
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<2> = ReactNo
|
||||
LogData<3> = 'Error applying abort metrology. Error message: ':ErrorMsg
|
||||
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
||||
end else
|
||||
// Log success
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDtm
|
||||
LogData<2> = ReactNo
|
||||
LogData<3> = 'Successfully applied abort metrology'
|
||||
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
||||
end
|
||||
end
|
||||
|
||||
return
|
||||
|
||||
WRITE_RECORD:
|
||||
@ -377,3 +393,4 @@ Restore_System_Variables:
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user