Import/export camera property files.
The sample code shows how to export the property configurations of the selected camera as a XML file to the local PC, and import the XML file from the local PC to the selected cameras to fast configure all its properties without the inconvenience of configuring its property one by one.
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <pthread.h>
#include "MvCameraControl.h"
{
if (NULL == pstMVDevInfo)
{
printf("The Pointer of pstMVDevInfo is NULL!\n");
return false;
}
{
printf("CurrentIp: %d.%d.%d.%d\n" , nIp1, nIp2, nIp3, nIp4);
}
{
}
else
{
printf("Not support.\n");
}
return true;
}
int main()
{
void* handle = NULL;
do
{
{
printf("Initialize SDK fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("Enum Devices fail! nRet [0x%x]\n", nRet);
break;
}
{
for (
unsigned int i = 0; i < stDeviceList.
nDeviceNum; i++)
{
printf("[device %d]:\n", i);
if (NULL == pDeviceInfo)
{
break;
}
PrintDeviceInfo(pDeviceInfo);
}
}
else
{
printf("Find No Devices!\n");
break;
}
printf("Please Intput camera index: ");
unsigned int nIndex = 0;
scanf("%d", &nIndex);
{
printf("Intput error!\n");
break;
}
{
printf("Create Handle fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("Open Device fail! nRet [0x%x]\n", nRet);
break;
}
printf("Start export the camera properties to the file\n");
printf("Wait......\n");
{
printf("Save Feature fail! nRet [0x%x]\n", nRet);
break;
}
printf("Finish export the camera properties to the file\n\n");
printf("Start import the camera properties from the file\n");
printf("Wait......\n");
{
printf("Load Feature fail! nRet [0x%x]\n", nRet);
break;
}
printf("Finish import the camera properties from the file\n");
{
printf("ClosDevice fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("Destroy Handle fail! nRet [0x%x]\n", nRet);
break;
}
handle = NULL;
} while (0);
if (handle != NULL)
{
handle = NULL;
}
printf("exit.\n");
return 0;
}