[go: nahoru, domu]

Skip to content

Commit

Permalink
improved output table formatting; removed "before" bytes
Browse files Browse the repository at this point in the history
...because it's normal to have three leading 0 bytes in the first PmMessage
that contains the initial sysex byte.
  • Loading branch information
jimm committed Aug 24, 2021
1 parent 8e7d3bb commit 3bfa911
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
7 changes: 0 additions & 7 deletions src/kronos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ void Kronos::read_sysex() {
SysexState state;
time_t start = time(0);
PmError err;
bool logged_bytes_before_sysex = false;

state = waiting;
clog << "waiting for sysex" << endl;
Expand Down Expand Up @@ -134,12 +133,6 @@ void Kronos::read_sysex() {
state = received;
clog << "sysex end seen" << endl;
}

if (state == waiting && !logged_bytes_before_sysex) {
clog << "dropping data before sysex, first byte dropped "
<< setw(2) << setfill('0') << hex << (unsigned int)b << endl;
logged_bytes_before_sysex = true;
}
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/set_list_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,21 @@ void SetListFile::table_headers(const char * const h1, const char * const h2) {

void SetListFile::table_row(const char * const col1, const char * const col2) {
_out << "| " << setw(COL1_DATA_WIDTH) << col1
<< " | " << setw(COL2_DATA_WIDTH) << col2
<< " |" << endl;
<< " | " << setw(COL2_DATA_WIDTH) << left << col2
<< " |" << endl;
}

void SetListFile::table_row(const char * const col1, const string &col2) {
fprintf(stderr, "col1 %s, col2 %s\n", col1, col2.c_str()); // DEBUG
_out << "| " << setw(COL1_DATA_WIDTH) << col1
<< " | " << setw(COL2_DATA_WIDTH) << col2
<< " |" << endl;
<< " | " << setw(COL2_DATA_WIDTH) << left << col2
<< " |" << endl;
}

void SetListFile::table_row(const char * const col1, int value) {
_out << "| " << setw(COL1_DATA_WIDTH) << col1
<< " | " << setw(COL2_DATA_WIDTH) << value
<< " |" << endl;
<< " | " << setw(COL2_DATA_WIDTH) << left << value
<< " |" << endl;
}

void SetListFile::table_end() {
Expand Down

0 comments on commit 3bfa911

Please sign in to comment.