-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QGCCameraControl: allow to read camera information xml via ftp #10094
QGCCameraControl: allow to read camera information xml via ftp #10094
Conversation
src/Camera/QGCCameraControl.cc
Outdated
@@ -2020,6 +2036,26 @@ QGCCameraControl::_downloadFinished() | |||
//reply->deleteLater(); | |||
} | |||
|
|||
void QGCCameraControl::_ftpDownloadComplete(const QString& fileName, const QString& errorMsg) | |||
{ | |||
qCDebug(CameraControlLog) << "QGCCameraControl::_ftpDownloadComplete fileName:errorMsg" << fileName << errorMsg; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to set class and function name, that can be configured via environment variable:
https://doc.qt.io/qt-5/debug.html
src/Vehicle/FTPManager.cc
Outdated
@@ -72,7 +72,11 @@ bool FTPManager::download(const QString& fromURI, const QString& toDir) | |||
} | |||
lastDirSlashIndex++; // move past slash | |||
|
|||
_downloadState.fileName = _downloadState.fullPathOnVehicle.right(_downloadState.fullPathOnVehicle.size() - lastDirSlashIndex); | |||
if (fileName.size() == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fileName.isEmpty()
src/Vehicle/FTPManager.cc
Outdated
@@ -641,6 +645,8 @@ bool FTPManager::_parseURI(const QString& uri, QString& parsedURI, uint8_t& comp | |||
if (!ok) { | |||
qCWarning(FTPManagerLog) << "Incorrect format for component id" << uri; | |||
return false; | |||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont need else after return.
src/Vehicle/FTPManager.cc
Outdated
@@ -641,6 +645,8 @@ bool FTPManager::_parseURI(const QString& uri, QString& parsedURI, uint8_t& comp | |||
if (!ok) { | |||
qCWarning(FTPManagerLog) << "Incorrect format for component id" << uri; | |||
return false; | |||
} else { | |||
qCDebug(FTPManagerLog) << "Found compId:" << (int)compId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to cast it to int.
@patrickelectric Thanks for your review. I applied your suggested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code appears to be correct
thanks for the contribution @dayjaby |
This PR heavily reuses the MAVLink FTP capabilities already present in QGroundControl and allows to specify camera definition URLs in
CAMERA_INFORMATION
with the mftp prefix, likemftp://[;comp=100]infos/camera_info.xml
.Tested it against the MAVSDK camera manager example PR: mavlink/MAVSDK#1655
TODO:
mftp://infos/camera_info.xml