Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
nebarnix authored Sep 28, 2016
1 parent 773c60b commit 990cd04
Show file tree
Hide file tree
Showing 6 changed files with 744 additions and 0 deletions.
20 changes: 20 additions & 0 deletions TelemExplorer.pro
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
315 changes: 315 additions & 0 deletions TelemExplorer.pro.user

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions main.cpp
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();
}
119 changes: 119 additions & 0 deletions mainwindow.cpp
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));
}
31 changes: 31 additions & 0 deletions mainwindow.h
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
Loading

0 comments on commit 990cd04

Please sign in to comment.