mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 10:30:41 +02:00
wip
This commit is contained in:
parent
bd895148ea
commit
f3744a10c6
@ -1279,6 +1279,11 @@ std::vector<char> DetectorImpl::readProgrammingFile(const std::string &fname) {
|
|||||||
"Program FPGA: Could not open source file for programming: " +
|
"Program FPGA: Could not open source file for programming: " +
|
||||||
fname);
|
fname);
|
||||||
}
|
}
|
||||||
|
size_t srcSize = ftell(src);
|
||||||
|
if (srcSize <= 0) {
|
||||||
|
throw RuntimeError("Program FPGA: Could not get length of source file");
|
||||||
|
}
|
||||||
|
rewind(src);
|
||||||
|
|
||||||
// create temp destination file
|
// create temp destination file
|
||||||
char destfname[] = "/tmp/SLS_DET_MCB.XXXXXX";
|
char destfname[] = "/tmp/SLS_DET_MCB.XXXXXX";
|
||||||
@ -1314,15 +1319,11 @@ std::vector<char> DetectorImpl::readProgrammingFile(const std::string &fname) {
|
|||||||
// Swap bits from source and write to dest
|
// Swap bits from source and write to dest
|
||||||
while (!feof(src)) {
|
while (!feof(src)) {
|
||||||
// print progress
|
// print progress
|
||||||
if (isPof) {
|
printf("%d%%\r", (int)(((double)(dstFilePos) / srcSize) * 100));
|
||||||
printf("pofFooterOfst:%d, dstfilepos:%d %d%%\r", pofFooterOfst,
|
fflush(stdout);
|
||||||
dstFilePos,
|
// pof: exit early to discard footer
|
||||||
(int)(((double)(dstFilePos) / pofFooterOfst) * 100));
|
if (isPof && dstFilePos >= pofFooterOfst) {
|
||||||
fflush(stdout);
|
break;
|
||||||
// pof: exit early to discard footer
|
|
||||||
if (dstFilePos >= pofFooterOfst) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// read source
|
// read source
|
||||||
int s = fgetc(src);
|
int s = fgetc(src);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user