DALSA网口相机三相机SDK使用
最近在做一个dalsa线阵相机的项目,三个相机同时调用SDK,本人小白,稍微分享下自己的使用情况
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DALSA.SaperaLT.SapClassBasic;
//using DALSA.SaperaLT.SapClassGui;
using HalconDotNet;
namespace SDK
{
class Class_DaslsaCamLeft
{
//初始化相机类
private static SapLocation m_ServerLocation;
private static SapAcqDevice m_AcqDevice;
private static SapBuffer m_Buffers;
private static SapAcqDeviceToBuf m_Xfer;
private static HImage image = new HImage();
public static Queue g_queImage = new Queue();
public static bool g_bGrabed = false;
Class_WriteLogs Cam_log = new Class_WriteLogs();
///
/// 获取相机名和索引
///
///
///
///
public bool GetCameraInfo(out string sCameraName, out int nIndex,string CamerId)
{
sCameraName = “”;
nIndex = 0;
bool bFind = false;
try
{
int serverCount = SapManager.GetServerCount();
int GenieIndex = 0;
System.Collections.ArrayList listServerNames = new System.Collections.ArrayList();
string serverName = "";
for (int serverIndex = 0; serverIndex < serverCount; serverIndex++)
{
if (SapManager.GetResourceCount(serverIndex, SapManager.ResourceType.AcqDevice) != 0)
{
serverName = SapManager.GetServerName(serverIndex);
listServerNames.Add(serverName);
GenieIndex++;
bFind = true;
}
}
int count = 0;
string deviceName = "";
foreach (string sName in listS