check point
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
using Hawkeye.VisionBuilder.Workflow.Operations.Attributes;
|
||||
|
||||
namespace Hawkeye.VisionBuilder.Workflow.Operations.Memory;
|
||||
|
||||
[Category("Memory")]
|
||||
public class ImageFromMemoryOperation:BaseOperation
|
||||
{
|
||||
public ImageFromMemoryOperation()
|
||||
{
|
||||
CanHaveProcessingError = false;
|
||||
}
|
||||
|
||||
public string SlotName { get; set; } = "Image";
|
||||
|
||||
|
||||
protected override void InterpretInternal(Context context)
|
||||
{
|
||||
if (context.Memory.ContainsKey(SlotName))
|
||||
{
|
||||
context.ActiveImage = context.Memory[SlotName];
|
||||
Status = "Image from slot "+SlotName;
|
||||
Result = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = "Slot not found";
|
||||
Result = false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Save(BinaryWriter bw)
|
||||
{
|
||||
base.Save(bw);
|
||||
bw.Write(SlotName);
|
||||
}
|
||||
|
||||
public override void Load(BinaryReader br)
|
||||
{
|
||||
base.Load(br);
|
||||
SlotName = br.ReadString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user