refactored PTO form to address freezing
This commit is contained in:
parent
37b912b801
commit
ae4bfcbfe1
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
LSL2/STPROC/TEST_DANIEL3.txt
|
@ -7,27 +7,79 @@
|
||||
"record1": {
|
||||
"<1>": "%2%",
|
||||
"<2>": "BNY",
|
||||
"<3>": "A",
|
||||
"<3>": "",
|
||||
"<4>": "!",
|
||||
"<5>": "2",
|
||||
"<6>": "-2",
|
||||
"<7>": "-2",
|
||||
"<8>": "T",
|
||||
"<9>": "",
|
||||
"<10>": "",
|
||||
"<9>": "-2",
|
||||
"<10>": "-2",
|
||||
"<11>": "",
|
||||
"<12>": "%1%",
|
||||
"<13>": "",
|
||||
"<14>": "",
|
||||
"<15>": "0",
|
||||
"<16>": "",
|
||||
"<17>": "1",
|
||||
"<18>": "",
|
||||
"<17>": "0",
|
||||
"<18>": {
|
||||
"<18,1>": {
|
||||
"<18,1,1>": "Segoe UI",
|
||||
"<18,1,2>": "-12",
|
||||
"<18,1,3>": "400",
|
||||
"<18,1,4>": "0",
|
||||
"<18,1,5>": "0",
|
||||
"<18,1,6>": "0",
|
||||
"<18,1,7>": "1",
|
||||
"<18,1,8>": "0",
|
||||
"<18,1,9>": "0",
|
||||
"<18,1,10>": "0",
|
||||
"<18,1,11>": "0",
|
||||
"<18,1,12>": "0"
|
||||
}
|
||||
},
|
||||
"<19>": "0",
|
||||
"<20>": "",
|
||||
"<21>": "0",
|
||||
"<22>": "",
|
||||
"<23>": ""
|
||||
"<23>": "",
|
||||
"<24>": "0",
|
||||
"<25>": "0",
|
||||
"<26>": "0",
|
||||
"<27>": "0",
|
||||
"<28>": "0",
|
||||
"<29>": "",
|
||||
"<30>": "",
|
||||
"<31>": "-2",
|
||||
"<32>": "-2",
|
||||
"<33>": "-2",
|
||||
"<34>": "",
|
||||
"<35>": "",
|
||||
"<36>": "",
|
||||
"<37>": "",
|
||||
"<38>": "0",
|
||||
"<39>": "",
|
||||
"<40>": "",
|
||||
"<41>": "",
|
||||
"<42>": "0",
|
||||
"<43>": "1",
|
||||
"<44>": "0",
|
||||
"<45>": "-2",
|
||||
"<46>": "",
|
||||
"<47>": "",
|
||||
"<48>": "",
|
||||
"<49>": "",
|
||||
"<50>": "",
|
||||
"<51>": "0",
|
||||
"<52>": "",
|
||||
"<53>": "",
|
||||
"<54>": "",
|
||||
"<55>": "",
|
||||
"<56>": "-2",
|
||||
"<57>": "-2",
|
||||
"<58>": "-2",
|
||||
"<59>": "-2",
|
||||
"<60>": "-2"
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -30,6 +30,7 @@ $insert RDS_EQUATES
|
||||
$insert NOTIFICATION_EQU
|
||||
$insert EPI_PART_EQUATES
|
||||
$Insert WO_LOG_EQUATES
|
||||
$Insert MSG_EQUATES
|
||||
|
||||
Declare function Scan_Services, Memory_Services, Database_Services, SRP_JSON, RTI_CreateGUID, Memberof, obj_WO_Mat
|
||||
Declare function Get_Property, RDS_Services, EpiPro_Services, DateTime, Signature_Services, Material_Movement_Services
|
||||
@ -371,6 +372,7 @@ Service ProcessPTOScanData(ScanData, ScanType = SCAN_TYPES_PTO, Param1, Param2)
|
||||
MsgText := 'Are you sure you wish to rescan and reprint the shipping label?'
|
||||
|
||||
OK = Msg(@WINDOW, '','YESNO','',MsgHead:@FM:MsgText)
|
||||
|
||||
IF NOT(OK) THEN
|
||||
Error_Services('Add', 'Scan Cancelled')
|
||||
RETURN
|
||||
@ -688,7 +690,3 @@ SendPTOMismatchNotification:
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -44,7 +44,7 @@ Equ Cassette2$ to @Window:'.EDL_CASSETTE2_SCAN'
|
||||
Equ Supplier$ to @Window:'.EDL_SUPPLIER_SCAN'
|
||||
|
||||
Declare subroutine Set_Property, Send_Event, Post_Event, Send_Message, SendMessage, Error_Services
|
||||
Declare subroutine Obj_Wo_Mat_Log, Errmsg, Utility, SRP_Show_Window, Material_Movement_Services
|
||||
Declare subroutine Obj_Wo_Mat_Log, Errmsg, Utility, SRP_Show_Window, Material_Movement_Services, PlaceDialog
|
||||
Declare function Get_Property, Send_Message, SendMessage, Material_Movement_Services, Error_Services,
|
||||
Declare function Popup, obj_WO_Mat, Database_Services, Utility, Rds_Services, Message_Box
|
||||
|
||||
@ -88,7 +88,7 @@ Event WINDOW.CREATE(CreateParam)
|
||||
end else
|
||||
GoSub SetupOLEControls
|
||||
GoSub ResetForm
|
||||
SRP_Show_Window(@Window, '', 'C', 'C', 1, '', False$, False$, FormSize)
|
||||
PlaceDialog(-2, -2)
|
||||
MsgStruct = ''
|
||||
MsgStruct<MTEXTWIDTH$> = MSG_WIDTH$
|
||||
end
|
||||
|
@ -41,10 +41,11 @@ Equ CRLF$ to \0D0A\
|
||||
Equ MSG_WIDTH$ to 600
|
||||
Equ Label1$ to @Window:'.EDL_LABEL1_SCAN'
|
||||
Equ Label2$ to @Window:'.EDL_LABEL2_SCAN'
|
||||
Equ SaveBtn$ to @Window:'.OLE_BTN_SAVE'
|
||||
Equ ClearBtn$ to @Window:'.PUB_CLEAR'
|
||||
Equ SaveBtn$ to @Window:'.PUB_SAVE'
|
||||
Equ Popup$ to @Window:".OLE_POPUP"
|
||||
|
||||
Declare subroutine Set_Property, Send_Event, Post_Event, Send_Message, SendMessage, Error_Services
|
||||
Declare subroutine Set_Property, Send_Event, Post_Event, Send_Message, SendMessage, Error_Services, PlaceDialog
|
||||
Declare subroutine Obj_Wo_Mat_Log, Errmsg, Utility, SRP_Show_Window, Material_Movement_Services, Delay, Getengineversion
|
||||
Declare function Get_Property, Send_Message, SendMessage, Material_Movement_Services, Error_Services
|
||||
Declare function Popup, obj_WO_Mat, Database_Services, Utility, Rds_Services, Message_Box, SRP_Get_Window_Rect
|
||||
@ -82,46 +83,13 @@ Event WINDOW.CREATE(CreateParam)
|
||||
|
||||
GoSub SetupOLEControls
|
||||
GoSub ResetForm
|
||||
SRP_Show_Window(@Window, '', 'C', 'C', 1, '', False$, False$, FormSize)
|
||||
|
||||
end event
|
||||
|
||||
|
||||
Event OLE_BTN_CLEAR.OnClick(Point, Button, Shift, Ctrl)
|
||||
|
||||
gosub HidePopup
|
||||
|
||||
If Get_Property(Label1$, 'TEXT') NE '' AND Get_Property(Label2$, 'TEXT') NE '' then
|
||||
MsgHead = 'Record not saved'
|
||||
MsgText = 'Record has not been saved - are you sure you want to clear form?'
|
||||
OK = Msg(@WINDOW,'','YESNO','',MsgHead:@FM:MsgText)
|
||||
If OK then
|
||||
GoSub ResetForm
|
||||
end else
|
||||
Set_Property(@Window:'.OLE_BTN_CLEAR', 'ENABLED', True$)
|
||||
Set_Property(@Window:'.OLE_BTN_SAVE', 'ENABLED', True$)
|
||||
end
|
||||
end else
|
||||
GoSub ResetForm
|
||||
end
|
||||
|
||||
end event
|
||||
|
||||
|
||||
Event OLE_BTN_SAVE.OnClick(Point, Button, Shift, Ctrl)
|
||||
|
||||
Cassette1 = Get_Property(Label1$, 'TEXT')
|
||||
Cassette2 = Get_Property(Label2$, 'TEXT')
|
||||
Warehouse = '1K'
|
||||
Location = 'PTO'
|
||||
Gosub SaveRecord
|
||||
PlaceDialog(-2, -2)
|
||||
|
||||
end event
|
||||
|
||||
|
||||
Event EDL_LABEL1_SCAN.LOSTFOCUS(Flag, FocusID)
|
||||
|
||||
Set_Property(SaveBtn$, 'FOCUS', True$)
|
||||
ScanField = 'Label1'
|
||||
If Flag EQ 1 then
|
||||
ScanData = Get_Property(CtrlEntID, 'TEXT')
|
||||
@ -149,7 +117,6 @@ end event
|
||||
|
||||
Event EDL_LABEL2_SCAN.LOSTFOCUS(Flag, FocusID)
|
||||
|
||||
Set_Property(SaveBtn$, 'FOCUS', True$)
|
||||
ScanField = 'Label2'
|
||||
If Flag EQ 1 then
|
||||
ScanData = Get_Property(CtrlEntID, 'TEXT')
|
||||
@ -165,15 +132,15 @@ Event EDL_LABEL2_SCAN.LOSTFOCUS(Flag, FocusID)
|
||||
Gosub SetupForm
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
if ErrorMessage[1,13] EQ 'Scan Mismatch' then
|
||||
If ErrorMessage[1,13] EQ 'Scan Mismatch' then
|
||||
Msg(@Window, MsgStruct, 'PROCESS_ERROR', '', ErrorMessage)
|
||||
Gosub ResetForm
|
||||
Set_Property(@Window:'.EDL_LABEL1_SCAN', 'FOCUS', True$)
|
||||
Set_Property(Label1$, 'FOCUS', True$)
|
||||
end else
|
||||
Set_Property(@Window:'.EDL_LABEL2_SCAN', 'ENABLED', True$)
|
||||
Set_Property(@Window:'.EDL_LABEL2_SCAN', 'TEXT', '')
|
||||
Set_Property(Label2$, 'ENABLED', True$)
|
||||
Set_Property(Label2$, 'TEXT', '')
|
||||
Msg(@Window, MsgStruct, 'PROCESS_ERROR', '', ErrorMessage)
|
||||
Set_Property(@Window:'.EDL_LABEL2_SCAN', 'FOCUS', True$)
|
||||
Set_Property(Label2$, 'FOCUS', True$)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -189,6 +156,38 @@ Event OLE_POPUP.OnItemClick(Item)
|
||||
end event
|
||||
|
||||
|
||||
Event PUB_CLEAR.CLICK()
|
||||
|
||||
gosub HidePopup
|
||||
|
||||
If Get_Property(Label1$, 'TEXT') NE '' AND Get_Property(Label2$, 'TEXT') NE '' then
|
||||
MsgHead = 'Record not saved'
|
||||
MsgText = 'Record has not been saved - are you sure you want to clear form?'
|
||||
OK = Msg(@WINDOW,'','YESNO','',MsgHead:@FM:MsgText)
|
||||
If OK then
|
||||
GoSub ResetForm
|
||||
end else
|
||||
Set_Property(ClearBtn$, 'ENABLED', True$)
|
||||
Set_Property(SaveBtn$, 'ENABLED', True$)
|
||||
end
|
||||
end else
|
||||
GoSub ResetForm
|
||||
end
|
||||
|
||||
end event
|
||||
|
||||
|
||||
Event PUB_SAVE.CLICK()
|
||||
|
||||
Cassette1 = Get_Property(Label1$, 'TEXT')
|
||||
Cassette2 = Get_Property(Label2$, 'TEXT')
|
||||
Warehouse = '1K'
|
||||
Location = 'PTO'
|
||||
Gosub SaveRecord
|
||||
|
||||
end event
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Internal Gosubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -221,29 +220,23 @@ return
|
||||
ShowPopup:
|
||||
|
||||
GoSub HidePopup
|
||||
PopupCtrl = Popup$
|
||||
|
||||
BackColor = Get_Property(@Window, 'BACKCOLOR')
|
||||
ForeColor = Get_Property(@Window, 'FORECOLOR')
|
||||
CursorXPos = Field(Point, ',', 1, 1)
|
||||
CursorYPos = Field(Point, ',', 2, 1)
|
||||
FormSize = Get_Property(@Window, 'SIZE')
|
||||
FormXPos = FormSize<1>
|
||||
FormYPos = FormSize<2>
|
||||
CtrlSize = Get_Property(CtrlEntID, 'SIZE')
|
||||
CtrlXPos = CtrlSize<1>
|
||||
CtrlYPos = CtrlSize<2>
|
||||
FormWidth = FormSize<3>
|
||||
FormHeight = FormSize<4>
|
||||
PopupWidth = 0
|
||||
PopupHeight = 0
|
||||
XPadding = 10
|
||||
YPadding = 10
|
||||
XOffset = 10
|
||||
YOffset = 55
|
||||
PopupXPos = FormXPos + CtrlXPos + CursorXPos + XOffset
|
||||
PopupYPos = FormYPos + CtrlYPos + CursorYPos + YOffset
|
||||
|
||||
Delay = 0
|
||||
If saveErr = 1 then
|
||||
If saveErr EQ True$ then
|
||||
BackColor = 255 + (51*256) + (51*65536)
|
||||
end else
|
||||
Delay = 2500
|
||||
@ -255,7 +248,6 @@ ShowPopup:
|
||||
ItemList = ''
|
||||
If ItemData NE '' then
|
||||
For Each Item in ItemData using @FM setting ItemCount
|
||||
* debug
|
||||
ItemLength = Len(Item)
|
||||
PopupWidth += (20 * ItemLength)
|
||||
rows = INT(PopupWidth /300)
|
||||
@ -277,24 +269,26 @@ ShowPopup:
|
||||
Next Item
|
||||
end
|
||||
|
||||
Set_Property(PopupCtrl, 'OLE.Size', Size)
|
||||
Set_Property(PopupCtrl, 'OLE.Opacity', 255)
|
||||
Set_Property(PopupCtrl, 'OLE.ShowDelay', Delay)
|
||||
Set_Property(PopupCtrl, 'OLE.Theme', 'Custom')
|
||||
Set_Property(PopupCtrl, 'OLE.Background', 'Vertical(Gradient(' : Backcolor : ', ' : Backcolor : '), Border(' : Backcolor : ' L=20))' : @FM : 'None' : @FM : 'None')
|
||||
Set_Property(PopupCtrl, 'OLE.ItemList', ItemList)
|
||||
Set_Property(PopupCtrl, 'OLE.Size', 0 : @FM : 0 : @FM : PopupWidth : @FM : PopupHeight)
|
||||
Send_Message(PopupCtrl, 'OLE.ShowAt', PopupXPos, PopupYPos)
|
||||
PopupXPos = FormXPos + FormWidth/2 - PopupWidth/2
|
||||
PopupYPos = FormYPos + FormHeight/2 - PopupHeight/2
|
||||
|
||||
Set_Property(Popup$, 'OLE.Size', Size)
|
||||
Set_Property(Popup$, 'OLE.Opacity', 255)
|
||||
Set_Property(Popup$, 'OLE.ShowDelay', Delay)
|
||||
Set_Property(Popup$, 'OLE.Theme', 'Custom')
|
||||
Set_Property(Popup$, 'OLE.Background', 'Vertical(Gradient(' : Backcolor : ', ' : Backcolor : '), Border(' : Backcolor : ' L=20))' : @FM : 'None' : @FM : 'None')
|
||||
Set_Property(Popup$, 'OLE.ItemList', ItemList)
|
||||
Set_Property(Popup$, 'OLE.Size', 0 : @FM : 0 : @FM : PopupWidth : @FM : PopupHeight)
|
||||
Send_Message(Popup$, 'OLE.ShowAt', PopupXPos, PopupYPos)
|
||||
|
||||
return
|
||||
|
||||
|
||||
HidePopup:
|
||||
|
||||
PopupCtrl = @Window : '.OLE_POPUP'
|
||||
PopupVisible = Get_Property(PopupCtrl, 'OLE.Visible')
|
||||
PopupVisible = Get_Property(Popup$, 'OLE.Visible')
|
||||
If PopupVisible EQ True$ then
|
||||
Send_Message(PopupCtrl, 'OLE.Close')
|
||||
Send_Message(Popup$, 'OLE.Close')
|
||||
end
|
||||
|
||||
return
|
||||
@ -329,10 +323,10 @@ return
|
||||
|
||||
DisableFormControls:
|
||||
|
||||
Set_Property(@Window:'.EDL_LABEL1_SCAN', 'TEXT', '')
|
||||
Set_Property(@Window:'.EDL_LABEL2_SCAN', 'TEXT', '')
|
||||
Set_Property(@Window:'.EDL_LABEL1_SCAN', 'ENABLED', False$)
|
||||
Set_Property(@Window:'.EDL_LABEL2_SCAN', 'ENABLED', False$)
|
||||
Set_Property(Label1$, 'TEXT', '')
|
||||
Set_Property(Label2$, 'TEXT', '')
|
||||
Set_Property(Label1$, 'ENABLED', False$)
|
||||
Set_Property(Label2$, 'ENABLED', False$)
|
||||
|
||||
return
|
||||
|
||||
@ -345,25 +339,21 @@ SetupOLEControls:
|
||||
Qualifier<3> = ''
|
||||
Qualifier<4> = 0 ; * process synchronously
|
||||
|
||||
Ctrl = @Window:'.OLE_BTN_CLEAR'
|
||||
Send_Message(Ctrl, 'QUALIFY_EVENT', 'OLE.OnClick', Qualifier)
|
||||
Ctrl = @Window:'.OLE_BTN_SAVE'
|
||||
Send_Message(Ctrl, 'QUALIFY_EVENT', 'OLE.OnClick', Qualifier)
|
||||
Ctrl = @Window :'.OLE_POPUP'
|
||||
Send_Message(Ctrl, 'QUALIFY_EVENT', 'OLE.OnItemClick', Qualifier)
|
||||
Send_Message(Popup$, 'QUALIFY_EVENT', 'OLE.OnItemClick', Qualifier)
|
||||
|
||||
return
|
||||
|
||||
|
||||
ResetForm:
|
||||
|
||||
Set_Property(@Window:'.EDL_LABEL1_SCAN', 'ENABLED', True$)
|
||||
Set_Property(@Window:'.EDL_LABEL2_SCAN', 'ENABLED', True$)
|
||||
Set_Property(@Window:'.EDL_LABEL1_SCAN', 'TEXT', '')
|
||||
Set_Property(@Window:'.EDL_LABEL2_SCAN', 'TEXT', '')
|
||||
Set_Property(@Window:'.EDL_LABEL1_SCAN', 'ENABLED', True$)
|
||||
Set_Property(@Window:'.EDL_LABEL2_SCAN', 'ENABLED', False$)
|
||||
Set_Property(@Window:'.EDL_LABEL1_SCAN', 'FOCUS', True$)
|
||||
Set_Property(@Window:'.OLE_BTN_SAVE', 'ENABLED', False$)
|
||||
Set_Property(Label1$, 'ENABLED', True$)
|
||||
Set_Property(Label2$, 'ENABLED', True$)
|
||||
Set_Property(Label1$, 'TEXT', '')
|
||||
Set_Property(Label2$, 'TEXT', '')
|
||||
Set_Property(Label1$, 'ENABLED', True$)
|
||||
Set_Property(Label2$, 'ENABLED', False$)
|
||||
Set_Property(Label1$, 'FOCUS', True$)
|
||||
Set_Property(SaveBtn$, 'ENABLED', False$)
|
||||
|
||||
return
|
||||
|
||||
|
@ -94,11 +94,15 @@ $Insert PS_EQUATES
|
||||
|
||||
Main:
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,REACTOR_SERVICES', '', '', '')
|
||||
debug
|
||||
ASMList = Reactor_Services('GetReactorNumbers', 'ASM')
|
||||
ASMList := @FM : Reactor_Services('GetReactorNumbers', 'ASM+')
|
||||
|
||||
ASMList = SRP_Array('SortSimpleList', ASMList, 'AscendingNumbers', @FM)
|
||||
response = Msg(@Window, '', 'OK', '', 'Test':@FM:'Test2')
|
||||
|
||||
|
||||
return
|
||||
* ASMList = Reactor_Services('GetReactorNumbers', 'ASM')
|
||||
* ASMList := @FM : Reactor_Services('GetReactorNumbers', 'ASM+')
|
||||
*
|
||||
* ASMList = SRP_Array('SortSimpleList', ASMList, 'AscendingNumbers', @FM)
|
||||
|
||||
* LoadInstAckReq = Xlate('RDS', 646209, 'LOAD_INST_ACK_REQ', 'X')
|
||||
* DefPrinter = Get_Printer( "CURRENTDEVICE")
|
||||
@ -4306,3 +4310,4 @@ return
|
||||
*
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user