This is an example of how to use the SequenceInterface class.
#include "stdafx.h"
#include "BiSimplePlusPlus.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
CWinApp theApp;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
if (!AfxWinInit(::GetModuleHandle(
BFNULL),
BFNULL, ::GetCommandLine(), 0))
{
_tprintf(_T("Fatal Error: MFC initialization failed\n"));
nRetCode = 1;
}
else
{
int hDspSrf = -1;
MSG Msg;
char ch;
BFU32 BoardType, BrdNum, Init, SerNum;
if( DoBrdOpenDialog(BOD_BRD_NUM_NON_FAMILY|BOD_HIDEJUSTOPEN, FF_BITFLOW_MODERN, &BoardType, &BrdNum, &Init, &SerNum) )
{
return -1;
}
try
{
cout << "Creating instance of sequence interface." << endl;
cout << "Starting Acquisition" << endl;
cout << "Waiting for sequence to be acquired" << endl;
{
cout << "Couldn't create display surface" << endl;
return 1;
}
if(!DispSurfGetBitmap(hDspSrf, &bitmap))
{
cout << "No display surface available" << endl;
return 1;
}
DispSurfOffset(hDspSrf,100,100);
cout << "Press L to loop continuously, X to exit, and any other key"
" for next frame." << endl;
for(i=0; i<numBuffers; i++)
{
cout << "Displaying frame " << (int) i << "\r";
if(!DispSurfFormatBlit(hDspSrf, pBufferArray[i],
{
cout << "Could not update the display surface" << endl;
return 1;
}
if(!LoopContin)
{
while(!BFkbhit())
{
if(PeekMessage(&Msg,
BFNULL,0,0,PM_REMOVE))
DispatchMessage(&Msg);
else
Sleep(10);
}
ch = BFgetch();
if(toupper(ch) == 'X')
i = numBuffers;
else if(toupper(ch) == 'L')
}
else
{
Sleep(50);
}
if(PeekMessage(&Msg,
BFNULL,0,0,PM_REMOVE))
DispatchMessage(&Msg);
}
cout << "Saving sequence to disk." << endl;
BFCHAR FileName[128] =
"BiSimplePlusPlus.tif";
board.
writeSeqBuffer(FileName,
sizeof(FileName), 0, numBuffers, WriteOptions);
cout << "\nPress Any Key to Continue." << endl;
while(!BFkbhit())
{
if(PeekMessage(&Msg,
BFNULL,0,0,PM_REMOVE))
DispatchMessage(&Msg);
else
Sleep(0);
}
if (BFkbhit()) BFgetch();
DispSurfClose(hDspSrf);
}
{
nRetCode = 1;
}
}
return nRetCode;
}