Partialreadout (#47)

* eiger server, rxr: partial readout, also gui messages: up last command, down clear command

* added binaries and resolved conflict

* bugfix eiger server: interrupt subframe is bit 2 and not bit number 3

* brackets in defs
This commit is contained in:
Dhanya Thattil
2019-08-07 09:08:58 +02:00
committed by GitHub
parent e20b5e6952
commit 98ddf154b2
28 changed files with 389 additions and 99 deletions

View File

@ -50,6 +50,9 @@
<height>25</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Up arrow key picks up the previous command.&lt;/p&gt;&lt;p&gt;Down arrow key clears the current command.&lt;/p&gt;&lt;p&gt;Return or Enter key executes the current command&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="3">

View File

@ -3,6 +3,7 @@
#include "ui_form_tab_messages.h"
class QProcess;
class QKeyEvent;
class qTabMessages:public QWidget, private Ui::TabMessagesObject {
Q_OBJECT
@ -12,6 +13,9 @@ public:
~qTabMessages();
void Refresh();
protected:
void keyPressEvent(QKeyEvent* event);
private slots:
void ExecuteCommand();
void SaveLog();
@ -21,9 +25,12 @@ private:
void SetupWidgetWindow();
void Initialization();
void PrintNextLine();
void GetLastCommand();
void ClearCommand();
void AppendOutput();
void AppendError();
QProcess* process;
QStringList lastCommand;
};

View File

@ -6,6 +6,7 @@
#include <QTextStream>
#include <QDir>
#include <QProcess>
#include <QKeyEvent>
#include <iostream>
#include <string>
@ -26,6 +27,7 @@ void qTabMessages::SetupWidgetWindow() {
process = new QProcess;
process->setWorkingDirectory(QDir::cleanPath(QDir::currentPath()));
PrintNextLine();
lastCommand.clear();
Initialization();
}
@ -36,8 +38,37 @@ void qTabMessages::Initialization() {
connect(dispCommand, SIGNAL(returnPressed()), this, SLOT(ExecuteCommand()));
}
void qTabMessages::keyPressEvent(QKeyEvent* event) {
//cout<<"inside KeyPressEvent()\n";
if (event->key() == Qt::Key_Up) {
GetLastCommand();
}
else if (event->key() == Qt::Key_Down) {
ClearCommand();
}
/* else if((event->key() == Qt::Key_Return) ||(event->key() == Qt::Key_Enter)) {
ExecuteCommand();
}*/ else {
event->ignore();
}
}
void qTabMessages::PrintNextLine() {
dispLog->append(QString("<font color = \"DarkGrey\">") + QDir::current().dirName() + QString("$ ") + QString("</font>"));
}
void qTabMessages::GetLastCommand() {
dispCommand->setText(lastCommand.join(" "));
}
void qTabMessages::ClearCommand() {
dispCommand->setText("");
}
void qTabMessages::ExecuteCommand() {
QStringList param = dispCommand->text().split(" ");
lastCommand.clear();
lastCommand += param;
dispCommand->clear();
// appending command to log without newline
dispLog->moveCursor (QTextCursor::End);
@ -56,10 +87,6 @@ void qTabMessages::ExecuteCommand() {
}
}
void qTabMessages::PrintNextLine() {
dispLog->append(QString("<font color = \"DarkGrey\">") + QDir::current().dirName() + QString("$ ") + QString("</font>"));
}
void qTabMessages::AppendOutput() {
QByteArray result = process->readAll();
result.replace("\n", "<br>");