open-insight/LSL2/STPROC/SCHEDULER_ACTIONS_EVENTS.txt
2024-05-22 14:06:46 -07:00

940 lines
38 KiB
Plaintext

Function Scheduler_Actions_Events(CtrlEntId, Event, Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15)
/***********************************************************************************************************************
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 Infineon.
Name : Scheduler_Actions_Events
Description : This function acts as a commuter module for all events related to this window.
Notes : Commuter Modules are automatically called from the Promoted_Events function which is called by the
application-specific promoted event handler. This makes it possible to add QuickEvents that need to
execute Basic+ logic without having use the Form Designer to make the association, although this is
limited to the events which are currently promoted.
If the form needs to call the commuter module directly then the QuickEvent parameters should be
formatted like this:
'@SELF','@EVENT',['@PARAM1','@PARAMx']
Parameters :
CtrlEntId [in] -- The fully qualified name of the control calling the promoted event
Event [in] -- The event being executed. See the Notes section regarding "PRE" events
Param1-15 [in] -- Additional event parameter holders
EventFlow [out] -- Set to 1 or 0 so the calling event knows whether or not to chain forward. See comments in
EVENT_SETUP insert
History : (Date, Initials, Notes)
06/12/17 dmb Created initial commuter module.
***********************************************************************************************************************/
#pragma precomp SRP_PreCompiler
#Window SCHEDULER_ACTIONS
$insert APP_INSERTS
$insert EVENT_SETUP
$insert MSG_EQUATES
$insert SCHED_DET_EQUATES
$insert WO_LOG_EQUATES
$insert WO_SCHEDULE_EQUATES
$insert REACTOR_EQUATES
Equ LightGrey$ TO 239 + (239*256) + (239*65536)
WorkOrderCtrls = 'OLE_DIV_WORK_ORDER_DETAILS,WO_NO_LABEL,WO_NO,WO_STEP_LABEL,WO_STEP,EPI_PART_LABEL,EPI_PART,DESCRIPTION_LABEL,DESCRIPTION,CUSTOMER_NAME_LABEL,CUSTOMER_NAME,'
WorkOrderCtrls := 'TOTAL_WAFERS_LABEL,TOTAL_WAFERS,TOTAL_REMAINING_LABEL,TOTAL_REMAINING,PERCENT_COMPLETE_LABEL,PERCENT_COMPLETE'
AddDateCtrls = 'DATE_LABEL,DATE'
DateRangeCtrls = 'SCHEDULE_START_DATE_LABEL,SCHEDULE_START_DATE,SCHEDULE_END_DATE_LABEL,SCHEDULE_END_DATE,DAYS_LABEL,DAYS'
BlockOutCtrls = 'START_BLOCK_OUT_LABEL,START_BLOCK_OUT,END_BLOCK_OUT_LABEL,END_BLOCK_OUT,OLE_DIV_BLOCK_OUT_DETAILS,DESCRIPTION_LABEL,DESCRIPTION'
CancelBlockOutCtrls = 'BLOCK_OUT_DATE_LABEL,BLOCK_OUT_DATE,OLE_DIV_BLOCK_OUT_DETAILS,DESCRIPTION_LABEL,DESCRIPTION'
Declare function SRP_Array, Schedule_Services, Database_Services, Work_Order_Services, SRP_Math, Epi_Part_Services
Declare subroutine obj_Appwindow, Center_Window, Schedule_Services, Form_Services, SRP_Show_Window
SubclassInfo = Form_Services('FindSubclassControl')
Subclass = SubclassInfo<1>
// Update the arguments so that the OpenInsight OLE event will treate the ActiveX event as a native event handler.
If Event EQ 'OLE' then
Transfer Event to OIEvent
Transfer Param1 to Event
Transfer Param2 to Param1
Transfer Param3 to Param2
Transfer Param4 to Param3
Transfer Param5 to Param4
Transfer Param6 to Param5
Transfer Param7 to Param6
Transfer Param8 to Param7
end
GoToEvent Event for CtrlEntID
Return EventFlow else EVENT_CONTINUE$
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Events
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Event WINDOW.CREATE(CreateParam)
Action = CreateParam<1>
SchedulerKeyIDs = CreateParam<2>
Set_Property(@Window, '@ORIG_SCHEDULERKEYIDS', SchedulerKeyIDs)
NumKeys = DCount(SchedulerKeyIDs, @VM)
FirstKey = SchedulerKeyIDs<0, 1>
WONo = FirstKey[1, '*']
EpiPart = FirstKey[Col2() + 1, '*']
ReactorNo = FirstKey[Col2() + 1, '*']
StartDate = FirstKey[Col2() + 1, '*']
SeqNo = FirstKey[Col2() + 1, '*']
ScheduleKeyID = Field(FirstKey, '*', 3, 3)
Set_Property(@Window : '.REACTOR_NO', 'TEXT', ReactorNo)
Set_Property(@Window : '.DATE', 'INVALUE', StartDate)
Set_Property(@Window : '.MODIFY_DATE', 'INVALUE', StartDate)
Set_Property(@Window : '.SCHEDULE_START_DATE', 'INVALUE', StartDate)
Set_Property(@Window : '.START_BLOCK_OUT', 'INVALUE', StartDate)
Set_Property(@Window : '.END_BLOCK_OUT', 'INVALUE', StartDate)
Set_Property(@Window : '.BLOCK_OUT_DATE', 'INVALUE', StartDate)
Set_Property(@Window, '@ORIG_WO_NO', WONo)
Set_Property(@Window, '@SCHEDULE_KEY_ID', ScheduleKeyID)
GoSub Setup_OLE_Controls
Set_Property(@Window : '.CLOSE_BUTTON', 'NEXT', @Window : '.REACTOR_NO')
Item = 1 ; // Default item to select from the ShortcutBar.
Begin Case
Case Action _EQC 'ADD'
Group = 1
Case Action _EQC 'MODIFY'
Group = 2
Case Action _EQC 'CANCEL'
Group = 3
Case Action _EQC 'ADDBLOCK'
Group = 4
Set_Property(@Window : '.OLE_SHORTCUTBAR', 'OLE.ItemEnabled[' : 1 : ';' : 1 : ']', False$)
Set_Property(@Window : '.OLE_SHORTCUTBAR', 'OLE.ItemEnabled[' : 2 : ';' : 1 : ']', False$)
Set_Property(@Window : '.OLE_SHORTCUTBAR', 'OLE.ItemEnabled[' : 2 : ';' : 2 : ']', False$)
Set_Property(@Window : '.OLE_SHORTCUTBAR', 'OLE.ItemEnabled[' : 3 : ';' : 1 : ']', False$)
Set_Property(@Window : '.OLE_SHORTCUTBAR', 'OLE.ItemEnabled[' : 4 : ';' : 2 : ']', False$)
Case Action _EQC 'CANCELBLOCK'
// Since the Cancel Block Out action is very specific, the other options
// will be disabled.
Group = 4
Item = 2
Set_Property(@Window : '.OLE_SHORTCUTBAR', 'OLE.ItemEnabled[' : 1 : ';' : 1 : ']', False$)
Set_Property(@Window : '.OLE_SHORTCUTBAR', 'OLE.ItemEnabled[' : 2 : ';' : 1 : ']', False$)
Set_Property(@Window : '.OLE_SHORTCUTBAR', 'OLE.ItemEnabled[' : 2 : ';' : 2 : ']', False$)
Set_Property(@Window : '.OLE_SHORTCUTBAR', 'OLE.ItemEnabled[' : 3 : ';' : 1 : ']', False$)
Set_Property(@Window : '.OLE_SHORTCUTBAR', 'OLE.ItemEnabled[' : 4 : ';' : 1 : ']', False$)
Case Otherwise$
Group = 1
End Case
SRP_Show_Window(@Window, '', 'C', 'C', 1, '', False$, False$)
Set_Property(@Window : '.OLE_SHORTCUTBAR', 'OLE.Selection', Group : ';' : Item)
Send_Event(@Window : '.OLE_SHORTCUTBAR', 'OLE', 'OnClick', Group, Item)
end event
Event WINDOW.CLOSE(CancelFlag)
end event
Event OLE_SHORTCUTBAR.OnClick(Group, Item, Point, Button, Shift, Ctrl)
PreviousPage = Get_Property(@Window, '@PREVIOUS_PAGE')
GroupCaption = Get_Property(CtrlEntId, 'GroupCaption[' : Group : ']')
ItemCaption = Get_Property(CtrlEntId, 'ItemCaption[' : Group : ';' : Item : ']')
Set_Property(@Window, 'TEXT', 'Scheduler Actions - ' : GroupCaption : ' - ' : ItemCaption)
Begin Case
Case Group EQ 1
// Add Actions
Begin Case
Case Item EQ 1
// Add New Work Order to this Reactor
Page = 1
ClearControls = 'WO_NO,EPI_PART,TOTAL_WAFERS,TOTAL_REMAINING,PERCENT_COMPLETE,SCHEDULE_END_DATE,DAYS,CUSTOMER_NAME,DESCRIPTION'
GoSub ClearControls
HideControls = AddDateCtrls : @FM : BlockOutCtrls : @FM : CancelBlockOutCtrls
GoSub HideControls
ShowControls = WorkOrderCtrls : @FM : DateRangeCtrls
GoSub ShowControls
EnableControls = 'WO_NO,SCHEDULE_START_DATE'
GoSub EnableControls
Set_Property(@Window : '.OLE_SUBCLASS', 'OLE.OptionEnabled[' : @Window : ';WO_NO' : ']', True$)
Set_Property(@Window : '.REACTOR_NO', 'NEXT', @Window : '.SCHEDULE_START_DATE')
Set_Property(@Window : '.DESCRIPTION', 'NEXT', @Window : '.REACTOR_NO')
Set_Property(@Window : '.WO_NO', 'FOCUS', True$)
WorkOrders = Get_Property(@Window, '@UNSCHEDULED_WORK_ORDERS')
WONo = ''
ScheduleKeyID = ''
GoSub UpdateWorkOrderList
GoSub UpdateScheduleDetails
GoSub UpdateReactorDetails
GoSub UpdateCustomerName
GoSub UpdateWorkOrderDetails
End Case
Case Group EQ 2
// Modify Actions
Begin Case
Case Item EQ 1
// Current Work Order Schedule Only
Page = 2
HideControls = DateRangeCtrls : @FM : BlockOutCtrls : @FM : CancelBlockOutCtrls
GoSub HideControls
ShowControls = AddDateCtrls : @FM : WorkOrderCtrls
GoSub ShowControls
DisableConTrols = 'WO_NO'
GoSub DisableControls
EnableControls = 'DESCRIPTION'
GoSub EnableControls
Set_Property(@Window : '.OLE_SUBCLASS', 'OLE.OptionEnabled[' : @Window : ';WO_NO' : ']', False$)
Set_Property(@Window : '.REACTOR_NO', 'NEXT', @Window : '.DATE')
Set_Property(@Window : '.DATE', 'NEXT', @Window : '.DESCRIPTION')
Set_Property(@Window : '.DESCRIPTION', 'NEXT', @Window : '.REACTOR_NO')
ScheduleKeyID = Get_Property(@Window, '@SCHEDULE_KEY_ID')
GoSub UpdateWorkOrderList
GoSub UpdateScheduleDetails
GoSub UpdateReactorDetails
GoSub UpdateCustomerName
GoSub UpdateWorkOrderDetails
Case Item EQ 2
// All Work Orders for this Reactor
Page = 3
HideControls = DateRangeCtrls : @FM : BlockOutCtrls :@FM : CancelBlockOutCtrls
GoSub HideControls
ShowControls = AddDateCtrls : @FM : WorkOrderCtrls
GoSub ShowControls
DisableConTrols = 'WO_NO,DESCRIPTION'
GoSub DisableControls
Set_Property(@Window : '.OLE_SUBCLASS', 'OLE.OptionEnabled[' : @Window : ';WO_NO' : ']', False$)
Set_Property(@Window : '.REACTOR_NO', 'NEXT', @Window : '.MODIFY_DATE')
Set_Property(@Window : '.MODIFY_DATE', 'NEXT', @Window : '.REACTOR_NO')
End Case
Case Group EQ 3
// Cancel Actions
Begin Case
Case Item EQ 1
// All Work Orders for this Reactor
Page = 4
HideControls = AddDateCtrls : @FM : BlockOutCtrls : @FM : CancelBlockOutCtrls
GoSub HideControls
ShowControls = WorkOrderCtrls : @FM : DateRangeCtrls
GoSub ShowControls
DisableControls = 'SCHEDULE_START_DATE,WO_NO,DESCRIPTION'
GoSub DisableControls
WorkOrders = Get_Property(@Window, '@UNSCHEDULED_WORK_ORDERS')
WONo = Get_Property(@Window, '@ORIG_WO_NO')
ScheduleKeyID = Get_Property(@Window, '@SCHEDULE_KEY_ID')
GoSub UpdateWorkOrderList
GoSub UpdateScheduleDetails
GoSub UpdateReactorDetails
GoSub UpdateCustomerName
GoSub UpdateWorkOrderDetails
End Case
Case Group EQ 4
// Block Out Actions
Begin Case
Case Item EQ 1
// Add block out events.
Page = 5
HideControls = WorkOrderCtrls : @FM : DateRangeCtrls : @FM : AddDateCtrls : @FM : CancelBlockOutCtrls
GoSub HideControls
ShowControls = BlockOutCtrls
GoSub ShowControls
EnableControls = 'SAVE_BUTTON'
GoSub EnableControls
Set_Property(@Window : '.REACTOR_NO', 'NEXT', @Window : '.START_BLOCK_OUT')
Set_Property(@Window : '.END_BLOCK_OUT', 'NEXT', @Window : '.DESCRIPTION')
Set_Property(@Window : '.DESCRIPTION', 'NEXT', @Window : '.REACTOR_NO')
GoSub UpdateReactorDetails
Case Item EQ 2
// Remove block out event.
Page = 6
HideControls = WorkOrderCtrls : @FM : DateRangeCtrls : @FM : AddDateCtrls : @FM : BlockOutCtrls
GoSub HideControls
ShowControls = CancelBlockOutCtrls
GoSub ShowControls
DisableControls = 'REACTOR_NO,DESCRIPTION,BLOCK_OUT_DATE'
GoSub DisableControls
EnableControls = 'SAVE_BUTTON'
GoSub EnableControls
Set_Property(@Window : '.REACTOR_NO', 'NEXT', @Window : '.BLOCK_OUT_DATE')
Set_Property(@Window : '.BLOCK_OUT_DATE', 'NEXT', @Window : '.DESCRIPTION')
Set_Property(@Window : '.DESCRIPTION', 'NEXT', @Window : '.REACTOR_NO')
ScheduleKeyID = Get_Property(@Window, '@SCHEDULE_KEY_ID')
GoSub UpdateReactorDetails
GoSub UpdateBlockOutDetails
End Case
End Case
Send_Event(@Window, 'PAGE', Page)
Set_Property(@Window : '.REACTOR_NO', 'FOCUS', True$)
Set_Property(@Window, '@PREVIOUS_PAGE', Page)
end event
Event REACTOR_NO.GOTFOCUS(PrevFocusID)
GoSub SelectAll
end event
Event REACTOR_NO.LOSTFOCUS(Flag, FocusID)
GoSub UpdateReactorDetails
GoSub UpdateWorkOrderList
end event
Event DATE.GOTFOCUS(PrevFocusID)
GoSub SelectAll
end event
Event DATE.OPTIONS()
GoSub DisplayDatePicker
end event
Event SCHEDULE_START_DATE.GOTFOCUS(PrevFocusID)
GoSub SelectAll
end event
Event SCHEDULE_START_DATE.LOSTFOCUS(Flag, FocusID)
WorkOrder = Get_Property(@Window : '.WO_NO', 'TEXT')
If WorkOrder NE '' then
StartDate = Get_Property(CtrlEntId, 'INVALUE')
Days = Get_Property(@Window : '.DAYS', 'DEFPROP')
// Round up to create a full number of days (i.e., events).
Days = SRP_Math('NONE', Days + .49, '', 0)
EndDate = StartDate + Days - 1
Set_Property(@Window : '.SCHEDULE_END_DATE', 'INVALUE', EndDate)
end else
Set_Property(@Window : '.SCHEDULE_END_DATE', 'INVALUE', '')
end
end event
Event SCHEDULE_START_DATE.OPTIONS()
GoSub DisplayDatePicker
end event
Event SCHEDULE_END_DATE.GOTFOCUS(PrevFocusID)
GoSub SelectAll
end event
Event SCHEDULE_END_DATE.LOSTFOCUS(Flag, FocusID)
StartDate = Get_Property(@Window : '.SCHEDULE_START_DATE', 'INVALUE')
EndDate = Get_Property(CtrlEntId, 'INVALUE')
If StartDate NE '' AND EndDate NE '' then
Days = EndDate - StartDate + 1
Set_Property(@Window : '.DAYS', 'DEFPROP', Days)
end
end event
Event SCHEDULE_END_DATE.OPTIONS()
GoSub DisplayDatePicker
end event
Event MODIFY_DATE.GOTFOCUS(PrevFocusID)
GoSub SelectAll
end event
Event MODIFY_DATE.OPTIONS()
GoSub DisplayDatePicker
end event
Event START_BLOCK_OUT.GOTFOCUS(PrevFocusID)
GoSub SelectAll
end event
Event START_BLOCK_OUT.OPTIONS()
GoSub DisplayDatePicker
end event
Event END_BLOCK_OUT.GOTFOCUS(PrevFocusID)
GoSub SelectAll
end event
Event END_BLOCK_OUT.OPTIONS()
GoSub DisplayDatePicker
end event
Event WO_NO.LOSTFOCUS(Flag, FocusID)
// User changed the value in this control. Update related controls.
GoSub UpdateCustomerName
GoSub UpdateWorkOrderDetails
If Error_Services('HasError') then
* Error_Services('DisplayError')
end
end event
Event DAYS.GOTFOCUS(PrevFocusID)
GoSub SelectAll
end event
Event DAYS.LOSTFOCUS(Flag, FocusID)
Days = Get_Property(CtrlEntId, 'DEFPROP')
Days = SRP_Math('NONE', Days + .49, '', 0)
StartDate = Get_Property(@Window : '.SCHEDULE_START_DATE', 'INVALUE')
EndDate = Get_Property(CtrlEntId, 'INVALUE')
If StartDate NE '' AND Days NE '' then
EndDate = StartDate + Days - 1
Set_Property(@Window : '.SCHEDULE_END_DATE', 'INVALUE', EndDate)
end
end event
Event SAVE_BUTTON.CLICK()
Parent = Get_Property(@Window, 'PARENT')
Page = Get_Property(@Window, '@PREVIOUS_PAGE')
OrigSchedulerKeyIDS = Get_Property(@Window, '@ORIG_SCHEDULERKEYIDS')
OrigScheduleDetail = Get_Property(@Window, '@ORIG_SCHEDULEDETAIL')
ReactorNo = Get_Property(@Window : '.REACTOR_NO', 'TEXT')
Description = Get_Property(@Window : '.DESCRIPTION', 'TEXT')
NumKeys = DCount(OrigSchedulerKeyIDS, @VM)
ResponseData = '' ; // Data relevant to the specific action taken. See below for the actual data being returned.
Begin Case
Case Page EQ 1
// Adding work order events.
WorkOrder = Get_Property(@Window : '.WO_NO', 'TEXT')
Days = Get_Property(@Window : '.DAYS', 'DEFPROP')
// ** Temp code to contain the auto-adjuster problem with single-day events. **
If Days LE 1 then Days = 2
StartDate = Get_Property(@Window : '.SCHEDULE_START_DATE', 'INVALUE')
Description = Get_Property(@Window : '.DESCRIPTION', 'INVALUE')
ResponseData = ReactorNo : @FM : WorkOrder : @FM : Days : @FM : StartDate : @FM : Description
Case Page EQ 2
// Modifying the current work order.
WorkOrder = Get_Property(@Window : '.WO_NO', 'TEXT')
StartDate = Get_Property(@Window : '.DATE', 'INVALUE')
Description = Get_Property(@Window : '.DESCRIPTION', 'INVALUE')
ResponseData = ReactorNo : @FM : WorkOrder : @FM : StartDate : @FM : Description
Case Page EQ 3
// Modifying the current and following work orders.
WorkOrder = Get_Property(@Window : '.WO_NO', 'TEXT')
StartDate = Get_Property(@Window : '.MODIFY_DATE', 'INVALUE')
Description = ''
ResponseData = ReactorNo : @FM : WorkOrder : @FM : StartDate : @FM : Description
Case Page EQ 4
// Cancelling work order events.
WorkOrder = Get_Property(@Window : '.WO_NO', 'TEXT')
CancelledScheduleEvents = Schedule_Services('GetScheduleEvents', Date(), '', ReactorNo, WorkOrder, False$)
Transfer CancelledScheduleEvents to ResponseData
Case Page EQ 5
// Adding block out events.
StartDate = Get_Property(@Window : '.START_BLOCK_OUT', 'INVALUE')
EndDate = Get_Property(@Window : '.END_BLOCK_OUT', 'INVALUE')
If EndDate EQ '' then EndDate = StartDate
Description = Get_Property(@Window : '.DESCRIPTION', 'INVALUE')
ResponseData = ReactorNo : @FM : StartDate : @FM : EndDate : @FM : Description
Case Page EQ 6
// Cancelling block out event. Just return the schedule key passed in.
ResponseData = Get_Property(@Window, '@SCHEDULE_KEY_ID')
End Case
End_Dialog(@Window, ResponseData)
end event
Event CLOSE_BUTTON.CLICK()
End_Dialog(@Window, '')
end event
Event OLE_SUBCLASS.OnOptionClick(CtrlId)
Send_Event(CtrlId, 'OPTIONS')
end event
Event OLE_SUBCLASS.OnComboClick(CtrlId)
Send_Event(CtrlId, 'LOSTFOCUS')
end event
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Internal GoSubs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Setup_OLE_Controls:
Ctrl = @Window : '.OLE_SHORTCUTBAR'
Set_Property(Ctrl, 'OLE.Border', 'XP Flat')
Set_Property(Ctrl, 'OLE.Theme', 'Office2000')
Set_Property(Ctrl, 'OLE.SelectBehavior', 'S' : @FM : 'S')
Set_Property(Ctrl, 'OLE.HotTrackStyle', 'Item')
Set_Property(Ctrl, 'OLE.GroupCount', 4)
Set_Property(Ctrl, 'OLE.GroupExpandable[All]', False$)
Set_Property(Ctrl, 'OLE.GroupEnabled[All]', False$)
Set_Property(Ctrl, 'OLE.GroupCaption[1]', 'Add Actions')
Set_Property(Ctrl, 'OLE.GroupItemCount[1]', 1)
Set_Property(Ctrl, 'OLE.ItemCaption[1;1]', 'Work Order Events')
Set_Property(Ctrl, 'OLE.GroupCaption[2]', 'Modify Actions')
Set_Property(Ctrl, 'OLE.GroupItemCount[2]', 2)
Set_Property(Ctrl, 'OLE.ItemCaption[2;1]', 'Current Work Order Event')
Set_Property(Ctrl, 'OLE.ItemCaption[2;2]', 'Current+Future Work Order Events')
Set_Property(Ctrl, 'OLE.GroupCaption[3]', 'Cancel Actions')
Set_Property(Ctrl, 'OLE.GroupItemCount[3]', 1)
Set_Property(Ctrl, 'OLE.ItemCaption[3;1]', 'Work Order Event')
Set_Property(Ctrl, 'OLE.GroupCaption[4]', 'Block Out Actions')
Set_Property(Ctrl, 'OLE.GroupItemCount[4]', 2)
Set_Property(Ctrl, 'OLE.ItemCaption[4;1]', 'Add Block Out Events')
Set_Property(Ctrl, 'OLE.ItemCaption[4;2]', 'Cancel Block Out Event')
Send_Message(Ctrl, 'QUALIFY_EVENT', 'OLE.OnClick', 1)
Ctrl = @Window : '.OLE_SUBCLASS'
DateCtrls = 'DATE,SCHEDULE_START_DATE,MODIFY_DATE,START_BLOCK_OUT,END_BLOCK_OUT'
For Each DateCtrl in DateCtrls using ','
EditLine = @Window : '.' : DateCtrl
Handle = Get_Property(EditLine, 'HANDLE')
Send_Message(Ctrl, 'OLE.Subclass', Handle, EditLine)
EditLine = @Window : ';' : DateCtrl
Set_Property(Ctrl, 'OLE.OptionButton[' : EditLine : ']', True$)
Set_Property(Ctrl, 'OLE.OptionImage[' : EditLine : ']', 'bmps\calendar.png')
Next DateCtrl
// Get the current reactor type and size so the GetReactor and GetUnscheduledWorkOrders service results can be filtered
// down to only those items that match the same type and size.
ReactorNo = Get_Property(@Window : '.REACTOR_NO', 'TEXT')
ReactorRec = Database_Services('ReadDataRow', 'REACTOR', ReactorNo)
ReactorType = ReactorRec<REACTOR_REACT_TYPE$>
SusceptorSize = ReactorRec<REACTOR_SUSC_POCKET_SIZE$>
EditLine = @Window : '.REACTOR_NO'
Handle = Get_Property(EditLine, 'HANDLE')
Send_Message(Ctrl, 'OLE.Subclass', Handle, EditLine)
EditLine = @Window : ';REACTOR_NO'
Reactors = Schedule_Services('GetReactors', ReactorType) ; // This returns an array suited for the SRP Schedule control.
Reactors = Reactors[1, @RM]
Reactors = SRP_Array('Rotate', Reactors)
Reactors = Delete(Reactors, 1, 0, 0)
Reactors = Delete(Reactors, 1, 0, 0)
Reactors = Delete(Reactors, 1, 0, 0)
Reactors = Delete(Reactors, 3, 0, 0)
Reactors = Delete(Reactors, 3, 0, 0)
Convert @FM to @TM in Reactors
Convert @VM to @STM in Reactors
Swap \0D0A\ with ' / ' in Reactors
Combo = ''
Combo<1> = 1
Combo<2, 1> = 'Reactor No' : @TM : 'Type / Size'
Combo<2, 2> = 'L' : @STM : 'DYN' : @TM : 'L' : @STM : 'DYN'
Combo<2, 3> = Reactors
Combo<2, 4> = 1
Combo<2, 5> = 1
Combo<2, 6> = 0
Combo<2, 9> = 1
Combo<2,10> = 0
Combo<2,11> = 0
Combo<2,12> = 1
Combo<2,24> = 0
Set_Property(Ctrl, 'OLE.Combo[' : EditLine : ']', Combo)
EditLine = @Window : '.WO_NO'
Handle = Get_Property(EditLine, 'HANDLE')
Send_Message(Ctrl, 'OLE.Subclass', Handle, EditLine)
Combo = ''
Combo<1> = 1
Combo<2, 1> = 'Work Order' : @TM : 'Epi Part' : @TM : 'Customer' : @TM : 'Reactor Type' : @TM : 'PSN Block'
Combo<2, 2> = 'L' : @STM : 'DYN' : @TM : 'L' : @STM : 'DYN' : @TM : 'L' : @STM : 'DYN' : @TM : 'L' : @STM : 'DYN' : @TM : 'C' : @STM : 'DYN'
Combo<2, 3> = ''
Combo<2, 4> = 1
Combo<2, 5> = 1
Combo<2, 6> = 0
Combo<2, 9> = 1
Combo<2,10> = 0
Combo<2,11> = 0
Combo<2,12> = 1
Combo<2,24> = 0
EditLine = @Window : ';WO_NO'
Set_Property(@Window : '.OLE_SUBCLASS', 'OLE.Combo[' : EditLine : ']', Combo)
Send_Message(Ctrl, 'QUALIFY_EVENT', 'OLE.OnOptionClick', 1)
Send_Message(Ctrl, 'QUALIFY_EVENT', 'OLE.OnComboClick', 1)
return
SelectAll:
Set_Property(CtrlEntId, 'SELECTION', 1 : @FM : 999)
return
UpdateScheduleDetails:
ScheduleDetail = Schedule_Services('GetScheduleDetail', ScheduleKeyID)
Set_Property(@Window, '@ORIG_SCHEDULEDETAIL', ScheduleDetail)
Set_Property(@Window : '.WO_STEP', 'TEXT', ScheduleDetail<SCHED_DET_WO_STEP$>)
WorkOrder = Get_Property(@Window : '.WO_NO', 'TEXT')
If WorkOrder NE '' then
Set_Property(@Window : '.DESCRIPTION', 'TEXT', ScheduleDetail<SCHED_DET_DESC$>)
end else
Set_Property(@Window : '.DESCRIPTION', 'TEXT', '')
end
return
UpdateCustomerName:
WoNo = Get_Property(@Window : '.WO_NO', 'TEXT')
If WoNo NE '' then
WorkOrderDetail = Work_Order_Services('GetWorkOrderLogDetail', WONo)
CustNo = WorkOrderDetail<WO_LOG_CUST_NO$>
CompanyRow = Database_Services('ReadDataRow', 'COMPANY', CustNo)
CustName = CompanyRow<42>
end else
CustName = ''
end
Set_Property(@Window : '.CUSTOMER_NAME', 'TEXT', CustName)
return
UpdateReactorDetails:
ReactorNo = Get_Property(@Window : '.REACTOR_NO', 'TEXT')
If Index(ReactorNo, '/', 1) then
// EpiPro reactors formatted as such, "40/42". We must truncate the reactor number to the first reactor.
ReactorNo = Field(ReactorNo, '/', 1, 1)
Set_Property(@Window : '.REACTOR_NO', 'TEXT', ReactorNo)
end
ReactorDetails = Schedule_Services('GetReactorDetails', ReactorNo)
ReactorType = ReactorDetails<REACTOR_REACT_TYPE$>
Begin Case
Case ReactorType _EQC 'EPP' ; ReactorType = 'EpiPro'
Case ReactorType _EQC 'GAN' ; ReactorType = 'GaN'
End Case
Set_Property(@Window : '.REACTOR_TYPE', 'TEXT', ReactorType)
Set_Property(@Window : '.REACTOR_SIZE', 'TEXT', ReactorDetails<REACTOR_SUSC_POCKET_SIZE$>)
FutureEvents = Schedule_Services('GetScheduleEvents', Date() + 1, '', ReactorNo, '', False$)
Set_Property(@Window, '@FUTURE_EVENTS', FutureEvents)
return
UpdateWorkOrderDetails:
If Assigned(Page) else Page = Get_Property(@Window, 'VPOSITION')<1>
WorkOrder = Get_Property(@Window : '.WO_NO', 'TEXT')
PSNBlocked = ''
If WorkOrder NE '' then
WorkOrdersArray = Get_Property(@Window, '@UNSCHEDULED_WORK_ORDERS')
Convert @TM to @FM in WorkOrdersArray
Convert @STM to @VM in WorkOrdersArray
WorkOrderList = WorkOrdersArray<1>
PSNBlockedList = WorkOrdersArray<5>
Locate WorkOrder in WorkOrderList using @VM setting vPos then PSNBlocked = PSNBlockedList<0, vPos>
If PSNBlocked EQ '' then
Set_Property(@Window:'.LBL_PSN_BLOCK', 'VISIBLE', False$)
WorkOrderDetail = Work_Order_Services('GetWorkOrderLogDetail', WorkOrder)
EpiPart = WorkOrderDetail<WO_LOG_EPI_PART_NO$>
TotalWafers = WorkOrderDetail<WO_LOG_WO_QTY$>
Remaining = Work_Order_Services('GetRemainingWafers', WorkOrder)
Remaining = Int(Remaining + .5)
If TotalWafers GT 0 then
Complete = (TotalWafers - Remaining) / TotalWafers * 100
end else
Complete = 0
end
AdjustedDays = Schedule_Services('GetAdjustedDays', WorkOrder)
ReactorType = Get_Property(@Window : '.REACTOR_TYPE', 'TEXT')
MinutesPerWafer = Epi_Part_Services('GetMinutesPerWaferScheduler', EpiPart, ReactorType)
If MinutesPerWafer EQ '' then
Msg(@Window, 'Warning: ' : EpiPart : ' appears to be missing minutes per wafer values for ' : ReactorType)
end
end else
// PSN Blocked
Set_Property(@Window:'.LBL_PSN_BLOCK', 'VISIBLE', True$)
end
end
If (WorkOrder NE '') and (PSNBlocked EQ '') then
Set_Property(@Window : '.EPI_PART', 'TEXT', EpiPart)
Set_Property(@Window : '.TOTAL_WAFERS', 'TEXT', TotalWafers)
Set_Property(@Window : '.TOTAL_REMAINING', 'TEXT', Remaining)
Set_Property(@Window : '.PERCENT_COMPLETE', 'TEXT', Oconv(Complete, 'MD0[ %]S'))
If Page EQ 4 then
// Start Date might not be correct since it defaults to the date the user was viewing from the Scheduler.
// Cancelled work order events will always use the true start date as it appears in the current reactor.
// The current end date already on the schedule should be correct so it will be used.
WOScheduleRow = Database_Services('ReadDataRow', 'WO_SCHEDULE', WorkOrder)
SchedDetKeys = WOScheduleRow<WO_SCHEDULE_SCHED_DET_KEY_IDS$>
If SchedDetKeys NE '' then
ReactorNo = Get_Property(@Window : '.REACTOR_NO', 'TEXT')
NumSchedKeys = DCount(SchedDetKeys, @VM)
// Loop through the list of schedule detail keys and remove those belonging
// to another reactor than the one we are working on.
For SchedKeyCnt = NumSchedKeys to 1 Step -1
SchedDetKey = SchedDetKeys<0, SchedKeyCnt>
If Field(SchedDetKey, '*', 1) NE ReactorNo then
SchedDetKeys = Delete(SchedDetKeys, 0, SchedKeyCnt, 0)
end
Next SchedKeyCnt
// Sort the remaining schedule detail keys so the oldest one is at the top of the list.
SchedDetKeys = SRP_Array('SortRows', SchedDetKeys, 'AR2', 'LIST', @VM, '*')
StartDate = Field(SchedDetKeys<1, 1>, '*', 2)
SchedDetKeys = SRP_Array('SortRows', SchedDetKeys, 'DR2', 'LIST', @VM, '*')
EndDate = Field(SchedDetKeys<1, 1>, '*', 2)
AdjustedDays = EndDate - StartDate + 1
end else
StartDate = ''
EndDate = ''
AdjustedDays = ''
end
Set_Property(@Window : '.SCHEDULE_START_DATE', 'INVALUE', StartDate)
end else
// Calculate the end date based on the adjusted days.
StartDate = Get_Property(@Window : '.SCHEDULE_START_DATE', 'INVALUE')
EndDate = StartDate + AdjustedDays - 1
end
Set_Property(@Window : '.SCHEDULE_END_DATE', 'INVALUE', EndDate)
Set_Property(@Window : '.DAYS', 'DEFPROP', AdjustedDays)
Set_Property(@Window : '.SAVE_BUTTON', 'ENABLED', True$)
end else
Error_Services('DisplayError')
Set_Property(@Window : '.EPI_PART', 'TEXT', '')
Set_Property(@Window : '.TOTAL_WAFERS', 'TEXT', '')
Set_Property(@Window : '.TOTAL_REMAINING', 'TEXT', '')
Set_Property(@Window : '.PERCENT_COMPLETE', 'TEXT', '')
Set_Property(@Window : '.SCHEDULE_END_DATE', 'INVALUE', '')
Set_Property(@Window : '.DAYS', 'DEFPROP', '')
Set_Property(@Window : '.SAVE_BUTTON', 'ENABLED', False$)
end
return
UpdateBlockOutDetails:
ScheduleDetail = Schedule_Services('GetScheduleDetail', ScheduleKeyID)
Set_Property(@Window : '.DESCRIPTION', 'TEXT', ScheduleDetail<SCHED_DET_DESC$>)
return
DisplayDatePicker:
Date = Get_Property(CtrlEntId, 'INVALUE')
NewDate = Dialog_Box('NDW_DATEPICKER', @Window, Date)
If NewDate NE '' then
Set_Property(CtrlEntId, 'INVALUE', NewDate)
Send_Event(CtrlEntId, 'LOSTFOCUS')
end
return
ClearControls:
Convert ',' to @FM in ClearControls
For Each Ctrl in ClearControls using @FM
Set_Property(@Window : '.' : Ctrl, 'TEXT', '')
Next Ctrl
return
HideControls:
Convert ',' to @FM in HideControls
For Each Ctrl in HideControls using @FM
Set_Property(@Window : '.' : Ctrl, 'VISIBLE', False$)
Next Ctrl
return
ShowControls:
Convert ',' to @FM in ShowControls
For Each Ctrl in ShowControls using @FM
Set_Property(@Window : '.' : Ctrl, 'VISIBLE', True$)
Next Ctrl
return
EnableControls:
Convert ',' to @FM in EnableControls
For Each Ctrl in EnableControls using @FM
Set_Property(@Window : '.' : Ctrl, 'ENABLED', True$)
If Get_Property(@Window : '.' : Ctrl, 'TYPE') EQ 'EDITFIELD' then
Set_Property(@Window : '.' : Ctrl, 'BACKCOLOR', White$)
end
Next Ctrl
return
DisableControls:
Convert ',' to @FM in DisableControls
For Each Ctrl in DisableControls using @FM
Set_Property(@Window : '.' : Ctrl, 'ENABLED', False$)
If Get_Property(@Window : '.' : Ctrl, 'TYPE') EQ 'EDITFIELD' then
Set_Property(@Window : '.' : Ctrl, 'BACKCOLOR', LightGrey$)
end
Next Ctrl
return
UpdateWorkOrderList:
If Assigned(Page) else Page = Get_Property(@Window, 'VPOSITION')<1>
WorkOrders = ''
Begin Case
Case Page EQ 1
// Adding work order.
WorkOrders = Get_Property(@Window, '@UNSCHEDULED_WORK_ORDERS')
If WorkOrders EQ '' then
// Get the current reactor type and size so the GetReactor and GetUnscheduledWorkOrders service results can be filtered
// down to only those items that match the same type and size.
ReactorNo = Get_Property(@Window : '.REACTOR_NO', 'TEXT')
ReactorRec = Database_Services('ReadDataRow', 'REACTOR', ReactorNo)
ReactorType = ReactorRec<REACTOR_REACT_TYPE$>
SusceptorSize = ReactorRec<REACTOR_SUSC_POCKET_SIZE$>
WorkOrders = Work_Order_Services('GetUnscheduledWorkOrders', ReactorType, '', ReactorNo)
WorkOrders = SRP_Array('Rotate', WorkOrders)
Convert @FM to @TM in WorkOrders
Convert @VM to @STM in WorkOrders
Set_Property(@Window, '@UNSCHEDULED_WORK_ORDERS', WorkOrders)
end
Case Page EQ 2
// Modifying work order.
WONo = Get_Property(@Window, '@ORIG_WO_NO')
Set_Property(@Window : '.WO_NO', 'TEXT', WONo)
Case Page EQ 3
// Modifying work order.
WONo = Get_Property(@Window, '@ORIG_WO_NO')
Set_Property(@Window : '.WO_NO', 'TEXT', WONo)
Case Page EQ 4
// Cancelling a work order.
WONo = Get_Property(@Window, '@ORIG_WO_NO')
WOScheduleRow = Database_Services('ReadDataRow', 'WO_SCHEDULE', WONo)
SchedDetKeys = WOScheduleRow<WO_SCHEDULE_SCHED_DET_KEY_IDS$>
* WorkOrderRec = Work_Order_Services('GetWorkOrderLogDetail', WONo)
* SchedDetKeys = WorkOrderRec<WO_LOG_SCHED_DET_KEYIDS$>
If SchedDetKeys NE '' then
ReactorNo = Get_Property(@Window : '.REACTOR_NO', 'TEXT')
NumSchedKeys = DCount(SchedDetKeys, @VM)
// Loop through the list of schedule detail keys and remove those belonging
// to another reactor than the one we are working on.
For SchedKeyCnt = NumSchedKeys to 1 Step -1
SchedDetKey = SchedDetKeys<0, SchedKeyCnt>
If Field(SchedDetKey, '*', 1) NE ReactorNo then
SchedDetKeys = Delete(SchedDetKeys, 0, SchedKeyCnt, 0)
end
Next SchedKeyCnt
// Sort the remaining schedule detail keys so the oldest one is at the top of the list.
SchedDetKeys = SRP_Array('SortRows', SchedDetKeys, 'AR2', 'LIST', @VM, '*')
FirstDate = Field(SchedDetKeys<1, 1>, '*', 2)
If FirstDate GT Date() then
// All previous scheduled events are in the future. Allow the work order to be cancelled.
WorkOrders = WONo
end
end else
// No previous scheduled events exist. Allow the work order to be cancelled.
WorkOrders = WONo
end
Set_Property(@Window : '.WO_NO', 'TEXT', WorkOrders)
Case Page EQ 5
End Case
EditLine = @Window : ';WO_NO'
Set_Property(@Window : '.OLE_SUBCLASS', 'OLE.ComboData[' : EditLine : ']', WorkOrders)
return