diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index a77f6aec582c2009e1e6358bc12a02742b6db742..bb4ccca20c34cf3f9cb7437ad16b546b9330f801 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -535,7 +535,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) { mavlink_global_position_int_t pos; mavlink_msg_global_position_int_decode(&message, &pos); - quint64 time = QGC::groundTimeUsecs()/1000; + quint64 time = getUnixTime(); latitude = pos.lat/(double)1E7; longitude = pos.lon/(double)1E7; altitude = pos.alt/1000.0; @@ -562,7 +562,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) case MAVLINK_MSG_ID_GLOBAL_POSITION: { mavlink_global_position_t pos; mavlink_msg_global_position_decode(&message, &pos); - quint64 time = QGC::groundTimeUsecs()/1000; + quint64 time = getUnixTime(); latitude = pos.lat; longitude = pos.lon; altitude = pos.alt; @@ -845,7 +845,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) case MAVLINK_MSG_ID_SERVO_OUTPUT_RAW: { mavlink_servo_output_raw_t servos; mavlink_msg_servo_output_raw_decode(&message, &servos); - quint64 time = getUnixTime(0); + quint64 time = getUnixTime(); emit valueChanged(uasId, "servo #1", "us", servos.servo1_raw, time); emit valueChanged(uasId, "servo #2", "us", servos.servo2_raw, time); emit valueChanged(uasId, "servo #3", "us", servos.servo3_raw, time); @@ -939,7 +939,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) case MAVLINK_MSG_ID_NAV_FILTER_BIAS: { mavlink_nav_filter_bias_t bias; mavlink_msg_nav_filter_bias_decode(&message, &bias); - quint64 time = MG::TIME::getGroundTimeNow(); + quint64 time = getUnixTime(); emit valueChanged(uasId, "b_f[0]", "raw", bias.accel_0, time); emit valueChanged(uasId, "b_f[1]", "raw", bias.accel_1, time); emit valueChanged(uasId, "b_f[2]", "raw", bias.accel_2, time); @@ -985,7 +985,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) if (!unknownPackets.contains(message.msgid)) { unknownPackets.append(message.msgid); QString errString = tr("UNABLE TO DECODE MESSAGE NUMBER %1").arg(message.msgid); - GAudioOutput::instance()->say(errString+tr(", please check the communication console for details.")); + GAudioOutput::instance()->say(errString+tr(", please check console for details.")); emit textMessageReceived(uasId, message.compid, 255, errString); std::cout << "Unable to decode message from system " << std::dec << static_cast(message.sysid) << " with message id:" << static_cast(message.msgid) << std::endl; //qDebug() << std::cerr << "Unable to decode message from system " << std::dec << static_cast(message.acid) << " with message id:" << static_cast(message.msgid) << std::endl; diff --git a/src/ui/QGCParamWidget.cc b/src/ui/QGCParamWidget.cc index 7c5bde8afe9874155d41aa74034932c1e3d6b58c..af87c7ed15da2fb4245906579d6a82777b85d69a 100644 --- a/src/ui/QGCParamWidget.cc +++ b/src/ui/QGCParamWidget.cc @@ -416,6 +416,7 @@ void QGCParamWidget::addParameter(int uas, int component, QString parameterName, */ void QGCParamWidget::requestParameterList() { + if (!mav) return; // FIXME This call does not belong here // Once the comm handling is moved to a new // Param manager class the settings can be directly @@ -487,6 +488,7 @@ void QGCParamWidget::parameterItemChanged(QTreeWidgetItem* current, int column) void QGCParamWidget::saveParameters() { + if (!mav) return; QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), "./parameters.txt", tr("Parameter File (*.txt)")); QFile file(fileName); if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { @@ -520,6 +522,7 @@ void QGCParamWidget::saveParameters() void QGCParamWidget::loadParameters() { + if (!mav) return; QString fileName = QFileDialog::getOpenFileName(this, tr("Load File"), ".", tr("Parameter file (*.txt)")); QFile file(fileName); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) @@ -749,11 +752,13 @@ void QGCParamWidget::setParameters() */ void QGCParamWidget::writeParameters() { + if (!mav) return; mav->writeParametersToStorage(); } void QGCParamWidget::readParameters() { + if (!mav) return; mav->readParametersFromStorage(); }