-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
744 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#------------------------------------------------- | ||
# | ||
# Project created by QtCreator 2016-09-28T19:21:30 | ||
# | ||
#------------------------------------------------- | ||
|
||
QT += core gui | ||
|
||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets | ||
|
||
TARGET = TelemExplorer | ||
TEMPLATE = app | ||
|
||
|
||
SOURCES += main.cpp\ | ||
mainwindow.cpp | ||
|
||
HEADERS += mainwindow.h | ||
|
||
FORMS += mainwindow.ui |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "mainwindow.h" | ||
#include <QApplication> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
QApplication a(argc, argv); | ||
MainWindow w; | ||
w.show(); | ||
|
||
return a.exec(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
#include "mainwindow.h" | ||
#include "ui_mainwindow.h" | ||
|
||
MainWindow::MainWindow(QWidget *parent) : | ||
QMainWindow(parent), | ||
ui(new Ui::MainWindow) | ||
{ | ||
ui->setupUi(this); | ||
|
||
QFont font("Monospace"); | ||
font.setStyleHint(QFont::TypeWriter); | ||
ui->minorFrameBrowser->setFont(font); | ||
|
||
connect(ui->actionLoad, SIGNAL(triggered()), this, SLOT(open())); | ||
connect(ui->treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this,SLOT(updateViewOnTreeClick(QTreeWidgetItem*,int))); | ||
} | ||
|
||
MainWindow::~MainWindow() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void MainWindow::open() | ||
{ | ||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "", | ||
tr("Text Files (*.txt)")); | ||
|
||
if (fileName != "") { | ||
QFile file(fileName); | ||
if (!file.open(QIODevice::ReadOnly)) { | ||
QMessageBox::critical(this, tr("Error"), tr("Could not open file")); | ||
return; | ||
} | ||
QTextStream in(&file); | ||
//QTextStream textStream(&textFile); | ||
while (true) | ||
{ | ||
QString line = in.readLine(); | ||
if (line.isNull()) | ||
break; | ||
else | ||
minorFramesHex.append(line); | ||
} | ||
ui->minorFrameBrowser->setPlainText(minorFramesHex.join('\n')); | ||
file.close(); | ||
} | ||
} | ||
|
||
void MainWindow::updateViewOnTreeClick(QTreeWidgetItem *item, int column) | ||
{ | ||
QStringList myOptions; | ||
myOptions << "Duration" << "Raw Hex Frames" << "Number of Frames" <<\ | ||
"Parity Check" << "Spacecraft ID" << "Timestamps" <<\ | ||
"HIRS" << "DCS Summary" << "Channels" << "All" << "Telemetry" <<\ | ||
"DCS" << "DCS Summary" << "CPU" << "CPU A" << "CPU B" <<\ | ||
"SEM" << "MEPED" << "TED"; | ||
|
||
switch(myOptions.indexOf(item->text(0))) | ||
{ | ||
case 0: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 1: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 2: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 3: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 4: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 5: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 6: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 7: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 8: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 9: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 10: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 11: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 12: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 13: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 14: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 15: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 16: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 17: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
case 18: | ||
ui->groupBox->setTitle(item->text(0)); | ||
break; | ||
} | ||
//ui->textBrowser->setText(item->text(0)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef MAINWINDOW_H | ||
#define MAINWINDOW_H | ||
|
||
#include <QMainWindow> | ||
#include <QFileDialog> | ||
#include <QMessageBox> | ||
#include <QTextStream> | ||
#include <QTreeWidgetItem> | ||
|
||
namespace Ui { | ||
class MainWindow; | ||
} | ||
|
||
class MainWindow : public QMainWindow | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit MainWindow(QWidget *parent = 0); | ||
~MainWindow(); | ||
|
||
private slots: | ||
void open(); | ||
void updateViewOnTreeClick(QTreeWidgetItem *item, int column); | ||
//void QTreeWidget::itemDoubleClicked(QTreeWidgetItem *item, int column) | ||
private: | ||
Ui::MainWindow *ui; | ||
QStringList minorFramesHex; | ||
}; | ||
|
||
#endif // MAINWINDOW_H |
Oops, something went wrong.