io commander
This commit is contained in:
@@ -5,9 +5,14 @@ namespace Hawkeye.VisionBuilder.Workflow;
|
||||
|
||||
public class Context
|
||||
{
|
||||
public Context()
|
||||
{
|
||||
}
|
||||
|
||||
public HawkeyeImage? ActiveImage { get; set; }
|
||||
public HawkeyeImage? LastCameraImage { get; set; }
|
||||
public List<IGraphicsElement> GraphicsElements { get; set; }=new List<IGraphicsElement>();
|
||||
public Dictionary<string, HawkeyeImage> Memory { get; set; } = new Dictionary<string, HawkeyeImage>();
|
||||
public CancellationToken CancellationToken { get; set; }
|
||||
|
||||
}
|
||||
@@ -26,7 +26,7 @@ public class GetImageOperation:BaseOperation,IHaveImage
|
||||
protected override void InterpretInternal(Context context)
|
||||
{
|
||||
|
||||
var image = _workflowList.ImageSource.GetImage(CancellationToken.None).Result;
|
||||
var image = _workflowList.ImageSource.GetImage(context.CancellationToken).Result;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ public class WorkflowList
|
||||
long total = 0;
|
||||
foreach (BaseOperation operation in Operations)
|
||||
{
|
||||
if (Context.CancellationToken.IsCancellationRequested) break;
|
||||
operation.Interpret(Context);
|
||||
}
|
||||
_executionCounter++;
|
||||
|
||||
Reference in New Issue
Block a user