Commit c26fae0b authored by Alejandro's avatar Alejandro

HILSIM ready to test

parent 9ec89231
......@@ -135,7 +135,7 @@ void SlugsHilSim::readDatagram(void){
sendMessageToSlugs();
commandToSimulink();
commandDatagramToSimulink();
}
ui->ed_count->setText(QString::number(count++));
......@@ -311,26 +311,28 @@ void SlugsHilSim::sendMessageToSlugs()
}
void SlugsHilSim::commandToSimulink()
void SlugsHilSim::commandDatagramToSimulink()
{
//mavlink_pwm_commands_t* pwdC = (static_cast<SlugsMAV*>(activeUas))->getPwmCommands();
uint16_t j=10;
//mavlink_pwm_commands_t* pwdC;
//pwdC->dt_c = 1;
QByteArray data;
data.resize(22);
unsigned char i=0;
setUInt16ToDatagram(data, &i, 1);//pwdC->dt_c);
setUInt16ToDatagram(data, &i, 2);//pwdC->dla_c);
setUInt16ToDatagram(data, &i, 3);//pwdC->dra_c);
setUInt16ToDatagram(data, &i, 4);//pwdC->dr_c);
setUInt16ToDatagram(data, &i, 5);//pwdC->dle_c);
setUInt16ToDatagram(data, &i, 6);//pwdC->dre_c);
setUInt16ToDatagram(data, &i, 7);//pwdC->dlf_c);
setUInt16ToDatagram(data, &i, 8);//pwdC->drf_c);
setUInt16ToDatagram(data, &i, 9);//pwdC->aux1);
setUInt16ToDatagram(data, &i, 10);//pwdC->aux2);
setUInt16ToDatagram(data, &i, 11);
setUInt16ToDatagram(data, &i, rand());//pwdC->dt_c);
setUInt16ToDatagram(data, &i, rand());//pwdC->dla_c);
setUInt16ToDatagram(data, &i, rand());//pwdC->dra_c);
setUInt16ToDatagram(data, &i, rand());//pwdC->dr_c);
setUInt16ToDatagram(data, &i, rand());//pwdC->dle_c);
setUInt16ToDatagram(data, &i, rand());//pwdC->dre_c);
setUInt16ToDatagram(data, &i, rand());//pwdC->dlf_c);
setUInt16ToDatagram(data, &i, rand());//pwdC->drf_c);
setUInt16ToDatagram(data, &i, rand());//pwdC->aux1);
setUInt16ToDatagram(data, &i, rand());//pwdC->aux2);
setUInt16ToDatagram(data, &i, rand());//value default
txSocket->writeDatagram(data, QHostAddress::Broadcast, ui->ed_txPort->text().toInt());
}
......
......@@ -141,7 +141,7 @@ private:
void sendMessageToSlugs();
void commandToSimulink();
void commandDatagramToSimulink();
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment