示例#1
0
MusicShape::MusicShape(int p1, int p2, float radius, QObject *parent) :
    QObject(parent)
{
    setParamMax(2, 3, -1);
    setParam1(p1);
    setParam2(p2);

//    m_radius = radius;
    m_radius = .15f;
}
AP_MavlinkCommand::AP_MavlinkCommand(const mavlink_waypoint_t & cmd) :
    _data(k_commands + cmd.seq), _seq(cmd.seq) {
    setCommand(MAV_CMD(cmd.command));
    setAutocontinue(cmd.autocontinue);
    setFrame(MAV_FRAME(cmd.frame));
    setParam1(cmd.param1);
    setParam2(cmd.param2);
    setParam3(cmd.param3);
    setParam4(cmd.param4);
    setX(cmd.x);
    setY(cmd.y);
    setZ(cmd.z);
    save();

    // reload home if sent, home must be a global waypoint
    if ( (cmd.seq == 0) && (cmd.frame == MAV_FRAME_GLOBAL)) home.load();

    Serial.println("============================================================");
    Serial.println("storing new command from mavlink_waypoint_t");
    Serial.print("key: ");
    Serial.println(_data.key(),DEC);
    Serial.print("number: ");
    Serial.println(cmd.seq,DEC);
    Serial.print("command: ");
    Serial.println(getCommand());
    Serial.print("autocontinue: ");
    Serial.println(getAutocontinue(),DEC);
    Serial.print("frame: ");
    Serial.println(getFrame(),DEC);
    Serial.print("1000*param1: ");
    Serial.println(int(1000*getParam1()),DEC);
    Serial.print("1000*param2: ");
    Serial.println(int(1000*getParam2()),DEC);
    Serial.print("1000*param3: ");
    Serial.println(int(1000*getParam3()),DEC);
    Serial.print("1000*param4: ");
    Serial.println(int(1000*getParam4()),DEC);
    Serial.print("1000*x0: ");
    Serial.println(int(1000*cmd.x),DEC);
    Serial.print("1000*y0: ");
    Serial.println(int(1000*cmd.y),DEC);
    Serial.print("1000*z0: ");
    Serial.println(int(1000*cmd.z),DEC);
    Serial.print("1000*x: ");
    Serial.println(int(1000*getX()),DEC);
    Serial.print("1000*y: ");
    Serial.println(int(1000*getY()),DEC);
    Serial.print("1000*z: ");
    Serial.println(int(1000*getZ()),DEC);

    load();

    Serial.print("1000*x1: ");
    Serial.println(int(1000*getX()),DEC);
    Serial.print("1000*y1: ");
    Serial.println(int(1000*getY()),DEC);
    Serial.print("1000*z1: ");
    Serial.println(int(1000*getZ()),DEC);
    Serial.println("============================================================");
    Serial.flush();
}