QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
FTPController Class Reference

QML-facing controller for MAVLink FTP operations. More...

#include <FTPController.h>

+ Inheritance diagram for FTPController:
+ Collaboration diagram for FTPController:

Signals

void busyChanged ()
 
void activeOperationChanged ()
 
void progressChanged ()
 
void errorStringChanged ()
 
void currentPathChanged ()
 
void directoryEntriesChanged ()
 
void lastDownloadFileChanged ()
 
void lastUploadTargetChanged ()
 
void downloadComplete (const QString &filePath, const QString &error)
 
void uploadComplete (const QString &remotePath, const QString &error)
 
void deleteComplete (const QString &remotePath, const QString &error)
 
void extractingChanged ()
 
void extractionProgressChanged ()
 
void extractionComplete (const QString &outputDir, const QString &error)
 

Public Member Functions

 FTPController (QObject *parent=nullptr)
 
bool busy () const
 
bool listInProgress () const
 
bool downloadInProgress () const
 
bool uploadInProgress () const
 
bool deleteInProgress () const
 
float progress () const
 
QString errorString () const
 
QString currentPath () const
 
QStringList directoryEntries () const
 
QString lastDownloadFile () const
 
QString lastUploadTarget () const
 
bool lastDownloadIsArchive () const
 
bool extracting () const
 
float extractionProgress () const
 
QGCArchiveModelarchiveModel () const
 
Q_INVOKABLE bool listDirectory (const QString &uri, int componentId=MAV_COMP_ID_AUTOPILOT1)
 
Q_INVOKABLE bool downloadFile (const QString &uri, const QString &localDir, const QString &fileName=QString(), int componentId=MAV_COMP_ID_AUTOPILOT1)
 
Q_INVOKABLE bool uploadFile (const QString &localFile, const QString &uri, int componentId=MAV_COMP_ID_AUTOPILOT1)
 
Q_INVOKABLE bool deleteFile (const QString &uri, int componentId=MAV_COMP_ID_AUTOPILOT1)
 
Q_INVOKABLE void cancelActiveOperation ()
 
Q_INVOKABLE bool browseArchive (const QString &archivePath)
 
Q_INVOKABLE bool extractArchive (const QString &archivePath, const QString &outputDir=QString())
 
Q_INVOKABLE void cancelExtraction ()
 Cancel an in-progress extraction.
 

Detailed Description

QML-facing controller for MAVLink FTP operations.

Definition at line 19 of file FTPController.h.

Constructor & Destructor Documentation

◆ FTPController()

Member Function Documentation

◆ activeOperationChanged

void FTPController::activeOperationChanged ( )
signal

◆ archiveModel()

QGCArchiveModel * FTPController::archiveModel ( ) const
inline

Definition at line 58 of file FTPController.h.

◆ browseArchive()

bool FTPController::browseArchive ( const QString &  archivePath)

Browse the contents of a downloaded archive file

Parameters
archivePathPath to the archive file (use lastDownloadFile after download)
Returns
true if archive was opened successfully

Definition at line 349 of file FTPController.cc.

References QGCCompression::isArchiveFile(), and QGCArchiveModel::setArchivePath().

◆ busy()

bool FTPController::busy ( ) const
inline

Definition at line 44 of file FTPController.h.

◆ busyChanged

void FTPController::busyChanged ( )
signal

◆ cancelActiveOperation()

void FTPController::cancelActiveOperation ( )

◆ cancelExtraction()

void FTPController::cancelExtraction ( )

Cancel an in-progress extraction.

Definition at line 417 of file FTPController.cc.

References QGCCompressionJob::cancel().

◆ currentPath()

QString FTPController::currentPath ( ) const
inline

Definition at line 51 of file FTPController.h.

◆ currentPathChanged

void FTPController::currentPathChanged ( )
signal

Referenced by listDirectory().

◆ deleteComplete

void FTPController::deleteComplete ( const QString &  remotePath,
const QString &  error 
)
signal

Referenced by deleteFile(), and FTPController().

◆ deleteFile()

