General utility function.
Returns the file import progress .Note: this function requires GTDIO6x-FIT license.
GtDio6xFileImportGetProgress (phHandle, bCancel, pszStatus, nStatusMaxLen, pnStatus)
Name |
Type |
Comments |
phHandle |
PHANDLE |
A HANDLE to the file import object that was returned by GtDio6xFileImport API, in order to monitor the progress of the import file process. |
bCancel |
BOOL |
If TRUE terminates the import process. |
pszStatus |
PSTR |
Buffer to contain the returned status string (null terminated). This string will be empty while the file import is in progress (based on pnStatus parameter). When the file import is done, if the file import finish successfully this string will be empty or in case of a warning it will contain the warning message. In case of an error (pnStatus is negative), it will contain the error message. |
nStatusMaxLen |
SHORT |
Size of the buffer to contain the status string. |
pnStatus |
PSHORT |
When the file import is in progress pnStatus returns the percentage that was completed, from 1% to 100%. When file import is complete it returns 0 on success or <0 on failure. |
The function can only be used after the user called GtDio6xFileImport and specified bWait =FALSE.
The following example converts a STIL file to a GX5296 with Real time compare file and monitoring the progress (bWait=FALSE):
SHORT nStatus;
CHAR szStatus[512];
HANDLE hHandle;
GtDio6xFileImport (“InputStilFile.stil”, “OutputDioFile.dio6x”, GTDIO6X_BOARD_TYPE_GX5296, TRUE, NULL, 0, FALSE, &hHandle, szStatus, sizeof (szStatus), &nStatus);
// Monitor the import file process
while (nStatus>=0)
{
GtDio6xFileImportGetProgress(hHandle, FALSE, szStatus, sizeof (szStatus), &nStatus);
if (nStatus>0)
printf(“Progress = %i”, (int) nStatus); // continue
else
break;
// wait for import to finish or time out every 250ms without consuming the CPU
WaitForSingleObject(hHandle, 250);
}
printf(szStatus); // print complete (nStatus=0), warning, errrors
GtDio6xFileImportPanel, GtDio6xFileImport, GtDio6xGetErrorString