COMPILE FUNCTION Dialog_GAN_Dispo(EntID,Event,Parm1,Parm2,Parm3,Parm4,Parm5)

/*
	Commuter module for Dialog_GAN_DISPO window.- Cloned from DIALOG_SPLIT_WAFERS
	
	06/27/2016 - John C. Henry, J.C. Henry & Co., Inc.
*/

DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg,
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg, End_Dialog, Send_Message, 
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, obj_WM_In, Send_Message, obj_WO_Mat_GaN


EQU CRLF$	TO \0D0A\


$INSERT REACT_RUN_EQUATES
$INSERT REACTOR_EQUATES
$INSERT RDS_TEST_EQUATES
$INSERT TOOL_EQUATES
$INSERT TOOL_CLASS_EQUATES
$INSERT PRS_STAGE_EQUATES
$INSERT EPI_PART_EQUATES
$INSERT WO_LOG_EQUATES
$INSERT WO_STEP_EQUATES
$INSERT WO_MAT_EQUATES
$INSERT APPCOLORS
$INSERT POPUP_EQUATES
$INSERT LOGICAL
$INSERT WO_WFR_EQUATES
$INSERT RTI_STYLE_EQUATES

EQU COL$IN_SLOT_ID		TO 1
EQU COL$IN_WFR_ID		TO 2
EQU COL$CARR_SLOT_ID	TO 3
EQU COL$RDS_NO			TO 4
EQU COL$PKT				TO 5


EQU COL_WD$IN_WFR_ID		TO 1	;* Equates used in return data structure for Manifest Wafers
EQU COL_WD$RDS_NO			TO 2
EQU COL_WD$PKT				TO 3
EQU COL_WD$CARR_SLOT_ID		TO 4
EQU COL_WD$SCRIBE			TO 5
EQU COL_WD$WFR_GRADE		TO 6
EQU COL_WD$WFR_SHIP			TO 7
EQU COL_WDOUT_SLOT_ID		TO 8



EQU EDITABLE$			TO 4
EQU PROTECTED$			TO 8			;* Protected  - Edittable COLSTYLE constants
EQU MULTILINE_STYLE$	TO 512 			;* MultiLine Select
EQU LOCKED$				TO 8192
EQU DROPDOWN_STYLE$		TO 131072


ErrTitle = 'Error in Dialog_GAN_Dispo commuter module'
ErrorMsg = ''

Result = ''


BEGIN CASE

	CASE EntID = @WINDOW
		BEGIN CASE
			CASE Event = 'CREATE' 			; GOSUB Create
			CASE Event = 'CLOSE'			; GOSUB Close			;* This needs to be a PRECLOSE event!
			
			
		END CASE
	
	CASE EntID = @WINDOW:'.LU_WO_NO'		AND Event = 'CLICK'		; GOSUB LUWONo
	CASE EntID = @WINDOW:'.ADD_WAFERS'		AND Event = 'CLICK'		; GOSUB AddWafers
	
	CASE EntID = @WINDOW:'.WO_NO'			AND Event = 'LOSTFOCUS'	; GOSUB Refresh
	
	
	
	CASE 1
		ErrorMsg = 'Unknown Parameters ':EntID:' - ':Event:' passed to commuter'
		ErrMsg(ErrorMsg)
		
END CASE

IF ErrorMsg NE '' THEN
	ErrMsg(ErrTitle:@SVM:ErrorMsg)
END



RETURN Result



* * * * * * *
Create:
* * * * * * *

obj_AppWindow('Create')


	
BriefTxt  = '{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}'
BriefTxt := '{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\b\f0\fs20 Wafer Disposition\par'
BriefTxt := '\b0\par'
BriefTxt := ' 1.) Log Char wfrs as Product Test wfrs\b\par'
BriefTxt := ' 2.) Enter Wfr Grades for each wafer in carrier\b\par'
BriefTxt := ' 3.) Select and Create Non Conforming Report for scrap wfrs\b\par'
BriefTxt := ' 4.) Unload remaining wafers into shipping cassette slots\b\par'
BriefTxt := '\b0\par'
BriefTxt := '}'

*Set_Property(@WINDOW:'.BRIEF_EDITBOX','RTFTEXT',BriefTxt)



RETURN


* * * * * * *
LUWONo:
* * * * * * *


DEBUG

RETURN




* * * * * * *
Close:
* * * * * * *



RETURN


* * * * * * *
AddWafers:
* * * * * * *

WONo = Get_Property(@WINDOW:'.WO_NO','DEFPROP')

WfrData = obj_WO_Mat_GaN('GetManifestWfrs',WONo)

IF Get_Status(errCode) THEN
	ErrMsg(errCode) 
	DEBUG
	RETURN
END


IF WfrData = '' THEN RETURN

CONVERT @VM:@FM TO @SVM:@VM IN WfrData


TypeOver = ''
TypeOver<PDISPLAY$> = WfrData

SelWfrs = Popup(@WINDOW,TypeOver,'WO_WFRS')






DEBUG

RETURN




* * * * * * *
Refresh:
* * * * * * *

WONo = Get_Property(@WINDOW:'.WO_NO','DEFPROP')
DEBUG
IF WONo NE '' THEN
	EpiPartNo = XLATE('WO_LOG',WONo,WO_LOG_EPI_PART_NO$,'X')
	WfrThick = XLATE('EPI_PART',EpiPartNo,EPI_PART_SUB_THICK$,'X')
	
	Set_Property(@WINDOW:'.EPI_PART_NO','DEFPROP',EpiPartNo)
	Set_Property(@WINDOW:'.WFR_THICK','DEFPROP',WfrThick)
	
END

RETURN



