mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 23:10:02 +02:00
wip
This commit is contained in:
parent
8cc0804f99
commit
8e58d1907d
@ -1293,7 +1293,7 @@ std::vector<char> DetectorImpl::readProgrammingFile(const std::string &fname) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert src to dst rawbin
|
// convert src to dst rawbin
|
||||||
LOG(logINFOBLUE) << "Converting " << fname << " to " << destfname;
|
LOG(logDEBUG1) << "Converting " << fname << " to " << destfname;
|
||||||
{
|
{
|
||||||
constexpr int pofNumHeaderBytes = 0x11C;
|
constexpr int pofNumHeaderBytes = 0x11C;
|
||||||
constexpr int pofFooterOfst = 0x1000000;
|
constexpr int pofFooterOfst = 0x1000000;
|
||||||
@ -1313,6 +1313,12 @@ 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
|
||||||
|
LOG(logINFO,
|
||||||
|
("Converting program to rawbin :%d%%\r",
|
||||||
|
(int)(((double)(pofFooterOfst - dstFilePos) / pofFooterOfst) *
|
||||||
|
100)));
|
||||||
|
fflush(stdout);
|
||||||
// pof: exit early to discard footer
|
// pof: exit early to discard footer
|
||||||
if (isPof && dstFilePos >= pofFooterOfst) {
|
if (isPof && dstFilePos >= pofFooterOfst) {
|
||||||
break;
|
break;
|
||||||
@ -1342,7 +1348,7 @@ std::vector<char> DetectorImpl::readProgrammingFile(const std::string &fname) {
|
|||||||
if (close(dst) != 0) {
|
if (close(dst) != 0) {
|
||||||
throw RuntimeError("Program FPGA: Could not close destination file");
|
throw RuntimeError("Program FPGA: Could not close destination file");
|
||||||
}
|
}
|
||||||
LOG(logINFOBLUE) << "File has been converted to " << destfname;
|
LOG(logDEBUG1) << "File has been converted to " << destfname;
|
||||||
|
|
||||||
// loading dst file to memory
|
// loading dst file to memory
|
||||||
FILE *fp = fopen(destfname, "r");
|
FILE *fp = fopen(destfname, "r");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user