bool FTPController::deleteFile ( const QString &  uri,
int  componentId = MAV_COMP_ID_AUTOPILOT1 
)

Definition at line 149 of file FTPController.cc.

References deleteComplete(), FTPManager::deleteFile(), and error.

◆ deleteInProgress()

bool FTPController::deleteInProgress ( ) const
inline

Definition at line 48 of file FTPController.h.

◆ directoryEntries()

QStringList FTPController::directoryEntries ( ) const
inline

Definition at line 52 of file FTPController.h.

◆ directoryEntriesChanged

void FTPController::directoryEntriesChanged ( )
signal

◆ downloadComplete

void FTPController::downloadComplete ( const QString &  filePath,
const QString &  error 
)
signal

Referenced by downloadFile(), and FTPController().

◆ downloadFile()

bool FTPController::downloadFile ( const QString &  uri,
const QString &  localDir,
const QString &  fileName = QString(),
int  componentId = MAV_COMP_ID_AUTOPILOT1 
)

◆ downloadInProgress()

bool FTPController::downloadInProgress ( ) const
inline

Definition at line 46 of file FTPController.h.

◆ errorString()

QString FTPController::errorString ( ) const
inline

Definition at line 50 of file FTPController.h.

◆ errorStringChanged

void FTPController::errorStringChanged ( )
signal

◆ extractArchive()

bool FTPController::extractArchive ( const QString &  archivePath,
const QString &  outputDir = QString() 
)

Extract a downloaded archive to the specified directory

Parameters
archivePathPath to the archive file
outputDirDirectory to extract to (empty = same as archive location)
Returns
true if extraction started successfully

Definition at line 371 of file FTPController.cc.

References QGCFileHelper::ensureDirectoryExists(), QGCCompressionJob::extractArchive(), extractingChanged(), extractionProgressChanged(), QGCCompressionJob::finished(), and QGCCompressionJob::progressChanged().

◆ extracting()

bool FTPController::extracting ( ) const
inline

Definition at line 56 of file FTPController.h.

◆ extractingChanged

void FTPController::extractingChanged ( )
signal

Referenced by extractArchive().

◆ extractionComplete

void FTPController::extractionComplete ( const QString &  outputDir,
const QString &  error 
)
signal

◆ extractionProgress()

float FTPController::extractionProgress ( ) const
inline

Definition at line 57 of file FTPController.h.

◆ extractionProgressChanged

void FTPController::extractionProgressChanged ( )
signal

Referenced by extractArchive().

◆ lastDownloadFile()

QString FTPController::lastDownloadFile ( ) const
inline

Definition at line 53 of file FTPController.h.

◆ lastDownloadFileChanged

void FTPController::lastDownloadFileChanged ( )
signal

Referenced by downloadFile().

◆ lastDownloadIsArchive()

bool FTPController::lastDownloadIsArchive ( ) const
inline

Definition at line 55 of file FTPController.h.

◆ lastUploadTarget()

QString FTPController::lastUploadTarget ( ) const
inline

Definition at line 54 of file FTPController.h.

◆ lastUploadTargetChanged

void FTPController::lastUploadTargetChanged ( )
signal

Referenced by uploadFile().

◆ listDirectory()

bool FTPController::listDirectory ( const QString &  uri,
int  componentId = MAV_COMP_ID_AUTOPILOT1 
)

◆ listInProgress()

bool FTPController::listInProgress ( ) const
inline

Definition at line 45 of file FTPController.h.

◆ progress()

float FTPController::progress ( ) const
inline

Definition at line 49 of file FTPController.h.

◆ progressChanged

void FTPController::progressChanged ( )
signal

◆ uploadComplete

void FTPController::uploadComplete ( const QString &  remotePath,
const QString &  error 
)
signal

Referenced by FTPController(), and uploadFile().

◆ uploadFile()

bool FTPController::uploadFile ( const QString &  localFile,
const QString &  uri,
int  componentId = MAV_COMP_ID_AUTOPILOT1 
)

◆ uploadInProgress()

bool FTPController::uploadInProgress ( ) const
inline

Definition at line 47 of file FTPController.h.


The documentation for this class was generated from the following files: