The ENVIAsyncSpawnTaskJob class is a subclass of the IDLAsyncSpawnTaskJob class for ENVI purposes. It allows the user to specify a single ENVITask that will executed by the ENVITaskEngine when there are available resources. The ENVITask must have all of its input parameters specified before creating this job, as it will be cloned and dehydrated for passage to ENVITaskEngine via STDIN. Any subsequent changes to the task's parameter values will not be reflected when this job executes the task in the ENVITaskEngine.
Examples
e = envi()
File = Filepath('qb_boulder_msi', Subdir=['data'], $
Root_Dir=e.Root_Dir)
raster = enviUrlRaster(File)
numClasses = [ 3, 5, 7 ]
numJobs = N_Elements(numClasses)
oJoin = IDLAsyncJoin()
oQueue = IDLAsyncQueue(CONCURRENCY=numJobs)
oJobs = ObjArr(numJobs)
oTask = ENVITask('ISODATAClassification')
oTask.Input_Raster = raster
FOR i=0, numJobs-1 DO BEGIN
oTask.Number_of_Classes = numClasses[i]
oJobs[i] = ENVIAsyncSpawnTaskJob(oTask, JOIN=oJoin)
ENDFOR
oQueue.SubmitJob, oJobs
oJoin.WaitForJoin
v0 = e.GetView()
v1 = e.CreateView()
v2 = e.CreateView()
v3 = e.CreateView()
l0 = v0.CreateLayer(raster)
l1 = v1.CreateLayer(oJobs[0].Task.Output_Raster)
l2 = v2.CreateLayer(oJobs[1].Task.Output_Raster)
l3 = v3.CreateLayer(oJobs[2].Task.Output_Raster)
Syntax
Result = ENVIAsyncSpawnTaskJob(Task [, /COMPILE] [, JOIN=IDLAsyncJoin] [, WAIT=Float])
Arguments
Task
A scalar ENVITask object owned by this job, which will be executed inside ENVITaskEngine when Start is called.
Keywords
COMPILE (optional)
Specify an optional Boolean flag that indicates whether the "--compile" flag should be added to the ENVITaskEngine invocation. Use this if your task uses PRO code instead of save files.
JOIN (optional)
Specify an IDLAsyncJoin object that is passed to the IDLAsyncJob base class Init() method for handling.
WAIT (optional)
Specify a value in seconds to pass to IDLAsyncSpawnJob::Init for handling.
Methods
ENVIAsyncSpawnTaskJob inherits all methods from IDLAsyncSpawnTaskJob. ENVIAsyncSpawnTaskJob also has the following method:
ENVIAsyncSpawnTaskJob::OnDone
Properties
ENVIAsyncSpawnTaskJob inherits all properties from IDLAsyncSpawnTaskJob.
Version History
API Version
4.2
See Also
ENVIAsyncSpawnTaskJob::OnDone, ENVITask