JaiCamera.cs
1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using Jai_FactoryDotNET;
namespace OS.Spin.Common.Camera
{
public class JaiCamera
{
private static JaiCamera _jai;
CFactory myFactory = new CFactory();
private static object _objLock = new object();
public static JaiCamera GetInstance()
{
lock(_objLock)
{
if(null == _jai)
{
_jai = new JaiCamera();
}
return _jai;
}
}
private JaiCamera()
{
myFactory.Open("");
myFactory.UpdateCameraList(CFactory.EDriverType.Undefined);
}
public CCamera GetCameraByChannel(int channel)
{
if(channel >= myFactory.CameraList.Count)
{
return null;
}
return myFactory.CameraList[channel];
}
public void Close()
{
myFactory.Close();
myFactory.Dispose();
}
}
}