Esempio n. 1
0
/**
 * Returns a string representing the coding of the state
 *
 * @param type If 'Binary' a binary string is returned, otherwise an integer string.
 * @returns The resulting string
 */
QString State::getCodeStr(int type/*=-1*/)
{
  Convert conv;
  QString res;
  int stateCodeSize;
  stateCodeSize=machine->getNumEncodingBits();

  if (type==-1)
    type = machine->getType();

  switch (type)
  {
    case Binary:
      res = conv.intToBinStr(code, stateCodeSize);
      return res;
    default:
      res.setNum(code);
      return res;
  }
}