#include "binning.h"

Binning::Binning() {
  this->row = 0;
  this->collum = 0;
}

bool Binning::setBinning(QByteArray &data) {
  if (data.length() == 2) {
    this->row = static_cast<uint8_t>(data[0]);
    this->collum = static_cast<uint8_t>(data[1]);
    return true;
  }
  return false;
}

QTextStream &operator<<(QTextStream &out, Binning bin) {
  out << "{\n";
  out << tab << CMOSBinRowText << ": " << bin.row << endValue;
  out << tab << CMOSBinColText << ": " << bin.collum << endValue;
  out << "}";
  return out;
}
