Compile function RDS_TEST_Services(@Service, @Params) /*********************************************************************************************************************** Name : Rds_Test_Services Description : Handler program for all RDS_TEST services. Notes : Application errors should be logged using the Error Services module. There are a few methodological assumptions built into way errors are managed which are important to understand in order to properly work with Error Services: - The term 'top' refers to the originating procedure of a call stack and the term 'bottom' refers to the last routine (or the current routine) within a call stack. Within the OpenInsight Debugger this will appear backwards since the originating procedure always appears at the bottom of the list and the current routine appears at the top of the list. We are using this orientation because it is common to refer to the process of calling other procedures as 'drilling down'. - The reason for defining the orientation of the call stack is because Error_Services allows for multiple error conditions to be appended to an original error. In most cases this will happen when a procedure at the bottom of the stack generates an error condition and then returns to its calling procedure. This higher level procedure can optionally add more information relevant to itself. This continues as the call stack 'bubbles' its way back to the top to where the originating procedure is waiting. - Native OpenInsight commands that handle errors (e.g., Set_Status, Set_FSError, Set_EventStatus) preserve their error state until explicitly cleared. This can hinder the normal execution of code since subsequent procedures (usually SSPs) will fail if a pre-existing error condition exists. Our philosophy is that error conditions should automatically be cleared before a new procedure is executed to avoid this problem. However, the nature of Basic+ does not make this easy to automate for any given stored procedure. Therefore, if a stored procedure wants to conform to our philosophy then it should include a call into the 'Clear' service request at the top of the program. Alternatively this can be done through a common insert (see SERVICE_SETUP for example.) - Service modules will use the SERVICE_SETUP insert and therefore automatically clear out any error conditions that were set before. Parameters : Service [in] -- Name of the service being requested Param1-10 [in/out] -- Additional request parameter holders Response [out] -- Response to be sent back to the Controller (MCP) or requesting procedure Metadata : History : (Date, Initials, Notes) 09/26/2025 djs Original programmer. ***********************************************************************************************************************/ #pragma precomp SRP_PreCompiler $Insert SERVICE_SETUP $insert APP_INSERTS $Insert RDS_EQUATES $Insert RDS_TEST_EQUATES $Insert PROD_SPEC_EQUATES $Insert RDS_LAYER_EQUATES $INSERT PRS_LAYER_EQU Declare function Database_Services, Error_Services, obj_Prod_Spec Declare subroutine Database_Services, Error_Services GoToService Return Response or "" //----------------------------------------------------------------------------- // SERVICES //----------------------------------------------------------------------------- Service UpdateRDSTestSpecs(RdsNo) ErrorMsg = '' If (RDSNo NE '') then If RowExists('RDS', RDSNo) then RDSRec = Database_Services('ReadDataRow', 'RDS', RDSNo) If Error_Services('NoError') then LayerKeys = RDSRec PSNId = RDSRec For each LayerKey in LayerKeys using @VM setting vPos LayerSet = Field(LayerKey, '*', 2, 1) LayerSpecs = obj_Prod_Spec('GetLayerProp',PSNId:@RM:LayerSet:@RM:1) ;* Last parameter specifies no output conversion on return data LayerSpecs = Field(LayerSpecs,@FM,2,99) ;* Returns with the layer set ID in the first field of each line ErrCode = '' If Not(Get_Status(ErrCode)) then WaferSize = Xlate('PROD_SPEC', PSNId, 'SUB_WAFER_SIZE', 'X') SubOrientation = Xlate('PROD_SPEC', PSNId, 'SUB_ORIENTATION', 'X') ResUnits = LayerSpecs ReactorType = Xlate('PROD_SPEC', PSNId, PROD_SPEC_REACTOR_TYPE$, 'X') ThickFilmMet = Xlate('PROD_SPEC', PSNId, PROD_SPEC_THICKFILM_MET$, 'X') ;* Added 1/16/2009 JCH RdsTestKeys = Database_Services('ReadDataColumn', 'RDS_LAYER', LayerKey, RDS_LAYER_RDS_TEST_KEYS$) If Error_Services('NoError') then For each RdsTestKey in RdsTestKeys using @VM setting RdsTestPos RdsTestRec = Database_Services('ReadDataRow', 'RDS_TEST', RdsTestKey) If Error_Services('NoError') then RDSTestRec = WaferSize RDSTestRec = SubOrientation RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs For A = 11 to 19 RDSTestRec = LayerSpecs Next A For A = 24 to 32 RDSTestRec = LayerSpecs Next A For A = 37 to 45 RDSTestRec = LayerSpecs Next A For A = 50 to 58 RDSTestRec = LayerSpecs Next A For A = 121 to 129 RDSTestRec = LayerSpecs Next A RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = LayerSpecs RDSTestRec = ReactorType If ( (ReactorType EQ 'P') or (ReactorType EQ 'EPP') or (ThickFilmMet EQ True$) ) then SpecMap = XLATE('PROD_SPEC', PSNId, PROD_SPEC_TEST_POINT_MAP$, 'X') ;* Added 4/8/2009 JCH new field in PROD_SPEC If SpecMap NE '' then RDSTestRec = SpecMap end else ;* Added ThickFilmMet check - 1/16/2009 JCH AllTargetThicks = XLATE('PROD_SPEC', PSNId, 'THICK_TARGET_ALL', 'X') TargetCnt = COUNT(AllTargetThicks,@VM) + (AllTargetThicks NE '') Begin Case Case TargetCnt = 2 CombinedThick = SUM(AllTargetThicks) Case TargetCnt = 1 OR TargetCnt = 3 CombinedThick = AllTargetThicks[-1,'B':@VM] End Case If OCONV(CombinedThick,'MD2') > '65.0' then RDSTestRec = 'FTIR_T' end else RDSTestRec = 'FTIR' end end end else RDSTestRec = 'ASM17' ;* 17 Point linear test pattern until PROD_SPEC is updated support other types end Database_Services('WriteDataRow', 'RDS_TEST', RdsTestKey, RdsTestRec) If Error_Services('HasError') then ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage') end end else ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage') end Next RdsTestKey end else ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage') end end else ErrorMsg = 'Error in ':Service:' service. Error calling obj_Prod_Spec("GetLayerProp"). Error code: ':ErrCode end Next LayerKey end else ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage') end end else ErrorMsg = 'Error in ':Service:' service. RDS ':RdsNo:' does not exist' end end else ErrorMsg = 'Error in ':Service:' service. Null RDSNo passed into service' end If (ErrorMsg NE '') then Error_Services('Add', ErrorMsg) End Service