This commit is contained in:
Mike Nolan 2021-12-28 07:47:09 -06:00
parent b266d8a490
commit 24e220badc
2 changed files with 8 additions and 3 deletions

View File

@ -97,13 +97,18 @@ namespace Timelapse.Api
ExtensionAttribute attr=type.GetCustomAttribute<ExtensionAttribute>(); ExtensionAttribute attr=type.GetCustomAttribute<ExtensionAttribute>();
if(typeof(TimelapseExtension).IsAssignableFrom(type) && attr != null) if(typeof(TimelapseExtension).IsAssignableFrom(type) && attr != null)
{ {
Console.WriteLine("Before Create Instance");
//load assembly info //load assembly info
var item=(TimelapseExtension)Activator.CreateInstance(typeof(TimelapseExtension));
var item=(TimelapseExtension)Activator.CreateInstance(type);
Console.WriteLine("Affter Create Instance");
item.__id=attr.Id; item.__id=attr.Id;
item.Name = attr.Name; item.Name = attr.Name;
TimelapseExtensions.Add(item); TimelapseExtensions.Add(item);
Attributes.Add(attr,item); Attributes.Add(attr,item);
Console.WriteLine("Before OnInit");
item.OnInit(); item.OnInit();
Console.WriteLine("After OnInit");
} }
} }
Assemblies.Add(asm,dll); Assemblies.Add(asm,dll);

View File

@ -44,7 +44,7 @@
[JSInvokable] [JSInvokable]
public void ProcessImage(string imageString) public void ProcessImage(string imageString)
{ {
Console.WriteLine("Taken");
byte[] imageData = Convert.FromBase64String(imageString.Split(',')[1]); byte[] imageData = Convert.FromBase64String(imageString.Split(',')[1]);
Image<Rgb24> image = Image.Load<Rgb24>(imageData); Image<Rgb24> image = Image.Load<Rgb24>(imageData);
Task.Run(async ()=>{ await EPS.SendImageAsync(image);}); Task.Run(async ()=>{ await EPS.SendImageAsync(image);});
@ -104,7 +104,7 @@
if(Recording && EPS.IsProjectLoaded) if(Recording && EPS.IsProjectLoaded)
{ {
Console.WriteLine("OK");
Task.Run(async()=>{ await TakeFrameAsync();}); Task.Run(async()=>{ await TakeFrameAsync();});
frame=0; frame=0;
} }