From c26fae0bf6241577b6482de4f458ea05cbf6f20b Mon Sep 17 00:00:00 2001 From: Alejandro Date: Fri, 7 Jan 2011 11:57:22 -0600 Subject: [PATCH] HILSIM ready to test --- src/ui/SlugsHilSim.cc | 30 ++++++++++++++++-------------- src/ui/SlugsHilSim.h | 2 +- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/ui/SlugsHilSim.cc b/src/ui/SlugsHilSim.cc index c22f6c094..f22e81083 100644 --- a/src/ui/SlugsHilSim.cc +++ b/src/ui/SlugsHilSim.cc @@ -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(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()); } diff --git a/src/ui/SlugsHilSim.h b/src/ui/SlugsHilSim.h index 85b11d200..11326ee9a 100644 --- a/src/ui/SlugsHilSim.h +++ b/src/ui/SlugsHilSim.h @@ -141,7 +141,7 @@ private: void sendMessageToSlugs(); - void commandToSimulink(); + void commandDatagramToSimulink(); }; -- 2.22.0