Initial addition for Test Wafer Tracking Phase 2
Includes services and functions to create new test wafer lot. Tables included outside of git push New Tables: 1. LOT 2. LOT_EVENT 3. LOT_OPERATION 4. PRODUCT_OPERATION 5. OPERATION 6. Added PRODUCT_OPERATIONS field in TEST_WAFER_PROD table. All relational indexes and btree indexes.
This commit is contained in:
parent
f2a8ce4116
commit
9651c48539
3214
LSL2/OIWIN/NDW_LOG_TEST_WAFER_USAGE.json
Normal file
3214
LSL2/OIWIN/NDW_LOG_TEST_WAFER_USAGE.json
Normal file
File diff suppressed because it is too large
Load Diff
1912
LSL2/OIWIN/NDW_TW_LOT_CREATE.json
Normal file
1912
LSL2/OIWIN/NDW_TW_LOT_CREATE.json
Normal file
File diff suppressed because it is too large
Load Diff
2592
LSL2/OIWIN/NDW_VIEW_LOT.json
Normal file
2592
LSL2/OIWIN/NDW_VIEW_LOT.json
Normal file
File diff suppressed because it is too large
Load Diff
1004
LSL2/OIWIN/TW_LOT_CREATE.json
Normal file
1004
LSL2/OIWIN/TW_LOT_CREATE.json
Normal file
File diff suppressed because it is too large
Load Diff
148
LSL2/STPROC/CREATENEWTESTWAFERLOT_API.txt
Normal file
148
LSL2/STPROC/CREATENEWTESTWAFERLOT_API.txt
Normal file
@ -0,0 +1,148 @@
|
||||
Function Createnewtestwaferlot_API(@API)
|
||||
/***********************************************************************************************************************
|
||||
|
||||
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
|
||||
permission from SRP Computer Solutions, Inc.
|
||||
|
||||
Name : Createnewtestwaferlot_API
|
||||
|
||||
Description : API logic for the Createnewtestwaferlot resource.
|
||||
|
||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
||||
|
||||
HTTPMethod - The HTTP Method (Verb) submitted by the client (e.g., GET, POST, etc.)
|
||||
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||
FullEndpointURL - The URL submitted by the client, including query params.
|
||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||
EndpointSegment - The URL endpoint segment.
|
||||
ParentURL - The URL path preceeding the current endpoint.
|
||||
CurrentAPI - The name of this stored procedure.
|
||||
|
||||
Parameters :
|
||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||
- APIPattern must follow this structure Createnewtestwaferlot[.ID.[<Property>]]
|
||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||
Examples:
|
||||
- Createnewtestwaferlot.POST
|
||||
- Createnewtestwaferlot.ID.PUT
|
||||
- Createnewtestwaferlot.ID.firstName.GET
|
||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
||||
services do not rely upon anything being returned in the response. This is what the
|
||||
various services like SetResponseBody and SetResponseStatus services are for. A response
|
||||
value is only helpful if the developers want to use it for debug purposes.
|
||||
|
||||
History : (Date, Initials, Notes)
|
||||
10/21/24 xxx Original programmer.
|
||||
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
Declare function OI_Wizard_Services, Lot_Services
|
||||
|
||||
$insert APP_INSERTS
|
||||
$insert API_SETUP
|
||||
$insert HTTP_INSERTS
|
||||
$Insert OI_Wizard_Equates
|
||||
|
||||
GoToAPI else
|
||||
// The specific resource endpoint doesn't have a API handler yet.
|
||||
HTTP_Services('SetResponseStatus', 204, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||
end
|
||||
|
||||
Return Response OR ''
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Endpoint Handlers
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
API createnewtestwaferlot.POST
|
||||
//LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, VendorCode, Username, PrinterID
|
||||
OIWizardID = ''
|
||||
Cookies = HTTP_Services('GetHTTPCookie')
|
||||
For each Cookie in Cookies using ';'
|
||||
Key = Field(Cookie, '=', 1)
|
||||
If Key EQ 'sessionID' then
|
||||
OIWizardID = Field(Cookie, '=', 2)
|
||||
end
|
||||
Next Cookie
|
||||
|
||||
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
||||
If ValidSession then
|
||||
// Check if payload has the required information to create a react mode change record
|
||||
Body = HTTP_Services('GetHTTPPostString')
|
||||
If Body NE '' then
|
||||
// The POST string will have been encoded so use percent (URL) decoding.
|
||||
//ReactModeJSON = HTTP_Services('DecodePercentString', Body)
|
||||
NewTWLotJson = HTTP_Services('DecodePercentString', Body)
|
||||
ParseResponse = SRP_JSON(hNewTWLotJson, 'PARSE', NewTWLotJson)
|
||||
|
||||
If (ParseResponse EQ '') then
|
||||
TWLotObject = ''
|
||||
TWLotObject = SRP_JSON(hNewTWLotJson, 'Get', 'NewTWLot')
|
||||
LotType = 'TW'
|
||||
ProdName = SRP_JSON(TWLotObject, 'GetValue', 'ProdName')
|
||||
LotQty = SRP_JSON(TWLotObject, 'GetValue', 'LotQty')
|
||||
VendorPartNo = SRP_JSON(TWLotObject, 'GetValue', 'VendorPartNo')
|
||||
VendorLotNo = SRP_JSON(TWLotObject, 'GetValue', 'VendorLotNo')
|
||||
VendorCode = SRP_JSON(TWLotObject, 'GetValue', 'VendorCode')
|
||||
Username = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X')
|
||||
PrinterID = 'WEB'
|
||||
SRP_JSON(TWLotObject, 'Release')
|
||||
LotId = Lot_Services('CreateNewTestWaferLot', LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, VendorCode, Username, PrinterID)
|
||||
If Error_Services('NoError') And RowExists('LOT', LotId) then
|
||||
Message = 'Create TW Lot Successful: New Lot ID - ' : LotId
|
||||
GoSub CreateHALItem
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 400, Error_Services('GetMessage'))
|
||||
end
|
||||
SRP_Json(hNewTWLotJson, 'Release')
|
||||
end else
|
||||
// Error parsing JSON
|
||||
HTTP_Services('SetResponseStatus', 400, 'Unable to parse the JSON data from the request.')
|
||||
end
|
||||
end else
|
||||
// No JSON payload sent with request
|
||||
If SRP_JSON(hTemplateJSON, 'New', 'Object', 'Template') then
|
||||
SRP_JSON(hTemplateJSON, 'SetValue', 'ProdName', '')
|
||||
SRP_JSON(hTemplateJSON, 'SetValue', 'LotQty', '')
|
||||
SRP_JSON(hTemplateJSON, 'SetValue', 'VendorPartNo', '')
|
||||
SRP_JSON(hTemplateJSON, 'SetValue', 'VendorLotNo', '')
|
||||
SRP_JSON(hTemplateJSON, 'SetValue', 'VendorCode', '')
|
||||
JSONTemplate = SRP_JSON(hTemplateJSON, 'Stringify', 'Styled')
|
||||
SRP_JSON(hTemplateJSON, 'Release')
|
||||
HTTP_Services('SetResponseBody', JSONTemplate, False$, 'application/hal+json')
|
||||
end
|
||||
HTTP_Services('SetResponseStatus', 400, 'JSON object is missing in the body of the request.')
|
||||
end
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
||||
end
|
||||
end api
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
// CreateHALItem
|
||||
//
|
||||
// Creates a HAL+JSON object based on the OpenInsight data row representation.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
CreateHALItem:
|
||||
|
||||
LotJson = Lot_Services('ConvertLotRecordToJson', LotId, FullEndpointURL, CurrUser , 0)
|
||||
|
||||
If Error_Services('NoError') then
|
||||
StatusCode = 200
|
||||
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||
HTTP_Services('SetResponseBody', LotJson, False$, 'application/hal+json')
|
||||
If Assigned(Message) then
|
||||
HTTP_Services('SetResponseStatus', StatusCode, Message)
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', StatusCode)
|
||||
end
|
||||
end else
|
||||
Message = Error_Services('GetMessage')
|
||||
HTTP_Services('SetResponseStatus', 500, 'Error in the ' : CurrentAPI : ' API. Message: ': Message)
|
||||
end
|
||||
|
||||
return
|
165
LSL2/STPROC/GETTESTWAFERLOTZPL_API.txt
Normal file
165
LSL2/STPROC/GETTESTWAFERLOTZPL_API.txt
Normal file
@ -0,0 +1,165 @@
|
||||
Function Gettestwaferlotzpl_API(@API)
|
||||
/***********************************************************************************************************************
|
||||
|
||||
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
|
||||
permission from SRP Computer Solutions, Inc.
|
||||
|
||||
Name : Gettestwaferlotzpl_API
|
||||
|
||||
Description : API logic for the Gettestwaferlotzpl resource.
|
||||
|
||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
||||
|
||||
HTTPMethod - The HTTP Method (Verb) submitted by the client (e.g., GET, POST, etc.)
|
||||
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||
FullEndpointURL - The URL submitted by the client, including query params.
|
||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||
EndpointSegment - The URL endpoint segment.
|
||||
ParentURL - The URL path preceeding the current endpoint.
|
||||
CurrentAPI - The name of this stored procedure.
|
||||
|
||||
Parameters :
|
||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||
- APIPattern must follow this structure Gettestwaferlotzpl[.ID.[<Property>]]
|
||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||
Examples:
|
||||
- Gettestwaferlotzpl.POST
|
||||
- Gettestwaferlotzpl.ID.PUT
|
||||
- Gettestwaferlotzpl.ID.firstName.GET
|
||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
||||
services do not rely upon anything being returned in the response. This is what the
|
||||
various services like SetResponseBody and SetResponseStatus services are for. A response
|
||||
value is only helpful if the developers want to use it for debug purposes.
|
||||
|
||||
History : (Date, Initials, Notes)
|
||||
10/21/24 xxx Original programmer.
|
||||
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
Declare function Labeling_Services, OI_Wizard_services
|
||||
|
||||
$insert APP_INSERTS
|
||||
$insert API_SETUP
|
||||
$insert HTTP_INSERTS
|
||||
$Insert LOT_EQUATES
|
||||
$Insert OI_WIZARD_EQUATES
|
||||
|
||||
GoToAPI else
|
||||
// The specific resource endpoint doesn't have a API handler yet.
|
||||
HTTP_Services('SetResponseStatus', 204, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||
end
|
||||
|
||||
Return Response OR ''
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Endpoint Handlers
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
API gettestwaferlotzpl.HEAD
|
||||
API gettestwaferlotzpl.GET
|
||||
//LotId, Username
|
||||
OIWizardID = ''
|
||||
Cookies = HTTP_Services('GetHTTPCookie')
|
||||
For each Cookie in Cookies using ';'
|
||||
Key = Field(Cookie, '=', 1)
|
||||
If Key EQ 'sessionID' then
|
||||
OIWizardID = Field(Cookie, '=', 2)
|
||||
end
|
||||
Next Cookie
|
||||
|
||||
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
||||
|
||||
If ValidSession then
|
||||
// Check if payload has the required information to create a react mode change record
|
||||
Body = HTTP_Services('GetHTTPGetString')
|
||||
If Body NE '' then
|
||||
// The POST string will have been encoded so use percent (URL) decoding.
|
||||
ReactModeJSON = HTTP_Services('DecodePercentString', Body)
|
||||
ParseResponse = SRP_JSON(hReactModeJSON, 'PARSE', ReactModeJSON)
|
||||
If (ParseResponse EQ '') then
|
||||
LotId = SRP_JSON(hReactModeJSON, 'GetValue', 'LotId')
|
||||
Username = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X')
|
||||
SRP_JSON(hReactModeJSON, 'Release')
|
||||
//Reactor_Services('CreateReactModeChange', UserID, ReactNo, Mode, ModeSubCat, ModeText)
|
||||
ZPLString = Labeling_Services('GetTestWaferLotZPL', LotId, Username)
|
||||
If Error_Services('NoError') And ZPLString NE '' then
|
||||
// Maybe return the corresponding reactor object with the new current mode info.
|
||||
HTTP_Services('SetResponseStatus', 201, ZPLString)
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 400, Error_Services('GetMessage'))
|
||||
end
|
||||
end else
|
||||
// Error parsing JSON
|
||||
HTTP_Services('SetResponseStatus', 400, 'Unable to parse the JSON data from the request.')
|
||||
end
|
||||
end else
|
||||
// No JSON payload sent with request
|
||||
If SRP_JSON(hTemplateJSON, 'New', 'Object', 'Template') then
|
||||
SRP_JSON(hTemplateJSON, 'SetValue', 'userID', '')
|
||||
SRP_JSON(hTemplateJSON, 'SetValue', 'reactNo', '')
|
||||
SRP_JSON(hTemplateJSON, 'SetValue', 'mode', '')
|
||||
SRP_JSON(hTemplateJSON, 'SetValue', 'modeSubCat', '')
|
||||
SRP_JSON(hTemplateJSON, 'SetValue', 'modeText', '')
|
||||
JSONTemplate = SRP_JSON(hTemplateJSON, 'Stringify', 'Styled')
|
||||
SRP_JSON(hTemplateJSON, 'Release')
|
||||
HTTP_Services('SetResponseBody', JSONTemplate, False$, 'application/hal+json')
|
||||
end
|
||||
HTTP_Services('SetResponseStatus', 400, 'JSON object is missing in the body of the request.')
|
||||
end
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
||||
end
|
||||
|
||||
end api
|
||||
|
||||
|
||||
API gettestwaferlotzpl.ID.HEAD
|
||||
API gettestwaferlotzpl.ID.GET
|
||||
OIWizardID = ''
|
||||
Cookies = HTTP_Services('GetHTTPCookie')
|
||||
For each Cookie in Cookies using ';'
|
||||
Key = Field(Cookie, '=', 1)
|
||||
If Key EQ 'sessionID' then
|
||||
OIWizardID = Field(Cookie, '=', 2)
|
||||
end
|
||||
Next Cookie
|
||||
|
||||
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
||||
|
||||
If ValidSession then
|
||||
// Check if payload has the required information to create a react mode change record
|
||||
LotId = EndpointSegment
|
||||
If LotId NE '' then
|
||||
// The POST string will have been encoded so use percent (URL) decoding.
|
||||
Username = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X')
|
||||
//Reactor_Services('CreateReactModeChange', UserID, ReactNo, Mode, ModeSubCat, ModeText)
|
||||
ZPLString = Labeling_Services('GetTestWaferLotZPL', LotId, Username)
|
||||
If Error_Services('NoError') And ZPLString NE '' then
|
||||
// Maybe return the corresponding reactor object with the new current mode info.
|
||||
HTTP_Services('SetResponseStatus', 201, ZPLString)
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 400, Error_Services('GetMessage'))
|
||||
end
|
||||
end else
|
||||
// No JSON payload sent with request
|
||||
If SRP_JSON(hTemplateJSON, 'New', 'Object', 'Template') then
|
||||
SRP_JSON(hTemplateJSON, 'SetValue', 'userID', '')
|
||||
SRP_JSON(hTemplateJSON, 'SetValue', 'reactNo', '')
|
||||
SRP_JSON(hTemplateJSON, 'SetValue', 'mode', '')
|
||||
SRP_JSON(hTemplateJSON, 'SetValue', 'modeSubCat', '')
|
||||
SRP_JSON(hTemplateJSON, 'SetValue', 'modeText', '')
|
||||
JSONTemplate = SRP_JSON(hTemplateJSON, 'Stringify', 'Styled')
|
||||
SRP_JSON(hTemplateJSON, 'Release')
|
||||
HTTP_Services('SetResponseBody', JSONTemplate, False$, 'application/hal+json')
|
||||
end
|
||||
HTTP_Services('SetResponseStatus', 400, 'JSON object is missing in the body of the request.')
|
||||
end
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
||||
end
|
||||
|
||||
end api
|
107
LSL2/STPROC/LABELING_API.txt
Normal file
107
LSL2/STPROC/LABELING_API.txt
Normal file
@ -0,0 +1,107 @@
|
||||
Function Labeling_API(@API)
|
||||
/***********************************************************************************************************************
|
||||
|
||||
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
|
||||
permission from SRP Computer Solutions, Inc.
|
||||
|
||||
Name : Labeling_API
|
||||
|
||||
Description : API logic for the Labeling resource.
|
||||
|
||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
||||
|
||||
HTTPMethod - The HTTP Method (Verb) submitted by the client (e.g., GET, POST, etc.)
|
||||
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||
FullEndpointURL - The URL submitted by the client, including query params.
|
||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||
EndpointSegment - The URL endpoint segment.
|
||||
ParentURL - The URL path preceeding the current endpoint.
|
||||
CurrentAPI - The name of this stored procedure.
|
||||
|
||||
Parameters :
|
||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||
- APIPattern must follow this structure Labeling[.ID.[<Property>]]
|
||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||
Examples:
|
||||
- Labeling.POST
|
||||
- Labeling.ID.PUT
|
||||
- Labeling.ID.firstName.GET
|
||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
||||
services do not rely upon anything being returned in the response. This is what the
|
||||
various services like SetResponseBody and SetResponseStatus services are for. A response
|
||||
value is only helpful if the developers want to use it for debug purposes.
|
||||
|
||||
History : (Date, Initials, Notes)
|
||||
10/22/24 xxx Original programmer.
|
||||
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
Declare function Labeling_Services, OI_Wizard_Services
|
||||
|
||||
$insert APP_INSERTS
|
||||
$insert API_SETUP
|
||||
$insert HTTP_INSERTS
|
||||
|
||||
GoToAPI else
|
||||
// The specific resource endpoint doesn't have a API handler yet.
|
||||
HTTP_Services('SetResponseStatus', 204, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||
end
|
||||
|
||||
Return Response OR ''
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Endpoint Handlers
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
API labeling.HEAD
|
||||
API labeling.GET
|
||||
|
||||
OIWizardID = ''
|
||||
Cookies = HTTP_Services('GetHTTPCookie')
|
||||
For each Cookie in Cookies using ';'
|
||||
Key = Field(Cookie, '=', 1)
|
||||
If Key EQ 'sessionID' then
|
||||
OIWizardID = Field(Cookie, '=', 2)
|
||||
end
|
||||
Next Cookie
|
||||
|
||||
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
||||
If ValidSession then
|
||||
//Send back list of printers
|
||||
PrinterList = Labeling_Services('GetAllZebraPrinters')
|
||||
If SRP_JSON(hJSONCollection, 'New', 'Object') then
|
||||
hPrinterArray = ''
|
||||
If SRP_JSON(hPrinterArray, 'New', 'Array') then
|
||||
for each ZebraPrinter in PrinterList using @FM setting printerPos
|
||||
//Create individual printer object
|
||||
hPrinterObj = ''
|
||||
If SRP_Json(hPrinterObj, 'New', 'Object') then
|
||||
SRP_JSON(hPrinterObj, 'SetValue', 'PrinterId', ZebraPrinter<1,1>)
|
||||
SRP_JSON(hPrinterObj, 'SetValue', 'PrinterIPAddress', ZebraPrinter<1,2>)
|
||||
SRP_JSON(hPrinterObj, 'SetValue', 'PrinterPort', ZebraPrinter<1,3>)
|
||||
SRP_JSON(hPrinterArray, 'Add', hPrinterObj)
|
||||
SRP_JSON(hPrinterObj, 'Release')
|
||||
end
|
||||
Next ZebraPrinter
|
||||
SRP_JSON(hJSONCollection, 'Set', 'ZebraPrinters', hPrinterArray)
|
||||
SRP_JSON(hPrinterArray, 'Release')
|
||||
end
|
||||
JSONCollection = SRP_JSON(hJSONCollection, 'Stringify', 'Styled')
|
||||
SRP_JSON(hJSONCollection, 'Release')
|
||||
end
|
||||
If Error_Services('NoError') then
|
||||
HTTP_Services('SetResponseStatus', 201, 'Success')
|
||||
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||
HTTP_Services('SetResponseBody', JSONCollection, False$, 'application/hal+json')
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 400, Error_Services('GetMessage'))
|
||||
end
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
||||
end
|
||||
|
||||
end api
|
175
LSL2/STPROC/LABELING_SERVICES.txt
Normal file
175
LSL2/STPROC/LABELING_SERVICES.txt
Normal file
@ -0,0 +1,175 @@
|
||||
Compile function Labeling_Services(@Service, @Params)
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
Declare Function Database_Services, Environment_Services, Set_Printer, Direct_Print, Printer_Select, Error_Services
|
||||
Declare Function Logging_Services, Datetime
|
||||
Declare subroutine Error_Services, Labeling_Services, Lot_Services
|
||||
|
||||
$insert LOGICAL
|
||||
$Insert LOT_EQUATES
|
||||
$Insert TEST_WAFER_PROD_EQUATES
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\LabelPrinting'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' TestWaferLabelPrinting.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'Lot Id' : @FM : 'Username' : @FM : 'PrinterID' : @FM : 'Message'
|
||||
objTWLabelPrinting = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
|
||||
|
||||
|
||||
|
||||
GoToService
|
||||
|
||||
Return Response or ""
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// SERVICES
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Service PrintLabel(ZPLString, PrinterId)
|
||||
debug
|
||||
SuccessfulPrint = False$
|
||||
ErrorMessage = ''
|
||||
If PrinterId EQ '' then
|
||||
PrinterId = Printer_Select(PrinterID)
|
||||
end
|
||||
If PrinterID NE '' then
|
||||
stat = Direct_Print('START', PrinterId, '', '')
|
||||
If Stat GE 0 then
|
||||
stat = Direct_Print('PRINT', ZPLString)
|
||||
If Stat GE 0 then
|
||||
stat = Direct_Print('STOP')
|
||||
end
|
||||
end
|
||||
If Stat LT 0 then
|
||||
Begin Case
|
||||
Case Stat EQ -1
|
||||
ErrorMessage = "A subsequent START message was sent prior to a previous report's STOP message was invoked."
|
||||
Case Stat EQ -2
|
||||
ErrorMessage = 'Unable to initialize printer. The printer name may be incorrect or the printer is not avaible'
|
||||
Case Stat EQ -3 OR Stat EQ -4
|
||||
ErrorMessage = 'Problems starting the report.'
|
||||
Case Stat EQ -5 OR Stat EQ -6
|
||||
ErrorMessage = 'Problems stopping the report.'
|
||||
Case Stat EQ -7
|
||||
ErrorMessage = 'Error with printing data - fatal error sending data to the printer.'
|
||||
Case Stat EQ -8
|
||||
ErrorMessage = 'Error with printing data - wrong number of bytes sent to the printer.'
|
||||
Case Stat EQ -9 OR Stat EQ -10
|
||||
ErrorMessage = 'Error occurred sending the PAGE message'
|
||||
Case Stat EQ -11
|
||||
ErrorMessage = 'Problems aborting the report.'
|
||||
Case Stat EQ -12
|
||||
ErrorMessage = 'The Direct_Print function was called prior to the START message being invoked.'
|
||||
End Case
|
||||
end
|
||||
end
|
||||
If ErrorMessage NE '' then
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
end service
|
||||
|
||||
Service PrintTestWaferLotLabel(LotId, Username, PrinterId)
|
||||
ErrorMessage = ''
|
||||
If Username EQ '' then
|
||||
Username = @User4
|
||||
If Username EQ '' then Username = @USERNAME
|
||||
end
|
||||
If RowExists('LOT', LotId) then
|
||||
ZPLStringLabel = ''
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||
PartNoId = LotRec<LOT_PROD_ID$>
|
||||
PartNo = Xlate('TEST_WAFER_PROD', PartNoId, TEST_WAFER_PROD_PART_NAME$, 'X')
|
||||
VendorPartNo = LotRec<LOT_VENDOR_PART_NO$>
|
||||
VendorLotNo = LotRec<LOT_VENDOR_LOT_NO$>
|
||||
VendorCode = LotRec<LOT_VENDOR_CODE$>
|
||||
LotQty = LotRec<LOT_WAFER_QTY$>
|
||||
For LabelCnt = 1 to 2
|
||||
|
||||
ZPLStringLabel := '^XA'
|
||||
ZPLStringLabel := '^LH0,0'
|
||||
ZPLStringLabel := '^PR1'
|
||||
ZPLStringLabel := '^LL406'
|
||||
ZPLStringLabel := '^PW900'
|
||||
ZPLStringLabel := '^MD22'
|
||||
ZPLStringLabel := '^MMT'
|
||||
ZPLStringLabel := '^FO25,25^A045,70,40^FD(1T)Lot Number: ^FS^FX(Lot Number Title)^FS'
|
||||
ZPLStringLabel := '^FO320,25^A045,70,40^FD':LotId:'^FS^FX(Lot Number Text)^FS'
|
||||
ZPLStringLabel := '^FO25,200^A070,40^FD':PartNo:'^FS^FX(Part Number Text)^FS'
|
||||
ZPLStringLabel := '^FO60,300^BY7^B3,,50,N^FD1T':LotId:'^FS^FX(Lot Number 1D Barcode)^FS'
|
||||
ZPLStringLabel := "^FO25,370^A045,28^FDWe do what we promise. That's quality made by Infineon.^FS^FX(Infineon Quality Statement)^FS"
|
||||
ZPLStringLabel := '^FO500,105^CI28'
|
||||
ZPLStringLabel := '^BXN,5,200^FDP':PartNo:'|S':VendorPartNo:'|1T':LotId:'|2T':VendorLotNo:'|(PSN)|Q':LotQty:'|1V':VendorCode:'|SEQ':LabelCnt:'^FS^FX(2DBarcode)^FS'
|
||||
ZPLStringLabel := '^XZ'
|
||||
Next LabelCnt
|
||||
If ZPLStringLabel NE '' then
|
||||
Labeling_Services('PrintLabel', ZPLStringLabel, PrinterId)
|
||||
If Error_Services('NoError') then
|
||||
//Log Event for lot.
|
||||
end else
|
||||
//Log Error for lot
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
|
||||
end
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error printing label for lot ' : LotId : '. LotId was null or did not exist in database.'
|
||||
end
|
||||
If ErrorMessage EQ '' then
|
||||
Lot_Services('CreateLotEvent', LotId, 'TW', Datetime(), 'COMMENT', 'Lot Labels Printed', '', 0, 0, '', Username)
|
||||
end else
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
End Service
|
||||
|
||||
Service GetTestWaferLotZPL(LotId, Username)
|
||||
ZPLStringLabel = ''
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||
PartNoId = LotRec<LOT_PROD_ID$>
|
||||
PartNo = Xlate('TEST_WAFER_PROD', PartNoId, TEST_WAFER_PROD_PART_NAME$, 'X')
|
||||
VendorPartNo = LotRec<LOT_VENDOR_PART_NO$>
|
||||
VendorLotNo = LotRec<LOT_VENDOR_LOT_NO$>
|
||||
VendorCode = LotRec<LOT_VENDOR_CODE$>
|
||||
LotQty = LotRec<LOT_WAFER_QTY$>
|
||||
For LabelCnt = 1 to 2
|
||||
|
||||
ZPLStringLabel := '^XA'
|
||||
ZPLStringLabel := '^LH0,0'
|
||||
ZPLStringLabel := '^PR1'
|
||||
ZPLStringLabel := '^LL406'
|
||||
ZPLStringLabel := '^PW900'
|
||||
ZPLStringLabel := '^MD22'
|
||||
ZPLStringLabel := '^MMT'
|
||||
ZPLStringLabel := '^FO25,25^A045,70,40^FD(1T)Lot Number: ^FS^FX(Lot Number Title)^FS'
|
||||
ZPLStringLabel := '^FO320,25^A045,70,40^FD':LotId:'^FS^FX(Lot Number Text)^FS'
|
||||
ZPLStringLabel := '^FO25,200^A070,40^FD':PartNo:'^FS^FX(Part Number Text)^FS'
|
||||
ZPLStringLabel := '^FO60,300^BY7^B3,,50,N^FD1T':LotId:'^FS^FX(Lot Number 1D Barcode)^FS'
|
||||
ZPLStringLabel := "^FO25,370^A045,28^FDWe do what we promise. That's quality made by Infineon.^FS^FX(Infineon Quality Statement)^FS"
|
||||
ZPLStringLabel := '^FO500,105^CI28'
|
||||
ZPLStringLabel := '^BXN,5,200^FDP':PartNo:'|S':VendorPartNo:'|1T':LotId:'|2T':VendorLotNo:'|(PSN)|Q':LotQty:'|1V':VendorCode:'|SEQ':LabelCnt:'^FS^FX(2DBarcode)^FS'
|
||||
ZPLStringLabel := '^XZ'
|
||||
Next LabelCnt
|
||||
Response = ZPLStringLabel
|
||||
end service
|
||||
|
||||
Service GetAllZebraPrinters()
|
||||
Server = Environment_Services('GetServer')
|
||||
ZebraPrinterList = ''
|
||||
ZebraPrinterList<1> = 'MESZBRPRT002' : @VM : '10.95.30.247' : @VM : 9100
|
||||
ZebraPrinterList<2> = 'MESZBRPRT003' : @VM : '10.95.1.27' : @VM : 9100
|
||||
ZebraPrinterList<3> = 'MESZBRPRT004' : @VM : '10.95.15.252' : @VM : 9100
|
||||
ZebraPrinterList<4> = 'MESZBRPRT005' : @VM : '10.95.30.42' : @VM : 9100
|
||||
ZebraPrinterList<5> = 'MESZBRPRT006' : @VM : '10.95.25.25' : @VM : 9100
|
||||
ZebraPrinterList<6> = 'MESZBRPRT007' : @VM : '10.95.1.13' : @VM : 9100
|
||||
ZebraPrinterList<7> = 'MESZBRPRT008' : @VM : '10.95.164.24' : @VM : 9100
|
||||
ZebraPrinterList<8> = 'MESZBRPRT0011' : @VM : '10.95.13.33' : @VM : 9100
|
||||
ZebraPrinterList<9> = 'FI_ZEBRA_PRINTER' : @VM : '10.95.164.55' : @VM : 9100
|
||||
If Server EQ 'MESTSA01EC' then
|
||||
ZebraPrinterList<10> = 'JONATHAN_HOME_TEST' : @VM : '192.168.0.123' : @VM : 9100
|
||||
end
|
||||
Response = ZebraPrinterList
|
||||
end service
|
||||
|
||||
|
57
LSL2/STPROC/LOT_API.txt
Normal file
57
LSL2/STPROC/LOT_API.txt
Normal file
@ -0,0 +1,57 @@
|
||||
Function Lot_API(@API)
|
||||
/***********************************************************************************************************************
|
||||
|
||||
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
|
||||
permission from SRP Computer Solutions, Inc.
|
||||
|
||||
Name : Lot_API
|
||||
|
||||
Description : API logic for the Lot resource.
|
||||
|
||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
||||
|
||||
HTTPMethod - The HTTP Method (Verb) submitted by the client (e.g., GET, POST, etc.)
|
||||
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||
FullEndpointURL - The URL submitted by the client, including query params.
|
||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||
EndpointSegment - The URL endpoint segment.
|
||||
ParentURL - The URL path preceeding the current endpoint.
|
||||
CurrentAPI - The name of this stored procedure.
|
||||
|
||||
Parameters :
|
||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||
- APIPattern must follow this structure Lot[.ID.[<Property>]]
|
||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||
Examples:
|
||||
- Lot.POST
|
||||
- Lot.ID.PUT
|
||||
- Lot.ID.firstName.GET
|
||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
||||
services do not rely upon anything being returned in the response. This is what the
|
||||
various services like SetResponseBody and SetResponseStatus services are for. A response
|
||||
value is only helpful if the developers want to use it for debug purposes.
|
||||
|
||||
History : (Date, Initials, Notes)
|
||||
10/21/24 xxx Original programmer.
|
||||
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
$insert APP_INSERTS
|
||||
$insert API_SETUP
|
||||
$insert HTTP_INSERTS
|
||||
|
||||
GoToAPI else
|
||||
// The specific resource endpoint doesn't have a API handler yet.
|
||||
HTTP_Services('SetResponseStatus', 204, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||
end
|
||||
|
||||
Return Response OR ''
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Endpoint Handlers
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
615
LSL2/STPROC/LOT_SERVICES.txt
Normal file
615
LSL2/STPROC/LOT_SERVICES.txt
Normal file
@ -0,0 +1,615 @@
|
||||
Compile function Lot_Services(@Service, @Params)
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
Declare function TEST_WAFER_PROD_SERVICES, SRP_Datetime, Datetime, Database_Services, Lot_Services, Error_Services, RTI_CREATEGUID
|
||||
Declare function SRP_Array, SRP_Json
|
||||
Declare subroutine Database_Services, Btree.Extract, Lot_Services, Error_Services, Labeling_Services, SRP_Json
|
||||
$insert LOGICAL
|
||||
$Insert LOT_EQUATES
|
||||
$Insert TEST_WAFER_PROD_EQUATES
|
||||
$Insert Lot_Operation_Equates
|
||||
$Insert PRODUCT_OPERATION_EQUATES
|
||||
$Insert LOT_EVENT_EQUATES
|
||||
|
||||
Options EVENT_TYPES = 'MOVE_IN', 'MOVE_OUT', 'HOLD_ON', 'HOLD_OFF', 'REDUCE_WAFER_QTY', 'BONUS_WAFER_QTY', 'COMMENT', 'LOCATION'
|
||||
Options LOT_TYPES = 'TW', 'RDS', 'WM_OUT', 'WM_IN'
|
||||
|
||||
GoToService
|
||||
|
||||
Return Response or ""
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// SERVICES
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Service GenerateNewLotId(LotType)
|
||||
NewLotID = ''
|
||||
RightNow = Datetime()
|
||||
If LotType NE '' then
|
||||
ValidLotNum = False$
|
||||
GeneratedLotID = ''
|
||||
Begin Case
|
||||
Case LotType EQ 'TW'
|
||||
|
||||
Loop
|
||||
Until ValidLotNum EQ True$
|
||||
LotPrefix = 'TW'
|
||||
LotYear = SRP_Datetime('Year', RightNow)
|
||||
LotMonth = SRP_Datetime('Month', RightNow)
|
||||
LotDay = SRP_Datetime('Day', RightNow)
|
||||
LotTime = SRP_Datetime('Time', RightNow)
|
||||
|
||||
GeneratedLotId = LotPrefix : LotYear : LotMonth : LotDay : LotTime
|
||||
If Not(RowExists('LOT', GeneratedLotId)) then
|
||||
ValidLotNum = True$
|
||||
end else
|
||||
ValidLotNum = False$
|
||||
RightNow = Datetime()
|
||||
end
|
||||
Repeat
|
||||
Case OTHERWISE$
|
||||
//null
|
||||
End Case
|
||||
If GeneratedLotID NE '' AND ValidLotNum then
|
||||
//Write the new lot id now so it's reserved
|
||||
Database_Services('WriteDataRow', 'LOT', GeneratedLotID, '')
|
||||
If RowExists('LOT', GeneratedLotID) then
|
||||
NewLotID = GeneratedLotID
|
||||
end
|
||||
end
|
||||
end
|
||||
Response = NewLotID
|
||||
end service
|
||||
|
||||
Service CreateNewTestWaferLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, VendorCode, Username, PrinterID)
|
||||
CreatedLotNumber = ''
|
||||
ErrorMessage = ''
|
||||
If LotType EQ 'TW' then
|
||||
If ProdName NE '' then
|
||||
TWProdID = Test_Wafer_Prod_Services('GetTestWaferProdIDsByPartName', ProdName)
|
||||
If TWProdID NE '' then
|
||||
If DCount(TWProdID, @VM) EQ 1 then
|
||||
NewLotId = Lot_Services('GenerateNewLotId', 'TW')
|
||||
If NewLotId NE '' then
|
||||
If RowExists('LOT', NewLotId) then
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', NewLotId)
|
||||
//Ensure the lot record is empty
|
||||
If LotRec<LOT_TYPE$> EQ '' AND LotRec<LOT_PROD_ID$> EQ '' AND LotRec<LOT_ORIG_WAFER_QTY$> EQ '' AND LotRec<LOT_WAFER_QTY$> EQ '' then
|
||||
LotRec<LOT_TYPE$> = LotType
|
||||
LotRec<LOT_PROD_ID$> = TWProdID
|
||||
LotRec<LOT_ORIG_WAFER_QTY$> = LotQty
|
||||
LotRec<LOT_WAFER_QTY$> = LotQty
|
||||
LotRec<LOT_VENDOR_PART_NO$> = VendorPartNo
|
||||
LotRec<LOT_VENDOR_LOT_NO$> = VendorLotNo
|
||||
LotRec<LOT_VENDOR_CODE$> = VendorCode
|
||||
Database_Services('WriteDataRow', 'LOT', NewLotId, LotRec)
|
||||
//Now Ensure that the written lot matches what was just written
|
||||
LotRecCheck = Database_Services('ReadDataRow', 'LOT', NewLotId)
|
||||
If LotRecCheck EQ LotRec then
|
||||
//Lot Created successfully
|
||||
CreatedLotNumber = NewLotId
|
||||
If RowExists('LOT', CreatedLotNumber) then
|
||||
Lot_Services('CreateInitialLotOperationRecords', CreatedLotNumber)
|
||||
If Error_Services('NoError') then
|
||||
//Check in at first operation
|
||||
//Get Curr Operation(Should be first one in sequence)
|
||||
ThisLotCurrOpId = Lot_Services('GetLotCurrOperation', CreatedLotNumber)
|
||||
If ThisLotCurrOpId NE '' then
|
||||
Lot_Services('MoveInLot', NewLotId, LotQty, Username)
|
||||
If PrinterID NE 'WEB' then
|
||||
Labeling_Services('PrintTestWaferLotLabel', CreatedLotNumber, Username, PrinterID)
|
||||
end
|
||||
Lot_Services('MoveOutLot', NewLotId, LotQty, Username)
|
||||
Lot_Services('MoveInLot', NewLotId, LotQty, Username)
|
||||
end else
|
||||
//Error: Error getting current operation
|
||||
end
|
||||
end else
|
||||
//Error: Failed to initialize lot operations
|
||||
end
|
||||
end
|
||||
end else
|
||||
//Lot attributes didn't write correctly.
|
||||
end
|
||||
end else
|
||||
//Error: Lot already had data
|
||||
end
|
||||
end else
|
||||
//Error creating new lot ID
|
||||
end
|
||||
end else
|
||||
//Error getting new Lot ID
|
||||
end
|
||||
end else
|
||||
//Ambiguous Product name, multiple results.
|
||||
end
|
||||
end else
|
||||
//No Matching part no found
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Null value passed in for ProdID'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Lot type was not test wafer'
|
||||
end
|
||||
Response = CreatedLotNumber
|
||||
|
||||
End Service
|
||||
|
||||
Service GenerateInitialLotOperationRecords(LotId)
|
||||
If LotID NE '' then
|
||||
if RowExists('LOT', LotId) then
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||
ProdID = LotRec<LOT_PROD_ID$>
|
||||
If ProdID NE '' then
|
||||
//Get product operations
|
||||
ThisLotOperations = Lot_Services('GetPrescribedOperationsByProdId', ProdId)
|
||||
If ThisLotOperations NE '' then
|
||||
for each ProdOperationKey in ThisLotOperations using @FM
|
||||
OperationRec = Database_Services('ReadDataRow', 'PRODUCT_OPERATION', ProdOperationKey)
|
||||
|
||||
//NewOperationRecID =
|
||||
Next operation
|
||||
end else
|
||||
//Error: No Operations returned
|
||||
end
|
||||
end else
|
||||
//Error: Prod ID for lot is null
|
||||
end
|
||||
//ID will be LotNum + OperationID
|
||||
//Get product operations
|
||||
|
||||
end else
|
||||
//error: lot does not exist
|
||||
end
|
||||
end else
|
||||
//error: null lot id
|
||||
end
|
||||
end service
|
||||
|
||||
Service GetPrescribedOperationsByProdId(ProdId, ProdType)
|
||||
ProdOperationKeys = ''
|
||||
If ProdId NE '' then
|
||||
Begin Case
|
||||
Case ProdType = 'TW'
|
||||
ProdRec = Database_Services('ReadDataRow', 'TEST_WAFER_PROD', ProdId)
|
||||
ProdOperationKeys = ProdRec<TEST_WAFER_PROD_PRODUCT_OPERATIONS$>
|
||||
Case Otherwise$
|
||||
//error, no matching prod type.
|
||||
End Case
|
||||
end else
|
||||
//Error: ProdID was null
|
||||
end
|
||||
Response = ProdOperationKeys
|
||||
end service
|
||||
|
||||
Service CreateInitialLotOperationRecords(LotId)
|
||||
If LotId NE '' then
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||
LotType = LotRec<LOT_TYPE$>
|
||||
ProdId = LotRec<LOT_PROD_ID$>
|
||||
ThisInitialProdOperations = Lot_Services('GetPrescribedOperationsByProdId', ProdId, LotType)
|
||||
For each ProdOperation in ThisInitialProdOperations using @VM
|
||||
|
||||
ProdOperationRec = Database_Services('ReadDataRow', 'PRODUCT_OPERATION', ProdOperation)
|
||||
OperationID = ProdOperationRec<PRODUCT_OPERATION_OPERATION_ID$>
|
||||
OperationSequence = ProdOperationRec<PRODUCT_OPERATION_OPERATION_SEQUENCE$>
|
||||
|
||||
LotOperationRecID = LotId : '*' : OperationID
|
||||
If Not(RowExists('LOT_OPERATION', LotOperationRecID)) then
|
||||
LotOperationRec = ''
|
||||
LotOperationRec<LOT_OPERATION_LOT_ID$> = LotId
|
||||
LotOperationRec<LOT_OPERATION_OPERATION_ID$> = OperationID
|
||||
LotOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$> = OperationSequence
|
||||
LotOperationRec<LOT_OPERATION_REWORK$> = False$
|
||||
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec)
|
||||
TestRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||
end else
|
||||
//Error: Lot Operation already existed, cannot overwrite
|
||||
end
|
||||
|
||||
Next Operation
|
||||
end else
|
||||
//Error: Lot ID was null
|
||||
end
|
||||
TestRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||
end service
|
||||
|
||||
//Returns a @FM delimited list of operations in sequence
|
||||
Service GetLotOperationSequence(LotId)
|
||||
LotOperationsInSequence = ''
|
||||
If LotID NE '' then
|
||||
//Get Operations
|
||||
LotOperations = Xlate('LOT', LotId, LOT_LOT_OPERATIONS$, 'X')
|
||||
for each LotOperation in LotOperations using @VM
|
||||
ThisLotOperationSequence = Xlate('LOT_OPERATION', LotOperation, LOT_OPERATION_OPERATION_SEQUENCE$, 'X')
|
||||
LotOperationsInSequence<ThisLotOperationSequence> = LotOperation
|
||||
Next LotOperation
|
||||
end else
|
||||
//error: lot id was null
|
||||
end
|
||||
Response = LotOperationsInSequence
|
||||
end service
|
||||
|
||||
//Returns a @FM delimited list of events in sequence
|
||||
Service GetLotEventsInSequence(LotId)
|
||||
|
||||
LotEventsUnsorted = ''
|
||||
LotEventsSorted = ''
|
||||
LotEventsToReturn = ''
|
||||
If LotID NE '' then
|
||||
//Get Operations
|
||||
LotEvents = Xlate('LOT', LotId, LOT_LOT_EVENTS$, 'X')
|
||||
for each LotEvent in LotEvents using @VM
|
||||
ThisEventSequence = XLATE('LOT_EVENT', LotEvent, LOT_EVENT_SEQUENCE$, 'X')
|
||||
LotEventsToReturn<ThisEventSequence> = LotEvent
|
||||
Next LotOperation
|
||||
end else
|
||||
//error: lot id was null
|
||||
end
|
||||
Response = LotEventsToReturn
|
||||
end service
|
||||
|
||||
Service GetLotCurrOperation(LotId)
|
||||
CurrOperation = ''
|
||||
If LotID NE '' then
|
||||
//Get them in sequence first
|
||||
LotOperationsInSequence = Lot_Services('GetLotOperationSequence', LotId)
|
||||
for each LotOperation in LotOperationsInSequence using @FM
|
||||
ThisLotOperationStartDTM = Xlate('LOT_OPERATION', LotOperation, LOT_OPERATION_DATETIME_IN$, 'X')
|
||||
ThisLotOperationEndDTM = Xlate('LOT_OPERATION', LotOperation, LOT_OPERATION_DATETIME_OUT$, 'X')
|
||||
If ThisLotOperationEndDTM Eq '' then
|
||||
CurrOperation = LotOperation
|
||||
end
|
||||
until CurrOperation
|
||||
Next LotOperation
|
||||
end else
|
||||
//error: lot id was null
|
||||
end
|
||||
Response = CurrOperation
|
||||
end service
|
||||
|
||||
Service AddLotOperationIntoSequence(LotId, NewOperationId, NewSequence, Rework)
|
||||
ErrorMessage = ''
|
||||
If LotId NE '' then
|
||||
If NewSequence NE '' AND Num(NewSequence) then
|
||||
//Get Current Operations in sequence
|
||||
//CurrSequence = Lot_Services('GetLotOperationSequence', LotId)
|
||||
LotCurrOperation = Lot_Services('GetLotCurrOperation', LotId)
|
||||
CurrOperationSequence = Xlate('LOT_OPERATION', LotCurrOperation, LOT_OPERATION_OPERATION_SEQUENCE$, 'X')
|
||||
If CurrOperationSequence LE NewSequence then
|
||||
//Get Curr Operation Sequence
|
||||
Done = False$
|
||||
LotCurrOperationSequence = Lot_Services('GetLotOperationSequence', LotId)
|
||||
for each Operation in LotCurrOperationSequence using @Fm setting OpPos
|
||||
ThisOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', Operation)
|
||||
ThisOperationSequence = ThisOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$>
|
||||
If ThisOperationSequence GE NewSequence then
|
||||
NewOperationSequence = ThisOperationSequence + 1
|
||||
ThisOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$> = NewOperationSequence
|
||||
Database_Services('WriteDataRow', 'LOT_OPERATION', Operation, ThisOperationRec)
|
||||
If Error_Services('HasError') then
|
||||
Done = True$
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
end
|
||||
Until Done
|
||||
Next Operation
|
||||
If ErrorMessage EQ '' then
|
||||
LotOperationRecID = LotId : '*' : NewOperationId
|
||||
If Not(RowExists('LOT_OPERATION', LotOperationRecID)) then
|
||||
LotOperationRec = ''
|
||||
LotOperationRec<LOT_OPERATION_LOT_ID$> = LotId
|
||||
LotOperationRec<LOT_OPERATION_OPERATION_ID$> = NewOperationId
|
||||
LotOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$> = NewSequence
|
||||
LotOperationRec<LOT_OPERATION_REWORK$> = Rework
|
||||
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec)
|
||||
end else
|
||||
//Error: Lot Operation already existed, cannot overwrite
|
||||
end
|
||||
end
|
||||
end else
|
||||
//Error: Not allowed to add new operations prior to current operation
|
||||
end
|
||||
end else
|
||||
//Error: null or invalid sequence passed to routine
|
||||
end
|
||||
end else
|
||||
//Error: Lot id was null
|
||||
end
|
||||
If ErrorMessage NE '' then
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
end service
|
||||
|
||||
Service MoveInLot(LotID, WaferQty, Operator)
|
||||
If LotId NE '' then
|
||||
If WaferQty NE '' then
|
||||
If RowExists('LOT', LotId) then
|
||||
ThisLotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||
//Possibly Add locking here
|
||||
If Error_Services('NoError') then
|
||||
ThisLotCurrOperationID = Lot_Services('GetLotCurrOperation', LotId)
|
||||
If ThisLotCurrOperationID NE '' then
|
||||
ThisLotCurrOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', ThisLotCurrOperationID)
|
||||
ThisLotCurrOperationRec<LOT_OPERATION_DATETIME_IN$> = Datetime()
|
||||
ThisLotCurrOperationRec<LOT_OPERATION_WAFER_IN_QTY$> = WaferQty
|
||||
ThisLotCurrOperationRec<LOT_OPERATION_OPERATOR_IN_ID$> = Operator
|
||||
Database_Services('WriteDataRow', 'LOT_OPERATION', ThisLotCurrOperationID, ThisLotCurrOperationRec)
|
||||
If Error_Services('NoError') then
|
||||
LotType = XLATE('LOT', LotId, LOT_TYPE$, 'X')
|
||||
CurrOperation = XLATE('LOT_OPERATION', ThisLotCurrOperationID, LOT_OPERATION_OPERATION_ID$, 'X')
|
||||
Lot_Services('CreateLotEvent', LotId, LotType, Datetime(), 'MOVE_IN', '', '', 0, 0, CurrOperation, Operator)
|
||||
end
|
||||
end
|
||||
|
||||
//Log to Lot Event Table
|
||||
end else
|
||||
//Error: Error reading record
|
||||
end
|
||||
|
||||
end else
|
||||
//Error Invalid Lot id entered
|
||||
end
|
||||
end else
|
||||
//Error: Wafer Qty was null
|
||||
end
|
||||
end else
|
||||
//Error: Lot Id was null
|
||||
end
|
||||
end service
|
||||
|
||||
Service MoveOutLot(LotID, WaferQty, Operator)
|
||||
If LotId NE '' then
|
||||
If WaferQty NE '' then
|
||||
If RowExists('LOT', LotId) then
|
||||
ThisLotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||
CurrLotQty = ThisLotRec<LOT_WAFER_QTY$>
|
||||
BonusQty = 0
|
||||
ReduceQty = 0
|
||||
If WaferQty NE CurrLotQty then
|
||||
Begin Case
|
||||
Case WaferQty GT CurrLotQty
|
||||
//Addition of wafers
|
||||
BonusQty = WaferQty - CurrLotQty
|
||||
Case WaferQty LT CurrLotQty
|
||||
ReduceQty = CurrLotQty - WaferQty
|
||||
End Case
|
||||
end
|
||||
//Possibly Add locking here
|
||||
If Error_Services('NoError') then
|
||||
ThisLotCurrOperationID = Lot_Services('GetLotCurrOperation', LotId)
|
||||
If ThisLotCurrOperationID NE '' then
|
||||
ThisLotCurrOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', ThisLotCurrOperationID)
|
||||
ThisLotCurrOperationRec<LOT_OPERATION_DATETIME_OUT$> = Datetime()
|
||||
ThisLotCurrOperationRec<LOT_OPERATION_WAFER_OUT_QTY$> = WaferQty
|
||||
ThisLotCurrOperationRec<LOT_OPERATION_OPERATOR_OUT_ID$> = Operator
|
||||
Database_Services('WriteDataRow', 'LOT_OPERATION', ThisLotCurrOperationID, ThisLotCurrOperationRec)
|
||||
If Error_Services('NoError') then
|
||||
LotType = XLATE('LOT', LotId, LOT_TYPE$, 'X')
|
||||
|
||||
CurrOperation = XLATE('LOT_OPERATION', ThisLotCurrOperationID, LOT_OPERATION_OPERATION_ID$, 'X')
|
||||
Lot_Services('CreateLotEvent', LotId, LotType, Datetime(), 'MOVE_OUT', '', '', ReduceQty, BonusQty, CurrOperation, Operator)
|
||||
end
|
||||
end
|
||||
//Log to lot event table.
|
||||
end else
|
||||
//Error: Error reading record
|
||||
end
|
||||
|
||||
end else
|
||||
//Error Invalid Lot id entered
|
||||
end
|
||||
end else
|
||||
//Error: Wafer Qty was null
|
||||
end
|
||||
end else
|
||||
//Error: Lot Id was null
|
||||
end
|
||||
end service
|
||||
|
||||
Service CreateLotEvent(LotId, LotType=LOT_TYPES, EventDatetime, EventType=EVENT_TYPES, EventNote, EventEquipmentId, ReduceWaferQty, BonusWaferQty, OperationId, OperatorId)
|
||||
If LotId NE '' then
|
||||
Begin Case
|
||||
Case LotType EQ 'TW'
|
||||
If EventType NE '' AND OperatorId NE '' then
|
||||
If RowExists('LOT', LotId) then
|
||||
ValidId = False$
|
||||
NewEventId = ''
|
||||
Loop
|
||||
NewEventId = RTI_CreateGUID()
|
||||
If Not(RowExists('LOT_EVENT', NewEventId)) then
|
||||
ValidId = True$
|
||||
end
|
||||
Until ValidId EQ True$
|
||||
Repeat
|
||||
BeginWaferQty = Xlate('LOT', LotId, LOT_WAFER_QTY$, 'X')
|
||||
If OperationID EQ '' then
|
||||
OperationID = Lot_Services('GetLotCurrOperation', LotId)
|
||||
OperationID = XLATE('LOT_OPERATION', OperationID, LOT_OPERATION_OPERATION_ID$, 'X')
|
||||
end
|
||||
If ReduceWaferQty NE '' then
|
||||
If Num(ReduceWaferQty) then
|
||||
EndWaferQty = BeginWaferQty - ReduceWaferQty
|
||||
end
|
||||
end
|
||||
If BonusWaferQty NE '' then
|
||||
If Num(BonusWaferQty) then
|
||||
EndWaferQty = BeginWaferQty + BonusWaferQty
|
||||
end
|
||||
end
|
||||
NewEventRec = ''
|
||||
NewEventRec<LOT_EVENT_LOT_ID$> = LotId
|
||||
NewEventRec<LOT_EVENT_LOT_EVENT_TYPE$> = EventType
|
||||
NewEventRec<LOT_EVENT_EVENT_DATETIME$> = EventDatetime
|
||||
NewEventRec<LOT_EVENT_EVENT_NOTE$> = EventNote
|
||||
NewEventRec<LOT_EVENT_EQUIPMENT_ID$> = EventEquipmentId
|
||||
NewEventRec<LOT_EVENT_EVENT_REDUCE_WAFER_QTY$> = ReduceWaferQty
|
||||
NewEventRec<LOT_EVENT_EVENT_BONUS_WAFER_QTY$> = BonusWaferQty
|
||||
NewEventRec<LOT_EVENT_EVENT_BEGIN_WAFER_QTY$> = BeginWaferQty
|
||||
NewEventRec<LOT_EVENT_EVENT_END_WAFER_QTY$> = EndWaferQty
|
||||
NewEventRec<LOT_EVENT_EVENT_OPERATION_ID$> = OperationId
|
||||
NewEventRec<LOT_EVENT_EVENT_OPERATOR_ID$> = OperatorId
|
||||
|
||||
NewEventSequence = Lot_Services('GetLotEventNextSequence', LotId)
|
||||
NewEventRec<LOT_EVENT_SEQUENCE$> = NewEventSequence
|
||||
Database_Services('WriteDataRow', 'LOT_EVENT', NewEventId, NewEventRec)
|
||||
end else
|
||||
//Error: Nonexistent Lot Id passed to routine
|
||||
end
|
||||
end else
|
||||
//Error Missing Parameter
|
||||
end
|
||||
Case LotType EQ 'RDS'
|
||||
null
|
||||
Case LotType EQ 'WM_OUT'
|
||||
null
|
||||
Case LotType EQ 'WM_IN'
|
||||
null
|
||||
Case Otherwise$
|
||||
//Error: Invalid LotType Passed to routine
|
||||
End Case
|
||||
end else
|
||||
//Error: Lot ID was null
|
||||
end
|
||||
end service
|
||||
|
||||
Service GetLotEventNextSequence(LotId)
|
||||
ErrorMessage = ''
|
||||
NextSequence = 1
|
||||
If LotID NE '' then
|
||||
If RowExists('LOT', LotId) then
|
||||
LotEvents = XLATE('LOT', LotId, LOT_LOT_EVENTS$, 'X')
|
||||
for each LotEvent in LotEvents using @VM
|
||||
ThisEventSequence = XLATE('LOT_EVENT', LotEvent, LOT_EVENT_SEQUENCE$, 'X')
|
||||
If ThisEventSequence GE NextSequence then NextSequence = ThisEventSequence + 1
|
||||
Next LotEvent
|
||||
end else
|
||||
ErrorMessage = 'Unable to get lot event sequence: Lot ID not found.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Unable to get lot event sequence: Lot ID was null.'
|
||||
end
|
||||
If ErrorMessage EQ '' then
|
||||
Response = NextSequence
|
||||
end else
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
end service
|
||||
|
||||
Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN)
|
||||
|
||||
ErrorMessage = ''
|
||||
JsonString = ''
|
||||
If FullObject EQ '' then
|
||||
FullObject = True$
|
||||
end
|
||||
If RowExists('LOT', LotId) then
|
||||
objJSON = ''
|
||||
If SRP_JSON(objJSON, 'New', 'Object') then
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||
If Error_Services('NoError') then
|
||||
If SRP_JSON(objLot, 'New', 'Object') then
|
||||
|
||||
SRP_JSON(objLot, 'SetValue', 'LotId', LotId)
|
||||
SRP_JSON(objLot, 'SetValue', 'Type', LotRec<LOT_TYPE$>)
|
||||
SRP_JSON(objLot, 'SetValue', 'ProdId', LotRec<LOT_PROD_ID$>)
|
||||
Begin Case
|
||||
Case LotRec<LOT_TYPE$> = 'TW'
|
||||
ProdName = XLATE('TEST_WAFER_PROD', LotRec<LOT_PROD_ID$>, TEST_WAFER_PROD_PART_NAME$, 'X')
|
||||
Case Otherwise$
|
||||
ProdName = ''
|
||||
End Case
|
||||
SRP_JSON(objLot, 'SetValue', 'ProdName', ProdName)
|
||||
SRP_JSON(objLot, 'SetValue', 'OrigWaferQty', LotRec<LOT_ORIG_WAFER_QTY$>)
|
||||
SRP_JSON(objLot, 'SetValue', 'WaferQty', LotRec<LOT_WAFER_QTY$>)
|
||||
SRP_JSON(objLot, 'SetValue', 'VendorPartNo', LotRec<LOT_VENDOR_PART_NO$>)
|
||||
SRP_JSON(objLot, 'SetValue', 'VendorLotNo', LotRec<LOT_VENDOR_LOT_NO$>)
|
||||
If FullObject then
|
||||
//Events Array
|
||||
EventsArrayJson = ''
|
||||
If SRP_Json(EventsArrayJson, 'New', 'Array') then
|
||||
LotEventKeys = Lot_Services('GetLotEventsInSequence', LotId)
|
||||
for each LotEventKey in LotEventKeys using @FM
|
||||
objEvent = ''
|
||||
EventRec = Database_Services('ReadDataRow', 'LOT_EVENT', LotEventKey)
|
||||
If SRP_Json(objEvent, 'New', 'Object') then
|
||||
SRP_JSON(objEvent, 'SetValue', 'LotEventId', LotEventKey)
|
||||
SRP_JSON(objEvent, 'SetValue', 'LotId', EventRec<LOT_EVENT_LOT_ID$>)
|
||||
SRP_JSON(objEvent, 'SetValue', 'LotEventType', EventRec<LOT_EVENT_LOT_EVENT_TYPE$>)
|
||||
SRP_JSON(objEvent, 'SetValue', 'EventDatetime', OConv(EventRec<LOT_EVENT_EVENT_DATETIME$>, 'DT'))
|
||||
SRP_JSON(objEvent, 'SetValue', 'EventNote', EventRec<LOT_EVENT_EVENT_NOTE$>)
|
||||
SRP_JSON(objEvent, 'SetValue', 'EquipmentId', EventRec<LOT_EVENT_EQUIPMENT_ID$>)
|
||||
SRP_JSON(objEvent, 'SetValue', 'EventReduceWaferQty', EventRec<LOT_EVENT_EVENT_REDUCE_WAFER_QTY$>)
|
||||
SRP_JSON(objEvent, 'SetValue', 'EventBonusWaferQty', EventRec<LOT_EVENT_EVENT_BONUS_WAFER_QTY$>)
|
||||
SRP_JSON(objEvent, 'SetValue', 'EventBeginWaferQty', EventRec<LOT_EVENT_EVENT_BEGIN_WAFER_QTY$>)
|
||||
SRP_JSON(objEvent, 'SetValue', 'EventEndWaferQty', EventRec<LOT_EVENT_EVENT_END_WAFER_QTY$>)
|
||||
SRP_JSON(objEvent, 'SetValue', 'EventOperationId', EventRec<LOT_EVENT_EVENT_OPERATION_ID$>)
|
||||
SRP_JSON(objEvent, 'SetValue', 'EventOperatorId', EventRec<LOT_EVENT_EVENT_OPERATOR_ID$>)
|
||||
SRP_JSON(objEvent, 'SetValue', 'Sequence', EventRec<LOT_EVENT_SEQUENCE$>)
|
||||
SRP_JSON(EventsArrayJson, 'Add', objEvent)
|
||||
SRP_JSON(objEvent, 'Release')
|
||||
end
|
||||
Next LotEventKey
|
||||
SRP_JSON(objLot, 'Set', 'LotEvents', EventsArrayJson)
|
||||
SRP_JSON(EventsArrayJson, 'Release')
|
||||
end else
|
||||
ErrorMessage = 'Error Creating Events JSON Array'
|
||||
end
|
||||
//Operations Array
|
||||
OperationsArrayJson = ''
|
||||
If SRP_Json(OperationsArrayJson, 'New', 'Array') then
|
||||
LotOperationKeys = Lot_Services('GetLotOperationSequence', LotId)
|
||||
for each LotOperationKey in LotOperationKeys using @FM
|
||||
objOperation = ''
|
||||
OperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationKey)
|
||||
If SRP_Json(objOperation, 'New', 'Object') then
|
||||
SRP_JSON(objOperation, 'SetValue', 'LotOperationId', LotOperationKey)
|
||||
SRP_JSON(objOperation, 'SetValue', 'LotId', OperationRec<LOT_OPERATION_LOT_ID$>)
|
||||
SRP_JSON(objOperation, 'SetValue', 'OperationId', OperationRec<LOT_OPERATION_OPERATION_ID$>)
|
||||
SRP_JSON(objOperation, 'SetValue', 'DatetimeIn', OConv(OperationRec<LOT_OPERATION_DATETIME_IN$>, 'DT'))
|
||||
SRP_JSON(objOperation, 'SetValue', 'DatetimeOut', Oconv(OperationRec<LOT_OPERATION_DATETIME_OUT$>, 'DT'))
|
||||
SRP_JSON(objOperation, 'SetValue', 'EquipmentId', OperationRec<LOT_OPERATION_EQUIPMENT_ID$>)
|
||||
SRP_JSON(objOperation, 'SetValue', 'WaferInQty', OperationRec<LOT_OPERATION_WAFER_IN_QTY$>)
|
||||
SRP_JSON(objOperation, 'SetValue', 'WaferOutQty', OperationRec<LOT_OPERATION_WAFER_OUT_QTY$>)
|
||||
SRP_JSON(objOperation, 'SetValue', 'OperatorInId', OperationRec<LOT_OPERATION_OPERATOR_IN_ID$>)
|
||||
SRP_JSON(objOperation, 'SetValue', 'OperatorOutId', OperationRec<LOT_OPERATION_OPERATOR_OUT_ID$>)
|
||||
SRP_JSON(objOperation, 'SetValue', 'OperationSequence', OperationRec<LOT_OPERATION_OPERATION_SEQUENCE$>)
|
||||
SRP_JSON(objOperation, 'SetValue', 'Rework', OperationRec<LOT_OPERATION_REWORK$>)
|
||||
SRP_JSON(objOperation, 'SetValue', 'DatetimeStart', OConv(OperationRec<LOT_OPERATION_DATETIME_START$>, 'DT'))
|
||||
SRP_JSON(objOperation, 'SetValue', 'DatetimeStop', OConv(OperationRec<LOT_OPERATION_DATETIME_STOP$>, 'DT'))
|
||||
SRP_JSON(OperationsArrayJson, 'Add', objOperation)
|
||||
SRP_JSON(objOperation, 'Release')
|
||||
end
|
||||
|
||||
Next LotOperationKey
|
||||
SRP_JSON(objLot, 'Set', 'LotOperations', OperationsArrayJson)
|
||||
SRP_JSON(OperationsArrayJson, 'Release')
|
||||
end else
|
||||
ErrorMessage = 'Error Creating Operations JSON Array'
|
||||
end
|
||||
end
|
||||
|
||||
SRP_JSON(objJSON, 'Set', 'Lot', objLot)
|
||||
SRP_JSON(objLot, 'Release')
|
||||
end else
|
||||
ErrorMessage = 'Error creating new Lot Json Object'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error reading ':LotId:' from lot table.'
|
||||
end
|
||||
JsonString = SRP_JSON(objJSON, 'Stringify', 'Styled')
|
||||
SRP_JSON(objJSON, 'Release')
|
||||
end else
|
||||
ErrorMessage = 'Error creating new Json Object'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Invalid or null lot number passed to routine.'
|
||||
end
|
||||
If ErrorMessage NE '' then
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
Response = JsonString
|
||||
end service
|
||||
|
||||
|
104
LSL2/STPROC/NDW_LOG_TEST_WAFER_USAGE_EVENTS.txt
Normal file
104
LSL2/STPROC/NDW_LOG_TEST_WAFER_USAGE_EVENTS.txt
Normal file
@ -0,0 +1,104 @@
|
||||
Compile function NDW_LOG_TEST_WAFER_USAGE_EVENTS(CtrlEntId, Event, @PARAMS)
|
||||
#pragma precomp SRP_PreCompiler
|
||||
#window NDW_LOG_TEST_WAFER_USAGE
|
||||
|
||||
Declare function Get_Property, Error_Services, Test_Run_Services, Reactor_Services, Tool_Services
|
||||
Declare subroutine Set_Property, Error_Services
|
||||
|
||||
$Insert LOGICAL
|
||||
$Insert TEST_RUN_EQUATES
|
||||
$Insert RDS_EQUATES
|
||||
|
||||
GoToEvent Event for CtrlEntId else
|
||||
// Event not implemented
|
||||
end
|
||||
|
||||
Return EventFlow or 1
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// EVENT HANDLERS
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Event WINDOW.CREATE(CreateParam)
|
||||
GoSub FillFormMasterData
|
||||
debug
|
||||
PresetRDSNo = ''
|
||||
PresetTestType = ''
|
||||
PresetEquipmentType = ''
|
||||
PresetEquipmentId = ''
|
||||
If CreateParam NE '' then
|
||||
RDSNo = CreateParam<1, 1>
|
||||
PresetTestType = CreateParam<1, 2>
|
||||
PresetEquipmentType = CreateParam<1, 3>
|
||||
PresetEquipmentId = CreateParam<1, 4>
|
||||
end
|
||||
If RDSNo NE '' AND RowExists('RDS', RDSNo) then
|
||||
PSN = XLATE('RDS', RDSNo, RDS_PROD_SPEC_ID$, 'X')
|
||||
Set_Property(@Window : '.EDL_RDS', 'TEXT', RDSNo)
|
||||
Set_Property(@Window : '.EDL_PSN', 'TEXT', PSN)
|
||||
Set_Property(@Window : '.EDL_PSN', 'ENABLED', False$)
|
||||
end
|
||||
If PresetTestType NE '' then
|
||||
Begin Case
|
||||
Case PresetTestType EQ 'STANDARD'
|
||||
Set_Property(@Window : '.CMB_TEST_TYPE', 'TEXT', 'Standard Sampling')
|
||||
End Case
|
||||
end
|
||||
If PresetEquipmentType NE '' then
|
||||
Begin Case
|
||||
Case PresetEquipmentType EQ 'Reactor'
|
||||
Set_Property(@Window : '.CMB_EQUIP_TYPE', 'TEXT', 'Reactor')
|
||||
Case PresetEquipmentType EQ 'Non-Reactor'
|
||||
Set_Property(@Window : '.CMB_EQUIP_TYPE', 'TEXT', 'Tool')
|
||||
End Case
|
||||
end
|
||||
If PresetEquipmentId NE '' then
|
||||
SelectedEquipType = Get_Property(@Window : '.CMB_EQUIP_TYPE', 'TEXT')
|
||||
Begin Case
|
||||
Case SelectedEquipType EQ 'Reactor'
|
||||
If RowExists('REACTOR', PresetEquipmentId) then
|
||||
Set_Property(@Window : '.CMB_EQUIPMENT_ID', 'TEXT', PresetEquipmentId)
|
||||
end
|
||||
Case SelectedEquipType EQ 'Non-Reactor'
|
||||
If RowExists('REACTOR', PresetEquipmentId) then
|
||||
Set_Property(@Window : '.CMB_EQUIPMENT_ID', 'TEXT', PresetEquipmentId)
|
||||
end
|
||||
End Case
|
||||
end
|
||||
EventFlow = 1
|
||||
|
||||
End Event
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Internal GoSubs
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
FillFormMasterData:
|
||||
//Get Test run type options. Populate to CMB_TEST_TYPE
|
||||
TestRunTypeList = Test_Run_Services('GetAllTestRunTypes')
|
||||
Set_Property(@Window, '@RUN_TYPE_OPTS', TestRunTypeList)
|
||||
TestRunTypeOpts = ''
|
||||
for each TestRunID in TestRunTypeList<1> using @VM setting tPos
|
||||
TestRunName = TestRunTypeList<2, tPos>
|
||||
TestRunTypeOpts<-1> = TestRunName
|
||||
Next TestRunID
|
||||
Set_Property(@Window : '.CMB_TEST_TYPE', 'LIST', TestRunTypeOpts)
|
||||
|
||||
//Get Tool and Reactor Identifiers and buffer them in user defined window properties @REACTOR_OPTS and @NON_REACTOR_OPTS
|
||||
//Reactors
|
||||
ReactorOpts = Reactor_Services('GetReactorNumbers')
|
||||
//Set_Property(@Window : '.EDT_REACTORS', 'TEXT', ReactorOpts)
|
||||
Set_Property(@Window, '@REACTOR_OPTS', ReactorOpts)
|
||||
|
||||
//Non Reactors
|
||||
NonReactorOpts = Tool_Services('GetAllTools')
|
||||
swap @VM with @FM in NonReactorOpts
|
||||
Set_Property(@Window : '.EDT_NON_REACTORS', 'TEXT', NonReactorOpts)
|
||||
Set_Property(@Window, '@NON_REACTOR_OPTS', NonReactorOpts)
|
||||
//Then set the inital combo list to be filled with reactors because that is the default.
|
||||
Set_Property(@Window : '.CMB_EQUIPMENT_ID', 'LIST', ReactorOpts)
|
||||
//Get TW Products and store them in user defined window property @TW_PROD_OPTS
|
||||
Prods = Test_Run_Services('GetAllTWProdKeys', 1)
|
||||
Set_Property(@Window, '@TW_PROD_OPTS', Prods)
|
||||
Return
|
||||
|
90
LSL2/STPROC/NDW_TW_LOT_CREATE_EVENTS.txt
Normal file
90
LSL2/STPROC/NDW_TW_LOT_CREATE_EVENTS.txt
Normal file
@ -0,0 +1,90 @@
|
||||
Compile function NDW_TW_LOT_CREATE_EVENTS(CtrlEntId, Event, @PARAMS)
|
||||
#pragma precomp SRP_PreCompiler
|
||||
#window NDW_TW_LOT_CREATE
|
||||
|
||||
Declare function Get_Property, Lot_Services, Error_Services
|
||||
Declare subroutine Set_Property, Msg
|
||||
|
||||
$Insert LOGICAL
|
||||
|
||||
GoToEvent Event for CtrlEntId else
|
||||
// Event not implemented
|
||||
end
|
||||
|
||||
Return EventFlow or 1
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// EVENT HANDLERS
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Event WINDOW.CREATE(CreateParam)
|
||||
|
||||
EventFlow = 1
|
||||
|
||||
End Event
|
||||
|
||||
Event EDL_PROD_NAME.LOSTFOCUS(Flag, FocusID)
|
||||
ProdNameVal = Get_Property(@Window : '.EDL_PROD_NAME', 'TEXT')
|
||||
If ProdNameVal[1, 1] EQ 'P' then
|
||||
ProdNameVal[1,1] = ''
|
||||
end
|
||||
Set_Property(@Window : '.EDL_PROD_NAME', 'TEXT', ProdNameVal)
|
||||
Set_Property(@Window:'.EDL_WAFER_QTY', 'FOCUS', True$)
|
||||
end event
|
||||
|
||||
Event EDL_WAFER_QTY.LOSTFOCUS(Flag, FocusID)
|
||||
QtyVal = Get_Property(@Window : '.EDL_WAFER_QTY', 'TEXT')
|
||||
If QtyVal[1, 1] EQ 'Q' then
|
||||
QtyVal[1,1] = ''
|
||||
end
|
||||
If Num(QtyVal) then
|
||||
Set_Property(@Window : '.EDL_WAFER_QTY', 'TEXT', QtyVal)
|
||||
Set_Property(@Window:'.EDL_VENDOR_LOT_NO', 'FOCUS', True$)
|
||||
end else
|
||||
Msg(@Window, 'Quantity must be a number.')
|
||||
Set_Property(@Window:'.EDL_WAFER_QTY', 'TEXT', '')
|
||||
Set_Property(@Window:'.EDL_WAFER_QTY', 'FOCUS', True$)
|
||||
end
|
||||
end event
|
||||
|
||||
Event PUB_SUBMIT.CLICK()
|
||||
debug
|
||||
ThisProdName = Get_Property(@Window : '.EDL_PROD_NAME', 'TEXT')
|
||||
ThisQuantity = Get_Property(@Window : '.EDL_WAFER_QTY', 'TEXT')
|
||||
If ThisProdName NE '' then
|
||||
If ThisQuantity NE '' then
|
||||
CreatedLotID = Lot_Services('CreateNewTestWaferLot', 'TW', ThisProdName, ThisQuantity, '', '', '', @USER4)
|
||||
If CreatedLotID NE '' then
|
||||
Msg(@Window, CreatedLotID : ' successfully created')
|
||||
GoSub ResetForm
|
||||
end else
|
||||
If Error_Services('HasError') then
|
||||
//Known error, get the message
|
||||
end else
|
||||
Msg(@Window, 'Unspecified error created new test wafer lot.')
|
||||
end
|
||||
end
|
||||
end else
|
||||
//Error: Qty was empty
|
||||
end
|
||||
end else
|
||||
//Error: Prod Name was empty
|
||||
end
|
||||
|
||||
end event
|
||||
|
||||
|
||||
* * * * * * * * * * *
|
||||
* Internal Go-Subs *
|
||||
* * * * * * * * * * *
|
||||
|
||||
ResetForm:
|
||||
Set_Property(@Window: '.EDL_PROD_NAME', 'TEXT', '')
|
||||
Set_Property(@Window: '.EDL_WAFER_QTY', 'TEXT', '')
|
||||
Set_Property(@Window: '.EDL_VENDOR_LOT_NO', 'TEXT', '')
|
||||
Set_Property(@Window: '.EDL_VENDOR_PROD_ORDER_NO', 'TEXT', '')
|
||||
Set_Property(@Window: '.EDL_VENDOR_CODE', 'TEXT', '')
|
||||
Set_Property(@Window: '.EDL_PROD_NAME', 'FOCUS', True$)
|
||||
return
|
||||
|
||||
|
102
LSL2/STPROC/NDW_VIEW_LOT_EVENTS.txt
Normal file
102
LSL2/STPROC/NDW_VIEW_LOT_EVENTS.txt
Normal file
@ -0,0 +1,102 @@
|
||||
Compile function NDW_VIEW_LOT_EVENTS(CtrlEntId, Event, @PARAMS)
|
||||
#pragma precomp SRP_PreCompiler
|
||||
#window NDW_VIEW_LOT
|
||||
|
||||
Declare function Get_Property, Lot_Services, Database_Services
|
||||
Declare subroutine Set_Property
|
||||
|
||||
$Insert LOT_EQUATES
|
||||
$Insert LOT_OPERATION_EQUATES
|
||||
$Insert LOT_EVENT_EQUATES
|
||||
|
||||
GoToEvent Event for CtrlEntId else
|
||||
// Event not implemented
|
||||
end
|
||||
|
||||
Return EventFlow or 1
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// EVENT HANDLERS
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Event WINDOW.CREATE(CreateParam)
|
||||
GoSub SetupFormControls
|
||||
|
||||
End Event
|
||||
|
||||
Event EDL_LOT_ID.LOSTFOCUS(Flag, FocusID)
|
||||
GoSub GetLot
|
||||
end event
|
||||
|
||||
Event PUB_SEARCH_LOT.CLICK()
|
||||
GoSub GetLot
|
||||
end event
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// INTERNAL GO-SUBS
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
SetupFormControls:
|
||||
LabelFont = Get_Property(@Window : '.LBL_LOT_ID', 'FONT')
|
||||
LabelFont<1,1,2> = -20
|
||||
LabelFont<1,1,6> = 10
|
||||
Set_Property(@Window : '.LBL_LOT_ID', 'FONT', LabelFont)
|
||||
Set_Property(@Window : '.LBL_CURR_OPERATION', 'FONT', LabelFont)
|
||||
EditLineFont = Get_Property(@Window : '.EDL_LOT_ID', 'FONT')
|
||||
EditLineFont<1,1,2> = -20
|
||||
EditLineFont<1,1,6> = 10
|
||||
Set_Property(@Window : '.EDL_LOT_ID', 'FONT', EditLineFont)
|
||||
Set_Property(@Window : '.EDL_LOT_ID', 'FONT', EditLineFont)
|
||||
Set_Property(@Window : '.EDL_CURR_OPERATION', 'FONT', EditLineFont)
|
||||
return
|
||||
|
||||
GetLot:
|
||||
//Get Lot
|
||||
LotIdText = Get_Property(@Window : '.EDL_LOT_ID', 'TEXT')
|
||||
If LotIdText[1, 2] EQ '1T' then
|
||||
LotIdText[1,2] = ''
|
||||
end
|
||||
Set_Property(@Window : '.EDL_LOT_ID', 'TEXT', LotIdText)
|
||||
If RowExists('LOT', LotIdText) then
|
||||
ThisLotId = LotIdText
|
||||
ThisLotRec = Database_Services('ReadDataRow', 'LOT', ThisLotId)
|
||||
ThisLotCurrOperationID = Lot_Services('GetLotCurrOperation', ThisLotId)
|
||||
ThisLotCurrOperationName = Xlate('LOT_OPERATION', ThisLotCurrOperationId, LOT_OPERATION_OPERATION_ID$, 'X')
|
||||
|
||||
//Lot Operation Status'
|
||||
LotOperationsInSequence = Lot_Services('GetLotOperationSequence', ThisLotId)
|
||||
LotOperationTableData = ''
|
||||
For each LotOperation in LotOperationsInSequence using @FM setting dPos
|
||||
LotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperation)
|
||||
LotOperationTableData<1, -1> = LotOperationRec<LOT_OPERATION_OPERATION_ID$>
|
||||
LotOperationTableData<2, -1> = LotOperationRec<LOT_OPERATION_OPERATOR_IN_ID$>
|
||||
LotOperationTableData<3, -1> = Oconv(LotOperationRec<LOT_OPERATION_DATETIME_IN$>, 'DT')
|
||||
LotOperationTableData<4, -1> = LotOperationRec<LOT_OPERATION_WAFER_IN_QTY$>
|
||||
LotOperationTableData<5, -1> = LotOperationRec<LOT_OPERATION_OPERATOR_OUT_ID$>
|
||||
LotOperationTableData<6, -1> = Oconv(LotOperationRec<LOT_OPERATION_DATETIME_OUT$>, 'DT')
|
||||
LotOperationTableData<7, -1> = LotOperationRec<LOT_OPERATION_WAFER_OUT_QTY$>
|
||||
Next LotOperation
|
||||
|
||||
//Lot Event Status'
|
||||
LotEventsInSequence = Lot_Services('GetLotEventsInSequence', ThisLotId)
|
||||
LotEventTableData = ''
|
||||
For each LotEvent in LotEventsInSequence using @FM
|
||||
LotEventRec = Database_Services('ReadDataRow', 'LOT_EVENT', LotEvent)
|
||||
ThisEventSequence = LotEventRec<LOT_EVENT_SEQUENCE$>
|
||||
LotEventTableData<1, ThisEventSequence> = OConv(LotEventRec<LOT_EVENT_EVENT_DATETIME$>, 'DT')
|
||||
LotEventTableData<2, ThisEventSequence> = LotEventRec<LOT_EVENT_LOT_EVENT_TYPE$>
|
||||
LotEventTableData<3, ThisEventSequence> = LotEventRec<LOT_EVENT_EVENT_OPERATOR_ID$>
|
||||
LotEventTableData<4, ThisEventSequence> = LotEventRec<LOT_EVENT_EVENT_OPERATION_ID$>
|
||||
LotEventTableData<5, ThisEventSequence> = LotEventRec<LOT_EVENT_EVENT_NOTE$>
|
||||
Next LotEvent
|
||||
|
||||
//Fill form
|
||||
Set_Property(@Window : '.EDL_CURR_OPERATION', 'TEXT', ThisLotCurrOperationName)
|
||||
Set_Property(@Window : '.EDT_LOT_OPERATIONS', 'ARRAY', LotOperationTableData)
|
||||
Set_Property(@Window : '.EDT_LOT_EVENTS', 'ARRAY', LotEventTableData)
|
||||
end else
|
||||
//Error: Lot did not exist
|
||||
end
|
||||
return
|
||||
|
23
LSL2/STPROC/PRODUCT_SERVICES.txt
Normal file
23
LSL2/STPROC/PRODUCT_SERVICES.txt
Normal file
@ -0,0 +1,23 @@
|
||||
Compile function Product_Services(@Service, @Params)
|
||||
#pragma precomp SRP_PreCompiler
|
||||
$insert LOGICAL
|
||||
|
||||
GoToService
|
||||
|
||||
Return Response or ""
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// SERVICES
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Service DoSomething()
|
||||
|
||||
Response = "Hello, World!"
|
||||
|
||||
End Service
|
||||
|
||||
Service DoSomethingWithParameters(Input, Ref Output)
|
||||
|
||||
Output = Input:", World!"
|
||||
|
||||
End Service
|
134
LSL2/STPROC/TESTWAFERPROD_API.txt
Normal file
134
LSL2/STPROC/TESTWAFERPROD_API.txt
Normal file
@ -0,0 +1,134 @@
|
||||
Function Testwaferprod_API(@API)
|
||||
/***********************************************************************************************************************
|
||||
|
||||
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
|
||||
permission from SRP Computer Solutions, Inc.
|
||||
|
||||
Name : Testwaferprod_API
|
||||
|
||||
Description : API logic for the Testwaferprod resource.
|
||||
|
||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
||||
|
||||
HTTPMethod - The HTTP Method (Verb) submitted by the client (e.g., GET, POST, etc.)
|
||||
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||
FullEndpointURL - The URL submitted by the client, including query params.
|
||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||
EndpointSegment - The URL endpoint segment.
|
||||
ParentURL - The URL path preceeding the current endpoint.
|
||||
CurrentAPI - The name of this stored procedure.
|
||||
|
||||
Parameters :
|
||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||
- APIPattern must follow this structure Testwaferprod[.ID.[<Property>]]
|
||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||
Examples:
|
||||
- Testwaferprod.POST
|
||||
- Testwaferprod.ID.PUT
|
||||
- Testwaferprod.ID.firstName.GET
|
||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
||||
services do not rely upon anything being returned in the response. This is what the
|
||||
various services like SetResponseBody and SetResponseStatus services are for. A response
|
||||
value is only helpful if the developers want to use it for debug purposes.
|
||||
|
||||
History : (Date, Initials, Notes)
|
||||
10/23/24 xxx Original programmer.
|
||||
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
Declare function Test_Wafer_Prod_Services, OI_WIZARD_SERVICES
|
||||
|
||||
$insert APP_INSERTS
|
||||
$insert API_SETUP
|
||||
$insert HTTP_INSERTS
|
||||
$Insert LOGICAL
|
||||
|
||||
GoToAPI else
|
||||
// The specific resource endpoint doesn't have a API handler yet.
|
||||
HTTP_Services('SetResponseStatus', 204, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||
end
|
||||
|
||||
Return Response OR ''
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Endpoint Handlers
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
API testwaferprod.HEAD
|
||||
API testwaferprod.GET
|
||||
|
||||
OIWizardID = ''
|
||||
Cookies = HTTP_Services('GetHTTPCookie')
|
||||
For each Cookie in Cookies using ';'
|
||||
Key = Field(Cookie, '=', 1)
|
||||
If Key EQ 'sessionID' then
|
||||
OIWizardID = Field(Cookie, '=', 2)
|
||||
end
|
||||
Next Cookie
|
||||
|
||||
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
||||
If ValidSession then
|
||||
//Send back list of printers
|
||||
|
||||
StatusCode = 201
|
||||
Message = 'Success'
|
||||
GoSub CreateHALCollection
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
||||
end
|
||||
|
||||
end api
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
// CreateHALCollection
|
||||
//
|
||||
// Creates a HAL+JSON object based on OpenInsight data row representations.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
CreateHALCollection:
|
||||
|
||||
JSONCollection = ''
|
||||
Abort = False$
|
||||
TestWaferProdList = Test_Wafer_Prod_Services('GetAllTestWaferProdIDs', True$)
|
||||
hJSONCollection = ''
|
||||
If SRP_JSON(hJSONCollection, 'New', 'Object') then
|
||||
hTestWaferProdIdArray = ''
|
||||
If SRP_JSON(hTestWaferProdIdArray, 'New', 'Array') then
|
||||
For each TWProdId in TestWaferProdList using @FM setting fPos
|
||||
ReactorJSON = Test_Wafer_Prod_Services('ConvertRecordToJSON', TWProdId)
|
||||
If Error_Services('NoError') then
|
||||
hTWProd = ''
|
||||
If (SRP_JSON(hTWProd, 'Parse', ReactorJSON) EQ '') then
|
||||
SRP_JSON(hTestWaferProdIdArray, 'Add', hTWProd)
|
||||
SRP_JSON(hTWProd, 'Release')
|
||||
end
|
||||
end else
|
||||
Abort = True$
|
||||
end
|
||||
Until Abort
|
||||
Next TWProdId
|
||||
If Abort EQ False$ then
|
||||
SRP_JSON(hJSONCollection, 'Set', 'TestWaferProdIds', hTestWaferProdIdArray)
|
||||
end
|
||||
SRP_JSON(hTestWaferProdIdArray, 'Release')
|
||||
end
|
||||
JSONCollection = SRP_JSON(hJSONCollection, 'Stringify', 'Styled')
|
||||
SRP_JSON(hJSONCollection, 'Release')
|
||||
end
|
||||
If Error_Services('NoError') then
|
||||
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||
HTTP_Services('SetResponseBody', JSONCollection, False$, 'application/hal+json')
|
||||
If Assigned(Message) then
|
||||
HTTP_Services('SetResponseStatus', StatusCode, Message)
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', StatusCode)
|
||||
end
|
||||
end else
|
||||
Message = Error_Services('GetMessage')
|
||||
HTTP_Services('SetResponseStatus', 500, 'Error in the ' : CurrentAPI : ' API. Message: ': Message)
|
||||
end
|
||||
|
||||
return
|
64
LSL2/STPROC/TEST_WAFER_PROD_SERVICES.txt
Normal file
64
LSL2/STPROC/TEST_WAFER_PROD_SERVICES.txt
Normal file
@ -0,0 +1,64 @@
|
||||
Compile function Test_Wafer_Prod_Services(@Service, @Params)
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
Declare function Database_Services, SRP_JSON
|
||||
Declare Subroutine Btree.Extract, SRP_JSON, Error_Services, Rlist
|
||||
|
||||
$insert LOGICAL
|
||||
$insert TEST_WAFER_PROD_EQUATES
|
||||
|
||||
GoToService
|
||||
|
||||
Return Response or ""
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// SERVICES
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Service GetAllTestWaferProdIDs(ShowSorted)
|
||||
keylist = ''
|
||||
ProdList = ''
|
||||
If ShowSorted then
|
||||
RList("SELECT TEST_WAFER_PROD WITH SORT_ORDER NE 0 AND WITH SORT_ORDER NE '' BY SORT_ORDER", 5, '', '', '')
|
||||
end else
|
||||
RList("SELECT TEST_WAFER_PROD BY SORT_ORDER", 5, '', '', '')
|
||||
end
|
||||
Done = False$
|
||||
Loop
|
||||
Readnext TWProdKey else Done = True$
|
||||
Until Done
|
||||
keylist<-1> = TWProdKey
|
||||
Repeat
|
||||
Response = keylist
|
||||
end service
|
||||
|
||||
Service GetTestWaferProdIDsByPartName(PartName)
|
||||
TWPartIDs = ''
|
||||
OPEN 'DICT.TEST_WAFER_PROD' TO DictVar THEN
|
||||
SearchString = 'PART_NAME':@VM:PartName:@FM
|
||||
Flag = ''
|
||||
Btree.Extract(SearchString, 'TEST_WAFER_PROD', DictVar, TWPartIDs, '', Flag)
|
||||
end else
|
||||
Error_Services('Add', 'Error opening TEST_WAFER_PROD dictionary')
|
||||
end
|
||||
Response = TWPartIDs
|
||||
|
||||
End Service
|
||||
|
||||
Service ConvertRecordToJson(TWProdId)
|
||||
JSON = ''
|
||||
TWProdRec = Database_Services('ReadDataRow', 'TEST_WAFER_PROD', TWProdId)
|
||||
If SRP_JSON(hJSONCollection, 'New', 'Object') then
|
||||
hTWProdObj = ''
|
||||
If SRP_Json(hTWProdObj, 'New', 'Object') then
|
||||
SRP_JSON(hTWProdObj, 'SetValue', 'TestWaferProdId', TWProdId)
|
||||
SRP_JSON(hTWProdObj, 'SetValue', 'TestWaferPartName', TWProdRec<TEST_WAFER_PROD_PART_NAME$>)
|
||||
SRP_JSON(hJSONCollection, 'Set', 'TEST_WAFER_PROD', hTWProdObj)
|
||||
SRP_JSON(hTWProdObj, 'Release')
|
||||
end
|
||||
JSON = SRP_JSON(hJSONCollection, 'Stringify', 'Styled')
|
||||
SRP_JSON(hJSONCollection, 'Release')
|
||||
end
|
||||
|
||||
Response = JSON
|
||||
End Service
|
20
LSL2/STPROCINS/LOT_EQUATES.txt
Normal file
20
LSL2/STPROCINS/LOT_EQUATES.txt
Normal file
@ -0,0 +1,20 @@
|
||||
compile insert LOT_EQUATES
|
||||
/*----------------------------------------
|
||||
Author : Table Create Insert Routine
|
||||
Written : 11/10/2024
|
||||
Description : Insert for Table LOT
|
||||
----------------------------------------*/
|
||||
#ifndef __LOT_EQUATES__
|
||||
#define __LOT_EQUATES__
|
||||
|
||||
equ LOT_TYPE$ to 1
|
||||
equ LOT_PROD_ID$ to 2
|
||||
equ LOT_ORIG_WAFER_QTY$ to 3
|
||||
equ LOT_WAFER_QTY$ to 4
|
||||
equ LOT_VENDOR_PART_NO$ to 5
|
||||
equ LOT_VENDOR_LOT_NO$ to 6
|
||||
equ LOT_VENDOR_CODE$ to 7
|
||||
equ LOT_LOT_EVENTS$ to 8
|
||||
equ LOT_LOT_OPERATIONS$ to 9
|
||||
|
||||
#endif
|
23
LSL2/STPROCINS/LOT_EVENT_EQUATES.txt
Normal file
23
LSL2/STPROCINS/LOT_EVENT_EQUATES.txt
Normal file
@ -0,0 +1,23 @@
|
||||
compile insert LOT_EVENT_EQUATES
|
||||
/*----------------------------------------
|
||||
Author : Table Create Insert Routine
|
||||
Written : 16/10/2024
|
||||
Description : Insert for Table LOT_EVENT
|
||||
----------------------------------------*/
|
||||
#ifndef __LOT_EVENT_EQUATES__
|
||||
#define __LOT_EVENT_EQUATES__
|
||||
|
||||
equ LOT_EVENT_LOT_ID$ to 1
|
||||
equ LOT_EVENT_LOT_EVENT_TYPE$ to 2
|
||||
equ LOT_EVENT_EVENT_DATETIME$ to 3
|
||||
equ LOT_EVENT_EVENT_NOTE$ to 4
|
||||
equ LOT_EVENT_EQUIPMENT_ID$ to 5
|
||||
equ LOT_EVENT_EVENT_REDUCE_WAFER_QTY$ to 6
|
||||
equ LOT_EVENT_EVENT_BONUS_WAFER_QTY$ to 7
|
||||
equ LOT_EVENT_EVENT_BEGIN_WAFER_QTY$ to 8
|
||||
equ LOT_EVENT_EVENT_END_WAFER_QTY$ to 9
|
||||
equ LOT_EVENT_EVENT_OPERATION_ID$ to 10
|
||||
equ LOT_EVENT_EVENT_OPERATOR_ID$ to 11
|
||||
equ LOT_EVENT_SEQUENCE$ to 12
|
||||
|
||||
#endif
|
24
LSL2/STPROCINS/LOT_OPERATION_EQUATES.txt
Normal file
24
LSL2/STPROCINS/LOT_OPERATION_EQUATES.txt
Normal file
@ -0,0 +1,24 @@
|
||||
compile insert LOT_OPERATION_EQUATES
|
||||
/*----------------------------------------
|
||||
Author : Table Create Insert Routine
|
||||
Written : 14/10/2024
|
||||
Description : Insert for Table LOT_OPERATION
|
||||
----------------------------------------*/
|
||||
#ifndef __LOT_OPERATION_EQUATES__
|
||||
#define __LOT_OPERATION_EQUATES__
|
||||
|
||||
equ LOT_OPERATION_LOT_ID$ to 1
|
||||
equ LOT_OPERATION_OPERATION_ID$ to 2
|
||||
equ LOT_OPERATION_DATETIME_IN$ to 3
|
||||
equ LOT_OPERATION_DATETIME_OUT$ to 4
|
||||
equ LOT_OPERATION_EQUIPMENT_ID$ to 5
|
||||
equ LOT_OPERATION_WAFER_IN_QTY$ to 6
|
||||
equ LOT_OPERATION_WAFER_OUT_QTY$ to 7
|
||||
equ LOT_OPERATION_OPERATOR_IN_ID$ to 8
|
||||
equ LOT_OPERATION_OPERATOR_OUT_ID$ to 9
|
||||
equ LOT_OPERATION_OPERATION_SEQUENCE$ to 10
|
||||
equ LOT_OPERATION_REWORK$ to 11
|
||||
equ LOT_OPERATION_DATETIME_START$ to 12
|
||||
equ LOT_OPERATION_DATETIME_STOP$ to 13
|
||||
|
||||
#endif
|
11
LSL2/STPROCINS/OPERATION_EQUATES.txt
Normal file
11
LSL2/STPROCINS/OPERATION_EQUATES.txt
Normal file
@ -0,0 +1,11 @@
|
||||
compile insert OPERATION_EQUATES
|
||||
/*----------------------------------------
|
||||
Author : Table Create Insert Routine
|
||||
Written : 10/10/2024
|
||||
Description : Insert for Table OPERATION
|
||||
----------------------------------------*/
|
||||
#ifndef __OPERATION_EQUATES__
|
||||
#define __OPERATION_EQUATES__
|
||||
|
||||
|
||||
#endif
|
15
LSL2/STPROCINS/PRODUCT_OPERATION_EQUATES.txt
Normal file
15
LSL2/STPROCINS/PRODUCT_OPERATION_EQUATES.txt
Normal file
@ -0,0 +1,15 @@
|
||||
compile insert PRODUCT_OPERATION_EQUATES
|
||||
/*----------------------------------------
|
||||
Author : Table Create Insert Routine
|
||||
Written : 11/10/2024
|
||||
Description : Insert for Table PRODUCT_OPERATION
|
||||
----------------------------------------*/
|
||||
#ifndef __PRODUCT_OPERATION_EQUATES__
|
||||
#define __PRODUCT_OPERATION_EQUATES__
|
||||
|
||||
equ PRODUCT_OPERATION_PROD_ID$ to 1
|
||||
equ PRODUCT_OPERATION_OPERATION_ID$ to 2
|
||||
equ PRODUCT_OPERATION_OPERATION_SEQUENCE$ to 3
|
||||
equ PRODUCT_OPERATION_TEST_WAFER_PROD_ID$ to 4
|
||||
|
||||
#endif
|
@ -1,15 +1,16 @@
|
||||
compile insert TEST_WAFER_PROD_EQUATES
|
||||
/*----------------------------------------
|
||||
Author : Table Create Insert Routine
|
||||
Written : 17/11/2023
|
||||
Written : 11/10/2024
|
||||
Description : Insert for Table TEST_WAFER_PROD
|
||||
----------------------------------------*/
|
||||
#ifndef __TEST_WAFER_PROD_EQUATES__
|
||||
#define __TEST_WAFER_PROD_EQUATES__
|
||||
|
||||
equ TEST_WAFER_PROD_PART_NAME$ to 1
|
||||
equ TEST_WAFER_PROD_WAFER_DISPO_IDS$ to 2
|
||||
equ TEST_WAFER_PROD_USAGE$ to 3
|
||||
equ TEST_WAFER_PROD_SORT_ORDER$ to 4
|
||||
equ TEST_WAFER_PROD_PRODUCT_OPERATIONS$ to 5
|
||||
|
||||
Equ TEST_WAFER_PROD_TEST_WAFER_PROD_ID$ To 0
|
||||
Equ TEST_WAFER_PROD_PART_NAME$ To 1
|
||||
Equ TEST_WAFER_PROD_WAFER_DISPO_IDS$ To 2
|
||||
Equ TEST_WAFER_PROD_USAGE$ To 3
|
||||
Equ TEST_WAFER_PROD_SORT_ORDER$ To 4
|
||||
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user