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 46 47 48 49 50 51
|
VSIDRIVER_API int CamSaveImageSetInC(const int numFrames, char fname[])
{
//Memory Allocation for the Header
char Header[120][120];
// Opens a file and writes a file header
HRESULT hr = CamStartImageSet(numFrames, fname);
if(hr!=0)
{
CamEndImageSet();
return hr;
}
// This loop records header info for each frame
for (int n = 0; n < numFrames; n++)
{
HRESULT hr = CamGetImageSet(Header[n]);
camStatus.numCounts = n+1;
}
//Takes image and header sets and writes them to separate files
if (hr == 0)
{
hr = fwrite(Header, 2, numFrames*120, Hd);
};
// Closes the files
return CamEndImageSet();;
}
VSIDRIVER_API int CamGetImageSet(char Header[])
{
// A portion of the code I removed stored the info in pMemBuffer
InfoImageStruct* pInfoImage = ((InfoImageStruct*)m_sSharedMem[INF_SHARED_MEM].pMemBuffer);
// Here is how I currently am able to write to Header
sprintf_s(Header, 120, "Preset:%d; ITime:%7.3f; ImageTime:%I64u; Count:%I64u; T:%.1f; T1:%.1f; T2:%.1f; T3:%.1f; T4:%.1f\n",
pInfoImage->wMultiItNumber, //preset
pInfoImage->fIntegrationTime,
pInfoImage->qwImageTime,
pInfoImage->qwImageCounter,
pInfoImage->fDetectorTemp,
pInfoImage->fSensorTemp[0],
pInfoImage->fSensorTemp[1],
pInfoImage->fSensorTemp[2],
pInfoImage->fSensorTemp[3]);
return 0;
}
|