Browse Source

Rebase to master, fix merge problems

QGC4.4
Don Gagne 10 years ago
parent
commit
e4434dc925
  1. 6
      src/uas/FileManager.cc
  2. 8
      src/uas/FileManager.h

6
src/uas/FileManager.cc

@ -379,7 +379,7 @@ void FileManager::receiveMessage(LinkInterface* link, mavlink_message_t message) @@ -379,7 +379,7 @@ void FileManager::receiveMessage(LinkInterface* link, mavlink_message_t message)
// This is not an error, just the end of the download loop
_closeDownloadSession(true /* success */);
return;
} else if (previousOperation == kCOCreate) {
} else if (request->hdr.req_opcode == kCmdCreateFile) {
// End a failed create file operation
_sendTerminateCommand();
_emitErrorMessage(tr("Nak received creating file, error: %1").arg(errorString(request->data[0])));
@ -614,14 +614,14 @@ void FileManager::_ackTimeout(void) @@ -614,14 +614,14 @@ void FileManager::_ackTimeout(void)
case kCOCreate:
_currentOperation = kCOAck;
_writeFileAccumulator.clear();
_emitErrorMessage(tr("Timeout waiting for ack: Sending Create command"));
_emitErrorMessage(tr("Timeout waiting for ack: Sending Terminate command"));
_sendTerminateCommand();
break;
case kCOWrite:
_currentOperation = kCOAck;
_writeFileAccumulator.clear();
_emitErrorMessage(tr("Timeout waiting for ack: Sending Write command"));
_emitErrorMessage(tr("Timeout waiting for ack: Sending Terminate command"));
_sendTerminateCommand();
break;

8
src/uas/FileManager.h

@ -61,6 +61,10 @@ public: @@ -61,6 +61,10 @@ public:
/// @param dirPath Fully qualified path to list
void listDirectory(const QString& dirPath);
/// Upload the specified file to the specified location
void uploadPath(const QString& toPath, const QFileInfo& uploadFile);
signals:
/// @brief Signalled whenever an error occurs during the listDirectory or downloadPath methods.
void errorMessage(const QString& msg);
@ -97,9 +101,6 @@ signals: @@ -97,9 +101,6 @@ signals:
public slots:
void receiveMessage(LinkInterface* link, mavlink_message_t message);
void listDirectory(const QString& dirPath);
void downloadPath(const QString& from, const QDir& downloadDir);
void uploadPath(const QString& toPath, const QFileInfo& uploadFile);
private slots:
void _ackTimeout(void);
@ -188,6 +189,7 @@ private: @@ -188,6 +189,7 @@ private:
kCORead, // waiting for Read response
kCOBurst, // waiting for Burst response
kCOWrite, // waiting for Write response
kCOCreate, // waiting for Create response
};
bool _sendOpcodeOnlyCmd(uint8_t opcode, OperationState newOpState);

Loading…
Cancel
Save