#
# =================================================================================================
#
#
#
#
#
# =================================================================================================
# -------------------------------------------------------------------------------------------------
# Public API
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# Standard Imports
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# Scope4Xi imports
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# Multiprocessing Imports
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# DragonXi imports
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# Global constants
# ------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
# Settings
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def trace2image4opu(task4trace2opu=None):
'''
creates callback to opu2image4xi
'''
global opu2trace4xi
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "trace2image4opu"
method2print = "trace2image4opu"
message2print = "{(Step 1A/33) started" + "; trace2image4opu-started: " + str(trace2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1B/33) passed" + "; task4trace2opu-to-trace2image4opu: " + str(task4trace2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
# None
code2ack = ' '
code2nack = ' '
opu2trace4xi = {} # INITIALIZES TO EMPTY DICTIONARY
if task4trace2opu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY OPUIZED CALLBACK !
# -----------------------------------------------------------------------------------------
task4trace2opu = {}
task4trace2opu['CLASS'] = "trace2image4opu" # OPUIZE ZPU TRACE!
task4trace2opu['METHOD'] = "trace2image4opu"
task4trace2opu['MESSAGE'] = "{(Step 2Z0/33) failed" + "; trace2image4opu-failed " + str(opu2trace4xi) + "; time: " + time4xi() + "}"
message2print = "{(Step 2A/33) set" + "; task4trace2opu-set-by-trace2image4opu to: " + str(task4trace2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4opu-failed {}; time: 08:14:33 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4opu',
# 'METHOD': 'trace2image4opu'}
# ; time: 08:14:33 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '2A-'
# -----------------------------------------------------------------------------------------
# PARAMETER GIVEN BY OPUIZED CALLBACK !
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) try" + "; task4trace2opu-try-by-trace2image4opu: " + str(task4trace2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# { trace2image4opu : trace2image4opu ; (Step 3A/33) try; task4trace2opu-try-by-trace2image4opu:
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4opu-failed {}; time: 08:14:33 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4opu',
# 'METHOD': 'trace2image4opu'}
# ; time: 08:14:33 09/06/11 Pacific Daylight Time}
try:
opu2trace4xi ['CLASS'] = task4trace2opu['CLASS'] # OPUIZE OPU TRACE!
opu2trace4xi ['METHOD'] = task4trace2opu['METHOD']
opu2trace4xi ['MESSAGE'] = task4trace2opu['MESSAGE']
message2print = "{(Step 3B/33) set" + "; opu2trace4xi-set-by-trace2image4opu to: " + str(opu2trace4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# { trace2image4opu : trace2image4opu ; (Step 3B/33) set; opu2trace4xi-set-by-trace2image4opu to:
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4opu-failed {}; time: 23:41:37 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4opu',
# 'METHOD': 'trace2image4opu'}
# ; time: 23:41:37 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z1/33) failed" + "; opu-trace-failed-by-trace2image4opu: " + str(task4trace2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
try:
# =================================
# SIMULATE OPU TRACE
# =================================
class2print = task4trace2opu['CLASS'] # OPUIZE OPU TRACE!
method2print = task4trace2opu['METHOD']
message2print = task4trace2opu['MESSAGE']
print4xi(class2print, method2print, message2print) # OPUIZED TRACE FOR OPENCL CALLBACK!
# { trace2image4opu : trace2image4opu ; (Step 2Z0/33) failed; trace2image4opu-failed {}; time: 23:41:37 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '3C-'
except:
class2print = "trace2image4opu" # SET TRACE BACK TO THIS FUNCTION!
method2print = "trace2image4opu"
message2print = "{(Step 3Z2/33) failed" + "; simulation-of-opu-trace-failed-by-trace2image4opu: " + str(task4trace2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z2-'
try:
# =================================
# NORMAL TRACE
# =================================
class2print = "trace2image4opu" # SET TRACE BACK TO THIS FUNCTION!
method2print = "trace2image4opu"
message2print = "{(Step 3D/33) performed" + "; opu-trace-performed-by-trace2image4opu: " + str(task4trace2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# { trace2image4opu : trace2image4opu ; (Step 3D/33) performed; opu-trace-performed-by-trace2image4opu:
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4opu-failed {}; time: 23:41:37 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4opu', 'METHOD': 'trace2image4opu'}; time: 23:41:37 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '3D-'
except:
message2print = "{(Step 3Z3/33) failed" + "; opu-trace-failed-by-trace2image4opu: " + str(task4trace2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z3-'
# -----------------------------------------------------------------------------------------
# (Step 33/3)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 33/33) returning" + "; opu2trace4xi-returning-by-trace2image4opu: " + str(opu2trace4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4opu-failed {}; time: 23:41:37 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4opu',
# 'METHOD': 'trace2image4opu'}; time: 23:41:37 09/06/11 Pacific Daylight Time}
return opu2trace4xi
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def set2imagecallback4opu(task4set2imagecallback=None):
'''
registers callback function to opu2image4xi
'''
global opu2image4xi
class2print = "set2imagecallback4opu"
method2print = "set2imagecallback4opu"
message2print = "{(Step 1A/70) started" + "; set2imagecallback4opu-started: " + str(set2imagecallback4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
opu2image4xi ['CALLBACK'] = trace2image4opu
message2print = "{(Step 1B/70) set callback2opu" + "; imagecallback4opu-set-by-set2imagecallback4opu: " + str(opu2image4xi ['CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1C/70) returning" + "; callback-of-opu2image4xi-returning-by-set2imagecallback4opu: " + str(opu2image4xi ['CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
return opu2image4xi ['CALLBACK']
except:
message2print = "{(Step 1Z1/70) failed" + "; callback2image-failed-by-set2imagecallback4opu: " + str(callback2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 1Z2/70) returning" + "; trace2image4opu-returning-by-set2imagecallback4opu: " + str(trace2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
return trace2image4opu
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def create2image4opu(task4imagecreate2opu=None):
'''
creates 2D image for OPU
'''
global opu2image4xi
# -----------------------------------------------------------------------------------------
# (Step 1/70) - CHECK PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "create2image4opu"
method2print = "create2image4opu"
message2print = "{(Step 1A/70) started" + "; create2image4opu-started: " + str(create2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1B/70) passed" + "; task4imagecreate2opu-to-create2image4opu: " + str(task4imagecreate2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
opu2image4xi = {} # INITIALIZES TO EMPTY DICTIONARY
try:
if task4imagecreate2opu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR CREATION - BUILD TASK TO OPU!
# -----------------------------------------------------------------------------------------
task4imagecreate2opu = {}
message2print = "{(Step 1C/70) initialized" + "; task4imagecreate2opu-created-by-create2image4opu to: " + str(task4imagecreate2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
function2callback4opu = trace2image4opu # CALLBACK FUNCTION FOR OPU
message2print = "{(Step 1D/70) initialized" + "; function2callback4opu-created-by-create2image4opu to: " + str(function2callback4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1D-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "create2image4opu" # MODULE OF OPUIZED OPENCL MODULE
args2callback['METHOD'] = "create2image4opu" # FUNCTION OF OPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; create2image4opu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR OPUIZED OPENCL TO RETURN
message2print = "{(Step 1E/70) initialized" + "; args2callback-created-by-create2image4opu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; create2image4opu-failed ; time: 00:54:15 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4opu',
# 'METHOD': 'create2image4opu'}; time: 00:54:15 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '1E-'
# ---------------------------------------------------------------------------------------------
# (1) CALLBACKS - EXTRA
# ---------------------------------------------------------------------------------------------
task4imagecreate2opu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO OPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagecreate2opu['FUNCTION2CALLBACK'] = function2callback4opu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '2C-'
message2print = "{(Step 1F/70) initialized" + "; task4imagecreate2opu-created-by-create2image4opu to: " + str(task4imagecreate2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4opu-failed ; time: 00:54:15 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4opu',
# 'METHOD': 'create2image4opu'}}; time: 00:54:15 09/06/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - EXTRA
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-create2image4opu 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-create2image4opu: " + 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-create2image4opu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4imagecreate2opu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - REQUIRED
# ---------------------------------------------------------------------------------------------
context2opu = {}
message2print = "{(Step 3A/70) trying" + "; context2opu-trying-by-create2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2opu = get2context4opu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2opu-got-by-create2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4opu-failed ; time: 00:54:15 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4opu',
# 'METHOD': 'create2context4opu'},
# '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" + "; context2opu-failed-by-create2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4imagecreate2opu ['CONTEXT'] = context2opu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - EXTRA
# ---------------------------------------------------------------------------------------------
device2opu = {}
message2print = "{(Step 4A/70) trying" + "; device2opu-trying-by-create2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2opu = get2opu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2opu-got-by-create2image4opu: " + str(device2opu) + "; 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_OPU',
# 'DENORMS2SINGLEPRECISION4FLOATINGPOINTCAPABILITY': 'ACK'}; time: 00:54:15 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2opu-failed-by-create2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4imagecreate2opu ['DEVICE'] = device2opu
# ---------------------------------------------------------------------------------------------
# (5) ERROR CODE - REQUIRED
# ---------------------------------------------------------------------------------------------
task4imagecreate2opu ['CODE2ERROR'] = 0
code2ack = code2ack + '5B-'
# ---------------------------------------------------------------------------------------------
# (6) QUEUE - EXTRA
# ---------------------------------------------------------------------------------------------
queue2opu = None
message2print = "{(Step 6A/70) trying" + "; queue2opu-trying-by-create2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2opu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 6B/70) got" + "; queue2opu-got-by-create2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; queue2opu-failed-by-create2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4imagecreate2opu ['QUEUE'] = queue2opu
# ---------------------------------------------------------------------------------------------
# (7) PIPE - EXTRA
# ---------------------------------------------------------------------------------------------
pipe2opu = None
message2print = "{(Step 7A/70) trying" + "; pipe2opu-trying-by-create2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2opu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 7B/70) got" + "; pipe2opu-got-by-create2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; pipe2opu-failed-by-create2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4imagecreate2opu ['PIPE'] = pipe2opu
# ---------------------------------------------------------------------------------------------
# (8) COMMAND QUEUE INFO - EXTRA
# ---------------------------------------------------------------------------------------------
commandqueueinfo2opu = {}
message2print = "{(Step 8A/70) trying" + "; commandqueueinfo2opu-trying-by-create2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2opu = get2commandqueueinfo4opu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 8B/70) got" + "; commandqueueinfo2opu-got-by-create2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2commandqueue4opu-failed ; time: 05:04:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4opu',
# 'METHOD': 'create2commandqueue4opu'},
# '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; create2context4opu-failed ; time: 05:04:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4opu',
# 'METHOD': 'create2context4opu'},
# '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" + "; commandqueueinfo2opu-failed-by-create2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4imagecreate2opu ['COMMANDQUEUE'] = commandqueueinfo2opu
# ---------------------------------------------------------------------------------------------
# (9) BUFFER INFO - EXTRA
# ---------------------------------------------------------------------------------------------
bufferinfo2opu = {}
message2print = "{(Step 9A/70) trying" + "; bufferinfo2opu-trying-by-create2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2opu = get2bufferinfo4opu() # SYSTEM CREATES BUFFER FOR OPU, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; bufferinfo2opu-got-by-create2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4opu-failed ; time: 05:04:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4opu',
# 'METHOD': 'create2buffer4opu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4opu-failed ; time: 05:04:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4opu',
# 'METHOD': 'create2context4opu'},
# '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" + "; bufferinfo2opu-failed-by-create2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4imagecreate2opu ['BUFFER'] = bufferinfo2opu
# ---------------------------------------------------------------------------------------------
# (10) EVENT INFO - EXTRA
# ---------------------------------------------------------------------------------------------
eventinfo2opu = {}
message2print = "{(Step 10A/70) trying" + "; eventinfo2opu-trying-by-create2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2opu = get2eventinfo4opu() # SYSTEM CREATES EVENT IF NECESSAY
message2print = "{(Step 10B/70) got" + "; eventinfo2opu-got-by-create2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2event4opu-failed ; time: 05:10:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2event4opu',
# 'METHOD': 'create2event4opu'},
# '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; create2context4opu-failed ; time: 05:10:51 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4opu', 'METHOD': 'create2context4opu'},
# '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" + "; eventinfo2opu-failed-by-create2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '10Z-'
task4imagecreate2opu ['EVENT'] = eventinfo2opu
# ---------------------------------------------------------------------------------------------
# (11) FLAGS - REQUIRED
# ---------------------------------------------------------------------------------------------
flags2opu = 0
message2print = "{(Step 11A/70) trying" + "; flags2opu-trying-by-create2image4opu: " + str(flags2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
flags2opu = 0
message2print = "{(Step 11B/70) set" + "; flags2opu-set-by-create2image4opu to: " + str(flags2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; flags2opu-failed-by-create2image4opu: " + str(flags2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4imagecreate2opu ['FLAGS'] = flags2opu
# ---------------------------------------------------------------------------------------------
# (14) WIDTH - REQUIRED
# ---------------------------------------------------------------------------------------------
width2opu = 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" + "; width2opu-trying-by-create2image4opu: " + str(width2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
width2opu = int(width2layer * (quantity2core + quantity2skeleton + quantity2layers + quantity2frame + quantity2extra))
width2opu = 2 * width2opu # POS and NEG X 2*400 = 800 PIXELS
message2print = "{(Step 14B/70) set" + "; width2opu-set-by-create2image4opu to: " + str(width2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; width2opu-failed-by-create2image4opu: " + str(width2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4imagecreate2opu ['WIDTH'] = width2opu
# ---------------------------------------------------------------------------------------------
# (15) HEIGHT - REQUIRED
# ---------------------------------------------------------------------------------------------
height2opu = 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" + "; height2opu-trying-by-create2image4opu: " + str(height2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
height2opu = height2layer * quantity2total
height2opu = 2 * height2opu # POS and NEG Y 2*400 = 800 PIXELS
message2print = "{(Step 15B2/70) set" + "; height2opu-set-by-create2image4opu to: " + str(height2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; height2opu-failed-by-create2image4opu: " + str(height2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '15Z-'
task4imagecreate2opu ['HEIGHT'] = height2opu
# ---------------------------------------------------------------------------------------------
# (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.
rowpitch2opu = 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" + "; rowpitch2opu-trying-by-create2image4opu: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2opu = int(width2opu * 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" + "; rowpitch2opu-set-by-create2image4opu to: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; rowpitch2opu-failed-by-create2image4opu: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '16Z-'
task4imagecreate2opu ['ROWPITCH'] = rowpitch2opu
# ---------------------------------------------------------------------------------------------
# (17) POINTER - REQUIRED
# ---------------------------------------------------------------------------------------------
pointer2opu = None
size2opu = int(width2opu * height2opu) # CALCULATED MEMORY
if size2opu == 0:
size2opu = 4400 # MINIMUM MEMORY
message2print = "{(Step 17A/70) trying" + "; pointer2opu-trying-by-create2image4opu: " + str(pointer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
arena2opu = Arena4Xi(size2opu) # SYSTEM RESERVER MEMORY FOR IMAGE
message2print = "{(Step 17B1/70) got" + "; arena2opu-got-by-create2image4opu: " + str(arena2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
size2arena = arena2opu.size #
message2print = "{(Step 17B2/70) got" + "; size2arena-got-by-create2buffer4opu: " + str(size2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 640000
buffer2arena = arena2opu.buffer
message2print = "{(Step 17B3/70) got" + "; buffer2arena-got-by-create2buffer4opu: " + str(buffer2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17B-'
if size2arena < size2opu:
size2opu = size2arena # AVAILABLE MEMORY FOR IMAGE
message2print = "{(Step 17C/70) set" + "; size2opu-set-by-create2buffer4opu to: " + str(size2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17C-'
else:
pass
pointer2opu = buffer2arena
message2print = "{(Step 17D/70) set" + "; pointer2opu-set-by-create2buffer4opu to: " + str(pointer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17D-'
except:
message2print = "{(Step 17Z/70) failed" + "; pointer2opu-failed-by-create2image4opu: " + str(pointer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '17Z-'
task4imagecreate2opu ['POINTER'] = pointer2opu
task4imagecreate2opu ['SIZE'] = size2opu # EXTRA
# ---------------------------------------------------------------------------------------------
# (18) FORMAT - REQUIRED
# ---------------------------------------------------------------------------------------------
format2opu = {}
message2print = "{(Step 18A/70) trying" + "; format2opu-trying-by-create2image4opu: " + str(format2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
format2opu['ORDER'] = 'CL_RGBA'
message2print = "{(Step 18B/70) set" + "; format2opu-set-by-create2image4opu to: " + str(format2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'ORDER': 'CL_RGBA'}
code2ack = code2ack + '18B-'
format2opu['TYPE'] = 'CL_UNORM_INT8'
message2print = "{(Step 18C/70) set" + "; format2opu-set-by-create2image4opu to: " + str(format2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'}
code2ack = code2ack + '18C-'
except:
message2print = "{(Step 18Z/70) failed" + "; format2opu-failed-by-create2image4opu: " + str(format2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '18Z-'
task4imagecreate2opu ['FORMAT'] = format2opu
# ---------------------------------------------------------------------------------------------
# (19) DEPTH - MUST BE 0
# ---------------------------------------------------------------------------------------------
depth2opu = 0
message2print = "{(Step 19A/70) set" + "; depth2opu-set-by-create2image4opu to: " + str(depth2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '19A-'
task4imagecreate2opu ['DEPTH'] = depth2opu
else:
pass # PARAMETER DATA RECEIVED
except:
message2print = "{(Step 1Z1/70) yielded" + "; task4imagecreate2opu-yielded-by-create2image4opu: " + str(task4imagecreate2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '1Z1-'
# ---------------------------------------------------------------------------------------------
# TASK EITHER GENERATED BY THIS PROGRAM (NONE GIVEN) OR GIVEN BY USER
# ---------------------------------------------------------------------------------------------
keys2task = task4imagecreate2opu.keys()
message2print = "{(Step 19A/70) using" + "; keys2task-using-by-create2image4opu: " + 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 OPU!
# ---------------------------------------------------------------------------------------------
opu2image4xi = {}
message2print = "{(Step 20A/70) initialized" + "; opu2image4xi-initialized-by-create2image4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
message2print = "{(Step 21A0/70) try" + "; data2callback-try-by-create2image4opu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 21A/70) - DATA2CALLBACK - EXTRA
# -----------------------------------------------------------------------------------------
opu2image4xi['DATA2CALLBACK'] = task4imagecreate2opu['DATA2CALLBACK']
message2print = "{(Step 21A1/70) initialized" + "; data2callback-created-by-create2image4opu to: " + str(opu2image4xi['DATA2CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; create2image4opu-failed ; time: 05:56:13 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4opu',
# 'METHOD': 'create2image4opu'}; time: 05:56:13 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '21A1-'
except:
message2print = "{(Step 21Z1/70) yielded" + "; data2callback-opu2image4xi-yielded-by-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '21Z1-'
message2print = "{(Step 22B0/70) try" + "; function2callback-try-by-create2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 22B/70) - FUNCTION2CALLBACK - EXTRA
# -----------------------------------------------------------------------------------------
opu2image4xi['FUNCTION2CALLBACK'] = task4imagecreate2opu['FUNCTION2CALLBACK']
message2print = "{(Step 22B1/70) initialized" + "; function2callback-created-by-create2image4opu to: " + str(opu2image4xi['FUNCTION2CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B1-'
except:
message2print = "{(Step 22Z2/70) yielded" + "; function2callback-opu2image4xi-yielded-by-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z2-'
message2print = "{(Step 22C0/70) try" + "; platform-try-by-create2image4opu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 22C/70) - PLATFORM - EXTRA
# -----------------------------------------------------------------------------------------
opu2image4xi['PLATFORM'] = task4imagecreate2opu['PLATFORM']
message2print = "{(Step 22C1/70) initialized" + "; platform-created-by-create2image4opu to: " + str(opu2image4xi['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-opu2image4xi-yielded-by-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z3-'
message2print = "{(Step 23A/70) try" + "; context2opu-try-by-create2image4opu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 23/70) - CONTEXT - REQUIRED
# -----------------------------------------------------------------------------------------
opu2image4xi['CONTEXT'] = task4imagecreate2opu['CONTEXT']
message2print = "{(Step 23B/70) initialized" + "; context-created-by-create2image4opu to: " + str(opu2image4xi['CONTEXT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4opu-failed ; time: 05:56:12 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4opu',
# 'METHOD': 'create2context4opu'},
# '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-opu2image4xi-yielded-by-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z1-'
message2print = "{(Step 24A/70) try" + "; device-try-by-create2image4opu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 24/70) - DEVICE - EXTRA
# -----------------------------------------------------------------------------------------
opu2image4xi['DEVICE'] = task4imagecreate2opu['DEVICE']
message2print = "{(Step 24B/70) initialized" + "; device-created-by-create2image4opu to: " + str(opu2image4xi['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-opu2image4xi-yielded-by-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z1-'
message2print = "{(Step 25A/70) try" + "; code2error-try-by-create2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 25/70) - ERROR CODE - REQUIRED
# -----------------------------------------------------------------------------------------
opu2image4xi['CODE2ERROR'] = task4imagecreate2opu['CODE2ERROR']
message2print = "{(Step 25B/70) initialized" + "; code2error-created-by-create2image4opu to: " + str(opu2image4xi['CODE2ERROR']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z1/70) yielded" + "; code2error-opu2image4xi-yielded-by-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z1-'
message2print = "{(Step 26A/70) try" + "; queue-try-by-create2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 26/70) - QUEUE - EXTRA
# -----------------------------------------------------------------------------------------
opu2image4xi['QUEUE'] = task4imagecreate2opu['QUEUE']
message2print = "{(Step 26B/70) initialized" + "; queue-created-by-create2image4opu to: " + str(opu2image4xi['QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z1/70) yielded" + "; queue-opu2image4xi-yielded-by-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z1-'
message2print = "{(Step 27A/70) try" + "; pipe-try-by-create2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 27/70) - PIPE - EXTRA
# -----------------------------------------------------------------------------------------
opu2image4xi['PIPE'] = task4imagecreate2opu['PIPE']
message2print = "{(Step 27B/70) initialized" + "; pipe-created-by-create2image4opu to: " + str(opu2image4xi['PIPE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z1/70) yielded" + "; pipe-opu2image4xi-yielded-by-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z1-'
message2print = "{(Step 28A/70) try" + "; commandqueue-try-by-create2image4opu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - EXTRA
# ---------------------------------------------------------------------------------------------
opu2image4xi['COMMANDQUEUE'] = task4imagecreate2opu['COMMANDQUEUE']
message2print = "{(Step 28B/70) initialized" + "; commandqueue-created-by-create2image4opu to: " + str(opu2image4xi['COMMANDQUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2commandqueue4opu-failed ; time: 07:13:59 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4opu',
# 'METHOD': 'create2commandqueue4opu'},
# '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-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '28Z1-'
message2print = "{(Step 29A/70) try" + "; bufferinfo-try-by-create2image4opu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (29) BUFFER INFO - EXTRA
# ---------------------------------------------------------------------------------------------
opu2image4xi['BUFFER'] = task4imagecreate2opu['BUFFER']
message2print = "{(Step 29B/70) initialized" + "; bufferinfo-created-by-create2image4opu to: " + str(opu2image4xi['BUFFER']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4opu-failed ; time: 05:56:12 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4opu',
# 'METHOD': 'create2buffer4opu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4opu-failed ...
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z1/70) yielded" + "; bufferinfo-yielded-by-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z1-'
message2print = "{(Step 30A/70) try" + "; eventinfo-try-by-create2image4opu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (30) EVENT INFO - EXTRA
# ---------------------------------------------------------------------------------------------
opu2image4xi['EVENT'] = task4imagecreate2opu['EVENT']
message2print = "{(Step 30B/70) initialized" + "; eventinfo-created-by-create2image4opu to: " + str(opu2image4xi['EVENT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2event4opu-failed ; time: 05:56:12 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2event4opu',
# 'METHOD': 'create2event4opu'},
# '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-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '30Z1-'
message2print = "{(Step 31A/70) try" + "; flags-try-by-create2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (31) FLAGS - REQUIRED
# ---------------------------------------------------------------------------------------------
opu2image4xi['FLAGS'] = task4imagecreate2opu['FLAGS']
message2print = "{(Step 31B/70) initialized" + "; flags-created-by-create2image4opu to: " + str(opu2image4xi['FLAGS']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z1/70) yielded" + "; flags-yielded-by-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z1-'
message2print = "{(Step 34A/70) try" + "; width-try-by-create2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (34) WIDTH - REQUIRED
# ---------------------------------------------------------------------------------------------
opu2image4xi['WIDTH'] = task4imagecreate2opu['WIDTH']
message2print = "{(Step 34H/70) initialized" + "; width-created-by-create2image4opu to: " + str(opu2image4xi['WIDTH']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '34H-'
except:
message2print = "{(Step 34Z1/70) yielded" + "; width-yielded-by-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z1-'
message2print = "{(Step 35A/70) try" + "; height-try-by-create2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (35) HEIGHT - REQUIRED
# ---------------------------------------------------------------------------------------------
opu2image4xi['HEIGHT'] = task4imagecreate2opu['HEIGHT']
message2print = "{(Step 35H/70) initialized" + "; height-created-by-create2image4opu to: " + str(opu2image4xi['HEIGHT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '35H-'
except:
message2print = "{(Step 35Z1/70) yielded" + "; height-yielded-by-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '35Z1-'
message2print = "{(Step 36A/70) try" + "; rowpitch-try-by-create2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (36) ROWPITCH - REQUIRED
# ---------------------------------------------------------------------------------------------
opu2image4xi['ROWPITCH'] = task4imagecreate2opu['ROWPITCH']
message2print = "{(Step 36B/70) initialized" + "; rowpitch-created-by-create2image4opu to: " + str(opu2image4xi['ROWPITCH']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z1/70) yielded" + "; rowpitch-yielded-by-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '36Z1-'
message2print = "{(Step 37A/70) try" + "; pointer-try-by-create2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (37) POINTER - REQUIRED
# ---------------------------------------------------------------------------------------------
opu2image4xi['POINTER'] = task4imagecreate2opu['POINTER']
message2print = "{(Step 37B/70) initialized" + "; pointer-created-by-create2image4opu to: " + str(opu2image4xi['POINTER']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37B-'
except:
message2print = "{(Step 37Z1/70) yielded" + "; pointer-yielded-by-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '37Z1-'
message2print = "{(Step 38A/70) try" + "; format-try-by-create2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (38) FORMAT - REQUIRED
# ---------------------------------------------------------------------------------------------
opu2image4xi['FORMAT'] = task4imagecreate2opu['FORMAT']
message2print = "{(Step 38B/70) initialized" + "; format-created-by-create2image4opu to: " + str(opu2image4xi['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-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '38Z1-'
message2print = "{(Step 39A/70) try" + "; depth-try-by-create2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (39) DEPTH - MUST BE 0
# ---------------------------------------------------------------------------------------------
opu2image4xi['DEPTH'] = task4imagecreate2opu['DEPTH']
message2print = "{(Step 39B/70) initialized" + "; depth-created-by-create2image4opu to: " + str(opu2image4xi['DEPTH']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '39B-'
except:
message2print = "{(Step 39Z1/70) yielded" + "; depth-yielded-by-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '39Z1-'
# -----------------------------------------------------------------------------------------
# (Step 70/70)
# -----------------------------------------------------------------------------------------
opu2image4xi ['ACK2RETURN'] = code2ack
opu2image4xi ['NACK2RETURN'] = code2nack
message2print = "{(Step 70/70) returning" + "; opu2image4xi-returning-by-create2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# 'DEPTH'
# 'WIDTH'
# 'HEIGHT'
return opu2image4xi
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def set2image4opu(task4imageset2opu=None):
'''
sets 2D images for OPU
'''
global opu2image4xi
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "set2image4opu"
method2print = "set2image4opu"
message2print = "{(Step 1A/33) started" + "; set2image4opu-started: " + str(set2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4imageset2opu-to-set2image4opu: " + str(task4imageset2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'QUEUE': ,
# 'CONTEXT': {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4opu-failed ; time: 07:13:59 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4opu',
# 'METHOD': 'create2context4opu'},
# '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; create2commandqueue4opu-failed ; time: 07:13:59 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4opu',
# 'METHOD': 'create2commandqueue4opu'},
# '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; create2context4opu-failed ; time: 07:13:59 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4opu',
# 'METHOD': 'create2context4opu'},
# '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 opu2image4xi is None:
opu2image4xi = create2image4opu() # INITIALIZE IMAGE FOR OPU
message2print = "{(Step 1C/70) set" + "; opu2image4xi-set-by-set2image4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4opu-skipped-by-set2image4opu: " + str(create2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ;
except:
try:
opu2image4xi = create2image4opu()
message2print = "{(Step 1E/70) set" + "; opu2image4xi-set-by-set2image4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
opu2image4xi = {}
message2print = "{(Step 1Z/70) yielded" + "; opu2image4xi-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
# ---------------------------------------------------------------------------------------------
# SET
# ---------------------------------------------------------------------------------------------
message2print = "{(Step 22A0/70) try" + "; data2callback-try-by-set2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 21A/70) - DATA2CALLBACK - EXTRA
# -----------------------------------------------------------------------------------------
opu2image4xi['DATA2CALLBACK'] = task4imageset2opu['DATA2CALLBACK']
message2print = "{(Step 21A1/70) set" + "; data2callback-set-by-set2image4opu to: " + str(opu2image4xi['DATA2CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21A1-'
except:
message2print = "{(Step 21Z1/70) yielded" + "; data2callback-opu2image4xi-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '21Z1-'
message2print = "{(Step 22B0/70) try" + "; function2callback-try-by-set2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 22B/70) - FUNCTION2CALLBACK - EXTRA
# -----------------------------------------------------------------------------------------
opu2image4xi['FUNCTION2CALLBACK'] = task4imageset2opu['FUNCTION2CALLBACK']
message2print = "{(Step 22B1/70) set" + "; function2callback-set-by-set2image4opu to: " + str(opu2image4xi['FUNCTION2CALLBACK']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B1-'
except:
message2print = "{(Step 22Z2/70) yielded" + "; function2callback-opu2image4xi-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '22Z2-'
message2print = "{(Step 22C0/70) try" + "; platform2callback-try-by-set2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
# -----------------------------------------------------------------------------------------
# (Step 22C/70) - PLATFORM - EXTRA
# -----------------------------------------------------------------------------------------
opu2image4xi['PLATFORM'] = task4imageset2opu['PLATFORM']
message2print = "{(Step 2C1/70) set" + "; platform-set-by-set2image4opu to: " + str(opu2image4xi['PLATFORM']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2ack = code2ack + '2C1-'
except:
message2print = "{(Step 22Z3/70) yielded" + "; platform-opu2image4xi-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z3-'
message2print = "{(Step 23A/70) try" + "; context2opu-try-by-set2image4opu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 23/70) - CONTEXT - REQUIRED
# -----------------------------------------------------------------------------------------
opu2image4xi['CONTEXT'] = task4imageset2opu['CONTEXT']
message2print = "{(Step 23B/70) set" + "; context-set-by-set2image4opu to: " + str(opu2image4xi['CONTEXT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4opu-failed ; time: 07:13:59 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4opu',
# 'METHOD': 'create2context4opu'},
# '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-opu2image4xi-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z1-'
message2print = "{(Step 24A/70) try" + "; device-try-by-set2image4opu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 24/70) - DEVICE - EXTRA
# -----------------------------------------------------------------------------------------
opu2image4xi['DEVICE'] = task4imageset2opu['DEVICE']
message2print = "{(Step 24B/70) set" + "; device-set-by-set2image4opu to: " + str(opu2image4xi['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_OPU',
# 'DENORMS2SINGLEPRECISION4FLOATINGPOINTCAPABILITY': 'ACK'}; time: 07:13:59 09/06/11 Pacific Daylight Time}
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z1/70) yielded" + "; device-opu2image4xi-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z1-'
message2print = "{(Step 25A/70) try" + "; code2error-try-by-set2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 25/70) - ERROR CODE - REQUIRED
# -----------------------------------------------------------------------------------------
opu2image4xi['CODE2ERROR'] = task4imageset2opu['CODE2ERROR']
message2print = "{(Step 25B/70) set" + "; code2error-set-by-set2image4opu to: " + str(opu2image4xi['CODE2ERROR']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z1/70) yielded" + "; code2error-opu2image4xi-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z1-'
message2print = "{(Step 26A/70) try" + "; queue-try-by-set2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 26/70) - QUEUE - EXTRA
# -----------------------------------------------------------------------------------------
opu2image4xi['QUEUE'] = task4imageset2opu['QUEUE']
message2print = "{(Step 26B/70) set" + "; queue-set-by-set2image4opu to: " + str(opu2image4xi['QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z1/70) yielded" + "; queue-opu2image4xi-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z1-'
message2print = "{(Step 27A/70) try" + "; pipe-try-by-set2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# -----------------------------------------------------------------------------------------
# (Step 27/70) - PIPE - EXTRA
# -----------------------------------------------------------------------------------------
opu2image4xi['PIPE'] = task4imageset2opu['PIPE']
message2print = "{(Step 27B/70) set" + "; pipe-set-by-set2image4opu to: " + str(opu2image4xi['PIPE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z1/70) yielded" + "; pipe-opu2image4xi-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z1-'
message2print = "{(Step 28A/70) try" + "; commandqueue-try-by-set2image4opu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - EXTRA
# ---------------------------------------------------------------------------------------------
opu2image4xi['COMMANDQUEUE'] = task4imageset2opu['COMMANDQUEUE']
message2print = "{(Step 28B/70) set" + "; commandqueue-set-by-set2image4opu to: " + str(opu2image4xi['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-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z1-'
message2print = "{(Step 29A/70) try" + "; bufferinfo-try-by-set2image4opu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (29) BUFFER INFO - EXTRA
# ---------------------------------------------------------------------------------------------
opu2image4xi['BUFFER'] = task4imageset2opu['BUFFER']
message2print = "{(Step 29B/70) set" + "; bufferinfo-set-by-set2image4opu to: " + str(opu2image4xi['BUFFER']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z1/70) yielded" + "; bufferinfo-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '29Z1-'
message2print = "{(Step 30A/70) try" + "; eventinfo-try-by-set2image4opu: {}" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (30) EVENT INFO - EXTRA
# ---------------------------------------------------------------------------------------------
opu2image4xi['EVENT'] = task4imageset2opu['EVENT']
message2print = "{(Step 30B/70) set" + "; eventinfo-set-by-set2image4opu to: " + str(opu2image4xi['EVENT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '30B-'
except:
message2print = "{(Step 30Z1/70) yielded" + "; eventinfo-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '30Z1-'
message2print = "{(Step 31A/70) try" + "; flags-try-by-set2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (31) FLAGS - REQUIRED
# ---------------------------------------------------------------------------------------------
opu2image4xi['FLAGS'] = task4imageset2opu['FLAGS']
message2print = "{(Step 31B/70) set" + "; flags-set-by-set2image4opu to: " + str(opu2image4xi['FLAGS']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z1/70) yielded" + "; flags-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '31Z1-'
message2print = "{(Step 34A/70) try" + "; width-try-by-set2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (34) WIDTH - REQUIRED
# ---------------------------------------------------------------------------------------------
opu2image4xi['WIDTH'] = task4imageset2opu['WIDTH']
message2print = "{(Step 34H/70) set" + "; width-set-by-set2image4opu to: " + str(opu2image4xi['WIDTH']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34H-'
except:
message2print = "{(Step 34Z1/70) yielded" + "; width-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z1-'
message2print = "{(Step 35A/70) try" + "; height-try-by-set2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (35) HEIGHT - REQUIRED
# ---------------------------------------------------------------------------------------------
opu2image4xi['HEIGHT'] = task4imageset2opu['HEIGHT']
message2print = "{(Step 35H/70) set" + "; height-set-by-set2image4opu to: " + str(opu2image4xi['HEIGHT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '35H-'
except:
message2print = "{(Step 35Z1/70) yielded" + "; height-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '35Z1-'
message2print = "{(Step 36A/70) try" + "; rowpitch-try-by-set2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (36) ROWPITCH - REQUIRED
# ---------------------------------------------------------------------------------------------
opu2image4xi['ROWPITCH'] = task4imageset2opu['ROWPITCH']
message2print = "{(Step 36B/70) set" + "; rowpitch-set-by-set2image4opu to: " + str(opu2image4xi['ROWPITCH']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z1/70) yielded" + "; rowpitch-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '36Z1-'
message2print = "{(Step 37A/70) try" + "; pointer-try-by-set2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (37) POINTER - REQUIRED
# ---------------------------------------------------------------------------------------------
opu2image4xi['POINTER'] = task4imageset2opu['POINTER']
message2print = "{(Step 37B/70) set" + "; pointer-set-by-set2image4opu to: " + str(opu2image4xi['POINTER']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37B-'
except:
message2print = "{(Step 37Z1/70) yielded" + "; pointer-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '37Z1-'
message2print = "{(Step 38A/70) try" + "; format-try-by-set2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ---------------------------------------------------------------------------------------------
# (38) FORMAT - REQUIRED
# ---------------------------------------------------------------------------------------------
opu2image4xi['FORMAT'] = task4imageset2opu['FORMAT']
message2print = "{(Step 38B/70) set" + "; format-set-by-set2image4opu to: " + str(opu2image4xi['FORMAT']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '38B-'
except:
message2print = "{(Step 38Z1/70) yielded" + "; format-yielded-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# yielded
code2nack = code2nack + '38Z1-'
# -----------------------------------------------------------------------------------------
# (Step 70/70)
# -----------------------------------------------------------------------------------------
opu2image4xi ['ACK2RETURN'] = code2ack
opu2image4xi ['NACK2RETURN'] = code2nack
message2print = "{(Step 70/70) returning" + "; opu2image4xi-returning-by-set2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'ACK2RETURN': ' 23B-24B-25B-26B-27B-28B-', 'ROWPITCH': 800, 'DATA2CALLBACK': ...
return opu2image4xi
#
# -------------------------------------------------------------------------------------------------
#copy2copy4opu"
# channel2copypublish4opu = response4copy2image['PUBLISHERCHANNEL']
# channel2copypublish4opu.send(message2copyimagesend4opu)
# print("(Step 17B/700) OF OPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4OPU: ", channel2copypublish4opu, " MESSAGE2SEND4OPU: " , message2copyimagesend4opu)
# except:
# print('(Step 17Z1/700) OF OPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4OPU ', time4xi())
# # -----------------------------------------------------------------------------------------------
# # (18) LET MANOEUVRE2IMAGE4OPU TO RECEIVE COPY AND AND SEND ROGER VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print("(Step 18C/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# try:
# response2manoeuvre4opu = manoeuvre2copyimage4opu(queue2copy4opu, channel2copyconsume4opu, channel2copypublish4opu)
# print("(Step 18D/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", manoeuvre2copyimage4opu)
# except:
# print("(Step 18Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# else:
# pass # trust activated thread
# # -----------------------------------------------------------------------------------------------
# # (19) RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 19A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4OPU ', time4xi())
# try:
# channel2copyconsume4opu = response4copy2image['CONSUMERCHANNEL']
# message2copyimagereceive4opu = channel2copyconsume4opu.recv()
# print("(Step 19B/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel2copyconsume4opu, " CONTROL & COMMAND: ", message2copyimagereceive4opu)
# # roger2copy4opu
# except:
# print('(Step 19Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4OPU ', time4xi())
# # -----------------------------------------------------------------------------------------------
# # (20) SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2IMAGE4OPU TO RECEIVE
# # -----------------------------------------------------------------------------------------------
# print('(Step 20A/700) OF OPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4OPU ', time4xi())
# try:
# message2copyimagesend4opu = "copy2copy4opu"
# channel2copypublish4opu = response4copy2image['PUBLISHERCHANNEL']
# channel2copypublish4opu.send(message2copyimagesend4opu)
# print("(Step 20B/700) OF OPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4OPU: ", channel2copypublish4opu, " MESSAGE2SEND4OPU: " , message2copyimagesend4opu)
# # copy2copy4opu
# except:
# print('(Step 20Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4OPU ', time4xi())
# # -----------------------------------------------------------------------------------------------
# # (21) LET MANOEUVRE2IMAGE4OPU TO RECEIVE READY AND TO SEND READY
# # -----------------------------------------------------------------------------------------------
# print("(Step 21A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# try:
# response2manoeuvre4opu = manoeuvre2copyimage4opu(queue2copy4opu, channel2copyconsume4opu, channel2copypublish4opu)
# print("(Step 21B/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", manoeuvre2copyimage4opu)
# except:
# print("(Step 21Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (22) RECEIVE CONTROL & COMMAND READY VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 22A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4OPU ', time4xi())
# try:
# channel2copyconsume4opu = response4copy2image['CONSUMERCHANNEL']
# message2copyimagereceive4opu = channel2copyconsume4opu.recv()
# print("(Step 22B/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel2copyconsume4opu, " CONTROL & COMMAND: ", message2copyimagereceive4opu)
# # copy2copy4opu
# except:
# print('(Step 22Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGE4OPU ', time4xi())
# # ----------------------------------------------------------------------------------------------
# # (24) PUT IMAGE PATH TO QUEUE
# # ----------------------------------------------------------------------------------------------
# print("(Step 24A/700) OF OPU2IMAGE4XI5TEST - 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 OPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (25) LET MANOEUVRE2IMAGE4OPU TO GET FROM QUEUE AND TO SEND EITHER ACK OR NACK VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print("(Step 25A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# try:
# response2manoeuvre4opu = manoeuvre2copyimage4opu(queue2copy4opu, channel2copyconsume4opu, channel2copypublish4opu)
# print("(Step 25B/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", manoeuvre2copyimage4opu)
# except:
# print("(Step 25Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (26) RECEIVE ACK OR NACK ABOUT IMAGE OPERATION VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 26A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2copyimagereceive4opu = channel2copyconsume4opu.recv()
# print("(Step 26D/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel2copyconsume4opu, " CONTROL & COMMAND: ", message2copyimagereceive4opu)
# # ack2imageinfo4opu
# except:
# print('(Step 26Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# # -----------------------------------------------------------------------------------------------
# (27) LET MANOEUVRE2IMAGE4OPU GO TO STATE 0
# # -----------------------------------------------------------------------------------------------
# print("(Step 27A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# try:
# response2manoeuvre4opu = manoeuvre2copyimage4opu(queue2copy4opu, channel2copyconsume4opu, channel2copypublish4opu)
# print("(Step 27B/700) OF OPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4OPU ", response2manoeuvre4opu)
# except:
# print("(Step 27Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
#">
# -------------------------------------------------------------------------------------------------
def copy2image4opu(task4imagecopy2opu=None):
'''
copies 2D images for OPU
'''
global opu2image4xi # 2D-IMAGES FOR OPU
global control2copyimage4opu # COMMAND AND CONTROL FOR OPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "copy2image4opu"
method2print = "copy2image4opu"
message2print = "{(Step 0A/33) started" + "; copy2image4opu-started: " + str(copy2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0B/33) passed" + "; task4imagecopy2opu-to-copy2image4opu: " + str(task4imagecopy2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE OPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if opu2image4xi is None:
opu2image4xi = create2image4opu() # INITIALIZE IMAGE FOR OPU
message2print = "{(Step 0C/70) created" + "; opu2image4xi-created-by-copy2image4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 0D/70) skipped" + "; create2image4opu-skipped-by-copy2image4opu: " + str(copy2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
try:
opu2image4xi = create2image4opu()
message2print = "{(Step 0E/70) set" + "; opu2image4xi-set-by-copy2image4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
opu2image4xi = {}
message2print = "{(Step 0Z/70) yielded" + "; opu2image4xi-yielded-by-copy2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '0Z-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - CHECK PARAMETERS
# -----------------------------------------------------------------------------------------
try:
if task4imagecopy2opu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR COPY - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4imagecopy2opu = {}
message2print = "{(Step 1A/70) initialized" + "; task4imagecopy2opu-created-by-copy2image4opu to: " + str(task4imagecopy2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4opu = trace2image4opu # CALLBACK FUNCTION FOR OPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4opu-created-by-copy2image4opu to: " + str(function2callback4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2image4opu" # MODULE OF OPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2image4opu" # FUNCTION OF OPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2image4opu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR OPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-copy2image4opu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; copy2image4opu-failed ; time: 07:01:44 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2image4opu',
# 'METHOD': 'copy2image4opu'}; time: 07:01:44 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagecopy2opu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO OPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagecopy2opu['FUNCTION2CALLBACK'] = function2callback4opu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4imagecopy2opu-created-by-copy2image4opu to: " + str(task4imagecopy2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; copy2image4opu-failed ; time: 07:01:44 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2image4opu',
# 'METHOD': 'copy2image4opu'}}; time: 07:01:44 10/04/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-copy2image4opu 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-copy2image4opu: " + 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-copy2image4opu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4imagecopy2opu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2opu = {}
message2print = "{(Step 3A/70) trying" + "; context2opu-trying-by-copy2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2opu = get2context4opu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2opu-got-by-copy2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) ...
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2opu-failed-by-copy2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4imagecopy2opu ['CONTEXT'] = context2opu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2opu = {}
message2print = "{(Step 4A/70) trying" + "; device2opu-trying-by-copy2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2opu = get2opu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2opu-got-by-copy2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'RESOLUTION2TIMER4PROFILING': 318, 'ID2PLATFORM': '0000000001509568', 'PROFILING2QUEUE': 'ACK', ...
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2opu-failed-by-copy2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4imagecopy2opu ['DEVICE'] = device2opu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE SOURCE OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
imagesourceinfo2opu = {}
message2print = "{(Step 5A/70) trying" + "; imagesourceinfo2opu-trying-by-copy2image4opu: " + str(imagesourceinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imagesourceinfo2opu = get2imageinfo4opu()
message2print = "{(Step 5B/70) got" + "; imagesourceinfo2opu-got-by-copy2image4opu: " + str(imagesourceinfo2opu) + "; 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" + "; imagesourceinfo2opu-failed-by-copy2image4opu: " + str(imagesourceinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4imagecopy2opu ['IMAGESOURCE'] = imagesourceinfo2opu
# ---------------------------------------------------------------------------------------------
# (6) IMAGE DESTINATION OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
imagedestinationinfo2opu = {}
message2print = "{(Step 6A/70) trying" + "; imagedestinationinfo2opu-trying-by-copy2image4opu: " + str(imagedestinationinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imagedestinationinfo2opu = get2imageinfo4opu()
message2print = "{(Step 6B/70) got" + "; imagedestinationinfo2opu-got-by-copy2image4opu: " + str(imagedestinationinfo2opu) + "; 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" + "; imagedestinationinfo2opu-failed-by-copy2image4opu: " + str(imagedestinationinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4imagecopy2opu ['IMAGEDESTINATION'] = imagedestinationinfo2opu
# ---------------------------------------------------------------------------------------------
# (7) QUEUE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
queue2opu = None
message2print = "{(Step 7A/70) trying" + "; queue2opu-trying-by-copy2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2opu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 7B/70) got" + "; queue2opu-got-by-copy2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; queue2opu-failed-by-copy2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4imagecopy2opu ['QUEUE'] = queue2opu
# ---------------------------------------------------------------------------------------------
# (8) PIPE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
pipe2opu = None
message2print = "{(Step 8A/70) trying" + "; pipe2opu-trying-by-copy2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2opu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 8B/70) got" + "; pipe2opu-got-by-copy2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; pipe2opu-failed-by-copy2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4imagecopy2opu ['PIPE'] = pipe2opu
# ---------------------------------------------------------------------------------------------
# (9) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2opu = {}
message2print = "{(Step 9A/70) trying" + "; commandqueueinfo2opu-trying-by-copy2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2opu = get2commandqueueinfo4opu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; commandqueueinfo2opu-got-by-copy2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2commandqueue4opu-failed ; time: 07:01:44 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4opu',
# 'METHOD': 'create2commandqueue4opu'},
# 'FUNCTION2CALLBACK': ...
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; commandqueueinfo2opu-failed-by-copy2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4imagecopy2opu ['COMMANDQUEUE'] = commandqueueinfo2opu
# ---------------------------------------------------------------------------------------------
# (10) BUFFER - AUTOMATIC BY OPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2opu = {}
message2print = "{(Step 10A/70) trying" + "; bufferinfo2opu-trying-by-copy2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2opu = get2bufferinfo4opu() # SYSTEM CREATES BUFFER FOR OPU, IF NECESSARY
message2print = "{(Step 10B/70) got" + "; bufferinfo2opu-got-by-copy2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE' ...
code2ack = code2ack + '10B-'
except:
message2print = "{(Step 10Z/70) failed" + "; bufferinfo2opu-failed-by-copy2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '10Z-'
task4imagecopy2opu ['BUFFER'] = bufferinfo2opu
# ---------------------------------------------------------------------------------------------
# (11) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2opu = {}
message2print = "{(Step 11A/70) trying" + "; eventinfo2opu-trying-by-copy2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2opu = get2eventinfo4opu()
message2print = "{(Step 11B/70) got" + "; eventinfo2opu-got-by-copy2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2event4opu-failed ; time: 07:01:44 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2event4opu',
# 'METHOD': 'create2event4opu'},
# '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" + "; eventinfo2opu-failed-by-copy2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4imagecopy2opu ['EVENT'] = eventinfo2opu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2opu = {}
message2print = "{(Step 12A/70) trying" + "; eventwaitlist2opu-trying-by-copy2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2opu = {}
message2print = "{(Step 12B/70) set" + "; eventwaitlist2opu-set-by-copy2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlist2opu-failed-by-copy2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4imagecopy2opu ['EVENTWAITLIST'] = eventwaitlist2opu
# ---------------------------------------------------------------------------------------------
# (13) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2opu = 0
message2print = "{(Step 13A/70) trying" + "; eventwaitlistquantity2opu-trying-by-copy2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2opu.keys()
for key2event in keys2event:
eventwaitlistquantity2opu = eventwaitlistquantity2opu + 1
message2print = "{(Step 13B/70) set" + "; eventwaitlistquantity2opu-set-by-copy2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; eventwaitlistquantity2opu-failed-by-copy2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4imagecopy2opu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2opu
# ---------------------------------------------------------------------------------------------
# (14) ORIGIN FOR SOURCE - REQUIRED
# ---------------------------------------------------------------------------------------------
origin4source2opu = {}
message2print = "{(Step 14A/70) trying" + "; origin4source2opu-trying-by-copy2image4opu: " + str(origin4source2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin4source2opu['X'] = 0
origin4source2opu['Y'] = 0
origin4source2opu['Z'] = 0
message2print = "{(Step 14B/70) set" + "; origin4source2opu-set-by-copy2image4opu to: " + str(origin4source2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; origin4source2opu-failed-by-copy2image4opu: " + str(origin4source2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4imagecopy2opu ['SOURCEORIGIN'] = origin4source2opu
# ---------------------------------------------------------------------------------------------
# (15) ORIGIN FOR DESTINATION - REQUIRED
# ---------------------------------------------------------------------------------------------
origin4destination2opu = {}
message2print = "{(Step 15A/70) trying" + "; origin4destination2opu-trying-by-copy2image4opu: " + str(origin4destination2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin4destination2opu['X'] = 100
origin4destination2opu['Y'] = 100
origin4destination2opu['Z'] = 100
message2print = "{(Step 15B/70) set" + "; origin4destination2opu-set-by-copy2image4opu to: " + str(origin4destination2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; origin4destination2opu-failed-by-copy2image4opu: " + str(origin4destination2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '15Z-'
task4imagecopy2opu ['DESTINATIONORIGIN'] = origin4destination2opu
# --------------------------------------------------------------------------------------------------------
# (16) REGION - REGION OF A IMAGE TO BE COPIED
# --------------------------------------------------------------------------------------------------------
region4copy2opu = {}
message2print = "{(Step 16A/70) trying" + "; region4copy2opu-trying-by-copy2image4opu: " + str(region4copy2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region4copy2opu['X'] = 10
region4copy2opu['Y'] = 10
region4copy2opu['Z'] = 10
message2print = "{(Step 16B/70) set" + "; region4copy2opu-set-by-copy2image4opu to: " + str(region4copy2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; region4copy2opu-failed-by-copy2image4opu: " + str(region4copy2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '16Z-'
task4imagecopy2opu ['REGION'] = region4copy2opu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
else:
pass
# ---------------------------------------------------------------------------------------------
# CHECK PARAMETERS - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4imagecopy2opu.keys()
message2print = "{(Step 20/70) using" + "; keys2task-using-by-copy2image4opu: " + 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
# ---------------------------------------------------------------------------------------------
function2callback4opu = trace2image4opu # CALLBACK FUNCTION FOR OPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4opu-created-by-copy2image4opu to: " + str(function2callback4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2image4opu" # MODULE OF OPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2image4opu" # FUNCTION OF OPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2image4opu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR OPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-copy2image4opu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagecopy2opu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO OPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagecopy2opu['FUNCTION2CALLBACK'] = function2callback4opu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4imagecopy2opu-created-by-copy2image4opu to: " + str(task4imagecopy2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-copy2image4opu 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-copy2image4opu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-copy2image4opu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4imagecopy2opu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2opu = {}
message2print = "{(Step 23A/70) trying" + "; context2opu-trying-by-copy2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2opu = get2context4opu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2opu-got-by-copy2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2opu-failed-by-copy2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4imagecopy2opu ['CONTEXT'] = context2opu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2opu = {}
message2print = "{(Step 24A/70) trying" + "; device2opu-trying-by-copy2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2opu = get2opu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2opu-got-by-copy2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2opu-failed-by-copy2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4imagecopy2opu ['DEVICE'] = device2opu
if 'IMAGESOURCE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) SOURCE IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
sourceimageinfo2opu = {}
message2print = "{(Step 25A/70) trying" + "; sourceimageinfo2opu-trying-by-copy2image4opu: " + str(sourceimageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
sourceimageinfo2opu = get2imageinfo4opu()
message2print = "{(Step 25B/70) got" + "; sourceimageinfo2opu-got-by-copy2image4opu: " + str(sourceimageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; sourceimageinfo2opu-failed-by-copy2image4opu: " + str(sourceimageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4imagecopy2opu ['IMAGESOURCE'] = sourceimageinfo2opu
if 'IMAGEDESTINATION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) DESTINATION IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
destinationimageinfo2opu = {}
message2print = "{(Step 26A/70) trying" + "; destinationimageinfo2opu-trying-by-copy2image4opu: " + str(destinationimageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
destinationimageinfo2opu = get2imageinfo4opu()
message2print = "{(Step 26B/70) got" + "; destinationimageinfo2opu-got-by-copy2image4opu: " + str(destinationimageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; destinationimageinfo2opu-failed-by-copy2image4opu: " + str(destinationimageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4imagecopy2opu ['IMAGEDESTINATION'] = destinationimageinfo2opu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) QUEUE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
queue2opu = None
message2print = "{(Step 27A/70) trying" + "; queue2opu-trying-by-copy2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2opu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 27B/70) got" + "; queue2opu-got-by-copy2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; queue2opu-failed-by-copy2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4imagecopy2opu ['QUEUE'] = queue2opu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) PIPE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
pipe2opu = None
message2print = "{(Step 28A/70) trying" + "; pipe2opu-trying-by-copy2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2opu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 28B/70) got" + "; pipe2opu-got-by-copy2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; pipe2opu-failed-by-copy2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4imagecopy2opu ['PIPE'] = pipe2opu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2opu = {}
message2print = "{(Step 29A/70) trying" + "; commandqueueinfo2opu-trying-by-copy2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2opu = get2commandqueueinfo4opu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; commandqueueinfo2opu-got-by-copy2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; commandqueueinfo2opu-failed-by-copy2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4imagecopy2opu ['COMMANDQUEUE'] = commandqueueinfo2opu
if 'BUFFER' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (30) BUFFER - AUTOMATIC BY OPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2opu = {}
message2print = "{(Step 30A/70) trying" + "; bufferinfo2opu-trying-by-copy2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2opu = get2bufferinfo4opu() # SYSTEM CREATES BUFFER FOR OPU, IF NECESSARY
message2print = "{(Step 30B/70) got" + "; bufferinfo2opu-got-by-copy2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '30B-'
except:
message2print = "{(Step 30Z/70) failed" + "; bufferinfo2opu-failed-by-copy2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '30Z-'
task4imagecopy2opu ['BUFFER'] = bufferinfo2opu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2opu = {}
message2print = "{(Step 31A/70) trying" + "; eventinfo2opu-trying-by-copy2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2opu = get2eventinfo4opu()
message2print = "{(Step 31B/70) got" + "; eventinfo2opu-got-by-copy2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventinfo2opu-failed-by-copy2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4imagecopy2opu ['EVENT'] = eventinfo2opu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2opu = {}
message2print = "{(Step 32A/70) trying" + "; eventwaitlist2opu-trying-by-copy2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2opu = {}
message2print = "{(Step 32B/70) set" + "; eventwaitlist2opu-set-by-copy2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlist2opu-failed-by-copy2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4imagecopy2opu ['EVENTWAITLIST'] = eventwaitlist2opu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2opu = 0
message2print = "{(Step 33A/70) trying" + "; eventwaitlistquantity2opu-trying-by-copy2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2opu.keys()
for key2event in keys2event:
eventwaitlistquantity2opu = eventwaitlistquantity2opu + 1
message2print = "{(Step 33B/70) set" + "; eventwaitlistquantity2opu-set-by-copy2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; eventwaitlistquantity2opu-failed-by-copy2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4imagecopy2opu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2opu
if 'SOURCEORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) SOURCEORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
source4origin2opu = {}
message2print = "{(Step 34A/70) trying" + "; source4origin2opu-trying-by-copy2image4opu: " + str(source4origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
source4origin2opu['X'] = 0
source4origin2opu['Y'] = 0
source4origin2opu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; source4origin2opu-set-by-copy2image4opu to: " + str(source4origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; source4origin2opu-failed-by-copy2image4opu: " + str(source4origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4imagecopy2opu ['SOURCEORIGIN'] = source4origin2opu
if 'DESTINATIONORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (35) DESTINATIONORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
destination4origin2opu = {}
message2print = "{(Step 35A/70) trying" + "; destination4origin2opu-trying-by-copy2image4opu: " + str(destination4origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
destination4origin2opu['X'] = 100
destination4origin2opu['Y'] = 100
destination4origin2opu['Z'] = 100
message2print = "{(Step 35B/70) set" + "; destination4origin2opu-set-by-copy2image4opu to: " + str(destination4origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '35B-'
except:
message2print = "{(Step 35Z/70) failed" + "; destination4origin2opu-failed-by-copy2image4opu: " + str(destination4origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '35Z-'
task4imagecopy2opu ['DESTINATIONSOURCEORIGIN'] = destination4origin2opu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (36) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2opu = {}
message2print = "{(Step 36A/70) trying" + "; region2opu-trying-by-copy2image4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2opu['X'] = 160 # WIDTH IN PIXELS TO WRITE
region2opu['Y'] = 90 # HEIGHT IN PIXELS TO WRITE
region2opu['Z'] = 0 # DEPTH IN PIXELS TO WRITE
message2print = "{(Step 36B/70) set" + "; region2opu-set-by-copy2image4opu to: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; region2opu-failed-by-copy2image4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '36Z-'
task4imagecopy2opu ['REGION'] = region2opu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER CHECKING AND PROVIDING FOR MISSING ONES
# ---------------------------------------------------------------------------------------------
keys2task = task4imagecopy2opu.keys()
message2print = "{(Step 39/70) set" + "; keys2task-set-by-copy2image4opu 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" + "; task4imagecopy2opu-yielded-by-copy2image4opu: " + str(task4imagecopy2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '39Z-'
# ---------------------------------------------------------------------------------------------
# CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
control2copyimage4opu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2opu = False
channels2opu = ()
message2print = "{(Step 40A/70) trying" + "channels2opu-trying-by-copy2image4opu: " + str(channels2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
#
consumerchannel2opu, publisherchannel2opu = task4imagecopy2opu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2opu-got-by-copy2image4opu: " + str(consumerchannel2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2opu-got-by-copy2image4opu: " + str(publisherchannel2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2opu = True
control2copyimage4opu['CONSUMERCHANNEL'] = consumerchannel2opu
control2copyimage4opu['PUBLISHERCHANNEL'] = publisherchannel2opu
code2ack = code2ack + '40D-'
except:
ack4channels2opu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2opu = False
queue2opu = None
message2print = "{(Step 41A/70) trying" + "queue2opu-trying-by-copy2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2opu = task4imagecopy2opu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2opu-got-by-copy2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2opu = True
control2copyimage4opu['QUEUE'] = queue2opu
code2ack = code2ack + '41C-'
except:
ack4queue2opu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4opu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4opu-trying-by-copy2image4opu: " + str(dummy2image4opu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4opu = DummyProcess4Xi(target=manoeuvre2copyimage4opu, # in this module to handle queue and pipe channels
# args =(queue2opu, # caller puts and gets - does NOT call any functions
# consumerchannel2opu, publisherchannel2opu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4opu-created-by-copy2image4opu: " + str(dummy2image4opu) + "; 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-copy2image4opu: " + 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-copy2image4opu: " + str(code2nack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70C/70) returning" + "; control2copyimage4opu-returning-by-copy2image4opu: " + str(control2copyimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return control2copyimage4opu
#
# -------------------------------------------------------------------------------------------------
#copy2copyimagetobuffer4opu"
# channel2copyimagetobufferpublish4opu = response4copy2imagetobuffer['PUBLISHERCHANNEL']
# channel2copyimagetobufferpublish4opu.send(message2copyimagetobuffersend4opu)
# print("(Step 61B/700) OF OPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4OPU: ", channel2copyimagetobufferpublish4opu, " MESSAGE2SEND4OPU: " , message2copyimagetobuffersend4opu)
# except:
# print('(Step 61Z1/700) OF OPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4OPU ', time4xi())
# # ------------------------------------------------------------------------------------------
# # (62) LET MANOEUVRE2COPYIMAGETOBUFFER4OPU TO RECEIVE COPY AND AND SEND ROGER VIA PIPE
# # ------------------------------------------------------------------------------------------
# print("(Step 62A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4opu = manoeuvre2copyimagetobuffer4opu(queue2copyimagetobuffer4opu, channel2copyimagetobufferconsume4opu, channel2copyimagetobufferpublish4opu)
# print("(Step 62B/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", manoeuvre2copyimagetobuffer4opu)
# except:
# print("(Step 62Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", time4xi())
# else:
# pass # trust activated thread
# # ---------------------------------------------------------------------------------------------
# # (63) RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------
# print('(Step 63A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4OPU ', time4xi())
# try:
# channel2copyimagetobufferconsume4opu = response4copy2imagetobuffer['CONSUMERCHANNEL']
# message2copyimagereceive4opu = channel2copyimagetobufferconsume4opu.recv()
# print("(Step 63B/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel2copyimagetobufferconsume4opu, " CONTROL & COMMAND: ", message2copyimagereceive4opu)
# #
# except:
# print('(Step 63Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4OPU ', time4xi())
# # ---------------------------------------------------------------------------------------------------
# # (64) SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2COPYIMAGETOBUFFER4OPU TO RECEIVE
# # ---------------------------------------------------------------------------------------------------
# print('(Step 64A/700) OF OPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4OPU ', time4xi())
# try:
# message2copyimagetobuffersend4opu = "copy2copyimagetobuffer4opu"
# channel2copyimagetobufferpublish4opu = response4copy2imagetobuffer['PUBLISHERCHANNEL']
# channel2copyimagetobufferpublish4opu.send(message2copyimagetobuffersend4opu)
# print("(Step 64B/700) OF OPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4OPU: ", channel2copyimagetobufferpublish4opu, " MESSAGE2SEND4OPU: " , message2copyimagetobuffersend4opu)
# #
# except:
# print('(Step 64Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4OPU ', time4xi())
# # -----------------------------------------------------------------------------------
# # (65) LET MANOEUVRE2COPYIMAGETOBUFFER4OPU TO RECEIVE READY AND TO SEND READY
# # -----------------------------------------------------------------------------------
# print("(Step 65A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4opu = manoeuvre2copyimagetobuffer4opu(queue2copyimagetobuffer4opu, channel2copyimagetobufferconsume4opu, channel2copyimagetobufferpublish4opu)
# print("(Step 65B/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", manoeuvre2copyimagetobuffer4opu)
# except:
# print("(Step 65Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", time4xi())
# # ---------------------------------------------------------------------------------------
# # (66) RECEIVE CONTROL & COMMAND READY VIA PIPE
# # ---------------------------------------------------------------------------------------
# print('(Step 66A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4OPU ', time4xi())
# try:
# channel2copyimagetobufferconsume4opu = response4copy2imagetobuffer['CONSUMERCHANNEL']
# message2copyimagereceive4opu = channel2copyimagetobufferconsume4opu.recv()
# print("(Step 66B/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel2copyimagetobufferconsume4opu, " CONTROL & COMMAND: ", message2copyimagereceive4opu)
# #
# except:
# print('(Step 66Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPY2IMAGETOBUFFER4OPU ', time4xi())
# # -----------------------------------------------------------------------------------------
# # (67) PUT IMAGE PATH TO QUEUE
# # -----------------------------------------------------------------------------------------
# print("(Step 67A/700) OF OPU2IMAGE4XI5TEST - 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 OPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
# # ------------------------------------------------------------------------------------------------------
# # (68) LET MANOEUVRE2COPYIMAGETOBUFFER4OPU TO GET FROM QUEUE AND TO SEND EITHER ACK OR NACK VIA PIPE
# # -------------------------------------------------------------------------------------------------------
# print("(Step 68A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4opu = manoeuvre2copyimagetobuffer4opu(queue2copyimagetobuffer4opu, channel2copyimagetobufferconsume4opu, channel2copyimagetobufferpublish4opu)
# print("(Step 68B/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", manoeuvre2copyimagetobuffer4opu)
# except:
# print("(Step 68Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (69) RECEIVE ACK OR NACK ABOUT IMAGE OPERATION VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 69A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2copyimagereceive4opu = channel2copyimagetobufferconsume4opu.recv()
# print("(Step 69D/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel2copyimagetobufferconsume4opu, " CONTROL & COMMAND: ", message2copyimagereceive4opu)
# except:
# print('(Step 69Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# # -------------------------------------------------------------------------------------------------------
# # (70) LET MANOEUVRE2COPYIMAGETOBUFFER4OPU GO TO STATE 0
# # -------------------------------------------------------------------------------------------------------
# print("(Step 70A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4opu = manoeuvre2copyimagetobuffer4opu(queue2copyimagetobuffer4opu, channel2copyimagetobufferconsume4opu, channel2copyimagetobufferpublish4opu)
# print("(Step 70B/700) OF OPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4OPU ", response2manoeuvreimagecopytobuffer4opu)
# except:
# print("(Step 70Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", time4xi())
#">
# -------------------------------------------------------------------------------------------------
def copy2imagetobuffer4opu(task4copyimagetobuffer2opu=None):
'''
copies 2D images to buffer for OPU
'''
global opu2image4xi # 2D-IMAGES FOR OPU
global opu2buffer4xi # BUFFER FOR OPU
global control2copyimagetobuffer4opu # COMMAND AND CONTROL FOR OPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "copy2imagetobuffer4opu"
method2print = "copy2imagetobuffer4opu"
message2print = "{(Step 1A/33) started" + "; copy2imagetobuffer4opu-started: " + str(copy2imagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1B/33) passed" + "; task4copyimagetobuffer2opu-to-copy2imagetobuffer4opu: " + str(task4copyimagetobuffer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE OPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if opu2image4xi is None:
opu2image4xi = create2image4opu() # INITIALIZE IMAGE FOR OPU
message2print = "{(Step 1C/70) created" + "; opu2image4xi-created-by-copy2imagetobuffer4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4opu-skipped-by-copy2imagetobuffer4opu: " + str(copy2imagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# create2image4opu-skipped-by-copy2imagetobuffer4opu
except:
try:
opu2image4xi = create2image4opu()
message2print = "{(Step 1E/70) set" + "; opu2image4xi-set-by-copy2imagetobuffer4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
opu2image4xi = {}
message2print = "{(Step 1Z1/70) yielded" + "; opu2image4xi-yielded-by-copy2imagetobuffer4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z1-'
# -----------------------------------------------------------------------------------------
# CREATE OPU2BUFFER4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if opu2buffer4xi is None:
opu2buffer4xi = create2buffer4opu() # INITIALIZE BUFFER FOR OPU
message2print = "{(Step 1F/70) created" + "; opu2buffer4xi-created-by-copy2imagetobuffer4opu to: " + str(opu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1G/70) skipped" + "; create2buffer4opu-skipped-by-copy2imagetobuffer4opu: " + str(copy2imagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
try:
opu2buffer4xi = create2buffer4opu()
message2print = "{(Step 1H/70) set" + "; opu2buffer4xi-set-by-copy2imagetobuffer4opu to: " + str(opu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4opu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4opu',
# 'METHOD': 'create2buffer4opu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': ...
except:
opu2buffer4xi = {}
message2print = "{(Step 1Z2/70) yielded" + "; opu2buffer4xi-yielded-by-copy2imagetobuffer4opu: " + str(opu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z2-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - ANALYZE TASK
# -----------------------------------------------------------------------------------------
if task4copyimagetobuffer2opu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR COPY - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4copyimagetobuffer2opu = {}
message2print = "{(Step 1A/70) initialized" + "; task4copyimagetobuffer2opu-created-by-copy2imagetobuffer4opu to: " + str(task4copyimagetobuffer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4opu = trace2image4opu # CALLBACK FUNCTION FOR OPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4opu-created-by-copy2imagetobuffer4opu to: " + str(function2callback4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2imagetobuffer4opu" # MODULE OF OPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2imagetobuffer4opu" # FUNCTION OF OPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2imagetobuffer4opu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR OPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-copy2imagetobuffer4opu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; copy2imagetobuffer4opu-failed; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2imagetobuffer4opu',
# 'METHOD': 'copy2imagetobuffer4opu'}; time: 03:40:47 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4copyimagetobuffer2opu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO OPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4copyimagetobuffer2opu['FUNCTION2CALLBACK'] = function2callback4opu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4copyimagetobuffer2opu-created-by-copy2imagetobuffer4opu to: " + str(task4copyimagetobuffer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; copy2imagetobuffer4opu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2imagetobuffer4opu',
# 'METHOD': 'copy2imagetobuffer4opu'}}; time: 03:40:47 10/04/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-copy2imagetobuffer4opu 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-copy2imagetobuffer4opu: " + 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-copy2imagetobuffer4opu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4copyimagetobuffer2opu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2opu = {}
message2print = "{(Step 3A/70) trying" + "; context2opu-trying-by-copy2imagetobuffer4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2opu = get2context4opu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2opu-got-by-copy2imagetobuffer4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4opu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4opu',
# 'METHOD': 'create2context4opu'},
# '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" + "; context2opu-failed-by-copy2imagetobuffer4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4copyimagetobuffer2opu ['CONTEXT'] = context2opu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2opu = {}
message2print = "{(Step 4A/70) trying" + "; device2opu-trying-by-copy2imagetobuffer4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2opu = get2opu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2opu-got-by-copy2imagetobuffer4opu: " + str(device2opu) + "; 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_OPU',
# 'DENORMS2SINGLEPRECISION4FLOATINGPOINTCAPABILITY': 'ACK'}; time: 03:40:47 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2opu-failed-by-copy2imagetobuffer4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4copyimagetobuffer2opu ['DEVICE'] = device2opu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE SOURCE OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
imagesourceinfo2opu = {}
message2print = "{(Step 5A/70) trying" + "; imagesourceinfo2opu-trying-by-copy2imagetobuffer4opu: " + str(imagesourceinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imagesourceinfo2opu = get2imageinfo4opu()
message2print = "{(Step 5B/70) got" + "; imagesourceinfo2opu-got-by-copy2imagetobuffer4opu: " + str(imagesourceinfo2opu) + "; 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" + "; imagesourceinfo2opu-failed-by-copy2imagetobuffer4opu: " + str(imagesourceinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4copyimagetobuffer2opu ['IMAGESOURCE'] = imagesourceinfo2opu
# ---------------------------------------------------------------------------------------------
# (6) BUFFER DESTINATION OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
bufferdestinationinfo2opu = {}
message2print = "{(Step 6A/70) trying" + "; bufferdestinationinfo2opu-trying-by-copy2imagetobuffer4opu: " + str(bufferdestinationinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferdestinationinfo2opu = get2bufferinfo4opu()
message2print = "{(Step 6B/70) got" + "; bufferdestinationinfo2opu-got-by-copy2imagetobuffer4opu: " + str(bufferdestinationinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4opu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4opu',
# 'METHOD': 'create2buffer4opu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0, ...
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; bufferdestinationinfo2opu-failed-by-copy2imagetobuffer4opu: " + str(bufferdestinationinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4copyimagetobuffer2opu ['BUFFERDESTINATION'] = bufferdestinationinfo2opu
# ---------------------------------------------------------------------------------------------
# (7) QUEUE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
queue2copyimagetobuffer4opu = None
message2print = "{(Step 7A/70) trying" + "; queue2copyimagetobuffer4opu-trying-by-copy2imagetobuffer4opu: " + str(queue2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copyimagetobuffer4opu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 7B/70) got" + "; queue2copyimagetobuffer4opu-got-by-copy2imagetobuffer4opu: " + str(queue2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; queue2copyimagetobuffer4opu-failed-by-copy2imagetobuffer4opu: " + str(queue2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4copyimagetobuffer2opu ['QUEUE'] = queue2copyimagetobuffer4opu
# ---------------------------------------------------------------------------------------------
# (8) PIPE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
pipe2opu = None
message2print = "{(Step 8A/70) trying" + "; pipe2opu-trying-by-copy2imagetobuffer4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2opu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 8B/70) got" + "; pipe2opu-got-by-copy2imagetobuffer4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; pipe2opu-failed-by-copy2imagetobuffer4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4copyimagetobuffer2opu ['PIPE'] = pipe2opu
# ---------------------------------------------------------------------------------------------
# (9) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2opu = {}
message2print = "{(Step 9A/70) trying" + "; commandqueueinfo2opu-trying-by-copy2imagetobuffer4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2opu = get2commandqueueinfo4opu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; commandqueueinfo2opu-got-by-copy2imagetobuffer4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2commandqueue4opu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4opu',
# 'METHOD': 'create2commandqueue4opu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ...
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; commandqueueinfo2opu-failed-by-copy2imagetobuffer4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4copyimagetobuffer2opu ['COMMANDQUEUE'] = commandqueueinfo2opu
# ---------------------------------------------------------------------------------------------
# (11) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2opu = {}
message2print = "{(Step 11A/70) trying" + "; eventinfo2opu-trying-by-copy2imagetobuffer4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2opu = get2eventinfo4opu()
message2print = "{(Step 11B/70) got" + "; eventinfo2opu-got-by-copy2imagetobuffer4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2event4opu-failed ; time: 03:40:47 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2event4opu',
# 'METHOD': 'create2event4opu'},
# 'FUNCTION2CALLBACK': ,
# 'ACK2RETURN': ' 1D-1E-...
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; eventinfo2opu-failed-by-copy2imagetobuffer4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4copyimagetobuffer2opu ['EVENT'] = eventinfo2opu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2opu = {}
message2print = "{(Step 12A/70) trying" + "; eventwaitlist2opu-trying-by-copy2imagetobuffer4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2opu = {}
message2print = "{(Step 12B/70) set" + "; eventwaitlist2opu-set-by-copy2imagetobuffer4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlist2opu-failed-by-copy2imagetobuffer4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4copyimagetobuffer2opu ['EVENTWAITLIST'] = eventwaitlist2opu
# ---------------------------------------------------------------------------------------------
# (13) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2opu = 0
message2print = "{(Step 13A/70) trying" + "; eventwaitlistquantity2opu-trying-by-copy2imagetobuffer4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2opu.keys()
for key2event in keys2event:
eventwaitlistquantity2opu = eventwaitlistquantity2opu + 1
message2print = "{(Step 13B/70) set" + "; eventwaitlistquantity2opu-set-by-copy2imagetobuffer4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; eventwaitlistquantity2opu-failed-by-copy2imagetobuffer4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4copyimagetobuffer2opu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2opu
# ---------------------------------------------------------------------------------------------
# (14) ORIGIN FOR SOURCE - REQUIRED
# ---------------------------------------------------------------------------------------------
origin4source2opu = {}
message2print = "{(Step 14A/70) trying" + "; origin4source2opu-trying-by-copy2imagetobuffer4opu: " + str(origin4source2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin4source2opu['X'] = 0
origin4source2opu['Y'] = 0
origin4source2opu['Z'] = 0
message2print = "{(Step 14B/70) set" + "; origin4source2opu-set-by-copy2imagetobuffer4opu to: " + str(origin4source2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 0, 'X': 0, 'Z': 0}
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; origin4source2opu-failed-by-copy2imagetobuffer4opu: " + str(origin4source2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4copyimagetobuffer2opu ['SOURCEORIGIN'] = origin4source2opu
# --------------------------------------------------------------------------------------------------------
# (16) REGION - REGION OF A IMAGE TO BE COPIED
# --------------------------------------------------------------------------------------------------------
region4copy2opu = {}
message2print = "{(Step 16A/70) trying" + "; region4copy2opu-trying-by-copy2imagetobuffer4opu: " + str(region4copy2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region4copy2opu['X'] = 10
region4copy2opu['Y'] = 10
region4copy2opu['Z'] = 10
message2print = "{(Step 16B/70) set" + "; region4copy2opu-set-by-copy2imagetobuffer4opu to: " + str(region4copy2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 10, 'X': 10, 'Z': 10}
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; region4copy2opu-failed-by-copy2imagetobuffer4opu: " + str(region4copy2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '16Z-'
task4copyimagetobuffer2opu ['REGION'] = region4copy2opu
# --------------------------------------------------------------------------------------------------------
# (17) OFFSET - WHERE TO BEGIN COPYING DATA INTO DESTINATION BUFFER
# --------------------------------------------------------------------------------------------------------
offset4copy2opu = 0
message2print = "{(Step 17A/70) set" + "; offset4copy2opu-set-by-copy2imagetobuffer4opu to: " + str(offset4copy2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '17A-'
task4copyimagetobuffer2opu ['OFFSET'] = offset4copy2opu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
else:
pass
# ---------------------------------------------------------------------------------------------
# ANALYZE TASK - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4copyimagetobuffer2opu.keys()
message2print = "{(Step 20/70) got" + "; keys2task-got-by-copy2imagetobuffer4opu: " + 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
# ---------------------------------------------------------------------------------------------
function2callback4opu = trace2image4opu # CALLBACK FUNCTION FOR OPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4opu-created-by-copy2imagetobuffer4opu to: " + str(function2callback4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2imagetobuffer4opu" # MODULE OF OPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2imagetobuffer4opu" # FUNCTION OF OPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2imagetobuffer4opu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR OPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-copy2imagetobuffer4opu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4copyimagetobuffer2opu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO OPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4copyimagetobuffer2opu['FUNCTION2CALLBACK'] = function2callback4opu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4copyimagetobuffer2opu-created-by-copy2imagetobuffer4opu to: " + str(task4copyimagetobuffer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-copy2imagetobuffer4opu 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-copy2imagetobuffer4opu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-copy2imagetobuffer4opu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4copyimagetobuffer2opu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2opu = {}
message2print = "{(Step 23A/70) trying" + "; context2opu-trying-by-copy2imagetobuffer4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2opu = get2context4opu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2opu-got-by-copy2imagetobuffer4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2opu-failed-by-copy2imagetobuffer4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4copyimagetobuffer2opu ['CONTEXT'] = context2opu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2opu = {}
message2print = "{(Step 24A/70) trying" + "; device2opu-trying-by-copy2imagetobuffer4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2opu = get2opu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2opu-got-by-copy2imagetobuffer4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2opu-failed-by-copy2imagetobuffer4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4copyimagetobuffer2opu ['DEVICE'] = device2opu
if 'IMAGESOURCE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) SOURCE IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
sourceimageinfo2opu = {}
message2print = "{(Step 25A/70) trying" + "; sourceimageinfo2opu-trying-by-copy2imagetobuffer4opu: " + str(sourceimageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
sourceimageinfo2opu = get2imageinfo4opu()
message2print = "{(Step 25B/70) got" + "; sourceimageinfo2opu-got-by-copy2imagetobuffer4opu: " + str(sourceimageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; sourceimageinfo2opu-failed-by-copy2imagetobuffer4opu: " + str(sourceimageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4copyimagetobuffer2opu ['IMAGESOURCE'] = sourceimageinfo2opu
if 'BUFFERDESTINATION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) DESTINATION BUFFER - REQUIRED
# ---------------------------------------------------------------------------------------------
destinationbufferinfo2opu = {}
message2print = "{(Step 26A/70) trying" + "; destinationbufferinfo2opu-trying-by-copy2imagetobuffer4opu: " + str(destinationbufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
destinationbufferinfo2opu = get2bufferinfo4opu()
message2print = "{(Step 26B/70) got" + "; destinationbufferinfo2opu-got-by-copy2imagetobuffer4opu: " + str(destinationbufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; destinationbufferinfo2opu-failed-by-copy2imagetobuffer4opu: " + str(destinationbufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4copyimagetobuffer2opu ['BUFFERDESTINATION'] = destinationbufferinfo2opu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) QUEUE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
queue2copyimagetobuffer4opu = None
message2print = "{(Step 27A/70) trying" + "; queue2copyimagetobuffer4opu-trying-by-copy2imagetobuffer4opu: " + str(queue2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copyimagetobuffer4opu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 27B/70) got" + "; queue2copyimagetobuffer4opu-got-by-copy2imagetobuffer4opu: " + str(queue2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; queue2copyimagetobuffer4opu-failed-by-copy2imagetobuffer4opu: " + str(queue2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4copyimagetobuffer2opu ['QUEUE'] = queue2copyimagetobuffer4opu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) PIPE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
pipe2opu = None
message2print = "{(Step 28A/70) trying" + "; pipe2opu-trying-by-copy2imagetobuffer4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2opu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 28B/70) got" + "; pipe2opu-got-by-copy2imagetobuffer4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; pipe2opu-failed-by-copy2imagetobuffer4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4copyimagetobuffer2opu ['PIPE'] = pipe2opu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2opu = {}
message2print = "{(Step 29A/70) trying" + "; commandqueueinfo2opu-trying-by-copy2imagetobuffer4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2opu = get2commandqueueinfo4opu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; commandqueueinfo2opu-got-by-copy2imagetobuffer4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; commandqueueinfo2opu-failed-by-copy2imagetobuffer4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4copyimagetobuffer2opu ['COMMANDQUEUE'] = commandqueueinfo2opu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2opu = {}
message2print = "{(Step 31A/70) trying" + "; eventinfo2opu-trying-by-copy2imagetobuffer4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2opu = get2eventinfo4opu()
message2print = "{(Step 31B/70) got" + "; eventinfo2opu-got-by-copy2imagetobuffer4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventinfo2opu-failed-by-copy2imagetobuffer4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4copyimagetobuffer2opu ['EVENT'] = eventinfo2opu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2opu = {}
message2print = "{(Step 32A/70) trying" + "; eventwaitlist2opu-trying-by-copy2imagetobuffer4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2opu = {}
message2print = "{(Step 32B/70) set" + "; eventwaitlist2opu-set-by-copy2imagetobuffer4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlist2opu-failed-by-copy2imagetobuffer4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4copyimagetobuffer2opu ['EVENTWAITLIST'] = eventwaitlist2opu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2opu = 0
message2print = "{(Step 33A/70) trying" + "; eventwaitlistquantity2opu-trying-by-copy2imagetobuffer4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2opu.keys()
for key2event in keys2event:
eventwaitlistquantity2opu = eventwaitlistquantity2opu + 1
message2print = "{(Step 33B/70) set" + "; eventwaitlistquantity2opu-set-by-copy2imagetobuffer4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; eventwaitlistquantity2opu-failed-by-copy2imagetobuffer4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4copyimagetobuffer2opu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2opu
if 'SOURCEORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) SOURCEORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
source4origin2opu = {}
message2print = "{(Step 34A/70) trying" + "; source4origin2opu-trying-by-copy2imagetobuffer4opu: " + str(source4origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
source4origin2opu['X'] = 0
source4origin2opu['Y'] = 0
source4origin2opu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; source4origin2opu-set-by-copy2imagetobuffer4opu to: " + str(source4origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; source4origin2opu-failed-by-copy2imagetobuffer4opu: " + str(source4origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4copyimagetobuffer2opu ['SOURCEORIGIN'] = source4origin2opu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (36) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2opu = {}
message2print = "{(Step 36A/70) trying" + "; region2opu-trying-by-copy2imagetobuffer4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2opu['X'] = 160 # WIDTH IN PIXELS TO WRITE
region2opu['Y'] = 90 # HEIGHT IN PIXELS TO WRITE
region2opu['Z'] = 0 # DEPTH IN PIXELS TO WRITE
message2print = "{(Step 36B/70) set" + "; region2opu-set-by-copy2imagetobuffer4opu to: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; region2opu-failed-by-copy2imagetobuffer4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '36Z-'
task4copyimagetobuffer2opu ['REGION'] = region2opu
if 'OFFSET' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (37) OFFSET - WHERE TO BEGIN COPYING DATA INTO DESTINATION BUFFER - REQUIRED
# ---------------------------------------------------------------------------------------------
offset2opu = 0
message2print = "{(Step 37A/70) set" + "; offset2opu-set-by-copy2imagetobuffer4opu to: " + str(offset2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
task4copyimagetobuffer2opu ['OFFSET'] = offset2opu
code2ack = code2ack + '37A-'
# ---------------------------------------------------------------------------------------------
# EOF TASK
# ---------------------------------------------------------------------------------------------
keys2task = task4copyimagetobuffer2opu.keys()
message2print = "{(Step 39/70) set" + "; keys2task-set-by-copy2imagetobuffer4opu 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
# ---------------------------------------------------------------------------------------------
control2copyimagetobuffer4opu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2opu = False
channels2opu = ()
message2print = "{(Step 40A/70) trying" + "channels2opu-trying-by-copy2imagetobuffer4opu: " + str(channels2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
#
consumerchannel2copyimagetobuffer4opu, publisherchannel2copyimagetobuffer4opu = task4copyimagetobuffer2opu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2copyimagetobuffer4opu-got-by-copy2imagetobuffer4opu: " + str(consumerchannel2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2copyimagetobuffer4opu-got-by-copy2imagetobuffer4opu: " + str(publisherchannel2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2opu = True
control2copyimagetobuffer4opu['CONSUMERCHANNEL'] = consumerchannel2copyimagetobuffer4opu
control2copyimagetobuffer4opu['PUBLISHERCHANNEL'] = publisherchannel2copyimagetobuffer4opu
code2ack = code2ack + '40D-'
except:
ack4channels2opu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2copyimagetobuffer4opu = False
queue2copyimagetobuffer4opu = None
message2print = "{(Step 41A/70) trying" + "queue2copyimagetobuffer4opu-trying-by-copy2imagetobuffer4opu: " + str(queue2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copyimagetobuffer4opu = task4copyimagetobuffer2opu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2copyimagetobuffer4opu-got-by-copy2imagetobuffer4opu: " + str(queue2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2copyimagetobuffer4opu = True
control2copyimagetobuffer4opu['QUEUE'] = queue2copyimagetobuffer4opu
code2ack = code2ack + '41C-'
except:
ack4queue2copyimagetobuffer4opu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4opu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4opu-trying-by-copy2imagetobuffer4opu: " + str(dummy2image4opu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4opu = DummyProcess4Xi(target=manoeuvre2copyimagetobuffer4opu, # in this module to handle queue and pipe channels
# args =(queue2copyimagetobuffer4opu, # caller puts and gets - does NOT call any functions
# consumerchannel2copyimagetobuffer4opu, publisherchannel2copyimagetobuffer4opu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4opu-created-by-copy2imagetobuffer4opu: " + str(dummy2image4opu) + "; 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-copy2imagetobuffer4opu: " + 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-copy2imagetobuffer4opu: " + str(code2nack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70C/70) returning" + "; control2copyimagetobuffer4opu-returning-by-copy2imagetobuffer4opu: " + str(control2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return control2copyimagetobuffer4opu
#
# -------------------------------------------------------------------------------------------------
#copy2copybuffertoimage4opu"
# channel2copybuffertoimagepublish4opu = response4copy2buffertoimage['PUBLISHERCHANNEL']
# channel2copybuffertoimagepublish4opu.send(message2copybuffertoimagesend4opu)
# print("(Step 81B/700) OF OPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4OPU: ", channel2copybuffertoimagepublish4opu, " MESSAGE2SEND4OPU: " , message2copybuffertoimagesend4opu)
# except:
# print('(Step 81Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4OPU ', time4xi())
# # ------------------------------------------------------------------------------------------
# # (82) LET MANOEUVRE2COPYIMAGETOBUFFER4OPU TO RECEIVE COPY AND AND SEND ROGER VIA PIPE
# # ------------------------------------------------------------------------------------------
# print("(Step 82C/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4opu = manoeuvre2copybuffertoimage4opu(queue2copybuffertoimage4opu, channel2copybuffertoimageconsume4opu, channel2copybuffertoimagepublish4opu)
# print("(Step 82D/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", manoeuvre2copybuffertoimage4opu)
# except:
# print("(Step 82Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", time4xi())
# else:
# pass # trust activated thread
# # ---------------------------------------------------------------------------------------------
# # (83) RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------
# print('(Step 83A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4OPU ', time4xi())
# try:
# channel2copybuffertoimageconsume4opu = response4copy2buffertoimage['CONSUMERCHANNEL']
# message2copyimagereceive4opu = channel2copybuffertoimageconsume4opu.recv()
# print("(Step 83B/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel2copybuffertoimageconsume4opu, " CONTROL & COMMAND: ", message2copyimagereceive4opu)
# #
# except:
# print('(Step 83Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4OPU ', time4xi())
# # ---------------------------------------------------------------------------------------------------
# # (84) SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2COPYIMAGETOBUFFER4OPU TO RECEIVE
# # ---------------------------------------------------------------------------------------------------
# print('(Step 84A/700) OF OPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4OPU ', time4xi())
# try:
# message2copybuffertoimagesend4opu = "copy2copybuffertoimage4opu"
# channel2copybuffertoimagepublish4opu = response4copy2buffertoimage['PUBLISHERCHANNEL']
# channel2copybuffertoimagepublish4opu.send(message2copybuffertoimagesend4opu)
# print("(Step 84B/700) OF OPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4OPU: ", channel2copybuffertoimagepublish4opu, " MESSAGE2SEND4OPU: " , message2copybuffertoimagesend4opu)
# #
# except:
# print('(Step 84Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4OPU ', time4xi())
# # -----------------------------------------------------------------------------------
# # (85) LET MANOEUVRE2COPYIMAGETOBUFFER4OPU TO RECEIVE READY AND TO SEND READY
# # -----------------------------------------------------------------------------------
# print("(Step 85A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4opu = manoeuvre2copybuffertoimage4opu(queue2copybuffertoimage4opu, channel2copybuffertoimageconsume4opu, channel2copybuffertoimagepublish4opu)
# print("(Step 85B/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", manoeuvre2copybuffertoimage4opu)
# except:
# print("(Step 85Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", time4xi())
# # ---------------------------------------------------------------------------------------
# # (86) RECEIVE CONTROL & COMMAND READY VIA PIPE
# # ---------------------------------------------------------------------------------------
# print('(Step 86A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4OPU ', time4xi())
# try:
# channel2copybuffertoimageconsume4opu = response4copy2buffertoimage['CONSUMERCHANNEL']
# message2copyimagereceive4opu = channel2copybuffertoimageconsume4opu.recv()
# print("(Step 86B/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel2copybuffertoimageconsume4opu, " CONTROL & COMMAND: ", message2copyimagereceive4opu)
# #
# except:
# print('(Step 86Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH COPYBUFFERTOIMAGE4OPU ', time4xi())
# # -----------------------------------------------------------------------------------------
# # (87) PUT IMAGE PATH TO QUEUE
# # -----------------------------------------------------------------------------------------
# print("(Step 87A/700) OF OPU2IMAGE4XI5TEST - 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 OPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
# # ------------------------------------------------------------------------------------------------------
# # (88) LET MANOEUVRE2COPYIMAGETOBUFFER4OPU TO GET FROM QUEUE AND TO SEND EITHER ACK OR NACK VIA PIPE
# # -------------------------------------------------------------------------------------------------------
# print("(Step 88A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4opu = manoeuvre2copybuffertoimage4opu(queue2copybuffertoimage4opu, channel2copybuffertoimageconsume4opu, channel2copybuffertoimagepublish4opu)
# print("(Step 88B/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", manoeuvre2copybuffertoimage4opu)
# except:
# print("(Step 88Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (89) RECEIVE ACK OR NACK ABOUT IMAGE OPERATION VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 89A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2copyimagereceive4opu = channel2copybuffertoimageconsume4opu.recv()
# print("(Step 89D/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel2copybuffertoimageconsume4opu, " CONTROL & COMMAND: ", message2copyimagereceive4opu)
# except:
# print('(Step 89Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# # -------------------------------------------------------------------------------------------------------
# # (90) LET MANOEUVRE2COPYIMAGETOBUFFER4OPU GO TO STATE 0
# # -------------------------------------------------------------------------------------------------------
# print("(Step 90A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", time4xi())
# try:
# response2manoeuvreimagecopytobuffer4opu = manoeuvre2copybuffertoimage4opu(queue2copybuffertoimage4opu, channel2copybuffertoimageconsume4opu, channel2copybuffertoimagepublish4opu)
# print("(Step 90B/700) OF OPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4OPU ", response2manoeuvreimagecopytobuffer4opu)
# except:
# print("(Step 90Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGETOBUFFER4OPU ", time4xi())
#">
# -------------------------------------------------------------------------------------------------
def copy2buffertoimage4opu(task4copybuffertoimage2opu=None):
'''
copies buffer to image for OPU
'''
global opu2image4xi # 2D-IMAGES FOR OPU
global opu2buffer4xi # BUFFER FOR OPU
global control2copybuffertoimage4opu # COMMAND AND CONTROL FOR OPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "copy2buffertoimage4opu"
method2print = "copy2buffertoimage4opu"
message2print = "{(Step 1A/33) started" + "; copy2buffertoimage4opu-started: " + str(copy2buffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1B/33) passed" + "; task4copybuffertoimage2opu-to-copy2buffertoimage4opu: " + str(task4copybuffertoimage2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE OPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if opu2image4xi is None:
opu2image4xi = create2image4opu() # INITIALIZE IMAGE FOR OPU
message2print = "{(Step 1C/70) created" + "; opu2image4xi-created-by-copy2buffertoimage4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4opu-skipped-by-copy2buffertoimage4opu: " + str(copy2buffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# skipped
except:
try:
opu2image4xi = create2image4opu()
message2print = "{(Step 1E/70) set" + "; opu2image4xi-set-by-copy2buffertoimage4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
opu2image4xi = {}
message2print = "{(Step 1Z1/70) yielded" + "; opu2image4xi-yielded-by-copy2buffertoimage4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z1-'
# -----------------------------------------------------------------------------------------
# CREATE OPU2BUFFER4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if opu2buffer4xi is None:
opu2buffer4xi = create2buffer4opu() # INITIALIZE BUFFER FOR OPU
message2print = "{(Step 1F/70) created" + "; opu2buffer4xi-created-by-copy2buffertoimage4opu to: " + str(opu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1G/70) skipped" + "; create2buffer4opu-skipped-by-copy2buffertoimage4opu: " + str(copy2buffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# skipped
except:
try:
opu2buffer4xi = create2buffer4opu()
message2print = "{(Step 1H/70) set" + "; opu2buffer4xi-set-by-copy2buffertoimage4opu to: " + str(opu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
opu2buffer4xi = {}
message2print = "{(Step 1Z2/70) yielded" + "; opu2buffer4xi-yielded-by-copy2buffertoimage4opu: " + str(opu2buffer4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z2-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - ANALYZE TASKS
# -----------------------------------------------------------------------------------------
if task4copybuffertoimage2opu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR COPY - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4copybuffertoimage2opu = {}
message2print = "{(Step 1A/70) initialized" + "; task4copybuffertoimage2opu-created-by-copy2buffertoimage4opu to: " + str(task4copybuffertoimage2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4opu = trace2image4opu # CALLBACK FUNCTION FOR OPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4opu-created-by-copy2buffertoimage4opu to: " + str(function2callback4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2buffertoimage4opu" # MODULE OF OPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2buffertoimage4opu" # FUNCTION OF OPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2buffertoimage4opu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR OPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-copy2buffertoimage4opu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; copy2buffertoimage4opu-failed ; time: 04:41:15 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2buffertoimage4opu',
# 'METHOD': 'copy2buffertoimage4opu'}; time: 04:41:15 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4copybuffertoimage2opu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO OPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4copybuffertoimage2opu['FUNCTION2CALLBACK'] = function2callback4opu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4copybuffertoimage2opu-created-by-copy2buffertoimage4opu to: " + str(task4copybuffertoimage2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; copy2buffertoimage4opu-failed ; time: 04:41:15 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'copy2buffertoimage4opu',
# 'METHOD': 'copy2buffertoimage4opu'}}; time: 04:41:15 10/04/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-copy2buffertoimage4opu 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-copy2buffertoimage4opu: " + 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-copy2buffertoimage4opu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4copybuffertoimage2opu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2opu = {}
message2print = "{(Step 3A/70) trying" + "; context2opu-trying-by-copy2buffertoimage4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2opu = get2context4opu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2opu-got-by-copy2buffertoimage4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2opu-failed-by-copy2buffertoimage4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4copybuffertoimage2opu ['CONTEXT'] = context2opu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2opu = {}
message2print = "{(Step 4A/70) trying" + "; device2opu-trying-by-copy2buffertoimage4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2opu = get2opu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2opu-got-by-copy2buffertoimage4opu: " + str(device2opu) + "; 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" + "; device2opu-failed-by-copy2buffertoimage4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4copybuffertoimage2opu ['DEVICE'] = device2opu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE DESTINATION OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
imagedestinationinfo2opu = {}
message2print = "{(Step 5A/70) trying" + "; imagedestinationinfo2opu-trying-by-copy2buffertoimage4opu: " + str(imagedestinationinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imagedestinationinfo2opu = get2imageinfo4opu()
message2print = "{(Step 5B/70) got" + "; imagedestinationinfo2opu-got-by-copy2buffertoimage4opu: " + str(imagedestinationinfo2opu) + "; 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; create2context4opu-failed ; time: 04:41:15 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4opu',
# 'METHOD': 'create2context4opu'},
# '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" + "; imagedestinationinfo2opu-failed-by-copy2buffertoimage4opu: " + str(imagedestinationinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4copybuffertoimage2opu ['IMAGEDESTINATION'] = imagedestinationinfo2opu
# ---------------------------------------------------------------------------------------------
# (6) BUFFER SOURCE OBJECT - REQUIRED
# ---------------------------------------------------------------------------------------------
buffersourceinfo2opu = {}
message2print = "{(Step 6A/70) trying" + "; buffersourceinfo2opu-trying-by-copy2buffertoimage4opu: " + str(buffersourceinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
buffersourceinfo2opu = get2bufferinfo4opu()
message2print = "{(Step 6B/70) got" + "; buffersourceinfo2opu-got-by-copy2buffertoimage4opu: " + str(buffersourceinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4opu-failed ; time: 04:41:15 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4opu',
# 'METHOD': 'create2buffer4opu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': ...
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; buffersourceinfo2opu-failed-by-copy2buffertoimage4opu: " + str(buffersourceinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4copybuffertoimage2opu ['BUFFERSOURCE'] = buffersourceinfo2opu
# ---------------------------------------------------------------------------------------------
# (7) QUEUE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
queue2copybuffertoimage4opu = None
message2print = "{(Step 7A/70) trying" + "; queue2copybuffertoimage4opu-trying-by-copy2buffertoimage4opu: " + str(queue2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copybuffertoimage4opu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 7B/70) got" + "; queue2copybuffertoimage4opu-got-by-copy2buffertoimage4opu: " + str(queue2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; queue2copybuffertoimage4opu-failed-by-copy2buffertoimage4opu: " + str(queue2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4copybuffertoimage2opu ['QUEUE'] = queue2copybuffertoimage4opu
# ---------------------------------------------------------------------------------------------
# (8) PIPE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
pipe2opu = None
message2print = "{(Step 8A/70) trying" + "; pipe2opu-trying-by-copy2buffertoimage4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2opu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 8B/70) got" + "; pipe2opu-got-by-copy2buffertoimage4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; pipe2opu-failed-by-copy2buffertoimage4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4copybuffertoimage2opu ['PIPE'] = pipe2opu
# ---------------------------------------------------------------------------------------------
# (9) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2opu = {}
message2print = "{(Step 9A/70) trying" + "; commandqueueinfo2opu-trying-by-copy2buffertoimage4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2opu = get2commandqueueinfo4opu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; commandqueueinfo2opu-got-by-copy2buffertoimage4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': ...
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; commandqueueinfo2opu-failed-by-copy2buffertoimage4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4copybuffertoimage2opu ['COMMANDQUEUE'] = commandqueueinfo2opu
# ---------------------------------------------------------------------------------------------
# (11) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2opu = {}
message2print = "{(Step 11A/70) trying" + "; eventinfo2opu-trying-by-copy2buffertoimage4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2opu = get2eventinfo4opu()
message2print = "{(Step 11B/70) got" + "; eventinfo2opu-got-by-copy2buffertoimage4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'DATA2CALLBACK': ...
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; eventinfo2opu-failed-by-copy2buffertoimage4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4copybuffertoimage2opu ['EVENT'] = eventinfo2opu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2opu = {}
message2print = "{(Step 12A/70) trying" + "; eventwaitlist2opu-trying-by-copy2buffertoimage4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2opu = {}
message2print = "{(Step 12B/70) set" + "; eventwaitlist2opu-set-by-copy2buffertoimage4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlist2opu-failed-by-copy2buffertoimage4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4copybuffertoimage2opu ['EVENTWAITLIST'] = eventwaitlist2opu
# ---------------------------------------------------------------------------------------------
# (13) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2opu = 0
message2print = "{(Step 13A/70) trying" + "; eventwaitlistquantity2opu-trying-by-copy2buffertoimage4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2opu.keys()
for key2event in keys2event:
eventwaitlistquantity2opu = eventwaitlistquantity2opu + 1
message2print = "{(Step 13B/70) set" + "; eventwaitlistquantity2opu-set-by-copy2buffertoimage4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; eventwaitlistquantity2opu-failed-by-copy2buffertoimage4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4copybuffertoimage2opu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2opu
# ---------------------------------------------------------------------------------------------
# (15) ORIGIN FOR DESTINATION - REQUIRED
# ---------------------------------------------------------------------------------------------
origin4destination2opu = {}
message2print = "{(Step 15A/70) trying" + "; origin4destination2opu-trying-by-copy2buffertoimage4opu: " + str(origin4destination2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin4destination2opu['X'] = 100
origin4destination2opu['Y'] = 100
origin4destination2opu['Z'] = 100
message2print = "{(Step 15B/70) set" + "; origin4destination2opu-set-by-copy2buffertoimage4opu to: " + str(origin4destination2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 100, 'X': 100, 'Z': 100}
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; origin4destination2opu-failed-by-copy2buffertoimage4opu: " + str(origin4destination2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '15Z-'
task4copybuffertoimage2opu ['DESTINATIONORIGIN'] = origin4destination2opu
# --------------------------------------------------------------------------------------------------------
# (16) REGION - REGION OF A IMAGE TO BE COPIED
# --------------------------------------------------------------------------------------------------------
region4copy2opu = {}
message2print = "{(Step 16A/70) trying" + "; region4copy2opu-trying-by-copy2buffertoimage4opu: " + str(region4copy2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region4copy2opu['X'] = 10
region4copy2opu['Y'] = 10
region4copy2opu['Z'] = 10
message2print = "{(Step 16B/70) set" + "; region4copy2opu-set-by-copy2buffertoimage4opu to: " + str(region4copy2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 10, 'X': 10, 'Z': 10}
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; region4copy2opu-failed-by-copy2buffertoimage4opu: " + str(region4copy2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '16Z-'
task4copybuffertoimage2opu ['REGION'] = region4copy2opu
# --------------------------------------------------------------------------------------------------------
# (17) OFFSET - WHERE TO BEGIN COPYING DATA FROM SOURCE BUFFER
# --------------------------------------------------------------------------------------------------------
offset4copy2opu = 0
message2print = "{(Step 17A/70) set" + "; offset4copy2opu-set-by-copy2buffertoimage4opu to: " + str(offset4copy2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
task4copybuffertoimage2opu ['OFFSET'] = offset4copy2opu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------
# ANALYZE TASKS - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4copybuffertoimage2opu.keys()
message2print = "{(Step 20/70) got" + "; keys2task-got-by-copy2buffertoimage4opu: " + 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
# ---------------------------------------------------------------------------------------------
function2callback4opu = trace2image4opu # CALLBACK FUNCTION FOR OPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4opu-created-by-copy2buffertoimage4opu to: " + str(function2callback4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "copy2buffertoimage4opu" # MODULE OF OPUIZED OPENCL MODULE
args2callback['METHOD'] = "copy2buffertoimage4opu" # FUNCTION OF OPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; copy2buffertoimage4opu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR OPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-copy2buffertoimage4opu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4copybuffertoimage2opu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO OPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4copybuffertoimage2opu['FUNCTION2CALLBACK'] = function2callback4opu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4copybuffertoimage2opu-created-by-copy2buffertoimage4opu to: " + str(task4copybuffertoimage2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-copy2buffertoimage4opu 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-copy2buffertoimage4opu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-copy2buffertoimage4opu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4copybuffertoimage2opu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2opu = {}
message2print = "{(Step 23A/70) trying" + "; context2opu-trying-by-copy2buffertoimage4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2opu = get2context4opu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2opu-got-by-copy2buffertoimage4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2opu-failed-by-copy2buffertoimage4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4copybuffertoimage2opu ['CONTEXT'] = context2opu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2opu = {}
message2print = "{(Step 24A/70) trying" + "; device2opu-trying-by-copy2buffertoimage4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2opu = get2opu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2opu-got-by-copy2buffertoimage4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2opu-failed-by-copy2buffertoimage4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4copybuffertoimage2opu ['DEVICE'] = device2opu
if 'IMAGEDESTINATION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) DESTINATION IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
destinationimageinfo2opu = {}
message2print = "{(Step 25A/70) trying" + "; destinationimageinfo2opu-trying-by-copy2buffertoimage4opu: " + str(destinationimageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
destinationimageinfo2opu = get2imageinfo4opu()
message2print = "{(Step 25B/70) got" + "; destinationimageinfo2opu-got-by-copy2buffertoimage4opu: " + str(destinationimageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; destinationimageinfo2opu-failed-by-copy2buffertoimage4opu: " + str(destinationimageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4copybuffertoimage2opu ['IMAGEDESTINATION'] = destinationimageinfo2opu
if 'BUFFERSOURCE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) SOURCE BUFFER - REQUIRED
# ---------------------------------------------------------------------------------------------
sourcebufferinfo2opu = {}
message2print = "{(Step 26A/70) trying" + "; sourcebufferinfo2opu-trying-by-copy2buffertoimage4opu: " + str(sourcebufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
sourcebufferinfo2opu = get2bufferinfo4opu()
message2print = "{(Step 26B/70) got" + "; sourcebufferinfo2opu-got-by-copy2buffertoimage4opu: " + str(sourcebufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; sourcebufferinfo2opu-failed-by-copy2buffertoimage4opu: " + str(sourcebufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4copybuffertoimage2opu ['BUFFERSOURCE'] = sourcebufferinfo2opu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) QUEUE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
queue2copybuffertoimage4opu = None
message2print = "{(Step 27A/70) trying" + "; queue2copybuffertoimage4opu-trying-by-copy2buffertoimage4opu: " + str(queue2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copybuffertoimage4opu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 27B/70) got" + "; queue2copybuffertoimage4opu-got-by-copy2buffertoimage4opu: " + str(queue2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; queue2copybuffertoimage4opu-failed-by-copy2buffertoimage4opu: " + str(queue2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4copybuffertoimage2opu ['QUEUE'] = queue2copybuffertoimage4opu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) PIPE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
pipe2opu = None
message2print = "{(Step 28A/70) trying" + "; pipe2opu-trying-by-copy2buffertoimage4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2opu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 28B/70) got" + "; pipe2opu-got-by-copy2buffertoimage4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; pipe2opu-failed-by-copy2buffertoimage4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4copybuffertoimage2opu ['PIPE'] = pipe2opu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2opu = {}
message2print = "{(Step 29A/70) trying" + "; commandqueueinfo2opu-trying-by-copy2buffertoimage4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2opu = get2commandqueueinfo4opu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; commandqueueinfo2opu-got-by-copy2buffertoimage4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; commandqueueinfo2opu-failed-by-copy2buffertoimage4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4copybuffertoimage2opu ['COMMANDQUEUE'] = commandqueueinfo2opu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2opu = {}
message2print = "{(Step 31A/70) trying" + "; eventinfo2opu-trying-by-copy2buffertoimage4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2opu = get2eventinfo4opu()
message2print = "{(Step 31B/70) got" + "; eventinfo2opu-got-by-copy2buffertoimage4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventinfo2opu-failed-by-copy2buffertoimage4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4copybuffertoimage2opu ['EVENT'] = eventinfo2opu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2opu = {}
message2print = "{(Step 32A/70) trying" + "; eventwaitlist2opu-trying-by-copy2buffertoimage4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2opu = {}
message2print = "{(Step 32B/70) set" + "; eventwaitlist2opu-set-by-copy2buffertoimage4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlist2opu-failed-by-copy2buffertoimage4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4copybuffertoimage2opu ['EVENTWAITLIST'] = eventwaitlist2opu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2opu = 0
message2print = "{(Step 33A/70) trying" + "; eventwaitlistquantity2opu-trying-by-copy2buffertoimage4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2opu.keys()
for key2event in keys2event:
eventwaitlistquantity2opu = eventwaitlistquantity2opu + 1
message2print = "{(Step 33B/70) set" + "; eventwaitlistquantity2opu-set-by-copy2buffertoimage4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; eventwaitlistquantity2opu-failed-by-copy2buffertoimage4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4copybuffertoimage2opu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2opu
if 'DESTINATIONORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) DESTINATIONORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
destination4origin2opu = {}
message2print = "{(Step 34A/70) trying" + "; destination4origin2opu-trying-by-copy2buffertoimage4opu: " + str(destination4origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
destination4origin2opu['X'] = 0
destination4origin2opu['Y'] = 0
destination4origin2opu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; destination4origin2opu-set-by-copy2buffertoimage4opu to: " + str(destination4origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; destination4origin2opu-failed-by-copy2buffertoimage4opu: " + str(destination4origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4copybuffertoimage2opu ['DESTINATIONORIGIN'] = destination4origin2opu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (36) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2opu = {}
message2print = "{(Step 36A/70) trying" + "; region2opu-trying-by-copy2buffertoimage4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2opu['X'] = 160 # WIDTH IN PIXELS TO WRITE
region2opu['Y'] = 90 # HEIGHT IN PIXELS TO WRITE
region2opu['Z'] = 0 # DEPTH IN PIXELS TO WRITE
message2print = "{(Step 36B/70) set" + "; region2opu-set-by-copy2buffertoimage4opu to: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; region2opu-failed-by-copy2buffertoimage4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '36Z-'
task4copybuffertoimage2opu ['REGION'] = region2opu
if 'OFFSET' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (37) OFFSET - WHERE TO BEGIN COPYING DATA FROM SOURCE BUFFER - REQUIRED
# ---------------------------------------------------------------------------------------------
offset2opu = 0
message2print = "{(Step 37A/70) set" + "; offset2opu-set-by-copy2buffertoimage4opu to: " + str(offset2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
task4copybuffertoimage2opu ['OFFSET'] = offset2opu
code2ack = code2ack + '37A-'
# ---------------------------------------------------------------------------------------------
# EOF TASK ANALYSIS
# ---------------------------------------------------------------------------------------------
keys2task = task4copybuffertoimage2opu.keys()
message2print = "{(Step 39/70) set" + "; keys2task-set-by-copy2buffertoimage4opu 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
# ---------------------------------------------------------------------------------------------
control2copybuffertoimage4opu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2opu = False
channels2opu = ()
message2print = "{(Step 40A/70) trying" + "channels2opu-trying-by-copy2buffertoimage4opu: " + str(channels2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
#
consumerchannel2copybuffertoimage4opu, publisherchannel2copybuffertoimage4opu = task4copybuffertoimage2opu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2copybuffertoimage4opu-got-by-copy2buffertoimage4opu: " + str(consumerchannel2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2copybuffertoimage4opu-got-by-copy2buffertoimage4opu: " + str(publisherchannel2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2opu = True
control2copybuffertoimage4opu['CONSUMERCHANNEL'] = consumerchannel2copybuffertoimage4opu
control2copybuffertoimage4opu['PUBLISHERCHANNEL'] = publisherchannel2copybuffertoimage4opu
code2ack = code2ack + '40D-'
except:
ack4channels2opu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2copybuffertoimage4opu = False
queue2copybuffertoimage4opu = None
message2print = "{(Step 41A/70) trying" + "queue2copybuffertoimage4opu-trying-by-copy2buffertoimage4opu: " + str(queue2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2copybuffertoimage4opu = task4copybuffertoimage2opu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2copybuffertoimage4opu-got-by-copy2buffertoimage4opu: " + str(queue2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2copybuffertoimage4opu = True
control2copybuffertoimage4opu['QUEUE'] = queue2copybuffertoimage4opu
code2ack = code2ack + '41C-'
except:
ack4queue2copybuffertoimage4opu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4opu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4opu-trying-by-copy2buffertoimage4opu: " + str(dummy2image4opu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4opu = DummyProcess4Xi(target=manoeuvre2copybuffertoimage4opu, # in this module to handle queue and pipe channels
# args =(queue2copybuffertoimage4opu, # caller puts and gets - does NOT call any functions
# consumerchannel2copybuffertoimage4opu, publisherchannel2copybuffertoimage4opu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4opu-created-by-copy2buffertoimage4opu: " + str(dummy2image4opu) + "; 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-copy2buffertoimage4opu: " + 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-copy2buffertoimage4opu: " + str(code2nack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70C/70) returning" + "; control2copybuffertoimage4opu-returning-by-copy2buffertoimage4opu: " + str(control2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 04:52:11 10/04/11 Pacific Daylight Time}
return control2copybuffertoimage4opu
#
# -------------------------------------------------------------------------------------------------
#copy2read4opu"
# channel2readpublish4opu = response4read2image['PUBLISHERCHANNEL']
# channel2readpublish4opu.send(message2readsend4opu)
# print("(Step 17B/700) OF OPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4OPU: ", channel2readpublish4opu, " MESSAGE2SEND4OPU: " , message2readsend4opu)
# except:
# print('(Step 17Z1/700) OF OPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4OPU ', time4xi())
# # ------------------------------------------------------------------------------------------
# # (18) LET MANOEUVRE2IMAGE4OPU TO RECEIVE COPY AND AND SEND ROGER VIA PIPE
# # ------------------------------------------------------------------------------------------
# print("(Step 18C/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# try:
# response2manoeuvre4opu = manoeuvre2readimage4opu(queue2read4opu, channel2readconsume4opu, channel2readpublish4opu)
# print("(Step 18D/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", manoeuvre2readimage4opu)
# except:
# print("(Step 18Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# else:
# pass # trust activated thread
# # ---------------------------------------------------------------------------------------------
# # (19) RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------
# print('(Step 19A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4OPU ', time4xi())
# try:
# channel2readconsume4opu = response4read2image['CONSUMERCHANNEL']
# message2readreceive4opu = channel2readconsume4opu.recv()
# print("(Step 19B/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel2readconsume4opu, " CONTROL & COMMAND: ", message2readreceive4opu)
# # roger2read4opu
# except:
# print('(Step 19Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4OPU ', time4xi())
# # ---------------------------------------------------------------------------------------------------
# # (20) SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2IMAGE4OPU TO RECEIVE
# # ---------------------------------------------------------------------------------------------------
# print('(Step 20A/700) OF OPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4OPU ', time4xi())
# try:
# message2readsend4opu = "ready2read4opu"
# channel2readpublish4opu = response4read2image['PUBLISHERCHANNEL']
# channel2readpublish4opu.send(message2readsend4opu)
# print("(Step 20B/700) OF OPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4OPU: ", channel2readpublish4opu, " MESSAGE2SEND4OPU: " , message2readsend4opu)
# # ready2read4opu
# except:
# print('(Step 20Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4OPU ', time4xi())
# # -----------------------------------------------------------------------------------
# # (21) LET MANOEUVRE2IMAGE4OPU TO RECEIVE READY AND TO SEND READY
# # -----------------------------------------------------------------------------------
# print("(Step 21A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# try:
# response2manoeuvre4opu = manoeuvre2readimage4opu(queue2read4opu, channel2readconsume4opu, channel2readpublish4opu)
# print("(Step 21B/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", manoeuvre2readimage4opu)
# except:
# print("(Step 21Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# # ---------------------------------------------------------------------------------------
# # (22) RECEIVE CONTROL & COMMAND READY VIA PIPE
# # ---------------------------------------------------------------------------------------
# print('(Step 22A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4OPU ', time4xi())
# try:
# channel2readconsume4opu = response4read2image['CONSUMERCHANNEL']
# message2readreceive4opu = channel2readconsume4opu.recv()
# print("(Step 22B/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel2readconsume4opu, " CONTROL & COMMAND: ", message2readreceive4opu)
# # ready2read4opu
# except:
# print('(Step 22Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4OPU ', time4xi())
# # -----------------------------------------------------------------------------------------
# # (24) PUT IMAGE PATH TO QUEUE
# # -----------------------------------------------------------------------------------------
# print("(Step 24A/700) OF OPU2IMAGE4XI5TEST - 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 OPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
# # ------------------------------------------------------------------------------------------------------
# # (25) LET MANOEUVRE2IMAGE4OPU TO GET FROM QUEUE AND TO SEND EITHER ACK OR NACK VIA PIPE
# # -------------------------------------------------------------------------------------------------------
# print("(Step 25A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# try:
# response2manoeuvre4opu = manoeuvre2readimage4opu(queue2read4opu, channel2readconsume4opu, channel2readpublish4opu)
# print("(Step 25B/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", manoeuvre2readimage4opu)
# except:
# print("(Step 25Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (26) RECEIVE ACK OR NACK ABOUT IMAGE OPERATION VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 26A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2readreceive4opu = channel2readconsume4opu.recv()
# print("(Step 26D/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel2readconsume4opu, " CONTROL & COMMAND: ", message2readreceive4opu)
# # ack2imageinfo4opu
# except:
# print('(Step 26Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# # -------------------------------------------------------------------------------------------------------
# # (27) LET MANOEUVRE2IMAGE4OPU GO TO STATE 0
# # -------------------------------------------------------------------------------------------------------
# print("(Step 27A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# try:
# response2manoeuvre4opu = manoeuvre2readimage4opu(queue2read4opu, channel2readconsume4opu, channel2readpublish4opu)
# print("(Step 27B/700) OF OPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4OPU ", response2manoeuvre4opu)
# except:
# print("(Step 27Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
#">
# -------------------------------------------------------------------------------------------------
def read2image4opu(task4imageread2opu=None):
'''
reads 2D images for OPU
'''
global opu2image4xi # 2D-IMAGES FOR OPU
global control2readimage4opu # COMMAND AND CONTROL FOR OPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "read2image4opu"
method2print = "read2image4opu"
message2print = "{(Step 1A/33) started" + "; read2image4opu-started: " + str(read2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4imageread2opu-to-read2image4opu: " + str(task4imageread2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE OPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if opu2image4xi is None:
opu2image4xi = create2image4opu() # INITIALIZE IMAGE FOR OPU
message2print = "{(Step 1C/70) created" + "; opu2image4xi-created-by-read2image4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4opu-skipped-by-read2image4opu: " + str(read2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# skipped
except:
try:
opu2image4xi = create2image4opu()
message2print = "{(Step 1E/70) set" + "; opu2image4xi-set-by-read2image4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
opu2image4xi = {}
message2print = "{(Step 1Z/70) yielded" + "; opu2image4xi-yielded-by-read2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - CHECK PARAMETERS
# -----------------------------------------------------------------------------------------
try:
if task4imageread2opu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR READ - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4imageread2opu = {}
message2print = "{(Step 1A/70) initialized" + "; task4imageread2opu-created-by-read2image4opu to: " + str(task4imageread2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4opu = trace2image4opu # CALLBACK FUNCTION FOR OPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4opu-created-by-read2image4opu to: " + str(function2callback4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ;
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "read2image4opu" # MODULE OF OPUIZED OPENCL MODULE
args2callback['METHOD'] = "read2image4opu" # FUNCTION OF OPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; read2image4opu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR OPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-read2image4opu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; read2image4opu-failed ; time: 05:06:38 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'read2image4opu',
# 'METHOD': 'read2image4opu'}; time: 05:06:38 10/04/11 Pacific Daylight Time}
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imageread2opu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO OPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imageread2opu['FUNCTION2CALLBACK'] = function2callback4opu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4imageread2opu-created-by-read2image4opu to: " + str(task4imageread2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; read2image4opu-failed ; time: 05:06:38 10/04/11 Pacific Daylight Time}',
# 'CLASS': 'read2image4opu',
# 'METHOD': 'read2image4opu'}}; time: 05:06:38 10/04/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-read2image4opu 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-read2image4opu: " + 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-read2image4opu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4imageread2opu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2opu = {}
message2print = "{(Step 3A/70) trying" + "; context2opu-trying-by-read2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2opu = get2context4opu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2opu-got-by-read2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2opu-failed-by-read2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4imageread2opu ['CONTEXT'] = context2opu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2opu = {}
message2print = "{(Step 4A/70) trying" + "; device2opu-trying-by-read2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2opu = get2opu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2opu-got-by-read2image4opu: " + str(device2opu) + "; 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" + "; device2opu-failed-by-read2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4imageread2opu ['DEVICE'] = device2opu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2opu = {}
message2print = "{(Step 5A/70) trying" + "; imageinfo2opu-trying-by-read2image4opu: " + str(imageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2opu = get2imageinfo4opu()
message2print = "{(Step 5B/70) got" + "; imageinfo2opu-got-by-read2image4opu: " + str(imageinfo2opu) + "; 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" + "; imageinfo2opu-failed-by-read2image4opu: " + str(imageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4imageread2opu ['IMAGE'] = imageinfo2opu
# ---------------------------------------------------------------------------------------------
# (6) QUEUE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
queue2opu = None
message2print = "{(Step 6A/70) trying" + "; queue2opu-trying-by-read2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2opu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 6B/70) got" + "; queue2opu-got-by-read2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; queue2opu-failed-by-read2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4imageread2opu ['QUEUE'] = queue2opu
# ---------------------------------------------------------------------------------------------
# (7) PIPE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
pipe2opu = None
message2print = "{(Step 7A/70) trying" + "; pipe2opu-trying-by-read2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2opu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 7B/70) got" + "; pipe2opu-got-by-read2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; pipe2opu-failed-by-read2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4imageread2opu ['PIPE'] = pipe2opu
# ---------------------------------------------------------------------------------------------
# (8) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2opu = {}
message2print = "{(Step 8A/70) trying" + "; commandqueueinfo2opu-trying-by-read2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2opu = get2commandqueueinfo4opu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 8B/70) got" + "; commandqueueinfo2opu-got-by-read2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; commandqueueinfo2opu-failed-by-read2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4imageread2opu ['COMMANDQUEUE'] = commandqueueinfo2opu
# ---------------------------------------------------------------------------------------------
# (9) BUFFER - AUTOMATIC BY OPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2opu = {}
message2print = "{(Step 9A/70) trying" + "; bufferinfo2opu-trying-by-read2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2opu = get2bufferinfo4opu() # SYSTEM CREATES BUFFER FOR OPU, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; bufferinfo2opu-got-by-read2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; bufferinfo2opu-failed-by-read2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4imageread2opu ['BUFFER'] = bufferinfo2opu
# ---------------------------------------------------------------------------------------------
# (10) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2opu = {}
message2print = "{(Step 10A/70) trying" + "; eventinfo2opu-trying-by-read2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2opu = get2eventinfo4opu()
message2print = "{(Step 10B/70) got" + "; eventinfo2opu-got-by-read2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'DATA2CALLBACK': {'MESSAGE': ...
code2ack = code2ack + '10B-'
except:
message2print = "{(Step 10Z/70) failed" + "; eventinfo2opu-failed-by-read2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '10Z-'
task4imageread2opu ['EVENT'] = eventinfo2opu
# ---------------------------------------------------------------------------------------------
# (11) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2opu = {}
message2print = "{(Step 11A/70) trying" + "; eventwaitlist2opu-trying-by-read2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2opu = {}
message2print = "{(Step 11B/70) set" + "; eventwaitlist2opu-set-by-read2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; eventwaitlist2opu-failed-by-read2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4imageread2opu ['EVENTWAITLIST'] = eventwaitlist2opu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2opu = 0
message2print = "{(Step 12A/70) trying" + "; eventwaitlistquantity2opu-trying-by-read2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2opu.keys()
for key2event in keys2event:
eventwaitlistquantity2opu = eventwaitlistquantity2opu + 1
message2print = "{(Step 12B/70) set" + "; eventwaitlistquantity2opu-set-by-read2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlistquantity2opu-failed-by-read2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4imageread2opu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2opu
# ---------------------------------------------------------------------------------------------
# (13) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2opu = ' '
message2print = "{(Step 13A/70) trying" + "; blocking2opu-trying-by-read2image4opu: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2opu = 'CL_FALSE' # the read command is non-blocking
message2print = "{(Step 13B/70) set" + "; blocking2opu-set-by-read2image4opu to: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# CL_FALSE
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; blocking2opu-failed-by-read2image4opu: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4imageread2opu ['BLOCKING'] = blocking2opu
# ---------------------------------------------------------------------------------------------
# (14) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2opu = {}
message2print = "{(Step 14A/70) trying" + "; origin2opu-trying-by-read2image4opu: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2opu['X'] = 0
origin2opu['Y'] = 0
origin2opu['Z'] = 0
message2print = "{(Step 14B/70) set" + "; origin2opu-set-by-read2image4opu to: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 0, 'X': 0, 'Z': 0}
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; origin2opu-failed-by-read2image4opu: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4imageread2opu ['ORIGIN'] = origin2opu
# ---------------------------------------------------------------------------------------------
# (15) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2opu = {}
message2print = "{(Step 15A/70) trying" + "; region2opu-trying-by-read2image4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2opu['X'] = 160 # WIDTH IN PIXELS TO READ
region2opu['Y'] = 90 # HEIGHT IN PIXELS TO READ
region2opu['Z'] = 0 # DEPTH IN PIXELS TO READ
message2print = "{(Step 15B/70) set" + "; region2opu-set-by-read2image4opu to: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 90, 'X': 160, 'Z': 0}
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; region2opu-failed-by-read2image4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '15Z-'
task4imageread2opu ['REGION'] = region2opu
# ---------------------------------------------------------------------------------------------
# (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.
rowpitch2opu = 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
width2opu = 800
message2print = "{(Step 16A/70) trying" + "; rowpitch2opu-trying-by-read2image4opu: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2opu = int(width2opu * 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" + "; rowpitch2opu-set-by-read2image4opu to: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 8000
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; rowpitch2opu-failed-by-read2image4opu: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '16Z-'
task4imageread2opu ['ROWPITCH'] = rowpitch2opu
# ----------------------------------------------------------------------------------------------------
# (17) POINTER - REQUIRED - THE POINTER TO A BUFFER IN HOST MEMORY WHERE IMAGE DATA IS TO BE READ FROM
# ----------------------------------------------------------------------------------------------------
pointer2opu = None
height2opu = 800
size2opu = int(width2opu * height2opu) # CALCULATED MEMORY
if size2opu == 0:
size2opu = 4400 # MINIMUM MEMORY
message2print = "{(Step 17A/70) trying" + "; pointer2opu-trying-by-read2image4opu: " + str(pointer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
arena2opu = Arena4Xi(size2opu) # SYSTEM RESERVER MEMORY FOR IMAGE
message2print = "{(Step 17B/70) got" + "; arena2opu-got-by-read2image4opu: " + str(arena2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
size2arena = arena2opu.size #
message2print = "{(Step 17C/70) got" + "; size2arena-got-by-read2buffer4opu: " + str(size2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 640000
buffer2arena = arena2opu.buffer
message2print = "{(Step 17D/70) got" + "; buffer2arena-got-by-read2buffer4opu: " + str(buffer2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17D-'
if size2arena < size2opu:
size2opu = size2arena # AVAILABLE MEMORY FOR IMAGE
message2print = "{(Step 17E/70) set" + "; size2opu-set-by-read2buffer4opu to: " + str(size2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17E-'
else:
pass
pointer2opu = buffer2arena
message2print = "{(Step 17F/70) set" + "; pointer2opu-set-by-read2buffer4opu to: " + str(pointer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17F-'
except:
message2print = "{(Step 17Z/70) failed" + "; pointer2opu-failed-by-read2image4opu: " + str(pointer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '17Z-'
task4imageread2opu ['POINTER'] = pointer2opu
task4imageread2opu ['SIZE'] = size2opu # AUTOMATIC BY OPUXI
# --------------------------------------------------------------------------------------------------------
# (18) SLICEPITCH - REQUIRED - THE SIZE IN BYTES OF THE 2D SLICE OF THE 3D REGION OF A 3D IMAGE BEING READ
# --------------------------------------------------------------------------------------------------------
slicepitch2opu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 18A/70) trying" + "; slicepitch2opu-trying-by-read2image4opu: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2opu = 0
message2print = "{(Step 18B/70) set" + "; slicepitch2opu-set-by-read2image4opu to: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '18B-'
except:
message2print = "{(Step 18Z/70) failed" + "; slicepitch2opu-failed-by-read2image4opu: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '18Z-'
task4imageread2opu ['SLICEPITCH'] = slicepitch2opu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
else:
pass
# ---------------------------------------------------------------------------------------------
# ANALYSE TASKS - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4imageread2opu.keys()
message2print = "{(Step 20/70) got" + "; keys2task-got-by-read2image4opu: " + 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
# ---------------------------------------------------------------------------------------------
function2callback4opu = trace2image4opu # CALLBACK FUNCTION FOR OPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4opu-created-by-read2image4opu to: " + str(function2callback4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "read2image4opu" # MODULE OF OPUIZED OPENCL MODULE
args2callback['METHOD'] = "read2image4opu" # FUNCTION OF OPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; read2image4opu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR OPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-read2image4opu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imageread2opu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO OPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imageread2opu['FUNCTION2CALLBACK'] = function2callback4opu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4imageread2opu-created-by-read2image4opu to: " + str(task4imageread2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-read2image4opu 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-read2image4opu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-read2image4opu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4imageread2opu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2opu = {}
message2print = "{(Step 23A/70) trying" + "; context2opu-trying-by-read2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2opu = get2context4opu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2opu-got-by-read2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2opu-failed-by-read2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4imageread2opu ['CONTEXT'] = context2opu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2opu = {}
message2print = "{(Step 24A/70) trying" + "; device2opu-trying-by-read2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2opu = get2opu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2opu-got-by-read2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2opu-failed-by-read2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4imageread2opu ['DEVICE'] = device2opu
if 'IMAGE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2opu = {}
message2print = "{(Step 25A/70) trying" + "; imageinfo2opu-trying-by-read2image4opu: " + str(imageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2opu = get2imageinfo4opu()
message2print = "{(Step 25B/70) got" + "; imageinfo2opu-got-by-read2image4opu: " + str(imageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; imageinfo2opu-failed-by-read2image4opu: " + str(imageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4imageread2opu ['IMAGE'] = imageinfo2opu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) QUEUE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
queue2opu = None
message2print = "{(Step 26A/70) trying" + "; queue2opu-trying-by-read2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2opu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 26B/70) got" + "; queue2opu-got-by-read2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; queue2opu-failed-by-read2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4imageread2opu ['QUEUE'] = queue2opu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) PIPE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
pipe2opu = None
message2print = "{(Step 27A/70) trying" + "; pipe2opu-trying-by-read2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2opu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 27B/70) got" + "; pipe2opu-got-by-read2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; pipe2opu-failed-by-read2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4imageread2opu ['PIPE'] = pipe2opu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2opu = {}
message2print = "{(Step 28A/70) trying" + "; commandqueueinfo2opu-trying-by-read2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2opu = get2commandqueueinfo4opu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 28B/70) got" + "; commandqueueinfo2opu-got-by-read2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; commandqueueinfo2opu-failed-by-read2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4imageread2opu ['COMMANDQUEUE'] = commandqueueinfo2opu
if 'BUFFER' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (29) BUFFER - AUTOMATIC BY OPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2opu = {}
message2print = "{(Step 29A/70) trying" + "; bufferinfo2opu-trying-by-read2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2opu = get2bufferinfo4opu() # SYSTEM CREATES BUFFER FOR OPU, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; bufferinfo2opu-got-by-read2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; bufferinfo2opu-failed-by-read2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4imageread2opu ['BUFFER'] = bufferinfo2opu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (30) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2opu = {}
message2print = "{(Step 30A/70) trying" + "; eventinfo2opu-trying-by-read2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2opu = get2eventinfo4opu()
message2print = "{(Step 30B/70) got" + "; eventinfo2opu-got-by-read2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '30B-'
except:
message2print = "{(Step 30Z/70) failed" + "; eventinfo2opu-failed-by-read2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '30Z-'
task4imageread2opu ['EVENT'] = eventinfo2opu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2opu = {}
message2print = "{(Step 31A/70) trying" + "; eventwaitlist2opu-trying-by-read2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2opu = {}
message2print = "{(Step 31B/70) set" + "; eventwaitlist2opu-set-by-read2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventwaitlist2opu-failed-by-read2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4imageread2opu ['EVENTWAITLIST'] = eventwaitlist2opu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2opu = 0
message2print = "{(Step 32A/70) trying" + "; eventwaitlistquantity2opu-trying-by-read2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2opu.keys()
for key2event in keys2event:
eventwaitlistquantity2opu = eventwaitlistquantity2opu + 1
message2print = "{(Step 32B/70) set" + "; eventwaitlistquantity2opu-set-by-read2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlistquantity2opu-failed-by-read2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4imageread2opu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2opu
if 'BLOCKING' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2opu = ' '
message2print = "{(Step 33A/70) trying" + "; blocking2opu-trying-by-read2image4opu: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2opu = 'CL_FALSE' # the read command is non-blocking
message2print = "{(Step 33B/70) set" + "; blocking2opu-set-by-read2image4opu to: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; blocking2opu-failed-by-read2image4opu: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4imageread2opu ['BLOCKING'] = blocking2opu
if 'ORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2opu = {}
message2print = "{(Step 34A/70) trying" + "; origin2opu-trying-by-read2image4opu: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2opu['X'] = 0
origin2opu['Y'] = 0
origin2opu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; origin2opu-set-by-read2image4opu to: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; origin2opu-failed-by-read2image4opu: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4imageread2opu ['ORIGIN'] = origin2opu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (35) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2opu = {}
message2print = "{(Step 35A/70) trying" + "; region2opu-trying-by-read2image4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2opu['X'] = 160 # WIDTH IN PIXELS TO READ
region2opu['Y'] = 90 # HEIGHT IN PIXELS TO READ
region2opu['Z'] = 0 # DEPTH IN PIXELS TO READ
message2print = "{(Step 35B/70) set" + "; region2opu-set-by-read2image4opu to: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '35B-'
except:
message2print = "{(Step 35Z/70) failed" + "; region2opu-failed-by-read2image4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '35Z-'
task4imageread2opu ['REGION'] = region2opu
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.
rowpitch2opu = 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" + "; rowpitch2opu-trying-by-read2image4opu: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2opu = int(width2opu * 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" + "; rowpitch2opu-set-by-read2image4opu to: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; rowpitch2opu-failed-by-read2image4opu: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '36Z-'
task4imageread2opu ['ROWPITCH'] = rowpitch2opu
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
# ----------------------------------------------------------------------------------------------------
pointer2opu = None
size2opu = int(width2opu * height2opu) # CALCULATED MEMORY
if size2opu == 0:
size2opu = 4400 # MINIMUM MEMORY
message2print = "{(Step 37A/70) trying" + "; pointer2opu-trying-by-read2image4opu: " + str(pointer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
arena2opu = Arena4Xi(size2opu) # SYSTEM RESERVER MEMORY FOR IMAGE
message2print = "{(Step 37B/70) got" + "; arena2opu-got-by-read2image4opu: " + str(arena2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
size2arena = arena2opu.size #
message2print = "{(Step 37C/70) got" + "; size2arena-got-by-read2buffer4opu: " + str(size2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
buffer2arena = arena2opu.buffer
message2print = "{(Step 37D/70) got" + "; buffer2arena-got-by-read2buffer4opu: " + str(buffer2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37D-'
if size2arena < size2opu:
size2opu = size2arena # AVAILABLE MEMORY FOR IMAGE
message2print = "{(Step 37E/70) set" + "; size2opu-set-by-read2buffer4opu to: " + str(size2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37E-'
else:
pass
pointer2opu = buffer2arena
message2print = "{(Step 37F/70) set" + "; pointer2opu-set-by-read2buffer4opu to: " + str(pointer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37F-'
except:
message2print = "{(Step 37Z/70) failed" + "; pointer2opu-failed-by-read2image4opu: " + str(pointer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '37Z-'
task4imageread2opu ['POINTER'] = pointer2opu
task4imageread2opu ['SIZE'] = size2opu # AUTOMATIC BY OPUXI
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
# --------------------------------------------------------------------------------------------------------
slicepitch2opu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 38A/70) trying" + "; slicepitch2opu-trying-by-read2image4opu: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2opu = 0
message2print = "{(Step 38B/70) set" + "; slicepitch2opu-set-by-read2image4opu to: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '38B-'
except:
message2print = "{(Step 38Z/70) failed" + "; slicepitch2opu-failed-by-read2image4opu: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '38Z-'
task4imageread2opu ['SLICEPITCH'] = slicepitch2opu
# ---------------------------------------------------------------------------------------------
# EOF TASK ANALYSIS
# ---------------------------------------------------------------------------------------------
keys2task = task4imageread2opu.keys()
message2print = "{(Step 39/70) set" + "; keys2task-set-by-read2image4opu 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" + "; task4imageread2opu-yielded-by-read2image4opu: " + str(task4imageread2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '39Z-'
# ---------------------------------------------------------------------------------------------
# CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
control2readimage4opu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2opu = False
channels2opu = ()
message2print = "{(Step 40A/70) trying" + "channels2opu-trying-by-read2image4opu: " + str(channels2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# (, )
consumerchannel2opu, publisherchannel2opu = task4imageread2opu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2opu-got-by-read2image4opu: " + str(consumerchannel2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2opu-got-by-read2image4opu: " + str(publisherchannel2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2opu = True
control2readimage4opu['CONSUMERCHANNEL'] = consumerchannel2opu
control2readimage4opu['PUBLISHERCHANNEL'] = publisherchannel2opu
code2ack = code2ack + '40D-'
except:
ack4channels2opu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2opu = False
queue2opu = None
message2print = "{(Step 41A/70) trying" + "; queue2opu-trying-by-read2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2opu = task4imageread2opu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2opu-got-by-read2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2opu = True
control2readimage4opu['QUEUE'] = queue2opu
code2ack = code2ack + '41C-'
except:
ack4queue2opu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4opu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4opu-trying-by-read2image4opu: " + str(dummy2image4opu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4opu = DummyProcess4Xi(target=manoeuvre2readimage4opu, # in this module to handle queue and pipe channels
# args =(queue2opu, # caller puts and gets - does NOT call any functions
# consumerchannel2opu, publisherchannel2opu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4opu-created-by-read2image4opu: " + str(dummy2image4opu) + "; 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-read2image4opu: " + 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-read2image4opu: " + str(code2nack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70C/70) returning" + "; control2readimage4opu-returning-by-read2image4opu: " + str(control2readimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }
return control2readimage4opu
#
# -------------------------------------------------------------------------------------------------
#copy2mapimage4opu"
# channel4map2imagepublish4opu.send(message2send4opu)
# print("(Step 93B/700) OF OPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4OPU: ", channel4map2imagepublish4opu, " MESSAGE2SEND4OPU: " , message2send4opu)
# except:
# print('(Step 93Z1/700) OF OPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4OPU ', time4xi())
#
# # ---------------------------------------------------------------------------------------------------------------------
# # SIMULATE MANOEUVRE2COPYIMAGE4OPU - LET IT TO RECEIVE COPY AND TO SEND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------------------------------
# if ack2simulate4opu is True:
# print("(Step 94A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4OPU ", time4xi())
# try:
# response2manoeuvre4copy = manoeuvre2mapimage4opu(queue4map2image4opu, channel4map2imageconsume4opu, channel4map2imagepublish4opu)
# print("(Step 94B/700) OF OPU2IMAGE4XI5TEST - PERFORMED MANOEUVRE2COPYIMAGE4OPU, RESPONSE2MANOEUVRE4COPY: ", response2manoeuvre4copy)
# except:
# print("(Step 94Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4OPU ", time4xi())
# else:
# pass # trust activated thread
#
# # ---------------------------------------------------------------------------------------------
# # RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------
# print('(Step 95A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4OPU ', time4xi())
# try:
# message2receive4opu = channel4map2imageconsume4opu.recv()
# print("(Step 95B/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel4map2imageconsume4opu, " CONTROL & COMMAND: ", message2receive4opu)
# except:
# print('(Step 95Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4OPU ', time4xi())
#
# # ------------------------------------------------------------------------------------------------------------
# # SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2COPYIMAGE4OPU TO RECEIVE
# # ------------------------------------------------------------------------------------------------------------
# print('(Step 96A/700) OF OPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4OPU ', time4xi())
# try:
# message2send4opu = "ready2mapimage4opu"
# channel4map2imagepublish4opu.send(message2send4opu)
# print("(Step 96B/700) OF OPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4OPU: ", channel4map2imagepublish4opu, " MESSAGE2SEND4OPU: " , message2send4opu)
# except:
# print('(Step 84Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4OPU ', time4xi())
#
# # -------------------------------------------------------------------------------------------------------
# # SIMULATE MANOEUVRE2COPYIMAGE4OPU - LET IT RECEIVE READY AND SEND READY
# # -------------------------------------------------------------------------------------------------------
# if ack2simulate4opu is True:
# print("(Step 97A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4OPU ", time4xi())
# try:
# response2manoeuvre4copy = manoeuvre2mapimage4opu(queue4map2image4opu, channel4map2imageconsume4opu, channel4map2imagepublish4opu)
# print("(Step 97B/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGE4OPU ", manoeuvre2copyimage4opu)
# except:
# print("(Step 97Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4OPU ", time4xi())
# else:
# pass # trust activated thread
#
#
# # ---------------------------------------------------------------------------------------
# # RECEIVE CONTROL & COMMAND READY VIA PIPE
# # ---------------------------------------------------------------------------------------
# print('(Step 98A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4OPU ', time4xi())
# try:
# message2receive4opu = channel4map2imageconsume4opu.recv()
# print("(Step 98B/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel4map2imageconsume4opu, " CONTROL & COMMAND: ", message2receive4opu)
# except:
# print('(Step 86Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH MAP2IMAGE4OPU ', time4xi())
#
# # -----------------------------------------------------------------------------------------
# # IMAGE OPUXI COPY OPERATIONS
# # -----------------------------------------------------------------------------------------
# print('(Step 99A/700) OF OPU2IMAGE4XI5TEST - TRYING FILE OPERATIONS WITH IMAGE OPUXI ', time4xi())
# try:
# path2dragon = '..//..//..//..//..//web//images//png//dragonxi.png'
# file2dragon = open(path2dragon)
# print("(Step 99B/700) OF OPU2IMAGE4XI5TEST - FILENO: ", file2opu.fileno( ))
# print("(Step 99C/700) OF OPU2IMAGE4XI5TEST - MODE: ", file2opu.mode)
# print("(Step 99D/700) OF OPU2IMAGE4XI5TEST - NAME: ", file2opu.name)
# offset2opu = 10
# file2opu.seek(offset2opu)
# print("(Step 99E/700) OF OPU2IMAGE4XI5TEST - PERFORMED SEEK WITH OFFSET: ", offset2opu)
# file2opu.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 OPU2IMAGE4XI5TEST - 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 OPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
#
# # -------------------------------------------------------------------------------------------------------------------------------------
# # SIMULATE MANOEUVRE2COPYIMAGE4OPU - STATE III - GETS FROM QUEUE AND SENDS EITHER ACK OR NACK VIA PIPE
# # -------------------------------------------------------------------------------------------------------------------------------------
# if ack2simulate4opu is True:
# print("(Step 101A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4OPU ", time4xi())
# try:
# response2manoeuvre4copy = manoeuvre2mapimage4opu(queue4map2image4opu, channel4map2imageconsume4opu, channel4map2imagepublish4opu)
# print("(Step 101B/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2COPYIMAGE4OPU ", manoeuvre2copyimage4opu)
# except:
# print("(Step 101Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4OPU ", time4xi())
# else:
# pass # trust activated thread
#
#
# # ----------------------------------------------------------------------------------------------------
# # RECEIVE ACK OR NACK ABOUT IMAGE OPERATION CONTROL & COMMAND VIA PIPE
# # ----------------------------------------------------------------------------------------------------
# print('(Step 102A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2receive4opu = channel4map2imageconsume4opu.recv()
# print("(Step 102B/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel4map2imageconsume4opu, " CONTROL & COMMAND: ", message2receive4opu)
# except:
# print('(Step 90Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
#
#
# # ----------------------------------------------------------------------------------------------------------------
# # SIMULATE MANOEUVRE2COPYIMAGE4OPU - LET MANOEUVRE2COPYIMAGE4OPU TO GO TO STATE 0
# # ----------------------------------------------------------------------------------------------------------------
# if ack2simulate4opu is True:
# print("(Step 103A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4OPU ", time4xi())
# try:
# response2manoeuvre4copy = manoeuvre2mapimage4opu(queue4map2image4opu, channel4map2imageconsume4opu, channel4map2imagepublish4opu)
# print("(Step 103B/700) OF OPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4OPU ", response2manoeuvre4copy)
# except:
# print("(Step 103Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4OPU ", time4xi())
# else:
# pass # trust activated thread
#
#">
# -------------------------------------------------------------------------------------------------
def map2image4opu(task4imagemap2opu=None):
'''
maps 2D images for OPU
'''
global opu2image4xi # 2D-IMAGES FOR OPU
global control2mapimage4opu # COMMAND AND CONTROL FOR OPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "map2image4opu"
method2print = "map2image4opu"
message2print = "{(Step 1A/33) started" + "; map2image4opu-started: " + str(map2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4imagemap2opu-to-map2image4opu: " + str(task4imagemap2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE OPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if opu2image4xi is None:
opu2image4xi = create2image4opu() # INITIALIZE IMAGE FOR OPU
message2print = "{(Step 1C/70) created" + "; opu2image4xi-created-by-map2image4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4opu-skipped-by-map2image4opu: " + str(map2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
try:
opu2image4xi = create2image4opu()
message2print = "{(Step 1E/70) set" + "; opu2image4xi-set-by-map2image4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
opu2image4xi = {}
message2print = "{(Step 1Z/70) yielded" + "; opu2image4xi-yielded-by-map2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - CHECK PARAMETERS
# -----------------------------------------------------------------------------------------
try:
if task4imagemap2opu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR MAP - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4imagemap2opu = {}
message2print = "{(Step 1A/70) initialized" + "; task4imagemap2opu-created-by-map2image4opu to: " + str(task4imagemap2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4opu = trace2image4opu # CALLBACK FUNCTION FOR OPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4opu-created-by-map2image4opu to: " + str(function2callback4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "map2image4opu" # MODULE OF OPUIZED OPENCL MODULE
args2callback['METHOD'] = "map2image4opu" # FUNCTION OF OPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; map2image4opu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR OPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-map2image4opu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagemap2opu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO OPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagemap2opu['FUNCTION2CALLBACK'] = function2callback4opu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4imagemap2opu-created-by-map2image4opu to: " + str(task4imagemap2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-map2image4opu 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-map2image4opu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '2B-'
except:
message2print = "{(Step 2Z/70) failed" + "; platform2xi-failed-by-map2image4opu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4imagemap2opu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2opu = {}
message2print = "{(Step 3A/70) trying" + "; context2opu-trying-by-map2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2opu = get2context4opu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2opu-got-by-map2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2opu-failed-by-map2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4imagemap2opu ['CONTEXT'] = context2opu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2opu = {}
message2print = "{(Step 4A/70) trying" + "; device2opu-trying-by-map2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2opu = get2opu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2opu-got-by-map2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2opu-failed-by-map2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4imagemap2opu ['DEVICE'] = device2opu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2opu = {}
message2print = "{(Step 5A/70) trying" + "; imageinfo2opu-trying-by-map2image4opu: " + str(imageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2opu = get2imageinfo4opu()
message2print = "{(Step 5B/70) got" + "; imageinfo2opu-got-by-map2image4opu: " + str(imageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '5B-'
except:
message2print = "{(Step 5Z/70) failed" + "; imageinfo2opu-failed-by-map2image4opu: " + str(imageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4imagemap2opu ['IMAGE'] = imageinfo2opu
# ---------------------------------------------------------------------------------------------
# (6) QUEUE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
queue2opu = None
message2print = "{(Step 6A/70) trying" + "; queue2opu-trying-by-map2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2opu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 6B/70) got" + "; queue2opu-got-by-map2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; queue2opu-failed-by-map2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4imagemap2opu ['QUEUE'] = queue2opu
# ---------------------------------------------------------------------------------------------
# (7) PIPE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
pipe2opu = None
message2print = "{(Step 7A/70) trying" + "; pipe2opu-trying-by-map2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2opu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 7B/70) got" + "; pipe2opu-got-by-map2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; pipe2opu-failed-by-map2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4imagemap2opu ['PIPE'] = pipe2opu
# ---------------------------------------------------------------------------------------------
# (8) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2opu = {}
message2print = "{(Step 8A/70) trying" + "; commandqueueinfo2opu-trying-by-map2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2opu = get2commandqueueinfo4opu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 8B/70) got" + "; commandqueueinfo2opu-got-by-map2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; commandqueueinfo2opu-failed-by-map2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4imagemap2opu ['COMMANDQUEUE'] = commandqueueinfo2opu
# ---------------------------------------------------------------------------------------------
# (9) BUFFER - AUTOMATIC BY OPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2opu = {}
message2print = "{(Step 9A/70) trying" + "; bufferinfo2opu-trying-by-map2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2opu = get2bufferinfo4opu() # SYSTEM CREATES BUFFER FOR OPU, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; bufferinfo2opu-got-by-map2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; bufferinfo2opu-failed-by-map2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4imagemap2opu ['BUFFER'] = bufferinfo2opu
# ---------------------------------------------------------------------------------------------
# (10) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2opu = {}
message2print = "{(Step 10A/70) trying" + "; eventinfo2opu-trying-by-map2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2opu = get2eventinfo4opu()
message2print = "{(Step 10B/70) got" + "; eventinfo2opu-got-by-map2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '10B-'
except:
message2print = "{(Step 10Z/70) failed" + "; eventinfo2opu-failed-by-map2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '10Z-'
task4imagemap2opu ['EVENT'] = eventinfo2opu
# ---------------------------------------------------------------------------------------------
# (11) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2opu = {}
message2print = "{(Step 11A/70) trying" + "; eventwaitlist2opu-trying-by-map2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2opu = {}
message2print = "{(Step 11B/70) set" + "; eventwaitlist2opu-set-by-map2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; eventwaitlist2opu-failed-by-map2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4imagemap2opu ['EVENTWAITLIST'] = eventwaitlist2opu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2opu = 0
message2print = "{(Step 12A/70) trying" + "; eventwaitlistquantity2opu-trying-by-map2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2opu.keys()
for key2event in keys2event:
eventwaitlistquantity2opu = eventwaitlistquantity2opu + 1
message2print = "{(Step 12B/70) set" + "; eventwaitlistquantity2opu-set-by-map2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlistquantity2opu-failed-by-map2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4imagemap2opu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2opu
# ---------------------------------------------------------------------------------------------
# (13) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2opu = ' '
message2print = "{(Step 13A/70) trying" + "; blocking2opu-trying-by-map2image4opu: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2opu = 'CL_FALSE' # the map command is non-blocking
message2print = "{(Step 13B/70) set" + "; blocking2opu-set-by-map2image4opu to: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; blocking2opu-failed-by-map2image4opu: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4imagemap2opu ['BLOCKING'] = blocking2opu
# ---------------------------------------------------------------------------------------------
# (14) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2opu = {}
message2print = "{(Step 14A/70) trying" + "; origin2opu-trying-by-map2image4opu: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2opu['X'] = 0
origin2opu['Y'] = 0
origin2opu['Z'] = 0
message2print = "{(Step 14B/70) set" + "; origin2opu-set-by-map2image4opu to: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; origin2opu-failed-by-map2image4opu: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4imagemap2opu ['ORIGIN'] = origin2opu
# ---------------------------------------------------------------------------------------------
# (15) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2opu = {}
message2print = "{(Step 15A/70) trying" + "; region2opu-trying-by-map2image4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2opu['X'] = 160 # WIDTH IN PIXELS TO MAP
region2opu['Y'] = 90 # HEIGHT IN PIXELS TO MAP
region2opu['Z'] = 0 # DEPTH IN PIXELS TO MAP
message2print = "{(Step 15B/70) set" + "; region2opu-set-by-map2image4opu to: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; region2opu-failed-by-map2image4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '15Z-'
task4imagemap2opu ['REGION'] = region2opu
# ---------------------------------------------------------------------------------------------
# (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.
rowpitch2opu = 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
width2opu = 800
message2print = "{(Step 16A/70) trying" + "; rowpitch2opu-trying-by-map2image4opu: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2opu = int(width2opu * 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" + "; rowpitch2opu-set-by-map2image4opu to: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 8000
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; rowpitch2opu-failed-by-map2image4opu: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '16Z-'
task4imagemap2opu ['ROWPITCH'] = rowpitch2opu
# --------------------------------------------------------------------------------------------------------
# (18) SLICEPITCH - REQUIRED - THE SIZE IN BYTES OF THE 2D SLICE OF THE 3D REGION OF A 3D IMAGE BEING MAP
# --------------------------------------------------------------------------------------------------------
slicepitch2opu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 18A/70) trying" + "; slicepitch2opu-trying-by-map2image4opu: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2opu = 0
message2print = "{(Step 18B/70) set" + "; slicepitch2opu-set-by-map2image4opu to: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '18B-'
except:
message2print = "{(Step 18Z/70) failed" + "; slicepitch2opu-failed-by-map2image4opu: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '18Z-'
task4imagemap2opu ['SLICEPITCH'] = slicepitch2opu
# ---------------------------------------------------------------------------------------------
# (19) FLAGS - REQUIRED
# ---------------------------------------------------------------------------------------------
flags2opu = 'CL_MAP_READ'
message2print = "{(Step 19A/70) trying" + "; flags2opu-trying-by-map2image4opu: " + str(flags2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
flags2opu = 'CL_MAP_WRITE' # THE REGION SPECIFIED BY (ORIGIN, REGION) IN THE IMAGE OBJECT IS BEING MAPPED FOR WRITING
message2print = "{(Step 19B/70) set" + "; flags2opu-set-by-map2image4opu to: " + str(flags2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '19B-'
except:
message2print = "{(Step 19Z/70) failed" + "; flags2opu-failed-by-map2image4opu: " + str(flags2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '19Z-'
task4imagemap2opu ['FLAGS'] = flags2opu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
else:
pass
# ---------------------------------------------------------------------------------------------
# ANALYSE TASKS - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4imagemap2opu.keys()
message2print = "{(Step 20/70) got" + "; keys2task-got-by-map2image4opu: " + 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
# ---------------------------------------------------------------------------------------------
function2callback4opu = trace2image4opu # CALLBACK FUNCTION FOR OPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4opu-created-by-map2image4opu to: " + str(function2callback4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "map2image4opu" # MODULE OF OPUIZED OPENCL MODULE
args2callback['METHOD'] = "map2image4opu" # FUNCTION OF OPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; map2image4opu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR OPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-map2image4opu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagemap2opu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO OPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagemap2opu['FUNCTION2CALLBACK'] = function2callback4opu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4imagemap2opu-created-by-map2image4opu to: " + str(task4imagemap2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-map2image4opu 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-map2image4opu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-map2image4opu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4imagemap2opu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2opu = {}
message2print = "{(Step 23A/70) trying" + "; context2opu-trying-by-map2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2opu = get2context4opu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2opu-got-by-map2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2opu-failed-by-map2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4imagemap2opu ['CONTEXT'] = context2opu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2opu = {}
message2print = "{(Step 24A/70) trying" + "; device2opu-trying-by-map2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2opu = get2opu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2opu-got-by-map2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2opu-failed-by-map2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4imagemap2opu ['DEVICE'] = device2opu
if 'IMAGE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2opu = {}
message2print = "{(Step 25A/70) trying" + "; imageinfo2opu-trying-by-map2image4opu: " + str(imageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2opu = get2imageinfo4opu()
message2print = "{(Step 25B/70) got" + "; imageinfo2opu-got-by-map2image4opu: " + str(imageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; imageinfo2opu-failed-by-map2image4opu: " + str(imageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4imagemap2opu ['IMAGE'] = imageinfo2opu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) QUEUE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
queue2opu = None
message2print = "{(Step 26A/70) trying" + "; queue2opu-trying-by-map2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2opu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 26B/70) got" + "; queue2opu-got-by-map2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; queue2opu-failed-by-map2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4imagemap2opu ['QUEUE'] = queue2opu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) PIPE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
pipe2opu = None
message2print = "{(Step 27A/70) trying" + "; pipe2opu-trying-by-map2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2opu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 27B/70) got" + "; pipe2opu-got-by-map2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; pipe2opu-failed-by-map2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4imagemap2opu ['PIPE'] = pipe2opu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2opu = {}
message2print = "{(Step 28A/70) trying" + "; commandqueueinfo2opu-trying-by-map2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2opu = get2commandqueueinfo4opu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 28B/70) got" + "; commandqueueinfo2opu-got-by-map2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; commandqueueinfo2opu-failed-by-map2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4imagemap2opu ['COMMANDQUEUE'] = commandqueueinfo2opu
if 'BUFFER' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (29) BUFFER - AUTOMATIC BY OPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2opu = {}
message2print = "{(Step 29A/70) trying" + "; bufferinfo2opu-trying-by-map2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2opu = get2bufferinfo4opu() # SYSTEM CREATES BUFFER FOR OPU, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; bufferinfo2opu-got-by-map2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; bufferinfo2opu-failed-by-map2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4imagemap2opu ['BUFFER'] = bufferinfo2opu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (30) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2opu = {}
message2print = "{(Step 30A/70) trying" + "; eventinfo2opu-trying-by-map2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2opu = get2eventinfo4opu()
message2print = "{(Step 30B/70) got" + "; eventinfo2opu-got-by-map2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '30B-'
except:
message2print = "{(Step 30Z/70) failed" + "; eventinfo2opu-failed-by-map2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '30Z-'
task4imagemap2opu ['EVENT'] = eventinfo2opu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2opu = {}
message2print = "{(Step 31A/70) trying" + "; eventwaitlist2opu-trying-by-map2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2opu = {}
message2print = "{(Step 31B/70) set" + "; eventwaitlist2opu-set-by-map2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventwaitlist2opu-failed-by-map2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4imagemap2opu ['EVENTWAITLIST'] = eventwaitlist2opu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2opu = 0
message2print = "{(Step 32A/70) trying" + "; eventwaitlistquantity2opu-trying-by-map2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2opu.keys()
for key2event in keys2event:
eventwaitlistquantity2opu = eventwaitlistquantity2opu + 1
message2print = "{(Step 32B/70) set" + "; eventwaitlistquantity2opu-set-by-map2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlistquantity2opu-failed-by-map2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4imagemap2opu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2opu
if 'BLOCKING' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2opu = ' '
message2print = "{(Step 33A/70) trying" + "; blocking2opu-trying-by-map2image4opu: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2opu = 'CL_FALSE' # the map command is non-blocking
message2print = "{(Step 33B/70) set" + "; blocking2opu-set-by-map2image4opu to: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; blocking2opu-failed-by-map2image4opu: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4imagemap2opu ['BLOCKING'] = blocking2opu
if 'ORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2opu = {}
message2print = "{(Step 34A/70) trying" + "; origin2opu-trying-by-map2image4opu: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2opu['X'] = 0
origin2opu['Y'] = 0
origin2opu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; origin2opu-set-by-map2image4opu to: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; origin2opu-failed-by-map2image4opu: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4imagemap2opu ['ORIGIN'] = origin2opu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (35) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2opu = {}
message2print = "{(Step 35A/70) trying" + "; region2opu-trying-by-map2image4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2opu['X'] = 160 # WIDTH IN PIXELS TO MAP
region2opu['Y'] = 90 # HEIGHT IN PIXELS TO MAP
region2opu['Z'] = 0 # DEPTH IN PIXELS TO MAP
message2print = "{(Step 35B/70) set" + "; region2opu-set-by-map2image4opu to: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '35B-'
except:
message2print = "{(Step 35Z/70) failed" + "; region2opu-failed-by-map2image4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '35Z-'
task4imagemap2opu ['REGION'] = region2opu
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.
rowpitch2opu = 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" + "; rowpitch2opu-trying-by-map2image4opu: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2opu = int(width2opu * 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" + "; rowpitch2opu-set-by-map2image4opu to: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; rowpitch2opu-failed-by-map2image4opu: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '36Z-'
task4imagemap2opu ['ROWPITCH'] = rowpitch2opu
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
# --------------------------------------------------------------------------------------------------------
slicepitch2opu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 38A/70) trying" + "; slicepitch2opu-trying-by-map2image4opu: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2opu = 0
message2print = "{(Step 38B/70) set" + "; slicepitch2opu-set-by-map2image4opu to: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '38B-'
except:
message2print = "{(Step 38Z/70) failed" + "; slicepitch2opu-failed-by-map2image4opu: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '38Z-'
task4imagemap2opu ['SLICEPITCH'] = slicepitch2opu
if 'FLAGS' in keys2task:
pass
else:
# --------------------------------------------------------------------------------------------------------
# (39) FLAGS - REQUIRED
# --------------------------------------------------------------------------------------------------------
flags2opu = 'CL_MAP_READ'
message2print = "{(Step 39A/70) trying" + "; flags2opu-trying-by-map2image4opu: " + str(flags2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
flags2opu = 'CL_MAP_WRITE'
message2print = "{(Step 39B/70) set" + "; flags2opu-set-by-map2image4opu to: " + str(flags2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '39B-'
except:
message2print = "{(Step 39Z/70) failed" + "; flags2opu-failed-by-map2image4opu: " + str(flags2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '39Z-'
task4imagemap2opu ['FLAGS'] = flags2opu
# ---------------------------------------------------------------------------------------------
# EOF TASK ANALYSIS
# ---------------------------------------------------------------------------------------------
keys2task = task4imagemap2opu.keys()
message2print = "{(Step 40A/70) set" + "; keys2task-set-by-map2image4opu 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" + "; task4imagemap2opu-yielded-by-map2image4opu: " + str(task4imagemap2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
control2mapimage4opu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2opu = False
channels2opu = ()
message2print = "{(Step 40A/70) trying" + "channels2opu-trying-by-map2image4opu: " + str(channels2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
#
consumerchannel2opu, publisherchannel2opu = task4imagemap2opu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2opu-got-by-map2image4opu: " + str(consumerchannel2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2opu-got-by-map2image4opu: " + str(publisherchannel2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2opu = True
control2mapimage4opu['CONSUMERCHANNEL'] = consumerchannel2opu
control2mapimage4opu['PUBLISHERCHANNEL'] = publisherchannel2opu
code2ack = code2ack + '40D-'
except:
ack4channels2opu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2opu = False
queue2opu = None
message2print = "{(Step 41A/70) trying" + "queue2opu-trying-by-map2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2opu = task4imagemap2opu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2opu-got-by-map2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2opu = True
control2mapimage4opu['QUEUE'] = queue2opu
code2ack = code2ack + '41C-'
except:
ack4queue2opu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4opu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4opu-trying-by-map2image4opu: " + str(dummy2image4opu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4opu = DummyProcess4Xi(target=manoeuvre2mapimage4opu, # in this module to handle queue and pipe channels
# args =(queue2opu, # caller puts and gets - does NOT call any functions
# consumerchannel2opu, publisherchannel2opu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4opu-created-by-map2image4opu: " + str(dummy2image4opu) + "; 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-map2image4opu: " + str(code2ack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70B/70) set" + "; code2nack-set-by-map2image4opu: " + 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" + "; control2mapimage4opu-returning-by-map2image4opu: " + str(control2mapimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return control2mapimage4opu
#
# -----------------------------------------------------------------------------------------------------------------------
#roger2copy4opu', 'ACK2INFO4OPU': False, 'MESSAGE2GET4OPU': 'default2copy4opu',
# # 'MESSAGE2RECEIVE4OPU': 'copy2copy4opu',
# 'CODE2ACK4OPU': ' 0D-1C-', 'MESSAGE2PUT4OPU': 'default2copy4opu', 'CODE2NACK4OPU': ' ', 'STATE2MANOEUVRE4OPU': 1}
# except:
# print("(Step 42Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4OPU ", time4xi())
# else:
# pass # trust activated thread
#">
# -----------------------------------------------------------------------------------------------------------------------
def manoeuvre2copyimage4opu(queue2copymanoeuvre4opu, consumerchannel2copymanoeuvre4opu, publisherchannel2copymanoeuvre4opu):
'''
manoeuvres copy control and command
'''
global state2copyimage4opu # STATE FOR COMMAND AND CONTROL
global max2copyimagestate4opu # MAX FOR STATE
global ack2copyimageinfo4opu # ACK FOR IMAGE INFO
global message2copyimageget4opu
global message2copyimageput4opu
global message2copyimagereceive4opu
global message2copyimagesend4opu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2copyimage4opu"
method2print = "manoeuvre2copyimage4opu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2copyimage4opu-started: " + str(manoeuvre2copyimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 0B/33) passed" + "; queue2copymanoeuvre4opu-to-manoeuvre2copyimage4opu: " + str(queue2copymanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2copymanoeuvre4opu-to-manoeuvre2copyimage4opu: " + str(consumerchannel2copymanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0D/33) passed" + "; publisherchannel2copymanoeuvre4opu-to-manoeuvre2copyimage4opu: " + str(publisherchannel2copymanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4copy = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2copyimage4opu-try-by-manoeuvre2copyimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2copyimage4opu is None:
state2copyimage4opu = 0
message2print = "{(Step 0F/33) initialized" + "; state2copyimage4opu-initialized-by-manoeuvre2copyimage4opu to: " + str(state2copyimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2copyimage4opu-used-by-manoeuvre2copyimage4opu: " + str(state2copyimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2copyimage4opu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2copyimage4opu-initialized-by-manoeuvre2copyimage4opu to: " + str(state2copyimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2copyimageinfo4opu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2copyimageinfo4opu-initialized-by-manoeuvre2copyimage4opu to: " + str(ack2copyimageinfo4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2copyimageget4opu = 'default2copy4opu'
message2print = "{(Step 0Z3/33) initialized" + "; message2copyimageget4opu-initialized-by-manoeuvre2copyimage4opu to: " + str(message2copyimageget4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4opu
message2copyimageput4opu = 'default2copy4opu'
message2print = "{(Step 0Z4/33) initialized" + "; message2copyimageput4opu-initialized-by-manoeuvre2copyimage4opu to: " + str(message2copyimageput4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4opu
message2copyimagereceive4opu = 'default2copy4opu'
message2print = "{(Step 0Z5/33) initialized" + "; message2copyimagereceive4opu-initialized-by-manoeuvre2copyimage4opu to: " + str(message2copyimagereceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4opu
message2copyimagesend4opu = 'default2copy4opu'
message2print = "{(Step 0Z6/33) initialized" + "; message2copyimagesend4opu-initialized-by-manoeuvre2copyimage4opu to: " + str(message2copyimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4opu
max2copyimagestate4opu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2copyimagestate4opu-initialized-by-manoeuvre2copyimage4opu to: " + str( max2copyimagestate4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2copyimage4opu = state2copyimage4opu + 1
message2print = "{(Step 0H/33) added" + "; state2copyimage4opu-added-by-manoeuvre2copyimage4opu: " + str(state2copyimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2copyimage4opu > max2copyimagestate4opu:
state2copyimage4opu = 0
message2print = "{(Step 0I/33) set" + "; state2copyimage4opu-set-by-manoeuvre2copyimage4opu to: " + str(state2copyimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2copyimageinfo4opu = False
message2print = "{(Step 0J/33) set" + "; ack2copyimageinfo4opu-set-by-manoeuvre2copyimage4opu to: " + str(ack2copyimageinfo4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2copyimageget4opu = 'default2copy4opu'
message2print = "{(Step 0K/33) set" + "; message2copyimageget4opu-set-by-manoeuvre2copyimage4opu to: " + str(message2copyimageget4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4opu
message2copyimageput4opu = 'default2copy4opu'
message2print = "{(Step 0L/33) set" + "; message2copyimageput4opu-set-by-manoeuvre2copyimage4opu to: " + str(message2copyimageput4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4opu
message2copyimagereceive4opu = 'default2copy4opu'
message2print = "{(Step 0M/33) set" + "; message2copyimagereceive4opu-set-by-manoeuvre2copyimage4opu to: " + str(message2copyimagereceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4opu
message2copyimagesend4opu = 'default2copy4opu'
message2print = "{(Step 0N/33) set" + "; message2copyimagesend4opu-set-by-manoeuvre2copyimage4opu to: " + str(message2copyimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2copy4opu
max2copyimagestate4opu = 3
message2print = "{(Step 0O/33) initialized" + "; max2copyimagestate4opu-set-by-manoeuvre2copyimage4opu to: " + str( max2copyimagestate4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2copyimage4opu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2copyimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copyimagereceive4opu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copyimagereceive4opu = consumerchannel2copymanoeuvre4opu.recv()
message2print = "{(Step 1B/33) received" + "; message2copyimagereceive4opu-received-by-manoeuvre2copyimage4opu: " + str(message2copyimagereceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# copy2copy4opu
if message2copyimagereceive4opu == 'copy2copy4opu':
message2copyimagesend4opu = 'roger2copy4opu'
else:
message2copyimagesend4opu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copymanoeuvre4opu.send(message2copyimagesend4opu)
message2print = "{(Step 1C/33) sent" + "; message2copyimagesend4opu-sent-by-manoeuvre2copyimage4opu: " + str(message2copyimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# roger2copy4opu
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2copyimagereceive4opu-failed-by-manoeuvre2copyimage4opu: " + str(message2copyimagereceive4opu) + "; 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 state2copyimage4opu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2copyimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copyimagereceive4opu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copyimagereceive4opu = consumerchannel2copymanoeuvre4opu.recv()
message2print = "{(Step 2B/33) received" + "; message2copyimagereceive4opu-received-by-manoeuvre2copyimage4opu: " + str(message2copyimagereceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ready2copy4opu
if message2copyimagereceive4opu == 'ready2copy4opu':
message2copyimagesend4opu = 'ready2copy4opu'
else:
message2copyimagesend4opu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND READY OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copymanoeuvre4opu.send(message2copyimagesend4opu)
message2print = "{(Step 2C/33) sent" + "; message2copyimagesend4opu-sent-by-manoeuvre2copyimage4opu: " + str(message2copyimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2copyimagereceive4opu-failed-by-manoeuvre2copyimage4opu: " + str(message2copyimagereceive4opu) + "; 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 state2copyimage4opu == 3:
info2image4opu = None
message2print = "{(Step 3A/70) try" + "; info2image4opu-try-by-manoeuvre2copyimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4opu = queue2copymanoeuvre4opu.get()
message2print = "{(Step 3B/33) got" + "; info2image4opu-got-by-manoeuvre2copyimage4opu: " + str(info2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ..//..//..//..//..//web//images//png//dragonxi.png
if info2image4opu is None:
code2nack = code2nack + '3Z1-'
ack2copyimageinfo4opu = False
else:
code2ack = code2ack + '3C-'
ack2copyimageinfo4opu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2copymanoeuvre4opu-failed-by-manoeuvre2copyimage4opu: " + str(queue2copymanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2copyimagesend4opu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2copyimageinfo4opu is True:
message2copyimagesend4opu = 'ack2imageinfo4opu'
else:
message2copyimagesend4opu = 'nack2imageinfo4opu'
message2print = "{(Step 4B/33) set" + "; message2copyimagesend4opu-set-by-manoeuvre2copyimage4opu to: " + str(message2copyimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4opu
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copyimagesend4opu-failed-by-manoeuvre2copyimage4opu: " + str(message2copyimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2copymanoeuvre4opu-calling-by-manoeuvre2copyimage4opu: " + str(publisherchannel2copymanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2copyimagesend4opu-passing-to-send-by-manoeuvre2copyimage4opu: " + str(message2copyimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copyimagesend4opu-failed-by-manoeuvre2copyimage4opu: " + str(message2copyimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2copymanoeuvre4opu.send(message2copyimagesend4opu)
message2print = "{(Step 4E/33) sent" + "; message2copyimagesend4opu-sent-by-manoeuvre2copyimage4opu: " + str(message2copyimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4opu
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2copyimagesend4opu-failed-by-manoeuvre2copyimage4opu: " + str(message2copyimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4copy['ACK2INFO4OPU'] = ack2copyimageinfo4opu
response2manouvre4copy['CODE2ACK4OPU'] = code2ack
response2manouvre4copy['CODE2NACK4OPU'] = code2nack
response2manouvre4copy['MESSAGE2GET4OPU'] = message2copyimageget4opu
response2manouvre4copy['MESSAGE2PUT4OPU'] = message2copyimageput4opu
response2manouvre4copy['MESSAGE2RECEIVE4OPU'] = message2copyimagereceive4opu
response2manouvre4copy['MESSAGE2SEND4OPU'] = message2copyimagesend4opu
response2manouvre4copy['STATE2MANOEUVRE4OPU'] = state2copyimage4opu
message2print = "{(Step 33/33) returning" + "; response2manouvre4copy-returning-by-manoeuvre2copyimage4opu: " + str(response2manouvre4copy) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1 {'MESSAGE2SEND4OPU': 'roger2copy4opu',
# 'ACK2INFO4OPU': False,
# 'MESSAGE2GET4OPU': 'default2copy4opu',
# 'MESSAGE2RECEIVE4OPU': 'copy2copy4opu',
# 'CODE2ACK4OPU': ' 0D-1C-',
# 'MESSAGE2PUT4OPU': 'default2copy4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 1}; time: 05:25:15 10/03/11 Pacific Daylight Time}
#2 {'MESSAGE2SEND4OPU': 'ready2copy4opu',
# 'ACK2INFO4OPU': False,
# 'MESSAGE2GET4OPU': 'default2copy4opu',
# 'MESSAGE2RECEIVE4OPU': 'ready2copy4opu',
# 'CODE2ACK4OPU': ' 0D-2C-',
# 'MESSAGE2PUT4OPU': 'default2copy4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 2}; time: 05:25:15 10/03/11 Pacific Daylight Time}
#3 {'MESSAGE2SEND4OPU': 'ack2imageinfo4opu',
# 'ACK2INFO4OPU': True,
# 'MESSAGE2GET4OPU': 'default2copy4opu',
# 'MESSAGE2RECEIVE4OPU': 'ready2copy4opu',
# 'CODE2ACK4OPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4OPU': 'default2copy4opu',
# 'CODE2NACK4OPU': ' ', 'STATE2MANOEUVRE4OPU': 3}; time: 05:25:15 10/03/11 Pacific Daylight Time}
#4 {'MESSAGE2SEND4OPU': 'default2copy4opu',
# 'ACK2INFO4OPU': False,
# 'MESSAGE2GET4OPU': 'default2copy4opu',
# 'MESSAGE2RECEIVE4OPU': 'default2copy4opu',
# 'CODE2ACK4OPU': ' 0D-',
# 'MESSAGE2PUT4OPU': 'default2copy4opu',
# 'CODE2NACK4OPU': ' ', 'STATE2MANOEUVRE4OPU': 0}; time: 05:25:15 10/03/11 Pacific Daylight Time}
return response2manouvre4copy
#
# -----------------------------------------------------------------------------------------------------------------------
#roger2copyimagetobuffer4opu',
# # 'ACK2INFO4OPU': False,
# # 'MESSAGE2GET4OPU': 'default2copyimagetobuffer4opu',
# # 'MESSAGE2RECEIVE4OPU': 'copy2copyimagetobuffer4opu',
# # 'CODE2ACK4OPU': ' 0D-1C-',
# # 'MESSAGE2PUT4OPU': 'default2copyimagetobuffer4opu',
# # 'CODE2NACK4OPU': ' ',
# # 'STATE2MANOEUVRE4OPU': 1}
# except:
# print("(Step 62Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4OPU ", time4xi())
# else:
# pass # trust activated thread
#">
# -----------------------------------------------------------------------------------------------------------------------
def manoeuvre2copyimagetobuffer4opu(queue2copyimagetobuffermanoeuvre4opu, consumerchannel2copyimagetobuffermanoeuvre4opu, publisherchannel2copyimagetobuffermanoeuvre4opu):
'''
manoeuvres copy control and command for copy2imagetobuffer4opu
'''
global state2copyimagetobuffer4opu # STATE FOR COMMAND AND CONTROL
global max2copyimagetobufferstate4opu # MAX FOR STATE
global ack2copyimagetobufferinfo4opu # ACK FOR IMAGE INFO
global message2copyimagetobufferget4opu
global message2copyimagetobufferput4opu
global message2copyimagetobufferreceive4opu
global message2copyimagetobuffersend4opu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2copyimagetobuffer4opu"
method2print = "manoeuvre2copyimagetobuffer4opu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2copyimagetobuffer4opu-started: " + str(manoeuvre2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 0B/33) passed" + "; queue2copyimagetobuffermanoeuvre4opu-to-manoeuvre2copyimagetobuffer4opu: " + str(queue2copyimagetobuffermanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2copyimagetobuffermanoeuvre4opu-to-manoeuvre2copyimagetobuffer4opu: " + str(consumerchannel2copyimagetobuffermanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0D/33) passed" + "; publisherchannel2copyimagetobuffermanoeuvre4opu-to-manoeuvre2copyimagetobuffer4opu: " + str(publisherchannel2copyimagetobuffermanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4copyimagetobuffer = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2copyimagetobuffer4opu-try-by-manoeuvre2copyimagetobuffer4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2copyimagetobuffer4opu is None:
state2copyimagetobuffer4opu = 0
message2print = "{(Step 0F/33) initialized" + "; state2copyimagetobuffer4opu-initialized-by-manoeuvre2copyimagetobuffer4opu to: " + str(state2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2copyimagetobuffer4opu-used-by-manoeuvre2copyimagetobuffer4opu: " + str(state2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2copyimagetobuffer4opu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2copyimagetobuffer4opu-initialized-by-manoeuvre2copyimagetobuffer4opu to: " + str(state2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2copyimagetobufferinfo4opu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2copyimagetobufferinfo4opu-initialized-by-manoeuvre2copyimagetobuffer4opu to: " + str(ack2copyimagetobufferinfo4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2copyimagetobufferget4opu = 'default2copyimagetobuffer4opu'
message2print = "{(Step 0Z3/33) initialized" + "; message2copyimagetobufferget4opu-initialized-by-manoeuvre2copyimagetobuffer4opu to: " + str(message2copyimagetobufferget4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobufferput4opu = 'default2copyimagetobuffer4opu'
message2print = "{(Step 0Z4/33) initialized" + "; message2copyimagetobufferput4opu-initialized-by-manoeuvre2copyimagetobuffer4opu to: " + str(message2copyimagetobufferput4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobufferreceive4opu = 'default2copyimagetobuffer4opu'
message2print = "{(Step 0Z5/33) initialized" + "; message2copyimagetobufferreceive4opu-initialized-by-manoeuvre2copyimagetobuffer4opu to: " + str(message2copyimagetobufferreceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobuffersend4opu = 'default2copyimagetobuffer4opu'
message2print = "{(Step 0Z6/33) initialized" + "; message2copyimagetobuffersend4opu-initialized-by-manoeuvre2copyimagetobuffer4opu to: " + str(message2copyimagetobuffersend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
max2copyimagetobufferstate4opu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2copyimagetobufferstate4opu-initialized-by-manoeuvre2copyimagetobuffer4opu to: " + str( max2copyimagetobufferstate4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2copyimagetobuffer4opu = state2copyimagetobuffer4opu + 1
message2print = "{(Step 0H/33) added" + "; state2copyimagetobuffer4opu-added-by-manoeuvre2copyimagetobuffer4opu: " + str(state2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2copyimagetobuffer4opu > max2copyimagetobufferstate4opu:
state2copyimagetobuffer4opu = 0
message2print = "{(Step 0I/33) set" + "; state2copyimagetobuffer4opu-set-by-manoeuvre2copyimagetobuffer4opu to: " + str(state2copyimagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack2copyimagetobufferinfo4opu = False
message2print = "{(Step 0J/33) set" + "; ack2copyimagetobufferinfo4opu-set-by-manoeuvre2copyimagetobuffer4opu to: " + str(ack2copyimagetobufferinfo4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobufferget4opu = 'default2copyimagetobuffer4opu'
message2print = "{(Step 0K/33) set" + "; message2copyimagetobufferget4opu-set-by-manoeuvre2copyimagetobuffer4opu to: " + str(message2copyimagetobufferget4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobufferput4opu = 'default2copyimagetobuffer4opu'
message2print = "{(Step 0L/33) set" + "; message2copyimagetobufferput4opu-set-by-manoeuvre2copyimagetobuffer4opu to: " + str(message2copyimagetobufferput4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobufferreceive4opu = 'default2copyimagetobuffer4opu'
message2print = "{(Step 0M/33) set" + "; message2copyimagetobufferreceive4opu-set-by-manoeuvre2copyimagetobuffer4opu to: " + str(message2copyimagetobufferreceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copyimagetobuffersend4opu = 'default2copyimagetobuffer4opu'
message2print = "{(Step 0N/33) set" + "; message2copyimagetobuffersend4opu-set-by-manoeuvre2copyimagetobuffer4opu to: " + str(message2copyimagetobuffersend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
max2copyimagetobufferstate4opu = 3
message2print = "{(Step 0O/33) initialized" + "; max2copyimagetobufferstate4opu-set-by-manoeuvre2copyimagetobuffer4opu to: " + str( max2copyimagetobufferstate4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2copyimagetobuffer4opu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2copyimagetobuffer4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copyimagetobufferreceive4opu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copyimagetobufferreceive4opu = consumerchannel2copyimagetobuffermanoeuvre4opu.recv()
message2print = "{(Step 1B/33) received" + "; message2copyimagetobufferreceive4opu-received-by-manoeuvre2copyimagetobuffer4opu: " + str(message2copyimagetobufferreceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2copyimagetobufferreceive4opu == 'copy2copyimagetobuffer4opu':
message2copyimagetobuffersend4opu = 'roger2copyimagetobuffer4opu'
else:
message2copyimagetobuffersend4opu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copyimagetobuffermanoeuvre4opu.send(message2copyimagetobuffersend4opu)
message2print = "{(Step 1C/33) sent" + "; message2copyimagetobuffersend4opu-sent-by-manoeuvre2copyimagetobuffer4opu: " + str(message2copyimagetobuffersend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2copyimagetobufferreceive4opu-failed-by-manoeuvre2copyimagetobuffer4opu: " + str(message2copyimagetobufferreceive4opu) + "; 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 state2copyimagetobuffer4opu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2copyimagetobuffer4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copyimagetobufferreceive4opu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copyimagetobufferreceive4opu = consumerchannel2copyimagetobuffermanoeuvre4opu.recv()
message2print = "{(Step 2B/33) received" + "; message2copyimagetobufferreceive4opu-received-by-manoeuvre2copyimagetobuffer4opu: " + str(message2copyimagetobufferreceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2copyimagetobufferreceive4opu == 'ready2copyimagetobuffer4opu':
message2copyimagetobuffersend4opu = 'ready2copyimagetobuffer4opu'
else:
message2copyimagetobuffersend4opu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND READY OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copyimagetobuffermanoeuvre4opu.send(message2copyimagetobuffersend4opu)
message2print = "{(Step 2C/33) sent" + "; message2copyimagetobuffersend4opu-sent-by-manoeuvre2copyimagetobuffer4opu: " + str(message2copyimagetobuffersend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2copyimagetobufferreceive4opu-failed-by-manoeuvre2copyimagetobuffer4opu: " + str(message2copyimagetobufferreceive4opu) + "; 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 state2copyimagetobuffer4opu == 3:
info2image4opu = None
message2print = "{(Step 3A/70) try" + "; info2image4opu-try-by-manoeuvre2copyimagetobuffer4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4opu = queue2copyimagetobuffermanoeuvre4opu.get()
message2print = "{(Step 3B/33) got" + "; info2image4opu-got-by-manoeuvre2copyimagetobuffer4opu: " + str(info2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ..//..//..//..//..//web//images//png//dragonxi.png
if info2image4opu is None:
code2nack = code2nack + '3Z1-'
ack2copyimagetobufferinfo4opu = False
else:
code2ack = code2ack + '3C-'
ack2copyimagetobufferinfo4opu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2copyimagetobuffermanoeuvre4opu-failed-by-manoeuvre2copyimagetobuffer4opu: " + str(queue2copyimagetobuffermanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2copyimagetobuffersend4opu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2copyimagetobufferinfo4opu is True:
message2copyimagetobuffersend4opu = 'ack2imageinfo4opu'
else:
message2copyimagetobuffersend4opu = 'nack2imageinfo4opu'
message2print = "{(Step 4B/33) set" + "; message2copyimagetobuffersend4opu-set-by-manoeuvre2copyimagetobuffer4opu to: " + str(message2copyimagetobuffersend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4opu
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copyimagetobuffersend4opu-failed-by-manoeuvre2copyimagetobuffer4opu: " + str(message2copyimagetobuffersend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2copyimagetobuffermanoeuvre4opu-calling-by-manoeuvre2copyimagetobuffer4opu: " + str(publisherchannel2copyimagetobuffermanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2copyimagetobuffersend4opu-passing-to-send-by-manoeuvre2copyimagetobuffer4opu: " + str(message2copyimagetobuffersend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copyimagetobuffersend4opu-failed-by-manoeuvre2copyimagetobuffer4opu: " + str(message2copyimagetobuffersend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2copyimagetobuffermanoeuvre4opu.send(message2copyimagetobuffersend4opu)
message2print = "{(Step 4E/33) sent" + "; message2copyimagetobuffersend4opu-sent-by-manoeuvre2copyimagetobuffer4opu: " + str(message2copyimagetobuffersend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4opu
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2copyimagetobuffersend4opu-failed-by-manoeuvre2copyimagetobuffer4opu: " + str(message2copyimagetobuffersend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4copyimagetobuffer['ACK2INFO4OPU'] = ack2copyimagetobufferinfo4opu
response2manouvre4copyimagetobuffer['CODE2ACK4OPU'] = code2ack
response2manouvre4copyimagetobuffer['CODE2NACK4OPU'] = code2nack
response2manouvre4copyimagetobuffer['MESSAGE2GET4OPU'] = message2copyimagetobufferget4opu
response2manouvre4copyimagetobuffer['MESSAGE2PUT4OPU'] = message2copyimagetobufferput4opu
response2manouvre4copyimagetobuffer['MESSAGE2RECEIVE4OPU'] = message2copyimagetobufferreceive4opu
response2manouvre4copyimagetobuffer['MESSAGE2SEND4OPU'] = message2copyimagetobuffersend4opu
response2manouvre4copyimagetobuffer['STATE2MANOEUVRE4OPU'] = state2copyimagetobuffer4opu
message2print = "{(Step 33/33) returning" + "; response2manouvre4copyimagetobuffer-returning-by-manoeuvre2copyimagetobuffer4opu: " + str(response2manouvre4copyimagetobuffer) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1 {'MESSAGE2SEND4OPU': 'roger2copyimagetobuffer4opu',
# 'ACK2INFO4OPU': False,
# 'MESSAGE2GET4OPU': 'default2copyimagetobuffer4opu',
# 'MESSAGE2RECEIVE4OPU': 'copy2copyimagetobuffer4opu',
# 'CODE2ACK4OPU': ' 0D-1C-',
# 'MESSAGE2PUT4OPU': 'default2copyimagetobuffer4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 1}; time: 02:00:20 10/04/11 Pacific Daylight Time}
#2 {'MESSAGE2SEND4OPU': 'ready2copyimagetobuffer4opu',
# 'ACK2INFO4OPU': False,
# 'MESSAGE2GET4OPU': 'default2copyimagetobuffer4opu',
# 'MESSAGE2RECEIVE4OPU': 'ready2copyimagetobuffer4opu',
# 'CODE2ACK4OPU': ' 0D-2C-',
# 'MESSAGE2PUT4OPU': 'default2copyimagetobuffer4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 2}; time: 02:10:33 10/04/11 Pacific Daylight Time}
#3 {'MESSAGE2SEND4OPU': 'ack2imageinfo4opu',
# 'ACK2INFO4OPU': True,
# 'MESSAGE2GET4OPU': 'default2copyimagetobuffer4opu',
# 'MESSAGE2RECEIVE4OPU': 'ready2copyimagetobuffer4opu',
# 'CODE2ACK4OPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4OPU': 'default2copyimagetobuffer4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 3}; time: 02:10:33 10/04/11 Pacific Daylight Time}
#4 {'MESSAGE2SEND4OPU': 'default2copyimagetobuffer4opu',
# 'ACK2INFO4OPU': False,
# 'MESSAGE2GET4OPU': 'default2copyimagetobuffer4opu',
# 'MESSAGE2RECEIVE4OPU': 'default2copyimagetobuffer4opu',
# 'CODE2ACK4OPU': ' 0D-',
# 'MESSAGE2PUT4OPU': 'default2copyimagetobuffer4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 0}; time: 02:10:33 10/04/11 Pacific Daylight Time}
return response2manouvre4copyimagetobuffer
#
# -----------------------------------------------------------------------------------------------------------------------
#roger2copybuffertoimage4opu',
# # 'ACK2INFO4OPU': False,
# # 'MESSAGE2GET4OPU': 'default2copybuffertoimage4opu',
# # 'MESSAGE2RECEIVE4OPU': 'copy2copybuffertoimage4opu',
# # 'CODE2ACK4OPU': ' 0D-1C-',
# # 'MESSAGE2PUT4OPU': 'default2copybuffertoimage4opu',
# # 'CODE2NACK4OPU': ' ',
# # 'STATE2MANOEUVRE4OPU': 1}
# except:
# print("(Step 82Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2COPYIMAGE4OPU ", time4xi())
# else:
# pass # trust activated thread
#">
# -----------------------------------------------------------------------------------------------------------------------
def manoeuvre2copybuffertoimage4opu(queue2copybuffertoimagemanoeuvre4opu, consumerchannel2copybuffertoimagemanoeuvre4opu, publisherchannel2copybuffertoimagemanoeuvre4opu):
'''
manoeuvres copy control and command for copy2buffertoimage4opu
'''
global state2copybuffertoimage4opu # STATE FOR COMMAND AND CONTROL
global max2copybuffertoimagestate4opu # MAX FOR STATE
global ack2copybuffertoimageinfo4opu # ACK FOR IMAGE INFO
global message2copybuffertoimageget4opu
global message2copybuffertoimageput4opu
global message2copybuffertoimagereceive4opu
global message2copybuffertoimagesend4opu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2copybuffertoimage4opu"
method2print = "manoeuvre2copybuffertoimage4opu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2copybuffertoimage4opu-started: " + str(manoeuvre2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 0B/33) passed" + "; queue2copybuffertoimagemanoeuvre4opu-to-manoeuvre2copybuffertoimage4opu: " + str(queue2copybuffertoimagemanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2copybuffertoimagemanoeuvre4opu-to-manoeuvre2copybuffertoimage4opu: " + str(consumerchannel2copybuffertoimagemanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0D/33) passed" + "; publisherchannel2copybuffertoimagemanoeuvre4opu-to-manoeuvre2copybuffertoimage4opu: " + str(publisherchannel2copybuffertoimagemanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4copybuffertoimage = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2copybuffertoimage4opu-try-by-manoeuvre2copybuffertoimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2copybuffertoimage4opu is None:
state2copybuffertoimage4opu = 0
message2print = "{(Step 0F/33) initialized" + "; state2copybuffertoimage4opu-initialized-by-manoeuvre2copybuffertoimage4opu to: " + str(state2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2copybuffertoimage4opu-used-by-manoeuvre2copybuffertoimage4opu: " + str(state2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2copybuffertoimage4opu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2copybuffertoimage4opu-initialized-by-manoeuvre2copybuffertoimage4opu to: " + str(state2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2copybuffertoimageinfo4opu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2copybuffertoimageinfo4opu-initialized-by-manoeuvre2copybuffertoimage4opu to: " + str(ack2copybuffertoimageinfo4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2copybuffertoimageget4opu = 'default2copybuffertoimage4opu'
message2print = "{(Step 0Z3/33) initialized" + "; message2copybuffertoimageget4opu-initialized-by-manoeuvre2copybuffertoimage4opu to: " + str(message2copybuffertoimageget4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimageput4opu = 'default2copybuffertoimage4opu'
message2print = "{(Step 0Z4/33) initialized" + "; message2copybuffertoimageput4opu-initialized-by-manoeuvre2copybuffertoimage4opu to: " + str(message2copybuffertoimageput4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimagereceive4opu = 'default2copybuffertoimage4opu'
message2print = "{(Step 0Z5/33) initialized" + "; message2copybuffertoimagereceive4opu-initialized-by-manoeuvre2copybuffertoimage4opu to: " + str(message2copybuffertoimagereceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimagesend4opu = 'default2copybuffertoimage4opu'
message2print = "{(Step 0Z6/33) initialized" + "; message2copybuffertoimagesend4opu-initialized-by-manoeuvre2copybuffertoimage4opu to: " + str(message2copybuffertoimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
max2copybuffertoimagestate4opu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2copybuffertoimagestate4opu-initialized-by-manoeuvre2copybuffertoimage4opu to: " + str( max2copybuffertoimagestate4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2copybuffertoimage4opu = state2copybuffertoimage4opu + 1
message2print = "{(Step 0H/33) added" + "; state2copybuffertoimage4opu-added-by-manoeuvre2copybuffertoimage4opu: " + str(state2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2copybuffertoimage4opu > max2copybuffertoimagestate4opu:
state2copybuffertoimage4opu = 0
message2print = "{(Step 0I/33) set" + "; state2copybuffertoimage4opu-set-by-manoeuvre2copybuffertoimage4opu to: " + str(state2copybuffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack2copybuffertoimageinfo4opu = False
message2print = "{(Step 0J/33) set" + "; ack2copybuffertoimageinfo4opu-set-by-manoeuvre2copybuffertoimage4opu to: " + str(ack2copybuffertoimageinfo4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimageget4opu = 'default2copybuffertoimage4opu'
message2print = "{(Step 0K/33) set" + "; message2copybuffertoimageget4opu-set-by-manoeuvre2copybuffertoimage4opu to: " + str(message2copybuffertoimageget4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimageput4opu = 'default2copybuffertoimage4opu'
message2print = "{(Step 0L/33) set" + "; message2copybuffertoimageput4opu-set-by-manoeuvre2copybuffertoimage4opu to: " + str(message2copybuffertoimageput4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimagereceive4opu = 'default2copybuffertoimage4opu'
message2print = "{(Step 0M/33) set" + "; message2copybuffertoimagereceive4opu-set-by-manoeuvre2copybuffertoimage4opu to: " + str(message2copybuffertoimagereceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2copybuffertoimagesend4opu = 'default2copybuffertoimage4opu'
message2print = "{(Step 0N/33) set" + "; message2copybuffertoimagesend4opu-set-by-manoeuvre2copybuffertoimage4opu to: " + str(message2copybuffertoimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
max2copybuffertoimagestate4opu = 3
message2print = "{(Step 0O/33) initialized" + "; max2copybuffertoimagestate4opu-set-by-manoeuvre2copybuffertoimage4opu to: " + str( max2copybuffertoimagestate4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2copybuffertoimage4opu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2copybuffertoimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copybuffertoimagereceive4opu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copybuffertoimagereceive4opu = consumerchannel2copybuffertoimagemanoeuvre4opu.recv()
message2print = "{(Step 1B/33) received" + "; message2copybuffertoimagereceive4opu-received-by-manoeuvre2copybuffertoimage4opu: " + str(message2copybuffertoimagereceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2copybuffertoimagereceive4opu == 'copy2copybuffertoimage4opu':
message2copybuffertoimagesend4opu = 'roger2copybuffertoimage4opu'
else:
message2copybuffertoimagesend4opu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copybuffertoimagemanoeuvre4opu.send(message2copybuffertoimagesend4opu)
message2print = "{(Step 1C/33) sent" + "; message2copybuffertoimagesend4opu-sent-by-manoeuvre2copybuffertoimage4opu: " + str(message2copybuffertoimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2copybuffertoimagereceive4opu-failed-by-manoeuvre2copybuffertoimage4opu: " + str(message2copybuffertoimagereceive4opu) + "; 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 state2copybuffertoimage4opu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2copybuffertoimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2copybuffertoimagereceive4opu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2copybuffertoimagereceive4opu = consumerchannel2copybuffertoimagemanoeuvre4opu.recv()
message2print = "{(Step 2B/33) received" + "; message2copybuffertoimagereceive4opu-received-by-manoeuvre2copybuffertoimage4opu: " + str(message2copybuffertoimagereceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2copybuffertoimagereceive4opu == 'ready2copybuffertoimage4opu':
message2copybuffertoimagesend4opu = 'ready2copybuffertoimage4opu'
else:
message2copybuffertoimagesend4opu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND READY OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2copybuffertoimagemanoeuvre4opu.send(message2copybuffertoimagesend4opu)
message2print = "{(Step 2C/33) sent" + "; message2copybuffertoimagesend4opu-sent-by-manoeuvre2copybuffertoimage4opu: " + str(message2copybuffertoimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2copybuffertoimagereceive4opu-failed-by-manoeuvre2copybuffertoimage4opu: " + str(message2copybuffertoimagereceive4opu) + "; 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 state2copybuffertoimage4opu == 3:
info2image4opu = None
message2print = "{(Step 3A/70) try" + "; info2image4opu-try-by-manoeuvre2copybuffertoimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4opu = queue2copybuffertoimagemanoeuvre4opu.get()
message2print = "{(Step 3B/33) got" + "; info2image4opu-got-by-manoeuvre2copybuffertoimage4opu: " + str(info2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ..//..//..//..//..//web//images//png//dragonxi.png
if info2image4opu is None:
code2nack = code2nack + '3Z1-'
ack2copybuffertoimageinfo4opu = False
else:
code2ack = code2ack + '3C-'
ack2copybuffertoimageinfo4opu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2copybuffertoimagemanoeuvre4opu-failed-by-manoeuvre2copybuffertoimage4opu: " + str(queue2copybuffertoimagemanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2copybuffertoimagesend4opu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2copybuffertoimageinfo4opu is True:
message2copybuffertoimagesend4opu = 'ack2imageinfo4opu'
else:
message2copybuffertoimagesend4opu = 'nack2imageinfo4opu'
message2print = "{(Step 4B/33) set" + "; message2copybuffertoimagesend4opu-set-by-manoeuvre2copybuffertoimage4opu to: " + str(message2copybuffertoimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4opu
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copybuffertoimagesend4opu-failed-by-manoeuvre2copybuffertoimage4opu: " + str(message2copybuffertoimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2copybuffertoimagemanoeuvre4opu-calling-by-manoeuvre2copybuffertoimage4opu: " + str(publisherchannel2copybuffertoimagemanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2copybuffertoimagesend4opu-passing-to-send-by-manoeuvre2copybuffertoimage4opu: " + str(message2copybuffertoimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2copybuffertoimagesend4opu-failed-by-manoeuvre2copybuffertoimage4opu: " + str(message2copybuffertoimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2copybuffertoimagemanoeuvre4opu.send(message2copybuffertoimagesend4opu)
message2print = "{(Step 4E/33) sent" + "; message2copybuffertoimagesend4opu-sent-by-manoeuvre2copybuffertoimage4opu: " + str(message2copybuffertoimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4opu
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2copybuffertoimagesend4opu-failed-by-manoeuvre2copybuffertoimage4opu: " + str(message2copybuffertoimagesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4copybuffertoimage['ACK2INFO4OPU'] = ack2copybuffertoimageinfo4opu
response2manouvre4copybuffertoimage['CODE2ACK4OPU'] = code2ack
response2manouvre4copybuffertoimage['CODE2NACK4OPU'] = code2nack
response2manouvre4copybuffertoimage['MESSAGE2GET4OPU'] = message2copybuffertoimageget4opu
response2manouvre4copybuffertoimage['MESSAGE2PUT4OPU'] = message2copybuffertoimageput4opu
response2manouvre4copybuffertoimage['MESSAGE2RECEIVE4OPU'] = message2copybuffertoimagereceive4opu
response2manouvre4copybuffertoimage['MESSAGE2SEND4OPU'] = message2copybuffertoimagesend4opu
response2manouvre4copybuffertoimage['STATE2MANOEUVRE4OPU'] = state2copybuffertoimage4opu
message2print = "{(Step 33/33) returning" + "; response2manouvre4copybuffertoimage-returning-by-manoeuvre2copybuffertoimage4opu: " + str(response2manouvre4copybuffertoimage) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1 {'MESSAGE2SEND4OPU': 'roger2copybuffertoimage4opu',
# 'ACK2INFO4OPU': False,
# 'MESSAGE2GET4OPU': 'default2copybuffertoimage4opu',
# 'MESSAGE2RECEIVE4OPU': 'copy2copybuffertoimage4opu',
# 'CODE2ACK4OPU': ' 0D-1C-',
# 'MESSAGE2PUT4OPU': 'default2copybuffertoimage4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 1}; time: 02:18:55 10/04/11 Pacific Daylight Time}
#2 {'MESSAGE2SEND4OPU': 'ready2copybuffertoimage4opu',
# 'ACK2INFO4OPU': False,
# 'MESSAGE2GET4OPU': 'default2copybuffertoimage4opu',
# 'MESSAGE2RECEIVE4OPU': 'ready2copybuffertoimage4opu',
# 'CODE2ACK4OPU': ' 0D-2C-',
# 'MESSAGE2PUT4OPU': 'default2copybuffertoimage4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 2}; time: 02:18:55 10/04/11 Pacific Daylight Time}
#3 {'MESSAGE2SEND4OPU': 'ack2imageinfo4opu',
# 'ACK2INFO4OPU': True,
# 'MESSAGE2GET4OPU': 'default2copybuffertoimage4opu',
# 'MESSAGE2RECEIVE4OPU': 'ready2copybuffertoimage4opu',
# 'CODE2ACK4OPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4OPU': 'default2copybuffertoimage4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 3}; time: 02:18:55 10/04/11 Pacific Daylight Time}
#4 {'MESSAGE2SEND4OPU': 'default2copybuffertoimage4opu',
# 'ACK2INFO4OPU': False,
# 'MESSAGE2GET4OPU': 'default2copybuffertoimage4opu',
# 'MESSAGE2RECEIVE4OPU': 'default2copybuffertoimage4opu',
# 'CODE2ACK4OPU': ' 0D-',
# 'MESSAGE2PUT4OPU': 'default2copybuffertoimage4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 0}
return response2manouvre4copybuffertoimage
#
# -----------------------------------------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------------------------------------
def manoeuvre2readimage4opu(queue2readmanoeuvre4opu, consumerchannel2readmanoeuvre4opu, publisherchannel2readmanoeuvre4opu):
'''
manoeuvres read control and command
'''
global state2read4opu # STATE FOR COMMAND AND CONTROL
global max2readstate4opu # MAX FOR STATE
global ack2readinfo4opu # ACK FOR IMAGE INFO
global message2readget4opu
global message2readput4opu
global message2readreceive4opu
global message2readsend4opu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2readimage4opu"
method2print = "manoeuvre2readimage4opu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2readimage4opu-started: " + str(manoeuvre2readimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 0B/33) passed" + "; queue2readmanoeuvre4opu-to-manoeuvre2readimage4opu: " + str(queue2readmanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2readmanoeuvre4opu-to-manoeuvre2readimage4opu: " + str(consumerchannel2readmanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0D/33) passed" + "; publisherchannel2readmanoeuvre4opu-to-manoeuvre2readimage4opu: " + str(publisherchannel2readmanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4read = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2read4opu-try-by-manoeuvre2readimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2read4opu is None:
state2read4opu = 0
message2print = "{(Step 0F/33) initialized" + "; state2read4opu-initialized-by-manoeuvre2readimage4opu to: " + str(state2read4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2read4opu-used-by-manoeuvre2readimage4opu: " + str(state2read4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2read4opu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2read4opu-initialized-by-manoeuvre2readimage4opu to: " + str(state2read4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2readinfo4opu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2readinfo4opu-initialized-by-manoeuvre2readimage4opu to: " + str(ack2readinfo4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2readget4opu = 'default2read4opu'
message2print = "{(Step 0Z3/33) initialized" + "; message2readget4opu-initialized-by-manoeuvre2readimage4opu to: " + str(message2readget4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4opu
message2readput4opu = 'default2read4opu'
message2print = "{(Step 0Z4/33) initialized" + "; message2readput4opu-initialized-by-manoeuvre2readimage4opu to: " + str(message2readput4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4opu
message2readreceive4opu = 'default2read4opu'
message2print = "{(Step 0Z5/33) initialized" + "; message2readreceive4opu-initialized-by-manoeuvre2readimage4opu to: " + str(message2readreceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4opu
message2readsend4opu = 'default2read4opu'
message2print = "{(Step 0Z6/33) initialized" + "; message2readsend4opu-initialized-by-manoeuvre2readimage4opu to: " + str(message2readsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4opu
max2readstate4opu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2readstate4opu-initialized-by-manoeuvre2readimage4opu to: " + str( max2readstate4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2read4opu = state2read4opu + 1
message2print = "{(Step 0H/33) added" + "; state2read4opu-added-by-manoeuvre2readimage4opu: " + str(state2read4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2read4opu > max2readstate4opu:
state2read4opu = 0
message2print = "{(Step 0I/33) set" + "; state2read4opu-set-by-manoeuvre2readimage4opu to: " + str(state2read4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2readinfo4opu = False
message2print = "{(Step 0J/33) set" + "; ack2readinfo4opu-set-by-manoeuvre2readimage4opu to: " + str(ack2readinfo4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2readget4opu = 'default2read4opu'
message2print = "{(Step 0K/33) set" + "; message2readget4opu-set-by-manoeuvre2readimage4opu to: " + str(message2readget4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4opu
message2readput4opu = 'default2read4opu'
message2print = "{(Step 0L/33) set" + "; message2readput4opu-set-by-manoeuvre2readimage4opu to: " + str(message2readput4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4opu
message2readreceive4opu = 'default2read4opu'
message2print = "{(Step 0M/33) set" + "; message2readreceive4opu-set-by-manoeuvre2readimage4opu to: " + str(message2readreceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4opu
message2readsend4opu = 'default2read4opu'
message2print = "{(Step 0N/33) set" + "; message2readsend4opu-set-by-manoeuvre2readimage4opu to: " + str(message2readsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2read4opu
max2readstate4opu = 3
message2print = "{(Step 0O/33) initialized" + "; max2readstate4opu-set-by-manoeuvre2readimage4opu to: " + str( max2readstate4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2read4opu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2readimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2readreceive4opu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2readreceive4opu = consumerchannel2readmanoeuvre4opu.recv()
message2print = "{(Step 1B/33) received" + "; message2readreceive4opu-received-by-manoeuvre2readimage4opu: " + str(message2readreceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# copy2read4opu
if message2readreceive4opu == 'copy2read4opu':
message2readsend4opu = 'roger2read4opu'
else:
message2readsend4opu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2readmanoeuvre4opu.send(message2readsend4opu)
message2print = "{(Step 1C/33) sent" + "; message2readsend4opu-sent-by-manoeuvre2readimage4opu: " + str(message2readsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# roger2read4opu
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2readreceive4opu-failed-by-manoeuvre2readimage4opu: " + str(message2readreceive4opu) + "; 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 state2read4opu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2readimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2readreceive4opu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2readreceive4opu = consumerchannel2readmanoeuvre4opu.recv()
message2print = "{(Step 2B/33) received" + "; message2readreceive4opu-received-by-manoeuvre2readimage4opu: " + str(message2readreceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ready2read4opu
if message2readreceive4opu == 'ready2read4opu':
message2readsend4opu = 'ready2read4opu'
else:
message2readsend4opu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2readmanoeuvre4opu.send(message2readsend4opu)
message2print = "{(Step 2C/33) sent" + "; message2readsend4opu-sent-by-manoeuvre2readimage4opu: " + str(message2readsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ready2read4opu
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2readreceive4opu-failed-by-manoeuvre2readimage4opu: " + str(message2readreceive4opu) + "; 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 state2read4opu == 3:
info2image4opu = None
message2print = "{(Step 3A/70) try" + "; info2image4opu-try-by-manoeuvre2readimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4opu = queue2readmanoeuvre4opu.get()
message2print = "{(Step 3B/33) got" + "; info2image4opu-got-by-manoeuvre2readimage4opu: " + str(info2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ..//..//..//..//..//web//images//png//dragonxi.png
if info2image4opu is None:
code2nack = code2nack + '3Z1-'
ack2readinfo4opu = False
else:
code2ack = code2ack + '3C-'
ack2readinfo4opu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2readmanoeuvre4opu-failed-by-manoeuvre2readimage4opu: " + str(queue2readmanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2readsend4opu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2readinfo4opu is True:
message2readsend4opu = 'ack2imageinfo4opu'
else:
message2readsend4opu = 'nack2imageinfo4opu'
message2print = "{(Step 4B/33) set" + "; message2readsend4opu-set-by-manoeuvre2readimage4opu to: " + str(message2readsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4opu
except:
message2print = "{(Step 4Z1/33) failed" + "; message2readsend4opu-failed-by-manoeuvre2readimage4opu: " + str(message2readsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2readmanoeuvre4opu-calling-by-manoeuvre2readimage4opu: " + str(publisherchannel2readmanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2readsend4opu-passing-to-send-by-manoeuvre2readimage4opu: " + str(message2readsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2readsend4opu-failed-by-manoeuvre2readimage4opu: " + str(message2readsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2readmanoeuvre4opu.send(message2readsend4opu)
message2print = "{(Step 4E/33) sent" + "; message2readsend4opu-sent-by-manoeuvre2readimage4opu: " + str(message2readsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4opu
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2readsend4opu-failed-by-manoeuvre2readimage4opu: " + str(message2readsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4read['ACK2INFO4OPU'] = ack2readinfo4opu
response2manouvre4read['CODE2ACK4OPU'] = code2ack
response2manouvre4read['CODE2NACK4OPU'] = code2nack
response2manouvre4read['MESSAGE2GET4OPU'] = message2readget4opu
response2manouvre4read['MESSAGE2PUT4OPU'] = message2readput4opu
response2manouvre4read['MESSAGE2RECEIVE4OPU'] = message2readreceive4opu
response2manouvre4read['MESSAGE2SEND4OPU'] = message2readsend4opu
response2manouvre4read['STATE2MANOEUVRE4OPU'] = state2read4opu
message2print = "{(Step 33/33) returning" + "; response2manouvre4read-returning-by-manoeuvre2readimage4opu: " + str(response2manouvre4read) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1 {'MESSAGE2SEND4OPU': 'roger2read4opu',
# 'ACK2INFO4OPU': False,
# 'MESSAGE2GET4OPU': 'default2read4opu',
# 'MESSAGE2RECEIVE4OPU': 'copy2read4opu',
# 'CODE2ACK4OPU': ' 0D-1C-',
# 'MESSAGE2PUT4OPU': 'default2read4opu',
# 'CODE2NACK4OPU': ' ', 'STATE2MANOEUVRE4OPU': 1}; time: 01:44:40 09/29/11 Pacific Daylight Time}
#2 {'MESSAGE2SEND4OPU': 'ready2read4opu',
# 'ACK2INFO4OPU': False,
# 'MESSAGE2GET4OPU': 'default2read4opu',
# 'MESSAGE2RECEIVE4OPU': 'ready2read4opu',
# 'CODE2ACK4OPU': ' 0D-2C-',
# 'MESSAGE2PUT4OPU': 'default2read4opu',
# 'CODE2NACK4OPU': ' ', 'STATE2MANOEUVRE4OPU': 2}; time: 01:44:40 09/29/11 Pacific Daylight Time}
#3 {'MESSAGE2SEND4OPU': 'ack2imageinfo4opu',
# 'ACK2INFO4OPU': True,
# 'MESSAGE2GET4OPU': 'default2read4opu',
# 'MESSAGE2RECEIVE4OPU': 'ready2read4opu',
# 'CODE2ACK4OPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4OPU': 'default2read4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 3}; time: 01:44:40 09/29/11 Pacific Daylight Time}
#4 {'MESSAGE2SEND4OPU': 'default2read4opu',
# 'ACK2INFO4OPU': False,
# 'MESSAGE2GET4OPU': 'default2read4opu',
# 'MESSAGE2RECEIVE4OPU': 'default2read4opu',
# 'CODE2ACK4OPU': ' 0D-',
# 'MESSAGE2PUT4OPU': 'default2read4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 0}; time: 02:11:49 09/29/11 Pacific Daylight Time}
return response2manouvre4read
#
# -------------------------------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------------------------------
def manoeuvre2writeimage4opu(queue2writemanoeuvre4opu, consumerchannel2writemanoeuvre4opu, publisherchannel2writemanoeuvre4opu):
'''
manoeuvres control and command
'''
global state2write4opu # STATE FOR COMMAND AND CONTROL
global max2writestate4opu # MAX FOR STATE
global ack2writeinfo4opu # ACK FOR IMAGE INFO
global message2writeget4opu
global message2writeput4opu
global message2writereceive4opu
global message2writesend4opu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2writeimage4opu"
method2print = "manoeuvre2writeimage4opu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2writeimage4opu-started: " + str(manoeuvre2writeimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0B/33) passed" + "; queue2writemanoeuvre4opu-to-manoeuvre2writeimage4opu: " + str(queue2writemanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2writemanoeuvre4opu-to-manoeuvre2writeimage4opu: " + str(consumerchannel2writemanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# read-write PipeConnection, handle 568>
message2print = "{(Step 0D/33) passed" + "; publisherchannel2writemanoeuvre4opu-to-manoeuvre2writeimage4opu: " + str(publisherchannel2writemanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4write = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2write4opu-try-by-manoeuvre2writeimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2write4opu is None:
state2write4opu = 0
message2print = "{(Step 0F/33) initialized" + "; state2write4opu-initialized-by-manoeuvre2writeimage4opu to: " + str(state2write4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2write4opu-used-by-manoeuvre2writeimage4opu: " + str(state2write4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2write4opu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2write4opu-initialized-by-manoeuvre2writeimage4opu to: " + str(state2write4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2writeinfo4opu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2writeinfo4opu-initialized-by-manoeuvre2writeimage4opu to: " + str(ack2writeinfo4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2writeget4opu = 'default2write4opu'
message2print = "{(Step 0Z3/33) initialized" + "; message2writeget4opu-initialized-by-manoeuvre2writeimage4opu to: " + str(message2writeget4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4opu
message2writeput4opu = 'default2write4opu'
message2print = "{(Step 0Z4/33) initialized" + "; message2writeput4opu-initialized-by-manoeuvre2writeimage4opu to: " + str(message2writeput4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4opu
message2writereceive4opu = 'default2write4opu'
message2print = "{(Step 0Z5/33) initialized" + "; message2writereceive4opu-initialized-by-manoeuvre2writeimage4opu to: " + str(message2writereceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4opu
message2writesend4opu = 'default2write4opu'
message2print = "{(Step 0Z6/33) initialized" + "; message2writesend4opu-initialized-by-manoeuvre2writeimage4opu to: " + str(message2writesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4opu
max2writestate4opu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2writestate4opu-initialized-by-manoeuvre2writeimage4opu to: " + str( max2writestate4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2write4opu = state2write4opu + 1
message2print = "{(Step 0H/33) added" + "; state2write4opu-added-by-manoeuvre2writeimage4opu: " + str(state2write4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2write4opu > max2writestate4opu:
state2write4opu = 0
message2print = "{(Step 0I/33) set" + "; state2write4opu-set-by-manoeuvre2writeimage4opu to: " + str(state2write4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2writeinfo4opu = False
message2print = "{(Step 0J/33) set" + "; ack2writeinfo4opu-set-by-manoeuvre2writeimage4opu to: " + str(ack2writeinfo4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2writeget4opu = 'default2write4opu'
message2print = "{(Step 0K/33) set" + "; message2writeget4opu-set-by-manoeuvre2writeimage4opu to: " + str(message2writeget4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4opu
message2writeput4opu = 'default2write4opu'
message2print = "{(Step 0L/33) set" + "; message2writeput4opu-set-by-manoeuvre2writeimage4opu to: " + str(message2writeput4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4opu
message2writereceive4opu = 'default2write4opu'
message2print = "{(Step 0M/33) set" + "; message2writereceive4opu-set-by-manoeuvre2writeimage4opu to: " + str(message2writereceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4opu
message2writesend4opu = 'default2write4opu'
message2print = "{(Step 0N/33) set" + "; message2writesend4opu-set-by-manoeuvre2writeimage4opu to: " + str(message2writesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2write4opu
max2writestate4opu = 3
message2print = "{(Step 0O/33) initialized" + "; max2writestate4opu-set-by-manoeuvre2writeimage4opu to: " + str( max2writestate4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2write4opu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2writeimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2writereceive4opu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2writereceive4opu = consumerchannel2writemanoeuvre4opu.recv()
message2print = "{(Step 1B/33) received" + "; message2writereceive4opu-received-by-manoeuvre2writeimage4opu: " + str(message2writereceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# copy2write4opu
if message2writereceive4opu == 'copy2write4opu':
message2writesend4opu = 'roger2write4opu'
else:
message2writesend4opu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2writemanoeuvre4opu.send(message2writesend4opu)
message2print = "{(Step 1C/33) sent" + "; message2writesend4opu-sent-by-manoeuvre2writeimage4opu: " + str(message2writesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# roger2write4opu
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2writereceive4opu-failed-by-manoeuvre2writeimage4opu: " + str(message2writereceive4opu) + "; 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 state2write4opu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2writeimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2writereceive4opu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2writereceive4opu = consumerchannel2writemanoeuvre4opu.recv()
message2print = "{(Step 2B/33) received" + "; message2writereceive4opu-received-by-manoeuvre2writeimage4opu: " + str(message2writereceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ready2write4opu
if message2writereceive4opu == 'ready2write4opu':
message2writesend4opu = 'ready2write4opu'
else:
message2writesend4opu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2writemanoeuvre4opu.send(message2writesend4opu)
message2print = "{(Step 2C/33) sent" + "; message2writesend4opu-sent-by-manoeuvre2writeimage4opu: " + str(message2writesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ready2write4opu
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2writereceive4opu-failed-by-manoeuvre2writeimage4opu: " + str(message2writereceive4opu) + "; 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 state2write4opu == 3:
info2image4opu = None
message2print = "{(Step 3A/70) try" + "; info2image4opu-try-by-manoeuvre2writeimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4opu = queue2writemanoeuvre4opu.get()
message2print = "{(Step 3B/33) got" + "; info2image4opu-got-by-manoeuvre2writeimage4opu: " + str(info2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ..//..//..//..//..//web//images//png//dragonxi.png
if info2image4opu is None:
code2nack = code2nack + '3Z1-'
ack2writeinfo4opu = False
else:
code2ack = code2ack + '3C-'
ack2writeinfo4opu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2writemanoeuvre4opu-failed-by-manoeuvre2writeimage4opu: " + str(queue2writemanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2writesend4opu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2writeinfo4opu is True:
message2writesend4opu = 'ack2imageinfo4opu'
else:
message2writesend4opu = 'nack2imageinfo4opu'
message2print = "{(Step 4B/33) set" + "; message2writesend4opu-set-by-manoeuvre2writeimage4opu to: " + str(message2writesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4opu
except:
message2print = "{(Step 4Z1/33) failed" + "; message2writesend4opu-failed-by-manoeuvre2writeimage4opu: " + str(message2writesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2writemanoeuvre4opu-calling-by-manoeuvre2writeimage4opu: " + str(publisherchannel2writemanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2writesend4opu-passing-to-send-by-manoeuvre2writeimage4opu: " + str(message2writesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2writesend4opu-failed-by-manoeuvre2writeimage4opu: " + str(message2writesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2writemanoeuvre4opu.send(message2writesend4opu)
message2print = "{(Step 4E/33) sent" + "; message2writesend4opu-sent-by-manoeuvre2writeimage4opu: " + str(message2writesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# ack2imageinfo4opu
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2writesend4opu-failed-by-manoeuvre2writeimage4opu: " + str(message2writesend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4write['ACK2INFO4OPU'] = ack2writeinfo4opu
response2manouvre4write['CODE2ACK4OPU'] = code2ack
response2manouvre4write['CODE2NACK4OPU'] = code2nack
response2manouvre4write['MESSAGE2GET4OPU'] = message2writeget4opu
response2manouvre4write['MESSAGE2PUT4OPU'] = message2writeput4opu
response2manouvre4write['MESSAGE2RECEIVE4OPU'] = message2writereceive4opu
response2manouvre4write['MESSAGE2SEND4OPU'] = message2writesend4opu
response2manouvre4write['STATE2MANOEUVRE4OPU'] = state2write4opu
message2print = "{(Step 33/33) returning" + "; response2manouvre4write-returning-by-manoeuvre2writeimage4opu: " + str(response2manouvre4write) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1
# {'MESSAGE2SEND4OPU': 'roger2write4opu',
# 'ACK2INFO4OPU': False, 'MESSAGE2GET4OPU': 'default2write4opu',
# 'MESSAGE2RECEIVE4OPU': 'copy2write4opu',
# 'CODE2ACK4OPU': ' 0D-1C-',
# 'MESSAGE2PUT4OPU': 'default2write4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 1}; time: 00:11:53 10/03/11 Pacific Daylight Time}
#2
# {'MESSAGE2SEND4OPU': 'ready2write4opu',
# 'ACK2INFO4OPU': False, 'MESSAGE2GET4OPU': 'default2write4opu',
# 'MESSAGE2RECEIVE4OPU': 'ready2write4opu',
# 'CODE2ACK4OPU': ' 0D-2C-',
# 'MESSAGE2PUT4OPU': 'default2write4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 2}; time: 00:11:53 10/03/11 Pacific Daylight Time}
#3
# {'MESSAGE2SEND4OPU': 'ack2imageinfo4opu',
# 'ACK2INFO4OPU': True, 'MESSAGE2GET4OPU': 'default2write4opu',
# 'MESSAGE2RECEIVE4OPU': 'ready2write4opu',
# 'CODE2ACK4OPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4OPU': 'default2write4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 3}; time: 00:11:53 10/03/11 Pacific Daylight Time}
return response2manouvre4write
#
# -------------------------------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------------------------------
def manoeuvre2mapimage4opu(queue2mapmanoeuvre4opu, consumerchannel2mapmanoeuvre4opu, publisherchannel2mapmanoeuvre4opu):
'''
manoeuvres control and command
'''
global state2map4opu # STATE FOR COMMAND AND CONTROL
global max2mapstate4opu # MAX FOR STATE
global ack2mapinfo4opu # ACK FOR IMAGE INFO
global message2mapget4opu
global message2mapput4opu
global message2mapreceive4opu
global message2mapsend4opu
# -----------------------------------------------------------------------------------------
# (Step 0/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "manoeuvre2mapimage4opu"
method2print = "manoeuvre2mapimage4opu"
code2ack = ' '
code2nack = ' '
message2print = "{(Step 0A/33) started" + "; manoeuvre2mapimage4opu-started: " + str(manoeuvre2mapimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0B/33) passed" + "; queue2mapmanoeuvre4opu-to-manoeuvre2mapimage4opu: " + str(queue2mapmanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0C/33) passed" + "; consumerchannel2mapmanoeuvre4opu-to-manoeuvre2mapimage4opu: " + str(consumerchannel2mapmanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0D/33) passed" + "; publisherchannel2mapmanoeuvre4opu-to-manoeuvre2mapimage4opu: " + str(publisherchannel2mapmanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '0D-'
response2manouvre4map = {}
# ------------------------------------------------------------------------------------------------------------------------
# SETTINGS
# ------------------------------------------------------------------------------------------------------------------------
message2print = "{(Step 0E/70) try" + "; state2map4opu-try-by-manoeuvre2mapimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if state2map4opu is None:
state2map4opu = 0
message2print = "{(Step 0F/33) initialized" + "; state2map4opu-initialized-by-manoeuvre2mapimage4opu to: " + str(state2map4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
else:
message2print = "{(Step 0G/33) used" + "; state2map4opu-used-by-manoeuvre2mapimage4opu: " + str(state2map4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3;
except:
state2map4opu = 0
message2print = "{(Step 0Z1/33) initialized" + "; state2map4opu-initialized-by-manoeuvre2mapimage4opu to: " + str(state2map4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2mapinfo4opu = False
message2print = "{(Step 0Z2/33) initialized" + "; ack2mapinfo4opu-initialized-by-manoeuvre2mapimage4opu to: " + str(ack2mapinfo4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2mapget4opu = 'default2map4opu'
message2print = "{(Step 0Z3/33) initialized" + "; message2mapget4opu-initialized-by-manoeuvre2mapimage4opu to: " + str(message2mapget4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4opu
message2mapput4opu = 'default2map4opu'
message2print = "{(Step 0Z4/33) initialized" + "; message2mapput4opu-initialized-by-manoeuvre2mapimage4opu to: " + str(message2mapput4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4opu
message2mapreceive4opu = 'default2map4opu'
message2print = "{(Step 0Z5/33) initialized" + "; message2mapreceive4opu-initialized-by-manoeuvre2mapimage4opu to: " + str(message2mapreceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4opu
message2mapsend4opu = 'default2map4opu'
message2print = "{(Step 0Z6/33) initialized" + "; message2mapsend4opu-initialized-by-manoeuvre2mapimage4opu to: " + str(message2mapsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4opu
max2mapstate4opu = 3
message2print = "{(Step 0Z7/33) initialized" + "; max2mapstate4opu-initialized-by-manoeuvre2mapimage4opu to: " + str( max2mapstate4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE UPDATE
# ------------------------------------------------------------------------------------------------------------------------
state2map4opu = state2map4opu + 1
message2print = "{(Step 0H/33) added" + "; state2map4opu-added-by-manoeuvre2mapimage4opu: " + str(state2map4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 1; 2; 3; 4
if state2map4opu > max2mapstate4opu:
state2map4opu = 0
message2print = "{(Step 0I/33) set" + "; state2map4opu-set-by-manoeuvre2mapimage4opu to: " + str(state2map4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
ack2mapinfo4opu = False
message2print = "{(Step 0J/33) set" + "; ack2mapinfo4opu-set-by-manoeuvre2mapimage4opu to: " + str(ack2mapinfo4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# False
message2mapget4opu = 'default2map4opu'
message2print = "{(Step 0K/33) set" + "; message2mapget4opu-set-by-manoeuvre2mapimage4opu to: " + str(message2mapget4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4opu
message2mapput4opu = 'default2map4opu'
message2print = "{(Step 0L/33) set" + "; message2mapput4opu-set-by-manoeuvre2mapimage4opu to: " + str(message2mapput4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4opu
message2mapreceive4opu = 'default2map4opu'
message2print = "{(Step 0M/33) set" + "; message2mapreceive4opu-set-by-manoeuvre2mapimage4opu to: " + str(message2mapreceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4opu
message2mapsend4opu = 'default2map4opu'
message2print = "{(Step 0N/33) set" + "; message2mapsend4opu-set-by-manoeuvre2mapimage4opu to: " + str(message2mapsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# default2map4opu
max2mapstate4opu = 3
message2print = "{(Step 0O/33) initialized" + "; max2mapstate4opu-set-by-manoeuvre2mapimage4opu to: " + str( max2mapstate4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ------------------------------------------------------------------------------------------------------------------------
# STATE I - RECEIVE CONTROL AND COMMAND COPY MESSAGE VIA PIPE AND SEND ROGER OR NEGATIVE BACK
# ------------------------------------------------------------------------------------------------------------------------
if state2map4opu == 1:
message2print = "{(Step 1A/70) try" + "; receive-try-by-manoeuvre2mapimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2mapreceive4opu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2mapreceive4opu = consumerchannel2mapmanoeuvre4opu.recv()
message2print = "{(Step 1B/33) received" + "; message2mapreceive4opu-received-by-manoeuvre2mapimage4opu: " + str(message2mapreceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2mapreceive4opu == 'copy2mapimage4opu':
message2mapsend4opu = 'roger2mapimage4opu'
else:
message2mapsend4opu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2mapmanoeuvre4opu.send(message2mapsend4opu)
message2print = "{(Step 1C/33) sent" + "; message2mapsend4opu-sent-by-manoeuvre2mapimage4opu: " + str(message2mapsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1C-'
except:
message2print = "{(Step 1Z/33) failed" + "; message2mapreceive4opu-failed-by-manoeuvre2mapimage4opu: " + str(message2mapreceive4opu) + "; 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 state2map4opu == 2:
message2print = "{(Step 2A/70) try" + "; receive-try-by-manoeuvre2mapimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2mapreceive4opu = ''
try:
# ----------------------------------------------------------------------------------------------------------------
# RECEIVE CONTROL AND COMMAND MESSAGE VIA PIPE
# ----------------------------------------------------------------------------------------------------------------
message2mapreceive4opu = consumerchannel2mapmanoeuvre4opu.recv()
message2print = "{(Step 2B/33) received" + "; message2mapreceive4opu-received-by-manoeuvre2mapimage4opu: " + str(message2mapreceive4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if message2mapreceive4opu == 'ready2mapimage4opu':
message2mapsend4opu = 'ready2mapimage4opu'
else:
message2mapsend4opu = ''
# ----------------------------------------------------------------------------------------------------------------
# SEND ROGER OR NEGATIVE BACK
# ----------------------------------------------------------------------------------------------------------------
publisherchannel2mapmanoeuvre4opu.send(message2mapsend4opu)
message2print = "{(Step 2C/33) sent" + "; message2mapsend4opu-sent-by-manoeuvre2mapimage4opu: " + str(message2mapsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '2C-'
except:
message2print = "{(Step 2Z/33) failed" + "; message2mapreceive4opu-failed-by-manoeuvre2mapimage4opu: " + str(message2mapreceive4opu) + "; 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 state2map4opu == 3:
info2image4opu = None
message2print = "{(Step 3A/70) try" + "; info2image4opu-try-by-manoeuvre2mapimage4opu" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
# ----------------------------------------------------------------------------------------------------------------
# GET IMAGE INFORMATION SUCH AS IMAGE PATH VIA QUEUE
# ----------------------------------------------------------------------------------------------------------------
info2image4opu = queue2mapmanoeuvre4opu.get()
message2print = "{(Step 3B/33) got" + "; info2image4opu-got-by-manoeuvre2mapimage4opu: " + str(info2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if info2image4opu is None:
code2nack = code2nack + '3Z1-'
ack2mapinfo4opu = False
else:
code2ack = code2ack + '3C-'
ack2mapinfo4opu = True
except:
message2print = "{(Step 3Z1/33) failed" + "; queue2mapmanoeuvre4opu-failed-by-manoeuvre2mapimage4opu: " + str(queue2mapmanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z1-'
message2mapsend4opu = ' '
try:
# ----------------------------------------------------------------------------------------------------------------
# SEND CONTROL INFO ABOUT IMAGE OPERATION - EITHER ACK OR NACK
# ----------------------------------------------------------------------------------------------------------------
if ack2mapinfo4opu is True:
message2mapsend4opu = 'ack2imageinfo4opu'
else:
message2mapsend4opu = 'nack2imageinfo4opu'
message2print = "{(Step 4B/33) set" + "; message2mapsend4opu-set-by-manoeuvre2mapimage4opu to: " + str(message2mapsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2mapsend4opu-failed-by-manoeuvre2mapimage4opu: " + str(message2mapsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z1-'
try:
message2print = "{(Step 4C/70) using" + "; publisherchannel2mapmanoeuvre4opu-calling-by-manoeuvre2mapimage4opu: " + str(publisherchannel2mapmanoeuvre4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{{(Step 4D/70) passing" + "; message2mapsend4opu-passing-to-send-by-manoeuvre2mapimage4opu: " + str(message2mapsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4Z1/33) failed" + "; message2mapsend4opu-failed-by-manoeuvre2mapimage4opu: " + str(message2mapsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z2-'
try:
publisherchannel2mapmanoeuvre4opu.send(message2mapsend4opu)
message2print = "{(Step 4E/33) sent" + "; message2mapsend4opu-sent-by-manoeuvre2mapimage4opu: " + str(message2mapsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '4E-'
except:
message2print = "{(Step 4Z3/33) failed" + "; message2mapsend4opu-failed-by-manoeuvre2mapimage4opu: " + str(message2mapsend4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z3-'
else:
pass
# ------------------------------------------------------------------------------------------------------------------------
# RETURN
# ------------------------------------------------------------------------------------------------------------------------
response2manouvre4map['ACK2INFO4OPU'] = ack2mapinfo4opu
response2manouvre4map['CODE2ACK4OPU'] = code2ack
response2manouvre4map['CODE2NACK4OPU'] = code2nack
response2manouvre4map['MESSAGE2GET4OPU'] = message2mapget4opu
response2manouvre4map['MESSAGE2PUT4OPU'] = message2mapput4opu
response2manouvre4map['MESSAGE2RECEIVE4OPU'] = message2mapreceive4opu
response2manouvre4map['MESSAGE2SEND4OPU'] = message2mapsend4opu
response2manouvre4map['STATE2MANOEUVRE4OPU'] = state2map4opu
message2print = "{(Step 33/33) returning" + "; response2manouvre4map-returning-by-manoeuvre2mapimage4opu: " + str(response2manouvre4map) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#1 {'MESSAGE2SEND4OPU': 'roger2mapimage4opu',
# 'ACK2INFO4OPU': False,
# 'MESSAGE2GET4OPU': 'default2map4opu',
# 'MESSAGE2RECEIVE4OPU': 'copy2mapimage4opu',
# 'CODE2ACK4OPU': ' 0D-1C-',
# 'MESSAGE2PUT4OPU': 'default2map4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 1}
#2 {'MESSAGE2SEND4OPU': 'ready2mapimage4opu',
# 'ACK2INFO4OPU': False,
# 'MESSAGE2GET4OPU': 'default2map4opu',
# 'MESSAGE2RECEIVE4OPU': 'ready2mapimage4opu',
# 'CODE2ACK4OPU': ' 0D-2C-',
# 'MESSAGE2PUT4OPU': 'default2map4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 2}; time: 06:49:48 10/04/11 Pacific Daylight Time}
#3 {'MESSAGE2SEND4OPU': 'ack2imageinfo4opu',
# 'ACK2INFO4OPU': True,
# 'MESSAGE2GET4OPU': 'default2map4opu',
# 'MESSAGE2RECEIVE4OPU': 'ready2mapimage4opu',
# 'CODE2ACK4OPU': ' 0D-3C-4E-',
# 'MESSAGE2PUT4OPU': 'default2map4opu',
# 'CODE2NACK4OPU': ' ',
# 'STATE2MANOEUVRE4OPU': 3}; time: 06:49:48 10/04/11 Pacific Daylight Time}
#4 {'MESSAGE2SEND4OPU': 'default2map4opu',
# 'ACK2INFO4OPU': False,
# 'MESSAGE2GET4OPU': 'default2map4opu',
# 'MESSAGE2RECEIVE4OPU': 'default2map4opu',
# 'CODE2ACK4OPU': ' 0D-',
# 'MESSAGE2PUT4OPU': 'default2map4opu',
# 'CODE2NACK4OPU': ' ', 'STATE2MANOEUVRE4OPU': 0}; time: 06:49:48 10/04/11 Pacific Daylight Time}
return response2manouvre4map
#
# -------------------------------------------------------------------------------------------------
#copy2write4opu"
# channel2publish4opu = response4write2image['PUBLISHERCHANNEL']
# channel2publish4opu.send(message2writesend4opu)
# print("(Step 17B/700) OF OPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4OPU: ", channel2publish4opu, " MESSAGE2SEND4OPU: " , message2writesend4opu)
# except:
# print('(Step 17Z1/700) OF OPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4OPU ', time4xi())
# # ------------------------------------------------------------------------------------------
# # (18) LET MANOEUVRE2IMAGE4OPU TO RECEIVE COPY AND AND SEND ROGER VIA PIPE
# # ------------------------------------------------------------------------------------------
# print("(Step 18C/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# try:
# response2manoeuvre4opu = manoeuvre2readimage4opu(queue2write4opu, channel2consume4opu, channel2publish4opu)
# print("(Step 18D/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", manoeuvre2readimage4opu)
# except:
# print("(Step 18Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# else:
# pass # trust activated thread
# # ---------------------------------------------------------------------------------------------
# # (19) RECEIVE CONTROL & COMMAND ROGER VIA PIPE
# # ---------------------------------------------------------------------------------------------
# print('(Step 19A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4OPU ', time4xi())
# try:
# channel2consume4opu = response4write2image['CONSUMERCHANNEL']
# message2writereceive4opu = channel2consume4opu.recv()
# print("(Step 19B/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel2consume4opu, " CONTROL & COMMAND: ", message2writereceive4opu)
# # roger2write4opu
# except:
# print('(Step 19Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4OPU ', time4xi())
# # ---------------------------------------------------------------------------------------------------
# # (20) SEND CONTROL & COMMAND READY VIA PIPE FOR MANOEUVRE2IMAGE4OPU TO RECEIVE
# # ---------------------------------------------------------------------------------------------------
# print('(Step 20A/700) OF OPU2IMAGE4XI5TEST - TRYING TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4OPU ', time4xi())
# try:
# message2writesend4opu = "write2write4opu"
# channel2publish4opu = response4write2image['PUBLISHERCHANNEL']
# channel2publish4opu.send(message2writesend4opu)
# print("(Step 20B/700) OF OPU2IMAGE4XI5TEST - SENT TO CHANNEL2PUBLISH4OPU: ", channel2publish4opu, " MESSAGE2SEND4OPU: " , message2writesend4opu)
# # write2write4opu
# except:
# print('(Step 20Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO SEND CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4OPU ', time4xi())
# # -----------------------------------------------------------------------------------
# # (21) LET MANOEUVRE2IMAGE4OPU TO RECEIVE READY AND TO SEND READY
# # -----------------------------------------------------------------------------------
# print("(Step 21A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# try:
# response2manoeuvre4opu = manoeuvre2readimage4opu(queue2write4opu, channel2consume4opu, channel2publish4opu)
# print("(Step 21B/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", manoeuvre2readimage4opu)
# except:
# print("(Step 21Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# # ---------------------------------------------------------------------------------------
# # (22) RECEIVE CONTROL & COMMAND READY VIA PIPE
# # ---------------------------------------------------------------------------------------
# print('(Step 22A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4OPU ', time4xi())
# try:
# channel2consume4opu = response4write2image['CONSUMERCHANNEL']
# message2writereceive4opu = channel2consume4opu.recv()
# print("(Step 22B/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel2consume4opu, " CONTROL & COMMAND: ", message2writereceive4opu)
# # write2write4opu
# except:
# print('(Step 22Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND VIA PIPE WITH READ2IMAGE4OPU ', time4xi())
# # -----------------------------------------------------------------------------------------
# # (24) PUT IMAGE PATH TO QUEUE
# # -----------------------------------------------------------------------------------------
# print("(Step 24A/700) OF OPU2IMAGE4XI5TEST - 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 OPU2IMAGE4XI5TEST *** FAILED TO PUT IMAGE PATH TO QUEUE ", time4xi())
# # ------------------------------------------------------------------------------------------------------
# # (25) LET MANOEUVRE2IMAGE4OPU TO GET FROM QUEUE AND TO SEND EITHER ACK OR NACK VIA PIPE
# # -------------------------------------------------------------------------------------------------------
# print("(Step 25A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# try:
# response2manoeuvre4opu = manoeuvre2readimage4opu(queue2write4opu, channel2consume4opu, channel2publish4opu)
# print("(Step 25B/700) OF OPU2IMAGE4XI5TEST - PERFORMED TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", manoeuvre2readimage4opu)
# except:
# print("(Step 25Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# # -----------------------------------------------------------------------------------------------
# # (26) RECEIVE ACK OR NACK ABOUT IMAGE OPERATION VIA PIPE
# # -----------------------------------------------------------------------------------------------
# print('(Step 26A/700) OF OPU2IMAGE4XI5TEST - TRYING TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# try:
# message2writereceive4opu = channel2consume4opu.recv()
# print("(Step 26D/700) OF OPU2IMAGE4XI5TEST - RECEIVED FROM CHANNEL2CONSUME4OPU: ", channel2consume4opu, " CONTROL & COMMAND: ", message2writereceive4opu)
# # ack2imageinfo4opu
# except:
# print('(Step 26Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO RECEIVE CONTROL & COMMAND ABOUT IMAGE OPERTION VIA PIPE ', time4xi())
# # -------------------------------------------------------------------------------------------------------
# # (27) LET MANOEUVRE2IMAGE4OPU GO TO STATE 0
# # -------------------------------------------------------------------------------------------------------
# print("(Step 27A/700) OF OPU2IMAGE4XI5TEST - TRYING TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
# try:
# response2manoeuvre4opu = manoeuvre2readimage4opu(queue2write4opu, channel2consume4opu, channel2publish4opu)
# print("(Step 27B/700) OF OPU2IMAGE4XI5TEST - GOT RESPONSE2MANOEUVRE4OPU ", response2manoeuvre4opu)
# except:
# print("(Step 27Z/700) OF OPU2IMAGE4XI5TEST *** FAILED TO PERFORM TARGET FUNCTION MANOEUVRE2IMAGE4OPU ", time4xi())
#">
# -------------------------------------------------------------------------------------------------
def write2image4opu(task4imagewrite2opu=None):
'''
writes 2D images for OPU
'''
global opu2image4xi # 2D-IMAGES FOR OPU
global control2writeimage4opu # COMMAND AND CONTROL FOR OPU IMAGES
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "write2image4opu"
method2print = "write2image4opu"
message2print = "{(Step 1A/33) started" + "; write2image4opu-started: " + str(write2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4imagewrite2opu-to-write2image4opu: " + str(task4imagewrite2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
code2ack = ' '
code2nack = ' '
# -----------------------------------------------------------------------------------------
# CREATE OPU2IMAGE4XI IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if opu2image4xi is None:
opu2image4xi = create2image4opu() # INITIALIZE IMAGE FOR OPU
message2print = "{(Step 1C/70) created" + "; opu2image4xi-created-by-write2image4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1D/70) skipped" + "; create2image4opu-skipped-by-write2image4opu: " + str(write2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# create2image4opu-skipped-by-write2image4opu:
except:
try:
opu2image4xi = create2image4opu()
message2print = "{(Step 1E/70) set" + "; opu2image4xi-set-by-write2image4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
opu2image4xi = {}
message2print = "{(Step 1Z/70) yielded" + "; opu2image4xi-yielded-by-write2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '1Z-'
# -----------------------------------------------------------------------------------------
# (Step 1/70) - CHECK PARAMETERS
# -----------------------------------------------------------------------------------------
try:
if task4imagewrite2opu is None:
# -----------------------------------------------------------------------------------------
# NO PARAMETERS GIVEN BY CALLER FOR READ - BUILD TASK!
# -----------------------------------------------------------------------------------------
task4imagewrite2opu = {}
message2print = "{(Step 1A/70) initialized" + "; task4imagewrite2opu-created-by-write2image4opu to: " + str(task4imagewrite2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# ---------------------------------------------------------------------------------------------
# (1B) TRACE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
function2callback4opu = trace2image4opu # CALLBACK FUNCTION FOR OPU
message2print = "{(Step 1B1/70) initialized" + "; function2callback4opu-created-by-write2image4opu to: " + str(function2callback4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '1B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "write2image4opu" # MODULE OF OPUIZED OPENCL MODULE
args2callback['METHOD'] = "write2image4opu" # FUNCTION OF OPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; write2image4opu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR OPUIZED OPENCL TO RETURN
message2print = "{(Step 1B2/70) initialized" + "; args2callback-created-by-write2image4opu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 1Z1/33) failed; write2image4opu-failed ; time: 02:32:29 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'write2image4opu',
# 'METHOD': 'write2image4opu'}; time: 02:32:29 10/05/11 Pacific Daylight Time}
code2ack = code2ack + '1B2-'
# ---------------------------------------------------------------------------------------------
# (1C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagewrite2opu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO OPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagewrite2opu['FUNCTION2CALLBACK'] = function2callback4opu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '1C-'
message2print = "{(Step 1C/70) initialized" + "; task4imagewrite2opu-created-by-write2image4opu to: " + str(task4imagewrite2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'FUNCTION2CALLBACK': ,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; write2image4opu-failed ; time: 02:32:29 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'write2image4opu',
# 'METHOD': 'write2image4opu'}}; time: 02:32:29 10/05/11 Pacific Daylight Time}
# ---------------------------------------------------------------------------------------------
# (2) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 2A/70) initialized" + "; platform2xi-created-by-write2image4opu 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-write2image4opu: " + 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-write2image4opu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z-'
task4imagewrite2opu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
# ---------------------------------------------------------------------------------------------
# (3) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2opu = {}
message2print = "{(Step 3A/70) trying" + "; context2opu-trying-by-write2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2opu = get2context4opu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 3B/70) got" + "; context2opu-got-by-write2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2context4opu-failed ; time: 02:32:29 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4opu', ...
code2ack = code2ack + '3B-'
except:
message2print = "{(Step 3Z/70) failed" + "; context2opu-failed-by-write2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '3Z-'
task4imagewrite2opu ['CONTEXT'] = context2opu
# ---------------------------------------------------------------------------------------------
# (4) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2opu = {}
message2print = "{(Step 4A/70) trying" + "; device2opu-trying-by-write2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2opu = get2opu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 4B/70) got" + "; device2opu-got-by-write2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'RESOLUTION2TIMER4PROFILING': 318, 'ID2PLATFORM': '0000000001509568' ...
code2ack = code2ack + '4B-'
except:
message2print = "{(Step 4Z/70) failed" + "; device2opu-failed-by-write2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
task4imagewrite2opu ['DEVICE'] = device2opu
# ---------------------------------------------------------------------------------------------
# (5) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2opu = {}
message2print = "{(Step 5A/70) trying" + "; imageinfo2opu-trying-by-write2image4opu: " + str(imageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2opu = get2imageinfo4opu()
message2print = "{(Step 5B/70) got" + "; imageinfo2opu-got-by-write2image4opu: " + str(imageinfo2opu) + "; 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; create2context4opu-failed ; time: 02:32:29 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2context4opu',
# 'METHOD': 'create2context4opu'},
# '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" + "; imageinfo2opu-failed-by-write2image4opu: " + str(imageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '5Z-'
task4imagewrite2opu ['IMAGE'] = imageinfo2opu
# ---------------------------------------------------------------------------------------------
# (6) QUEUE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
queue2opu = None
message2print = "{(Step 6A/70) trying" + "; queue2opu-trying-by-write2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2opu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 6B/70) got" + "; queue2opu-got-by-write2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '6B-'
except:
message2print = "{(Step 6Z/70) failed" + "; queue2opu-failed-by-write2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z-'
task4imagewrite2opu ['QUEUE'] = queue2opu
# ---------------------------------------------------------------------------------------------
# (7) PIPE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
pipe2opu = None
message2print = "{(Step 7A/70) trying" + "; pipe2opu-trying-by-write2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2opu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 7B/70) got" + "; pipe2opu-got-by-write2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# (, )
code2ack = code2ack + '7B-'
except:
message2print = "{(Step 7Z/70) failed" + "; pipe2opu-failed-by-write2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z-'
task4imagewrite2opu ['PIPE'] = pipe2opu
# ---------------------------------------------------------------------------------------------
# (8) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2opu = {}
message2print = "{(Step 8A/70) trying" + "; commandqueueinfo2opu-trying-by-write2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2opu = get2commandqueueinfo4opu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 8B/70) got" + "; commandqueueinfo2opu-got-by-write2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2commandqueue4opu-failed ; time: 02:32:29 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2commandqueue4opu',
# 'METHOD': 'create2commandqueue4opu'},
# 'FUNCTION2CALLBACK': ...
code2ack = code2ack + '8B-'
except:
message2print = "{(Step 8Z/70) failed" + "; commandqueueinfo2opu-failed-by-write2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z-'
task4imagewrite2opu ['COMMANDQUEUE'] = commandqueueinfo2opu
# ---------------------------------------------------------------------------------------------
# (9) BUFFER - AUTOMATIC BY OPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2opu = {}
message2print = "{(Step 9A/70) trying" + "; bufferinfo2opu-trying-by-write2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2opu = get2bufferinfo4opu() # SYSTEM CREATES BUFFER FOR OPU, IF NECESSARY
message2print = "{(Step 9B/70) got" + "; bufferinfo2opu-got-by-write2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4opu-failed ; time: 02:32:28 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4opu',
# 'METHOD': 'create2buffer4opu'}, ...
code2ack = code2ack + '9B-'
except:
message2print = "{(Step 9Z/70) failed" + "; bufferinfo2opu-failed-by-write2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '9Z-'
task4imagewrite2opu ['BUFFER'] = bufferinfo2opu
# ---------------------------------------------------------------------------------------------
# (10) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2opu = {}
message2print = "{(Step 10A/70) trying" + "; eventinfo2opu-trying-by-write2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2opu = get2eventinfo4opu()
message2print = "{(Step 10B/70) got" + "; eventinfo2opu-got-by-write2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2event4opu-failed ; time: 02:32:28 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2event4opu',
# 'METHOD': 'create2event4opu'},
# 'FUNCTION2CALLBACK': , ...
code2ack = code2ack + '10B-'
except:
message2print = "{(Step 10Z/70) failed" + "; eventinfo2opu-failed-by-write2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '10Z-'
task4imagewrite2opu ['EVENT'] = eventinfo2opu
# ---------------------------------------------------------------------------------------------
# (11) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2opu = {}
message2print = "{(Step 11A/70) trying" + "; eventwaitlist2opu-trying-by-write2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2opu = {}
message2print = "{(Step 11B/70) set" + "; eventwaitlist2opu-set-by-write2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {}
code2ack = code2ack + '11B-'
except:
message2print = "{(Step 11Z/70) failed" + "; eventwaitlist2opu-failed-by-write2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '11Z-'
task4imagewrite2opu ['EVENTWAITLIST'] = eventwaitlist2opu
# ---------------------------------------------------------------------------------------------
# (12) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2opu = 0
message2print = "{(Step 12A/70) trying" + "; eventwaitlistquantity2opu-trying-by-write2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2opu.keys()
for key2event in keys2event:
eventwaitlistquantity2opu = eventwaitlistquantity2opu + 1
message2print = "{(Step 12B/70) set" + "; eventwaitlistquantity2opu-set-by-write2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '12B-'
except:
message2print = "{(Step 12Z/70) failed" + "; eventwaitlistquantity2opu-failed-by-write2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '12Z-'
task4imagewrite2opu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2opu
# ---------------------------------------------------------------------------------------------
# (13) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2opu = ' '
message2print = "{(Step 13A/70) trying" + "; blocking2opu-trying-by-write2image4opu: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2opu = 'CL_FALSE' # the write command is non-blocking
message2print = "{(Step 13B/70) set" + "; blocking2opu-set-by-write2image4opu to: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# CL_FALSE
code2ack = code2ack + '13B-'
except:
message2print = "{(Step 13Z/70) failed" + "; blocking2opu-failed-by-write2image4opu: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '13Z-'
task4imagewrite2opu ['BLOCKING'] = blocking2opu
# ---------------------------------------------------------------------------------------------
# (14) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2opu = {}
message2print = "{(Step 14A/70) trying" + "; origin2opu-trying-by-write2image4opu: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2opu['X'] = 0
origin2opu['Y'] = 0
origin2opu['Z'] = 0
message2print = "{(Step 14B/70) set" + "; origin2opu-set-by-write2image4opu to: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 0, 'X': 0, 'Z': 0}
code2ack = code2ack + '14B-'
except:
message2print = "{(Step 14Z/70) failed" + "; origin2opu-failed-by-write2image4opu: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '14Z-'
task4imagewrite2opu ['ORIGIN'] = origin2opu
# ---------------------------------------------------------------------------------------------
# (15) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2opu = {}
message2print = "{(Step 15A/70) trying" + "; region2opu-trying-by-write2image4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2opu['X'] = 160 # WIDTH IN PIXELS TO READ
region2opu['Y'] = 90 # HEIGHT IN PIXELS TO READ
region2opu['Z'] = 0 # DEPTH IN PIXELS TO READ
message2print = "{(Step 15B/70) set" + "; region2opu-set-by-write2image4opu to: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'Y': 90, 'X': 160, 'Z': 0}
code2ack = code2ack + '15B-'
except:
message2print = "{(Step 15Z/70) failed" + "; region2opu-failed-by-write2image4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '15Z-'
task4imagewrite2opu ['REGION'] = region2opu
# ---------------------------------------------------------------------------------------------
# (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.
height2opu = 800
width2opu = 800
rowpitch2opu = 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" + "; rowpitch2opu-trying-by-write2image4opu: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2opu = int(width2opu * 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" + "; rowpitch2opu-set-by-write2image4opu to: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800
code2ack = code2ack + '16B-'
except:
message2print = "{(Step 16Z/70) failed" + "; rowpitch2opu-failed-by-write2image4opu: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '16Z-'
task4imagewrite2opu ['ROWPITCH'] = rowpitch2opu
# ----------------------------------------------------------------------------------------------------
# (17) POINTER - REQUIRED - THE POINTER TO A BUFFER IN HOST MEMORY WHERE IMAGE DATA IS TO BE READ FROM
# ----------------------------------------------------------------------------------------------------
pointer2opu = None
size2opu = int(width2opu * height2opu) # CALCULATED MEMORY
if size2opu == 0:
size2opu = 4400 # MINIMUM MEMORY
message2print = "{(Step 17A/70) trying" + "; pointer2opu-trying-by-write2image4opu: " + str(pointer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
arena2opu = Arena4Xi(size2opu) # SYSTEM RESERVER MEMORY FOR IMAGE
message2print = "{(Step 17B/70) got" + "; arena2opu-got-by-write2image4opu: " + str(arena2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
size2arena = arena2opu.size #
message2print = "{(Step 17C/70) got" + "; size2arena-got-by-write2buffer4opu: " + str(size2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 640000
buffer2arena = arena2opu.buffer
message2print = "{(Step 17D/70) got" + "; buffer2arena-got-by-write2buffer4opu: " + str(buffer2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17D-'
if size2arena < size2opu:
size2opu = size2arena # AVAILABLE MEMORY FOR IMAGE
message2print = "{(Step 17E/70) set" + "; size2opu-set-by-write2buffer4opu to: " + str(size2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17E-'
else:
pass
pointer2opu = buffer2arena
message2print = "{(Step 17F/70) set" + "; pointer2opu-set-by-write2buffer4opu to: " + str(pointer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '17F-'
except:
message2print = "{(Step 17Z/70) failed" + "; pointer2opu-failed-by-write2image4opu: " + str(pointer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '17Z-'
task4imagewrite2opu ['POINTER'] = pointer2opu
task4imagewrite2opu ['SIZE'] = size2opu # AUTOMATIC BY OPUXI
# --------------------------------------------------------------------------------------------------------
# (18) SLICEPITCH - REQUIRED - THE SIZE IN BYTES OF THE 2D SLICE OF THE 3D REGION OF A 3D IMAGE BEING READ
# --------------------------------------------------------------------------------------------------------
slicepitch2opu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 18A/70) trying" + "; slicepitch2opu-trying-by-write2image4opu: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2opu = 0
message2print = "{(Step 18B/70) set" + "; slicepitch2opu-set-by-write2image4opu to: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 0
code2ack = code2ack + '18B-'
except:
message2print = "{(Step 18Z/70) failed" + "; slicepitch2opu-failed-by-write2image4opu: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '18Z-'
task4imagewrite2opu ['SLICEPITCH'] = slicepitch2opu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER PROVIDING
# ---------------------------------------------------------------------------------------------
else:
pass
# ---------------------------------------------------------------------------------------------
# CHECK PARAMETERS - WHETHER AUTOMATICALLY GENERATED OR USER GIVEN
# ---------------------------------------------------------------------------------------------
keys2task = task4imagewrite2opu.keys()
message2print = "{(Step 20/70) using" + "; keys2task-using-by-write2image4opu: " + 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
# ---------------------------------------------------------------------------------------------
function2callback4opu = trace2image4opu # CALLBACK FUNCTION FOR OPU
message2print = "{(Step 21B1/70) initialized" + "; function2callback4opu-created-by-write2image4opu to: " + str(function2callback4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B1-'
args2callback = {} # CREATE ARGUMENT DICTIONARY FOR CALLBACK FUNCTION
args2callback['CLASS'] = "write2image4opu" # MODULE OF OPUIZED OPENCL MODULE
args2callback['METHOD'] = "write2image4opu" # FUNCTION OF OPUIZED OPENCL MODULE
args2callback['MESSAGE'] = "{(Step 1Z1/33) failed" + "; write2image4opu-failed " + "; time: " + time4xi() + "}" # ERROR MESSAGE FOR OPUIZED OPENCL TO RETURN
message2print = "{(Step 21B2/70) initialized" + "; args2callback-created-by-write2image4opu to: " + str(args2callback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '21B2-'
# ---------------------------------------------------------------------------------------------
# (21C) CALLBACK - AUTOMATIC
# ---------------------------------------------------------------------------------------------
task4imagewrite2opu['DATA2CALLBACK'] = args2callback # USER DATA PASSED TO OPUIZED OPENCL - SEVERAL ARGS PASSED IN ONE DICTIONARY
task4imagewrite2opu['FUNCTION2CALLBACK'] = function2callback4opu # CALLBACK FUNCTION TO CALLED BY OPENCL IN EXCEPTIONS
code2ack = code2ack + '21C-'
message2print = "{(Step 21C/70) initialized" + "; task4imagewrite2opu-created-by-write2image4opu to: " + str(task4imagewrite2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if 'PLATFORM' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (22) PLATFORM - AUTOMATIC
# ---------------------------------------------------------------------------------------------
platform2xi = {}
message2print = "{(Step 22A/70) initialized" + "; platform2xi-created-by-write2image4opu 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-write2image4opu: " + str(platform2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '22B-'
except:
message2print = "{(Step 22Z/70) failed" + "; platform2xi-failed-by-write2image4opu: " + str(failed) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '22Z-'
task4imagewrite2opu['PLATFORM'] = platform2xi # PLATFORM OF SYSTEM
if 'CONTEXT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (23) CONTEXT - AUTOMATIC
# ---------------------------------------------------------------------------------------------
context2opu = {}
message2print = "{(Step 23A/70) trying" + "; context2opu-trying-by-write2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
context2opu = get2context4opu() # NO PARAMETERS - THE SYSTEM CREATES CONTEXT IF REQUIRED
message2print = "{(Step 23B/70) got" + "; context2opu-got-by-write2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '23B-'
except:
message2print = "{(Step 23Z/70) failed" + "; context2opu-failed-by-write2image4opu: " + str(context2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '23Z-'
task4imagewrite2opu ['CONTEXT'] = context2opu
if 'DEVICE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (24) DEVICE - AUTOMATIC
# ---------------------------------------------------------------------------------------------
device2opu = {}
message2print = "{(Step 24A/70) trying" + "; device2opu-trying-by-write2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
device2opu = get2opu4xi() # THE SYSTEM CREATES DEVICE INFO, IF NECESSARY
message2print = "{(Step 24B/70) got" + "; device2opu-got-by-write2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '24B-'
except:
message2print = "{(Step 24Z/70) failed" + "; device2opu-failed-by-write2image4opu: " + str(device2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '24Z-'
task4imagewrite2opu ['DEVICE'] = device2opu
if 'IMAGE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (25) IMAGE - REQUIRED
# ---------------------------------------------------------------------------------------------
imageinfo2opu = {}
message2print = "{(Step 25A/70) trying" + "; imageinfo2opu-trying-by-write2image4opu: " + str(imageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
imageinfo2opu = get2imageinfo4opu()
message2print = "{(Step 25B/70) got" + "; imageinfo2opu-got-by-write2image4opu: " + str(imageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '25B-'
except:
message2print = "{(Step 25Z/70) failed" + "; imageinfo2opu-failed-by-write2image4opu: " + str(imageinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '25Z-'
task4imagewrite2opu ['IMAGE'] = imageinfo2opu
if 'QUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (26) QUEUE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
queue2opu = None
message2print = "{(Step 26A/70) trying" + "; queue2opu-trying-by-write2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2opu = Queue4Xi() # THE SYSTEM CREATES QUEUE
message2print = "{(Step 26B/70) got" + "; queue2opu-got-by-write2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '26B-'
except:
message2print = "{(Step 26Z/70) failed" + "; queue2opu-failed-by-write2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '26Z-'
task4imagewrite2opu ['QUEUE'] = queue2opu
if 'PIPE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (27) PIPE - REQUIRED BY OPUXI
# ---------------------------------------------------------------------------------------------
pipe2opu = None
message2print = "{(Step 27A/70) trying" + "; pipe2opu-trying-by-write2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
pipe2opu = Pipe4Xi() # THE SYSTEM CREATES PIPE
message2print = "{(Step 27B/70) got" + "; pipe2opu-got-by-write2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '27B-'
except:
message2print = "{(Step 27Z/70) failed" + "; pipe2opu-failed-by-write2image4opu: " + str(pipe2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '27Z-'
task4imagewrite2opu ['PIPE'] = pipe2opu
if 'COMMANDQUEUE' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (28) COMMAND QUEUE - REQUIRED
# ---------------------------------------------------------------------------------------------
commandqueueinfo2opu = {}
message2print = "{(Step 28A/70) trying" + "; commandqueueinfo2opu-trying-by-write2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
commandqueueinfo2opu = get2commandqueueinfo4opu() # SYSTEM CREATES COMMAND QUEUE, IF NECESSARY
message2print = "{(Step 28B/70) got" + "; commandqueueinfo2opu-got-by-write2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '28B-'
except:
message2print = "{(Step 28Z/70) failed" + "; commandqueueinfo2opu-failed-by-write2image4opu: " + str(commandqueueinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '28Z-'
task4imagewrite2opu ['COMMANDQUEUE'] = commandqueueinfo2opu
if 'BUFFER' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (29) BUFFER - AUTOMATIC BY OPUXI
# ---------------------------------------------------------------------------------------------
bufferinfo2opu = {}
message2print = "{(Step 29A/70) trying" + "; bufferinfo2opu-trying-by-write2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
bufferinfo2opu = get2bufferinfo4opu() # SYSTEM CREATES BUFFER FOR OPU, IF NECESSARY
message2print = "{(Step 29B/70) got" + "; bufferinfo2opu-got-by-write2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '29B-'
except:
message2print = "{(Step 29Z/70) failed" + "; bufferinfo2opu-failed-by-write2image4opu: " + str(bufferinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '29Z-'
task4imagewrite2opu ['BUFFER'] = bufferinfo2opu
if 'EVENT' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (30) EVENT - REQUIRED
# ---------------------------------------------------------------------------------------------
eventinfo2opu = {}
message2print = "{(Step 30A/70) trying" + "; eventinfo2opu-trying-by-write2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventinfo2opu = get2eventinfo4opu()
message2print = "{(Step 30B/70) got" + "; eventinfo2opu-got-by-write2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '30B-'
except:
message2print = "{(Step 30Z/70) failed" + "; eventinfo2opu-failed-by-write2image4opu: " + str(eventinfo2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '30Z-'
task4imagewrite2opu ['EVENT'] = eventinfo2opu
if 'EVENTWAITLIST' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (31) EVENTWAITLIST - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlist2opu = {}
message2print = "{(Step 31A/70) trying" + "; eventwaitlist2opu-trying-by-write2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
eventwaitlist2opu = {}
message2print = "{(Step 31B/70) set" + "; eventwaitlist2opu-set-by-write2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '31B-'
except:
message2print = "{(Step 31Z/70) failed" + "; eventwaitlist2opu-failed-by-write2image4opu: " + str(eventwaitlist2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '31Z-'
task4imagewrite2opu ['EVENTWAITLIST'] = eventwaitlist2opu
if 'EVENTWAITLISTQUANTITY' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (32) EVENTWAITLISTQUANTITY - REQUIRED
# ---------------------------------------------------------------------------------------------
eventwaitlistquantity2opu = 0
message2print = "{(Step 32A/70) trying" + "; eventwaitlistquantity2opu-trying-by-write2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
keys2event = eventwaitlist2opu.keys()
for key2event in keys2event:
eventwaitlistquantity2opu = eventwaitlistquantity2opu + 1
message2print = "{(Step 32B/70) set" + "; eventwaitlistquantity2opu-set-by-write2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '32B-'
except:
message2print = "{(Step 32Z/70) failed" + "; eventwaitlistquantity2opu-failed-by-write2image4opu: " + str(eventwaitlistquantity2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '32Z-'
task4imagewrite2opu ['EVENTWAITLISTQUANTITY'] = eventwaitlistquantity2opu
if 'BLOCKING' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (33) BLOCKING - REQUIRED
# ---------------------------------------------------------------------------------------------
blocking2opu = ' '
message2print = "{(Step 33A/70) trying" + "; blocking2opu-trying-by-write2image4opu: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
blocking2opu = 'CL_FALSE' # the write command is non-blocking
message2print = "{(Step 33B/70) set" + "; blocking2opu-set-by-write2image4opu to: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '33B-'
except:
message2print = "{(Step 33Z/70) failed" + "; blocking2opu-failed-by-write2image4opu: " + str(blocking2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '33Z-'
task4imagewrite2opu ['BLOCKING'] = blocking2opu
if 'ORIGIN' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (34) ORIGIN - REQUIRED
# ---------------------------------------------------------------------------------------------
origin2opu = {}
message2print = "{(Step 34A/70) trying" + "; origin2opu-trying-by-write2image4opu: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
origin2opu['X'] = 0
origin2opu['Y'] = 0
origin2opu['Z'] = 0
message2print = "{(Step 34B/70) set" + "; origin2opu-set-by-write2image4opu to: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '34B-'
except:
message2print = "{(Step 34Z/70) failed" + "; origin2opu-failed-by-write2image4opu: " + str(origin2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '34Z-'
task4imagewrite2opu ['ORIGIN'] = origin2opu
if 'REGION' in keys2task:
pass
else:
# ---------------------------------------------------------------------------------------------
# (35) REGION - REQUIRED
# ---------------------------------------------------------------------------------------------
region2opu = {}
message2print = "{(Step 35A/70) trying" + "; region2opu-trying-by-write2image4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
region2opu['X'] = 160 # WIDTH IN PIXELS TO WRITE
region2opu['Y'] = 90 # HEIGHT IN PIXELS TO WRITE
region2opu['Z'] = 0 # DEPTH IN PIXELS TO WRITE
message2print = "{(Step 35B/70) set" + "; region2opu-set-by-write2image4opu to: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '35B-'
except:
message2print = "{(Step 35Z/70) failed" + "; region2opu-failed-by-write2image4opu: " + str(region2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '35Z-'
task4imagewrite2opu ['REGION'] = region2opu
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.
rowpitch2opu = 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" + "; rowpitch2opu-trying-by-write2image4opu: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try: # X-AXEL IS THE WORST CASE TO SCAN WITH Y=0, Z=0
rowpitch2opu = int(width2opu * 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" + "; rowpitch2opu-set-by-write2image4opu to: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '36B-'
except:
message2print = "{(Step 36Z/70) failed" + "; rowpitch2opu-failed-by-write2image4opu: " + str(rowpitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '36Z-'
task4imagewrite2opu ['ROWPITCH'] = rowpitch2opu
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
# ----------------------------------------------------------------------------------------------------
pointer2opu = None
size2opu = int(width2opu * height2opu) # CALCULATED MEMORY
if size2opu == 0:
size2opu = 4400 # MINIMUM MEMORY
message2print = "{(Step 37A/70) trying" + "; pointer2opu-trying-by-write2image4opu: " + str(pointer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
arena2opu = Arena4Xi(size2opu) # SYSTEM RESERVER MEMORY FOR IMAGE
message2print = "{(Step 37B/70) got" + "; arena2opu-got-by-write2image4opu: " + str(arena2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
size2arena = arena2opu.size #
message2print = "{(Step 37C/70) got" + "; size2arena-got-by-write2buffer4opu: " + str(size2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
buffer2arena = arena2opu.buffer
message2print = "{(Step 37D/70) got" + "; buffer2arena-got-by-write2buffer4opu: " + str(buffer2arena) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37D-'
if size2arena < size2opu:
size2opu = size2arena # AVAILABLE MEMORY FOR IMAGE
message2print = "{(Step 37E/70) set" + "; size2opu-set-by-write2buffer4opu to: " + str(size2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37E-'
else:
pass
pointer2opu = buffer2arena
message2print = "{(Step 37F/70) set" + "; pointer2opu-set-by-write2buffer4opu to: " + str(pointer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '37F-'
except:
message2print = "{(Step 37Z/70) failed" + "; pointer2opu-failed-by-write2image4opu: " + str(pointer2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '37Z-'
task4imagewrite2opu ['POINTER'] = pointer2opu
task4imagewrite2opu ['SIZE'] = size2opu # AUTOMATIC BY OPUXI
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
# --------------------------------------------------------------------------------------------------------
slicepitch2opu = None # SLICEPITCH IS ZERO FOR 2D IMAGES
message2print = "{(Step 38A/70) trying" + "; slicepitch2opu-trying-by-write2image4opu: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
slicepitch2opu = 0
message2print = "{(Step 38B/70) set" + "; slicepitch2opu-set-by-write2image4opu to: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2ack = code2ack + '38B-'
except:
message2print = "{(Step 38Z/70) failed" + "; slicepitch2opu-failed-by-write2image4opu: " + str(slicepitch2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '38Z-'
task4imagewrite2opu ['SLICEPITCH'] = slicepitch2opu
# ---------------------------------------------------------------------------------------------
# EOF PARAMETER CHECKING AND PROVIDING FOR MISSING ONES
# ---------------------------------------------------------------------------------------------
keys2task = task4imagewrite2opu.keys()
message2print = "{(Step 39/70) set" + "; keys2task-set-by-write2image4opu 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" + "; task4imagewrite2opu-yielded-by-write2image4opu: " + str(task4imagewrite2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '39Z-'
# ---------------------------------------------------------------------------------------------
# CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
control2writeimage4opu = {}
# ---------------------------------------------------------------------------------------------
# CONSUMER AND PUBLISHER CHANNEL FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4channels2opu = False
channels2opu = ()
message2print = "{(Step 40A/70) trying" + "channels2opu-trying-by-write2image4opu: " + str(channels2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
#
consumerchannel2opu, publisherchannel2opu = task4imagewrite2opu ['PIPE']
message2print = "{(Step 40B/70) got" + "; consumerchannel2opu-got-by-write2image4opu: " + str(consumerchannel2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 40C/70) got" + "; publisherchannel2opu-got-by-write2image4opu: " + str(publisherchannel2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4channels2opu = True
control2writeimage4opu['CONSUMERCHANNEL'] = consumerchannel2opu
control2writeimage4opu['PUBLISHERCHANNEL'] = publisherchannel2opu
code2ack = code2ack + '40D-'
except:
ack4channels2opu = False
code2nack = code2nack + '40Z-'
# ---------------------------------------------------------------------------------------------
# QUEUE FOR CONTROL AND COMMAND
# ---------------------------------------------------------------------------------------------
ack4queue2opu = False
queue2opu = None
message2print = "{(Step 41A/70) trying" + "queue2opu-trying-by-write2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
queue2opu = task4imagewrite2opu ['QUEUE']
message2print = "{(Step 41B/70) got" + "; queue2opu-got-by-write2image4opu: " + str(queue2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
ack4queue2opu = True
control2writeimage4opu['QUEUE'] = queue2opu
code2ack = code2ack + '41C-'
except:
ack4queue2opu = False
code2nack = code2nack + '41Z-'
# -----------------------------------------------------------------------------------------
# DUMMY PROCESS OBJECT = THREAD CREATION
# -----------------------------------------------------------------------------------------
# dummy2image4opu = None
# message2print = "{(Step 69A/70) trying" + "dummy2image4opu-trying-by-write2image4opu: " + str(dummy2image4opu) + "; time: " + time4xi() + "}"
# print4xi(class2print, method2print, message2print)
# try:
# dummy2image4opu = DummyProcess4Xi(target=manoeuvre2readimage4opu, # in this module to handle queue and pipe channels
# args =(queue2opu, # caller puts and gets - does NOT call any functions
# consumerchannel2opu, publisherchannel2opu)) # caller sends and receives - does NOT call any functions
# message2print = "{(Step 69B/70) created" + "dummy2image4opu-created-by-write2image4opu: " + str(dummy2image4opu) + "; 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-write2image4opu: " + 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-write2image4opu: " + str(code2nack) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 70C/70) returning" + "; control2writeimage4opu-returning-by-write2image4opu: " + str(control2writeimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 02:45:31 10/05/11 Pacific Daylight Time}
return control2writeimage4opu
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def release2image4opu(task4release2opu=None):
'''
releases opu2image4xi
'''
global opu2image4xi
global code2ack
global code2nack
# -----------------------------------------------------------------------------------------
# (Step 1/33) PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "release2image4opu"
method2print = "release2image4opu"
message2print = "{(Step 1A/33) started" + "; release2image4opu-started: " + str(release2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4release2opu-to-release2image4opu: " + str(task4release2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 1}
code2ack = ' '
code2nack = ' '
try:
if opu2image4xi is None:
opu2image4xi = create2image4opu() # INITIALIZE IMAGE
except:
try:
opu2image4xi = create2image4opu()
except:
opu2image4xi = {}
message2print = "{(Step 2Z0/70) yielded" + "; opu2image4xi-yielded-by-release2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '2Z0-'
message2print = "{(Step 1A/70) try" + "; release-try-by-release2image4opu: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
if task4release2opu is None:
task4release2opu = {}
task4release2opu['COUNT2REFERENCE'] = 1
try:
# -----------------------------------------------------------------------------------------
# RELEASE
# -----------------------------------------------------------------------------------------
opu2image4xi['COUNT2REFERENCE'] = opu2image4xi['COUNT2REFERENCE'] - task4release2opu['COUNT2REFERENCE']
message2print = "{(Step 1A/70) calculated" + "; count2reference-calculated-by-release2image4opu: " + str(opu2image4xi['COUNT2REFERENCE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if opu2image4xi['COUNT2REFERENCE'] < 0:
opu2image4xi['COUNT2REFERENCE'] = 0
message2print = "{(Step 1B/70) warning" + "; count2reference-warning-by-release2image4opu: " + " ** " + str(opu2image4xi['COUNT2REFERENCE']) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# { release2image4opu : release2image4opu ; (Step 8Z1/70) warning; count2reference-warning-by-release2image4opu: ** 0 ** ; time: 23:41:37 09/06/11 Pacific Daylight Time}
code2nack = code2nack + '1B-'
else:
code2ack = code2ack + '1B-'
except:
try:
opu2image4xi['COUNT2REFERENCE'] = 0
message2print = "{(Step 8Z1/70) warning" + "; count2reference-warning-by-release2image4opu: " + " ** " + str(opu2image4xi['COUNT2REFERENCE']) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
code2nack = code2nack + '8Z1-'
except:
message2print = "{(Step 8Z2/70) yielded" + "; opu2image4xi-yielded-by-release2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '8Z2-'
# -----------------------------------------------------------------------------------------
# (Step 70/70)
# -----------------------------------------------------------------------------------------
opu2image4xi ['ACK2RETURN'] = code2ack
opu2image4xi ['NACK2RETURN'] = code2nack
message2print = "{(Step 70/70) returning" + "; opu2image4xi-returning-by-release2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'ACK2RETURN': ' ',
# 'ROWPITCH': 800,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4opu-failed ; time: 23:41:37 09/06/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4opu',
# 'METHOD': 'create2image4opu'},
# 'WIDTH': 800,
# 'BUFFER': {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4opu-failed ; time: 23:41:37 09/06/11 Pacific Daylight Time}', 'CLASS': 'create2buffer4opu', 'METHOD': 'create2buffer4opu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0, 'CONTEXT': {'COUNT2REFERENCE': 0, ...
return opu2image4xi
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def retain2image4opu(task4retain2opu=None):
'''
retains either opu2image4xi
'''
global opu2image4xi
global code2ack
global code2nack
# -----------------------------------------------------------------------------------------
# (Step 1/70) - PARAMETERS
# -----------------------------------------------------------------------------------------
class2print = "retain2image4opu"
method2print = "retain2image4opu"
message2print = "{(Step 1A/33) started" + "; retain2image4opu-started: " + str(retain2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print) #
#
message2print = "{(Step 1B/33) passed" + "; task4retain2opu-to-retain2image4opu: " + str(task4retain2opu) + "; 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 task4retain2opu is None:
task4retain2opu = {}
task4retain2opu['DIMENSION'] = 2
task4retain2opu['COUNT2REFERENCE'] = 1
message2print = "{(Step 2A/33) set" + "; task4retain2opu-set-by-retain2image4opu to: " + str(task4retain2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
pass
if 'DIMENSION' in task4retain2opu.keys():
if task4retain2opu['DIMENSION'] == 2:
pass
else:
task4retain2opu['DIMENSION'] = 2
message2print = "{(Step 2B/33) set" + "; dimension-set-by-retain2image4opu to: " + str(task4retain2opu['DIMENSION']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
task4retain2opu['DIMENSION'] = 2
# -----------------------------------------------------------------------------------------
# (Step 3/70) - CHECK COUNT2REFERENCE
# -----------------------------------------------------------------------------------------
if 'COUNT2REFERENCE' in task4retain2opu.keys():
pass
else:
task4retain2opu['COUNT2REFERENCE'] = 1
message2print = "{(Step 3A/33) set" + "; count2reference-set-by-retain2image4opu to: " + str(task4retain2opu['COUNT2REFERENCE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if task4retain2opu['COUNT2REFERENCE'] < 1:
task4retain2opu['COUNT2REFERENCE'] = 1
message2print = "{(Step 3B/33) set" + "; count2reference-set-by-retain2image4opu to: " + str(task4retain2opu['COUNT2REFERENCE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 4/70) - INITIALIZE 2D IMAGE IF NECESSARY
# -----------------------------------------------------------------------------------------
try:
if opu2image4xi is None:
opu2image4xi = create2image4opu()
message2print = "{(Step 4A/70) created" + "; opu2image4xi-created-by-retain2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
except:
try:
opu2image4xi = create2image4opu()
message2print = "{(Step 4B/70) created" + "; opu2image4xi-created-by-retain2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
except:
opu2image4xi = {}
message2print = "{(Step 4Z/70) yielded" + "; opu2image4xi-yielded-by-retain2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '4Z-'
# -----------------------------------------------------------------------------------------
# (Step 5/70) - RETAIN
# -----------------------------------------------------------------------------------------
try:
opu2image4xi['COUNT2REFERENCE'] = opu2image4xi['COUNT2REFERENCE'] + task4retain2opu['COUNT2REFERENCE']
message2print = "{(Step 6A/70) calculated" + "; count2reference-calculated-by-retain2image4opu: " + str(opu2image4xi['COUNT2REFERENCE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if opu2image4xi['COUNT2REFERENCE'] <= 0:
opu2image4xi['COUNT2REFERENCE'] = 1
message2print = "{(Step 6Z1/70) warning" + "; count2reference-warning-by-retain2image4opu: " + " ** " + str(opu2image4xi['COUNT2REFERENCE']) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '6Z1-'
else:
code2ack = code2ack + '6C-'
except:
try:
opu2image4xi['COUNT2REFERENCE'] = 1
message2print = "{(Step 7Z1/70) warning" + "; count2reference-warning-by-retain2image4opu: " + " ** " + str(opu2image4xi['COUNT2REFERENCE']) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z1-'
except:
message2print = "{(Step 7Z2/70) yielded" + "; opu2image4xi-yielded-by-retain2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
code2nack = code2nack + '7Z2-'
# -----------------------------------------------------------------------------------------
# (Step 70/70) - RETURN
# -----------------------------------------------------------------------------------------
opu2image4xi ['ACK2RETURN'] = code2ack
opu2image4xi ['NACK2RETURN'] = code2nack
message2print = "{(Step 70A/70) returning" + "; opu2image4xi-returning-by-retain2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0, 'ACK2RETURN': ' 6C-', 'ROWPITCH': 800, 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4opu-failed ; time: 23:25:02 10/05/11 Pacific Daylight Time}', 'CLASS': 'create2image4opu', 'METHOD': 'create2image4opu'}, 'WIDTH': 800, 'BUFFER': {'CODE2ERROR': 0,
# 'COUNT2REFERENCE': 0, ...
# 'COUNT2REFERENCE': 1,
# 'FLAGS': 0, 'CONTEXT': ...
return opu2image4xi
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def get2imageinfo4opu(task4getinfo2image=None):
'''
gets opu2image4xi
'''
global opu2image4xi
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "get2imageinfo4opu"
method2print = "get2imageinfo4opu"
message2print = "{(Step 0A/33) started" + "; get2imageinfo4opu-started: " + str(get2imageinfo4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0A/33) passed" + "; task4getinfo2image-passed-to-get2imageinfo4opu: " + 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}
image2opu = {}
try:
if opu2image4xi is None:
# -------------------------------------------------------------------------------------
# INITIALIZE 2D IMAGE FOR OPU
# -------------------------------------------------------------------------------------
image2opu = create2image4opu()
message2print = "{(Step 1B2/33) initialized" + "; image2opu-initialized-by-get2imageinfo4opu to: " + str(image2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1B2/33) using" + "; opu2image4xi-using-by-get2imageinfo4opu: " + str(opu2image4xi) + "; 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; create2image4opu-failed ; time: 09:05:31 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4opu',
# 'METHOD': 'create2image4opu'},
# 'WIDTH': 800,
# 'BUFFER': ...
# -------------------------------------------------------------------------------------
# RETURN THE WHOLE OR PART OF THE IMAGE INFO OF OPU
# -------------------------------------------------------------------------------------
dimension2xi = 0
if task4getinfo2image is None:
task4getinfo2image = {}
task4getinfo2image ['DIMENSION'] = 2
task4getinfo2image ['DOMAIN'] = 'ALL'
image2opu = opu2image4xi
message2print = "{(Step 1C/33) using" + "; image2opu-got-by-get2imageinfo4opu: " + str(image2opu) + "; 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 = opu2image4xi.keys()
for key2domain in keys2domain:
task4getinfo2image[key2domain] = opu2image4xi[key2domain]
message2print = "{(Step 1C/33) using" + "; task4getinfo2image-using-by-get2imageinfo4opu: " + 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-get2image4opu: " + str(key2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# WIDTH; DIMENSION; HEIGHT
image2opu [key2task] = opu2image4xi[key2task]
message2print = "{(Step 2D2/33) set" + "; info-of-image2opu-set-by-get2imageinfo4opu to: " + str(image2opu [key2task]) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 800; 800
except:
message2print = "{(Step 2Z/70) yielded" + "; key2task-yielded-by-get2image4opu: " + str(key2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# DIMENSION;
message2print = "{(Step 2Z2/70) using" + "; task4getinfo2image-using-by-get2image4opu: " + str(task4getinfo2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 2Z3/70) using" + "; opu2image4xi-using-by-get2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
try:
# -------------------------------------------------------------------------------------
# INITIALIZE
# -------------------------------------------------------------------------------------
image2opu = create2image4opu()
message2print = "{(Step 1F/33) initialized" + "; image2opu-initialized-by-get2imageinfo4opu to: " + str(image2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if task4getinfo2image is None:
image2opu = opu2image4xi
message2print = "{(Step 1G/33) got" + "; image2opu-got-by-get2imageinfo4opu: " + str(image2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
keys2task = task4getinfo2image.keys()
for key2task in keys2task:
try:
message2print = "{(Step HD2/33) using" + "; key2task-using-by-get2image4opu: " + str(key2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
image2opu [key2task] = opu2image4xi[key2task]
message2print = "{(Step HD2/33) set" + "; info-of-image2opu-set-by-get2imageinfo4opu to: " + str(image2opu [key2task]) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step HZ/70) yielded" + "; key2task-yielded-by-get2image4opu: " + str(key2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
except:
image2opu = {}
message2print = "{(Step 1Z3/70) yielded" + "; image2opu-yielded-by-get2image4opu: " + str(image2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 33/33) returning" + "; image2opu-returning-by-get2imageinfo4opu: " + str(image2opu) + "; 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; create2image4opu-failed ; time: 09:05:31 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4opu',
# 'METHOD': 'create2image4opu'},
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8',
# 'ORDER': 'CL_RGBA'},
# 'BUFFER': ...
# 3D ALL: {'PIPE': (, ),
# 'ROWPITCH': 800,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create3image4opu-failed ; time: 09:05:31 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create3image4opu',
# 'METHOD': 'create3image4opu'},
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8',
# 'ORDER': 'CL_RGBA'},
# 'BUFFER': ....
# 'HEIGHT': 800,
# 'QUEUE': ,
# 'WIDTH': 800,
# 'DEPTH': 800,
# 'FLAGS': 0,
# 'CONTEXT': ...
return image2opu
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def get2supportedimageformats4opu(task4supportedimageformats2opu=None):
'''
gets supported image formats for opu
'''
global opu2image4xi
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "get2supportedimageformats4opu"
method2print = "get2supportedimageformats4opu"
message2print = "{(Step 0A/33) started" + "; get2supportedimageformats4opu-started: " + str(get2supportedimageformats4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 0B/33) passed" + "; task4supportedimageformats2opu-passed-to-get2supportedimageformats4opu: " + str(task4supportedimageformats2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None; {'DIMENSION': 3}
if task4supportedimageformats2opu is None:
task4supportedimageformats2opu = {}
task4supportedimageformats2opu['DIMENSION'] = 2 # 2D image is the default
dimension2xi = 2
try:
keys2supportedimageformats = task4supportedimageformats2opu.keys()
if 'DIMENSION' in keys2supportedimageformats:
dimension2xi = task4supportedimageformats2opu['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
supportedimageformats2opu = {}
try:
if opu2image4xi is None:
# -------------------------------------------------------------------------------------
# INITIALIZE
# -------------------------------------------------------------------------------------
image2opu = create2image4opu() # create opu2image4xi
message2print = "{(Step 1B/33) initialized" + "; image2opu-initialized-by-get2supportedimageformats4opu to: " + str(image2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
pass
# -------------------------------------------------------------------------------------
# SUPPORTED IMAGE FORMATS FOR OPU
# -------------------------------------------------------------------------------------
supportedimageformats2opu = opu2image4xi['FORMAT']
message2print = "{(Step 1E/33) got" + "; supportedimageformats2opu-got-by-get2supportedimageformats4opu: " + str(supportedimageformats2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'}
except:
try:
# -------------------------------------------------------------------------------------
# INITIALIZE
# -------------------------------------------------------------------------------------
image2opu = create2image4opu()
message2print = "{(Step 1F1/33) initialized" + "; image2opu-initialized-by-get2supportedimageformats4opu to: " + str(image2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -------------------------------------------------------------------------------------
# SUPPORTED IMAGE FORMATS FOR OPU
# -------------------------------------------------------------------------------------
supportedimageformats2opu = opu2image4xi['FORMAT']
message2print = "{(Step 1H/33) got" + "; supportedimageformats2opu-got-by-get2supportedimageformats4opu: " + str(supportedimageformats2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z/70) yielded" + "; supportedimageformats2opu-yielded-by-get2image4opu: " + str(supportedimageformats2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 33/33) returning" + "; supportedimageformats2opu-returning-by-get2supportedimageformats4opu: " + str(supportedimageformats2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 2: {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'}
# 3: {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'}
return supportedimageformats2opu
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def wait2image4opu(task4wait2image=None):
'''
waits opu2image4opu
'''
global opu2image4xi
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "wait2image4opu"
method2print = "wait2image4opu"
message2print = "{(Step 1A1/33) started" + "; wait2image4opu-started: " + str(wait2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1A2/33) passed" + "; task4wait2image-passed-by-wait2image4opu to: " + str(task4wait2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
try:
if opu2image4xi is None:
# -------------------------------------------------------------------------------------
# INITIALIZE - KEEP SYSTEM RUNNING
# -------------------------------------------------------------------------------------
opu2image4xi = create2image4opu()
message2print = "{(Step 1B/33) created" + "; opu2image4xi-created-by-wait2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -------------------------------------------------------------------------------------
# WAIT
# -------------------------------------------------------------------------------------
queue2image4opu = None
try:
queue2image4opu = opu2image4xi['QUEUE']
message2print = "{(Step 1C/33) got" + "; queue2image4opu-got-by-wait2image4opu to: " + str(queue2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z1/70) yielded" + "; opu2xi-yielded-by-wait2image4opu: " + str(opu2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
size2image4opu = 0
try:
size2image4opu = queue2image4opu.qsize()
message2print = "{(Step 1D/33) got" + "; size2image4opu-got-by-wait2image4opu to: " + str(size2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z2/70) yielded" + "; opu2xi-yielded-by-wait2image4opu: " + str(opu2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
empty2image4opu = True
try:
empty2image4opu= queue2image4opu.empty()
message2print = "{(Step 1E/33) got" + "; empty2image4opu-got-by-wait2image4opu to: " + str(empty2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z3/70) yielded" + "; empty2image4opu-yielded-by-wait2image4opu: " + str(empty2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
full2image4opu = False
try:
full2image4opu = queue2image4opu.full()
message2print = "{(Step 1F/33) got" + "; full2image4opu-got-by-wait2image4opu to: " + str(full2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z4/70) yielded" + "; full2image4opu-yielded-by-wait2image4opu: " + str(full2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 1G/33) finished" + "; opu2image4xi-finished-by-wait2image4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
# -------------------------------------------------------------------------------------
# USE THE EXISTING IMAGE FOR OPU
# -------------------------------------------------------------------------------------
message2print = "{(Step 1H/33) used" + "; opu2image4xi-used-by-wait2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -------------------------------------------------------------------------------------
# WAIT
# -------------------------------------------------------------------------------------
queue2image4opu = None
try:
queue2image4opu = opu2image4xi['QUEUE']
message2print = "{(Step 1I/33) got" + "; queue2image4opu-got-by-wait2image4opu to: " + str(queue2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z5/70) yielded" + "; opu2xi-yielded-by-wait2image4opu: " + str(opu2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
if task4wait2image is None:
pass
else:
# -------------------------------------------------------------------------------------
# IMAGE GIVEN AS PARAMETER
# -------------------------------------------------------------------------------------
message2print = "{(Step 1J1/33) passed" + "; task4wait2image-passed-by-wait2image4opu to: " + str(task4wait2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
queue2task = {}
try:
queue2task = task4wait2image ['QUEUE']
message2print = "{(Step 1J2/33) set" + "; queue2task-set-by-wait2image4opu to: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z61/70) yielded" + "; queue2task-yielded-by-wait2image4opu: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
try:
if queue2task == queue2image4opu:
# -------------------------------------------------------------------------------------
# ACCEPTED - GIVEN QUEUE IS THE SAME
# -------------------------------------------------------------------------------------
message2print = "{(Step 1K/33) accepted" + "; queue2task-accepted-by-wait2image4opu: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
try:
message2print = "{(Step 1L/33) warned" + "; queue2task-warned-by-wait2image4opu: " + " ** " + str(queue2task) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1M/33) warned" + "; queue2image4opu-warned-by-wait2image4opu: " + " ** " + str(queue2image4opu) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
pass
except:
message2print = "{(Step 1Z62/70) yielded" + "; queue2task-yielded-by-wait2image4opu: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
size2queue4opu = 0
try:
size2queue4opu = queue2image4opu.qsize()
message2print = "{(Step 1N1/33) got" + "; size2queue4opu-got-by-wait2image4opu to: " + str(size2queue4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
opu2image4xi ['SIZE2QUEUE'] = size2queue4opu
message2print = "{(Step 1N2/33) set" + "; size2queue4image-got-by-wait2image4opu to: " + str(opu2image4xi ['SIZE2QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z7/70) yielded" + "; size2queue4opu-yielded-by-wait2image4opu: " + str(size2queue4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
empty2queue4opu = False
try:
empty2queue4opu = queue2image4opu.empty()
message2print = "{(Step 1O1/33) got" + "; empty2queue4opu-got-by-wait2image4opu to: " + str(empty2queue4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
opu2image4xi ['EMPTY2QUEUE'] = empty2queue4opu
message2print = "{(Step 1O2/33) set" + "; empty2queue4image-got-by-wait2image4opu to: " + str(opu2image4xi ['EMPTY2QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z8/70) yielded" + "; empty2queue4opu-yielded-by-wait2image4opu: " + str(empty2queue4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
full2queue4opu = False
try:
full2queue4opu = queue2image4opu.full()
message2print = "{(Step 1P1/33) got" + "; full2queue4opu-got-by-wait2image4opu to: " + str(full2queue4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
opu2image4xi ['FULL2QUEUE'] = full2queue4opu
message2print = "{(Step 1P2/33) set" + "; full2queue4image-got-by-wait2image4opu to: " + str(opu2image4xi ['FULL2QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z9/70) yielded" + "; full2queue4opu-yielded-by-wait2image4opu: " + str(full2queue4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
state2queue4opu = None
try:
state2queue4opu = queue2image4opu.__getstate__()
message2print = "{(Step 1P3/33) got" + "; state2queue4opu-got-by-wait2image4opu to: " + str(state2queue4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
opu2image4xi ['STATE2QUEUE'] = state2queue4opu
message2print = "{(Step 1P4/33) set" + "; state2queue4image-set-by-wait2image4opu to: " + str(opu2image4xi ['STATE2QUEUE']) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z10/70) yielded" + "; state2queue4opu-yielded-by-wait2image4opu: " + str(state2queue4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 1Q/33) finished" + "; opu2image4xi-finished-by-wait2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
try:
# -------------------------------------------------------------------------------------
# INITIALIZE
# -------------------------------------------------------------------------------------
opu2image4opu = create2image4opu()
message2print = "{(Step 1R/33) got" + "; opu2image4xi-got-by-wait2image4opu to: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -------------------------------------------------------------------------------------
# WAIT
# -------------------------------------------------------------------------------------
queue2image4opu = None
try:
queue2image4opu = opu2image4xi['QUEUE']
message2print = "{(Step 1S/33) got" + "; queue2image4opu-got-by-wait2image4opu to: " + str(queue2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z10/70) yielded" + "; queue2image4opu-yielded-by-wait2image4opu: " + str(queue2image4opu) + "; 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-wait2image4opu to: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
if queue2task == queue2image4opu:
# -------------------------------------------------------------------------------------
# ACCEPTED - GIVEN QUEUE IS THE SAME
# -------------------------------------------------------------------------------------
message2print = "{(Step 1U/33) accepted" + "; queue2task-accepted-by-wait2image4opu: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
else:
message2print = "{(Step 1X/33) warned" + "; queue2task-warned-by-wait2image4opu: " + " ** " + str(queue2task) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1Y1/33) warned" + "; queue2image4opu-warned-by-wait2image4opu: " + " ** " + str(queue2image4opu) + " ** " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z11/70) yielded" + "; queue2task-yielded-by-wait2image4opu: " + str(queue2task) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
size2image4opu = 0
try:
size2image4opu = queue2image4opu.qsize()
message2print = "{(Step 1Y2/33) got" + "; size2image4opu-got-by-wait2image4opu to: " + str(size2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z12/70) yielded" + "; size2image4opu-yielded-by-wait2image4opu: " + str(size2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
empty2image4opu = True
try:
empty2image4opu = queue2image4opu.empty()
message2print = "{(Step 1Y3/33) got" + "; empty2image4opu-got-by-wait2image4opu to: " + str(empty2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z13/70) yielded" + "; opu2xi-yielded-by-wait2image4opu: " + str(opu2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
full2image4opu = False
try:
full2image4opu= queue2image4opu.full()
message2print = "{(Step 1Y4/33) got" + "; full2image4opu-got-by-wait2image4opu to: " + str(full2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 1Z14/70) yielded" + "; full2image4opu-yielded-by-wait2image4opu: " + str(full2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 1Y5/33) finished" + "; opu2image4xi-finished-by-wait2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
except:
opu2image4opu= {}
message2print = "{(Step 1Z15/70) yielded" + "; opu2image4xi-yielded-by-wait2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 33/33) returning" + "; opu2image4xi-returning-by-wait2image4opu: " + str(opu2image4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'SIZE2QUEUE': 2147483646,
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8',
# 'ORDER': 'CL_RGBA'},
# 'QUEUE': ,
# 'WIDTH': 800,
# 'CONTEXT': ...
return opu2image4xi
#
# =================================================================================================
#
# =================================================================================================
class OPU2Image4Xi(object):
'''
OPU2Image4Xi offers methods for OPU 2D images
'''
#
# ---------------------------------------------------------------------------------------------
# sharable class variables
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
# Public API of this class
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def __init__(self, task4imagecreate2opu = None):
'''
_init__ method initializes OPU2Image4Xi
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "OPU2Image4Xi"
method2print = "__init__"
message2print = "{(Step 1A/33) started" + "; init-of-OPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 23:41:37 09/06/11 Pacific Daylight Time
message2print = "{(Step 1B/33) borning" + "; opu2image2xi-of-OPU2Image4Xi-borning: None" + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
message2print = "{(Step 1C/33) inheriting" + "; object-inheriting-by-opu2image2xi-of-OPU2Image4Xi: " + str(object) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1D/33) sharing" + "; classvariable2opu-sharing-by-opu2image2xi-of-OPU2Image4Xi: " + str(OPU2Image4Xi.classvariable2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 4
message2print = "{(Step 1E/33) passed" + "; task4imagecreate2opu-passed-to-init-of-OPU2Image4Xi: " + str(task4imagecreate2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4imagecreate2opu-passing-to-create2image4opu-by-init-of-OPU2Image4Xi: " + str(task4imagecreate2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
opu2image2xi = create2image4opu(task4imagecreate2opu)
message2print = "{(Step 2B/33) performed" + "; create2image4opu-performed-by-init-of-OPU2Image4Xi: " + str(create2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) activated" + "; opu2image2xi-of-OPU2Image4Xi-activated: " + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# { OPU2Image4Xi : __init__ ; (Step 3A/33) activated; opu2image2xi-of-OPU2Image4Xi-activated: ; time: 00:14:05 09/07/11 Pacific Daylight Time}
message2print = "{(Step 3B/33) inherited" + "; object-inherited-by-opu2image2xi-of-OPU2Image4Xi: " + str(object) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 3C/33) shared" + "; classvariable2opu-shared-by-opu2image2xi-of-OPU2Image4Xi: " + str(OPU2Image4Xi.classvariable2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 4
message2print = "{(Step 3D/33) returning" + "; init-of-OPU2Image4Xi-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 OPU2Image4Xi
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "OPU2Image4Xi"
method2print = "create2image"
message2print = "{(Step 1A/33) started" + "; create2image-of-OPU2Image4Xi-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-OPU2Image4Xi: " + str(task4image2create) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4image2create-passing-to-create2image4opu-by-create2image-of-OPU2Image4Xi: " + str(task4image2create) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
opu2image2xi = create2image4opu(task4image2create)
message2print = "{(Step 2B/33) performed" + "; create2image4opu-performed-by-create2image-of-OPU2Image4Xi: " + str(create2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3/33) returning" + "; opu2image2xi-returning-by-create2image-of-OPU2Image4Xi: " + str(opu2image2xi) + "; 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; create2image4opu-failed ; time: 00:53:55 10/05/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4opu',
# 'METHOD': 'create2image4opu'},
# 'WIDTH': 800 ...
return opu2image2xi
#
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def set2image(self, task4set2image = None):
'''
sets 2D image OPU objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "OPU2Image4Xi"
method2print = "set2image"
message2print = "{(Step 1A/33) started" + "; set2image-of-OPU2Image4Xi-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-OPU2Image4Xi: " + 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-set2image4opu-by-set2image-of-OPU2Image4Xi: " + str(task4set2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'QUEUE': ,
# 'CONTEXT': {'COUNT2REFERENCE': 0 ...
opu2image2xi = set2image4opu(task4set2image)
message2print = "{(Step 2B/33) performed" + "; set2image4opu-performed-by-set2image-of-OPU2Image4Xi: " + str(set2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; opu2image2xi-returning-by-set2image-of-OPU2Image4Xi: " + str(opu2image2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'ACK2RETURN': ' 23B-24B-25B-26B-27B-28B-',
# 'ROWPITCH': 800,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4opu-failed ; time: 01:02:22 09/07/11 Pacific Daylight Time}', 'CLASS': 'create2image4opu', 'METHOD': 'create2image4opu'},
# 'WIDTH': 800,
# 'BUFFER': {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4opu-failed ; time: 01:02:22 09/07/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4opu',
# 'METHOD': 'create2buffer4opu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0 ...
return opu2image2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def get2imageinfo(self, task4getinfo2image=None):
'''
get2imageinfo method gets 2D objects of OPU2Image4Xi
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "OPU2Image4Xi"
method2print = "get2imageinfo"
message2print = "{(Step 1A/33) started" + "; get2imageinfo-of-OPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 00:14:05 09/07/11 Pacific Daylight Time
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
opu2image2xi = get2imageinfo4opu(task4getinfo2image)
message2print = "{(Step 2A/33) returning" + "; opu2image2xi-returning-by-get2imageinfo-of-OPU2Image4Xi: " + str(opu2image2xi) + "; 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; create2image4opu-failed ; time: 00:14:05 09/07/11 Pacific Daylight Time}', 'CLASS': 'create2image4opu', 'METHOD': 'create2image4opu'},
# 'WIDTH': 800,
# 'BUFFER': {'CODE2ERROR': 0, 'COUNT2REFERENCE': 0, 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2buffer4opu-failed ; time: 00:14:05 09/07/11 Pacific Daylight Time}',
# 'CLASS': 'create2buffer4opu',
# 'METHOD': 'create2buffer4opu'},
# 'FUNCTION2CALLBACK': ,
# 'POINTER2BUFFER': ,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0, ...
# or when only two elemets required
# {'WIDTH': 800, 'HEIGHT': 800}
return opu2image2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def get2supportedimageformats(self):
'''
get2supportedimageformats method gets supported imageformats by objects of OPU2Image4Xi
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "OPU2Image4Xi"
method2print = "get2supportedimageformats"
message2print = "{(Step 1A/33) started" + "; get2supportedimageformats-of-OPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:43:00 09/07/11 Pacific Daylight Time
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
supportedimageformats2opu = get2supportedimageformats4opu()
message2print = "{(Step 2A/33) returning" + "; supportedimageformats2opu-returning-by-get2imageinfo-of-OPU2Image4Xi: " + str(supportedimageformats2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'}
return supportedimageformats2opu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def read2image(self, task4read2image = None):
'''
reads OPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "OPU2Image4Xi"
method2print = "read2image"
message2print = "{(Step 1A/33) started" + "; read2image-of-OPU2Image4Xi-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-OPU2Image4Xi: " + str(task4read2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4read2image-passing-to-read2image4opu-by-read2image-of-OPU2Image4Xi: " + str(task4read2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4readimage2opu = read2image4opu(task4read2image)
message2print = "{(Step 2B/33) performed" + "; read2image4opu-performed-by-read2image-of-OPU2Image4Xi: " + str(read2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4readimage2opu-returning-by-read2image-of-OPU2Image4Xi: " + str(response4readimage2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 00:20:02 10/05/11 Pacific Daylight Time}
return response4readimage2opu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def map2image(self, task4map2image = None):
'''
maps OPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "OPU2Image4Xi"
method2print = "map2image"
message2print = "{(Step 1A/33) started" + "; map2image-of-OPU2Image4Xi-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-OPU2Image4Xi: " + str(task4map2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4map2image-passing-to-map2image4opu-by-map2image-of-OPU2Image4Xi: " + str(task4map2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4mapimage2opu = map2image4opu(task4map2image)
message2print = "{(Step 2B/33) performed" + "; map2image4opu-performed-by-map2image-of-OPU2Image4Xi: " + str(map2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4mapimage2opu-returning-by-map2image-of-OPU2Image4Xi: " + str(response4mapimage2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return response4mapimage2opu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def release2image(self, task4release2image = None):
'''
releases OPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "OPU2Image4Xi"
method2print = "release2image"
message2print = "{(Step 1A/33) started" + "; release2image-of-OPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
message2print = "{(Step 1B/33) passed" + "; task4release2image-passed-to-release2image-of-OPU2Image4Xi: " + str(task4release2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4release2image-passing-to-release2image4opu-by-release2image-of-OPU2Image4Xi: " + str(task4release2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
opu2image2xi = release2image4opu(task4release2image)
message2print = "{(Step 2B/33) performed" + "; release2image4opu-performed-by-release2image-of-OPU2Image4Xi: " + str(release2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; opu2image2xi-returning-by-release2image-of-OPU2Image4Xi: " + str(opu2image2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
return opu2image2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def retain2image(self, task4retain2image = None):
'''
retains OPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "OPU2Image4Xi"
method2print = "retain2image"
message2print = "{(Step 1A/33) started" + "; retain2image-of-OPU2Image4Xi-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-OPU2Image4Xi: " + str(task4retain2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 1}
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4retain-passing-to-retain2image4opu-by-retain-of-OPU2Image4Xi: " + str(task4retain2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'COUNT2REFERENCE': 1}
opu2image2xi = retain2image4opu(task4retain2image)
message2print = "{(Step 2B/33) performed" + "; retain2image4opu-performed-by-retain2image-of-OPU2Image4Xi: " + str(retain2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; opu2image2xi-returning-by-retain2image-of-OPU2Image4Xi: " + str(opu2image2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'CODE2ERROR': 0,
# 'ACK2RETURN': ' 1D-',
# 'ROWPITCH': 800,
# 'DATA2CALLBACK': {'MESSAGE': '{(Step 1Z1/33) failed; create2image4opu-failed ; time: 00:14:05 09/07/11 Pacific Daylight Time}',
# 'CLASS': 'create2image4opu',
# 'METHOD': 'create2image4opu'},
# 'WIDTH': 800,
# 'BUFFER': {'CODE2ERROR': 0,
# ...
# 'COUNT2REFERENCE': 1,
# 'FLAGS': 0,
# 'CONTEXT': {'COUNT2REFERENCE': 0 ...
return opu2image2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def wait2image(self, task4wait2image = None):
'''
waits OPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "OPU2Image4Xi"
method2print = "wait2image"
message2print = "{(Step 1A/33) started" + "; wait2image-of-OPU2Image4Xi-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-OPU2Image4Xi: " + str(task4wait2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4wait-passing-to-wait2image4opu-by-wait2image-of-OPU2Image4Xi: " + str(task4wait2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
opu2image2xi = wait2image4opu(task4wait2image)
message2print = "{(Step 2B/33) performed" + "; wait2image4opu-performed-by-wait2image-of-OPU2Image4Xi: " + str(wait2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# semaphore and lock analysis by multiprocessing4xi
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; opu2image2xi-returning-by-wait2image-of-OPU2Image4Xi: " + str(opu2image2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'SIZE2QUEUE': 2147483646,
# 'FORMAT': {'TYPE': 'CL_UNORM_INT8', 'ORDER': 'CL_RGBA'},
# 'QUEUE': ,
# 'WIDTH': 800,
# 'CONTEXT': ...
return opu2image2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def write2image(self, task4write2image = None):
'''
writes OPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "OPU2Image4Xi"
method2print = "write2image"
message2print = "{(Step 1A/33) started" + "; write2image-of-OPU2Image4Xi-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-OPU2Image4Xi: " + str(task4write2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4write2image-passing-to-write2image4opu-by-write2image-of-OPU2Image4Xi: " + str(task4write2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4writeimage2opu = write2image4opu(task4write2image)
message2print = "{(Step 2B/33) performed" + "; write2image4opu-performed-by-write2image-of-OPU2Image4Xi: " + str(write2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4writeimage2opu-returning-by-write2image-of-OPU2Image4Xi: " + str(response4writeimage2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 02:45:31 10/05/11 Pacific Daylight Time}
return response4writeimage2opu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def copy2image(self, task4copy2image = None):
'''
copies OPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "OPU2Image4Xi"
method2print = "copy2image"
message2print = "{(Step 1A/33) started" + "; copy2image-of-OPU2Image4Xi-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-OPU2Image4Xi: " + str(task4copy2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4copy2image-passing-to-copy2image4opu-by-copy2image-of-OPU2Image4Xi: " + str(task4copy2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4copyimage2opu = copy2image4opu(task4copy2image)
message2print = "{(Step 2B/33) performed" + "; copy2image4opu-performed-by-copy2image-of-OPU2Image4Xi: " + str(copy2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4copyimage2opu-returning-by-copy2image-of-OPU2Image4Xi: " + str(response4copyimage2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return response4copyimage2opu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def copy2imagetobuffer(self, task4copy2imagetobuffer = None):
'''
copies 2D images to buffer
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "OPU2Image4Xi"
method2print = "copy2imagetobuffer"
message2print = "{(Step 1A/33) started" + "; copy2imagetobuffer-of-OPU2Image4Xi-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-OPU2Image4Xi: " + str(task4copy2imagetobuffer) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4copy2imagetobuffer-passing-to-copy2imagetobuffer4opu-by-copy2imagetobuffer-of-OPU2Image4Xi: " + str(task4copy2imagetobuffer) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4copyimage2opu = copy2imagetobuffer4opu(task4copy2imagetobuffer)
message2print = "{(Step 2B/33) performed" + "; copy2imagetobuffer4opu-performed-by-copy2imagetobuffer-of-OPU2Image4Xi: " + str(copy2imagetobuffer4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4copyimage2opu-returning-by-copy2imagetobuffer-of-OPU2Image4Xi: " + str(response4copyimage2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return response4copyimage2opu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def copy2buffertoimage(self, task4copy2buffertoimage = None):
'''
copies 2D images to buffer
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "OPU2Image4Xi"
method2print = "copy2buffertoimage"
message2print = "{(Step 1A/33) started" + "; copy2buffertoimage-of-OPU2Image4Xi-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-OPU2Image4Xi: " + str(task4copy2buffertoimage) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4copy2buffertoimage-passing-to-copy2buffertoimage4opu-by-copy2buffertoimage-of-OPU2Image4Xi: " + str(task4copy2buffertoimage) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
response4copyimage2opu = copy2buffertoimage4opu(task4copy2buffertoimage)
message2print = "{(Step 2B/33) performed" + "; copy2buffertoimage4opu-performed-by-copy2buffertoimage-of-OPU2Image4Xi: " + str(copy2buffertoimage4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; response4copyimage2opu-returning-by-copy2buffertoimage-of-OPU2Image4Xi: " + str(response4copyimage2opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'QUEUE': ,
# 'PUBLISHERCHANNEL': ,
# 'CONSUMERCHANNEL': }; time: 01:28:44 10/05/11 Pacific Daylight Time}
return response4copyimage2opu
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def trace2image(self, task4trace2image = None):
'''
traces OPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "OPU2Image4Xi"
method2print = "trace2image"
message2print = "{(Step 1A/33) started" + "; trace2image-of-OPU2Image4Xi-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-OPU2Image4Xi: " + str(task4trace2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4trace2image-passing-to-trace2image4opu-by-trace2image-of-OPU2Image4Xi: " + str(task4trace2image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
trace2xi = trace2image4opu(task4trace2image)
message2print = "{(Step 2B/33) performed" + "; trace2image4opu-performed-by-trace2image-of-OPU2Image4Xi: " + str(trace2image4opu) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; trace2xi-returning-by-trace2image-of-OPU2Image4Xi: " + str(trace2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'MESSAGE': '{(Step 2Z0/33) failed; trace2image4opu-failed {}; time: 01:05:20 09/08/11 Pacific Daylight Time}',
# 'CLASS': 'trace2image4opu',
# 'METHOD': 'trace2image4opu'}; time: 01:05:20 09/08/11 Pacific Daylight Time}
return trace2xi
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def set2imagecallback(self, task4set2imagecallback = None):
'''
set2imagecallback of OPU2Image4Xi objects
'''
# -----------------------------------------------------------------------------------------
# (Step 1/33)
# -----------------------------------------------------------------------------------------
class2print = "OPU2Image4Xi"
method2print = "set2imagecallback"
message2print = "{(Step 1A/33) started" + "; set2imagecallback-of-OPU2Image4Xi-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-OPU2Image4Xi: " + str(task4set2imagecallback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
# -----------------------------------------------------------------------------------------
# (Step 2/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) passing" + "; task4set2imagecallback-passing-to-set2imagecallback -by-set2imagecallback-of-OPU2Image4Xi: " + str(task4set2imagecallback) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# None
callback2opu4image = {}
try:
callback2opu4image = set2imagecallback4opu (task4set2imagecallback)
message2print = "{(Step 2B/33) callback2opu4image" + "; callback2opu4image-set-by-set2imagecallback-of-OPU2Image4Xi to: " + str(callback2opu4image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
except:
message2print = "{(Step 4A/33) failed" + "; callback2opu4image-failed-by-set2imagecallback-of-OPU2Image4Xi: " + str(callback2opu4image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# -----------------------------------------------------------------------------------------
# (Step 3/33)
# -----------------------------------------------------------------------------------------
message2print = "{(Step 3A/33) returning" + "; callback2opu4image-returning-by-set2imagecallback-of-OPU2Image4Xi: " + str(callback2opu4image) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
return callback2opu4image
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def sense(self):
'''
method sense: senses OPU2Image4Xi class objects
'''
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
class2print = 'OPU2Image4Xi'
method2print = 'sense'
message2print = "{(Step 1A/33) started" + "; sense-of-OPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:02:22 09/07/11 Pacific Daylight Time
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) sensing" + "; OPU2Image4Xi-sensing-by-sense-of-OPU2Image4Xi: " + str(OPU2Image4Xi) + "; 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-OPU2Image4Xi: " + str(kb2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'object': }
# -----------------------------------------------------------------------------------------
# add knowledge specific to this object
# format example: kb2xi['time2xi'] = time4xi() #adding time
# -----------------------------------------------------------------------------------------
try:
kb2xi['classvariable2opu-of-OPU2Image4Xi'] = OPU2Image4Xi.classvariable2opu
except:
message2print = "{(Step 4A/33) yielded" + "; kb2xi-yielded-by-sense-of-OPU2Image4Xi: " + str(kb2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 5A/33) sensed" + "; OPU2Image4Xi-sensed-by-sense-of-OPU2Image4Xi: " + str(OPU2Image4Xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 6A/33) returning" + "; kb2xi-returning-by-sense-of-OPU2Image4Xi: " + str(kb2xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'object': , 'classvariable2opu-of-OPU2Image4Xi': 4}
return kb2xi
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def reason(self):
'''
method reason: reasons OPU2Image4Xi class objects
'''
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
class2print = 'OPU2Image4Xi'
method2print = 'reason'
message2print = "{(Step 1A/33) started" + "; reason-of-OPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:02:22 09/07/11 Pacific Daylight Time
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) reasoning" + "; OPU2Image4Xi-reasoning-by-reason-of-OPU2Image4Xi: " + str(OPU2Image4Xi) + "; 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-OPU2Image4Xi: " + 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-OPU2Image4Xi'] = time4xi() #adding time
except:
message2print = "{(Step 4Z/33) yielded" + "; kb4xi-yielded-by-reason-of-OPU2Image4Xi: " + str(kb4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 5A/33) reasoned" + "; OPU2Image4Xi-reasoned-by-reason-of-OPU2Image4Xi: " + str(OPU2Image4Xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 6A/33) returning" + "; kb4xi-returning-by-reason-of-OPU2Image4Xi: " + str(kb4xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'object-reason-object4xi': , 'time-reason-of-OPU2Image4Xi': '01:02:22 09/07/11 Pacific Daylight Time'}
return kb4xi
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
def ace(self):
'''
method ace: aces OPU2Image4Xi class objects
'''
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
class2print = 'OPU2Image4Xi'
method2print = 'ace'
message2print = "{(Step 1A/33) started" + "; ace-of-OPU2Image4Xi-started: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# 01:02:22 09/07/11 Pacific Daylight Time
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 2A/33) acing" + "; OPU2Image4Xi-acing-by-ace-of-OPU2Image4Xi: " + str(OPU2Image4Xi) + "; 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-OPU2Image4Xi: " + 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-OPU2Image4Xi'] = OPU2Image4Xi.classvariable2opu
except:
message2print = "{(Step 4A/33) yielded" + "; kb8xi-yielded-by-ace-of-OPU2Image4Xi: " + str(kb8xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
message2print = "{(Step 5A/33) aced" + "; OPU2Image4Xi-aced-by-ace-of-OPU2Image4Xi: " + str(OPU2Image4Xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
#
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
message2print = "{(Step 6A/33) returning" + "; kb8xi-returning-by-ace-of-OPU2Image4Xi: " + str(kb8xi) + "; time: " + time4xi() + "}"
print4xi(class2print, method2print, message2print)
# {'cores-of-OPU2Image4Xi': 4, 'object8xi': }
return kb8xi
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
#
#
#
# -------------------------------------------------------------------------------------------------
# Recorded History
# -------------------------------------------------------------------------------------------------
#
#
# -------------------------------------------------------------------------------------------------
# to-be-done
# -------------------------------------------------------------------------------------------------
#
#
# -------------------------------------------------------------------------------------------------
# Legal Notice
# -------------------------------------------------------------------------------------------------
#
#