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

8
src/uas/FileManager.h

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

Loading…
Cancel
Save