#
# =================================================================================================
#
#
#
#
#
# =================================================================================================
# -------------------------------------------------------------------------------------------------
# Public API
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# Standard Imports
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# Scope4Xi imports
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# Multiprocessing Imports
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# DragonXi imports
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# Global constants
# ------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# Settings
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def trace2image4lpu(task4trace2lpu=None):
'''
creates callback to lpu2image4xi
'''
global lpu2trace4xi
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "trace2image4lpu"
method2print = "trace2image4lpu"
message2print = "{(Step 1A/33) started" + "; trace2image4lpu-started: " + str(trace2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1B/33) passed" + "; task4trace2lpu-to-trace2image4lpu: " + str(task4trace2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
# None
code2ack = ' '
code2nack = ' '
lpu2trace4xi = {} # INITIALIZES TO EMPTY DICTIONARY
if task4trace2lpu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY LPUIZED CALLBACK !
# -----------------------------------------------------------------------------------------
task4trace2lpu = {}
task4trace2lpu['CLASS'] = "trace2image4lpu" # LPUIZE ZPU TRACE!
task4trace2lpu['METHOD'] = "trace2image4lpu"
task4trace2lpu['MESSAGE'] = "{(Step 2Z0/33) failed" + "; trace2image4lpu-failed " + str(lpu2trace4xi) + "; time: " + time4xi() + "}"
message2print = "{(Step 2A/33) set" + "; task4trace2lpu-set-by-trace2image4lpu to: " + str(task4trace2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4lpu-failed {}; time: 08:14:33 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4lpu',
# 'METHOD': 'trace2image4lpu'}
# ; time: 08:14:33 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '2A-'
# -----------------------------------------------------------------------------------------
# PARAMETER GIVEN BY LPUIZED CALLBACK !
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) try" + "; task4trace2lpu-try-by-trace2image4lpu: " + str(task4trace2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# { trace2image4lpu : trace2image4lpu ; (Step 3A/33) try; task4trace2lpu-try-by-trace2image4lpu:
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4lpu-failed {}; time: 08:14:33 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4lpu',
# 'METHOD': 'trace2image4lpu'}
# ; time: 08:14:33 09/06/11 Pacific Daylight Time}
try:
lpu2trace4xi ['CLASS'] = task4trace2lpu['CLASS'] # LPUIZE LPU TRACE!
lpu2trace4xi ['METHOD'] = task4trace2lpu['METHOD']
lpu2trace4xi ['MESSAGE'] = task4trace2lpu['MESSAGE']
message2print = "{(Step 3B/33) set" + "; lpu2trace4xi-set-by-trace2image4lpu to: " + str(lpu2trace4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# { trace2image4lpu : trace2image4lpu ; (Step 3B/33) set; lpu2trace4xi-set-by-trace2image4lpu to:
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4lpu-failed {}; time: 23:41:37 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4lpu',
# 'METHOD': 'trace2image4lpu'}
# ; time: 23:41:37 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z1/33) failed" + "; lpu-trace-failed-by-trace2image4lpu: " + str(task4trace2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
try:
# =================================
# SIMULATE LPU TRACE
# =================================
class2print = task4trace2lpu['CLASS'] # LPUIZE LPU TRACE!
method2print = task4trace2lpu['METHOD']
message2print = task4trace2lpu['MESSAGE']
print4xi(class2print, method2print, message2print) # LPUIZED TRACE FOR OPENCL CALLBACK!
# { trace2image4lpu : trace2image4lpu ; (Step 2Z0/33) failed; trace2image4lpu-failed {}; time: 23:41:37 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '3C-'
except:
class2print = "trace2image4lpu" # SET TRACE BACK TO THIS FUNCTION!
method2print = "trace2image4lpu"
message2print = "{(Step 3Z2/33) failed" + "; simulation-of-lpu-trace-failed-by-trace2image4lpu: " + str(task4trace2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z2-'
try:
# =================================
# NORMAL TRACE
# =================================
class2print = "trace2image4lpu" # SET TRACE BACK TO THIS FUNCTION!
method2print = "trace2image4lpu"
message2print = "{(Step 3D/33) performed" + "; lpu-trace-performed-by-trace2image4lpu: " + str(task4trace2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# { trace2image4lpu : trace2image4lpu ; (Step 3D/33) performed; lpu-trace-performed-by-trace2image4lpu:
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4lpu-failed {}; time: 23:41:37 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4lpu', 'METHOD': 'trace2image4lpu'}; time: 23:41:37 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '3D-'
except:
message2print = "{(Step 3Z3/33) failed" + "; lpu-trace-failed-by-trace2image4lpu: " + str(task4trace2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z3-'
# -----------------------------------------------------------------------------------------
# (Step 33/3)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 33/33) returning" + "; lpu2trace4xi-returning-by-trace2image4lpu: " + str(lpu2trace4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4lpu-failed {}; time: 23:41:37 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4lpu',
# 'METHOD': 'trace2image4lpu'}; time: 23:41:37 09/06/11 Pacific Daylight Time}
return lpu2trace4xi
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def set2imagecallback4lpu(task4set2imagecallback=None):
'''
registers callback function to lpu2image4xi
'''
global lpu2image4xi
class2print = "set2imagecallback4lpu"
method2print = "set2imagecallback4lpu"
message2print = "{(Step 1A/70) started" + "; set2imagecallback4lpu-started: " + str(set2imagecallback4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
lpu2image4xi ['CALLBACK'] = trace2image4lpu
message2print = "{(Step 1B/70) set callback2lpu" + "; imagecallback4lpu-set-by-set2imagecallback4lpu: " + str(lpu2image4xi ['CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1C/70) returning" + "; callback-of-lpu2image4xi-returning-by-set2imagecallback4lpu: " + str(lpu2image4xi ['CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
return lpu2image4xi ['CALLBACK']
except:
message2print = "{(Step 1Z1/70) failed" + "; callback2image-failed-by-set2imagecallback4lpu: " + str(callback2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 1Z2/70) returning" + "; trace2image4lpu-returning-by-set2imagecallback4lpu: " + str(trace2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
return trace2image4lpu
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def create2image4lpu(task4imagecreate2lpu=None):
'''
creates 2D image for LPU
'''
global lpu2image4xi
# -----------------------------------------------------------------------------------------
# (Step 1/70) - CHECK PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "create2image4lpu"
method2print = "create2image4lpu"
message2print = "{(Step 1A/70) started" + "; create2image4lpu-started: " + str(create2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1B/70) passed" + "; task4imagecreate2lpu-to-create2image4lpu: " + str(task4imagecreate2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
lpu2image4xi = {} # INITIALIZES TO EMPTY DICTIONARY
try:
if task4imagecreate2lpu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR CREATION - BUILD TASK TO LPU!
# -----------------------------------------------------------------------------------------
task4imagecreate2lpu = {}
message2print = "{(Step 1C/70) initialized" + "; task4imagecreate2lpu-created-by-create2image4lpu to: " + str(task4imagecreate2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
function2callback4lpu = trace2image4lpu # CALLBACK FUNCTION FOR LPU
message2print = "{(Step 1D/70) initialized" + "; function2callback4lpu-created-by-create2image4lpu to: " + str(function2callback4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1D-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "create2image4lpu" # MODULE OF LPUIZED OPENCL MODULE
args2callback['METHOD'] = "create2image4lpu" # FUNCTION OF LPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; create2image4lpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR LPUIZED OPENCL TO RETURN
message2print = "{(Step 1E/70) initialized" + "; args2callback-created-by-create2image4lpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; create2image4lpu-failed ; time: 00:54:15 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4lpu',
# 'METHOD': 'create2image4lpu'}; time: 00:54:15 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '1E-'
# ---------------------------------------------------------------------------------------------
# (1) CALLBACKS - EXTRA
# ---------------------------------------------------------------------------------------------
task4imagecreate2lpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO LPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagecreate2lpu['FUNCTION2CALLBACK'] = function2callback4lpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '2C-'
message2print = "{(Step 1F/70) initialized" + "; task4imagecreate2lpu-created-by-create2image4lpu to: " + str(task4imagecreate2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4lpu-failed ; time: 00:54:15 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4lpu',
# 'METHOD': 'create2image4lpu'}}; time: 00:54:15 09/06/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - EXTRA
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-create2image4lpu to: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
try:
platform2xi = get2platformids4xi() # PLATFORM IS COMMON TO ALL DEVICES I.E TO DEVICE XI
message2print = "{(Step 2B/70) got" + "; platform2xi-got-by-create2image4lpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'list2platforms': ['DragonXi'], 'ack2return': ' 2C-2E-2F-2G-', 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1}; time: 00:54:15 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '2B-'
except:
message2print = "{(Step 2Z/70) failed" + "; platform2xi-failed-by-create2image4lpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4imagecreate2lpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - REQUIRED
# ---------------------------------------------------------------------------------------------
context2lpu = {}
message2print = "{(Step 3A/70) trying" + "; context2lpu-trying-by-create2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2lpu = get2context4lpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2lpu-got-by-create2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4lpu-failed ; time: 00:54:15 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4lpu',
# 'METHOD': 'create2context4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 2A-2C-2D-2E-2B-3B-4B-5B-6B-7B-7B-',
# 'INFO2PRIVATE': None,
# 'PLATFORM': {'list2platforms': ['DragonXi'], 'ack2return': ' 2C-2E-2F-2G-', 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1},
# 'NACK2RETURN': ' ',
# 'SIZE2PRIVATE': 0, 'PROPERTIES': None}; time: 00:54:15 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2lpu-failed-by-create2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4imagecreate2lpu ['CONTEXT'] = context2lpu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - EXTRA
# ---------------------------------------------------------------------------------------------
device2lpu = {}
message2print = "{(Step 4A/70) trying" + "; device2lpu-trying-by-create2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2lpu = get2lpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2lpu-got-by-create2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'RESOLUTION2TIMER4PROFILING': 318,
# 'ID2PLATFORM': '0000000001509568',
# 'PROFILING2QUEUE': 'ACK',
# 'EXECUTE2KERNELS4OPENCL': 'ACK',
# 'NATIVE2WIDTHLONG4VECTOR': 2,
# 'MAX2UNITS4COMPUTE': 4,
# 'SIZE2MEMORY4GLOBAL': 3221225472,
# 'NATIVE2WIDTHFLOAT4VECTOR': 4,
# 'MAX2SIZE4WORKGROUP': 1024,
# 'PREFERRED2WIDTHCHAR4VECTOR': 16,
# 'SIZE2CACHE': 65536,
# 'IEEE754-2008FUSED2MULTIPLY-ADD': 'NACK',
# 'TYPE4CACHE': 'Read/Write',
# 'PREFERRED2WIDTHINT4VECTOR': 4,
# 'SIZE2PREFERREDWORKGROUPMULTIPLE4KERNEL': 1,
# 'NATIVE2WIDTHINT4VECTOR': 4,
# 'SIZE2BUFFER4CONSTANT': 65536,
# 'EXECUTE2FUNCTION4NATIVE': 'ACK',
# 'PREFERRED2WIDTHDOUBLE4VECTOR': 0,
# 'MAX2NUMBER4CONSTANTARGS': 8,
# 'VERSION2DRIVER': '2.0',
# 'EXTENSIONS': 'cl_amd_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics
# 'AVAILABLE2COMPILER': 'ACK',
# 'MAX2DIMENSIONS4WORKITEMS': 3,
# 'SUPPORT2CORRECTION4ERROR': 0,
# 'BITS2ADDRESS': 64,
# 'AVAILABLE': 'ACK',
# 'SIZE2MEMORY4LOCAL': 32768,
# 'VENDOR': 'AuthenticAMD',
# 'SUPPORT2IMAGE': 'NACK',
# 'MAX2SIZE4KERNELARGUMENT': 4096,
# 'ACK2RETURN': ' 1C-1D-1E-1F-1D-2A-
# 'OUT-OF-ORDER2QUEUE': 'NACK',
# 'ALIGNMENT2ADDRESS4BASE': 1024,
# 'PROFILE': 'FULL_PROFILE',
# 'TYPE2MEMORY4LOCAL': 'Global',
# 'PREFERRED2WIDTHFLOAT4VECTOR': 4,
# 'PREFERRED2WIDTHLONG4VECTOR': 2,
# 'MAX2FREQUENCY4CLOCK': 3210,
# 'PREFERRED2WIDTHSHORT4VECTOR': 8,
# 'ID': 4033,
# 'MAX2WORKITEM2': 1024,
# 'NATIVE2WIDTHDOUBLE4VECTOR': 0,
# 'ROUND2ZERO': 'ACK',
# 'NAME': 'AMD64 Family 16 Model 4 Stepping 2, AuthenticAMD',
# 'MAX2WORKITEM1': 1024,
# 'MAX2WORKITEM0': 1024,
# 'SIZE2LINE4CACHE': 64,
# 'MAX2ALLOCATION4MEMORY': 1073741824,
# 'NATIVE2WIDTHCHAR4VECTOR': 16,
# 'QUIET2NANS': 'ACK',
# 'NATIVE2WIDTHSHORT4VECTOR': 8,
# 'ROUND2NEAREST4EVEN': 'ACK',
# 'VERSION': 'OpenCL 1.1 ATI-Stream-v2.3 (451)',
# 'NACK2RETURN': ' ',
# 'MEMORY2UNIFIED4HOSTANDDEVICE': 1,
# 'ENDIANESS2DEVICE': 'Little',
# 'MINIMUM2ALIGNMENT4DATATYPE': 128,
# 'ROUND2+VE3INFINITY': 'ACK',
# 'TYPE': 'CL_DEVICE_TYPE_LPU',
# 'DENORMS2SINGLEPRECISION4FLOATINGPOINTCAPABILITY': 'ACK'}; time: 00:54:15 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2lpu-failed-by-create2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4imagecreate2lpu ['DEVICE'] = device2lpu
# ---------------------------------------------------------------------------------------------
# (5) ERROR CODE - REQUIRED
# ---------------------------------------------------------------------------------------------
task4imagecreate2lpu ['CODE2ERROR'] = 0
code2ack = code2ack + '5B-'
# ---------------------------------------------------------------------------------------------
# (6) QUEUE - EXTRA
# ---------------------------------------------------------------------------------------------
queue2lpu = None
message2print = "{(Step 6A/70) trying" + "; queue2lpu-trying-by-create2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2lpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 6B/70) got" + "; queue2lpu-got-by-create2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; queue2lpu-failed-by-create2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4imagecreate2lpu ['QUEUE'] = queue2lpu
# ---------------------------------------------------------------------------------------------
# (7) PIPE - EXTRA
# ---------------------------------------------------------------------------------------------
pipe2lpu = None
message2print = "{(Step 7A/70) trying" + "; pipe2lpu-trying-by-create2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2lpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 7B/70) got" + "; pipe2lpu-got-by-create2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; pipe2lpu-failed-by-create2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4imagecreate2lpu ['PIPE'] = pipe2lpu
# ---------------------------------------------------------------------------------------------
# (8) COMMAND QUEUE INFO - EXTRA
# ---------------------------------------------------------------------------------------------
commandqueueinfo2lpu = {}
message2print = "{(Step 8A/70) trying" + "; commandqueueinfo2lpu-trying-by-create2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2lpu = get2commandqueueinfo4lpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 8B/70) got" + "; commandqueueinfo2lpu-got-by-create2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2commandqueue4lpu-failed ; time: 05:04:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4lpu',
# 'METHOD': 'create2commandqueue4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 1D-1E-2C-2B-3B-4B-8A-9B-10B-9B-10B-11B-12B-13B-14B-15B-16B-17B-18B-',
# 'INFO2PRIVATE': None,
# 'QUEUE': ,
# 'NACK2RETURN': ' ',
# 'CONTEXT': {'COUNT2REFERENCE': 0 ...
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4lpu-failed ; time: 05:04:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4lpu',
# 'METHOD': 'create2context4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 2A-2C-2D-2E-2B-3B-4B-5B-6B-7B-7B-',
# 'INFO2PRIVATE': None,
# 'PLATFORM': {'list2platforms': ['DragonXi'], 'ack2return': ' 2C-2E-2F-2G-', 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1},
# 'NACK2RETURN': ' ',
# 'SIZE2PRIVATE': 0,
# 'PROPERTIES': None},
# 'DEVICE': {'RESOLUTION2TIMER4PROFILING': 318, ...
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; commandqueueinfo2lpu-failed-by-create2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4imagecreate2lpu ['COMMANDQUEUE'] = commandqueueinfo2lpu
# ---------------------------------------------------------------------------------------------
# (9) BUFFER INFO - EXTRA
# ---------------------------------------------------------------------------------------------
bufferinfo2lpu = {}
message2print = "{(Step 9A/70) trying" + "; bufferinfo2lpu-trying-by-create2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2lpu = get2bufferinfo4lpu() # SYSTEM CREATES BUFFER FOR LPU, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; bufferinfo2lpu-got-by-create2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4lpu-failed ; time: 05:04:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4lpu',
# 'METHOD': 'create2buffer4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4lpu-failed ; time: 05:04:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4lpu',
# 'METHOD': 'create2context4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 2A-2C-2D-2E-2B-3B-4B-5B-6B-7B-7B-',
# 'INFO2PRIVATE': None,
# 'PLATFORM': {'list2platforms': ['DragonXi'], 'ack2return': ' 2C-2E-2F-2G-', 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1},
# 'NACK2RETURN': ' ',
# 'SIZE2PRIVATE': 0,
# 'PROPERTIES': None},
# 'DEVICE': {'RESOLUTION2TIMER4PROFILING': 318, ...
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; bufferinfo2lpu-failed-by-create2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4imagecreate2lpu ['BUFFER'] = bufferinfo2lpu
# ---------------------------------------------------------------------------------------------
# (10) EVENT INFO - EXTRA
# ---------------------------------------------------------------------------------------------
eventinfo2lpu = {}
message2print = "{(Step 10A/70) trying" + "; eventinfo2lpu-trying-by-create2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2lpu = get2eventinfo4lpu() # SYSTEM CREATES EVENT IF NECESSAY
message2print = "{(Step 10B/70) got" + "; eventinfo2lpu-got-by-create2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2event4lpu-failed ; time: 05:10:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2event4lpu',
# 'METHOD': 'create2event4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 1D-1E-2C-2B-3B-4B-6B-7B-8B-9B-10B-11B-12B-14B-15B-16B-',
# 'QUEUE': ,
# 'NACK2RETURN': ' ',
# 'CONTEXT': {'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4lpu-failed ; time: 05:10:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4lpu', 'METHOD': 'create2context4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 2A-2C-2D-2E-2B-3B-4B-5B-6B-7B-7B-',
# 'INFO2PRIVATE': None,
# 'PLATFORM': {'list2platforms': ['DragonXi'], 'ack2return': ' 2C-2E-2F-2G-', 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1},
# 'NACK2RETURN': ' ',
# 'SIZE2PRIVATE': 0,
# 'PROPERTIES': None},
# 'COMMANDQUEUE': {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': ...
code2ack = code2ack + '10B-'
except:
message2print = "{(Step 10Z/70) failed" + "; eventinfo2lpu-failed-by-create2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '10Z-'
task4imagecreate2lpu ['EVENT'] = eventinfo2lpu
# ---------------------------------------------------------------------------------------------
# (11) FLAGS - REQUIRED
# ---------------------------------------------------------------------------------------------
flags2lpu = 0
message2print = "{(Step 11A/70) trying" + "; flags2lpu-trying-by-create2image4lpu: " + str(flags2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
flags2lpu = 0
message2print = "{(Step 11B/70) set" + "; flags2lpu-set-by-create2image4lpu to: " + str(flags2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; flags2lpu-failed-by-create2image4lpu: " + str(flags2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4imagecreate2lpu ['FLAGS'] = flags2lpu
# ---------------------------------------------------------------------------------------------
# (14) WIDTH - REQUIRED
# ---------------------------------------------------------------------------------------------
width2lpu = 0
quantity2core = 1 # ORIGIN
quantity2skeleton = 1 # SKELETON WITH DISTANCE 1
quantity2layers = 33 # LAYERS 10, 100 ... 900, 1000 ... 3300
quantity2frame = 1 # FRAME
quantity2extra = 4 # CONTROLS FOR GUI ETC...
width2layer = 10 # SCALED TO 10 EACH LAYER
message2print = "{(Step 14A/70) trying" + "; width2lpu-trying-by-create2image4lpu: " + str(width2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
width2lpu = int(width2layer * (quantity2core + quantity2skeleton + quantity2layers + quantity2frame + quantity2extra))
width2lpu = 2 * width2lpu # POS and NEG X 2*400 = 800 PIXELS
message2print = "{(Step 14B/70) set" + "; width2lpu-set-by-create2image4lpu to: " + str(width2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; width2lpu-failed-by-create2image4lpu: " + str(width2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4imagecreate2lpu ['WIDTH'] = width2lpu
# ---------------------------------------------------------------------------------------------
# (15) HEIGHT - REQUIRED
# ---------------------------------------------------------------------------------------------
height2lpu = 0
quantity2core = 1 # ORIGIN
quantity2skeleton = 1 # SKELETON WITH DISTANCE 1
quantity2layers = 33 # LAYERS 10, 100 ... 900, 1000 ... 3300
quantity2frame = 1 # FRAME
quantity2extra = 4 # CONTROLS FOR GUI
quantity2total = quantity2core + quantity2skeleton + quantity2layers + quantity2frame + quantity2extra
height2layer = 10 # SCALED TO 10
message2print = "{(Step 15A/70) trying" + "; height2lpu-trying-by-create2image4lpu: " + str(height2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
height2lpu = height2layer * quantity2total
height2lpu = 2 * height2lpu # POS and NEG Y 2*400 = 800 PIXELS
message2print = "{(Step 15B2/70) set" + "; height2lpu-set-by-create2image4lpu to: " + str(height2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; height2lpu-failed-by-create2image4lpu: " + str(height2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '15Z-'
task4imagecreate2lpu ['HEIGHT'] = height2lpu
# ---------------------------------------------------------------------------------------------
# (16) ROWPITCH (STRIDE) - REQUIRED
# ---------------------------------------------------------------------------------------------
# One can assume that memory representing an image or screen will have data laid out as one row of pixels followed directly by the next row of pixels.
# However many APIs (e.g. Direct3D) that return a pointer to image data add an extra block of data at the end of each row.
# int offset = x * bytesPerPixel + y * pitch;
# When a video image is stored in memory, the memory buffer might contain extra padding bytes after each row of pixels.
# The padding bytes affect how the image is stored in memory, but do not affect how the image is displayed.
# The stride is the number of bytes from one row of pixels in memory to the next row of pixels in memory.
# Stride is also called pitch.
# If padding bytes are present, the stride is wider than the width of the image, as shown in the following illustration.
rowpitch2lpu = 0
size2element = 1 # VOXEL (X,Y,Z) = SHOT IN PIXELS, R=1 PIXELS
voxelquantity2layer = 1 # MAX NUMBER OF VOXELS IN EACH 2D LAYER
quantity2direction = 1 # ONE DIRECTIONS IN 2D
message2print = "{(Step 16A/70) trying" + "; rowpitch2lpu-trying-by-create2image4lpu: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2lpu = int(width2lpu * size2element * voxelquantity2layer / quantity2direction) # (800 * 8 * 10) / 8 = 8K PIXELS MAX TO SCAN
# SPHERE IS SPARSE HAVING FEW SHOTS PER SCAN LINE
message2print = "{(Step 16B/70) set" + "; rowpitch2lpu-set-by-create2image4lpu to: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; rowpitch2lpu-failed-by-create2image4lpu: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '16Z-'
task4imagecreate2lpu ['ROWPITCH'] = rowpitch2lpu
# ---------------------------------------------------------------------------------------------
# (17) POINTER - REQUIRED
# ---------------------------------------------------------------------------------------------
pointer2lpu = None
size2lpu = int(width2lpu * height2lpu) # CALCULATED MEMORY
if size2lpu == 0:
size2lpu = 4400 # MINIMUM MEMORY
message2print = "{(Step 17A/70) trying" + "; pointer2lpu-trying-by-create2image4lpu: " + str(pointer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
arena2lpu = Arena4Xi(size2lpu) # SYSTEM RESERVER MEMORY FOR IMAGE
message2print = "{(Step 17B1/70) got" + "; arena2lpu-got-by-create2image4lpu: " + str(arena2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
size2arena = arena2lpu.size #
message2print = "{(Step 17B2/70) got" + "; size2arena-got-by-create2buffer4lpu: " + str(size2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 640000
buffer2arena = arena2lpu.buffer
message2print = "{(Step 17B3/70) got" + "; buffer2arena-got-by-create2buffer4lpu: " + str(buffer2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17B-'
if size2arena < size2lpu:
size2lpu = size2arena # AVAILABLE MEMORY FOR IMAGE
message2print = "{(Step 17C/70) set" + "; size2lpu-set-by-create2buffer4lpu to: " + str(size2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17C-'
else:
pass
pointer2lpu = buffer2arena
message2print = "{(Step 17D/70) set" + "; pointer2lpu-set-by-create2buffer4lpu to: " + str(pointer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17D-'
except:
message2print = "{(Step 17Z/70) failed" + "; pointer2lpu-failed-by-create2image4lpu: " + str(pointer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '17Z-'
task4imagecreate2lpu ['POINTER'] = pointer2lpu
task4imagecreate2lpu ['SIZE'] = size2lpu # EXTRA
# ---------------------------------------------------------------------------------------------
# (18) FORMAT - REQUIRED
# ---------------------------------------------------------------------------------------------
format2lpu = {}
message2print = "{(Step 18A/70) trying" + "; format2lpu-trying-by-create2image4lpu: " + str(format2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
format2lpu['ORDER'] = 'CL_RGBA'
message2print = "{(Step 18B/70) set" + "; format2lpu-set-by-create2image4lpu to: " + str(format2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'ORDER': 'CL_RGBA'}
code2ack = code2ack + '18B-'
format2lpu['TYPE'] = 'CL_UNORM_INT8'
message2print = "{(Step 18C/70) set" + "; format2lpu-set-by-create2image4lpu to: " + str(format2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'}
code2ack = code2ack + '18C-'
except:
message2print = "{(Step 18Z/70) failed" + "; format2lpu-failed-by-create2image4lpu: " + str(format2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '18Z-'
task4imagecreate2lpu ['FORMAT'] = format2lpu
# ---------------------------------------------------------------------------------------------
# (19) DEPTH - MUST BE 0
# ---------------------------------------------------------------------------------------------
depth2lpu = 0
message2print = "{(Step 19A/70) set" + "; depth2lpu-set-by-create2image4lpu to: " + str(depth2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '19A-'
task4imagecreate2lpu ['DEPTH'] = depth2lpu
else:
pass # PARAMETER DATA RECEIVED
except:
message2print = "{(Step 1Z1/70) yielded" + "; task4imagecreate2lpu-yielded-by-create2image4lpu: " + str(task4imagecreate2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '1Z1-'
# ---------------------------------------------------------------------------------------------
# TASK EITHER GENERATED BY THIS PROGRAM (NONE GIVEN) OR GIVEN BY USER
# ---------------------------------------------------------------------------------------------
keys2task = task4imagecreate2lpu.keys()
message2print = "{(Step 19A/70) using" + "; keys2task-using-by-create2image4lpu: " + str(sorted(keys2task)) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ['BUFFER',
# 'CODE2ERROR',
# 'COMMANDQUEUE',
# 'CONTEXT',
# 'DATA2CALLBACK',
# 'DEVICE',
# 'EVENT',
# 'FLAGS',
# 'FORMAT',
# 'FUNCTION2CALLBACK',
# 'HEIGHT',
# 'PIPE',
# 'PLATFORM',
# 'POINTER',
# 'QUEUE',
# 'ROWPITCH',
# 'SIZE',
# 'WIDTH']; time: 00:53:55 10/05/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (Step 20A/70) - CREATE 2D IMAGE FOR LPU!
# ---------------------------------------------------------------------------------------------
lpu2image4xi = {}
message2print = "{(Step 20A/70) initialized" + "; lpu2image4xi-initialized-by-create2image4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
message2print = "{(Step 21A0/70) try" + "; data2callback-try-by-create2image4lpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 21A/70) - DATA2CALLBACK - EXTRA
# -----------------------------------------------------------------------------------------
lpu2image4xi['DATA2CALLBACK'] = task4imagecreate2lpu['DATA2CALLBACK']
message2print = "{(Step 21A1/70) initialized" + "; data2callback-created-by-create2image4lpu to: " + str(lpu2image4xi['DATA2CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; create2image4lpu-failed ; time: 05:56:13 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4lpu',
# 'METHOD': 'create2image4lpu'}; time: 05:56:13 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '21A1-'
except:
message2print = "{(Step 21Z1/70) yielded" + "; data2callback-lpu2image4xi-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '21Z1-'
message2print = "{(Step 22B0/70) try" + "; function2callback-try-by-create2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 22B/70) - FUNCTION2CALLBACK - EXTRA
# -----------------------------------------------------------------------------------------
lpu2image4xi['FUNCTION2CALLBACK'] = task4imagecreate2lpu['FUNCTION2CALLBACK']
message2print = "{(Step 22B1/70) initialized" + "; function2callback-created-by-create2image4lpu to: " + str(lpu2image4xi['FUNCTION2CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B1-'
except:
message2print = "{(Step 22Z2/70) yielded" + "; function2callback-lpu2image4xi-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z2-'
message2print = "{(Step 22C0/70) try" + "; platform-try-by-create2image4lpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 22C/70) - PLATFORM - EXTRA
# -----------------------------------------------------------------------------------------
lpu2image4xi['PLATFORM'] = task4imagecreate2lpu['PLATFORM']
message2print = "{(Step 22C1/70) initialized" + "; platform-created-by-create2image4lpu to: " + str(lpu2image4xi['PLATFORM']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'list2platforms': ['DragonXi'], 'ack2return': ' 2C-2E-2F-2G-', 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1}; time: 05:56:13 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '22C1-'
except:
message2print = "{(Step 22Z3/70) yielded" + "; platform-lpu2image4xi-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z3-'
message2print = "{(Step 23A/70) try" + "; context2lpu-try-by-create2image4lpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 23/70) - CONTEXT - REQUIRED
# -----------------------------------------------------------------------------------------
lpu2image4xi['CONTEXT'] = task4imagecreate2lpu['CONTEXT']
message2print = "{(Step 23B/70) initialized" + "; context-created-by-create2image4lpu to: " + str(lpu2image4xi['CONTEXT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4lpu-failed ; time: 05:56:12 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4lpu',
# 'METHOD': 'create2context4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 2A-2C-2D-2E-2B-3B-4B-5B-6B-7B-7B-',
# 'INFO2PRIVATE': None,
# 'PLATFORM': {'list2platforms': ['DragonXi'], 'ack2return': ' 2C-2E-2F-2G-', 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1},
# 'NACK2RETURN': ' ',
# 'SIZE2PRIVATE': 0,
# 'PROPERTIES': None}; time: 05:56:13 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z1/70) yielded" + "; context-lpu2image4xi-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z1-'
message2print = "{(Step 24A/70) try" + "; device-try-by-create2image4lpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 24/70) - DEVICE - EXTRA
# -----------------------------------------------------------------------------------------
lpu2image4xi['DEVICE'] = task4imagecreate2lpu['DEVICE']
message2print = "{(Step 24B/70) initialized" + "; device-created-by-create2image4lpu to: " + str(lpu2image4xi['DEVICE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'RESOLUTION2TIMER4PROFILING': 318,
# 'ID2PLATFORM': '0000000001509568',
# 'PROFILING2QUEUE': 'ACK',
# 'EXECUTE2KERNELS4OPENCL': 'ACK',
# 'NATIVE2WIDTHLONG4VECTOR': 2,
# 'MAX2UNITS4COMPUTE': 4,
# 'SIZE2MEMORY4GLOBAL': 3221225472,
# 'NATIVE2WIDTHFLOAT4VECTOR': 4,
# 'MAX2SIZE4WORKGROUP': 1024,
# 'PREFERRED2WIDTHCHAR4VECTOR': 16,
# 'SIZE2CACHE': 65536,
# 'IEEE754-2008FUSED2MULTIPLY-ADD': 'NACK',
# 'TYPE4CACHE': 'Read/Write',
# 'PREFERRED2WIDTHINT4VECTOR': 4,
# 'SIZE2PREFERREDWORKGROUPMULTIPLE4KERNEL': 1,
# 'NATIVE2WIDTHINT4VECTOR': 4,
# 'SIZE2BUFFER4CONSTANT': 65536,
# 'EXECUTE2FUNCTION4NATIVE': 'ACK',
# 'PREFERRED2WIDTHDOUBLE4VECTOR': 0,
# 'MAX2NUMBER4CONSTANTARGS': 8,
# 'VERSION2DRIVER': '2.0', 'EXTENSIONS': 'cl_amd_fp64 ...
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z1/70) yielded" + "; device-lpu2image4xi-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z1-'
message2print = "{(Step 25A/70) try" + "; code2error-try-by-create2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 25/70) - ERROR CODE - REQUIRED
# -----------------------------------------------------------------------------------------
lpu2image4xi['CODE2ERROR'] = task4imagecreate2lpu['CODE2ERROR']
message2print = "{(Step 25B/70) initialized" + "; code2error-created-by-create2image4lpu to: " + str(lpu2image4xi['CODE2ERROR']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z1/70) yielded" + "; code2error-lpu2image4xi-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z1-'
message2print = "{(Step 26A/70) try" + "; queue-try-by-create2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 26/70) - QUEUE - EXTRA
# -----------------------------------------------------------------------------------------
lpu2image4xi['QUEUE'] = task4imagecreate2lpu['QUEUE']
message2print = "{(Step 26B/70) initialized" + "; queue-created-by-create2image4lpu to: " + str(lpu2image4xi['QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z1/70) yielded" + "; queue-lpu2image4xi-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z1-'
message2print = "{(Step 27A/70) try" + "; pipe-try-by-create2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 27/70) - PIPE - EXTRA
# -----------------------------------------------------------------------------------------
lpu2image4xi['PIPE'] = task4imagecreate2lpu['PIPE']
message2print = "{(Step 27B/70) initialized" + "; pipe-created-by-create2image4lpu to: " + str(lpu2image4xi['PIPE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z1/70) yielded" + "; pipe-lpu2image4xi-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z1-'
message2print = "{(Step 28A/70) try" + "; commandqueue-try-by-create2image4lpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - EXTRA
# ---------------------------------------------------------------------------------------------
lpu2image4xi['COMMANDQUEUE'] = task4imagecreate2lpu['COMMANDQUEUE']
message2print = "{(Step 28B/70) initialized" + "; commandqueue-created-by-create2image4lpu to: " + str(lpu2image4xi['COMMANDQUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2commandqueue4lpu-failed ; time: 07:13:59 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4lpu',
# 'METHOD': 'create2commandqueue4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 1D-1E-2C-2B-3B-4B-8A-9B-10B-9B-10B-11B-12B-13B-14B-15B-16B-17B-18B-',
# 'INFO2PRIVATE': None,
# 'QUEUE': ,
# 'NACK2RETURN': ' ',
# 'CONTEXT': {'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z1/70) yielded" + "; commandqueue-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '28Z1-'
message2print = "{(Step 29A/70) try" + "; bufferinfo-try-by-create2image4lpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (29) BUFFER INFO - EXTRA
# ---------------------------------------------------------------------------------------------
lpu2image4xi['BUFFER'] = task4imagecreate2lpu['BUFFER']
message2print = "{(Step 29B/70) initialized" + "; bufferinfo-created-by-create2image4lpu to: " + str(lpu2image4xi['BUFFER']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4lpu-failed ; time: 05:56:12 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4lpu',
# 'METHOD': 'create2buffer4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4lpu-failed ...
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z1/70) yielded" + "; bufferinfo-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z1-'
message2print = "{(Step 30A/70) try" + "; eventinfo-try-by-create2image4lpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (30) EVENT INFO - EXTRA
# ---------------------------------------------------------------------------------------------
lpu2image4xi['EVENT'] = task4imagecreate2lpu['EVENT']
message2print = "{(Step 30B/70) initialized" + "; eventinfo-created-by-create2image4lpu to: " + str(lpu2image4xi['EVENT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2event4lpu-failed ; time: 05:56:12 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2event4lpu',
# 'METHOD': 'create2event4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 1D-1E-2C-2B-3B-4B-6B-7B-8B-9B-10B-11B-12B-14B-15B-16B-',
# 'QUEUE': ,
# 'NACK2RETURN': ' ',
# 'CONTEXT': {'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '30B-'
except:
message2print = "{(Step 30Z1/70) yielded" + "; eventinfo-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '30Z1-'
message2print = "{(Step 31A/70) try" + "; flags-try-by-create2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (31) FLAGS - REQUIRED
# ---------------------------------------------------------------------------------------------
lpu2image4xi['FLAGS'] = task4imagecreate2lpu['FLAGS']
message2print = "{(Step 31B/70) initialized" + "; flags-created-by-create2image4lpu to: " + str(lpu2image4xi['FLAGS']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z1/70) yielded" + "; flags-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z1-'
message2print = "{(Step 34A/70) try" + "; width-try-by-create2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (34) WIDTH - REQUIRED
# ---------------------------------------------------------------------------------------------
lpu2image4xi['WIDTH'] = task4imagecreate2lpu['WIDTH']
message2print = "{(Step 34H/70) initialized" + "; width-created-by-create2image4lpu to: " + str(lpu2image4xi['WIDTH']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '34H-'
except:
message2print = "{(Step 34Z1/70) yielded" + "; width-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z1-'
message2print = "{(Step 35A/70) try" + "; height-try-by-create2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (35) HEIGHT - REQUIRED
# ---------------------------------------------------------------------------------------------
lpu2image4xi['HEIGHT'] = task4imagecreate2lpu['HEIGHT']
message2print = "{(Step 35H/70) initialized" + "; height-created-by-create2image4lpu to: " + str(lpu2image4xi['HEIGHT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '35H-'
except:
message2print = "{(Step 35Z1/70) yielded" + "; height-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '35Z1-'
message2print = "{(Step 36A/70) try" + "; rowpitch-try-by-create2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (36) ROWPITCH - REQUIRED
# ---------------------------------------------------------------------------------------------
lpu2image4xi['ROWPITCH'] = task4imagecreate2lpu['ROWPITCH']
message2print = "{(Step 36B/70) initialized" + "; rowpitch-created-by-create2image4lpu to: " + str(lpu2image4xi['ROWPITCH']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z1/70) yielded" + "; rowpitch-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '36Z1-'
message2print = "{(Step 37A/70) try" + "; pointer-try-by-create2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (37) POINTER - REQUIRED
# ---------------------------------------------------------------------------------------------
lpu2image4xi['POINTER'] = task4imagecreate2lpu['POINTER']
message2print = "{(Step 37B/70) initialized" + "; pointer-created-by-create2image4lpu to: " + str(lpu2image4xi['POINTER']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37B-'
except:
message2print = "{(Step 37Z1/70) yielded" + "; pointer-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '37Z1-'
message2print = "{(Step 38A/70) try" + "; format-try-by-create2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (38) FORMAT - REQUIRED
# ---------------------------------------------------------------------------------------------
lpu2image4xi['FORMAT'] = task4imagecreate2lpu['FORMAT']
message2print = "{(Step 38B/70) initialized" + "; format-created-by-create2image4lpu to: " + str(lpu2image4xi['FORMAT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'}
code2ack = code2ack + '38B-'
except:
message2print = "{(Step 38Z1/70) yielded" + "; format-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '38Z1-'
message2print = "{(Step 39A/70) try" + "; depth-try-by-create2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (39) DEPTH - MUST BE 0
# ---------------------------------------------------------------------------------------------
lpu2image4xi['DEPTH'] = task4imagecreate2lpu['DEPTH']
message2print = "{(Step 39B/70) initialized" + "; depth-created-by-create2image4lpu to: " + str(lpu2image4xi['DEPTH']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '39B-'
except:
message2print = "{(Step 39Z1/70) yielded" + "; depth-yielded-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '39Z1-'
# -----------------------------------------------------------------------------------------
# (Step 70/70)
# -----------------------------------------------------------------------------------------
lpu2image4xi ['ACK2RETURN'] = code2ack
lpu2image4xi ['NACK2RETURN'] = code2nack
message2print = "{(Step 70/70) returning" + "; lpu2image4xi-returning-by-create2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# 'DEPTH'
# 'WIDTH'
# 'HEIGHT'
return lpu2image4xi
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def set2image4lpu(task4imageset2lpu=None):
'''
sets 2D images for LPU
'''
global lpu2image4xi
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "set2image4lpu"
method2print = "set2image4lpu"
message2print = "{(Step 1A/33) started" + "; set2image4lpu-started: " + str(set2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4imageset2lpu-to-set2image4lpu: " + str(task4imageset2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'QUEUE': ,
# 'CONTEXT': {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4lpu-failed ; time: 07:13:59 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4lpu',
# 'METHOD': 'create2context4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 2A-2C-2D-2E-2B-3B-4B-5B-6B-7B-7B-',
# 'INFO2PRIVATE': None,
# 'PLATFORM': {'list2platforms': ['DragonXi'], 'ack2return': ' 2C-2E-2F-2G-', 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1},
# 'NACK2RETURN': ' ',
# 'SIZE2PRIVATE': 0,
# 'PROPERTIES': None},
# 'COMMANDQUEUE': {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2commandqueue4lpu-failed ; time: 07:13:59 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4lpu',
# 'METHOD': 'create2commandqueue4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 1D-1E-2C-2B-3B-4B-8A-9B-10B-9B-10B-11B-12B-13B-14B-15B-16B-17B-18B-',
# 'INFO2PRIVATE': None,
# 'QUEUE': ,
# 'NACK2RETURN': ' ',
# 'CONTEXT': {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4lpu-failed ; time: 07:13:59 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4lpu',
# 'METHOD': 'create2context4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 2A-2C-2D-2E-2B-3B-4B-5B-6B-7B-7B-',
# 'INFO2PRIVATE': None,
# 'PLATFORM': {'list2platforms': ['DragonXi'],
# 'ack2return': ' 2C-2E-2F-2G-',
# 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1},
# 'NACK2RETURN': ' ',
# 'SIZE2PRIVATE': 0,
# 'PROPERTIES': None},
# 'DEVICE': {'RESOLUTION2TIMER4PROFILING': 318,
# 'ID2PLATFORM': '0000000001509568',
# 'PROPERTIES': None,
# 'PIPE': (, )},
# 'DEVICE': {'RESOLUTION2TIMER4PROFILING': 318, 'ID2PLATFORM': '0000000001509568', 'PROFILING2QUEUE': 'ACK', 'EXECUTE2KERNELS4OPENCL': 'ACK',
# 'NATIVE2WIDTHLONG4VECTOR': 2, 'MAX2UNITS4COMPUTE': 4, 'SIZE2MEMORY4GLOBAL': 3221225472, 'NATIVE2WIDTHFLOAT4VECTOR': 4, 'MAX2SIZE4WORKGROUP': 1024, 'PREFERRED2WIDTHCHAR4VECTOR': 16, 'SIZE2CACHE': 65536,
# 'IEEE754-2008FUSED2MULTIPLY-ADD': 'NACK', 'TYPE4CACHE': 'Read/Write', 'PREFERRED2WIDTHINT4VECTOR': 4, 'SIZE2PREFERREDWORKGROUPMULTIPLE4KERNEL': 1, 'NATIVE2WIDTHINT4VECTOR': 4,
# 'SIZE2BUFFER4CONSTANT': 65536, 'EXECUTE2FUNCTION4NATIVE': 'ACK', 'PREFERRED2WIDTHDOUBLE4VECTOR': 0, 'MAX2NUMBER4CONSTANTARGS': 8, 'VERSION2DRIVER': '2.0',
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if lpu2image4xi is None:
lpu2image4xi = create2image4lpu() # INITIALIZE IMAGE FOR LPU
message2print = "{(Step 1C/70) set" + "; lpu2image4xi-set-by-set2image4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4lpu-skipped-by-set2image4lpu: " + str(create2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ;
except:
try:
lpu2image4xi = create2image4lpu()
message2print = "{(Step 1E/70) set" + "; lpu2image4xi-set-by-set2image4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
lpu2image4xi = {}
message2print = "{(Step 1Z/70) yielded" + "; lpu2image4xi-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
# ---------------------------------------------------------------------------------------------
# SET
# ---------------------------------------------------------------------------------------------
message2print = "{(Step 22A0/70) try" + "; data2callback-try-by-set2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 21A/70) - DATA2CALLBACK - EXTRA
# -----------------------------------------------------------------------------------------
lpu2image4xi['DATA2CALLBACK'] = task4imageset2lpu['DATA2CALLBACK']
message2print = "{(Step 21A1/70) set" + "; data2callback-set-by-set2image4lpu to: " + str(lpu2image4xi['DATA2CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21A1-'
except:
message2print = "{(Step 21Z1/70) yielded" + "; data2callback-lpu2image4xi-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '21Z1-'
message2print = "{(Step 22B0/70) try" + "; function2callback-try-by-set2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 22B/70) - FUNCTION2CALLBACK - EXTRA
# -----------------------------------------------------------------------------------------
lpu2image4xi['FUNCTION2CALLBACK'] = task4imageset2lpu['FUNCTION2CALLBACK']
message2print = "{(Step 22B1/70) set" + "; function2callback-set-by-set2image4lpu to: " + str(lpu2image4xi['FUNCTION2CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B1-'
except:
message2print = "{(Step 22Z2/70) yielded" + "; function2callback-lpu2image4xi-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '22Z2-'
message2print = "{(Step 22C0/70) try" + "; platform2callback-try-by-set2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 22C/70) - PLATFORM - EXTRA
# -----------------------------------------------------------------------------------------
lpu2image4xi['PLATFORM'] = task4imageset2lpu['PLATFORM']
message2print = "{(Step 2C1/70) set" + "; platform-set-by-set2image4lpu to: " + str(lpu2image4xi['PLATFORM']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2ack = code2ack + '2C1-'
except:
message2print = "{(Step 22Z3/70) yielded" + "; platform-lpu2image4xi-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z3-'
message2print = "{(Step 23A/70) try" + "; context2lpu-try-by-set2image4lpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 23/70) - CONTEXT - REQUIRED
# -----------------------------------------------------------------------------------------
lpu2image4xi['CONTEXT'] = task4imageset2lpu['CONTEXT']
message2print = "{(Step 23B/70) set" + "; context-set-by-set2image4lpu to: " + str(lpu2image4xi['CONTEXT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4lpu-failed ; time: 07:13:59 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4lpu',
# 'METHOD': 'create2context4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 2A-2C-2D-2E-2B-3B-4B-5B-6B-7B-7B-',
# 'INFO2PRIVATE': None,
# 'PLATFORM': {'list2platforms': ['DragonXi'], 'ack2return': ' 2C-2E-2F-2G-', 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1}, 'NACK2RETURN': ' ',
# 'SIZE2PRIVATE': 0,
# 'PROPERTIES': None}; time: 07:13:59 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z1/70) yielded" + "; context-lpu2image4xi-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z1-'
message2print = "{(Step 24A/70) try" + "; device-try-by-set2image4lpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 24/70) - DEVICE - EXTRA
# -----------------------------------------------------------------------------------------
lpu2image4xi['DEVICE'] = task4imageset2lpu['DEVICE']
message2print = "{(Step 24B/70) set" + "; device-set-by-set2image4lpu to: " + str(lpu2image4xi['DEVICE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'RESOLUTION2TIMER4PROFILING': 318,
# 'ID2PLATFORM': '0000000001509568',
# 'PROFILING2QUEUE': 'ACK',
# 'EXECUTE2KERNELS4OPENCL': 'ACK',
# 'NATIVE2WIDTHLONG4VECTOR': 2,
# 'MAX2UNITS4COMPUTE': 4,
# 'SIZE2MEMORY4GLOBAL': 3221225472,
# 'NATIVE2WIDTHFLOAT4VECTOR': 4,
# 'MAX2SIZE4WORKGROUP': 1024,
# 'PREFERRED2WIDTHCHAR4VECTOR': 16,
# 'SIZE2CACHE': 65536,
# 'IEEE754-2008FUSED2MULTIPLY-ADD': 'NACK',
# 'TYPE4CACHE': 'Read/Write',
# 'PREFERRED2WIDTHINT4VECTOR': 4,
# 'SIZE2PREFERREDWORKGROUPMULTIPLE4KERNEL': 1,
# 'NATIVE2WIDTHINT4VECTOR': 4,
# 'SIZE2BUFFER4CONSTANT': 65536,
# 'EXECUTE2FUNCTION4NATIVE': 'ACK',
# 'PREFERRED2WIDTHDOUBLE4VECTOR': 0,
# 'MAX2NUMBER4CONSTANTARGS': 8,
# 'VERSION2DRIVER': '2.0',
# 'EXTENSIONS': 'cl_amd_fp64 cl_khr_global_int32_base_atomics ...
# 'AVAILABLE2COMPILER': 'ACK',
# 'MAX2DIMENSIONS4WORKITEMS': 3,
# 'SUPPORT2CORRECTION4ERROR': 0,
# 'BITS2ADDRESS': 64,
# 'AVAILABLE': 'ACK',
# 'SIZE2MEMORY4LOCAL': 32768,
# 'VENDOR': 'AuthenticAMD',
# 'SUPPORT2IMAGE': 'NACK',
# 'MAX2SIZE4KERNELARGUMENT': 4096,
# 'ACK2RETURN': ' 1C-1D-1E-1F-1D-2A-3A-4A-5A-6A-7A-8A-9A-10A-11A-...
# 'OUT-OF-ORDER2QUEUE': 'NACK',
# 'ALIGNMENT2ADDRESS4BASE': 1024,
# 'PROFILE': 'FULL_PROFILE',
# 'TYPE2MEMORY4LOCAL': 'Global',
# 'PREFERRED2WIDTHFLOAT4VECTOR': 4,
# 'PREFERRED2WIDTHLONG4VECTOR': 2,
# 'MAX2FREQUENCY4CLOCK': 3210,
# 'PREFERRED2WIDTHSHORT4VECTOR': 8,
# 'ID': 4033,
# 'MAX2WORKITEM2': 1024,
# 'NATIVE2WIDTHDOUBLE4VECTOR': 0,
# 'ROUND2ZERO': 'ACK',
# 'NAME': 'AMD64 Family 16 Model 4 Stepping 2, AuthenticAMD',
# 'MAX2WORKITEM1': 1024,
# 'MAX2WORKITEM0': 1024,
# 'SIZE2LINE4CACHE': 64,
# 'MAX2ALLOCATION4MEMORY': 1073741824,
# 'NATIVE2WIDTHCHAR4VECTOR': 16,
# 'QUIET2NANS': 'ACK',
# 'NATIVE2WIDTHSHORT4VECTOR': 8,
# 'ROUND2NEAREST4EVEN': 'ACK',
# 'VERSION': 'OpenCL 1.1 ATI-Stream-v2.3 (451)',
# 'NACK2RETURN': ' ',
# 'MEMORY2UNIFIED4HOSTANDDEVICE': 1,
# 'ENDIANESS2DEVICE': 'Little',
# 'MINIMUM2ALIGNMENT4DATATYPE': 128,
# 'ROUND2+VE3INFINITY': 'ACK',
# 'TYPE': 'CL_DEVICE_TYPE_LPU',
# 'DENORMS2SINGLEPRECISION4FLOATINGPOINTCAPABILITY': 'ACK'}; time: 07:13:59 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z1/70) yielded" + "; device-lpu2image4xi-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z1-'
message2print = "{(Step 25A/70) try" + "; code2error-try-by-set2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 25/70) - ERROR CODE - REQUIRED
# -----------------------------------------------------------------------------------------
lpu2image4xi['CODE2ERROR'] = task4imageset2lpu['CODE2ERROR']
message2print = "{(Step 25B/70) set" + "; code2error-set-by-set2image4lpu to: " + str(lpu2image4xi['CODE2ERROR']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z1/70) yielded" + "; code2error-lpu2image4xi-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z1-'
message2print = "{(Step 26A/70) try" + "; queue-try-by-set2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 26/70) - QUEUE - EXTRA
# -----------------------------------------------------------------------------------------
lpu2image4xi['QUEUE'] = task4imageset2lpu['QUEUE']
message2print = "{(Step 26B/70) set" + "; queue-set-by-set2image4lpu to: " + str(lpu2image4xi['QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z1/70) yielded" + "; queue-lpu2image4xi-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z1-'
message2print = "{(Step 27A/70) try" + "; pipe-try-by-set2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 27/70) - PIPE - EXTRA
# -----------------------------------------------------------------------------------------
lpu2image4xi['PIPE'] = task4imageset2lpu['PIPE']
message2print = "{(Step 27B/70) set" + "; pipe-set-by-set2image4lpu to: " + str(lpu2image4xi['PIPE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z1/70) yielded" + "; pipe-lpu2image4xi-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z1-'
message2print = "{(Step 28A/70) try" + "; commandqueue-try-by-set2image4lpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - EXTRA
# ---------------------------------------------------------------------------------------------
lpu2image4xi['COMMANDQUEUE'] = task4imageset2lpu['COMMANDQUEUE']
message2print = "{(Step 28B/70) set" + "; commandqueue-set-by-set2image4lpu to: " + str(lpu2image4xi['COMMANDQUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z1/70) yielded" + "; commandqueue-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z1-'
message2print = "{(Step 29A/70) try" + "; bufferinfo-try-by-set2image4lpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (29) BUFFER INFO - EXTRA
# ---------------------------------------------------------------------------------------------
lpu2image4xi['BUFFER'] = task4imageset2lpu['BUFFER']
message2print = "{(Step 29B/70) set" + "; bufferinfo-set-by-set2image4lpu to: " + str(lpu2image4xi['BUFFER']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z1/70) yielded" + "; bufferinfo-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '29Z1-'
message2print = "{(Step 30A/70) try" + "; eventinfo-try-by-set2image4lpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (30) EVENT INFO - EXTRA
# ---------------------------------------------------------------------------------------------
lpu2image4xi['EVENT'] = task4imageset2lpu['EVENT']
message2print = "{(Step 30B/70) set" + "; eventinfo-set-by-set2image4lpu to: " + str(lpu2image4xi['EVENT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '30B-'
except:
message2print = "{(Step 30Z1/70) yielded" + "; eventinfo-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '30Z1-'
message2print = "{(Step 31A/70) try" + "; flags-try-by-set2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (31) FLAGS - REQUIRED
# ---------------------------------------------------------------------------------------------
lpu2image4xi['FLAGS'] = task4imageset2lpu['FLAGS']
message2print = "{(Step 31B/70) set" + "; flags-set-by-set2image4lpu to: " + str(lpu2image4xi['FLAGS']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z1/70) yielded" + "; flags-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '31Z1-'
message2print = "{(Step 34A/70) try" + "; width-try-by-set2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (34) WIDTH - REQUIRED
# ---------------------------------------------------------------------------------------------
lpu2image4xi['WIDTH'] = task4imageset2lpu['WIDTH']
message2print = "{(Step 34H/70) set" + "; width-set-by-set2image4lpu to: " + str(lpu2image4xi['WIDTH']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34H-'
except:
message2print = "{(Step 34Z1/70) yielded" + "; width-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z1-'
message2print = "{(Step 35A/70) try" + "; height-try-by-set2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (35) HEIGHT - REQUIRED
# ---------------------------------------------------------------------------------------------
lpu2image4xi['HEIGHT'] = task4imageset2lpu['HEIGHT']
message2print = "{(Step 35H/70) set" + "; height-set-by-set2image4lpu to: " + str(lpu2image4xi['HEIGHT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '35H-'
except:
message2print = "{(Step 35Z1/70) yielded" + "; height-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '35Z1-'
message2print = "{(Step 36A/70) try" + "; rowpitch-try-by-set2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (36) ROWPITCH - REQUIRED
# ---------------------------------------------------------------------------------------------
lpu2image4xi['ROWPITCH'] = task4imageset2lpu['ROWPITCH']
message2print = "{(Step 36B/70) set" + "; rowpitch-set-by-set2image4lpu to: " + str(lpu2image4xi['ROWPITCH']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z1/70) yielded" + "; rowpitch-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '36Z1-'
message2print = "{(Step 37A/70) try" + "; pointer-try-by-set2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (37) POINTER - REQUIRED
# ---------------------------------------------------------------------------------------------
lpu2image4xi['POINTER'] = task4imageset2lpu['POINTER']
message2print = "{(Step 37B/70) set" + "; pointer-set-by-set2image4lpu to: " + str(lpu2image4xi['POINTER']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37B-'
except:
message2print = "{(Step 37Z1/70) yielded" + "; pointer-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '37Z1-'
message2print = "{(Step 38A/70) try" + "; format-try-by-set2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (38) FORMAT - REQUIRED
# ---------------------------------------------------------------------------------------------
lpu2image4xi['FORMAT'] = task4imageset2lpu['FORMAT']
message2print = "{(Step 38B/70) set" + "; format-set-by-set2image4lpu to: " + str(lpu2image4xi['FORMAT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '38B-'
except:
message2print = "{(Step 38Z1/70) yielded" + "; format-yielded-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '38Z1-'
# -----------------------------------------------------------------------------------------
# (Step 70/70)
# -----------------------------------------------------------------------------------------
lpu2image4xi ['ACK2RETURN'] = code2ack
lpu2image4xi ['NACK2RETURN'] = code2nack
message2print = "{(Step 70/70) returning" + "; lpu2image4xi-returning-by-set2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'ACK2RETURN': ' 23B-24B-25B-26B-27B-28B-', 'ROWPITCH': 800, 'DATA2CALLBACK': ...
return lpu2image4xi
#
# -------------------------------------------------------------------------------------------------
#copy2copy4lpu"
# channel2copypublish4lpu = response4copy2image['PUBLISHERCHANNEL']
# channel2copypublish4lpu.send(message2copyimagesend4lpu)
# print("(Step 17B/700) OF LPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4LPU: ", channel2copypublish4lpu, " MESSAGE2SEND4LPU: " , message2copyimagesend4lpu)
# except:
# print('(Step 17Z1/700) OF LPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4LPU ', time4xi())
# # -----------------------------------------------------------------------------------------------
# # (18) LET MANOEUVRE2IMAGE4LPU TO RECEIVE COPY AND AND SEND ROGER VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print("(Step 18C/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# try:
# response2manoeuvre4lpu = manoeuvre2copyimage4lpu(queue2copy4lpu, channel2copyconsume4lpu, channel2copypublish4lpu)
# print("(Step 18D/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", manoeuvre2copyimage4lpu)
# except:
# print("(Step 18Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# else:
# pass # trust activated thread
# # -----------------------------------------------------------------------------------------------
# # (19) RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 19A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4LPU ', time4xi())
# try:
# channel2copyconsume4lpu = response4copy2image['CONSUMERCHANNEL']
# message2copyimagereceive4lpu = channel2copyconsume4lpu.recv()
# print("(Step 19B/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel2copyconsume4lpu, " CONTROL & COMMAND: ", message2copyimagereceive4lpu)
# # roger2copy4lpu
# except:
# print('(Step 19Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4LPU ', time4xi())
# # -----------------------------------------------------------------------------------------------
# # (20) SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2IMAGE4LPU TO RECEIVE
# # -----------------------------------------------------------------------------------------------
# print('(Step 20A/700) OF LPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4LPU ', time4xi())
# try:
# message2copyimagesend4lpu = "copy2copy4lpu"
# channel2copypublish4lpu = response4copy2image['PUBLISHERCHANNEL']
# channel2copypublish4lpu.send(message2copyimagesend4lpu)
# print("(Step 20B/700) OF LPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4LPU: ", channel2copypublish4lpu, " MESSAGE2SEND4LPU: " , message2copyimagesend4lpu)
# # copy2copy4lpu
# except:
# print('(Step 20Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4LPU ', time4xi())
# # -----------------------------------------------------------------------------------------------
# # (21) LET MANOEUVRE2IMAGE4LPU TO RECEIVE READY AND TO SEND READY
# # -----------------------------------------------------------------------------------------------
# print("(Step 21A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# try:
# response2manoeuvre4lpu = manoeuvre2copyimage4lpu(queue2copy4lpu, channel2copyconsume4lpu, channel2copypublish4lpu)
# print("(Step 21B/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", manoeuvre2copyimage4lpu)
# except:
# print("(Step 21Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (22) RECEIVE CONTROL & COMMAND READY VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 22A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4LPU ', time4xi())
# try:
# channel2copyconsume4lpu = response4copy2image['CONSUMERCHANNEL']
# message2copyimagereceive4lpu = channel2copyconsume4lpu.recv()
# print("(Step 22B/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel2copyconsume4lpu, " CONTROL & COMMAND: ", message2copyimagereceive4lpu)
# # copy2copy4lpu
# except:
# print('(Step 22Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4LPU ', time4xi())
# # ----------------------------------------------------------------------------------------------
# # (24) PUT IMAGE PATH TO QUEUE
# # ----------------------------------------------------------------------------------------------
# print("(Step 24A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PUT IMAGE PATH TO QUEUE ", time4xi())
# try:
# queue2copy4dragon.put(path2dragon)
# print("(Step 24B/700) OF DRAGON2IMAGE4XI5TEST - PUT TO QUEUE IMAGE PATH: ", path2dragon)
# # ..//..//..//..//..//web//images//png//dragonxi.png
# except:
# print("(Step 24Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (25) LET MANOEUVRE2IMAGE4LPU TO GET FROM QUEUE AND TO SEND EITHER ACK OR NACK VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print("(Step 25A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# try:
# response2manoeuvre4lpu = manoeuvre2copyimage4lpu(queue2copy4lpu, channel2copyconsume4lpu, channel2copypublish4lpu)
# print("(Step 25B/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", manoeuvre2copyimage4lpu)
# except:
# print("(Step 25Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (26) RECEIVE ACK OR NACK ABOUT IMAGE OPERATION VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 26A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2copyimagereceive4lpu = channel2copyconsume4lpu.recv()
# print("(Step 26D/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel2copyconsume4lpu, " CONTROL & COMMAND: ", message2copyimagereceive4lpu)
# # ack2imageinfo4lpu
# except:
# print('(Step 26Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# # -----------------------------------------------------------------------------------------------
# (27) LET MANOEUVRE2IMAGE4LPU GO TO STATE 0
# # -----------------------------------------------------------------------------------------------
# print("(Step 27A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# try:
# response2manoeuvre4lpu = manoeuvre2copyimage4lpu(queue2copy4lpu, channel2copyconsume4lpu, channel2copypublish4lpu)
# print("(Step 27B/700) OF LPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4LPU ", response2manoeuvre4lpu)
# except:
# print("(Step 27Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
#">
# -------------------------------------------------------------------------------------------------
def copy2image4lpu(task4imagecopy2lpu=None):
'''
copies 2D images for LPU
'''
global lpu2image4xi # 2D-IMAGES FOR LPU
global control2copyimage4lpu # COMMAND AND CONTROL FOR LPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "copy2image4lpu"
method2print = "copy2image4lpu"
message2print = "{(Step 0A/33) started" + "; copy2image4lpu-started: " + str(copy2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0B/33) passed" + "; task4imagecopy2lpu-to-copy2image4lpu: " + str(task4imagecopy2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE LPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if lpu2image4xi is None:
lpu2image4xi = create2image4lpu() # INITIALIZE IMAGE FOR LPU
message2print = "{(Step 0C/70) created" + "; lpu2image4xi-created-by-copy2image4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 0D/70) skipped" + "; create2image4lpu-skipped-by-copy2image4lpu: " + str(copy2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
try:
lpu2image4xi = create2image4lpu()
message2print = "{(Step 0E/70) set" + "; lpu2image4xi-set-by-copy2image4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
lpu2image4xi = {}
message2print = "{(Step 0Z/70) yielded" + "; lpu2image4xi-yielded-by-copy2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '0Z-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - CHECK PARAMETERS
# -----------------------------------------------------------------------------------------
try:
if task4imagecopy2lpu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR COPY - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4imagecopy2lpu = {}
message2print = "{(Step 1A/70) initialized" + "; task4imagecopy2lpu-created-by-copy2image4lpu to: " + str(task4imagecopy2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4lpu = trace2image4lpu # CALLBACK FUNCTION FOR LPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4lpu-created-by-copy2image4lpu to: " + str(function2callback4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2image4lpu" # MODULE OF LPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2image4lpu" # FUNCTION OF LPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2image4lpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR LPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-copy2image4lpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; copy2image4lpu-failed ; time: 07:01:44 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2image4lpu',
# 'METHOD': 'copy2image4lpu'}; time: 07:01:44 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagecopy2lpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO LPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagecopy2lpu['FUNCTION2CALLBACK'] = function2callback4lpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4imagecopy2lpu-created-by-copy2image4lpu to: " + str(task4imagecopy2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; copy2image4lpu-failed ; time: 07:01:44 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2image4lpu',
# 'METHOD': 'copy2image4lpu'}}; time: 07:01:44 10/04/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-copy2image4lpu to: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
try:
platform2xi = get2platformids4xi() # PLATFORM IS COMMON TO ALL DEVICES I.E TO DEVICE XI
message2print = "{(Step 2B/70) got" + "; platform2xi-got-by-copy2image4lpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'list2platforms': ['DragonXi'], 'ack2return': ' 2C-2E-2F-2G-', 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1}; time: 07:01:44 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '2B-'
except:
message2print = "{(Step 2Z/70) failed" + "; platform2xi-failed-by-copy2image4lpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4imagecopy2lpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2lpu = {}
message2print = "{(Step 3A/70) trying" + "; context2lpu-trying-by-copy2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2lpu = get2context4lpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2lpu-got-by-copy2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) ...
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2lpu-failed-by-copy2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4imagecopy2lpu ['CONTEXT'] = context2lpu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2lpu = {}
message2print = "{(Step 4A/70) trying" + "; device2lpu-trying-by-copy2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2lpu = get2lpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2lpu-got-by-copy2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'RESOLUTION2TIMER4PROFILING': 318, 'ID2PLATFORM': '0000000001509568', 'PROFILING2QUEUE': 'ACK', ...
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2lpu-failed-by-copy2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4imagecopy2lpu ['DEVICE'] = device2lpu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE SOURCE OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
imagesourceinfo2lpu = {}
message2print = "{(Step 5A/70) trying" + "; imagesourceinfo2lpu-trying-by-copy2image4lpu: " + str(imagesourceinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imagesourceinfo2lpu = get2imageinfo4lpu()
message2print = "{(Step 5B/70) got" + "; imagesourceinfo2lpu-got-by-copy2image4lpu: " + str(imagesourceinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'SIZE2QUEUE': 2147483646,
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8',
# 'ORDER': 'CL_RGBA'},
# 'QUEUE': ,
# 'WIDTH': 800,
# 'CONTEXT': {'COUNT2REFERENCE': 0, ...
code2ack = code2ack + '5B-'
except:
message2print = "{(Step 5Z/70) failed" + "; imagesourceinfo2lpu-failed-by-copy2image4lpu: " + str(imagesourceinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4imagecopy2lpu ['IMAGESOURCE'] = imagesourceinfo2lpu
# ---------------------------------------------------------------------------------------------
# (6) IMAGE DESTINATION OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
imagedestinationinfo2lpu = {}
message2print = "{(Step 6A/70) trying" + "; imagedestinationinfo2lpu-trying-by-copy2image4lpu: " + str(imagedestinationinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imagedestinationinfo2lpu = get2imageinfo4lpu()
message2print = "{(Step 6B/70) got" + "; imagedestinationinfo2lpu-got-by-copy2image4lpu: " + str(imagedestinationinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'SIZE2QUEUE': 2147483646,
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8',
# 'ORDER': 'CL_RGBA'},
# 'QUEUE': ,
# 'WIDTH': 800,
# 'CONTEXT': {'COUNT2REFERENCE': 0, ...
# note: source and destination will be the same !
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; imagedestinationinfo2lpu-failed-by-copy2image4lpu: " + str(imagedestinationinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4imagecopy2lpu ['IMAGEDESTINATION'] = imagedestinationinfo2lpu
# ---------------------------------------------------------------------------------------------
# (7) QUEUE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
queue2lpu = None
message2print = "{(Step 7A/70) trying" + "; queue2lpu-trying-by-copy2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2lpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 7B/70) got" + "; queue2lpu-got-by-copy2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; queue2lpu-failed-by-copy2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4imagecopy2lpu ['QUEUE'] = queue2lpu
# ---------------------------------------------------------------------------------------------
# (8) PIPE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
pipe2lpu = None
message2print = "{(Step 8A/70) trying" + "; pipe2lpu-trying-by-copy2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2lpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 8B/70) got" + "; pipe2lpu-got-by-copy2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; pipe2lpu-failed-by-copy2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4imagecopy2lpu ['PIPE'] = pipe2lpu
# ---------------------------------------------------------------------------------------------
# (9) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2lpu = {}
message2print = "{(Step 9A/70) trying" + "; commandqueueinfo2lpu-trying-by-copy2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2lpu = get2commandqueueinfo4lpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; commandqueueinfo2lpu-got-by-copy2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2commandqueue4lpu-failed ; time: 07:01:44 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4lpu',
# 'METHOD': 'create2commandqueue4lpu'},
# 'FUNCTION2CALLBACK': ...
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; commandqueueinfo2lpu-failed-by-copy2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4imagecopy2lpu ['COMMANDQUEUE'] = commandqueueinfo2lpu
# ---------------------------------------------------------------------------------------------
# (10) BUFFER - AUTOMATIC BY LPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2lpu = {}
message2print = "{(Step 10A/70) trying" + "; bufferinfo2lpu-trying-by-copy2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2lpu = get2bufferinfo4lpu() # SYSTEM CREATES BUFFER FOR LPU, IF NECESSARY
message2print = "{(Step 10B/70) got" + "; bufferinfo2lpu-got-by-copy2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE' ...
code2ack = code2ack + '10B-'
except:
message2print = "{(Step 10Z/70) failed" + "; bufferinfo2lpu-failed-by-copy2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '10Z-'
task4imagecopy2lpu ['BUFFER'] = bufferinfo2lpu
# ---------------------------------------------------------------------------------------------
# (11) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2lpu = {}
message2print = "{(Step 11A/70) trying" + "; eventinfo2lpu-trying-by-copy2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2lpu = get2eventinfo4lpu()
message2print = "{(Step 11B/70) got" + "; eventinfo2lpu-got-by-copy2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2event4lpu-failed ; time: 07:01:44 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2event4lpu',
# 'METHOD': 'create2event4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 1D-1E-2C-2B-3B-4B-6B-7B-8B-9B-10B-11B-12B-14B-15B-16B-',
# 'QUEUE': ,
# 'NACK2RETURN': ' ',
# 'CONTEXT': {'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; eventinfo2lpu-failed-by-copy2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4imagecopy2lpu ['EVENT'] = eventinfo2lpu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2lpu = {}
message2print = "{(Step 12A/70) trying" + "; eventwaitlist2lpu-trying-by-copy2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2lpu = {}
message2print = "{(Step 12B/70) set" + "; eventwaitlist2lpu-set-by-copy2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlist2lpu-failed-by-copy2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4imagecopy2lpu ['EVENTWAITLIST'] = eventwaitlist2lpu
# ---------------------------------------------------------------------------------------------
# (13) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2lpu = 0
message2print = "{(Step 13A/70) trying" + "; eventwaitlistquantity2lpu-trying-by-copy2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2lpu.keys()
for key2event in keys2event:
eventwaitlistquantity2lpu = eventwaitlistquantity2lpu + 1
message2print = "{(Step 13B/70) set" + "; eventwaitlistquantity2lpu-set-by-copy2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; eventwaitlistquantity2lpu-failed-by-copy2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4imagecopy2lpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2lpu
# ---------------------------------------------------------------------------------------------
# (14) ORIGIN FOR SOURCE - REQUIRED
# ---------------------------------------------------------------------------------------------
origin4source2lpu = {}
message2print = "{(Step 14A/70) trying" + "; origin4source2lpu-trying-by-copy2image4lpu: " + str(origin4source2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin4source2lpu['X'] = 0
origin4source2lpu['Y'] = 0
origin4source2lpu['Z'] = 0
message2print = "{(Step 14B/70) set" + "; origin4source2lpu-set-by-copy2image4lpu to: " + str(origin4source2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; origin4source2lpu-failed-by-copy2image4lpu: " + str(origin4source2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4imagecopy2lpu ['SOURCEORIGIN'] = origin4source2lpu
# ---------------------------------------------------------------------------------------------
# (15) ORIGIN FOR DESTINATION - REQUIRED
# ---------------------------------------------------------------------------------------------
origin4destination2lpu = {}
message2print = "{(Step 15A/70) trying" + "; origin4destination2lpu-trying-by-copy2image4lpu: " + str(origin4destination2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin4destination2lpu['X'] = 100
origin4destination2lpu['Y'] = 100
origin4destination2lpu['Z'] = 100
message2print = "{(Step 15B/70) set" + "; origin4destination2lpu-set-by-copy2image4lpu to: " + str(origin4destination2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; origin4destination2lpu-failed-by-copy2image4lpu: " + str(origin4destination2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '15Z-'
task4imagecopy2lpu ['DESTINATIONORIGIN'] = origin4destination2lpu
# --------------------------------------------------------------------------------------------------------
# (16) REGION - REGION OF A IMAGE TO BE COPIED
# --------------------------------------------------------------------------------------------------------
region4copy2lpu = {}
message2print = "{(Step 16A/70) trying" + "; region4copy2lpu-trying-by-copy2image4lpu: " + str(region4copy2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region4copy2lpu['X'] = 10
region4copy2lpu['Y'] = 10
region4copy2lpu['Z'] = 10
message2print = "{(Step 16B/70) set" + "; region4copy2lpu-set-by-copy2image4lpu to: " + str(region4copy2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; region4copy2lpu-failed-by-copy2image4lpu: " + str(region4copy2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '16Z-'
task4imagecopy2lpu ['REGION'] = region4copy2lpu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
else:
pass
# ---------------------------------------------------------------------------------------------
# CHECK PARAMETERS - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4imagecopy2lpu.keys()
message2print = "{(Step 20/70) using" + "; keys2task-using-by-copy2image4lpu: " + str(sorted(keys2task)) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ['BUFFER',
# 'COMMANDQUEUE',
# 'CONTEXT',
# 'DATA2CALLBACK',
# 'DESTINATIONORIGIN',
# 'DEVICE',
# 'EVENT',
# 'EVENTWAITLIST',
# 'EVENTWAITLISTQUANTITY',
# 'FUNCTION2CALLBACK',
# 'IMAGEDESTINATION',
# 'IMAGESOURCE',
# 'PIPE',
# 'PLATFORM',
# 'QUEUE',
# 'REGION',
# 'SOURCEORIGIN']; time: 01:21:58 10/05/11 Pacific Daylight Time}
if (('DATA2CALLBACK' in keys2task) and ('FUNCTION2CALLBACK' in keys2task)):
pass
else:
# ---------------------------------------------------------------------------------------------
# (21B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4lpu = trace2image4lpu # CALLBACK FUNCTION FOR LPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4lpu-created-by-copy2image4lpu to: " + str(function2callback4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2image4lpu" # MODULE OF LPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2image4lpu" # FUNCTION OF LPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2image4lpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR LPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-copy2image4lpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagecopy2lpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO LPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagecopy2lpu['FUNCTION2CALLBACK'] = function2callback4lpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4imagecopy2lpu-created-by-copy2image4lpu to: " + str(task4imagecopy2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-copy2image4lpu to: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
platform2xi = get2platformids4xi() # PLATFORM IS COMMON TO ALL DEVICES I.E TO DEVICE XI
message2print = "{(Step 22B/70) got" + "; platform2xi-got-by-copy2image4lpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-copy2image4lpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4imagecopy2lpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2lpu = {}
message2print = "{(Step 23A/70) trying" + "; context2lpu-trying-by-copy2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2lpu = get2context4lpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2lpu-got-by-copy2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2lpu-failed-by-copy2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4imagecopy2lpu ['CONTEXT'] = context2lpu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2lpu = {}
message2print = "{(Step 24A/70) trying" + "; device2lpu-trying-by-copy2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2lpu = get2lpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2lpu-got-by-copy2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2lpu-failed-by-copy2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4imagecopy2lpu ['DEVICE'] = device2lpu
if 'IMAGESOURCE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) SOURCE IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
sourceimageinfo2lpu = {}
message2print = "{(Step 25A/70) trying" + "; sourceimageinfo2lpu-trying-by-copy2image4lpu: " + str(sourceimageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
sourceimageinfo2lpu = get2imageinfo4lpu()
message2print = "{(Step 25B/70) got" + "; sourceimageinfo2lpu-got-by-copy2image4lpu: " + str(sourceimageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; sourceimageinfo2lpu-failed-by-copy2image4lpu: " + str(sourceimageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4imagecopy2lpu ['IMAGESOURCE'] = sourceimageinfo2lpu
if 'IMAGEDESTINATION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) DESTINATION IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
destinationimageinfo2lpu = {}
message2print = "{(Step 26A/70) trying" + "; destinationimageinfo2lpu-trying-by-copy2image4lpu: " + str(destinationimageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
destinationimageinfo2lpu = get2imageinfo4lpu()
message2print = "{(Step 26B/70) got" + "; destinationimageinfo2lpu-got-by-copy2image4lpu: " + str(destinationimageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; destinationimageinfo2lpu-failed-by-copy2image4lpu: " + str(destinationimageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4imagecopy2lpu ['IMAGEDESTINATION'] = destinationimageinfo2lpu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) QUEUE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
queue2lpu = None
message2print = "{(Step 27A/70) trying" + "; queue2lpu-trying-by-copy2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2lpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 27B/70) got" + "; queue2lpu-got-by-copy2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; queue2lpu-failed-by-copy2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4imagecopy2lpu ['QUEUE'] = queue2lpu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) PIPE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
pipe2lpu = None
message2print = "{(Step 28A/70) trying" + "; pipe2lpu-trying-by-copy2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2lpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 28B/70) got" + "; pipe2lpu-got-by-copy2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; pipe2lpu-failed-by-copy2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4imagecopy2lpu ['PIPE'] = pipe2lpu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2lpu = {}
message2print = "{(Step 29A/70) trying" + "; commandqueueinfo2lpu-trying-by-copy2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2lpu = get2commandqueueinfo4lpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; commandqueueinfo2lpu-got-by-copy2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; commandqueueinfo2lpu-failed-by-copy2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4imagecopy2lpu ['COMMANDQUEUE'] = commandqueueinfo2lpu
if 'BUFFER' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (30) BUFFER - AUTOMATIC BY LPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2lpu = {}
message2print = "{(Step 30A/70) trying" + "; bufferinfo2lpu-trying-by-copy2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2lpu = get2bufferinfo4lpu() # SYSTEM CREATES BUFFER FOR LPU, IF NECESSARY
message2print = "{(Step 30B/70) got" + "; bufferinfo2lpu-got-by-copy2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '30B-'
except:
message2print = "{(Step 30Z/70) failed" + "; bufferinfo2lpu-failed-by-copy2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '30Z-'
task4imagecopy2lpu ['BUFFER'] = bufferinfo2lpu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2lpu = {}
message2print = "{(Step 31A/70) trying" + "; eventinfo2lpu-trying-by-copy2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2lpu = get2eventinfo4lpu()
message2print = "{(Step 31B/70) got" + "; eventinfo2lpu-got-by-copy2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventinfo2lpu-failed-by-copy2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4imagecopy2lpu ['EVENT'] = eventinfo2lpu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2lpu = {}
message2print = "{(Step 32A/70) trying" + "; eventwaitlist2lpu-trying-by-copy2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2lpu = {}
message2print = "{(Step 32B/70) set" + "; eventwaitlist2lpu-set-by-copy2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlist2lpu-failed-by-copy2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4imagecopy2lpu ['EVENTWAITLIST'] = eventwaitlist2lpu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2lpu = 0
message2print = "{(Step 33A/70) trying" + "; eventwaitlistquantity2lpu-trying-by-copy2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2lpu.keys()
for key2event in keys2event:
eventwaitlistquantity2lpu = eventwaitlistquantity2lpu + 1
message2print = "{(Step 33B/70) set" + "; eventwaitlistquantity2lpu-set-by-copy2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; eventwaitlistquantity2lpu-failed-by-copy2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4imagecopy2lpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2lpu
if 'SOURCEORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) SOURCEORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
source4origin2lpu = {}
message2print = "{(Step 34A/70) trying" + "; source4origin2lpu-trying-by-copy2image4lpu: " + str(source4origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
source4origin2lpu['X'] = 0
source4origin2lpu['Y'] = 0
source4origin2lpu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; source4origin2lpu-set-by-copy2image4lpu to: " + str(source4origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; source4origin2lpu-failed-by-copy2image4lpu: " + str(source4origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4imagecopy2lpu ['SOURCEORIGIN'] = source4origin2lpu
if 'DESTINATIONORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (35) DESTINATIONORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
destination4origin2lpu = {}
message2print = "{(Step 35A/70) trying" + "; destination4origin2lpu-trying-by-copy2image4lpu: " + str(destination4origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
destination4origin2lpu['X'] = 100
destination4origin2lpu['Y'] = 100
destination4origin2lpu['Z'] = 100
message2print = "{(Step 35B/70) set" + "; destination4origin2lpu-set-by-copy2image4lpu to: " + str(destination4origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '35B-'
except:
message2print = "{(Step 35Z/70) failed" + "; destination4origin2lpu-failed-by-copy2image4lpu: " + str(destination4origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '35Z-'
task4imagecopy2lpu ['DESTINATIONSOURCEORIGIN'] = destination4origin2lpu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (36) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2lpu = {}
message2print = "{(Step 36A/70) trying" + "; region2lpu-trying-by-copy2image4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2lpu['X'] = 160 # WIDTH IN PIXELS TO WRITE
region2lpu['Y'] = 90 # HEIGHT IN PIXELS TO WRITE
region2lpu['Z'] = 0 # DEPTH IN PIXELS TO WRITE
message2print = "{(Step 36B/70) set" + "; region2lpu-set-by-copy2image4lpu to: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; region2lpu-failed-by-copy2image4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '36Z-'
task4imagecopy2lpu ['REGION'] = region2lpu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER CHECKING AND PROVIDING FOR MISSING ONES
# ---------------------------------------------------------------------------------------------
keys2task = task4imagecopy2lpu.keys()
message2print = "{(Step 39/70) set" + "; keys2task-set-by-copy2image4lpu to: " + str(sorted(keys2task)) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ['BUFFER',
# 'COMMANDQUEUE',
# 'CONTEXT',
# 'DATA2CALLBACK',
# 'DESTINATIONORIGIN',
# 'DEVICE',
# 'EVENT',
# 'EVENTWAITLIST',
# 'EVENTWAITLISTQUANTITY',
# 'FUNCTION2CALLBACK',
# 'IMAGEDESTINATION',
# 'IMAGESOURCE',
# 'PIPE',
# 'PLATFORM',
# 'QUEUE',
# 'REGION',
# 'SOURCEORIGIN']; time: 01:28:44 10/05/11 Pacific Daylight Time}
except:
message2print = "{(Step 39Z/70) yielded" + "; task4imagecopy2lpu-yielded-by-copy2image4lpu: " + str(task4imagecopy2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '39Z-'
# ---------------------------------------------------------------------------------------------
# CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
control2copyimage4lpu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2lpu = False
channels2lpu = ()
message2print = "{(Step 40A/70) trying" + "channels2lpu-trying-by-copy2image4lpu: " + str(channels2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
#
consumerchannel2lpu, publisherchannel2lpu = task4imagecopy2lpu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2lpu-got-by-copy2image4lpu: " + str(consumerchannel2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2lpu-got-by-copy2image4lpu: " + str(publisherchannel2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2lpu = True
control2copyimage4lpu['CONSUMERCHANNEL'] = consumerchannel2lpu
control2copyimage4lpu['PUBLISHERCHANNEL'] = publisherchannel2lpu
code2ack = code2ack + '40D-'
except:
ack4channels2lpu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2lpu = False
queue2lpu = None
message2print = "{(Step 41A/70) trying" + "queue2lpu-trying-by-copy2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2lpu = task4imagecopy2lpu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2lpu-got-by-copy2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2lpu = True
control2copyimage4lpu['QUEUE'] = queue2lpu
code2ack = code2ack + '41C-'
except:
ack4queue2lpu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4lpu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4lpu-trying-by-copy2image4lpu: " + str(dummy2image4lpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4lpu = DummyProcess4Xi(target=manoeuvre2copyimage4lpu, # in this module to handle queue and pipe channels
# args =(queue2lpu, # caller puts and gets - does NOT call any functions
# consumerchannel2lpu, publisherchannel2lpu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4lpu-created-by-copy2image4lpu: " + str(dummy2image4lpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# code2ack = code2ack + '69B-'
# except:
# code2nack = code2nack + '69Z-'
# ---------------------------------------------------------------------------------------------
# RETURN CONTROL AND COMMAND DICTIONARY
# ---------------------------------------------------------------------------------------------
message2print = "{(Step 70A/70) set" + "; code2ack-set-by-copy2image4lpu: " + str(code2ack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1B1-1B2-1C-2B-3B-4B-5B-6B-7B-8B-9B-10B-11B-12B-13B-14B-15B-16B-40D-41C-
message2print = "{(Step 70B/70) set" + "; code2nack-set-by-copy2image4lpu: " + str(code2nack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70C/70) returning" + "; control2copyimage4lpu-returning-by-copy2image4lpu: " + str(control2copyimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return control2copyimage4lpu
#
# -------------------------------------------------------------------------------------------------
#copy2copyimagetobuffer4lpu"
# channel2copyimagetobufferpublish4lpu = response4copy2imagetobuffer['PUBLISHERCHANNEL']
# channel2copyimagetobufferpublish4lpu.send(message2copyimagetobuffersend4lpu)
# print("(Step 61B/700) OF LPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4LPU: ", channel2copyimagetobufferpublish4lpu, " MESSAGE2SEND4LPU: " , message2copyimagetobuffersend4lpu)
# except:
# print('(Step 61Z1/700) OF LPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4LPU ', time4xi())
# # ------------------------------------------------------------------------------------------
# # (62) LET MANOEUVRE2COPYIMAGETOBUFFER4LPU TO RECEIVE COPY AND AND SEND ROGER VIA PIPE
# # ------------------------------------------------------------------------------------------
# print("(Step 62A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4lpu = manoeuvre2copyimagetobuffer4lpu(queue2copyimagetobuffer4lpu, channel2copyimagetobufferconsume4lpu, channel2copyimagetobufferpublish4lpu)
# print("(Step 62B/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", manoeuvre2copyimagetobuffer4lpu)
# except:
# print("(Step 62Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", time4xi())
# else:
# pass # trust activated thread
# # ---------------------------------------------------------------------------------------------
# # (63) RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------
# print('(Step 63A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4LPU ', time4xi())
# try:
# channel2copyimagetobufferconsume4lpu = response4copy2imagetobuffer['CONSUMERCHANNEL']
# message2copyimagereceive4lpu = channel2copyimagetobufferconsume4lpu.recv()
# print("(Step 63B/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel2copyimagetobufferconsume4lpu, " CONTROL & COMMAND: ", message2copyimagereceive4lpu)
# #
# except:
# print('(Step 63Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4LPU ', time4xi())
# # ---------------------------------------------------------------------------------------------------
# # (64) SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2COPYIMAGETOBUFFER4LPU TO RECEIVE
# # ---------------------------------------------------------------------------------------------------
# print('(Step 64A/700) OF LPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4LPU ', time4xi())
# try:
# message2copyimagetobuffersend4lpu = "copy2copyimagetobuffer4lpu"
# channel2copyimagetobufferpublish4lpu = response4copy2imagetobuffer['PUBLISHERCHANNEL']
# channel2copyimagetobufferpublish4lpu.send(message2copyimagetobuffersend4lpu)
# print("(Step 64B/700) OF LPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4LPU: ", channel2copyimagetobufferpublish4lpu, " MESSAGE2SEND4LPU: " , message2copyimagetobuffersend4lpu)
# #
# except:
# print('(Step 64Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4LPU ', time4xi())
# # -----------------------------------------------------------------------------------
# # (65) LET MANOEUVRE2COPYIMAGETOBUFFER4LPU TO RECEIVE READY AND TO SEND READY
# # -----------------------------------------------------------------------------------
# print("(Step 65A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4lpu = manoeuvre2copyimagetobuffer4lpu(queue2copyimagetobuffer4lpu, channel2copyimagetobufferconsume4lpu, channel2copyimagetobufferpublish4lpu)
# print("(Step 65B/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", manoeuvre2copyimagetobuffer4lpu)
# except:
# print("(Step 65Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", time4xi())
# # ---------------------------------------------------------------------------------------
# # (66) RECEIVE CONTROL & COMMAND READY VIA PIPE
# # ---------------------------------------------------------------------------------------
# print('(Step 66A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4LPU ', time4xi())
# try:
# channel2copyimagetobufferconsume4lpu = response4copy2imagetobuffer['CONSUMERCHANNEL']
# message2copyimagereceive4lpu = channel2copyimagetobufferconsume4lpu.recv()
# print("(Step 66B/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel2copyimagetobufferconsume4lpu, " CONTROL & COMMAND: ", message2copyimagereceive4lpu)
# #
# except:
# print('(Step 66Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4LPU ', time4xi())
# # -----------------------------------------------------------------------------------------
# # (67) PUT IMAGE PATH TO QUEUE
# # -----------------------------------------------------------------------------------------
# print("(Step 67A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PUT IMAGE PATH TO QUEUE ", time4xi())
# try:
# queue2copyimagetobuffer4dragon.put(path2dragon)
# print("(Step 67B/700) OF DRAGON2IMAGE4XI5TEST - PUT TO QUEUE IMAGE PATH: ", path2dragon)
# # ..//..//..//..//..//web//images//png//dragonxi.png
# except:
# print("(Step 67Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
# # ------------------------------------------------------------------------------------------------------
# # (68) LET MANOEUVRE2COPYIMAGETOBUFFER4LPU TO GET FROM QUEUE AND TO SEND EITHER ACK OR NACK VIA PIPE
# # -------------------------------------------------------------------------------------------------------
# print("(Step 68A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4lpu = manoeuvre2copyimagetobuffer4lpu(queue2copyimagetobuffer4lpu, channel2copyimagetobufferconsume4lpu, channel2copyimagetobufferpublish4lpu)
# print("(Step 68B/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", manoeuvre2copyimagetobuffer4lpu)
# except:
# print("(Step 68Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (69) RECEIVE ACK OR NACK ABOUT IMAGE OPERATION VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 69A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2copyimagereceive4lpu = channel2copyimagetobufferconsume4lpu.recv()
# print("(Step 69D/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel2copyimagetobufferconsume4lpu, " CONTROL & COMMAND: ", message2copyimagereceive4lpu)
# except:
# print('(Step 69Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# # -------------------------------------------------------------------------------------------------------
# # (70) LET MANOEUVRE2COPYIMAGETOBUFFER4LPU GO TO STATE 0
# # -------------------------------------------------------------------------------------------------------
# print("(Step 70A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4lpu = manoeuvre2copyimagetobuffer4lpu(queue2copyimagetobuffer4lpu, channel2copyimagetobufferconsume4lpu, channel2copyimagetobufferpublish4lpu)
# print("(Step 70B/700) OF LPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4LPU ", response2manoeuvreimagecopytobuffer4lpu)
# except:
# print("(Step 70Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", time4xi())
#">
# -------------------------------------------------------------------------------------------------
def copy2imagetobuffer4lpu(task4copyimagetobuffer2lpu=None):
'''
copies 2D images to buffer for LPU
'''
global lpu2image4xi # 2D-IMAGES FOR LPU
global lpu2buffer4xi # BUFFER FOR LPU
global control2copyimagetobuffer4lpu # COMMAND AND CONTROL FOR LPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "copy2imagetobuffer4lpu"
method2print = "copy2imagetobuffer4lpu"
message2print = "{(Step 1A/33) started" + "; copy2imagetobuffer4lpu-started: " + str(copy2imagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1B/33) passed" + "; task4copyimagetobuffer2lpu-to-copy2imagetobuffer4lpu: " + str(task4copyimagetobuffer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE LPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if lpu2image4xi is None:
lpu2image4xi = create2image4lpu() # INITIALIZE IMAGE FOR LPU
message2print = "{(Step 1C/70) created" + "; lpu2image4xi-created-by-copy2imagetobuffer4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4lpu-skipped-by-copy2imagetobuffer4lpu: " + str(copy2imagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# create2image4lpu-skipped-by-copy2imagetobuffer4lpu
except:
try:
lpu2image4xi = create2image4lpu()
message2print = "{(Step 1E/70) set" + "; lpu2image4xi-set-by-copy2imagetobuffer4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
lpu2image4xi = {}
message2print = "{(Step 1Z1/70) yielded" + "; lpu2image4xi-yielded-by-copy2imagetobuffer4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z1-'
# -----------------------------------------------------------------------------------------
# CREATE LPU2BUFFER4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if lpu2buffer4xi is None:
lpu2buffer4xi = create2buffer4lpu() # INITIALIZE BUFFER FOR LPU
message2print = "{(Step 1F/70) created" + "; lpu2buffer4xi-created-by-copy2imagetobuffer4lpu to: " + str(lpu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1G/70) skipped" + "; create2buffer4lpu-skipped-by-copy2imagetobuffer4lpu: " + str(copy2imagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
try:
lpu2buffer4xi = create2buffer4lpu()
message2print = "{(Step 1H/70) set" + "; lpu2buffer4xi-set-by-copy2imagetobuffer4lpu to: " + str(lpu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4lpu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4lpu',
# 'METHOD': 'create2buffer4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': ...
except:
lpu2buffer4xi = {}
message2print = "{(Step 1Z2/70) yielded" + "; lpu2buffer4xi-yielded-by-copy2imagetobuffer4lpu: " + str(lpu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z2-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - ANALYZE TASK
# -----------------------------------------------------------------------------------------
if task4copyimagetobuffer2lpu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR COPY - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4copyimagetobuffer2lpu = {}
message2print = "{(Step 1A/70) initialized" + "; task4copyimagetobuffer2lpu-created-by-copy2imagetobuffer4lpu to: " + str(task4copyimagetobuffer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4lpu = trace2image4lpu # CALLBACK FUNCTION FOR LPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4lpu-created-by-copy2imagetobuffer4lpu to: " + str(function2callback4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2imagetobuffer4lpu" # MODULE OF LPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2imagetobuffer4lpu" # FUNCTION OF LPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2imagetobuffer4lpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR LPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-copy2imagetobuffer4lpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; copy2imagetobuffer4lpu-failed; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2imagetobuffer4lpu',
# 'METHOD': 'copy2imagetobuffer4lpu'}; time: 03:40:47 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4copyimagetobuffer2lpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO LPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4copyimagetobuffer2lpu['FUNCTION2CALLBACK'] = function2callback4lpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4copyimagetobuffer2lpu-created-by-copy2imagetobuffer4lpu to: " + str(task4copyimagetobuffer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; copy2imagetobuffer4lpu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2imagetobuffer4lpu',
# 'METHOD': 'copy2imagetobuffer4lpu'}}; time: 03:40:47 10/04/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-copy2imagetobuffer4lpu to: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
try:
platform2xi = get2platformids4xi() # PLATFORM IS COMMON TO ALL DEVICES I.E TO DEVICE XI
message2print = "{(Step 2B/70) got" + "; platform2xi-got-by-copy2imagetobuffer4lpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'list2platforms': ['DragonXi'], 'ack2return': ' 2C-2E-2F-2G-', 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1}; time: 03:40:47 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '2B-'
except:
message2print = "{(Step 2Z/70) failed" + "; platform2xi-failed-by-copy2imagetobuffer4lpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4copyimagetobuffer2lpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2lpu = {}
message2print = "{(Step 3A/70) trying" + "; context2lpu-trying-by-copy2imagetobuffer4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2lpu = get2context4lpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2lpu-got-by-copy2imagetobuffer4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4lpu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4lpu',
# 'METHOD': 'create2context4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 2A-2C-2D-2E-2B-3B-4B-5B-6B-7B-7B-',
# 'INFO2PRIVATE': None,
# 'PLATFORM': {'list2platforms': ['DragonXi'],'ack2return': ' 2C-2E-2F-2G-', 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1},
# 'NACK2RETURN': ' ',
# 'SIZE2PRIVATE': 0,
# 'PROPERTIES': None}; time: 03:40:47 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2lpu-failed-by-copy2imagetobuffer4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4copyimagetobuffer2lpu ['CONTEXT'] = context2lpu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2lpu = {}
message2print = "{(Step 4A/70) trying" + "; device2lpu-trying-by-copy2imagetobuffer4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2lpu = get2lpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2lpu-got-by-copy2imagetobuffer4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'RESOLUTION2TIMER4PROFILING': 318,
# 'ID2PLATFORM': '0000000001509568',
# 'PROFILING2QUEUE': 'ACK',
# 'EXECUTE2KERNELS4OPENCL': 'ACK',
# 'NATIVE2WIDTHLONG4VECTOR': 2,
# 'MAX2UNITS4COMPUTE': 4,
# 'SIZE2MEMORY4GLOBAL': 3221225472,
# 'NATIVE2WIDTHFLOAT4VECTOR': 4,
# 'MAX2SIZE4WORKGROUP': 1024,
# 'PREFERRED2WIDTHCHAR4VECTOR': 16,
# 'SIZE2CACHE': 65536,
# 'IEEE754-2008FUSED2MULTIPLY-ADD': 'NACK',
# 'TYPE4CACHE': 'Read/Write',
# 'PREFERRED2WIDTHINT4VECTOR': 4,
# 'SIZE2PREFERREDWORKGROUPMULTIPLE4KERNEL': 1,
# 'NATIVE2WIDTHINT4VECTOR': 4,
# 'SIZE2BUFFER4CONSTANT': 65536,
# 'EXECUTE2FUNCTION4NATIVE': 'ACK',
# 'PREFERRED2WIDTHDOUBLE4VECTOR': 0,
# 'MAX2NUMBER4CONSTANTARGS': 8,
# 'VERSION2DRIVER': '2.0',
# 'EXTENSIONS': 'cl_amd_fp64 ...
# 'AVAILABLE2COMPILER': 'ACK',
# 'MAX2DIMENSIONS4WORKITEMS': 3,
# 'SUPPORT2CORRECTION4ERROR': 0,
# 'BITS2ADDRESS': 64,
# 'AVAILABLE': 'ACK',
# 'SIZE2MEMORY4LOCAL': 32768,
# 'VENDOR': 'AuthenticAMD',
# 'SUPPORT2IMAGE': 'NACK',
# 'MAX2SIZE4KERNELARGUMENT': 4096,
# 'ACK2RETURN': ' 1C-1D-1E-1F-1D-2A-...
# 'OUT-OF-ORDER2QUEUE': 'NACK',
# 'ALIGNMENT2ADDRESS4BASE': 1024,
# 'PROFILE': 'FULL_PROFILE',
# 'TYPE2MEMORY4LOCAL': 'Global',
# 'PREFERRED2WIDTHFLOAT4VECTOR': 4,
# 'PREFERRED2WIDTHLONG4VECTOR': 2,
# 'MAX2FREQUENCY4CLOCK': 3210,
# 'PREFERRED2WIDTHSHORT4VECTOR': 8,
# 'ID': 4033,
# 'MAX2WORKITEM2': 1024,
# 'NATIVE2WIDTHDOUBLE4VECTOR': 0,
# 'ROUND2ZERO': 'ACK',
# 'NAME': 'AMD64 Family 16 Model 4 Stepping 2,
# AuthenticAMD',
# 'MAX2WORKITEM1': 1024,
# 'MAX2WORKITEM0': 1024,
# 'SIZE2LINE4CACHE': 64,
# 'MAX2ALLOCATION4MEMORY': 1073741824,
# 'NATIVE2WIDTHCHAR4VECTOR': 16,
# 'QUIET2NANS': 'ACK',
# 'NATIVE2WIDTHSHORT4VECTOR': 8,
# 'ROUND2NEAREST4EVEN': 'ACK',
# 'VERSION': 'OpenCL 1.1 ATI-Stream-v2.3 (451)',
# 'NACK2RETURN': ' ',
# 'MEMORY2UNIFIED4HOSTANDDEVICE': 1,
# 'ENDIANESS2DEVICE': 'Little',
# 'MINIMUM2ALIGNMENT4DATATYPE': 128,
# 'ROUND2+VE3INFINITY': 'ACK',
# 'TYPE': 'CL_DEVICE_TYPE_LPU',
# 'DENORMS2SINGLEPRECISION4FLOATINGPOINTCAPABILITY': 'ACK'}; time: 03:40:47 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2lpu-failed-by-copy2imagetobuffer4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4copyimagetobuffer2lpu ['DEVICE'] = device2lpu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE SOURCE OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
imagesourceinfo2lpu = {}
message2print = "{(Step 5A/70) trying" + "; imagesourceinfo2lpu-trying-by-copy2imagetobuffer4lpu: " + str(imagesourceinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imagesourceinfo2lpu = get2imageinfo4lpu()
message2print = "{(Step 5B/70) got" + "; imagesourceinfo2lpu-got-by-copy2imagetobuffer4lpu: " + str(imagesourceinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'SIZE2QUEUE': 2147483646,
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8',
# 'ORDER': 'CL_RGBA'},
# 'QUEUE': ,
# 'WIDTH': 800,
# 'CONTEXT': ...
code2ack = code2ack + '5B-'
except:
message2print = "{(Step 5Z/70) failed" + "; imagesourceinfo2lpu-failed-by-copy2imagetobuffer4lpu: " + str(imagesourceinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4copyimagetobuffer2lpu ['IMAGESOURCE'] = imagesourceinfo2lpu
# ---------------------------------------------------------------------------------------------
# (6) BUFFER DESTINATION OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
bufferdestinationinfo2lpu = {}
message2print = "{(Step 6A/70) trying" + "; bufferdestinationinfo2lpu-trying-by-copy2imagetobuffer4lpu: " + str(bufferdestinationinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferdestinationinfo2lpu = get2bufferinfo4lpu()
message2print = "{(Step 6B/70) got" + "; bufferdestinationinfo2lpu-got-by-copy2imagetobuffer4lpu: " + str(bufferdestinationinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4lpu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4lpu',
# 'METHOD': 'create2buffer4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0, ...
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; bufferdestinationinfo2lpu-failed-by-copy2imagetobuffer4lpu: " + str(bufferdestinationinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4copyimagetobuffer2lpu ['BUFFERDESTINATION'] = bufferdestinationinfo2lpu
# ---------------------------------------------------------------------------------------------
# (7) QUEUE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
queue2copyimagetobuffer4lpu = None
message2print = "{(Step 7A/70) trying" + "; queue2copyimagetobuffer4lpu-trying-by-copy2imagetobuffer4lpu: " + str(queue2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copyimagetobuffer4lpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 7B/70) got" + "; queue2copyimagetobuffer4lpu-got-by-copy2imagetobuffer4lpu: " + str(queue2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; queue2copyimagetobuffer4lpu-failed-by-copy2imagetobuffer4lpu: " + str(queue2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4copyimagetobuffer2lpu ['QUEUE'] = queue2copyimagetobuffer4lpu
# ---------------------------------------------------------------------------------------------
# (8) PIPE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
pipe2lpu = None
message2print = "{(Step 8A/70) trying" + "; pipe2lpu-trying-by-copy2imagetobuffer4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2lpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 8B/70) got" + "; pipe2lpu-got-by-copy2imagetobuffer4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; pipe2lpu-failed-by-copy2imagetobuffer4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4copyimagetobuffer2lpu ['PIPE'] = pipe2lpu
# ---------------------------------------------------------------------------------------------
# (9) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2lpu = {}
message2print = "{(Step 9A/70) trying" + "; commandqueueinfo2lpu-trying-by-copy2imagetobuffer4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2lpu = get2commandqueueinfo4lpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; commandqueueinfo2lpu-got-by-copy2imagetobuffer4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2commandqueue4lpu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4lpu',
# 'METHOD': 'create2commandqueue4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ...
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; commandqueueinfo2lpu-failed-by-copy2imagetobuffer4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4copyimagetobuffer2lpu ['COMMANDQUEUE'] = commandqueueinfo2lpu
# ---------------------------------------------------------------------------------------------
# (11) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2lpu = {}
message2print = "{(Step 11A/70) trying" + "; eventinfo2lpu-trying-by-copy2imagetobuffer4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2lpu = get2eventinfo4lpu()
message2print = "{(Step 11B/70) got" + "; eventinfo2lpu-got-by-copy2imagetobuffer4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2event4lpu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2event4lpu',
# 'METHOD': 'create2event4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 1D-1E-...
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; eventinfo2lpu-failed-by-copy2imagetobuffer4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4copyimagetobuffer2lpu ['EVENT'] = eventinfo2lpu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2lpu = {}
message2print = "{(Step 12A/70) trying" + "; eventwaitlist2lpu-trying-by-copy2imagetobuffer4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2lpu = {}
message2print = "{(Step 12B/70) set" + "; eventwaitlist2lpu-set-by-copy2imagetobuffer4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlist2lpu-failed-by-copy2imagetobuffer4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4copyimagetobuffer2lpu ['EVENTWAITLIST'] = eventwaitlist2lpu
# ---------------------------------------------------------------------------------------------
# (13) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2lpu = 0
message2print = "{(Step 13A/70) trying" + "; eventwaitlistquantity2lpu-trying-by-copy2imagetobuffer4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2lpu.keys()
for key2event in keys2event:
eventwaitlistquantity2lpu = eventwaitlistquantity2lpu + 1
message2print = "{(Step 13B/70) set" + "; eventwaitlistquantity2lpu-set-by-copy2imagetobuffer4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; eventwaitlistquantity2lpu-failed-by-copy2imagetobuffer4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4copyimagetobuffer2lpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2lpu
# ---------------------------------------------------------------------------------------------
# (14) ORIGIN FOR SOURCE - REQUIRED
# ---------------------------------------------------------------------------------------------
origin4source2lpu = {}
message2print = "{(Step 14A/70) trying" + "; origin4source2lpu-trying-by-copy2imagetobuffer4lpu: " + str(origin4source2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin4source2lpu['X'] = 0
origin4source2lpu['Y'] = 0
origin4source2lpu['Z'] = 0
message2print = "{(Step 14B/70) set" + "; origin4source2lpu-set-by-copy2imagetobuffer4lpu to: " + str(origin4source2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 0, 'X': 0, 'Z': 0}
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; origin4source2lpu-failed-by-copy2imagetobuffer4lpu: " + str(origin4source2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4copyimagetobuffer2lpu ['SOURCEORIGIN'] = origin4source2lpu
# --------------------------------------------------------------------------------------------------------
# (16) REGION - REGION OF A IMAGE TO BE COPIED
# --------------------------------------------------------------------------------------------------------
region4copy2lpu = {}
message2print = "{(Step 16A/70) trying" + "; region4copy2lpu-trying-by-copy2imagetobuffer4lpu: " + str(region4copy2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region4copy2lpu['X'] = 10
region4copy2lpu['Y'] = 10
region4copy2lpu['Z'] = 10
message2print = "{(Step 16B/70) set" + "; region4copy2lpu-set-by-copy2imagetobuffer4lpu to: " + str(region4copy2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 10, 'X': 10, 'Z': 10}
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; region4copy2lpu-failed-by-copy2imagetobuffer4lpu: " + str(region4copy2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '16Z-'
task4copyimagetobuffer2lpu ['REGION'] = region4copy2lpu
# --------------------------------------------------------------------------------------------------------
# (17) OFFSET - WHERE TO BEGIN COPYING DATA INTO DESTINATION BUFFER
# --------------------------------------------------------------------------------------------------------
offset4copy2lpu = 0
message2print = "{(Step 17A/70) set" + "; offset4copy2lpu-set-by-copy2imagetobuffer4lpu to: " + str(offset4copy2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '17A-'
task4copyimagetobuffer2lpu ['OFFSET'] = offset4copy2lpu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
else:
pass
# ---------------------------------------------------------------------------------------------
# ANALYZE TASK - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4copyimagetobuffer2lpu.keys()
message2print = "{(Step 20/70) got" + "; keys2task-got-by-copy2imagetobuffer4lpu: " + str(sorted(keys2task)) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ['BUFFERDESTINATION',
# 'COMMANDQUEUE',
# 'CONTEXT',
# 'DATA2CALLBACK',
# 'DEVICE',
# 'EVENT',
# 'EVENTWAITLIST',
# 'EVENTWAITLISTQUANTITY',
# 'FUNCTION2CALLBACK',
# 'IMAGESOURCE',
# 'OFFSET',
# 'PIPE',
# 'PLATFORM',
# 'QUEUE',
# 'REGION',
# 'SOURCEORIGIN']; time: 01:28:44 10/05/11 Pacific Daylight Time}
if (('DATA2CALLBACK' in keys2task) and ('FUNCTION2CALLBACK' in keys2task)):
pass
else:
# ---------------------------------------------------------------------------------------------
# (21B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4lpu = trace2image4lpu # CALLBACK FUNCTION FOR LPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4lpu-created-by-copy2imagetobuffer4lpu to: " + str(function2callback4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2imagetobuffer4lpu" # MODULE OF LPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2imagetobuffer4lpu" # FUNCTION OF LPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2imagetobuffer4lpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR LPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-copy2imagetobuffer4lpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4copyimagetobuffer2lpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO LPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4copyimagetobuffer2lpu['FUNCTION2CALLBACK'] = function2callback4lpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4copyimagetobuffer2lpu-created-by-copy2imagetobuffer4lpu to: " + str(task4copyimagetobuffer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-copy2imagetobuffer4lpu to: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
platform2xi = get2platformids4xi() # PLATFORM IS COMMON TO ALL DEVICES I.E TO DEVICE XI
message2print = "{(Step 22B/70) got" + "; platform2xi-got-by-copy2imagetobuffer4lpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-copy2imagetobuffer4lpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4copyimagetobuffer2lpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2lpu = {}
message2print = "{(Step 23A/70) trying" + "; context2lpu-trying-by-copy2imagetobuffer4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2lpu = get2context4lpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2lpu-got-by-copy2imagetobuffer4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2lpu-failed-by-copy2imagetobuffer4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4copyimagetobuffer2lpu ['CONTEXT'] = context2lpu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2lpu = {}
message2print = "{(Step 24A/70) trying" + "; device2lpu-trying-by-copy2imagetobuffer4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2lpu = get2lpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2lpu-got-by-copy2imagetobuffer4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2lpu-failed-by-copy2imagetobuffer4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4copyimagetobuffer2lpu ['DEVICE'] = device2lpu
if 'IMAGESOURCE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) SOURCE IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
sourceimageinfo2lpu = {}
message2print = "{(Step 25A/70) trying" + "; sourceimageinfo2lpu-trying-by-copy2imagetobuffer4lpu: " + str(sourceimageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
sourceimageinfo2lpu = get2imageinfo4lpu()
message2print = "{(Step 25B/70) got" + "; sourceimageinfo2lpu-got-by-copy2imagetobuffer4lpu: " + str(sourceimageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; sourceimageinfo2lpu-failed-by-copy2imagetobuffer4lpu: " + str(sourceimageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4copyimagetobuffer2lpu ['IMAGESOURCE'] = sourceimageinfo2lpu
if 'BUFFERDESTINATION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) DESTINATION BUFFER - REQUIRED
# ---------------------------------------------------------------------------------------------
destinationbufferinfo2lpu = {}
message2print = "{(Step 26A/70) trying" + "; destinationbufferinfo2lpu-trying-by-copy2imagetobuffer4lpu: " + str(destinationbufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
destinationbufferinfo2lpu = get2bufferinfo4lpu()
message2print = "{(Step 26B/70) got" + "; destinationbufferinfo2lpu-got-by-copy2imagetobuffer4lpu: " + str(destinationbufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; destinationbufferinfo2lpu-failed-by-copy2imagetobuffer4lpu: " + str(destinationbufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4copyimagetobuffer2lpu ['BUFFERDESTINATION'] = destinationbufferinfo2lpu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) QUEUE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
queue2copyimagetobuffer4lpu = None
message2print = "{(Step 27A/70) trying" + "; queue2copyimagetobuffer4lpu-trying-by-copy2imagetobuffer4lpu: " + str(queue2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copyimagetobuffer4lpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 27B/70) got" + "; queue2copyimagetobuffer4lpu-got-by-copy2imagetobuffer4lpu: " + str(queue2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; queue2copyimagetobuffer4lpu-failed-by-copy2imagetobuffer4lpu: " + str(queue2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4copyimagetobuffer2lpu ['QUEUE'] = queue2copyimagetobuffer4lpu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) PIPE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
pipe2lpu = None
message2print = "{(Step 28A/70) trying" + "; pipe2lpu-trying-by-copy2imagetobuffer4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2lpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 28B/70) got" + "; pipe2lpu-got-by-copy2imagetobuffer4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; pipe2lpu-failed-by-copy2imagetobuffer4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4copyimagetobuffer2lpu ['PIPE'] = pipe2lpu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2lpu = {}
message2print = "{(Step 29A/70) trying" + "; commandqueueinfo2lpu-trying-by-copy2imagetobuffer4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2lpu = get2commandqueueinfo4lpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; commandqueueinfo2lpu-got-by-copy2imagetobuffer4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; commandqueueinfo2lpu-failed-by-copy2imagetobuffer4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4copyimagetobuffer2lpu ['COMMANDQUEUE'] = commandqueueinfo2lpu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2lpu = {}
message2print = "{(Step 31A/70) trying" + "; eventinfo2lpu-trying-by-copy2imagetobuffer4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2lpu = get2eventinfo4lpu()
message2print = "{(Step 31B/70) got" + "; eventinfo2lpu-got-by-copy2imagetobuffer4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventinfo2lpu-failed-by-copy2imagetobuffer4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4copyimagetobuffer2lpu ['EVENT'] = eventinfo2lpu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2lpu = {}
message2print = "{(Step 32A/70) trying" + "; eventwaitlist2lpu-trying-by-copy2imagetobuffer4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2lpu = {}
message2print = "{(Step 32B/70) set" + "; eventwaitlist2lpu-set-by-copy2imagetobuffer4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlist2lpu-failed-by-copy2imagetobuffer4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4copyimagetobuffer2lpu ['EVENTWAITLIST'] = eventwaitlist2lpu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2lpu = 0
message2print = "{(Step 33A/70) trying" + "; eventwaitlistquantity2lpu-trying-by-copy2imagetobuffer4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2lpu.keys()
for key2event in keys2event:
eventwaitlistquantity2lpu = eventwaitlistquantity2lpu + 1
message2print = "{(Step 33B/70) set" + "; eventwaitlistquantity2lpu-set-by-copy2imagetobuffer4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; eventwaitlistquantity2lpu-failed-by-copy2imagetobuffer4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4copyimagetobuffer2lpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2lpu
if 'SOURCEORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) SOURCEORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
source4origin2lpu = {}
message2print = "{(Step 34A/70) trying" + "; source4origin2lpu-trying-by-copy2imagetobuffer4lpu: " + str(source4origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
source4origin2lpu['X'] = 0
source4origin2lpu['Y'] = 0
source4origin2lpu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; source4origin2lpu-set-by-copy2imagetobuffer4lpu to: " + str(source4origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; source4origin2lpu-failed-by-copy2imagetobuffer4lpu: " + str(source4origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4copyimagetobuffer2lpu ['SOURCEORIGIN'] = source4origin2lpu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (36) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2lpu = {}
message2print = "{(Step 36A/70) trying" + "; region2lpu-trying-by-copy2imagetobuffer4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2lpu['X'] = 160 # WIDTH IN PIXELS TO WRITE
region2lpu['Y'] = 90 # HEIGHT IN PIXELS TO WRITE
region2lpu['Z'] = 0 # DEPTH IN PIXELS TO WRITE
message2print = "{(Step 36B/70) set" + "; region2lpu-set-by-copy2imagetobuffer4lpu to: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; region2lpu-failed-by-copy2imagetobuffer4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '36Z-'
task4copyimagetobuffer2lpu ['REGION'] = region2lpu
if 'OFFSET' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (37) OFFSET - WHERE TO BEGIN COPYING DATA INTO DESTINATION BUFFER - REQUIRED
# ---------------------------------------------------------------------------------------------
offset2lpu = 0
message2print = "{(Step 37A/70) set" + "; offset2lpu-set-by-copy2imagetobuffer4lpu to: " + str(offset2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
task4copyimagetobuffer2lpu ['OFFSET'] = offset2lpu
code2ack = code2ack + '37A-'
# ---------------------------------------------------------------------------------------------
# EOF TASK
# ---------------------------------------------------------------------------------------------
keys2task = task4copyimagetobuffer2lpu.keys()
message2print = "{(Step 39/70) set" + "; keys2task-set-by-copy2imagetobuffer4lpu to: " + str(sorted(keys2task)) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ['BUFFERDESTINATION',
# 'COMMANDQUEUE',
# 'CONTEXT',
# 'DATA2CALLBACK',
# 'DEVICE',
# 'EVENT',
# 'EVENTWAITLIST',
# 'EVENTWAITLISTQUANTITY',
# 'FUNCTION2CALLBACK',
# 'IMAGESOURCE',
# 'OFFSET',
# 'PIPE',
# 'PLATFORM',
# 'QUEUE',
# 'REGION',
# 'SOURCEORIGIN']; time: 01:28:44 10/05/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
control2copyimagetobuffer4lpu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2lpu = False
channels2lpu = ()
message2print = "{(Step 40A/70) trying" + "channels2lpu-trying-by-copy2imagetobuffer4lpu: " + str(channels2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
#
consumerchannel2copyimagetobuffer4lpu, publisherchannel2copyimagetobuffer4lpu = task4copyimagetobuffer2lpu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2copyimagetobuffer4lpu-got-by-copy2imagetobuffer4lpu: " + str(consumerchannel2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2copyimagetobuffer4lpu-got-by-copy2imagetobuffer4lpu: " + str(publisherchannel2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2lpu = True
control2copyimagetobuffer4lpu['CONSUMERCHANNEL'] = consumerchannel2copyimagetobuffer4lpu
control2copyimagetobuffer4lpu['PUBLISHERCHANNEL'] = publisherchannel2copyimagetobuffer4lpu
code2ack = code2ack + '40D-'
except:
ack4channels2lpu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2copyimagetobuffer4lpu = False
queue2copyimagetobuffer4lpu = None
message2print = "{(Step 41A/70) trying" + "queue2copyimagetobuffer4lpu-trying-by-copy2imagetobuffer4lpu: " + str(queue2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copyimagetobuffer4lpu = task4copyimagetobuffer2lpu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2copyimagetobuffer4lpu-got-by-copy2imagetobuffer4lpu: " + str(queue2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2copyimagetobuffer4lpu = True
control2copyimagetobuffer4lpu['QUEUE'] = queue2copyimagetobuffer4lpu
code2ack = code2ack + '41C-'
except:
ack4queue2copyimagetobuffer4lpu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4lpu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4lpu-trying-by-copy2imagetobuffer4lpu: " + str(dummy2image4lpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4lpu = DummyProcess4Xi(target=manoeuvre2copyimagetobuffer4lpu, # in this module to handle queue and pipe channels
# args =(queue2copyimagetobuffer4lpu, # caller puts and gets - does NOT call any functions
# consumerchannel2copyimagetobuffer4lpu, publisherchannel2copyimagetobuffer4lpu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4lpu-created-by-copy2imagetobuffer4lpu: " + str(dummy2image4lpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# code2ack = code2ack + '69B-'
# except:
# code2nack = code2nack + '69Z-'
# ---------------------------------------------------------------------------------------------
# RETURN CONTROL AND COMMAND DICTIONARY
# ---------------------------------------------------------------------------------------------
message2print = "{(Step 70A/70) set" + "; code2ack-set-by-copy2imagetobuffer4lpu: " + str(code2ack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1B1-1B2-1C-2B-3B-4B-5B-6B-7B-8B-9B-11B-12B-13B-14B-16B-17A-40D-41C-
message2print = "{(Step 70B/70) set" + "; code2nack-set-by-copy2imagetobuffer4lpu: " + str(code2nack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70C/70) returning" + "; control2copyimagetobuffer4lpu-returning-by-copy2imagetobuffer4lpu: " + str(control2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return control2copyimagetobuffer4lpu
#
# -------------------------------------------------------------------------------------------------
#copy2copybuffertoimage4lpu"
# channel2copybuffertoimagepublish4lpu = response4copy2buffertoimage['PUBLISHERCHANNEL']
# channel2copybuffertoimagepublish4lpu.send(message2copybuffertoimagesend4lpu)
# print("(Step 81B/700) OF LPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4LPU: ", channel2copybuffertoimagepublish4lpu, " MESSAGE2SEND4LPU: " , message2copybuffertoimagesend4lpu)
# except:
# print('(Step 81Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4LPU ', time4xi())
# # ------------------------------------------------------------------------------------------
# # (82) LET MANOEUVRE2COPYIMAGETOBUFFER4LPU TO RECEIVE COPY AND AND SEND ROGER VIA PIPE
# # ------------------------------------------------------------------------------------------
# print("(Step 82C/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4lpu = manoeuvre2copybuffertoimage4lpu(queue2copybuffertoimage4lpu, channel2copybuffertoimageconsume4lpu, channel2copybuffertoimagepublish4lpu)
# print("(Step 82D/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", manoeuvre2copybuffertoimage4lpu)
# except:
# print("(Step 82Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", time4xi())
# else:
# pass # trust activated thread
# # ---------------------------------------------------------------------------------------------
# # (83) RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------
# print('(Step 83A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4LPU ', time4xi())
# try:
# channel2copybuffertoimageconsume4lpu = response4copy2buffertoimage['CONSUMERCHANNEL']
# message2copyimagereceive4lpu = channel2copybuffertoimageconsume4lpu.recv()
# print("(Step 83B/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel2copybuffertoimageconsume4lpu, " CONTROL & COMMAND: ", message2copyimagereceive4lpu)
# #
# except:
# print('(Step 83Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4LPU ', time4xi())
# # ---------------------------------------------------------------------------------------------------
# # (84) SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2COPYIMAGETOBUFFER4LPU TO RECEIVE
# # ---------------------------------------------------------------------------------------------------
# print('(Step 84A/700) OF LPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4LPU ', time4xi())
# try:
# message2copybuffertoimagesend4lpu = "copy2copybuffertoimage4lpu"
# channel2copybuffertoimagepublish4lpu = response4copy2buffertoimage['PUBLISHERCHANNEL']
# channel2copybuffertoimagepublish4lpu.send(message2copybuffertoimagesend4lpu)
# print("(Step 84B/700) OF LPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4LPU: ", channel2copybuffertoimagepublish4lpu, " MESSAGE2SEND4LPU: " , message2copybuffertoimagesend4lpu)
# #
# except:
# print('(Step 84Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4LPU ', time4xi())
# # -----------------------------------------------------------------------------------
# # (85) LET MANOEUVRE2COPYIMAGETOBUFFER4LPU TO RECEIVE READY AND TO SEND READY
# # -----------------------------------------------------------------------------------
# print("(Step 85A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4lpu = manoeuvre2copybuffertoimage4lpu(queue2copybuffertoimage4lpu, channel2copybuffertoimageconsume4lpu, channel2copybuffertoimagepublish4lpu)
# print("(Step 85B/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", manoeuvre2copybuffertoimage4lpu)
# except:
# print("(Step 85Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", time4xi())
# # ---------------------------------------------------------------------------------------
# # (86) RECEIVE CONTROL & COMMAND READY VIA PIPE
# # ---------------------------------------------------------------------------------------
# print('(Step 86A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4LPU ', time4xi())
# try:
# channel2copybuffertoimageconsume4lpu = response4copy2buffertoimage['CONSUMERCHANNEL']
# message2copyimagereceive4lpu = channel2copybuffertoimageconsume4lpu.recv()
# print("(Step 86B/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel2copybuffertoimageconsume4lpu, " CONTROL & COMMAND: ", message2copyimagereceive4lpu)
# #
# except:
# print('(Step 86Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4LPU ', time4xi())
# # -----------------------------------------------------------------------------------------
# # (87) PUT IMAGE PATH TO QUEUE
# # -----------------------------------------------------------------------------------------
# print("(Step 87A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PUT IMAGE PATH TO QUEUE ", time4xi())
# try:
# queue2copybuffertoimage4dragon.put(path2dragon)
# print("(Step 87B/700) OF DRAGON2IMAGE4XI5TEST - PUT TO QUEUE IMAGE PATH: ", path2dragon)
# # ..//..//..//..//..//web//images//png//dragonxi.png
# except:
# print("(Step 87Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
# # ------------------------------------------------------------------------------------------------------
# # (88) LET MANOEUVRE2COPYIMAGETOBUFFER4LPU TO GET FROM QUEUE AND TO SEND EITHER ACK OR NACK VIA PIPE
# # -------------------------------------------------------------------------------------------------------
# print("(Step 88A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4lpu = manoeuvre2copybuffertoimage4lpu(queue2copybuffertoimage4lpu, channel2copybuffertoimageconsume4lpu, channel2copybuffertoimagepublish4lpu)
# print("(Step 88B/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", manoeuvre2copybuffertoimage4lpu)
# except:
# print("(Step 88Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (89) RECEIVE ACK OR NACK ABOUT IMAGE OPERATION VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 89A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2copyimagereceive4lpu = channel2copybuffertoimageconsume4lpu.recv()
# print("(Step 89D/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel2copybuffertoimageconsume4lpu, " CONTROL & COMMAND: ", message2copyimagereceive4lpu)
# except:
# print('(Step 89Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# # -------------------------------------------------------------------------------------------------------
# # (90) LET MANOEUVRE2COPYIMAGETOBUFFER4LPU GO TO STATE 0
# # -------------------------------------------------------------------------------------------------------
# print("(Step 90A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4lpu = manoeuvre2copybuffertoimage4lpu(queue2copybuffertoimage4lpu, channel2copybuffertoimageconsume4lpu, channel2copybuffertoimagepublish4lpu)
# print("(Step 90B/700) OF LPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4LPU ", response2manoeuvreimagecopytobuffer4lpu)
# except:
# print("(Step 90Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4LPU ", time4xi())
#">
# -------------------------------------------------------------------------------------------------
def copy2buffertoimage4lpu(task4copybuffertoimage2lpu=None):
'''
copies buffer to image for LPU
'''
global lpu2image4xi # 2D-IMAGES FOR LPU
global lpu2buffer4xi # BUFFER FOR LPU
global control2copybuffertoimage4lpu # COMMAND AND CONTROL FOR LPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "copy2buffertoimage4lpu"
method2print = "copy2buffertoimage4lpu"
message2print = "{(Step 1A/33) started" + "; copy2buffertoimage4lpu-started: " + str(copy2buffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1B/33) passed" + "; task4copybuffertoimage2lpu-to-copy2buffertoimage4lpu: " + str(task4copybuffertoimage2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE LPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if lpu2image4xi is None:
lpu2image4xi = create2image4lpu() # INITIALIZE IMAGE FOR LPU
message2print = "{(Step 1C/70) created" + "; lpu2image4xi-created-by-copy2buffertoimage4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4lpu-skipped-by-copy2buffertoimage4lpu: " + str(copy2buffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# skipped
except:
try:
lpu2image4xi = create2image4lpu()
message2print = "{(Step 1E/70) set" + "; lpu2image4xi-set-by-copy2buffertoimage4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
lpu2image4xi = {}
message2print = "{(Step 1Z1/70) yielded" + "; lpu2image4xi-yielded-by-copy2buffertoimage4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z1-'
# -----------------------------------------------------------------------------------------
# CREATE LPU2BUFFER4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if lpu2buffer4xi is None:
lpu2buffer4xi = create2buffer4lpu() # INITIALIZE BUFFER FOR LPU
message2print = "{(Step 1F/70) created" + "; lpu2buffer4xi-created-by-copy2buffertoimage4lpu to: " + str(lpu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1G/70) skipped" + "; create2buffer4lpu-skipped-by-copy2buffertoimage4lpu: " + str(copy2buffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# skipped
except:
try:
lpu2buffer4xi = create2buffer4lpu()
message2print = "{(Step 1H/70) set" + "; lpu2buffer4xi-set-by-copy2buffertoimage4lpu to: " + str(lpu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
lpu2buffer4xi = {}
message2print = "{(Step 1Z2/70) yielded" + "; lpu2buffer4xi-yielded-by-copy2buffertoimage4lpu: " + str(lpu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z2-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - ANALYZE TASKS
# -----------------------------------------------------------------------------------------
if task4copybuffertoimage2lpu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR COPY - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4copybuffertoimage2lpu = {}
message2print = "{(Step 1A/70) initialized" + "; task4copybuffertoimage2lpu-created-by-copy2buffertoimage4lpu to: " + str(task4copybuffertoimage2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4lpu = trace2image4lpu # CALLBACK FUNCTION FOR LPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4lpu-created-by-copy2buffertoimage4lpu to: " + str(function2callback4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2buffertoimage4lpu" # MODULE OF LPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2buffertoimage4lpu" # FUNCTION OF LPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2buffertoimage4lpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR LPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-copy2buffertoimage4lpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; copy2buffertoimage4lpu-failed ; time: 04:41:15 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2buffertoimage4lpu',
# 'METHOD': 'copy2buffertoimage4lpu'}; time: 04:41:15 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4copybuffertoimage2lpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO LPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4copybuffertoimage2lpu['FUNCTION2CALLBACK'] = function2callback4lpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4copybuffertoimage2lpu-created-by-copy2buffertoimage4lpu to: " + str(task4copybuffertoimage2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; copy2buffertoimage4lpu-failed ; time: 04:41:15 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2buffertoimage4lpu',
# 'METHOD': 'copy2buffertoimage4lpu'}}; time: 04:41:15 10/04/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-copy2buffertoimage4lpu to: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
try:
platform2xi = get2platformids4xi() # PLATFORM IS COMMON TO ALL DEVICES I.E TO DEVICE XI
message2print = "{(Step 2B/70) got" + "; platform2xi-got-by-copy2buffertoimage4lpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'list2platforms': ['DragonXi'],
# 'ack2return': ' 2C-2E-2F-2G-',
# 'nack2return': ' ',
# 'available2platform': 1,
# 'max2entries': 1}; time: 04:41:15 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '2B-'
except:
message2print = "{(Step 2Z/70) failed" + "; platform2xi-failed-by-copy2buffertoimage4lpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4copybuffertoimage2lpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2lpu = {}
message2print = "{(Step 3A/70) trying" + "; context2lpu-trying-by-copy2buffertoimage4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2lpu = get2context4lpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2lpu-got-by-copy2buffertoimage4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2lpu-failed-by-copy2buffertoimage4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4copybuffertoimage2lpu ['CONTEXT'] = context2lpu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2lpu = {}
message2print = "{(Step 4A/70) trying" + "; device2lpu-trying-by-copy2buffertoimage4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2lpu = get2lpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2lpu-got-by-copy2buffertoimage4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'RESOLUTION2TIMER4PROFILING': 318,
# 'ID2PLATFORM': '0000000001509568',
# 'PROFILING2QUEUE': 'ACK',
# 'EXECUTE2KERNELS4OPENCL': 'ACK',
# 'NATIVE2WIDTHLONG4VECTOR': 2,
# 'MAX2UNITS4COMPUTE': 4,
# 'SIZE2MEMORY4GLOBAL': 3221225472, ...
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2lpu-failed-by-copy2buffertoimage4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4copybuffertoimage2lpu ['DEVICE'] = device2lpu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE DESTINATION OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
imagedestinationinfo2lpu = {}
message2print = "{(Step 5A/70) trying" + "; imagedestinationinfo2lpu-trying-by-copy2buffertoimage4lpu: " + str(imagedestinationinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imagedestinationinfo2lpu = get2imageinfo4lpu()
message2print = "{(Step 5B/70) got" + "; imagedestinationinfo2lpu-got-by-copy2buffertoimage4lpu: " + str(imagedestinationinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'SIZE2QUEUE': 2147483646,
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8',
# 'ORDER': 'CL_RGBA'},
# 'QUEUE': ,
# 'WIDTH': 800,
# 'CONTEXT': {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4lpu-failed ; time: 04:41:15 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4lpu',
# 'METHOD': 'create2context4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 2A-2C-2D-2E-2B-3B-4B-5B-6B-7B-7B-',
# 'INFO2PRIVATE': None,
# 'PLATFORM': {'list2platforms': ['DragonXi'],'ack2return': ' 2C-2E-2F-2G-', 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1},
# 'NACK2RETURN': ' ',
# 'SIZE2PRIVATE': 0,
# 'PROPERTIES': None},
# 'PIPE': (, ),
# 'COUNT2REFERENCE': 1,
# 'FUNCTION2CALLBACK': ,
# 'COMMANDQUEUE': ...
code2ack = code2ack + '5B-'
except:
message2print = "{(Step 5Z/70) failed" + "; imagedestinationinfo2lpu-failed-by-copy2buffertoimage4lpu: " + str(imagedestinationinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4copybuffertoimage2lpu ['IMAGEDESTINATION'] = imagedestinationinfo2lpu
# ---------------------------------------------------------------------------------------------
# (6) BUFFER SOURCE OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
buffersourceinfo2lpu = {}
message2print = "{(Step 6A/70) trying" + "; buffersourceinfo2lpu-trying-by-copy2buffertoimage4lpu: " + str(buffersourceinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
buffersourceinfo2lpu = get2bufferinfo4lpu()
message2print = "{(Step 6B/70) got" + "; buffersourceinfo2lpu-got-by-copy2buffertoimage4lpu: " + str(buffersourceinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4lpu-failed ; time: 04:41:15 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4lpu',
# 'METHOD': 'create2buffer4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': ...
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; buffersourceinfo2lpu-failed-by-copy2buffertoimage4lpu: " + str(buffersourceinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4copybuffertoimage2lpu ['BUFFERSOURCE'] = buffersourceinfo2lpu
# ---------------------------------------------------------------------------------------------
# (7) QUEUE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
queue2copybuffertoimage4lpu = None
message2print = "{(Step 7A/70) trying" + "; queue2copybuffertoimage4lpu-trying-by-copy2buffertoimage4lpu: " + str(queue2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copybuffertoimage4lpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 7B/70) got" + "; queue2copybuffertoimage4lpu-got-by-copy2buffertoimage4lpu: " + str(queue2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; queue2copybuffertoimage4lpu-failed-by-copy2buffertoimage4lpu: " + str(queue2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4copybuffertoimage2lpu ['QUEUE'] = queue2copybuffertoimage4lpu
# ---------------------------------------------------------------------------------------------
# (8) PIPE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
pipe2lpu = None
message2print = "{(Step 8A/70) trying" + "; pipe2lpu-trying-by-copy2buffertoimage4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2lpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 8B/70) got" + "; pipe2lpu-got-by-copy2buffertoimage4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; pipe2lpu-failed-by-copy2buffertoimage4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4copybuffertoimage2lpu ['PIPE'] = pipe2lpu
# ---------------------------------------------------------------------------------------------
# (9) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2lpu = {}
message2print = "{(Step 9A/70) trying" + "; commandqueueinfo2lpu-trying-by-copy2buffertoimage4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2lpu = get2commandqueueinfo4lpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; commandqueueinfo2lpu-got-by-copy2buffertoimage4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': ...
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; commandqueueinfo2lpu-failed-by-copy2buffertoimage4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4copybuffertoimage2lpu ['COMMANDQUEUE'] = commandqueueinfo2lpu
# ---------------------------------------------------------------------------------------------
# (11) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2lpu = {}
message2print = "{(Step 11A/70) trying" + "; eventinfo2lpu-trying-by-copy2buffertoimage4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2lpu = get2eventinfo4lpu()
message2print = "{(Step 11B/70) got" + "; eventinfo2lpu-got-by-copy2buffertoimage4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'DATA2CALLBACK': ...
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; eventinfo2lpu-failed-by-copy2buffertoimage4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4copybuffertoimage2lpu ['EVENT'] = eventinfo2lpu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2lpu = {}
message2print = "{(Step 12A/70) trying" + "; eventwaitlist2lpu-trying-by-copy2buffertoimage4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2lpu = {}
message2print = "{(Step 12B/70) set" + "; eventwaitlist2lpu-set-by-copy2buffertoimage4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlist2lpu-failed-by-copy2buffertoimage4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4copybuffertoimage2lpu ['EVENTWAITLIST'] = eventwaitlist2lpu
# ---------------------------------------------------------------------------------------------
# (13) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2lpu = 0
message2print = "{(Step 13A/70) trying" + "; eventwaitlistquantity2lpu-trying-by-copy2buffertoimage4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2lpu.keys()
for key2event in keys2event:
eventwaitlistquantity2lpu = eventwaitlistquantity2lpu + 1
message2print = "{(Step 13B/70) set" + "; eventwaitlistquantity2lpu-set-by-copy2buffertoimage4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; eventwaitlistquantity2lpu-failed-by-copy2buffertoimage4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4copybuffertoimage2lpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2lpu
# ---------------------------------------------------------------------------------------------
# (15) ORIGIN FOR DESTINATION - REQUIRED
# ---------------------------------------------------------------------------------------------
origin4destination2lpu = {}
message2print = "{(Step 15A/70) trying" + "; origin4destination2lpu-trying-by-copy2buffertoimage4lpu: " + str(origin4destination2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin4destination2lpu['X'] = 100
origin4destination2lpu['Y'] = 100
origin4destination2lpu['Z'] = 100
message2print = "{(Step 15B/70) set" + "; origin4destination2lpu-set-by-copy2buffertoimage4lpu to: " + str(origin4destination2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 100, 'X': 100, 'Z': 100}
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; origin4destination2lpu-failed-by-copy2buffertoimage4lpu: " + str(origin4destination2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '15Z-'
task4copybuffertoimage2lpu ['DESTINATIONORIGIN'] = origin4destination2lpu
# --------------------------------------------------------------------------------------------------------
# (16) REGION - REGION OF A IMAGE TO BE COPIED
# --------------------------------------------------------------------------------------------------------
region4copy2lpu = {}
message2print = "{(Step 16A/70) trying" + "; region4copy2lpu-trying-by-copy2buffertoimage4lpu: " + str(region4copy2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region4copy2lpu['X'] = 10
region4copy2lpu['Y'] = 10
region4copy2lpu['Z'] = 10
message2print = "{(Step 16B/70) set" + "; region4copy2lpu-set-by-copy2buffertoimage4lpu to: " + str(region4copy2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 10, 'X': 10, 'Z': 10}
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; region4copy2lpu-failed-by-copy2buffertoimage4lpu: " + str(region4copy2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '16Z-'
task4copybuffertoimage2lpu ['REGION'] = region4copy2lpu
# --------------------------------------------------------------------------------------------------------
# (17) OFFSET - WHERE TO BEGIN COPYING DATA FROM SOURCE BUFFER
# --------------------------------------------------------------------------------------------------------
offset4copy2lpu = 0
message2print = "{(Step 17A/70) set" + "; offset4copy2lpu-set-by-copy2buffertoimage4lpu to: " + str(offset4copy2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
task4copybuffertoimage2lpu ['OFFSET'] = offset4copy2lpu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------
# ANALYZE TASKS - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4copybuffertoimage2lpu.keys()
message2print = "{(Step 20/70) got" + "; keys2task-got-by-copy2buffertoimage4lpu: " + str(sorted(keys2task)) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ['BUFFERSOURCE',
# 'COMMANDQUEUE',
# 'CONTEXT',
# 'DATA2CALLBACK',
# 'DESTINATIONORIGIN',
# 'DEVICE',
# 'EVENT',
# 'EVENTWAITLIST',
# 'EVENTWAITLISTQUANTITY',
# 'FUNCTION2CALLBACK',
# 'IMAGEDESTINATION',
# 'OFFSET',
# 'PIPE',
# 'PLATFORM',
# 'QUEUE',
# 'REGION']; time: 04:41:15 10/04/11 Pacific Daylight Time}
if (('DATA2CALLBACK' in keys2task) and ('FUNCTION2CALLBACK' in keys2task)):
pass
else:
# ---------------------------------------------------------------------------------------------
# (21B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4lpu = trace2image4lpu # CALLBACK FUNCTION FOR LPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4lpu-created-by-copy2buffertoimage4lpu to: " + str(function2callback4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2buffertoimage4lpu" # MODULE OF LPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2buffertoimage4lpu" # FUNCTION OF LPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2buffertoimage4lpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR LPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-copy2buffertoimage4lpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4copybuffertoimage2lpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO LPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4copybuffertoimage2lpu['FUNCTION2CALLBACK'] = function2callback4lpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4copybuffertoimage2lpu-created-by-copy2buffertoimage4lpu to: " + str(task4copybuffertoimage2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-copy2buffertoimage4lpu to: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
platform2xi = get2platformids4xi() # PLATFORM IS COMMON TO ALL DEVICES I.E TO DEVICE XI
message2print = "{(Step 22B/70) got" + "; platform2xi-got-by-copy2buffertoimage4lpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-copy2buffertoimage4lpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4copybuffertoimage2lpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2lpu = {}
message2print = "{(Step 23A/70) trying" + "; context2lpu-trying-by-copy2buffertoimage4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2lpu = get2context4lpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2lpu-got-by-copy2buffertoimage4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2lpu-failed-by-copy2buffertoimage4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4copybuffertoimage2lpu ['CONTEXT'] = context2lpu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2lpu = {}
message2print = "{(Step 24A/70) trying" + "; device2lpu-trying-by-copy2buffertoimage4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2lpu = get2lpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2lpu-got-by-copy2buffertoimage4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2lpu-failed-by-copy2buffertoimage4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4copybuffertoimage2lpu ['DEVICE'] = device2lpu
if 'IMAGEDESTINATION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) DESTINATION IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
destinationimageinfo2lpu = {}
message2print = "{(Step 25A/70) trying" + "; destinationimageinfo2lpu-trying-by-copy2buffertoimage4lpu: " + str(destinationimageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
destinationimageinfo2lpu = get2imageinfo4lpu()
message2print = "{(Step 25B/70) got" + "; destinationimageinfo2lpu-got-by-copy2buffertoimage4lpu: " + str(destinationimageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; destinationimageinfo2lpu-failed-by-copy2buffertoimage4lpu: " + str(destinationimageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4copybuffertoimage2lpu ['IMAGEDESTINATION'] = destinationimageinfo2lpu
if 'BUFFERSOURCE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) SOURCE BUFFER - REQUIRED
# ---------------------------------------------------------------------------------------------
sourcebufferinfo2lpu = {}
message2print = "{(Step 26A/70) trying" + "; sourcebufferinfo2lpu-trying-by-copy2buffertoimage4lpu: " + str(sourcebufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
sourcebufferinfo2lpu = get2bufferinfo4lpu()
message2print = "{(Step 26B/70) got" + "; sourcebufferinfo2lpu-got-by-copy2buffertoimage4lpu: " + str(sourcebufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; sourcebufferinfo2lpu-failed-by-copy2buffertoimage4lpu: " + str(sourcebufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4copybuffertoimage2lpu ['BUFFERSOURCE'] = sourcebufferinfo2lpu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) QUEUE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
queue2copybuffertoimage4lpu = None
message2print = "{(Step 27A/70) trying" + "; queue2copybuffertoimage4lpu-trying-by-copy2buffertoimage4lpu: " + str(queue2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copybuffertoimage4lpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 27B/70) got" + "; queue2copybuffertoimage4lpu-got-by-copy2buffertoimage4lpu: " + str(queue2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; queue2copybuffertoimage4lpu-failed-by-copy2buffertoimage4lpu: " + str(queue2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4copybuffertoimage2lpu ['QUEUE'] = queue2copybuffertoimage4lpu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) PIPE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
pipe2lpu = None
message2print = "{(Step 28A/70) trying" + "; pipe2lpu-trying-by-copy2buffertoimage4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2lpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 28B/70) got" + "; pipe2lpu-got-by-copy2buffertoimage4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; pipe2lpu-failed-by-copy2buffertoimage4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4copybuffertoimage2lpu ['PIPE'] = pipe2lpu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2lpu = {}
message2print = "{(Step 29A/70) trying" + "; commandqueueinfo2lpu-trying-by-copy2buffertoimage4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2lpu = get2commandqueueinfo4lpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; commandqueueinfo2lpu-got-by-copy2buffertoimage4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; commandqueueinfo2lpu-failed-by-copy2buffertoimage4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4copybuffertoimage2lpu ['COMMANDQUEUE'] = commandqueueinfo2lpu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2lpu = {}
message2print = "{(Step 31A/70) trying" + "; eventinfo2lpu-trying-by-copy2buffertoimage4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2lpu = get2eventinfo4lpu()
message2print = "{(Step 31B/70) got" + "; eventinfo2lpu-got-by-copy2buffertoimage4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventinfo2lpu-failed-by-copy2buffertoimage4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4copybuffertoimage2lpu ['EVENT'] = eventinfo2lpu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2lpu = {}
message2print = "{(Step 32A/70) trying" + "; eventwaitlist2lpu-trying-by-copy2buffertoimage4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2lpu = {}
message2print = "{(Step 32B/70) set" + "; eventwaitlist2lpu-set-by-copy2buffertoimage4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlist2lpu-failed-by-copy2buffertoimage4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4copybuffertoimage2lpu ['EVENTWAITLIST'] = eventwaitlist2lpu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2lpu = 0
message2print = "{(Step 33A/70) trying" + "; eventwaitlistquantity2lpu-trying-by-copy2buffertoimage4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2lpu.keys()
for key2event in keys2event:
eventwaitlistquantity2lpu = eventwaitlistquantity2lpu + 1
message2print = "{(Step 33B/70) set" + "; eventwaitlistquantity2lpu-set-by-copy2buffertoimage4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; eventwaitlistquantity2lpu-failed-by-copy2buffertoimage4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4copybuffertoimage2lpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2lpu
if 'DESTINATIONORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) DESTINATIONORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
destination4origin2lpu = {}
message2print = "{(Step 34A/70) trying" + "; destination4origin2lpu-trying-by-copy2buffertoimage4lpu: " + str(destination4origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
destination4origin2lpu['X'] = 0
destination4origin2lpu['Y'] = 0
destination4origin2lpu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; destination4origin2lpu-set-by-copy2buffertoimage4lpu to: " + str(destination4origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; destination4origin2lpu-failed-by-copy2buffertoimage4lpu: " + str(destination4origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4copybuffertoimage2lpu ['DESTINATIONORIGIN'] = destination4origin2lpu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (36) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2lpu = {}
message2print = "{(Step 36A/70) trying" + "; region2lpu-trying-by-copy2buffertoimage4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2lpu['X'] = 160 # WIDTH IN PIXELS TO WRITE
region2lpu['Y'] = 90 # HEIGHT IN PIXELS TO WRITE
region2lpu['Z'] = 0 # DEPTH IN PIXELS TO WRITE
message2print = "{(Step 36B/70) set" + "; region2lpu-set-by-copy2buffertoimage4lpu to: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; region2lpu-failed-by-copy2buffertoimage4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '36Z-'
task4copybuffertoimage2lpu ['REGION'] = region2lpu
if 'OFFSET' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (37) OFFSET - WHERE TO BEGIN COPYING DATA FROM SOURCE BUFFER - REQUIRED
# ---------------------------------------------------------------------------------------------
offset2lpu = 0
message2print = "{(Step 37A/70) set" + "; offset2lpu-set-by-copy2buffertoimage4lpu to: " + str(offset2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
task4copybuffertoimage2lpu ['OFFSET'] = offset2lpu
code2ack = code2ack + '37A-'
# ---------------------------------------------------------------------------------------------
# EOF TASK ANALYSIS
# ---------------------------------------------------------------------------------------------
keys2task = task4copybuffertoimage2lpu.keys()
message2print = "{(Step 39/70) set" + "; keys2task-set-by-copy2buffertoimage4lpu to: " + str(sorted(keys2task)) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ['BUFFERSOURCE',
# 'COMMANDQUEUE',
# 'CONTEXT',
# 'DATA2CALLBACK',
# 'DESTINATIONORIGIN',
# 'DEVICE',
# 'EVENT',
# 'EVENTWAITLIST',
# 'EVENTWAITLISTQUANTITY',
# 'FUNCTION2CALLBACK',
# 'IMAGEDESTINATION',
# 'OFFSET',
# 'PIPE',
# 'PLATFORM',
# 'QUEUE',
# 'REGION']; time: 04:52:11 10/04/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
control2copybuffertoimage4lpu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2lpu = False
channels2lpu = ()
message2print = "{(Step 40A/70) trying" + "channels2lpu-trying-by-copy2buffertoimage4lpu: " + str(channels2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
#
consumerchannel2copybuffertoimage4lpu, publisherchannel2copybuffertoimage4lpu = task4copybuffertoimage2lpu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2copybuffertoimage4lpu-got-by-copy2buffertoimage4lpu: " + str(consumerchannel2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2copybuffertoimage4lpu-got-by-copy2buffertoimage4lpu: " + str(publisherchannel2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2lpu = True
control2copybuffertoimage4lpu['CONSUMERCHANNEL'] = consumerchannel2copybuffertoimage4lpu
control2copybuffertoimage4lpu['PUBLISHERCHANNEL'] = publisherchannel2copybuffertoimage4lpu
code2ack = code2ack + '40D-'
except:
ack4channels2lpu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2copybuffertoimage4lpu = False
queue2copybuffertoimage4lpu = None
message2print = "{(Step 41A/70) trying" + "queue2copybuffertoimage4lpu-trying-by-copy2buffertoimage4lpu: " + str(queue2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copybuffertoimage4lpu = task4copybuffertoimage2lpu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2copybuffertoimage4lpu-got-by-copy2buffertoimage4lpu: " + str(queue2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2copybuffertoimage4lpu = True
control2copybuffertoimage4lpu['QUEUE'] = queue2copybuffertoimage4lpu
code2ack = code2ack + '41C-'
except:
ack4queue2copybuffertoimage4lpu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4lpu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4lpu-trying-by-copy2buffertoimage4lpu: " + str(dummy2image4lpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4lpu = DummyProcess4Xi(target=manoeuvre2copybuffertoimage4lpu, # in this module to handle queue and pipe channels
# args =(queue2copybuffertoimage4lpu, # caller puts and gets - does NOT call any functions
# consumerchannel2copybuffertoimage4lpu, publisherchannel2copybuffertoimage4lpu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4lpu-created-by-copy2buffertoimage4lpu: " + str(dummy2image4lpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# code2ack = code2ack + '69B-'
# except:
# code2nack = code2nack + '69Z-'
# ---------------------------------------------------------------------------------------------
# RETURN CONTROL AND COMMAND DICTIONARY
# ---------------------------------------------------------------------------------------------
message2print = "{(Step 70A/70) set" + "; code2ack-set-by-copy2buffertoimage4lpu: " + str(code2ack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1B1-1B2-1C-2B-3B-4B-5B-6B-7B-8B-9B-11B-12B-13B-15B-16B-40D-41C-
message2print = "{(Step 70B/70) set" + "; code2nack-set-by-copy2buffertoimage4lpu: " + str(code2nack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70C/70) returning" + "; control2copybuffertoimage4lpu-returning-by-copy2buffertoimage4lpu: " + str(control2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 04:52:11 10/04/11 Pacific Daylight Time}
return control2copybuffertoimage4lpu
#
# -------------------------------------------------------------------------------------------------
#copy2read4lpu"
# channel2readpublish4lpu = response4read2image['PUBLISHERCHANNEL']
# channel2readpublish4lpu.send(message2readsend4lpu)
# print("(Step 17B/700) OF LPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4LPU: ", channel2readpublish4lpu, " MESSAGE2SEND4LPU: " , message2readsend4lpu)
# except:
# print('(Step 17Z1/700) OF LPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4LPU ', time4xi())
# # ------------------------------------------------------------------------------------------
# # (18) LET MANOEUVRE2IMAGE4LPU TO RECEIVE COPY AND AND SEND ROGER VIA PIPE
# # ------------------------------------------------------------------------------------------
# print("(Step 18C/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# try:
# response2manoeuvre4lpu = manoeuvre2readimage4lpu(queue2read4lpu, channel2readconsume4lpu, channel2readpublish4lpu)
# print("(Step 18D/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", manoeuvre2readimage4lpu)
# except:
# print("(Step 18Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# else:
# pass # trust activated thread
# # ---------------------------------------------------------------------------------------------
# # (19) RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------
# print('(Step 19A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4LPU ', time4xi())
# try:
# channel2readconsume4lpu = response4read2image['CONSUMERCHANNEL']
# message2readreceive4lpu = channel2readconsume4lpu.recv()
# print("(Step 19B/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel2readconsume4lpu, " CONTROL & COMMAND: ", message2readreceive4lpu)
# # roger2read4lpu
# except:
# print('(Step 19Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4LPU ', time4xi())
# # ---------------------------------------------------------------------------------------------------
# # (20) SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2IMAGE4LPU TO RECEIVE
# # ---------------------------------------------------------------------------------------------------
# print('(Step 20A/700) OF LPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4LPU ', time4xi())
# try:
# message2readsend4lpu = "ready2read4lpu"
# channel2readpublish4lpu = response4read2image['PUBLISHERCHANNEL']
# channel2readpublish4lpu.send(message2readsend4lpu)
# print("(Step 20B/700) OF LPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4LPU: ", channel2readpublish4lpu, " MESSAGE2SEND4LPU: " , message2readsend4lpu)
# # ready2read4lpu
# except:
# print('(Step 20Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4LPU ', time4xi())
# # -----------------------------------------------------------------------------------
# # (21) LET MANOEUVRE2IMAGE4LPU TO RECEIVE READY AND TO SEND READY
# # -----------------------------------------------------------------------------------
# print("(Step 21A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# try:
# response2manoeuvre4lpu = manoeuvre2readimage4lpu(queue2read4lpu, channel2readconsume4lpu, channel2readpublish4lpu)
# print("(Step 21B/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", manoeuvre2readimage4lpu)
# except:
# print("(Step 21Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# # ---------------------------------------------------------------------------------------
# # (22) RECEIVE CONTROL & COMMAND READY VIA PIPE
# # ---------------------------------------------------------------------------------------
# print('(Step 22A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4LPU ', time4xi())
# try:
# channel2readconsume4lpu = response4read2image['CONSUMERCHANNEL']
# message2readreceive4lpu = channel2readconsume4lpu.recv()
# print("(Step 22B/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel2readconsume4lpu, " CONTROL & COMMAND: ", message2readreceive4lpu)
# # ready2read4lpu
# except:
# print('(Step 22Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4LPU ', time4xi())
# # -----------------------------------------------------------------------------------------
# # (24) PUT IMAGE PATH TO QUEUE
# # -----------------------------------------------------------------------------------------
# print("(Step 24A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PUT IMAGE PATH TO QUEUE ", time4xi())
# try:
# queue2read4dragon.put(path2dragon)
# print("(Step 24B/700) OF DRAGON2IMAGE4XI5TEST - PUT TO QUEUE IMAGE PATH: ", path2dragon)
# # ..//..//..//..//..//web//images//png//dragonxi.png
# except:
# print("(Step 24Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
# # ------------------------------------------------------------------------------------------------------
# # (25) LET MANOEUVRE2IMAGE4LPU TO GET FROM QUEUE AND TO SEND EITHER ACK OR NACK VIA PIPE
# # -------------------------------------------------------------------------------------------------------
# print("(Step 25A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# try:
# response2manoeuvre4lpu = manoeuvre2readimage4lpu(queue2read4lpu, channel2readconsume4lpu, channel2readpublish4lpu)
# print("(Step 25B/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", manoeuvre2readimage4lpu)
# except:
# print("(Step 25Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (26) RECEIVE ACK OR NACK ABOUT IMAGE OPERATION VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 26A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2readreceive4lpu = channel2readconsume4lpu.recv()
# print("(Step 26D/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel2readconsume4lpu, " CONTROL & COMMAND: ", message2readreceive4lpu)
# # ack2imageinfo4lpu
# except:
# print('(Step 26Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# # -------------------------------------------------------------------------------------------------------
# # (27) LET MANOEUVRE2IMAGE4LPU GO TO STATE 0
# # -------------------------------------------------------------------------------------------------------
# print("(Step 27A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# try:
# response2manoeuvre4lpu = manoeuvre2readimage4lpu(queue2read4lpu, channel2readconsume4lpu, channel2readpublish4lpu)
# print("(Step 27B/700) OF LPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4LPU ", response2manoeuvre4lpu)
# except:
# print("(Step 27Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
#">
# -------------------------------------------------------------------------------------------------
def read2image4lpu(task4imageread2lpu=None):
'''
reads 2D images for LPU
'''
global lpu2image4xi # 2D-IMAGES FOR LPU
global control2readimage4lpu # COMMAND AND CONTROL FOR LPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "read2image4lpu"
method2print = "read2image4lpu"
message2print = "{(Step 1A/33) started" + "; read2image4lpu-started: " + str(read2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4imageread2lpu-to-read2image4lpu: " + str(task4imageread2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE LPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if lpu2image4xi is None:
lpu2image4xi = create2image4lpu() # INITIALIZE IMAGE FOR LPU
message2print = "{(Step 1C/70) created" + "; lpu2image4xi-created-by-read2image4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4lpu-skipped-by-read2image4lpu: " + str(read2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# skipped
except:
try:
lpu2image4xi = create2image4lpu()
message2print = "{(Step 1E/70) set" + "; lpu2image4xi-set-by-read2image4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
lpu2image4xi = {}
message2print = "{(Step 1Z/70) yielded" + "; lpu2image4xi-yielded-by-read2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - CHECK PARAMETERS
# -----------------------------------------------------------------------------------------
try:
if task4imageread2lpu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR READ - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4imageread2lpu = {}
message2print = "{(Step 1A/70) initialized" + "; task4imageread2lpu-created-by-read2image4lpu to: " + str(task4imageread2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4lpu = trace2image4lpu # CALLBACK FUNCTION FOR LPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4lpu-created-by-read2image4lpu to: " + str(function2callback4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ;
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "read2image4lpu" # MODULE OF LPUIZED OPENCL MODULE
args2callback['METHOD'] = "read2image4lpu" # FUNCTION OF LPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; read2image4lpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR LPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-read2image4lpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; read2image4lpu-failed ; time: 05:06:38 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'read2image4lpu',
# 'METHOD': 'read2image4lpu'}; time: 05:06:38 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imageread2lpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO LPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imageread2lpu['FUNCTION2CALLBACK'] = function2callback4lpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4imageread2lpu-created-by-read2image4lpu to: " + str(task4imageread2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; read2image4lpu-failed ; time: 05:06:38 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'read2image4lpu',
# 'METHOD': 'read2image4lpu'}}; time: 05:06:38 10/04/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-read2image4lpu to: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
try:
platform2xi = get2platformids4xi() # PLATFORM IS COMMON TO ALL DEVICES I.E TO DEVICE XI
message2print = "{(Step 2B/70) got" + "; platform2xi-got-by-read2image4lpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'list2platforms': ['DragonXi'], 'ack2return': ' 2C-2E-2F-2G-', 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1}
code2ack = code2ack + '2B-'
except:
message2print = "{(Step 2Z/70) failed" + "; platform2xi-failed-by-read2image4lpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4imageread2lpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2lpu = {}
message2print = "{(Step 3A/70) trying" + "; context2lpu-trying-by-read2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2lpu = get2context4lpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2lpu-got-by-read2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2lpu-failed-by-read2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4imageread2lpu ['CONTEXT'] = context2lpu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2lpu = {}
message2print = "{(Step 4A/70) trying" + "; device2lpu-trying-by-read2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2lpu = get2lpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2lpu-got-by-read2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'RESOLUTION2TIMER4PROFILING': 318,
# 'ID2PLATFORM': '0000000001509568',
# 'PROFILING2QUEUE': 'ACK',
# 'EXECUTE2KERNELS4OPENCL': 'ACK',
# 'NATIVE2WIDTHLONG4VECTOR': 2 ...
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2lpu-failed-by-read2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4imageread2lpu ['DEVICE'] = device2lpu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2lpu = {}
message2print = "{(Step 5A/70) trying" + "; imageinfo2lpu-trying-by-read2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2lpu = get2imageinfo4lpu()
message2print = "{(Step 5B/70) got" + "; imageinfo2lpu-got-by-read2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'SIZE2QUEUE': 2147483646,
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8',
# 'ORDER': 'CL_RGBA'},
# 'QUEUE': ,
# 'WIDTH': 800,
# 'CONTEXT': {'COUNT2REFERENCE': 0, ...
code2ack = code2ack + '5B-'
except:
message2print = "{(Step 5Z/70) failed" + "; imageinfo2lpu-failed-by-read2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4imageread2lpu ['IMAGE'] = imageinfo2lpu
# ---------------------------------------------------------------------------------------------
# (6) QUEUE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
queue2lpu = None
message2print = "{(Step 6A/70) trying" + "; queue2lpu-trying-by-read2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2lpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 6B/70) got" + "; queue2lpu-got-by-read2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; queue2lpu-failed-by-read2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4imageread2lpu ['QUEUE'] = queue2lpu
# ---------------------------------------------------------------------------------------------
# (7) PIPE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
pipe2lpu = None
message2print = "{(Step 7A/70) trying" + "; pipe2lpu-trying-by-read2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2lpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 7B/70) got" + "; pipe2lpu-got-by-read2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; pipe2lpu-failed-by-read2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4imageread2lpu ['PIPE'] = pipe2lpu
# ---------------------------------------------------------------------------------------------
# (8) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2lpu = {}
message2print = "{(Step 8A/70) trying" + "; commandqueueinfo2lpu-trying-by-read2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2lpu = get2commandqueueinfo4lpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 8B/70) got" + "; commandqueueinfo2lpu-got-by-read2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; commandqueueinfo2lpu-failed-by-read2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4imageread2lpu ['COMMANDQUEUE'] = commandqueueinfo2lpu
# ---------------------------------------------------------------------------------------------
# (9) BUFFER - AUTOMATIC BY LPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2lpu = {}
message2print = "{(Step 9A/70) trying" + "; bufferinfo2lpu-trying-by-read2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2lpu = get2bufferinfo4lpu() # SYSTEM CREATES BUFFER FOR LPU, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; bufferinfo2lpu-got-by-read2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; bufferinfo2lpu-failed-by-read2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4imageread2lpu ['BUFFER'] = bufferinfo2lpu
# ---------------------------------------------------------------------------------------------
# (10) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2lpu = {}
message2print = "{(Step 10A/70) trying" + "; eventinfo2lpu-trying-by-read2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2lpu = get2eventinfo4lpu()
message2print = "{(Step 10B/70) got" + "; eventinfo2lpu-got-by-read2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '10B-'
except:
message2print = "{(Step 10Z/70) failed" + "; eventinfo2lpu-failed-by-read2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '10Z-'
task4imageread2lpu ['EVENT'] = eventinfo2lpu
# ---------------------------------------------------------------------------------------------
# (11) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2lpu = {}
message2print = "{(Step 11A/70) trying" + "; eventwaitlist2lpu-trying-by-read2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2lpu = {}
message2print = "{(Step 11B/70) set" + "; eventwaitlist2lpu-set-by-read2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; eventwaitlist2lpu-failed-by-read2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4imageread2lpu ['EVENTWAITLIST'] = eventwaitlist2lpu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2lpu = 0
message2print = "{(Step 12A/70) trying" + "; eventwaitlistquantity2lpu-trying-by-read2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2lpu.keys()
for key2event in keys2event:
eventwaitlistquantity2lpu = eventwaitlistquantity2lpu + 1
message2print = "{(Step 12B/70) set" + "; eventwaitlistquantity2lpu-set-by-read2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlistquantity2lpu-failed-by-read2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4imageread2lpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2lpu
# ---------------------------------------------------------------------------------------------
# (13) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2lpu = ' '
message2print = "{(Step 13A/70) trying" + "; blocking2lpu-trying-by-read2image4lpu: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2lpu = 'CL_FALSE' # the read command is non-blocking
message2print = "{(Step 13B/70) set" + "; blocking2lpu-set-by-read2image4lpu to: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# CL_FALSE
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; blocking2lpu-failed-by-read2image4lpu: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4imageread2lpu ['BLOCKING'] = blocking2lpu
# ---------------------------------------------------------------------------------------------
# (14) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2lpu = {}
message2print = "{(Step 14A/70) trying" + "; origin2lpu-trying-by-read2image4lpu: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2lpu['X'] = 0
origin2lpu['Y'] = 0
origin2lpu['Z'] = 0
message2print = "{(Step 14B/70) set" + "; origin2lpu-set-by-read2image4lpu to: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 0, 'X': 0, 'Z': 0}
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; origin2lpu-failed-by-read2image4lpu: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4imageread2lpu ['ORIGIN'] = origin2lpu
# ---------------------------------------------------------------------------------------------
# (15) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2lpu = {}
message2print = "{(Step 15A/70) trying" + "; region2lpu-trying-by-read2image4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2lpu['X'] = 160 # WIDTH IN PIXELS TO READ
region2lpu['Y'] = 90 # HEIGHT IN PIXELS TO READ
region2lpu['Z'] = 0 # DEPTH IN PIXELS TO READ
message2print = "{(Step 15B/70) set" + "; region2lpu-set-by-read2image4lpu to: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 90, 'X': 160, 'Z': 0}
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; region2lpu-failed-by-read2image4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '15Z-'
task4imageread2lpu ['REGION'] = region2lpu
# ---------------------------------------------------------------------------------------------
# (16) ROWPITCH (STRIDE) - REQUIRED
# ---------------------------------------------------------------------------------------------
# One can assume that memory representing an image or screen will have data laid out as one row of pixels followed directly by the next row of pixels.
# However many APIs (e.g. Direct3D) that return a pointer to image data add an extra block of data at the end of each row.
# int offset = x * bytesPerPixel + y * pitch;
# When a video image is stored in memory, the memory buffer might contain extra padding bytes after each row of pixels.
# The padding bytes affect how the image is stored in memory, but do not affect how the image is displayed.
# The stride is the number of bytes from one row of pixels in memory to the next row of pixels in memory.
# Stride is also called pitch.
# If padding bytes are present, the stride is wider than the width of the image, as shown in the following illustration.
rowpitch2lpu = 0
size2element = 8 # VOXEL (X,Y,Z) = SHOT IN PIXELS, R=1 PIXELS
voxelquantity2layer = 10 # MAX NUMBER OF VOXELS IN EACH 2D LAYER
quantity2direction = 8 # ONE DIRECTIONS IN 2D
width2lpu = 800
message2print = "{(Step 16A/70) trying" + "; rowpitch2lpu-trying-by-read2image4lpu: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2lpu = int(width2lpu * size2element * voxelquantity2layer / quantity2direction) # (800 * 8 * 10) / 8 = 8K PIXELS MAX TO SCAN
# SPHERE IS SPARSE HAVING FEW SHOTS PER SCAN LINE
message2print = "{(Step 16B/70) set" + "; rowpitch2lpu-set-by-read2image4lpu to: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 8000
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; rowpitch2lpu-failed-by-read2image4lpu: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '16Z-'
task4imageread2lpu ['ROWPITCH'] = rowpitch2lpu
# ----------------------------------------------------------------------------------------------------
# (17) POINTER - REQUIRED - THE POINTER TO A BUFFER IN HOST MEMORY WHERE IMAGE DATA IS TO BE READ FROM
# ----------------------------------------------------------------------------------------------------
pointer2lpu = None
height2lpu = 800
size2lpu = int(width2lpu * height2lpu) # CALCULATED MEMORY
if size2lpu == 0:
size2lpu = 4400 # MINIMUM MEMORY
message2print = "{(Step 17A/70) trying" + "; pointer2lpu-trying-by-read2image4lpu: " + str(pointer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
arena2lpu = Arena4Xi(size2lpu) # SYSTEM RESERVER MEMORY FOR IMAGE
message2print = "{(Step 17B/70) got" + "; arena2lpu-got-by-read2image4lpu: " + str(arena2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
size2arena = arena2lpu.size #
message2print = "{(Step 17C/70) got" + "; size2arena-got-by-read2buffer4lpu: " + str(size2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 640000
buffer2arena = arena2lpu.buffer
message2print = "{(Step 17D/70) got" + "; buffer2arena-got-by-read2buffer4lpu: " + str(buffer2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17D-'
if size2arena < size2lpu:
size2lpu = size2arena # AVAILABLE MEMORY FOR IMAGE
message2print = "{(Step 17E/70) set" + "; size2lpu-set-by-read2buffer4lpu to: " + str(size2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17E-'
else:
pass
pointer2lpu = buffer2arena
message2print = "{(Step 17F/70) set" + "; pointer2lpu-set-by-read2buffer4lpu to: " + str(pointer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17F-'
except:
message2print = "{(Step 17Z/70) failed" + "; pointer2lpu-failed-by-read2image4lpu: " + str(pointer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '17Z-'
task4imageread2lpu ['POINTER'] = pointer2lpu
task4imageread2lpu ['SIZE'] = size2lpu # AUTOMATIC BY LPUXI
# --------------------------------------------------------------------------------------------------------
# (18) SLICEPITCH - REQUIRED - THE SIZE IN BYTES OF THE 2D SLICE OF THE 3D REGION OF A 3D IMAGE BEING READ
# --------------------------------------------------------------------------------------------------------
slicepitch2lpu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 18A/70) trying" + "; slicepitch2lpu-trying-by-read2image4lpu: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2lpu = 0
message2print = "{(Step 18B/70) set" + "; slicepitch2lpu-set-by-read2image4lpu to: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '18B-'
except:
message2print = "{(Step 18Z/70) failed" + "; slicepitch2lpu-failed-by-read2image4lpu: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '18Z-'
task4imageread2lpu ['SLICEPITCH'] = slicepitch2lpu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
else:
pass
# ---------------------------------------------------------------------------------------------
# ANALYSE TASKS - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4imageread2lpu.keys()
message2print = "{(Step 20/70) got" + "; keys2task-got-by-read2image4lpu: " + str(sorted(keys2task)) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ['BLOCKING',
# 'BUFFER',
# 'COMMANDQUEUE',
# 'CONTEXT',
# 'DATA2CALLBACK',
# 'DEVICE',
# 'EVENT',
# 'EVENTWAITLIST',
# 'EVENTWAITLISTQUANTITY',
# 'FUNCTION2CALLBACK',
# 'IMAGE',
# 'ORIGIN',
# 'PIPE',
# 'PLATFORM',
# 'POINTER',
# 'QUEUE',
# 'REGION',
# 'ROWPITCH',
# 'SIZE',
# 'SLICEPITCH']; time: 05:25:42 10/04/11 Pacific Daylight Time}
if (('DATA2CALLBACK' in keys2task) and ('FUNCTION2CALLBACK' in keys2task)):
pass
else:
# ---------------------------------------------------------------------------------------------
# (21B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4lpu = trace2image4lpu # CALLBACK FUNCTION FOR LPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4lpu-created-by-read2image4lpu to: " + str(function2callback4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "read2image4lpu" # MODULE OF LPUIZED OPENCL MODULE
args2callback['METHOD'] = "read2image4lpu" # FUNCTION OF LPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; read2image4lpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR LPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-read2image4lpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imageread2lpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO LPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imageread2lpu['FUNCTION2CALLBACK'] = function2callback4lpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4imageread2lpu-created-by-read2image4lpu to: " + str(task4imageread2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-read2image4lpu to: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
platform2xi = get2platformids4xi() # PLATFORM IS COMMON TO ALL DEVICES I.E TO DEVICE XI
message2print = "{(Step 22B/70) got" + "; platform2xi-got-by-read2image4lpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-read2image4lpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4imageread2lpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2lpu = {}
message2print = "{(Step 23A/70) trying" + "; context2lpu-trying-by-read2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2lpu = get2context4lpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2lpu-got-by-read2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2lpu-failed-by-read2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4imageread2lpu ['CONTEXT'] = context2lpu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2lpu = {}
message2print = "{(Step 24A/70) trying" + "; device2lpu-trying-by-read2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2lpu = get2lpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2lpu-got-by-read2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2lpu-failed-by-read2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4imageread2lpu ['DEVICE'] = device2lpu
if 'IMAGE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2lpu = {}
message2print = "{(Step 25A/70) trying" + "; imageinfo2lpu-trying-by-read2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2lpu = get2imageinfo4lpu()
message2print = "{(Step 25B/70) got" + "; imageinfo2lpu-got-by-read2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; imageinfo2lpu-failed-by-read2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4imageread2lpu ['IMAGE'] = imageinfo2lpu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) QUEUE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
queue2lpu = None
message2print = "{(Step 26A/70) trying" + "; queue2lpu-trying-by-read2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2lpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 26B/70) got" + "; queue2lpu-got-by-read2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; queue2lpu-failed-by-read2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4imageread2lpu ['QUEUE'] = queue2lpu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) PIPE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
pipe2lpu = None
message2print = "{(Step 27A/70) trying" + "; pipe2lpu-trying-by-read2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2lpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 27B/70) got" + "; pipe2lpu-got-by-read2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; pipe2lpu-failed-by-read2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4imageread2lpu ['PIPE'] = pipe2lpu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2lpu = {}
message2print = "{(Step 28A/70) trying" + "; commandqueueinfo2lpu-trying-by-read2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2lpu = get2commandqueueinfo4lpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 28B/70) got" + "; commandqueueinfo2lpu-got-by-read2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; commandqueueinfo2lpu-failed-by-read2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4imageread2lpu ['COMMANDQUEUE'] = commandqueueinfo2lpu
if 'BUFFER' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (29) BUFFER - AUTOMATIC BY LPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2lpu = {}
message2print = "{(Step 29A/70) trying" + "; bufferinfo2lpu-trying-by-read2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2lpu = get2bufferinfo4lpu() # SYSTEM CREATES BUFFER FOR LPU, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; bufferinfo2lpu-got-by-read2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; bufferinfo2lpu-failed-by-read2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4imageread2lpu ['BUFFER'] = bufferinfo2lpu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (30) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2lpu = {}
message2print = "{(Step 30A/70) trying" + "; eventinfo2lpu-trying-by-read2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2lpu = get2eventinfo4lpu()
message2print = "{(Step 30B/70) got" + "; eventinfo2lpu-got-by-read2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '30B-'
except:
message2print = "{(Step 30Z/70) failed" + "; eventinfo2lpu-failed-by-read2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '30Z-'
task4imageread2lpu ['EVENT'] = eventinfo2lpu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2lpu = {}
message2print = "{(Step 31A/70) trying" + "; eventwaitlist2lpu-trying-by-read2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2lpu = {}
message2print = "{(Step 31B/70) set" + "; eventwaitlist2lpu-set-by-read2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventwaitlist2lpu-failed-by-read2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4imageread2lpu ['EVENTWAITLIST'] = eventwaitlist2lpu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2lpu = 0
message2print = "{(Step 32A/70) trying" + "; eventwaitlistquantity2lpu-trying-by-read2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2lpu.keys()
for key2event in keys2event:
eventwaitlistquantity2lpu = eventwaitlistquantity2lpu + 1
message2print = "{(Step 32B/70) set" + "; eventwaitlistquantity2lpu-set-by-read2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlistquantity2lpu-failed-by-read2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4imageread2lpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2lpu
if 'BLOCKING' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2lpu = ' '
message2print = "{(Step 33A/70) trying" + "; blocking2lpu-trying-by-read2image4lpu: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2lpu = 'CL_FALSE' # the read command is non-blocking
message2print = "{(Step 33B/70) set" + "; blocking2lpu-set-by-read2image4lpu to: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; blocking2lpu-failed-by-read2image4lpu: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4imageread2lpu ['BLOCKING'] = blocking2lpu
if 'ORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2lpu = {}
message2print = "{(Step 34A/70) trying" + "; origin2lpu-trying-by-read2image4lpu: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2lpu['X'] = 0
origin2lpu['Y'] = 0
origin2lpu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; origin2lpu-set-by-read2image4lpu to: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; origin2lpu-failed-by-read2image4lpu: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4imageread2lpu ['ORIGIN'] = origin2lpu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (35) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2lpu = {}
message2print = "{(Step 35A/70) trying" + "; region2lpu-trying-by-read2image4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2lpu['X'] = 160 # WIDTH IN PIXELS TO READ
region2lpu['Y'] = 90 # HEIGHT IN PIXELS TO READ
region2lpu['Z'] = 0 # DEPTH IN PIXELS TO READ
message2print = "{(Step 35B/70) set" + "; region2lpu-set-by-read2image4lpu to: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '35B-'
except:
message2print = "{(Step 35Z/70) failed" + "; region2lpu-failed-by-read2image4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '35Z-'
task4imageread2lpu ['REGION'] = region2lpu
if 'ROWPITCH' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (36) ROWPITCH (STRIDE) - REQUIRED
# ---------------------------------------------------------------------------------------------
# One can assume that memory representing an image or screen will have data laid out as one row of pixels followed directly by the next row of pixels.
# However many APIs (e.g. Direct3D) that return a pointer to image data add an extra block of data at the end of each row.
# int offset = x * bytesPerPixel + y * pitch;
# When a video image is stored in memory, the memory buffer might contain extra padding bytes after each row of pixels.
# The padding bytes affect how the image is stored in memory, but do not affect how the image is displayed.
# The stride is the number of bytes from one row of pixels in memory to the next row of pixels in memory.
# Stride is also called pitch.
# If padding bytes are present, the stride is wider than the width of the image, as shown in the following illustration.
rowpitch2lpu = 0
size2element = 1 # VOXEL (X,Y,Z) = SHOT IN PIXELS, R=1 PIXELS
voxelquantity2layer = 1 # MAX NUMBER OF VOXELS IN EACH 2D LAYER
quantity2direction = 1 # ONE DIRECTIONS IN 2D
message2print = "{(Step 36A/70) trying" + "; rowpitch2lpu-trying-by-read2image4lpu: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2lpu = int(width2lpu * size2element * voxelquantity2layer / quantity2direction) # (800 * 8 * 10) / 8 = 8K PIXELS MAX TO SCAN
# SPHERE IS SPARSE HAVING FEW SHOTS PER SCAN LINE
message2print = "{(Step 36B/70) set" + "; rowpitch2lpu-set-by-read2image4lpu to: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; rowpitch2lpu-failed-by-read2image4lpu: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '36Z-'
task4imageread2lpu ['ROWPITCH'] = rowpitch2lpu
if 'POINTER' in keys2task:
pass
else:
# ----------------------------------------------------------------------------------------------------
# (37) POINTER - REQUIRED - THE POINTER TO A BUFFER IN HOST MEMORY WHERE IMAGE DATA IS TO BE READ FROM
# ----------------------------------------------------------------------------------------------------
pointer2lpu = None
size2lpu = int(width2lpu * height2lpu) # CALCULATED MEMORY
if size2lpu == 0:
size2lpu = 4400 # MINIMUM MEMORY
message2print = "{(Step 37A/70) trying" + "; pointer2lpu-trying-by-read2image4lpu: " + str(pointer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
arena2lpu = Arena4Xi(size2lpu) # SYSTEM RESERVER MEMORY FOR IMAGE
message2print = "{(Step 37B/70) got" + "; arena2lpu-got-by-read2image4lpu: " + str(arena2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
size2arena = arena2lpu.size #
message2print = "{(Step 37C/70) got" + "; size2arena-got-by-read2buffer4lpu: " + str(size2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
buffer2arena = arena2lpu.buffer
message2print = "{(Step 37D/70) got" + "; buffer2arena-got-by-read2buffer4lpu: " + str(buffer2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37D-'
if size2arena < size2lpu:
size2lpu = size2arena # AVAILABLE MEMORY FOR IMAGE
message2print = "{(Step 37E/70) set" + "; size2lpu-set-by-read2buffer4lpu to: " + str(size2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37E-'
else:
pass
pointer2lpu = buffer2arena
message2print = "{(Step 37F/70) set" + "; pointer2lpu-set-by-read2buffer4lpu to: " + str(pointer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37F-'
except:
message2print = "{(Step 37Z/70) failed" + "; pointer2lpu-failed-by-read2image4lpu: " + str(pointer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '37Z-'
task4imageread2lpu ['POINTER'] = pointer2lpu
task4imageread2lpu ['SIZE'] = size2lpu # AUTOMATIC BY LPUXI
if 'SLICEPITCH' in keys2task:
pass
else:
# --------------------------------------------------------------------------------------------------------
# (38) SLICEPITCH - REQUIRED - THE SIZE IN BYTES OF THE 2D SLICE OF THE 3D REGION OF A 3D IMAGE BEING READ
# --------------------------------------------------------------------------------------------------------
slicepitch2lpu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 38A/70) trying" + "; slicepitch2lpu-trying-by-read2image4lpu: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2lpu = 0
message2print = "{(Step 38B/70) set" + "; slicepitch2lpu-set-by-read2image4lpu to: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '38B-'
except:
message2print = "{(Step 38Z/70) failed" + "; slicepitch2lpu-failed-by-read2image4lpu: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '38Z-'
task4imageread2lpu ['SLICEPITCH'] = slicepitch2lpu
# ---------------------------------------------------------------------------------------------
# EOF TASK ANALYSIS
# ---------------------------------------------------------------------------------------------
keys2task = task4imageread2lpu.keys()
message2print = "{(Step 39/70) set" + "; keys2task-set-by-read2image4lpu to: " + str(sorted(keys2task)) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ['BLOCKING',
# 'BUFFER',
# 'COMMANDQUEUE',
# 'CONTEXT',
# 'DATA2CALLBACK',
# 'DEVICE',
# 'EVENT',
# 'EVENTWAITLIST',
# 'EVENTWAITLISTQUANTITY',
# 'FUNCTION2CALLBACK',
# 'IMAGE',
# 'ORIGIN',
# 'PIPE',
# 'PLATFORM',
# 'POINTER',
# 'QUEUE',
# 'REGION',
# 'ROWPITCH',
# 'SIZE',
# 'SLICEPITCH']; time: 05:25:42 10/04/11 Pacific Daylight Time}
except:
message2print = "{(Step 39Z/70) yielded" + "; task4imageread2lpu-yielded-by-read2image4lpu: " + str(task4imageread2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '39Z-'
# ---------------------------------------------------------------------------------------------
# CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
control2readimage4lpu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2lpu = False
channels2lpu = ()
message2print = "{(Step 40A/70) trying" + "channels2lpu-trying-by-read2image4lpu: " + str(channels2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# (, )
consumerchannel2lpu, publisherchannel2lpu = task4imageread2lpu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2lpu-got-by-read2image4lpu: " + str(consumerchannel2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2lpu-got-by-read2image4lpu: " + str(publisherchannel2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2lpu = True
control2readimage4lpu['CONSUMERCHANNEL'] = consumerchannel2lpu
control2readimage4lpu['PUBLISHERCHANNEL'] = publisherchannel2lpu
code2ack = code2ack + '40D-'
except:
ack4channels2lpu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2lpu = False
queue2lpu = None
message2print = "{(Step 41A/70) trying" + "; queue2lpu-trying-by-read2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2lpu = task4imageread2lpu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2lpu-got-by-read2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2lpu = True
control2readimage4lpu['QUEUE'] = queue2lpu
code2ack = code2ack + '41C-'
except:
ack4queue2lpu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4lpu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4lpu-trying-by-read2image4lpu: " + str(dummy2image4lpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4lpu = DummyProcess4Xi(target=manoeuvre2readimage4lpu, # in this module to handle queue and pipe channels
# args =(queue2lpu, # caller puts and gets - does NOT call any functions
# consumerchannel2lpu, publisherchannel2lpu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4lpu-created-by-read2image4lpu: " + str(dummy2image4lpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# code2ack = code2ack + '69B-'
# except:
# code2nack = code2nack + '69Z-'
# ---------------------------------------------------------------------------------------------
# RETURN CONTROL AND COMMAND DICTIONARY
# ---------------------------------------------------------------------------------------------
message2print = "{(Step 70A/70) set" + "; code2ack-set-by-read2image4lpu: " + str(code2ack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1B1-1B2-1C-2B-3B-4B-5B-6B-7B-8B-9B-10B-11B-12B-13B-14B-15B-16B-17D-17F-18B-40D-41C-
message2print = "{(Step 70B/70) set" + "; code2nack-set-by-read2image4lpu: " + str(code2nack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70C/70) returning" + "; control2readimage4lpu-returning-by-read2image4lpu: " + str(control2readimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }
return control2readimage4lpu
#
# -------------------------------------------------------------------------------------------------
#copy2mapimage4lpu"
# channel4map2imagepublish4lpu.send(message2send4lpu)
# print("(Step 93B/700) OF LPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4LPU: ", channel4map2imagepublish4lpu, " MESSAGE2SEND4LPU: " , message2send4lpu)
# except:
# print('(Step 93Z1/700) OF LPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4LPU ', time4xi())
#
# # ---------------------------------------------------------------------------------------------------------------------
# # SIMULATE MANOEUVRE2COPYIMAGE4LPU - LET IT TO RECEIVE COPY AND TO SEND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------------------------------
# if ack2simulate4lpu is True:
# print("(Step 94A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4LPU ", time4xi())
# try:
# response2manoeuvre4copy = manoeuvre2mapimage4lpu(queue4map2image4lpu, channel4map2imageconsume4lpu, channel4map2imagepublish4lpu)
# print("(Step 94B/700) OF LPU2IMAGE4XI5TEST - PERFORMED MANOEUVRE2COPYIMAGE4LPU, RESPONSE2MANOEUVRE4COPY: ", response2manoeuvre4copy)
# except:
# print("(Step 94Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4LPU ", time4xi())
# else:
# pass # trust activated thread
#
# # ---------------------------------------------------------------------------------------------
# # RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------
# print('(Step 95A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4LPU ', time4xi())
# try:
# message2receive4lpu = channel4map2imageconsume4lpu.recv()
# print("(Step 95B/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel4map2imageconsume4lpu, " CONTROL & COMMAND: ", message2receive4lpu)
# except:
# print('(Step 95Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4LPU ', time4xi())
#
# # ------------------------------------------------------------------------------------------------------------
# # SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2COPYIMAGE4LPU TO RECEIVE
# # ------------------------------------------------------------------------------------------------------------
# print('(Step 96A/700) OF LPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4LPU ', time4xi())
# try:
# message2send4lpu = "ready2mapimage4lpu"
# channel4map2imagepublish4lpu.send(message2send4lpu)
# print("(Step 96B/700) OF LPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4LPU: ", channel4map2imagepublish4lpu, " MESSAGE2SEND4LPU: " , message2send4lpu)
# except:
# print('(Step 84Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4LPU ', time4xi())
#
# # -------------------------------------------------------------------------------------------------------
# # SIMULATE MANOEUVRE2COPYIMAGE4LPU - LET IT RECEIVE READY AND SEND READY
# # -------------------------------------------------------------------------------------------------------
# if ack2simulate4lpu is True:
# print("(Step 97A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4LPU ", time4xi())
# try:
# response2manoeuvre4copy = manoeuvre2mapimage4lpu(queue4map2image4lpu, channel4map2imageconsume4lpu, channel4map2imagepublish4lpu)
# print("(Step 97B/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGE4LPU ", manoeuvre2copyimage4lpu)
# except:
# print("(Step 97Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4LPU ", time4xi())
# else:
# pass # trust activated thread
#
#
# # ---------------------------------------------------------------------------------------
# # RECEIVE CONTROL & COMMAND READY VIA PIPE
# # ---------------------------------------------------------------------------------------
# print('(Step 98A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4LPU ', time4xi())
# try:
# message2receive4lpu = channel4map2imageconsume4lpu.recv()
# print("(Step 98B/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel4map2imageconsume4lpu, " CONTROL & COMMAND: ", message2receive4lpu)
# except:
# print('(Step 86Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4LPU ', time4xi())
#
# # -----------------------------------------------------------------------------------------
# # IMAGE LPUXI COPY OPERATIONS
# # -----------------------------------------------------------------------------------------
# print('(Step 99A/700) OF LPU2IMAGE4XI5TEST - TRYING FILE OPERATIONS WITH IMAGE LPUXI ', time4xi())
# try:
# path2dragon = '..//..//..//..//..//web//images//png//dragonxi.png'
# file2dragon = open(path2dragon)
# print("(Step 99B/700) OF LPU2IMAGE4XI5TEST - FILENO: ", file2lpu.fileno( ))
# print("(Step 99C/700) OF LPU2IMAGE4XI5TEST - MODE: ", file2lpu.mode)
# print("(Step 99D/700) OF LPU2IMAGE4XI5TEST - NAME: ", file2lpu.name)
# offset2lpu = 10
# file2lpu.seek(offset2lpu)
# print("(Step 99E/700) OF LPU2IMAGE4XI5TEST - PERFORMED SEEK WITH OFFSET: ", offset2lpu)
# file2lpu.close()
# print("(Step 99F/700) OF DRAGON2IMAGE4XI5TEST - CLOSED IMAGE FILE: ", path2dragon)
# except:
# print("(Step 87Z/700) OF DRAGON2IMAGE4XI5TEST *** FAILED TO PERFORM FILE OPERATIONS WITH IMAGE: ", path2dragon)
#
# # -----------------------------------------------------------------------------------------
# # PUT IMAGE PATH TO QUEUE
# # -----------------------------------------------------------------------------------------
# print("(Step 100A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PUT IMAGE PATH TO QUEUE ", time4xi())
# try:
# queue4map2image4dragon.put(path2dragon)
# print("(Step 100B/700) OF DRAGON2IMAGE4XI5TEST - PUT TO QUEUE IMAGE PATH: ", path2dragon)
# except:
# print("(Step 88Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
#
# # -------------------------------------------------------------------------------------------------------------------------------------
# # SIMULATE MANOEUVRE2COPYIMAGE4LPU - STATE III - GETS FROM QUEUE AND SENDS EITHER ACK OR NACK VIA PIPE
# # -------------------------------------------------------------------------------------------------------------------------------------
# if ack2simulate4lpu is True:
# print("(Step 101A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4LPU ", time4xi())
# try:
# response2manoeuvre4copy = manoeuvre2mapimage4lpu(queue4map2image4lpu, channel4map2imageconsume4lpu, channel4map2imagepublish4lpu)
# print("(Step 101B/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGE4LPU ", manoeuvre2copyimage4lpu)
# except:
# print("(Step 101Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4LPU ", time4xi())
# else:
# pass # trust activated thread
#
#
# # ----------------------------------------------------------------------------------------------------
# # RECEIVE ACK OR NACK ABOUT IMAGE OPERATION CONTROL & COMMAND VIA PIPE
# # ----------------------------------------------------------------------------------------------------
# print('(Step 102A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2receive4lpu = channel4map2imageconsume4lpu.recv()
# print("(Step 102B/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel4map2imageconsume4lpu, " CONTROL & COMMAND: ", message2receive4lpu)
# except:
# print('(Step 90Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
#
#
# # ----------------------------------------------------------------------------------------------------------------
# # SIMULATE MANOEUVRE2COPYIMAGE4LPU - LET MANOEUVRE2COPYIMAGE4LPU TO GO TO STATE 0
# # ----------------------------------------------------------------------------------------------------------------
# if ack2simulate4lpu is True:
# print("(Step 103A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4LPU ", time4xi())
# try:
# response2manoeuvre4copy = manoeuvre2mapimage4lpu(queue4map2image4lpu, channel4map2imageconsume4lpu, channel4map2imagepublish4lpu)
# print("(Step 103B/700) OF LPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4LPU ", response2manoeuvre4copy)
# except:
# print("(Step 103Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4LPU ", time4xi())
# else:
# pass # trust activated thread
#
#">
# -------------------------------------------------------------------------------------------------
def map2image4lpu(task4imagemap2lpu=None):
'''
maps 2D images for LPU
'''
global lpu2image4xi # 2D-IMAGES FOR LPU
global control2mapimage4lpu # COMMAND AND CONTROL FOR LPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "map2image4lpu"
method2print = "map2image4lpu"
message2print = "{(Step 1A/33) started" + "; map2image4lpu-started: " + str(map2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4imagemap2lpu-to-map2image4lpu: " + str(task4imagemap2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE LPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if lpu2image4xi is None:
lpu2image4xi = create2image4lpu() # INITIALIZE IMAGE FOR LPU
message2print = "{(Step 1C/70) created" + "; lpu2image4xi-created-by-map2image4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4lpu-skipped-by-map2image4lpu: " + str(map2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
try:
lpu2image4xi = create2image4lpu()
message2print = "{(Step 1E/70) set" + "; lpu2image4xi-set-by-map2image4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
lpu2image4xi = {}
message2print = "{(Step 1Z/70) yielded" + "; lpu2image4xi-yielded-by-map2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - CHECK PARAMETERS
# -----------------------------------------------------------------------------------------
try:
if task4imagemap2lpu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR MAP - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4imagemap2lpu = {}
message2print = "{(Step 1A/70) initialized" + "; task4imagemap2lpu-created-by-map2image4lpu to: " + str(task4imagemap2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4lpu = trace2image4lpu # CALLBACK FUNCTION FOR LPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4lpu-created-by-map2image4lpu to: " + str(function2callback4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "map2image4lpu" # MODULE OF LPUIZED OPENCL MODULE
args2callback['METHOD'] = "map2image4lpu" # FUNCTION OF LPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; map2image4lpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR LPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-map2image4lpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagemap2lpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO LPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagemap2lpu['FUNCTION2CALLBACK'] = function2callback4lpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4imagemap2lpu-created-by-map2image4lpu to: " + str(task4imagemap2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-map2image4lpu to: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
platform2xi = get2platformids4xi() # PLATFORM IS COMMON TO ALL DEVICES I.E TO DEVICE XI
message2print = "{(Step 2B/70) got" + "; platform2xi-got-by-map2image4lpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '2B-'
except:
message2print = "{(Step 2Z/70) failed" + "; platform2xi-failed-by-map2image4lpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4imagemap2lpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2lpu = {}
message2print = "{(Step 3A/70) trying" + "; context2lpu-trying-by-map2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2lpu = get2context4lpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2lpu-got-by-map2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2lpu-failed-by-map2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4imagemap2lpu ['CONTEXT'] = context2lpu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2lpu = {}
message2print = "{(Step 4A/70) trying" + "; device2lpu-trying-by-map2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2lpu = get2lpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2lpu-got-by-map2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2lpu-failed-by-map2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4imagemap2lpu ['DEVICE'] = device2lpu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2lpu = {}
message2print = "{(Step 5A/70) trying" + "; imageinfo2lpu-trying-by-map2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2lpu = get2imageinfo4lpu()
message2print = "{(Step 5B/70) got" + "; imageinfo2lpu-got-by-map2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '5B-'
except:
message2print = "{(Step 5Z/70) failed" + "; imageinfo2lpu-failed-by-map2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4imagemap2lpu ['IMAGE'] = imageinfo2lpu
# ---------------------------------------------------------------------------------------------
# (6) QUEUE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
queue2lpu = None
message2print = "{(Step 6A/70) trying" + "; queue2lpu-trying-by-map2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2lpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 6B/70) got" + "; queue2lpu-got-by-map2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; queue2lpu-failed-by-map2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4imagemap2lpu ['QUEUE'] = queue2lpu
# ---------------------------------------------------------------------------------------------
# (7) PIPE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
pipe2lpu = None
message2print = "{(Step 7A/70) trying" + "; pipe2lpu-trying-by-map2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2lpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 7B/70) got" + "; pipe2lpu-got-by-map2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; pipe2lpu-failed-by-map2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4imagemap2lpu ['PIPE'] = pipe2lpu
# ---------------------------------------------------------------------------------------------
# (8) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2lpu = {}
message2print = "{(Step 8A/70) trying" + "; commandqueueinfo2lpu-trying-by-map2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2lpu = get2commandqueueinfo4lpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 8B/70) got" + "; commandqueueinfo2lpu-got-by-map2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; commandqueueinfo2lpu-failed-by-map2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4imagemap2lpu ['COMMANDQUEUE'] = commandqueueinfo2lpu
# ---------------------------------------------------------------------------------------------
# (9) BUFFER - AUTOMATIC BY LPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2lpu = {}
message2print = "{(Step 9A/70) trying" + "; bufferinfo2lpu-trying-by-map2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2lpu = get2bufferinfo4lpu() # SYSTEM CREATES BUFFER FOR LPU, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; bufferinfo2lpu-got-by-map2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; bufferinfo2lpu-failed-by-map2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4imagemap2lpu ['BUFFER'] = bufferinfo2lpu
# ---------------------------------------------------------------------------------------------
# (10) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2lpu = {}
message2print = "{(Step 10A/70) trying" + "; eventinfo2lpu-trying-by-map2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2lpu = get2eventinfo4lpu()
message2print = "{(Step 10B/70) got" + "; eventinfo2lpu-got-by-map2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '10B-'
except:
message2print = "{(Step 10Z/70) failed" + "; eventinfo2lpu-failed-by-map2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '10Z-'
task4imagemap2lpu ['EVENT'] = eventinfo2lpu
# ---------------------------------------------------------------------------------------------
# (11) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2lpu = {}
message2print = "{(Step 11A/70) trying" + "; eventwaitlist2lpu-trying-by-map2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2lpu = {}
message2print = "{(Step 11B/70) set" + "; eventwaitlist2lpu-set-by-map2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; eventwaitlist2lpu-failed-by-map2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4imagemap2lpu ['EVENTWAITLIST'] = eventwaitlist2lpu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2lpu = 0
message2print = "{(Step 12A/70) trying" + "; eventwaitlistquantity2lpu-trying-by-map2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2lpu.keys()
for key2event in keys2event:
eventwaitlistquantity2lpu = eventwaitlistquantity2lpu + 1
message2print = "{(Step 12B/70) set" + "; eventwaitlistquantity2lpu-set-by-map2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlistquantity2lpu-failed-by-map2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4imagemap2lpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2lpu
# ---------------------------------------------------------------------------------------------
# (13) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2lpu = ' '
message2print = "{(Step 13A/70) trying" + "; blocking2lpu-trying-by-map2image4lpu: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2lpu = 'CL_FALSE' # the map command is non-blocking
message2print = "{(Step 13B/70) set" + "; blocking2lpu-set-by-map2image4lpu to: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; blocking2lpu-failed-by-map2image4lpu: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4imagemap2lpu ['BLOCKING'] = blocking2lpu
# ---------------------------------------------------------------------------------------------
# (14) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2lpu = {}
message2print = "{(Step 14A/70) trying" + "; origin2lpu-trying-by-map2image4lpu: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2lpu['X'] = 0
origin2lpu['Y'] = 0
origin2lpu['Z'] = 0
message2print = "{(Step 14B/70) set" + "; origin2lpu-set-by-map2image4lpu to: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; origin2lpu-failed-by-map2image4lpu: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4imagemap2lpu ['ORIGIN'] = origin2lpu
# ---------------------------------------------------------------------------------------------
# (15) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2lpu = {}
message2print = "{(Step 15A/70) trying" + "; region2lpu-trying-by-map2image4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2lpu['X'] = 160 # WIDTH IN PIXELS TO MAP
region2lpu['Y'] = 90 # HEIGHT IN PIXELS TO MAP
region2lpu['Z'] = 0 # DEPTH IN PIXELS TO MAP
message2print = "{(Step 15B/70) set" + "; region2lpu-set-by-map2image4lpu to: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; region2lpu-failed-by-map2image4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '15Z-'
task4imagemap2lpu ['REGION'] = region2lpu
# ---------------------------------------------------------------------------------------------
# (16) ROWPITCH (STRIDE) - REQUIRED
# ---------------------------------------------------------------------------------------------
# One can assume that memory representing an image or screen will have data laid out as one row of pixels followed directly by the next row of pixels.
# However many APIs (e.g. Direct3D) that return a pointer to image data add an extra block of data at the end of each row.
# int offset = x * bytesPerPixel + y * pitch;
# When a video image is stored in memory, the memory buffer might contain extra padding bytes after each row of pixels.
# The padding bytes affect how the image is stored in memory, but do not affect how the image is displayed.
# The stride is the number of bytes from one row of pixels in memory to the next row of pixels in memory.
# Stride is also called pitch.
# If padding bytes are present, the stride is wider than the width of the image, as shown in the following illustration.
rowpitch2lpu = 0
size2element = 8 # VOXEL (X,Y,Z) = SHOT IN PIXELS, R=1 PIXELS
voxelquantity2layer = 10 # MAX NUMBER OF VOXELS IN EACH 2D LAYER
quantity2direction = 8 # ONE DIRECTIONS IN 2D
width2lpu = 800
message2print = "{(Step 16A/70) trying" + "; rowpitch2lpu-trying-by-map2image4lpu: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2lpu = int(width2lpu * size2element * voxelquantity2layer / quantity2direction) # (800 * 8 * 10) / 8 = 8K PIXELS MAX TO SCAN
# SPHERE IS SPARSE HAVING FEW SHOTS PER SCAN LINE
message2print = "{(Step 16B/70) set" + "; rowpitch2lpu-set-by-map2image4lpu to: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 8000
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; rowpitch2lpu-failed-by-map2image4lpu: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '16Z-'
task4imagemap2lpu ['ROWPITCH'] = rowpitch2lpu
# --------------------------------------------------------------------------------------------------------
# (18) SLICEPITCH - REQUIRED - THE SIZE IN BYTES OF THE 2D SLICE OF THE 3D REGION OF A 3D IMAGE BEING MAP
# --------------------------------------------------------------------------------------------------------
slicepitch2lpu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 18A/70) trying" + "; slicepitch2lpu-trying-by-map2image4lpu: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2lpu = 0
message2print = "{(Step 18B/70) set" + "; slicepitch2lpu-set-by-map2image4lpu to: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '18B-'
except:
message2print = "{(Step 18Z/70) failed" + "; slicepitch2lpu-failed-by-map2image4lpu: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '18Z-'
task4imagemap2lpu ['SLICEPITCH'] = slicepitch2lpu
# ---------------------------------------------------------------------------------------------
# (19) FLAGS - REQUIRED
# ---------------------------------------------------------------------------------------------
flags2lpu = 'CL_MAP_READ'
message2print = "{(Step 19A/70) trying" + "; flags2lpu-trying-by-map2image4lpu: " + str(flags2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
flags2lpu = 'CL_MAP_WRITE' # THE REGION SPECIFIED BY (ORIGIN, REGION) IN THE IMAGE OBJECT IS BEING MAPPED FOR WRITING
message2print = "{(Step 19B/70) set" + "; flags2lpu-set-by-map2image4lpu to: " + str(flags2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '19B-'
except:
message2print = "{(Step 19Z/70) failed" + "; flags2lpu-failed-by-map2image4lpu: " + str(flags2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '19Z-'
task4imagemap2lpu ['FLAGS'] = flags2lpu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
else:
pass
# ---------------------------------------------------------------------------------------------
# ANALYSE TASKS - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4imagemap2lpu.keys()
message2print = "{(Step 20/70) got" + "; keys2task-got-by-map2image4lpu: " + str(sorted(keys2task)) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ['BLOCKING',
# 'BUFFER',
# 'COMMANDQUEUE',
# 'CONTEXT',
# 'DATA2CALLBACK',
# 'DEVICE',
# 'EVENT',
# 'EVENTWAITLIST',
# 'EVENTWAITLISTQUANTITY',
# 'FLAGS',
# 'FUNCTION2CALLBACK',
# 'IMAGE',
# 'ORIGIN',
# 'PIPE',
# 'PLATFORM',
# 'QUEUE',
# 'REGION',
# 'ROWPITCH',
# 'SLICEPITCH']; time: 01:28:44 10/05/11 Pacific Daylight Time}
if (('DATA2CALLBACK' in keys2task) and ('FUNCTION2CALLBACK' in keys2task)):
pass
else:
# ---------------------------------------------------------------------------------------------
# (21B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4lpu = trace2image4lpu # CALLBACK FUNCTION FOR LPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4lpu-created-by-map2image4lpu to: " + str(function2callback4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "map2image4lpu" # MODULE OF LPUIZED OPENCL MODULE
args2callback['METHOD'] = "map2image4lpu" # FUNCTION OF LPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; map2image4lpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR LPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-map2image4lpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagemap2lpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO LPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagemap2lpu['FUNCTION2CALLBACK'] = function2callback4lpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4imagemap2lpu-created-by-map2image4lpu to: " + str(task4imagemap2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-map2image4lpu to: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
platform2xi = get2platformids4xi() # PLATFORM IS COMMON TO ALL DEVICES I.E TO DEVICE XI
message2print = "{(Step 22B/70) got" + "; platform2xi-got-by-map2image4lpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-map2image4lpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4imagemap2lpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2lpu = {}
message2print = "{(Step 23A/70) trying" + "; context2lpu-trying-by-map2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2lpu = get2context4lpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2lpu-got-by-map2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2lpu-failed-by-map2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4imagemap2lpu ['CONTEXT'] = context2lpu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2lpu = {}
message2print = "{(Step 24A/70) trying" + "; device2lpu-trying-by-map2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2lpu = get2lpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2lpu-got-by-map2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2lpu-failed-by-map2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4imagemap2lpu ['DEVICE'] = device2lpu
if 'IMAGE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2lpu = {}
message2print = "{(Step 25A/70) trying" + "; imageinfo2lpu-trying-by-map2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2lpu = get2imageinfo4lpu()
message2print = "{(Step 25B/70) got" + "; imageinfo2lpu-got-by-map2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; imageinfo2lpu-failed-by-map2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4imagemap2lpu ['IMAGE'] = imageinfo2lpu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) QUEUE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
queue2lpu = None
message2print = "{(Step 26A/70) trying" + "; queue2lpu-trying-by-map2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2lpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 26B/70) got" + "; queue2lpu-got-by-map2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; queue2lpu-failed-by-map2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4imagemap2lpu ['QUEUE'] = queue2lpu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) PIPE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
pipe2lpu = None
message2print = "{(Step 27A/70) trying" + "; pipe2lpu-trying-by-map2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2lpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 27B/70) got" + "; pipe2lpu-got-by-map2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; pipe2lpu-failed-by-map2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4imagemap2lpu ['PIPE'] = pipe2lpu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2lpu = {}
message2print = "{(Step 28A/70) trying" + "; commandqueueinfo2lpu-trying-by-map2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2lpu = get2commandqueueinfo4lpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 28B/70) got" + "; commandqueueinfo2lpu-got-by-map2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; commandqueueinfo2lpu-failed-by-map2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4imagemap2lpu ['COMMANDQUEUE'] = commandqueueinfo2lpu
if 'BUFFER' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (29) BUFFER - AUTOMATIC BY LPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2lpu = {}
message2print = "{(Step 29A/70) trying" + "; bufferinfo2lpu-trying-by-map2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2lpu = get2bufferinfo4lpu() # SYSTEM CREATES BUFFER FOR LPU, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; bufferinfo2lpu-got-by-map2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; bufferinfo2lpu-failed-by-map2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4imagemap2lpu ['BUFFER'] = bufferinfo2lpu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (30) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2lpu = {}
message2print = "{(Step 30A/70) trying" + "; eventinfo2lpu-trying-by-map2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2lpu = get2eventinfo4lpu()
message2print = "{(Step 30B/70) got" + "; eventinfo2lpu-got-by-map2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '30B-'
except:
message2print = "{(Step 30Z/70) failed" + "; eventinfo2lpu-failed-by-map2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '30Z-'
task4imagemap2lpu ['EVENT'] = eventinfo2lpu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2lpu = {}
message2print = "{(Step 31A/70) trying" + "; eventwaitlist2lpu-trying-by-map2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2lpu = {}
message2print = "{(Step 31B/70) set" + "; eventwaitlist2lpu-set-by-map2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventwaitlist2lpu-failed-by-map2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4imagemap2lpu ['EVENTWAITLIST'] = eventwaitlist2lpu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2lpu = 0
message2print = "{(Step 32A/70) trying" + "; eventwaitlistquantity2lpu-trying-by-map2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2lpu.keys()
for key2event in keys2event:
eventwaitlistquantity2lpu = eventwaitlistquantity2lpu + 1
message2print = "{(Step 32B/70) set" + "; eventwaitlistquantity2lpu-set-by-map2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlistquantity2lpu-failed-by-map2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4imagemap2lpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2lpu
if 'BLOCKING' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2lpu = ' '
message2print = "{(Step 33A/70) trying" + "; blocking2lpu-trying-by-map2image4lpu: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2lpu = 'CL_FALSE' # the map command is non-blocking
message2print = "{(Step 33B/70) set" + "; blocking2lpu-set-by-map2image4lpu to: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; blocking2lpu-failed-by-map2image4lpu: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4imagemap2lpu ['BLOCKING'] = blocking2lpu
if 'ORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2lpu = {}
message2print = "{(Step 34A/70) trying" + "; origin2lpu-trying-by-map2image4lpu: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2lpu['X'] = 0
origin2lpu['Y'] = 0
origin2lpu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; origin2lpu-set-by-map2image4lpu to: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; origin2lpu-failed-by-map2image4lpu: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4imagemap2lpu ['ORIGIN'] = origin2lpu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (35) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2lpu = {}
message2print = "{(Step 35A/70) trying" + "; region2lpu-trying-by-map2image4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2lpu['X'] = 160 # WIDTH IN PIXELS TO MAP
region2lpu['Y'] = 90 # HEIGHT IN PIXELS TO MAP
region2lpu['Z'] = 0 # DEPTH IN PIXELS TO MAP
message2print = "{(Step 35B/70) set" + "; region2lpu-set-by-map2image4lpu to: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '35B-'
except:
message2print = "{(Step 35Z/70) failed" + "; region2lpu-failed-by-map2image4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '35Z-'
task4imagemap2lpu ['REGION'] = region2lpu
if 'ROWPITCH' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (36) ROWPITCH (STRIDE) - REQUIRED
# ---------------------------------------------------------------------------------------------
# One can assume that memory representing an image or screen will have data laid out as one row of pixels followed directly by the next row of pixels.
# However many APIs (e.g. Direct3D) that return a pointer to image data add an extra block of data at the end of each row.
# int offset = x * bytesPerPixel + y * pitch;
# When a video image is stored in memory, the memory buffer might contain extra padding bytes after each row of pixels.
# The padding bytes affect how the image is stored in memory, but do not affect how the image is displayed.
# The stride is the number of bytes from one row of pixels in memory to the next row of pixels in memory.
# Stride is also called pitch.
# If padding bytes are present, the stride is wider than the width of the image, as shown in the following illustration.
rowpitch2lpu = 0
size2element = 1 # VOXEL (X,Y,Z) = SHOT IN PIXELS, R=1 PIXELS
voxelquantity2layer = 1 # MAX NUMBER OF VOXELS IN EACH 2D LAYER
quantity2direction = 1 # ONE DIRECTIONS IN 2D
message2print = "{(Step 36A/70) trying" + "; rowpitch2lpu-trying-by-map2image4lpu: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2lpu = int(width2lpu * size2element * voxelquantity2layer / quantity2direction) # (800 * 8 * 10) / 8 = 8K PIXELS MAX TO SCAN
# SPHERE IS SPARSE HAVING FEW SHOTS PER SCAN LINE
message2print = "{(Step 36B/70) set" + "; rowpitch2lpu-set-by-map2image4lpu to: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; rowpitch2lpu-failed-by-map2image4lpu: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '36Z-'
task4imagemap2lpu ['ROWPITCH'] = rowpitch2lpu
if 'SLICEPITCH' in keys2task:
pass
else:
# --------------------------------------------------------------------------------------------------------
# (38) SLICEPITCH - REQUIRED - THE SIZE IN BYTES OF THE 2D SLICE OF THE 3D REGION OF A 3D IMAGE BEING MAP
# --------------------------------------------------------------------------------------------------------
slicepitch2lpu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 38A/70) trying" + "; slicepitch2lpu-trying-by-map2image4lpu: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2lpu = 0
message2print = "{(Step 38B/70) set" + "; slicepitch2lpu-set-by-map2image4lpu to: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '38B-'
except:
message2print = "{(Step 38Z/70) failed" + "; slicepitch2lpu-failed-by-map2image4lpu: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '38Z-'
task4imagemap2lpu ['SLICEPITCH'] = slicepitch2lpu
if 'FLAGS' in keys2task:
pass
else:
# --------------------------------------------------------------------------------------------------------
# (39) FLAGS - REQUIRED
# --------------------------------------------------------------------------------------------------------
flags2lpu = 'CL_MAP_READ'
message2print = "{(Step 39A/70) trying" + "; flags2lpu-trying-by-map2image4lpu: " + str(flags2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
flags2lpu = 'CL_MAP_WRITE'
message2print = "{(Step 39B/70) set" + "; flags2lpu-set-by-map2image4lpu to: " + str(flags2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '39B-'
except:
message2print = "{(Step 39Z/70) failed" + "; flags2lpu-failed-by-map2image4lpu: " + str(flags2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '39Z-'
task4imagemap2lpu ['FLAGS'] = flags2lpu
# ---------------------------------------------------------------------------------------------
# EOF TASK ANALYSIS
# ---------------------------------------------------------------------------------------------
keys2task = task4imagemap2lpu.keys()
message2print = "{(Step 40A/70) set" + "; keys2task-set-by-map2image4lpu to: " + str(sorted(keys2task)) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ['BLOCKING',
# 'BUFFER',
# 'COMMANDQUEUE',
# 'CONTEXT',
# 'DATA2CALLBACK',
# 'DEVICE',
# 'EVENT',
# 'EVENTWAITLIST',
# 'EVENTWAITLISTQUANTITY',
# 'FLAGS',
# 'FUNCTION2CALLBACK',
# 'IMAGE',
# 'ORIGIN',
# 'PIPE',
# 'PLATFORM',
# 'QUEUE',
# 'REGION',
# 'ROWPITCH',
# 'SLICEPITCH']; time: 01:28:44 10/05/11 Pacific Daylight Time}
except:
message2print = "{(Step 40Z/70) yielded" + "; task4imagemap2lpu-yielded-by-map2image4lpu: " + str(task4imagemap2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
control2mapimage4lpu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2lpu = False
channels2lpu = ()
message2print = "{(Step 40A/70) trying" + "channels2lpu-trying-by-map2image4lpu: " + str(channels2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
#
consumerchannel2lpu, publisherchannel2lpu = task4imagemap2lpu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2lpu-got-by-map2image4lpu: " + str(consumerchannel2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2lpu-got-by-map2image4lpu: " + str(publisherchannel2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2lpu = True
control2mapimage4lpu['CONSUMERCHANNEL'] = consumerchannel2lpu
control2mapimage4lpu['PUBLISHERCHANNEL'] = publisherchannel2lpu
code2ack = code2ack + '40D-'
except:
ack4channels2lpu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2lpu = False
queue2lpu = None
message2print = "{(Step 41A/70) trying" + "queue2lpu-trying-by-map2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2lpu = task4imagemap2lpu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2lpu-got-by-map2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2lpu = True
control2mapimage4lpu['QUEUE'] = queue2lpu
code2ack = code2ack + '41C-'
except:
ack4queue2lpu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4lpu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4lpu-trying-by-map2image4lpu: " + str(dummy2image4lpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4lpu = DummyProcess4Xi(target=manoeuvre2mapimage4lpu, # in this module to handle queue and pipe channels
# args =(queue2lpu, # caller puts and gets - does NOT call any functions
# consumerchannel2lpu, publisherchannel2lpu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4lpu-created-by-map2image4lpu: " + str(dummy2image4lpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# code2ack = code2ack + '69B-'
# except:
# code2nack = code2nack + '69Z-'
# ---------------------------------------------------------------------------------------------
# RETURN CONTROL AND COMMAND DICTIONARY
# ---------------------------------------------------------------------------------------------
message2print = "{(Step 70A/70) set" + "; code2ack-set-by-map2image4lpu: " + str(code2ack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70B/70) set" + "; code2nack-set-by-map2image4lpu: " + str(code2nack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1B1-1B2-1C-2B-3B-4B-5B-6B-7B-8B-9B-10B-11B-12B-13B-14B-15B-16B-18B-19B-40D-41C-
message2print = "{(Step 70C/70) returning" + "; control2mapimage4lpu-returning-by-map2image4lpu: " + str(control2mapimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return control2mapimage4lpu
#
# -----------------------------------------------------------------------------------------------------------------------
#roger2copy4lpu', 'ACK2INFO4LPU': False, 'MESSAGE2GET4LPU': 'default2copy4lpu',
# # 'MESSAGE2RECEIVE4LPU': 'copy2copy4lpu',
# 'CODE2ACK4LPU': ' 0D-1C-', 'MESSAGE2PUT4LPU': 'default2copy4lpu', 'CODE2NACK4LPU': ' ', 'STATE2MANOEUVRE4LPU': 1}
# except:
# print("(Step 42Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4LPU ", time4xi())
# else:
# pass # trust activated thread
#">
# -----------------------------------------------------------------------------------------------------------------------
def manoeuvre2copyimage4lpu(queue2copymanoeuvre4lpu, consumerchannel2copymanoeuvre4lpu, publisherchannel2copymanoeuvre4lpu):
'''
manoeuvres copy control and command
'''
global state2copyimage4lpu # STATE FOR COMMAND AND CONTROL
global max2copyimagestate4lpu # MAX FOR STATE
global ack2copyimageinfo4lpu # ACK FOR IMAGE INFO
global message2copyimageget4lpu
global message2copyimageput4lpu
global message2copyimagereceive4lpu
global message2copyimagesend4lpu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2copyimage4lpu"
method2print = "manoeuvre2copyimage4lpu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2copyimage4lpu-started: " + str(manoeuvre2copyimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 0B/33) passed" + "; queue2copymanoeuvre4lpu-to-manoeuvre2copyimage4lpu: " + str(queue2copymanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2copymanoeuvre4lpu-to-manoeuvre2copyimage4lpu: " + str(consumerchannel2copymanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0D/33) passed" + "; publisherchannel2copymanoeuvre4lpu-to-manoeuvre2copyimage4lpu: " + str(publisherchannel2copymanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4copy = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2copyimage4lpu-try-by-manoeuvre2copyimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2copyimage4lpu is None:
state2copyimage4lpu = 0
message2print = "{(Step 0F/33) initialized" + "; state2copyimage4lpu-initialized-by-manoeuvre2copyimage4lpu to: " + str(state2copyimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2copyimage4lpu-used-by-manoeuvre2copyimage4lpu: " + str(state2copyimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2copyimage4lpu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2copyimage4lpu-initialized-by-manoeuvre2copyimage4lpu to: " + str(state2copyimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2copyimageinfo4lpu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2copyimageinfo4lpu-initialized-by-manoeuvre2copyimage4lpu to: " + str(ack2copyimageinfo4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2copyimageget4lpu = 'default2copy4lpu'
message2print = "{(Step 0Z3/33) initialized" + "; message2copyimageget4lpu-initialized-by-manoeuvre2copyimage4lpu to: " + str(message2copyimageget4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4lpu
message2copyimageput4lpu = 'default2copy4lpu'
message2print = "{(Step 0Z4/33) initialized" + "; message2copyimageput4lpu-initialized-by-manoeuvre2copyimage4lpu to: " + str(message2copyimageput4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4lpu
message2copyimagereceive4lpu = 'default2copy4lpu'
message2print = "{(Step 0Z5/33) initialized" + "; message2copyimagereceive4lpu-initialized-by-manoeuvre2copyimage4lpu to: " + str(message2copyimagereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4lpu
message2copyimagesend4lpu = 'default2copy4lpu'
message2print = "{(Step 0Z6/33) initialized" + "; message2copyimagesend4lpu-initialized-by-manoeuvre2copyimage4lpu to: " + str(message2copyimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4lpu
max2copyimagestate4lpu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2copyimagestate4lpu-initialized-by-manoeuvre2copyimage4lpu to: " + str( max2copyimagestate4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2copyimage4lpu = state2copyimage4lpu + 1
message2print = "{(Step 0H/33) added" + "; state2copyimage4lpu-added-by-manoeuvre2copyimage4lpu: " + str(state2copyimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2copyimage4lpu > max2copyimagestate4lpu:
state2copyimage4lpu = 0
message2print = "{(Step 0I/33) set" + "; state2copyimage4lpu-set-by-manoeuvre2copyimage4lpu to: " + str(state2copyimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2copyimageinfo4lpu = False
message2print = "{(Step 0J/33) set" + "; ack2copyimageinfo4lpu-set-by-manoeuvre2copyimage4lpu to: " + str(ack2copyimageinfo4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2copyimageget4lpu = 'default2copy4lpu'
message2print = "{(Step 0K/33) set" + "; message2copyimageget4lpu-set-by-manoeuvre2copyimage4lpu to: " + str(message2copyimageget4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4lpu
message2copyimageput4lpu = 'default2copy4lpu'
message2print = "{(Step 0L/33) set" + "; message2copyimageput4lpu-set-by-manoeuvre2copyimage4lpu to: " + str(message2copyimageput4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4lpu
message2copyimagereceive4lpu = 'default2copy4lpu'
message2print = "{(Step 0M/33) set" + "; message2copyimagereceive4lpu-set-by-manoeuvre2copyimage4lpu to: " + str(message2copyimagereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4lpu
message2copyimagesend4lpu = 'default2copy4lpu'
message2print = "{(Step 0N/33) set" + "; message2copyimagesend4lpu-set-by-manoeuvre2copyimage4lpu to: " + str(message2copyimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4lpu
max2copyimagestate4lpu = 3
message2print = "{(Step 0O/33) initialized" + "; max2copyimagestate4lpu-set-by-manoeuvre2copyimage4lpu to: " + str( max2copyimagestate4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2copyimage4lpu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2copyimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copyimagereceive4lpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copyimagereceive4lpu = consumerchannel2copymanoeuvre4lpu.recv()
message2print = "{(Step 1B/33) received" + "; message2copyimagereceive4lpu-received-by-manoeuvre2copyimage4lpu: " + str(message2copyimagereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# copy2copy4lpu
if message2copyimagereceive4lpu == 'copy2copy4lpu':
message2copyimagesend4lpu = 'roger2copy4lpu'
else:
message2copyimagesend4lpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copymanoeuvre4lpu.send(message2copyimagesend4lpu)
message2print = "{(Step 1C/33) sent" + "; message2copyimagesend4lpu-sent-by-manoeuvre2copyimage4lpu: " + str(message2copyimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# roger2copy4lpu
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2copyimagereceive4lpu-failed-by-manoeuvre2copyimage4lpu: " + str(message2copyimagereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# STATE II - RECEIVE CONTROL AND COMMAND READY MESSAGE VIA PIPE AND SEND READY OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2copyimage4lpu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2copyimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copyimagereceive4lpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copyimagereceive4lpu = consumerchannel2copymanoeuvre4lpu.recv()
message2print = "{(Step 2B/33) received" + "; message2copyimagereceive4lpu-received-by-manoeuvre2copyimage4lpu: " + str(message2copyimagereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ready2copy4lpu
if message2copyimagereceive4lpu == 'ready2copy4lpu':
message2copyimagesend4lpu = 'ready2copy4lpu'
else:
message2copyimagesend4lpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND READY OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copymanoeuvre4lpu.send(message2copyimagesend4lpu)
message2print = "{(Step 2C/33) sent" + "; message2copyimagesend4lpu-sent-by-manoeuvre2copyimage4lpu: " + str(message2copyimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2copyimagereceive4lpu-failed-by-manoeuvre2copyimage4lpu: " + str(message2copyimagereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# STATE III - GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE AND SEND ACK OR NACK VIA PIPE
# ------------------------------------------------------------------------------------------------------------------------
if state2copyimage4lpu == 3:
info2image4lpu = None
message2print = "{(Step 3A/70) try" + "; info2image4lpu-try-by-manoeuvre2copyimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4lpu = queue2copymanoeuvre4lpu.get()
message2print = "{(Step 3B/33) got" + "; info2image4lpu-got-by-manoeuvre2copyimage4lpu: " + str(info2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ..//..//..//..//..//web//images//png//dragonxi.png
if info2image4lpu is None:
code2nack = code2nack + '3Z1-'
ack2copyimageinfo4lpu = False
else:
code2ack = code2ack + '3C-'
ack2copyimageinfo4lpu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2copymanoeuvre4lpu-failed-by-manoeuvre2copyimage4lpu: " + str(queue2copymanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2copyimagesend4lpu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2copyimageinfo4lpu is True:
message2copyimagesend4lpu = 'ack2imageinfo4lpu'
else:
message2copyimagesend4lpu = 'nack2imageinfo4lpu'
message2print = "{(Step 4B/33) set" + "; message2copyimagesend4lpu-set-by-manoeuvre2copyimage4lpu to: " + str(message2copyimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4lpu
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copyimagesend4lpu-failed-by-manoeuvre2copyimage4lpu: " + str(message2copyimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2copymanoeuvre4lpu-calling-by-manoeuvre2copyimage4lpu: " + str(publisherchannel2copymanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2copyimagesend4lpu-passing-to-send-by-manoeuvre2copyimage4lpu: " + str(message2copyimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copyimagesend4lpu-failed-by-manoeuvre2copyimage4lpu: " + str(message2copyimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2copymanoeuvre4lpu.send(message2copyimagesend4lpu)
message2print = "{(Step 4E/33) sent" + "; message2copyimagesend4lpu-sent-by-manoeuvre2copyimage4lpu: " + str(message2copyimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4lpu
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2copyimagesend4lpu-failed-by-manoeuvre2copyimage4lpu: " + str(message2copyimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4copy['ACK2INFO4LPU'] = ack2copyimageinfo4lpu
response2manouvre4copy['CODE2ACK4LPU'] = code2ack
response2manouvre4copy['CODE2NACK4LPU'] = code2nack
response2manouvre4copy['MESSAGE2GET4LPU'] = message2copyimageget4lpu
response2manouvre4copy['MESSAGE2PUT4LPU'] = message2copyimageput4lpu
response2manouvre4copy['MESSAGE2RECEIVE4LPU'] = message2copyimagereceive4lpu
response2manouvre4copy['MESSAGE2SEND4LPU'] = message2copyimagesend4lpu
response2manouvre4copy['STATE2MANOEUVRE4LPU'] = state2copyimage4lpu
message2print = "{(Step 33/33) returning" + "; response2manouvre4copy-returning-by-manoeuvre2copyimage4lpu: " + str(response2manouvre4copy) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1 {'MESSAGE2SEND4LPU': 'roger2copy4lpu',
# 'ACK2INFO4LPU': False,
# 'MESSAGE2GET4LPU': 'default2copy4lpu',
# 'MESSAGE2RECEIVE4LPU': 'copy2copy4lpu',
# 'CODE2ACK4LPU': ' 0D-1C-',
# 'MESSAGE2PUT4LPU': 'default2copy4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 1}; time: 05:25:15 10/03/11 Pacific Daylight Time}
#2 {'MESSAGE2SEND4LPU': 'ready2copy4lpu',
# 'ACK2INFO4LPU': False,
# 'MESSAGE2GET4LPU': 'default2copy4lpu',
# 'MESSAGE2RECEIVE4LPU': 'ready2copy4lpu',
# 'CODE2ACK4LPU': ' 0D-2C-',
# 'MESSAGE2PUT4LPU': 'default2copy4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 2}; time: 05:25:15 10/03/11 Pacific Daylight Time}
#3 {'MESSAGE2SEND4LPU': 'ack2imageinfo4lpu',
# 'ACK2INFO4LPU': True,
# 'MESSAGE2GET4LPU': 'default2copy4lpu',
# 'MESSAGE2RECEIVE4LPU': 'ready2copy4lpu',
# 'CODE2ACK4LPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4LPU': 'default2copy4lpu',
# 'CODE2NACK4LPU': ' ', 'STATE2MANOEUVRE4LPU': 3}; time: 05:25:15 10/03/11 Pacific Daylight Time}
#4 {'MESSAGE2SEND4LPU': 'default2copy4lpu',
# 'ACK2INFO4LPU': False,
# 'MESSAGE2GET4LPU': 'default2copy4lpu',
# 'MESSAGE2RECEIVE4LPU': 'default2copy4lpu',
# 'CODE2ACK4LPU': ' 0D-',
# 'MESSAGE2PUT4LPU': 'default2copy4lpu',
# 'CODE2NACK4LPU': ' ', 'STATE2MANOEUVRE4LPU': 0}; time: 05:25:15 10/03/11 Pacific Daylight Time}
return response2manouvre4copy
#
# -----------------------------------------------------------------------------------------------------------------------
#roger2copyimagetobuffer4lpu',
# # 'ACK2INFO4LPU': False,
# # 'MESSAGE2GET4LPU': 'default2copyimagetobuffer4lpu',
# # 'MESSAGE2RECEIVE4LPU': 'copy2copyimagetobuffer4lpu',
# # 'CODE2ACK4LPU': ' 0D-1C-',
# # 'MESSAGE2PUT4LPU': 'default2copyimagetobuffer4lpu',
# # 'CODE2NACK4LPU': ' ',
# # 'STATE2MANOEUVRE4LPU': 1}
# except:
# print("(Step 62Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4LPU ", time4xi())
# else:
# pass # trust activated thread
#">
# -----------------------------------------------------------------------------------------------------------------------
def manoeuvre2copyimagetobuffer4lpu(queue2copyimagetobuffermanoeuvre4lpu, consumerchannel2copyimagetobuffermanoeuvre4lpu, publisherchannel2copyimagetobuffermanoeuvre4lpu):
'''
manoeuvres copy control and command for copy2imagetobuffer4lpu
'''
global state2copyimagetobuffer4lpu # STATE FOR COMMAND AND CONTROL
global max2copyimagetobufferstate4lpu # MAX FOR STATE
global ack2copyimagetobufferinfo4lpu # ACK FOR IMAGE INFO
global message2copyimagetobufferget4lpu
global message2copyimagetobufferput4lpu
global message2copyimagetobufferreceive4lpu
global message2copyimagetobuffersend4lpu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2copyimagetobuffer4lpu"
method2print = "manoeuvre2copyimagetobuffer4lpu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2copyimagetobuffer4lpu-started: " + str(manoeuvre2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 0B/33) passed" + "; queue2copyimagetobuffermanoeuvre4lpu-to-manoeuvre2copyimagetobuffer4lpu: " + str(queue2copyimagetobuffermanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2copyimagetobuffermanoeuvre4lpu-to-manoeuvre2copyimagetobuffer4lpu: " + str(consumerchannel2copyimagetobuffermanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0D/33) passed" + "; publisherchannel2copyimagetobuffermanoeuvre4lpu-to-manoeuvre2copyimagetobuffer4lpu: " + str(publisherchannel2copyimagetobuffermanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4copyimagetobuffer = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2copyimagetobuffer4lpu-try-by-manoeuvre2copyimagetobuffer4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2copyimagetobuffer4lpu is None:
state2copyimagetobuffer4lpu = 0
message2print = "{(Step 0F/33) initialized" + "; state2copyimagetobuffer4lpu-initialized-by-manoeuvre2copyimagetobuffer4lpu to: " + str(state2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2copyimagetobuffer4lpu-used-by-manoeuvre2copyimagetobuffer4lpu: " + str(state2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2copyimagetobuffer4lpu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2copyimagetobuffer4lpu-initialized-by-manoeuvre2copyimagetobuffer4lpu to: " + str(state2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2copyimagetobufferinfo4lpu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2copyimagetobufferinfo4lpu-initialized-by-manoeuvre2copyimagetobuffer4lpu to: " + str(ack2copyimagetobufferinfo4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2copyimagetobufferget4lpu = 'default2copyimagetobuffer4lpu'
message2print = "{(Step 0Z3/33) initialized" + "; message2copyimagetobufferget4lpu-initialized-by-manoeuvre2copyimagetobuffer4lpu to: " + str(message2copyimagetobufferget4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobufferput4lpu = 'default2copyimagetobuffer4lpu'
message2print = "{(Step 0Z4/33) initialized" + "; message2copyimagetobufferput4lpu-initialized-by-manoeuvre2copyimagetobuffer4lpu to: " + str(message2copyimagetobufferput4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobufferreceive4lpu = 'default2copyimagetobuffer4lpu'
message2print = "{(Step 0Z5/33) initialized" + "; message2copyimagetobufferreceive4lpu-initialized-by-manoeuvre2copyimagetobuffer4lpu to: " + str(message2copyimagetobufferreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobuffersend4lpu = 'default2copyimagetobuffer4lpu'
message2print = "{(Step 0Z6/33) initialized" + "; message2copyimagetobuffersend4lpu-initialized-by-manoeuvre2copyimagetobuffer4lpu to: " + str(message2copyimagetobuffersend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
max2copyimagetobufferstate4lpu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2copyimagetobufferstate4lpu-initialized-by-manoeuvre2copyimagetobuffer4lpu to: " + str( max2copyimagetobufferstate4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2copyimagetobuffer4lpu = state2copyimagetobuffer4lpu + 1
message2print = "{(Step 0H/33) added" + "; state2copyimagetobuffer4lpu-added-by-manoeuvre2copyimagetobuffer4lpu: " + str(state2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2copyimagetobuffer4lpu > max2copyimagetobufferstate4lpu:
state2copyimagetobuffer4lpu = 0
message2print = "{(Step 0I/33) set" + "; state2copyimagetobuffer4lpu-set-by-manoeuvre2copyimagetobuffer4lpu to: " + str(state2copyimagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack2copyimagetobufferinfo4lpu = False
message2print = "{(Step 0J/33) set" + "; ack2copyimagetobufferinfo4lpu-set-by-manoeuvre2copyimagetobuffer4lpu to: " + str(ack2copyimagetobufferinfo4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobufferget4lpu = 'default2copyimagetobuffer4lpu'
message2print = "{(Step 0K/33) set" + "; message2copyimagetobufferget4lpu-set-by-manoeuvre2copyimagetobuffer4lpu to: " + str(message2copyimagetobufferget4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobufferput4lpu = 'default2copyimagetobuffer4lpu'
message2print = "{(Step 0L/33) set" + "; message2copyimagetobufferput4lpu-set-by-manoeuvre2copyimagetobuffer4lpu to: " + str(message2copyimagetobufferput4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobufferreceive4lpu = 'default2copyimagetobuffer4lpu'
message2print = "{(Step 0M/33) set" + "; message2copyimagetobufferreceive4lpu-set-by-manoeuvre2copyimagetobuffer4lpu to: " + str(message2copyimagetobufferreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobuffersend4lpu = 'default2copyimagetobuffer4lpu'
message2print = "{(Step 0N/33) set" + "; message2copyimagetobuffersend4lpu-set-by-manoeuvre2copyimagetobuffer4lpu to: " + str(message2copyimagetobuffersend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
max2copyimagetobufferstate4lpu = 3
message2print = "{(Step 0O/33) initialized" + "; max2copyimagetobufferstate4lpu-set-by-manoeuvre2copyimagetobuffer4lpu to: " + str( max2copyimagetobufferstate4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2copyimagetobuffer4lpu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2copyimagetobuffer4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copyimagetobufferreceive4lpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copyimagetobufferreceive4lpu = consumerchannel2copyimagetobuffermanoeuvre4lpu.recv()
message2print = "{(Step 1B/33) received" + "; message2copyimagetobufferreceive4lpu-received-by-manoeuvre2copyimagetobuffer4lpu: " + str(message2copyimagetobufferreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2copyimagetobufferreceive4lpu == 'copy2copyimagetobuffer4lpu':
message2copyimagetobuffersend4lpu = 'roger2copyimagetobuffer4lpu'
else:
message2copyimagetobuffersend4lpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copyimagetobuffermanoeuvre4lpu.send(message2copyimagetobuffersend4lpu)
message2print = "{(Step 1C/33) sent" + "; message2copyimagetobuffersend4lpu-sent-by-manoeuvre2copyimagetobuffer4lpu: " + str(message2copyimagetobuffersend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2copyimagetobufferreceive4lpu-failed-by-manoeuvre2copyimagetobuffer4lpu: " + str(message2copyimagetobufferreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# STATE II - RECEIVE CONTROL AND COMMAND READY MESSAGE VIA PIPE AND SEND READY OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2copyimagetobuffer4lpu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2copyimagetobuffer4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copyimagetobufferreceive4lpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copyimagetobufferreceive4lpu = consumerchannel2copyimagetobuffermanoeuvre4lpu.recv()
message2print = "{(Step 2B/33) received" + "; message2copyimagetobufferreceive4lpu-received-by-manoeuvre2copyimagetobuffer4lpu: " + str(message2copyimagetobufferreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2copyimagetobufferreceive4lpu == 'ready2copyimagetobuffer4lpu':
message2copyimagetobuffersend4lpu = 'ready2copyimagetobuffer4lpu'
else:
message2copyimagetobuffersend4lpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND READY OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copyimagetobuffermanoeuvre4lpu.send(message2copyimagetobuffersend4lpu)
message2print = "{(Step 2C/33) sent" + "; message2copyimagetobuffersend4lpu-sent-by-manoeuvre2copyimagetobuffer4lpu: " + str(message2copyimagetobuffersend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2copyimagetobufferreceive4lpu-failed-by-manoeuvre2copyimagetobuffer4lpu: " + str(message2copyimagetobufferreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# STATE III - GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE AND SEND ACK OR NACK VIA PIPE
# ------------------------------------------------------------------------------------------------------------------------
if state2copyimagetobuffer4lpu == 3:
info2image4lpu = None
message2print = "{(Step 3A/70) try" + "; info2image4lpu-try-by-manoeuvre2copyimagetobuffer4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4lpu = queue2copyimagetobuffermanoeuvre4lpu.get()
message2print = "{(Step 3B/33) got" + "; info2image4lpu-got-by-manoeuvre2copyimagetobuffer4lpu: " + str(info2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ..//..//..//..//..//web//images//png//dragonxi.png
if info2image4lpu is None:
code2nack = code2nack + '3Z1-'
ack2copyimagetobufferinfo4lpu = False
else:
code2ack = code2ack + '3C-'
ack2copyimagetobufferinfo4lpu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2copyimagetobuffermanoeuvre4lpu-failed-by-manoeuvre2copyimagetobuffer4lpu: " + str(queue2copyimagetobuffermanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2copyimagetobuffersend4lpu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2copyimagetobufferinfo4lpu is True:
message2copyimagetobuffersend4lpu = 'ack2imageinfo4lpu'
else:
message2copyimagetobuffersend4lpu = 'nack2imageinfo4lpu'
message2print = "{(Step 4B/33) set" + "; message2copyimagetobuffersend4lpu-set-by-manoeuvre2copyimagetobuffer4lpu to: " + str(message2copyimagetobuffersend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4lpu
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copyimagetobuffersend4lpu-failed-by-manoeuvre2copyimagetobuffer4lpu: " + str(message2copyimagetobuffersend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2copyimagetobuffermanoeuvre4lpu-calling-by-manoeuvre2copyimagetobuffer4lpu: " + str(publisherchannel2copyimagetobuffermanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2copyimagetobuffersend4lpu-passing-to-send-by-manoeuvre2copyimagetobuffer4lpu: " + str(message2copyimagetobuffersend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copyimagetobuffersend4lpu-failed-by-manoeuvre2copyimagetobuffer4lpu: " + str(message2copyimagetobuffersend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2copyimagetobuffermanoeuvre4lpu.send(message2copyimagetobuffersend4lpu)
message2print = "{(Step 4E/33) sent" + "; message2copyimagetobuffersend4lpu-sent-by-manoeuvre2copyimagetobuffer4lpu: " + str(message2copyimagetobuffersend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4lpu
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2copyimagetobuffersend4lpu-failed-by-manoeuvre2copyimagetobuffer4lpu: " + str(message2copyimagetobuffersend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4copyimagetobuffer['ACK2INFO4LPU'] = ack2copyimagetobufferinfo4lpu
response2manouvre4copyimagetobuffer['CODE2ACK4LPU'] = code2ack
response2manouvre4copyimagetobuffer['CODE2NACK4LPU'] = code2nack
response2manouvre4copyimagetobuffer['MESSAGE2GET4LPU'] = message2copyimagetobufferget4lpu
response2manouvre4copyimagetobuffer['MESSAGE2PUT4LPU'] = message2copyimagetobufferput4lpu
response2manouvre4copyimagetobuffer['MESSAGE2RECEIVE4LPU'] = message2copyimagetobufferreceive4lpu
response2manouvre4copyimagetobuffer['MESSAGE2SEND4LPU'] = message2copyimagetobuffersend4lpu
response2manouvre4copyimagetobuffer['STATE2MANOEUVRE4LPU'] = state2copyimagetobuffer4lpu
message2print = "{(Step 33/33) returning" + "; response2manouvre4copyimagetobuffer-returning-by-manoeuvre2copyimagetobuffer4lpu: " + str(response2manouvre4copyimagetobuffer) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1 {'MESSAGE2SEND4LPU': 'roger2copyimagetobuffer4lpu',
# 'ACK2INFO4LPU': False,
# 'MESSAGE2GET4LPU': 'default2copyimagetobuffer4lpu',
# 'MESSAGE2RECEIVE4LPU': 'copy2copyimagetobuffer4lpu',
# 'CODE2ACK4LPU': ' 0D-1C-',
# 'MESSAGE2PUT4LPU': 'default2copyimagetobuffer4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 1}; time: 02:00:20 10/04/11 Pacific Daylight Time}
#2 {'MESSAGE2SEND4LPU': 'ready2copyimagetobuffer4lpu',
# 'ACK2INFO4LPU': False,
# 'MESSAGE2GET4LPU': 'default2copyimagetobuffer4lpu',
# 'MESSAGE2RECEIVE4LPU': 'ready2copyimagetobuffer4lpu',
# 'CODE2ACK4LPU': ' 0D-2C-',
# 'MESSAGE2PUT4LPU': 'default2copyimagetobuffer4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 2}; time: 02:10:33 10/04/11 Pacific Daylight Time}
#3 {'MESSAGE2SEND4LPU': 'ack2imageinfo4lpu',
# 'ACK2INFO4LPU': True,
# 'MESSAGE2GET4LPU': 'default2copyimagetobuffer4lpu',
# 'MESSAGE2RECEIVE4LPU': 'ready2copyimagetobuffer4lpu',
# 'CODE2ACK4LPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4LPU': 'default2copyimagetobuffer4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 3}; time: 02:10:33 10/04/11 Pacific Daylight Time}
#4 {'MESSAGE2SEND4LPU': 'default2copyimagetobuffer4lpu',
# 'ACK2INFO4LPU': False,
# 'MESSAGE2GET4LPU': 'default2copyimagetobuffer4lpu',
# 'MESSAGE2RECEIVE4LPU': 'default2copyimagetobuffer4lpu',
# 'CODE2ACK4LPU': ' 0D-',
# 'MESSAGE2PUT4LPU': 'default2copyimagetobuffer4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 0}; time: 02:10:33 10/04/11 Pacific Daylight Time}
return response2manouvre4copyimagetobuffer
#
# -----------------------------------------------------------------------------------------------------------------------
#roger2copybuffertoimage4lpu',
# # 'ACK2INFO4LPU': False,
# # 'MESSAGE2GET4LPU': 'default2copybuffertoimage4lpu',
# # 'MESSAGE2RECEIVE4LPU': 'copy2copybuffertoimage4lpu',
# # 'CODE2ACK4LPU': ' 0D-1C-',
# # 'MESSAGE2PUT4LPU': 'default2copybuffertoimage4lpu',
# # 'CODE2NACK4LPU': ' ',
# # 'STATE2MANOEUVRE4LPU': 1}
# except:
# print("(Step 82Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4LPU ", time4xi())
# else:
# pass # trust activated thread
#">
# -----------------------------------------------------------------------------------------------------------------------
def manoeuvre2copybuffertoimage4lpu(queue2copybuffertoimagemanoeuvre4lpu, consumerchannel2copybuffertoimagemanoeuvre4lpu, publisherchannel2copybuffertoimagemanoeuvre4lpu):
'''
manoeuvres copy control and command for copy2buffertoimage4lpu
'''
global state2copybuffertoimage4lpu # STATE FOR COMMAND AND CONTROL
global max2copybuffertoimagestate4lpu # MAX FOR STATE
global ack2copybuffertoimageinfo4lpu # ACK FOR IMAGE INFO
global message2copybuffertoimageget4lpu
global message2copybuffertoimageput4lpu
global message2copybuffertoimagereceive4lpu
global message2copybuffertoimagesend4lpu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2copybuffertoimage4lpu"
method2print = "manoeuvre2copybuffertoimage4lpu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2copybuffertoimage4lpu-started: " + str(manoeuvre2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 0B/33) passed" + "; queue2copybuffertoimagemanoeuvre4lpu-to-manoeuvre2copybuffertoimage4lpu: " + str(queue2copybuffertoimagemanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2copybuffertoimagemanoeuvre4lpu-to-manoeuvre2copybuffertoimage4lpu: " + str(consumerchannel2copybuffertoimagemanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0D/33) passed" + "; publisherchannel2copybuffertoimagemanoeuvre4lpu-to-manoeuvre2copybuffertoimage4lpu: " + str(publisherchannel2copybuffertoimagemanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4copybuffertoimage = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2copybuffertoimage4lpu-try-by-manoeuvre2copybuffertoimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2copybuffertoimage4lpu is None:
state2copybuffertoimage4lpu = 0
message2print = "{(Step 0F/33) initialized" + "; state2copybuffertoimage4lpu-initialized-by-manoeuvre2copybuffertoimage4lpu to: " + str(state2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2copybuffertoimage4lpu-used-by-manoeuvre2copybuffertoimage4lpu: " + str(state2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2copybuffertoimage4lpu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2copybuffertoimage4lpu-initialized-by-manoeuvre2copybuffertoimage4lpu to: " + str(state2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2copybuffertoimageinfo4lpu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2copybuffertoimageinfo4lpu-initialized-by-manoeuvre2copybuffertoimage4lpu to: " + str(ack2copybuffertoimageinfo4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2copybuffertoimageget4lpu = 'default2copybuffertoimage4lpu'
message2print = "{(Step 0Z3/33) initialized" + "; message2copybuffertoimageget4lpu-initialized-by-manoeuvre2copybuffertoimage4lpu to: " + str(message2copybuffertoimageget4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimageput4lpu = 'default2copybuffertoimage4lpu'
message2print = "{(Step 0Z4/33) initialized" + "; message2copybuffertoimageput4lpu-initialized-by-manoeuvre2copybuffertoimage4lpu to: " + str(message2copybuffertoimageput4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimagereceive4lpu = 'default2copybuffertoimage4lpu'
message2print = "{(Step 0Z5/33) initialized" + "; message2copybuffertoimagereceive4lpu-initialized-by-manoeuvre2copybuffertoimage4lpu to: " + str(message2copybuffertoimagereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimagesend4lpu = 'default2copybuffertoimage4lpu'
message2print = "{(Step 0Z6/33) initialized" + "; message2copybuffertoimagesend4lpu-initialized-by-manoeuvre2copybuffertoimage4lpu to: " + str(message2copybuffertoimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
max2copybuffertoimagestate4lpu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2copybuffertoimagestate4lpu-initialized-by-manoeuvre2copybuffertoimage4lpu to: " + str( max2copybuffertoimagestate4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2copybuffertoimage4lpu = state2copybuffertoimage4lpu + 1
message2print = "{(Step 0H/33) added" + "; state2copybuffertoimage4lpu-added-by-manoeuvre2copybuffertoimage4lpu: " + str(state2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2copybuffertoimage4lpu > max2copybuffertoimagestate4lpu:
state2copybuffertoimage4lpu = 0
message2print = "{(Step 0I/33) set" + "; state2copybuffertoimage4lpu-set-by-manoeuvre2copybuffertoimage4lpu to: " + str(state2copybuffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack2copybuffertoimageinfo4lpu = False
message2print = "{(Step 0J/33) set" + "; ack2copybuffertoimageinfo4lpu-set-by-manoeuvre2copybuffertoimage4lpu to: " + str(ack2copybuffertoimageinfo4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimageget4lpu = 'default2copybuffertoimage4lpu'
message2print = "{(Step 0K/33) set" + "; message2copybuffertoimageget4lpu-set-by-manoeuvre2copybuffertoimage4lpu to: " + str(message2copybuffertoimageget4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimageput4lpu = 'default2copybuffertoimage4lpu'
message2print = "{(Step 0L/33) set" + "; message2copybuffertoimageput4lpu-set-by-manoeuvre2copybuffertoimage4lpu to: " + str(message2copybuffertoimageput4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimagereceive4lpu = 'default2copybuffertoimage4lpu'
message2print = "{(Step 0M/33) set" + "; message2copybuffertoimagereceive4lpu-set-by-manoeuvre2copybuffertoimage4lpu to: " + str(message2copybuffertoimagereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimagesend4lpu = 'default2copybuffertoimage4lpu'
message2print = "{(Step 0N/33) set" + "; message2copybuffertoimagesend4lpu-set-by-manoeuvre2copybuffertoimage4lpu to: " + str(message2copybuffertoimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
max2copybuffertoimagestate4lpu = 3
message2print = "{(Step 0O/33) initialized" + "; max2copybuffertoimagestate4lpu-set-by-manoeuvre2copybuffertoimage4lpu to: " + str( max2copybuffertoimagestate4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2copybuffertoimage4lpu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2copybuffertoimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copybuffertoimagereceive4lpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copybuffertoimagereceive4lpu = consumerchannel2copybuffertoimagemanoeuvre4lpu.recv()
message2print = "{(Step 1B/33) received" + "; message2copybuffertoimagereceive4lpu-received-by-manoeuvre2copybuffertoimage4lpu: " + str(message2copybuffertoimagereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2copybuffertoimagereceive4lpu == 'copy2copybuffertoimage4lpu':
message2copybuffertoimagesend4lpu = 'roger2copybuffertoimage4lpu'
else:
message2copybuffertoimagesend4lpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copybuffertoimagemanoeuvre4lpu.send(message2copybuffertoimagesend4lpu)
message2print = "{(Step 1C/33) sent" + "; message2copybuffertoimagesend4lpu-sent-by-manoeuvre2copybuffertoimage4lpu: " + str(message2copybuffertoimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2copybuffertoimagereceive4lpu-failed-by-manoeuvre2copybuffertoimage4lpu: " + str(message2copybuffertoimagereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# STATE II - RECEIVE CONTROL AND COMMAND READY MESSAGE VIA PIPE AND SEND READY OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2copybuffertoimage4lpu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2copybuffertoimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copybuffertoimagereceive4lpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copybuffertoimagereceive4lpu = consumerchannel2copybuffertoimagemanoeuvre4lpu.recv()
message2print = "{(Step 2B/33) received" + "; message2copybuffertoimagereceive4lpu-received-by-manoeuvre2copybuffertoimage4lpu: " + str(message2copybuffertoimagereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2copybuffertoimagereceive4lpu == 'ready2copybuffertoimage4lpu':
message2copybuffertoimagesend4lpu = 'ready2copybuffertoimage4lpu'
else:
message2copybuffertoimagesend4lpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND READY OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copybuffertoimagemanoeuvre4lpu.send(message2copybuffertoimagesend4lpu)
message2print = "{(Step 2C/33) sent" + "; message2copybuffertoimagesend4lpu-sent-by-manoeuvre2copybuffertoimage4lpu: " + str(message2copybuffertoimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2copybuffertoimagereceive4lpu-failed-by-manoeuvre2copybuffertoimage4lpu: " + str(message2copybuffertoimagereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# STATE III - GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE AND SEND ACK OR NACK VIA PIPE
# ------------------------------------------------------------------------------------------------------------------------
if state2copybuffertoimage4lpu == 3:
info2image4lpu = None
message2print = "{(Step 3A/70) try" + "; info2image4lpu-try-by-manoeuvre2copybuffertoimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4lpu = queue2copybuffertoimagemanoeuvre4lpu.get()
message2print = "{(Step 3B/33) got" + "; info2image4lpu-got-by-manoeuvre2copybuffertoimage4lpu: " + str(info2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ..//..//..//..//..//web//images//png//dragonxi.png
if info2image4lpu is None:
code2nack = code2nack + '3Z1-'
ack2copybuffertoimageinfo4lpu = False
else:
code2ack = code2ack + '3C-'
ack2copybuffertoimageinfo4lpu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2copybuffertoimagemanoeuvre4lpu-failed-by-manoeuvre2copybuffertoimage4lpu: " + str(queue2copybuffertoimagemanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2copybuffertoimagesend4lpu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2copybuffertoimageinfo4lpu is True:
message2copybuffertoimagesend4lpu = 'ack2imageinfo4lpu'
else:
message2copybuffertoimagesend4lpu = 'nack2imageinfo4lpu'
message2print = "{(Step 4B/33) set" + "; message2copybuffertoimagesend4lpu-set-by-manoeuvre2copybuffertoimage4lpu to: " + str(message2copybuffertoimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4lpu
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copybuffertoimagesend4lpu-failed-by-manoeuvre2copybuffertoimage4lpu: " + str(message2copybuffertoimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2copybuffertoimagemanoeuvre4lpu-calling-by-manoeuvre2copybuffertoimage4lpu: " + str(publisherchannel2copybuffertoimagemanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2copybuffertoimagesend4lpu-passing-to-send-by-manoeuvre2copybuffertoimage4lpu: " + str(message2copybuffertoimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copybuffertoimagesend4lpu-failed-by-manoeuvre2copybuffertoimage4lpu: " + str(message2copybuffertoimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2copybuffertoimagemanoeuvre4lpu.send(message2copybuffertoimagesend4lpu)
message2print = "{(Step 4E/33) sent" + "; message2copybuffertoimagesend4lpu-sent-by-manoeuvre2copybuffertoimage4lpu: " + str(message2copybuffertoimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4lpu
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2copybuffertoimagesend4lpu-failed-by-manoeuvre2copybuffertoimage4lpu: " + str(message2copybuffertoimagesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4copybuffertoimage['ACK2INFO4LPU'] = ack2copybuffertoimageinfo4lpu
response2manouvre4copybuffertoimage['CODE2ACK4LPU'] = code2ack
response2manouvre4copybuffertoimage['CODE2NACK4LPU'] = code2nack
response2manouvre4copybuffertoimage['MESSAGE2GET4LPU'] = message2copybuffertoimageget4lpu
response2manouvre4copybuffertoimage['MESSAGE2PUT4LPU'] = message2copybuffertoimageput4lpu
response2manouvre4copybuffertoimage['MESSAGE2RECEIVE4LPU'] = message2copybuffertoimagereceive4lpu
response2manouvre4copybuffertoimage['MESSAGE2SEND4LPU'] = message2copybuffertoimagesend4lpu
response2manouvre4copybuffertoimage['STATE2MANOEUVRE4LPU'] = state2copybuffertoimage4lpu
message2print = "{(Step 33/33) returning" + "; response2manouvre4copybuffertoimage-returning-by-manoeuvre2copybuffertoimage4lpu: " + str(response2manouvre4copybuffertoimage) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1 {'MESSAGE2SEND4LPU': 'roger2copybuffertoimage4lpu',
# 'ACK2INFO4LPU': False,
# 'MESSAGE2GET4LPU': 'default2copybuffertoimage4lpu',
# 'MESSAGE2RECEIVE4LPU': 'copy2copybuffertoimage4lpu',
# 'CODE2ACK4LPU': ' 0D-1C-',
# 'MESSAGE2PUT4LPU': 'default2copybuffertoimage4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 1}; time: 02:18:55 10/04/11 Pacific Daylight Time}
#2 {'MESSAGE2SEND4LPU': 'ready2copybuffertoimage4lpu',
# 'ACK2INFO4LPU': False,
# 'MESSAGE2GET4LPU': 'default2copybuffertoimage4lpu',
# 'MESSAGE2RECEIVE4LPU': 'ready2copybuffertoimage4lpu',
# 'CODE2ACK4LPU': ' 0D-2C-',
# 'MESSAGE2PUT4LPU': 'default2copybuffertoimage4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 2}; time: 02:18:55 10/04/11 Pacific Daylight Time}
#3 {'MESSAGE2SEND4LPU': 'ack2imageinfo4lpu',
# 'ACK2INFO4LPU': True,
# 'MESSAGE2GET4LPU': 'default2copybuffertoimage4lpu',
# 'MESSAGE2RECEIVE4LPU': 'ready2copybuffertoimage4lpu',
# 'CODE2ACK4LPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4LPU': 'default2copybuffertoimage4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 3}; time: 02:18:55 10/04/11 Pacific Daylight Time}
#4 {'MESSAGE2SEND4LPU': 'default2copybuffertoimage4lpu',
# 'ACK2INFO4LPU': False,
# 'MESSAGE2GET4LPU': 'default2copybuffertoimage4lpu',
# 'MESSAGE2RECEIVE4LPU': 'default2copybuffertoimage4lpu',
# 'CODE2ACK4LPU': ' 0D-',
# 'MESSAGE2PUT4LPU': 'default2copybuffertoimage4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 0}
return response2manouvre4copybuffertoimage
#
# -----------------------------------------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------------------------------------
def manoeuvre2readimage4lpu(queue2readmanoeuvre4lpu, consumerchannel2readmanoeuvre4lpu, publisherchannel2readmanoeuvre4lpu):
'''
manoeuvres read control and command
'''
global state2read4lpu # STATE FOR COMMAND AND CONTROL
global max2readstate4lpu # MAX FOR STATE
global ack2readinfo4lpu # ACK FOR IMAGE INFO
global message2readget4lpu
global message2readput4lpu
global message2readreceive4lpu
global message2readsend4lpu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2readimage4lpu"
method2print = "manoeuvre2readimage4lpu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2readimage4lpu-started: " + str(manoeuvre2readimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 0B/33) passed" + "; queue2readmanoeuvre4lpu-to-manoeuvre2readimage4lpu: " + str(queue2readmanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2readmanoeuvre4lpu-to-manoeuvre2readimage4lpu: " + str(consumerchannel2readmanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0D/33) passed" + "; publisherchannel2readmanoeuvre4lpu-to-manoeuvre2readimage4lpu: " + str(publisherchannel2readmanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4read = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2read4lpu-try-by-manoeuvre2readimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2read4lpu is None:
state2read4lpu = 0
message2print = "{(Step 0F/33) initialized" + "; state2read4lpu-initialized-by-manoeuvre2readimage4lpu to: " + str(state2read4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2read4lpu-used-by-manoeuvre2readimage4lpu: " + str(state2read4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2read4lpu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2read4lpu-initialized-by-manoeuvre2readimage4lpu to: " + str(state2read4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2readinfo4lpu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2readinfo4lpu-initialized-by-manoeuvre2readimage4lpu to: " + str(ack2readinfo4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2readget4lpu = 'default2read4lpu'
message2print = "{(Step 0Z3/33) initialized" + "; message2readget4lpu-initialized-by-manoeuvre2readimage4lpu to: " + str(message2readget4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4lpu
message2readput4lpu = 'default2read4lpu'
message2print = "{(Step 0Z4/33) initialized" + "; message2readput4lpu-initialized-by-manoeuvre2readimage4lpu to: " + str(message2readput4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4lpu
message2readreceive4lpu = 'default2read4lpu'
message2print = "{(Step 0Z5/33) initialized" + "; message2readreceive4lpu-initialized-by-manoeuvre2readimage4lpu to: " + str(message2readreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4lpu
message2readsend4lpu = 'default2read4lpu'
message2print = "{(Step 0Z6/33) initialized" + "; message2readsend4lpu-initialized-by-manoeuvre2readimage4lpu to: " + str(message2readsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4lpu
max2readstate4lpu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2readstate4lpu-initialized-by-manoeuvre2readimage4lpu to: " + str( max2readstate4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2read4lpu = state2read4lpu + 1
message2print = "{(Step 0H/33) added" + "; state2read4lpu-added-by-manoeuvre2readimage4lpu: " + str(state2read4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2read4lpu > max2readstate4lpu:
state2read4lpu = 0
message2print = "{(Step 0I/33) set" + "; state2read4lpu-set-by-manoeuvre2readimage4lpu to: " + str(state2read4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2readinfo4lpu = False
message2print = "{(Step 0J/33) set" + "; ack2readinfo4lpu-set-by-manoeuvre2readimage4lpu to: " + str(ack2readinfo4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2readget4lpu = 'default2read4lpu'
message2print = "{(Step 0K/33) set" + "; message2readget4lpu-set-by-manoeuvre2readimage4lpu to: " + str(message2readget4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4lpu
message2readput4lpu = 'default2read4lpu'
message2print = "{(Step 0L/33) set" + "; message2readput4lpu-set-by-manoeuvre2readimage4lpu to: " + str(message2readput4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4lpu
message2readreceive4lpu = 'default2read4lpu'
message2print = "{(Step 0M/33) set" + "; message2readreceive4lpu-set-by-manoeuvre2readimage4lpu to: " + str(message2readreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4lpu
message2readsend4lpu = 'default2read4lpu'
message2print = "{(Step 0N/33) set" + "; message2readsend4lpu-set-by-manoeuvre2readimage4lpu to: " + str(message2readsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4lpu
max2readstate4lpu = 3
message2print = "{(Step 0O/33) initialized" + "; max2readstate4lpu-set-by-manoeuvre2readimage4lpu to: " + str( max2readstate4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2read4lpu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2readimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2readreceive4lpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2readreceive4lpu = consumerchannel2readmanoeuvre4lpu.recv()
message2print = "{(Step 1B/33) received" + "; message2readreceive4lpu-received-by-manoeuvre2readimage4lpu: " + str(message2readreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# copy2read4lpu
if message2readreceive4lpu == 'copy2read4lpu':
message2readsend4lpu = 'roger2read4lpu'
else:
message2readsend4lpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2readmanoeuvre4lpu.send(message2readsend4lpu)
message2print = "{(Step 1C/33) sent" + "; message2readsend4lpu-sent-by-manoeuvre2readimage4lpu: " + str(message2readsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# roger2read4lpu
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2readreceive4lpu-failed-by-manoeuvre2readimage4lpu: " + str(message2readreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# STATE II - RECEIVE CONTROL AND COMMAND READY MESSAGE VIA PIPE AND SEND READY OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2read4lpu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2readimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2readreceive4lpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2readreceive4lpu = consumerchannel2readmanoeuvre4lpu.recv()
message2print = "{(Step 2B/33) received" + "; message2readreceive4lpu-received-by-manoeuvre2readimage4lpu: " + str(message2readreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ready2read4lpu
if message2readreceive4lpu == 'ready2read4lpu':
message2readsend4lpu = 'ready2read4lpu'
else:
message2readsend4lpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2readmanoeuvre4lpu.send(message2readsend4lpu)
message2print = "{(Step 2C/33) sent" + "; message2readsend4lpu-sent-by-manoeuvre2readimage4lpu: " + str(message2readsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ready2read4lpu
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2readreceive4lpu-failed-by-manoeuvre2readimage4lpu: " + str(message2readreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# STATE III - GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE AND SEND ACK OR NACK VIA PIPE
# ------------------------------------------------------------------------------------------------------------------------
if state2read4lpu == 3:
info2image4lpu = None
message2print = "{(Step 3A/70) try" + "; info2image4lpu-try-by-manoeuvre2readimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4lpu = queue2readmanoeuvre4lpu.get()
message2print = "{(Step 3B/33) got" + "; info2image4lpu-got-by-manoeuvre2readimage4lpu: " + str(info2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ..//..//..//..//..//web//images//png//dragonxi.png
if info2image4lpu is None:
code2nack = code2nack + '3Z1-'
ack2readinfo4lpu = False
else:
code2ack = code2ack + '3C-'
ack2readinfo4lpu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2readmanoeuvre4lpu-failed-by-manoeuvre2readimage4lpu: " + str(queue2readmanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2readsend4lpu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2readinfo4lpu is True:
message2readsend4lpu = 'ack2imageinfo4lpu'
else:
message2readsend4lpu = 'nack2imageinfo4lpu'
message2print = "{(Step 4B/33) set" + "; message2readsend4lpu-set-by-manoeuvre2readimage4lpu to: " + str(message2readsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4lpu
except:
message2print = "{(Step 4Z1/33) failed" + "; message2readsend4lpu-failed-by-manoeuvre2readimage4lpu: " + str(message2readsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2readmanoeuvre4lpu-calling-by-manoeuvre2readimage4lpu: " + str(publisherchannel2readmanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2readsend4lpu-passing-to-send-by-manoeuvre2readimage4lpu: " + str(message2readsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2readsend4lpu-failed-by-manoeuvre2readimage4lpu: " + str(message2readsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2readmanoeuvre4lpu.send(message2readsend4lpu)
message2print = "{(Step 4E/33) sent" + "; message2readsend4lpu-sent-by-manoeuvre2readimage4lpu: " + str(message2readsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4lpu
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2readsend4lpu-failed-by-manoeuvre2readimage4lpu: " + str(message2readsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4read['ACK2INFO4LPU'] = ack2readinfo4lpu
response2manouvre4read['CODE2ACK4LPU'] = code2ack
response2manouvre4read['CODE2NACK4LPU'] = code2nack
response2manouvre4read['MESSAGE2GET4LPU'] = message2readget4lpu
response2manouvre4read['MESSAGE2PUT4LPU'] = message2readput4lpu
response2manouvre4read['MESSAGE2RECEIVE4LPU'] = message2readreceive4lpu
response2manouvre4read['MESSAGE2SEND4LPU'] = message2readsend4lpu
response2manouvre4read['STATE2MANOEUVRE4LPU'] = state2read4lpu
message2print = "{(Step 33/33) returning" + "; response2manouvre4read-returning-by-manoeuvre2readimage4lpu: " + str(response2manouvre4read) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1 {'MESSAGE2SEND4LPU': 'roger2read4lpu',
# 'ACK2INFO4LPU': False,
# 'MESSAGE2GET4LPU': 'default2read4lpu',
# 'MESSAGE2RECEIVE4LPU': 'copy2read4lpu',
# 'CODE2ACK4LPU': ' 0D-1C-',
# 'MESSAGE2PUT4LPU': 'default2read4lpu',
# 'CODE2NACK4LPU': ' ', 'STATE2MANOEUVRE4LPU': 1}; time: 01:44:40 09/29/11 Pacific Daylight Time}
#2 {'MESSAGE2SEND4LPU': 'ready2read4lpu',
# 'ACK2INFO4LPU': False,
# 'MESSAGE2GET4LPU': 'default2read4lpu',
# 'MESSAGE2RECEIVE4LPU': 'ready2read4lpu',
# 'CODE2ACK4LPU': ' 0D-2C-',
# 'MESSAGE2PUT4LPU': 'default2read4lpu',
# 'CODE2NACK4LPU': ' ', 'STATE2MANOEUVRE4LPU': 2}; time: 01:44:40 09/29/11 Pacific Daylight Time}
#3 {'MESSAGE2SEND4LPU': 'ack2imageinfo4lpu',
# 'ACK2INFO4LPU': True,
# 'MESSAGE2GET4LPU': 'default2read4lpu',
# 'MESSAGE2RECEIVE4LPU': 'ready2read4lpu',
# 'CODE2ACK4LPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4LPU': 'default2read4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 3}; time: 01:44:40 09/29/11 Pacific Daylight Time}
#4 {'MESSAGE2SEND4LPU': 'default2read4lpu',
# 'ACK2INFO4LPU': False,
# 'MESSAGE2GET4LPU': 'default2read4lpu',
# 'MESSAGE2RECEIVE4LPU': 'default2read4lpu',
# 'CODE2ACK4LPU': ' 0D-',
# 'MESSAGE2PUT4LPU': 'default2read4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 0}; time: 02:11:49 09/29/11 Pacific Daylight Time}
return response2manouvre4read
#
# -------------------------------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------------------------------
def manoeuvre2writeimage4lpu(queue2writemanoeuvre4lpu, consumerchannel2writemanoeuvre4lpu, publisherchannel2writemanoeuvre4lpu):
'''
manoeuvres control and command
'''
global state2write4lpu # STATE FOR COMMAND AND CONTROL
global max2writestate4lpu # MAX FOR STATE
global ack2writeinfo4lpu # ACK FOR IMAGE INFO
global message2writeget4lpu
global message2writeput4lpu
global message2writereceive4lpu
global message2writesend4lpu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2writeimage4lpu"
method2print = "manoeuvre2writeimage4lpu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2writeimage4lpu-started: " + str(manoeuvre2writeimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0B/33) passed" + "; queue2writemanoeuvre4lpu-to-manoeuvre2writeimage4lpu: " + str(queue2writemanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2writemanoeuvre4lpu-to-manoeuvre2writeimage4lpu: " + str(consumerchannel2writemanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# read-write PipeConnection, handle 568>
message2print = "{(Step 0D/33) passed" + "; publisherchannel2writemanoeuvre4lpu-to-manoeuvre2writeimage4lpu: " + str(publisherchannel2writemanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4write = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2write4lpu-try-by-manoeuvre2writeimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2write4lpu is None:
state2write4lpu = 0
message2print = "{(Step 0F/33) initialized" + "; state2write4lpu-initialized-by-manoeuvre2writeimage4lpu to: " + str(state2write4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2write4lpu-used-by-manoeuvre2writeimage4lpu: " + str(state2write4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2write4lpu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2write4lpu-initialized-by-manoeuvre2writeimage4lpu to: " + str(state2write4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2writeinfo4lpu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2writeinfo4lpu-initialized-by-manoeuvre2writeimage4lpu to: " + str(ack2writeinfo4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2writeget4lpu = 'default2write4lpu'
message2print = "{(Step 0Z3/33) initialized" + "; message2writeget4lpu-initialized-by-manoeuvre2writeimage4lpu to: " + str(message2writeget4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4lpu
message2writeput4lpu = 'default2write4lpu'
message2print = "{(Step 0Z4/33) initialized" + "; message2writeput4lpu-initialized-by-manoeuvre2writeimage4lpu to: " + str(message2writeput4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4lpu
message2writereceive4lpu = 'default2write4lpu'
message2print = "{(Step 0Z5/33) initialized" + "; message2writereceive4lpu-initialized-by-manoeuvre2writeimage4lpu to: " + str(message2writereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4lpu
message2writesend4lpu = 'default2write4lpu'
message2print = "{(Step 0Z6/33) initialized" + "; message2writesend4lpu-initialized-by-manoeuvre2writeimage4lpu to: " + str(message2writesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4lpu
max2writestate4lpu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2writestate4lpu-initialized-by-manoeuvre2writeimage4lpu to: " + str( max2writestate4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2write4lpu = state2write4lpu + 1
message2print = "{(Step 0H/33) added" + "; state2write4lpu-added-by-manoeuvre2writeimage4lpu: " + str(state2write4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2write4lpu > max2writestate4lpu:
state2write4lpu = 0
message2print = "{(Step 0I/33) set" + "; state2write4lpu-set-by-manoeuvre2writeimage4lpu to: " + str(state2write4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2writeinfo4lpu = False
message2print = "{(Step 0J/33) set" + "; ack2writeinfo4lpu-set-by-manoeuvre2writeimage4lpu to: " + str(ack2writeinfo4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2writeget4lpu = 'default2write4lpu'
message2print = "{(Step 0K/33) set" + "; message2writeget4lpu-set-by-manoeuvre2writeimage4lpu to: " + str(message2writeget4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4lpu
message2writeput4lpu = 'default2write4lpu'
message2print = "{(Step 0L/33) set" + "; message2writeput4lpu-set-by-manoeuvre2writeimage4lpu to: " + str(message2writeput4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4lpu
message2writereceive4lpu = 'default2write4lpu'
message2print = "{(Step 0M/33) set" + "; message2writereceive4lpu-set-by-manoeuvre2writeimage4lpu to: " + str(message2writereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4lpu
message2writesend4lpu = 'default2write4lpu'
message2print = "{(Step 0N/33) set" + "; message2writesend4lpu-set-by-manoeuvre2writeimage4lpu to: " + str(message2writesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4lpu
max2writestate4lpu = 3
message2print = "{(Step 0O/33) initialized" + "; max2writestate4lpu-set-by-manoeuvre2writeimage4lpu to: " + str( max2writestate4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2write4lpu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2writeimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2writereceive4lpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2writereceive4lpu = consumerchannel2writemanoeuvre4lpu.recv()
message2print = "{(Step 1B/33) received" + "; message2writereceive4lpu-received-by-manoeuvre2writeimage4lpu: " + str(message2writereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# copy2write4lpu
if message2writereceive4lpu == 'copy2write4lpu':
message2writesend4lpu = 'roger2write4lpu'
else:
message2writesend4lpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2writemanoeuvre4lpu.send(message2writesend4lpu)
message2print = "{(Step 1C/33) sent" + "; message2writesend4lpu-sent-by-manoeuvre2writeimage4lpu: " + str(message2writesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# roger2write4lpu
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2writereceive4lpu-failed-by-manoeuvre2writeimage4lpu: " + str(message2writereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# STATE II - RECEIVE CONTROL AND COMMAND READY MESSAGE VIA PIPE AND SEND READY OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2write4lpu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2writeimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2writereceive4lpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2writereceive4lpu = consumerchannel2writemanoeuvre4lpu.recv()
message2print = "{(Step 2B/33) received" + "; message2writereceive4lpu-received-by-manoeuvre2writeimage4lpu: " + str(message2writereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ready2write4lpu
if message2writereceive4lpu == 'ready2write4lpu':
message2writesend4lpu = 'ready2write4lpu'
else:
message2writesend4lpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2writemanoeuvre4lpu.send(message2writesend4lpu)
message2print = "{(Step 2C/33) sent" + "; message2writesend4lpu-sent-by-manoeuvre2writeimage4lpu: " + str(message2writesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ready2write4lpu
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2writereceive4lpu-failed-by-manoeuvre2writeimage4lpu: " + str(message2writereceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# STATE III - GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE AND SEND ACK OR NACK VIA PIPE
# ------------------------------------------------------------------------------------------------------------------------
if state2write4lpu == 3:
info2image4lpu = None
message2print = "{(Step 3A/70) try" + "; info2image4lpu-try-by-manoeuvre2writeimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4lpu = queue2writemanoeuvre4lpu.get()
message2print = "{(Step 3B/33) got" + "; info2image4lpu-got-by-manoeuvre2writeimage4lpu: " + str(info2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ..//..//..//..//..//web//images//png//dragonxi.png
if info2image4lpu is None:
code2nack = code2nack + '3Z1-'
ack2writeinfo4lpu = False
else:
code2ack = code2ack + '3C-'
ack2writeinfo4lpu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2writemanoeuvre4lpu-failed-by-manoeuvre2writeimage4lpu: " + str(queue2writemanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2writesend4lpu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2writeinfo4lpu is True:
message2writesend4lpu = 'ack2imageinfo4lpu'
else:
message2writesend4lpu = 'nack2imageinfo4lpu'
message2print = "{(Step 4B/33) set" + "; message2writesend4lpu-set-by-manoeuvre2writeimage4lpu to: " + str(message2writesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4lpu
except:
message2print = "{(Step 4Z1/33) failed" + "; message2writesend4lpu-failed-by-manoeuvre2writeimage4lpu: " + str(message2writesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2writemanoeuvre4lpu-calling-by-manoeuvre2writeimage4lpu: " + str(publisherchannel2writemanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2writesend4lpu-passing-to-send-by-manoeuvre2writeimage4lpu: " + str(message2writesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2writesend4lpu-failed-by-manoeuvre2writeimage4lpu: " + str(message2writesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2writemanoeuvre4lpu.send(message2writesend4lpu)
message2print = "{(Step 4E/33) sent" + "; message2writesend4lpu-sent-by-manoeuvre2writeimage4lpu: " + str(message2writesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4lpu
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2writesend4lpu-failed-by-manoeuvre2writeimage4lpu: " + str(message2writesend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4write['ACK2INFO4LPU'] = ack2writeinfo4lpu
response2manouvre4write['CODE2ACK4LPU'] = code2ack
response2manouvre4write['CODE2NACK4LPU'] = code2nack
response2manouvre4write['MESSAGE2GET4LPU'] = message2writeget4lpu
response2manouvre4write['MESSAGE2PUT4LPU'] = message2writeput4lpu
response2manouvre4write['MESSAGE2RECEIVE4LPU'] = message2writereceive4lpu
response2manouvre4write['MESSAGE2SEND4LPU'] = message2writesend4lpu
response2manouvre4write['STATE2MANOEUVRE4LPU'] = state2write4lpu
message2print = "{(Step 33/33) returning" + "; response2manouvre4write-returning-by-manoeuvre2writeimage4lpu: " + str(response2manouvre4write) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1
# {'MESSAGE2SEND4LPU': 'roger2write4lpu',
# 'ACK2INFO4LPU': False, 'MESSAGE2GET4LPU': 'default2write4lpu',
# 'MESSAGE2RECEIVE4LPU': 'copy2write4lpu',
# 'CODE2ACK4LPU': ' 0D-1C-',
# 'MESSAGE2PUT4LPU': 'default2write4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 1}; time: 00:11:53 10/03/11 Pacific Daylight Time}
#2
# {'MESSAGE2SEND4LPU': 'ready2write4lpu',
# 'ACK2INFO4LPU': False, 'MESSAGE2GET4LPU': 'default2write4lpu',
# 'MESSAGE2RECEIVE4LPU': 'ready2write4lpu',
# 'CODE2ACK4LPU': ' 0D-2C-',
# 'MESSAGE2PUT4LPU': 'default2write4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 2}; time: 00:11:53 10/03/11 Pacific Daylight Time}
#3
# {'MESSAGE2SEND4LPU': 'ack2imageinfo4lpu',
# 'ACK2INFO4LPU': True, 'MESSAGE2GET4LPU': 'default2write4lpu',
# 'MESSAGE2RECEIVE4LPU': 'ready2write4lpu',
# 'CODE2ACK4LPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4LPU': 'default2write4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 3}; time: 00:11:53 10/03/11 Pacific Daylight Time}
return response2manouvre4write
#
# -------------------------------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------------------------------
def manoeuvre2mapimage4lpu(queue2mapmanoeuvre4lpu, consumerchannel2mapmanoeuvre4lpu, publisherchannel2mapmanoeuvre4lpu):
'''
manoeuvres control and command
'''
global state2map4lpu # STATE FOR COMMAND AND CONTROL
global max2mapstate4lpu # MAX FOR STATE
global ack2mapinfo4lpu # ACK FOR IMAGE INFO
global message2mapget4lpu
global message2mapput4lpu
global message2mapreceive4lpu
global message2mapsend4lpu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2mapimage4lpu"
method2print = "manoeuvre2mapimage4lpu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2mapimage4lpu-started: " + str(manoeuvre2mapimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0B/33) passed" + "; queue2mapmanoeuvre4lpu-to-manoeuvre2mapimage4lpu: " + str(queue2mapmanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2mapmanoeuvre4lpu-to-manoeuvre2mapimage4lpu: " + str(consumerchannel2mapmanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0D/33) passed" + "; publisherchannel2mapmanoeuvre4lpu-to-manoeuvre2mapimage4lpu: " + str(publisherchannel2mapmanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4map = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2map4lpu-try-by-manoeuvre2mapimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2map4lpu is None:
state2map4lpu = 0
message2print = "{(Step 0F/33) initialized" + "; state2map4lpu-initialized-by-manoeuvre2mapimage4lpu to: " + str(state2map4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2map4lpu-used-by-manoeuvre2mapimage4lpu: " + str(state2map4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2map4lpu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2map4lpu-initialized-by-manoeuvre2mapimage4lpu to: " + str(state2map4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2mapinfo4lpu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2mapinfo4lpu-initialized-by-manoeuvre2mapimage4lpu to: " + str(ack2mapinfo4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2mapget4lpu = 'default2map4lpu'
message2print = "{(Step 0Z3/33) initialized" + "; message2mapget4lpu-initialized-by-manoeuvre2mapimage4lpu to: " + str(message2mapget4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4lpu
message2mapput4lpu = 'default2map4lpu'
message2print = "{(Step 0Z4/33) initialized" + "; message2mapput4lpu-initialized-by-manoeuvre2mapimage4lpu to: " + str(message2mapput4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4lpu
message2mapreceive4lpu = 'default2map4lpu'
message2print = "{(Step 0Z5/33) initialized" + "; message2mapreceive4lpu-initialized-by-manoeuvre2mapimage4lpu to: " + str(message2mapreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4lpu
message2mapsend4lpu = 'default2map4lpu'
message2print = "{(Step 0Z6/33) initialized" + "; message2mapsend4lpu-initialized-by-manoeuvre2mapimage4lpu to: " + str(message2mapsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4lpu
max2mapstate4lpu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2mapstate4lpu-initialized-by-manoeuvre2mapimage4lpu to: " + str( max2mapstate4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2map4lpu = state2map4lpu + 1
message2print = "{(Step 0H/33) added" + "; state2map4lpu-added-by-manoeuvre2mapimage4lpu: " + str(state2map4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2map4lpu > max2mapstate4lpu:
state2map4lpu = 0
message2print = "{(Step 0I/33) set" + "; state2map4lpu-set-by-manoeuvre2mapimage4lpu to: " + str(state2map4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2mapinfo4lpu = False
message2print = "{(Step 0J/33) set" + "; ack2mapinfo4lpu-set-by-manoeuvre2mapimage4lpu to: " + str(ack2mapinfo4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2mapget4lpu = 'default2map4lpu'
message2print = "{(Step 0K/33) set" + "; message2mapget4lpu-set-by-manoeuvre2mapimage4lpu to: " + str(message2mapget4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4lpu
message2mapput4lpu = 'default2map4lpu'
message2print = "{(Step 0L/33) set" + "; message2mapput4lpu-set-by-manoeuvre2mapimage4lpu to: " + str(message2mapput4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4lpu
message2mapreceive4lpu = 'default2map4lpu'
message2print = "{(Step 0M/33) set" + "; message2mapreceive4lpu-set-by-manoeuvre2mapimage4lpu to: " + str(message2mapreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4lpu
message2mapsend4lpu = 'default2map4lpu'
message2print = "{(Step 0N/33) set" + "; message2mapsend4lpu-set-by-manoeuvre2mapimage4lpu to: " + str(message2mapsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4lpu
max2mapstate4lpu = 3
message2print = "{(Step 0O/33) initialized" + "; max2mapstate4lpu-set-by-manoeuvre2mapimage4lpu to: " + str( max2mapstate4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2map4lpu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2mapimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2mapreceive4lpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2mapreceive4lpu = consumerchannel2mapmanoeuvre4lpu.recv()
message2print = "{(Step 1B/33) received" + "; message2mapreceive4lpu-received-by-manoeuvre2mapimage4lpu: " + str(message2mapreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2mapreceive4lpu == 'copy2mapimage4lpu':
message2mapsend4lpu = 'roger2mapimage4lpu'
else:
message2mapsend4lpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2mapmanoeuvre4lpu.send(message2mapsend4lpu)
message2print = "{(Step 1C/33) sent" + "; message2mapsend4lpu-sent-by-manoeuvre2mapimage4lpu: " + str(message2mapsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2mapreceive4lpu-failed-by-manoeuvre2mapimage4lpu: " + str(message2mapreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# STATE II - RECEIVE CONTROL AND COMMAND READY MESSAGE VIA PIPE AND SEND READY OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2map4lpu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2mapimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2mapreceive4lpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2mapreceive4lpu = consumerchannel2mapmanoeuvre4lpu.recv()
message2print = "{(Step 2B/33) received" + "; message2mapreceive4lpu-received-by-manoeuvre2mapimage4lpu: " + str(message2mapreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2mapreceive4lpu == 'ready2mapimage4lpu':
message2mapsend4lpu = 'ready2mapimage4lpu'
else:
message2mapsend4lpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2mapmanoeuvre4lpu.send(message2mapsend4lpu)
message2print = "{(Step 2C/33) sent" + "; message2mapsend4lpu-sent-by-manoeuvre2mapimage4lpu: " + str(message2mapsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2mapreceive4lpu-failed-by-manoeuvre2mapimage4lpu: " + str(message2mapreceive4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# STATE III - GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE AND SEND ACK OR NACK VIA PIPE
# ------------------------------------------------------------------------------------------------------------------------
if state2map4lpu == 3:
info2image4lpu = None
message2print = "{(Step 3A/70) try" + "; info2image4lpu-try-by-manoeuvre2mapimage4lpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4lpu = queue2mapmanoeuvre4lpu.get()
message2print = "{(Step 3B/33) got" + "; info2image4lpu-got-by-manoeuvre2mapimage4lpu: " + str(info2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if info2image4lpu is None:
code2nack = code2nack + '3Z1-'
ack2mapinfo4lpu = False
else:
code2ack = code2ack + '3C-'
ack2mapinfo4lpu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2mapmanoeuvre4lpu-failed-by-manoeuvre2mapimage4lpu: " + str(queue2mapmanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2mapsend4lpu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2mapinfo4lpu is True:
message2mapsend4lpu = 'ack2imageinfo4lpu'
else:
message2mapsend4lpu = 'nack2imageinfo4lpu'
message2print = "{(Step 4B/33) set" + "; message2mapsend4lpu-set-by-manoeuvre2mapimage4lpu to: " + str(message2mapsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2mapsend4lpu-failed-by-manoeuvre2mapimage4lpu: " + str(message2mapsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2mapmanoeuvre4lpu-calling-by-manoeuvre2mapimage4lpu: " + str(publisherchannel2mapmanoeuvre4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2mapsend4lpu-passing-to-send-by-manoeuvre2mapimage4lpu: " + str(message2mapsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2mapsend4lpu-failed-by-manoeuvre2mapimage4lpu: " + str(message2mapsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2mapmanoeuvre4lpu.send(message2mapsend4lpu)
message2print = "{(Step 4E/33) sent" + "; message2mapsend4lpu-sent-by-manoeuvre2mapimage4lpu: " + str(message2mapsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2mapsend4lpu-failed-by-manoeuvre2mapimage4lpu: " + str(message2mapsend4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4map['ACK2INFO4LPU'] = ack2mapinfo4lpu
response2manouvre4map['CODE2ACK4LPU'] = code2ack
response2manouvre4map['CODE2NACK4LPU'] = code2nack
response2manouvre4map['MESSAGE2GET4LPU'] = message2mapget4lpu
response2manouvre4map['MESSAGE2PUT4LPU'] = message2mapput4lpu
response2manouvre4map['MESSAGE2RECEIVE4LPU'] = message2mapreceive4lpu
response2manouvre4map['MESSAGE2SEND4LPU'] = message2mapsend4lpu
response2manouvre4map['STATE2MANOEUVRE4LPU'] = state2map4lpu
message2print = "{(Step 33/33) returning" + "; response2manouvre4map-returning-by-manoeuvre2mapimage4lpu: " + str(response2manouvre4map) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1 {'MESSAGE2SEND4LPU': 'roger2mapimage4lpu',
# 'ACK2INFO4LPU': False,
# 'MESSAGE2GET4LPU': 'default2map4lpu',
# 'MESSAGE2RECEIVE4LPU': 'copy2mapimage4lpu',
# 'CODE2ACK4LPU': ' 0D-1C-',
# 'MESSAGE2PUT4LPU': 'default2map4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 1}
#2 {'MESSAGE2SEND4LPU': 'ready2mapimage4lpu',
# 'ACK2INFO4LPU': False,
# 'MESSAGE2GET4LPU': 'default2map4lpu',
# 'MESSAGE2RECEIVE4LPU': 'ready2mapimage4lpu',
# 'CODE2ACK4LPU': ' 0D-2C-',
# 'MESSAGE2PUT4LPU': 'default2map4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 2}; time: 06:49:48 10/04/11 Pacific Daylight Time}
#3 {'MESSAGE2SEND4LPU': 'ack2imageinfo4lpu',
# 'ACK2INFO4LPU': True,
# 'MESSAGE2GET4LPU': 'default2map4lpu',
# 'MESSAGE2RECEIVE4LPU': 'ready2mapimage4lpu',
# 'CODE2ACK4LPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4LPU': 'default2map4lpu',
# 'CODE2NACK4LPU': ' ',
# 'STATE2MANOEUVRE4LPU': 3}; time: 06:49:48 10/04/11 Pacific Daylight Time}
#4 {'MESSAGE2SEND4LPU': 'default2map4lpu',
# 'ACK2INFO4LPU': False,
# 'MESSAGE2GET4LPU': 'default2map4lpu',
# 'MESSAGE2RECEIVE4LPU': 'default2map4lpu',
# 'CODE2ACK4LPU': ' 0D-',
# 'MESSAGE2PUT4LPU': 'default2map4lpu',
# 'CODE2NACK4LPU': ' ', 'STATE2MANOEUVRE4LPU': 0}; time: 06:49:48 10/04/11 Pacific Daylight Time}
return response2manouvre4map
#
# -------------------------------------------------------------------------------------------------
#copy2write4lpu"
# channel2publish4lpu = response4write2image['PUBLISHERCHANNEL']
# channel2publish4lpu.send(message2writesend4lpu)
# print("(Step 17B/700) OF LPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4LPU: ", channel2publish4lpu, " MESSAGE2SEND4LPU: " , message2writesend4lpu)
# except:
# print('(Step 17Z1/700) OF LPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4LPU ', time4xi())
# # ------------------------------------------------------------------------------------------
# # (18) LET MANOEUVRE2IMAGE4LPU TO RECEIVE COPY AND AND SEND ROGER VIA PIPE
# # ------------------------------------------------------------------------------------------
# print("(Step 18C/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# try:
# response2manoeuvre4lpu = manoeuvre2readimage4lpu(queue2write4lpu, channel2consume4lpu, channel2publish4lpu)
# print("(Step 18D/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", manoeuvre2readimage4lpu)
# except:
# print("(Step 18Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# else:
# pass # trust activated thread
# # ---------------------------------------------------------------------------------------------
# # (19) RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------
# print('(Step 19A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4LPU ', time4xi())
# try:
# channel2consume4lpu = response4write2image['CONSUMERCHANNEL']
# message2writereceive4lpu = channel2consume4lpu.recv()
# print("(Step 19B/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel2consume4lpu, " CONTROL & COMMAND: ", message2writereceive4lpu)
# # roger2write4lpu
# except:
# print('(Step 19Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4LPU ', time4xi())
# # ---------------------------------------------------------------------------------------------------
# # (20) SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2IMAGE4LPU TO RECEIVE
# # ---------------------------------------------------------------------------------------------------
# print('(Step 20A/700) OF LPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4LPU ', time4xi())
# try:
# message2writesend4lpu = "write2write4lpu"
# channel2publish4lpu = response4write2image['PUBLISHERCHANNEL']
# channel2publish4lpu.send(message2writesend4lpu)
# print("(Step 20B/700) OF LPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4LPU: ", channel2publish4lpu, " MESSAGE2SEND4LPU: " , message2writesend4lpu)
# # write2write4lpu
# except:
# print('(Step 20Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4LPU ', time4xi())
# # -----------------------------------------------------------------------------------
# # (21) LET MANOEUVRE2IMAGE4LPU TO RECEIVE READY AND TO SEND READY
# # -----------------------------------------------------------------------------------
# print("(Step 21A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# try:
# response2manoeuvre4lpu = manoeuvre2readimage4lpu(queue2write4lpu, channel2consume4lpu, channel2publish4lpu)
# print("(Step 21B/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", manoeuvre2readimage4lpu)
# except:
# print("(Step 21Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# # ---------------------------------------------------------------------------------------
# # (22) RECEIVE CONTROL & COMMAND READY VIA PIPE
# # ---------------------------------------------------------------------------------------
# print('(Step 22A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4LPU ', time4xi())
# try:
# channel2consume4lpu = response4write2image['CONSUMERCHANNEL']
# message2writereceive4lpu = channel2consume4lpu.recv()
# print("(Step 22B/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel2consume4lpu, " CONTROL & COMMAND: ", message2writereceive4lpu)
# # write2write4lpu
# except:
# print('(Step 22Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4LPU ', time4xi())
# # -----------------------------------------------------------------------------------------
# # (24) PUT IMAGE PATH TO QUEUE
# # -----------------------------------------------------------------------------------------
# print("(Step 24A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PUT IMAGE PATH TO QUEUE ", time4xi())
# try:
# queue2write4dragon.put(path2dragon)
# print("(Step 24B/700) OF DRAGON2IMAGE4XI5TEST - PUT TO QUEUE IMAGE PATH: ", path2dragon)
# # ..//..//..//..//..//web//images//png//dragonxi.png
# except:
# print("(Step 24Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
# # ------------------------------------------------------------------------------------------------------
# # (25) LET MANOEUVRE2IMAGE4LPU TO GET FROM QUEUE AND TO SEND EITHER ACK OR NACK VIA PIPE
# # -------------------------------------------------------------------------------------------------------
# print("(Step 25A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# try:
# response2manoeuvre4lpu = manoeuvre2readimage4lpu(queue2write4lpu, channel2consume4lpu, channel2publish4lpu)
# print("(Step 25B/700) OF LPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", manoeuvre2readimage4lpu)
# except:
# print("(Step 25Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (26) RECEIVE ACK OR NACK ABOUT IMAGE OPERATION VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 26A/700) OF LPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2writereceive4lpu = channel2consume4lpu.recv()
# print("(Step 26D/700) OF LPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4LPU: ", channel2consume4lpu, " CONTROL & COMMAND: ", message2writereceive4lpu)
# # ack2imageinfo4lpu
# except:
# print('(Step 26Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# # -------------------------------------------------------------------------------------------------------
# # (27) LET MANOEUVRE2IMAGE4LPU GO TO STATE 0
# # -------------------------------------------------------------------------------------------------------
# print("(Step 27A/700) OF LPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
# try:
# response2manoeuvre4lpu = manoeuvre2readimage4lpu(queue2write4lpu, channel2consume4lpu, channel2publish4lpu)
# print("(Step 27B/700) OF LPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4LPU ", response2manoeuvre4lpu)
# except:
# print("(Step 27Z/700) OF LPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4LPU ", time4xi())
#">
# -------------------------------------------------------------------------------------------------
def write2image4lpu(task4imagewrite2lpu=None):
'''
writes 2D images for LPU
'''
global lpu2image4xi # 2D-IMAGES FOR LPU
global control2writeimage4lpu # COMMAND AND CONTROL FOR LPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "write2image4lpu"
method2print = "write2image4lpu"
message2print = "{(Step 1A/33) started" + "; write2image4lpu-started: " + str(write2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4imagewrite2lpu-to-write2image4lpu: " + str(task4imagewrite2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE LPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if lpu2image4xi is None:
lpu2image4xi = create2image4lpu() # INITIALIZE IMAGE FOR LPU
message2print = "{(Step 1C/70) created" + "; lpu2image4xi-created-by-write2image4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4lpu-skipped-by-write2image4lpu: " + str(write2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# create2image4lpu-skipped-by-write2image4lpu:
except:
try:
lpu2image4xi = create2image4lpu()
message2print = "{(Step 1E/70) set" + "; lpu2image4xi-set-by-write2image4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
lpu2image4xi = {}
message2print = "{(Step 1Z/70) yielded" + "; lpu2image4xi-yielded-by-write2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - CHECK PARAMETERS
# -----------------------------------------------------------------------------------------
try:
if task4imagewrite2lpu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR READ - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4imagewrite2lpu = {}
message2print = "{(Step 1A/70) initialized" + "; task4imagewrite2lpu-created-by-write2image4lpu to: " + str(task4imagewrite2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4lpu = trace2image4lpu # CALLBACK FUNCTION FOR LPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4lpu-created-by-write2image4lpu to: " + str(function2callback4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "write2image4lpu" # MODULE OF LPUIZED OPENCL MODULE
args2callback['METHOD'] = "write2image4lpu" # FUNCTION OF LPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; write2image4lpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR LPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-write2image4lpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; write2image4lpu-failed ; time: 02:32:29 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'write2image4lpu',
# 'METHOD': 'write2image4lpu'}; time: 02:32:29 10/05/11 Pacific Daylight Time}
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagewrite2lpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO LPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagewrite2lpu['FUNCTION2CALLBACK'] = function2callback4lpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4imagewrite2lpu-created-by-write2image4lpu to: " + str(task4imagewrite2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; write2image4lpu-failed ; time: 02:32:29 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'write2image4lpu',
# 'METHOD': 'write2image4lpu'}}; time: 02:32:29 10/05/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-write2image4lpu to: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
try:
platform2xi = get2platformids4xi() # PLATFORM IS COMMON TO ALL DEVICES I.E TO DEVICE XI
message2print = "{(Step 2B/70) got" + "; platform2xi-got-by-write2image4lpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'list2platforms': ['DragonXi'], 'ack2return': ' 2C-2E-2F-2G-', 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1}; time: 02:32:29 10/05/11 Pacific Daylight Time}
code2ack = code2ack + '2B-'
except:
message2print = "{(Step 2Z/70) failed" + "; platform2xi-failed-by-write2image4lpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4imagewrite2lpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2lpu = {}
message2print = "{(Step 3A/70) trying" + "; context2lpu-trying-by-write2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2lpu = get2context4lpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2lpu-got-by-write2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4lpu-failed ; time: 02:32:29 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4lpu', ...
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2lpu-failed-by-write2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4imagewrite2lpu ['CONTEXT'] = context2lpu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2lpu = {}
message2print = "{(Step 4A/70) trying" + "; device2lpu-trying-by-write2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2lpu = get2lpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2lpu-got-by-write2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'RESOLUTION2TIMER4PROFILING': 318, 'ID2PLATFORM': '0000000001509568' ...
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2lpu-failed-by-write2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4imagewrite2lpu ['DEVICE'] = device2lpu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2lpu = {}
message2print = "{(Step 5A/70) trying" + "; imageinfo2lpu-trying-by-write2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2lpu = get2imageinfo4lpu()
message2print = "{(Step 5B/70) got" + "; imageinfo2lpu-got-by-write2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'SIZE2QUEUE': 2147483646,
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8',
# 'ORDER': 'CL_RGBA'},
# 'QUEUE': ,
# 'WIDTH': 800,
# 'CONTEXT': {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4lpu-failed ; time: 02:32:29 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4lpu',
# 'METHOD': 'create2context4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 2A-2C-2D-2E-2B-3B-4B-5B-6B-7B-7B-',
# 'INFO2PRIVATE': None,
# 'PLATFORM': {'list2platforms': ['DragonXi'], 'ack2return': ' 2C-2E-2F-2G-', 'nack2return': ' ', 'available2platform': 1, 'max2entries': 1},
# 'NACK2RETURN': ' ',
# 'SIZE2PRIVATE': 0,
# 'PROPERTIES': None},
# 'PIPE': (, ),
# 'COUNT2REFERENCE': 1,
# 'FUNCTION2CALLBACK': ,
# 'COMMANDQUEUE': ...
code2ack = code2ack + '5B-'
except:
message2print = "{(Step 5Z/70) failed" + "; imageinfo2lpu-failed-by-write2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4imagewrite2lpu ['IMAGE'] = imageinfo2lpu
# ---------------------------------------------------------------------------------------------
# (6) QUEUE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
queue2lpu = None
message2print = "{(Step 6A/70) trying" + "; queue2lpu-trying-by-write2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2lpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 6B/70) got" + "; queue2lpu-got-by-write2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; queue2lpu-failed-by-write2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4imagewrite2lpu ['QUEUE'] = queue2lpu
# ---------------------------------------------------------------------------------------------
# (7) PIPE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
pipe2lpu = None
message2print = "{(Step 7A/70) trying" + "; pipe2lpu-trying-by-write2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2lpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 7B/70) got" + "; pipe2lpu-got-by-write2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; pipe2lpu-failed-by-write2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4imagewrite2lpu ['PIPE'] = pipe2lpu
# ---------------------------------------------------------------------------------------------
# (8) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2lpu = {}
message2print = "{(Step 8A/70) trying" + "; commandqueueinfo2lpu-trying-by-write2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2lpu = get2commandqueueinfo4lpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 8B/70) got" + "; commandqueueinfo2lpu-got-by-write2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2commandqueue4lpu-failed ; time: 02:32:29 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4lpu',
# 'METHOD': 'create2commandqueue4lpu'},
# 'FUNCTION2CALLBACK': ...
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; commandqueueinfo2lpu-failed-by-write2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4imagewrite2lpu ['COMMANDQUEUE'] = commandqueueinfo2lpu
# ---------------------------------------------------------------------------------------------
# (9) BUFFER - AUTOMATIC BY LPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2lpu = {}
message2print = "{(Step 9A/70) trying" + "; bufferinfo2lpu-trying-by-write2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2lpu = get2bufferinfo4lpu() # SYSTEM CREATES BUFFER FOR LPU, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; bufferinfo2lpu-got-by-write2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4lpu-failed ; time: 02:32:28 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4lpu',
# 'METHOD': 'create2buffer4lpu'}, ...
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; bufferinfo2lpu-failed-by-write2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4imagewrite2lpu ['BUFFER'] = bufferinfo2lpu
# ---------------------------------------------------------------------------------------------
# (10) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2lpu = {}
message2print = "{(Step 10A/70) trying" + "; eventinfo2lpu-trying-by-write2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2lpu = get2eventinfo4lpu()
message2print = "{(Step 10B/70) got" + "; eventinfo2lpu-got-by-write2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2event4lpu-failed ; time: 02:32:28 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2event4lpu',
# 'METHOD': 'create2event4lpu'},
# 'FUNCTION2CALLBACK': , ...
code2ack = code2ack + '10B-'
except:
message2print = "{(Step 10Z/70) failed" + "; eventinfo2lpu-failed-by-write2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '10Z-'
task4imagewrite2lpu ['EVENT'] = eventinfo2lpu
# ---------------------------------------------------------------------------------------------
# (11) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2lpu = {}
message2print = "{(Step 11A/70) trying" + "; eventwaitlist2lpu-trying-by-write2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2lpu = {}
message2print = "{(Step 11B/70) set" + "; eventwaitlist2lpu-set-by-write2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; eventwaitlist2lpu-failed-by-write2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4imagewrite2lpu ['EVENTWAITLIST'] = eventwaitlist2lpu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2lpu = 0
message2print = "{(Step 12A/70) trying" + "; eventwaitlistquantity2lpu-trying-by-write2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2lpu.keys()
for key2event in keys2event:
eventwaitlistquantity2lpu = eventwaitlistquantity2lpu + 1
message2print = "{(Step 12B/70) set" + "; eventwaitlistquantity2lpu-set-by-write2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlistquantity2lpu-failed-by-write2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4imagewrite2lpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2lpu
# ---------------------------------------------------------------------------------------------
# (13) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2lpu = ' '
message2print = "{(Step 13A/70) trying" + "; blocking2lpu-trying-by-write2image4lpu: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2lpu = 'CL_FALSE' # the write command is non-blocking
message2print = "{(Step 13B/70) set" + "; blocking2lpu-set-by-write2image4lpu to: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# CL_FALSE
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; blocking2lpu-failed-by-write2image4lpu: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4imagewrite2lpu ['BLOCKING'] = blocking2lpu
# ---------------------------------------------------------------------------------------------
# (14) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2lpu = {}
message2print = "{(Step 14A/70) trying" + "; origin2lpu-trying-by-write2image4lpu: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2lpu['X'] = 0
origin2lpu['Y'] = 0
origin2lpu['Z'] = 0
message2print = "{(Step 14B/70) set" + "; origin2lpu-set-by-write2image4lpu to: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 0, 'X': 0, 'Z': 0}
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; origin2lpu-failed-by-write2image4lpu: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4imagewrite2lpu ['ORIGIN'] = origin2lpu
# ---------------------------------------------------------------------------------------------
# (15) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2lpu = {}
message2print = "{(Step 15A/70) trying" + "; region2lpu-trying-by-write2image4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2lpu['X'] = 160 # WIDTH IN PIXELS TO READ
region2lpu['Y'] = 90 # HEIGHT IN PIXELS TO READ
region2lpu['Z'] = 0 # DEPTH IN PIXELS TO READ
message2print = "{(Step 15B/70) set" + "; region2lpu-set-by-write2image4lpu to: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 90, 'X': 160, 'Z': 0}
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; region2lpu-failed-by-write2image4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '15Z-'
task4imagewrite2lpu ['REGION'] = region2lpu
# ---------------------------------------------------------------------------------------------
# (16) ROWPITCH (STRIDE) - REQUIRED
# ---------------------------------------------------------------------------------------------
# One can assume that memory representing an image or screen will have data laid out as one row of pixels followed directly by the next row of pixels.
# However many APIs (e.g. Direct3D) that return a pointer to image data add an extra block of data at the end of each row.
# int offset = x * bytesPerPixel + y * pitch;
# When a video image is stored in memory, the memory buffer might contain extra padding bytes after each row of pixels.
# The padding bytes affect how the image is stored in memory, but do not affect how the image is displayed.
# The stride is the number of bytes from one row of pixels in memory to the next row of pixels in memory.
# Stride is also called pitch.
# If padding bytes are present, the stride is wider than the width of the image, as shown in the following illustration.
height2lpu = 800
width2lpu = 800
rowpitch2lpu = 0
size2element = 1 # VOXEL (X,Y,Z) = SHOT IN PIXELS, R=1 PIXELS
voxelquantity2layer = 1 # MAX NUMBER OF VOXELS IN EACH 2D LAYER
quantity2direction = 1 # ONE DIRECTIONS IN 2D
message2print = "{(Step 16A/70) trying" + "; rowpitch2lpu-trying-by-write2image4lpu: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2lpu = int(width2lpu * size2element * voxelquantity2layer / quantity2direction) # (800 * 8 * 10) / 8 = 8K PIXELS MAX TO SCAN
# SPHERE IS SPARSE HAVING FEW SHOTS PER SCAN LINE
message2print = "{(Step 16B/70) set" + "; rowpitch2lpu-set-by-write2image4lpu to: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; rowpitch2lpu-failed-by-write2image4lpu: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '16Z-'
task4imagewrite2lpu ['ROWPITCH'] = rowpitch2lpu
# ----------------------------------------------------------------------------------------------------
# (17) POINTER - REQUIRED - THE POINTER TO A BUFFER IN HOST MEMORY WHERE IMAGE DATA IS TO BE READ FROM
# ----------------------------------------------------------------------------------------------------
pointer2lpu = None
size2lpu = int(width2lpu * height2lpu) # CALCULATED MEMORY
if size2lpu == 0:
size2lpu = 4400 # MINIMUM MEMORY
message2print = "{(Step 17A/70) trying" + "; pointer2lpu-trying-by-write2image4lpu: " + str(pointer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
arena2lpu = Arena4Xi(size2lpu) # SYSTEM RESERVER MEMORY FOR IMAGE
message2print = "{(Step 17B/70) got" + "; arena2lpu-got-by-write2image4lpu: " + str(arena2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
size2arena = arena2lpu.size #
message2print = "{(Step 17C/70) got" + "; size2arena-got-by-write2buffer4lpu: " + str(size2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 640000
buffer2arena = arena2lpu.buffer
message2print = "{(Step 17D/70) got" + "; buffer2arena-got-by-write2buffer4lpu: " + str(buffer2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17D-'
if size2arena < size2lpu:
size2lpu = size2arena # AVAILABLE MEMORY FOR IMAGE
message2print = "{(Step 17E/70) set" + "; size2lpu-set-by-write2buffer4lpu to: " + str(size2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17E-'
else:
pass
pointer2lpu = buffer2arena
message2print = "{(Step 17F/70) set" + "; pointer2lpu-set-by-write2buffer4lpu to: " + str(pointer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17F-'
except:
message2print = "{(Step 17Z/70) failed" + "; pointer2lpu-failed-by-write2image4lpu: " + str(pointer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '17Z-'
task4imagewrite2lpu ['POINTER'] = pointer2lpu
task4imagewrite2lpu ['SIZE'] = size2lpu # AUTOMATIC BY LPUXI
# --------------------------------------------------------------------------------------------------------
# (18) SLICEPITCH - REQUIRED - THE SIZE IN BYTES OF THE 2D SLICE OF THE 3D REGION OF A 3D IMAGE BEING READ
# --------------------------------------------------------------------------------------------------------
slicepitch2lpu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 18A/70) trying" + "; slicepitch2lpu-trying-by-write2image4lpu: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2lpu = 0
message2print = "{(Step 18B/70) set" + "; slicepitch2lpu-set-by-write2image4lpu to: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '18B-'
except:
message2print = "{(Step 18Z/70) failed" + "; slicepitch2lpu-failed-by-write2image4lpu: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '18Z-'
task4imagewrite2lpu ['SLICEPITCH'] = slicepitch2lpu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
else:
pass
# ---------------------------------------------------------------------------------------------
# CHECK PARAMETERS - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4imagewrite2lpu.keys()
message2print = "{(Step 20/70) using" + "; keys2task-using-by-write2image4lpu: " + str(sorted(keys2task)) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ['BLOCKING',
# 'BUFFER',
# 'COMMANDQUEUE',
# 'CONTEXT',
# 'DATA2CALLBACK',
# 'DEVICE',
# 'EVENT',
# 'EVENTWAITLIST',
# 'EVENTWAITLISTQUANTITY',
# 'FUNCTION2CALLBACK',
# 'IMAGE',
# 'ORIGIN',
# 'PIPE',
# 'PLATFORM',
# 'POINTER',
# 'QUEUE',
# 'REGION',
# 'ROWPITCH',
# 'SIZE',
# 'SLICEPITCH']; time: 02:45:31 10/05/11 Pacific Daylight Time}
if (('DATA2CALLBACK' in keys2task) and ('FUNCTION2CALLBACK' in keys2task)):
pass
else:
# ---------------------------------------------------------------------------------------------
# (21B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4lpu = trace2image4lpu # CALLBACK FUNCTION FOR LPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4lpu-created-by-write2image4lpu to: " + str(function2callback4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "write2image4lpu" # MODULE OF LPUIZED OPENCL MODULE
args2callback['METHOD'] = "write2image4lpu" # FUNCTION OF LPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; write2image4lpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR LPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-write2image4lpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagewrite2lpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO LPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagewrite2lpu['FUNCTION2CALLBACK'] = function2callback4lpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4imagewrite2lpu-created-by-write2image4lpu to: " + str(task4imagewrite2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-write2image4lpu to: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
platform2xi = get2platformids4xi() # PLATFORM IS COMMON TO ALL DEVICES I.E TO DEVICE XI
message2print = "{(Step 22B/70) got" + "; platform2xi-got-by-write2image4lpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-write2image4lpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4imagewrite2lpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2lpu = {}
message2print = "{(Step 23A/70) trying" + "; context2lpu-trying-by-write2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2lpu = get2context4lpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2lpu-got-by-write2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2lpu-failed-by-write2image4lpu: " + str(context2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4imagewrite2lpu ['CONTEXT'] = context2lpu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2lpu = {}
message2print = "{(Step 24A/70) trying" + "; device2lpu-trying-by-write2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2lpu = get2lpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2lpu-got-by-write2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2lpu-failed-by-write2image4lpu: " + str(device2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4imagewrite2lpu ['DEVICE'] = device2lpu
if 'IMAGE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2lpu = {}
message2print = "{(Step 25A/70) trying" + "; imageinfo2lpu-trying-by-write2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2lpu = get2imageinfo4lpu()
message2print = "{(Step 25B/70) got" + "; imageinfo2lpu-got-by-write2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; imageinfo2lpu-failed-by-write2image4lpu: " + str(imageinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4imagewrite2lpu ['IMAGE'] = imageinfo2lpu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) QUEUE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
queue2lpu = None
message2print = "{(Step 26A/70) trying" + "; queue2lpu-trying-by-write2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2lpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 26B/70) got" + "; queue2lpu-got-by-write2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; queue2lpu-failed-by-write2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4imagewrite2lpu ['QUEUE'] = queue2lpu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) PIPE - REQUIRED BY LPUXI
# ---------------------------------------------------------------------------------------------
pipe2lpu = None
message2print = "{(Step 27A/70) trying" + "; pipe2lpu-trying-by-write2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2lpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 27B/70) got" + "; pipe2lpu-got-by-write2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; pipe2lpu-failed-by-write2image4lpu: " + str(pipe2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4imagewrite2lpu ['PIPE'] = pipe2lpu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2lpu = {}
message2print = "{(Step 28A/70) trying" + "; commandqueueinfo2lpu-trying-by-write2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2lpu = get2commandqueueinfo4lpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 28B/70) got" + "; commandqueueinfo2lpu-got-by-write2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; commandqueueinfo2lpu-failed-by-write2image4lpu: " + str(commandqueueinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4imagewrite2lpu ['COMMANDQUEUE'] = commandqueueinfo2lpu
if 'BUFFER' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (29) BUFFER - AUTOMATIC BY LPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2lpu = {}
message2print = "{(Step 29A/70) trying" + "; bufferinfo2lpu-trying-by-write2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2lpu = get2bufferinfo4lpu() # SYSTEM CREATES BUFFER FOR LPU, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; bufferinfo2lpu-got-by-write2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; bufferinfo2lpu-failed-by-write2image4lpu: " + str(bufferinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4imagewrite2lpu ['BUFFER'] = bufferinfo2lpu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (30) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2lpu = {}
message2print = "{(Step 30A/70) trying" + "; eventinfo2lpu-trying-by-write2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2lpu = get2eventinfo4lpu()
message2print = "{(Step 30B/70) got" + "; eventinfo2lpu-got-by-write2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '30B-'
except:
message2print = "{(Step 30Z/70) failed" + "; eventinfo2lpu-failed-by-write2image4lpu: " + str(eventinfo2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '30Z-'
task4imagewrite2lpu ['EVENT'] = eventinfo2lpu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2lpu = {}
message2print = "{(Step 31A/70) trying" + "; eventwaitlist2lpu-trying-by-write2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2lpu = {}
message2print = "{(Step 31B/70) set" + "; eventwaitlist2lpu-set-by-write2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventwaitlist2lpu-failed-by-write2image4lpu: " + str(eventwaitlist2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4imagewrite2lpu ['EVENTWAITLIST'] = eventwaitlist2lpu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2lpu = 0
message2print = "{(Step 32A/70) trying" + "; eventwaitlistquantity2lpu-trying-by-write2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2lpu.keys()
for key2event in keys2event:
eventwaitlistquantity2lpu = eventwaitlistquantity2lpu + 1
message2print = "{(Step 32B/70) set" + "; eventwaitlistquantity2lpu-set-by-write2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlistquantity2lpu-failed-by-write2image4lpu: " + str(eventwaitlistquantity2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4imagewrite2lpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2lpu
if 'BLOCKING' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2lpu = ' '
message2print = "{(Step 33A/70) trying" + "; blocking2lpu-trying-by-write2image4lpu: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2lpu = 'CL_FALSE' # the write command is non-blocking
message2print = "{(Step 33B/70) set" + "; blocking2lpu-set-by-write2image4lpu to: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; blocking2lpu-failed-by-write2image4lpu: " + str(blocking2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4imagewrite2lpu ['BLOCKING'] = blocking2lpu
if 'ORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2lpu = {}
message2print = "{(Step 34A/70) trying" + "; origin2lpu-trying-by-write2image4lpu: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2lpu['X'] = 0
origin2lpu['Y'] = 0
origin2lpu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; origin2lpu-set-by-write2image4lpu to: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; origin2lpu-failed-by-write2image4lpu: " + str(origin2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4imagewrite2lpu ['ORIGIN'] = origin2lpu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (35) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2lpu = {}
message2print = "{(Step 35A/70) trying" + "; region2lpu-trying-by-write2image4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2lpu['X'] = 160 # WIDTH IN PIXELS TO WRITE
region2lpu['Y'] = 90 # HEIGHT IN PIXELS TO WRITE
region2lpu['Z'] = 0 # DEPTH IN PIXELS TO WRITE
message2print = "{(Step 35B/70) set" + "; region2lpu-set-by-write2image4lpu to: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '35B-'
except:
message2print = "{(Step 35Z/70) failed" + "; region2lpu-failed-by-write2image4lpu: " + str(region2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '35Z-'
task4imagewrite2lpu ['REGION'] = region2lpu
if 'ROWPITCH' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (36) ROWPITCH (STRIDE) - REQUIRED
# ---------------------------------------------------------------------------------------------
# One can assume that memory representing an image or screen will have data laid out as one row of pixels followed directly by the next row of pixels.
# However many APIs (e.g. Direct3D) that return a pointer to image data add an extra block of data at the end of each row.
# int offset = x * bytesPerPixel + y * pitch;
# When a video image is stored in memory, the memory buffer might contain extra padding bytes after each row of pixels.
# The padding bytes affect how the image is stored in memory, but do not affect how the image is displayed.
# The stride is the number of bytes from one row of pixels in memory to the next row of pixels in memory.
# Stride is also called pitch.
# If padding bytes are present, the stride is wider than the width of the image, as shown in the following illustration.
rowpitch2lpu = 0
size2element = 1 # VOXEL (X,Y,Z) = SHOT IN PIXELS, R=1 PIXELS
voxelquantity2layer = 1 # MAX NUMBER OF VOXELS IN EACH 2D LAYER
quantity2direction = 1 # ONE DIRECTIONS IN 2D
message2print = "{(Step 36A/70) trying" + "; rowpitch2lpu-trying-by-write2image4lpu: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2lpu = int(width2lpu * size2element * voxelquantity2layer / quantity2direction) # (800 * 8 * 10) / 8 = 8K PIXELS MAX TO SCAN
# SPHERE IS SPARSE HAVING FEW SHOTS PER SCAN LINE
message2print = "{(Step 36B/70) set" + "; rowpitch2lpu-set-by-write2image4lpu to: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; rowpitch2lpu-failed-by-write2image4lpu: " + str(rowpitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '36Z-'
task4imagewrite2lpu ['ROWPITCH'] = rowpitch2lpu
if 'POINTER' in keys2task:
pass
else:
# ----------------------------------------------------------------------------------------------------
# (37) POINTER - REQUIRED - THE POINTER TO A BUFFER IN HOST MEMORY WHERE IMAGE DATA IS TO BE READ FROM
# ----------------------------------------------------------------------------------------------------
pointer2lpu = None
size2lpu = int(width2lpu * height2lpu) # CALCULATED MEMORY
if size2lpu == 0:
size2lpu = 4400 # MINIMUM MEMORY
message2print = "{(Step 37A/70) trying" + "; pointer2lpu-trying-by-write2image4lpu: " + str(pointer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
arena2lpu = Arena4Xi(size2lpu) # SYSTEM RESERVER MEMORY FOR IMAGE
message2print = "{(Step 37B/70) got" + "; arena2lpu-got-by-write2image4lpu: " + str(arena2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
size2arena = arena2lpu.size #
message2print = "{(Step 37C/70) got" + "; size2arena-got-by-write2buffer4lpu: " + str(size2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
buffer2arena = arena2lpu.buffer
message2print = "{(Step 37D/70) got" + "; buffer2arena-got-by-write2buffer4lpu: " + str(buffer2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37D-'
if size2arena < size2lpu:
size2lpu = size2arena # AVAILABLE MEMORY FOR IMAGE
message2print = "{(Step 37E/70) set" + "; size2lpu-set-by-write2buffer4lpu to: " + str(size2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37E-'
else:
pass
pointer2lpu = buffer2arena
message2print = "{(Step 37F/70) set" + "; pointer2lpu-set-by-write2buffer4lpu to: " + str(pointer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37F-'
except:
message2print = "{(Step 37Z/70) failed" + "; pointer2lpu-failed-by-write2image4lpu: " + str(pointer2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '37Z-'
task4imagewrite2lpu ['POINTER'] = pointer2lpu
task4imagewrite2lpu ['SIZE'] = size2lpu # AUTOMATIC BY LPUXI
if 'SLICEPITCH' in keys2task:
pass
else:
# --------------------------------------------------------------------------------------------------------
# (38) SLICEPITCH - REQUIRED - THE SIZE IN BYTES OF THE 2D SLICE OF THE 3D REGION OF A 3D IMAGE BEING READ
# --------------------------------------------------------------------------------------------------------
slicepitch2lpu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 38A/70) trying" + "; slicepitch2lpu-trying-by-write2image4lpu: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2lpu = 0
message2print = "{(Step 38B/70) set" + "; slicepitch2lpu-set-by-write2image4lpu to: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '38B-'
except:
message2print = "{(Step 38Z/70) failed" + "; slicepitch2lpu-failed-by-write2image4lpu: " + str(slicepitch2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '38Z-'
task4imagewrite2lpu ['SLICEPITCH'] = slicepitch2lpu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER CHECKING AND PROVIDING FOR MISSING ONES
# ---------------------------------------------------------------------------------------------
keys2task = task4imagewrite2lpu.keys()
message2print = "{(Step 39/70) set" + "; keys2task-set-by-write2image4lpu to: " + str(sorted(keys2task)) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ['BLOCKING',
# 'BUFFER',
# 'COMMANDQUEUE',
# 'CONTEXT',
# 'DATA2CALLBACK',
# 'DEVICE',
# 'EVENT',
# 'EVENTWAITLIST',
# 'EVENTWAITLISTQUANTITY',
# 'FUNCTION2CALLBACK',
# 'IMAGE',
# 'ORIGIN',
# 'PIPE',
# 'PLATFORM',
# 'POINTER',
# 'QUEUE',
# 'REGION',
# 'ROWPITCH',
# 'SIZE',
# 'SLICEPITCH']; time: 02:45:31 10/05/11 Pacific Daylight Time}
except:
message2print = "{(Step 39Z/70) yielded" + "; task4imagewrite2lpu-yielded-by-write2image4lpu: " + str(task4imagewrite2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '39Z-'
# ---------------------------------------------------------------------------------------------
# CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
control2writeimage4lpu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2lpu = False
channels2lpu = ()
message2print = "{(Step 40A/70) trying" + "channels2lpu-trying-by-write2image4lpu: " + str(channels2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
#
consumerchannel2lpu, publisherchannel2lpu = task4imagewrite2lpu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2lpu-got-by-write2image4lpu: " + str(consumerchannel2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2lpu-got-by-write2image4lpu: " + str(publisherchannel2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2lpu = True
control2writeimage4lpu['CONSUMERCHANNEL'] = consumerchannel2lpu
control2writeimage4lpu['PUBLISHERCHANNEL'] = publisherchannel2lpu
code2ack = code2ack + '40D-'
except:
ack4channels2lpu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2lpu = False
queue2lpu = None
message2print = "{(Step 41A/70) trying" + "queue2lpu-trying-by-write2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2lpu = task4imagewrite2lpu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2lpu-got-by-write2image4lpu: " + str(queue2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2lpu = True
control2writeimage4lpu['QUEUE'] = queue2lpu
code2ack = code2ack + '41C-'
except:
ack4queue2lpu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4lpu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4lpu-trying-by-write2image4lpu: " + str(dummy2image4lpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4lpu = DummyProcess4Xi(target=manoeuvre2readimage4lpu, # in this module to handle queue and pipe channels
# args =(queue2lpu, # caller puts and gets - does NOT call any functions
# consumerchannel2lpu, publisherchannel2lpu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4lpu-created-by-write2image4lpu: " + str(dummy2image4lpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# code2ack = code2ack + '69B-'
# except:
# code2nack = code2nack + '69Z-'
# ---------------------------------------------------------------------------------------------
# RETURN CONTROL AND COMMAND DICTIONARY
# ---------------------------------------------------------------------------------------------
message2print = "{(Step 70A/70) set" + "; code2ack-set-by-write2image4lpu: " + str(code2ack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1B1-1B2-1C-2B-3B-4B-5B-6B-7B-8B-9B-10B-11B-12B-13B-14B-15B-16B-17D-17F-18B-40D-41C-
message2print = "{(Step 70B/70) set" + "; code2nack-set-by-write2image4lpu: " + str(code2nack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70C/70) returning" + "; control2writeimage4lpu-returning-by-write2image4lpu: " + str(control2writeimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 02:45:31 10/05/11 Pacific Daylight Time}
return control2writeimage4lpu
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def release2image4lpu(task4release2lpu=None):
'''
releases lpu2image4xi
'''
global lpu2image4xi
global code2ack
global code2nack
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "release2image4lpu"
method2print = "release2image4lpu"
message2print = "{(Step 1A/33) started" + "; release2image4lpu-started: " + str(release2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4release2lpu-to-release2image4lpu: " + str(task4release2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 1}
code2ack = ' '
code2nack = ' '
try:
if lpu2image4xi is None:
lpu2image4xi = create2image4lpu() # INITIALIZE IMAGE
except:
try:
lpu2image4xi = create2image4lpu()
except:
lpu2image4xi = {}
message2print = "{(Step 2Z0/70) yielded" + "; lpu2image4xi-yielded-by-release2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z0-'
message2print = "{(Step 1A/70) try" + "; release-try-by-release2image4lpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
if task4release2lpu is None:
task4release2lpu = {}
task4release2lpu['COUNT2REFERENCE'] = 1
try:
# -----------------------------------------------------------------------------------------
# RELEASE
# -----------------------------------------------------------------------------------------
lpu2image4xi['COUNT2REFERENCE'] = lpu2image4xi['COUNT2REFERENCE'] - task4release2lpu['COUNT2REFERENCE']
message2print = "{(Step 1A/70) calculated" + "; count2reference-calculated-by-release2image4lpu: " + str(lpu2image4xi['COUNT2REFERENCE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if lpu2image4xi['COUNT2REFERENCE'] < 0:
lpu2image4xi['COUNT2REFERENCE'] = 0
message2print = "{(Step 1B/70) warning" + "; count2reference-warning-by-release2image4lpu: " + " ** " + str(lpu2image4xi['COUNT2REFERENCE']) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# { release2image4lpu : release2image4lpu ; (Step 8Z1/70) warning; count2reference-warning-by-release2image4lpu: ** 0 ** ; time: 23:41:37 09/06/11 Pacific Daylight Time}
code2nack = code2nack + '1B-'
else:
code2ack = code2ack + '1B-'
except:
try:
lpu2image4xi['COUNT2REFERENCE'] = 0
message2print = "{(Step 8Z1/70) warning" + "; count2reference-warning-by-release2image4lpu: " + " ** " + str(lpu2image4xi['COUNT2REFERENCE']) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '8Z1-'
except:
message2print = "{(Step 8Z2/70) yielded" + "; lpu2image4xi-yielded-by-release2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z2-'
# -----------------------------------------------------------------------------------------
# (Step 70/70)
# -----------------------------------------------------------------------------------------
lpu2image4xi ['ACK2RETURN'] = code2ack
lpu2image4xi ['NACK2RETURN'] = code2nack
message2print = "{(Step 70/70) returning" + "; lpu2image4xi-returning-by-release2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'ACK2RETURN': ' ',
# 'ROWPITCH': 800,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4lpu-failed ; time: 23:41:37 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4lpu',
# 'METHOD': 'create2image4lpu'},
# 'WIDTH': 800,
# 'BUFFER': {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4lpu-failed ; time: 23:41:37 09/06/11 Pacific Daylight Time}', 'CLASS': 'create2buffer4lpu', 'METHOD': 'create2buffer4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0, 'CONTEXT': {'COUNT2REFERENCE': 0, ...
return lpu2image4xi
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def retain2image4lpu(task4retain2lpu=None):
'''
retains either lpu2image4xi
'''
global lpu2image4xi
global code2ack
global code2nack
# -----------------------------------------------------------------------------------------
# (Step 1/70) - PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "retain2image4lpu"
method2print = "retain2image4lpu"
message2print = "{(Step 1A/33) started" + "; retain2image4lpu-started: " + str(retain2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4retain2lpu-to-retain2image4lpu: " + str(task4retain2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 1, 'DIMENSION': 2}
# {'COUNT2REFERENCE': 1, 'DIMENSION': 3}
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# (Step 2/70) - PROVIDE TASKS, IF NECESSARY AND CHECK GIVEN TASKS
# -----------------------------------------------------------------------------------------
if task4retain2lpu is None:
task4retain2lpu = {}
task4retain2lpu['DIMENSION'] = 2
task4retain2lpu['COUNT2REFERENCE'] = 1
message2print = "{(Step 2A/33) set" + "; task4retain2lpu-set-by-retain2image4lpu to: " + str(task4retain2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
pass
if 'DIMENSION' in task4retain2lpu.keys():
if task4retain2lpu['DIMENSION'] == 2:
pass
else:
task4retain2lpu['DIMENSION'] = 2
message2print = "{(Step 2B/33) set" + "; dimension-set-by-retain2image4lpu to: " + str(task4retain2lpu['DIMENSION']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
task4retain2lpu['DIMENSION'] = 2
# -----------------------------------------------------------------------------------------
# (Step 3/70) - CHECK COUNT2REFERENCE
# -----------------------------------------------------------------------------------------
if 'COUNT2REFERENCE' in task4retain2lpu.keys():
pass
else:
task4retain2lpu['COUNT2REFERENCE'] = 1
message2print = "{(Step 3A/33) set" + "; count2reference-set-by-retain2image4lpu to: " + str(task4retain2lpu['COUNT2REFERENCE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if task4retain2lpu['COUNT2REFERENCE'] < 1:
task4retain2lpu['COUNT2REFERENCE'] = 1
message2print = "{(Step 3B/33) set" + "; count2reference-set-by-retain2image4lpu to: " + str(task4retain2lpu['COUNT2REFERENCE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 4/70) - INITIALIZE 2D IMAGE IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if lpu2image4xi is None:
lpu2image4xi = create2image4lpu()
message2print = "{(Step 4A/70) created" + "; lpu2image4xi-created-by-retain2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
except:
try:
lpu2image4xi = create2image4lpu()
message2print = "{(Step 4B/70) created" + "; lpu2image4xi-created-by-retain2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
except:
lpu2image4xi = {}
message2print = "{(Step 4Z/70) yielded" + "; lpu2image4xi-yielded-by-retain2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
# -----------------------------------------------------------------------------------------
# (Step 5/70) - RETAIN
# -----------------------------------------------------------------------------------------
try:
lpu2image4xi['COUNT2REFERENCE'] = lpu2image4xi['COUNT2REFERENCE'] + task4retain2lpu['COUNT2REFERENCE']
message2print = "{(Step 6A/70) calculated" + "; count2reference-calculated-by-retain2image4lpu: " + str(lpu2image4xi['COUNT2REFERENCE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if lpu2image4xi['COUNT2REFERENCE'] <= 0:
lpu2image4xi['COUNT2REFERENCE'] = 1
message2print = "{(Step 6Z1/70) warning" + "; count2reference-warning-by-retain2image4lpu: " + " ** " + str(lpu2image4xi['COUNT2REFERENCE']) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z1-'
else:
code2ack = code2ack + '6C-'
except:
try:
lpu2image4xi['COUNT2REFERENCE'] = 1
message2print = "{(Step 7Z1/70) warning" + "; count2reference-warning-by-retain2image4lpu: " + " ** " + str(lpu2image4xi['COUNT2REFERENCE']) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z1-'
except:
message2print = "{(Step 7Z2/70) yielded" + "; lpu2image4xi-yielded-by-retain2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z2-'
# -----------------------------------------------------------------------------------------
# (Step 70/70) - RETURN
# -----------------------------------------------------------------------------------------
lpu2image4xi ['ACK2RETURN'] = code2ack
lpu2image4xi ['NACK2RETURN'] = code2nack
message2print = "{(Step 70A/70) returning" + "; lpu2image4xi-returning-by-retain2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'ACK2RETURN': ' 6C-', 'ROWPITCH': 800, 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4lpu-failed ; time: 23:25:02 10/05/11 Pacific Daylight Time}', 'CLASS': 'create2image4lpu', 'METHOD': 'create2image4lpu'}, 'WIDTH': 800, 'BUFFER': {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0, ...
# 'COUNT2REFERENCE': 1,
# 'FLAGS': 0, 'CONTEXT': ...
return lpu2image4xi
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def get2imageinfo4lpu(task4getinfo2image=None):
'''
gets lpu2image4xi
'''
global lpu2image4xi
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "get2imageinfo4lpu"
method2print = "get2imageinfo4lpu"
message2print = "{(Step 0A/33) started" + "; get2imageinfo4lpu-started: " + str(get2imageinfo4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0A/33) passed" + "; task4getinfo2image-passed-to-get2imageinfo4lpu: " + str(task4getinfo2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'WIDTH': 0, 'DIMENSION': 2, 'HEIGHT': 0}
# {'WIDTH': 0, 'DEPTH': 0, 'DIMENSION': 3, 'HEIGHT': 0}
# {'DOMAIN': 'ALL', 'DIMENSION': 2}
image2lpu = {}
try:
if lpu2image4xi is None:
# -------------------------------------------------------------------------------------
# INITIALIZE 2D IMAGE FOR LPU
# -------------------------------------------------------------------------------------
image2lpu = create2image4lpu()
message2print = "{(Step 1B2/33) initialized" + "; image2lpu-initialized-by-get2imageinfo4lpu to: " + str(image2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1B2/33) using" + "; lpu2image4xi-using-by-get2imageinfo4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'ACK2RETURN': ' 1D-1E-2C-2B-3B-4B-5B-6B-7B-8B-9B-10B-11B-14B-15B-16B-17B-17D-18B-18C-21A1-22B1-22C1-23B-24B-25B-26B-27B-28B-29B-30B-31B-34H-35H-36B-37B-38B-',
# 'ROWPITCH': 800,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4lpu-failed ; time: 09:05:31 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4lpu',
# 'METHOD': 'create2image4lpu'},
# 'WIDTH': 800,
# 'BUFFER': ...
# -------------------------------------------------------------------------------------
# RETURN THE WHOLE OR PART OF THE IMAGE INFO OF LPU
# -------------------------------------------------------------------------------------
dimension2xi = 0
if task4getinfo2image is None:
task4getinfo2image = {}
task4getinfo2image ['DIMENSION'] = 2
task4getinfo2image ['DOMAIN'] = 'ALL'
image2lpu = lpu2image4xi
message2print = "{(Step 1C/33) using" + "; image2lpu-got-by-get2imageinfo4lpu: " + str(image2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'DOMAIN': 'ALL',
# 'CONTEXT': ...
else:
pass
keys2task4imageinfo = task4getinfo2image.keys()
if 'DIMENSION' in keys2task4imageinfo:
dimension2xi = task4getinfo2image['DIMENSION']
if dimension2xi == 2:
pass
else:
dimension2xi = 2
else:
pass
if 'DOMAIN' in keys2task4imageinfo:
domain2xi = task4getinfo2image['DOMAIN']
if domain2xi == 'ALL':
pass
else:
domain2xi = 'ALL'
keys2domain = lpu2image4xi.keys()
for key2domain in keys2domain:
task4getinfo2image[key2domain] = lpu2image4xi[key2domain]
message2print = "{(Step 1C/33) using" + "; task4getinfo2image-using-by-get2imageinfo4lpu: " + str(task4getinfo2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
pass
keys2task = task4getinfo2image.keys()
for key2task in keys2task:
try:
message2print = "{(Step 2D2/33) using" + "; key2task-using-by-get2image4lpu: " + str(key2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# WIDTH; DIMENSION; HEIGHT
image2lpu [key2task] = lpu2image4xi[key2task]
message2print = "{(Step 2D2/33) set" + "; info-of-image2lpu-set-by-get2imageinfo4lpu to: " + str(image2lpu [key2task]) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800; 800
except:
message2print = "{(Step 2Z/70) yielded" + "; key2task-yielded-by-get2image4lpu: " + str(key2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# DIMENSION;
message2print = "{(Step 2Z2/70) using" + "; task4getinfo2image-using-by-get2image4lpu: " + str(task4getinfo2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 2Z3/70) using" + "; lpu2image4xi-using-by-get2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
try:
# -------------------------------------------------------------------------------------
# INITIALIZE
# -------------------------------------------------------------------------------------
image2lpu = create2image4lpu()
message2print = "{(Step 1F/33) initialized" + "; image2lpu-initialized-by-get2imageinfo4lpu to: " + str(image2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if task4getinfo2image is None:
image2lpu = lpu2image4xi
message2print = "{(Step 1G/33) got" + "; image2lpu-got-by-get2imageinfo4lpu: " + str(image2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
keys2task = task4getinfo2image.keys()
for key2task in keys2task:
try:
message2print = "{(Step HD2/33) using" + "; key2task-using-by-get2image4lpu: " + str(key2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
image2lpu [key2task] = lpu2image4xi[key2task]
message2print = "{(Step HD2/33) set" + "; info-of-image2lpu-set-by-get2imageinfo4lpu to: " + str(image2lpu [key2task]) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step HZ/70) yielded" + "; key2task-yielded-by-get2image4lpu: " + str(key2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
except:
image2lpu = {}
message2print = "{(Step 1Z3/70) yielded" + "; image2lpu-yielded-by-get2image4lpu: " + str(image2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 33/33) returning" + "; image2lpu-returning-by-get2imageinfo4lpu: " + str(image2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 2D: {'WIDTH': 800, 'HEIGHT': 800}
# 3D: {'WIDTH': 800, 'DEPTH': 800, 'HEIGHT': 800}
# 2D ALL: {'CODE2ERROR': 0,
# 'ROWPITCH': 800,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4lpu-failed ; time: 09:05:31 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4lpu',
# 'METHOD': 'create2image4lpu'},
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8',
# 'ORDER': 'CL_RGBA'},
# 'BUFFER': ...
# 3D ALL: {'PIPE': (, ),
# 'ROWPITCH': 800,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create3image4lpu-failed ; time: 09:05:31 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create3image4lpu',
# 'METHOD': 'create3image4lpu'},
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8',
# 'ORDER': 'CL_RGBA'},
# 'BUFFER': ....
# 'HEIGHT': 800,
# 'QUEUE': ,
# 'WIDTH': 800,
# 'DEPTH': 800,
# 'FLAGS': 0,
# 'CONTEXT': ...
return image2lpu
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def get2supportedimageformats4lpu(task4supportedimageformats2lpu=None):
'''
gets supported image formats for lpu
'''
global lpu2image4xi
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "get2supportedimageformats4lpu"
method2print = "get2supportedimageformats4lpu"
message2print = "{(Step 0A/33) started" + "; get2supportedimageformats4lpu-started: " + str(get2supportedimageformats4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0B/33) passed" + "; task4supportedimageformats2lpu-passed-to-get2supportedimageformats4lpu: " + str(task4supportedimageformats2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None; {'DIMENSION': 3}
if task4supportedimageformats2lpu is None:
task4supportedimageformats2lpu = {}
task4supportedimageformats2lpu['DIMENSION'] = 2 # 2D image is the default
dimension2xi = 2
try:
keys2supportedimageformats = task4supportedimageformats2lpu.keys()
if 'DIMENSION' in keys2supportedimageformats:
dimension2xi = task4supportedimageformats2lpu['DIMENSION']
if ((dimension2xi <=0) or (dimension2xi > 2)):
dimension2xi = 2
else:
dimension2xi = 2
except:
pass
message2print = "{(Step 1A/33) using" + "; dimension2xi-using-by-dimension2xi: " + str(dimension2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 2; 3
supportedimageformats2lpu = {}
try:
if lpu2image4xi is None:
# -------------------------------------------------------------------------------------
# INITIALIZE
# -------------------------------------------------------------------------------------
image2lpu = create2image4lpu() # create lpu2image4xi
message2print = "{(Step 1B/33) initialized" + "; image2lpu-initialized-by-get2supportedimageformats4lpu to: " + str(image2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
pass
# -------------------------------------------------------------------------------------
# SUPPORTED IMAGE FORMATS FOR LPU
# -------------------------------------------------------------------------------------
supportedimageformats2lpu = lpu2image4xi['FORMAT']
message2print = "{(Step 1E/33) got" + "; supportedimageformats2lpu-got-by-get2supportedimageformats4lpu: " + str(supportedimageformats2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'}
except:
try:
# -------------------------------------------------------------------------------------
# INITIALIZE
# -------------------------------------------------------------------------------------
image2lpu = create2image4lpu()
message2print = "{(Step 1F1/33) initialized" + "; image2lpu-initialized-by-get2supportedimageformats4lpu to: " + str(image2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -------------------------------------------------------------------------------------
# SUPPORTED IMAGE FORMATS FOR LPU
# -------------------------------------------------------------------------------------
supportedimageformats2lpu = lpu2image4xi['FORMAT']
message2print = "{(Step 1H/33) got" + "; supportedimageformats2lpu-got-by-get2supportedimageformats4lpu: " + str(supportedimageformats2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z/70) yielded" + "; supportedimageformats2lpu-yielded-by-get2image4lpu: " + str(supportedimageformats2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 33/33) returning" + "; supportedimageformats2lpu-returning-by-get2supportedimageformats4lpu: " + str(supportedimageformats2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 2: {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'}
# 3: {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'}
return supportedimageformats2lpu
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def wait2image4lpu(task4wait2image=None):
'''
waits lpu2image4lpu
'''
global lpu2image4xi
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "wait2image4lpu"
method2print = "wait2image4lpu"
message2print = "{(Step 1A1/33) started" + "; wait2image4lpu-started: " + str(wait2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1A2/33) passed" + "; task4wait2image-passed-by-wait2image4lpu to: " + str(task4wait2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
if lpu2image4xi is None:
# -------------------------------------------------------------------------------------
# INITIALIZE - KEEP SYSTEM RUNNING
# -------------------------------------------------------------------------------------
lpu2image4xi = create2image4lpu()
message2print = "{(Step 1B/33) created" + "; lpu2image4xi-created-by-wait2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -------------------------------------------------------------------------------------
# WAIT
# -------------------------------------------------------------------------------------
queue2image4lpu = None
try:
queue2image4lpu = lpu2image4xi['QUEUE']
message2print = "{(Step 1C/33) got" + "; queue2image4lpu-got-by-wait2image4lpu to: " + str(queue2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z1/70) yielded" + "; lpu2xi-yielded-by-wait2image4lpu: " + str(lpu2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
size2image4lpu = 0
try:
size2image4lpu = queue2image4lpu.qsize()
message2print = "{(Step 1D/33) got" + "; size2image4lpu-got-by-wait2image4lpu to: " + str(size2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z2/70) yielded" + "; lpu2xi-yielded-by-wait2image4lpu: " + str(lpu2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
empty2image4lpu = True
try:
empty2image4lpu= queue2image4lpu.empty()
message2print = "{(Step 1E/33) got" + "; empty2image4lpu-got-by-wait2image4lpu to: " + str(empty2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z3/70) yielded" + "; empty2image4lpu-yielded-by-wait2image4lpu: " + str(empty2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
full2image4lpu = False
try:
full2image4lpu = queue2image4lpu.full()
message2print = "{(Step 1F/33) got" + "; full2image4lpu-got-by-wait2image4lpu to: " + str(full2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z4/70) yielded" + "; full2image4lpu-yielded-by-wait2image4lpu: " + str(full2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 1G/33) finished" + "; lpu2image4xi-finished-by-wait2image4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
# -------------------------------------------------------------------------------------
# USE THE EXISTING IMAGE FOR LPU
# -------------------------------------------------------------------------------------
message2print = "{(Step 1H/33) used" + "; lpu2image4xi-used-by-wait2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -------------------------------------------------------------------------------------
# WAIT
# -------------------------------------------------------------------------------------
queue2image4lpu = None
try:
queue2image4lpu = lpu2image4xi['QUEUE']
message2print = "{(Step 1I/33) got" + "; queue2image4lpu-got-by-wait2image4lpu to: " + str(queue2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z5/70) yielded" + "; lpu2xi-yielded-by-wait2image4lpu: " + str(lpu2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
if task4wait2image is None:
pass
else:
# -------------------------------------------------------------------------------------
# IMAGE GIVEN AS PARAMETER
# -------------------------------------------------------------------------------------
message2print = "{(Step 1J1/33) passed" + "; task4wait2image-passed-by-wait2image4lpu to: " + str(task4wait2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
queue2task = {}
try:
queue2task = task4wait2image ['QUEUE']
message2print = "{(Step 1J2/33) set" + "; queue2task-set-by-wait2image4lpu to: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z61/70) yielded" + "; queue2task-yielded-by-wait2image4lpu: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if queue2task == queue2image4lpu:
# -------------------------------------------------------------------------------------
# ACCEPTED - GIVEN QUEUE IS THE SAME
# -------------------------------------------------------------------------------------
message2print = "{(Step 1K/33) accepted" + "; queue2task-accepted-by-wait2image4lpu: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
try:
message2print = "{(Step 1L/33) warned" + "; queue2task-warned-by-wait2image4lpu: " + " ** " + str(queue2task) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1M/33) warned" + "; queue2image4lpu-warned-by-wait2image4lpu: " + " ** " + str(queue2image4lpu) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
pass
except:
message2print = "{(Step 1Z62/70) yielded" + "; queue2task-yielded-by-wait2image4lpu: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
size2queue4lpu = 0
try:
size2queue4lpu = queue2image4lpu.qsize()
message2print = "{(Step 1N1/33) got" + "; size2queue4lpu-got-by-wait2image4lpu to: " + str(size2queue4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
lpu2image4xi ['SIZE2QUEUE'] = size2queue4lpu
message2print = "{(Step 1N2/33) set" + "; size2queue4image-got-by-wait2image4lpu to: " + str(lpu2image4xi ['SIZE2QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z7/70) yielded" + "; size2queue4lpu-yielded-by-wait2image4lpu: " + str(size2queue4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
empty2queue4lpu = False
try:
empty2queue4lpu = queue2image4lpu.empty()
message2print = "{(Step 1O1/33) got" + "; empty2queue4lpu-got-by-wait2image4lpu to: " + str(empty2queue4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
lpu2image4xi ['EMPTY2QUEUE'] = empty2queue4lpu
message2print = "{(Step 1O2/33) set" + "; empty2queue4image-got-by-wait2image4lpu to: " + str(lpu2image4xi ['EMPTY2QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z8/70) yielded" + "; empty2queue4lpu-yielded-by-wait2image4lpu: " + str(empty2queue4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
full2queue4lpu = False
try:
full2queue4lpu = queue2image4lpu.full()
message2print = "{(Step 1P1/33) got" + "; full2queue4lpu-got-by-wait2image4lpu to: " + str(full2queue4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
lpu2image4xi ['FULL2QUEUE'] = full2queue4lpu
message2print = "{(Step 1P2/33) set" + "; full2queue4image-got-by-wait2image4lpu to: " + str(lpu2image4xi ['FULL2QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z9/70) yielded" + "; full2queue4lpu-yielded-by-wait2image4lpu: " + str(full2queue4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
state2queue4lpu = None
try:
state2queue4lpu = queue2image4lpu.__getstate__()
message2print = "{(Step 1P3/33) got" + "; state2queue4lpu-got-by-wait2image4lpu to: " + str(state2queue4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
lpu2image4xi ['STATE2QUEUE'] = state2queue4lpu
message2print = "{(Step 1P4/33) set" + "; state2queue4image-set-by-wait2image4lpu to: " + str(lpu2image4xi ['STATE2QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z10/70) yielded" + "; state2queue4lpu-yielded-by-wait2image4lpu: " + str(state2queue4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 1Q/33) finished" + "; lpu2image4xi-finished-by-wait2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
try:
# -------------------------------------------------------------------------------------
# INITIALIZE
# -------------------------------------------------------------------------------------
lpu2image4lpu = create2image4lpu()
message2print = "{(Step 1R/33) got" + "; lpu2image4xi-got-by-wait2image4lpu to: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -------------------------------------------------------------------------------------
# WAIT
# -------------------------------------------------------------------------------------
queue2image4lpu = None
try:
queue2image4lpu = lpu2image4xi['QUEUE']
message2print = "{(Step 1S/33) got" + "; queue2image4lpu-got-by-wait2image4lpu to: " + str(queue2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z10/70) yielded" + "; queue2image4lpu-yielded-by-wait2image4lpu: " + str(queue2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
if task4wait2image is None:
pass
else:
# -------------------------------------------------------------------------------------
# IMAGE QUEUE GIVEN AS PARAMETER
# -------------------------------------------------------------------------------------
queue2task = None
try:
queue2task = task4wait2image ['QUEUE']
message2print = "{(Step 1T/33) passed" + "; queue2task-passed-by-wait2image4lpu to: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if queue2task == queue2image4lpu:
# -------------------------------------------------------------------------------------
# ACCEPTED - GIVEN QUEUE IS THE SAME
# -------------------------------------------------------------------------------------
message2print = "{(Step 1U/33) accepted" + "; queue2task-accepted-by-wait2image4lpu: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1X/33) warned" + "; queue2task-warned-by-wait2image4lpu: " + " ** " + str(queue2task) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1Y1/33) warned" + "; queue2image4lpu-warned-by-wait2image4lpu: " + " ** " + str(queue2image4lpu) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z11/70) yielded" + "; queue2task-yielded-by-wait2image4lpu: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
size2image4lpu = 0
try:
size2image4lpu = queue2image4lpu.qsize()
message2print = "{(Step 1Y2/33) got" + "; size2image4lpu-got-by-wait2image4lpu to: " + str(size2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z12/70) yielded" + "; size2image4lpu-yielded-by-wait2image4lpu: " + str(size2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
empty2image4lpu = True
try:
empty2image4lpu = queue2image4lpu.empty()
message2print = "{(Step 1Y3/33) got" + "; empty2image4lpu-got-by-wait2image4lpu to: " + str(empty2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z13/70) yielded" + "; lpu2xi-yielded-by-wait2image4lpu: " + str(lpu2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
full2image4lpu = False
try:
full2image4lpu= queue2image4lpu.full()
message2print = "{(Step 1Y4/33) got" + "; full2image4lpu-got-by-wait2image4lpu to: " + str(full2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z14/70) yielded" + "; full2image4lpu-yielded-by-wait2image4lpu: " + str(full2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 1Y5/33) finished" + "; lpu2image4xi-finished-by-wait2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
except:
lpu2image4lpu= {}
message2print = "{(Step 1Z15/70) yielded" + "; lpu2image4xi-yielded-by-wait2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 33/33) returning" + "; lpu2image4xi-returning-by-wait2image4lpu: " + str(lpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'SIZE2QUEUE': 2147483646,
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8',
# 'ORDER': 'CL_RGBA'},
# 'QUEUE': ,
# 'WIDTH': 800,
# 'CONTEXT': ...
return lpu2image4xi
#
# =================================================================================================
#
# =================================================================================================
class LPU2Image4Xi(object):
'''
LPU2Image4Xi offers methods for LPU 2D images
'''
#
# ---------------------------------------------------------------------------------------------
# sharable class variables
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
# Public API of this class
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def __init__(self, task4imagecreate2lpu = None):
'''
_init__ method initializes LPU2Image4Xi
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "LPU2Image4Xi"
method2print = "__init__"
message2print = "{(Step 1A/33) started" + "; init-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 23:41:37 09/06/11 Pacific Daylight Time
message2print = "{(Step 1B/33) borning" + "; lpu2image2xi-of-LPU2Image4Xi-borning: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
message2print = "{(Step 1C/33) inheriting" + "; object-inheriting-by-lpu2image2xi-of-LPU2Image4Xi: " + str(object) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1D/33) sharing" + "; classvariable2lpu-sharing-by-lpu2image2xi-of-LPU2Image4Xi: " + str(LPU2Image4Xi.classvariable2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 4
message2print = "{(Step 1E/33) passed" + "; task4imagecreate2lpu-passed-to-init-of-LPU2Image4Xi: " + str(task4imagecreate2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4imagecreate2lpu-passing-to-create2image4lpu-by-init-of-LPU2Image4Xi: " + str(task4imagecreate2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
lpu2image2xi = create2image4lpu(task4imagecreate2lpu)
message2print = "{(Step 2B/33) performed" + "; create2image4lpu-performed-by-init-of-LPU2Image4Xi: " + str(create2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) activated" + "; lpu2image2xi-of-LPU2Image4Xi-activated: " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# { LPU2Image4Xi : __init__ ; (Step 3A/33) activated; lpu2image2xi-of-LPU2Image4Xi-activated: ; time: 00:14:05 09/07/11 Pacific Daylight Time}
message2print = "{(Step 3B/33) inherited" + "; object-inherited-by-lpu2image2xi-of-LPU2Image4Xi: " + str(object) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 3C/33) shared" + "; classvariable2lpu-shared-by-lpu2image2xi-of-LPU2Image4Xi: " + str(LPU2Image4Xi.classvariable2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 4
message2print = "{(Step 3D/33) returning" + "; init-of-LPU2Image4Xi-returning: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 00:14:05 09/07/11 Pacific Daylight Time
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def create2image(self, task4image2create = None):
'''
create2image method creates 2D image objects of LPU2Image4Xi
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "LPU2Image4Xi"
method2print = "create2image"
message2print = "{(Step 1A/33) started" + "; create2image-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 00:14:05 09/07/11 Pacific Daylight Time
message2print = "{(Step 1B/33) passed" + "; task4image2create-passed-to-create-of-LPU2Image4Xi: " + str(task4image2create) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4image2create-passing-to-create2image4lpu-by-create2image-of-LPU2Image4Xi: " + str(task4image2create) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
lpu2image2xi = create2image4lpu(task4image2create)
message2print = "{(Step 2B/33) performed" + "; create2image4lpu-performed-by-create2image-of-LPU2Image4Xi: " + str(create2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3/33) returning" + "; lpu2image2xi-returning-by-create2image-of-LPU2Image4Xi: " + str(lpu2image2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
# {'CODE2ERROR': 0,
# 'ACK2RETURN': ' 1D-1E-2C-2B-3B-4B-5B-6B-7B-8B-9B-10B-11B-14B-15B-16B-17B-17D-18B-18C-21A1-22B1-22C1-23B-24B-25B-26B-27B-28B-29B-30B-31B-34H-35H-36B-37B-38B-',
# 'ROWPITCH': 800,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4lpu-failed ; time: 00:53:55 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4lpu',
# 'METHOD': 'create2image4lpu'},
# 'WIDTH': 800 ...
return lpu2image2xi
#
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def set2image(self, task4set2image = None):
'''
sets 2D image LPU objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "LPU2Image4Xi"
method2print = "set2image"
message2print = "{(Step 1A/33) started" + "; set2image-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:02:22 09/07/11 Pacific Daylight Time
message2print = "{(Step 1B/33) passed" + "; task4set2image-passed-to-set2image-of-LPU2Image4Xi: " + str(task4set2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'QUEUE': ,
# 'CONTEXT': {'COUNT2REFERENCE': 0, ...
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4set2image-passing-to-set2image4lpu-by-set2image-of-LPU2Image4Xi: " + str(task4set2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'QUEUE': ,
# 'CONTEXT': {'COUNT2REFERENCE': 0 ...
lpu2image2xi = set2image4lpu(task4set2image)
message2print = "{(Step 2B/33) performed" + "; set2image4lpu-performed-by-set2image-of-LPU2Image4Xi: " + str(set2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; lpu2image2xi-returning-by-set2image-of-LPU2Image4Xi: " + str(lpu2image2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'ACK2RETURN': ' 23B-24B-25B-26B-27B-28B-',
# 'ROWPITCH': 800,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4lpu-failed ; time: 01:02:22 09/07/11 Pacific Daylight Time}', 'CLASS': 'create2image4lpu', 'METHOD': 'create2image4lpu'},
# 'WIDTH': 800,
# 'BUFFER': {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4lpu-failed ; time: 01:02:22 09/07/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4lpu',
# 'METHOD': 'create2buffer4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0 ...
return lpu2image2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def get2imageinfo(self, task4getinfo2image=None):
'''
get2imageinfo method gets 2D objects of LPU2Image4Xi
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "LPU2Image4Xi"
method2print = "get2imageinfo"
message2print = "{(Step 1A/33) started" + "; get2imageinfo-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 00:14:05 09/07/11 Pacific Daylight Time
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
lpu2image2xi = get2imageinfo4lpu(task4getinfo2image)
message2print = "{(Step 2A/33) returning" + "; lpu2image2xi-returning-by-get2imageinfo-of-LPU2Image4Xi: " + str(lpu2image2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'ACK2RETURN': ' 1D-1E-2C-2B-3B-4B-5B-6B-7B-8B-9B-10B-11B-14B-15B-16B-17B-17D-18B-18C-21A1-22B1-22C1-23B-24B-25B-26B-27B-28B-29B-30B-31B-34H-35H-36B-37B-38B-',
# 'ROWPITCH': 800,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4lpu-failed ; time: 00:14:05 09/07/11 Pacific Daylight Time}', 'CLASS': 'create2image4lpu', 'METHOD': 'create2image4lpu'},
# 'WIDTH': 800,
# 'BUFFER': {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4lpu-failed ; time: 00:14:05 09/07/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4lpu',
# 'METHOD': 'create2buffer4lpu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0, ...
# or when only two elemets required
# {'WIDTH': 800, 'HEIGHT': 800}
return lpu2image2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def get2supportedimageformats(self):
'''
get2supportedimageformats method gets supported imageformats by objects of LPU2Image4Xi
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "LPU2Image4Xi"
method2print = "get2supportedimageformats"
message2print = "{(Step 1A/33) started" + "; get2supportedimageformats-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:43:00 09/07/11 Pacific Daylight Time
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
supportedimageformats2lpu = get2supportedimageformats4lpu()
message2print = "{(Step 2A/33) returning" + "; supportedimageformats2lpu-returning-by-get2imageinfo-of-LPU2Image4Xi: " + str(supportedimageformats2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'}
return supportedimageformats2lpu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def read2image(self, task4read2image = None):
'''
reads LPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "LPU2Image4Xi"
method2print = "read2image"
message2print = "{(Step 1A/33) started" + "; read2image-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 00:20:02 10/05/11 Pacific Daylight Time
message2print = "{(Step 1B/33) passed" + "; task4read2image-passed-to-read2image-of-LPU2Image4Xi: " + str(task4read2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4read2image-passing-to-read2image4lpu-by-read2image-of-LPU2Image4Xi: " + str(task4read2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4readimage2lpu = read2image4lpu(task4read2image)
message2print = "{(Step 2B/33) performed" + "; read2image4lpu-performed-by-read2image-of-LPU2Image4Xi: " + str(read2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4readimage2lpu-returning-by-read2image-of-LPU2Image4Xi: " + str(response4readimage2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 00:20:02 10/05/11 Pacific Daylight Time}
return response4readimage2lpu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def map2image(self, task4map2image = None):
'''
maps LPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "LPU2Image4Xi"
method2print = "map2image"
message2print = "{(Step 1A/33) started" + "; map2image-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:28:44 10/05/11 Pacific Daylight Time
message2print = "{(Step 1B/33) passed" + "; task4map2image-passed-to-map2image-of-LPU2Image4Xi: " + str(task4map2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4map2image-passing-to-map2image4lpu-by-map2image-of-LPU2Image4Xi: " + str(task4map2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4mapimage2lpu = map2image4lpu(task4map2image)
message2print = "{(Step 2B/33) performed" + "; map2image4lpu-performed-by-map2image-of-LPU2Image4Xi: " + str(map2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4mapimage2lpu-returning-by-map2image-of-LPU2Image4Xi: " + str(response4mapimage2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return response4mapimage2lpu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def release2image(self, task4release2image = None):
'''
releases LPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "LPU2Image4Xi"
method2print = "release2image"
message2print = "{(Step 1A/33) started" + "; release2image-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1B/33) passed" + "; task4release2image-passed-to-release2image-of-LPU2Image4Xi: " + str(task4release2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4release2image-passing-to-release2image4lpu-by-release2image-of-LPU2Image4Xi: " + str(task4release2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
lpu2image2xi = release2image4lpu(task4release2image)
message2print = "{(Step 2B/33) performed" + "; release2image4lpu-performed-by-release2image-of-LPU2Image4Xi: " + str(release2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; lpu2image2xi-returning-by-release2image-of-LPU2Image4Xi: " + str(lpu2image2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
return lpu2image2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def retain2image(self, task4retain2image = None):
'''
retains LPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "LPU2Image4Xi"
method2print = "retain2image"
message2print = "{(Step 1A/33) started" + "; retain2image-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 00:14:05 09/07/11 Pacific Daylight Time
message2print = "{(Step 1B/33) passed" + "; task4retain-passed-to-retain2image-of-LPU2Image4Xi: " + str(task4retain2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 1}
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4retain-passing-to-retain2image4lpu-by-retain-of-LPU2Image4Xi: " + str(task4retain2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 1}
lpu2image2xi = retain2image4lpu(task4retain2image)
message2print = "{(Step 2B/33) performed" + "; retain2image4lpu-performed-by-retain2image-of-LPU2Image4Xi: " + str(retain2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; lpu2image2xi-returning-by-retain2image-of-LPU2Image4Xi: " + str(lpu2image2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'ACK2RETURN': ' 1D-',
# 'ROWPITCH': 800,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4lpu-failed ; time: 00:14:05 09/07/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4lpu',
# 'METHOD': 'create2image4lpu'},
# 'WIDTH': 800,
# 'BUFFER': {'CODE2ERROR': 0,
# ...
# 'COUNT2REFERENCE': 1,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0 ...
return lpu2image2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def wait2image(self, task4wait2image = None):
'''
waits LPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "LPU2Image4Xi"
method2print = "wait2image"
message2print = "{(Step 1A/33) started" + "; wait2image-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 00:14:05 09/07/11 Pacific Daylight Time
message2print = "{(Step 1B/33) passed" + "; task4wait2image-passed-to-wait2image-of-LPU2Image4Xi: " + str(task4wait2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4wait-passing-to-wait2image4lpu-by-wait2image-of-LPU2Image4Xi: " + str(task4wait2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
lpu2image2xi = wait2image4lpu(task4wait2image)
message2print = "{(Step 2B/33) performed" + "; wait2image4lpu-performed-by-wait2image-of-LPU2Image4Xi: " + str(wait2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# semaphore and lock analysis by multiprocessing4xi
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; lpu2image2xi-returning-by-wait2image-of-LPU2Image4Xi: " + str(lpu2image2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'SIZE2QUEUE': 2147483646,
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'},
# 'QUEUE': ,
# 'WIDTH': 800,
# 'CONTEXT': ...
return lpu2image2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def write2image(self, task4write2image = None):
'''
writes LPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "LPU2Image4Xi"
method2print = "write2image"
message2print = "{(Step 1A/33) started" + "; write2image-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 02:45:31 10/05/11 Pacific Daylight Time
message2print = "{(Step 1B/33) passed" + "; task4write2image-passed-to-write2image-of-LPU2Image4Xi: " + str(task4write2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4write2image-passing-to-write2image4lpu-by-write2image-of-LPU2Image4Xi: " + str(task4write2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4writeimage2lpu = write2image4lpu(task4write2image)
message2print = "{(Step 2B/33) performed" + "; write2image4lpu-performed-by-write2image-of-LPU2Image4Xi: " + str(write2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4writeimage2lpu-returning-by-write2image-of-LPU2Image4Xi: " + str(response4writeimage2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 02:45:31 10/05/11 Pacific Daylight Time}
return response4writeimage2lpu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def copy2image(self, task4copy2image = None):
'''
copies LPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "LPU2Image4Xi"
method2print = "copy2image"
message2print = "{(Step 1A/33) started" + "; copy2image-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:28:44 10/05/11 Pacific Daylight Time
message2print = "{(Step 1B/33) passed" + "; task4copy2image-passed-to-copy2image-of-LPU2Image4Xi: " + str(task4copy2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4copy2image-passing-to-copy2image4lpu-by-copy2image-of-LPU2Image4Xi: " + str(task4copy2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4copyimage2lpu = copy2image4lpu(task4copy2image)
message2print = "{(Step 2B/33) performed" + "; copy2image4lpu-performed-by-copy2image-of-LPU2Image4Xi: " + str(copy2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4copyimage2lpu-returning-by-copy2image-of-LPU2Image4Xi: " + str(response4copyimage2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return response4copyimage2lpu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def copy2imagetobuffer(self, task4copy2imagetobuffer = None):
'''
copies 2D images to buffer
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "LPU2Image4Xi"
method2print = "copy2imagetobuffer"
message2print = "{(Step 1A/33) started" + "; copy2imagetobuffer-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:28:44 10/05/11 Pacific Daylight Time
message2print = "{(Step 1B/33) passed" + "; task4copy2imagetobuffer-passed-to-copy2imagetobuffer-of-LPU2Image4Xi: " + str(task4copy2imagetobuffer) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4copy2imagetobuffer-passing-to-copy2imagetobuffer4lpu-by-copy2imagetobuffer-of-LPU2Image4Xi: " + str(task4copy2imagetobuffer) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4copyimage2lpu = copy2imagetobuffer4lpu(task4copy2imagetobuffer)
message2print = "{(Step 2B/33) performed" + "; copy2imagetobuffer4lpu-performed-by-copy2imagetobuffer-of-LPU2Image4Xi: " + str(copy2imagetobuffer4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4copyimage2lpu-returning-by-copy2imagetobuffer-of-LPU2Image4Xi: " + str(response4copyimage2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return response4copyimage2lpu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def copy2buffertoimage(self, task4copy2buffertoimage = None):
'''
copies 2D images to buffer
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "LPU2Image4Xi"
method2print = "copy2buffertoimage"
message2print = "{(Step 1A/33) started" + "; copy2buffertoimage-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:28:44 10/05/11 Pacific Daylight Time
message2print = "{(Step 1B/33) passed" + "; task4copy2buffertoimage-passed-to-copy2buffertoimage-of-LPU2Image4Xi: " + str(task4copy2buffertoimage) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4copy2buffertoimage-passing-to-copy2buffertoimage4lpu-by-copy2buffertoimage-of-LPU2Image4Xi: " + str(task4copy2buffertoimage) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4copyimage2lpu = copy2buffertoimage4lpu(task4copy2buffertoimage)
message2print = "{(Step 2B/33) performed" + "; copy2buffertoimage4lpu-performed-by-copy2buffertoimage-of-LPU2Image4Xi: " + str(copy2buffertoimage4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4copyimage2lpu-returning-by-copy2buffertoimage-of-LPU2Image4Xi: " + str(response4copyimage2lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return response4copyimage2lpu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def trace2image(self, task4trace2image = None):
'''
traces LPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "LPU2Image4Xi"
method2print = "trace2image"
message2print = "{(Step 1A/33) started" + "; trace2image-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 00:14:05 09/07/11 Pacific Daylight Time
message2print = "{(Step 1B/33) passed" + "; task4trace2image-passed-to-trace-of-LPU2Image4Xi: " + str(task4trace2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4trace2image-passing-to-trace2image4lpu-by-trace2image-of-LPU2Image4Xi: " + str(task4trace2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
trace2xi = trace2image4lpu(task4trace2image)
message2print = "{(Step 2B/33) performed" + "; trace2image4lpu-performed-by-trace2image-of-LPU2Image4Xi: " + str(trace2image4lpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; trace2xi-returning-by-trace2image-of-LPU2Image4Xi: " + str(trace2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4lpu-failed {}; time: 01:05:20 09/08/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4lpu',
# 'METHOD': 'trace2image4lpu'}; time: 01:05:20 09/08/11 Pacific Daylight Time}
return trace2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def set2imagecallback(self, task4set2imagecallback = None):
'''
set2imagecallback of LPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "LPU2Image4Xi"
method2print = "set2imagecallback"
message2print = "{(Step 1A/33) started" + "; set2imagecallback-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 00:14:05 09/07/11 Pacific Daylight Time
message2print = "{(Step 1B/33) passed" + "; task4set2imagecallback-passed-to-set2imagecallback-of-LPU2Image4Xi: " + str(task4set2imagecallback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4set2imagecallback-passing-to-set2imagecallback -by-set2imagecallback-of-LPU2Image4Xi: " + str(task4set2imagecallback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
callback2lpu4image = {}
try:
callback2lpu4image = set2imagecallback4lpu (task4set2imagecallback)
message2print = "{(Step 2B/33) callback2lpu4image" + "; callback2lpu4image-set-by-set2imagecallback-of-LPU2Image4Xi to: " + str(callback2lpu4image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4A/33) failed" + "; callback2lpu4image-failed-by-set2imagecallback-of-LPU2Image4Xi: " + str(callback2lpu4image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; callback2lpu4image-returning-by-set2imagecallback-of-LPU2Image4Xi: " + str(callback2lpu4image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
return callback2lpu4image
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def sense(self):
'''
method sense: senses LPU2Image4Xi class objects
'''
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
class2print = 'LPU2Image4Xi'
method2print = 'sense'
message2print = "{(Step 1A/33) started" + "; sense-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:02:22 09/07/11 Pacific Daylight Time
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) sensing" + "; LPU2Image4Xi-sensing-by-sense-of-LPU2Image4Xi: " + str(LPU2Image4Xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# get sensed knowledge for this object
# -----------------------------------------------------------------------------------------
kb2xi = sense_object4xi(self)
message2print = "{(Step 3A/33) got" + "; kb2xi-got-by-sense-of-LPU2Image4Xi: " + str(kb2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'object': }
# -----------------------------------------------------------------------------------------
# add knowledge specific to this object
# format example: kb2xi['time2xi'] = time4xi() #adding time
# -----------------------------------------------------------------------------------------
try:
kb2xi['classvariable2lpu-of-LPU2Image4Xi'] = LPU2Image4Xi.classvariable2lpu
except:
message2print = "{(Step 4A/33) yielded" + "; kb2xi-yielded-by-sense-of-LPU2Image4Xi: " + str(kb2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 5A/33) sensed" + "; LPU2Image4Xi-sensed-by-sense-of-LPU2Image4Xi: " + str(LPU2Image4Xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 6A/33) returning" + "; kb2xi-returning-by-sense-of-LPU2Image4Xi: " + str(kb2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'object': , 'classvariable2lpu-of-LPU2Image4Xi': 4}
return kb2xi
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def reason(self):
'''
method reason: reasons LPU2Image4Xi class objects
'''
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
class2print = 'LPU2Image4Xi'
method2print = 'reason'
message2print = "{(Step 1A/33) started" + "; reason-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:02:22 09/07/11 Pacific Daylight Time
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) reasoning" + "; LPU2Image4Xi-reasoning-by-reason-of-LPU2Image4Xi: " + str(LPU2Image4Xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# get reasoned knowledge for this object
# -----------------------------------------------------------------------------------------
kb4xi = reason_object4xi(self)
message2print = "{(Step 3A/33) got" + "; kb4xi-got-by-reason-of-LPU2Image4Xi: " + str(kb4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'object-reason-object4xi': }
# -----------------------------------------------------------------------------------------
# add knowledge specific to this object
# format example: kb4xi['time2xi'] = time4xi() #adding time
# -----------------------------------------------------------------------------------------
try:
kb4xi['time-reason-of-LPU2Image4Xi'] = time4xi() #adding time
except:
message2print = "{(Step 4Z/33) yielded" + "; kb4xi-yielded-by-reason-of-LPU2Image4Xi: " + str(kb4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 5A/33) reasoned" + "; LPU2Image4Xi-reasoned-by-reason-of-LPU2Image4Xi: " + str(LPU2Image4Xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 6A/33) returning" + "; kb4xi-returning-by-reason-of-LPU2Image4Xi: " + str(kb4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'object-reason-object4xi': , 'time-reason-of-LPU2Image4Xi': '01:02:22 09/07/11 Pacific Daylight Time'}
return kb4xi
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def ace(self):
'''
method ace: aces LPU2Image4Xi class objects
'''
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
class2print = 'LPU2Image4Xi'
method2print = 'ace'
message2print = "{(Step 1A/33) started" + "; ace-of-LPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:02:22 09/07/11 Pacific Daylight Time
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) acing" + "; LPU2Image4Xi-acing-by-ace-of-LPU2Image4Xi: " + str(LPU2Image4Xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# get aced knowledge for this object
# -----------------------------------------------------------------------------------------
kb8xi = ace_object4xi(self)
message2print = "{(Step 3A/33) got" + "; kb8xi-got-by-ace-of-LPU2Image4Xi: " + str(kb8xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'object8xi': }
# -----------------------------------------------------------------------------------------
# add knowledge specific to this object
# format example: kb8xi['time2xi'] = time4xi() #adding time
# -----------------------------------------------------------------------------------------
try:
kb8xi['cores-of-LPU2Image4Xi'] = LPU2Image4Xi.classvariable2lpu
except:
message2print = "{(Step 4A/33) yielded" + "; kb8xi-yielded-by-ace-of-LPU2Image4Xi: " + str(kb8xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 5A/33) aced" + "; LPU2Image4Xi-aced-by-ace-of-LPU2Image4Xi: " + str(LPU2Image4Xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 6A/33) returning" + "; kb8xi-returning-by-ace-of-LPU2Image4Xi: " + str(kb8xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'cores-of-LPU2Image4Xi': 4, 'object8xi': }
return kb8xi
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
#
#
#
# -------------------------------------------------------------------------------------------------
# Recorded History
# -------------------------------------------------------------------------------------------------
#
#
# -------------------------------------------------------------------------------------------------
# to-be-done
# -------------------------------------------------------------------------------------------------
#
#
# -------------------------------------------------------------------------------------------------
# Legal Notice
# -------------------------------------------------------------------------------------------------
#
#