add camera driver layer

This commit is contained in:
2025-12-26 14:54:32 +08:00
parent c6be81d1dd
commit d7ef283b9d
11 changed files with 324 additions and 469 deletions

View File

@@ -43,14 +43,19 @@ namespace LibComm
cc24.NotifyCamAcqDisabled -= CC24_NotifyCamAcqDisabled;
cc24.Shutdown();
}
public void NoticeCamComplete(int index, byte[] datax)
public void NoticeCamComplete(int index, float data)
{
cc24?.NotifyCamInspectionComplete(index, datax);
cc24?.NotifyCamInspectionComplete(index, DataConverter.FloatToByte(data, true));
cc24?.NotifyCamAcqComplete(index);
}
public void NoticeCamComplete(int index, List<float> data)
{
cc24?.NotifyCamInspectionComplete(index, DataConverter.FloatToByte(data, true));
cc24?.NotifyCamAcqComplete(index);
}
private void CC24_NewUserDataReceived(object sender, CogNdmNewUserDataEventArgs e)
{
OnDataReceived?.Invoke(cc24.ReadBytesFromPLC(0, 4));
OnDataReceived?.Invoke(DataConverter.ByteToFloat(cc24.ReadBytesFromPLC(0, 4), true));
}
private void CC24_PlcConnectionStatusChanged(object sender, CogNdmProtocolStatusChangedEventArgs e)
{

View File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace LibComm
{
public delegate void OnDataReceived(byte[] data);
public delegate void OnDataReceived(float data);
public delegate void OnConnectStatus(bool connected);
public delegate void OnTrigCamera(int index);
public delegate void OnCameraStatus(int index, bool enable);
@@ -18,6 +18,7 @@ namespace LibComm
event OnCameraStatus OnCameraStatus;
void Start();
void Stop();
void NoticeCamComplete(int index, byte[] datax);
void NoticeCamComplete(int index, float data);
void NoticeCamComplete(int index, List<float> data);
}
}

View File

@@ -30,6 +30,24 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="Bjcve.Comm.FFP">
<HintPath>..\dll\Bjcve.Comm.FFP.dll</HintPath>