Ignore:
Timestamp:
02/16/12 14:44:55 (13 years ago)
Author:
ogrimm
Message:
Updated Edd for history plotting of more complex arrays
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/Evidence/Evidence.cc

    r12892 r12894  
    421421  }
    422422
    423   // Simplify format "?;1" to "?"
    424   if (strlen(Format)==3 && Format[2]=='1') Format[1] = '\0';
    425  
    426   // Structure: print hex representation
    427   if (strlen(Format) != 1) {
    428         for (int i=0; i<Size; i++) {
    429           Text << setw(2) << hex << *((char *) Data + i) << " ";
    430         }
    431         return Text.str();
    432   }
    433 
    434423  // String if format "C" and terminated with \0
    435424  if (strcmp(Format, "C") == 0 && Size > 0 && *((char *) Data+Size-1)=='\0') {
    436425        return string((char *) Data);
    437426  }
    438 
     427 
     428  // Check if format is made of identical component types
     429  vector<string> Components = Tokenize(Format, ";");
     430 
     431  for (unsigned int i=0; i<Components.size(); i++) {
     432        if (Components[i].empty()) return string();
     433
     434        // Print hex representation if format complex
     435        if (Components[i][0] != Components[0][0]) {
     436          for (int i=0; i<Size; i++) {
     437                Text << setw(2) << hex << *((char *) Data + i) << " ";
     438          }
     439          return Text.str();
     440        }
     441  }
     442 
    439443  // Number array
    440444  int ElementSize;
     445
    441446  switch (toupper(*Format)) {
    442447    case 'B':
Note: See TracChangeset for help on using the changeset viewer.