check point
This commit is contained in:
74
framework/Inspectron.Camera/NoImage/NoImageCamera.cs
Normal file
74
framework/Inspectron.Camera/NoImage/NoImageCamera.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using Inspectron.Camera.Image;
|
||||
|
||||
namespace Inspectron.Camera.NoImage
|
||||
{
|
||||
public class NoImageCamera:ICamera
|
||||
{
|
||||
public NoImageCamera(ICameraProvider provider)
|
||||
{
|
||||
Provider = provider;
|
||||
}
|
||||
|
||||
private int _acquisitionDelay = 0;
|
||||
public string Name { get; }
|
||||
public void Open()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public bool IsOpen { get; }
|
||||
public void Close()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public bool IsGrabbingContinuous { get; private set; }
|
||||
|
||||
public void StartGrabContinuous()
|
||||
{
|
||||
IsGrabbingContinuous = true;
|
||||
}
|
||||
|
||||
public void StopGrabContinuous()
|
||||
{
|
||||
IsGrabbingContinuous = false;
|
||||
}
|
||||
|
||||
public void LoadParameters(string parametersFile)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void SaveParameters(string parametersFile)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void SaveParametersToDevice()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public int AcquisitionDelay
|
||||
{
|
||||
get => _acquisitionDelay;
|
||||
set => _acquisitionDelay = value;
|
||||
}
|
||||
|
||||
public IImage GrabSingle()
|
||||
{
|
||||
Thread.Sleep(AcquisitionDelay);
|
||||
return null;
|
||||
}
|
||||
|
||||
public event ImageGrabbedHandler ImageGrabbed=delegate{};
|
||||
public ICameraCapabilities Capabilities =>new NoImageCameraCapabilities();
|
||||
public IEnumerable<ICameraParameter> Parameters =>new List<ICameraParameter>()
|
||||
{
|
||||
new CameraParameter("AcquisitionDelay",() => this.AcquisitionDelay,x=>AcquisitionDelay=(int)x)
|
||||
};
|
||||
public ICameraProvider Provider { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Inspectron.Camera.NoImage
|
||||
{
|
||||
public class NoImageCameraCapabilities:ICameraCapabilities
|
||||
{
|
||||
public bool CanGrabSingle { get; }=true;
|
||||
public bool CanGrabContinuous { get; } = true;
|
||||
public bool CanSaveParametersToFile { get; } = false;
|
||||
public bool CanSaveParametersToDevice { get; } = false;
|
||||
}
|
||||
}
|
||||
18
framework/Inspectron.Camera/NoImage/NoImageCameraProvider.cs
Normal file
18
framework/Inspectron.Camera/NoImage/NoImageCameraProvider.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
|
||||
namespace Inspectron.Camera.NoImage
|
||||
{
|
||||
public class NoImageCameraProvider : ICameraProvider
|
||||
{
|
||||
public string Name { get; } = "No image camera provider";
|
||||
public int CamerasToDiscover { get; set; } = 1;
|
||||
public ReadOnlyCollection<ICamera> Discover()
|
||||
{
|
||||
return Enumerable.Range(0, CamerasToDiscover).Select(x => (ICamera)new NoImageCamera(this)).ToList().AsReadOnly();
|
||||
}
|
||||
|
||||
public ReadOnlyCollection<ICamera> Cameras { get; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user