#include <iostream>
#include <sstream>
using namespace Spinnaker;
using namespace Spinnaker::GenApi;
using namespace Spinnaker::GenICam;
using namespace std;
{
int result = 0;
try
{
if (
IsAvailable(pInterface->TLInterface.InterfaceDisplayName) &&
IsReadable(pInterface->TLInterface.InterfaceDisplayName))
{
gcstring interfaceDisplayName = pInterface->TLInterface.InterfaceDisplayName.GetValue();
cout << interfaceDisplayName << endl;
}
else
{
cout << "Interface display name not readable" << endl;
}
pInterface->UpdateCameras();
unsigned int numCameras = camList.
GetSize();
if (numCameras == 0)
{
cout << "\tNo devices detected." << endl << endl;
return 0;
}
for (unsigned int i = 0; i < numCameras; i++)
{
cout << "\tDevice " << i << " ";
{
gcstring deviceVendorName = pCam->TLDevice.DeviceVendorName.GetValue();
cout << deviceVendorName << " ";
}
{
gcstring deviceModelName = pCam->TLDevice.DeviceModelName.GetValue();
cout << deviceModelName << " " << endl << endl;
}
}
}
{
cout <<
"Error: " << e.
what() << endl;
result = -1;
}
return result;
}
{
int result = 0;
cout << "Application build date: " << __DATE__ << " " << __TIME__ << endl << endl;
const LibraryVersion spinnakerLibraryVersion = system->GetLibraryVersion();
cout <<
"Spinnaker library version: " << spinnakerLibraryVersion.
major <<
"." << spinnakerLibraryVersion.
minor
<<
"." << spinnakerLibraryVersion.
type <<
"." << spinnakerLibraryVersion.
build << endl
<< endl;
unsigned int numInterfaces = interfaceList.
GetSize();
cout << "Number of interfaces detected: " << numInterfaces << endl << endl;
unsigned int numCameras = camList.
GetSize();
cout << "Number of cameras detected: " << numCameras << endl << endl;
if (numCameras == 0 || numInterfaces == 0)
{
system->ReleaseInstance();
cout << "Not enough cameras!" << endl;
cout << "Done! Press Enter to exit..." << endl;
getchar();
return -1;
}
cout << endl << "*** QUERYING INTERFACES ***" << endl << endl;
for (unsigned int i = 0; i < numInterfaces; i++)
{
}
interfacePtr = nullptr;
system->ReleaseInstance();
cout << endl << "Done! Press Enter to exit..." << endl;
getchar();
return result;
}