|
|
@ -135,7 +135,7 @@ void SlugsHilSim::readDatagram(void){ |
|
|
|
|
|
|
|
|
|
|
|
sendMessageToSlugs(); |
|
|
|
sendMessageToSlugs(); |
|
|
|
|
|
|
|
|
|
|
|
commandToSimulink(); |
|
|
|
commandDatagramToSimulink(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ui->ed_count->setText(QString::number(count++)); |
|
|
|
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();
|
|
|
|
//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; |
|
|
|
QByteArray data; |
|
|
|
data.resize(22); |
|
|
|
data.resize(22); |
|
|
|
|
|
|
|
|
|
|
|
unsigned char i=0; |
|
|
|
unsigned char i=0; |
|
|
|
setUInt16ToDatagram(data, &i, 1);//pwdC->dt_c);
|
|
|
|
setUInt16ToDatagram(data, &i, rand());//pwdC->dt_c);
|
|
|
|
setUInt16ToDatagram(data, &i, 2);//pwdC->dla_c);
|
|
|
|
setUInt16ToDatagram(data, &i, rand());//pwdC->dla_c);
|
|
|
|
setUInt16ToDatagram(data, &i, 3);//pwdC->dra_c);
|
|
|
|
setUInt16ToDatagram(data, &i, rand());//pwdC->dra_c);
|
|
|
|
setUInt16ToDatagram(data, &i, 4);//pwdC->dr_c);
|
|
|
|
setUInt16ToDatagram(data, &i, rand());//pwdC->dr_c);
|
|
|
|
setUInt16ToDatagram(data, &i, 5);//pwdC->dle_c);
|
|
|
|
setUInt16ToDatagram(data, &i, rand());//pwdC->dle_c);
|
|
|
|
setUInt16ToDatagram(data, &i, 6);//pwdC->dre_c);
|
|
|
|
setUInt16ToDatagram(data, &i, rand());//pwdC->dre_c);
|
|
|
|
setUInt16ToDatagram(data, &i, 7);//pwdC->dlf_c);
|
|
|
|
setUInt16ToDatagram(data, &i, rand());//pwdC->dlf_c);
|
|
|
|
setUInt16ToDatagram(data, &i, 8);//pwdC->drf_c);
|
|
|
|
setUInt16ToDatagram(data, &i, rand());//pwdC->drf_c);
|
|
|
|
setUInt16ToDatagram(data, &i, 9);//pwdC->aux1);
|
|
|
|
setUInt16ToDatagram(data, &i, rand());//pwdC->aux1);
|
|
|
|
setUInt16ToDatagram(data, &i, 10);//pwdC->aux2);
|
|
|
|
setUInt16ToDatagram(data, &i, rand());//pwdC->aux2);
|
|
|
|
setUInt16ToDatagram(data, &i, 11); |
|
|
|
setUInt16ToDatagram(data, &i, rand());//value default
|
|
|
|
|
|
|
|
|
|
|
|
txSocket->writeDatagram(data, QHostAddress::Broadcast, ui->ed_txPort->text().toInt()); |
|
|
|
txSocket->writeDatagram(data, QHostAddress::Broadcast, ui->ed_txPort->text().toInt()); |
|
|
|
} |
|
|
|
} |
|
|
|