updated reactor print dialog form to allow users to select printer

This commit is contained in:
Infineon\StieberD
2025-10-16 14:58:44 -07:00
parent 712cec903a
commit cbb52c469b
2 changed files with 55 additions and 10 deletions

View File

@ -425,6 +425,38 @@ Service PrintReactorLabel(ReactNo, LoadLockSide=LOAD_LOCK_SIDE)
end service
Service GetReactorLabelZPL(ReactNo, LoadLockSide=LOAD_LOCK_SIDE)
If ( (ReactNo NE '') and (LoadLockSide NE '') ) then
BaseZpl = '^XA^MD30^PR1^LH10,10^FO35,5^BY2^B3N,,80,N^FD10SR{ReactNo}.{LoadLockSidePrefix}^FS^FO10,105^A045,90^FB400,1,,C^FDR{ReactNo} {LoadLockSide}^FS^XZ'
Convert 'R' to '' in ReactNo
If LoadLockSide _EQC 'Both' then
LoadLockSidePrefix = 'L'
ZplLeft = BaseZpl
Swap '{ReactNo}' with ReactNo in ZplLeft
Swap '{LoadLockSidePrefix}' with LoadLockSidePrefix in ZplLeft
Swap '{LoadLockSide}' with 'Left' in ZplLeft
ZplRight = BaseZpl
LoadLockSidePrefix = 'R'
Swap '{ReactNo}' with ReactNo in ZplRight
Swap '{LoadLockSidePrefix}' with LoadLockSidePrefix in ZplRight
Swap '{LoadLockSide}' with 'Right' in ZplRight
Zpl = ZplLeft:ZplRight
end else
LoadLockSidePrefix = LoadLockSide[1, 1]
Zpl = BaseZpl
Swap '{ReactNo}' with ReactNo in Zpl
Swap '{LoadLockSidePrefix}' with LoadLockSidePrefix in Zpl
Swap '{LoadLockSide}' with LoadLockSide in Zpl
end
Response = Zpl
end else
Error_Services('Add', 'Error in ':Service:' service. Null ReactNo or LoadLockSide passed in.')
end
end service
Service GetReturnToFabLabelZPL(RTFId)
ZPLStringLabel = ''
@ -460,5 +492,3 @@ Service GetReturnToFabLabelZPL(RTFId)
end service

View File

@ -36,7 +36,7 @@ $Insert APP_INSERTS
$Insert EVENT_SETUP
$Insert MSG_EQUATES
Declare function Reactor_Services
Declare function Reactor_Services, Labeling_Services, Printer_Select
Declare subroutine PlaceDialog, Labeling_Services
GoToEvent Event for CtrlEntId else
@ -77,15 +77,30 @@ end event
Event PUB_PRINT.CLICK()
ErrorMsg = ''
ReactNo = Get_Property(@Window:'.COB_REACTOR', 'TEXT')
LLSide = Get_Property(@Window:'.COB_LOAD_LOCK_SIDE', 'TEXT')
ReactorZpl = Labeling_Services('GetReactorLabelZPL', ReactNo, LLSide)
If Error_Services('NoError') then
PrintPath = Printer_Select()
If PrintPath NE '' then
Def = ""
Def<MTEXT$> = "Printing label..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def) ;* display the processing message
Labeling_Services('PrintReactorLabel', ReactNo, LLSide)
Msg(@window, MsgUp) ;* take down the processing message
If Error_Services('HasError') then Error_Services('DisplayError')
Labeling_Services('PrintLabel', ReactorZpl, PrintPath)
If Error_Services('HasError') then
ErrorMsg = Error_Services('GetMessage')
end
end
end else
ErrorMsg = Error_Services('GetMessage')
end
If ErrorMsg NE '' then
Msg(@Window, '', 'OK', '', 'Print Error':@FM:ErrorMsg)
end
end event