#
# =================================================================================================
#
#
#
#
#
# =================================================================================================
# -------------------------------------------------------------------------------------------------
# Public API
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# Standard Imports
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# Scope4Xi imports
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# Multiprocessing Imports
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# DragonXi imports
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# Global constants
# ------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# Settings
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def trace2image4jpu(task4trace2jpu=None):
'''
creates callback to jpu2image4xi
'''
global jpu2trace4xi
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "trace2image4jpu"
method2print = "trace2image4jpu"
message2print = "{(Step 1A/33) started" + "; trace2image4jpu-started: " + str(trace2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1B/33) passed" + "; task4trace2jpu-to-trace2image4jpu: " + str(task4trace2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
# None
code2ack = ' '
code2nack = ' '
jpu2trace4xi = {} # INITIALIZES TO EMPTY DICTIONARY
if task4trace2jpu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY JPUIZED CALLBACK !
# -----------------------------------------------------------------------------------------
task4trace2jpu = {}
task4trace2jpu['CLASS'] = "trace2image4jpu" # JPUIZE ZPU TRACE!
task4trace2jpu['METHOD'] = "trace2image4jpu"
task4trace2jpu['MESSAGE'] = "{(Step 2Z0/33) failed" + "; trace2image4jpu-failed " + str(jpu2trace4xi) + "; time: " + time4xi() + "}"
message2print = "{(Step 2A/33) set" + "; task4trace2jpu-set-by-trace2image4jpu to: " + str(task4trace2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4jpu-failed {}; time: 08:14:33 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4jpu',
# 'METHOD': 'trace2image4jpu'}
# ; time: 08:14:33 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '2A-'
# -----------------------------------------------------------------------------------------
# PARAMETER GIVEN BY JPUIZED CALLBACK !
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) try" + "; task4trace2jpu-try-by-trace2image4jpu: " + str(task4trace2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# { trace2image4jpu : trace2image4jpu ; (Step 3A/33) try; task4trace2jpu-try-by-trace2image4jpu:
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4jpu-failed {}; time: 08:14:33 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4jpu',
# 'METHOD': 'trace2image4jpu'}
# ; time: 08:14:33 09/06/11 Pacific Daylight Time}
try:
jpu2trace4xi ['CLASS'] = task4trace2jpu['CLASS'] # JPUIZE JPU TRACE!
jpu2trace4xi ['METHOD'] = task4trace2jpu['METHOD']
jpu2trace4xi ['MESSAGE'] = task4trace2jpu['MESSAGE']
message2print = "{(Step 3B/33) set" + "; jpu2trace4xi-set-by-trace2image4jpu to: " + str(jpu2trace4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# { trace2image4jpu : trace2image4jpu ; (Step 3B/33) set; jpu2trace4xi-set-by-trace2image4jpu to:
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4jpu-failed {}; time: 23:41:37 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4jpu',
# 'METHOD': 'trace2image4jpu'}
# ; time: 23:41:37 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z1/33) failed" + "; jpu-trace-failed-by-trace2image4jpu: " + str(task4trace2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
try:
# =================================
# SIMULATE JPU TRACE
# =================================
class2print = task4trace2jpu['CLASS'] # JPUIZE JPU TRACE!
method2print = task4trace2jpu['METHOD']
message2print = task4trace2jpu['MESSAGE']
print4xi(class2print, method2print, message2print) # JPUIZED TRACE FOR OPENCL CALLBACK!
# { trace2image4jpu : trace2image4jpu ; (Step 2Z0/33) failed; trace2image4jpu-failed {}; time: 23:41:37 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '3C-'
except:
class2print = "trace2image4jpu" # SET TRACE BACK TO THIS FUNCTION!
method2print = "trace2image4jpu"
message2print = "{(Step 3Z2/33) failed" + "; simulation-of-jpu-trace-failed-by-trace2image4jpu: " + str(task4trace2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z2-'
try:
# =================================
# NORMAL TRACE
# =================================
class2print = "trace2image4jpu" # SET TRACE BACK TO THIS FUNCTION!
method2print = "trace2image4jpu"
message2print = "{(Step 3D/33) performed" + "; jpu-trace-performed-by-trace2image4jpu: " + str(task4trace2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# { trace2image4jpu : trace2image4jpu ; (Step 3D/33) performed; jpu-trace-performed-by-trace2image4jpu:
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4jpu-failed {}; time: 23:41:37 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4jpu', 'METHOD': 'trace2image4jpu'}; time: 23:41:37 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '3D-'
except:
message2print = "{(Step 3Z3/33) failed" + "; jpu-trace-failed-by-trace2image4jpu: " + str(task4trace2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z3-'
# -----------------------------------------------------------------------------------------
# (Step 33/3)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 33/33) returning" + "; jpu2trace4xi-returning-by-trace2image4jpu: " + str(jpu2trace4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4jpu-failed {}; time: 23:41:37 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4jpu',
# 'METHOD': 'trace2image4jpu'}; time: 23:41:37 09/06/11 Pacific Daylight Time}
return jpu2trace4xi
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def set2imagecallback4jpu(task4set2imagecallback=None):
'''
registers callback function to jpu2image4xi
'''
global jpu2image4xi
class2print = "set2imagecallback4jpu"
method2print = "set2imagecallback4jpu"
message2print = "{(Step 1A/70) started" + "; set2imagecallback4jpu-started: " + str(set2imagecallback4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
jpu2image4xi ['CALLBACK'] = trace2image4jpu
message2print = "{(Step 1B/70) set callback2jpu" + "; imagecallback4jpu-set-by-set2imagecallback4jpu: " + str(jpu2image4xi ['CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1C/70) returning" + "; callback-of-jpu2image4xi-returning-by-set2imagecallback4jpu: " + str(jpu2image4xi ['CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
return jpu2image4xi ['CALLBACK']
except:
message2print = "{(Step 1Z1/70) failed" + "; callback2image-failed-by-set2imagecallback4jpu: " + str(callback2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 1Z2/70) returning" + "; trace2image4jpu-returning-by-set2imagecallback4jpu: " + str(trace2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
return trace2image4jpu
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def create2image4jpu(task4imagecreate2jpu=None):
'''
creates 2D image for JPU
'''
global jpu2image4xi
# -----------------------------------------------------------------------------------------
# (Step 1/70) - CHECK PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "create2image4jpu"
method2print = "create2image4jpu"
message2print = "{(Step 1A/70) started" + "; create2image4jpu-started: " + str(create2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1B/70) passed" + "; task4imagecreate2jpu-to-create2image4jpu: " + str(task4imagecreate2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
jpu2image4xi = {} # INITIALIZES TO EMPTY DICTIONARY
try:
if task4imagecreate2jpu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR CREATION - BUILD TASK TO JPU!
# -----------------------------------------------------------------------------------------
task4imagecreate2jpu = {}
message2print = "{(Step 1C/70) initialized" + "; task4imagecreate2jpu-created-by-create2image4jpu to: " + str(task4imagecreate2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
function2callback4jpu = trace2image4jpu # CALLBACK FUNCTION FOR JPU
message2print = "{(Step 1D/70) initialized" + "; function2callback4jpu-created-by-create2image4jpu to: " + str(function2callback4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1D-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "create2image4jpu" # MODULE OF JPUIZED OPENCL MODULE
args2callback['METHOD'] = "create2image4jpu" # FUNCTION OF JPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; create2image4jpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR JPUIZED OPENCL TO RETURN
message2print = "{(Step 1E/70) initialized" + "; args2callback-created-by-create2image4jpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; create2image4jpu-failed ; time: 00:54:15 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4jpu',
# 'METHOD': 'create2image4jpu'}; time: 00:54:15 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '1E-'
# ---------------------------------------------------------------------------------------------
# (1) CALLBACKS - EXTRA
# ---------------------------------------------------------------------------------------------
task4imagecreate2jpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO JPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagecreate2jpu['FUNCTION2CALLBACK'] = function2callback4jpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '2C-'
message2print = "{(Step 1F/70) initialized" + "; task4imagecreate2jpu-created-by-create2image4jpu to: " + str(task4imagecreate2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4jpu-failed ; time: 00:54:15 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4jpu',
# 'METHOD': 'create2image4jpu'}}; time: 00:54:15 09/06/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - EXTRA
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-create2image4jpu 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-create2image4jpu: " + 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-create2image4jpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4imagecreate2jpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - REQUIRED
# ---------------------------------------------------------------------------------------------
context2jpu = {}
message2print = "{(Step 3A/70) trying" + "; context2jpu-trying-by-create2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2jpu = get2context4jpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2jpu-got-by-create2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4jpu-failed ; time: 00:54:15 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4jpu',
# 'METHOD': 'create2context4jpu'},
# '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" + "; context2jpu-failed-by-create2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4imagecreate2jpu ['CONTEXT'] = context2jpu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - EXTRA
# ---------------------------------------------------------------------------------------------
device2jpu = {}
message2print = "{(Step 4A/70) trying" + "; device2jpu-trying-by-create2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2jpu = get2jpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2jpu-got-by-create2image4jpu: " + str(device2jpu) + "; 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_JPU',
# 'DENORMS2SINGLEPRECISION4FLOATINGPOINTCAPABILITY': 'ACK'}; time: 00:54:15 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2jpu-failed-by-create2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4imagecreate2jpu ['DEVICE'] = device2jpu
# ---------------------------------------------------------------------------------------------
# (5) ERROR CODE - REQUIRED
# ---------------------------------------------------------------------------------------------
task4imagecreate2jpu ['CODE2ERROR'] = 0
code2ack = code2ack + '5B-'
# ---------------------------------------------------------------------------------------------
# (6) QUEUE - EXTRA
# ---------------------------------------------------------------------------------------------
queue2jpu = None
message2print = "{(Step 6A/70) trying" + "; queue2jpu-trying-by-create2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2jpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 6B/70) got" + "; queue2jpu-got-by-create2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; queue2jpu-failed-by-create2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4imagecreate2jpu ['QUEUE'] = queue2jpu
# ---------------------------------------------------------------------------------------------
# (7) PIPE - EXTRA
# ---------------------------------------------------------------------------------------------
pipe2jpu = None
message2print = "{(Step 7A/70) trying" + "; pipe2jpu-trying-by-create2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2jpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 7B/70) got" + "; pipe2jpu-got-by-create2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; pipe2jpu-failed-by-create2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4imagecreate2jpu ['PIPE'] = pipe2jpu
# ---------------------------------------------------------------------------------------------
# (8) COMMAND QUEUE INFO - EXTRA
# ---------------------------------------------------------------------------------------------
commandqueueinfo2jpu = {}
message2print = "{(Step 8A/70) trying" + "; commandqueueinfo2jpu-trying-by-create2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2jpu = get2commandqueueinfo4jpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 8B/70) got" + "; commandqueueinfo2jpu-got-by-create2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2commandqueue4jpu-failed ; time: 05:04:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4jpu',
# 'METHOD': 'create2commandqueue4jpu'},
# '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; create2context4jpu-failed ; time: 05:04:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4jpu',
# 'METHOD': 'create2context4jpu'},
# '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" + "; commandqueueinfo2jpu-failed-by-create2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4imagecreate2jpu ['COMMANDQUEUE'] = commandqueueinfo2jpu
# ---------------------------------------------------------------------------------------------
# (9) BUFFER INFO - EXTRA
# ---------------------------------------------------------------------------------------------
bufferinfo2jpu = {}
message2print = "{(Step 9A/70) trying" + "; bufferinfo2jpu-trying-by-create2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2jpu = get2bufferinfo4jpu() # SYSTEM CREATES BUFFER FOR JPU, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; bufferinfo2jpu-got-by-create2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4jpu-failed ; time: 05:04:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4jpu',
# 'METHOD': 'create2buffer4jpu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4jpu-failed ; time: 05:04:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4jpu',
# 'METHOD': 'create2context4jpu'},
# '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" + "; bufferinfo2jpu-failed-by-create2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4imagecreate2jpu ['BUFFER'] = bufferinfo2jpu
# ---------------------------------------------------------------------------------------------
# (10) EVENT INFO - EXTRA
# ---------------------------------------------------------------------------------------------
eventinfo2jpu = {}
message2print = "{(Step 10A/70) trying" + "; eventinfo2jpu-trying-by-create2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2jpu = get2eventinfo4jpu() # SYSTEM CREATES EVENT IF NECESSAY
message2print = "{(Step 10B/70) got" + "; eventinfo2jpu-got-by-create2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2event4jpu-failed ; time: 05:10:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2event4jpu',
# 'METHOD': 'create2event4jpu'},
# '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; create2context4jpu-failed ; time: 05:10:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4jpu', 'METHOD': 'create2context4jpu'},
# '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" + "; eventinfo2jpu-failed-by-create2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '10Z-'
task4imagecreate2jpu ['EVENT'] = eventinfo2jpu
# ---------------------------------------------------------------------------------------------
# (11) FLAGS - REQUIRED
# ---------------------------------------------------------------------------------------------
flags2jpu = 0
message2print = "{(Step 11A/70) trying" + "; flags2jpu-trying-by-create2image4jpu: " + str(flags2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
flags2jpu = 0
message2print = "{(Step 11B/70) set" + "; flags2jpu-set-by-create2image4jpu to: " + str(flags2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; flags2jpu-failed-by-create2image4jpu: " + str(flags2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4imagecreate2jpu ['FLAGS'] = flags2jpu
# ---------------------------------------------------------------------------------------------
# (14) WIDTH - REQUIRED
# ---------------------------------------------------------------------------------------------
width2jpu = 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" + "; width2jpu-trying-by-create2image4jpu: " + str(width2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
width2jpu = int(width2layer * (quantity2core + quantity2skeleton + quantity2layers + quantity2frame + quantity2extra))
width2jpu = 2 * width2jpu # POS and NEG X 2*400 = 800 PIXELS
message2print = "{(Step 14B/70) set" + "; width2jpu-set-by-create2image4jpu to: " + str(width2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; width2jpu-failed-by-create2image4jpu: " + str(width2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4imagecreate2jpu ['WIDTH'] = width2jpu
# ---------------------------------------------------------------------------------------------
# (15) HEIGHT - REQUIRED
# ---------------------------------------------------------------------------------------------
height2jpu = 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" + "; height2jpu-trying-by-create2image4jpu: " + str(height2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
height2jpu = height2layer * quantity2total
height2jpu = 2 * height2jpu # POS and NEG Y 2*400 = 800 PIXELS
message2print = "{(Step 15B2/70) set" + "; height2jpu-set-by-create2image4jpu to: " + str(height2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; height2jpu-failed-by-create2image4jpu: " + str(height2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '15Z-'
task4imagecreate2jpu ['HEIGHT'] = height2jpu
# ---------------------------------------------------------------------------------------------
# (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.
rowpitch2jpu = 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" + "; rowpitch2jpu-trying-by-create2image4jpu: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2jpu = int(width2jpu * 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" + "; rowpitch2jpu-set-by-create2image4jpu to: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; rowpitch2jpu-failed-by-create2image4jpu: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '16Z-'
task4imagecreate2jpu ['ROWPITCH'] = rowpitch2jpu
# ---------------------------------------------------------------------------------------------
# (17) POINTER - REQUIRED
# ---------------------------------------------------------------------------------------------
pointer2jpu = None
size2jpu = int(width2jpu * height2jpu) # CALCULATED MEMORY
if size2jpu == 0:
size2jpu = 4400 # MINIMUM MEMORY
message2print = "{(Step 17A/70) trying" + "; pointer2jpu-trying-by-create2image4jpu: " + str(pointer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
arena2jpu = Arena4Xi(size2jpu) # SYSTEM RESERVER MEMORY FOR IMAGE
message2print = "{(Step 17B1/70) got" + "; arena2jpu-got-by-create2image4jpu: " + str(arena2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
size2arena = arena2jpu.size #
message2print = "{(Step 17B2/70) got" + "; size2arena-got-by-create2buffer4jpu: " + str(size2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 640000
buffer2arena = arena2jpu.buffer
message2print = "{(Step 17B3/70) got" + "; buffer2arena-got-by-create2buffer4jpu: " + str(buffer2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17B-'
if size2arena < size2jpu:
size2jpu = size2arena # AVAILABLE MEMORY FOR IMAGE
message2print = "{(Step 17C/70) set" + "; size2jpu-set-by-create2buffer4jpu to: " + str(size2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17C-'
else:
pass
pointer2jpu = buffer2arena
message2print = "{(Step 17D/70) set" + "; pointer2jpu-set-by-create2buffer4jpu to: " + str(pointer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17D-'
except:
message2print = "{(Step 17Z/70) failed" + "; pointer2jpu-failed-by-create2image4jpu: " + str(pointer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '17Z-'
task4imagecreate2jpu ['POINTER'] = pointer2jpu
task4imagecreate2jpu ['SIZE'] = size2jpu # EXTRA
# ---------------------------------------------------------------------------------------------
# (18) FORMAT - REQUIRED
# ---------------------------------------------------------------------------------------------
format2jpu = {}
message2print = "{(Step 18A/70) trying" + "; format2jpu-trying-by-create2image4jpu: " + str(format2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
format2jpu['ORDER'] = 'CL_RGBA'
message2print = "{(Step 18B/70) set" + "; format2jpu-set-by-create2image4jpu to: " + str(format2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'ORDER': 'CL_RGBA'}
code2ack = code2ack + '18B-'
format2jpu['TYPE'] = 'CL_UNORM_INT8'
message2print = "{(Step 18C/70) set" + "; format2jpu-set-by-create2image4jpu to: " + str(format2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'}
code2ack = code2ack + '18C-'
except:
message2print = "{(Step 18Z/70) failed" + "; format2jpu-failed-by-create2image4jpu: " + str(format2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '18Z-'
task4imagecreate2jpu ['FORMAT'] = format2jpu
# ---------------------------------------------------------------------------------------------
# (19) DEPTH - MUST BE 0
# ---------------------------------------------------------------------------------------------
depth2jpu = 0
message2print = "{(Step 19A/70) set" + "; depth2jpu-set-by-create2image4jpu to: " + str(depth2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '19A-'
task4imagecreate2jpu ['DEPTH'] = depth2jpu
else:
pass # PARAMETER DATA RECEIVED
except:
message2print = "{(Step 1Z1/70) yielded" + "; task4imagecreate2jpu-yielded-by-create2image4jpu: " + str(task4imagecreate2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '1Z1-'
# ---------------------------------------------------------------------------------------------
# TASK EITHER GENERATED BY THIS PROGRAM (NONE GIVEN) OR GIVEN BY USER
# ---------------------------------------------------------------------------------------------
keys2task = task4imagecreate2jpu.keys()
message2print = "{(Step 19A/70) using" + "; keys2task-using-by-create2image4jpu: " + 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 JPU!
# ---------------------------------------------------------------------------------------------
jpu2image4xi = {}
message2print = "{(Step 20A/70) initialized" + "; jpu2image4xi-initialized-by-create2image4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
message2print = "{(Step 21A0/70) try" + "; data2callback-try-by-create2image4jpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 21A/70) - DATA2CALLBACK - EXTRA
# -----------------------------------------------------------------------------------------
jpu2image4xi['DATA2CALLBACK'] = task4imagecreate2jpu['DATA2CALLBACK']
message2print = "{(Step 21A1/70) initialized" + "; data2callback-created-by-create2image4jpu to: " + str(jpu2image4xi['DATA2CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; create2image4jpu-failed ; time: 05:56:13 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4jpu',
# 'METHOD': 'create2image4jpu'}; time: 05:56:13 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '21A1-'
except:
message2print = "{(Step 21Z1/70) yielded" + "; data2callback-jpu2image4xi-yielded-by-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '21Z1-'
message2print = "{(Step 22B0/70) try" + "; function2callback-try-by-create2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 22B/70) - FUNCTION2CALLBACK - EXTRA
# -----------------------------------------------------------------------------------------
jpu2image4xi['FUNCTION2CALLBACK'] = task4imagecreate2jpu['FUNCTION2CALLBACK']
message2print = "{(Step 22B1/70) initialized" + "; function2callback-created-by-create2image4jpu to: " + str(jpu2image4xi['FUNCTION2CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B1-'
except:
message2print = "{(Step 22Z2/70) yielded" + "; function2callback-jpu2image4xi-yielded-by-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z2-'
message2print = "{(Step 22C0/70) try" + "; platform-try-by-create2image4jpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 22C/70) - PLATFORM - EXTRA
# -----------------------------------------------------------------------------------------
jpu2image4xi['PLATFORM'] = task4imagecreate2jpu['PLATFORM']
message2print = "{(Step 22C1/70) initialized" + "; platform-created-by-create2image4jpu to: " + str(jpu2image4xi['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-jpu2image4xi-yielded-by-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z3-'
message2print = "{(Step 23A/70) try" + "; context2jpu-try-by-create2image4jpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 23/70) - CONTEXT - REQUIRED
# -----------------------------------------------------------------------------------------
jpu2image4xi['CONTEXT'] = task4imagecreate2jpu['CONTEXT']
message2print = "{(Step 23B/70) initialized" + "; context-created-by-create2image4jpu to: " + str(jpu2image4xi['CONTEXT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4jpu-failed ; time: 05:56:12 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4jpu',
# 'METHOD': 'create2context4jpu'},
# '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-jpu2image4xi-yielded-by-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z1-'
message2print = "{(Step 24A/70) try" + "; device-try-by-create2image4jpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 24/70) - DEVICE - EXTRA
# -----------------------------------------------------------------------------------------
jpu2image4xi['DEVICE'] = task4imagecreate2jpu['DEVICE']
message2print = "{(Step 24B/70) initialized" + "; device-created-by-create2image4jpu to: " + str(jpu2image4xi['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-jpu2image4xi-yielded-by-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z1-'
message2print = "{(Step 25A/70) try" + "; code2error-try-by-create2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 25/70) - ERROR CODE - REQUIRED
# -----------------------------------------------------------------------------------------
jpu2image4xi['CODE2ERROR'] = task4imagecreate2jpu['CODE2ERROR']
message2print = "{(Step 25B/70) initialized" + "; code2error-created-by-create2image4jpu to: " + str(jpu2image4xi['CODE2ERROR']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z1/70) yielded" + "; code2error-jpu2image4xi-yielded-by-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z1-'
message2print = "{(Step 26A/70) try" + "; queue-try-by-create2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 26/70) - QUEUE - EXTRA
# -----------------------------------------------------------------------------------------
jpu2image4xi['QUEUE'] = task4imagecreate2jpu['QUEUE']
message2print = "{(Step 26B/70) initialized" + "; queue-created-by-create2image4jpu to: " + str(jpu2image4xi['QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z1/70) yielded" + "; queue-jpu2image4xi-yielded-by-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z1-'
message2print = "{(Step 27A/70) try" + "; pipe-try-by-create2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 27/70) - PIPE - EXTRA
# -----------------------------------------------------------------------------------------
jpu2image4xi['PIPE'] = task4imagecreate2jpu['PIPE']
message2print = "{(Step 27B/70) initialized" + "; pipe-created-by-create2image4jpu to: " + str(jpu2image4xi['PIPE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z1/70) yielded" + "; pipe-jpu2image4xi-yielded-by-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z1-'
message2print = "{(Step 28A/70) try" + "; commandqueue-try-by-create2image4jpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - EXTRA
# ---------------------------------------------------------------------------------------------
jpu2image4xi['COMMANDQUEUE'] = task4imagecreate2jpu['COMMANDQUEUE']
message2print = "{(Step 28B/70) initialized" + "; commandqueue-created-by-create2image4jpu to: " + str(jpu2image4xi['COMMANDQUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2commandqueue4jpu-failed ; time: 07:13:59 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4jpu',
# 'METHOD': 'create2commandqueue4jpu'},
# '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-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '28Z1-'
message2print = "{(Step 29A/70) try" + "; bufferinfo-try-by-create2image4jpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (29) BUFFER INFO - EXTRA
# ---------------------------------------------------------------------------------------------
jpu2image4xi['BUFFER'] = task4imagecreate2jpu['BUFFER']
message2print = "{(Step 29B/70) initialized" + "; bufferinfo-created-by-create2image4jpu to: " + str(jpu2image4xi['BUFFER']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4jpu-failed ; time: 05:56:12 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4jpu',
# 'METHOD': 'create2buffer4jpu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4jpu-failed ...
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z1/70) yielded" + "; bufferinfo-yielded-by-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z1-'
message2print = "{(Step 30A/70) try" + "; eventinfo-try-by-create2image4jpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (30) EVENT INFO - EXTRA
# ---------------------------------------------------------------------------------------------
jpu2image4xi['EVENT'] = task4imagecreate2jpu['EVENT']
message2print = "{(Step 30B/70) initialized" + "; eventinfo-created-by-create2image4jpu to: " + str(jpu2image4xi['EVENT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2event4jpu-failed ; time: 05:56:12 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2event4jpu',
# 'METHOD': 'create2event4jpu'},
# '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-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '30Z1-'
message2print = "{(Step 31A/70) try" + "; flags-try-by-create2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (31) FLAGS - REQUIRED
# ---------------------------------------------------------------------------------------------
jpu2image4xi['FLAGS'] = task4imagecreate2jpu['FLAGS']
message2print = "{(Step 31B/70) initialized" + "; flags-created-by-create2image4jpu to: " + str(jpu2image4xi['FLAGS']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z1/70) yielded" + "; flags-yielded-by-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z1-'
message2print = "{(Step 34A/70) try" + "; width-try-by-create2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (34) WIDTH - REQUIRED
# ---------------------------------------------------------------------------------------------
jpu2image4xi['WIDTH'] = task4imagecreate2jpu['WIDTH']
message2print = "{(Step 34H/70) initialized" + "; width-created-by-create2image4jpu to: " + str(jpu2image4xi['WIDTH']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '34H-'
except:
message2print = "{(Step 34Z1/70) yielded" + "; width-yielded-by-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z1-'
message2print = "{(Step 35A/70) try" + "; height-try-by-create2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (35) HEIGHT - REQUIRED
# ---------------------------------------------------------------------------------------------
jpu2image4xi['HEIGHT'] = task4imagecreate2jpu['HEIGHT']
message2print = "{(Step 35H/70) initialized" + "; height-created-by-create2image4jpu to: " + str(jpu2image4xi['HEIGHT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '35H-'
except:
message2print = "{(Step 35Z1/70) yielded" + "; height-yielded-by-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '35Z1-'
message2print = "{(Step 36A/70) try" + "; rowpitch-try-by-create2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (36) ROWPITCH - REQUIRED
# ---------------------------------------------------------------------------------------------
jpu2image4xi['ROWPITCH'] = task4imagecreate2jpu['ROWPITCH']
message2print = "{(Step 36B/70) initialized" + "; rowpitch-created-by-create2image4jpu to: " + str(jpu2image4xi['ROWPITCH']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z1/70) yielded" + "; rowpitch-yielded-by-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '36Z1-'
message2print = "{(Step 37A/70) try" + "; pointer-try-by-create2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (37) POINTER - REQUIRED
# ---------------------------------------------------------------------------------------------
jpu2image4xi['POINTER'] = task4imagecreate2jpu['POINTER']
message2print = "{(Step 37B/70) initialized" + "; pointer-created-by-create2image4jpu to: " + str(jpu2image4xi['POINTER']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37B-'
except:
message2print = "{(Step 37Z1/70) yielded" + "; pointer-yielded-by-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '37Z1-'
message2print = "{(Step 38A/70) try" + "; format-try-by-create2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (38) FORMAT - REQUIRED
# ---------------------------------------------------------------------------------------------
jpu2image4xi['FORMAT'] = task4imagecreate2jpu['FORMAT']
message2print = "{(Step 38B/70) initialized" + "; format-created-by-create2image4jpu to: " + str(jpu2image4xi['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-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '38Z1-'
message2print = "{(Step 39A/70) try" + "; depth-try-by-create2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (39) DEPTH - MUST BE 0
# ---------------------------------------------------------------------------------------------
jpu2image4xi['DEPTH'] = task4imagecreate2jpu['DEPTH']
message2print = "{(Step 39B/70) initialized" + "; depth-created-by-create2image4jpu to: " + str(jpu2image4xi['DEPTH']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '39B-'
except:
message2print = "{(Step 39Z1/70) yielded" + "; depth-yielded-by-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '39Z1-'
# -----------------------------------------------------------------------------------------
# (Step 70/70)
# -----------------------------------------------------------------------------------------
jpu2image4xi ['ACK2RETURN'] = code2ack
jpu2image4xi ['NACK2RETURN'] = code2nack
message2print = "{(Step 70/70) returning" + "; jpu2image4xi-returning-by-create2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# 'DEPTH'
# 'WIDTH'
# 'HEIGHT'
return jpu2image4xi
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def set2image4jpu(task4imageset2jpu=None):
'''
sets 2D images for JPU
'''
global jpu2image4xi
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "set2image4jpu"
method2print = "set2image4jpu"
message2print = "{(Step 1A/33) started" + "; set2image4jpu-started: " + str(set2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4imageset2jpu-to-set2image4jpu: " + str(task4imageset2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'QUEUE': ,
# 'CONTEXT': {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4jpu-failed ; time: 07:13:59 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4jpu',
# 'METHOD': 'create2context4jpu'},
# '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; create2commandqueue4jpu-failed ; time: 07:13:59 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4jpu',
# 'METHOD': 'create2commandqueue4jpu'},
# '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; create2context4jpu-failed ; time: 07:13:59 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4jpu',
# 'METHOD': 'create2context4jpu'},
# '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 jpu2image4xi is None:
jpu2image4xi = create2image4jpu() # INITIALIZE IMAGE FOR JPU
message2print = "{(Step 1C/70) set" + "; jpu2image4xi-set-by-set2image4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4jpu-skipped-by-set2image4jpu: " + str(create2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ;
except:
try:
jpu2image4xi = create2image4jpu()
message2print = "{(Step 1E/70) set" + "; jpu2image4xi-set-by-set2image4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
jpu2image4xi = {}
message2print = "{(Step 1Z/70) yielded" + "; jpu2image4xi-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
# ---------------------------------------------------------------------------------------------
# SET
# ---------------------------------------------------------------------------------------------
message2print = "{(Step 22A0/70) try" + "; data2callback-try-by-set2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 21A/70) - DATA2CALLBACK - EXTRA
# -----------------------------------------------------------------------------------------
jpu2image4xi['DATA2CALLBACK'] = task4imageset2jpu['DATA2CALLBACK']
message2print = "{(Step 21A1/70) set" + "; data2callback-set-by-set2image4jpu to: " + str(jpu2image4xi['DATA2CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21A1-'
except:
message2print = "{(Step 21Z1/70) yielded" + "; data2callback-jpu2image4xi-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '21Z1-'
message2print = "{(Step 22B0/70) try" + "; function2callback-try-by-set2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 22B/70) - FUNCTION2CALLBACK - EXTRA
# -----------------------------------------------------------------------------------------
jpu2image4xi['FUNCTION2CALLBACK'] = task4imageset2jpu['FUNCTION2CALLBACK']
message2print = "{(Step 22B1/70) set" + "; function2callback-set-by-set2image4jpu to: " + str(jpu2image4xi['FUNCTION2CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B1-'
except:
message2print = "{(Step 22Z2/70) yielded" + "; function2callback-jpu2image4xi-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '22Z2-'
message2print = "{(Step 22C0/70) try" + "; platform2callback-try-by-set2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 22C/70) - PLATFORM - EXTRA
# -----------------------------------------------------------------------------------------
jpu2image4xi['PLATFORM'] = task4imageset2jpu['PLATFORM']
message2print = "{(Step 2C1/70) set" + "; platform-set-by-set2image4jpu to: " + str(jpu2image4xi['PLATFORM']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2ack = code2ack + '2C1-'
except:
message2print = "{(Step 22Z3/70) yielded" + "; platform-jpu2image4xi-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z3-'
message2print = "{(Step 23A/70) try" + "; context2jpu-try-by-set2image4jpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 23/70) - CONTEXT - REQUIRED
# -----------------------------------------------------------------------------------------
jpu2image4xi['CONTEXT'] = task4imageset2jpu['CONTEXT']
message2print = "{(Step 23B/70) set" + "; context-set-by-set2image4jpu to: " + str(jpu2image4xi['CONTEXT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4jpu-failed ; time: 07:13:59 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4jpu',
# 'METHOD': 'create2context4jpu'},
# '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-jpu2image4xi-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z1-'
message2print = "{(Step 24A/70) try" + "; device-try-by-set2image4jpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 24/70) - DEVICE - EXTRA
# -----------------------------------------------------------------------------------------
jpu2image4xi['DEVICE'] = task4imageset2jpu['DEVICE']
message2print = "{(Step 24B/70) set" + "; device-set-by-set2image4jpu to: " + str(jpu2image4xi['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_JPU',
# 'DENORMS2SINGLEPRECISION4FLOATINGPOINTCAPABILITY': 'ACK'}; time: 07:13:59 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z1/70) yielded" + "; device-jpu2image4xi-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z1-'
message2print = "{(Step 25A/70) try" + "; code2error-try-by-set2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 25/70) - ERROR CODE - REQUIRED
# -----------------------------------------------------------------------------------------
jpu2image4xi['CODE2ERROR'] = task4imageset2jpu['CODE2ERROR']
message2print = "{(Step 25B/70) set" + "; code2error-set-by-set2image4jpu to: " + str(jpu2image4xi['CODE2ERROR']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z1/70) yielded" + "; code2error-jpu2image4xi-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z1-'
message2print = "{(Step 26A/70) try" + "; queue-try-by-set2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 26/70) - QUEUE - EXTRA
# -----------------------------------------------------------------------------------------
jpu2image4xi['QUEUE'] = task4imageset2jpu['QUEUE']
message2print = "{(Step 26B/70) set" + "; queue-set-by-set2image4jpu to: " + str(jpu2image4xi['QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z1/70) yielded" + "; queue-jpu2image4xi-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z1-'
message2print = "{(Step 27A/70) try" + "; pipe-try-by-set2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 27/70) - PIPE - EXTRA
# -----------------------------------------------------------------------------------------
jpu2image4xi['PIPE'] = task4imageset2jpu['PIPE']
message2print = "{(Step 27B/70) set" + "; pipe-set-by-set2image4jpu to: " + str(jpu2image4xi['PIPE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z1/70) yielded" + "; pipe-jpu2image4xi-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z1-'
message2print = "{(Step 28A/70) try" + "; commandqueue-try-by-set2image4jpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - EXTRA
# ---------------------------------------------------------------------------------------------
jpu2image4xi['COMMANDQUEUE'] = task4imageset2jpu['COMMANDQUEUE']
message2print = "{(Step 28B/70) set" + "; commandqueue-set-by-set2image4jpu to: " + str(jpu2image4xi['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-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z1-'
message2print = "{(Step 29A/70) try" + "; bufferinfo-try-by-set2image4jpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (29) BUFFER INFO - EXTRA
# ---------------------------------------------------------------------------------------------
jpu2image4xi['BUFFER'] = task4imageset2jpu['BUFFER']
message2print = "{(Step 29B/70) set" + "; bufferinfo-set-by-set2image4jpu to: " + str(jpu2image4xi['BUFFER']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z1/70) yielded" + "; bufferinfo-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '29Z1-'
message2print = "{(Step 30A/70) try" + "; eventinfo-try-by-set2image4jpu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (30) EVENT INFO - EXTRA
# ---------------------------------------------------------------------------------------------
jpu2image4xi['EVENT'] = task4imageset2jpu['EVENT']
message2print = "{(Step 30B/70) set" + "; eventinfo-set-by-set2image4jpu to: " + str(jpu2image4xi['EVENT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '30B-'
except:
message2print = "{(Step 30Z1/70) yielded" + "; eventinfo-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '30Z1-'
message2print = "{(Step 31A/70) try" + "; flags-try-by-set2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (31) FLAGS - REQUIRED
# ---------------------------------------------------------------------------------------------
jpu2image4xi['FLAGS'] = task4imageset2jpu['FLAGS']
message2print = "{(Step 31B/70) set" + "; flags-set-by-set2image4jpu to: " + str(jpu2image4xi['FLAGS']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z1/70) yielded" + "; flags-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '31Z1-'
message2print = "{(Step 34A/70) try" + "; width-try-by-set2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (34) WIDTH - REQUIRED
# ---------------------------------------------------------------------------------------------
jpu2image4xi['WIDTH'] = task4imageset2jpu['WIDTH']
message2print = "{(Step 34H/70) set" + "; width-set-by-set2image4jpu to: " + str(jpu2image4xi['WIDTH']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34H-'
except:
message2print = "{(Step 34Z1/70) yielded" + "; width-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z1-'
message2print = "{(Step 35A/70) try" + "; height-try-by-set2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (35) HEIGHT - REQUIRED
# ---------------------------------------------------------------------------------------------
jpu2image4xi['HEIGHT'] = task4imageset2jpu['HEIGHT']
message2print = "{(Step 35H/70) set" + "; height-set-by-set2image4jpu to: " + str(jpu2image4xi['HEIGHT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '35H-'
except:
message2print = "{(Step 35Z1/70) yielded" + "; height-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '35Z1-'
message2print = "{(Step 36A/70) try" + "; rowpitch-try-by-set2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (36) ROWPITCH - REQUIRED
# ---------------------------------------------------------------------------------------------
jpu2image4xi['ROWPITCH'] = task4imageset2jpu['ROWPITCH']
message2print = "{(Step 36B/70) set" + "; rowpitch-set-by-set2image4jpu to: " + str(jpu2image4xi['ROWPITCH']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z1/70) yielded" + "; rowpitch-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '36Z1-'
message2print = "{(Step 37A/70) try" + "; pointer-try-by-set2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (37) POINTER - REQUIRED
# ---------------------------------------------------------------------------------------------
jpu2image4xi['POINTER'] = task4imageset2jpu['POINTER']
message2print = "{(Step 37B/70) set" + "; pointer-set-by-set2image4jpu to: " + str(jpu2image4xi['POINTER']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37B-'
except:
message2print = "{(Step 37Z1/70) yielded" + "; pointer-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '37Z1-'
message2print = "{(Step 38A/70) try" + "; format-try-by-set2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (38) FORMAT - REQUIRED
# ---------------------------------------------------------------------------------------------
jpu2image4xi['FORMAT'] = task4imageset2jpu['FORMAT']
message2print = "{(Step 38B/70) set" + "; format-set-by-set2image4jpu to: " + str(jpu2image4xi['FORMAT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '38B-'
except:
message2print = "{(Step 38Z1/70) yielded" + "; format-yielded-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '38Z1-'
# -----------------------------------------------------------------------------------------
# (Step 70/70)
# -----------------------------------------------------------------------------------------
jpu2image4xi ['ACK2RETURN'] = code2ack
jpu2image4xi ['NACK2RETURN'] = code2nack
message2print = "{(Step 70/70) returning" + "; jpu2image4xi-returning-by-set2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'ACK2RETURN': ' 23B-24B-25B-26B-27B-28B-', 'ROWPITCH': 800, 'DATA2CALLBACK': ...
return jpu2image4xi
#
# -------------------------------------------------------------------------------------------------
#copy2copy4jpu"
# channel2copypublish4jpu = response4copy2image['PUBLISHERCHANNEL']
# channel2copypublish4jpu.send(message2copyimagesend4jpu)
# print("(Step 17B/700) OF JPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4JPU: ", channel2copypublish4jpu, " MESSAGE2SEND4JPU: " , message2copyimagesend4jpu)
# except:
# print('(Step 17Z1/700) OF JPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4JPU ', time4xi())
# # -----------------------------------------------------------------------------------------------
# # (18) LET MANOEUVRE2IMAGE4JPU TO RECEIVE COPY AND AND SEND ROGER VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print("(Step 18C/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# try:
# response2manoeuvre4jpu = manoeuvre2copyimage4jpu(queue2copy4jpu, channel2copyconsume4jpu, channel2copypublish4jpu)
# print("(Step 18D/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", manoeuvre2copyimage4jpu)
# except:
# print("(Step 18Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# else:
# pass # trust activated thread
# # -----------------------------------------------------------------------------------------------
# # (19) RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 19A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4JPU ', time4xi())
# try:
# channel2copyconsume4jpu = response4copy2image['CONSUMERCHANNEL']
# message2copyimagereceive4jpu = channel2copyconsume4jpu.recv()
# print("(Step 19B/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel2copyconsume4jpu, " CONTROL & COMMAND: ", message2copyimagereceive4jpu)
# # roger2copy4jpu
# except:
# print('(Step 19Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4JPU ', time4xi())
# # -----------------------------------------------------------------------------------------------
# # (20) SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2IMAGE4JPU TO RECEIVE
# # -----------------------------------------------------------------------------------------------
# print('(Step 20A/700) OF JPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4JPU ', time4xi())
# try:
# message2copyimagesend4jpu = "copy2copy4jpu"
# channel2copypublish4jpu = response4copy2image['PUBLISHERCHANNEL']
# channel2copypublish4jpu.send(message2copyimagesend4jpu)
# print("(Step 20B/700) OF JPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4JPU: ", channel2copypublish4jpu, " MESSAGE2SEND4JPU: " , message2copyimagesend4jpu)
# # copy2copy4jpu
# except:
# print('(Step 20Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4JPU ', time4xi())
# # -----------------------------------------------------------------------------------------------
# # (21) LET MANOEUVRE2IMAGE4JPU TO RECEIVE READY AND TO SEND READY
# # -----------------------------------------------------------------------------------------------
# print("(Step 21A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# try:
# response2manoeuvre4jpu = manoeuvre2copyimage4jpu(queue2copy4jpu, channel2copyconsume4jpu, channel2copypublish4jpu)
# print("(Step 21B/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", manoeuvre2copyimage4jpu)
# except:
# print("(Step 21Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (22) RECEIVE CONTROL & COMMAND READY VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 22A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4JPU ', time4xi())
# try:
# channel2copyconsume4jpu = response4copy2image['CONSUMERCHANNEL']
# message2copyimagereceive4jpu = channel2copyconsume4jpu.recv()
# print("(Step 22B/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel2copyconsume4jpu, " CONTROL & COMMAND: ", message2copyimagereceive4jpu)
# # copy2copy4jpu
# except:
# print('(Step 22Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4JPU ', time4xi())
# # ----------------------------------------------------------------------------------------------
# # (24) PUT IMAGE PATH TO QUEUE
# # ----------------------------------------------------------------------------------------------
# print("(Step 24A/700) OF JPU2IMAGE4XI5TEST - 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 JPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (25) LET MANOEUVRE2IMAGE4JPU TO GET FROM QUEUE AND TO SEND EITHER ACK OR NACK VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print("(Step 25A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# try:
# response2manoeuvre4jpu = manoeuvre2copyimage4jpu(queue2copy4jpu, channel2copyconsume4jpu, channel2copypublish4jpu)
# print("(Step 25B/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", manoeuvre2copyimage4jpu)
# except:
# print("(Step 25Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (26) RECEIVE ACK OR NACK ABOUT IMAGE OPERATION VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 26A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2copyimagereceive4jpu = channel2copyconsume4jpu.recv()
# print("(Step 26D/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel2copyconsume4jpu, " CONTROL & COMMAND: ", message2copyimagereceive4jpu)
# # ack2imageinfo4jpu
# except:
# print('(Step 26Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# # -----------------------------------------------------------------------------------------------
# (27) LET MANOEUVRE2IMAGE4JPU GO TO STATE 0
# # -----------------------------------------------------------------------------------------------
# print("(Step 27A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# try:
# response2manoeuvre4jpu = manoeuvre2copyimage4jpu(queue2copy4jpu, channel2copyconsume4jpu, channel2copypublish4jpu)
# print("(Step 27B/700) OF JPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4JPU ", response2manoeuvre4jpu)
# except:
# print("(Step 27Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
#">
# -------------------------------------------------------------------------------------------------
def copy2image4jpu(task4imagecopy2jpu=None):
'''
copies 2D images for JPU
'''
global jpu2image4xi # 2D-IMAGES FOR JPU
global control2copyimage4jpu # COMMAND AND CONTROL FOR JPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "copy2image4jpu"
method2print = "copy2image4jpu"
message2print = "{(Step 0A/33) started" + "; copy2image4jpu-started: " + str(copy2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0B/33) passed" + "; task4imagecopy2jpu-to-copy2image4jpu: " + str(task4imagecopy2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE JPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if jpu2image4xi is None:
jpu2image4xi = create2image4jpu() # INITIALIZE IMAGE FOR JPU
message2print = "{(Step 0C/70) created" + "; jpu2image4xi-created-by-copy2image4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 0D/70) skipped" + "; create2image4jpu-skipped-by-copy2image4jpu: " + str(copy2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
try:
jpu2image4xi = create2image4jpu()
message2print = "{(Step 0E/70) set" + "; jpu2image4xi-set-by-copy2image4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
jpu2image4xi = {}
message2print = "{(Step 0Z/70) yielded" + "; jpu2image4xi-yielded-by-copy2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '0Z-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - CHECK PARAMETERS
# -----------------------------------------------------------------------------------------
try:
if task4imagecopy2jpu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR COPY - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4imagecopy2jpu = {}
message2print = "{(Step 1A/70) initialized" + "; task4imagecopy2jpu-created-by-copy2image4jpu to: " + str(task4imagecopy2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4jpu = trace2image4jpu # CALLBACK FUNCTION FOR JPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4jpu-created-by-copy2image4jpu to: " + str(function2callback4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2image4jpu" # MODULE OF JPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2image4jpu" # FUNCTION OF JPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2image4jpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR JPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-copy2image4jpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; copy2image4jpu-failed ; time: 07:01:44 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2image4jpu',
# 'METHOD': 'copy2image4jpu'}; time: 07:01:44 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagecopy2jpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO JPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagecopy2jpu['FUNCTION2CALLBACK'] = function2callback4jpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4imagecopy2jpu-created-by-copy2image4jpu to: " + str(task4imagecopy2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; copy2image4jpu-failed ; time: 07:01:44 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2image4jpu',
# 'METHOD': 'copy2image4jpu'}}; time: 07:01:44 10/04/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-copy2image4jpu 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-copy2image4jpu: " + 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-copy2image4jpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4imagecopy2jpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2jpu = {}
message2print = "{(Step 3A/70) trying" + "; context2jpu-trying-by-copy2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2jpu = get2context4jpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2jpu-got-by-copy2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) ...
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2jpu-failed-by-copy2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4imagecopy2jpu ['CONTEXT'] = context2jpu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2jpu = {}
message2print = "{(Step 4A/70) trying" + "; device2jpu-trying-by-copy2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2jpu = get2jpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2jpu-got-by-copy2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'RESOLUTION2TIMER4PROFILING': 318, 'ID2PLATFORM': '0000000001509568', 'PROFILING2QUEUE': 'ACK', ...
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2jpu-failed-by-copy2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4imagecopy2jpu ['DEVICE'] = device2jpu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE SOURCE OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
imagesourceinfo2jpu = {}
message2print = "{(Step 5A/70) trying" + "; imagesourceinfo2jpu-trying-by-copy2image4jpu: " + str(imagesourceinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imagesourceinfo2jpu = get2imageinfo4jpu()
message2print = "{(Step 5B/70) got" + "; imagesourceinfo2jpu-got-by-copy2image4jpu: " + str(imagesourceinfo2jpu) + "; 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" + "; imagesourceinfo2jpu-failed-by-copy2image4jpu: " + str(imagesourceinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4imagecopy2jpu ['IMAGESOURCE'] = imagesourceinfo2jpu
# ---------------------------------------------------------------------------------------------
# (6) IMAGE DESTINATION OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
imagedestinationinfo2jpu = {}
message2print = "{(Step 6A/70) trying" + "; imagedestinationinfo2jpu-trying-by-copy2image4jpu: " + str(imagedestinationinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imagedestinationinfo2jpu = get2imageinfo4jpu()
message2print = "{(Step 6B/70) got" + "; imagedestinationinfo2jpu-got-by-copy2image4jpu: " + str(imagedestinationinfo2jpu) + "; 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" + "; imagedestinationinfo2jpu-failed-by-copy2image4jpu: " + str(imagedestinationinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4imagecopy2jpu ['IMAGEDESTINATION'] = imagedestinationinfo2jpu
# ---------------------------------------------------------------------------------------------
# (7) QUEUE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
queue2jpu = None
message2print = "{(Step 7A/70) trying" + "; queue2jpu-trying-by-copy2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2jpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 7B/70) got" + "; queue2jpu-got-by-copy2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; queue2jpu-failed-by-copy2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4imagecopy2jpu ['QUEUE'] = queue2jpu
# ---------------------------------------------------------------------------------------------
# (8) PIPE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
pipe2jpu = None
message2print = "{(Step 8A/70) trying" + "; pipe2jpu-trying-by-copy2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2jpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 8B/70) got" + "; pipe2jpu-got-by-copy2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; pipe2jpu-failed-by-copy2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4imagecopy2jpu ['PIPE'] = pipe2jpu
# ---------------------------------------------------------------------------------------------
# (9) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2jpu = {}
message2print = "{(Step 9A/70) trying" + "; commandqueueinfo2jpu-trying-by-copy2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2jpu = get2commandqueueinfo4jpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; commandqueueinfo2jpu-got-by-copy2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2commandqueue4jpu-failed ; time: 07:01:44 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4jpu',
# 'METHOD': 'create2commandqueue4jpu'},
# 'FUNCTION2CALLBACK': ...
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; commandqueueinfo2jpu-failed-by-copy2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4imagecopy2jpu ['COMMANDQUEUE'] = commandqueueinfo2jpu
# ---------------------------------------------------------------------------------------------
# (10) BUFFER - AUTOMATIC BY JPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2jpu = {}
message2print = "{(Step 10A/70) trying" + "; bufferinfo2jpu-trying-by-copy2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2jpu = get2bufferinfo4jpu() # SYSTEM CREATES BUFFER FOR JPU, IF NECESSARY
message2print = "{(Step 10B/70) got" + "; bufferinfo2jpu-got-by-copy2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE' ...
code2ack = code2ack + '10B-'
except:
message2print = "{(Step 10Z/70) failed" + "; bufferinfo2jpu-failed-by-copy2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '10Z-'
task4imagecopy2jpu ['BUFFER'] = bufferinfo2jpu
# ---------------------------------------------------------------------------------------------
# (11) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2jpu = {}
message2print = "{(Step 11A/70) trying" + "; eventinfo2jpu-trying-by-copy2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2jpu = get2eventinfo4jpu()
message2print = "{(Step 11B/70) got" + "; eventinfo2jpu-got-by-copy2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2event4jpu-failed ; time: 07:01:44 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2event4jpu',
# 'METHOD': 'create2event4jpu'},
# '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" + "; eventinfo2jpu-failed-by-copy2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4imagecopy2jpu ['EVENT'] = eventinfo2jpu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2jpu = {}
message2print = "{(Step 12A/70) trying" + "; eventwaitlist2jpu-trying-by-copy2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2jpu = {}
message2print = "{(Step 12B/70) set" + "; eventwaitlist2jpu-set-by-copy2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlist2jpu-failed-by-copy2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4imagecopy2jpu ['EVENTWAITLIST'] = eventwaitlist2jpu
# ---------------------------------------------------------------------------------------------
# (13) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2jpu = 0
message2print = "{(Step 13A/70) trying" + "; eventwaitlistquantity2jpu-trying-by-copy2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2jpu.keys()
for key2event in keys2event:
eventwaitlistquantity2jpu = eventwaitlistquantity2jpu + 1
message2print = "{(Step 13B/70) set" + "; eventwaitlistquantity2jpu-set-by-copy2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; eventwaitlistquantity2jpu-failed-by-copy2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4imagecopy2jpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2jpu
# ---------------------------------------------------------------------------------------------
# (14) ORIGIN FOR SOURCE - REQUIRED
# ---------------------------------------------------------------------------------------------
origin4source2jpu = {}
message2print = "{(Step 14A/70) trying" + "; origin4source2jpu-trying-by-copy2image4jpu: " + str(origin4source2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin4source2jpu['X'] = 0
origin4source2jpu['Y'] = 0
origin4source2jpu['Z'] = 0
message2print = "{(Step 14B/70) set" + "; origin4source2jpu-set-by-copy2image4jpu to: " + str(origin4source2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; origin4source2jpu-failed-by-copy2image4jpu: " + str(origin4source2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4imagecopy2jpu ['SOURCEORIGIN'] = origin4source2jpu
# ---------------------------------------------------------------------------------------------
# (15) ORIGIN FOR DESTINATION - REQUIRED
# ---------------------------------------------------------------------------------------------
origin4destination2jpu = {}
message2print = "{(Step 15A/70) trying" + "; origin4destination2jpu-trying-by-copy2image4jpu: " + str(origin4destination2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin4destination2jpu['X'] = 100
origin4destination2jpu['Y'] = 100
origin4destination2jpu['Z'] = 100
message2print = "{(Step 15B/70) set" + "; origin4destination2jpu-set-by-copy2image4jpu to: " + str(origin4destination2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; origin4destination2jpu-failed-by-copy2image4jpu: " + str(origin4destination2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '15Z-'
task4imagecopy2jpu ['DESTINATIONORIGIN'] = origin4destination2jpu
# --------------------------------------------------------------------------------------------------------
# (16) REGION - REGION OF A IMAGE TO BE COPIED
# --------------------------------------------------------------------------------------------------------
region4copy2jpu = {}
message2print = "{(Step 16A/70) trying" + "; region4copy2jpu-trying-by-copy2image4jpu: " + str(region4copy2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region4copy2jpu['X'] = 10
region4copy2jpu['Y'] = 10
region4copy2jpu['Z'] = 10
message2print = "{(Step 16B/70) set" + "; region4copy2jpu-set-by-copy2image4jpu to: " + str(region4copy2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; region4copy2jpu-failed-by-copy2image4jpu: " + str(region4copy2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '16Z-'
task4imagecopy2jpu ['REGION'] = region4copy2jpu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
else:
pass
# ---------------------------------------------------------------------------------------------
# CHECK PARAMETERS - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4imagecopy2jpu.keys()
message2print = "{(Step 20/70) using" + "; keys2task-using-by-copy2image4jpu: " + 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
# ---------------------------------------------------------------------------------------------
function2callback4jpu = trace2image4jpu # CALLBACK FUNCTION FOR JPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4jpu-created-by-copy2image4jpu to: " + str(function2callback4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2image4jpu" # MODULE OF JPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2image4jpu" # FUNCTION OF JPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2image4jpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR JPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-copy2image4jpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagecopy2jpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO JPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagecopy2jpu['FUNCTION2CALLBACK'] = function2callback4jpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4imagecopy2jpu-created-by-copy2image4jpu to: " + str(task4imagecopy2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-copy2image4jpu 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-copy2image4jpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-copy2image4jpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4imagecopy2jpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2jpu = {}
message2print = "{(Step 23A/70) trying" + "; context2jpu-trying-by-copy2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2jpu = get2context4jpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2jpu-got-by-copy2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2jpu-failed-by-copy2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4imagecopy2jpu ['CONTEXT'] = context2jpu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2jpu = {}
message2print = "{(Step 24A/70) trying" + "; device2jpu-trying-by-copy2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2jpu = get2jpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2jpu-got-by-copy2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2jpu-failed-by-copy2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4imagecopy2jpu ['DEVICE'] = device2jpu
if 'IMAGESOURCE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) SOURCE IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
sourceimageinfo2jpu = {}
message2print = "{(Step 25A/70) trying" + "; sourceimageinfo2jpu-trying-by-copy2image4jpu: " + str(sourceimageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
sourceimageinfo2jpu = get2imageinfo4jpu()
message2print = "{(Step 25B/70) got" + "; sourceimageinfo2jpu-got-by-copy2image4jpu: " + str(sourceimageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; sourceimageinfo2jpu-failed-by-copy2image4jpu: " + str(sourceimageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4imagecopy2jpu ['IMAGESOURCE'] = sourceimageinfo2jpu
if 'IMAGEDESTINATION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) DESTINATION IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
destinationimageinfo2jpu = {}
message2print = "{(Step 26A/70) trying" + "; destinationimageinfo2jpu-trying-by-copy2image4jpu: " + str(destinationimageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
destinationimageinfo2jpu = get2imageinfo4jpu()
message2print = "{(Step 26B/70) got" + "; destinationimageinfo2jpu-got-by-copy2image4jpu: " + str(destinationimageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; destinationimageinfo2jpu-failed-by-copy2image4jpu: " + str(destinationimageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4imagecopy2jpu ['IMAGEDESTINATION'] = destinationimageinfo2jpu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) QUEUE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
queue2jpu = None
message2print = "{(Step 27A/70) trying" + "; queue2jpu-trying-by-copy2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2jpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 27B/70) got" + "; queue2jpu-got-by-copy2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; queue2jpu-failed-by-copy2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4imagecopy2jpu ['QUEUE'] = queue2jpu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) PIPE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
pipe2jpu = None
message2print = "{(Step 28A/70) trying" + "; pipe2jpu-trying-by-copy2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2jpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 28B/70) got" + "; pipe2jpu-got-by-copy2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; pipe2jpu-failed-by-copy2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4imagecopy2jpu ['PIPE'] = pipe2jpu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2jpu = {}
message2print = "{(Step 29A/70) trying" + "; commandqueueinfo2jpu-trying-by-copy2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2jpu = get2commandqueueinfo4jpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; commandqueueinfo2jpu-got-by-copy2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; commandqueueinfo2jpu-failed-by-copy2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4imagecopy2jpu ['COMMANDQUEUE'] = commandqueueinfo2jpu
if 'BUFFER' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (30) BUFFER - AUTOMATIC BY JPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2jpu = {}
message2print = "{(Step 30A/70) trying" + "; bufferinfo2jpu-trying-by-copy2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2jpu = get2bufferinfo4jpu() # SYSTEM CREATES BUFFER FOR JPU, IF NECESSARY
message2print = "{(Step 30B/70) got" + "; bufferinfo2jpu-got-by-copy2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '30B-'
except:
message2print = "{(Step 30Z/70) failed" + "; bufferinfo2jpu-failed-by-copy2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '30Z-'
task4imagecopy2jpu ['BUFFER'] = bufferinfo2jpu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2jpu = {}
message2print = "{(Step 31A/70) trying" + "; eventinfo2jpu-trying-by-copy2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2jpu = get2eventinfo4jpu()
message2print = "{(Step 31B/70) got" + "; eventinfo2jpu-got-by-copy2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventinfo2jpu-failed-by-copy2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4imagecopy2jpu ['EVENT'] = eventinfo2jpu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2jpu = {}
message2print = "{(Step 32A/70) trying" + "; eventwaitlist2jpu-trying-by-copy2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2jpu = {}
message2print = "{(Step 32B/70) set" + "; eventwaitlist2jpu-set-by-copy2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlist2jpu-failed-by-copy2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4imagecopy2jpu ['EVENTWAITLIST'] = eventwaitlist2jpu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2jpu = 0
message2print = "{(Step 33A/70) trying" + "; eventwaitlistquantity2jpu-trying-by-copy2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2jpu.keys()
for key2event in keys2event:
eventwaitlistquantity2jpu = eventwaitlistquantity2jpu + 1
message2print = "{(Step 33B/70) set" + "; eventwaitlistquantity2jpu-set-by-copy2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; eventwaitlistquantity2jpu-failed-by-copy2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4imagecopy2jpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2jpu
if 'SOURCEORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) SOURCEORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
source4origin2jpu = {}
message2print = "{(Step 34A/70) trying" + "; source4origin2jpu-trying-by-copy2image4jpu: " + str(source4origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
source4origin2jpu['X'] = 0
source4origin2jpu['Y'] = 0
source4origin2jpu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; source4origin2jpu-set-by-copy2image4jpu to: " + str(source4origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; source4origin2jpu-failed-by-copy2image4jpu: " + str(source4origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4imagecopy2jpu ['SOURCEORIGIN'] = source4origin2jpu
if 'DESTINATIONORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (35) DESTINATIONORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
destination4origin2jpu = {}
message2print = "{(Step 35A/70) trying" + "; destination4origin2jpu-trying-by-copy2image4jpu: " + str(destination4origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
destination4origin2jpu['X'] = 100
destination4origin2jpu['Y'] = 100
destination4origin2jpu['Z'] = 100
message2print = "{(Step 35B/70) set" + "; destination4origin2jpu-set-by-copy2image4jpu to: " + str(destination4origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '35B-'
except:
message2print = "{(Step 35Z/70) failed" + "; destination4origin2jpu-failed-by-copy2image4jpu: " + str(destination4origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '35Z-'
task4imagecopy2jpu ['DESTINATIONSOURCEORIGIN'] = destination4origin2jpu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (36) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2jpu = {}
message2print = "{(Step 36A/70) trying" + "; region2jpu-trying-by-copy2image4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2jpu['X'] = 160 # WIDTH IN PIXELS TO WRITE
region2jpu['Y'] = 90 # HEIGHT IN PIXELS TO WRITE
region2jpu['Z'] = 0 # DEPTH IN PIXELS TO WRITE
message2print = "{(Step 36B/70) set" + "; region2jpu-set-by-copy2image4jpu to: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; region2jpu-failed-by-copy2image4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '36Z-'
task4imagecopy2jpu ['REGION'] = region2jpu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER CHECKING AND PROVIDING FOR MISSING ONES
# ---------------------------------------------------------------------------------------------
keys2task = task4imagecopy2jpu.keys()
message2print = "{(Step 39/70) set" + "; keys2task-set-by-copy2image4jpu 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" + "; task4imagecopy2jpu-yielded-by-copy2image4jpu: " + str(task4imagecopy2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '39Z-'
# ---------------------------------------------------------------------------------------------
# CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
control2copyimage4jpu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2jpu = False
channels2jpu = ()
message2print = "{(Step 40A/70) trying" + "channels2jpu-trying-by-copy2image4jpu: " + str(channels2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
#
consumerchannel2jpu, publisherchannel2jpu = task4imagecopy2jpu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2jpu-got-by-copy2image4jpu: " + str(consumerchannel2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2jpu-got-by-copy2image4jpu: " + str(publisherchannel2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2jpu = True
control2copyimage4jpu['CONSUMERCHANNEL'] = consumerchannel2jpu
control2copyimage4jpu['PUBLISHERCHANNEL'] = publisherchannel2jpu
code2ack = code2ack + '40D-'
except:
ack4channels2jpu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2jpu = False
queue2jpu = None
message2print = "{(Step 41A/70) trying" + "queue2jpu-trying-by-copy2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2jpu = task4imagecopy2jpu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2jpu-got-by-copy2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2jpu = True
control2copyimage4jpu['QUEUE'] = queue2jpu
code2ack = code2ack + '41C-'
except:
ack4queue2jpu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4jpu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4jpu-trying-by-copy2image4jpu: " + str(dummy2image4jpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4jpu = DummyProcess4Xi(target=manoeuvre2copyimage4jpu, # in this module to handle queue and pipe channels
# args =(queue2jpu, # caller puts and gets - does NOT call any functions
# consumerchannel2jpu, publisherchannel2jpu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4jpu-created-by-copy2image4jpu: " + str(dummy2image4jpu) + "; 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-copy2image4jpu: " + 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-copy2image4jpu: " + str(code2nack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70C/70) returning" + "; control2copyimage4jpu-returning-by-copy2image4jpu: " + str(control2copyimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return control2copyimage4jpu
#
# -------------------------------------------------------------------------------------------------
#copy2copyimagetobuffer4jpu"
# channel2copyimagetobufferpublish4jpu = response4copy2imagetobuffer['PUBLISHERCHANNEL']
# channel2copyimagetobufferpublish4jpu.send(message2copyimagetobuffersend4jpu)
# print("(Step 61B/700) OF JPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4JPU: ", channel2copyimagetobufferpublish4jpu, " MESSAGE2SEND4JPU: " , message2copyimagetobuffersend4jpu)
# except:
# print('(Step 61Z1/700) OF JPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4JPU ', time4xi())
# # ------------------------------------------------------------------------------------------
# # (62) LET MANOEUVRE2COPYIMAGETOBUFFER4JPU TO RECEIVE COPY AND AND SEND ROGER VIA PIPE
# # ------------------------------------------------------------------------------------------
# print("(Step 62A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4jpu = manoeuvre2copyimagetobuffer4jpu(queue2copyimagetobuffer4jpu, channel2copyimagetobufferconsume4jpu, channel2copyimagetobufferpublish4jpu)
# print("(Step 62B/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", manoeuvre2copyimagetobuffer4jpu)
# except:
# print("(Step 62Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", time4xi())
# else:
# pass # trust activated thread
# # ---------------------------------------------------------------------------------------------
# # (63) RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------
# print('(Step 63A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4JPU ', time4xi())
# try:
# channel2copyimagetobufferconsume4jpu = response4copy2imagetobuffer['CONSUMERCHANNEL']
# message2copyimagereceive4jpu = channel2copyimagetobufferconsume4jpu.recv()
# print("(Step 63B/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel2copyimagetobufferconsume4jpu, " CONTROL & COMMAND: ", message2copyimagereceive4jpu)
# #
# except:
# print('(Step 63Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4JPU ', time4xi())
# # ---------------------------------------------------------------------------------------------------
# # (64) SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2COPYIMAGETOBUFFER4JPU TO RECEIVE
# # ---------------------------------------------------------------------------------------------------
# print('(Step 64A/700) OF JPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4JPU ', time4xi())
# try:
# message2copyimagetobuffersend4jpu = "copy2copyimagetobuffer4jpu"
# channel2copyimagetobufferpublish4jpu = response4copy2imagetobuffer['PUBLISHERCHANNEL']
# channel2copyimagetobufferpublish4jpu.send(message2copyimagetobuffersend4jpu)
# print("(Step 64B/700) OF JPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4JPU: ", channel2copyimagetobufferpublish4jpu, " MESSAGE2SEND4JPU: " , message2copyimagetobuffersend4jpu)
# #
# except:
# print('(Step 64Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4JPU ', time4xi())
# # -----------------------------------------------------------------------------------
# # (65) LET MANOEUVRE2COPYIMAGETOBUFFER4JPU TO RECEIVE READY AND TO SEND READY
# # -----------------------------------------------------------------------------------
# print("(Step 65A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4jpu = manoeuvre2copyimagetobuffer4jpu(queue2copyimagetobuffer4jpu, channel2copyimagetobufferconsume4jpu, channel2copyimagetobufferpublish4jpu)
# print("(Step 65B/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", manoeuvre2copyimagetobuffer4jpu)
# except:
# print("(Step 65Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", time4xi())
# # ---------------------------------------------------------------------------------------
# # (66) RECEIVE CONTROL & COMMAND READY VIA PIPE
# # ---------------------------------------------------------------------------------------
# print('(Step 66A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4JPU ', time4xi())
# try:
# channel2copyimagetobufferconsume4jpu = response4copy2imagetobuffer['CONSUMERCHANNEL']
# message2copyimagereceive4jpu = channel2copyimagetobufferconsume4jpu.recv()
# print("(Step 66B/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel2copyimagetobufferconsume4jpu, " CONTROL & COMMAND: ", message2copyimagereceive4jpu)
# #
# except:
# print('(Step 66Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4JPU ', time4xi())
# # -----------------------------------------------------------------------------------------
# # (67) PUT IMAGE PATH TO QUEUE
# # -----------------------------------------------------------------------------------------
# print("(Step 67A/700) OF JPU2IMAGE4XI5TEST - 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 JPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
# # ------------------------------------------------------------------------------------------------------
# # (68) LET MANOEUVRE2COPYIMAGETOBUFFER4JPU TO GET FROM QUEUE AND TO SEND EITHER ACK OR NACK VIA PIPE
# # -------------------------------------------------------------------------------------------------------
# print("(Step 68A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4jpu = manoeuvre2copyimagetobuffer4jpu(queue2copyimagetobuffer4jpu, channel2copyimagetobufferconsume4jpu, channel2copyimagetobufferpublish4jpu)
# print("(Step 68B/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", manoeuvre2copyimagetobuffer4jpu)
# except:
# print("(Step 68Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (69) RECEIVE ACK OR NACK ABOUT IMAGE OPERATION VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 69A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2copyimagereceive4jpu = channel2copyimagetobufferconsume4jpu.recv()
# print("(Step 69D/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel2copyimagetobufferconsume4jpu, " CONTROL & COMMAND: ", message2copyimagereceive4jpu)
# except:
# print('(Step 69Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# # -------------------------------------------------------------------------------------------------------
# # (70) LET MANOEUVRE2COPYIMAGETOBUFFER4JPU GO TO STATE 0
# # -------------------------------------------------------------------------------------------------------
# print("(Step 70A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4jpu = manoeuvre2copyimagetobuffer4jpu(queue2copyimagetobuffer4jpu, channel2copyimagetobufferconsume4jpu, channel2copyimagetobufferpublish4jpu)
# print("(Step 70B/700) OF JPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4JPU ", response2manoeuvreimagecopytobuffer4jpu)
# except:
# print("(Step 70Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", time4xi())
#">
# -------------------------------------------------------------------------------------------------
def copy2imagetobuffer4jpu(task4copyimagetobuffer2jpu=None):
'''
copies 2D images to buffer for JPU
'''
global jpu2image4xi # 2D-IMAGES FOR JPU
global jpu2buffer4xi # BUFFER FOR JPU
global control2copyimagetobuffer4jpu # COMMAND AND CONTROL FOR JPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "copy2imagetobuffer4jpu"
method2print = "copy2imagetobuffer4jpu"
message2print = "{(Step 1A/33) started" + "; copy2imagetobuffer4jpu-started: " + str(copy2imagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1B/33) passed" + "; task4copyimagetobuffer2jpu-to-copy2imagetobuffer4jpu: " + str(task4copyimagetobuffer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE JPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if jpu2image4xi is None:
jpu2image4xi = create2image4jpu() # INITIALIZE IMAGE FOR JPU
message2print = "{(Step 1C/70) created" + "; jpu2image4xi-created-by-copy2imagetobuffer4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4jpu-skipped-by-copy2imagetobuffer4jpu: " + str(copy2imagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# create2image4jpu-skipped-by-copy2imagetobuffer4jpu
except:
try:
jpu2image4xi = create2image4jpu()
message2print = "{(Step 1E/70) set" + "; jpu2image4xi-set-by-copy2imagetobuffer4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
jpu2image4xi = {}
message2print = "{(Step 1Z1/70) yielded" + "; jpu2image4xi-yielded-by-copy2imagetobuffer4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z1-'
# -----------------------------------------------------------------------------------------
# CREATE JPU2BUFFER4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if jpu2buffer4xi is None:
jpu2buffer4xi = create2buffer4jpu() # INITIALIZE BUFFER FOR JPU
message2print = "{(Step 1F/70) created" + "; jpu2buffer4xi-created-by-copy2imagetobuffer4jpu to: " + str(jpu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1G/70) skipped" + "; create2buffer4jpu-skipped-by-copy2imagetobuffer4jpu: " + str(copy2imagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
try:
jpu2buffer4xi = create2buffer4jpu()
message2print = "{(Step 1H/70) set" + "; jpu2buffer4xi-set-by-copy2imagetobuffer4jpu to: " + str(jpu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4jpu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4jpu',
# 'METHOD': 'create2buffer4jpu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': ...
except:
jpu2buffer4xi = {}
message2print = "{(Step 1Z2/70) yielded" + "; jpu2buffer4xi-yielded-by-copy2imagetobuffer4jpu: " + str(jpu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z2-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - ANALYZE TASK
# -----------------------------------------------------------------------------------------
if task4copyimagetobuffer2jpu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR COPY - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4copyimagetobuffer2jpu = {}
message2print = "{(Step 1A/70) initialized" + "; task4copyimagetobuffer2jpu-created-by-copy2imagetobuffer4jpu to: " + str(task4copyimagetobuffer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4jpu = trace2image4jpu # CALLBACK FUNCTION FOR JPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4jpu-created-by-copy2imagetobuffer4jpu to: " + str(function2callback4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2imagetobuffer4jpu" # MODULE OF JPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2imagetobuffer4jpu" # FUNCTION OF JPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2imagetobuffer4jpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR JPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-copy2imagetobuffer4jpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; copy2imagetobuffer4jpu-failed; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2imagetobuffer4jpu',
# 'METHOD': 'copy2imagetobuffer4jpu'}; time: 03:40:47 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4copyimagetobuffer2jpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO JPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4copyimagetobuffer2jpu['FUNCTION2CALLBACK'] = function2callback4jpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4copyimagetobuffer2jpu-created-by-copy2imagetobuffer4jpu to: " + str(task4copyimagetobuffer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; copy2imagetobuffer4jpu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2imagetobuffer4jpu',
# 'METHOD': 'copy2imagetobuffer4jpu'}}; time: 03:40:47 10/04/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-copy2imagetobuffer4jpu 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-copy2imagetobuffer4jpu: " + 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-copy2imagetobuffer4jpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4copyimagetobuffer2jpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2jpu = {}
message2print = "{(Step 3A/70) trying" + "; context2jpu-trying-by-copy2imagetobuffer4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2jpu = get2context4jpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2jpu-got-by-copy2imagetobuffer4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4jpu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4jpu',
# 'METHOD': 'create2context4jpu'},
# '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" + "; context2jpu-failed-by-copy2imagetobuffer4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4copyimagetobuffer2jpu ['CONTEXT'] = context2jpu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2jpu = {}
message2print = "{(Step 4A/70) trying" + "; device2jpu-trying-by-copy2imagetobuffer4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2jpu = get2jpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2jpu-got-by-copy2imagetobuffer4jpu: " + str(device2jpu) + "; 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_JPU',
# 'DENORMS2SINGLEPRECISION4FLOATINGPOINTCAPABILITY': 'ACK'}; time: 03:40:47 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2jpu-failed-by-copy2imagetobuffer4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4copyimagetobuffer2jpu ['DEVICE'] = device2jpu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE SOURCE OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
imagesourceinfo2jpu = {}
message2print = "{(Step 5A/70) trying" + "; imagesourceinfo2jpu-trying-by-copy2imagetobuffer4jpu: " + str(imagesourceinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imagesourceinfo2jpu = get2imageinfo4jpu()
message2print = "{(Step 5B/70) got" + "; imagesourceinfo2jpu-got-by-copy2imagetobuffer4jpu: " + str(imagesourceinfo2jpu) + "; 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" + "; imagesourceinfo2jpu-failed-by-copy2imagetobuffer4jpu: " + str(imagesourceinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4copyimagetobuffer2jpu ['IMAGESOURCE'] = imagesourceinfo2jpu
# ---------------------------------------------------------------------------------------------
# (6) BUFFER DESTINATION OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
bufferdestinationinfo2jpu = {}
message2print = "{(Step 6A/70) trying" + "; bufferdestinationinfo2jpu-trying-by-copy2imagetobuffer4jpu: " + str(bufferdestinationinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferdestinationinfo2jpu = get2bufferinfo4jpu()
message2print = "{(Step 6B/70) got" + "; bufferdestinationinfo2jpu-got-by-copy2imagetobuffer4jpu: " + str(bufferdestinationinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4jpu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4jpu',
# 'METHOD': 'create2buffer4jpu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0, ...
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; bufferdestinationinfo2jpu-failed-by-copy2imagetobuffer4jpu: " + str(bufferdestinationinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4copyimagetobuffer2jpu ['BUFFERDESTINATION'] = bufferdestinationinfo2jpu
# ---------------------------------------------------------------------------------------------
# (7) QUEUE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
queue2copyimagetobuffer4jpu = None
message2print = "{(Step 7A/70) trying" + "; queue2copyimagetobuffer4jpu-trying-by-copy2imagetobuffer4jpu: " + str(queue2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copyimagetobuffer4jpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 7B/70) got" + "; queue2copyimagetobuffer4jpu-got-by-copy2imagetobuffer4jpu: " + str(queue2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; queue2copyimagetobuffer4jpu-failed-by-copy2imagetobuffer4jpu: " + str(queue2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4copyimagetobuffer2jpu ['QUEUE'] = queue2copyimagetobuffer4jpu
# ---------------------------------------------------------------------------------------------
# (8) PIPE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
pipe2jpu = None
message2print = "{(Step 8A/70) trying" + "; pipe2jpu-trying-by-copy2imagetobuffer4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2jpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 8B/70) got" + "; pipe2jpu-got-by-copy2imagetobuffer4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; pipe2jpu-failed-by-copy2imagetobuffer4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4copyimagetobuffer2jpu ['PIPE'] = pipe2jpu
# ---------------------------------------------------------------------------------------------
# (9) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2jpu = {}
message2print = "{(Step 9A/70) trying" + "; commandqueueinfo2jpu-trying-by-copy2imagetobuffer4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2jpu = get2commandqueueinfo4jpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; commandqueueinfo2jpu-got-by-copy2imagetobuffer4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2commandqueue4jpu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4jpu',
# 'METHOD': 'create2commandqueue4jpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ...
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; commandqueueinfo2jpu-failed-by-copy2imagetobuffer4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4copyimagetobuffer2jpu ['COMMANDQUEUE'] = commandqueueinfo2jpu
# ---------------------------------------------------------------------------------------------
# (11) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2jpu = {}
message2print = "{(Step 11A/70) trying" + "; eventinfo2jpu-trying-by-copy2imagetobuffer4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2jpu = get2eventinfo4jpu()
message2print = "{(Step 11B/70) got" + "; eventinfo2jpu-got-by-copy2imagetobuffer4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2event4jpu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2event4jpu',
# 'METHOD': 'create2event4jpu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 1D-1E-...
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; eventinfo2jpu-failed-by-copy2imagetobuffer4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4copyimagetobuffer2jpu ['EVENT'] = eventinfo2jpu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2jpu = {}
message2print = "{(Step 12A/70) trying" + "; eventwaitlist2jpu-trying-by-copy2imagetobuffer4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2jpu = {}
message2print = "{(Step 12B/70) set" + "; eventwaitlist2jpu-set-by-copy2imagetobuffer4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlist2jpu-failed-by-copy2imagetobuffer4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4copyimagetobuffer2jpu ['EVENTWAITLIST'] = eventwaitlist2jpu
# ---------------------------------------------------------------------------------------------
# (13) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2jpu = 0
message2print = "{(Step 13A/70) trying" + "; eventwaitlistquantity2jpu-trying-by-copy2imagetobuffer4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2jpu.keys()
for key2event in keys2event:
eventwaitlistquantity2jpu = eventwaitlistquantity2jpu + 1
message2print = "{(Step 13B/70) set" + "; eventwaitlistquantity2jpu-set-by-copy2imagetobuffer4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; eventwaitlistquantity2jpu-failed-by-copy2imagetobuffer4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4copyimagetobuffer2jpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2jpu
# ---------------------------------------------------------------------------------------------
# (14) ORIGIN FOR SOURCE - REQUIRED
# ---------------------------------------------------------------------------------------------
origin4source2jpu = {}
message2print = "{(Step 14A/70) trying" + "; origin4source2jpu-trying-by-copy2imagetobuffer4jpu: " + str(origin4source2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin4source2jpu['X'] = 0
origin4source2jpu['Y'] = 0
origin4source2jpu['Z'] = 0
message2print = "{(Step 14B/70) set" + "; origin4source2jpu-set-by-copy2imagetobuffer4jpu to: " + str(origin4source2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 0, 'X': 0, 'Z': 0}
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; origin4source2jpu-failed-by-copy2imagetobuffer4jpu: " + str(origin4source2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4copyimagetobuffer2jpu ['SOURCEORIGIN'] = origin4source2jpu
# --------------------------------------------------------------------------------------------------------
# (16) REGION - REGION OF A IMAGE TO BE COPIED
# --------------------------------------------------------------------------------------------------------
region4copy2jpu = {}
message2print = "{(Step 16A/70) trying" + "; region4copy2jpu-trying-by-copy2imagetobuffer4jpu: " + str(region4copy2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region4copy2jpu['X'] = 10
region4copy2jpu['Y'] = 10
region4copy2jpu['Z'] = 10
message2print = "{(Step 16B/70) set" + "; region4copy2jpu-set-by-copy2imagetobuffer4jpu to: " + str(region4copy2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 10, 'X': 10, 'Z': 10}
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; region4copy2jpu-failed-by-copy2imagetobuffer4jpu: " + str(region4copy2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '16Z-'
task4copyimagetobuffer2jpu ['REGION'] = region4copy2jpu
# --------------------------------------------------------------------------------------------------------
# (17) OFFSET - WHERE TO BEGIN COPYING DATA INTO DESTINATION BUFFER
# --------------------------------------------------------------------------------------------------------
offset4copy2jpu = 0
message2print = "{(Step 17A/70) set" + "; offset4copy2jpu-set-by-copy2imagetobuffer4jpu to: " + str(offset4copy2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '17A-'
task4copyimagetobuffer2jpu ['OFFSET'] = offset4copy2jpu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
else:
pass
# ---------------------------------------------------------------------------------------------
# ANALYZE TASK - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4copyimagetobuffer2jpu.keys()
message2print = "{(Step 20/70) got" + "; keys2task-got-by-copy2imagetobuffer4jpu: " + 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
# ---------------------------------------------------------------------------------------------
function2callback4jpu = trace2image4jpu # CALLBACK FUNCTION FOR JPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4jpu-created-by-copy2imagetobuffer4jpu to: " + str(function2callback4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2imagetobuffer4jpu" # MODULE OF JPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2imagetobuffer4jpu" # FUNCTION OF JPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2imagetobuffer4jpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR JPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-copy2imagetobuffer4jpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4copyimagetobuffer2jpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO JPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4copyimagetobuffer2jpu['FUNCTION2CALLBACK'] = function2callback4jpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4copyimagetobuffer2jpu-created-by-copy2imagetobuffer4jpu to: " + str(task4copyimagetobuffer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-copy2imagetobuffer4jpu 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-copy2imagetobuffer4jpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-copy2imagetobuffer4jpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4copyimagetobuffer2jpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2jpu = {}
message2print = "{(Step 23A/70) trying" + "; context2jpu-trying-by-copy2imagetobuffer4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2jpu = get2context4jpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2jpu-got-by-copy2imagetobuffer4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2jpu-failed-by-copy2imagetobuffer4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4copyimagetobuffer2jpu ['CONTEXT'] = context2jpu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2jpu = {}
message2print = "{(Step 24A/70) trying" + "; device2jpu-trying-by-copy2imagetobuffer4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2jpu = get2jpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2jpu-got-by-copy2imagetobuffer4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2jpu-failed-by-copy2imagetobuffer4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4copyimagetobuffer2jpu ['DEVICE'] = device2jpu
if 'IMAGESOURCE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) SOURCE IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
sourceimageinfo2jpu = {}
message2print = "{(Step 25A/70) trying" + "; sourceimageinfo2jpu-trying-by-copy2imagetobuffer4jpu: " + str(sourceimageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
sourceimageinfo2jpu = get2imageinfo4jpu()
message2print = "{(Step 25B/70) got" + "; sourceimageinfo2jpu-got-by-copy2imagetobuffer4jpu: " + str(sourceimageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; sourceimageinfo2jpu-failed-by-copy2imagetobuffer4jpu: " + str(sourceimageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4copyimagetobuffer2jpu ['IMAGESOURCE'] = sourceimageinfo2jpu
if 'BUFFERDESTINATION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) DESTINATION BUFFER - REQUIRED
# ---------------------------------------------------------------------------------------------
destinationbufferinfo2jpu = {}
message2print = "{(Step 26A/70) trying" + "; destinationbufferinfo2jpu-trying-by-copy2imagetobuffer4jpu: " + str(destinationbufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
destinationbufferinfo2jpu = get2bufferinfo4jpu()
message2print = "{(Step 26B/70) got" + "; destinationbufferinfo2jpu-got-by-copy2imagetobuffer4jpu: " + str(destinationbufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; destinationbufferinfo2jpu-failed-by-copy2imagetobuffer4jpu: " + str(destinationbufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4copyimagetobuffer2jpu ['BUFFERDESTINATION'] = destinationbufferinfo2jpu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) QUEUE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
queue2copyimagetobuffer4jpu = None
message2print = "{(Step 27A/70) trying" + "; queue2copyimagetobuffer4jpu-trying-by-copy2imagetobuffer4jpu: " + str(queue2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copyimagetobuffer4jpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 27B/70) got" + "; queue2copyimagetobuffer4jpu-got-by-copy2imagetobuffer4jpu: " + str(queue2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; queue2copyimagetobuffer4jpu-failed-by-copy2imagetobuffer4jpu: " + str(queue2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4copyimagetobuffer2jpu ['QUEUE'] = queue2copyimagetobuffer4jpu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) PIPE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
pipe2jpu = None
message2print = "{(Step 28A/70) trying" + "; pipe2jpu-trying-by-copy2imagetobuffer4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2jpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 28B/70) got" + "; pipe2jpu-got-by-copy2imagetobuffer4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; pipe2jpu-failed-by-copy2imagetobuffer4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4copyimagetobuffer2jpu ['PIPE'] = pipe2jpu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2jpu = {}
message2print = "{(Step 29A/70) trying" + "; commandqueueinfo2jpu-trying-by-copy2imagetobuffer4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2jpu = get2commandqueueinfo4jpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; commandqueueinfo2jpu-got-by-copy2imagetobuffer4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; commandqueueinfo2jpu-failed-by-copy2imagetobuffer4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4copyimagetobuffer2jpu ['COMMANDQUEUE'] = commandqueueinfo2jpu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2jpu = {}
message2print = "{(Step 31A/70) trying" + "; eventinfo2jpu-trying-by-copy2imagetobuffer4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2jpu = get2eventinfo4jpu()
message2print = "{(Step 31B/70) got" + "; eventinfo2jpu-got-by-copy2imagetobuffer4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventinfo2jpu-failed-by-copy2imagetobuffer4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4copyimagetobuffer2jpu ['EVENT'] = eventinfo2jpu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2jpu = {}
message2print = "{(Step 32A/70) trying" + "; eventwaitlist2jpu-trying-by-copy2imagetobuffer4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2jpu = {}
message2print = "{(Step 32B/70) set" + "; eventwaitlist2jpu-set-by-copy2imagetobuffer4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlist2jpu-failed-by-copy2imagetobuffer4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4copyimagetobuffer2jpu ['EVENTWAITLIST'] = eventwaitlist2jpu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2jpu = 0
message2print = "{(Step 33A/70) trying" + "; eventwaitlistquantity2jpu-trying-by-copy2imagetobuffer4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2jpu.keys()
for key2event in keys2event:
eventwaitlistquantity2jpu = eventwaitlistquantity2jpu + 1
message2print = "{(Step 33B/70) set" + "; eventwaitlistquantity2jpu-set-by-copy2imagetobuffer4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; eventwaitlistquantity2jpu-failed-by-copy2imagetobuffer4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4copyimagetobuffer2jpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2jpu
if 'SOURCEORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) SOURCEORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
source4origin2jpu = {}
message2print = "{(Step 34A/70) trying" + "; source4origin2jpu-trying-by-copy2imagetobuffer4jpu: " + str(source4origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
source4origin2jpu['X'] = 0
source4origin2jpu['Y'] = 0
source4origin2jpu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; source4origin2jpu-set-by-copy2imagetobuffer4jpu to: " + str(source4origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; source4origin2jpu-failed-by-copy2imagetobuffer4jpu: " + str(source4origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4copyimagetobuffer2jpu ['SOURCEORIGIN'] = source4origin2jpu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (36) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2jpu = {}
message2print = "{(Step 36A/70) trying" + "; region2jpu-trying-by-copy2imagetobuffer4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2jpu['X'] = 160 # WIDTH IN PIXELS TO WRITE
region2jpu['Y'] = 90 # HEIGHT IN PIXELS TO WRITE
region2jpu['Z'] = 0 # DEPTH IN PIXELS TO WRITE
message2print = "{(Step 36B/70) set" + "; region2jpu-set-by-copy2imagetobuffer4jpu to: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; region2jpu-failed-by-copy2imagetobuffer4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '36Z-'
task4copyimagetobuffer2jpu ['REGION'] = region2jpu
if 'OFFSET' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (37) OFFSET - WHERE TO BEGIN COPYING DATA INTO DESTINATION BUFFER - REQUIRED
# ---------------------------------------------------------------------------------------------
offset2jpu = 0
message2print = "{(Step 37A/70) set" + "; offset2jpu-set-by-copy2imagetobuffer4jpu to: " + str(offset2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
task4copyimagetobuffer2jpu ['OFFSET'] = offset2jpu
code2ack = code2ack + '37A-'
# ---------------------------------------------------------------------------------------------
# EOF TASK
# ---------------------------------------------------------------------------------------------
keys2task = task4copyimagetobuffer2jpu.keys()
message2print = "{(Step 39/70) set" + "; keys2task-set-by-copy2imagetobuffer4jpu 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
# ---------------------------------------------------------------------------------------------
control2copyimagetobuffer4jpu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2jpu = False
channels2jpu = ()
message2print = "{(Step 40A/70) trying" + "channels2jpu-trying-by-copy2imagetobuffer4jpu: " + str(channels2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
#
consumerchannel2copyimagetobuffer4jpu, publisherchannel2copyimagetobuffer4jpu = task4copyimagetobuffer2jpu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2copyimagetobuffer4jpu-got-by-copy2imagetobuffer4jpu: " + str(consumerchannel2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2copyimagetobuffer4jpu-got-by-copy2imagetobuffer4jpu: " + str(publisherchannel2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2jpu = True
control2copyimagetobuffer4jpu['CONSUMERCHANNEL'] = consumerchannel2copyimagetobuffer4jpu
control2copyimagetobuffer4jpu['PUBLISHERCHANNEL'] = publisherchannel2copyimagetobuffer4jpu
code2ack = code2ack + '40D-'
except:
ack4channels2jpu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2copyimagetobuffer4jpu = False
queue2copyimagetobuffer4jpu = None
message2print = "{(Step 41A/70) trying" + "queue2copyimagetobuffer4jpu-trying-by-copy2imagetobuffer4jpu: " + str(queue2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copyimagetobuffer4jpu = task4copyimagetobuffer2jpu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2copyimagetobuffer4jpu-got-by-copy2imagetobuffer4jpu: " + str(queue2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2copyimagetobuffer4jpu = True
control2copyimagetobuffer4jpu['QUEUE'] = queue2copyimagetobuffer4jpu
code2ack = code2ack + '41C-'
except:
ack4queue2copyimagetobuffer4jpu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4jpu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4jpu-trying-by-copy2imagetobuffer4jpu: " + str(dummy2image4jpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4jpu = DummyProcess4Xi(target=manoeuvre2copyimagetobuffer4jpu, # in this module to handle queue and pipe channels
# args =(queue2copyimagetobuffer4jpu, # caller puts and gets - does NOT call any functions
# consumerchannel2copyimagetobuffer4jpu, publisherchannel2copyimagetobuffer4jpu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4jpu-created-by-copy2imagetobuffer4jpu: " + str(dummy2image4jpu) + "; 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-copy2imagetobuffer4jpu: " + 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-copy2imagetobuffer4jpu: " + str(code2nack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70C/70) returning" + "; control2copyimagetobuffer4jpu-returning-by-copy2imagetobuffer4jpu: " + str(control2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return control2copyimagetobuffer4jpu
#
# -------------------------------------------------------------------------------------------------
#copy2copybuffertoimage4jpu"
# channel2copybuffertoimagepublish4jpu = response4copy2buffertoimage['PUBLISHERCHANNEL']
# channel2copybuffertoimagepublish4jpu.send(message2copybuffertoimagesend4jpu)
# print("(Step 81B/700) OF JPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4JPU: ", channel2copybuffertoimagepublish4jpu, " MESSAGE2SEND4JPU: " , message2copybuffertoimagesend4jpu)
# except:
# print('(Step 81Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4JPU ', time4xi())
# # ------------------------------------------------------------------------------------------
# # (82) LET MANOEUVRE2COPYIMAGETOBUFFER4JPU TO RECEIVE COPY AND AND SEND ROGER VIA PIPE
# # ------------------------------------------------------------------------------------------
# print("(Step 82C/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4jpu = manoeuvre2copybuffertoimage4jpu(queue2copybuffertoimage4jpu, channel2copybuffertoimageconsume4jpu, channel2copybuffertoimagepublish4jpu)
# print("(Step 82D/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", manoeuvre2copybuffertoimage4jpu)
# except:
# print("(Step 82Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", time4xi())
# else:
# pass # trust activated thread
# # ---------------------------------------------------------------------------------------------
# # (83) RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------
# print('(Step 83A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4JPU ', time4xi())
# try:
# channel2copybuffertoimageconsume4jpu = response4copy2buffertoimage['CONSUMERCHANNEL']
# message2copyimagereceive4jpu = channel2copybuffertoimageconsume4jpu.recv()
# print("(Step 83B/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel2copybuffertoimageconsume4jpu, " CONTROL & COMMAND: ", message2copyimagereceive4jpu)
# #
# except:
# print('(Step 83Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4JPU ', time4xi())
# # ---------------------------------------------------------------------------------------------------
# # (84) SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2COPYIMAGETOBUFFER4JPU TO RECEIVE
# # ---------------------------------------------------------------------------------------------------
# print('(Step 84A/700) OF JPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4JPU ', time4xi())
# try:
# message2copybuffertoimagesend4jpu = "copy2copybuffertoimage4jpu"
# channel2copybuffertoimagepublish4jpu = response4copy2buffertoimage['PUBLISHERCHANNEL']
# channel2copybuffertoimagepublish4jpu.send(message2copybuffertoimagesend4jpu)
# print("(Step 84B/700) OF JPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4JPU: ", channel2copybuffertoimagepublish4jpu, " MESSAGE2SEND4JPU: " , message2copybuffertoimagesend4jpu)
# #
# except:
# print('(Step 84Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4JPU ', time4xi())
# # -----------------------------------------------------------------------------------
# # (85) LET MANOEUVRE2COPYIMAGETOBUFFER4JPU TO RECEIVE READY AND TO SEND READY
# # -----------------------------------------------------------------------------------
# print("(Step 85A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4jpu = manoeuvre2copybuffertoimage4jpu(queue2copybuffertoimage4jpu, channel2copybuffertoimageconsume4jpu, channel2copybuffertoimagepublish4jpu)
# print("(Step 85B/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", manoeuvre2copybuffertoimage4jpu)
# except:
# print("(Step 85Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", time4xi())
# # ---------------------------------------------------------------------------------------
# # (86) RECEIVE CONTROL & COMMAND READY VIA PIPE
# # ---------------------------------------------------------------------------------------
# print('(Step 86A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4JPU ', time4xi())
# try:
# channel2copybuffertoimageconsume4jpu = response4copy2buffertoimage['CONSUMERCHANNEL']
# message2copyimagereceive4jpu = channel2copybuffertoimageconsume4jpu.recv()
# print("(Step 86B/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel2copybuffertoimageconsume4jpu, " CONTROL & COMMAND: ", message2copyimagereceive4jpu)
# #
# except:
# print('(Step 86Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4JPU ', time4xi())
# # -----------------------------------------------------------------------------------------
# # (87) PUT IMAGE PATH TO QUEUE
# # -----------------------------------------------------------------------------------------
# print("(Step 87A/700) OF JPU2IMAGE4XI5TEST - 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 JPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
# # ------------------------------------------------------------------------------------------------------
# # (88) LET MANOEUVRE2COPYIMAGETOBUFFER4JPU TO GET FROM QUEUE AND TO SEND EITHER ACK OR NACK VIA PIPE
# # -------------------------------------------------------------------------------------------------------
# print("(Step 88A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4jpu = manoeuvre2copybuffertoimage4jpu(queue2copybuffertoimage4jpu, channel2copybuffertoimageconsume4jpu, channel2copybuffertoimagepublish4jpu)
# print("(Step 88B/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", manoeuvre2copybuffertoimage4jpu)
# except:
# print("(Step 88Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (89) RECEIVE ACK OR NACK ABOUT IMAGE OPERATION VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 89A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2copyimagereceive4jpu = channel2copybuffertoimageconsume4jpu.recv()
# print("(Step 89D/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel2copybuffertoimageconsume4jpu, " CONTROL & COMMAND: ", message2copyimagereceive4jpu)
# except:
# print('(Step 89Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# # -------------------------------------------------------------------------------------------------------
# # (90) LET MANOEUVRE2COPYIMAGETOBUFFER4JPU GO TO STATE 0
# # -------------------------------------------------------------------------------------------------------
# print("(Step 90A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4jpu = manoeuvre2copybuffertoimage4jpu(queue2copybuffertoimage4jpu, channel2copybuffertoimageconsume4jpu, channel2copybuffertoimagepublish4jpu)
# print("(Step 90B/700) OF JPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4JPU ", response2manoeuvreimagecopytobuffer4jpu)
# except:
# print("(Step 90Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4JPU ", time4xi())
#">
# -------------------------------------------------------------------------------------------------
def copy2buffertoimage4jpu(task4copybuffertoimage2jpu=None):
'''
copies buffer to image for JPU
'''
global jpu2image4xi # 2D-IMAGES FOR JPU
global jpu2buffer4xi # BUFFER FOR JPU
global control2copybuffertoimage4jpu # COMMAND AND CONTROL FOR JPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "copy2buffertoimage4jpu"
method2print = "copy2buffertoimage4jpu"
message2print = "{(Step 1A/33) started" + "; copy2buffertoimage4jpu-started: " + str(copy2buffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1B/33) passed" + "; task4copybuffertoimage2jpu-to-copy2buffertoimage4jpu: " + str(task4copybuffertoimage2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE JPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if jpu2image4xi is None:
jpu2image4xi = create2image4jpu() # INITIALIZE IMAGE FOR JPU
message2print = "{(Step 1C/70) created" + "; jpu2image4xi-created-by-copy2buffertoimage4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4jpu-skipped-by-copy2buffertoimage4jpu: " + str(copy2buffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# skipped
except:
try:
jpu2image4xi = create2image4jpu()
message2print = "{(Step 1E/70) set" + "; jpu2image4xi-set-by-copy2buffertoimage4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
jpu2image4xi = {}
message2print = "{(Step 1Z1/70) yielded" + "; jpu2image4xi-yielded-by-copy2buffertoimage4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z1-'
# -----------------------------------------------------------------------------------------
# CREATE JPU2BUFFER4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if jpu2buffer4xi is None:
jpu2buffer4xi = create2buffer4jpu() # INITIALIZE BUFFER FOR JPU
message2print = "{(Step 1F/70) created" + "; jpu2buffer4xi-created-by-copy2buffertoimage4jpu to: " + str(jpu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1G/70) skipped" + "; create2buffer4jpu-skipped-by-copy2buffertoimage4jpu: " + str(copy2buffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# skipped
except:
try:
jpu2buffer4xi = create2buffer4jpu()
message2print = "{(Step 1H/70) set" + "; jpu2buffer4xi-set-by-copy2buffertoimage4jpu to: " + str(jpu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
jpu2buffer4xi = {}
message2print = "{(Step 1Z2/70) yielded" + "; jpu2buffer4xi-yielded-by-copy2buffertoimage4jpu: " + str(jpu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z2-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - ANALYZE TASKS
# -----------------------------------------------------------------------------------------
if task4copybuffertoimage2jpu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR COPY - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4copybuffertoimage2jpu = {}
message2print = "{(Step 1A/70) initialized" + "; task4copybuffertoimage2jpu-created-by-copy2buffertoimage4jpu to: " + str(task4copybuffertoimage2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4jpu = trace2image4jpu # CALLBACK FUNCTION FOR JPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4jpu-created-by-copy2buffertoimage4jpu to: " + str(function2callback4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2buffertoimage4jpu" # MODULE OF JPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2buffertoimage4jpu" # FUNCTION OF JPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2buffertoimage4jpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR JPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-copy2buffertoimage4jpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; copy2buffertoimage4jpu-failed ; time: 04:41:15 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2buffertoimage4jpu',
# 'METHOD': 'copy2buffertoimage4jpu'}; time: 04:41:15 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4copybuffertoimage2jpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO JPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4copybuffertoimage2jpu['FUNCTION2CALLBACK'] = function2callback4jpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4copybuffertoimage2jpu-created-by-copy2buffertoimage4jpu to: " + str(task4copybuffertoimage2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; copy2buffertoimage4jpu-failed ; time: 04:41:15 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2buffertoimage4jpu',
# 'METHOD': 'copy2buffertoimage4jpu'}}; time: 04:41:15 10/04/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-copy2buffertoimage4jpu 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-copy2buffertoimage4jpu: " + 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-copy2buffertoimage4jpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4copybuffertoimage2jpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2jpu = {}
message2print = "{(Step 3A/70) trying" + "; context2jpu-trying-by-copy2buffertoimage4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2jpu = get2context4jpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2jpu-got-by-copy2buffertoimage4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2jpu-failed-by-copy2buffertoimage4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4copybuffertoimage2jpu ['CONTEXT'] = context2jpu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2jpu = {}
message2print = "{(Step 4A/70) trying" + "; device2jpu-trying-by-copy2buffertoimage4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2jpu = get2jpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2jpu-got-by-copy2buffertoimage4jpu: " + str(device2jpu) + "; 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" + "; device2jpu-failed-by-copy2buffertoimage4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4copybuffertoimage2jpu ['DEVICE'] = device2jpu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE DESTINATION OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
imagedestinationinfo2jpu = {}
message2print = "{(Step 5A/70) trying" + "; imagedestinationinfo2jpu-trying-by-copy2buffertoimage4jpu: " + str(imagedestinationinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imagedestinationinfo2jpu = get2imageinfo4jpu()
message2print = "{(Step 5B/70) got" + "; imagedestinationinfo2jpu-got-by-copy2buffertoimage4jpu: " + str(imagedestinationinfo2jpu) + "; 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; create2context4jpu-failed ; time: 04:41:15 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4jpu',
# 'METHOD': 'create2context4jpu'},
# '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" + "; imagedestinationinfo2jpu-failed-by-copy2buffertoimage4jpu: " + str(imagedestinationinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4copybuffertoimage2jpu ['IMAGEDESTINATION'] = imagedestinationinfo2jpu
# ---------------------------------------------------------------------------------------------
# (6) BUFFER SOURCE OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
buffersourceinfo2jpu = {}
message2print = "{(Step 6A/70) trying" + "; buffersourceinfo2jpu-trying-by-copy2buffertoimage4jpu: " + str(buffersourceinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
buffersourceinfo2jpu = get2bufferinfo4jpu()
message2print = "{(Step 6B/70) got" + "; buffersourceinfo2jpu-got-by-copy2buffertoimage4jpu: " + str(buffersourceinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4jpu-failed ; time: 04:41:15 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4jpu',
# 'METHOD': 'create2buffer4jpu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': ...
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; buffersourceinfo2jpu-failed-by-copy2buffertoimage4jpu: " + str(buffersourceinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4copybuffertoimage2jpu ['BUFFERSOURCE'] = buffersourceinfo2jpu
# ---------------------------------------------------------------------------------------------
# (7) QUEUE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
queue2copybuffertoimage4jpu = None
message2print = "{(Step 7A/70) trying" + "; queue2copybuffertoimage4jpu-trying-by-copy2buffertoimage4jpu: " + str(queue2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copybuffertoimage4jpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 7B/70) got" + "; queue2copybuffertoimage4jpu-got-by-copy2buffertoimage4jpu: " + str(queue2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; queue2copybuffertoimage4jpu-failed-by-copy2buffertoimage4jpu: " + str(queue2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4copybuffertoimage2jpu ['QUEUE'] = queue2copybuffertoimage4jpu
# ---------------------------------------------------------------------------------------------
# (8) PIPE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
pipe2jpu = None
message2print = "{(Step 8A/70) trying" + "; pipe2jpu-trying-by-copy2buffertoimage4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2jpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 8B/70) got" + "; pipe2jpu-got-by-copy2buffertoimage4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; pipe2jpu-failed-by-copy2buffertoimage4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4copybuffertoimage2jpu ['PIPE'] = pipe2jpu
# ---------------------------------------------------------------------------------------------
# (9) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2jpu = {}
message2print = "{(Step 9A/70) trying" + "; commandqueueinfo2jpu-trying-by-copy2buffertoimage4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2jpu = get2commandqueueinfo4jpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; commandqueueinfo2jpu-got-by-copy2buffertoimage4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': ...
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; commandqueueinfo2jpu-failed-by-copy2buffertoimage4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4copybuffertoimage2jpu ['COMMANDQUEUE'] = commandqueueinfo2jpu
# ---------------------------------------------------------------------------------------------
# (11) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2jpu = {}
message2print = "{(Step 11A/70) trying" + "; eventinfo2jpu-trying-by-copy2buffertoimage4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2jpu = get2eventinfo4jpu()
message2print = "{(Step 11B/70) got" + "; eventinfo2jpu-got-by-copy2buffertoimage4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'DATA2CALLBACK': ...
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; eventinfo2jpu-failed-by-copy2buffertoimage4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4copybuffertoimage2jpu ['EVENT'] = eventinfo2jpu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2jpu = {}
message2print = "{(Step 12A/70) trying" + "; eventwaitlist2jpu-trying-by-copy2buffertoimage4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2jpu = {}
message2print = "{(Step 12B/70) set" + "; eventwaitlist2jpu-set-by-copy2buffertoimage4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlist2jpu-failed-by-copy2buffertoimage4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4copybuffertoimage2jpu ['EVENTWAITLIST'] = eventwaitlist2jpu
# ---------------------------------------------------------------------------------------------
# (13) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2jpu = 0
message2print = "{(Step 13A/70) trying" + "; eventwaitlistquantity2jpu-trying-by-copy2buffertoimage4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2jpu.keys()
for key2event in keys2event:
eventwaitlistquantity2jpu = eventwaitlistquantity2jpu + 1
message2print = "{(Step 13B/70) set" + "; eventwaitlistquantity2jpu-set-by-copy2buffertoimage4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; eventwaitlistquantity2jpu-failed-by-copy2buffertoimage4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4copybuffertoimage2jpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2jpu
# ---------------------------------------------------------------------------------------------
# (15) ORIGIN FOR DESTINATION - REQUIRED
# ---------------------------------------------------------------------------------------------
origin4destination2jpu = {}
message2print = "{(Step 15A/70) trying" + "; origin4destination2jpu-trying-by-copy2buffertoimage4jpu: " + str(origin4destination2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin4destination2jpu['X'] = 100
origin4destination2jpu['Y'] = 100
origin4destination2jpu['Z'] = 100
message2print = "{(Step 15B/70) set" + "; origin4destination2jpu-set-by-copy2buffertoimage4jpu to: " + str(origin4destination2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 100, 'X': 100, 'Z': 100}
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; origin4destination2jpu-failed-by-copy2buffertoimage4jpu: " + str(origin4destination2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '15Z-'
task4copybuffertoimage2jpu ['DESTINATIONORIGIN'] = origin4destination2jpu
# --------------------------------------------------------------------------------------------------------
# (16) REGION - REGION OF A IMAGE TO BE COPIED
# --------------------------------------------------------------------------------------------------------
region4copy2jpu = {}
message2print = "{(Step 16A/70) trying" + "; region4copy2jpu-trying-by-copy2buffertoimage4jpu: " + str(region4copy2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region4copy2jpu['X'] = 10
region4copy2jpu['Y'] = 10
region4copy2jpu['Z'] = 10
message2print = "{(Step 16B/70) set" + "; region4copy2jpu-set-by-copy2buffertoimage4jpu to: " + str(region4copy2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 10, 'X': 10, 'Z': 10}
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; region4copy2jpu-failed-by-copy2buffertoimage4jpu: " + str(region4copy2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '16Z-'
task4copybuffertoimage2jpu ['REGION'] = region4copy2jpu
# --------------------------------------------------------------------------------------------------------
# (17) OFFSET - WHERE TO BEGIN COPYING DATA FROM SOURCE BUFFER
# --------------------------------------------------------------------------------------------------------
offset4copy2jpu = 0
message2print = "{(Step 17A/70) set" + "; offset4copy2jpu-set-by-copy2buffertoimage4jpu to: " + str(offset4copy2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
task4copybuffertoimage2jpu ['OFFSET'] = offset4copy2jpu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------
# ANALYZE TASKS - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4copybuffertoimage2jpu.keys()
message2print = "{(Step 20/70) got" + "; keys2task-got-by-copy2buffertoimage4jpu: " + 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
# ---------------------------------------------------------------------------------------------
function2callback4jpu = trace2image4jpu # CALLBACK FUNCTION FOR JPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4jpu-created-by-copy2buffertoimage4jpu to: " + str(function2callback4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2buffertoimage4jpu" # MODULE OF JPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2buffertoimage4jpu" # FUNCTION OF JPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2buffertoimage4jpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR JPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-copy2buffertoimage4jpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4copybuffertoimage2jpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO JPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4copybuffertoimage2jpu['FUNCTION2CALLBACK'] = function2callback4jpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4copybuffertoimage2jpu-created-by-copy2buffertoimage4jpu to: " + str(task4copybuffertoimage2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-copy2buffertoimage4jpu 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-copy2buffertoimage4jpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-copy2buffertoimage4jpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4copybuffertoimage2jpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2jpu = {}
message2print = "{(Step 23A/70) trying" + "; context2jpu-trying-by-copy2buffertoimage4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2jpu = get2context4jpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2jpu-got-by-copy2buffertoimage4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2jpu-failed-by-copy2buffertoimage4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4copybuffertoimage2jpu ['CONTEXT'] = context2jpu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2jpu = {}
message2print = "{(Step 24A/70) trying" + "; device2jpu-trying-by-copy2buffertoimage4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2jpu = get2jpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2jpu-got-by-copy2buffertoimage4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2jpu-failed-by-copy2buffertoimage4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4copybuffertoimage2jpu ['DEVICE'] = device2jpu
if 'IMAGEDESTINATION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) DESTINATION IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
destinationimageinfo2jpu = {}
message2print = "{(Step 25A/70) trying" + "; destinationimageinfo2jpu-trying-by-copy2buffertoimage4jpu: " + str(destinationimageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
destinationimageinfo2jpu = get2imageinfo4jpu()
message2print = "{(Step 25B/70) got" + "; destinationimageinfo2jpu-got-by-copy2buffertoimage4jpu: " + str(destinationimageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; destinationimageinfo2jpu-failed-by-copy2buffertoimage4jpu: " + str(destinationimageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4copybuffertoimage2jpu ['IMAGEDESTINATION'] = destinationimageinfo2jpu
if 'BUFFERSOURCE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) SOURCE BUFFER - REQUIRED
# ---------------------------------------------------------------------------------------------
sourcebufferinfo2jpu = {}
message2print = "{(Step 26A/70) trying" + "; sourcebufferinfo2jpu-trying-by-copy2buffertoimage4jpu: " + str(sourcebufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
sourcebufferinfo2jpu = get2bufferinfo4jpu()
message2print = "{(Step 26B/70) got" + "; sourcebufferinfo2jpu-got-by-copy2buffertoimage4jpu: " + str(sourcebufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; sourcebufferinfo2jpu-failed-by-copy2buffertoimage4jpu: " + str(sourcebufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4copybuffertoimage2jpu ['BUFFERSOURCE'] = sourcebufferinfo2jpu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) QUEUE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
queue2copybuffertoimage4jpu = None
message2print = "{(Step 27A/70) trying" + "; queue2copybuffertoimage4jpu-trying-by-copy2buffertoimage4jpu: " + str(queue2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copybuffertoimage4jpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 27B/70) got" + "; queue2copybuffertoimage4jpu-got-by-copy2buffertoimage4jpu: " + str(queue2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; queue2copybuffertoimage4jpu-failed-by-copy2buffertoimage4jpu: " + str(queue2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4copybuffertoimage2jpu ['QUEUE'] = queue2copybuffertoimage4jpu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) PIPE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
pipe2jpu = None
message2print = "{(Step 28A/70) trying" + "; pipe2jpu-trying-by-copy2buffertoimage4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2jpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 28B/70) got" + "; pipe2jpu-got-by-copy2buffertoimage4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; pipe2jpu-failed-by-copy2buffertoimage4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4copybuffertoimage2jpu ['PIPE'] = pipe2jpu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2jpu = {}
message2print = "{(Step 29A/70) trying" + "; commandqueueinfo2jpu-trying-by-copy2buffertoimage4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2jpu = get2commandqueueinfo4jpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; commandqueueinfo2jpu-got-by-copy2buffertoimage4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; commandqueueinfo2jpu-failed-by-copy2buffertoimage4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4copybuffertoimage2jpu ['COMMANDQUEUE'] = commandqueueinfo2jpu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2jpu = {}
message2print = "{(Step 31A/70) trying" + "; eventinfo2jpu-trying-by-copy2buffertoimage4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2jpu = get2eventinfo4jpu()
message2print = "{(Step 31B/70) got" + "; eventinfo2jpu-got-by-copy2buffertoimage4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventinfo2jpu-failed-by-copy2buffertoimage4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4copybuffertoimage2jpu ['EVENT'] = eventinfo2jpu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2jpu = {}
message2print = "{(Step 32A/70) trying" + "; eventwaitlist2jpu-trying-by-copy2buffertoimage4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2jpu = {}
message2print = "{(Step 32B/70) set" + "; eventwaitlist2jpu-set-by-copy2buffertoimage4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlist2jpu-failed-by-copy2buffertoimage4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4copybuffertoimage2jpu ['EVENTWAITLIST'] = eventwaitlist2jpu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2jpu = 0
message2print = "{(Step 33A/70) trying" + "; eventwaitlistquantity2jpu-trying-by-copy2buffertoimage4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2jpu.keys()
for key2event in keys2event:
eventwaitlistquantity2jpu = eventwaitlistquantity2jpu + 1
message2print = "{(Step 33B/70) set" + "; eventwaitlistquantity2jpu-set-by-copy2buffertoimage4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; eventwaitlistquantity2jpu-failed-by-copy2buffertoimage4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4copybuffertoimage2jpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2jpu
if 'DESTINATIONORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) DESTINATIONORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
destination4origin2jpu = {}
message2print = "{(Step 34A/70) trying" + "; destination4origin2jpu-trying-by-copy2buffertoimage4jpu: " + str(destination4origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
destination4origin2jpu['X'] = 0
destination4origin2jpu['Y'] = 0
destination4origin2jpu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; destination4origin2jpu-set-by-copy2buffertoimage4jpu to: " + str(destination4origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; destination4origin2jpu-failed-by-copy2buffertoimage4jpu: " + str(destination4origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4copybuffertoimage2jpu ['DESTINATIONORIGIN'] = destination4origin2jpu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (36) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2jpu = {}
message2print = "{(Step 36A/70) trying" + "; region2jpu-trying-by-copy2buffertoimage4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2jpu['X'] = 160 # WIDTH IN PIXELS TO WRITE
region2jpu['Y'] = 90 # HEIGHT IN PIXELS TO WRITE
region2jpu['Z'] = 0 # DEPTH IN PIXELS TO WRITE
message2print = "{(Step 36B/70) set" + "; region2jpu-set-by-copy2buffertoimage4jpu to: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; region2jpu-failed-by-copy2buffertoimage4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '36Z-'
task4copybuffertoimage2jpu ['REGION'] = region2jpu
if 'OFFSET' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (37) OFFSET - WHERE TO BEGIN COPYING DATA FROM SOURCE BUFFER - REQUIRED
# ---------------------------------------------------------------------------------------------
offset2jpu = 0
message2print = "{(Step 37A/70) set" + "; offset2jpu-set-by-copy2buffertoimage4jpu to: " + str(offset2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
task4copybuffertoimage2jpu ['OFFSET'] = offset2jpu
code2ack = code2ack + '37A-'
# ---------------------------------------------------------------------------------------------
# EOF TASK ANALYSIS
# ---------------------------------------------------------------------------------------------
keys2task = task4copybuffertoimage2jpu.keys()
message2print = "{(Step 39/70) set" + "; keys2task-set-by-copy2buffertoimage4jpu 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
# ---------------------------------------------------------------------------------------------
control2copybuffertoimage4jpu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2jpu = False
channels2jpu = ()
message2print = "{(Step 40A/70) trying" + "channels2jpu-trying-by-copy2buffertoimage4jpu: " + str(channels2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
#
consumerchannel2copybuffertoimage4jpu, publisherchannel2copybuffertoimage4jpu = task4copybuffertoimage2jpu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2copybuffertoimage4jpu-got-by-copy2buffertoimage4jpu: " + str(consumerchannel2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2copybuffertoimage4jpu-got-by-copy2buffertoimage4jpu: " + str(publisherchannel2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2jpu = True
control2copybuffertoimage4jpu['CONSUMERCHANNEL'] = consumerchannel2copybuffertoimage4jpu
control2copybuffertoimage4jpu['PUBLISHERCHANNEL'] = publisherchannel2copybuffertoimage4jpu
code2ack = code2ack + '40D-'
except:
ack4channels2jpu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2copybuffertoimage4jpu = False
queue2copybuffertoimage4jpu = None
message2print = "{(Step 41A/70) trying" + "queue2copybuffertoimage4jpu-trying-by-copy2buffertoimage4jpu: " + str(queue2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copybuffertoimage4jpu = task4copybuffertoimage2jpu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2copybuffertoimage4jpu-got-by-copy2buffertoimage4jpu: " + str(queue2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2copybuffertoimage4jpu = True
control2copybuffertoimage4jpu['QUEUE'] = queue2copybuffertoimage4jpu
code2ack = code2ack + '41C-'
except:
ack4queue2copybuffertoimage4jpu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4jpu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4jpu-trying-by-copy2buffertoimage4jpu: " + str(dummy2image4jpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4jpu = DummyProcess4Xi(target=manoeuvre2copybuffertoimage4jpu, # in this module to handle queue and pipe channels
# args =(queue2copybuffertoimage4jpu, # caller puts and gets - does NOT call any functions
# consumerchannel2copybuffertoimage4jpu, publisherchannel2copybuffertoimage4jpu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4jpu-created-by-copy2buffertoimage4jpu: " + str(dummy2image4jpu) + "; 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-copy2buffertoimage4jpu: " + 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-copy2buffertoimage4jpu: " + str(code2nack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70C/70) returning" + "; control2copybuffertoimage4jpu-returning-by-copy2buffertoimage4jpu: " + str(control2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 04:52:11 10/04/11 Pacific Daylight Time}
return control2copybuffertoimage4jpu
#
# -------------------------------------------------------------------------------------------------
#copy2read4jpu"
# channel2readpublish4jpu = response4read2image['PUBLISHERCHANNEL']
# channel2readpublish4jpu.send(message2readsend4jpu)
# print("(Step 17B/700) OF JPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4JPU: ", channel2readpublish4jpu, " MESSAGE2SEND4JPU: " , message2readsend4jpu)
# except:
# print('(Step 17Z1/700) OF JPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4JPU ', time4xi())
# # ------------------------------------------------------------------------------------------
# # (18) LET MANOEUVRE2IMAGE4JPU TO RECEIVE COPY AND AND SEND ROGER VIA PIPE
# # ------------------------------------------------------------------------------------------
# print("(Step 18C/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# try:
# response2manoeuvre4jpu = manoeuvre2readimage4jpu(queue2read4jpu, channel2readconsume4jpu, channel2readpublish4jpu)
# print("(Step 18D/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", manoeuvre2readimage4jpu)
# except:
# print("(Step 18Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# else:
# pass # trust activated thread
# # ---------------------------------------------------------------------------------------------
# # (19) RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------
# print('(Step 19A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4JPU ', time4xi())
# try:
# channel2readconsume4jpu = response4read2image['CONSUMERCHANNEL']
# message2readreceive4jpu = channel2readconsume4jpu.recv()
# print("(Step 19B/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel2readconsume4jpu, " CONTROL & COMMAND: ", message2readreceive4jpu)
# # roger2read4jpu
# except:
# print('(Step 19Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4JPU ', time4xi())
# # ---------------------------------------------------------------------------------------------------
# # (20) SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2IMAGE4JPU TO RECEIVE
# # ---------------------------------------------------------------------------------------------------
# print('(Step 20A/700) OF JPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4JPU ', time4xi())
# try:
# message2readsend4jpu = "ready2read4jpu"
# channel2readpublish4jpu = response4read2image['PUBLISHERCHANNEL']
# channel2readpublish4jpu.send(message2readsend4jpu)
# print("(Step 20B/700) OF JPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4JPU: ", channel2readpublish4jpu, " MESSAGE2SEND4JPU: " , message2readsend4jpu)
# # ready2read4jpu
# except:
# print('(Step 20Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4JPU ', time4xi())
# # -----------------------------------------------------------------------------------
# # (21) LET MANOEUVRE2IMAGE4JPU TO RECEIVE READY AND TO SEND READY
# # -----------------------------------------------------------------------------------
# print("(Step 21A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# try:
# response2manoeuvre4jpu = manoeuvre2readimage4jpu(queue2read4jpu, channel2readconsume4jpu, channel2readpublish4jpu)
# print("(Step 21B/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", manoeuvre2readimage4jpu)
# except:
# print("(Step 21Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# # ---------------------------------------------------------------------------------------
# # (22) RECEIVE CONTROL & COMMAND READY VIA PIPE
# # ---------------------------------------------------------------------------------------
# print('(Step 22A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4JPU ', time4xi())
# try:
# channel2readconsume4jpu = response4read2image['CONSUMERCHANNEL']
# message2readreceive4jpu = channel2readconsume4jpu.recv()
# print("(Step 22B/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel2readconsume4jpu, " CONTROL & COMMAND: ", message2readreceive4jpu)
# # ready2read4jpu
# except:
# print('(Step 22Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4JPU ', time4xi())
# # -----------------------------------------------------------------------------------------
# # (24) PUT IMAGE PATH TO QUEUE
# # -----------------------------------------------------------------------------------------
# print("(Step 24A/700) OF JPU2IMAGE4XI5TEST - 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 JPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
# # ------------------------------------------------------------------------------------------------------
# # (25) LET MANOEUVRE2IMAGE4JPU TO GET FROM QUEUE AND TO SEND EITHER ACK OR NACK VIA PIPE
# # -------------------------------------------------------------------------------------------------------
# print("(Step 25A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# try:
# response2manoeuvre4jpu = manoeuvre2readimage4jpu(queue2read4jpu, channel2readconsume4jpu, channel2readpublish4jpu)
# print("(Step 25B/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", manoeuvre2readimage4jpu)
# except:
# print("(Step 25Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (26) RECEIVE ACK OR NACK ABOUT IMAGE OPERATION VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 26A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2readreceive4jpu = channel2readconsume4jpu.recv()
# print("(Step 26D/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel2readconsume4jpu, " CONTROL & COMMAND: ", message2readreceive4jpu)
# # ack2imageinfo4jpu
# except:
# print('(Step 26Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# # -------------------------------------------------------------------------------------------------------
# # (27) LET MANOEUVRE2IMAGE4JPU GO TO STATE 0
# # -------------------------------------------------------------------------------------------------------
# print("(Step 27A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# try:
# response2manoeuvre4jpu = manoeuvre2readimage4jpu(queue2read4jpu, channel2readconsume4jpu, channel2readpublish4jpu)
# print("(Step 27B/700) OF JPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4JPU ", response2manoeuvre4jpu)
# except:
# print("(Step 27Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
#">
# -------------------------------------------------------------------------------------------------
def read2image4jpu(task4imageread2jpu=None):
'''
reads 2D images for JPU
'''
global jpu2image4xi # 2D-IMAGES FOR JPU
global control2readimage4jpu # COMMAND AND CONTROL FOR JPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "read2image4jpu"
method2print = "read2image4jpu"
message2print = "{(Step 1A/33) started" + "; read2image4jpu-started: " + str(read2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4imageread2jpu-to-read2image4jpu: " + str(task4imageread2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE JPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if jpu2image4xi is None:
jpu2image4xi = create2image4jpu() # INITIALIZE IMAGE FOR JPU
message2print = "{(Step 1C/70) created" + "; jpu2image4xi-created-by-read2image4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4jpu-skipped-by-read2image4jpu: " + str(read2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# skipped
except:
try:
jpu2image4xi = create2image4jpu()
message2print = "{(Step 1E/70) set" + "; jpu2image4xi-set-by-read2image4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
jpu2image4xi = {}
message2print = "{(Step 1Z/70) yielded" + "; jpu2image4xi-yielded-by-read2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - CHECK PARAMETERS
# -----------------------------------------------------------------------------------------
try:
if task4imageread2jpu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR READ - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4imageread2jpu = {}
message2print = "{(Step 1A/70) initialized" + "; task4imageread2jpu-created-by-read2image4jpu to: " + str(task4imageread2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4jpu = trace2image4jpu # CALLBACK FUNCTION FOR JPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4jpu-created-by-read2image4jpu to: " + str(function2callback4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ;
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "read2image4jpu" # MODULE OF JPUIZED OPENCL MODULE
args2callback['METHOD'] = "read2image4jpu" # FUNCTION OF JPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; read2image4jpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR JPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-read2image4jpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; read2image4jpu-failed ; time: 05:06:38 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'read2image4jpu',
# 'METHOD': 'read2image4jpu'}; time: 05:06:38 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imageread2jpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO JPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imageread2jpu['FUNCTION2CALLBACK'] = function2callback4jpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4imageread2jpu-created-by-read2image4jpu to: " + str(task4imageread2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; read2image4jpu-failed ; time: 05:06:38 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'read2image4jpu',
# 'METHOD': 'read2image4jpu'}}; time: 05:06:38 10/04/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-read2image4jpu 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-read2image4jpu: " + 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-read2image4jpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4imageread2jpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2jpu = {}
message2print = "{(Step 3A/70) trying" + "; context2jpu-trying-by-read2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2jpu = get2context4jpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2jpu-got-by-read2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2jpu-failed-by-read2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4imageread2jpu ['CONTEXT'] = context2jpu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2jpu = {}
message2print = "{(Step 4A/70) trying" + "; device2jpu-trying-by-read2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2jpu = get2jpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2jpu-got-by-read2image4jpu: " + str(device2jpu) + "; 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" + "; device2jpu-failed-by-read2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4imageread2jpu ['DEVICE'] = device2jpu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2jpu = {}
message2print = "{(Step 5A/70) trying" + "; imageinfo2jpu-trying-by-read2image4jpu: " + str(imageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2jpu = get2imageinfo4jpu()
message2print = "{(Step 5B/70) got" + "; imageinfo2jpu-got-by-read2image4jpu: " + str(imageinfo2jpu) + "; 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" + "; imageinfo2jpu-failed-by-read2image4jpu: " + str(imageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4imageread2jpu ['IMAGE'] = imageinfo2jpu
# ---------------------------------------------------------------------------------------------
# (6) QUEUE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
queue2jpu = None
message2print = "{(Step 6A/70) trying" + "; queue2jpu-trying-by-read2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2jpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 6B/70) got" + "; queue2jpu-got-by-read2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; queue2jpu-failed-by-read2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4imageread2jpu ['QUEUE'] = queue2jpu
# ---------------------------------------------------------------------------------------------
# (7) PIPE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
pipe2jpu = None
message2print = "{(Step 7A/70) trying" + "; pipe2jpu-trying-by-read2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2jpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 7B/70) got" + "; pipe2jpu-got-by-read2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; pipe2jpu-failed-by-read2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4imageread2jpu ['PIPE'] = pipe2jpu
# ---------------------------------------------------------------------------------------------
# (8) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2jpu = {}
message2print = "{(Step 8A/70) trying" + "; commandqueueinfo2jpu-trying-by-read2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2jpu = get2commandqueueinfo4jpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 8B/70) got" + "; commandqueueinfo2jpu-got-by-read2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; commandqueueinfo2jpu-failed-by-read2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4imageread2jpu ['COMMANDQUEUE'] = commandqueueinfo2jpu
# ---------------------------------------------------------------------------------------------
# (9) BUFFER - AUTOMATIC BY JPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2jpu = {}
message2print = "{(Step 9A/70) trying" + "; bufferinfo2jpu-trying-by-read2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2jpu = get2bufferinfo4jpu() # SYSTEM CREATES BUFFER FOR JPU, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; bufferinfo2jpu-got-by-read2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; bufferinfo2jpu-failed-by-read2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4imageread2jpu ['BUFFER'] = bufferinfo2jpu
# ---------------------------------------------------------------------------------------------
# (10) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2jpu = {}
message2print = "{(Step 10A/70) trying" + "; eventinfo2jpu-trying-by-read2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2jpu = get2eventinfo4jpu()
message2print = "{(Step 10B/70) got" + "; eventinfo2jpu-got-by-read2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '10B-'
except:
message2print = "{(Step 10Z/70) failed" + "; eventinfo2jpu-failed-by-read2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '10Z-'
task4imageread2jpu ['EVENT'] = eventinfo2jpu
# ---------------------------------------------------------------------------------------------
# (11) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2jpu = {}
message2print = "{(Step 11A/70) trying" + "; eventwaitlist2jpu-trying-by-read2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2jpu = {}
message2print = "{(Step 11B/70) set" + "; eventwaitlist2jpu-set-by-read2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; eventwaitlist2jpu-failed-by-read2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4imageread2jpu ['EVENTWAITLIST'] = eventwaitlist2jpu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2jpu = 0
message2print = "{(Step 12A/70) trying" + "; eventwaitlistquantity2jpu-trying-by-read2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2jpu.keys()
for key2event in keys2event:
eventwaitlistquantity2jpu = eventwaitlistquantity2jpu + 1
message2print = "{(Step 12B/70) set" + "; eventwaitlistquantity2jpu-set-by-read2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlistquantity2jpu-failed-by-read2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4imageread2jpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2jpu
# ---------------------------------------------------------------------------------------------
# (13) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2jpu = ' '
message2print = "{(Step 13A/70) trying" + "; blocking2jpu-trying-by-read2image4jpu: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2jpu = 'CL_FALSE' # the read command is non-blocking
message2print = "{(Step 13B/70) set" + "; blocking2jpu-set-by-read2image4jpu to: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# CL_FALSE
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; blocking2jpu-failed-by-read2image4jpu: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4imageread2jpu ['BLOCKING'] = blocking2jpu
# ---------------------------------------------------------------------------------------------
# (14) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2jpu = {}
message2print = "{(Step 14A/70) trying" + "; origin2jpu-trying-by-read2image4jpu: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2jpu['X'] = 0
origin2jpu['Y'] = 0
origin2jpu['Z'] = 0
message2print = "{(Step 14B/70) set" + "; origin2jpu-set-by-read2image4jpu to: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 0, 'X': 0, 'Z': 0}
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; origin2jpu-failed-by-read2image4jpu: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4imageread2jpu ['ORIGIN'] = origin2jpu
# ---------------------------------------------------------------------------------------------
# (15) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2jpu = {}
message2print = "{(Step 15A/70) trying" + "; region2jpu-trying-by-read2image4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2jpu['X'] = 160 # WIDTH IN PIXELS TO READ
region2jpu['Y'] = 90 # HEIGHT IN PIXELS TO READ
region2jpu['Z'] = 0 # DEPTH IN PIXELS TO READ
message2print = "{(Step 15B/70) set" + "; region2jpu-set-by-read2image4jpu to: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 90, 'X': 160, 'Z': 0}
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; region2jpu-failed-by-read2image4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '15Z-'
task4imageread2jpu ['REGION'] = region2jpu
# ---------------------------------------------------------------------------------------------
# (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.
rowpitch2jpu = 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
width2jpu = 800
message2print = "{(Step 16A/70) trying" + "; rowpitch2jpu-trying-by-read2image4jpu: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2jpu = int(width2jpu * 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" + "; rowpitch2jpu-set-by-read2image4jpu to: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 8000
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; rowpitch2jpu-failed-by-read2image4jpu: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '16Z-'
task4imageread2jpu ['ROWPITCH'] = rowpitch2jpu
# ----------------------------------------------------------------------------------------------------
# (17) POINTER - REQUIRED - THE POINTER TO A BUFFER IN HOST MEMORY WHERE IMAGE DATA IS TO BE READ FROM
# ----------------------------------------------------------------------------------------------------
pointer2jpu = None
height2jpu = 800
size2jpu = int(width2jpu * height2jpu) # CALCULATED MEMORY
if size2jpu == 0:
size2jpu = 4400 # MINIMUM MEMORY
message2print = "{(Step 17A/70) trying" + "; pointer2jpu-trying-by-read2image4jpu: " + str(pointer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
arena2jpu = Arena4Xi(size2jpu) # SYSTEM RESERVER MEMORY FOR IMAGE
message2print = "{(Step 17B/70) got" + "; arena2jpu-got-by-read2image4jpu: " + str(arena2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
size2arena = arena2jpu.size #
message2print = "{(Step 17C/70) got" + "; size2arena-got-by-read2buffer4jpu: " + str(size2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 640000
buffer2arena = arena2jpu.buffer
message2print = "{(Step 17D/70) got" + "; buffer2arena-got-by-read2buffer4jpu: " + str(buffer2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17D-'
if size2arena < size2jpu:
size2jpu = size2arena # AVAILABLE MEMORY FOR IMAGE
message2print = "{(Step 17E/70) set" + "; size2jpu-set-by-read2buffer4jpu to: " + str(size2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17E-'
else:
pass
pointer2jpu = buffer2arena
message2print = "{(Step 17F/70) set" + "; pointer2jpu-set-by-read2buffer4jpu to: " + str(pointer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17F-'
except:
message2print = "{(Step 17Z/70) failed" + "; pointer2jpu-failed-by-read2image4jpu: " + str(pointer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '17Z-'
task4imageread2jpu ['POINTER'] = pointer2jpu
task4imageread2jpu ['SIZE'] = size2jpu # AUTOMATIC BY JPUXI
# --------------------------------------------------------------------------------------------------------
# (18) SLICEPITCH - REQUIRED - THE SIZE IN BYTES OF THE 2D SLICE OF THE 3D REGION OF A 3D IMAGE BEING READ
# --------------------------------------------------------------------------------------------------------
slicepitch2jpu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 18A/70) trying" + "; slicepitch2jpu-trying-by-read2image4jpu: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2jpu = 0
message2print = "{(Step 18B/70) set" + "; slicepitch2jpu-set-by-read2image4jpu to: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '18B-'
except:
message2print = "{(Step 18Z/70) failed" + "; slicepitch2jpu-failed-by-read2image4jpu: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '18Z-'
task4imageread2jpu ['SLICEPITCH'] = slicepitch2jpu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
else:
pass
# ---------------------------------------------------------------------------------------------
# ANALYSE TASKS - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4imageread2jpu.keys()
message2print = "{(Step 20/70) got" + "; keys2task-got-by-read2image4jpu: " + 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
# ---------------------------------------------------------------------------------------------
function2callback4jpu = trace2image4jpu # CALLBACK FUNCTION FOR JPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4jpu-created-by-read2image4jpu to: " + str(function2callback4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "read2image4jpu" # MODULE OF JPUIZED OPENCL MODULE
args2callback['METHOD'] = "read2image4jpu" # FUNCTION OF JPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; read2image4jpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR JPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-read2image4jpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imageread2jpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO JPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imageread2jpu['FUNCTION2CALLBACK'] = function2callback4jpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4imageread2jpu-created-by-read2image4jpu to: " + str(task4imageread2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-read2image4jpu 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-read2image4jpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-read2image4jpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4imageread2jpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2jpu = {}
message2print = "{(Step 23A/70) trying" + "; context2jpu-trying-by-read2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2jpu = get2context4jpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2jpu-got-by-read2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2jpu-failed-by-read2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4imageread2jpu ['CONTEXT'] = context2jpu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2jpu = {}
message2print = "{(Step 24A/70) trying" + "; device2jpu-trying-by-read2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2jpu = get2jpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2jpu-got-by-read2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2jpu-failed-by-read2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4imageread2jpu ['DEVICE'] = device2jpu
if 'IMAGE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2jpu = {}
message2print = "{(Step 25A/70) trying" + "; imageinfo2jpu-trying-by-read2image4jpu: " + str(imageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2jpu = get2imageinfo4jpu()
message2print = "{(Step 25B/70) got" + "; imageinfo2jpu-got-by-read2image4jpu: " + str(imageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; imageinfo2jpu-failed-by-read2image4jpu: " + str(imageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4imageread2jpu ['IMAGE'] = imageinfo2jpu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) QUEUE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
queue2jpu = None
message2print = "{(Step 26A/70) trying" + "; queue2jpu-trying-by-read2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2jpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 26B/70) got" + "; queue2jpu-got-by-read2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; queue2jpu-failed-by-read2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4imageread2jpu ['QUEUE'] = queue2jpu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) PIPE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
pipe2jpu = None
message2print = "{(Step 27A/70) trying" + "; pipe2jpu-trying-by-read2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2jpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 27B/70) got" + "; pipe2jpu-got-by-read2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; pipe2jpu-failed-by-read2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4imageread2jpu ['PIPE'] = pipe2jpu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2jpu = {}
message2print = "{(Step 28A/70) trying" + "; commandqueueinfo2jpu-trying-by-read2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2jpu = get2commandqueueinfo4jpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 28B/70) got" + "; commandqueueinfo2jpu-got-by-read2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; commandqueueinfo2jpu-failed-by-read2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4imageread2jpu ['COMMANDQUEUE'] = commandqueueinfo2jpu
if 'BUFFER' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (29) BUFFER - AUTOMATIC BY JPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2jpu = {}
message2print = "{(Step 29A/70) trying" + "; bufferinfo2jpu-trying-by-read2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2jpu = get2bufferinfo4jpu() # SYSTEM CREATES BUFFER FOR JPU, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; bufferinfo2jpu-got-by-read2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; bufferinfo2jpu-failed-by-read2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4imageread2jpu ['BUFFER'] = bufferinfo2jpu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (30) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2jpu = {}
message2print = "{(Step 30A/70) trying" + "; eventinfo2jpu-trying-by-read2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2jpu = get2eventinfo4jpu()
message2print = "{(Step 30B/70) got" + "; eventinfo2jpu-got-by-read2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '30B-'
except:
message2print = "{(Step 30Z/70) failed" + "; eventinfo2jpu-failed-by-read2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '30Z-'
task4imageread2jpu ['EVENT'] = eventinfo2jpu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2jpu = {}
message2print = "{(Step 31A/70) trying" + "; eventwaitlist2jpu-trying-by-read2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2jpu = {}
message2print = "{(Step 31B/70) set" + "; eventwaitlist2jpu-set-by-read2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventwaitlist2jpu-failed-by-read2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4imageread2jpu ['EVENTWAITLIST'] = eventwaitlist2jpu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2jpu = 0
message2print = "{(Step 32A/70) trying" + "; eventwaitlistquantity2jpu-trying-by-read2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2jpu.keys()
for key2event in keys2event:
eventwaitlistquantity2jpu = eventwaitlistquantity2jpu + 1
message2print = "{(Step 32B/70) set" + "; eventwaitlistquantity2jpu-set-by-read2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlistquantity2jpu-failed-by-read2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4imageread2jpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2jpu
if 'BLOCKING' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2jpu = ' '
message2print = "{(Step 33A/70) trying" + "; blocking2jpu-trying-by-read2image4jpu: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2jpu = 'CL_FALSE' # the read command is non-blocking
message2print = "{(Step 33B/70) set" + "; blocking2jpu-set-by-read2image4jpu to: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; blocking2jpu-failed-by-read2image4jpu: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4imageread2jpu ['BLOCKING'] = blocking2jpu
if 'ORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2jpu = {}
message2print = "{(Step 34A/70) trying" + "; origin2jpu-trying-by-read2image4jpu: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2jpu['X'] = 0
origin2jpu['Y'] = 0
origin2jpu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; origin2jpu-set-by-read2image4jpu to: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; origin2jpu-failed-by-read2image4jpu: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4imageread2jpu ['ORIGIN'] = origin2jpu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (35) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2jpu = {}
message2print = "{(Step 35A/70) trying" + "; region2jpu-trying-by-read2image4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2jpu['X'] = 160 # WIDTH IN PIXELS TO READ
region2jpu['Y'] = 90 # HEIGHT IN PIXELS TO READ
region2jpu['Z'] = 0 # DEPTH IN PIXELS TO READ
message2print = "{(Step 35B/70) set" + "; region2jpu-set-by-read2image4jpu to: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '35B-'
except:
message2print = "{(Step 35Z/70) failed" + "; region2jpu-failed-by-read2image4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '35Z-'
task4imageread2jpu ['REGION'] = region2jpu
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.
rowpitch2jpu = 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" + "; rowpitch2jpu-trying-by-read2image4jpu: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2jpu = int(width2jpu * 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" + "; rowpitch2jpu-set-by-read2image4jpu to: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; rowpitch2jpu-failed-by-read2image4jpu: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '36Z-'
task4imageread2jpu ['ROWPITCH'] = rowpitch2jpu
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
# ----------------------------------------------------------------------------------------------------
pointer2jpu = None
size2jpu = int(width2jpu * height2jpu) # CALCULATED MEMORY
if size2jpu == 0:
size2jpu = 4400 # MINIMUM MEMORY
message2print = "{(Step 37A/70) trying" + "; pointer2jpu-trying-by-read2image4jpu: " + str(pointer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
arena2jpu = Arena4Xi(size2jpu) # SYSTEM RESERVER MEMORY FOR IMAGE
message2print = "{(Step 37B/70) got" + "; arena2jpu-got-by-read2image4jpu: " + str(arena2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
size2arena = arena2jpu.size #
message2print = "{(Step 37C/70) got" + "; size2arena-got-by-read2buffer4jpu: " + str(size2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
buffer2arena = arena2jpu.buffer
message2print = "{(Step 37D/70) got" + "; buffer2arena-got-by-read2buffer4jpu: " + str(buffer2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37D-'
if size2arena < size2jpu:
size2jpu = size2arena # AVAILABLE MEMORY FOR IMAGE
message2print = "{(Step 37E/70) set" + "; size2jpu-set-by-read2buffer4jpu to: " + str(size2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37E-'
else:
pass
pointer2jpu = buffer2arena
message2print = "{(Step 37F/70) set" + "; pointer2jpu-set-by-read2buffer4jpu to: " + str(pointer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37F-'
except:
message2print = "{(Step 37Z/70) failed" + "; pointer2jpu-failed-by-read2image4jpu: " + str(pointer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '37Z-'
task4imageread2jpu ['POINTER'] = pointer2jpu
task4imageread2jpu ['SIZE'] = size2jpu # AUTOMATIC BY JPUXI
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
# --------------------------------------------------------------------------------------------------------
slicepitch2jpu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 38A/70) trying" + "; slicepitch2jpu-trying-by-read2image4jpu: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2jpu = 0
message2print = "{(Step 38B/70) set" + "; slicepitch2jpu-set-by-read2image4jpu to: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '38B-'
except:
message2print = "{(Step 38Z/70) failed" + "; slicepitch2jpu-failed-by-read2image4jpu: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '38Z-'
task4imageread2jpu ['SLICEPITCH'] = slicepitch2jpu
# ---------------------------------------------------------------------------------------------
# EOF TASK ANALYSIS
# ---------------------------------------------------------------------------------------------
keys2task = task4imageread2jpu.keys()
message2print = "{(Step 39/70) set" + "; keys2task-set-by-read2image4jpu 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" + "; task4imageread2jpu-yielded-by-read2image4jpu: " + str(task4imageread2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '39Z-'
# ---------------------------------------------------------------------------------------------
# CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
control2readimage4jpu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2jpu = False
channels2jpu = ()
message2print = "{(Step 40A/70) trying" + "channels2jpu-trying-by-read2image4jpu: " + str(channels2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# (, )
consumerchannel2jpu, publisherchannel2jpu = task4imageread2jpu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2jpu-got-by-read2image4jpu: " + str(consumerchannel2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2jpu-got-by-read2image4jpu: " + str(publisherchannel2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2jpu = True
control2readimage4jpu['CONSUMERCHANNEL'] = consumerchannel2jpu
control2readimage4jpu['PUBLISHERCHANNEL'] = publisherchannel2jpu
code2ack = code2ack + '40D-'
except:
ack4channels2jpu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2jpu = False
queue2jpu = None
message2print = "{(Step 41A/70) trying" + "; queue2jpu-trying-by-read2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2jpu = task4imageread2jpu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2jpu-got-by-read2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2jpu = True
control2readimage4jpu['QUEUE'] = queue2jpu
code2ack = code2ack + '41C-'
except:
ack4queue2jpu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4jpu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4jpu-trying-by-read2image4jpu: " + str(dummy2image4jpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4jpu = DummyProcess4Xi(target=manoeuvre2readimage4jpu, # in this module to handle queue and pipe channels
# args =(queue2jpu, # caller puts and gets - does NOT call any functions
# consumerchannel2jpu, publisherchannel2jpu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4jpu-created-by-read2image4jpu: " + str(dummy2image4jpu) + "; 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-read2image4jpu: " + 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-read2image4jpu: " + str(code2nack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70C/70) returning" + "; control2readimage4jpu-returning-by-read2image4jpu: " + str(control2readimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }
return control2readimage4jpu
#
# -------------------------------------------------------------------------------------------------
#copy2mapimage4jpu"
# channel4map2imagepublish4jpu.send(message2send4jpu)
# print("(Step 93B/700) OF JPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4JPU: ", channel4map2imagepublish4jpu, " MESSAGE2SEND4JPU: " , message2send4jpu)
# except:
# print('(Step 93Z1/700) OF JPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4JPU ', time4xi())
#
# # ---------------------------------------------------------------------------------------------------------------------
# # SIMULATE MANOEUVRE2COPYIMAGE4JPU - LET IT TO RECEIVE COPY AND TO SEND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------------------------------
# if ack2simulate4jpu is True:
# print("(Step 94A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4JPU ", time4xi())
# try:
# response2manoeuvre4copy = manoeuvre2mapimage4jpu(queue4map2image4jpu, channel4map2imageconsume4jpu, channel4map2imagepublish4jpu)
# print("(Step 94B/700) OF JPU2IMAGE4XI5TEST - PERFORMED MANOEUVRE2COPYIMAGE4JPU, RESPONSE2MANOEUVRE4COPY: ", response2manoeuvre4copy)
# except:
# print("(Step 94Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4JPU ", time4xi())
# else:
# pass # trust activated thread
#
# # ---------------------------------------------------------------------------------------------
# # RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------
# print('(Step 95A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4JPU ', time4xi())
# try:
# message2receive4jpu = channel4map2imageconsume4jpu.recv()
# print("(Step 95B/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel4map2imageconsume4jpu, " CONTROL & COMMAND: ", message2receive4jpu)
# except:
# print('(Step 95Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4JPU ', time4xi())
#
# # ------------------------------------------------------------------------------------------------------------
# # SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2COPYIMAGE4JPU TO RECEIVE
# # ------------------------------------------------------------------------------------------------------------
# print('(Step 96A/700) OF JPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4JPU ', time4xi())
# try:
# message2send4jpu = "ready2mapimage4jpu"
# channel4map2imagepublish4jpu.send(message2send4jpu)
# print("(Step 96B/700) OF JPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4JPU: ", channel4map2imagepublish4jpu, " MESSAGE2SEND4JPU: " , message2send4jpu)
# except:
# print('(Step 84Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4JPU ', time4xi())
#
# # -------------------------------------------------------------------------------------------------------
# # SIMULATE MANOEUVRE2COPYIMAGE4JPU - LET IT RECEIVE READY AND SEND READY
# # -------------------------------------------------------------------------------------------------------
# if ack2simulate4jpu is True:
# print("(Step 97A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4JPU ", time4xi())
# try:
# response2manoeuvre4copy = manoeuvre2mapimage4jpu(queue4map2image4jpu, channel4map2imageconsume4jpu, channel4map2imagepublish4jpu)
# print("(Step 97B/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGE4JPU ", manoeuvre2copyimage4jpu)
# except:
# print("(Step 97Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4JPU ", time4xi())
# else:
# pass # trust activated thread
#
#
# # ---------------------------------------------------------------------------------------
# # RECEIVE CONTROL & COMMAND READY VIA PIPE
# # ---------------------------------------------------------------------------------------
# print('(Step 98A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4JPU ', time4xi())
# try:
# message2receive4jpu = channel4map2imageconsume4jpu.recv()
# print("(Step 98B/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel4map2imageconsume4jpu, " CONTROL & COMMAND: ", message2receive4jpu)
# except:
# print('(Step 86Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4JPU ', time4xi())
#
# # -----------------------------------------------------------------------------------------
# # IMAGE JPUXI COPY OPERATIONS
# # -----------------------------------------------------------------------------------------
# print('(Step 99A/700) OF JPU2IMAGE4XI5TEST - TRYING FILE OPERATIONS WITH IMAGE JPUXI ', time4xi())
# try:
# path2dragon = '..//..//..//..//..//web//images//png//dragonxi.png'
# file2dragon = open(path2dragon)
# print("(Step 99B/700) OF JPU2IMAGE4XI5TEST - FILENO: ", file2jpu.fileno( ))
# print("(Step 99C/700) OF JPU2IMAGE4XI5TEST - MODE: ", file2jpu.mode)
# print("(Step 99D/700) OF JPU2IMAGE4XI5TEST - NAME: ", file2jpu.name)
# offset2jpu = 10
# file2jpu.seek(offset2jpu)
# print("(Step 99E/700) OF JPU2IMAGE4XI5TEST - PERFORMED SEEK WITH OFFSET: ", offset2jpu)
# file2jpu.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 JPU2IMAGE4XI5TEST - 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 JPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
#
# # -------------------------------------------------------------------------------------------------------------------------------------
# # SIMULATE MANOEUVRE2COPYIMAGE4JPU - STATE III - GETS FROM QUEUE AND SENDS EITHER ACK OR NACK VIA PIPE
# # -------------------------------------------------------------------------------------------------------------------------------------
# if ack2simulate4jpu is True:
# print("(Step 101A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4JPU ", time4xi())
# try:
# response2manoeuvre4copy = manoeuvre2mapimage4jpu(queue4map2image4jpu, channel4map2imageconsume4jpu, channel4map2imagepublish4jpu)
# print("(Step 101B/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGE4JPU ", manoeuvre2copyimage4jpu)
# except:
# print("(Step 101Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4JPU ", time4xi())
# else:
# pass # trust activated thread
#
#
# # ----------------------------------------------------------------------------------------------------
# # RECEIVE ACK OR NACK ABOUT IMAGE OPERATION CONTROL & COMMAND VIA PIPE
# # ----------------------------------------------------------------------------------------------------
# print('(Step 102A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2receive4jpu = channel4map2imageconsume4jpu.recv()
# print("(Step 102B/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel4map2imageconsume4jpu, " CONTROL & COMMAND: ", message2receive4jpu)
# except:
# print('(Step 90Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
#
#
# # ----------------------------------------------------------------------------------------------------------------
# # SIMULATE MANOEUVRE2COPYIMAGE4JPU - LET MANOEUVRE2COPYIMAGE4JPU TO GO TO STATE 0
# # ----------------------------------------------------------------------------------------------------------------
# if ack2simulate4jpu is True:
# print("(Step 103A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4JPU ", time4xi())
# try:
# response2manoeuvre4copy = manoeuvre2mapimage4jpu(queue4map2image4jpu, channel4map2imageconsume4jpu, channel4map2imagepublish4jpu)
# print("(Step 103B/700) OF JPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4JPU ", response2manoeuvre4copy)
# except:
# print("(Step 103Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4JPU ", time4xi())
# else:
# pass # trust activated thread
#
#">
# -------------------------------------------------------------------------------------------------
def map2image4jpu(task4imagemap2jpu=None):
'''
maps 2D images for JPU
'''
global jpu2image4xi # 2D-IMAGES FOR JPU
global control2mapimage4jpu # COMMAND AND CONTROL FOR JPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "map2image4jpu"
method2print = "map2image4jpu"
message2print = "{(Step 1A/33) started" + "; map2image4jpu-started: " + str(map2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4imagemap2jpu-to-map2image4jpu: " + str(task4imagemap2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE JPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if jpu2image4xi is None:
jpu2image4xi = create2image4jpu() # INITIALIZE IMAGE FOR JPU
message2print = "{(Step 1C/70) created" + "; jpu2image4xi-created-by-map2image4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4jpu-skipped-by-map2image4jpu: " + str(map2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
try:
jpu2image4xi = create2image4jpu()
message2print = "{(Step 1E/70) set" + "; jpu2image4xi-set-by-map2image4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
jpu2image4xi = {}
message2print = "{(Step 1Z/70) yielded" + "; jpu2image4xi-yielded-by-map2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - CHECK PARAMETERS
# -----------------------------------------------------------------------------------------
try:
if task4imagemap2jpu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR MAP - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4imagemap2jpu = {}
message2print = "{(Step 1A/70) initialized" + "; task4imagemap2jpu-created-by-map2image4jpu to: " + str(task4imagemap2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4jpu = trace2image4jpu # CALLBACK FUNCTION FOR JPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4jpu-created-by-map2image4jpu to: " + str(function2callback4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "map2image4jpu" # MODULE OF JPUIZED OPENCL MODULE
args2callback['METHOD'] = "map2image4jpu" # FUNCTION OF JPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; map2image4jpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR JPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-map2image4jpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagemap2jpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO JPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagemap2jpu['FUNCTION2CALLBACK'] = function2callback4jpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4imagemap2jpu-created-by-map2image4jpu to: " + str(task4imagemap2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-map2image4jpu 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-map2image4jpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '2B-'
except:
message2print = "{(Step 2Z/70) failed" + "; platform2xi-failed-by-map2image4jpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4imagemap2jpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2jpu = {}
message2print = "{(Step 3A/70) trying" + "; context2jpu-trying-by-map2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2jpu = get2context4jpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2jpu-got-by-map2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2jpu-failed-by-map2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4imagemap2jpu ['CONTEXT'] = context2jpu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2jpu = {}
message2print = "{(Step 4A/70) trying" + "; device2jpu-trying-by-map2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2jpu = get2jpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2jpu-got-by-map2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2jpu-failed-by-map2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4imagemap2jpu ['DEVICE'] = device2jpu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2jpu = {}
message2print = "{(Step 5A/70) trying" + "; imageinfo2jpu-trying-by-map2image4jpu: " + str(imageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2jpu = get2imageinfo4jpu()
message2print = "{(Step 5B/70) got" + "; imageinfo2jpu-got-by-map2image4jpu: " + str(imageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '5B-'
except:
message2print = "{(Step 5Z/70) failed" + "; imageinfo2jpu-failed-by-map2image4jpu: " + str(imageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4imagemap2jpu ['IMAGE'] = imageinfo2jpu
# ---------------------------------------------------------------------------------------------
# (6) QUEUE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
queue2jpu = None
message2print = "{(Step 6A/70) trying" + "; queue2jpu-trying-by-map2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2jpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 6B/70) got" + "; queue2jpu-got-by-map2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; queue2jpu-failed-by-map2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4imagemap2jpu ['QUEUE'] = queue2jpu
# ---------------------------------------------------------------------------------------------
# (7) PIPE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
pipe2jpu = None
message2print = "{(Step 7A/70) trying" + "; pipe2jpu-trying-by-map2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2jpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 7B/70) got" + "; pipe2jpu-got-by-map2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; pipe2jpu-failed-by-map2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4imagemap2jpu ['PIPE'] = pipe2jpu
# ---------------------------------------------------------------------------------------------
# (8) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2jpu = {}
message2print = "{(Step 8A/70) trying" + "; commandqueueinfo2jpu-trying-by-map2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2jpu = get2commandqueueinfo4jpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 8B/70) got" + "; commandqueueinfo2jpu-got-by-map2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; commandqueueinfo2jpu-failed-by-map2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4imagemap2jpu ['COMMANDQUEUE'] = commandqueueinfo2jpu
# ---------------------------------------------------------------------------------------------
# (9) BUFFER - AUTOMATIC BY JPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2jpu = {}
message2print = "{(Step 9A/70) trying" + "; bufferinfo2jpu-trying-by-map2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2jpu = get2bufferinfo4jpu() # SYSTEM CREATES BUFFER FOR JPU, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; bufferinfo2jpu-got-by-map2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; bufferinfo2jpu-failed-by-map2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4imagemap2jpu ['BUFFER'] = bufferinfo2jpu
# ---------------------------------------------------------------------------------------------
# (10) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2jpu = {}
message2print = "{(Step 10A/70) trying" + "; eventinfo2jpu-trying-by-map2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2jpu = get2eventinfo4jpu()
message2print = "{(Step 10B/70) got" + "; eventinfo2jpu-got-by-map2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '10B-'
except:
message2print = "{(Step 10Z/70) failed" + "; eventinfo2jpu-failed-by-map2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '10Z-'
task4imagemap2jpu ['EVENT'] = eventinfo2jpu
# ---------------------------------------------------------------------------------------------
# (11) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2jpu = {}
message2print = "{(Step 11A/70) trying" + "; eventwaitlist2jpu-trying-by-map2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2jpu = {}
message2print = "{(Step 11B/70) set" + "; eventwaitlist2jpu-set-by-map2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; eventwaitlist2jpu-failed-by-map2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4imagemap2jpu ['EVENTWAITLIST'] = eventwaitlist2jpu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2jpu = 0
message2print = "{(Step 12A/70) trying" + "; eventwaitlistquantity2jpu-trying-by-map2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2jpu.keys()
for key2event in keys2event:
eventwaitlistquantity2jpu = eventwaitlistquantity2jpu + 1
message2print = "{(Step 12B/70) set" + "; eventwaitlistquantity2jpu-set-by-map2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlistquantity2jpu-failed-by-map2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4imagemap2jpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2jpu
# ---------------------------------------------------------------------------------------------
# (13) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2jpu = ' '
message2print = "{(Step 13A/70) trying" + "; blocking2jpu-trying-by-map2image4jpu: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2jpu = 'CL_FALSE' # the map command is non-blocking
message2print = "{(Step 13B/70) set" + "; blocking2jpu-set-by-map2image4jpu to: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; blocking2jpu-failed-by-map2image4jpu: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4imagemap2jpu ['BLOCKING'] = blocking2jpu
# ---------------------------------------------------------------------------------------------
# (14) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2jpu = {}
message2print = "{(Step 14A/70) trying" + "; origin2jpu-trying-by-map2image4jpu: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2jpu['X'] = 0
origin2jpu['Y'] = 0
origin2jpu['Z'] = 0
message2print = "{(Step 14B/70) set" + "; origin2jpu-set-by-map2image4jpu to: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; origin2jpu-failed-by-map2image4jpu: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4imagemap2jpu ['ORIGIN'] = origin2jpu
# ---------------------------------------------------------------------------------------------
# (15) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2jpu = {}
message2print = "{(Step 15A/70) trying" + "; region2jpu-trying-by-map2image4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2jpu['X'] = 160 # WIDTH IN PIXELS TO MAP
region2jpu['Y'] = 90 # HEIGHT IN PIXELS TO MAP
region2jpu['Z'] = 0 # DEPTH IN PIXELS TO MAP
message2print = "{(Step 15B/70) set" + "; region2jpu-set-by-map2image4jpu to: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; region2jpu-failed-by-map2image4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '15Z-'
task4imagemap2jpu ['REGION'] = region2jpu
# ---------------------------------------------------------------------------------------------
# (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.
rowpitch2jpu = 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
width2jpu = 800
message2print = "{(Step 16A/70) trying" + "; rowpitch2jpu-trying-by-map2image4jpu: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2jpu = int(width2jpu * 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" + "; rowpitch2jpu-set-by-map2image4jpu to: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 8000
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; rowpitch2jpu-failed-by-map2image4jpu: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '16Z-'
task4imagemap2jpu ['ROWPITCH'] = rowpitch2jpu
# --------------------------------------------------------------------------------------------------------
# (18) SLICEPITCH - REQUIRED - THE SIZE IN BYTES OF THE 2D SLICE OF THE 3D REGION OF A 3D IMAGE BEING MAP
# --------------------------------------------------------------------------------------------------------
slicepitch2jpu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 18A/70) trying" + "; slicepitch2jpu-trying-by-map2image4jpu: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2jpu = 0
message2print = "{(Step 18B/70) set" + "; slicepitch2jpu-set-by-map2image4jpu to: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '18B-'
except:
message2print = "{(Step 18Z/70) failed" + "; slicepitch2jpu-failed-by-map2image4jpu: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '18Z-'
task4imagemap2jpu ['SLICEPITCH'] = slicepitch2jpu
# ---------------------------------------------------------------------------------------------
# (19) FLAGS - REQUIRED
# ---------------------------------------------------------------------------------------------
flags2jpu = 'CL_MAP_READ'
message2print = "{(Step 19A/70) trying" + "; flags2jpu-trying-by-map2image4jpu: " + str(flags2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
flags2jpu = 'CL_MAP_WRITE' # THE REGION SPECIFIED BY (ORIGIN, REGION) IN THE IMAGE OBJECT IS BEING MAPPED FOR WRITING
message2print = "{(Step 19B/70) set" + "; flags2jpu-set-by-map2image4jpu to: " + str(flags2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '19B-'
except:
message2print = "{(Step 19Z/70) failed" + "; flags2jpu-failed-by-map2image4jpu: " + str(flags2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '19Z-'
task4imagemap2jpu ['FLAGS'] = flags2jpu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
else:
pass
# ---------------------------------------------------------------------------------------------
# ANALYSE TASKS - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4imagemap2jpu.keys()
message2print = "{(Step 20/70) got" + "; keys2task-got-by-map2image4jpu: " + 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
# ---------------------------------------------------------------------------------------------
function2callback4jpu = trace2image4jpu # CALLBACK FUNCTION FOR JPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4jpu-created-by-map2image4jpu to: " + str(function2callback4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "map2image4jpu" # MODULE OF JPUIZED OPENCL MODULE
args2callback['METHOD'] = "map2image4jpu" # FUNCTION OF JPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; map2image4jpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR JPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-map2image4jpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagemap2jpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO JPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagemap2jpu['FUNCTION2CALLBACK'] = function2callback4jpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4imagemap2jpu-created-by-map2image4jpu to: " + str(task4imagemap2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-map2image4jpu 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-map2image4jpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-map2image4jpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4imagemap2jpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2jpu = {}
message2print = "{(Step 23A/70) trying" + "; context2jpu-trying-by-map2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2jpu = get2context4jpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2jpu-got-by-map2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2jpu-failed-by-map2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4imagemap2jpu ['CONTEXT'] = context2jpu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2jpu = {}
message2print = "{(Step 24A/70) trying" + "; device2jpu-trying-by-map2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2jpu = get2jpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2jpu-got-by-map2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2jpu-failed-by-map2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4imagemap2jpu ['DEVICE'] = device2jpu
if 'IMAGE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2jpu = {}
message2print = "{(Step 25A/70) trying" + "; imageinfo2jpu-trying-by-map2image4jpu: " + str(imageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2jpu = get2imageinfo4jpu()
message2print = "{(Step 25B/70) got" + "; imageinfo2jpu-got-by-map2image4jpu: " + str(imageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; imageinfo2jpu-failed-by-map2image4jpu: " + str(imageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4imagemap2jpu ['IMAGE'] = imageinfo2jpu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) QUEUE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
queue2jpu = None
message2print = "{(Step 26A/70) trying" + "; queue2jpu-trying-by-map2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2jpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 26B/70) got" + "; queue2jpu-got-by-map2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; queue2jpu-failed-by-map2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4imagemap2jpu ['QUEUE'] = queue2jpu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) PIPE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
pipe2jpu = None
message2print = "{(Step 27A/70) trying" + "; pipe2jpu-trying-by-map2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2jpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 27B/70) got" + "; pipe2jpu-got-by-map2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; pipe2jpu-failed-by-map2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4imagemap2jpu ['PIPE'] = pipe2jpu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2jpu = {}
message2print = "{(Step 28A/70) trying" + "; commandqueueinfo2jpu-trying-by-map2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2jpu = get2commandqueueinfo4jpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 28B/70) got" + "; commandqueueinfo2jpu-got-by-map2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; commandqueueinfo2jpu-failed-by-map2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4imagemap2jpu ['COMMANDQUEUE'] = commandqueueinfo2jpu
if 'BUFFER' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (29) BUFFER - AUTOMATIC BY JPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2jpu = {}
message2print = "{(Step 29A/70) trying" + "; bufferinfo2jpu-trying-by-map2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2jpu = get2bufferinfo4jpu() # SYSTEM CREATES BUFFER FOR JPU, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; bufferinfo2jpu-got-by-map2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; bufferinfo2jpu-failed-by-map2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4imagemap2jpu ['BUFFER'] = bufferinfo2jpu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (30) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2jpu = {}
message2print = "{(Step 30A/70) trying" + "; eventinfo2jpu-trying-by-map2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2jpu = get2eventinfo4jpu()
message2print = "{(Step 30B/70) got" + "; eventinfo2jpu-got-by-map2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '30B-'
except:
message2print = "{(Step 30Z/70) failed" + "; eventinfo2jpu-failed-by-map2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '30Z-'
task4imagemap2jpu ['EVENT'] = eventinfo2jpu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2jpu = {}
message2print = "{(Step 31A/70) trying" + "; eventwaitlist2jpu-trying-by-map2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2jpu = {}
message2print = "{(Step 31B/70) set" + "; eventwaitlist2jpu-set-by-map2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventwaitlist2jpu-failed-by-map2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4imagemap2jpu ['EVENTWAITLIST'] = eventwaitlist2jpu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2jpu = 0
message2print = "{(Step 32A/70) trying" + "; eventwaitlistquantity2jpu-trying-by-map2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2jpu.keys()
for key2event in keys2event:
eventwaitlistquantity2jpu = eventwaitlistquantity2jpu + 1
message2print = "{(Step 32B/70) set" + "; eventwaitlistquantity2jpu-set-by-map2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlistquantity2jpu-failed-by-map2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4imagemap2jpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2jpu
if 'BLOCKING' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2jpu = ' '
message2print = "{(Step 33A/70) trying" + "; blocking2jpu-trying-by-map2image4jpu: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2jpu = 'CL_FALSE' # the map command is non-blocking
message2print = "{(Step 33B/70) set" + "; blocking2jpu-set-by-map2image4jpu to: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; blocking2jpu-failed-by-map2image4jpu: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4imagemap2jpu ['BLOCKING'] = blocking2jpu
if 'ORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2jpu = {}
message2print = "{(Step 34A/70) trying" + "; origin2jpu-trying-by-map2image4jpu: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2jpu['X'] = 0
origin2jpu['Y'] = 0
origin2jpu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; origin2jpu-set-by-map2image4jpu to: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; origin2jpu-failed-by-map2image4jpu: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4imagemap2jpu ['ORIGIN'] = origin2jpu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (35) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2jpu = {}
message2print = "{(Step 35A/70) trying" + "; region2jpu-trying-by-map2image4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2jpu['X'] = 160 # WIDTH IN PIXELS TO MAP
region2jpu['Y'] = 90 # HEIGHT IN PIXELS TO MAP
region2jpu['Z'] = 0 # DEPTH IN PIXELS TO MAP
message2print = "{(Step 35B/70) set" + "; region2jpu-set-by-map2image4jpu to: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '35B-'
except:
message2print = "{(Step 35Z/70) failed" + "; region2jpu-failed-by-map2image4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '35Z-'
task4imagemap2jpu ['REGION'] = region2jpu
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.
rowpitch2jpu = 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" + "; rowpitch2jpu-trying-by-map2image4jpu: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2jpu = int(width2jpu * 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" + "; rowpitch2jpu-set-by-map2image4jpu to: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; rowpitch2jpu-failed-by-map2image4jpu: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '36Z-'
task4imagemap2jpu ['ROWPITCH'] = rowpitch2jpu
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
# --------------------------------------------------------------------------------------------------------
slicepitch2jpu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 38A/70) trying" + "; slicepitch2jpu-trying-by-map2image4jpu: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2jpu = 0
message2print = "{(Step 38B/70) set" + "; slicepitch2jpu-set-by-map2image4jpu to: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '38B-'
except:
message2print = "{(Step 38Z/70) failed" + "; slicepitch2jpu-failed-by-map2image4jpu: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '38Z-'
task4imagemap2jpu ['SLICEPITCH'] = slicepitch2jpu
if 'FLAGS' in keys2task:
pass
else:
# --------------------------------------------------------------------------------------------------------
# (39) FLAGS - REQUIRED
# --------------------------------------------------------------------------------------------------------
flags2jpu = 'CL_MAP_READ'
message2print = "{(Step 39A/70) trying" + "; flags2jpu-trying-by-map2image4jpu: " + str(flags2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
flags2jpu = 'CL_MAP_WRITE'
message2print = "{(Step 39B/70) set" + "; flags2jpu-set-by-map2image4jpu to: " + str(flags2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '39B-'
except:
message2print = "{(Step 39Z/70) failed" + "; flags2jpu-failed-by-map2image4jpu: " + str(flags2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '39Z-'
task4imagemap2jpu ['FLAGS'] = flags2jpu
# ---------------------------------------------------------------------------------------------
# EOF TASK ANALYSIS
# ---------------------------------------------------------------------------------------------
keys2task = task4imagemap2jpu.keys()
message2print = "{(Step 40A/70) set" + "; keys2task-set-by-map2image4jpu 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" + "; task4imagemap2jpu-yielded-by-map2image4jpu: " + str(task4imagemap2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
control2mapimage4jpu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2jpu = False
channels2jpu = ()
message2print = "{(Step 40A/70) trying" + "channels2jpu-trying-by-map2image4jpu: " + str(channels2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
#
consumerchannel2jpu, publisherchannel2jpu = task4imagemap2jpu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2jpu-got-by-map2image4jpu: " + str(consumerchannel2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2jpu-got-by-map2image4jpu: " + str(publisherchannel2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2jpu = True
control2mapimage4jpu['CONSUMERCHANNEL'] = consumerchannel2jpu
control2mapimage4jpu['PUBLISHERCHANNEL'] = publisherchannel2jpu
code2ack = code2ack + '40D-'
except:
ack4channels2jpu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2jpu = False
queue2jpu = None
message2print = "{(Step 41A/70) trying" + "queue2jpu-trying-by-map2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2jpu = task4imagemap2jpu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2jpu-got-by-map2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2jpu = True
control2mapimage4jpu['QUEUE'] = queue2jpu
code2ack = code2ack + '41C-'
except:
ack4queue2jpu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4jpu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4jpu-trying-by-map2image4jpu: " + str(dummy2image4jpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4jpu = DummyProcess4Xi(target=manoeuvre2mapimage4jpu, # in this module to handle queue and pipe channels
# args =(queue2jpu, # caller puts and gets - does NOT call any functions
# consumerchannel2jpu, publisherchannel2jpu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4jpu-created-by-map2image4jpu: " + str(dummy2image4jpu) + "; 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-map2image4jpu: " + str(code2ack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70B/70) set" + "; code2nack-set-by-map2image4jpu: " + 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" + "; control2mapimage4jpu-returning-by-map2image4jpu: " + str(control2mapimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return control2mapimage4jpu
#
# -----------------------------------------------------------------------------------------------------------------------
#roger2copy4jpu', 'ACK2INFO4JPU': False, 'MESSAGE2GET4JPU': 'default2copy4jpu',
# # 'MESSAGE2RECEIVE4JPU': 'copy2copy4jpu',
# 'CODE2ACK4JPU': ' 0D-1C-', 'MESSAGE2PUT4JPU': 'default2copy4jpu', 'CODE2NACK4JPU': ' ', 'STATE2MANOEUVRE4JPU': 1}
# except:
# print("(Step 42Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4JPU ", time4xi())
# else:
# pass # trust activated thread
#">
# -----------------------------------------------------------------------------------------------------------------------
def manoeuvre2copyimage4jpu(queue2copymanoeuvre4jpu, consumerchannel2copymanoeuvre4jpu, publisherchannel2copymanoeuvre4jpu):
'''
manoeuvres copy control and command
'''
global state2copyimage4jpu # STATE FOR COMMAND AND CONTROL
global max2copyimagestate4jpu # MAX FOR STATE
global ack2copyimageinfo4jpu # ACK FOR IMAGE INFO
global message2copyimageget4jpu
global message2copyimageput4jpu
global message2copyimagereceive4jpu
global message2copyimagesend4jpu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2copyimage4jpu"
method2print = "manoeuvre2copyimage4jpu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2copyimage4jpu-started: " + str(manoeuvre2copyimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 0B/33) passed" + "; queue2copymanoeuvre4jpu-to-manoeuvre2copyimage4jpu: " + str(queue2copymanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2copymanoeuvre4jpu-to-manoeuvre2copyimage4jpu: " + str(consumerchannel2copymanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0D/33) passed" + "; publisherchannel2copymanoeuvre4jpu-to-manoeuvre2copyimage4jpu: " + str(publisherchannel2copymanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4copy = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2copyimage4jpu-try-by-manoeuvre2copyimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2copyimage4jpu is None:
state2copyimage4jpu = 0
message2print = "{(Step 0F/33) initialized" + "; state2copyimage4jpu-initialized-by-manoeuvre2copyimage4jpu to: " + str(state2copyimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2copyimage4jpu-used-by-manoeuvre2copyimage4jpu: " + str(state2copyimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2copyimage4jpu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2copyimage4jpu-initialized-by-manoeuvre2copyimage4jpu to: " + str(state2copyimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2copyimageinfo4jpu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2copyimageinfo4jpu-initialized-by-manoeuvre2copyimage4jpu to: " + str(ack2copyimageinfo4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2copyimageget4jpu = 'default2copy4jpu'
message2print = "{(Step 0Z3/33) initialized" + "; message2copyimageget4jpu-initialized-by-manoeuvre2copyimage4jpu to: " + str(message2copyimageget4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4jpu
message2copyimageput4jpu = 'default2copy4jpu'
message2print = "{(Step 0Z4/33) initialized" + "; message2copyimageput4jpu-initialized-by-manoeuvre2copyimage4jpu to: " + str(message2copyimageput4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4jpu
message2copyimagereceive4jpu = 'default2copy4jpu'
message2print = "{(Step 0Z5/33) initialized" + "; message2copyimagereceive4jpu-initialized-by-manoeuvre2copyimage4jpu to: " + str(message2copyimagereceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4jpu
message2copyimagesend4jpu = 'default2copy4jpu'
message2print = "{(Step 0Z6/33) initialized" + "; message2copyimagesend4jpu-initialized-by-manoeuvre2copyimage4jpu to: " + str(message2copyimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4jpu
max2copyimagestate4jpu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2copyimagestate4jpu-initialized-by-manoeuvre2copyimage4jpu to: " + str( max2copyimagestate4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2copyimage4jpu = state2copyimage4jpu + 1
message2print = "{(Step 0H/33) added" + "; state2copyimage4jpu-added-by-manoeuvre2copyimage4jpu: " + str(state2copyimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2copyimage4jpu > max2copyimagestate4jpu:
state2copyimage4jpu = 0
message2print = "{(Step 0I/33) set" + "; state2copyimage4jpu-set-by-manoeuvre2copyimage4jpu to: " + str(state2copyimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2copyimageinfo4jpu = False
message2print = "{(Step 0J/33) set" + "; ack2copyimageinfo4jpu-set-by-manoeuvre2copyimage4jpu to: " + str(ack2copyimageinfo4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2copyimageget4jpu = 'default2copy4jpu'
message2print = "{(Step 0K/33) set" + "; message2copyimageget4jpu-set-by-manoeuvre2copyimage4jpu to: " + str(message2copyimageget4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4jpu
message2copyimageput4jpu = 'default2copy4jpu'
message2print = "{(Step 0L/33) set" + "; message2copyimageput4jpu-set-by-manoeuvre2copyimage4jpu to: " + str(message2copyimageput4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4jpu
message2copyimagereceive4jpu = 'default2copy4jpu'
message2print = "{(Step 0M/33) set" + "; message2copyimagereceive4jpu-set-by-manoeuvre2copyimage4jpu to: " + str(message2copyimagereceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4jpu
message2copyimagesend4jpu = 'default2copy4jpu'
message2print = "{(Step 0N/33) set" + "; message2copyimagesend4jpu-set-by-manoeuvre2copyimage4jpu to: " + str(message2copyimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4jpu
max2copyimagestate4jpu = 3
message2print = "{(Step 0O/33) initialized" + "; max2copyimagestate4jpu-set-by-manoeuvre2copyimage4jpu to: " + str( max2copyimagestate4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2copyimage4jpu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2copyimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copyimagereceive4jpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copyimagereceive4jpu = consumerchannel2copymanoeuvre4jpu.recv()
message2print = "{(Step 1B/33) received" + "; message2copyimagereceive4jpu-received-by-manoeuvre2copyimage4jpu: " + str(message2copyimagereceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# copy2copy4jpu
if message2copyimagereceive4jpu == 'copy2copy4jpu':
message2copyimagesend4jpu = 'roger2copy4jpu'
else:
message2copyimagesend4jpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copymanoeuvre4jpu.send(message2copyimagesend4jpu)
message2print = "{(Step 1C/33) sent" + "; message2copyimagesend4jpu-sent-by-manoeuvre2copyimage4jpu: " + str(message2copyimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# roger2copy4jpu
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2copyimagereceive4jpu-failed-by-manoeuvre2copyimage4jpu: " + str(message2copyimagereceive4jpu) + "; 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 state2copyimage4jpu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2copyimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copyimagereceive4jpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copyimagereceive4jpu = consumerchannel2copymanoeuvre4jpu.recv()
message2print = "{(Step 2B/33) received" + "; message2copyimagereceive4jpu-received-by-manoeuvre2copyimage4jpu: " + str(message2copyimagereceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ready2copy4jpu
if message2copyimagereceive4jpu == 'ready2copy4jpu':
message2copyimagesend4jpu = 'ready2copy4jpu'
else:
message2copyimagesend4jpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND READY OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copymanoeuvre4jpu.send(message2copyimagesend4jpu)
message2print = "{(Step 2C/33) sent" + "; message2copyimagesend4jpu-sent-by-manoeuvre2copyimage4jpu: " + str(message2copyimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2copyimagereceive4jpu-failed-by-manoeuvre2copyimage4jpu: " + str(message2copyimagereceive4jpu) + "; 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 state2copyimage4jpu == 3:
info2image4jpu = None
message2print = "{(Step 3A/70) try" + "; info2image4jpu-try-by-manoeuvre2copyimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4jpu = queue2copymanoeuvre4jpu.get()
message2print = "{(Step 3B/33) got" + "; info2image4jpu-got-by-manoeuvre2copyimage4jpu: " + str(info2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ..//..//..//..//..//web//images//png//dragonxi.png
if info2image4jpu is None:
code2nack = code2nack + '3Z1-'
ack2copyimageinfo4jpu = False
else:
code2ack = code2ack + '3C-'
ack2copyimageinfo4jpu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2copymanoeuvre4jpu-failed-by-manoeuvre2copyimage4jpu: " + str(queue2copymanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2copyimagesend4jpu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2copyimageinfo4jpu is True:
message2copyimagesend4jpu = 'ack2imageinfo4jpu'
else:
message2copyimagesend4jpu = 'nack2imageinfo4jpu'
message2print = "{(Step 4B/33) set" + "; message2copyimagesend4jpu-set-by-manoeuvre2copyimage4jpu to: " + str(message2copyimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4jpu
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copyimagesend4jpu-failed-by-manoeuvre2copyimage4jpu: " + str(message2copyimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2copymanoeuvre4jpu-calling-by-manoeuvre2copyimage4jpu: " + str(publisherchannel2copymanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2copyimagesend4jpu-passing-to-send-by-manoeuvre2copyimage4jpu: " + str(message2copyimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copyimagesend4jpu-failed-by-manoeuvre2copyimage4jpu: " + str(message2copyimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2copymanoeuvre4jpu.send(message2copyimagesend4jpu)
message2print = "{(Step 4E/33) sent" + "; message2copyimagesend4jpu-sent-by-manoeuvre2copyimage4jpu: " + str(message2copyimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4jpu
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2copyimagesend4jpu-failed-by-manoeuvre2copyimage4jpu: " + str(message2copyimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4copy['ACK2INFO4JPU'] = ack2copyimageinfo4jpu
response2manouvre4copy['CODE2ACK4JPU'] = code2ack
response2manouvre4copy['CODE2NACK4JPU'] = code2nack
response2manouvre4copy['MESSAGE2GET4JPU'] = message2copyimageget4jpu
response2manouvre4copy['MESSAGE2PUT4JPU'] = message2copyimageput4jpu
response2manouvre4copy['MESSAGE2RECEIVE4JPU'] = message2copyimagereceive4jpu
response2manouvre4copy['MESSAGE2SEND4JPU'] = message2copyimagesend4jpu
response2manouvre4copy['STATE2MANOEUVRE4JPU'] = state2copyimage4jpu
message2print = "{(Step 33/33) returning" + "; response2manouvre4copy-returning-by-manoeuvre2copyimage4jpu: " + str(response2manouvre4copy) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1 {'MESSAGE2SEND4JPU': 'roger2copy4jpu',
# 'ACK2INFO4JPU': False,
# 'MESSAGE2GET4JPU': 'default2copy4jpu',
# 'MESSAGE2RECEIVE4JPU': 'copy2copy4jpu',
# 'CODE2ACK4JPU': ' 0D-1C-',
# 'MESSAGE2PUT4JPU': 'default2copy4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 1}; time: 05:25:15 10/03/11 Pacific Daylight Time}
#2 {'MESSAGE2SEND4JPU': 'ready2copy4jpu',
# 'ACK2INFO4JPU': False,
# 'MESSAGE2GET4JPU': 'default2copy4jpu',
# 'MESSAGE2RECEIVE4JPU': 'ready2copy4jpu',
# 'CODE2ACK4JPU': ' 0D-2C-',
# 'MESSAGE2PUT4JPU': 'default2copy4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 2}; time: 05:25:15 10/03/11 Pacific Daylight Time}
#3 {'MESSAGE2SEND4JPU': 'ack2imageinfo4jpu',
# 'ACK2INFO4JPU': True,
# 'MESSAGE2GET4JPU': 'default2copy4jpu',
# 'MESSAGE2RECEIVE4JPU': 'ready2copy4jpu',
# 'CODE2ACK4JPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4JPU': 'default2copy4jpu',
# 'CODE2NACK4JPU': ' ', 'STATE2MANOEUVRE4JPU': 3}; time: 05:25:15 10/03/11 Pacific Daylight Time}
#4 {'MESSAGE2SEND4JPU': 'default2copy4jpu',
# 'ACK2INFO4JPU': False,
# 'MESSAGE2GET4JPU': 'default2copy4jpu',
# 'MESSAGE2RECEIVE4JPU': 'default2copy4jpu',
# 'CODE2ACK4JPU': ' 0D-',
# 'MESSAGE2PUT4JPU': 'default2copy4jpu',
# 'CODE2NACK4JPU': ' ', 'STATE2MANOEUVRE4JPU': 0}; time: 05:25:15 10/03/11 Pacific Daylight Time}
return response2manouvre4copy
#
# -----------------------------------------------------------------------------------------------------------------------
#roger2copyimagetobuffer4jpu',
# # 'ACK2INFO4JPU': False,
# # 'MESSAGE2GET4JPU': 'default2copyimagetobuffer4jpu',
# # 'MESSAGE2RECEIVE4JPU': 'copy2copyimagetobuffer4jpu',
# # 'CODE2ACK4JPU': ' 0D-1C-',
# # 'MESSAGE2PUT4JPU': 'default2copyimagetobuffer4jpu',
# # 'CODE2NACK4JPU': ' ',
# # 'STATE2MANOEUVRE4JPU': 1}
# except:
# print("(Step 62Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4JPU ", time4xi())
# else:
# pass # trust activated thread
#">
# -----------------------------------------------------------------------------------------------------------------------
def manoeuvre2copyimagetobuffer4jpu(queue2copyimagetobuffermanoeuvre4jpu, consumerchannel2copyimagetobuffermanoeuvre4jpu, publisherchannel2copyimagetobuffermanoeuvre4jpu):
'''
manoeuvres copy control and command for copy2imagetobuffer4jpu
'''
global state2copyimagetobuffer4jpu # STATE FOR COMMAND AND CONTROL
global max2copyimagetobufferstate4jpu # MAX FOR STATE
global ack2copyimagetobufferinfo4jpu # ACK FOR IMAGE INFO
global message2copyimagetobufferget4jpu
global message2copyimagetobufferput4jpu
global message2copyimagetobufferreceive4jpu
global message2copyimagetobuffersend4jpu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2copyimagetobuffer4jpu"
method2print = "manoeuvre2copyimagetobuffer4jpu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2copyimagetobuffer4jpu-started: " + str(manoeuvre2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 0B/33) passed" + "; queue2copyimagetobuffermanoeuvre4jpu-to-manoeuvre2copyimagetobuffer4jpu: " + str(queue2copyimagetobuffermanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2copyimagetobuffermanoeuvre4jpu-to-manoeuvre2copyimagetobuffer4jpu: " + str(consumerchannel2copyimagetobuffermanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0D/33) passed" + "; publisherchannel2copyimagetobuffermanoeuvre4jpu-to-manoeuvre2copyimagetobuffer4jpu: " + str(publisherchannel2copyimagetobuffermanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4copyimagetobuffer = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2copyimagetobuffer4jpu-try-by-manoeuvre2copyimagetobuffer4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2copyimagetobuffer4jpu is None:
state2copyimagetobuffer4jpu = 0
message2print = "{(Step 0F/33) initialized" + "; state2copyimagetobuffer4jpu-initialized-by-manoeuvre2copyimagetobuffer4jpu to: " + str(state2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2copyimagetobuffer4jpu-used-by-manoeuvre2copyimagetobuffer4jpu: " + str(state2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2copyimagetobuffer4jpu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2copyimagetobuffer4jpu-initialized-by-manoeuvre2copyimagetobuffer4jpu to: " + str(state2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2copyimagetobufferinfo4jpu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2copyimagetobufferinfo4jpu-initialized-by-manoeuvre2copyimagetobuffer4jpu to: " + str(ack2copyimagetobufferinfo4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2copyimagetobufferget4jpu = 'default2copyimagetobuffer4jpu'
message2print = "{(Step 0Z3/33) initialized" + "; message2copyimagetobufferget4jpu-initialized-by-manoeuvre2copyimagetobuffer4jpu to: " + str(message2copyimagetobufferget4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobufferput4jpu = 'default2copyimagetobuffer4jpu'
message2print = "{(Step 0Z4/33) initialized" + "; message2copyimagetobufferput4jpu-initialized-by-manoeuvre2copyimagetobuffer4jpu to: " + str(message2copyimagetobufferput4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobufferreceive4jpu = 'default2copyimagetobuffer4jpu'
message2print = "{(Step 0Z5/33) initialized" + "; message2copyimagetobufferreceive4jpu-initialized-by-manoeuvre2copyimagetobuffer4jpu to: " + str(message2copyimagetobufferreceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobuffersend4jpu = 'default2copyimagetobuffer4jpu'
message2print = "{(Step 0Z6/33) initialized" + "; message2copyimagetobuffersend4jpu-initialized-by-manoeuvre2copyimagetobuffer4jpu to: " + str(message2copyimagetobuffersend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
max2copyimagetobufferstate4jpu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2copyimagetobufferstate4jpu-initialized-by-manoeuvre2copyimagetobuffer4jpu to: " + str( max2copyimagetobufferstate4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2copyimagetobuffer4jpu = state2copyimagetobuffer4jpu + 1
message2print = "{(Step 0H/33) added" + "; state2copyimagetobuffer4jpu-added-by-manoeuvre2copyimagetobuffer4jpu: " + str(state2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2copyimagetobuffer4jpu > max2copyimagetobufferstate4jpu:
state2copyimagetobuffer4jpu = 0
message2print = "{(Step 0I/33) set" + "; state2copyimagetobuffer4jpu-set-by-manoeuvre2copyimagetobuffer4jpu to: " + str(state2copyimagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack2copyimagetobufferinfo4jpu = False
message2print = "{(Step 0J/33) set" + "; ack2copyimagetobufferinfo4jpu-set-by-manoeuvre2copyimagetobuffer4jpu to: " + str(ack2copyimagetobufferinfo4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobufferget4jpu = 'default2copyimagetobuffer4jpu'
message2print = "{(Step 0K/33) set" + "; message2copyimagetobufferget4jpu-set-by-manoeuvre2copyimagetobuffer4jpu to: " + str(message2copyimagetobufferget4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobufferput4jpu = 'default2copyimagetobuffer4jpu'
message2print = "{(Step 0L/33) set" + "; message2copyimagetobufferput4jpu-set-by-manoeuvre2copyimagetobuffer4jpu to: " + str(message2copyimagetobufferput4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobufferreceive4jpu = 'default2copyimagetobuffer4jpu'
message2print = "{(Step 0M/33) set" + "; message2copyimagetobufferreceive4jpu-set-by-manoeuvre2copyimagetobuffer4jpu to: " + str(message2copyimagetobufferreceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobuffersend4jpu = 'default2copyimagetobuffer4jpu'
message2print = "{(Step 0N/33) set" + "; message2copyimagetobuffersend4jpu-set-by-manoeuvre2copyimagetobuffer4jpu to: " + str(message2copyimagetobuffersend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
max2copyimagetobufferstate4jpu = 3
message2print = "{(Step 0O/33) initialized" + "; max2copyimagetobufferstate4jpu-set-by-manoeuvre2copyimagetobuffer4jpu to: " + str( max2copyimagetobufferstate4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2copyimagetobuffer4jpu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2copyimagetobuffer4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copyimagetobufferreceive4jpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copyimagetobufferreceive4jpu = consumerchannel2copyimagetobuffermanoeuvre4jpu.recv()
message2print = "{(Step 1B/33) received" + "; message2copyimagetobufferreceive4jpu-received-by-manoeuvre2copyimagetobuffer4jpu: " + str(message2copyimagetobufferreceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2copyimagetobufferreceive4jpu == 'copy2copyimagetobuffer4jpu':
message2copyimagetobuffersend4jpu = 'roger2copyimagetobuffer4jpu'
else:
message2copyimagetobuffersend4jpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copyimagetobuffermanoeuvre4jpu.send(message2copyimagetobuffersend4jpu)
message2print = "{(Step 1C/33) sent" + "; message2copyimagetobuffersend4jpu-sent-by-manoeuvre2copyimagetobuffer4jpu: " + str(message2copyimagetobuffersend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2copyimagetobufferreceive4jpu-failed-by-manoeuvre2copyimagetobuffer4jpu: " + str(message2copyimagetobufferreceive4jpu) + "; 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 state2copyimagetobuffer4jpu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2copyimagetobuffer4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copyimagetobufferreceive4jpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copyimagetobufferreceive4jpu = consumerchannel2copyimagetobuffermanoeuvre4jpu.recv()
message2print = "{(Step 2B/33) received" + "; message2copyimagetobufferreceive4jpu-received-by-manoeuvre2copyimagetobuffer4jpu: " + str(message2copyimagetobufferreceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2copyimagetobufferreceive4jpu == 'ready2copyimagetobuffer4jpu':
message2copyimagetobuffersend4jpu = 'ready2copyimagetobuffer4jpu'
else:
message2copyimagetobuffersend4jpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND READY OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copyimagetobuffermanoeuvre4jpu.send(message2copyimagetobuffersend4jpu)
message2print = "{(Step 2C/33) sent" + "; message2copyimagetobuffersend4jpu-sent-by-manoeuvre2copyimagetobuffer4jpu: " + str(message2copyimagetobuffersend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2copyimagetobufferreceive4jpu-failed-by-manoeuvre2copyimagetobuffer4jpu: " + str(message2copyimagetobufferreceive4jpu) + "; 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 state2copyimagetobuffer4jpu == 3:
info2image4jpu = None
message2print = "{(Step 3A/70) try" + "; info2image4jpu-try-by-manoeuvre2copyimagetobuffer4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4jpu = queue2copyimagetobuffermanoeuvre4jpu.get()
message2print = "{(Step 3B/33) got" + "; info2image4jpu-got-by-manoeuvre2copyimagetobuffer4jpu: " + str(info2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ..//..//..//..//..//web//images//png//dragonxi.png
if info2image4jpu is None:
code2nack = code2nack + '3Z1-'
ack2copyimagetobufferinfo4jpu = False
else:
code2ack = code2ack + '3C-'
ack2copyimagetobufferinfo4jpu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2copyimagetobuffermanoeuvre4jpu-failed-by-manoeuvre2copyimagetobuffer4jpu: " + str(queue2copyimagetobuffermanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2copyimagetobuffersend4jpu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2copyimagetobufferinfo4jpu is True:
message2copyimagetobuffersend4jpu = 'ack2imageinfo4jpu'
else:
message2copyimagetobuffersend4jpu = 'nack2imageinfo4jpu'
message2print = "{(Step 4B/33) set" + "; message2copyimagetobuffersend4jpu-set-by-manoeuvre2copyimagetobuffer4jpu to: " + str(message2copyimagetobuffersend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4jpu
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copyimagetobuffersend4jpu-failed-by-manoeuvre2copyimagetobuffer4jpu: " + str(message2copyimagetobuffersend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2copyimagetobuffermanoeuvre4jpu-calling-by-manoeuvre2copyimagetobuffer4jpu: " + str(publisherchannel2copyimagetobuffermanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2copyimagetobuffersend4jpu-passing-to-send-by-manoeuvre2copyimagetobuffer4jpu: " + str(message2copyimagetobuffersend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copyimagetobuffersend4jpu-failed-by-manoeuvre2copyimagetobuffer4jpu: " + str(message2copyimagetobuffersend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2copyimagetobuffermanoeuvre4jpu.send(message2copyimagetobuffersend4jpu)
message2print = "{(Step 4E/33) sent" + "; message2copyimagetobuffersend4jpu-sent-by-manoeuvre2copyimagetobuffer4jpu: " + str(message2copyimagetobuffersend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4jpu
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2copyimagetobuffersend4jpu-failed-by-manoeuvre2copyimagetobuffer4jpu: " + str(message2copyimagetobuffersend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4copyimagetobuffer['ACK2INFO4JPU'] = ack2copyimagetobufferinfo4jpu
response2manouvre4copyimagetobuffer['CODE2ACK4JPU'] = code2ack
response2manouvre4copyimagetobuffer['CODE2NACK4JPU'] = code2nack
response2manouvre4copyimagetobuffer['MESSAGE2GET4JPU'] = message2copyimagetobufferget4jpu
response2manouvre4copyimagetobuffer['MESSAGE2PUT4JPU'] = message2copyimagetobufferput4jpu
response2manouvre4copyimagetobuffer['MESSAGE2RECEIVE4JPU'] = message2copyimagetobufferreceive4jpu
response2manouvre4copyimagetobuffer['MESSAGE2SEND4JPU'] = message2copyimagetobuffersend4jpu
response2manouvre4copyimagetobuffer['STATE2MANOEUVRE4JPU'] = state2copyimagetobuffer4jpu
message2print = "{(Step 33/33) returning" + "; response2manouvre4copyimagetobuffer-returning-by-manoeuvre2copyimagetobuffer4jpu: " + str(response2manouvre4copyimagetobuffer) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1 {'MESSAGE2SEND4JPU': 'roger2copyimagetobuffer4jpu',
# 'ACK2INFO4JPU': False,
# 'MESSAGE2GET4JPU': 'default2copyimagetobuffer4jpu',
# 'MESSAGE2RECEIVE4JPU': 'copy2copyimagetobuffer4jpu',
# 'CODE2ACK4JPU': ' 0D-1C-',
# 'MESSAGE2PUT4JPU': 'default2copyimagetobuffer4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 1}; time: 02:00:20 10/04/11 Pacific Daylight Time}
#2 {'MESSAGE2SEND4JPU': 'ready2copyimagetobuffer4jpu',
# 'ACK2INFO4JPU': False,
# 'MESSAGE2GET4JPU': 'default2copyimagetobuffer4jpu',
# 'MESSAGE2RECEIVE4JPU': 'ready2copyimagetobuffer4jpu',
# 'CODE2ACK4JPU': ' 0D-2C-',
# 'MESSAGE2PUT4JPU': 'default2copyimagetobuffer4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 2}; time: 02:10:33 10/04/11 Pacific Daylight Time}
#3 {'MESSAGE2SEND4JPU': 'ack2imageinfo4jpu',
# 'ACK2INFO4JPU': True,
# 'MESSAGE2GET4JPU': 'default2copyimagetobuffer4jpu',
# 'MESSAGE2RECEIVE4JPU': 'ready2copyimagetobuffer4jpu',
# 'CODE2ACK4JPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4JPU': 'default2copyimagetobuffer4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 3}; time: 02:10:33 10/04/11 Pacific Daylight Time}
#4 {'MESSAGE2SEND4JPU': 'default2copyimagetobuffer4jpu',
# 'ACK2INFO4JPU': False,
# 'MESSAGE2GET4JPU': 'default2copyimagetobuffer4jpu',
# 'MESSAGE2RECEIVE4JPU': 'default2copyimagetobuffer4jpu',
# 'CODE2ACK4JPU': ' 0D-',
# 'MESSAGE2PUT4JPU': 'default2copyimagetobuffer4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 0}; time: 02:10:33 10/04/11 Pacific Daylight Time}
return response2manouvre4copyimagetobuffer
#
# -----------------------------------------------------------------------------------------------------------------------
#roger2copybuffertoimage4jpu',
# # 'ACK2INFO4JPU': False,
# # 'MESSAGE2GET4JPU': 'default2copybuffertoimage4jpu',
# # 'MESSAGE2RECEIVE4JPU': 'copy2copybuffertoimage4jpu',
# # 'CODE2ACK4JPU': ' 0D-1C-',
# # 'MESSAGE2PUT4JPU': 'default2copybuffertoimage4jpu',
# # 'CODE2NACK4JPU': ' ',
# # 'STATE2MANOEUVRE4JPU': 1}
# except:
# print("(Step 82Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4JPU ", time4xi())
# else:
# pass # trust activated thread
#">
# -----------------------------------------------------------------------------------------------------------------------
def manoeuvre2copybuffertoimage4jpu(queue2copybuffertoimagemanoeuvre4jpu, consumerchannel2copybuffertoimagemanoeuvre4jpu, publisherchannel2copybuffertoimagemanoeuvre4jpu):
'''
manoeuvres copy control and command for copy2buffertoimage4jpu
'''
global state2copybuffertoimage4jpu # STATE FOR COMMAND AND CONTROL
global max2copybuffertoimagestate4jpu # MAX FOR STATE
global ack2copybuffertoimageinfo4jpu # ACK FOR IMAGE INFO
global message2copybuffertoimageget4jpu
global message2copybuffertoimageput4jpu
global message2copybuffertoimagereceive4jpu
global message2copybuffertoimagesend4jpu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2copybuffertoimage4jpu"
method2print = "manoeuvre2copybuffertoimage4jpu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2copybuffertoimage4jpu-started: " + str(manoeuvre2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 0B/33) passed" + "; queue2copybuffertoimagemanoeuvre4jpu-to-manoeuvre2copybuffertoimage4jpu: " + str(queue2copybuffertoimagemanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2copybuffertoimagemanoeuvre4jpu-to-manoeuvre2copybuffertoimage4jpu: " + str(consumerchannel2copybuffertoimagemanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0D/33) passed" + "; publisherchannel2copybuffertoimagemanoeuvre4jpu-to-manoeuvre2copybuffertoimage4jpu: " + str(publisherchannel2copybuffertoimagemanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4copybuffertoimage = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2copybuffertoimage4jpu-try-by-manoeuvre2copybuffertoimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2copybuffertoimage4jpu is None:
state2copybuffertoimage4jpu = 0
message2print = "{(Step 0F/33) initialized" + "; state2copybuffertoimage4jpu-initialized-by-manoeuvre2copybuffertoimage4jpu to: " + str(state2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2copybuffertoimage4jpu-used-by-manoeuvre2copybuffertoimage4jpu: " + str(state2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2copybuffertoimage4jpu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2copybuffertoimage4jpu-initialized-by-manoeuvre2copybuffertoimage4jpu to: " + str(state2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2copybuffertoimageinfo4jpu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2copybuffertoimageinfo4jpu-initialized-by-manoeuvre2copybuffertoimage4jpu to: " + str(ack2copybuffertoimageinfo4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2copybuffertoimageget4jpu = 'default2copybuffertoimage4jpu'
message2print = "{(Step 0Z3/33) initialized" + "; message2copybuffertoimageget4jpu-initialized-by-manoeuvre2copybuffertoimage4jpu to: " + str(message2copybuffertoimageget4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimageput4jpu = 'default2copybuffertoimage4jpu'
message2print = "{(Step 0Z4/33) initialized" + "; message2copybuffertoimageput4jpu-initialized-by-manoeuvre2copybuffertoimage4jpu to: " + str(message2copybuffertoimageput4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimagereceive4jpu = 'default2copybuffertoimage4jpu'
message2print = "{(Step 0Z5/33) initialized" + "; message2copybuffertoimagereceive4jpu-initialized-by-manoeuvre2copybuffertoimage4jpu to: " + str(message2copybuffertoimagereceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimagesend4jpu = 'default2copybuffertoimage4jpu'
message2print = "{(Step 0Z6/33) initialized" + "; message2copybuffertoimagesend4jpu-initialized-by-manoeuvre2copybuffertoimage4jpu to: " + str(message2copybuffertoimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
max2copybuffertoimagestate4jpu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2copybuffertoimagestate4jpu-initialized-by-manoeuvre2copybuffertoimage4jpu to: " + str( max2copybuffertoimagestate4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2copybuffertoimage4jpu = state2copybuffertoimage4jpu + 1
message2print = "{(Step 0H/33) added" + "; state2copybuffertoimage4jpu-added-by-manoeuvre2copybuffertoimage4jpu: " + str(state2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2copybuffertoimage4jpu > max2copybuffertoimagestate4jpu:
state2copybuffertoimage4jpu = 0
message2print = "{(Step 0I/33) set" + "; state2copybuffertoimage4jpu-set-by-manoeuvre2copybuffertoimage4jpu to: " + str(state2copybuffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack2copybuffertoimageinfo4jpu = False
message2print = "{(Step 0J/33) set" + "; ack2copybuffertoimageinfo4jpu-set-by-manoeuvre2copybuffertoimage4jpu to: " + str(ack2copybuffertoimageinfo4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimageget4jpu = 'default2copybuffertoimage4jpu'
message2print = "{(Step 0K/33) set" + "; message2copybuffertoimageget4jpu-set-by-manoeuvre2copybuffertoimage4jpu to: " + str(message2copybuffertoimageget4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimageput4jpu = 'default2copybuffertoimage4jpu'
message2print = "{(Step 0L/33) set" + "; message2copybuffertoimageput4jpu-set-by-manoeuvre2copybuffertoimage4jpu to: " + str(message2copybuffertoimageput4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimagereceive4jpu = 'default2copybuffertoimage4jpu'
message2print = "{(Step 0M/33) set" + "; message2copybuffertoimagereceive4jpu-set-by-manoeuvre2copybuffertoimage4jpu to: " + str(message2copybuffertoimagereceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimagesend4jpu = 'default2copybuffertoimage4jpu'
message2print = "{(Step 0N/33) set" + "; message2copybuffertoimagesend4jpu-set-by-manoeuvre2copybuffertoimage4jpu to: " + str(message2copybuffertoimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
max2copybuffertoimagestate4jpu = 3
message2print = "{(Step 0O/33) initialized" + "; max2copybuffertoimagestate4jpu-set-by-manoeuvre2copybuffertoimage4jpu to: " + str( max2copybuffertoimagestate4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2copybuffertoimage4jpu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2copybuffertoimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copybuffertoimagereceive4jpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copybuffertoimagereceive4jpu = consumerchannel2copybuffertoimagemanoeuvre4jpu.recv()
message2print = "{(Step 1B/33) received" + "; message2copybuffertoimagereceive4jpu-received-by-manoeuvre2copybuffertoimage4jpu: " + str(message2copybuffertoimagereceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2copybuffertoimagereceive4jpu == 'copy2copybuffertoimage4jpu':
message2copybuffertoimagesend4jpu = 'roger2copybuffertoimage4jpu'
else:
message2copybuffertoimagesend4jpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copybuffertoimagemanoeuvre4jpu.send(message2copybuffertoimagesend4jpu)
message2print = "{(Step 1C/33) sent" + "; message2copybuffertoimagesend4jpu-sent-by-manoeuvre2copybuffertoimage4jpu: " + str(message2copybuffertoimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2copybuffertoimagereceive4jpu-failed-by-manoeuvre2copybuffertoimage4jpu: " + str(message2copybuffertoimagereceive4jpu) + "; 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 state2copybuffertoimage4jpu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2copybuffertoimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copybuffertoimagereceive4jpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copybuffertoimagereceive4jpu = consumerchannel2copybuffertoimagemanoeuvre4jpu.recv()
message2print = "{(Step 2B/33) received" + "; message2copybuffertoimagereceive4jpu-received-by-manoeuvre2copybuffertoimage4jpu: " + str(message2copybuffertoimagereceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2copybuffertoimagereceive4jpu == 'ready2copybuffertoimage4jpu':
message2copybuffertoimagesend4jpu = 'ready2copybuffertoimage4jpu'
else:
message2copybuffertoimagesend4jpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND READY OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copybuffertoimagemanoeuvre4jpu.send(message2copybuffertoimagesend4jpu)
message2print = "{(Step 2C/33) sent" + "; message2copybuffertoimagesend4jpu-sent-by-manoeuvre2copybuffertoimage4jpu: " + str(message2copybuffertoimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2copybuffertoimagereceive4jpu-failed-by-manoeuvre2copybuffertoimage4jpu: " + str(message2copybuffertoimagereceive4jpu) + "; 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 state2copybuffertoimage4jpu == 3:
info2image4jpu = None
message2print = "{(Step 3A/70) try" + "; info2image4jpu-try-by-manoeuvre2copybuffertoimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4jpu = queue2copybuffertoimagemanoeuvre4jpu.get()
message2print = "{(Step 3B/33) got" + "; info2image4jpu-got-by-manoeuvre2copybuffertoimage4jpu: " + str(info2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ..//..//..//..//..//web//images//png//dragonxi.png
if info2image4jpu is None:
code2nack = code2nack + '3Z1-'
ack2copybuffertoimageinfo4jpu = False
else:
code2ack = code2ack + '3C-'
ack2copybuffertoimageinfo4jpu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2copybuffertoimagemanoeuvre4jpu-failed-by-manoeuvre2copybuffertoimage4jpu: " + str(queue2copybuffertoimagemanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2copybuffertoimagesend4jpu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2copybuffertoimageinfo4jpu is True:
message2copybuffertoimagesend4jpu = 'ack2imageinfo4jpu'
else:
message2copybuffertoimagesend4jpu = 'nack2imageinfo4jpu'
message2print = "{(Step 4B/33) set" + "; message2copybuffertoimagesend4jpu-set-by-manoeuvre2copybuffertoimage4jpu to: " + str(message2copybuffertoimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4jpu
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copybuffertoimagesend4jpu-failed-by-manoeuvre2copybuffertoimage4jpu: " + str(message2copybuffertoimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2copybuffertoimagemanoeuvre4jpu-calling-by-manoeuvre2copybuffertoimage4jpu: " + str(publisherchannel2copybuffertoimagemanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2copybuffertoimagesend4jpu-passing-to-send-by-manoeuvre2copybuffertoimage4jpu: " + str(message2copybuffertoimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copybuffertoimagesend4jpu-failed-by-manoeuvre2copybuffertoimage4jpu: " + str(message2copybuffertoimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2copybuffertoimagemanoeuvre4jpu.send(message2copybuffertoimagesend4jpu)
message2print = "{(Step 4E/33) sent" + "; message2copybuffertoimagesend4jpu-sent-by-manoeuvre2copybuffertoimage4jpu: " + str(message2copybuffertoimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4jpu
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2copybuffertoimagesend4jpu-failed-by-manoeuvre2copybuffertoimage4jpu: " + str(message2copybuffertoimagesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4copybuffertoimage['ACK2INFO4JPU'] = ack2copybuffertoimageinfo4jpu
response2manouvre4copybuffertoimage['CODE2ACK4JPU'] = code2ack
response2manouvre4copybuffertoimage['CODE2NACK4JPU'] = code2nack
response2manouvre4copybuffertoimage['MESSAGE2GET4JPU'] = message2copybuffertoimageget4jpu
response2manouvre4copybuffertoimage['MESSAGE2PUT4JPU'] = message2copybuffertoimageput4jpu
response2manouvre4copybuffertoimage['MESSAGE2RECEIVE4JPU'] = message2copybuffertoimagereceive4jpu
response2manouvre4copybuffertoimage['MESSAGE2SEND4JPU'] = message2copybuffertoimagesend4jpu
response2manouvre4copybuffertoimage['STATE2MANOEUVRE4JPU'] = state2copybuffertoimage4jpu
message2print = "{(Step 33/33) returning" + "; response2manouvre4copybuffertoimage-returning-by-manoeuvre2copybuffertoimage4jpu: " + str(response2manouvre4copybuffertoimage) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1 {'MESSAGE2SEND4JPU': 'roger2copybuffertoimage4jpu',
# 'ACK2INFO4JPU': False,
# 'MESSAGE2GET4JPU': 'default2copybuffertoimage4jpu',
# 'MESSAGE2RECEIVE4JPU': 'copy2copybuffertoimage4jpu',
# 'CODE2ACK4JPU': ' 0D-1C-',
# 'MESSAGE2PUT4JPU': 'default2copybuffertoimage4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 1}; time: 02:18:55 10/04/11 Pacific Daylight Time}
#2 {'MESSAGE2SEND4JPU': 'ready2copybuffertoimage4jpu',
# 'ACK2INFO4JPU': False,
# 'MESSAGE2GET4JPU': 'default2copybuffertoimage4jpu',
# 'MESSAGE2RECEIVE4JPU': 'ready2copybuffertoimage4jpu',
# 'CODE2ACK4JPU': ' 0D-2C-',
# 'MESSAGE2PUT4JPU': 'default2copybuffertoimage4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 2}; time: 02:18:55 10/04/11 Pacific Daylight Time}
#3 {'MESSAGE2SEND4JPU': 'ack2imageinfo4jpu',
# 'ACK2INFO4JPU': True,
# 'MESSAGE2GET4JPU': 'default2copybuffertoimage4jpu',
# 'MESSAGE2RECEIVE4JPU': 'ready2copybuffertoimage4jpu',
# 'CODE2ACK4JPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4JPU': 'default2copybuffertoimage4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 3}; time: 02:18:55 10/04/11 Pacific Daylight Time}
#4 {'MESSAGE2SEND4JPU': 'default2copybuffertoimage4jpu',
# 'ACK2INFO4JPU': False,
# 'MESSAGE2GET4JPU': 'default2copybuffertoimage4jpu',
# 'MESSAGE2RECEIVE4JPU': 'default2copybuffertoimage4jpu',
# 'CODE2ACK4JPU': ' 0D-',
# 'MESSAGE2PUT4JPU': 'default2copybuffertoimage4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 0}
return response2manouvre4copybuffertoimage
#
# -----------------------------------------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------------------------------------
def manoeuvre2readimage4jpu(queue2readmanoeuvre4jpu, consumerchannel2readmanoeuvre4jpu, publisherchannel2readmanoeuvre4jpu):
'''
manoeuvres read control and command
'''
global state2read4jpu # STATE FOR COMMAND AND CONTROL
global max2readstate4jpu # MAX FOR STATE
global ack2readinfo4jpu # ACK FOR IMAGE INFO
global message2readget4jpu
global message2readput4jpu
global message2readreceive4jpu
global message2readsend4jpu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2readimage4jpu"
method2print = "manoeuvre2readimage4jpu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2readimage4jpu-started: " + str(manoeuvre2readimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 0B/33) passed" + "; queue2readmanoeuvre4jpu-to-manoeuvre2readimage4jpu: " + str(queue2readmanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2readmanoeuvre4jpu-to-manoeuvre2readimage4jpu: " + str(consumerchannel2readmanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0D/33) passed" + "; publisherchannel2readmanoeuvre4jpu-to-manoeuvre2readimage4jpu: " + str(publisherchannel2readmanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4read = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2read4jpu-try-by-manoeuvre2readimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2read4jpu is None:
state2read4jpu = 0
message2print = "{(Step 0F/33) initialized" + "; state2read4jpu-initialized-by-manoeuvre2readimage4jpu to: " + str(state2read4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2read4jpu-used-by-manoeuvre2readimage4jpu: " + str(state2read4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2read4jpu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2read4jpu-initialized-by-manoeuvre2readimage4jpu to: " + str(state2read4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2readinfo4jpu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2readinfo4jpu-initialized-by-manoeuvre2readimage4jpu to: " + str(ack2readinfo4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2readget4jpu = 'default2read4jpu'
message2print = "{(Step 0Z3/33) initialized" + "; message2readget4jpu-initialized-by-manoeuvre2readimage4jpu to: " + str(message2readget4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4jpu
message2readput4jpu = 'default2read4jpu'
message2print = "{(Step 0Z4/33) initialized" + "; message2readput4jpu-initialized-by-manoeuvre2readimage4jpu to: " + str(message2readput4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4jpu
message2readreceive4jpu = 'default2read4jpu'
message2print = "{(Step 0Z5/33) initialized" + "; message2readreceive4jpu-initialized-by-manoeuvre2readimage4jpu to: " + str(message2readreceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4jpu
message2readsend4jpu = 'default2read4jpu'
message2print = "{(Step 0Z6/33) initialized" + "; message2readsend4jpu-initialized-by-manoeuvre2readimage4jpu to: " + str(message2readsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4jpu
max2readstate4jpu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2readstate4jpu-initialized-by-manoeuvre2readimage4jpu to: " + str( max2readstate4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2read4jpu = state2read4jpu + 1
message2print = "{(Step 0H/33) added" + "; state2read4jpu-added-by-manoeuvre2readimage4jpu: " + str(state2read4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2read4jpu > max2readstate4jpu:
state2read4jpu = 0
message2print = "{(Step 0I/33) set" + "; state2read4jpu-set-by-manoeuvre2readimage4jpu to: " + str(state2read4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2readinfo4jpu = False
message2print = "{(Step 0J/33) set" + "; ack2readinfo4jpu-set-by-manoeuvre2readimage4jpu to: " + str(ack2readinfo4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2readget4jpu = 'default2read4jpu'
message2print = "{(Step 0K/33) set" + "; message2readget4jpu-set-by-manoeuvre2readimage4jpu to: " + str(message2readget4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4jpu
message2readput4jpu = 'default2read4jpu'
message2print = "{(Step 0L/33) set" + "; message2readput4jpu-set-by-manoeuvre2readimage4jpu to: " + str(message2readput4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4jpu
message2readreceive4jpu = 'default2read4jpu'
message2print = "{(Step 0M/33) set" + "; message2readreceive4jpu-set-by-manoeuvre2readimage4jpu to: " + str(message2readreceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4jpu
message2readsend4jpu = 'default2read4jpu'
message2print = "{(Step 0N/33) set" + "; message2readsend4jpu-set-by-manoeuvre2readimage4jpu to: " + str(message2readsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4jpu
max2readstate4jpu = 3
message2print = "{(Step 0O/33) initialized" + "; max2readstate4jpu-set-by-manoeuvre2readimage4jpu to: " + str( max2readstate4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2read4jpu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2readimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2readreceive4jpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2readreceive4jpu = consumerchannel2readmanoeuvre4jpu.recv()
message2print = "{(Step 1B/33) received" + "; message2readreceive4jpu-received-by-manoeuvre2readimage4jpu: " + str(message2readreceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# copy2read4jpu
if message2readreceive4jpu == 'copy2read4jpu':
message2readsend4jpu = 'roger2read4jpu'
else:
message2readsend4jpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2readmanoeuvre4jpu.send(message2readsend4jpu)
message2print = "{(Step 1C/33) sent" + "; message2readsend4jpu-sent-by-manoeuvre2readimage4jpu: " + str(message2readsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# roger2read4jpu
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2readreceive4jpu-failed-by-manoeuvre2readimage4jpu: " + str(message2readreceive4jpu) + "; 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 state2read4jpu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2readimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2readreceive4jpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2readreceive4jpu = consumerchannel2readmanoeuvre4jpu.recv()
message2print = "{(Step 2B/33) received" + "; message2readreceive4jpu-received-by-manoeuvre2readimage4jpu: " + str(message2readreceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ready2read4jpu
if message2readreceive4jpu == 'ready2read4jpu':
message2readsend4jpu = 'ready2read4jpu'
else:
message2readsend4jpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2readmanoeuvre4jpu.send(message2readsend4jpu)
message2print = "{(Step 2C/33) sent" + "; message2readsend4jpu-sent-by-manoeuvre2readimage4jpu: " + str(message2readsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ready2read4jpu
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2readreceive4jpu-failed-by-manoeuvre2readimage4jpu: " + str(message2readreceive4jpu) + "; 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 state2read4jpu == 3:
info2image4jpu = None
message2print = "{(Step 3A/70) try" + "; info2image4jpu-try-by-manoeuvre2readimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4jpu = queue2readmanoeuvre4jpu.get()
message2print = "{(Step 3B/33) got" + "; info2image4jpu-got-by-manoeuvre2readimage4jpu: " + str(info2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ..//..//..//..//..//web//images//png//dragonxi.png
if info2image4jpu is None:
code2nack = code2nack + '3Z1-'
ack2readinfo4jpu = False
else:
code2ack = code2ack + '3C-'
ack2readinfo4jpu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2readmanoeuvre4jpu-failed-by-manoeuvre2readimage4jpu: " + str(queue2readmanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2readsend4jpu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2readinfo4jpu is True:
message2readsend4jpu = 'ack2imageinfo4jpu'
else:
message2readsend4jpu = 'nack2imageinfo4jpu'
message2print = "{(Step 4B/33) set" + "; message2readsend4jpu-set-by-manoeuvre2readimage4jpu to: " + str(message2readsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4jpu
except:
message2print = "{(Step 4Z1/33) failed" + "; message2readsend4jpu-failed-by-manoeuvre2readimage4jpu: " + str(message2readsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2readmanoeuvre4jpu-calling-by-manoeuvre2readimage4jpu: " + str(publisherchannel2readmanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2readsend4jpu-passing-to-send-by-manoeuvre2readimage4jpu: " + str(message2readsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2readsend4jpu-failed-by-manoeuvre2readimage4jpu: " + str(message2readsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2readmanoeuvre4jpu.send(message2readsend4jpu)
message2print = "{(Step 4E/33) sent" + "; message2readsend4jpu-sent-by-manoeuvre2readimage4jpu: " + str(message2readsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4jpu
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2readsend4jpu-failed-by-manoeuvre2readimage4jpu: " + str(message2readsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4read['ACK2INFO4JPU'] = ack2readinfo4jpu
response2manouvre4read['CODE2ACK4JPU'] = code2ack
response2manouvre4read['CODE2NACK4JPU'] = code2nack
response2manouvre4read['MESSAGE2GET4JPU'] = message2readget4jpu
response2manouvre4read['MESSAGE2PUT4JPU'] = message2readput4jpu
response2manouvre4read['MESSAGE2RECEIVE4JPU'] = message2readreceive4jpu
response2manouvre4read['MESSAGE2SEND4JPU'] = message2readsend4jpu
response2manouvre4read['STATE2MANOEUVRE4JPU'] = state2read4jpu
message2print = "{(Step 33/33) returning" + "; response2manouvre4read-returning-by-manoeuvre2readimage4jpu: " + str(response2manouvre4read) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1 {'MESSAGE2SEND4JPU': 'roger2read4jpu',
# 'ACK2INFO4JPU': False,
# 'MESSAGE2GET4JPU': 'default2read4jpu',
# 'MESSAGE2RECEIVE4JPU': 'copy2read4jpu',
# 'CODE2ACK4JPU': ' 0D-1C-',
# 'MESSAGE2PUT4JPU': 'default2read4jpu',
# 'CODE2NACK4JPU': ' ', 'STATE2MANOEUVRE4JPU': 1}; time: 01:44:40 09/29/11 Pacific Daylight Time}
#2 {'MESSAGE2SEND4JPU': 'ready2read4jpu',
# 'ACK2INFO4JPU': False,
# 'MESSAGE2GET4JPU': 'default2read4jpu',
# 'MESSAGE2RECEIVE4JPU': 'ready2read4jpu',
# 'CODE2ACK4JPU': ' 0D-2C-',
# 'MESSAGE2PUT4JPU': 'default2read4jpu',
# 'CODE2NACK4JPU': ' ', 'STATE2MANOEUVRE4JPU': 2}; time: 01:44:40 09/29/11 Pacific Daylight Time}
#3 {'MESSAGE2SEND4JPU': 'ack2imageinfo4jpu',
# 'ACK2INFO4JPU': True,
# 'MESSAGE2GET4JPU': 'default2read4jpu',
# 'MESSAGE2RECEIVE4JPU': 'ready2read4jpu',
# 'CODE2ACK4JPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4JPU': 'default2read4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 3}; time: 01:44:40 09/29/11 Pacific Daylight Time}
#4 {'MESSAGE2SEND4JPU': 'default2read4jpu',
# 'ACK2INFO4JPU': False,
# 'MESSAGE2GET4JPU': 'default2read4jpu',
# 'MESSAGE2RECEIVE4JPU': 'default2read4jpu',
# 'CODE2ACK4JPU': ' 0D-',
# 'MESSAGE2PUT4JPU': 'default2read4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 0}; time: 02:11:49 09/29/11 Pacific Daylight Time}
return response2manouvre4read
#
# -------------------------------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------------------------------
def manoeuvre2writeimage4jpu(queue2writemanoeuvre4jpu, consumerchannel2writemanoeuvre4jpu, publisherchannel2writemanoeuvre4jpu):
'''
manoeuvres control and command
'''
global state2write4jpu # STATE FOR COMMAND AND CONTROL
global max2writestate4jpu # MAX FOR STATE
global ack2writeinfo4jpu # ACK FOR IMAGE INFO
global message2writeget4jpu
global message2writeput4jpu
global message2writereceive4jpu
global message2writesend4jpu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2writeimage4jpu"
method2print = "manoeuvre2writeimage4jpu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2writeimage4jpu-started: " + str(manoeuvre2writeimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0B/33) passed" + "; queue2writemanoeuvre4jpu-to-manoeuvre2writeimage4jpu: " + str(queue2writemanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2writemanoeuvre4jpu-to-manoeuvre2writeimage4jpu: " + str(consumerchannel2writemanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# read-write PipeConnection, handle 568>
message2print = "{(Step 0D/33) passed" + "; publisherchannel2writemanoeuvre4jpu-to-manoeuvre2writeimage4jpu: " + str(publisherchannel2writemanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4write = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2write4jpu-try-by-manoeuvre2writeimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2write4jpu is None:
state2write4jpu = 0
message2print = "{(Step 0F/33) initialized" + "; state2write4jpu-initialized-by-manoeuvre2writeimage4jpu to: " + str(state2write4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2write4jpu-used-by-manoeuvre2writeimage4jpu: " + str(state2write4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2write4jpu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2write4jpu-initialized-by-manoeuvre2writeimage4jpu to: " + str(state2write4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2writeinfo4jpu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2writeinfo4jpu-initialized-by-manoeuvre2writeimage4jpu to: " + str(ack2writeinfo4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2writeget4jpu = 'default2write4jpu'
message2print = "{(Step 0Z3/33) initialized" + "; message2writeget4jpu-initialized-by-manoeuvre2writeimage4jpu to: " + str(message2writeget4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4jpu
message2writeput4jpu = 'default2write4jpu'
message2print = "{(Step 0Z4/33) initialized" + "; message2writeput4jpu-initialized-by-manoeuvre2writeimage4jpu to: " + str(message2writeput4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4jpu
message2writereceive4jpu = 'default2write4jpu'
message2print = "{(Step 0Z5/33) initialized" + "; message2writereceive4jpu-initialized-by-manoeuvre2writeimage4jpu to: " + str(message2writereceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4jpu
message2writesend4jpu = 'default2write4jpu'
message2print = "{(Step 0Z6/33) initialized" + "; message2writesend4jpu-initialized-by-manoeuvre2writeimage4jpu to: " + str(message2writesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4jpu
max2writestate4jpu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2writestate4jpu-initialized-by-manoeuvre2writeimage4jpu to: " + str( max2writestate4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2write4jpu = state2write4jpu + 1
message2print = "{(Step 0H/33) added" + "; state2write4jpu-added-by-manoeuvre2writeimage4jpu: " + str(state2write4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2write4jpu > max2writestate4jpu:
state2write4jpu = 0
message2print = "{(Step 0I/33) set" + "; state2write4jpu-set-by-manoeuvre2writeimage4jpu to: " + str(state2write4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2writeinfo4jpu = False
message2print = "{(Step 0J/33) set" + "; ack2writeinfo4jpu-set-by-manoeuvre2writeimage4jpu to: " + str(ack2writeinfo4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2writeget4jpu = 'default2write4jpu'
message2print = "{(Step 0K/33) set" + "; message2writeget4jpu-set-by-manoeuvre2writeimage4jpu to: " + str(message2writeget4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4jpu
message2writeput4jpu = 'default2write4jpu'
message2print = "{(Step 0L/33) set" + "; message2writeput4jpu-set-by-manoeuvre2writeimage4jpu to: " + str(message2writeput4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4jpu
message2writereceive4jpu = 'default2write4jpu'
message2print = "{(Step 0M/33) set" + "; message2writereceive4jpu-set-by-manoeuvre2writeimage4jpu to: " + str(message2writereceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4jpu
message2writesend4jpu = 'default2write4jpu'
message2print = "{(Step 0N/33) set" + "; message2writesend4jpu-set-by-manoeuvre2writeimage4jpu to: " + str(message2writesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4jpu
max2writestate4jpu = 3
message2print = "{(Step 0O/33) initialized" + "; max2writestate4jpu-set-by-manoeuvre2writeimage4jpu to: " + str( max2writestate4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2write4jpu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2writeimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2writereceive4jpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2writereceive4jpu = consumerchannel2writemanoeuvre4jpu.recv()
message2print = "{(Step 1B/33) received" + "; message2writereceive4jpu-received-by-manoeuvre2writeimage4jpu: " + str(message2writereceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# copy2write4jpu
if message2writereceive4jpu == 'copy2write4jpu':
message2writesend4jpu = 'roger2write4jpu'
else:
message2writesend4jpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2writemanoeuvre4jpu.send(message2writesend4jpu)
message2print = "{(Step 1C/33) sent" + "; message2writesend4jpu-sent-by-manoeuvre2writeimage4jpu: " + str(message2writesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# roger2write4jpu
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2writereceive4jpu-failed-by-manoeuvre2writeimage4jpu: " + str(message2writereceive4jpu) + "; 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 state2write4jpu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2writeimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2writereceive4jpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2writereceive4jpu = consumerchannel2writemanoeuvre4jpu.recv()
message2print = "{(Step 2B/33) received" + "; message2writereceive4jpu-received-by-manoeuvre2writeimage4jpu: " + str(message2writereceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ready2write4jpu
if message2writereceive4jpu == 'ready2write4jpu':
message2writesend4jpu = 'ready2write4jpu'
else:
message2writesend4jpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2writemanoeuvre4jpu.send(message2writesend4jpu)
message2print = "{(Step 2C/33) sent" + "; message2writesend4jpu-sent-by-manoeuvre2writeimage4jpu: " + str(message2writesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ready2write4jpu
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2writereceive4jpu-failed-by-manoeuvre2writeimage4jpu: " + str(message2writereceive4jpu) + "; 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 state2write4jpu == 3:
info2image4jpu = None
message2print = "{(Step 3A/70) try" + "; info2image4jpu-try-by-manoeuvre2writeimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4jpu = queue2writemanoeuvre4jpu.get()
message2print = "{(Step 3B/33) got" + "; info2image4jpu-got-by-manoeuvre2writeimage4jpu: " + str(info2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ..//..//..//..//..//web//images//png//dragonxi.png
if info2image4jpu is None:
code2nack = code2nack + '3Z1-'
ack2writeinfo4jpu = False
else:
code2ack = code2ack + '3C-'
ack2writeinfo4jpu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2writemanoeuvre4jpu-failed-by-manoeuvre2writeimage4jpu: " + str(queue2writemanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2writesend4jpu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2writeinfo4jpu is True:
message2writesend4jpu = 'ack2imageinfo4jpu'
else:
message2writesend4jpu = 'nack2imageinfo4jpu'
message2print = "{(Step 4B/33) set" + "; message2writesend4jpu-set-by-manoeuvre2writeimage4jpu to: " + str(message2writesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4jpu
except:
message2print = "{(Step 4Z1/33) failed" + "; message2writesend4jpu-failed-by-manoeuvre2writeimage4jpu: " + str(message2writesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2writemanoeuvre4jpu-calling-by-manoeuvre2writeimage4jpu: " + str(publisherchannel2writemanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2writesend4jpu-passing-to-send-by-manoeuvre2writeimage4jpu: " + str(message2writesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2writesend4jpu-failed-by-manoeuvre2writeimage4jpu: " + str(message2writesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2writemanoeuvre4jpu.send(message2writesend4jpu)
message2print = "{(Step 4E/33) sent" + "; message2writesend4jpu-sent-by-manoeuvre2writeimage4jpu: " + str(message2writesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4jpu
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2writesend4jpu-failed-by-manoeuvre2writeimage4jpu: " + str(message2writesend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4write['ACK2INFO4JPU'] = ack2writeinfo4jpu
response2manouvre4write['CODE2ACK4JPU'] = code2ack
response2manouvre4write['CODE2NACK4JPU'] = code2nack
response2manouvre4write['MESSAGE2GET4JPU'] = message2writeget4jpu
response2manouvre4write['MESSAGE2PUT4JPU'] = message2writeput4jpu
response2manouvre4write['MESSAGE2RECEIVE4JPU'] = message2writereceive4jpu
response2manouvre4write['MESSAGE2SEND4JPU'] = message2writesend4jpu
response2manouvre4write['STATE2MANOEUVRE4JPU'] = state2write4jpu
message2print = "{(Step 33/33) returning" + "; response2manouvre4write-returning-by-manoeuvre2writeimage4jpu: " + str(response2manouvre4write) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1
# {'MESSAGE2SEND4JPU': 'roger2write4jpu',
# 'ACK2INFO4JPU': False, 'MESSAGE2GET4JPU': 'default2write4jpu',
# 'MESSAGE2RECEIVE4JPU': 'copy2write4jpu',
# 'CODE2ACK4JPU': ' 0D-1C-',
# 'MESSAGE2PUT4JPU': 'default2write4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 1}; time: 00:11:53 10/03/11 Pacific Daylight Time}
#2
# {'MESSAGE2SEND4JPU': 'ready2write4jpu',
# 'ACK2INFO4JPU': False, 'MESSAGE2GET4JPU': 'default2write4jpu',
# 'MESSAGE2RECEIVE4JPU': 'ready2write4jpu',
# 'CODE2ACK4JPU': ' 0D-2C-',
# 'MESSAGE2PUT4JPU': 'default2write4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 2}; time: 00:11:53 10/03/11 Pacific Daylight Time}
#3
# {'MESSAGE2SEND4JPU': 'ack2imageinfo4jpu',
# 'ACK2INFO4JPU': True, 'MESSAGE2GET4JPU': 'default2write4jpu',
# 'MESSAGE2RECEIVE4JPU': 'ready2write4jpu',
# 'CODE2ACK4JPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4JPU': 'default2write4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 3}; time: 00:11:53 10/03/11 Pacific Daylight Time}
return response2manouvre4write
#
# -------------------------------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------------------------------
def manoeuvre2mapimage4jpu(queue2mapmanoeuvre4jpu, consumerchannel2mapmanoeuvre4jpu, publisherchannel2mapmanoeuvre4jpu):
'''
manoeuvres control and command
'''
global state2map4jpu # STATE FOR COMMAND AND CONTROL
global max2mapstate4jpu # MAX FOR STATE
global ack2mapinfo4jpu # ACK FOR IMAGE INFO
global message2mapget4jpu
global message2mapput4jpu
global message2mapreceive4jpu
global message2mapsend4jpu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2mapimage4jpu"
method2print = "manoeuvre2mapimage4jpu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2mapimage4jpu-started: " + str(manoeuvre2mapimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0B/33) passed" + "; queue2mapmanoeuvre4jpu-to-manoeuvre2mapimage4jpu: " + str(queue2mapmanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2mapmanoeuvre4jpu-to-manoeuvre2mapimage4jpu: " + str(consumerchannel2mapmanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0D/33) passed" + "; publisherchannel2mapmanoeuvre4jpu-to-manoeuvre2mapimage4jpu: " + str(publisherchannel2mapmanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4map = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2map4jpu-try-by-manoeuvre2mapimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2map4jpu is None:
state2map4jpu = 0
message2print = "{(Step 0F/33) initialized" + "; state2map4jpu-initialized-by-manoeuvre2mapimage4jpu to: " + str(state2map4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2map4jpu-used-by-manoeuvre2mapimage4jpu: " + str(state2map4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2map4jpu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2map4jpu-initialized-by-manoeuvre2mapimage4jpu to: " + str(state2map4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2mapinfo4jpu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2mapinfo4jpu-initialized-by-manoeuvre2mapimage4jpu to: " + str(ack2mapinfo4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2mapget4jpu = 'default2map4jpu'
message2print = "{(Step 0Z3/33) initialized" + "; message2mapget4jpu-initialized-by-manoeuvre2mapimage4jpu to: " + str(message2mapget4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4jpu
message2mapput4jpu = 'default2map4jpu'
message2print = "{(Step 0Z4/33) initialized" + "; message2mapput4jpu-initialized-by-manoeuvre2mapimage4jpu to: " + str(message2mapput4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4jpu
message2mapreceive4jpu = 'default2map4jpu'
message2print = "{(Step 0Z5/33) initialized" + "; message2mapreceive4jpu-initialized-by-manoeuvre2mapimage4jpu to: " + str(message2mapreceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4jpu
message2mapsend4jpu = 'default2map4jpu'
message2print = "{(Step 0Z6/33) initialized" + "; message2mapsend4jpu-initialized-by-manoeuvre2mapimage4jpu to: " + str(message2mapsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4jpu
max2mapstate4jpu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2mapstate4jpu-initialized-by-manoeuvre2mapimage4jpu to: " + str( max2mapstate4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2map4jpu = state2map4jpu + 1
message2print = "{(Step 0H/33) added" + "; state2map4jpu-added-by-manoeuvre2mapimage4jpu: " + str(state2map4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2map4jpu > max2mapstate4jpu:
state2map4jpu = 0
message2print = "{(Step 0I/33) set" + "; state2map4jpu-set-by-manoeuvre2mapimage4jpu to: " + str(state2map4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2mapinfo4jpu = False
message2print = "{(Step 0J/33) set" + "; ack2mapinfo4jpu-set-by-manoeuvre2mapimage4jpu to: " + str(ack2mapinfo4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2mapget4jpu = 'default2map4jpu'
message2print = "{(Step 0K/33) set" + "; message2mapget4jpu-set-by-manoeuvre2mapimage4jpu to: " + str(message2mapget4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4jpu
message2mapput4jpu = 'default2map4jpu'
message2print = "{(Step 0L/33) set" + "; message2mapput4jpu-set-by-manoeuvre2mapimage4jpu to: " + str(message2mapput4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4jpu
message2mapreceive4jpu = 'default2map4jpu'
message2print = "{(Step 0M/33) set" + "; message2mapreceive4jpu-set-by-manoeuvre2mapimage4jpu to: " + str(message2mapreceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4jpu
message2mapsend4jpu = 'default2map4jpu'
message2print = "{(Step 0N/33) set" + "; message2mapsend4jpu-set-by-manoeuvre2mapimage4jpu to: " + str(message2mapsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4jpu
max2mapstate4jpu = 3
message2print = "{(Step 0O/33) initialized" + "; max2mapstate4jpu-set-by-manoeuvre2mapimage4jpu to: " + str( max2mapstate4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2map4jpu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2mapimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2mapreceive4jpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2mapreceive4jpu = consumerchannel2mapmanoeuvre4jpu.recv()
message2print = "{(Step 1B/33) received" + "; message2mapreceive4jpu-received-by-manoeuvre2mapimage4jpu: " + str(message2mapreceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2mapreceive4jpu == 'copy2mapimage4jpu':
message2mapsend4jpu = 'roger2mapimage4jpu'
else:
message2mapsend4jpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2mapmanoeuvre4jpu.send(message2mapsend4jpu)
message2print = "{(Step 1C/33) sent" + "; message2mapsend4jpu-sent-by-manoeuvre2mapimage4jpu: " + str(message2mapsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2mapreceive4jpu-failed-by-manoeuvre2mapimage4jpu: " + str(message2mapreceive4jpu) + "; 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 state2map4jpu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2mapimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2mapreceive4jpu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2mapreceive4jpu = consumerchannel2mapmanoeuvre4jpu.recv()
message2print = "{(Step 2B/33) received" + "; message2mapreceive4jpu-received-by-manoeuvre2mapimage4jpu: " + str(message2mapreceive4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2mapreceive4jpu == 'ready2mapimage4jpu':
message2mapsend4jpu = 'ready2mapimage4jpu'
else:
message2mapsend4jpu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2mapmanoeuvre4jpu.send(message2mapsend4jpu)
message2print = "{(Step 2C/33) sent" + "; message2mapsend4jpu-sent-by-manoeuvre2mapimage4jpu: " + str(message2mapsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2mapreceive4jpu-failed-by-manoeuvre2mapimage4jpu: " + str(message2mapreceive4jpu) + "; 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 state2map4jpu == 3:
info2image4jpu = None
message2print = "{(Step 3A/70) try" + "; info2image4jpu-try-by-manoeuvre2mapimage4jpu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4jpu = queue2mapmanoeuvre4jpu.get()
message2print = "{(Step 3B/33) got" + "; info2image4jpu-got-by-manoeuvre2mapimage4jpu: " + str(info2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if info2image4jpu is None:
code2nack = code2nack + '3Z1-'
ack2mapinfo4jpu = False
else:
code2ack = code2ack + '3C-'
ack2mapinfo4jpu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2mapmanoeuvre4jpu-failed-by-manoeuvre2mapimage4jpu: " + str(queue2mapmanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2mapsend4jpu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2mapinfo4jpu is True:
message2mapsend4jpu = 'ack2imageinfo4jpu'
else:
message2mapsend4jpu = 'nack2imageinfo4jpu'
message2print = "{(Step 4B/33) set" + "; message2mapsend4jpu-set-by-manoeuvre2mapimage4jpu to: " + str(message2mapsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2mapsend4jpu-failed-by-manoeuvre2mapimage4jpu: " + str(message2mapsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2mapmanoeuvre4jpu-calling-by-manoeuvre2mapimage4jpu: " + str(publisherchannel2mapmanoeuvre4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2mapsend4jpu-passing-to-send-by-manoeuvre2mapimage4jpu: " + str(message2mapsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2mapsend4jpu-failed-by-manoeuvre2mapimage4jpu: " + str(message2mapsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2mapmanoeuvre4jpu.send(message2mapsend4jpu)
message2print = "{(Step 4E/33) sent" + "; message2mapsend4jpu-sent-by-manoeuvre2mapimage4jpu: " + str(message2mapsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2mapsend4jpu-failed-by-manoeuvre2mapimage4jpu: " + str(message2mapsend4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4map['ACK2INFO4JPU'] = ack2mapinfo4jpu
response2manouvre4map['CODE2ACK4JPU'] = code2ack
response2manouvre4map['CODE2NACK4JPU'] = code2nack
response2manouvre4map['MESSAGE2GET4JPU'] = message2mapget4jpu
response2manouvre4map['MESSAGE2PUT4JPU'] = message2mapput4jpu
response2manouvre4map['MESSAGE2RECEIVE4JPU'] = message2mapreceive4jpu
response2manouvre4map['MESSAGE2SEND4JPU'] = message2mapsend4jpu
response2manouvre4map['STATE2MANOEUVRE4JPU'] = state2map4jpu
message2print = "{(Step 33/33) returning" + "; response2manouvre4map-returning-by-manoeuvre2mapimage4jpu: " + str(response2manouvre4map) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1 {'MESSAGE2SEND4JPU': 'roger2mapimage4jpu',
# 'ACK2INFO4JPU': False,
# 'MESSAGE2GET4JPU': 'default2map4jpu',
# 'MESSAGE2RECEIVE4JPU': 'copy2mapimage4jpu',
# 'CODE2ACK4JPU': ' 0D-1C-',
# 'MESSAGE2PUT4JPU': 'default2map4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 1}
#2 {'MESSAGE2SEND4JPU': 'ready2mapimage4jpu',
# 'ACK2INFO4JPU': False,
# 'MESSAGE2GET4JPU': 'default2map4jpu',
# 'MESSAGE2RECEIVE4JPU': 'ready2mapimage4jpu',
# 'CODE2ACK4JPU': ' 0D-2C-',
# 'MESSAGE2PUT4JPU': 'default2map4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 2}; time: 06:49:48 10/04/11 Pacific Daylight Time}
#3 {'MESSAGE2SEND4JPU': 'ack2imageinfo4jpu',
# 'ACK2INFO4JPU': True,
# 'MESSAGE2GET4JPU': 'default2map4jpu',
# 'MESSAGE2RECEIVE4JPU': 'ready2mapimage4jpu',
# 'CODE2ACK4JPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4JPU': 'default2map4jpu',
# 'CODE2NACK4JPU': ' ',
# 'STATE2MANOEUVRE4JPU': 3}; time: 06:49:48 10/04/11 Pacific Daylight Time}
#4 {'MESSAGE2SEND4JPU': 'default2map4jpu',
# 'ACK2INFO4JPU': False,
# 'MESSAGE2GET4JPU': 'default2map4jpu',
# 'MESSAGE2RECEIVE4JPU': 'default2map4jpu',
# 'CODE2ACK4JPU': ' 0D-',
# 'MESSAGE2PUT4JPU': 'default2map4jpu',
# 'CODE2NACK4JPU': ' ', 'STATE2MANOEUVRE4JPU': 0}; time: 06:49:48 10/04/11 Pacific Daylight Time}
return response2manouvre4map
#
# -------------------------------------------------------------------------------------------------
#copy2write4jpu"
# channel2publish4jpu = response4write2image['PUBLISHERCHANNEL']
# channel2publish4jpu.send(message2writesend4jpu)
# print("(Step 17B/700) OF JPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4JPU: ", channel2publish4jpu, " MESSAGE2SEND4JPU: " , message2writesend4jpu)
# except:
# print('(Step 17Z1/700) OF JPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4JPU ', time4xi())
# # ------------------------------------------------------------------------------------------
# # (18) LET MANOEUVRE2IMAGE4JPU TO RECEIVE COPY AND AND SEND ROGER VIA PIPE
# # ------------------------------------------------------------------------------------------
# print("(Step 18C/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# try:
# response2manoeuvre4jpu = manoeuvre2readimage4jpu(queue2write4jpu, channel2consume4jpu, channel2publish4jpu)
# print("(Step 18D/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", manoeuvre2readimage4jpu)
# except:
# print("(Step 18Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# else:
# pass # trust activated thread
# # ---------------------------------------------------------------------------------------------
# # (19) RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------
# print('(Step 19A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4JPU ', time4xi())
# try:
# channel2consume4jpu = response4write2image['CONSUMERCHANNEL']
# message2writereceive4jpu = channel2consume4jpu.recv()
# print("(Step 19B/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel2consume4jpu, " CONTROL & COMMAND: ", message2writereceive4jpu)
# # roger2write4jpu
# except:
# print('(Step 19Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4JPU ', time4xi())
# # ---------------------------------------------------------------------------------------------------
# # (20) SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2IMAGE4JPU TO RECEIVE
# # ---------------------------------------------------------------------------------------------------
# print('(Step 20A/700) OF JPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4JPU ', time4xi())
# try:
# message2writesend4jpu = "write2write4jpu"
# channel2publish4jpu = response4write2image['PUBLISHERCHANNEL']
# channel2publish4jpu.send(message2writesend4jpu)
# print("(Step 20B/700) OF JPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4JPU: ", channel2publish4jpu, " MESSAGE2SEND4JPU: " , message2writesend4jpu)
# # write2write4jpu
# except:
# print('(Step 20Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4JPU ', time4xi())
# # -----------------------------------------------------------------------------------
# # (21) LET MANOEUVRE2IMAGE4JPU TO RECEIVE READY AND TO SEND READY
# # -----------------------------------------------------------------------------------
# print("(Step 21A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# try:
# response2manoeuvre4jpu = manoeuvre2readimage4jpu(queue2write4jpu, channel2consume4jpu, channel2publish4jpu)
# print("(Step 21B/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", manoeuvre2readimage4jpu)
# except:
# print("(Step 21Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# # ---------------------------------------------------------------------------------------
# # (22) RECEIVE CONTROL & COMMAND READY VIA PIPE
# # ---------------------------------------------------------------------------------------
# print('(Step 22A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4JPU ', time4xi())
# try:
# channel2consume4jpu = response4write2image['CONSUMERCHANNEL']
# message2writereceive4jpu = channel2consume4jpu.recv()
# print("(Step 22B/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel2consume4jpu, " CONTROL & COMMAND: ", message2writereceive4jpu)
# # write2write4jpu
# except:
# print('(Step 22Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4JPU ', time4xi())
# # -----------------------------------------------------------------------------------------
# # (24) PUT IMAGE PATH TO QUEUE
# # -----------------------------------------------------------------------------------------
# print("(Step 24A/700) OF JPU2IMAGE4XI5TEST - 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 JPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
# # ------------------------------------------------------------------------------------------------------
# # (25) LET MANOEUVRE2IMAGE4JPU TO GET FROM QUEUE AND TO SEND EITHER ACK OR NACK VIA PIPE
# # -------------------------------------------------------------------------------------------------------
# print("(Step 25A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# try:
# response2manoeuvre4jpu = manoeuvre2readimage4jpu(queue2write4jpu, channel2consume4jpu, channel2publish4jpu)
# print("(Step 25B/700) OF JPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", manoeuvre2readimage4jpu)
# except:
# print("(Step 25Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (26) RECEIVE ACK OR NACK ABOUT IMAGE OPERATION VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 26A/700) OF JPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2writereceive4jpu = channel2consume4jpu.recv()
# print("(Step 26D/700) OF JPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4JPU: ", channel2consume4jpu, " CONTROL & COMMAND: ", message2writereceive4jpu)
# # ack2imageinfo4jpu
# except:
# print('(Step 26Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# # -------------------------------------------------------------------------------------------------------
# # (27) LET MANOEUVRE2IMAGE4JPU GO TO STATE 0
# # -------------------------------------------------------------------------------------------------------
# print("(Step 27A/700) OF JPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
# try:
# response2manoeuvre4jpu = manoeuvre2readimage4jpu(queue2write4jpu, channel2consume4jpu, channel2publish4jpu)
# print("(Step 27B/700) OF JPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4JPU ", response2manoeuvre4jpu)
# except:
# print("(Step 27Z/700) OF JPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4JPU ", time4xi())
#">
# -------------------------------------------------------------------------------------------------
def write2image4jpu(task4imagewrite2jpu=None):
'''
writes 2D images for JPU
'''
global jpu2image4xi # 2D-IMAGES FOR JPU
global control2writeimage4jpu # COMMAND AND CONTROL FOR JPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "write2image4jpu"
method2print = "write2image4jpu"
message2print = "{(Step 1A/33) started" + "; write2image4jpu-started: " + str(write2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4imagewrite2jpu-to-write2image4jpu: " + str(task4imagewrite2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE JPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if jpu2image4xi is None:
jpu2image4xi = create2image4jpu() # INITIALIZE IMAGE FOR JPU
message2print = "{(Step 1C/70) created" + "; jpu2image4xi-created-by-write2image4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4jpu-skipped-by-write2image4jpu: " + str(write2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# create2image4jpu-skipped-by-write2image4jpu:
except:
try:
jpu2image4xi = create2image4jpu()
message2print = "{(Step 1E/70) set" + "; jpu2image4xi-set-by-write2image4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
jpu2image4xi = {}
message2print = "{(Step 1Z/70) yielded" + "; jpu2image4xi-yielded-by-write2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - CHECK PARAMETERS
# -----------------------------------------------------------------------------------------
try:
if task4imagewrite2jpu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR READ - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4imagewrite2jpu = {}
message2print = "{(Step 1A/70) initialized" + "; task4imagewrite2jpu-created-by-write2image4jpu to: " + str(task4imagewrite2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4jpu = trace2image4jpu # CALLBACK FUNCTION FOR JPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4jpu-created-by-write2image4jpu to: " + str(function2callback4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "write2image4jpu" # MODULE OF JPUIZED OPENCL MODULE
args2callback['METHOD'] = "write2image4jpu" # FUNCTION OF JPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; write2image4jpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR JPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-write2image4jpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; write2image4jpu-failed ; time: 02:32:29 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'write2image4jpu',
# 'METHOD': 'write2image4jpu'}; time: 02:32:29 10/05/11 Pacific Daylight Time}
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagewrite2jpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO JPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagewrite2jpu['FUNCTION2CALLBACK'] = function2callback4jpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4imagewrite2jpu-created-by-write2image4jpu to: " + str(task4imagewrite2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; write2image4jpu-failed ; time: 02:32:29 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'write2image4jpu',
# 'METHOD': 'write2image4jpu'}}; time: 02:32:29 10/05/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-write2image4jpu 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-write2image4jpu: " + 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-write2image4jpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4imagewrite2jpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2jpu = {}
message2print = "{(Step 3A/70) trying" + "; context2jpu-trying-by-write2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2jpu = get2context4jpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2jpu-got-by-write2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4jpu-failed ; time: 02:32:29 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4jpu', ...
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2jpu-failed-by-write2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4imagewrite2jpu ['CONTEXT'] = context2jpu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2jpu = {}
message2print = "{(Step 4A/70) trying" + "; device2jpu-trying-by-write2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2jpu = get2jpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2jpu-got-by-write2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'RESOLUTION2TIMER4PROFILING': 318, 'ID2PLATFORM': '0000000001509568' ...
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2jpu-failed-by-write2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4imagewrite2jpu ['DEVICE'] = device2jpu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2jpu = {}
message2print = "{(Step 5A/70) trying" + "; imageinfo2jpu-trying-by-write2image4jpu: " + str(imageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2jpu = get2imageinfo4jpu()
message2print = "{(Step 5B/70) got" + "; imageinfo2jpu-got-by-write2image4jpu: " + str(imageinfo2jpu) + "; 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; create2context4jpu-failed ; time: 02:32:29 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4jpu',
# 'METHOD': 'create2context4jpu'},
# '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" + "; imageinfo2jpu-failed-by-write2image4jpu: " + str(imageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4imagewrite2jpu ['IMAGE'] = imageinfo2jpu
# ---------------------------------------------------------------------------------------------
# (6) QUEUE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
queue2jpu = None
message2print = "{(Step 6A/70) trying" + "; queue2jpu-trying-by-write2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2jpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 6B/70) got" + "; queue2jpu-got-by-write2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; queue2jpu-failed-by-write2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4imagewrite2jpu ['QUEUE'] = queue2jpu
# ---------------------------------------------------------------------------------------------
# (7) PIPE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
pipe2jpu = None
message2print = "{(Step 7A/70) trying" + "; pipe2jpu-trying-by-write2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2jpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 7B/70) got" + "; pipe2jpu-got-by-write2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; pipe2jpu-failed-by-write2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4imagewrite2jpu ['PIPE'] = pipe2jpu
# ---------------------------------------------------------------------------------------------
# (8) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2jpu = {}
message2print = "{(Step 8A/70) trying" + "; commandqueueinfo2jpu-trying-by-write2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2jpu = get2commandqueueinfo4jpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 8B/70) got" + "; commandqueueinfo2jpu-got-by-write2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2commandqueue4jpu-failed ; time: 02:32:29 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4jpu',
# 'METHOD': 'create2commandqueue4jpu'},
# 'FUNCTION2CALLBACK': ...
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; commandqueueinfo2jpu-failed-by-write2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4imagewrite2jpu ['COMMANDQUEUE'] = commandqueueinfo2jpu
# ---------------------------------------------------------------------------------------------
# (9) BUFFER - AUTOMATIC BY JPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2jpu = {}
message2print = "{(Step 9A/70) trying" + "; bufferinfo2jpu-trying-by-write2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2jpu = get2bufferinfo4jpu() # SYSTEM CREATES BUFFER FOR JPU, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; bufferinfo2jpu-got-by-write2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4jpu-failed ; time: 02:32:28 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4jpu',
# 'METHOD': 'create2buffer4jpu'}, ...
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; bufferinfo2jpu-failed-by-write2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4imagewrite2jpu ['BUFFER'] = bufferinfo2jpu
# ---------------------------------------------------------------------------------------------
# (10) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2jpu = {}
message2print = "{(Step 10A/70) trying" + "; eventinfo2jpu-trying-by-write2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2jpu = get2eventinfo4jpu()
message2print = "{(Step 10B/70) got" + "; eventinfo2jpu-got-by-write2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2event4jpu-failed ; time: 02:32:28 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2event4jpu',
# 'METHOD': 'create2event4jpu'},
# 'FUNCTION2CALLBACK': , ...
code2ack = code2ack + '10B-'
except:
message2print = "{(Step 10Z/70) failed" + "; eventinfo2jpu-failed-by-write2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '10Z-'
task4imagewrite2jpu ['EVENT'] = eventinfo2jpu
# ---------------------------------------------------------------------------------------------
# (11) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2jpu = {}
message2print = "{(Step 11A/70) trying" + "; eventwaitlist2jpu-trying-by-write2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2jpu = {}
message2print = "{(Step 11B/70) set" + "; eventwaitlist2jpu-set-by-write2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; eventwaitlist2jpu-failed-by-write2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4imagewrite2jpu ['EVENTWAITLIST'] = eventwaitlist2jpu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2jpu = 0
message2print = "{(Step 12A/70) trying" + "; eventwaitlistquantity2jpu-trying-by-write2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2jpu.keys()
for key2event in keys2event:
eventwaitlistquantity2jpu = eventwaitlistquantity2jpu + 1
message2print = "{(Step 12B/70) set" + "; eventwaitlistquantity2jpu-set-by-write2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlistquantity2jpu-failed-by-write2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4imagewrite2jpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2jpu
# ---------------------------------------------------------------------------------------------
# (13) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2jpu = ' '
message2print = "{(Step 13A/70) trying" + "; blocking2jpu-trying-by-write2image4jpu: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2jpu = 'CL_FALSE' # the write command is non-blocking
message2print = "{(Step 13B/70) set" + "; blocking2jpu-set-by-write2image4jpu to: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# CL_FALSE
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; blocking2jpu-failed-by-write2image4jpu: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4imagewrite2jpu ['BLOCKING'] = blocking2jpu
# ---------------------------------------------------------------------------------------------
# (14) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2jpu = {}
message2print = "{(Step 14A/70) trying" + "; origin2jpu-trying-by-write2image4jpu: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2jpu['X'] = 0
origin2jpu['Y'] = 0
origin2jpu['Z'] = 0
message2print = "{(Step 14B/70) set" + "; origin2jpu-set-by-write2image4jpu to: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 0, 'X': 0, 'Z': 0}
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; origin2jpu-failed-by-write2image4jpu: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4imagewrite2jpu ['ORIGIN'] = origin2jpu
# ---------------------------------------------------------------------------------------------
# (15) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2jpu = {}
message2print = "{(Step 15A/70) trying" + "; region2jpu-trying-by-write2image4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2jpu['X'] = 160 # WIDTH IN PIXELS TO READ
region2jpu['Y'] = 90 # HEIGHT IN PIXELS TO READ
region2jpu['Z'] = 0 # DEPTH IN PIXELS TO READ
message2print = "{(Step 15B/70) set" + "; region2jpu-set-by-write2image4jpu to: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 90, 'X': 160, 'Z': 0}
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; region2jpu-failed-by-write2image4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '15Z-'
task4imagewrite2jpu ['REGION'] = region2jpu
# ---------------------------------------------------------------------------------------------
# (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.
height2jpu = 800
width2jpu = 800
rowpitch2jpu = 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" + "; rowpitch2jpu-trying-by-write2image4jpu: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2jpu = int(width2jpu * 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" + "; rowpitch2jpu-set-by-write2image4jpu to: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; rowpitch2jpu-failed-by-write2image4jpu: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '16Z-'
task4imagewrite2jpu ['ROWPITCH'] = rowpitch2jpu
# ----------------------------------------------------------------------------------------------------
# (17) POINTER - REQUIRED - THE POINTER TO A BUFFER IN HOST MEMORY WHERE IMAGE DATA IS TO BE READ FROM
# ----------------------------------------------------------------------------------------------------
pointer2jpu = None
size2jpu = int(width2jpu * height2jpu) # CALCULATED MEMORY
if size2jpu == 0:
size2jpu = 4400 # MINIMUM MEMORY
message2print = "{(Step 17A/70) trying" + "; pointer2jpu-trying-by-write2image4jpu: " + str(pointer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
arena2jpu = Arena4Xi(size2jpu) # SYSTEM RESERVER MEMORY FOR IMAGE
message2print = "{(Step 17B/70) got" + "; arena2jpu-got-by-write2image4jpu: " + str(arena2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
size2arena = arena2jpu.size #
message2print = "{(Step 17C/70) got" + "; size2arena-got-by-write2buffer4jpu: " + str(size2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 640000
buffer2arena = arena2jpu.buffer
message2print = "{(Step 17D/70) got" + "; buffer2arena-got-by-write2buffer4jpu: " + str(buffer2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17D-'
if size2arena < size2jpu:
size2jpu = size2arena # AVAILABLE MEMORY FOR IMAGE
message2print = "{(Step 17E/70) set" + "; size2jpu-set-by-write2buffer4jpu to: " + str(size2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17E-'
else:
pass
pointer2jpu = buffer2arena
message2print = "{(Step 17F/70) set" + "; pointer2jpu-set-by-write2buffer4jpu to: " + str(pointer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17F-'
except:
message2print = "{(Step 17Z/70) failed" + "; pointer2jpu-failed-by-write2image4jpu: " + str(pointer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '17Z-'
task4imagewrite2jpu ['POINTER'] = pointer2jpu
task4imagewrite2jpu ['SIZE'] = size2jpu # AUTOMATIC BY JPUXI
# --------------------------------------------------------------------------------------------------------
# (18) SLICEPITCH - REQUIRED - THE SIZE IN BYTES OF THE 2D SLICE OF THE 3D REGION OF A 3D IMAGE BEING READ
# --------------------------------------------------------------------------------------------------------
slicepitch2jpu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 18A/70) trying" + "; slicepitch2jpu-trying-by-write2image4jpu: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2jpu = 0
message2print = "{(Step 18B/70) set" + "; slicepitch2jpu-set-by-write2image4jpu to: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '18B-'
except:
message2print = "{(Step 18Z/70) failed" + "; slicepitch2jpu-failed-by-write2image4jpu: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '18Z-'
task4imagewrite2jpu ['SLICEPITCH'] = slicepitch2jpu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
else:
pass
# ---------------------------------------------------------------------------------------------
# CHECK PARAMETERS - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4imagewrite2jpu.keys()
message2print = "{(Step 20/70) using" + "; keys2task-using-by-write2image4jpu: " + 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
# ---------------------------------------------------------------------------------------------
function2callback4jpu = trace2image4jpu # CALLBACK FUNCTION FOR JPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4jpu-created-by-write2image4jpu to: " + str(function2callback4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "write2image4jpu" # MODULE OF JPUIZED OPENCL MODULE
args2callback['METHOD'] = "write2image4jpu" # FUNCTION OF JPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; write2image4jpu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR JPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-write2image4jpu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagewrite2jpu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO JPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagewrite2jpu['FUNCTION2CALLBACK'] = function2callback4jpu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4imagewrite2jpu-created-by-write2image4jpu to: " + str(task4imagewrite2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-write2image4jpu 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-write2image4jpu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-write2image4jpu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4imagewrite2jpu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2jpu = {}
message2print = "{(Step 23A/70) trying" + "; context2jpu-trying-by-write2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2jpu = get2context4jpu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2jpu-got-by-write2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2jpu-failed-by-write2image4jpu: " + str(context2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4imagewrite2jpu ['CONTEXT'] = context2jpu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2jpu = {}
message2print = "{(Step 24A/70) trying" + "; device2jpu-trying-by-write2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2jpu = get2jpu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2jpu-got-by-write2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2jpu-failed-by-write2image4jpu: " + str(device2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4imagewrite2jpu ['DEVICE'] = device2jpu
if 'IMAGE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2jpu = {}
message2print = "{(Step 25A/70) trying" + "; imageinfo2jpu-trying-by-write2image4jpu: " + str(imageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2jpu = get2imageinfo4jpu()
message2print = "{(Step 25B/70) got" + "; imageinfo2jpu-got-by-write2image4jpu: " + str(imageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; imageinfo2jpu-failed-by-write2image4jpu: " + str(imageinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4imagewrite2jpu ['IMAGE'] = imageinfo2jpu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) QUEUE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
queue2jpu = None
message2print = "{(Step 26A/70) trying" + "; queue2jpu-trying-by-write2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2jpu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 26B/70) got" + "; queue2jpu-got-by-write2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; queue2jpu-failed-by-write2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4imagewrite2jpu ['QUEUE'] = queue2jpu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) PIPE - REQUIRED BY JPUXI
# ---------------------------------------------------------------------------------------------
pipe2jpu = None
message2print = "{(Step 27A/70) trying" + "; pipe2jpu-trying-by-write2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2jpu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 27B/70) got" + "; pipe2jpu-got-by-write2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; pipe2jpu-failed-by-write2image4jpu: " + str(pipe2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4imagewrite2jpu ['PIPE'] = pipe2jpu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2jpu = {}
message2print = "{(Step 28A/70) trying" + "; commandqueueinfo2jpu-trying-by-write2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2jpu = get2commandqueueinfo4jpu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 28B/70) got" + "; commandqueueinfo2jpu-got-by-write2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; commandqueueinfo2jpu-failed-by-write2image4jpu: " + str(commandqueueinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4imagewrite2jpu ['COMMANDQUEUE'] = commandqueueinfo2jpu
if 'BUFFER' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (29) BUFFER - AUTOMATIC BY JPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2jpu = {}
message2print = "{(Step 29A/70) trying" + "; bufferinfo2jpu-trying-by-write2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2jpu = get2bufferinfo4jpu() # SYSTEM CREATES BUFFER FOR JPU, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; bufferinfo2jpu-got-by-write2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; bufferinfo2jpu-failed-by-write2image4jpu: " + str(bufferinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4imagewrite2jpu ['BUFFER'] = bufferinfo2jpu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (30) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2jpu = {}
message2print = "{(Step 30A/70) trying" + "; eventinfo2jpu-trying-by-write2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2jpu = get2eventinfo4jpu()
message2print = "{(Step 30B/70) got" + "; eventinfo2jpu-got-by-write2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '30B-'
except:
message2print = "{(Step 30Z/70) failed" + "; eventinfo2jpu-failed-by-write2image4jpu: " + str(eventinfo2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '30Z-'
task4imagewrite2jpu ['EVENT'] = eventinfo2jpu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2jpu = {}
message2print = "{(Step 31A/70) trying" + "; eventwaitlist2jpu-trying-by-write2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2jpu = {}
message2print = "{(Step 31B/70) set" + "; eventwaitlist2jpu-set-by-write2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventwaitlist2jpu-failed-by-write2image4jpu: " + str(eventwaitlist2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4imagewrite2jpu ['EVENTWAITLIST'] = eventwaitlist2jpu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2jpu = 0
message2print = "{(Step 32A/70) trying" + "; eventwaitlistquantity2jpu-trying-by-write2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2jpu.keys()
for key2event in keys2event:
eventwaitlistquantity2jpu = eventwaitlistquantity2jpu + 1
message2print = "{(Step 32B/70) set" + "; eventwaitlistquantity2jpu-set-by-write2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlistquantity2jpu-failed-by-write2image4jpu: " + str(eventwaitlistquantity2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4imagewrite2jpu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2jpu
if 'BLOCKING' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2jpu = ' '
message2print = "{(Step 33A/70) trying" + "; blocking2jpu-trying-by-write2image4jpu: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2jpu = 'CL_FALSE' # the write command is non-blocking
message2print = "{(Step 33B/70) set" + "; blocking2jpu-set-by-write2image4jpu to: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; blocking2jpu-failed-by-write2image4jpu: " + str(blocking2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4imagewrite2jpu ['BLOCKING'] = blocking2jpu
if 'ORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2jpu = {}
message2print = "{(Step 34A/70) trying" + "; origin2jpu-trying-by-write2image4jpu: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2jpu['X'] = 0
origin2jpu['Y'] = 0
origin2jpu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; origin2jpu-set-by-write2image4jpu to: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; origin2jpu-failed-by-write2image4jpu: " + str(origin2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4imagewrite2jpu ['ORIGIN'] = origin2jpu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (35) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2jpu = {}
message2print = "{(Step 35A/70) trying" + "; region2jpu-trying-by-write2image4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2jpu['X'] = 160 # WIDTH IN PIXELS TO WRITE
region2jpu['Y'] = 90 # HEIGHT IN PIXELS TO WRITE
region2jpu['Z'] = 0 # DEPTH IN PIXELS TO WRITE
message2print = "{(Step 35B/70) set" + "; region2jpu-set-by-write2image4jpu to: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '35B-'
except:
message2print = "{(Step 35Z/70) failed" + "; region2jpu-failed-by-write2image4jpu: " + str(region2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '35Z-'
task4imagewrite2jpu ['REGION'] = region2jpu
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.
rowpitch2jpu = 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" + "; rowpitch2jpu-trying-by-write2image4jpu: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2jpu = int(width2jpu * 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" + "; rowpitch2jpu-set-by-write2image4jpu to: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; rowpitch2jpu-failed-by-write2image4jpu: " + str(rowpitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '36Z-'
task4imagewrite2jpu ['ROWPITCH'] = rowpitch2jpu
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
# ----------------------------------------------------------------------------------------------------
pointer2jpu = None
size2jpu = int(width2jpu * height2jpu) # CALCULATED MEMORY
if size2jpu == 0:
size2jpu = 4400 # MINIMUM MEMORY
message2print = "{(Step 37A/70) trying" + "; pointer2jpu-trying-by-write2image4jpu: " + str(pointer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
arena2jpu = Arena4Xi(size2jpu) # SYSTEM RESERVER MEMORY FOR IMAGE
message2print = "{(Step 37B/70) got" + "; arena2jpu-got-by-write2image4jpu: " + str(arena2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
size2arena = arena2jpu.size #
message2print = "{(Step 37C/70) got" + "; size2arena-got-by-write2buffer4jpu: " + str(size2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
buffer2arena = arena2jpu.buffer
message2print = "{(Step 37D/70) got" + "; buffer2arena-got-by-write2buffer4jpu: " + str(buffer2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37D-'
if size2arena < size2jpu:
size2jpu = size2arena # AVAILABLE MEMORY FOR IMAGE
message2print = "{(Step 37E/70) set" + "; size2jpu-set-by-write2buffer4jpu to: " + str(size2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37E-'
else:
pass
pointer2jpu = buffer2arena
message2print = "{(Step 37F/70) set" + "; pointer2jpu-set-by-write2buffer4jpu to: " + str(pointer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37F-'
except:
message2print = "{(Step 37Z/70) failed" + "; pointer2jpu-failed-by-write2image4jpu: " + str(pointer2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '37Z-'
task4imagewrite2jpu ['POINTER'] = pointer2jpu
task4imagewrite2jpu ['SIZE'] = size2jpu # AUTOMATIC BY JPUXI
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
# --------------------------------------------------------------------------------------------------------
slicepitch2jpu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 38A/70) trying" + "; slicepitch2jpu-trying-by-write2image4jpu: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2jpu = 0
message2print = "{(Step 38B/70) set" + "; slicepitch2jpu-set-by-write2image4jpu to: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '38B-'
except:
message2print = "{(Step 38Z/70) failed" + "; slicepitch2jpu-failed-by-write2image4jpu: " + str(slicepitch2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '38Z-'
task4imagewrite2jpu ['SLICEPITCH'] = slicepitch2jpu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER CHECKING AND PROVIDING FOR MISSING ONES
# ---------------------------------------------------------------------------------------------
keys2task = task4imagewrite2jpu.keys()
message2print = "{(Step 39/70) set" + "; keys2task-set-by-write2image4jpu 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" + "; task4imagewrite2jpu-yielded-by-write2image4jpu: " + str(task4imagewrite2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '39Z-'
# ---------------------------------------------------------------------------------------------
# CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
control2writeimage4jpu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2jpu = False
channels2jpu = ()
message2print = "{(Step 40A/70) trying" + "channels2jpu-trying-by-write2image4jpu: " + str(channels2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
#
consumerchannel2jpu, publisherchannel2jpu = task4imagewrite2jpu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2jpu-got-by-write2image4jpu: " + str(consumerchannel2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2jpu-got-by-write2image4jpu: " + str(publisherchannel2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2jpu = True
control2writeimage4jpu['CONSUMERCHANNEL'] = consumerchannel2jpu
control2writeimage4jpu['PUBLISHERCHANNEL'] = publisherchannel2jpu
code2ack = code2ack + '40D-'
except:
ack4channels2jpu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2jpu = False
queue2jpu = None
message2print = "{(Step 41A/70) trying" + "queue2jpu-trying-by-write2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2jpu = task4imagewrite2jpu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2jpu-got-by-write2image4jpu: " + str(queue2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2jpu = True
control2writeimage4jpu['QUEUE'] = queue2jpu
code2ack = code2ack + '41C-'
except:
ack4queue2jpu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4jpu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4jpu-trying-by-write2image4jpu: " + str(dummy2image4jpu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4jpu = DummyProcess4Xi(target=manoeuvre2readimage4jpu, # in this module to handle queue and pipe channels
# args =(queue2jpu, # caller puts and gets - does NOT call any functions
# consumerchannel2jpu, publisherchannel2jpu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4jpu-created-by-write2image4jpu: " + str(dummy2image4jpu) + "; 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-write2image4jpu: " + 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-write2image4jpu: " + str(code2nack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70C/70) returning" + "; control2writeimage4jpu-returning-by-write2image4jpu: " + str(control2writeimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 02:45:31 10/05/11 Pacific Daylight Time}
return control2writeimage4jpu
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def release2image4jpu(task4release2jpu=None):
'''
releases jpu2image4xi
'''
global jpu2image4xi
global code2ack
global code2nack
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "release2image4jpu"
method2print = "release2image4jpu"
message2print = "{(Step 1A/33) started" + "; release2image4jpu-started: " + str(release2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4release2jpu-to-release2image4jpu: " + str(task4release2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 1}
code2ack = ' '
code2nack = ' '
try:
if jpu2image4xi is None:
jpu2image4xi = create2image4jpu() # INITIALIZE IMAGE
except:
try:
jpu2image4xi = create2image4jpu()
except:
jpu2image4xi = {}
message2print = "{(Step 2Z0/70) yielded" + "; jpu2image4xi-yielded-by-release2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z0-'
message2print = "{(Step 1A/70) try" + "; release-try-by-release2image4jpu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
if task4release2jpu is None:
task4release2jpu = {}
task4release2jpu['COUNT2REFERENCE'] = 1
try:
# -----------------------------------------------------------------------------------------
# RELEASE
# -----------------------------------------------------------------------------------------
jpu2image4xi['COUNT2REFERENCE'] = jpu2image4xi['COUNT2REFERENCE'] - task4release2jpu['COUNT2REFERENCE']
message2print = "{(Step 1A/70) calculated" + "; count2reference-calculated-by-release2image4jpu: " + str(jpu2image4xi['COUNT2REFERENCE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if jpu2image4xi['COUNT2REFERENCE'] < 0:
jpu2image4xi['COUNT2REFERENCE'] = 0
message2print = "{(Step 1B/70) warning" + "; count2reference-warning-by-release2image4jpu: " + " ** " + str(jpu2image4xi['COUNT2REFERENCE']) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# { release2image4jpu : release2image4jpu ; (Step 8Z1/70) warning; count2reference-warning-by-release2image4jpu: ** 0 ** ; time: 23:41:37 09/06/11 Pacific Daylight Time}
code2nack = code2nack + '1B-'
else:
code2ack = code2ack + '1B-'
except:
try:
jpu2image4xi['COUNT2REFERENCE'] = 0
message2print = "{(Step 8Z1/70) warning" + "; count2reference-warning-by-release2image4jpu: " + " ** " + str(jpu2image4xi['COUNT2REFERENCE']) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '8Z1-'
except:
message2print = "{(Step 8Z2/70) yielded" + "; jpu2image4xi-yielded-by-release2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z2-'
# -----------------------------------------------------------------------------------------
# (Step 70/70)
# -----------------------------------------------------------------------------------------
jpu2image4xi ['ACK2RETURN'] = code2ack
jpu2image4xi ['NACK2RETURN'] = code2nack
message2print = "{(Step 70/70) returning" + "; jpu2image4xi-returning-by-release2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'ACK2RETURN': ' ',
# 'ROWPITCH': 800,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4jpu-failed ; time: 23:41:37 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4jpu',
# 'METHOD': 'create2image4jpu'},
# 'WIDTH': 800,
# 'BUFFER': {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4jpu-failed ; time: 23:41:37 09/06/11 Pacific Daylight Time}', 'CLASS': 'create2buffer4jpu', 'METHOD': 'create2buffer4jpu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0, 'CONTEXT': {'COUNT2REFERENCE': 0, ...
return jpu2image4xi
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def retain2image4jpu(task4retain2jpu=None):
'''
retains either jpu2image4xi
'''
global jpu2image4xi
global code2ack
global code2nack
# -----------------------------------------------------------------------------------------
# (Step 1/70) - PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "retain2image4jpu"
method2print = "retain2image4jpu"
message2print = "{(Step 1A/33) started" + "; retain2image4jpu-started: " + str(retain2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4retain2jpu-to-retain2image4jpu: " + str(task4retain2jpu) + "; 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 task4retain2jpu is None:
task4retain2jpu = {}
task4retain2jpu['DIMENSION'] = 2
task4retain2jpu['COUNT2REFERENCE'] = 1
message2print = "{(Step 2A/33) set" + "; task4retain2jpu-set-by-retain2image4jpu to: " + str(task4retain2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
pass
if 'DIMENSION' in task4retain2jpu.keys():
if task4retain2jpu['DIMENSION'] == 2:
pass
else:
task4retain2jpu['DIMENSION'] = 2
message2print = "{(Step 2B/33) set" + "; dimension-set-by-retain2image4jpu to: " + str(task4retain2jpu['DIMENSION']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
task4retain2jpu['DIMENSION'] = 2
# -----------------------------------------------------------------------------------------
# (Step 3/70) - CHECK COUNT2REFERENCE
# -----------------------------------------------------------------------------------------
if 'COUNT2REFERENCE' in task4retain2jpu.keys():
pass
else:
task4retain2jpu['COUNT2REFERENCE'] = 1
message2print = "{(Step 3A/33) set" + "; count2reference-set-by-retain2image4jpu to: " + str(task4retain2jpu['COUNT2REFERENCE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if task4retain2jpu['COUNT2REFERENCE'] < 1:
task4retain2jpu['COUNT2REFERENCE'] = 1
message2print = "{(Step 3B/33) set" + "; count2reference-set-by-retain2image4jpu to: " + str(task4retain2jpu['COUNT2REFERENCE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 4/70) - INITIALIZE 2D IMAGE IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if jpu2image4xi is None:
jpu2image4xi = create2image4jpu()
message2print = "{(Step 4A/70) created" + "; jpu2image4xi-created-by-retain2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
except:
try:
jpu2image4xi = create2image4jpu()
message2print = "{(Step 4B/70) created" + "; jpu2image4xi-created-by-retain2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
except:
jpu2image4xi = {}
message2print = "{(Step 4Z/70) yielded" + "; jpu2image4xi-yielded-by-retain2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
# -----------------------------------------------------------------------------------------
# (Step 5/70) - RETAIN
# -----------------------------------------------------------------------------------------
try:
jpu2image4xi['COUNT2REFERENCE'] = jpu2image4xi['COUNT2REFERENCE'] + task4retain2jpu['COUNT2REFERENCE']
message2print = "{(Step 6A/70) calculated" + "; count2reference-calculated-by-retain2image4jpu: " + str(jpu2image4xi['COUNT2REFERENCE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if jpu2image4xi['COUNT2REFERENCE'] <= 0:
jpu2image4xi['COUNT2REFERENCE'] = 1
message2print = "{(Step 6Z1/70) warning" + "; count2reference-warning-by-retain2image4jpu: " + " ** " + str(jpu2image4xi['COUNT2REFERENCE']) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z1-'
else:
code2ack = code2ack + '6C-'
except:
try:
jpu2image4xi['COUNT2REFERENCE'] = 1
message2print = "{(Step 7Z1/70) warning" + "; count2reference-warning-by-retain2image4jpu: " + " ** " + str(jpu2image4xi['COUNT2REFERENCE']) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z1-'
except:
message2print = "{(Step 7Z2/70) yielded" + "; jpu2image4xi-yielded-by-retain2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z2-'
# -----------------------------------------------------------------------------------------
# (Step 70/70) - RETURN
# -----------------------------------------------------------------------------------------
jpu2image4xi ['ACK2RETURN'] = code2ack
jpu2image4xi ['NACK2RETURN'] = code2nack
message2print = "{(Step 70A/70) returning" + "; jpu2image4xi-returning-by-retain2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'ACK2RETURN': ' 6C-', 'ROWPITCH': 800, 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4jpu-failed ; time: 23:25:02 10/05/11 Pacific Daylight Time}', 'CLASS': 'create2image4jpu', 'METHOD': 'create2image4jpu'}, 'WIDTH': 800, 'BUFFER': {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0, ...
# 'COUNT2REFERENCE': 1,
# 'FLAGS': 0, 'CONTEXT': ...
return jpu2image4xi
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def get2imageinfo4jpu(task4getinfo2image=None):
'''
gets jpu2image4xi
'''
global jpu2image4xi
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "get2imageinfo4jpu"
method2print = "get2imageinfo4jpu"
message2print = "{(Step 0A/33) started" + "; get2imageinfo4jpu-started: " + str(get2imageinfo4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0A/33) passed" + "; task4getinfo2image-passed-to-get2imageinfo4jpu: " + 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}
image2jpu = {}
try:
if jpu2image4xi is None:
# -------------------------------------------------------------------------------------
# INITIALIZE 2D IMAGE FOR JPU
# -------------------------------------------------------------------------------------
image2jpu = create2image4jpu()
message2print = "{(Step 1B2/33) initialized" + "; image2jpu-initialized-by-get2imageinfo4jpu to: " + str(image2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1B2/33) using" + "; jpu2image4xi-using-by-get2imageinfo4jpu: " + str(jpu2image4xi) + "; 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; create2image4jpu-failed ; time: 09:05:31 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4jpu',
# 'METHOD': 'create2image4jpu'},
# 'WIDTH': 800,
# 'BUFFER': ...
# -------------------------------------------------------------------------------------
# RETURN THE WHOLE OR PART OF THE IMAGE INFO OF JPU
# -------------------------------------------------------------------------------------
dimension2xi = 0
if task4getinfo2image is None:
task4getinfo2image = {}
task4getinfo2image ['DIMENSION'] = 2
task4getinfo2image ['DOMAIN'] = 'ALL'
image2jpu = jpu2image4xi
message2print = "{(Step 1C/33) using" + "; image2jpu-got-by-get2imageinfo4jpu: " + str(image2jpu) + "; 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 = jpu2image4xi.keys()
for key2domain in keys2domain:
task4getinfo2image[key2domain] = jpu2image4xi[key2domain]
message2print = "{(Step 1C/33) using" + "; task4getinfo2image-using-by-get2imageinfo4jpu: " + 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-get2image4jpu: " + str(key2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# WIDTH; DIMENSION; HEIGHT
image2jpu [key2task] = jpu2image4xi[key2task]
message2print = "{(Step 2D2/33) set" + "; info-of-image2jpu-set-by-get2imageinfo4jpu to: " + str(image2jpu [key2task]) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800; 800
except:
message2print = "{(Step 2Z/70) yielded" + "; key2task-yielded-by-get2image4jpu: " + str(key2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# DIMENSION;
message2print = "{(Step 2Z2/70) using" + "; task4getinfo2image-using-by-get2image4jpu: " + str(task4getinfo2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 2Z3/70) using" + "; jpu2image4xi-using-by-get2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
try:
# -------------------------------------------------------------------------------------
# INITIALIZE
# -------------------------------------------------------------------------------------
image2jpu = create2image4jpu()
message2print = "{(Step 1F/33) initialized" + "; image2jpu-initialized-by-get2imageinfo4jpu to: " + str(image2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if task4getinfo2image is None:
image2jpu = jpu2image4xi
message2print = "{(Step 1G/33) got" + "; image2jpu-got-by-get2imageinfo4jpu: " + str(image2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
keys2task = task4getinfo2image.keys()
for key2task in keys2task:
try:
message2print = "{(Step HD2/33) using" + "; key2task-using-by-get2image4jpu: " + str(key2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
image2jpu [key2task] = jpu2image4xi[key2task]
message2print = "{(Step HD2/33) set" + "; info-of-image2jpu-set-by-get2imageinfo4jpu to: " + str(image2jpu [key2task]) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step HZ/70) yielded" + "; key2task-yielded-by-get2image4jpu: " + str(key2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
except:
image2jpu = {}
message2print = "{(Step 1Z3/70) yielded" + "; image2jpu-yielded-by-get2image4jpu: " + str(image2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 33/33) returning" + "; image2jpu-returning-by-get2imageinfo4jpu: " + str(image2jpu) + "; 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; create2image4jpu-failed ; time: 09:05:31 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4jpu',
# 'METHOD': 'create2image4jpu'},
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8',
# 'ORDER': 'CL_RGBA'},
# 'BUFFER': ...
# 3D ALL: {'PIPE': (, ),
# 'ROWPITCH': 800,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create3image4jpu-failed ; time: 09:05:31 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create3image4jpu',
# 'METHOD': 'create3image4jpu'},
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8',
# 'ORDER': 'CL_RGBA'},
# 'BUFFER': ....
# 'HEIGHT': 800,
# 'QUEUE': ,
# 'WIDTH': 800,
# 'DEPTH': 800,
# 'FLAGS': 0,
# 'CONTEXT': ...
return image2jpu
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def get2supportedimageformats4jpu(task4supportedimageformats2jpu=None):
'''
gets supported image formats for jpu
'''
global jpu2image4xi
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "get2supportedimageformats4jpu"
method2print = "get2supportedimageformats4jpu"
message2print = "{(Step 0A/33) started" + "; get2supportedimageformats4jpu-started: " + str(get2supportedimageformats4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0B/33) passed" + "; task4supportedimageformats2jpu-passed-to-get2supportedimageformats4jpu: " + str(task4supportedimageformats2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None; {'DIMENSION': 3}
if task4supportedimageformats2jpu is None:
task4supportedimageformats2jpu = {}
task4supportedimageformats2jpu['DIMENSION'] = 2 # 2D image is the default
dimension2xi = 2
try:
keys2supportedimageformats = task4supportedimageformats2jpu.keys()
if 'DIMENSION' in keys2supportedimageformats:
dimension2xi = task4supportedimageformats2jpu['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
supportedimageformats2jpu = {}
try:
if jpu2image4xi is None:
# -------------------------------------------------------------------------------------
# INITIALIZE
# -------------------------------------------------------------------------------------
image2jpu = create2image4jpu() # create jpu2image4xi
message2print = "{(Step 1B/33) initialized" + "; image2jpu-initialized-by-get2supportedimageformats4jpu to: " + str(image2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
pass
# -------------------------------------------------------------------------------------
# SUPPORTED IMAGE FORMATS FOR JPU
# -------------------------------------------------------------------------------------
supportedimageformats2jpu = jpu2image4xi['FORMAT']
message2print = "{(Step 1E/33) got" + "; supportedimageformats2jpu-got-by-get2supportedimageformats4jpu: " + str(supportedimageformats2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'}
except:
try:
# -------------------------------------------------------------------------------------
# INITIALIZE
# -------------------------------------------------------------------------------------
image2jpu = create2image4jpu()
message2print = "{(Step 1F1/33) initialized" + "; image2jpu-initialized-by-get2supportedimageformats4jpu to: " + str(image2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -------------------------------------------------------------------------------------
# SUPPORTED IMAGE FORMATS FOR JPU
# -------------------------------------------------------------------------------------
supportedimageformats2jpu = jpu2image4xi['FORMAT']
message2print = "{(Step 1H/33) got" + "; supportedimageformats2jpu-got-by-get2supportedimageformats4jpu: " + str(supportedimageformats2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z/70) yielded" + "; supportedimageformats2jpu-yielded-by-get2image4jpu: " + str(supportedimageformats2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 33/33) returning" + "; supportedimageformats2jpu-returning-by-get2supportedimageformats4jpu: " + str(supportedimageformats2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 2: {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'}
# 3: {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'}
return supportedimageformats2jpu
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def wait2image4jpu(task4wait2image=None):
'''
waits jpu2image4jpu
'''
global jpu2image4xi
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "wait2image4jpu"
method2print = "wait2image4jpu"
message2print = "{(Step 1A1/33) started" + "; wait2image4jpu-started: " + str(wait2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1A2/33) passed" + "; task4wait2image-passed-by-wait2image4jpu to: " + str(task4wait2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
if jpu2image4xi is None:
# -------------------------------------------------------------------------------------
# INITIALIZE - KEEP SYSTEM RUNNING
# -------------------------------------------------------------------------------------
jpu2image4xi = create2image4jpu()
message2print = "{(Step 1B/33) created" + "; jpu2image4xi-created-by-wait2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -------------------------------------------------------------------------------------
# WAIT
# -------------------------------------------------------------------------------------
queue2image4jpu = None
try:
queue2image4jpu = jpu2image4xi['QUEUE']
message2print = "{(Step 1C/33) got" + "; queue2image4jpu-got-by-wait2image4jpu to: " + str(queue2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z1/70) yielded" + "; jpu2xi-yielded-by-wait2image4jpu: " + str(jpu2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
size2image4jpu = 0
try:
size2image4jpu = queue2image4jpu.qsize()
message2print = "{(Step 1D/33) got" + "; size2image4jpu-got-by-wait2image4jpu to: " + str(size2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z2/70) yielded" + "; jpu2xi-yielded-by-wait2image4jpu: " + str(jpu2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
empty2image4jpu = True
try:
empty2image4jpu= queue2image4jpu.empty()
message2print = "{(Step 1E/33) got" + "; empty2image4jpu-got-by-wait2image4jpu to: " + str(empty2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z3/70) yielded" + "; empty2image4jpu-yielded-by-wait2image4jpu: " + str(empty2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
full2image4jpu = False
try:
full2image4jpu = queue2image4jpu.full()
message2print = "{(Step 1F/33) got" + "; full2image4jpu-got-by-wait2image4jpu to: " + str(full2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z4/70) yielded" + "; full2image4jpu-yielded-by-wait2image4jpu: " + str(full2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 1G/33) finished" + "; jpu2image4xi-finished-by-wait2image4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
# -------------------------------------------------------------------------------------
# USE THE EXISTING IMAGE FOR JPU
# -------------------------------------------------------------------------------------
message2print = "{(Step 1H/33) used" + "; jpu2image4xi-used-by-wait2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -------------------------------------------------------------------------------------
# WAIT
# -------------------------------------------------------------------------------------
queue2image4jpu = None
try:
queue2image4jpu = jpu2image4xi['QUEUE']
message2print = "{(Step 1I/33) got" + "; queue2image4jpu-got-by-wait2image4jpu to: " + str(queue2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z5/70) yielded" + "; jpu2xi-yielded-by-wait2image4jpu: " + str(jpu2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
if task4wait2image is None:
pass
else:
# -------------------------------------------------------------------------------------
# IMAGE GIVEN AS PARAMETER
# -------------------------------------------------------------------------------------
message2print = "{(Step 1J1/33) passed" + "; task4wait2image-passed-by-wait2image4jpu to: " + str(task4wait2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
queue2task = {}
try:
queue2task = task4wait2image ['QUEUE']
message2print = "{(Step 1J2/33) set" + "; queue2task-set-by-wait2image4jpu to: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z61/70) yielded" + "; queue2task-yielded-by-wait2image4jpu: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if queue2task == queue2image4jpu:
# -------------------------------------------------------------------------------------
# ACCEPTED - GIVEN QUEUE IS THE SAME
# -------------------------------------------------------------------------------------
message2print = "{(Step 1K/33) accepted" + "; queue2task-accepted-by-wait2image4jpu: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
try:
message2print = "{(Step 1L/33) warned" + "; queue2task-warned-by-wait2image4jpu: " + " ** " + str(queue2task) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1M/33) warned" + "; queue2image4jpu-warned-by-wait2image4jpu: " + " ** " + str(queue2image4jpu) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
pass
except:
message2print = "{(Step 1Z62/70) yielded" + "; queue2task-yielded-by-wait2image4jpu: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
size2queue4jpu = 0
try:
size2queue4jpu = queue2image4jpu.qsize()
message2print = "{(Step 1N1/33) got" + "; size2queue4jpu-got-by-wait2image4jpu to: " + str(size2queue4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
jpu2image4xi ['SIZE2QUEUE'] = size2queue4jpu
message2print = "{(Step 1N2/33) set" + "; size2queue4image-got-by-wait2image4jpu to: " + str(jpu2image4xi ['SIZE2QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z7/70) yielded" + "; size2queue4jpu-yielded-by-wait2image4jpu: " + str(size2queue4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
empty2queue4jpu = False
try:
empty2queue4jpu = queue2image4jpu.empty()
message2print = "{(Step 1O1/33) got" + "; empty2queue4jpu-got-by-wait2image4jpu to: " + str(empty2queue4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
jpu2image4xi ['EMPTY2QUEUE'] = empty2queue4jpu
message2print = "{(Step 1O2/33) set" + "; empty2queue4image-got-by-wait2image4jpu to: " + str(jpu2image4xi ['EMPTY2QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z8/70) yielded" + "; empty2queue4jpu-yielded-by-wait2image4jpu: " + str(empty2queue4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
full2queue4jpu = False
try:
full2queue4jpu = queue2image4jpu.full()
message2print = "{(Step 1P1/33) got" + "; full2queue4jpu-got-by-wait2image4jpu to: " + str(full2queue4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
jpu2image4xi ['FULL2QUEUE'] = full2queue4jpu
message2print = "{(Step 1P2/33) set" + "; full2queue4image-got-by-wait2image4jpu to: " + str(jpu2image4xi ['FULL2QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z9/70) yielded" + "; full2queue4jpu-yielded-by-wait2image4jpu: " + str(full2queue4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
state2queue4jpu = None
try:
state2queue4jpu = queue2image4jpu.__getstate__()
message2print = "{(Step 1P3/33) got" + "; state2queue4jpu-got-by-wait2image4jpu to: " + str(state2queue4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
jpu2image4xi ['STATE2QUEUE'] = state2queue4jpu
message2print = "{(Step 1P4/33) set" + "; state2queue4image-set-by-wait2image4jpu to: " + str(jpu2image4xi ['STATE2QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z10/70) yielded" + "; state2queue4jpu-yielded-by-wait2image4jpu: " + str(state2queue4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 1Q/33) finished" + "; jpu2image4xi-finished-by-wait2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
try:
# -------------------------------------------------------------------------------------
# INITIALIZE
# -------------------------------------------------------------------------------------
jpu2image4jpu = create2image4jpu()
message2print = "{(Step 1R/33) got" + "; jpu2image4xi-got-by-wait2image4jpu to: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -------------------------------------------------------------------------------------
# WAIT
# -------------------------------------------------------------------------------------
queue2image4jpu = None
try:
queue2image4jpu = jpu2image4xi['QUEUE']
message2print = "{(Step 1S/33) got" + "; queue2image4jpu-got-by-wait2image4jpu to: " + str(queue2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z10/70) yielded" + "; queue2image4jpu-yielded-by-wait2image4jpu: " + str(queue2image4jpu) + "; 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-wait2image4jpu to: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if queue2task == queue2image4jpu:
# -------------------------------------------------------------------------------------
# ACCEPTED - GIVEN QUEUE IS THE SAME
# -------------------------------------------------------------------------------------
message2print = "{(Step 1U/33) accepted" + "; queue2task-accepted-by-wait2image4jpu: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1X/33) warned" + "; queue2task-warned-by-wait2image4jpu: " + " ** " + str(queue2task) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1Y1/33) warned" + "; queue2image4jpu-warned-by-wait2image4jpu: " + " ** " + str(queue2image4jpu) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z11/70) yielded" + "; queue2task-yielded-by-wait2image4jpu: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
size2image4jpu = 0
try:
size2image4jpu = queue2image4jpu.qsize()
message2print = "{(Step 1Y2/33) got" + "; size2image4jpu-got-by-wait2image4jpu to: " + str(size2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z12/70) yielded" + "; size2image4jpu-yielded-by-wait2image4jpu: " + str(size2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
empty2image4jpu = True
try:
empty2image4jpu = queue2image4jpu.empty()
message2print = "{(Step 1Y3/33) got" + "; empty2image4jpu-got-by-wait2image4jpu to: " + str(empty2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z13/70) yielded" + "; jpu2xi-yielded-by-wait2image4jpu: " + str(jpu2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
full2image4jpu = False
try:
full2image4jpu= queue2image4jpu.full()
message2print = "{(Step 1Y4/33) got" + "; full2image4jpu-got-by-wait2image4jpu to: " + str(full2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z14/70) yielded" + "; full2image4jpu-yielded-by-wait2image4jpu: " + str(full2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 1Y5/33) finished" + "; jpu2image4xi-finished-by-wait2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
except:
jpu2image4jpu= {}
message2print = "{(Step 1Z15/70) yielded" + "; jpu2image4xi-yielded-by-wait2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 33/33) returning" + "; jpu2image4xi-returning-by-wait2image4jpu: " + str(jpu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'SIZE2QUEUE': 2147483646,
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8',
# 'ORDER': 'CL_RGBA'},
# 'QUEUE': ,
# 'WIDTH': 800,
# 'CONTEXT': ...
return jpu2image4xi
#
# =================================================================================================
#
# =================================================================================================
class JPU2Image4Xi(object):
'''
JPU2Image4Xi offers methods for JPU 2D images
'''
#
# ---------------------------------------------------------------------------------------------
# sharable class variables
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
# Public API of this class
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def __init__(self, task4imagecreate2jpu = None):
'''
_init__ method initializes JPU2Image4Xi
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "JPU2Image4Xi"
method2print = "__init__"
message2print = "{(Step 1A/33) started" + "; init-of-JPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 23:41:37 09/06/11 Pacific Daylight Time
message2print = "{(Step 1B/33) borning" + "; jpu2image2xi-of-JPU2Image4Xi-borning: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
message2print = "{(Step 1C/33) inheriting" + "; object-inheriting-by-jpu2image2xi-of-JPU2Image4Xi: " + str(object) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1D/33) sharing" + "; classvariable2jpu-sharing-by-jpu2image2xi-of-JPU2Image4Xi: " + str(JPU2Image4Xi.classvariable2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 4
message2print = "{(Step 1E/33) passed" + "; task4imagecreate2jpu-passed-to-init-of-JPU2Image4Xi: " + str(task4imagecreate2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4imagecreate2jpu-passing-to-create2image4jpu-by-init-of-JPU2Image4Xi: " + str(task4imagecreate2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
jpu2image2xi = create2image4jpu(task4imagecreate2jpu)
message2print = "{(Step 2B/33) performed" + "; create2image4jpu-performed-by-init-of-JPU2Image4Xi: " + str(create2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) activated" + "; jpu2image2xi-of-JPU2Image4Xi-activated: " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# { JPU2Image4Xi : __init__ ; (Step 3A/33) activated; jpu2image2xi-of-JPU2Image4Xi-activated: ; time: 00:14:05 09/07/11 Pacific Daylight Time}
message2print = "{(Step 3B/33) inherited" + "; object-inherited-by-jpu2image2xi-of-JPU2Image4Xi: " + str(object) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 3C/33) shared" + "; classvariable2jpu-shared-by-jpu2image2xi-of-JPU2Image4Xi: " + str(JPU2Image4Xi.classvariable2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 4
message2print = "{(Step 3D/33) returning" + "; init-of-JPU2Image4Xi-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 JPU2Image4Xi
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "JPU2Image4Xi"
method2print = "create2image"
message2print = "{(Step 1A/33) started" + "; create2image-of-JPU2Image4Xi-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-JPU2Image4Xi: " + str(task4image2create) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4image2create-passing-to-create2image4jpu-by-create2image-of-JPU2Image4Xi: " + str(task4image2create) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
jpu2image2xi = create2image4jpu(task4image2create)
message2print = "{(Step 2B/33) performed" + "; create2image4jpu-performed-by-create2image-of-JPU2Image4Xi: " + str(create2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3/33) returning" + "; jpu2image2xi-returning-by-create2image-of-JPU2Image4Xi: " + str(jpu2image2xi) + "; 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; create2image4jpu-failed ; time: 00:53:55 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4jpu',
# 'METHOD': 'create2image4jpu'},
# 'WIDTH': 800 ...
return jpu2image2xi
#
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def set2image(self, task4set2image = None):
'''
sets 2D image JPU objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "JPU2Image4Xi"
method2print = "set2image"
message2print = "{(Step 1A/33) started" + "; set2image-of-JPU2Image4Xi-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-JPU2Image4Xi: " + 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-set2image4jpu-by-set2image-of-JPU2Image4Xi: " + str(task4set2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'QUEUE': ,
# 'CONTEXT': {'COUNT2REFERENCE': 0 ...
jpu2image2xi = set2image4jpu(task4set2image)
message2print = "{(Step 2B/33) performed" + "; set2image4jpu-performed-by-set2image-of-JPU2Image4Xi: " + str(set2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; jpu2image2xi-returning-by-set2image-of-JPU2Image4Xi: " + str(jpu2image2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'ACK2RETURN': ' 23B-24B-25B-26B-27B-28B-',
# 'ROWPITCH': 800,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4jpu-failed ; time: 01:02:22 09/07/11 Pacific Daylight Time}', 'CLASS': 'create2image4jpu', 'METHOD': 'create2image4jpu'},
# 'WIDTH': 800,
# 'BUFFER': {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4jpu-failed ; time: 01:02:22 09/07/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4jpu',
# 'METHOD': 'create2buffer4jpu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0 ...
return jpu2image2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def get2imageinfo(self, task4getinfo2image=None):
'''
get2imageinfo method gets 2D objects of JPU2Image4Xi
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "JPU2Image4Xi"
method2print = "get2imageinfo"
message2print = "{(Step 1A/33) started" + "; get2imageinfo-of-JPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 00:14:05 09/07/11 Pacific Daylight Time
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
jpu2image2xi = get2imageinfo4jpu(task4getinfo2image)
message2print = "{(Step 2A/33) returning" + "; jpu2image2xi-returning-by-get2imageinfo-of-JPU2Image4Xi: " + str(jpu2image2xi) + "; 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; create2image4jpu-failed ; time: 00:14:05 09/07/11 Pacific Daylight Time}', 'CLASS': 'create2image4jpu', 'METHOD': 'create2image4jpu'},
# 'WIDTH': 800,
# 'BUFFER': {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4jpu-failed ; time: 00:14:05 09/07/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4jpu',
# 'METHOD': 'create2buffer4jpu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0, ...
# or when only two elemets required
# {'WIDTH': 800, 'HEIGHT': 800}
return jpu2image2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def get2supportedimageformats(self):
'''
get2supportedimageformats method gets supported imageformats by objects of JPU2Image4Xi
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "JPU2Image4Xi"
method2print = "get2supportedimageformats"
message2print = "{(Step 1A/33) started" + "; get2supportedimageformats-of-JPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:43:00 09/07/11 Pacific Daylight Time
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
supportedimageformats2jpu = get2supportedimageformats4jpu()
message2print = "{(Step 2A/33) returning" + "; supportedimageformats2jpu-returning-by-get2imageinfo-of-JPU2Image4Xi: " + str(supportedimageformats2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'}
return supportedimageformats2jpu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def read2image(self, task4read2image = None):
'''
reads JPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "JPU2Image4Xi"
method2print = "read2image"
message2print = "{(Step 1A/33) started" + "; read2image-of-JPU2Image4Xi-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-JPU2Image4Xi: " + str(task4read2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4read2image-passing-to-read2image4jpu-by-read2image-of-JPU2Image4Xi: " + str(task4read2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4readimage2jpu = read2image4jpu(task4read2image)
message2print = "{(Step 2B/33) performed" + "; read2image4jpu-performed-by-read2image-of-JPU2Image4Xi: " + str(read2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4readimage2jpu-returning-by-read2image-of-JPU2Image4Xi: " + str(response4readimage2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 00:20:02 10/05/11 Pacific Daylight Time}
return response4readimage2jpu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def map2image(self, task4map2image = None):
'''
maps JPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "JPU2Image4Xi"
method2print = "map2image"
message2print = "{(Step 1A/33) started" + "; map2image-of-JPU2Image4Xi-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-JPU2Image4Xi: " + str(task4map2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4map2image-passing-to-map2image4jpu-by-map2image-of-JPU2Image4Xi: " + str(task4map2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4mapimage2jpu = map2image4jpu(task4map2image)
message2print = "{(Step 2B/33) performed" + "; map2image4jpu-performed-by-map2image-of-JPU2Image4Xi: " + str(map2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4mapimage2jpu-returning-by-map2image-of-JPU2Image4Xi: " + str(response4mapimage2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return response4mapimage2jpu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def release2image(self, task4release2image = None):
'''
releases JPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "JPU2Image4Xi"
method2print = "release2image"
message2print = "{(Step 1A/33) started" + "; release2image-of-JPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1B/33) passed" + "; task4release2image-passed-to-release2image-of-JPU2Image4Xi: " + str(task4release2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4release2image-passing-to-release2image4jpu-by-release2image-of-JPU2Image4Xi: " + str(task4release2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
jpu2image2xi = release2image4jpu(task4release2image)
message2print = "{(Step 2B/33) performed" + "; release2image4jpu-performed-by-release2image-of-JPU2Image4Xi: " + str(release2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; jpu2image2xi-returning-by-release2image-of-JPU2Image4Xi: " + str(jpu2image2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
return jpu2image2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def retain2image(self, task4retain2image = None):
'''
retains JPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "JPU2Image4Xi"
method2print = "retain2image"
message2print = "{(Step 1A/33) started" + "; retain2image-of-JPU2Image4Xi-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-JPU2Image4Xi: " + str(task4retain2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 1}
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4retain-passing-to-retain2image4jpu-by-retain-of-JPU2Image4Xi: " + str(task4retain2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 1}
jpu2image2xi = retain2image4jpu(task4retain2image)
message2print = "{(Step 2B/33) performed" + "; retain2image4jpu-performed-by-retain2image-of-JPU2Image4Xi: " + str(retain2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; jpu2image2xi-returning-by-retain2image-of-JPU2Image4Xi: " + str(jpu2image2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'ACK2RETURN': ' 1D-',
# 'ROWPITCH': 800,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4jpu-failed ; time: 00:14:05 09/07/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4jpu',
# 'METHOD': 'create2image4jpu'},
# 'WIDTH': 800,
# 'BUFFER': {'CODE2ERROR': 0,
# ...
# 'COUNT2REFERENCE': 1,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0 ...
return jpu2image2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def wait2image(self, task4wait2image = None):
'''
waits JPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "JPU2Image4Xi"
method2print = "wait2image"
message2print = "{(Step 1A/33) started" + "; wait2image-of-JPU2Image4Xi-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-JPU2Image4Xi: " + str(task4wait2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4wait-passing-to-wait2image4jpu-by-wait2image-of-JPU2Image4Xi: " + str(task4wait2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
jpu2image2xi = wait2image4jpu(task4wait2image)
message2print = "{(Step 2B/33) performed" + "; wait2image4jpu-performed-by-wait2image-of-JPU2Image4Xi: " + str(wait2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# semaphore and lock analysis by multiprocessing4xi
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; jpu2image2xi-returning-by-wait2image-of-JPU2Image4Xi: " + str(jpu2image2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'SIZE2QUEUE': 2147483646,
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'},
# 'QUEUE': ,
# 'WIDTH': 800,
# 'CONTEXT': ...
return jpu2image2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def write2image(self, task4write2image = None):
'''
writes JPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "JPU2Image4Xi"
method2print = "write2image"
message2print = "{(Step 1A/33) started" + "; write2image-of-JPU2Image4Xi-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-JPU2Image4Xi: " + str(task4write2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4write2image-passing-to-write2image4jpu-by-write2image-of-JPU2Image4Xi: " + str(task4write2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4writeimage2jpu = write2image4jpu(task4write2image)
message2print = "{(Step 2B/33) performed" + "; write2image4jpu-performed-by-write2image-of-JPU2Image4Xi: " + str(write2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4writeimage2jpu-returning-by-write2image-of-JPU2Image4Xi: " + str(response4writeimage2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 02:45:31 10/05/11 Pacific Daylight Time}
return response4writeimage2jpu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def copy2image(self, task4copy2image = None):
'''
copies JPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "JPU2Image4Xi"
method2print = "copy2image"
message2print = "{(Step 1A/33) started" + "; copy2image-of-JPU2Image4Xi-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-JPU2Image4Xi: " + str(task4copy2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4copy2image-passing-to-copy2image4jpu-by-copy2image-of-JPU2Image4Xi: " + str(task4copy2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4copyimage2jpu = copy2image4jpu(task4copy2image)
message2print = "{(Step 2B/33) performed" + "; copy2image4jpu-performed-by-copy2image-of-JPU2Image4Xi: " + str(copy2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4copyimage2jpu-returning-by-copy2image-of-JPU2Image4Xi: " + str(response4copyimage2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return response4copyimage2jpu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def copy2imagetobuffer(self, task4copy2imagetobuffer = None):
'''
copies 2D images to buffer
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "JPU2Image4Xi"
method2print = "copy2imagetobuffer"
message2print = "{(Step 1A/33) started" + "; copy2imagetobuffer-of-JPU2Image4Xi-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-JPU2Image4Xi: " + str(task4copy2imagetobuffer) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4copy2imagetobuffer-passing-to-copy2imagetobuffer4jpu-by-copy2imagetobuffer-of-JPU2Image4Xi: " + str(task4copy2imagetobuffer) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4copyimage2jpu = copy2imagetobuffer4jpu(task4copy2imagetobuffer)
message2print = "{(Step 2B/33) performed" + "; copy2imagetobuffer4jpu-performed-by-copy2imagetobuffer-of-JPU2Image4Xi: " + str(copy2imagetobuffer4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4copyimage2jpu-returning-by-copy2imagetobuffer-of-JPU2Image4Xi: " + str(response4copyimage2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return response4copyimage2jpu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def copy2buffertoimage(self, task4copy2buffertoimage = None):
'''
copies 2D images to buffer
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "JPU2Image4Xi"
method2print = "copy2buffertoimage"
message2print = "{(Step 1A/33) started" + "; copy2buffertoimage-of-JPU2Image4Xi-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-JPU2Image4Xi: " + str(task4copy2buffertoimage) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4copy2buffertoimage-passing-to-copy2buffertoimage4jpu-by-copy2buffertoimage-of-JPU2Image4Xi: " + str(task4copy2buffertoimage) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4copyimage2jpu = copy2buffertoimage4jpu(task4copy2buffertoimage)
message2print = "{(Step 2B/33) performed" + "; copy2buffertoimage4jpu-performed-by-copy2buffertoimage-of-JPU2Image4Xi: " + str(copy2buffertoimage4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4copyimage2jpu-returning-by-copy2buffertoimage-of-JPU2Image4Xi: " + str(response4copyimage2jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return response4copyimage2jpu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def trace2image(self, task4trace2image = None):
'''
traces JPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "JPU2Image4Xi"
method2print = "trace2image"
message2print = "{(Step 1A/33) started" + "; trace2image-of-JPU2Image4Xi-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-JPU2Image4Xi: " + str(task4trace2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4trace2image-passing-to-trace2image4jpu-by-trace2image-of-JPU2Image4Xi: " + str(task4trace2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
trace2xi = trace2image4jpu(task4trace2image)
message2print = "{(Step 2B/33) performed" + "; trace2image4jpu-performed-by-trace2image-of-JPU2Image4Xi: " + str(trace2image4jpu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; trace2xi-returning-by-trace2image-of-JPU2Image4Xi: " + str(trace2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4jpu-failed {}; time: 01:05:20 09/08/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4jpu',
# 'METHOD': 'trace2image4jpu'}; time: 01:05:20 09/08/11 Pacific Daylight Time}
return trace2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def set2imagecallback(self, task4set2imagecallback = None):
'''
set2imagecallback of JPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "JPU2Image4Xi"
method2print = "set2imagecallback"
message2print = "{(Step 1A/33) started" + "; set2imagecallback-of-JPU2Image4Xi-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-JPU2Image4Xi: " + str(task4set2imagecallback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4set2imagecallback-passing-to-set2imagecallback -by-set2imagecallback-of-JPU2Image4Xi: " + str(task4set2imagecallback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
callback2jpu4image = {}
try:
callback2jpu4image = set2imagecallback4jpu (task4set2imagecallback)
message2print = "{(Step 2B/33) callback2jpu4image" + "; callback2jpu4image-set-by-set2imagecallback-of-JPU2Image4Xi to: " + str(callback2jpu4image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4A/33) failed" + "; callback2jpu4image-failed-by-set2imagecallback-of-JPU2Image4Xi: " + str(callback2jpu4image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; callback2jpu4image-returning-by-set2imagecallback-of-JPU2Image4Xi: " + str(callback2jpu4image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
return callback2jpu4image
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def sense(self):
'''
method sense: senses JPU2Image4Xi class objects
'''
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
class2print = 'JPU2Image4Xi'
method2print = 'sense'
message2print = "{(Step 1A/33) started" + "; sense-of-JPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:02:22 09/07/11 Pacific Daylight Time
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) sensing" + "; JPU2Image4Xi-sensing-by-sense-of-JPU2Image4Xi: " + str(JPU2Image4Xi) + "; 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-JPU2Image4Xi: " + str(kb2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'object': }
# -----------------------------------------------------------------------------------------
# add knowledge specific to this object
# format example: kb2xi['time2xi'] = time4xi() #adding time
# -----------------------------------------------------------------------------------------
try:
kb2xi['classvariable2jpu-of-JPU2Image4Xi'] = JPU2Image4Xi.classvariable2jpu
except:
message2print = "{(Step 4A/33) yielded" + "; kb2xi-yielded-by-sense-of-JPU2Image4Xi: " + str(kb2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 5A/33) sensed" + "; JPU2Image4Xi-sensed-by-sense-of-JPU2Image4Xi: " + str(JPU2Image4Xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 6A/33) returning" + "; kb2xi-returning-by-sense-of-JPU2Image4Xi: " + str(kb2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'object': , 'classvariable2jpu-of-JPU2Image4Xi': 4}
return kb2xi
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def reason(self):
'''
method reason: reasons JPU2Image4Xi class objects
'''
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
class2print = 'JPU2Image4Xi'
method2print = 'reason'
message2print = "{(Step 1A/33) started" + "; reason-of-JPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:02:22 09/07/11 Pacific Daylight Time
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) reasoning" + "; JPU2Image4Xi-reasoning-by-reason-of-JPU2Image4Xi: " + str(JPU2Image4Xi) + "; 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-JPU2Image4Xi: " + 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-JPU2Image4Xi'] = time4xi() #adding time
except:
message2print = "{(Step 4Z/33) yielded" + "; kb4xi-yielded-by-reason-of-JPU2Image4Xi: " + str(kb4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 5A/33) reasoned" + "; JPU2Image4Xi-reasoned-by-reason-of-JPU2Image4Xi: " + str(JPU2Image4Xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 6A/33) returning" + "; kb4xi-returning-by-reason-of-JPU2Image4Xi: " + str(kb4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'object-reason-object4xi': , 'time-reason-of-JPU2Image4Xi': '01:02:22 09/07/11 Pacific Daylight Time'}
return kb4xi
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def ace(self):
'''
method ace: aces JPU2Image4Xi class objects
'''
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
class2print = 'JPU2Image4Xi'
method2print = 'ace'
message2print = "{(Step 1A/33) started" + "; ace-of-JPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:02:22 09/07/11 Pacific Daylight Time
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) acing" + "; JPU2Image4Xi-acing-by-ace-of-JPU2Image4Xi: " + str(JPU2Image4Xi) + "; 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-JPU2Image4Xi: " + 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-JPU2Image4Xi'] = JPU2Image4Xi.classvariable2jpu
except:
message2print = "{(Step 4A/33) yielded" + "; kb8xi-yielded-by-ace-of-JPU2Image4Xi: " + str(kb8xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 5A/33) aced" + "; JPU2Image4Xi-aced-by-ace-of-JPU2Image4Xi: " + str(JPU2Image4Xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 6A/33) returning" + "; kb8xi-returning-by-ace-of-JPU2Image4Xi: " + str(kb8xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'cores-of-JPU2Image4Xi': 4, 'object8xi': }
return kb8xi
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
#
#
#
# -------------------------------------------------------------------------------------------------
# Recorded History
# -------------------------------------------------------------------------------------------------
#
#
# -------------------------------------------------------------------------------------------------
# to-be-done
# -------------------------------------------------------------------------------------------------
#
#
# -------------------------------------------------------------------------------------------------
# Legal Notice
# -------------------------------------------------------------------------------------------------
#
#