Esempio n. 1
0
bool RobotModeData_V1_X::parseWith(BinParser& bp)
{
  if (!bp.checkSize<RobotModeData_V1_X>())
    return false;

  SharedRobotModeData::parseWith(bp);

  bp.parse(robot_mode);
  bp.parse(speed_fraction);

  return true;
}
Esempio n. 2
0
bool RobotModeData_V3_0__1::parseWith(BinParser& bp)
{
  if (!bp.checkSize<RobotModeData_V3_0__1>())
    return false;

  SharedRobotModeData::parseWith(bp);

  bp.parse(robot_mode);
  bp.parse(control_mode);
  bp.parse(target_speed_fraction);
  bp.parse(speed_scaling);

  return true;
}
Esempio n. 3
0
bool SharedRobotModeData::parseWith(BinParser& bp)
{
  bp.parse(timestamp);
  bp.parse(physical_robot_connected);
  bp.parse(real_robot_enabled);
  bp.parse(robot_power_on);
  bp.parse(emergency_stopped);
  bp.parse(protective_stopped);
  bp.parse(program_running);
  bp.parse(program_paused);
  return true;
}
Esempio n. 4
0
bool RobotModeData_V3_5::parseWith(BinParser& bp)
{
  if (!bp.checkSize<RobotModeData_V3_5>())
    return false;

  RobotModeData_V3_2::parseWith(bp);

  bp.parse(unknown_internal_use);

  return true;
}
Esempio n. 5
0
bool RobotModeData_V3_2::parseWith(BinParser& bp)
{
  if (!bp.checkSize<RobotModeData_V3_2>())
    return false;

  RobotModeData_V3_0__1::parseWith(bp);

  bp.parse(target_speed_fraction_limit);

  return true;
}
Esempio n. 6
0
File: as.cpp Progetto: ipeet/dcpu16
int disassemble(string &inFile, istream &in, ostream &out) {
  /* Parse the binary */
  BinParser p;
  try {
    p.parse(in);
  } catch (BinParser::Exception ex) {
    cerr << inFile << ": " << ex << endl;
    return -1;
  }

  /* Write the assembly */
  AsmWriter w (p.instructions(), map<string, vector<Instruction>::size_type> ());
  try {
    w.write(out);
  } catch (AsmWriter::Exception ex) {
    cerr << ex.msg << endl;
    return -1;
  } catch (BinWriter::Exception ex) {
    cerr << ex.msg << endl;
    return -1;
  }

  return 0;
}