mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
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:
@ -50,6 +50,9 @@
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Up arrow key picks up the previous command.</p><p>Down arrow key clears the current command.</p><p>Return or Enter key executes the current command</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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>");
|
||||
|
Reference in New Issue
Block a user