1 #include "BsmdRawData.h"
25 BsmdRawData :: ~BsmdRawData() {
36 void BsmdRawData :: clear() {
46 int BsmdRawData ::headSize()
const{
47 return nBlock>0 ? head->GetSize()/ nBlock: 0;
52 int BsmdRawData ::dataBlockSize()
const{
53 return nBlock>0 ?
data->GetSize()/ nBlock: 0;
58 void BsmdRawData :: print(
int k, FILE *fd)
const{
59 fprintf(fd,
"BsmdRawData:: print() \n");
60 fprintf(fd,
"used %.0f blocks\n", used->GetSum());
62 unsigned char *capsA=(
unsigned char*)caps->GetArray();
63 unsigned short *usedA=(
unsigned short *)used->GetArray();
65 for(i=0;i<used->GetSize();i++) {
66 if(!usedA[i])
continue;
67 printf(
"i=%d used=%d caps=%d\n",i,usedA[i],capsA[i]);
71 int bSize=dataBlockSize();
72 fprintf(fd,
"No. of nonzero blocks %d, size: heder=%d, dataBlock=%d\n", nBlock,hSize,bSize);
77 unsigned short *headA=(
unsigned short *)head->GetArray();
78 unsigned short *dataA=(
unsigned short *)
data->GetArray();
81 for(ib=0;ib<nBlock;ib++) {
83 printf(
"\n======\nSMD BANK=%d header size=%d\n",ib,hSize);
84 for(j = 0;j<hSize;j++) {
85 if(j%16==0) printf(
"\n");
86 printf(
"0x%04x ",headA[ib*hSize+j]);
91 printf(
"\n======\nSMD BANK=%d data size=%d\n",ib,bSize);
92 for(j = 0;j<bSize;j++) {
93 if(j%16==0) printf(
"\n");
94 printf(
"0x%04x ",dataA[ib*bSize+j]);